<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title><![CDATA[FrontAccounting forum — Inventory Valuation Report showing 0 (zero) on Unit Cost]]></title>
		<link>https://frontaccounting.com/punbb/viewtopic.php?id=7156</link>
		<atom:link href="https://frontaccounting.com/punbb/extern.php?action=feed&amp;tid=7156&amp;type=rss" rel="self" type="application/rss+xml" />
		<description><![CDATA[The most recent posts in Inventory Valuation Report showing 0 (zero) on Unit Cost.]]></description>
		<lastBuildDate>Wed, 19 Oct 2022 15:03:30 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: Inventory Valuation Report showing 0 (zero) on Unit Cost]]></title>
			<link>https://frontaccounting.com/punbb/viewtopic.php?pid=41609#p41609</link>
			<description><![CDATA[<p>i am getting same error for transferred items for different locations</p>]]></description>
			<author><![CDATA[null@example.com (b.popoola)]]></author>
			<pubDate>Wed, 19 Oct 2022 15:03:30 +0000</pubDate>
			<guid>https://frontaccounting.com/punbb/viewtopic.php?pid=41609#p41609</guid>
		</item>
		<item>
			<title><![CDATA[Re: Inventory Valuation Report showing 0 (zero) on Unit Cost]]></title>
			<link>https://frontaccounting.com/punbb/viewtopic.php?pid=37751#p37751</link>
			<description><![CDATA[<p>Although the specific rep301.php has not changed in the meanwhile, some functions it directly / indirectly uses may have been changed post release in other files. No harm in putting in the post release changed files - it does not change the db in any manner and any missing sys_prefs variables entries will get auto populated. Then see if the situation changes.</p>]]></description>
			<author><![CDATA[null@example.com (apmuthu)]]></author>
			<pubDate>Sat, 04 Jul 2020 10:03:14 +0000</pubDate>
			<guid>https://frontaccounting.com/punbb/viewtopic.php?pid=37751#p37751</guid>
		</item>
		<item>
			<title><![CDATA[Re: Inventory Valuation Report showing 0 (zero) on Unit Cost]]></title>
			<link>https://frontaccounting.com/punbb/viewtopic.php?pid=37750#p37750</link>
			<description><![CDATA[<p>2.4.8 released in feb 4, 2020. Do i still need to integrate post release fixes released&nbsp; before 2.4.8 release date?</p>]]></description>
			<author><![CDATA[null@example.com (Shenzo)]]></author>
			<pubDate>Sat, 04 Jul 2020 07:55:15 +0000</pubDate>
			<guid>https://frontaccounting.com/punbb/viewtopic.php?pid=37750#p37750</guid>
		</item>
		<item>
			<title><![CDATA[Re: Inventory Valuation Report showing 0 (zero) on Unit Cost]]></title>
			<link>https://frontaccounting.com/punbb/viewtopic.php?pid=37749#p37749</link>
			<description><![CDATA[<p>thanks for the response. I just checked server shows the right time. I have two locations, say location A and B, for inventory. both locations have 3 units in stock for that item. when I run report 301 without location filter, it works perfectly, without zeros, and shows 6 units with correct price and correct value (price x 6). but when I apply location filter to location A, it shows zeros for price and value of that item. However applying filter to location B shows right quantity (3), unit price and value for that item. The problems is visible with only location A filter.</p>]]></description>
			<author><![CDATA[null@example.com (Shenzo)]]></author>
			<pubDate>Sat, 04 Jul 2020 07:49:41 +0000</pubDate>
			<guid>https://frontaccounting.com/punbb/viewtopic.php?pid=37749#p37749</guid>
		</item>
		<item>
			<title><![CDATA[Re: Inventory Valuation Report showing 0 (zero) on Unit Cost]]></title>
			<link>https://frontaccounting.com/punbb/viewtopic.php?pid=37724#p37724</link>
			<description><![CDATA[<p>Check if this was a server time zone issue at the time when you tried it. This is a very old thread. Hope you have all the post release fixes in your install. Also a latest change was reverted to await v2.5 but is in mt FA24Mods folder (2019-06-24).</p>]]></description>
			<author><![CDATA[null@example.com (apmuthu)]]></author>
			<pubDate>Tue, 30 Jun 2020 18:57:03 +0000</pubDate>
			<guid>https://frontaccounting.com/punbb/viewtopic.php?pid=37724#p37724</guid>
		</item>
		<item>
			<title><![CDATA[Re: Inventory Valuation Report showing 0 (zero) on Unit Cost]]></title>
			<link>https://frontaccounting.com/punbb/viewtopic.php?pid=37723#p37723</link>
			<description><![CDATA[<p>This problem still persists in report 301 (inventory valuation report). I am getting zero for unit cost and value for one of the items. When i change to_date from 30/06/2020 to 29/06/2020 the report works fine, no zeros. However report 308 is working perfectly fine with any to_date.<br />I am using frontaccounting 2.4.8 php 7.2 ubuntu 18.04</p>]]></description>
			<author><![CDATA[null@example.com (Shenzo)]]></author>
			<pubDate>Tue, 30 Jun 2020 18:17:41 +0000</pubDate>
			<guid>https://frontaccounting.com/punbb/viewtopic.php?pid=37723#p37723</guid>
		</item>
		<item>
			<title><![CDATA[Re: Inventory Valuation Report showing 0 (zero) on Unit Cost]]></title>
			<link>https://frontaccounting.com/punbb/viewtopic.php?pid=29899#p29899</link>
			<description><![CDATA[<p>Fixed files <a href="https://github.com/FrontAccountingERP/FA/commit/495ac5fbc5f98dde51645d1691e13dc37654f771">committed</a>. Even report 308 was having the same issue.</p><p>/Joe</p>]]></description>
			<author><![CDATA[null@example.com (joe)]]></author>
			<pubDate>Sat, 09 Dec 2017 08:50:21 +0000</pubDate>
			<guid>https://frontaccounting.com/punbb/viewtopic.php?pid=29899#p29899</guid>
		</item>
		<item>
			<title><![CDATA[Re: Inventory Valuation Report showing 0 (zero) on Unit Cost]]></title>
			<link>https://frontaccounting.com/punbb/viewtopic.php?pid=29898#p29898</link>
			<description><![CDATA[<p>Ok, I will.</p><p>/Joe</p>]]></description>
			<author><![CDATA[null@example.com (joe)]]></author>
			<pubDate>Sat, 09 Dec 2017 08:30:17 +0000</pubDate>
			<guid>https://frontaccounting.com/punbb/viewtopic.php?pid=29898#p29898</guid>
		</item>
		<item>
			<title><![CDATA[Re: Inventory Valuation Report showing 0 (zero) on Unit Cost]]></title>
			<link>https://frontaccounting.com/punbb/viewtopic.php?pid=29897#p29897</link>
			<description><![CDATA[<p>The default value of the <strong>precision</strong> parameter in <em>php.ini</em> on a 32 bit system is 14 even when absent. In some installs it comes preset at 17. All float values that are a result of a fraction that has recurring decimals ad infinitum will generally truncate off at <strong>ini_get(&#039;precision&#039;)-3</strong> decimals, to make up for a:<br />1. sign, <br />2. single integer to the left of the decimal point and <br />3. the decimal point itself.</p><p>Hence the line 356 of <strong>includes/current_user.inc</strong>:<br /></p><div class="codebox"><pre><code>        if ($len &gt; $dec)</code></pre></div><p>should be:<br /></p><div class="codebox"><pre><code>        if ($len &gt; $dec &amp;&amp; $len &lt; ini_get(&#039;precision&#039;)-3)</code></pre></div><p>@joe: can commit both fixes (decimals and report sql)</p>]]></description>
			<author><![CDATA[null@example.com (apmuthu)]]></author>
			<pubDate>Sat, 09 Dec 2017 06:44:29 +0000</pubDate>
			<guid>https://frontaccounting.com/punbb/viewtopic.php?pid=29897#p29897</guid>
		</item>
		<item>
			<title><![CDATA[Re: Inventory Valuation Report showing 0 (zero) on Unit Cost]]></title>
			<link>https://frontaccounting.com/punbb/viewtopic.php?pid=29896#p29896</link>
			<description><![CDATA[<p>The sql in the <strong>function getAverageCost()</strong> defined in the file <strong>reporting/rep301.php</strong> (Inventory Valuation Report) is like:<br /></p><div class="codebox"><pre><code>SELECT move.*, IF(ISNULL(supplier.supplier_id), debtor.debtor_no, supplier.supplier_id) person_id
FROM 1_stock_moves move
     LEFT JOIN 1_supp_trans credit ON credit.trans_no=move.trans_no AND credit.type=move.type
     LEFT JOIN 1_grn_batch grn ON grn.id=move.trans_no AND 25=move.type
     LEFT JOIN 1_suppliers supplier ON IFNULL(grn.supplier_id, credit.supplier_id)=supplier.supplier_id
     LEFT JOIN 1_debtor_trans cust_trans ON cust_trans.trans_no=move.trans_no AND cust_trans.type=move.type
     LEFT JOIN 1_debtors_master debtor ON cust_trans.debtor_no=debtor.debtor_no
WHERE stock_id=102
  AND move.tran_date &lt; &#039;2017-11-27&#039; 
  AND standard_cost &gt; 0.001 
  AND qty &lt;&gt; 0 
  AND move.type &lt;&gt; 16 -- ST_LOCTRANSFER
ORDER BY tran_date;</code></pre></div><p>This means that when the purchase invoice is made on <strong>2017-11-27</strong>, the sql above computes the average cost to just before the said date and not including it. If a subsequent date is used for the query, then all is well (save for the irrational value at times not obeying the decimal limit).</p><p>@joe: must we correct line 65 in it:<br /></p><div class="codebox"><pre><code>            AND move.tran_date &lt; &#039;$to_date&#039; AND standard_cost &gt; 0.001 AND qty &lt;&gt; 0 AND move.type &lt;&gt; &quot;.ST_LOCTRANSFER;</code></pre></div><p>to be<br /></p><div class="codebox"><pre><code>            AND move.tran_date &lt;= &#039;$to_date&#039; AND standard_cost &gt; 0.001 AND qty &lt;&gt; 0 AND move.type &lt;&gt; &quot;.ST_LOCTRANSFER;</code></pre></div><p>so that it takes into consideration all transaction up until the end of the day and not to just before the date?</p><p>The decimals issue can be corrected by appropriately formatting the return value at the end of the said function or where it it used in line 211 in the report although line 229 uses it without assignment when <em>$details</em> is present. The culprit is line 357 in <strong>includes/current_user.inc</strong> for irrational numbers with large number of decimal places <s>when the value of $dec becomes 14. It is best hard coded to 2.</s></p>]]></description>
			<author><![CDATA[null@example.com (apmuthu)]]></author>
			<pubDate>Sat, 09 Dec 2017 04:17:17 +0000</pubDate>
			<guid>https://frontaccounting.com/punbb/viewtopic.php?pid=29896#p29896</guid>
		</item>
		<item>
			<title><![CDATA[Re: Inventory Valuation Report showing 0 (zero) on Unit Cost]]></title>
			<link>https://frontaccounting.com/punbb/viewtopic.php?pid=29802#p29802</link>
			<description><![CDATA[<p>I agree that this sounds strange. Maybe someone else can help us investigate this. I have only heard about problems with normal 4 decimals when huge currency rates exists.</p><p>/Joe</p>]]></description>
			<author><![CDATA[null@example.com (joe)]]></author>
			<pubDate>Mon, 27 Nov 2017 22:28:29 +0000</pubDate>
			<guid>https://frontaccounting.com/punbb/viewtopic.php?pid=29802#p29802</guid>
		</item>
		<item>
			<title><![CDATA[Re: Inventory Valuation Report showing 0 (zero) on Unit Cost]]></title>
			<link>https://frontaccounting.com/punbb/viewtopic.php?pid=29801#p29801</link>
			<description><![CDATA[<p>It makes me confused, I tried using new COA USA, and try the same test using USD as home currency. It works fine with The end date 27-11-2017. Hmmm?</p>]]></description>
			<author><![CDATA[null@example.com (aguspajak)]]></author>
			<pubDate>Mon, 27 Nov 2017 21:29:42 +0000</pubDate>
			<guid>https://frontaccounting.com/punbb/viewtopic.php?pid=29801#p29801</guid>
		</item>
		<item>
			<title><![CDATA[Re: Inventory Valuation Report showing 0 (zero) on Unit Cost]]></title>
			<link>https://frontaccounting.com/punbb/viewtopic.php?pid=29799#p29799</link>
			<description><![CDATA[<p>No Joe. It is not the decimals.</p><p>Here I found just now.<br />I created new company and start with empty data.<br />I inputed Direct Supplier Invoice using date 27-11-2017.<br />When I access Inventory Valuation Report with end date 27-11-2017 it shows 0 (zero) on Unit Cost.<br />But when I put End Date 28-11-2017 or 30-11-2017 the Unit Cost shows the value.</p><p>Don&#039;t you think if I put 27-11-2017 The unit cost allready should have value?</p>]]></description>
			<author><![CDATA[null@example.com (aguspajak)]]></author>
			<pubDate>Mon, 27 Nov 2017 21:09:56 +0000</pubDate>
			<guid>https://frontaccounting.com/punbb/viewtopic.php?pid=29799#p29799</guid>
		</item>
		<item>
			<title><![CDATA[Re: Inventory Valuation Report showing 0 (zero) on Unit Cost]]></title>
			<link>https://frontaccounting.com/punbb/viewtopic.php?pid=29798#p29798</link>
			<description><![CDATA[<p>Maybe even more decimals. </p><p>Joe</p>]]></description>
			<author><![CDATA[null@example.com (joe)]]></author>
			<pubDate>Mon, 27 Nov 2017 20:54:31 +0000</pubDate>
			<guid>https://frontaccounting.com/punbb/viewtopic.php?pid=29798#p29798</guid>
		</item>
		<item>
			<title><![CDATA[Re: Inventory Valuation Report showing 0 (zero) on Unit Cost]]></title>
			<link>https://frontaccounting.com/punbb/viewtopic.php?pid=29797#p29797</link>
			<description><![CDATA[<div class="quotebox"><cite>joe wrote:</cite><blockquote><p>Yes it is related to the currency. Try to increase the currency decimals in user preferences, f.i. 6.</p><p>Joe</p></blockquote></div><p>Unfortunately it doesn&#039;t help. The problem persist.<br />Any ideas?</p>]]></description>
			<author><![CDATA[null@example.com (aguspajak)]]></author>
			<pubDate>Mon, 27 Nov 2017 20:43:28 +0000</pubDate>
			<guid>https://frontaccounting.com/punbb/viewtopic.php?pid=29797#p29797</guid>
		</item>
	</channel>
</rss>
