[Astpp-commit] SF.net SVN: astpp:[2197] trunk
Brought to you by:
darrenkw
From: <dar...@us...> - 2008-09-06 16:54:55
|
Revision: 2197 http://astpp.svn.sourceforge.net/astpp/?rev=2197&view=rev Author: darrenkw Date: 2008-09-06 16:55:06 +0000 (Sat, 06 Sep 2008) Log Message: ----------- Fix a bug in the "by cdr date" invoice generation code. Modified Paths: -------------- trunk/astpp-common.pl trunk/astpp-generate-invoices.pl Modified: trunk/astpp-common.pl =================================================================== --- trunk/astpp-common.pl 2008-09-04 00:06:13 UTC (rev 2196) +++ trunk/astpp-common.pl 2008-09-06 16:55:06 UTC (rev 2197) @@ -4294,7 +4294,6 @@ $sql->execute; $row = $sql->fetchrow_hashref; $sql->finish; - if ($row->{customers_username}) { $tmp = "SELECT * FROM `customers` WHERE `customers_username` = " . $osc_db->quote($account); @@ -4307,7 +4306,6 @@ print STDERR "OSCommerce Account: $row->{customers_id}"; return (1,$row); } - } else { print STDERR "OSCommerce Account: $account NOT FOUND!!!\n"; return (0,""); @@ -4521,7 +4519,7 @@ if ($invoice_id) { if ($params->{startdate} && $params->{enddate}) { $tmp = - "SELECT COUNT(*) FROM cdrs WHERE cardnum = " + "SELECT * FROM cdrs WHERE cardnum = " . $astpp_db->quote($account) . " AND status = 0" . " AND callstart >= DATE(" . $astpp_db->quote($params->{startdate}) . ")" @@ -4529,25 +4527,26 @@ . " ORDER BY callstart"; } elsif ($params->{startdate}) { $tmp = - "SELECT COUNT(*) FROM cdrs WHERE cardnum = " + "SELECT * FROM cdrs WHERE cardnum = " . $astpp_db->quote($account) . " AND status = 0" . " AND callstart >= DATE(" . $astpp_db->quote($params->{startdate}) . ")" . " ORDER BY callstart"; } elsif ($params->{enddate}) { $tmp = - "SELECT COUNT(*) FROM cdrs WHERE cardnum = " + "SELECT * FROM cdrs WHERE cardnum = " . $astpp_db->quote($account) . " AND status = 0" . " AND callstart <= DATE(" . $astpp_db->quote($params->{enddate}) . ")" . " ORDER BY callstart"; } else { $tmp = - "SELECT COUNT(*) FROM cdrs WHERE cardnum = " + "SELECT * FROM cdrs WHERE cardnum = " . $astpp_db->quote($account) . " AND status = 0" . " ORDER BY callstart"; } + print STDERR $tmp; $sql = $astpp_db->prepare($tmp); $sql->execute; while ( $row = $sql->fetchrow_hashref ) { Modified: trunk/astpp-generate-invoices.pl =================================================================== --- trunk/astpp-generate-invoices.pl 2008-09-04 00:06:13 UTC (rev 2196) +++ trunk/astpp-generate-invoices.pl 2008-09-06 16:55:06 UTC (rev 2197) @@ -80,7 +80,7 @@ foreach my $handle (@output) { print $handle "Card: $cardno \n"; } - &osc_charges($astpp_db, $osc_db, $config, $cardno); + &osc_charges($astpp_db, $osc_db, $config, $cardno,$params); } } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |