Merged changes from mai trunk up to 2.3.1
[fa-stable.git] / purchasing / includes / ui / invoice_ui.inc
index 41ae4b3ba366dc2b791408789f2424e6293e7625..dd2d8ed6dded0be050ac56c1c16db95cd6901714 100644 (file)
@@ -377,11 +377,16 @@ function display_grn_items_for_selection(&$supp_trans, $k)
                qty_cells(null, 'This_QuantityCredited'.$n, number_format2(max($myrow["quantity_inv"], 0), $dec), 
                        null, null, $dec);
             $dec2 = 0;                 
-            amount_cells(null, 'ChgPrice'.$n, price_decimal_format($myrow["unit_price"], $dec2), null, null, $dec2);
             if ($supp_trans->trans_type == ST_SUPPINVOICE)
+            {
+               amount_cells(null, 'ChgPrice'.$n, price_decimal_format($myrow["unit_price"], $dec2), null, null, $dec2);
                amount_cell(round2($myrow["unit_price"] * ($myrow["qty_recd"] - $myrow["quantity_inv"]), user_price_dec()));
-            else       
-               amount_cell(round2($myrow["unit_price"] * max($myrow['quantity_inv'], 0), user_price_dec()));
+            }
+            else
+            {
+               amount_cells(null, 'ChgPrice'.$n, price_decimal_format($myrow["act_price"], $dec2), null, null, $dec2);
+               amount_cell(round2($myrow["act_price"] * max($myrow['quantity_inv'], 0), user_price_dec()));
+            }  
             if ($supp_trans->trans_type == ST_SUPPINVOICE)
                        submit_cells('grn_item_id'.$n, _("Add"), '', _("Add to Invoice"), true);
                else