[simpleinvoices commit] r1230 - in trunk: include modules/reports modules/reports/xml

15 views
Skip to first unread message

codesite...@google.com

unread,
Dec 12, 2007, 2:39:01 PM12/12/07
to simpleinv...@googlegroups.com
Author: tentra
Date: Wed Dec 12 11:38:06 2007
New Revision: 1230

Modified:
trunk/include/sql_queries.php
trunk/modules/reports/PHPReportsUtil.php
trunk/modules/reports/database_log.php
trunk/modules/reports/report_biller_by_customer.php
trunk/modules/reports/report_biller_total.php
trunk/modules/reports/report_debtors_aging_total.php
trunk/modules/reports/report_debtors_by_aging.php
trunk/modules/reports/report_debtors_by_amount.php
trunk/modules/reports/report_debtors_owing_by_customer.php
trunk/modules/reports/report_products_sold_by_customer.php
trunk/modules/reports/report_products_sold_total.php
trunk/modules/reports/report_sales_customers_total.php
trunk/modules/reports/report_sales_total.php
trunk/modules/reports/report_tax_total.php
trunk/modules/reports/xml/report_biller_by_customer.xml
trunk/modules/reports/xml/report_biller_total.xml
trunk/modules/reports/xml/report_debtors_aging_total.xml
trunk/modules/reports/xml/report_debtors_by_aging.xml
trunk/modules/reports/xml/report_debtors_by_amount.xml
trunk/modules/reports/xml/report_debtors_owing_by_customer.xml
trunk/modules/reports/xml/report_products_sold_by_customer.xml
trunk/modules/reports/xml/report_products_sold_total.xml
trunk/modules/reports/xml/report_sales_customers_total.xml
trunk/modules/reports/xml/report_sales_total.xml
trunk/modules/reports/xml/report_tax_total.xml

Log:
Adjusting reports to work with PDO and PostgreSQL


Modified: trunk/include/sql_queries.php
==============================================================================
--- trunk/include/sql_queries.php (original)
+++ trunk/include/sql_queries.php Wed Dec 12 11:38:06 2007
@@ -48,13 +48,14 @@

//error_log("Insert_id: ".mysql_insert_id($conn));

+ $last = lastInsertId();
if(LOGGING && (preg_match($pattern,$sqlQuery) == 0)) {
- $sql = "INSERT INTO si_log (timestamp, userid, sqlquerie, last_id)
VALUES (CURRENT_TIMESTAMP , ?, ?, lastval())";
+ $sql = "INSERT INTO si_log (timestamp, userid, sqlquerie, last_id)
VALUES (CURRENT_TIMESTAMP , ?, ?, ?)";
if ($db_server == 'mysql') {
- $sql = "INSERT INTO si_log (id, timestamp, userid, sqlquerie,
last_id) VALUES (NULL, CURRENT_TIMESTAMP , ?, ?, last_insert_id())";
+ $sql = "INSERT INTO si_log (id, timestamp, userid, sqlquerie,
last_id) VALUES (NULL, CURRENT_TIMESTAMP , ?, ?, ?)";
}
$tth = $log_dbh->prepare($sql);
- $tth->execute(array($userid, trim($sqlQuery)));
+ $tth->execute(array($userid, trim($sqlQuery), $last));
$tth = null;
}
return $sth;

Modified: trunk/modules/reports/PHPReportsUtil.php
==============================================================================
--- trunk/modules/reports/PHPReportsUtil.php (original)
+++ trunk/modules/reports/PHPReportsUtil.php Wed Dec 12 11:38:06 2007
@@ -14,6 +14,7 @@
******************************************************************************/
function getPHPReportsIncludePath(){
$ipsep = stristr(PHP_OS,"LINUX")?":":";";
+ $ipsep = stristr(PHP_OS,"DARWIN")?":":$ipsep;

$aPaths = explode($ipsep,ini_get("include_path"));
foreach($aPaths as $sPath)

Modified: trunk/modules/reports/database_log.php
==============================================================================
--- trunk/modules/reports/database_log.php (original)
+++ trunk/modules/reports/database_log.php Wed Dec 12 11:38:06 2007
@@ -18,7 +18,7 @@
}


- $sql = "SELECT * FROM ".TB_PREFIX."log WHERE timestamp BETWEEN :start
AND :end ORDER BY timestamp";
+ $sql = "SELECT * FROM ".TB_PREFIX."log l WHERE l.timestamp
BETWEEN :start AND :end ORDER BY l.timestamp";

$sth = dbQuery($sql, ':start', $startdate, ':end', $enddate);
$sqls = null;
@@ -28,18 +28,20 @@
}


+ $e_startdate = htmlspecialchars($startdate);
+ $e_enddate = htmlspecialchars($enddate);
echo <<<EOD
<div style="text-align:left;">
<form action="index.php?module=reports&view=database_log" method="post">
- <input type="text" class="date-picker" name="startdate" id="date1"
value="$startdate" /><br /><br />
- <input type="text" class="date-picker" name="enddate" id="date1"
value="$enddate" /><br /><br />
+ <input type="text" class="date-picker" name="startdate" id="date1"
value="$e_startdate" /><br /><br />
+ <input type="text" class="date-picker" name="enddate" id="date1"
value="$e_enddate" /><br /><br />
<input type="submit" value="Show">
</form>
EOD;

