Blank Page When Adding Employee Bank info

General support regarding TimeTrex, such as
configuring policies/taxes or processing payroll.
Locked
rons
Posts: 52
Joined: Fri Jul 06, 2007 11:24 am

Blank Page When Adding Employee Bank info

Post by rons »

When trying to add an employee's bank info, I get the form to add the routing and bank account info but when I submit it the page is blank. I enabled php error logging in the php.ini file and this is the error:
Jul 9 16:11:28 swiftubuntu apache2: PHP Fatal error: Uncaught exception 'ADODB_Exception' with message 'postgres7 error: [-1: ERROR: current transaction is aborted, commands ignored until end of transaction block] in adodb_throw(CREATE SEQUENCE system_log_id_seq START 1, ) ' in /home/swiftbo/public_html/TimeTrex/classes/adodb/adodb-exceptions.inc.php:78 Stack trace: #0 /home/swiftbo/public_html/TimeTrex/classes/adodb/adodb.inc.php(221): adodb_throw('postgres7', 'adodb_throw', -1, 'ERROR: current...', 'CREATE SEQUENCE...', false
I am using TimeTrex version 2.0.1 on ubuntu server with apache2 and postgresql 8 database.
shaunw
Posts: 7839
Joined: Tue Sep 19, 2006 2:22 pm

Post by shaunw »

Can you please go the Bank Account page, and before you press submit, edit your timetrex.ini.php and enable debugging, and set the verbosity to 11, then press Submit and paste the output here.

Once you are done you can disable debugging again to continue to use TimeTrex.
rons
Posts: 52
Joined: Fri Jul 06, 2007 11:24 am

Blank Page When Adding Employee Bank info

Post by rons »

Here is the output:
(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=>'a463c19c0d30225c7d979d053727da6e') (ip_address=>'192.168.0.213') (updated_date=>'1184001624') ] (postgres7): update authentication set updated_date = ? where session_id = ? [ (updated_date=>'1184016024') (session_id=>'a463c19c0d30225c7d979d053727da6e') ] (postgres7): select * from station where company_id = ? AND station_id = ? AND deleted = 0 [ (company_id=>'1') (station_id=>'6fee96a6a6077e63e5be993ef1615e98') ] (postgres7): select * from cron WHERE deleted = 0 ORDER BY last_run_date DESC LIMIT 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-07-09') (status_id=>'10') ] (postgres7): SELECT NEXTVAL('bank_account_id_seq') /tmp/timetrex//ec/adodb_ec7536c947a2147056b7601b547206ff.cache reloaded, ttl=81019 [ select company_id,user_id,transit,account,created_date,created_by,updated_date,updated_by,id from bank_account where id = -1 ]
(postgres7): INSERT INTO bank_account ( COMPANY_ID, USER_ID, TRANSIT, ACCOUNT, CREATED_DATE, CREATED_BY, UPDATED_DATE, UPDATED_BY, ID ) VALUES ( 1, 1, '123123123', '123123123', 1184016024, 1, 1184016024, 1, 6 ) -1: ERROR: null value in column "institution" violates not-null constraint

ADOConnection._Execute(INSERT INTO bank_account ( COMPANY_ID, USER_ID, TRANSIT, ACCOUNT, CREATED_DATE, CREATED_BY, UPDATED_DATE, UPDATED_BY, ID ) VALUE..., false) % line 861, file: adodb.inc.php
ADOConnection.Execute(INSERT INTO bank_account ( COMPANY_ID, USER_ID, TRANSIT, ACCOUNT, CREATED_DATE, CREATED_BY, UPDATED_DATE, UPDATED_BY, ID ) VALUE...) % line 823, file: Factory.class.php
Factory.Save() % line 117, file: EditBankAccount.php

(postgres7): SELECT NEXTVAL('system_log_id_seq') -1: ERROR: current transaction is aborted, commands ignored until end of transaction block

ADOConnection._Execute(SELECT NEXTVAL('system_log_id_seq'), false) % line 861, file: adodb.inc.php
ADOConnection.Execute(SELECT NEXTVAL('system_log_id_seq')) % line 949, file: adodb.inc.php
ADOConnection.GenID(system_log_id_seq) % line 745, file: Factory.class.php
Factory.getNextInsertId() % line 785, file: Factory.class.php
Factory.Save() % line 60, file: TTLog.class.php

(postgres7): CREATE SEQUENCE system_log_id_seq START 1 -1: ERROR: current transaction is aborted, commands ignored until end of transaction block

ADOConnection._Execute(CREATE SEQUENCE system_log_id_seq START 1, false) % line 861, file: adodb.inc.php
ADOConnection.Execute(CREATE SEQUENCE system_log_id_seq START 1) % line 954, file: adodb.inc.php
ADOConnection.GenID(system_log_id_seq) % line 745, file: Factory.class.php
Factory.getNextInsertId() % line 785, file: Factory.class.php
Factory.Save() % line 60, file: TTLog.class.php
shaunw
Posts: 7839
Joined: Tue Sep 19, 2006 2:22 pm

Post by shaunw »

Edit classes/modules/users/BankAccountFactory.class.php

and near the bottom in the preSave() function, right above : return TRUE, add:

Code: Select all

if ( $this->getInstitution() == FALSE ) {
			$this->setInstitution( '000' );
}

The final result should look like this:

Code: Select all

	function preSave() {
		if ( $this->getUser() == FALSE ) {
			Debug::Text('Clearing User value, because this is strictly a company record', __FILE__, __LINE__, __METHOD__,10);
			//$this->setUser( 0 ); //COMPANY record.
		}

		if ( $this->getInstitution() == FALSE ) {
			$this->setInstitution( '000' );
		}

		return TRUE;
	}
Locked