Re: Payroll extension for practice

@notrinos: good work.
Attached the same zip file without the MAC OS temp files. Updated file attached in a later post.

Re: Payroll extension for practice

@apmuthu: thanks for your corrections.
maybe someday I'll create another payroll module for more features and hope to receive more advices from you.

Phuong

Re: Payroll extension for practice

I have found an issue with DateTime class when generating payslip and fixed it here.

Change these lines in the payslip_ui.inc from

$emp_id     = $_POST['person_id'];
$from_date     = $_POST['from_date'];
$to_date     = $_POST['to_date'];

to

$emp_id     = $_POST['person_id'];
$from_date     = $_POST['from_date'];
$from_date  = DateTime::createFromFormat("m-d-Y H:i:s", $from_date);
$to_date     = $_POST['to_date'];
$to_date  = DateTime::createFromFormat("m-d-Y H:i:s", $to_date);

Phuong

Re: Payroll extension for practice

@notrinos: Thanks. Fork my GitHub repo and include your extension and update it there and send in a pull request.

Replaced the said lines with:

    $emp_id     = $_POST['person_id'];
    $from_date  = DateTime::createFromFormat("m-d-Y H:i:s", $_POST['from_date']);
    $to_date  = DateTime::createFromFormat("m-d-Y H:i:s", $_POST['to_date']);

Updated your extension and removed whitespaces and attached herein.

Post's attachments

Notrinos_Payroll.zip 41 kb, 12 downloads since 2017-01-16 

You don't have the permssions to download the attachments of this post.

Re: Payroll extension for practice

I installed this extension. It is giving following errors on all pages

Undefined property: sys_prefs::$use_popup_windows in file: D:\xampp\htdocs\boxygen\modules\Payroll\emp_payslip.php at line 24
Call to undefined function user_use_date_picker() in D:\xampp\htdocs\boxygen\modules\Payroll\emp_payslip.php on line 26

www.boxygen.pk

Re: Payroll extension for practice

did you installed on 2.3 @boxygen ? It works with 2.4 only.

Phuong

Re: Payroll extension for practice

Oh yes I installed with 2.3.25.

I think 2.4 doesn't have stable release till now. Shouldn't you have it for 2.3.25 as well?

Regards

www.boxygen.pk

Re: Payroll extension for practice

By the way while installing with 2.4RC1 I am receiving following error.

Package 'Payroll' is incompatible with current application version and cannot be activated. Check Install/Activate page for newer package version.

With 2.3.25 it installed successfully but had problem in accessing pages.

www.boxygen.pk

Re: Payroll extension for practice

boxygen wrote:

By the way while installing with 2.4RC1 I am receiving following error.

Package 'Payroll' is incompatible with current application version and cannot be activated. Check Install/Activate page for newer package version.

With 2.3.25 it installed successfully but had problem in accessing pages.

This solved on post #4

Phuong

Re: Payroll extension for practice

The file includes/packages.inc defines the function check_src_ext_version() and returns tru only if the package version >= application version. Here the latter is the FA version defined in line 9 of version.php as $src_version = "2.4.RC1"; and the former is the Payroll Module version. As your module is not packaged, there is no version number displayed in it's entry in installed_extensions.php file both in the webroot and in the company/#/ folder where you can manually make an entry for the version.

@joe: If no version is present like this for manually installed custom modules, the line 215 in admin/inst_modules.php:

            if (check_value('Active'.$i) && !check_src_ext_version($ext['version']))

can be modified to check the latter condition only if the $ext['version'] is not empty.

36 (edited by notrinos 02/13/2017 08:02:18 am)

Re: Payroll extension for practice

Added time attendance feature and mod payslip calculation based on timesheet DOWNLOAD

Phuong

Re: Payroll extension for practice

Thats great I will test it and will respond.

www.boxygen.pk

Re: Payroll extension for practice

Fixed issue of attendance sheet display. Replace line 61 of inquiry/attendance_sheet.php with:

$cols["<div style='background:#FFCCCC'>".$day->format('d')."</div><p hidden>".$day->format('m')."</p>"] = array('align'=>'center');

Phuong

Re: Payroll extension for practice

Check if the attachment is okay and matches your current repo state.

Post's attachments

Notrinos_Payroll_2017-03-26.zip 52.5 kb, 23 downloads since 2017-03-26 

You don't have the permssions to download the attachments of this post.

Re: Payroll extension for practice

an error is shown as " modules/payroll/employee.php was not found on this server"
all is uploaded, and already in the server.
your guidance is appreciated...

Re: Payroll extension for practice

Ajmal, try to rename folder to payroll instead of Payroll

Phuong

Re: Payroll extension for practice

Reorganized few places in the code and added printable payslip.

DOWNLOAD

Phuong

Re: Payroll extension for practice

Good work

44 (edited by Isatoyin2 08/14/2019 04:35:01 pm)

Re: Payroll extension for practice

Hello all esteem members.

Following the steps on this topic, I have been a able to write and install a module. But when I add update.sql file, I got this errors while re-installing the module again:

(SQL script execution failed in line 2: Erreur de syntaxe près de ') ENGINE=InnoDB' à la ligne 19)
(Status change for some extensions failed.)

I was able to re-install when I commented out as follow:

                 function activate_extension($company, $check_only=true) {
                            global $db_connections;
       
                          // $updates = array( 'update.sql' => array('sharehold'));

                          return $this->update_databases($company, $updates, $check_only);
                   }

-------------------------------------update.sql---------------------

DROP TABLE IF EXISTS `0_shareholder`;
CREATE TABLE IF NOT EXISTS `0_shareholder` (
    `shd_id` int(11) NOT NULL AUTO_INCREMENT,
    `shd_first_name` varchar(100) DEFAULT NULL,
    `shd_last_name` varchar(100) DEFAULT NULL,
    `gender` tinyint(1) NOT NULL DEFAULT '0',
    `shd_address` tinytext,
    `shd_mobile` varchar(30) DEFAULT NULL,
    `shd_email` varchar(100) DEFAULT NULL,
    `shd_birthdate` date NOT NULL,
    `national_id` varchar(100) DEFAULT NULL,
    `passport` varchar(100) DEFAULT NULL,
    `bank_account` varchar(100) DEFAULT NULL,
    `tax_number` varchar(100) DEFAULT NULL,
    `shd_notes` tinytext NOT NULL,
    `shd_hiredate` date DEFAULT NULL,
    `shd_releasedate` date DEFAULT NULL,
    `inactive` tinyint(1) NOT NULL DEFAULT '0',
    PRIMARY KEY (`shd_id`),
) ENGINE=InnoDB;

-----------------------------------------------------------------------

Please help

Re: Payroll extension for practice

The error message pointed out how to solve your problem

SQL script execution failed in line 2: Erreur de syntaxe près de ') ENGINE=InnoDB' à la ligne 19

Please remove the last comma in the SQL script

Phuong

Re: Payroll extension for practice

Problem solved. Thank you