echo "<br /><b>Invoice created</b><br />";
foreach($sqls as $sql) {
- $pattern = "/.*INSERT INTO si_invoices /i";
+ $pattern = "/.*INSERT\s+INTO\s+si_invoices\s+/im";

if(preg_match($pattern,$sql['sqlquerie'])) {
echo "User $sql[userid] created invoice $sql[last_id] on
$sql[timestamp].<br />";
@@ -48,15 +50,20 @@

echo "<br /><b>Invoice modified</b><br />";
foreach($sqls as $sql) {
- $pattern = "/.*UPDATE si_invoices .* WHERE id [^0-9]*([0-9]+)/i";
+ $pattern = "/.*UPDATE\s+si_invoices\s+SET/im";
if(preg_match($pattern,$sql['sqlquerie'],$match)) {
echo "User $sql[userid] modified invoice $match[1] on
$sql[timestamp].<br />";
}
}

- echo "<br /><b>Payment Process</b><br />";
+ echo "<br /><b>Payment Process</b><br />";
+ global $db_server;
foreach($sqls as $sql) {
- $pattern = "/.*INSERT INTO si_account_payments VALUES \( '', '([0-9]+)', '([0-9]+)',/i";
+ if ($db_server == 'pgsql') {
+ $pattern = "/.*INSERT\s+INTO\s+si_account_payments\s+/im";
+ } else {
+ $pattern = "/.*INSERT\s+INTO\s+si_account_payments\s+/im";
+ }
if(preg_match($pattern,$sql['sqlquerie'],$match)) {
echo "User $sql[userid] processed invoice $match[1] on
$sql[timestamp] with amount $match[2].<br />";
}

Modified: trunk/modules/reports/report_biller_by_customer.php
==============================================================================
--- trunk/modules/reports/report_biller_by_customer.php (original)
+++ trunk/modules/reports/report_biller_by_customer.php Wed Dec 12
11:38:06 2007
@@ -1,14 +1,17 @@
<?php


- //stop the direct browsing to this file - let index.php handle which
files get displayed
- checkLogin();
+ //stop the direct browsing to this file - let index.php handle
which files get displayed
+ checkLogin();

// include the PHPReports classes on the PHP path! configure your
path here
include "./modules/reports/PHPReportMaker.php";
- include "config/config.php";
+ include "./config/config.php";

- $sSQL = "SELECT sum(ii.total) as SUM_TOTAL, b.name as BNAME, c.name
as CNAME
+ $sSQL = "SELECT
+ sum(ii.total) AS sum_total,
+ b.name AS bname,
+ c.name AS cname
FROM ".TB_PREFIX."biller b INNER JOIN
".TB_PREFIX."invoices iv ON (b.id = iv.biller_id) INNER JOIN
".TB_PREFIX."customers c ON (c.id = iv.customer_id) INNER JOIN
@@ -21,12 +24,11 @@
$oRpt->setXML("./modules/reports/xml/report_biller_by_customer.xml");
$oRpt->setUser("$db_user");
$oRpt->setPassword("$db_password");
- $oRpt->setConnection("$db_host");
- $oRpt->setDatabaseInterface("mysql");
+ $oRpt->setDatabaseInterface("pdo");
if ($db_server == 'pgsql') {
- $oRpt->setDatabaseInterface("postgresql");
+ $oRpt->setConnection("pgsql:host=$db_host");
} else {
- $oRpt->setDatabaseInterface("mysql");
+ $oRpt->setConnection("mysql:host=$db_host");
}
$oRpt->setSQL($sSQL);
$oRpt->setDatabase("$db_name");
@@ -37,11 +39,10 @@

ob_end_clean();

-
$pageActive = "reports";

- $smarty->assign('pageActive', $pageActive);
- $smarty->assign('showReport', $showReport);
+ $smarty->assign('pageActive', $pageActive);
+ $smarty->assign('showReport', $showReport);

?>


Modified: trunk/modules/reports/report_biller_total.php
==============================================================================
--- trunk/modules/reports/report_biller_total.php (original)
+++ trunk/modules/reports/report_biller_total.php Wed Dec 12 11:38:06 2007
@@ -4,7 +4,7 @@
// include the PHPReports classes on the PHP path! configure your
path here
include "./modules/reports/PHPReportMaker.php";

- $sSQL = "SELECT b.name, sum(ii.total) as SUM_TOTAL
+ $sSQL = "SELECT b.name, sum(ii.total) AS sum_total
FROM ".TB_PREFIX."biller b INNER JOIN
".TB_PREFIX."invoices iv ON (b.id = iv.biller_id) INNER JOIN
".TB_PREFIX."invoice_items ii ON (ii.invoice_id = iv.id)
@@ -14,11 +14,11 @@
$oRpt->setXML("./modules/reports/xml/report_biller_total.xml");
$oRpt->setUser("$db_user");
$oRpt->setPassword("$db_password");
- $oRpt->setConnection("$db_host");
+ $oRpt->setDatabaseInterface("pdo");
if ($db_server == 'pgsql') {
- $oRpt->setDatabaseInterface("postgresql");
+ $oRpt->setConnection("pgsql:host=$db_host");
} else {
- $oRpt->setDatabaseInterface("mysql");
+ $oRpt->setConnection("mysql:host=$db_host");
}
$oRpt->setSQL($sSQL);
$oRpt->setDatabase("$db_name");
@@ -31,6 +31,6 @@

$pageActive = "reports";

- $smarty->assign('pageActive', $pageActive);
- $smarty->assign('showReport', $showReport);
+ $smarty->assign('pageActive', $pageActive);
+ $smarty->assign('showReport', $showReport);
?>

Modified: trunk/modules/reports/report_debtors_aging_total.php
==============================================================================
--- trunk/modules/reports/report_debtors_aging_total.php (original)
+++ trunk/modules/reports/report_debtors_aging_total.php Wed Dec 12
11:38:06 2007
@@ -18,18 +18,18 @@

if ($db_server == 'pgsql') {
$sSQL = "SELECT
- sum(coalesce(ii.total, 0)) AS \"INV_TOTAL\",
- sum(coalesce(ap.ac_amount, 0)) AS \"INV_PAID\",
+ sum(coalesce(ii.total, 0)) AS inv_total,
+ sum(coalesce(ap.ac_amount, 0)) AS inv_paid,

sum(coalesce(ii.total, 0)) -
- sum(coalesce(ap.ac_amount, 0)) AS \"INV_OWING\",
+ sum(coalesce(ap.ac_amount, 0)) AS inv_owing,

(CASE WHEN age(iv.date) <= '14 days'::interval THEN '0-14'
WHEN age(iv.date) <= '30 days'::interval THEN '15-30'
WHEN age(iv.date) <= '60 days'::interval THEN '31-60'
WHEN age(iv.date) <= '90 days'::interval THEN '61-90'
ELSE '90+'
- END) AS \"Aging\"
+ END) AS aging

FROM
".TB_PREFIX."invoices iv LEFT JOIN
@@ -40,7 +40,9 @@
FROM ".TB_PREFIX."account_payments p GROUP BY p.ac_inv_id
) ap ON (iv.id = ap.ac_inv_id)
GROUP BY
- \"Aging\";
+ aging
+ORDER BY
+ aging DESC;
";
} else {
$sSQL = "SELECT
@@ -50,30 +52,30 @@
WHEN datediff(now(),date) <= 60 THEN (select IF (
isnull(sum(".TB_PREFIX."invoice_items.total)) , '0',
sum(".TB_PREFIX."invoice_items.total))
from ".TB_PREFIX."invoices,".TB_PREFIX."invoice_items where
datediff(now(),date) <= 60 and datediff(now(),date) > 30
and ".TB_PREFIX."invoice_items.invoice_id = ".TB_PREFIX."invoices.id)
WHEN datediff(now(),date) <= 90 THEN (select IF (
isnull(sum(".TB_PREFIX."invoice_items.total)) , '0',
sum(".TB_PREFIX."invoice_items.total))
from ".TB_PREFIX."invoices,".TB_PREFIX."invoice_items where
datediff(now(),date) <= 90 and datediff(now(),date) > 60
and ".TB_PREFIX."invoice_items.invoice_id = ".TB_PREFIX."invoices.id)
ELSE (select IF (
isnull(sum(".TB_PREFIX."invoice_items.total)) , '0',
sum(".TB_PREFIX."invoice_items.total))
from ".TB_PREFIX."invoices,".TB_PREFIX."invoice_items where
datediff(now(),date) > 90 and ".TB_PREFIX."invoice_items.invoice_id = ".TB_PREFIX."invoices.id)
- END ) as INV_TOTAL,
+ END ) as inv_total,

(CASE WHEN datediff(now(),date) <= 14 THEN (select IF (
isnull(sum(ac_amount)) , '0', sum(ac_amount))
from ".TB_PREFIX."account_payments,".TB_PREFIX."invoices where
datediff(now(),date) <= 14 and ac_inv_id = ".TB_PREFIX."invoices.id)
WHEN datediff(now(),date) <= 30 THEN (select IF (
isnull(sum(ac_amount)) , '0', sum(ac_amount))
from ".TB_PREFIX."account_payments,".TB_PREFIX."invoices where
datediff(now(),date) > 14 and datediff(now(),date) <= 30 and ac_inv_id
= ".TB_PREFIX."invoices.id )
WHEN datediff(now(),date) <= 60 THEN (select IF (
isnull(sum(ac_amount)) , '0', sum(ac_amount))
from ".TB_PREFIX."account_payments,".TB_PREFIX."invoices where
datediff(now(),date) > 30 and datediff(now(),date) <= 60 and ac_inv_id
= ".TB_PREFIX."invoices.id )
WHEN datediff(now(),date) <= 90 THEN (select IF (
isnull(sum(ac_amount)) , '0', sum(ac_amount))
from ".TB_PREFIX."account_payments,".TB_PREFIX."invoices where
datediff(now(),date) > 60 and datediff(now(),date) <= 90 and ac_inv_id
= ".TB_PREFIX."invoices.id )
ELSE (select IF ( isnull(sum(ac_amount)) , '0',
sum(ac_amount))
from ".TB_PREFIX."account_payments,".TB_PREFIX."invoices where
datediff(now(),date) > 90 and ac_inv_id = ".TB_PREFIX."invoices.id )
- END ) as INV_PAID,
+ END ) as inv_paid,

