X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=blobdiff_plain;f=purchasing%2Fsupplier_invoice_grns.php;h=13f4d3040b78c7182b9b6c1d3668243e1ed07fdc;hb=3a1f2b3032483a04ffca4bb037ddb5c73d4730a7;hp=8cea6d8ec1564765d7bb64480665805522762fe6;hpb=0ad7b92c6cf2e4e65ca0fa94ba31f30f7b292ba8;p=fa-stable.git diff --git a/purchasing/supplier_invoice_grns.php b/purchasing/supplier_invoice_grns.php index 8cea6d8e..13f4d304 100644 --- a/purchasing/supplier_invoice_grns.php +++ b/purchasing/supplier_invoice_grns.php @@ -36,23 +36,29 @@ function check_data() 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; + } } } @@ -63,6 +69,7 @@ function check_data() { 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; } } @@ -164,7 +171,8 @@ function display_grn_items_for_selection() 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++; @@ -202,7 +210,7 @@ if (isset($_POST['grn_item_id']) && $_POST['grn_item_id'] != "") label_cell($myrow['item_code']); label_cell($myrow['description']); qty_cell($myrow['QtyOstdg']); - amount_cells(null, 'this_quantity_inv', qty_format($myrow['QtyOstdg'])); + qty_cells(null, 'this_quantity_inv', qty_format($myrow['QtyOstdg'])); amount_cell($myrow['unit_price']); small_amount_cells(null, 'ChgPrice', price_format($myrow['unit_price'])); end_row();