Time Accounting Management Software, or TAMS, is a PHP/PostgreSQL based time tracking, billing, and accounting package. This is useful for independent contractors, or consulting companies to track the time they spend on individual projects, bill accordin
Be the first to post a text review of Time Accounting Management Software. Rate and review a project by clicking thumbs up or thumbs down in the right column.
Fixed 2 bugs which would cause createinvoice.php to bomb. Here is the unified diff. =================================================================== RCS file: /cvsroot/tams/tams/createinvoice.php,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- tams/tams/createinvoice.php2001/08/16 15:11:041.1 +++ tams/tams/createinvoice.php2002/03/21 14:12:391.2 @@ -74,7 +74,11 @@ } function do_step2() { -global $dbase_host, $dbase_port, $dbase_dbname, $dbase_user, $dbase_password, $customerid; +global $dbase_host, $dbase_port, $dbase_dbname, $dbase_user, $dbase_password, $customerid, $HTTP_PREFIX; + +if (strlen($customerid) == 0) { +header("Location: ". $HTTP_PREFIX . "ticket.brw.net/createinvoice.php"); +} $conn = pg_pconnect("host=$dbase_host port=$dbase_port dbname=$dbase_dbname user=$dbase_user password=$dbase_password"); if (!$conn) { @@ -156,7 +160,11 @@ exit; } $result = pg_exec($conn, "SELECT ((select sum(qty * unitprice) from tempinvoice where sessionid = '$PHPSESSID') + (select coalesce(sum(qty * unitprice * .0825),0) from tempinvoice where sessionid = '$PHPSESSID' AND taxable = 't')) as currentTotal FROM tempinvoice WHERE sessionid = '$PHPSESSID'"); -$currentTotal = number_format(pg_result($result,0,"currentTotal"),2); +if (pg_numrows != 0 ) { +$currentTotal = number_format(pg_result($result,0,"currentTotal"),2); +} else { +$currentTotal = number_format(0,2); +} ?> <a href="createinvoice.php">Start Over</a> @@ -289,10 +297,10 @@ $result = pg_Exec ($conn, "SELECT * from customer where customerid = $customerid;"); $row = pg_fetch_object($result,0); -$company_name = $row->company_name; -$address1 = $row->address1; -$address2 = $row->address2; -$city = $row->city; +$company_name = ereg_replace("\'","\\'",$row->company_name); +$address1 = ereg_replace("\'","\\'",$row->address1); +$address2 = ereg_replace("\'","\\'",$row->address2); +$city = ereg_replace("\'","\\'",$row->city); $state = $row->state; $zip = $row->zip; $email = $row->email; @@ -316,7 +324,7 @@ pg_Exec($conn, "DELETE FROM ticketstobill WHERE sessionid = '$PHPSESSID'"); pg_close($conn); -//Header("Location: ". $HTTP_PREFIX . "ticket.brw.net/listinvoice.php?nextstep=3&customerid=$customerid&invoicenumber=$invoicenumber&PHPSESSID=".$PHPSESSID); +Header("Location: ". $HTTP_PREFIX . "ticket.brw.net/listinvoice.php?nextstep=3&customerid=$customerid&invoicenumber=$invoicenumber&PHPSESSID=".$PHPSESSID); } function do_add () {
=================================================================== RCS file: /cvsroot/tams/tams/createinvoice.php,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- tams/tams/createinvoice.php2001/08/16 15:11:041.1 +++ tams/tams/createinvoice.php2002/03/21 14:12:391.2 @@ -74,7 +74,11 @@ } function do_step2() { -global $dbase_host, $dbase_port, $dbase_dbname, $dbase_user, $dbase_password, $customerid; +global $dbase_host, $dbase_port, $dbase_dbname, $dbase_user, $dbase_password, $customerid, $HTTP_PREFIX; + +if (strlen($customerid) == 0) { +header("Location: ". $HTTP_PREFIX . "ticket.brw.net/createinvoice.php"); +} $conn = pg_pconnect("host=$dbase_host port=$dbase_port dbname=$dbase_dbname user=$dbase_user password=$dbase_password"); if (!$conn) { @@ -156,7 +160,11 @@ exit; } $result = pg_exec($conn, "SELECT ((select sum(qty * unitprice) from tempinvoice where sessionid = '$PHPSESSID') + (select coalesce(sum(qty * unitprice * .0825),0) from tempinvoice where sessionid = '$PHPSESSID' AND taxable = 't')) as currentTotal FROM tempinvoice WHERE sessionid = '$PHPSESSID'"); -$currentTotal = number_format(pg_result($result,0,"currentTotal"),2); +if (pg_numrows != 0 ) { +$currentTotal = number_format(pg_result($result,0,"currentTotal"),2); +} else { +$currentTotal = number_format(0,2); +} ?> <a href="createinvoice.php">Start Over</a> @@ -289,10 +297,10 @@ $result = pg_Exec ($conn, "SELECT * from customer where customerid = $customerid;"); $row = pg_fetch_object($result,0); -$company_name = $row->company_name; -$address1 = $row->address1; -$address2 = $row->address2; -$city = $row->city; +$company_name = ereg_replace("\'","\\'",$row->company_name); +$address1 = ereg_replace("\'","\\'",$row->address1); +$address2 = ereg_replace("\'","\\'",$row->address2); +$city = ereg_replace("\'","\\'",$row->city); $state = $row->state; $zip = $row->zip; $email = $row->email; @@ -316,7 +324,7 @@ pg_Exec($conn, "DELETE FROM ticketstobill WHERE sessionid = '$PHPSESSID'"); pg_close($conn); -//Header("Location: ". $HTTP_PREFIX . "ticket.brw.net/listinvoice.php?nextstep=3&customerid=$customerid&invoicenumber=$invoicenumber&PHPSESSID=".$PHPSESSID); +Header("Location: ". $HTTP_PREFIX . "ticket.brw.net/listinvoice.php?nextstep=3&customerid=$customerid&invoicenumber=$invoicenumber&PHPSESSID=".$PHPSESSID); } function do_add () {
Be the first person to add a text review.
Copyright © 2009 Geeknet, Inc. All rights reserved. Terms of Use
Thanks for your rating!
Would you also like to write a review?