Fatal error

General support regarding TimeTrex, such as
configuring policies/taxes or processing payroll.
Locked
aladdin
Posts: 2
Joined: Thu Feb 01, 2007 2:44 am

Fatal error

Post by aladdin »

Could you help me in this problem please :

Fatal error: Call to a member function getRecordCount() on a non-object in C:\Program Files\xampp\htdocs\timetrex\interface\payperiod\ClosePayPeriod.php on line 158
shaunw
Posts: 7839
Joined: Tue Sep 19, 2006 2:22 pm

Post by shaunw »

Please follow these instructions: http://forums.timetrex.com/viewtopic.php?t=89
rgaborko
Posts: 21
Joined: Thu Jan 25, 2007 10:23 am

Post by rgaborko »

I have the same error Shaun and here is the output

Code: Select all

(postgres7): select session_id,user_id,ip_address,created_date,updated_date from authentication WHERE session_id = ? AND ip_address = ? AND updated_date >= ?   [ (session_id=>'0b88045176b4b6c23f90902a486544c6') (ip_address=>'10.253.8.2') (updated_date=>'1170340957') ] (postgres7): update authentication set updated_date = ? where session_id = ?   [ (updated_date=>'1170355357') (session_id=>'0b88045176b4b6c23f90902a486544c6') ] (postgres7): select * from station where company_id = ? AND station_id = ? AND deleted = 0   [ (company_id=>'1') (station_id=>'7796b8d9807cbf41e570d5d490ce0c19') ] (postgres7): select * from cron WHERE deleted = 0 ORDER BY last_run_date DESC LIMIT 1   (postgres7): SELECT count(*) FROM message as a LEFT JOIN users as d ON a.object_type_id = 5 AND a.object_id = d.id LEFT JOIN request as b ON a.object_type_id = 50 AND a.object_id = b.id AND b.deleted=0 LEFT JOIN user_date as c ON b.user_date_id = c.id AND c.deleted = 0 WHERE a.object_type_id in (5,50) AND a.status_id = 10 AND ( ( c.user_id = ? OR d.id = ? OR a.parent_id in ( select parent_id FROM message WHERE created_by = ? AND parent_id != 0 ) OR a.parent_id in ( select id FROM message WHERE created_by = ? AND parent_id = 0 ) ) AND a.created_by != ? ) AND a.deleted = 0   [ (user_id=>'1') (id=>'1') (created_by1=>'1') (created_by2=>'1') (created_by3=>'1') ] (postgres7): select d.severity_id as severity_id, count(*) as count from exception as a LEFT JOIN user_date as b ON a.user_date_id = b.id LEFT JOIN users as c ON b.user_id = c.id LEFT JOIN exception_policy as d ON a.exception_policy_id = d.id LEFT JOIN pay_period as e ON b.pay_period_id = e.id where b.user_id = ? AND b.date_stamp < ? AND e.status_id = ? AND NOT EXISTS ( select z.id from request as z where z.user_date_id = a.user_date_id AND z.status_id = 30 ) AND ( a.deleted = 0 AND b.deleted = 0 AND e.deleted=0) GROUP BY d.severity_id ORDER BY d.severity_id desc   [ (user_id=>'1') (date_stamp=>'2007-02-01 00:00:00 EST') (status_id=>'10') ] (postgres7): select * from permission where company_id = ? AND user_id in (-1, ? ) AND deleted = 0 ORDER BY company_id ASC, user_id ASC   [ (company_id=>'1') (user_id=>'1') ] (postgres7): select name FROM bread_crumb WHERE user_id = ? AND name = ? LIMIT 1   [ (user_id=>'1') (name=>'End of Pay Period') ] (postgres7): UPDATE bread_crumb SET url = ?, created_date = ? WHERE user_id = ? AND name = ?   [ (url=>'/timetrex/interface/payperiod/ClosePayPeriod.php') (created_date=>'1170355357') (user_id=>'1') (name=>'End of Pay Period') ]  /tmp/timetrex//b6/adodb_b61d53f3c70b70ceab0da0e4584645c5.cache reloaded, ttl=47845 [ select * from pay_period where id = -1 ]
(postgres7): select a.* from pay_period as a, pay_period_schedule as b where a.pay_period_schedule_id = b.id AND a.company_id = ? AND a.status_id in ( ?,?,? ) AND a.deleted=0 AND b.deleted=0 order by a.transaction_date asc   [ (company_id=>'1') (0=>'10') (1=>'12') (2=>'15') ] (postgres7): select * from pay_period_schedule where id = ? AND deleted=0   [ (id=>'1') ] (postgres7): select d.severity_id as severity_id, count(*) as count from exception as a LEFT JOIN user_date as b ON a.user_date_id = b.id LEFT JOIN users as c ON b.user_id = c.id LEFT JOIN exception_policy as d ON a.exception_policy_id = d.id LEFT JOIN pay_period as e ON b.pay_period_id = e.id where e.id = ? AND b.date_stamp <= ? AND ( a.deleted = 0 AND b.deleted = 0 AND e.deleted=0) GROUP BY d.severity_id ORDER BY d.severity_id desc   [ (pay_period_id=>'1') (date_stamp=>'2007-01-14 00:00:00 EST') ] (postgres7): select count(*) from request as a, user_date as b where a.user_date_id = b.id AND b.pay_period_id = ? AND a.status_id = ? AND ( a.deleted=0 AND b.deleted=0 )   [ (pay_period_id=>'1') (status_id=>'30') ] /tmp/timetrex//cc/adodb_ccc1c112a0091c13866f2250c4476ee9.cache reloaded, ttl=47845 [ select * from pay_period_schedule_user where id = -1 ]
(postgres7): select a.* from pay_period_schedule_user as a, pay_period_schedule as b where b.id = a.pay_period_schedule_id AND pay_period_schedule_id = ? order by a.user_id asc   [ (id=>'1') ]
Fatal error: Call to a member function getRecordCount() on a non-object in /var/www/data/timetrex/interface/payperiod/ClosePayPeriod.php on line 158

