From: Joe Hunt Date: Wed, 3 Feb 2010 10:30:23 +0000 (+0000) Subject: When buying a service item from a supplier, the delivery produced X-Git-Tag: 2.3-final~994 X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=commitdiff_plain;h=8e1244e235e91e9b59e4b65b85bc9fa0b215f4cb;p=fa-stable.git When buying a service item from a supplier, the delivery produced wrong inventory GL transactions. No GL transactions should be here. [0000200] stock_master material_cost incorrectly updated during GRN when price format uses thousands seperator. A couple of minor errors too. --- diff --git a/CHANGELOG.txt b/CHANGELOG.txt index ff39f740..3b5d0b8d 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -19,6 +19,15 @@ Legend: ! -> Note $ -> Affected files +03-Feb-2010 Joe Hunt +# When buying a service item from a supplier, the delivery produced + wrong inventory GL transactions. No GL transactions should be here. +$ /sales/includes/db/sales_delivery_db.inc +# [0000200] stock_master material_cost incorrectly updated during GRN when + price format uses thousands seperator. A couple of minor errors too. +$ /purchasing/includes/db/grn_db.inc + /purchasing/includes/db/invoices_db.inc + 03-Feb-2010 Chaitanya/Joe + Added a Profit and Loss Drilldown page and changed menu link $ /applications/generalledger.php diff --git a/purchasing/includes/db/grn_db.inc b/purchasing/includes/db/grn_db.inc index b055c1f9..0a491a6f 100644 --- a/purchasing/includes/db/grn_db.inc +++ b/purchasing/includes/db/grn_db.inc @@ -18,10 +18,11 @@ function update_average_material_cost($supplier, $stock_id, $price, $qty, $date, else $currency = null; $dec = user_price_dec(); - $price = price_decimal_format($price, $dec); + price_decimal_format($price, $dec); + $price = round2($price, $dec); if ($currency != null) { - $ex_rate = get_exchange_rate_to_home_currency($currency, $date_); + $ex_rate = get_exchange_rate_to_home_currency($currency, $date); $price_in_home_currency = $price / $ex_rate; //$price_in_home_currency = to_home_currency($price, $currency, $date); } diff --git a/purchasing/includes/db/invoice_db.inc b/purchasing/includes/db/invoice_db.inc index ef60a938..a3a110db 100644 --- a/purchasing/includes/db/invoice_db.inc +++ b/purchasing/includes/db/invoice_db.inc @@ -117,7 +117,7 @@ function get_diff_in_home_currency($supplier, $old_date, $date, $amount1, $amoun $currency = get_supplier_currency($supplier); $ex_rate = get_exchange_rate_to_home_currency($currency, $old_date); $amount1 = $amount1 / $ex_rate; - $ex_rate = get_exchange_rate_to_home_currency($currency, $date_); + $ex_rate = get_exchange_rate_to_home_currency($currency, $date); $amount2 = $amount2 / $ex_rate; $diff = $amount2 - $amount1; return round2($diff, $dec); diff --git a/sales/includes/db/sales_delivery_db.inc b/sales/includes/db/sales_delivery_db.inc index 8bd2d785..0cded9cc 100644 --- a/sales/includes/db/sales_delivery_db.inc +++ b/sales/includes/db/sales_delivery_db.inc @@ -66,6 +66,10 @@ function write_sales_delivery(&$delivery,$bo_policy) if ($trans_no != 0) // Inserted 2008-09-25 Joe Hunt $delivery_line->standard_cost = get_standard_cost($delivery_line->stock_id); + // do not use standard cost if it's a non-inventory item, 2010-02-03 Joe Hunt + if (!is_inventory_item($delivery_line->stock_id)) + $delivery_line->standard_cost = 0; + /* add delivery details for all lines */ write_customer_trans_detail_item(ST_CUSTDELIVERY, $delivery_no, $delivery_line->stock_id, $delivery_line->item_description, $delivery_line->qty_dispatched,