- (select (INV_TOTAL - INV_PAID)) as INV_OWING,
+ (select (INV_TOTAL - INV_PAID)) as inv_owing,

(CASE WHEN datediff(now(),date) <= 14 THEN '0-14'
WHEN datediff(now(),date) <= 30 THEN '15-30'
WHEN datediff(now(),date) <= 60 THEN '31-60'
WHEN datediff(now(),date) <= 90 THEN '61-90'
ELSE '90+'
- END ) as Aging
+ END ) as aging

FROM
".TB_PREFIX."invoices,".TB_PREFIX."account_payments,".TB_PREFIX."invoice_items, ".TB_PREFIX."biller, ".TB_PREFIX."customers
WHERE
".TB_PREFIX."invoice_items.invoice_id = ".TB_PREFIX."invoices.id
GROUP BY
- INV_TOTAL;
+ inv_total;
";
}
$oRpt = new PHPReportMaker();
@@ -81,12 +83,8 @@
$oRpt->setXML("./modules/reports/xml/report_debtors_aging_total.xml");
$oRpt->setUser("$db_user");
$oRpt->setPassword("$db_password");
- $oRpt->setConnection("$db_host");
- if ($db_server == 'pgsql') {
- $oRpt->setDatabaseInterface("postgresql");
- } else {
- $oRpt->setDatabaseInterface("mysql");
- }
+ $oRpt->setDatabaseInterface("pdo");
+ $oRpt->setConnection("$db_server:host=$db_host");
$oRpt->setSQL($sSQL);
$oRpt->setDatabase("$db_name");
ob_start();

Modified: trunk/modules/reports/report_debtors_by_aging.php
==============================================================================
--- trunk/modules/reports/report_debtors_by_aging.php (original)
+++ trunk/modules/reports/report_debtors_by_aging.php Wed Dec 12
11:38:06 2007
@@ -7,21 +7,21 @@
if ($db_server == 'pgsql') {
$sSQL = "SELECT
iv.id,
- b.name AS \"Biller\",
- c.name AS \"Customer\",
+ b.name AS biller,
+ c.name AS customer,

- coalesce(ii.total, 0) AS \"INV_TOTAL\",
- coalesce(ap.total, 0) AS \"INV_PAID\",
- coalesce(ii.total, 0) - coalesce(ap.total, 0) as \"INV_OWING\",
-
- to_char(iv.date,'YYYY-MM-DD') as \"Date\",
- age(iv.date) as \"Age\",
- (CASE WHEN age(iv.date) <= 14 THEN '0-14'
- WHEN age(iv.date) <= 30 THEN '15-30'
- WHEN age(iv.date) <= 60 THEN '31-60'
- WHEN age(iv.date) <= 90 THEN '61-90'
+ coalesce(ii.total, 0) AS inv_total,
+ coalesce(ap.total, 0) AS inv_paid,
+ coalesce(ii.total, 0) - coalesce(ap.total, 0) as inv_owing,
+
+ to_char(iv.date,'YYYY-MM-DD') as date,
+ age(iv.date) as age,
+ (CASE WHEN age(iv.date) <= '14 days'::interval THEN '0-14'
+ WHEN age(iv.date) <= '30 days'::interval THEN '15-30'
+ WHEN age(iv.date) <= '60 days'::interval THEN '31-60'
+ WHEN age(iv.date) <= '90 days'::interval THEN '61-90'
ELSE '90+'
- END) as \"Aging\"
+ END) as aging

FROM
".TB_PREFIX."invoices iv INNER JOIN
@@ -34,24 +34,24 @@
FROM ".TB_PREFIX."account_payments p GROUP BY p.ac_inv_id
) ap ON (iv.id = ap.ac_inv_id)
ORDER BY
- \"Age\" DESC;
+ age DESC;
";
} else {
$sSQL = "SELECT
".TB_PREFIX."invoices.id,
- (select name from ".TB_PREFIX."biller
where ".TB_PREFIX."biller.id = ".TB_PREFIX."invoices.biller_id) as Biller,
- (select name from ".TB_PREFIX."customers
where ".TB_PREFIX."customers.id = ".TB_PREFIX."invoices.customer_id) as Customer,
- (select sum(".TB_PREFIX."invoice_items.total)
from ".TB_PREFIX."invoice_items
WHERE ".TB_PREFIX."invoice_items.invoice_id = ".TB_PREFIX."invoices.id)
as INV_TOTAL,
- (select IF ( isnull(sum(ac_amount)) , '0', sum(ac_amount))
from ".TB_PREFIX."account_payments where ac_inv_id
= ".TB_PREFIX."invoices.id ) as INV_PAID,
- (select (INV_TOTAL - INV_PAID)) as INV_OWING ,
- date_format(date,'%Y-%m-%e') as Date ,
- (select datediff(now(),date)) as Age,
+ (select name from ".TB_PREFIX."biller
where ".TB_PREFIX."biller.id = ".TB_PREFIX."invoices.biller_id) as biller,
+ (select name from ".TB_PREFIX."customers
where ".TB_PREFIX."customers.id = ".TB_PREFIX."invoices.customer_id) as customer,
+ (select sum(".TB_PREFIX."invoice_items.total)
from ".TB_PREFIX."invoice_items
WHERE ".TB_PREFIX."invoice_items.invoice_id = ".TB_PREFIX."invoices.id)
as inv_total,
+ (select IF ( isnull(sum(ac_amount)) , '0', sum(ac_amount))
from ".TB_PREFIX."account_payments where ac_inv_id
= ".TB_PREFIX."invoices.id ) as inv_paid,
+ (select (INV_TOTAL - INV_PAID)) as inv_owing ,
+ date_format(date,'%Y-%m-%e') as date ,
+ (select datediff(now(),date)) as age,
(CASE WHEN datediff(now(),date) <= 14 THEN '0-14'
WHEN datediff(now(),date) <= 30 THEN '15-30'
WHEN datediff(now(),date) <= 60 THEN '31-60'
WHEN datediff(now(),date) <= 90 THEN '61-90'
ELSE '90+'
- END ) as Aging
+ END ) as aging

FROM
".TB_PREFIX."invoices,".TB_PREFIX."account_payments,".TB_PREFIX."invoice_items, ".TB_PREFIX."biller, ".TB_PREFIX."customers
@@ -67,12 +67,8 @@
$oRpt->setXML("./modules/reports/xml/report_debtors_by_aging.xml");
$oRpt->setUser("$db_user");
$oRpt->setPassword("$db_password");
- $oRpt->setConnection("$db_host");
- if ($db_server == 'pgsql') {
- $oRpt->setDatabaseInterface("postgresql");
- } else {
- $oRpt->setDatabaseInterface("mysql");
- }
+ $oRpt->setConnection("$db_server:host=$db_host");
+ $oRpt->setDatabaseInterface("pdo");
$oRpt->setSQL($sSQL);
$oRpt->setDatabase("$db_name");
ob_start();

