- sales_items_list_cells(null,'stock_id', null, false, true);
- if (list_updated('stock_id')) {
- $Ajax->activate('price');
- $Ajax->activate('units');
- $Ajax->activate('qty');
- $Ajax->activate('line_total');
- }
+ if ($order->fixed_asset)
+ stock_disposable_fa_list_cells(null,'stock_id', null, _('[Select item]'), true, $order->line_items);
+ else {
+ if (!isset($_POST['stock_id'])) { // Check if stock_id dosesn't exist
+ $_POST['stock_id'] = last_sales_order_detail($order, 'stk_code'); //get the llast sales stock id.
+ }
+ sales_items_list_cells(null,'stock_id', $_POST['stock_id'], false, true, true);
+ }
+ if (list_updated('stock_id')) {
+ $Ajax->activate('price');
+ $Ajax->activate('units');
+ $Ajax->activate('qty');
+ $Ajax->activate('line_total');
+ }