function line_start_focus() {
global $Ajax;
-
+
$Ajax->activate('items_table');
$Ajax->addFocus(true, '_stock_id_edit');
set_focus('_stock_id_edit');
{
if ($_POST['UpdateItem'] != '' && check_item_data()) {
$_SESSION['Items']->update_cart_item($_POST['LineNo'],
- input_num('qty'), input_num('price'),
+ input_num('qty'), input_num('price'),
input_num('Disc') / 100 );
}
copy_from_cart();
function handle_new_item()
{
-
+
if (!check_item_data()) {
return;
}
$doc = new Cart(30, array($trans_no));
$doc->trans_type = $type;
$doc->trans_no = 0;
+ $doc->document_date = Today(); // 2006-06-15. Added so Invoices and Deliveries get current day
if ($type == 10)
$doc->due_date = get_invoice_duedate($doc->customer_id, $doc->document_date);
else
- $doc->due_date = $doc->document_date = Today();
+ $doc->due_date = $doc->document_date;
$doc->reference = references::get_next($doc->trans_type);
$doc->Comments='';
foreach($doc->line_items as $line_no => $line) {
$doc->line_items[$line_no]->qty_done = 0;
}
$_SESSION['Items'] = $doc;
- } else
+ } else
$_SESSION['Items'] = new Cart($type,array($trans_no));
copy_from_cart();
}
_('Validate changes and update document'), true);
}
- submit_center_last('CancelOrder', $cancelorder,
+ submit_center_last('CancelOrder', $cancelorder,
_('Cancels document entry or removes sales order when editing an old document'));
} else {
display_error($customer_error);