Modified: trunk/modules/reports/report_debtors_by_amount.php
==============================================================================
--- trunk/modules/reports/report_debtors_by_amount.php (original)
+++ trunk/modules/reports/report_debtors_by_amount.php Wed Dec 12
11:38:06 2007
@@ -7,12 +7,12 @@
if ($db_server == 'pgsql') {
$sSQL = "SELECT
iv.id,
- b.name AS \"Biller\",
- c.name AS \"Customer\",
+ b.name AS biller,
+ c.name AS customer,

- coalesce(ii.total, 0) AS \"INV_TOTAL\",
- coalesce(ap.total, 0) AS \"INV_PAID\",
- coalesce(ii.total, 0) - coalesce(ap.total, 0) AS \"INV_OWING\",
+ coalesce(ii.total, 0) AS inv_total,
+ coalesce(ap.total, 0) AS inv_paid,
+ coalesce(ii.total, 0) - coalesce(ap.total, 0) AS inv_owing,
iv.date
FROM
".TB_PREFIX."invoices iv INNER JOIN
@@ -25,16 +25,16 @@
FROM ".TB_PREFIX."account_payments p GROUP BY p.ac_inv_id
) ap ON (iv.id = ap.ac_inv_id)
ORDER BY
- \"INV_OWING\" DESC;
+ inv_owing DESC;
";
} else {
$sSQL = "SELECT
iv.id,
- (select name from ".TB_PREFIX."biller
where ".TB_PREFIX."biller.id = iv.biller_id) as Biller,
- (select name from ".TB_PREFIX."customers where id =
iv.customer_id) as Customer,
- (select sum(".TB_PREFIX."invoice_items.total)
from ".TB_PREFIX."invoice_items
WHERE ".TB_PREFIX."invoice_items.invoice_id = ".TB_PREFIX."invoices.id)
as INV_TOTAL,
- ( select coalesce ( sum(ac_amount), 0)
from ".TB_PREFIX."account_payments where ac_inv_id
= ".TB_PREFIX."invoices.id ) as INV_PAID,
- (select (INV_TOTAL - INV_PAID)) as INV_OWING ,
+ (select name from ".TB_PREFIX."biller
where ".TB_PREFIX."biller.id = iv.biller_id) as biller,
+ (select name from ".TB_PREFIX."customers where id =
iv.customer_id) as customer,
+ (select sum(".TB_PREFIX."invoice_items.total)
from ".TB_PREFIX."invoice_items
WHERE ".TB_PREFIX."invoice_items.invoice_id = ".TB_PREFIX."invoices.id)
as inv_total,
+ ( select coalesce ( sum(ac_amount), 0)
from ".TB_PREFIX."account_payments where ac_inv_id
= ".TB_PREFIX."invoices.id ) as inv_paid,
+ (select (INV_TOTAL - INV_PAID)) as inv_owing ,
date
FROM
".TB_PREFIX."invoices iv INNER JOIN
@@ -43,7 +43,7 @@
GROUP BY
iv.id
ORDER BY
- INV_OWING DESC;
+ inv_owing DESC;

";
}
@@ -52,12 +52,8 @@
$oRpt->setXML("./modules/reports/xml/report_debtors_by_amount.xml");
$oRpt->setUser("$db_user");
$oRpt->setPassword("$db_password");
- $oRpt->setConnection("$db_host");
- if ($db_server == 'pgsql') {
- $oRpt->setDatabaseInterface("postgresql");
- } else {
- $oRpt->setDatabaseInterface("mysql");
- }
+ $oRpt->setConnection("$db_server:host=$db_host");
+ $oRpt->setDatabaseInterface("pdo");
$oRpt->setSQL($sSQL);
$oRpt->setDatabase("$db_name");
ob_start();

Modified: trunk/modules/reports/report_debtors_owing_by_customer.php
==============================================================================
--- trunk/modules/reports/report_debtors_owing_by_customer.php (original)
+++ trunk/modules/reports/report_debtors_owing_by_customer.php Wed Dec
12 11:38:06 2007
@@ -1,39 +1,39 @@
<?php
// include the PHPReports classes on the PHP path! configure your
path here
include "./modules/reports/PHPReportMaker.php";
- include "config/config.php";
+ include "./config/config.php";


if ($db_server == 'pgsql') {
$sSQL = "SELECT
- c.id AS \"CID\",
- c.name AS \"Customer\",
- sum(coalesce(ii.total, 0)) AS \"INV_TOTAL\",
- sum(coalesce(ap.ac_amount, 0)) AS \"INV_PAID\",
+ c.id AS cid,
+ c.name AS customer,
+ sum(coalesce(ii.total, 0)) AS inv_total,
+ sum(coalesce(ap.ac_amount, 0)) AS inv_paid,
sum(coalesce(ii.total, 0)) -
- sum(coalesce(ap.ac_amount, 0)) AS \"INV_OWING\"
+ sum(coalesce(ap.ac_amount, 0)) AS inv_owing

FROM
".TB_PREFIX."customers c LEFT JOIN
".TB_PREFIX."invoices iv ON (c.id = iv.customer_id) LEFT JOIN
(SELECT i.invoice_id, coalesce(sum(i.total), 0) AS total
FROM ".TB_PREFIX."invoice_items i GROUP BY i.invoice_id
- ) ii ON (iv.id = ii.invoice_id)
+ ) ii ON (iv.id = ii.invoice_id) LEFT JOIN
(SELECT p.ac_inv_id, coalesce(sum(p.ac_amount), 0) AS ac_amount
FROM ".TB_PREFIX."account_payments p GROUP BY p.ac_inv_id
) ap ON (iv.id = ap.ac_inv_id)
GROUP BY
c.id, c.name
ORDER BY
- \"INV_OWING\" DESC;
+ inv_owing DESC;
";
} else {
$sSQL = "SELECT
- c.id as CID,
- c.name as Customer,
- (select coalesce(sum(ii.total), 0)
from ".TB_PREFIX."invoice_items,".TB_PREFIX."invoices where
ii2.invoice_id = iv2.id and iv2.customer_id = c.id) as INV_TOTAL,
- (select coalesce(sum(ap.ac_amount), 0)
from ".TB_PREFIX."account_payments ap, ".TB_PREFIX."invoices iv2 where
ap.ac_inv_id = iv2.id and iv2.customer_id = c.id) as INV_PAID,
- (select (INV_TOTAL - INV_PAID)) as INV_OWING
+ c.id as cid,
+ c.name as customer,
+ (select coalesce(sum(ii.total), 0)
from ".TB_PREFIX."invoice_items,".TB_PREFIX."invoices where
ii2.invoice_id = iv2.id and iv2.customer_id = c.id) as inv_total,
+ (select coalesce(sum(ap.ac_amount), 0)
from ".TB_PREFIX."account_payments ap, ".TB_PREFIX."invoices iv2 where
ap.ac_inv_id = iv2.id and iv2.customer_id = c.id) as inv_paid,
+ (select (inv_total - inv_paid)) as inv_owing

FROM
".TB_PREFIX."customers,".TB_PREFIX."invoices,".TB_PREFIX."invoice_items
@@ -43,7 +43,7 @@
GROUP BY
".TB_PREFIX."customers.id
ORDER BY
- INV_OWING DESC;
+ inv_owing DESC;
";
}
$oRpt = new PHPReportMaker();
@@ -51,12 +51,8 @@
$oRpt->setXML("./modules/reports/xml/report_debtors_owing_by_customer.xml");
$oRpt->setUser("$db_user");
$oRpt->setPassword("$db_password");
- $oRpt->setConnection("$db_host");
- if ($db_server == 'pgsql') {
- $oRpt->setDatabaseInterface("postgresql");
- } else {
- $oRpt->setDatabaseInterface("mysql");
- }
+ $oRpt->setConnection("$db_server:host=$db_host");
+ $oRpt->setDatabaseInterface("pdo");
$oRpt->setSQL($sSQL);
$oRpt->setDatabase("$db_name");
ob_start();

Modified: trunk/modules/reports/report_products_sold_by_customer.php
==============================================================================
--- trunk/modules/reports/report_products_sold_by_customer.php (original)
+++ trunk/modules/reports/report_products_sold_by_customer.php Wed Dec
12 11:38:06 2007
@@ -1,9 +1,9 @@
<?php
// include the PHPReports classes on the PHP path! configure your
path here
include "./modules/reports/PHPReportMaker.php";
- include "config/config.php";
+ include "./config/config.php";

