! -> Note
$ -> Affected files
+13-Jan-2010 Joe Hunt
+! Changed so also Item Adjustment and Cost Update allow more than 2 dec in price
+$ /inventory/cost_update.php
+ /inventory/includes/item_adjustments_ui.inc
+ /inventory/view/view_adjustment.php
+
12-Jan-2010 Janusz Dobrowolski
# Fixed buggy exemptions display
$ /taxes/item_tax_types.php
hidden("OldOverheadCost", $myrow["overhead_cost"]);
start_table($table_style2);
+$dec1 = $dec2 = $dec3 = 0;
+$_POST['material_cost'] = price_decimal_format($myrow["material_cost"], $dec1);
+$_POST['labour_cost'] = price_decimal_format($myrow["labour_cost"], $dec2);
+$_POST['overhead_cost'] = price_decimal_format($myrow["overhead_cost"], $dec3);
-$_POST['material_cost'] = price_format($myrow["material_cost"]);
-$_POST['labour_cost'] = price_format($myrow["labour_cost"]);
-$_POST['overhead_cost'] = price_format($myrow["overhead_cost"]);
-
-amount_row(_("Standard Material Cost Per Unit"), "material_cost",
- null, "class='tableheader2'");
-
+amount_row(_("Standard Material Cost Per Unit"), "material_cost", null, "class='tableheader2'", null, $dec1);
if ($myrow["mb_flag"]=='M')
{
- amount_row(_("Standard Labour Cost Per Unit"), "labour_cost",
- null, "class='tableheader2'");
- amount_row(_("Standard Overhead Cost Per Unit"), "overhead_cost",
- null, "class='tableheader2'");
+ amount_row(_("Standard Labour Cost Per Unit"), "labour_cost", null, "class='tableheader2'", null, $dec2);
+ amount_row(_("Standard Overhead Cost Per Unit"), "overhead_cost", null, "class='tableheader2'", null, $dec3);
}
else
{
label_cell($stock_item->item_description);
qty_cell($stock_item->quantity, false, get_qty_dec($stock_item->stock_id));
label_cell($stock_item->units);
- amount_cell($stock_item->standard_cost);
+ amount_decimal_cell($stock_item->standard_cost);
amount_cell($stock_item->standard_cost * $stock_item->quantity);
edit_button_cell("Edit$line_no", _("Edit"),
global $Ajax;
start_row();
+ $dec2 = 0;
$id = find_submit('Edit');
if ($line_no != -1 && $line_no == $id)
{
$_POST['stock_id'] = $order->line_items[$id]->stock_id;
$_POST['qty'] = qty_format($order->line_items[$id]->quantity,
$order->line_items[$id]->stock_id, $dec);
- $_POST['std_cost'] = price_format($order->line_items[$id]->standard_cost);
+ //$_POST['std_cost'] = price_format($order->line_items[$id]->standard_cost);
+ $_POST['std_cost'] = price_decimal_format($order->line_items[$id]->standard_cost, $dec2);
$_POST['units'] = $order->line_items[$id]->units;
hidden('stock_id', $_POST['stock_id']);
$item_info = get_item_edit_info($_POST['stock_id']);
$dec = $item_info['decimals'];
$_POST['qty'] = number_format2(0, $dec);
- $_POST['std_cost'] = price_format($item_info["standard_cost"]);
+ //$_POST['std_cost'] = price_format($item_info["standard_cost"]);
+ $_POST['std_cost'] = price_decimal_format($item_info["standard_cost"], $dec2);
$_POST['units'] = $item_info["units"];
}
qty_cells(null, 'qty', $_POST['qty'], null, null, $dec);
label_cell($_POST['units'], '', 'units');
- amount_cells(null, 'std_cost', $_POST['std_cost']);
+ //amount_cells(null, 'std_cost', $_POST['std_cost']);
+ amount_cells(null, 'std_cost', null, null, null, $dec2);
label_cell(" ");
if ($id != -1)
label_cell($adjustment['description']);
qty_cell($adjustment['qty'], false, get_qty_dec($adjustment['stock_id']));
label_cell($adjustment['units']);
- amount_cell($adjustment['standard_cost']);
+ amount_decimal_cell($adjustment['standard_cost']);
end_row();
}