X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=blobdiff_plain;ds=sidebyside;f=purchasing%2Fsupplier_invoice_grns.php;h=c334a699c31bbf6b517dd90072acf5e8945e6469;hb=ba6ef7ddb2676a61cb46091d299708473beb659e;hp=8cea6d8ec1564765d7bb64480665805522762fe6;hpb=0ad7b92c6cf2e4e65ca0fa94ba31f30f7b292ba8;p=fa-stable.git
diff --git a/purchasing/supplier_invoice_grns.php b/purchasing/supplier_invoice_grns.php
index 8cea6d8e..c334a699 100644
--- a/purchasing/supplier_invoice_grns.php
+++ b/purchasing/supplier_invoice_grns.php
@@ -2,19 +2,19 @@
$page_security = 5;
$path_to_root="..";
-include_once($path_to_root . "/purchasing/includes/supp_trans_class.inc");
+include_once($path_to_root . "/purchasing/includes/supp_trans_class.inc");
include_once($path_to_root . "/includes/session.inc");
-
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();
+if ($use_popup_windows)
+ $js .= get_js_open_window(900, 500);
page(_("Select Received Items to Add"), false, false, "", $js);
-
if (!isset($_SESSION['supp_trans']))
{
display_note("To enter supplier transactions the supplier must first be selected from the supplier selection screen, then the link to enter a supplier credit note must be clicked on.", 1, 0);;
@@ -33,36 +33,43 @@ function check_data()
{
global $check_price_charged_vs_order_price,
$check_qty_charged_vs_del_qty;
- if (!check_num('this_quantity_inv', 0) || input_num('this_quantity_inv')==0)
+ 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 ($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;
+ }
}
}
- if ($check_qty_charged_vs_del_qty == True)
+ if ($check_qty_charged_vs_del_qty == True)
{
- if (input_num('this_quantity_inv') / ($_POST['qty_recd'] - $_POST['prev_quantity_inv']) >
+ if (input_num('this_quantity_inv') / ($_POST['qty_recd'] - $_POST['prev_quantity_inv']) >
(1+ (sys_prefs::over_charge_allowance() / 100)))
{
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;
}
}
@@ -79,11 +86,11 @@ if (isset($_POST['AddGRNToTrans']))
{
if (input_num('this_quantity_inv') >= ($_POST['qty_recd'] - $_POST['prev_quantity_inv']))
{
- $complete = True;
- }
- else
+ $complete = true;
+ }
+ else
{
- $complete = False;
+ $complete = false;
}
$_SESSION['supp_trans']->add_grn_to_trans($_POST['GRNNumber'], $_POST['po_detail_item'],
@@ -95,17 +102,20 @@ if (isset($_POST['AddGRNToTrans']))
}
//-----------------------------------------------------------------------------------------
-
-if (isset($_GET['Delete']))
+$id = find_submit('Delete');
+if ($id != -1)
{
- $_SESSION['supp_trans']->remove_grn_from_trans($_GET['Delete']);
+ $_SESSION['supp_trans']->remove_grn_from_trans($id);
+ $Ajax->activate('grn_items');
+ $Ajax->activate('grn_table');
}
//-----------------------------------------------------------------------------------------
-
+start_form(false,true);
display_grn_items($_SESSION['supp_trans'], 1);
-
+end_form();
echo "
";
+
hyperlink_no_params("$path_to_root/purchasing/supplier_invoice.php", _("Back to Supplier Invoice Entry"));
echo "