Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
BILL OF MATERIALS
01-20-2016, 05:38 PM,
#1
BILL OF MATERIALS
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.
PeterWink
Reply
01-20-2016, 07:13 PM,
#2
RE: BILL OF MATERIALS
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"
INTO TABLE bom
COLUMNS TERMINATED BY ','
OPTIONALLY ENCLOSED BY '"'
ESCAPED BY '"'
LINES TERMINATED BY '\n'
IGNORE 1 LINES;

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.

Thanks
Tim
Reply
01-20-2016, 08:23 PM, (This post was last modified: 01-20-2016, 09:21 PM by petero@laballieds.)
#3
RE: BILL OF MATERIALS
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
Reply
01-20-2016, 10:50 PM,
#4
RE: BILL OF MATERIALS
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?

Thanks
Tim
Reply
01-20-2016, 11:51 PM, (This post was last modified: 01-20-2016, 11:53 PM by petero@laballieds.)
#5
RE: BILL OF MATERIALS
Kindly find attached a part of my bom parent sequence continuos until z001

I added few columns to bom table


Attached Files
.csv   bom.csv (Size: 241.14 KB / Downloads: 5)
Reply
01-21-2016, 12:43 AM,
#6
RE: BILL OF MATERIALS
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
Reply
01-21-2016, 09:16 PM,
#7
RE: BILL OF MATERIALS
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.
Reply
01-21-2016, 09:46 PM,
#8
RE: BILL OF MATERIALS
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,

Tim

Reply
01-22-2016, 11:17 PM, (This post was last modified: 01-22-2016, 11:26 PM by petero@laballieds.)
#9
RE: BILL OF MATERIALS
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.
Wink


Attached Files
.txt   bom sql.txt (Size: 1.29 KB / Downloads: 3)
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)