<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title><![CDATA[FrontAccounting forum — Journal Entries Round to 2 decimal places on add, not update]]></title>
		<link>https://frontaccounting.com/punbb/viewtopic.php?id=7491</link>
		<atom:link href="https://frontaccounting.com/punbb/extern.php?action=feed&amp;tid=7491&amp;type=rss" rel="self" type="application/rss+xml" />
		<description><![CDATA[The most recent posts in Journal Entries Round to 2 decimal places on add, not update.]]></description>
		<lastBuildDate>Wed, 02 May 2018 14:33:43 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: Journal Entries Round to 2 decimal places on add, not update]]></title>
			<link>https://frontaccounting.com/punbb/viewtopic.php?pid=31558#p31558</link>
			<description><![CDATA[<p>I did check it -- dropped log statements in methodically (just downloaded yesterday, code is new to me, and php is not my strong suite).</p><p>The gl_items class (which is the culprit) is defined in items_cart.inc, not intuitive, but can&#039;t hide from grep <img src="https://frontaccounting.com/punbb/img/smilies/smile.png" width="15" height="15" alt="smile" /></p><p>EDIT:&nbsp; To also be clear, it&#039;s not just the display.&nbsp; When an item is added to the gl_items list it uses the constructor in the gl_items class which does the rounding, so the rounded number is what gets pushed to the sql table.</p>]]></description>
			<author><![CDATA[null@example.com (ed45626)]]></author>
			<pubDate>Wed, 02 May 2018 14:33:43 +0000</pubDate>
			<guid>https://frontaccounting.com/punbb/viewtopic.php?pid=31558#p31558</guid>
		</item>
		<item>
			<title><![CDATA[Re: Journal Entries Round to 2 decimal places on add, not update]]></title>
			<link>https://frontaccounting.com/punbb/viewtopic.php?pid=31553#p31553</link>
			<description><![CDATA[<p>Items in the Cart are used for both display and for populating the tables. To conserve screen real-estate, the display is generally rounded off to 2 decimal places. Hopefully all the 8 digit amounts can fit into the Chart of Account table fields.</p><p>It is the <strong>function add_gl_item</strong> that needs to be fixed - inspect the value of $amount at the point when <strong>$this-&gt;gl_items[] = new gl_item(.....</strong> is executed whether it has the 8 digits in the decimals at line 130.</p><p>@joe: Worth fixing.</p>]]></description>
			<author><![CDATA[null@example.com (apmuthu)]]></author>
			<pubDate>Wed, 02 May 2018 08:10:50 +0000</pubDate>
			<guid>https://frontaccounting.com/punbb/viewtopic.php?pid=31553#p31553</guid>
		</item>
		<item>
			<title><![CDATA[Journal Entries Round to 2 decimal places on add, not update]]></title>
			<link>https://frontaccounting.com/punbb/viewtopic.php?pid=31552#p31552</link>
			<description><![CDATA[<p>We need 8 decimal places for GL entries and despite setting the precision adding a new journal entry always rounded to 2 places.</p><p>If we go back and update the entry, then the full number would stay.</p><p>In <strong>includes/ui/items_cart.inc</strong>, the definition for <strong>class gl_item</strong> ignores the user precision at line 535 (<a href="https://github.com/FrontAccountingERP/FA/blob/master/includes/ui/items_cart.inc#L534">line 534</a> in the GitMaster):<br /></p><div class="codebox"><pre><code>$this-&gt;amount = round($amount, 2);</code></pre></div><p>Whereas the <strong>function update_gl_item</strong> does not round (line 161):<br /></p><div class="codebox"><pre><code>$this-&gt;gl_items[$index]-&gt;amount = $amount;</code></pre></div><p>I&#039;ve hacked the file, but would probably be better to update -- not sure where to submit a pull request on sourceforge.</p><p>Thanks!</p>]]></description>
			<author><![CDATA[null@example.com (ed45626)]]></author>
			<pubDate>Wed, 02 May 2018 03:48:22 +0000</pubDate>
			<guid>https://frontaccounting.com/punbb/viewtopic.php?pid=31552#p31552</guid>
		</item>
	</channel>
</rss>
