Wrong linked credit data on invoices/credits table when view PO
authorJoe Hunt <joe.hunt.consulting@gmail.com>
Tue, 18 Jan 2011 10:32:05 +0000 (10:32 +0000)
committerJoe Hunt <joe.hunt.consulting@gmail.com>
Tue, 18 Jan 2011 10:32:05 +0000 (10:32 +0000)
CHANGELOG.txt
purchasing/includes/db/grn_db.inc
purchasing/includes/db/invoice_db.inc

index fb8deef3ac52e410dd369560ca860c3a072cec93..01fe68861f1c55c03f87b7bff70d7229d5890319 100644 (file)
@@ -19,6 +19,11 @@ Legend:
 ! -> Note
 $ -> Affected files
 
+18-Jan-2011 Joe Hunt
+# Wrong linked credit data on invoices/credits table when view PO
+$ /purchasing/includes/db/grn_db.inc
+  /purchasing/includes/db/invoice_db.inc
+  
 17-Jan-2011 Janusz Dobrowolski
 # Removed sparse Add button
 $ /admin/inst_module.php
index 691ae73f8f71f92bb63bd316859e332a37c08245..01a84e1f9959d2e398ed89cd344458829a5ad494 100644 (file)
@@ -310,7 +310,8 @@ function read_grn_items_to_order($grn_batch, &$order)
 
                while ($myrow = db_fetch($result))
                {
-
+                       if ($myrow['qty_recd'] == 0 && $myrow['quantity_inv'] == 0)
+                               continue; // 2011-01-18 Joe Hunt. We will not have empty credited rows.
                        if (is_null($myrow["units"]))
                        {
                                $units = "";
index 291664154f6d4314e9a6039029c115fb41d06037..c95e5de4a994d8006eab52d3513d94e00fe0fd99 100644 (file)
@@ -379,6 +379,7 @@ function get_po_invoices_credits($po_number)
                FROM ".TB_PREF."supp_trans, ".TB_PREF."supp_invoice_items, "
                .TB_PREF."purch_order_details, ".TB_PREF."purch_orders
                WHERE ".TB_PREF."supp_invoice_items.supp_trans_no = ".TB_PREF."supp_trans.trans_no
+               AND ".TB_PREF."supp_invoice_items.supp_trans_type = ".TB_PREF."supp_trans.type
                AND ".TB_PREF."supp_invoice_items.po_detail_item_id = ".TB_PREF."purch_order_details.po_detail_item
                AND ".TB_PREF."purch_orders.supplier_id = ".TB_PREF."supp_trans.supplier_id
                AND ".TB_PREF."purch_orders.order_no = ".TB_PREF."purch_order_details.order_no