X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=blobdiff_plain;f=purchasing%2Fsupplier_credit_grns.php;h=373e7676762d3dab7572de075662a01cb71ace8d;hb=41069728f318cd75cfecce474a7ac464e2894615;hp=5f84a39c712b1df5201367f214220e8ff1747f16;hpb=da8311619dd73feae101d246a1957b972e00cbd2;p=fa-stable.git diff --git a/purchasing/supplier_credit_grns.php b/purchasing/supplier_credit_grns.php index 5f84a39c..373e7676 100644 --- a/purchasing/supplier_credit_grns.php +++ b/purchasing/supplier_credit_grns.php @@ -6,10 +6,12 @@ $path_to_root=".."; include_once($path_to_root . "/purchasing/includes/supp_trans_class.inc"); include_once($path_to_root . "/includes/session.inc"); -page(_("Select Received Items to Add")); - include_once($path_to_root . "/purchasing/includes/purchasing_ui.inc"); include_once($path_to_root . "/purchasing/includes/purchasing_db.inc"); +$js = ""; +if ($use_date_picker) + $js .= get_js_date_picker(); +page(_("Select Received Items to Add"), false, false, "", $js); if (!isset($_SESSION['supp_trans'])) { @@ -27,21 +29,17 @@ echo "
"; function check_data() { - if (!is_numeric($_POST['This_QuantityCredited'])) - { - display_error(_("The quantity to credit must be numeric.")); - return false; - } - - if ($_POST['This_QuantityCredited'] <= 0) + if (!check_num('This_QuantityCredited', 0)) { - display_error(_("The quantity to credit must be greater than zero.")); + display_error(_("The quantity to credit must be numeric and greater than zero.")); + set_focus('This_QuantityCredited'); return false; } - if (!is_numeric($_POST['ChgPrice']) || $_POST['ChgPrice'] < 0) + if (!check_num('ChgPrice', 0)) { display_error(_("The price is either not numeric or negative.")); + set_focus('ChgPrice'); return false; } @@ -66,8 +64,8 @@ if (isset($_POST['AddGRNToTrans'])) $_SESSION['supp_trans']->add_grn_to_trans($_POST['GRNNumber'], $_POST['po_detail_item'], $_POST['item_code'], $_POST['item_description'], $_POST['qty_recd'], - $_POST['prev_quantity_inv'], $_POST['This_QuantityCredited'], - $_POST['order_price'], $_POST['ChgPrice'], $complete, + $_POST['prev_quantity_inv'], input_num('This_QuantityCredited'), + $_POST['order_price'], input_num('ChgPrice'), $complete, $_POST['std_cost_unit'], ""); } } @@ -139,7 +137,7 @@ while ($myrow = db_fetch($result)) qty_cell($myrow["quantity_inv"]); qty_cell($myrow["qty_recd"] - $myrow["quantity_inv"]); amount_cell($myrow["unit_price"]); - amount_cell($myrow["unit_price"] * $myrow["quantity_inv"]); + amount_cell(round($myrow["unit_price"] * $myrow["quantity_inv"], user_price_dec())); end_row(); $i++; if ($i > 15) @@ -170,9 +168,9 @@ if (isset($_POST['grn_item_id']) && $_POST['grn_item_id'] != "") label_cell($_POST['grn_item_id']); label_cell($myrow['item_code'] . " " . $myrow['description']); qty_cell($myrow["quantity_inv"]); - text_cells(null, 'This_QuantityCredited', max($myrow['quantity_inv'], 0), 13, 15); + qty_cells(null, 'This_QuantityCredited', qty_format(max($myrow['quantity_inv'],0))); amount_cell($myrow['unit_price']); - text_cells(null, 'ChgPrice', $myrow['unit_price'], 13, 15); + amount_cells(null, 'ChgPrice', price_format($myrow['unit_price'])); end_row(); end_table(1);