Purchases/Direct Invoice: added Update button for refreshing tax summary on demand.
[fa-stable.git] / purchasing / includes / ui / po_ui.inc
index 67ce8676ab75f3d8600fd641a2d1b29bcc0a94a0..9a9b716c7c876813e4f815c0d42817573b9217a9 100644 (file)
@@ -84,7 +84,8 @@ function create_new_po($trans_type, $trans_no)
                read_po($trans_no, $cart);
                $cart->order_no = $trans_no;
        } else
-               $cart->reference = $Refs->get_next($trans_type);
+               $cart->reference = $Refs->get_next($trans_type, null,
+                       array('supplier_id' => $cart->supplier_id, 'date' => get_post('OrderDate')));
        $_SESSION['PO'] = &$cart;
 }
 
@@ -273,7 +274,8 @@ function display_po_items(&$order, $editable=true)
 
        start_row();
        label_cells(_("Amount Total"), $display_total, "colspan=$colspan align='right'","align='right'");
-       $order->order_no ? submit_cells('update', _("Update"), "colspan=2 align='center'", _("Refresh"), true)
+       $order->trans_type == ST_SUPPINVOICE
+        ? submit_cells('update', _("Update"), "colspan=2 align='center'", _("Refresh"), true)
                : label_cell('', "colspan=2");
        end_row();