<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[FrontAccounting forum — Needed idea to work-arround diff. decimal places for unit price/amount]]></title>
	<link rel="self" href="https://frontaccounting.com/punbb/extern.php?action=feed&amp;tid=6699&amp;type=atom" />
	<updated>2017-02-17T15:36:53Z</updated>
	<generator>PunBB</generator>
	<id>https://frontaccounting.com/punbb/viewtopic.php?id=6699</id>
		<entry>
			<title type="html"><![CDATA[Re: Needed idea to work-arround diff. decimal places for unit price/amount]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=27546#p27546" />
			<content type="html"><![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>]]></content>
			<author>
				<name><![CDATA[stefan]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=20008</uri>
			</author>
			<updated>2017-02-17T15:36:53Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=27546#p27546</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Needed idea to work-arround diff. decimal places for unit price/amount]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=27544#p27544" />
			<content type="html"><![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>]]></content>
			<author>
				<name><![CDATA[stefan]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=20008</uri>
			</author>
			<updated>2017-02-17T13:49:38Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=27544#p27544</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Needed idea to work-arround diff. decimal places for unit price/amount]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=27542#p27542" />
			<content type="html"><![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>]]></content>
			<author>
				<name><![CDATA[notrinos]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=36772</uri>
			</author>
			<updated>2017-02-17T12:44:16Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=27542#p27542</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Needed idea to work-arround diff. decimal places for unit price/amount]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=27541#p27541" />
			<content type="html"><![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>]]></content>
			<author>
				<name><![CDATA[stefan]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=20008</uri>
			</author>
			<updated>2017-02-17T12:25:35Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=27541#p27541</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Needed idea to work-arround diff. decimal places for unit price/amount]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=27540#p27540" />
			<content type="html"><![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>]]></content>
			<author>
				<name><![CDATA[notrinos]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=36772</uri>
			</author>
			<updated>2017-02-17T11:54:56Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=27540#p27540</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Needed idea to work-arround diff. decimal places for unit price/amount]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=27539#p27539" />
			<content type="html"><![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>]]></content>
			<author>
				<name><![CDATA[stefan]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=20008</uri>
			</author>
			<updated>2017-02-17T10:36:03Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=27539#p27539</id>
		</entry>
</feed>
