webERP Forum
BILL OF MATERIALS - Printable Version

+- webERP Forum (
+-- Forum: webERP Discussion (/forumdisplay.php?fid=1)
+--- Forum: Development Discussion & Specification (/forumdisplay.php?fid=10)
+--- Thread: BILL OF MATERIALS (/showthread.php?tid=2684)

BILL OF MATERIALS - petero@laballieds - 01-20-2016 05:38 PM

Hi guys, have been looking for best ERP to manage the company's business, i wanted web based php good lack found weberp promising to others because of the easy of understanding its code base. Guddos guys

My question is how do i import a CSV BOM guys, is there any script doing so.
so far have imported all stock items.

RE: BILL OF MATERIALS - falkoner - 01-20-2016 07:13 PM

I don't think there is a script to do it, but mysql does have it's own command for importing csv files. So assuming you have a csv file with the data like this:

| Field | Type | Null | Key | Default | Extra |
| parent | varchar(20) | NO | | | |
| sequence | int(11) | YES | | 0 | |
| component | varchar(20) | YES | | | |
| workcentreadded | char(5) | YES | | | |
| loccode | char(5) | YES | | | |
| effectiveafter | date | YES | | 0000-00-00 | |
| effectiveto | date | YES | | 0000-00-00 | |
| quantity | double | YES | | NULL | |
| autoissue | tinyint(4) | YES | | 0 | |

All you need is to issue the following command to mysql:

LOAD DATA INFILE "/path/to/your/file/boms.csv"

You will need to adjust the line terminator if your file has windows line terminators instead of unix and the last part says to ignore the first line of the file assuming they are headers. Obviously change for your file.


RE: BILL OF MATERIALS - petero@laballieds - 01-20-2016 08:23 PM

Thanks Falkona , i will try your approach for now and see the outcome.
#1062 - Duplicate entry 'A008-INT002-W001-1' for key 'PRIMARY', yet i have no duplicate vlue for A008, Any help with this thread

RE: BILL OF MATERIALS - falkoner - 01-20-2016 10:50 PM

The primary key is

`parent` - A008, `component` - INT002, `workcentreadded` - W001, `location` - 1

Are you saying that you only have one record with these fields/values? If so are you sure you have your line endings correct windows/unix?


RE: BILL OF MATERIALS - petero@laballieds - 01-20-2016 11:51 PM

Kindly find attached a part of my bom parent sequence continuos until z001

I added few columns to bom table

RE: BILL OF MATERIALS - agaluski - 01-21-2016 12:43 AM

This is a duplicate. Same Parent, Component, Workcenter and location
A008 0 INT002 W001 1 1/6/2016 1/7/2036 0.4 1 TAB 1000 1000 INACT
A008 0 INT002 W001 1 1/6/2016 1/7/2036 1.6 1 TAB 1000 1000 INACT

RE: BILL OF MATERIALS - petero@laballieds - 01-21-2016 09:16 PM

Thanks so much Agaluski, it worked, that was the problem. The only problem i have is that in some of the bom setup(that i imported from csv) there is an added empty component when the bom(finished) product is expanded. This list of expanded Bom also displays error :the date format invalid ' when i try to delete the empty component nothing happens, when i try to search bom tablle for empty components nothing any suggestions, otherwise i thank you so much i am a mile ahead now.

RE: BILL OF MATERIALS - falkoner - 01-21-2016 09:46 PM

One thing I notice in that csv file is that the dates are in the form dd/mm/YYYY. For mysql they should be in the form YYYY-mm-dd - sorry I should have mentioned that when I posted the original query.

Not sure if this is what is causing the issue though,


RE: BILL OF MATERIALS - petero@laballieds - 01-22-2016 11:17 PM

Thanks it worked , i also noticed i had imported some items in the stockmaster with empty stockid.
I have done everything is fine now am guddos alot for ua help i love the easy of use of weberp, Finally am changing the table that displays bom to group by mbflag ie i should see a group of raw materials, finished products, i have appended 'group by stockmaster.mbflag' to the BOM query (i have also described a condition to display full descriptive name- if mbflag eg if mbflag='M' $constant="Finished Product" and display $constant insted of mbflag its working well apart from the grouping issue.