Topic: Error during CSV Inventory Import

Description:
DATABASE ERROR : Could not find dimension
error code : 1064
error message : You have an error in your SQL syntax; check the manual that
corresponds to your MySQL server version for the right syntax to use near '' at
line 1
sql that failed was : SELECT * FROM 0_dimensions WHERE name=

FrontAccounting 2.3.5
Inventory Items CSV Import  2.3.0-1(Installed) 2.3.0-1(Available)
MySQL 5.1
Apache 2.2.XX (Latest Version)

Link to my CSV:
https://docs.google.com/leaf?id=0B5_5equsThdMYTQ2N2IyYTAtY2Y2ZC00NDQ0LThmZWItNGU0ZWZkZTAzZDc1&sort=name&layout=list&num=50

Re: Error during CSV Inventory Import

Hello Tom Moulton,

Will you have a look at this. I guess you wrote this module, right?

/Joe

Re: Error during CSV Inventory Import

Yes I will look at it

Re: Error during CSV Inventory Import

It looks like you are missing a column:

ITEM;ITEM_CODE;STOCK_ID;Description;Category;units;dummy;MB_FLAG;Currency;Price;

Where Item_Code = STOCK_ID of the item.


You have the STOCK_ID missing

I think for the most part ITEM_CODE == STOCK_ID, these are used in the 'item_codes' table

Also line 52 of import_items.php has a problem it should be:

function get_dimension_by_name($name) {
    if ($name == '') return 0;

it was

    if ($name = '') return 0;

If you are using dimensions, it seems that the 'dummy' field before MB_FLAG is where you can put a dimension

Let me know if this fixes you up

tom

Re: Error during CSV Inventory Import

Works like a charm now.  Thank you guy very much.

Re: Error during CSV Inventory Import

Quick question on this though, is it possible to add my cost to the same csv to import that as well?

Re: Error during CSV Inventory Import

No, see the readme.txt for BUY

tom

Re: Error during CSV Inventory Import

Thank you guys for the help.  After getting the first import to work we are switching to using the BUY option to import for our next update.

I was wondering if it will read a Category column if I add one into it.