Do not allow editing invoice if allocated > 0
authorJoe Hunt <joe.hunt.consulting@gmail.com>
Wed, 19 Nov 2008 23:57:29 +0000 (23:57 +0000)
committerJoe Hunt <joe.hunt.consulting@gmail.com>
Wed, 19 Nov 2008 23:57:29 +0000 (23:57 +0000)
CHANGELOG.txt
sales/inquiry/customer_inquiry.php

index 1635f5c18e813bd18e60b41517383a1b090dcab8..cf942b6d1832c9adc2362871de3d9407d74e8ddb 100644 (file)
@@ -19,6 +19,10 @@ Legend:
 ! -> Note
 $ -> Affected files
 
+20-Nov-2008 Joe Hunt
+# Do not allow editing invoice if allocated > 0
+$ /sales/inquiry/customer_inquiry.php
+
 19-Nov-2008 Joe Hunt
 + Possibility to view a transaction before final voiding.
 $ /admin/void_transaction.php
index 08b8f0d1b6d70b4403bebc7c63e2456f23989bba..ebd55aeac424127a454b89d6c0c779854aed2250 100644 (file)
@@ -215,13 +215,13 @@ if (db_num_rows($result) == 0)
                    // only allow crediting if it's not been totally allocated
                if ($myrow["TotalAmount"] - $myrow["Allocated"] > 0)
                        $credit_me_str = "<a href='$path_to_root/sales/customer_credit_invoice.php?InvoiceNumber=" . $myrow["trans_no"] . "'>" . _("Credit This") . "</a>";
-               if (get_voided_entry(10, $myrow["trans_no"]) === false)
+               if (get_voided_entry(10, $myrow["trans_no"]) === false && $myrow['Allocated'] == 0) // 2008-11-19 Joe Hunt
                        $edit_page= $path_to_root.'/sales/customer_invoice.php?ModifyInvoice='
                                        . $myrow['trans_no'];
                break;
 
         case 11:
-               if (get_voided_entry(11, $myrow["trans_no"]) === false)
+               if (get_voided_entry(11, $myrow["trans_no"]) === false && $myrow['Allocated'] == 0) // 2008-11-19 Joe Hunt
                {        
                        if ($myrow['order_']==0) // free-hand credit note
                            $edit_page= $path_to_root.'/sales/credit_note_entry.php?ModifyCredit='