X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=blobdiff_plain;f=sales%2Fcustomer_credit_invoice.php;h=a88cdabed2aab5159d5070c458a9aa392b9bd28e;hb=55bddc51260dc87dba6e3217e2117cc760346306;hp=48f3f0d597ef6fd122f3a4a5e0e55451867f89f3;hpb=46c5f7a65a7659a44ae8254c63152074363d3987;p=fa-stable.git diff --git a/sales/customer_credit_invoice.php b/sales/customer_credit_invoice.php index 48f3f0d5..a88cdabe 100644 --- a/sales/customer_credit_invoice.php +++ b/sales/customer_credit_invoice.php @@ -124,25 +124,12 @@ function can_process() if (isset($_GET['InvoiceNumber']) && $_GET['InvoiceNumber'] > 0) { - $ci = new Cart(ST_SALESINVOICE, $_GET['InvoiceNumber'], true); - - $ci->trans_type = ST_CUSTCREDIT; - $ci->src_docs = $ci->trans_no; - $ci->src_date = $ci->document_date; - $ci->trans_no = 0; - $ci->document_date = new_doc_date(); - $ci->reference = $Refs->get_next(ST_CUSTCREDIT); - - for ($line_no=0; $line_noline_items); $line_no++) { - $ci->line_items[$line_no]->qty_dispatched = '0'; - } - - $_SESSION['Items'] = $ci; + $_SESSION['Items'] = new Cart(ST_SALESINVOICE, $_GET['InvoiceNumber'], true); copy_from_cart(); } elseif ( isset($_GET['ModifyCredit']) && $_GET['ModifyCredit']>0) { - $_SESSION['Items'] = new Cart(ST_CUSTCREDIT,$_GET['ModifyCredit']); + $_SESSION['Items'] = new Cart(ST_CUSTCREDIT, $_GET['ModifyCredit']); copy_from_cart(); } elseif (!processing_active()) { @@ -164,10 +151,10 @@ function check_quantities() $_SESSION['Items']->line_items[$line_no]->qty_dispatched = input_num('Line'.$line_no); } + else { + $ok = 0; + } } - else { - $ok = 0; - } if (isset($_POST['Line'.$line_no.'Desc'])) { $line_desc = $_POST['Line'.$line_no.'Desc'];