1 (edited by Petros 10/13/2015 02:45:40 am)

Topic: Advanced Manufacturing and My Doghouse

This is an illustrative example to show areas of improvement in the advanced manufacture of fa.
Assume:
I’m making a doghouse to be sold.
Dec 20 – purchased woods, glue and nails; properly recorded to "raw material inventory" in fa.
Dec 21 – Built the "BOM" for a doghouse, but since I’m not sure, I will be using "advanced manufacture" so I can issue more materials later.
Dec 22 – Started joining the woods as per the "BOM" and paid for my helper $50 and posted it to "labor cost".
Dec 23- Heavy rain came and to protect my doghouse bought plastic shed and charged it to "overhead cost" $50.
Dec 24- Ran out of glue and nails, in addition to the qty set in BOM, bought more and issued it to the "work order" $20.
Dec 25-30 no movement.
Dec 31 – Printed a "balance sheet" and found out the following:
Cash is less by $120 due to the above 3 expenses (correct).
My raw material inventory originally purchased is intact because no "work order" is processed yet (misleading).
Printed "profit or loss" statement:
I have a calculated return (loss) of -$120, because additional material, plastic shed and labor pay were charged to cost of goods sold account (or an account under this section).
Dec 31- After reviewing the reports, I got up, finished the doghouse and in fa, clicked on "process" (not "process and close" because I may have overhead charges to charge later).
Now "balance sheet" shows raw materials transferred to finished goods, by a value proportional to the qty in "BOM" ONLY, even though the doghouse consumed more material than that.
The $120 under "cost of goods sold section" remained there while I wanted it to add-up in "finished goods inventory".       
Later my helper came and complained he has $10 unpaid with me. We checked his hours and he is right. So I paid $10 but to include it to the "workorder", fa has closed it. (Even though I only clicked "process", not "process and close").

Can we not improve advanced manufacture to replicate real life?

2 (edited by apmuthu 10/13/2015 05:28:50 am)

Re: Advanced Manufacturing and My Doghouse

@itronics: probably only you can fathom the mountain of code to get this done, now that @Petros has a clear understanding to be able to test it out. Have linked it into the Wiki FWIW.

Re: Advanced Manufacturing and My Doghouse

I guess that if the number of ordered items have been produced, the Wo is automatically closed.
If you produce and close the Wo it is closed even if the manufacturing is not finished.

Joe

4 (edited by Petros 10/13/2015 08:47:17 pm)

Re: Advanced Manufacturing and My Doghouse

OK GOT A SOLUTION: the whole doghouse story as complicated as it seems, it only needs 2 minor fixes.

SOLUTION 1,  Achieve FG value accuracy and proper GL account posting.
To achieve this we need to re-route only one line. The values that fa throws to some cost of good sold section account (which then becomes the net loss on profit statement) should be routed to the item's assembly account (by altering the codes). It goes there and awaits BOM raw materials to come and join it. Together they make up finished good balance ==total production cost (of a doghouse, for instance). If we manage to do this the following happens:
Pro's
FA will not demonstrate fake losses in profit or loss report for productions.
FA will permit customer billing per job status type of projects (constructions).
Producers and accountants wouldn't worry about crafting an absolute BOM as additions and modifications are all costed properly to that specific item's assembly cost.
Con's
It makes BOM optional as anyone can add any item anytime and still achieve properly costed product. (Is this a con by the way?)
This "re-routing" still doesn't mean it's accurate during production (remember items on BOM remain in raw material inventory until completion) but it is accurate post production. (In accounting terms, after re-routing, we get correct profit or loss statement but not correct balance sheet until "process" is clicked).

SOLUTION 2,  Make the "process" button do different than "process and close" button
I completely agree with fa's inception that if qty ordered ==qty produced, auto-close the WO. But if a user clicks "process" and not "process and close", it means the producer is not done uploading pertaining costs. Imagine, right now I still have $10 direct labor cost I am unable to post. I know the importance of closing WO on time, but it should be left to the user's choice/risk/will.


In short, a help from anyone who is handy with the codes in this area can review only these two lines, and we got ourselves no errors.

Re: Advanced Manufacturing and My Doghouse

@petros

If you will be so kind to Point me out the two lines (file and position), I will be delighted to change this in the stable release.

/Joe

Re: Advanced Manufacturing and My Doghouse

@Joe
That's exactly the help I'm asking for, I'll rephrase the problem statement here below:
1. A line of codes in fa instructs fa to post additional material issuances, labor costs and overhead costs to "price variance account" instead of "the item's assembly account". Where is this code?
2. Again there's a line of codes somewhere that makes a click on "process" button to closedown a work order. where?

Re: Advanced Manufacturing and My Doghouse

1. Ok, I will see what I can do. Should be pretty easy.