The Fatal error is from php not from the timetrex debugging

Regards,
Rob G
shaunw
Posts: 7839
Joined: Tue Sep 19, 2006 2:22 pm

Post by shaunw »

Please provide information about your install, such as TimeTrex version, operating system, PHP version etc...
rgaborko
Posts: 21
Joined: Thu Jan 25, 2007 10:23 am

Post by rgaborko »

Timetrex Version 1.4.2
OS - CentOS 4.4
Apache - Server version: Apache/2.0.52
PHP 5.1.6 (cli)
psql (PostgreSQL) 8.1.4
contains support for command-line editing

Regards,
Rob G
shaunw
Posts: 7839
Joined: Tue Sep 19, 2006 2:22 pm

Post by shaunw »

What pay period schedule(s) do you have setup, and what pay periods are in the system?
rgaborko
Posts: 21
Joined: Thu Jan 25, 2007 10:23 am

Post by rgaborko »

This is the only pay period that is setup to run:


1 Test Pay Period Bi-Weekly N/A 28-Jan-07 12:00 AM 10-Feb-07 11:59 PM 10-Feb-07 11:59 PM

2 Test Pay Period Bi-Weekly OPEN 21-Jan-07 12:00 AM 27-Jan-07 11:59 PM 01-Feb-07 11:59 PM

We have two other pay periods configured but have no one assigned to them at this point. One for management and one for non management

Regards
Rob G
mikeb
Posts: 709
Joined: Thu Jul 27, 2006 11:58 am

Post by mikeb »

Replace lines 157 and 158 in interface/payperiod/ClosePayPeriod.php with this code.

Code: Select all

					//Get PS Amendments.
					$psalf = new PayStubAmendmentListFactory();
					$psalf->getByUserIdAndAuthorizedAndStartDateAndEndDate( $pay_period_schedule->getUser(), TRUE, $pay_period_obj->getStartDate(), $pay_period_obj->getEndDate() );
					$total_ps_amendments = 0;
					if ( is_object($psalf) ) {
						$total_ps_amendments = $psalf->getRecordCount();
					}
Let us know how that works for you.
TimeTrex Community Edition is developed and supported by volunteers.
Help motivate us to continue by showing your appreciation!
rgaborko
Posts: 21
Joined: Thu Jan 25, 2007 10:23 am

Post by rgaborko »

This has allowed that page to load. I will get the manager that is fronting this to work with it and see if everything is working.

Thank You
Rob G
Locked