[0000644] Unable o void delivery note and [0000645] Error entering written off Credit...
authorJoe Hunt <joe.hunt.consulting@gmail.com>
Thu, 17 Mar 2011 00:05:48 +0000 (01:05 +0100)
committerJoe Hunt <joe.hunt.consulting@gmail.com>
Thu, 17 Mar 2011 00:05:48 +0000 (01:05 +0100)
admin/db/voiding_db.inc
sales/credit_note_entry.php
sales/customer_credit_invoice.php

index 62165c1fbf2206d48a1bb7c10dfb22291f40a80e..17d7a8daceb58b2ca57210f50b0abf76574ecc26 100644 (file)
@@ -45,7 +45,7 @@ function void_transaction($type, $type_no, $date_, $memo_)
                                return false;
                        if ($type == ST_CUSTDELIVERY)   // added 04 Oct 2008 by Joe Hunt. If delivery note has a not voided invoice, then NO.
                        {
-                               $childs = get_sales_child_trans($type_no, $type);
+                               $childs = get_sales_child_lines($type, $type_no, false); // 2011-03-17 This had been changed. Joe
                                if ($childs && db_num_rows($childs))
                                                return false;
                        }
index 513fb25eb0f1fbe7b3354d22e6bf73fdd527602a..56e81a1dbfee6cd6928ee8c1e695676ec81f87fa 100644 (file)
@@ -94,7 +94,7 @@ function copy_to_cn()
        $cart->Comments = $_POST['CreditText'];
        $cart->document_date = $_POST['OrderDate'];
        $cart->freight_cost = input_num('ChargeFreightCost');
-       $cart->Location = $_POST["Location"];
+       $cart->Location = (isset($_POST["Location"]) ? $_POST["Location"] : "");
        $cart->sales_type = $_POST['sales_type_id'];
        if ($cart->trans_no == 0)
                $cart->reference = $_POST['ref'];
@@ -126,7 +126,7 @@ function copy_from_cn()
 function handle_new_credit($trans_no)
 {
        processing_start();
-       $_SESSION['Items'] = new Cart(11,$trans_no);
+       $_SESSION['Items'] = new Cart(ST_CUSTCREDIT,$trans_no);
        copy_from_cn();
 }
 
@@ -255,7 +255,7 @@ if (isset($_POST['CancelItemChanges']))
 //-----------------------------------------------------------------------------
 
 if (!processing_active()) {
-       handle_new_credit();
+       handle_new_credit(0);
 }
 
 //-----------------------------------------------------------------------------
index 24f70ce6b2c876b288cddd5833077ddb8c240615..ff6e45797e0c14534051686c21f71a594f42dfa1 100644 (file)
@@ -173,7 +173,7 @@ function copy_to_cart()
        $cart->ship_via = $_POST['ShipperID'];
        $cart->freight_cost = input_num('ChargeFreightCost');
        $cart->document_date =  $_POST['CreditDate'];
-       $cart->Location = $_POST['Location'];
+       $cart->Location = (isset($_POST['Location']) ? $_POST['Location'] : "");
        $cart->Comments = $_POST['CreditText'];
        if ($_SESSION['Items']->trans_no == 0)
                $cart->reference = $_POST['ref'];