- display_error(_("You are attempting to make the quantity ordered a quantity less than has already been invoiced or received. This is prohibited.") .
- "<br>" . _("The quantity received can only be modified by entering a negative receipt and the quantity invoiced can only be reduced by entering a credit note against this item."));
- set_focus('qty');
- return;
- }
+ if ($_SESSION['PO']->line_items[$_POST['line_no']]->qty_inv > input_num('qty') ||
+ $_SESSION['PO']->line_items[$_POST['line_no']]->qty_received > input_num('qty'))
+ {
+ display_error(_("You are attempting to make the quantity ordered a quantity less than has already been invoiced or received. This is prohibited.") .
+ "<br>" . _("The quantity received can only be modified by entering a negative receipt and the quantity invoiced can only be reduced by entering a credit note against this item."));
+ set_focus('qty');
+ return;
+ }