From: Joe Hunt Date: Tue, 18 Jan 2011 10:32:05 +0000 (+0000) Subject: Wrong linked credit data on invoices/credits table when view PO X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=commitdiff_plain;h=cca8e2cc847a6a63f80e1bfb07190b4a4e1d969c;p=textcart.git Wrong linked credit data on invoices/credits table when view PO --- diff --git a/CHANGELOG.txt b/CHANGELOG.txt index fb8deef..01fe688 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -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 diff --git a/purchasing/includes/db/grn_db.inc b/purchasing/includes/db/grn_db.inc index 691ae73..01a84e1 100644 --- a/purchasing/includes/db/grn_db.inc +++ b/purchasing/includes/db/grn_db.inc @@ -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 = ""; diff --git a/purchasing/includes/db/invoice_db.inc b/purchasing/includes/db/invoice_db.inc index 2916641..c95e5de 100644 --- a/purchasing/includes/db/invoice_db.inc +++ b/purchasing/includes/db/invoice_db.inc @@ -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