MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the License here <http://www.gnu.org/licenses/gpl-3.0.html>.
***********************************************************************/
-$page_security = 10;
+$page_security = 'SA_PAYTERMS';
$path_to_root="..";
include($path_to_root . "/includes/session.inc");
-page(_("Payment Terms"));
+page(_($help_context = "Payment Terms"));
include($path_to_root . "/includes/ui.inc");
$inpug_error = 1;
display_error( _("The Terms description must be entered."));
set_focus('terms');
- }
- elseif ($_POST['DayNumber'] > 30 && !check_value('DaysOrFoll'))
- {
- $inpug_error = 1;
- display_error( _("When the check box to indicate a day in the following month is the due date, the due date cannot be a day after the 30th. A number between 1 and 30 is expected."));
- set_focus('DayNumber');
- }
- elseif ($_POST['DayNumber'] > 500 && check_value('DaysOrFoll'))
- {
- $inpug_error = 1;
- display_error( _("When the check box is not checked to indicate that the term expects a number of days after which accounts are due, the number entered should be less than 500 days."));
- set_focus('DayNumber');
- }
+ } // there should be no limits by 30 here if they want longer payment terms. Joe Hunt 2010-05-31
+ //elseif ($_POST['DayNumber'] > 30 && !check_value('DaysOrFoll'))
+ //{
+ // $inpug_error = 1;
+ // display_error( _("When the check box to indicate a day in the following month is the due date, the due date cannot be a day after the 30th. A number between 1 and 30 is expected."));
+ // set_focus('DayNumber');
+ //}
+ // No constrain on day values, Joe Hunt 2010-06-18.
+ //elseif ($_POST['DayNumber'] > 500 && check_value('DaysOrFoll'))
+ //{
+ // $inpug_error = 1;
+ // display_error( _("When the check box is not checked to indicate that the term expects a number of days after which accounts are due, the number entered should be less than 500 days."));
+ // set_focus('DayNumber');
+ //}
if ($_POST['DayNumber'] == '')
$_POST['DayNumber'] = 0;
if ($Mode == 'RESET')
{
$selected_id = -1;
+ $sav = get_post('show_inactive');
unset($_POST);
+ $_POST['show_inactive'] = $sav;
}
//-------------------------------------------------------------------------------------------------
$sql = "SELECT * FROM ".TB_PREF."payment_terms";
+if (!check_value('show_inactive')) $sql .= " WHERE !inactive";
$result = db_query($sql,"could not get payment terms");
+
start_form();
start_table($table_style);
$th = array(_("Description"), _("Following Month On"), _("Due After (Days)"), "", "");
+inactive_control_column($th);
table_header($th);
$k = 0; //row colour counter
label_cell($myrow["terms"]);
label_cell($full_text);
label_cell($after_text);
+ inactive_control_cell($myrow["terms_indicator"], $myrow["inactive"], 'payment_terms', "terms_indicator");
edit_button_cell("Edit".$myrow["terms_indicator"], _("Edit"));
delete_button_cell("Delete".$myrow["terms_indicator"], _("Delete"));
end_row();
} //END WHILE LIST LOOP
-end_table();
-end_form();
-echo '<br>';
+inactive_control_row($th);
+end_table(1);
//-------------------------------------------------------------------------------------------------
-start_form();
-
start_table($table_style2);
$day_in_following_month = $days_before_due = 0;
$_POST['terms'] = $myrow["terms"];
$days_before_due = $myrow["days_before_due"];
$day_in_following_month = $myrow["day_in_following_month"];
+ unset($_POST['DayNumber']);
}
hidden('selected_id', $selected_id);
}
end_table(1);
-submit_add_or_update_center($selected_id == -1, '', true);
+submit_add_or_update_center($selected_id == -1, '', 'both');
end_form();