{
global $Refs;
+ if (!get_post('supplier_id'))
+ {
+ display_error(_("There is no supplier selected."));
+ set_focus('supplier_id');
+ return false;
+ }
+
if (!$_SESSION['supp_trans']->is_valid_trans_to_post())
{
display_error(_("The invoice cannot be processed because the there are no items or values on the invoice. Invoices are expected to have a charge."));
}
}
- if ($SysPrefs->check_qty_charged_vs_del_qty == true && ($_POST['qty_recd'.$n] != $_POST['prev_quantity_inv'.$n]))
+ if ($SysPrefs->check_qty_charged_vs_del_qty == true && ($_POST['qty_recd'.$n] != $_POST['prev_quantity_inv'.$n])
+ && !empty($_POST['prev_quantity_inv'.$n]))
{
if (input_num('this_quantity_inv'.$n) / ($_POST['qty_recd'.$n] - $_POST['prev_quantity_inv'.$n]) >
(1+ ($margin / 100)))
{
if (check_item_data($n))
{
- if (input_num('this_quantity_inv'.$n) >= ($_POST['qty_recd'.$n] - $_POST['prev_quantity_inv'.$n]))
- {
- $complete = true;
- }
- else
- {
- $complete = false;
- }
-
$_SESSION['supp_trans']->add_grn_to_trans($n, $_POST['po_detail_item'.$n],
$_POST['item_code'.$n], $_POST['item_description'.$n], $_POST['qty_recd'.$n],
$_POST['prev_quantity_inv'.$n], input_num('this_quantity_inv'.$n),
- $_POST['order_price'.$n], input_num('ChgPrice'.$n), $complete,
- $_POST['std_cost_unit'.$n], "");
+ $_POST['order_price'.$n], input_num('ChgPrice'.$n));
reset_tax_input();
}
}
$Ajax->activate('inv_tot');
}
-if (get_post('AddGLCodeToTrans'))
+if (get_post('AddGLCodeToTrans') || get_post('update'))
$Ajax->activate('inv_tot');
br();