From: Joe Hunt Date: Thu, 17 Mar 2011 00:05:48 +0000 (+0100) Subject: [0000644] Unable o void delivery note and [0000645] Error entering written off Credit... X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=commitdiff_plain;h=4470b5cb5f360d88b27ac37664159b20a0498581;p=textcart.git [0000644] Unable o void delivery note and [0000645] Error entering written off Credit Note --- diff --git a/admin/db/voiding_db.inc b/admin/db/voiding_db.inc index 62165c1..17d7a8d 100644 --- a/admin/db/voiding_db.inc +++ b/admin/db/voiding_db.inc @@ -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; } diff --git a/sales/credit_note_entry.php b/sales/credit_note_entry.php index 513fb25..56e81a1 100644 --- a/sales/credit_note_entry.php +++ b/sales/credit_note_entry.php @@ -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); } //----------------------------------------------------------------------------- diff --git a/sales/customer_credit_invoice.php b/sales/customer_credit_invoice.php index 24f70ce..ff6e457 100644 --- a/sales/customer_credit_invoice.php +++ b/sales/customer_credit_invoice.php @@ -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'];