[0000644] Unable o void delivery note and [0000645] Error entering written off Credit...
[fa-stable.git] / sales / credit_note_entry.php
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);
 }
 
 //-----------------------------------------------------------------------------