From: Janusz Dobrowolski Date: Mon, 10 Mar 2008 16:02:13 +0000 (+0000) Subject: Proper calculation of due date on template invoices fixed X-Git-Tag: v2.4.2~19^2~2200 X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=commitdiff_plain;h=8f6db6a1dc29f18e980a0b7ebee3319071aa2fb1;p=fa-stable.git Proper calculation of due date on template invoices fixed --- diff --git a/sales/customer_invoice.php b/sales/customer_invoice.php index fb726cd0..afbd3513 100644 --- a/sales/customer_invoice.php +++ b/sales/customer_invoice.php @@ -107,6 +107,7 @@ if ( (isset($_GET['DeliveryNumber']) && ($_GET['DeliveryNumber'] > 0) ) $dn->src_docs = $dn->trans_no; $dn->trans_no = 0; $dn->reference = references::get_next(10); + $dn->due_date = get_invoice_duedate($dn->customer_id, $dn->document_date); $_SESSION['Items'] = $dn; copy_from_cart(); diff --git a/sales/sales_order_entry.php b/sales/sales_order_entry.php index 3b1dacb1..1b204354 100644 --- a/sales/sales_order_entry.php +++ b/sales/sales_order_entry.php @@ -355,21 +355,21 @@ function create_cart($type, $trans_no) $doc_type = $type; if($type != 30 && $trans_no != 0) { // this is template - $doc_type = 30; + $doc_type = 30; - $doc = new Cart(30, array($trans_no)); - $doc->trans_type = $type; - $doc->trans_no = 0; + $doc = new Cart(30, array($trans_no)); + $doc->trans_type = $type; + $doc->trans_no = 0; - $doc->due_date = $doc->document_date = Today(); - $doc->reference = references::get_next($doc->trans_type); - $doc->Comments=''; - foreach($doc->line_items as $line_no => $line) { - $doc->line_items[$line_no]->qty_done = 0; - } - $_SESSION['Items'] = $doc; + $doc->due_date = $doc->document_date = Today(); + $doc->reference = references::get_next($doc->trans_type); + $doc->Comments=''; + foreach($doc->line_items as $line_no => $line) { + $doc->line_items[$line_no]->qty_done = 0; + } + $_SESSION['Items'] = $doc; } else - $_SESSION['Items'] = new Cart($type,array($trans_no)); + $_SESSION['Items'] = new Cart($type,array($trans_no)); copy_from_cart(); }