if (isset($_POST['ADD_ITEM']) && can_process())
{
- add_sales_type($_POST['sales_type']);
+ add_sales_type($_POST['sales_type'], isset($_POST['tax_included']));
meta_forward($_SERVER['PHP_SELF']);
}
if (isset($_POST['UPDATE_ITEM']) && can_process())
{
- update_sales_type($selected_id, $_POST['sales_type']);
+ update_sales_type($selected_id, $_POST['sales_type'], isset($_POST['tax_included']) ? 1:0);
meta_forward($_SERVER['PHP_SELF']);
}
start_table("$table_style width=30%");
-$th = array (_("Type Name"), "", "");
+$th = array (_("Type Name"), 'Tax Incl', '','');
table_header($th);
$k = 0;
{
alt_table_row_color($k);
label_cell($myrow["sales_type"]);
+ label_cell($myrow["tax_included"] ? _('Yes'):_('No'), 'align=center');
edit_link_cell("selected_id=".$myrow["id"]);
delete_link_cell("selected_id=".$myrow["id"]."&delete=1");
end_row();
hyperlink_no_params($_SERVER['PHP_SELF'], _("New Sales type"));
start_form();
+ if (!isset($_POST['tax_included']))
+ $_POST['tax_included'] = 0;
start_table("$table_style2 width=30%");
$myrow = get_sales_type($selected_id);
$_POST['sales_type'] = $myrow["sales_type"];
+ $_POST['tax_included'] = $myrow["tax_included"];
hidden('selected_id', $selected_id);
}
text_row_ex(_("Sales Type Name:"), 'sales_type', 20);
+check_cells("Tax included", 'tax_included', $_POST['tax_included']);
end_table(1);