- $sSQL = "SELECT sum(ii.quantity) as SUM_QUANTITY, c.name, p.description
+ $sSQL = "SELECT sum(ii.quantity) as sum_quantity, c.name, p.description
FROM ".TB_PREFIX."customers c INNER JOIN
".TB_PREFIX."invoices iv ON (c.id = iv.customer_id) INNER JOIN
".TB_PREFIX."invoice_items ii ON (iv.id = ii.invoice_id) INNER JOIN
@@ -17,12 +17,8 @@
$oRpt->setXML("./modules/reports/xml/report_products_sold_by_customer.xml");
$oRpt->setUser("$db_user");
$oRpt->setPassword("$db_password");
- $oRpt->setConnection("$db_host");
- if ($db_server == 'pgsql') {
- $oRpt->setDatabaseInterface("postgresql");
- } else {
- $oRpt->setDatabaseInterface("mysql");
- }
+ $oRpt->setConnection("$db_server:host=$db_host");
+ $oRpt->setDatabaseInterface("pdo");
$oRpt->setSQL($sSQL);
$oRpt->setDatabase("$db_name");
ob_start();

Modified: trunk/modules/reports/report_products_sold_total.php
==============================================================================
--- trunk/modules/reports/report_products_sold_total.php (original)
+++ trunk/modules/reports/report_products_sold_total.php Wed Dec 12
11:38:06 2007
@@ -9,24 +9,20 @@

// include the PHPReports classes on the PHP path! configure your
path here
include "./modules/reports/PHPReportMaker.php";
- include "config/config.php";
+ include "./config/config.php";

- $sSQL = "SELECT p.description, sum(ii.quantity) AS SUM_QUANTITY
+ $sSQL = "SELECT p.description, sum(ii.quantity) AS sum_quantity
FROM ".TB_PREFIX."invoice_items ii INNER JOIN
- ".TB_PREFIX."invoices iv (ii.invoice_id = iv.id) INNER JOIN
- ".TB_PREFIX."products p (p.id = ii.product_id)
- WHERE p.visible = 1 GROUP BY p.description";
+ ".TB_PREFIX."invoices iv ON (ii.invoice_id = iv.id) INNER JOIN
+ ".TB_PREFIX."products p ON (p.id = ii.product_id)
+ WHERE p.visible GROUP BY p.description";
$oRpt = new PHPReportMaker();

$oRpt->setXML("./modules/reports/xml/report_products_sold_total.xml");
$oRpt->setUser("$db_user");
$oRpt->setPassword("$db_password");
- $oRpt->setConnection("$db_host");
- if ($db_server == 'pgsql') {
- $oRpt->setDatabaseInterface("postgresql");
- } else {
- $oRpt->setDatabaseInterface("mysql");
- }
+ $oRpt->setConnection("$db_server:host=$db_host");
+ $oRpt->setDatabaseInterface("pdo");
$oRpt->setSQL($sSQL);
$oRpt->setDatabase("$db_name");
ob_start();

Modified: trunk/modules/reports/report_sales_customers_total.php
==============================================================================
--- trunk/modules/reports/report_sales_customers_total.php (original)
+++ trunk/modules/reports/report_sales_customers_total.php Wed Dec 12
11:38:06 2007
@@ -10,9 +10,9 @@

// include the PHPReports classes on the PHP path! configure your
path here
include "./modules/reports/PHPReportMaker.php";
- include "config/config.php";
+ include "./config/config.php";

- $sSQL = "SELECT c.name, sum(ii.total) as SUM_TOTAL
+ $sSQL = "SELECT c.name, sum(ii.total) as sum_total
FROM ".TB_PREFIX."customers c INNER JOIN
".TB_PREFIX."invoices iv ON (iv.customer_id = c.id) INNER JOIN
".TB_PREFIX."invoice_items ii ON (ii.invoice_id = iv.id)
@@ -22,12 +22,8 @@
$oRpt->setXML("./modules/reports/xml/report_sales_customers_total.xml");
$oRpt->setUser("$db_user");
$oRpt->setPassword("$db_password");
- $oRpt->setConnection("$db_host");
- if ($db_server == 'pgsql') {
- $oRpt->setDatabaseInterface("postgresql");
- } else {
- $oRpt->setDatabaseInterface("mysql");
- }
+ $oRpt->setConnection("$db_server:host=$db_host");
+ $oRpt->setDatabaseInterface("pdo");
$oRpt->setSQL($sSQL);
$oRpt->setDatabase("$db_name");
ob_start();

Modified: trunk/modules/reports/report_sales_total.php
==============================================================================
--- trunk/modules/reports/report_sales_total.php (original)
+++ trunk/modules/reports/report_sales_total.php Wed Dec 12 11:38:06 2007
@@ -12,18 +12,14 @@
// include the PHPReports classes on the PHP path! configure your
path here
include "./modules/reports/PHPReportMaker.php";

- $sSQL = "select sum(ii.total) as Total
from ".TB_PREFIX."invoice_items ii";
+ $sSQL = "select sum(ii.total) as total
from ".TB_PREFIX."invoice_items ii";
$oRpt = new PHPReportMaker();

$oRpt->setXML("./modules/reports/xml/report_sales_total.xml");
$oRpt->setUser("$db_user");
$oRpt->setPassword("$db_password");
- $oRpt->setConnection("$db_host");
- if ($db_server == 'pgsql') {
- $oRpt->setDatabaseInterface("postgresql");
- } else {
- $oRpt->setDatabaseInterface("mysql");
- }
+ $oRpt->setConnection("$db_server:host=$db_host");
+ $oRpt->setDatabaseInterface("pdo");
$oRpt->setSQL($sSQL);
$oRpt->setDatabase("$db_name");
ob_start();

Modified: trunk/modules/reports/report_tax_total.php
==============================================================================
--- trunk/modules/reports/report_tax_total.php (original)
+++ trunk/modules/reports/report_tax_total.php Wed Dec 12 11:38:06 2007
@@ -21,20 +21,16 @@

// include the PHPReports classes on the PHP path! configure your
path here
include "./modules/reports/PHPReportMaker.php";
- include "config/config.php";
+ include "./config/config.php";

- $sSQL = "select sum(ii.tax_amount) as SUM_TAX_AMOUNT
from ".TB_PREFIX."invoice_items ii";
+ $sSQL = "select sum(ii.tax_amount) as sum_tax_total
from ".TB_PREFIX."invoice_items ii";
$oRpt = new PHPReportMaker();

$oRpt->setXML("./modules/reports/xml/report_tax_total.xml");
$oRpt->setUser("$db_user");
$oRpt->setPassword("$db_password");
- $oRpt->setConnection("$db_host");
- if ($db_server == 'pgsql') {
- $oRpt->setDatabaseInterface("postgresql");
- } else {
- $oRpt->setDatabaseInterface("mysql");
- }
+ $oRpt->setConnection("$db_server:host=$db_host");
+ $oRpt->setDatabaseInterface("pdo");
$oRpt->setSQL($sSQL);
$oRpt->setDatabase("$db_name");
ob_start();

Modified: trunk/modules/reports/xml/report_biller_by_customer.xml
==============================================================================
--- trunk/modules/reports/xml/report_biller_by_customer.xml (original)
+++ trunk/modules/reports/xml/report_biller_by_customer.xml Wed Dec 12
11:38:06 2007
@@ -17,8 +17,8 @@
<FOOTER>

