<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title><![CDATA[FrontAccounting forum — Enter Purchase Order Items In Supplier Units]]></title>
		<link>https://frontaccounting.com/punbb/viewtopic.php?id=8375</link>
		<atom:link href="https://frontaccounting.com/punbb/extern.php?action=feed&amp;tid=8375&amp;type=rss" rel="self" type="application/rss+xml" />
		<description><![CDATA[The most recent posts in Enter Purchase Order Items In Supplier Units.]]></description>
		<lastBuildDate>Sun, 01 Sep 2019 14:15:04 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: Enter Purchase Order Items In Supplier Units]]></title>
			<link>https://frontaccounting.com/punbb/viewtopic.php?pid=35881#p35881</link>
			<description><![CDATA[<div class="quotebox"><blockquote><p>Concerning if item/supplier conversion is correct, Price column on PO does show correctly when using the base current_user.inc file, but maybe that is not an accurate comparison (because I don&#039;t fully understand the changes to that file).</p></blockquote></div><p>I&#039;m afraid I do not have any explanation.&nbsp; The change to current_user.inc was the price_decimal_format () function.&nbsp; The printed PO rounds using user_price_dec().&nbsp; Perhaps you had to login/logout after changing Preferences-&gt;Prices/Amounts for it to take effect.&nbsp; &nbsp;I don&#039;t know.&nbsp; It would be silly, but you could just hard code the line in rep209 to use 2 decimals:<br /></p><div class="codebox"><pre><code>             if ($data[&#039;conversion_factor&#039;] != 1)
                {
                    $myrow2[&#039;unit_price&#039;] = round2($myrow2[&#039;unit_price&#039;] * $data[&#039;conversion_factor&#039;], 2);
                    $myrow2[&#039;quantity_ordered&#039;] = round2($myrow2[&#039;quantity_ordered&#039;] / $data[&#039;conversion_factor&#039;], user_qty_dec());
                }</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (Braath Waate)]]></author>
			<pubDate>Sun, 01 Sep 2019 14:15:04 +0000</pubDate>
			<guid>https://frontaccounting.com/punbb/viewtopic.php?pid=35881#p35881</guid>
		</item>
		<item>
			<title><![CDATA[Re: Enter Purchase Order Items In Supplier Units]]></title>
			<link>https://frontaccounting.com/punbb/viewtopic.php?pid=35880#p35880</link>
			<description><![CDATA[<p>I wonder if I could further solve my issues by creating a new item in inventory that matches my suppliers UOM/pricing and change my currently purchased item to Manufactured Item Type. After receiving newly created item, perform an Assemble work order to convert the item into my UOM. That way I could basically enter a PO in my supplier&#039;s units and end up with our current units. Dumb idea?</p><p>&nbsp; I believe a manufactured item can still be used in a BOM list.</p>]]></description>
			<author><![CDATA[null@example.com (paul)]]></author>
			<pubDate>Sun, 01 Sep 2019 13:16:22 +0000</pubDate>
			<guid>https://frontaccounting.com/punbb/viewtopic.php?pid=35880#p35880</guid>
		</item>
		<item>
			<title><![CDATA[Re: Enter Purchase Order Items In Supplier Units]]></title>
			<link>https://frontaccounting.com/punbb/viewtopic.php?pid=35879#p35879</link>
			<description><![CDATA[<p>Concerning if item/supplier conversion is correct, Price column on PO does show correctly when using the base current_user.inc file, but maybe that is not an accurate comparison (because I don&#039;t fully understand the changes to that file).</p>]]></description>
			<author><![CDATA[null@example.com (paul)]]></author>
			<pubDate>Sun, 01 Sep 2019 13:09:27 +0000</pubDate>
			<guid>https://frontaccounting.com/punbb/viewtopic.php?pid=35879#p35879</guid>
		</item>
		<item>
			<title><![CDATA[Re: Enter Purchase Order Items In Supplier Units]]></title>
			<link>https://frontaccounting.com/punbb/viewtopic.php?pid=35878#p35878</link>
			<description><![CDATA[<p>I just changed Pref/Decimal Places to 2 and also changed Item UOM to 2 decimal places (just in case) and that doesn&#039;t change the printed PO. I believe I have the supplier pricing/conversion correctly as the supplier Quantity Units show correctly on the PO. If I edit the PO and double my inventory units, the PO will show 2 units. Also, the Total column on the PO displays with 2 decimal places.</p>]]></description>
			<author><![CDATA[null@example.com (paul)]]></author>
			<pubDate>Sun, 01 Sep 2019 12:56:36 +0000</pubDate>
			<guid>https://frontaccounting.com/punbb/viewtopic.php?pid=35878#p35878</guid>
		</item>
		<item>
			<title><![CDATA[Re: Enter Purchase Order Items In Supplier Units]]></title>
			<link>https://frontaccounting.com/punbb/viewtopic.php?pid=35877#p35877</link>
			<description><![CDATA[<p>The printed PO does&nbsp; should show the supplier qty units and cost correctly (in supplier units and 2 decimal pricing) if you enter the units and conversions into Items-&gt;Purchasing Pricing.&nbsp; &nbsp;Make sure your user decimal price is 2.</p><p>Looking at the PO print code that does the conversion back to supplier units,<br /></p><div class="codebox"><pre><code>                if ($data[&#039;conversion_factor&#039;] != 1)
                {
                    $myrow2[&#039;unit_price&#039;] = round2($myrow2[&#039;unit_price&#039;] * $data[&#039;conversion_factor&#039;], user_price_dec());
                    $myrow2[&#039;quantity_ordered&#039;] = round2($myrow2[&#039;quantity_ordered&#039;] / $data[&#039;conversion_factor&#039;], user_qty_dec());
                }</code></pre></div><p>it seems to me that if user_price_dec() is 2, it must round to 2 decimal places, so that is why I am guessing that you might have changed Preferences-&gt;Decimal Places?&nbsp; Or maybe you don&#039;t have the supplier pricing/conversion set in the Item?</p>]]></description>
			<author><![CDATA[null@example.com (Braath Waate)]]></author>
			<pubDate>Sun, 01 Sep 2019 12:19:50 +0000</pubDate>
			<guid>https://frontaccounting.com/punbb/viewtopic.php?pid=35877#p35877</guid>
		</item>
		<item>
			<title><![CDATA[Re: Enter Purchase Order Items In Supplier Units]]></title>
			<link>https://frontaccounting.com/punbb/viewtopic.php?pid=35876#p35876</link>
			<description><![CDATA[<p>But the side effect is better than before. Adding a new PO or editing an existing PO will not come out right price when using the base current_user.inc.</p>]]></description>
			<author><![CDATA[null@example.com (paul)]]></author>
			<pubDate>Sun, 01 Sep 2019 11:51:55 +0000</pubDate>
			<guid>https://frontaccounting.com/punbb/viewtopic.php?pid=35876#p35876</guid>
		</item>
		<item>
			<title><![CDATA[Re: Enter Purchase Order Items In Supplier Units]]></title>
			<link>https://frontaccounting.com/punbb/viewtopic.php?pid=35875#p35875</link>
			<description><![CDATA[<p>There is a side effect with this. On the printed Purchase Order, the line-item Price column is shown with 14 decimal places. A cost of $18.40 will print here as 18.40000000010000. I will look into the report to see if I can figure something out. Ha! Well, I will try.</p><p>I would still prefer to enter a PO in supplier units qty units and cost).</p>]]></description>
			<author><![CDATA[null@example.com (paul)]]></author>
			<pubDate>Sun, 01 Sep 2019 11:36:21 +0000</pubDate>
			<guid>https://frontaccounting.com/punbb/viewtopic.php?pid=35875#p35875</guid>
		</item>
		<item>
			<title><![CDATA[Re: Enter Purchase Order Items In Supplier Units]]></title>
			<link>https://frontaccounting.com/punbb/viewtopic.php?pid=35873#p35873</link>
			<description><![CDATA[<p>@joe: must this fix be incorporated in the stable version atleast now?</p>]]></description>
			<author><![CDATA[null@example.com (apmuthu)]]></author>
			<pubDate>Sun, 01 Sep 2019 06:16:58 +0000</pubDate>
			<guid>https://frontaccounting.com/punbb/viewtopic.php?pid=35873#p35873</guid>
		</item>
		<item>
			<title><![CDATA[Re: Enter Purchase Order Items In Supplier Units]]></title>
			<link>https://frontaccounting.com/punbb/viewtopic.php?pid=35868#p35868</link>
			<description><![CDATA[<p>Sweet-Pete! That took care of my pricing issue. Way, way beyond my level of comprehension.</p><p>&nbsp; Thanks again Braath!</p>]]></description>
			<author><![CDATA[null@example.com (paul)]]></author>
			<pubDate>Sat, 31 Aug 2019 23:08:13 +0000</pubDate>
			<guid>https://frontaccounting.com/punbb/viewtopic.php?pid=35868#p35868</guid>
		</item>
		<item>
			<title><![CDATA[Re: Enter Purchase Order Items In Supplier Units]]></title>
			<link>https://frontaccounting.com/punbb/viewtopic.php?pid=35867#p35867</link>
			<description><![CDATA[<p>This works correctly in my fork without changing price decimals.&nbsp; &nbsp; I fixed this bug a few years ago and I think the fix was rather obscure.&nbsp; I think this was it:</p><p>Change the includes/current_user.inc function to:<br /></p><div class="codebox"><pre><code>function price_decimal_format($number, &amp;$dec)
{
    $dec = user_price_dec();
    $str = strval($number);
    $pos = strpos($str, &#039;.&#039;);
    if ($pos !== false)
    {
        $len = strlen(substr($str, $pos + 1));
        if ($len &gt; ini_get(&#039;precision&#039;)-3)
                    $len = ini_get(&#039;precision&#039;)-3;
        if ($len &gt; $dec)
            $dec = $len;
    }
    return number_format2($number, $dec);
}</code></pre></div><p>from the base</p><div class="codebox"><pre><code>function price_decimal_format($number, &amp;$dec)
{
    $dec = user_price_dec();
    $str = strval($number);
    $pos = strpos($str, &#039;.&#039;);
    if ($pos !== false)
    {
        $len = strlen(substr($str, $pos + 1));
        if ($len &gt; $dec &amp;&amp; $len &lt; ini_get(&#039;precision&#039;)-3)
            $dec = $len;
    }
    return number_format2($number, $dec);</code></pre></div><p>I think the base code sees the desired precision ($len &gt; $dec) but only sets $dec to $len if $len happens to be less than the php.ini precision.&nbsp; &nbsp;It usually isn&#039;t so it uses the user decimals (which is probably 2, which causes the rounding problem you describe).</p><p>In my code, the desired precision is tested against the php.ini precision and truncates if necessary.&nbsp; Then if the result is greater than user decimals, it uses that.&nbsp; I think this is what the base coder wanted but just didn&#039;t code it right.</p><p>If that doesn&#039;t fix your problem, I will have to look deeper into how I fixed it.</p>]]></description>
			<author><![CDATA[null@example.com (Braath Waate)]]></author>
			<pubDate>Sat, 31 Aug 2019 01:29:43 +0000</pubDate>
			<guid>https://frontaccounting.com/punbb/viewtopic.php?pid=35867#p35867</guid>
		</item>
		<item>
			<title><![CDATA[Enter Purchase Order Items In Supplier Units]]></title>
			<link>https://frontaccounting.com/punbb/viewtopic.php?pid=35866#p35866</link>
			<description><![CDATA[<p>One unit from our supplier is&nbsp; 5760 stocking units to us. It looks like matching&nbsp; purchase order pricing is going to be tough when entering&nbsp; an item in our units/price unless I change price decimal places to 8. If an item was entered in the purchase order in supplier units, item costs can vary by calculating back to item units.</p>]]></description>
			<author><![CDATA[null@example.com (paul)]]></author>
			<pubDate>Sat, 31 Aug 2019 00:37:30 +0000</pubDate>
			<guid>https://frontaccounting.com/punbb/viewtopic.php?pid=35866#p35866</guid>
		</item>
	</channel>
</rss>
