// if (!is_date_in_fiscalyear($_POST['OrderDate']))
// $_POST['OrderDate'] = end_fiscalyear();
//}
- date_row(_("Order Date:"), 'OrderDate', '', $_POST['OrderDate'], 0, 0, 0);
+ date_row(_("Order Date:"), 'OrderDate', '', $_POST['OrderDate'], 0, 0, 0, null, true);
+ if (isset($_POST['_OrderDate_changed'])) {
+ $Ajax->activate('_ex_rate');
+ }
text_row(_("Supplier's Reference:"), 'Requisition', null, 16, 15);
hidden('line_no', ($_SESSION['PO']->lines_on_order + 1));
stock_purchasable_items_list_cells(null, 'stock_id', null, false, true);
- if(isset($_POST['_stock_id_update'])) {
+ if (list_updated('stock_id')) {
$Ajax->activate('price');
$Ajax->activate('units');
$Ajax->activate('qty');
$item_info = get_item_edit_info($_POST['stock_id']);
$_POST['units'] = $item_info["units"];
- $dec = get_qty_dec($_POST['stock_id']);
- $_POST['qty'] = qty_format(1, $_POST['stock_id'], $dec);
+ $dec = $item_info["decimals"];
+ $_POST['qty'] = number_format2(1, $dec);
$_POST['price'] = price_format(get_purchase_price ($order->supplier_id, $_POST['stock_id']));
$_POST['req_del_date'] = add_days(Today(), 10);
}