<ROW>
-<COL ALIGN="RIGHT" COLSPAN="3" CELLCLASS="PAGE_LAYER">page total</COL>
-<COL ALIGN="LEFT" NUMBERFORMATEX="2" CELLCLASS="PAGE_LAYER"
TEXTCLASS="BOLD" TYPE="EXPRESSION">$this->getSum("SUM_TOTAL")</COL>
+<COL ALIGN="RIGHT" COLSPAN="3" CELLCLASS="PAGE_LAYER">Page Total</COL>
+<COL ALIGN="LEFT" NUMBERFORMATEX="2" CELLCLASS="PAGE_LAYER"
TEXTCLASS="BOLD" TYPE="EXPRESSION">$this->getSum("sum_total")</COL>
</ROW>
</FOOTER>
</PAGE>
@@ -30,29 +30,29 @@
<HEADER>

<ROW>
-<COL CELLCLASS="GROUP_LAYER">CNAME</COL>
-<COL CELLCLASS="GROUP_LAYER" TEXTCLASS="BOLD" TYPE="EXPRESSION" COLSPAN="3">$header->getValue("BNAME")</COL>
+<COL CELLCLASS="GROUP_LAYER">cname</COL>
+<COL CELLCLASS="GROUP_LAYER" TEXTCLASS="BOLD" TYPE="EXPRESSION" COLSPAN="3">$header->getValue("bname")</COL>
</ROW>

<ROW>
-<COL CELLCLASS="GROUP_LAYER">CNAME</COL>
-<COL CELLCLASS="GROUP_LAYER">SUM_TOTAL</COL>
+<COL CELLCLASS="GROUP_LAYER">cname</COL>
+<COL CELLCLASS="GROUP_LAYER">sum_total</COL>
</ROW>
</HEADER>

<FOOTER>

<ROW>
-<COL ALIGN="RIGHT" COLSPAN="3" CELLCLASS="GROUP_LAYER">total</COL>
-<COL ALIGN="LEFT" CELLCLASS="GROUP_LAYER" TEXTCLASS="BOLD"
NUMBERFORMATEX="2" TYPE="EXPRESSION">$this->getSum("SUM_TOTAL")</COL>
+<COL ALIGN="RIGHT" COLSPAN="3" CELLCLASS="GROUP_LAYER">Total</COL>
+<COL ALIGN="LEFT" CELLCLASS="GROUP_LAYER" TEXTCLASS="BOLD"
NUMBERFORMATEX="2" TYPE="EXPRESSION">$this->getSum("sum_total")</COL>
</ROW>
</FOOTER>

<FIELDS>

<ROW>
-<COL TYPE="FIELD" CELLCLASS="GROUP_LAYER" >CNAME</COL>
-<COL TYPE="FIELD" CELLCLASS="GROUP_LAYER" NUMBERFORMATEX="2">SUM_TOTAL</COL>
+<COL TYPE="FIELD" CELLCLASS="GROUP_LAYER" >cname</COL>
+<COL TYPE="FIELD" CELLCLASS="GROUP_LAYER" NUMBERFORMATEX="2">sum_total</COL>
</ROW>
</FIELDS>
</GROUP>

Modified: trunk/modules/reports/xml/report_biller_total.xml
==============================================================================
--- trunk/modules/reports/xml/report_biller_total.xml (original)
+++ trunk/modules/reports/xml/report_biller_total.xml Wed Dec 12
11:38:06 2007
@@ -12,7 +12,7 @@
<FOOTER>
<ROW>
<COL ALIGN="RIGHT" COLSPAN="4" CELLCLASS="PAGE_LAYER">page total</COL>
- <COL ALIGN="LEFT" NUMBERFORMATEX="2"
CELLCLASS="PAGE_LAYER" TEXTCLASS="BOLD" TYPE="EXPRESSION">$this->getSum("SUM_TOTAL")</COL>
+ <COL ALIGN="LEFT" NUMBERFORMATEX="2"
CELLCLASS="PAGE_LAYER" TEXTCLASS="BOLD" TYPE="EXPRESSION">$this->getSum("sum_total")</COL>
</ROW>
</FOOTER>
</PAGE>
@@ -22,7 +22,7 @@
<FIELDS>
<ROW>
<COL TYPE="FIELD" CELLCLASS="GROUP_LAYER">name</COL>
- <COL TYPE="FIELD" CELLCLASS="GROUP_LAYER">SUM_TOTAL</COL>
+ <COL TYPE="FIELD" CELLCLASS="GROUP_LAYER">sum_total</COL>
</ROW>
</FIELDS>
</GROUP>

Modified: trunk/modules/reports/xml/report_debtors_aging_total.xml
==============================================================================
--- trunk/modules/reports/xml/report_debtors_aging_total.xml (original)
+++ trunk/modules/reports/xml/report_debtors_aging_total.xml Wed Dec 12
11:38:06 2007
@@ -20,9 +20,9 @@
<COL ALIGN="LEFT" COLSPAN="5" CELLCLASS="PAGE_LAYER">Sum</COL>
</ROW>
<ROW>
- <COL ALIGN="LEFT" NUMBERFORMATEX="2"
CELLCLASS="PAGE_LAYER" TEXTCLASS="BOLD" TYPE="EXPRESSION">$this->getSum("INV_TOTAL")</COL>
- <COL ALIGN="LEFT" NUMBERFORMATEX="2"
CELLCLASS="PAGE_LAYER" TEXTCLASS="BOLD" TYPE="EXPRESSION">$this->getSum("INV_PAID")</COL>
- <COL ALIGN="LEFT" NUMBERFORMATEX="2"
CELLCLASS="PAGE_LAYER" TEXTCLASS="BOLD" TYPE="EXPRESSION">$this->getSum("INV_OWING")</COL>
+ <COL ALIGN="LEFT" NUMBERFORMATEX="2"
CELLCLASS="PAGE_LAYER" TEXTCLASS="BOLD" TYPE="EXPRESSION">$this->getSum("inv_total")</COL>
+ <COL ALIGN="LEFT" NUMBERFORMATEX="2"
CELLCLASS="PAGE_LAYER" TEXTCLASS="BOLD" TYPE="EXPRESSION">$this->getSum("inv_paid")</COL>
+ <COL ALIGN="LEFT" NUMBERFORMATEX="2"
CELLCLASS="PAGE_LAYER" TEXTCLASS="BOLD" TYPE="EXPRESSION">$this->getSum("inv_owing")</COL>
<COL ALIGN="RIGHT" COLSPAN="5" CELLCLASS="PAGE_LAYER"></COL>
</ROW>
</FOOTER>
@@ -32,10 +32,10 @@

<FIELDS>
<ROW>
- <COL TYPE="FIELD" CELLCLASS="GROUP_LAYER">INV_TOTAL</COL>
- <COL TYPE="FIELD" CELLCLASS="GROUP_LAYER">INV_PAID</COL>
- <COL TYPE="FIELD" CELLCLASS="GROUP_LAYER">INV_OWING</COL>
- <COL TYPE="FIELD" CELLCLASS="GROUP_LAYER">Aging</COL>
+ <COL TYPE="FIELD" CELLCLASS="GROUP_LAYER">inv_total</COL>
+ <COL TYPE="FIELD" CELLCLASS="GROUP_LAYER">inv_paid</COL>
+ <COL TYPE="FIELD" CELLCLASS="GROUP_LAYER">inv_owing</COL>
+ <COL TYPE="FIELD" CELLCLASS="GROUP_LAYER">aging</COL>
</ROW>
</FIELDS>
</GROUP>

