X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=blobdiff_plain;f=sales%2Fcreate_recurrent_invoices.php;h=b14b30569dc10ec1716fd60999cbcf713d5ec7d7;hb=c061e1b478cb41d22c23627ddff39a4ea7d849ed;hp=3f359f8cd0a0bf5093f51d681cd1a881e0bbe130;hpb=fcf60152ed8fe3373f9dfe54ca5604e7446f995d;p=fa-stable.git diff --git a/sales/create_recurrent_invoices.php b/sales/create_recurrent_invoices.php index 3f359f8c..b14b3056 100644 --- a/sales/create_recurrent_invoices.php +++ b/sales/create_recurrent_invoices.php @@ -27,12 +27,15 @@ page(_($help_context = "Create and Print Recurrent Invoices"), false, false, "", function create_recurrent_invoices($customer_id, $branch_id, $order_no, $tmpl_no, $date, $from, $to, $memo) { - global $Refs; + global $Refs, $SysPrefs; update_last_sent_recurrent_invoice($tmpl_no, $to); $doc = new Cart(ST_SALESORDER, array($order_no)); - + + if (!empty($SysPrefs->prefs['dim_on_recurrent_invoice'])) + $doc->trans_type = ST_SALESINVOICE; + get_customer_details_to_order($doc, $customer_id, $branch_id); $doc->trans_type = ST_SALESORDER; @@ -43,6 +46,8 @@ function create_recurrent_invoices($customer_id, $branch_id, $order_no, $tmpl_no $doc->reference = $Refs->get_next($doc->trans_type, null, array('customer' => $customer_id, 'branch' => $branch_id, 'date' => $date)); + if (!empty($doc->Comments)) + $memo .= "\n" . $doc->Comments; $doc->Comments = $memo; foreach ($doc->line_items as $line_no=>$item) {