Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Item Cost - Decimal Places
02-15-2018, 08:54 AM
Post: #1
Item Cost - Decimal Places
I know we can set Standard Cost Decimal Places in the setup script. We buy product in gross amounts which are converted to smaller net amounts. For example we buy 55 gallons of product as quantity one (1) EA from the Supplier and convert it to 55 GA to our stock.

So when we receive it we can have small variances between the PO and the Invoice because we are limited to four (4) decimal places in the setup script and DB schema.

So the question is how hard would it be to increase this to more places? If I add it as an option and increase decimal places in StockMaster table will webERP comply?

It would be nice to make a variances like -0.0024999999749475 even smaller or, better yet, as close to 0 as possible.

https://www.linkedin.com/in/eclipsepaulbecker
Visit this user's website Find all posts by this user
Quote this message in a reply
02-16-2018, 12:43 PM (This post was last modified: 02-16-2018 01:31 PM by TurboPT.)
Post: #2
RE: Item Cost - Decimal Places
I believe that post 2 was meant to go here: http://www.weberp.org/forum/showthread.php?tid=8090 ?

No worries, there is now a link reference! Smile

When you have a chance, can you attach the file(s) with that change here?
Find all posts by this user
Quote this message in a reply
02-20-2018, 12:33 AM
Post: #3
RE: Item Cost - Decimal Places
We buy nuts and bolts in thousands, so use 5 decimal places for standard costs.

To enable this I made mods in scripts:
SystemParameters.php - around lines 51 and 749.
PO_Items.php - around lines 738 to 743.
SelectProduct.php - around line 347.

And in the DB schema, allowed 5 decimal places in these columns:
stockmaster.actualcost
stockmaster.lastcost
stockmaster.materialcost
stockmaster.labourcost
stockmaster.overheadcost
purchdata.price

https://www.linkedin.com/in/andrewcouling
Find all posts by this user
Quote this message in a reply
02-20-2018, 12:54 AM (This post was last modified: 02-20-2018 01:44 AM by VortecCPI.)
Post: #4
RE: Item Cost - Decimal Places
Thank you so much Andy. I knew somebody out there had to have a similar issue. Perhaps we need to incorporate this into the main trunk?

Do you have any rounding issues in GLTrans or ChartDetails tables or related GL reports?
Was it all easier with slide rules and only three decimal places???
(02-20-2018 12:33 AM)afcouling Wrote:  We buy nuts and bolts in thousands, so use 5 decimal places for standard costs.

To enable this I made mods in scripts:
SystemParameters.php - around lines 51 and 749.
PO_Items.php - around lines 738 to 743.
SelectProduct.php - around line 347.

And in the DB schema, allowed 5 decimal places in these columns:
stockmaster.actualcost
stockmaster.lastcost
stockmaster.materialcost
stockmaster.labourcost
stockmaster.overheadcost
purchdata.price

Hi Andy...

I have identified all the above except "SelectProduct.php - around line 347"

Can you give me a little extra help with this one?

https://www.linkedin.com/in/eclipsepaulbecker
Visit this user's website Find all posts by this user
Quote this message in a reply
02-21-2018, 09:36 PM (This post was last modified: 02-21-2018 09:37 PM by afcouling.)
Post: #5
RE: Item Cost - Decimal Places
Hi Paul,

Yes, would be great to get this in the trunk - one less customisation to re-instate following upgrades!

How many decimals (maximum) place do you think would be appropriate?
Is there a downside to allowing more than 4?
Do you the other systems you have worked with allow this to be configured?

I'm not sure if I have any rounding errors in the GLTrans or ChartDetails tables. Do you have an example, so I know what to look for?

In SelectProduct.php, around Line 347, I changed

Code:
<td class="select" style="text-align:right">' . locale_number_format($SuppRow['price'] / $SuppRow['conversionfactor'], $SuppRow['decimalplaces']) . '</td>

to

Code:
<td class="select" style="text-align:right">' . locale_number_format($SuppRow['price'] / $SuppRow['conversionfactor'], $_SESSION['StandardCostDecimalPlaces']) . '</td>

Perhaps this was a bit of a hack.

Andy.

PS. What is a slide rule ??! Tongue

https://www.linkedin.com/in/andrewcouling
Find all posts by this user
Quote this message in a reply
02-21-2018, 09:45 PM
Post: #6
RE: Item Cost - Decimal Places
Would it make more sense to have this defined at an item level in the stockmaster table? We already have a field for quantity decimal places so adding another one for cost decimal places wouldn't be too hard.

Tim
Visit this user's website Find all posts by this user
Quote this message in a reply
02-21-2018, 09:53 PM
Post: #7
RE: Item Cost - Decimal Places
Hi Tim,

Great idea.
My need for more decimal places does only affect a small proportion of purchased items.

Perhaps the setting for standard cost decimals in SystemParameters.php could become 'Default Standard Cost Decimal Places'. Or would it more simple to remove this configuration, and default to currency decimal places?

Andy.

https://www.linkedin.com/in/andrewcouling
Find all posts by this user
Quote this message in a reply
02-21-2018, 10:17 PM (This post was last modified: 02-21-2018 10:34 PM by VortecCPI.)
Post: #8
RE: Item Cost - Decimal Places
I think we should NOT fix the value via DB storage persistence but only fix the value when displayed. Sort of like data in gltrans table.

I am pretty sure this is how ECi M1 ERP does it.
In ECi M1 ERP decimal places setting is for quantities:
+ Sell By Decimals
+ Buy By Decimals
+ Inv Qty. Decimals

Another setting is for rounding currency to nearest N places for display.

Internally all calculations are at five (5) decimal places.
So perhaps we use 5 or 6 decimal places in the tables but then round and fix (based upon global setting) when this data is displayed?
I have access to working ECi M1 ERP and all help docs but I try not to display any data for obvious reasons.

https://www.linkedin.com/in/eclipsepaulbecker
Visit this user's website Find all posts by this user
Quote this message in a reply
02-21-2018, 11:37 PM
Post: #9
RE: Item Cost - Decimal Places
(02-21-2018 09:53 PM)afcouling Wrote:  Perhaps the setting for standard cost decimals in SystemParameters.php could become 'Default Standard Cost Decimal Places'. Or would it more simple to remove this configuration, and default to currency decimal places?

This sounds like a good idea. Make Stocks.php default to this global value but allow different values per item.

Tim
Visit this user's website Find all posts by this user
Quote this message in a reply
Post Reply 


Forum Jump:


User(s) browsing this thread: 2 Guest(s)