Voiding a supplier invoice/credit note with GL Postings creates a database error
authorJoe Hunt <joe.hunt.consulting@gmail.com>
Tue, 28 Oct 2008 23:48:13 +0000 (23:48 +0000)
committerJoe Hunt <joe.hunt.consulting@gmail.com>
Tue, 28 Oct 2008 23:48:13 +0000 (23:48 +0000)
CHANGELOG.txt
purchasing/includes/db/invoice_db.inc

index 769d6141254e74c3a634f166e0669724748fe575..b35d35616bd34dd958eb4704b54cb71379b74999 100644 (file)
@@ -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
index 33ec2b57205f662e7f599d4a9337fbf8c860c0f1..ec22b1cb2cdde221fff4f02df3c73ad3e5559fb3 100644 (file)
@@ -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"],