supplier_name);
echo "
";
//-----------------------------------------------------------------------------------------
function check_data()
{
global $check_price_charged_vs_order_price,
$check_qty_charged_vs_del_qty;
if (!is_numeric($_POST['this_quantity_inv']))
{
display_error( _("The quantity to invoice must be numeric."));
return false;
}
if ($_POST['this_quantity_inv'] <= 0)
{
display_error( _("The quantity to invoice must be greater than zero."));
return false;
}
if (!is_numeric($_POST['ChgPrice']))
{
display_error( _("The price is not numeric."));
return false;
}
if ($check_price_charged_vs_order_price == True)
{
if ($_POST['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() . "%");
return false;
}
}
if ($check_qty_charged_vs_del_qty == True)
{
if ($_POST['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() . "%");
return false;
}
}
return true;
}
//-----------------------------------------------------------------------------------------
if (isset($_POST['AddGRNToTrans']))
{
if (check_data())
{
if ($_POST['this_quantity_inv'] >= ($_POST['qty_recd'] - $_POST['prev_quantity_inv']))
{
$complete = True;
}
else
{
$complete = False;
}
//$_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_quantity_inv'],
// $_POST['order_price'], $_POST['ChgPrice'], $complete,
// $_POST['std_cost_unit'], $_POST['gl_code']);
$_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_quantity_inv'],
$_POST['order_price'], $_POST['ChgPrice'], $complete,
$_POST['std_cost_unit'], "");
}
}
//-----------------------------------------------------------------------------------------
if (isset($_GET['Delete']))
{
$_SESSION['supp_trans']->remove_grn_from_trans($_GET['Delete']);
}
//-----------------------------------------------------------------------------------------
display_grn_items($_SESSION['supp_trans'], 1);
echo "
";
hyperlink_no_params("$path_to_root/purchasing/supplier_invoice.php", _("Back to Supplier Invoice Entry"));
echo "