<?php
-
-
+/**********************************************************************
+ Copyright (C) FrontAccounting, LLC.
+ Released under the terms of the GNU General Public License, GPL,
+ as published by the Free Software Foundation, either version 3
+ of the License, or (at your option) any later version.
+ 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 <http://www.gnu.org/licenses/gpl-3.0.html>.
+***********************************************************************/
$page_security = 3;
$path_to_root="../..";
include($path_to_root . "/includes/session.inc");
page(_("Recurrent Invoices"), false, false, "", $js);
-
simple_page_mode(true);
if ($Mode=='ADD_ITEM' || $Mode=='UPDATE_ITEM')
order_no=".db_escape($_POST['order_no']).",
debtor_no=".db_escape($_POST['debtor_no']).",
group_no=".db_escape($_POST['group_no']).",
- days=".input_num('days').",
- monthly=".input_num('monthly').",
+ days=".input_num('days', 0).",
+ monthly=".input_num('monthly', 0).",
begin='".date2sql($_POST['begin'])."',
end='".date2sql($_POST['end'])."'
WHERE id = '$selected_id'";
$sql = "INSERT INTO ".TB_PREF."recurrent_invoices (description, order_no, debtor_no,
group_no, days, monthly, begin, end, last_sent) VALUES (".db_escape($_POST['description']) . ", "
.db_escape($_POST['order_no']).", ".db_escape($_POST['debtor_no']).", "
- .db_escape($_POST['group_no']).", ".input_num('days').", ".input_num('monthly').", '"
+ .db_escape($_POST['group_no']).", ".input_num('days', 0).", ".input_num('monthly', 0).", '"
.date2sql($_POST['begin'])."', '".date2sql($_POST['end'])."', '".date2sql(Add_Years($_POST['begin'], -5))."')";
$note = _('New recurrent invoice has been added');
}
label_cell($end);
label_cell($last_sent);
edit_button_cell("Edit".$myrow["id"], _("Edit"));
- edit_button_cell("Delete".$myrow["id"], _("Delete"));
+ delete_button_cell("Delete".$myrow["id"], _("Delete"));
end_row();
}
end_table();
start_form();
-start_table("$table_style2 width=40%");
+start_table($table_style2);
if ($selected_id != -1)
{
$_POST['monthly'] = $myrow["monthly"];
$_POST['begin'] = sql2date($myrow["begin"]);
$_POST['end'] = sql2date($myrow["end"]);
- }
+ }
hidden("selected_id", $selected_id);
-}
+}
text_row_ex(_("Description:"), 'description', 50);
else
sales_groups_list_row(_("Sales Group:"), 'group_no', null, " ");
-small_amount_row(_("Days:"), 'days', null, null, null, 0);
+small_amount_row(_("Days:"), 'days', 0, null, null, 0);
-small_amount_row(_("Monthly:"), 'monthly', null, null, null, 0);
+small_amount_row(_("Monthly:"), 'monthly', 0, null, null, 0);
date_row(_("Begin:"), 'begin');