On Fri, Dec 27, 2019 at 9:30 AM fmiser <..hidden..
> Erik wrote:
> Please find attached a replacement 'import_csv.pm' to be placed
> in lib/LedgerSMB/Scripts/.
In looking at the file, I see that "goods" has this listed after it.
[ qw/ partnumber description unit listprice sellprice lastcost
weight notes makemodel assembly alternate rop inventory_accno
income_accno expense_accno returns_accno bin bom image drawing
microfiche partsgroup avgcost taxaccnos / ]
I'm suspecting the "qw" is not part of the field list - correct?
That's correct: [ qw/ a b c / ] is a Perl construct and is the same as [ 'a', 'b', 'c' ].
So my CSV should have a header row, then on row 2 have "partnumber", then "description", etc on up to "taxaccnos"
Then, it appears I will also have to use the "inventory" script to
get "onhand" and "purchase_price" imported, correct?
What's a good way to figure out the values for "inventory_accno",
"income_accno", "expense_accno", and "taxaccnos"?
Ah. Sorry, I forgot to add that bit of description. The best way to find the values is to look at the screens for "Add Part", "Add Service" and "Add Overhead". On the "Add Part" screen, on the left, there are 4 drop down lists: Inventory, Income, COGS (=expense_accno) and Returns. The dropdown lists provide the available accounts in the format "<accno>--<description>". For the values in the upload, you just use the bit before the "--"; so, just the <accno>.
Below the 4 dropdowns, there's a section listing taxes. These are not drop-downs, but a series of checkmarks with a label "<accno>--<description>". The value of "taxaccnos" is a colon separated list of the taxes you want to check. E.g. you have 5 taxes with numbers ranging 1101 to 1105, a valid value for "taxaccnos" could be "1102:1104" to check the 1102 and 1104 accounts.
By looking at
the "parts" table psql I see the first 3 - but I'm not sure about
"taxaccnos". Where do I find that?
> I've tested the script by uploading an "overhead" on 1.6.17. The
> version difference should matter little, because the import file
> hasn't seen much churn over the 1.6.x release cycle.
> There's no menu option, but here's how to upload goods (=parts
> that are not services and not overhead):
The instructions look manageable. I don't have time to test it
tonight, but hope to give it a trial run really soon!
This is wonderful - thanks!
Let me know how it works out!