<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title><![CDATA[FrontAccounting forum — Needed idea to work-arround diff. decimal places for unit price/amount]]></title>
		<link>https://frontaccounting.com/punbb/viewtopic.php?id=6699</link>
		<atom:link href="https://frontaccounting.com/punbb/extern.php?action=feed&amp;tid=6699&amp;type=rss" rel="self" type="application/rss+xml" />
		<description><![CDATA[The most recent posts in Needed idea to work-arround diff. decimal places for unit price/amount.]]></description>
		<lastBuildDate>Fri, 17 Feb 2017 15:36:53 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: Needed idea to work-arround diff. decimal places for unit price/amount]]></title>
			<link>https://frontaccounting.com/punbb/viewtopic.php?pid=27546#p27546</link>
			<description><![CDATA[<p>Update:</p><p>In /includes/current_user.inc I added this:</p><p>function amount_format($number) {&nbsp; return number_format2($number, 2); } </p><p>At the sub-totals and totals of this file I have replaced price_format with amount_format</p><p>Than in /includes/ui/ui_view.inc in the functions:<br />display_customer_trans_tax_details<br />display_supp_trans_tax_details <br />display_edit_tax_items <br />I replaced all occurrences of &quot;user_price_dec()&quot; with &quot;2&quot; and the relevant &quot;price_format&quot; with &quot;amount_format&quot;</p><p>For the moment looks fine. I can use prices with .00001 and the line_totals are the same. The sub-total, the taxes and the total are .01 (rounded to cent).</p><p>update: IT&#039;S NOT GOOD !!!</p>]]></description>
			<author><![CDATA[null@example.com (stefan)]]></author>
			<pubDate>Fri, 17 Feb 2017 15:36:53 +0000</pubDate>
			<guid>https://frontaccounting.com/punbb/viewtopic.php?pid=27546#p27546</guid>
		</item>
		<item>
			<title><![CDATA[Re: Needed idea to work-arround diff. decimal places for unit price/amount]]></title>
			<link>https://frontaccounting.com/punbb/viewtopic.php?pid=27544#p27544</link>
			<description><![CDATA[<p>Sorry, both ways it doesn&#039;t not work.</p><p>168-169 changed to<br />$line_total = round($stock_item-&gt;qty_dispatched * $stock_item-&gt;price * (1 - $stock_item-&gt;discount_percent), 2);<br />solves the Sub-total, but not the Total and Taxes.</p><p>222 this solves Sub-total<br />$display_sub_total = round($total + input_num(&#039;freight_cost&#039;), 2);</p><p>227 this solves the Total<br />$display_total = round(($total + input_num(&#039;freight_cost&#039;) + $tax_total), 2); </p><p>only simple tests are done, but looks to work correct on the Sales Order.</p><p>My central issue are the taxes, and they are still not ready</p><p>I am just a beginner, so it might take time.<br />It seems &quot;user_price_dec&quot; has to be replaced with &quot;2&quot; at many places, mainly in .inc files</p>]]></description>
			<author><![CDATA[null@example.com (stefan)]]></author>
			<pubDate>Fri, 17 Feb 2017 13:49:38 +0000</pubDate>
			<guid>https://frontaccounting.com/punbb/viewtopic.php?pid=27544#p27544</guid>
		</item>
		<item>
			<title><![CDATA[Re: Needed idea to work-arround diff. decimal places for unit price/amount]]></title>
			<link>https://frontaccounting.com/punbb/viewtopic.php?pid=27542#p27542</link>
			<description><![CDATA[<p>Oh sorry! That was not good solution, instead of that you just add <span style="color: blue">$line_total = round($line_total*100)/100;</span> into line 170.</p>]]></description>
			<author><![CDATA[null@example.com (notrinos)]]></author>
			<pubDate>Fri, 17 Feb 2017 12:44:16 +0000</pubDate>
			<guid>https://frontaccounting.com/punbb/viewtopic.php?pid=27542#p27542</guid>
		</item>
		<item>
			<title><![CDATA[Re: Needed idea to work-arround diff. decimal places for unit price/amount]]></title>
			<link>https://frontaccounting.com/punbb/viewtopic.php?pid=27541#p27541</link>
			<description><![CDATA[<p>Thanks a lot!!!<br />This much I can edit <img src="https://frontaccounting.com/punbb/img/smilies/smile.png" width="15" height="15" alt="smile" /></p>]]></description>
			<author><![CDATA[null@example.com (stefan)]]></author>
			<pubDate>Fri, 17 Feb 2017 12:25:35 +0000</pubDate>
			<guid>https://frontaccounting.com/punbb/viewtopic.php?pid=27541#p27541</guid>
		</item>
		<item>
			<title><![CDATA[Re: Needed idea to work-arround diff. decimal places for unit price/amount]]></title>
			<link>https://frontaccounting.com/punbb/viewtopic.php?pid=27540#p27540</link>
			<description><![CDATA[<p>If you can edit code just replace lines 222 of sales/includes/ui/sales_order_ui.inc with <span style="color: blue">$display_sub_total = round(price_format($total + input_num(&#039;freight_cost&#039;))*100)/100;</span> and line 227 with <span style="color: blue">$display_total = round(price_format(($total + input_num(&#039;freight_cost&#039;) + $tax_total))*100)/100;</span></p>]]></description>
			<author><![CDATA[null@example.com (notrinos)]]></author>
			<pubDate>Fri, 17 Feb 2017 11:54:56 +0000</pubDate>
			<guid>https://frontaccounting.com/punbb/viewtopic.php?pid=27540#p27540</guid>
		</item>
		<item>
			<title><![CDATA[Needed idea to work-arround diff. decimal places for unit price/amount]]></title>
			<link>https://frontaccounting.com/punbb/viewtopic.php?pid=27539#p27539</link>
			<description><![CDATA[<p>I guess this question is directed to more experienced users.</p><p>I need to have prices per unit with 4 digits after decimal and all amounts rounded to cent (second digit after dec.).<br />This is especially valid for taxes and totals.</p><p>I think I have tried all combinations of Display Setup and Company Setup/Round Calculated Prices.<br />(The last seems to be for Price lists calculations etc., not for direct sales input)</p><p>The only idea I have is changing the unit of measure, but it leads to consequential issues.<br />Any other idea will be appreciated <img src="https://frontaccounting.com/punbb/img/smilies/smile.png" width="15" height="15" alt="smile" /></p>]]></description>
			<author><![CDATA[null@example.com (stefan)]]></author>
			<pubDate>Fri, 17 Feb 2017 10:36:03 +0000</pubDate>
			<guid>https://frontaccounting.com/punbb/viewtopic.php?pid=27539#p27539</guid>
		</item>
	</channel>
</rss>
