if (!check_num('this_quantity_inv', 0) || input_num('this_quantity_inv')==0)
{
display_error( _("The quantity to invoice must be numeric and greater than zero."));
+ set_focus('this_quantity_inv');
return false;
}
if (!check_num('ChgPrice'))
{
display_error( _("The price is not numeric."));
+ set_focus('ChgPrice');
return false;
}
if ($check_price_charged_vs_order_price == True)
{
- if (input_num('ChgPrice')/$_POST['order_price'] >
- (1 + (sys_prefs::over_charge_allowance() / 100)))
- {
+ if ($_POST['order_price']!=input_num('ChgPrice')) {
+ if ($_POST['order_price']==0 ||
+ input_num('ChgPrice')/$_POST['order_price'] >
+ (1 + (sys_prefs::over_charge_allowance() / 100)))
+ {
display_error(_("The price being invoiced is more than the purchase order price by more than the allowed over-charge percentage. The system is set up to prohibit this. See the system administrator to modify the set up parameters if necessary.") .
_("The over-charge percentage allowance is :") . sys_prefs::over_charge_allowance() . "%");
+ set_focus('ChgPrice');
return false;
+ }
}
}
{
display_error( _("The quantity being invoiced is more than the outstanding quantity by more than the allowed over-charge percentage. The system is set up to prohibit this. See the system administrator to modify the set up parameters if necessary.")
. _("The over-charge percentage allowance is :") . sys_prefs::over_charge_allowance() . "%");
+ set_focus('this_quantity_inv');
return false;
}
}
qty_cell($myrow["quantity_inv"]);
qty_cell($myrow["qty_recd"] - $myrow["quantity_inv"]);
amount_cell($myrow["unit_price"]);
- amount_cell($myrow["unit_price"] * ($myrow["qty_recd"] - $myrow["quantity_inv"]));
+ amount_cell(round($myrow["unit_price"] * ($myrow["qty_recd"] - $myrow["quantity_inv"]),
+ user_price_dec()));
end_row();
$i++;