Erik wrote:
Please find attached a replacement 'import_csv.pm' to be placed in lib/LedgerSMB/Scripts/.
Nice!! 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? 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"? 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):
[snip] 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! -- f
On Fri, Dec 27, 2019 at 9:30 AM fmiser <fmiser@gmail.com> wrote:
Erik wrote:
Please find attached a replacement 'import_csv.pm' to be placed in lib/LedgerSMB/Scripts/.
Nice!!
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"
Correct.
Then, it appears I will also have to use the "inventory" script to get "onhand" and "purchase_price" imported, correct?
Exactly.
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):
[snip]
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! -- Bye, Erik. http://efficito.com -- Hosted accounting and ERP. Robust and Flexible. No vendor lock-in.
Erik wrote:
Please find attached a replacement 'import_csv.pm' to be placed in lib/LedgerSMB/Scripts/.
fmiser wrote:
Nice!!
[ 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 / ]
Erik wrote
Let me know how it works out!
I'm not getting it to work. Initially I got an error message. After trying stuff, I think the error quit when I put a number, not a string in "partsgroup". But it didn't _do_ anything. The window grayed, no error, and 20 min later it was still the same. The file had 15 lines. So now I'm wondering if there is a problem with my csv data. Maybe it has to do with null fields. Should they be zero? Blank? "purchaseprice" and "onhand" are handled by inventory import, to be run next - right? Or maybe blank lines don't work? Any clues? -- f
Network Analysts maintain network security, gather and analyze the data to detect issues efficiently. They will then troubleshoot and fix the misbehaving network related connections. https://www.fieldengineer.com/skills/what-is-a-network-analyst
Still not able to get the new goods import script to work. Further digging in the table and such and I found that "f" (false) seems to be the correct null character for some fields. Others need "0" (zero). Most of the time I'm getting this error. Can't use an undefined value as a subroutine reference at /usr/share/ledgersmb/bin/../lib/LedgerSMB/Scripts/import_csv.pm line 517 One time I got "internal server error". But I don't know what log where to look for useful info. I tried using the same file - but did not get the same error! In syslog, I see "Compilation failed in require at /usr/share/perl5/Module/Runtime.pm line 314." I think I succeeded in importing directly to the parts table, but was hoping this import script would work. -- f
participants (3)
-
Erik Huelsmann
-
fmiser
-
srugamk@gmail.com