From 2e7b5edc07f954d93f9aa1570a12458394aa6234 Mon Sep 17 00:00:00 2001 From: Joe Hunt Date: Tue, 28 Oct 2008 23:48:13 +0000 Subject: [PATCH] Voiding a supplier invoice/credit note with GL Postings creates a database error --- CHANGELOG.txt | 4 ++++ purchasing/includes/db/invoice_db.inc | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 769d6141..b35d3561 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -19,6 +19,10 @@ Legend: ! -> Note $ -> Affected files +29-Oct-2008 Joe Hunt +# Voiding a supplier invoice/credit note with GL Postings creates a database error +$ /purchasing/includes/db/invoice_db.inc + 28-Oct-2008 Joe Hunt # [000009] Delivery Note/Sales Invoice should not be editable after it has been voided. $ /admin/db/voiding_db.inc diff --git a/purchasing/includes/db/invoice_db.inc b/purchasing/includes/db/invoice_db.inc index 33ec2b57..ec22b1cb 100644 --- a/purchasing/includes/db/invoice_db.inc +++ b/purchasing/includes/db/invoice_db.inc @@ -362,7 +362,7 @@ function void_supp_invoice($type, $type_no) $date_ = Today(); while ($details_row = db_fetch($result)) { - if (strlen($details_row["grn_item_id"]) > 0) // it can be empty for GL items + if ((int)$details_row["grn_item_id"] > 0) // it can be empty for GL items { // Changed 2008-10-17 by Joe Hunt to get the avg. material cost updated $old = update_supp_received_items_for_invoice($details_row["grn_item_id"], -- 2.30.2