X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=blobdiff_plain;f=sales%2Fcreate_recurrent_invoices.php;h=3f359f8cd0a0bf5093f51d681cd1a881e0bbe130;hb=c34e563fae8003a637a485b4eaf634678b90c60f;hp=06c045ec3fbde8b1976d7fb05284d42cdbc25cf6;hpb=832403f85f84fc91734eca085a32db6a509ffd3d;p=fa-stable.git diff --git a/sales/create_recurrent_invoices.php b/sales/create_recurrent_invoices.php index 06c045ec..3f359f8c 100644 --- a/sales/create_recurrent_invoices.php +++ b/sales/create_recurrent_invoices.php @@ -1,13 +1,13 @@ . + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + See the License here . ***********************************************************************/ $page_security = 'SA_SALESINVOICE'; $path_to_root = ".."; @@ -96,11 +96,11 @@ if ($id != -1) whole invoiced time is invoices are issued _after_ invoiced period is gone, eg: begin 1.1 - end 31.3 - period: invoice ready for issue since: - 1.1-31.1 - 1.2 - 1.2-28.2 - 1.3 - 1.3-31.3 - 1.4 + end 31.3 + period: invoice ready for issue since: + 1.1-31.1 - 1.2 + 1.2-28.2 - 1.3 + 1.3-31.3 - 1.4 In example above, when end is set to 1.4 will generate additional invoice on 1.5 ! */ @@ -114,7 +114,7 @@ if ($id != -1) $invs = array(); if (recurrent_invoice_ready($id, $date)) { - begin_transaction(); + begin_transaction(); if ($myrow['debtor_no'] == 0) { @@ -143,9 +143,8 @@ if ($id != -1) if (count($invs) > 0) { $ar = array('PARAM_0' => $min."-".ST_SALESINVOICE, 'PARAM_1' => $max."-".ST_SALESINVOICE, 'PARAM_2' => "", - 'PARAM_3' => 0, 'PARAM_4' => 0, 'PARAM_5' => "", 'PARAM_6' => user_def_print_orientation()); + 'PARAM_3' => 0, 'PARAM_4' => 0, 'PARAM_5' => "", 'PARAM_6' => "", 'PARAM_7' => user_def_print_orientation()); display_note(print_link(sprintf(_("&Print Recurrent Invoices # %s - # %s"), $min, $max), 107, $ar), 0, 1); - $ar['PARAM_6'] = 1; // orygina³ $ar['PARAM_3'] = 1; // email display_note(print_link(sprintf(_("&Email Recurrent Invoices # %s - # %s"), $min, $max), 107, $ar), 0, 1); } @@ -180,8 +179,10 @@ if ($id != -1) label_row(_('Template:'), get_customer_trans_view_str(ST_SALESORDER, $myrow["order_no"])); label_row(_('Number of invoices:'), $count); date_row(_('Invoice date:'), 'trans_date'); - text_row(_('Invoice notice:'), 'memo', sprintf(_("Recurrent Invoice covers period %s - %s."), $from, add_days($to, -1)), - 100, 100); + $newto = add_months($to, $myrow['monthly']); + $newto = add_days($newto, $myrow['days']); + text_row(_('Invoice notice:'), 'memo', sprintf(_("Recurrent Invoice covers period %s - %s."), $to, add_days($newto, -1)), 100, 100); + //text_row(_('Invoice notice:'), 'memo', sprintf(_("Recurrent Invoice covers period %s - %s."), //$from, add_days($to, -1)), 100, 100); end_table(); hidden('from', $from, true); hidden('to', $to, true); @@ -215,7 +216,7 @@ while ($myrow = db_fetch($result)) alt_table_row_color($k); label_cell($myrow["description"]); - label_cell(get_customer_trans_view_str(ST_SALESORDER, $myrow["order_no"])); + label_cell(get_customer_trans_view_str(ST_SALESORDER, $myrow["order_no"]), "nowrap align='right'"); if ($myrow["debtor_no"] == 0) { label_cell(""); @@ -230,20 +231,20 @@ while ($myrow = db_fetch($result)) label_cell($myrow["days"]); label_cell($myrow['monthly']); label_cell(sql2date($myrow['begin']), "align='center'"); - label_cell(sql2date($myrow['end']), "align='center'"); - label_cell(calculate_next($myrow), "align='center'"); - if ($myrow['overdue']) - { + label_cell(sql2date($myrow['end']), "align='center'"); + label_cell(calculate_next($myrow), "align='center'"); + if ($myrow['overdue']) + { $count = recurrent_invoice_count($myrow['id']); - if ($count) - { + if ($count) + { button_cell("create".$myrow["id"], sprintf(_("Create %s Invoice(s)"), $count), "", ICON_DOC, 'process'); } else { label_cell(''); } } - else - label_cell(""); + else + label_cell(""); end_row(); } end_table();