MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the License here <http://www.gnu.org/licenses/gpl-3.0.html>.
***********************************************************************/
-$page_security = 11;
-$path_to_root="..";
+$page_security = 'SA_GRN';
+$path_to_root = "..";
include_once($path_to_root . "/purchasing/includes/po_class.inc");
include_once($path_to_root . "/includes/session.inc");
$qty_outstanding = $ln_itm->quantity - $ln_itm->qty_received;
- if ($ln_itm->receive_qty == 0)
+ if (!isset($_POST['Update']) && !isset($_POST['ProcessGoodsReceived']) && $ln_itm->receive_qty == 0)
{ //If no quantites yet input default the balance to be received
$ln_itm->receive_qty = $qty_outstanding;
}
else
label_cell(number_format2($ln_itm->receive_qty, $dec), "align=right");
- amount_cell($ln_itm->price);
+ amount_decimal_cell($ln_itm->price);
amount_cell($line_total);
end_row();
}
function can_process()
{
+ global $SysPrefs, $Refs;
+
if (count($_SESSION['PO']->line_items) <= 0)
{
display_error(_("There is nothing to process. Please enter valid quantities greater than zero."));
return false;
}
- if (!references::is_valid($_POST['ref']))
+ if (!$Refs->is_valid($_POST['ref']))
{
display_error(_("You must enter a reference."));
set_focus('ref');
foreach ($_SESSION['PO']->line_items as $order_line)
{
if ($order_line->receive_qty+$order_line->qty_received >
- $order_line->quantity * (1+ (sys_prefs::over_receive_allowance() / 100)))
+ $order_line->quantity * (1+ ($SysPrefs->over_receive_allowance() / 100)))
{
$delivery_qty_too_large = 1;
break;
}
elseif ($delivery_qty_too_large == 1)
{
- display_error(_("Entered quantities cannot be greater than the quantity entered on the purchase order including the allowed over-receive percentage") . " (" . sys_prefs::over_receive_allowance() ."%)."
+ display_error(_("Entered quantities cannot be greater than the quantity entered on the purchase order including the allowed over-receive percentage") . " (" . $SysPrefs->over_receive_allowance() ."%)."
. "<br>" .
_("Modify the ordered items on the purchase order if you wish to increase the quantities."));
return false;