[0003780] Sales Invoice to partial delivery was improperly issued as final prepayment...
[fa-stable.git] / sales / includes / ui / sales_order_ui.inc
index 7b91967b97ab7bb734e393d297781c7496f53c17..4b697c514f6526d4dd2307e7e4fa2cedab40b085 100644 (file)
@@ -499,7 +499,10 @@ function sales_order_item_controls(&$order, &$rowcounter, $line_no=-1)
        }
        else    // prepare new line
        {
-               sales_items_list_cells(null,'stock_id', null, false, true, true);
+               if ($order->fixed_asset)
+                       stock_disposable_fa_list_cells(null,'stock_id', null, _('[Select item]'), true, $order->line_items);
+               else
+                       sales_items_list_cells(null,'stock_id', null, false, true, true);
                if (list_updated('stock_id')) {
                            $Ajax->activate('price');
                            $Ajax->activate('units');
@@ -519,7 +522,11 @@ function sales_order_item_controls(&$order, &$rowcounter, $line_no=-1)
                $_POST['Disc'] = percent_format($order->default_discount * 100);
        }
 
-       qty_cells(null, 'qty', $_POST['qty'], null, null, $dec);
+       if ($order->fixed_asset) {
+               label_cell(1, '', 'qty');
+               hidden('qty', 1);
+       } else 
+               qty_cells(null, 'qty', $_POST['qty'], null, null, $dec);
 
        if ($order->trans_no!=0) {
                qty_cell($line_no==-1 ? 0 :$order->line_items[$line_no]->qty_done, false, $dec);
@@ -599,8 +606,8 @@ function display_delivery_details(&$order)
                start_outer_table(TABLESTYLE2, "width='90%'");
                table_section(1);
 
-               locations_list_row(_("Deliver from Location:"), 'Location', null, false, true);
-               if ($order->payment_terms['days_before_due'] < 0)
+               locations_list_row(_("Deliver from Location:"), 'Location', null, false, true, $order->fixed_asset);
+               if ($order->payment_terms['days_before_due'] == -1)
                {
                        $Ajax->addUpdate('items_table', 'prep_amount', price_format($order->get_trans_total())); // bind to items_table update
                        if (!$order->is_started())