<?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="..";
function can_process()
{
+ global $selected_id;
+
if (strlen($_POST['name']) == 0)
{
display_error(_("The tax type name cannot be empty."));
return false;
}
+ if (!is_tax_gl_unique(get_post('sales_gl_code', 'purchasing_gl_code', $selected_id))) {
+ display_error( _("Selected GL Accounts cannot be used by another tax type."));
+ set_focus('sales_gl_code');
+ return false;
+ }
return true;
}
{
add_tax_type($_POST['name'], $_POST['sales_gl_code'],
- $_POST['purchasing_gl_code'], input_num('rate'));
+ $_POST['purchasing_gl_code'], input_num('rate', 0));
display_notification(_('New tax type has been added'));
$Mode = 'RESET';
}
$result = get_all_tax_types();
start_form();
+
+display_note(_("To avoid problems with manual journal entry all tax types should have unique Sales/Purchasing GL accounts."));
start_table($table_style);
$th = array(_("Description"), _("Default Rate (%)"),
label_cell($myrow["purchasing_gl_code"] . " " . $myrow["PurchasingAccountName"]);
edit_button_cell("Edit".$myrow["id"], _("Edit"));
- edit_button_cell("Delete".$myrow["id"], _("Delete"));
+ delete_button_cell("Delete".$myrow["id"], _("Delete"));
end_row();
}