From: Joe Hunt Date: Mon, 6 Sep 2010 22:23:06 +0000 (+0000) Subject: Removed all decimal roundings in cost price calculations X-Git-Tag: v2.4.2~19^2~635 X-Git-Url: https://delta.frontaccounting.com/gitweb/?p=fa-stable.git;a=commitdiff_plain;h=a8b1d5c9c416ae3d1863d0625d0cd42d39107b92 Removed all decimal roundings in cost price calculations --- diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 7bc06986..4909b54f 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -19,6 +19,11 @@ Legend: ! -> Note $ -> Affected files +07-Sep-2010 Joe Hunt/Chaitanya +! Removed all decimal roundings in cost price calculations +$ /purchasing/includes/db/grn_db.inc + /manufacturing/includes/db/work_orders_db.inc + 06-Sep-2010 Janusz Dobrowolski # Fixed error on new contact add. $ /includes/ui/contacts_view.inc diff --git a/manufacturing/includes/db/work_orders_db.inc b/manufacturing/includes/db/work_orders_db.inc index 4a442a8b..830b33b9 100644 --- a/manufacturing/includes/db/work_orders_db.inc +++ b/manufacturing/includes/db/work_orders_db.inc @@ -20,8 +20,8 @@ function add_material_cost($stock_id, $qty, $date_) $standard_cost = get_standard_cost($bom_item['component']); $m_cost += ($bom_item['quantity'] * $standard_cost); } - $dec = user_price_dec(); - price_decimal_format($m_cost, $dec); + //$dec = user_price_dec(); + //price_decimal_format($m_cost, $dec); $sql = "SELECT material_cost FROM ".TB_PREF."stock_master WHERE stock_id = " .db_escape($stock_id); $result = db_query($sql); @@ -41,8 +41,8 @@ function add_material_cost($stock_id, $qty, $date_) function add_overhead_cost($stock_id, $qty, $date_, $costs) { - $dec = user_price_dec(); - price_decimal_format($costs, $dec); + //$dec = user_price_dec(); + //price_decimal_format($costs, $dec); if ($qty != 0) $costs /= $qty; $sql = "SELECT overhead_cost FROM ".TB_PREF."stock_master WHERE stock_id = " @@ -64,8 +64,8 @@ function add_overhead_cost($stock_id, $qty, $date_, $costs) function add_labour_cost($stock_id, $qty, $date_, $costs) { - $dec = user_price_dec(); - price_decimal_format($costs, $dec); + //$dec = user_price_dec(); + //price_decimal_format($costs, $dec); if ($qty != 0) $costs /= $qty; $sql = "SELECT labour_cost FROM ".TB_PREF."stock_master WHERE stock_id = " @@ -94,8 +94,8 @@ function add_issue_cost($stock_id, $qty, $date_, $costs) $result = db_query($sql); $myrow = db_fetch($result); $material_cost = $myrow['material_cost']; - $dec = user_price_dec(); - price_decimal_format($material_cost, $dec); + //$dec = user_price_dec(); + //price_decimal_format($material_cost, $dec); //$qoh = get_qoh_on_date($stock_id, null, $date_); $qoh = get_qoh_on_date($stock_id); if ($qoh < 0) diff --git a/purchasing/includes/db/grn_db.inc b/purchasing/includes/db/grn_db.inc index a73efa6f..344677ea 100644 --- a/purchasing/includes/db/grn_db.inc +++ b/purchasing/includes/db/grn_db.inc @@ -26,9 +26,9 @@ function update_average_material_cost($supplier, $stock_id, $price, $qty, $date, $price = get_tax_free_price_for_item($stock_id, $price, $supp['tax_group_id'], $supp['tax_included']); - $dec = user_price_dec(); - price_decimal_format($price, $dec); - $price = round2($price, $dec); + //$dec = user_price_dec(); + //price_decimal_format($price, $dec); + //$price = round2($price, $dec); if ($currency != null) { $ex_rate = get_exchange_rate_to_home_currency($currency, $date);