Modified: trunk/modules/reports/xml/report_debtors_by_aging.xml
==============================================================================
--- trunk/modules/reports/xml/report_debtors_by_aging.xml (original)
+++ trunk/modules/reports/xml/report_debtors_by_aging.xml Wed Dec 12
11:38:06 2007
@@ -25,7 +25,7 @@
<FOOTER>
<ROW>
<COL ALIGN="RIGHT" COLSPAN="8"
CELLCLASS="PAGE_LAYER">Total Owed</COL>
- <COL ALIGN="LEFT" NUMBERFORMATEX="2"
CELLCLASS="PAGE_LAYER" TEXTCLASS="BOLD" TYPE="EXPRESSION">$this->getSum("INV_OWING")</COL>
+ <COL ALIGN="LEFT" NUMBERFORMATEX="2"
CELLCLASS="PAGE_LAYER" TEXTCLASS="BOLD" TYPE="EXPRESSION">$this->getSum("inv_owing")</COL>
</ROW>
</FOOTER>
</PAGE>
@@ -34,7 +34,7 @@
<HEADER>
<ROW>
<COL CELLCLASS="GROUP_LAYER">Aging:</COL>
- <COL CELLCLASS="GROUP_LAYER" TEXTCLASS="BOLD"
TYPE="EXPRESSION" COLSPAN="8">$header->getValue("Aging")</COL>
+ <COL CELLCLASS="GROUP_LAYER" TEXTCLASS="BOLD"
TYPE="EXPRESSION" COLSPAN="8">$header->getValue("aging")</COL>
</ROW>
<ROW>
<COL CELLCLASS="GROUP_LAYER">id</COL>
@@ -52,7 +52,7 @@
<FOOTER>
<ROW>
<COL ALIGN="RIGHT" COLSPAN="5" CELLCLASS="GROUP_LAYER">Sum</COL>
- <COL ALIGN="LEFT" CELLCLASS="GROUP_LAYER"
TEXTCLASS="BOLD" NUMBERFORMATEX="2" TYPE="EXPRESSION">$this->getSum("INV_OWING")</COL>
+ <COL ALIGN="LEFT" CELLCLASS="GROUP_LAYER"
TEXTCLASS="BOLD" NUMBERFORMATEX="2" TYPE="EXPRESSION">$this->getSum("inv_owing")</COL>
</ROW>
</FOOTER>

@@ -60,14 +60,14 @@
<FIELDS>
<ROW>
<COL TYPE="FIELD" CELLCLASS="GROUP_LAYER">id</COL>
- <COL TYPE="FIELD" CELLCLASS="GROUP_LAYER">Biller</COL>
- <COL TYPE="FIELD" CELLCLASS="GROUP_LAYER">Customer</COL>
- <COL TYPE="FIELD" CELLCLASS="GROUP_LAYER">INV_TOTAL</COL>
- <COL TYPE="FIELD" CELLCLASS="GROUP_LAYER">INV_PAID</COL>
- <COL TYPE="FIELD" CELLCLASS="GROUP_LAYER">INV_OWING</COL>
- <COL TYPE="FIELD" CELLCLASS="GROUP_LAYER">Date</COL>
- <COL TYPE="FIELD" CELLCLASS="GROUP_LAYER">Age</COL>
- <COL TYPE="FIELD" CELLCLASS="GROUP_LAYER">Aging</COL>
+ <COL TYPE="FIELD" CELLCLASS="GROUP_LAYER">biller</COL>
+ <COL TYPE="FIELD" CELLCLASS="GROUP_LAYER">customer</COL>
+ <COL TYPE="FIELD" CELLCLASS="GROUP_LAYER">inv_total</COL>
+ <COL TYPE="FIELD" CELLCLASS="GROUP_LAYER">inv_paid</COL>
+ <COL TYPE="FIELD" CELLCLASS="GROUP_LAYER">inv_owing</COL>
+ <COL TYPE="FIELD" CELLCLASS="GROUP_LAYER">date</COL>
+ <COL TYPE="FIELD" CELLCLASS="GROUP_LAYER">age</COL>
+ <COL TYPE="FIELD" CELLCLASS="GROUP_LAYER">aging</COL>
</ROW>
</FIELDS>
</GROUP>

Modified: trunk/modules/reports/xml/report_debtors_by_amount.xml
==============================================================================
--- trunk/modules/reports/xml/report_debtors_by_amount.xml (original)
+++ trunk/modules/reports/xml/report_debtors_by_amount.xml Wed Dec 12
11:38:06 2007
@@ -20,7 +20,7 @@
<FOOTER>
<ROW>
<COL ALIGN="RIGHT" COLSPAN="5"
CELLCLASS="PAGE_LAYER">Total Owed</COL>
- <COL ALIGN="LEFT" NUMBERFORMATEX="2"
CELLCLASS="PAGE_LAYER" TEXTCLASS="BOLD" TYPE="EXPRESSION">$this->getSum("INV_OWING")</COL>
+ <COL ALIGN="LEFT" NUMBERFORMATEX="2" CELLCLASS="PAGE_LAYER"
TEXTCLASS="BOLD" TYPE="EXPRESSION">$this->getSum("inv_owing")</COL>
</ROW>
</FOOTER>
</PAGE>
@@ -30,11 +30,11 @@
<FIELDS>
<ROW>
<COL TYPE="FIELD" CELLCLASS="GROUP_LAYER">id</COL>
- <COL TYPE="FIELD" CELLCLASS="GROUP_LAYER">Biller</COL>
- <COL TYPE="FIELD" CELLCLASS="GROUP_LAYER">Customer</COL>
- <COL TYPE="FIELD" CELLCLASS="GROUP_LAYER">INV_TOTAL</COL>
- <COL TYPE="FIELD" CELLCLASS="GROUP_LAYER">INV_PAID</COL>
- <COL TYPE="FIELD" CELLCLASS="GROUP_LAYER">INV_OWING</COL>
+ <COL TYPE="FIELD" CELLCLASS="GROUP_LAYER">biller</COL>
+ <COL TYPE="FIELD" CELLCLASS="GROUP_LAYER">customer</COL>
+ <COL TYPE="FIELD" CELLCLASS="GROUP_LAYER">inv_total</COL>
+ <COL TYPE="FIELD" CELLCLASS="GROUP_LAYER">inv_paid</COL>
+ <COL TYPE="FIELD" CELLCLASS="GROUP_LAYER">inv_owing</COL>
</ROW>
</FIELDS>
</GROUP>

Modified: trunk/modules/reports/xml/report_debtors_owing_by_customer.xml
==============================================================================
--- trunk/modules/reports/xml/report_debtors_owing_by_customer.xml (original)
+++ trunk/modules/reports/xml/report_debtors_owing_by_customer.xml Wed
Dec 12 11:38:06 2007
@@ -19,7 +19,7 @@
<FOOTER>
<ROW>
<COL ALIGN="RIGHT" COLSPAN="4"
CELLCLASS="PAGE_LAYER">Total Owing</COL>
- <COL ALIGN="LEFT" NUMBERFORMATEX="2"
CELLCLASS="PAGE_LAYER" TEXTCLASS="BOLD" TYPE="EXPRESSION">$this->getSum("INV_OWING")</COL>
+ <COL ALIGN="LEFT" NUMBERFORMATEX="2"
CELLCLASS="PAGE_LAYER" TEXTCLASS="BOLD" TYPE="EXPRESSION">$this->getSum("inv_owing")</COL>
</ROW>
</FOOTER>
</PAGE>
@@ -28,11 +28,11 @@

<FIELDS>
<ROW>
- <COL TYPE="FIELD" CELLCLASS="GROUP_LAYER">CID</COL>
- <COL TYPE="FIELD" CELLCLASS="GROUP_LAYER">Customer</COL>
- <COL TYPE="FIELD" CELLCLASS="GROUP_LAYER">INV_TOTAL</COL>
- <COL TYPE="FIELD" CELLCLASS="GROUP_LAYER">INV_PAID</COL>
- <COL TYPE="FIELD" CELLCLASS="GROUP_LAYER">INV_OWING</COL>
+ <COL TYPE="FIELD" CELLCLASS="GROUP_LAYER">cid</COL>
+ <COL TYPE="FIELD" CELLCLASS="GROUP_LAYER">customer</COL>
+ <COL TYPE="FIELD" CELLCLASS="GROUP_LAYER">inv_total</COL>
+ <COL TYPE="FIELD" CELLCLASS="GROUP_LAYER">inv_paid</COL>
+ <COL TYPE="FIELD" CELLCLASS="GROUP_LAYER">inv_owing</COL>
</ROW>
</FIELDS>
</GROUP>