2. This is a little more tricky. Maybe we could replace the buttons to only say 'process' and 'close'. Then you will always need to press the 'close' button to close the advanced assembly. I am not sure what is best here. Maybe a third option called 'close' and don't close the 'process' even if it is finished.

Joe

Re: Advanced Manufacturing and My Doghouse

Hello again,

@Petros
The number 1. issue has now been fixed. The following files can be downloaded from the Git repository and replaced on your server:

/manufacturing/includes/db(work_order_issues_db.inc
/manufacturing/includes/db/work_order_produce_items_db.inc
/manufacturing/includes/db/work_orders_db.inc
/manufacturing/includes/db/work_orders_quick_db.inc

I will continue to look into item number 2.

/Joe

Re: Advanced Manufacturing and My Doghouse

@Joe
2. Yes, two different buttons will do.
"PROCESS" will do what it does now. Allocation of costs to their respective GL accounts (of course to assembly account).
"CLOSE" will play more of an internal control role by making past production contracts inaccessible for erroneous postings to them.

10 (edited by Petros 10/14/2015 07:59:55 pm)

Re: Advanced Manufacturing and My Doghouse

@Joe
Just tested the fix.
The additional cost of labor, overhead and materials do get posted to assembly account and add up with the value of the BOM. Guess what? then when you check inventory valuation of the produced item it's valued only by the BOM. Then when you sell the item, cost of goods sold is calculated only to the BOM and while the inventory is sold out, finished goods account still shows the additional production costs. In short, the additional costs do get posted to the right account but are not associating them selves with the product.
Hint: stock_master table, cost columns aren't updated for additional costs to production.

Re: Advanced Manufacturing and My Doghouse

Yes, I know where the problem is. I need some additional time to correct this.

Joe

Re: Advanced Manufacturing and My Doghouse

Hello again,

The Standard Costs are now updated correctly when producing an Advanced Assembly.

You should now be able to run the valuation reports correctly.

Please download the following files and replace.

/manufacturing/includes/db/work_order_produce_items_db.inc
/manufacturing/includes/db/work_orders_quick_db.inc

Unfortunately I am not able to fix the stand alone button for 'Close' at the moment. The algorithms are now dependent of the production.
Your stock will not get updated only with adding Costs and issues. Only during the production the standard Costs are updated.

This is the reason why it is difficult to just enter additional Costs after all the production is done.

I am sorry for that, but maybe something shows up during the 2.4 release. Then of course we will fix this.

/Joe

13 (edited by Petros 10/15/2015 08:34:32 pm)

Re: Advanced Manufacturing and My Doghouse

First thing is first. Recent corrections aiming at advanced manufacture caused material_cost column of stock_master to start rounding figures to user_decimal() for purchased items only. This causes:
* Understatement of the value of inventory while passing through one production phase to another.
* Distorts the weighted average accuracy we used to find on inv.valuation report.

Re: Advanced Manufacturing and My Doghouse

@Joe
Back to advanced assembly:
Something remains a disparity between ledger account cost record and the database.
Suppose you produce a product with a $10 BOM, $5 additional issuance, $4 labour & $2 overhead cost:
*The finished goods account receives all $21 (this is where it's improved) but leaves behind the non-BOM costs upon sale of the item. Leaving FG account with leftover $11.
*Stock_master picks up only the $10 and distributes it over material_cost, labour_cost and overhead_cost columns using some strange ratio, I'm still trying to figure out: and this ruins INV. VAL report.
*I noticed that when you issue additional materials, it goes correctly to material_cost column but eventually gets overwritten (instead of adding up) by info from BOM when WO is closed.
*Suppose you produce an item without BOM, simply by a series of issuance of materials and other costs on top, stock_master does receive what ever is given, so does the gl, but after "process" is clicked, stock_master nullifies its column values, while assembly account gets stuck with dissociated costs that remain there even if the item is sold out and, Inv Val report rates the item @ 0.
I guess they all mean the same thing == dissociation.

Re: Advanced Manufacturing and My Doghouse

@Petros,

It can be a Little tricky to test this on an existing assembled item.

When Selling the item (delivery) it takes the Average Standard Cost to credit the Stock of Finished Goods (FG). Material, Labour and Overhead COSTs.This is done correctly.

The Item Valuation Reports can be a Little tricky also to follow.

There is a flag in config.php, called $use_costed_values, that usually is set to 0. Check that this is so. Then the reports are based on the overall average standard cost values. IF set to 1 it will use the average material COSTs over time. Maybe more correct related to the GL reports.

When testing, please start on a fresh Advanced Assembly Product, because we will get false tests otherwise.

Thanks for participating is this valuable test.

/Joe

Re: Advanced Manufacturing and My Doghouse

@Petros: does this work on a new install as desired?
Even if so, what are the standard operating procedures to be followed for Advanced Manufacturing?
Should we set the config flag $use_costed_values?
Are there any advantages prior to using code prior to these last 2 commits?

Re: Advanced Manufacturing and My Doghouse

@Joe
$use_costed_values must remain zero at all times for accounting sake. It includes tax values in to inventory cost and then separately reports tax in liability, causing double consideration of tax in the gl.
Coming to advanced assembly:
On a fresh install as well, I see our recent fixes are advantageous to post production costs to the right assembly account but, behind the screen:
* Labour and overhead costs are not picked up by their respective stock_master columns
* Additional issues properly picked up by material_cost column during production eventually gets overwritten by BOM value post production (instead of adding up)
* Upon purchase, the material_cost column improperly does rounding to the unit rate.
I guess these are the problems and all other disparities are by-products of these same points.

Re: Advanced Manufacturing and My Doghouse

@Petros.

I cannot reproduce your assembly errors.

Will you please give me a detailled example with amounts etc. If there still are errors, I will be extremely glad to fix these,

Joe

19 (edited by apmuthu 10/16/2015 05:54:11 pm)

Re: Advanced Manufacturing and My Doghouse

@Petros: Please provide a backup of the state before the Work Order commences and the steps thereafter to recreate your errors. You should have started from a fresh en_US-new.sql install.

Re: Advanced Manufacturing and My Doghouse

Hi there,
Sorry for the delay: here's a link
https://drive.google.com/file/d/0B8DlmARQ8isNM01BeE03Mzd1Qjg/view?usp=sharing
I included a helpful readme.txt file (which is why I delayed).

Re: Advanced Manufacturing and My Doghouse

@Petros,

Thanks for the test material. It was nice to make the tests from here.

I have fixed the issues, but want to do some further tests Before releasing the files.

I will be back later.

/Joe

Re: Advanced Manufacturing and My Doghouse

Hello,

Here are the new files. They have been committed to repo. replace on your server.

/manufacturing/work_order_costs.php
/manufacturing/includes/db/work_order_produce_items_db.inc
/manufacturing/includes/db/work_orders_db.inc
/manufacturing/includes/db/work_orders_quick_db.inc

@Petros

Remarks to your readme.txt file:

2.a. The issue of 10 'input 1' should NOT be devided by any factor to add the material cost per item price. This is the issue for 1 'Output 1' item.
       The Worth of the 10 'input 1' was $41.40 (not $44.10).

/Joe

23 (edited by Petros 10/17/2015 08:39:50 pm)

Re: Advanced Manufacturing and My Doghouse

@Joe
Thank you for your attention to the problem and prompt responses.
I now have accuracy issues: to replicate my situation:
1. Just restore to previous backup (https://drive.google.com/file/d/0B8DlmARQ8isNM01BeE03Mzd1Qjg/view?usp=sharing)
2. Receive the outstanding p.o >> produce 1 qty of Output1 with $41.4 add.material, $150 labor and $50 Overhead costs.
3. Right away make a 2nd batch production of 3qty of Output1 with $41.4 add.material, $150 labor and $50 Overhead costs.
Now you're supposed to get this:https://drive.google.com/file/d/0B8DlmARQ8isNWGo4RnlHVUxtdE0/view?usp=sharing
But you get this: https://drive.google.com/file/d/0B8DlmARQ8isNNzdrbks3Q1Nid28/view?usp=sharing


* I still see that received p.o. items, appear at a rounded rate in material_cost column, understating the value of inventory. I've agreed with @apmuthu in another thread that rounding is waived at storage level to maintain accuracy and should only apply at display level.

Re: Advanced Manufacturing and My Doghouse

@Petros

Thank you for your persistent testing wink. Please download and replace from the above links again (they have been updated):

/manufacturing/includes/db/work_order_produce_items_db.inc
/manufacturing/includes/db/work_orders_db.inc.

I guess this is as long as I can go with the fixing. It is very complex routines. It also handles ev. negative stock if set etc. Many things to take care of. Digging deaper will require assistance from a skilled programmer that are also familiar with the Advanced Assembly.

/Joe

25 (edited by Petros 10/19/2015 01:06:40 am)

Re: Advanced Manufacturing and My Doghouse

@Joe
I guess the most complex issues are resolved. For someone not referring to Inv.Val report, advanced assembly works at GL level. Exception is:
1) labour_cost column of stock_master table, upon 2nd batch production, if 2nd batch labour cost = 0, doesn't update with new average labour cost. Same to overhead_cost column.
2) Even on the 1st batch production, suppose the production takes 2 days and you insert:
day1 labor cost $150
day2 labor cost $20
Stock_master, labour_cost column overwrites $150 by $20 instead of adding up.

Whoever can dig deep, can take up the challenge from here.