Fixed multiply small issues mainly related to php5.3.
[fa-stable.git] / sales / create_recurrent_invoices.php
index 04c4bda526256d21355ae7b4f67aba3b9c3d6b77..dcc9cffe44c4c11b3ab491cf18ac1707894b55ff 100644 (file)
@@ -35,7 +35,7 @@ function create_recurrent_invoices($customer_id, $branch_id, $order_no, $tmpl_no
        $doc->trans_no = 0;
        $doc->document_date = Today(); // 2006-06-15. Added so Invoices and Deliveries get current day
 
-       $doc->due_date = get_invoice_duedate($doc->customer_id, $doc->document_date);
+       $doc->due_date = get_invoice_duedate($doc->payment, $doc->document_date);
        $doc->reference = $Refs->get_next($doc->trans_type);
        //$doc->Comments='';
 
@@ -81,7 +81,7 @@ if (isset($_GET['recurrent']))
                display_notification(sprintf(_("%s recurrent invoice(s) created, # $min - # $max."), count($invs)));
                if (count($invs) > 0)
                {
-                       $ar = array('PARAM_0' => $min,  'PARAM_1' => $max, 'PARAM_2' => "",
+                       $ar = array('PARAM_0' => $min."-".ST_SALESINVOICE,      'PARAM_1' => $max."-".ST_SALESINVOICE, 'PARAM_2' => "",
                                'PARAM_3' => 0, 'PARAM_4' => 0, 'PARAM_5' => "", 'PARAM_6' => ST_SALESINVOICE);
                        display_note(print_link(_("&Print Recurrent Invoices # $min - # $max"), 107, $ar), 0, 1);
                        $ar['PARAM_3'] = 1; 
@@ -94,7 +94,7 @@ if (isset($_GET['recurrent']))
 
 $result = get_recurrent_invoices();
 
-start_table("$table_style width=70%");
+start_table(TABLESTYLE, "width=70%");
 $th = array(_("Description"), _("Template No"),_("Customer"),_("Branch")."/"._("Group"),_("Days"),_("Monthly"),_("Begin"),_("End"),_("Last Created"),"");
 table_header($th);
 $k = 0;