Modified: trunk/modules/reports/xml/report_products_sold_by_customer.xml
==============================================================================
--- trunk/modules/reports/xml/report_products_sold_by_customer.xml (original)
+++ trunk/modules/reports/xml/report_products_sold_by_customer.xml Wed
Dec 12 11:38:06 2007
@@ -18,7 +18,7 @@

<ROW>
<COL ALIGN="RIGHT" COLSPAN="3" CELLCLASS="PAGE_LAYER">page total</COL>
-<COL ALIGN="LEFT" NUMBERFORMATEX="2" CELLCLASS="PAGE_LAYER"
TEXTCLASS="BOLD" TYPE="EXPRESSION">$this->getSum("SUM_QUANTITY")</COL>
+<COL ALIGN="LEFT" NUMBERFORMATEX="2" CELLCLASS="PAGE_LAYER"
TEXTCLASS="BOLD" TYPE="EXPRESSION">$this->getSum("sum_quantity")</COL>
</ROW>
</FOOTER>
</PAGE>
@@ -30,21 +30,21 @@
<HEADER>

<ROW>
-<COL CELLCLASS="GROUP_LAYER">name</COL>
+<COL CELLCLASS="GROUP_LAYER">Customer Name</COL>
<COL CELLCLASS="GROUP_LAYER" TEXTCLASS="BOLD" TYPE="EXPRESSION" COLSPAN="3">$header->getValue("name")</COL>
</ROW>

<ROW>
-<COL CELLCLASS="GROUP_LAYER">description</COL>
-<COL CELLCLASS="GROUP_LAYER">SUM_QUANTITY</COL>
+<COL CELLCLASS="GROUP_LAYER">Description</COL>
+<COL CELLCLASS="GROUP_LAYER">Quantity</COL>
</ROW>
</HEADER>

<FOOTER>

<ROW>
-<COL ALIGN="RIGHT" COLSPAN="3" CELLCLASS="GROUP_LAYER">total</COL>
-<COL ALIGN="LEFT" CELLCLASS="GROUP_LAYER" TEXTCLASS="BOLD"
NUMBERFORMATEX="2" TYPE="EXPRESSION">$this->getSum("SUM_QUANTITY")</COL>
+<COL ALIGN="RIGHT" COLSPAN="3" CELLCLASS="GROUP_LAYER">Total</COL>
+<COL ALIGN="LEFT" CELLCLASS="GROUP_LAYER" TEXTCLASS="BOLD"
NUMBERFORMATEX="2" TYPE="EXPRESSION">$this->getSum("sum_quantity")</COL>
</ROW>
</FOOTER>

@@ -52,7 +52,7 @@

<ROW>
<COL TYPE="FIELD" CELLCLASS="GROUP_LAYER" >description</COL>
-<COL TYPE="FIELD" CELLCLASS="GROUP_LAYER" NUMBERFORMATEX="2">SUM_QUANTITY</COL>
+<COL TYPE="FIELD" CELLCLASS="GROUP_LAYER" NUMBERFORMATEX="2">sum_quantity</COL>
</ROW>
</FIELDS>
</GROUP>

Modified: trunk/modules/reports/xml/report_products_sold_total.xml
==============================================================================
--- trunk/modules/reports/xml/report_products_sold_total.xml (original)
+++ trunk/modules/reports/xml/report_products_sold_total.xml Wed Dec 12
11:38:06 2007
@@ -12,7 +12,7 @@
<FOOTER>
<ROW>
<COL ALIGN="RIGHT" COLSPAN="4" CELLCLASS="PAGE_LAYER">page total</COL>
- <COL ALIGN="LEFT" NUMBERFORMATEX="2"
CELLCLASS="PAGE_LAYER" TEXTCLASS="BOLD" TYPE="EXPRESSION">$this->getSum("SUM_QUANTITY")</COL>
+ <COL ALIGN="LEFT" NUMBERFORMATEX="2"
CELLCLASS="PAGE_LAYER" TEXTCLASS="BOLD" TYPE="EXPRESSION">$this->getSum("sum_quantity")</COL>
</ROW>
</FOOTER>
</PAGE>
@@ -22,7 +22,7 @@
<FIELDS>
<ROW>
<COL TYPE="FIELD" CELLCLASS="GROUP_LAYER">description</COL>
- <COL TYPE="FIELD" CELLCLASS="GROUP_LAYER">SUM_QUANTITY</COL>
+ <COL TYPE="FIELD" CELLCLASS="GROUP_LAYER">sum_quantity</COL>
</ROW>
</FIELDS>
</GROUP>

Modified: trunk/modules/reports/xml/report_sales_customers_total.xml
==============================================================================
--- trunk/modules/reports/xml/report_sales_customers_total.xml (original)
+++ trunk/modules/reports/xml/report_sales_customers_total.xml Wed Dec
12 11:38:06 2007
@@ -12,7 +12,7 @@
<FOOTER>
<ROW>
<COL ALIGN="RIGHT" COLSPAN="4" CELLCLASS="PAGE_LAYER">page total</COL>
- <COL ALIGN="LEFT" NUMBERFORMATEX="2"
CELLCLASS="PAGE_LAYER" TEXTCLASS="BOLD" TYPE="EXPRESSION">$this->getSum("SUM_TOTAL")</COL>
+ <COL ALIGN="LEFT" NUMBERFORMATEX="2"
CELLCLASS="PAGE_LAYER" TEXTCLASS="BOLD" TYPE="EXPRESSION">$this->getSum("sum_total")</COL>
</ROW>
</FOOTER>
</PAGE>
@@ -22,7 +22,7 @@
<FIELDS>
<ROW>
<COL TYPE="FIELD" CELLCLASS="GROUP_LAYER">name</COL>
- <COL TYPE="FIELD" CELLCLASS="GROUP_LAYER">SUM_TOTAL</COL>
+ <COL TYPE="FIELD" CELLCLASS="GROUP_LAYER">sum_total</COL>
</ROW>
</FIELDS>
</GROUP>

Modified: trunk/modules/reports/xml/report_sales_total.xml
==============================================================================
--- trunk/modules/reports/xml/report_sales_total.xml (original)
+++ trunk/modules/reports/xml/report_sales_total.xml Wed Dec 12
11:38:06 2007
@@ -15,7 +15,7 @@

<FIELDS>
<ROW>
- <COL TYPE="FIELD" CELLCLASS="GROUP_LAYER">Total</COL>
+ <COL TYPE="FIELD" CELLCLASS="GROUP_LAYER">total</COL>
</ROW>
</FIELDS>
</GROUP>

Modified: trunk/modules/reports/xml/report_tax_total.xml
==============================================================================
--- trunk/modules/reports/xml/report_tax_total.xml (original)
+++ trunk/modules/reports/xml/report_tax_total.xml Wed Dec 12 11:38:06 2007
@@ -15,7 +15,7 @@

<FIELDS>
<ROW>
- <COL TYPE="FIELD" CELLCLASS="GROUP_LAYER">SUM_TAX_AMOUNT</COL>
+ <COL TYPE="FIELD" CELLCLASS="GROUP_LAYER">sum_tax_total</COL>
</ROW>
</FIELDS>
</GROUP>

codesite...@google.com

unread,
Dec 12, 2007, 2:39:01 PM12/12/07
to simpleinv...@googlegroups.com
Reply all
Reply to author
Forward
0 new messages