<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[FrontAccounting forum — Inventory Valuation]]></title>
	<link rel="self" href="https://frontaccounting.com/punbb/extern.php?action=feed&amp;tid=5095&amp;type=atom" />
	<updated>2018-09-23T15:07:28Z</updated>
	<generator>PunBB</generator>
	<id>https://frontaccounting.com/punbb/viewtopic.php?id=5095</id>
		<entry>
			<title type="html"><![CDATA[Re: Inventory Valuation]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=32716#p32716" />
			<content type="html"><![CDATA[<p>checked, and try to set&nbsp; $use_costed_values is set to 0 (before is 1), <br />not shown the last value in standard_cost 171666.66666667</p><p>actually this raise questions:<br />1. why this line having price 17?&nbsp; <br />&lt;code&gt;<br />1317 |&nbsp; &nbsp; &nbsp; 384 | 8996969010247 |&nbsp; &nbsp;25 | SUB&nbsp; &nbsp; &nbsp; | 2017-05-23 |&nbsp; &nbsp; &nbsp;17 |&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;|&nbsp; &nbsp;1 |&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 225000 |&nbsp; &nbsp;25 | NULL&nbsp; &nbsp; &nbsp; |&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 17 | IDR&nbsp; &nbsp; &nbsp; &nbsp;|<br />1495 |&nbsp; &nbsp; &nbsp; 439 | 8996969010247 |&nbsp; &nbsp;25 | SUB&nbsp; &nbsp; &nbsp; | 2017-07-11 |&nbsp; &nbsp; &nbsp;17 |&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;|&nbsp; 10 | 171666.66666667 |&nbsp; &nbsp;25 | NULL&nbsp; &nbsp; &nbsp; |&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 17 | IDR&nbsp; &nbsp; &nbsp; &nbsp;|<br />&lt;/code&gt;</p><p>as check it item transactions number is IDR (as home currency also)?</p>]]></content>
			<author>
				<name><![CDATA[ichtus]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=12975</uri>
			</author>
			<updated>2018-09-23T15:07:28Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=32716#p32716</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Inventory Valuation]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=32705#p32705" />
			<content type="html"><![CDATA[<p>I am also getting similar bug. Let me try this by checking update_average_material_cost.</p>]]></content>
			<author>
				<name><![CDATA[kvvaradha]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=19348</uri>
			</author>
			<updated>2018-09-21T09:25:10Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=32705#p32705</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Inventory Valuation]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=32704#p32704" />
			<content type="html"><![CDATA[<p>Hi Joe, </p><p>I have troubleshooting rep301.php</p><div class="codebox"><pre><code>function get_domestic_price($myrow, $stock_id)
{
        if ($myrow[&#039;type&#039;] == ST_SUPPRECEIVE || $myrow[&#039;type&#039;] == ST_SUPPCREDIT)
        {
                #below using standard_cost, change price to standard_cost
                $price = $myrow[&#039;price&#039;];
                #$price = $myrow[&#039;standard_cost&#039;];
                if ($myrow[&#039;person_id&#039;] &gt; 0)
                {
                        // Do we have foreign currency?
                        $supp = get_supplier($myrow[&#039;person_id&#039;]);
                        $currency = $supp[&#039;curr_code&#039;];
                        $ex_rate = get_exchange_rate_to_home_currency($currency, sql2date($myrow[&#039;tran_date&#039;]));
                        $price /= $ex_rate;
                }
        }
        else
                $price = $myrow[&#039;standard_cost&#039;]; // Item Adjustments just have the real cost
        return $price;
}</code></pre></div><p>sql query adding for currency type<br /></p><div class="codebox"><pre><code>SELECT move.*, move.type, debtor.curr_code, supplier.supplier_id, supplier.curr_code FROM 23_stock_moves move LEFT JOIN 23_supp_trans credit ON credit.trans_no=move.trans_no AND credit.type=move.type LEFT JOIN 23_grn_batch grn ON grn.id=move.trans_no AND 25=move.type LEFT JOIN 23_suppliers supplier ON IFNULL(grn.supplier_id, credit.supplier_id)=supplier.supplier_id LEFT JOIN 23_debtor_trans cust_trans ON cust_trans.trans_no=move.trans_no AND cust_trans.type=move.type LEFT JOIN 23_debtors_master debtor ON cust_trans.debtor_no=debtor.debtor_no WHERE stock_id=8996969010247;
+----------+----------+---------------+------+----------+------------+--------+-----------+-----+-----------------+------+-----------+-------------+-----------+
| trans_id | trans_no | stock_id      | type | loc_code | tran_date  | price  | reference | qty | standard_cost   | type | curr_code | supplier_id | curr_code |
+----------+----------+---------------+------+----------+------------+--------+-----------+-----+-----------------+------+-----------+-------------+-----------+
|      287 |       63 | 8996969010247 |   25 | SUB      | 2016-10-11 | 260000 |           |  10 |          260000 |   25 | NULL      |          17 | IDR       |
|      317 |        2 | 8996969010247 |   17 | SUB      | 2016-10-10 |      0 | 2         |   5 |          380000 |   17 | NULL      |        NULL | NULL      |
|      328 |       61 | 8996969010247 |   13 | SUB      | 2016-10-18 | 315000 | auto      | -10 |          300000 |   13 | IDR       |        NULL | NULL      |
|      765 |      191 | 8996969010247 |   25 | SUB      | 2017-01-23 | 210000 |           |  10 |          240000 |   25 | NULL      |          17 | IDR       |
|      774 |      135 | 8996969010247 |   13 | SUB      | 2017-01-31 | 215250 | auto      | -10 |          240000 |   13 | IDR       |        NULL | NULL      |
|     1317 |      384 | 8996969010247 |   25 | SUB      | 2017-05-23 |     17 |           |   1 |          225000 |   25 | NULL      |          17 | IDR       |
|     1334 |      245 | 8996969010247 |   13 | SUB      | 2017-05-26 | 153750 | auto      |  -1 |          225000 |   13 | IDR       |        NULL | NULL      |
|     1495 |      439 | 8996969010247 |   25 | SUB      | 2017-07-11 |     17 |           |  10 | 171666.66666667 |   25 | NULL      |          17 | IDR       |
|     1520 |      284 | 8996969010247 |   13 | SUB      | 2017-07-20 | 148625 | auto      | -10 | 171666.66666667 |   13 | IDR       |        NULL | NULL      |
+----------+----------+---------------+------+----------+------------+--------+-----------+-----+-----------------+------+-----------+-------------+-----------+
9 rows in set, 219 warnings (0.01 sec)</code></pre></div><p>as in the line 4th, the result for <br /></p><div class="codebox"><pre><code>$price = get_domestic_price($row, $stock_id);
return $price</code></pre></div><p>it show 210000, as it is strange as the currency still in IDR, it should 240000, debugging it catch by <br /></p><div class="codebox"><pre><code>        if ($myrow[&#039;type&#039;] == ST_SUPPRECEIVE || $myrow[&#039;type&#039;] == ST_SUPPCREDIT)</code></pre></div><p>but as this home currency, the price shown in line 36<br /></p><div class="codebox"><pre><code>$price = $myrow[&#039;price&#039;];</code></pre></div><p>questions why line 4 is calculate as different currency?</p>]]></content>
			<author>
				<name><![CDATA[ichtus]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=12975</uri>
			</author>
			<updated>2018-09-21T08:41:04Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=32704#p32704</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Inventory Valuation]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=32698#p32698" />
			<content type="html"><![CDATA[<p>Hello guys,</p><p>We have been working on this Inventory Valuation for I don&#039;t know how long. <br />Please try to help me locate the issue, if any.</p><p>Joe</p>]]></content>
			<author>
				<name><![CDATA[joe]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=3</uri>
			</author>
			<updated>2018-09-20T22:26:36Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=32698#p32698</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Inventory Valuation]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=32694#p32694" />
			<content type="html"><![CDATA[<p>@joe: does this need a fix in FA 2.4.4?</p>]]></content>
			<author>
				<name><![CDATA[apmuthu]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=364</uri>
			</author>
			<updated>2018-09-20T16:23:15Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=32694#p32694</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Inventory Valuation]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=32690#p32690" />
			<content type="html"><![CDATA[<p>found same problem in FA 2.4.4<br />step to reproduce<br />1. add item a with purchase value 1.8million idr(po,inv, price calculate before tax)<br />FA show correct qty 1 with correct standard price <br />2. sell items as we have input wrong selling price, a price 13million (so, invoice)<br />3. credit this from the invoice pages<br />FA show correct qty as item refund, <br />qty show 1 price 13million<br />standard price correct (in the item status)<br />4. Inventory valuation report show<br />Qty in 2 out 1<br />Value -5.6million</p><p>It should show valuation price 1.8 million, how we can fix this as in the items status show no any value minus 5.6million.</p>]]></content>
			<author>
				<name><![CDATA[ichtus]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=12975</uri>
			</author>
			<updated>2018-09-20T11:58:42Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=32690#p32690</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Inventory Valuation]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=20633#p20633" />
			<content type="html"><![CDATA[<p>The fix worked, tx !!!<br />Although it is not in the 2.3.21 version. Any plan to update ? tx again</p>]]></content>
			<author>
				<name><![CDATA[MarkAndrew]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=17490</uri>
			</author>
			<updated>2014-09-03T04:14:21Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=20633#p20633</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Inventory Valuation]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=20503#p20503" />
			<content type="html"><![CDATA[<p>thanks Joe. Appreciated.</p>]]></content>
			<author>
				<name><![CDATA[MarkAndrew]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=17490</uri>
			</author>
			<updated>2014-08-13T00:40:41Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=20503#p20503</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Inventory Valuation]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=20501#p20501" />
			<content type="html"><![CDATA[<p>This has now been fixed. The HG repository has been updated and the fix will go to next minor release.</p><p>You can download a fixed file <a href="http://https:/sourceforge.net/p/frontaccounting/mercurial/ci/default/tree/inventory/includes/db/items_adjust_db.inc">here</a> .</p><p>/Joe</p>]]></content>
			<author>
				<name><![CDATA[joe]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=3</uri>
			</author>
			<updated>2014-08-12T21:52:27Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=20501#p20501</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Inventory Valuation]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=20499#p20499" />
			<content type="html"><![CDATA[<p>Seems to be some problems during voiding. Will have a look at this.</p><p>/Joe</p>]]></content>
			<author>
				<name><![CDATA[joe]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=3</uri>
			</author>
			<updated>2014-08-12T20:24:34Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=20499#p20499</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Inventory Valuation]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=20494#p20494" />
			<content type="html"><![CDATA[<p>FA release 2.3.19 produces the following wrong result:</p><p>1. Create an inventory item called &quot;unit cost test&quot; (or any name you want)<br />2. Post an inventory adjustment of 1 unit at a cost of $2 to this new item.<br />3. Check the inventory valuation report - it will show, as expected, 1 unit at $2 each = Total value of $2<br />4. Post another inventory adjustment to the new item of 1 unit at $8.<br />5. Check the inventory valuation report - it will show, as expected, 2 units at $5 each = Total value of $10 <br />6. Now void the second inventory adjustment.<br />7. Check the inventory valuation report - it will show 1 unit at a cost of minus $237.6784 = Total value of minus$237.6784<br />8. I would expect to see 1 unit at $2 each = Total value of $2.</p><p>Why is this?&nbsp; I&#039;m not a programmer. I can&#039;t go into the code to fix it. <br />Can this be corrected?</p><p>I tried the same thing as above but using supplier invoices instead of inventory journals.&nbsp; It works correctly.</p>]]></content>
			<author>
				<name><![CDATA[MarkAndrew]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=17490</uri>
			</author>
			<updated>2014-08-12T12:26:38Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=20494#p20494</id>
		</entry>
</feed>
