TimeTrex Time and Attendance
http://forums.timetrex.com/

How to add the employee id number to the pdf paystub
http://forums.timetrex.com/viewtopic.php?f=5&t=723
Page 1 of 1

Author:  sgrizzard [ Wed Mar 19, 2008 2:47 pm ]
Post subject:  How to add the employee id number to the pdf paystub

I had to add the employee id number (the one assigned by the hr department) to the pdf paystub. I hope this helps if you need to do it.

Edition: Standard Edition
Version: 2.2.8

The goal is to put the employee number on the pay stub below the Net Pay, and above the Identification #, in the same font as the Identification #.

edit the file /classes/modules/pay_stub/PayStubFactory.class.php

Head to the bottom of the getPayStub function. On or about line 2925, you should see:
Code:
$pdf->SetFont('','',8);
$pdf->setXY( Misc::AdjustXY(125, $adjust_x), Misc::AdjustXY($block_adjust_y+30, $adjust_y) );
$pdf->Cell(50, 5, TTi18n::gettext('Identification #:').' '. str_pad($pay_stub_obj->getId(),12,0, STR_PAD_LEFT).$tainted_flag, $border, 1, 'L', 0);
unset($net_pay_amount, $tainted_flag);

This code adds the Identification Number to the paystub. Change to the following:
Code:
$pdf->SetFont('','',8);
$pdf->setXY( Misc::AdjustXY(125, $adjust_x), Misc::AdjustXY($block_adjust_y+27, $adjust_y) );
$pdf->Cell(50, 5, TTi18n::gettext('Employee ID') . ': ' . $user_obj->getEmployeeNumber(), $border, 1, 'L', 0);
$pdf->setXY( Misc::AdjustXY(125, $adjust_x), Misc::AdjustXY($block_adjust_y+30, $adjust_y) );
$pdf->Cell(50, 5, TTi18n::gettext('Identification #:').' '. str_pad($pay_stub_obj->getId(),12,0, STR_PAD_LEFT).$tainted_flag, $border, 1, 'L', 0);
unset($net_pay_amount, $tainted_flag);


The two additional lines add a cell at the specified location above the Identification #, and insert the Employee ID.

Page 1 of 1 All times are UTC - 8 hours [ DST ]
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/