[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: PO creation in cli



Okay, I got obsessive about this (plus I'm sick and don't really want to work on the pieces I should be working on :)).

Using the trick Chris mentioned and $form->error(), I tracked down the problem...

Line 87 of branches/1.2/bin/arap.pl

I'm passing in the form params:

vendor=K-L MANUFACTURING--10349&
oldvendor=K-L MANUFACTURING--10349&

But on the above mentioned lines, '--$form->{"${name}_id"}' is added on during the comparison of oldvendor and vendor. Was that intentional? If it was, then the following is out of whack as well. At line 97, you get the name. You pass in the value of $name which goes to the following:

Line 1698 of branches/1.2/LedgerSMB/Form.pm

Here, the query attempts to do compare "lower(name)" from db against essentially $self->{$table}, which has a value of "k-l manufacturing--10349", which will fail every time, unless I change the value of vendor to include just the name. In which case, I get a different error. Including the very large selectvendor form param also solves the problem because it causes the first conditional within sub check_name of arap.pl to execute. Since the two values are the same, the conditional fails.

I'm sure this is pretty incoherent but I'm proud of myself for tracking this one down. So, what's the fix? :)

Charley

Chris Travers wrote:
On 1/2/07, Charley Tiggs <..hidden..> wrote:
I did before and just tried it again.  Here's the result:

Error: menu.pl:108: Error: menu.pl:108: Error: Vendor not on file!

Compilation failed in require at ./oe.pl line 2.

One neat trick is to add something to the menu.pl after the form is
instantiated (i.e. after $form = new Form) that says:

$form->debug();

This will let you see what the form is grabbing from your input.  It
might be helpful.

Best Wishes,
Chris

Charley

Chris Travers wrote:
Try changing the space to %20.

On 1/2/07, Charley Tiggs <..hidden..> wrote:
I'm trying to create a PO in the cli and am getting hung up.  Here's the
script:

./oe.pl "path=bin/mozilla&
login=me&
password=geekygeek&
action=save&
type=purchase_order&
vc=vendor&
vendor=K-L MANUFACTURING--10349&
oldvendor=K-L MANUFACTURING--10349&
vendor_id=10349&
currency=USD&
defaultcurrency=USD&
employee=me--10157&
ordnumber=88123&
transdate=2007-01-02&
reqdate=2007-02-02&
partnumber_1=1823100&
description_1=Black X-Small Pro Racer Skort&
qty_1=10&
sellprice_1=24.58&
id_1=397139&
taxaccounts_1=&
notes=order saved from the command line&
rowcount=2"

Every time I run the above, I get the following error:

Error: menu.pl:108: Error: menu.pl:108: Error: Vendor not on file!

I know the vendor exists because I went into the db to pull it up.  So
far as I can see, everything that's needed is there.  On the offchance
that I was missing something, I went into the GUI and viewed the source
code, copied out all of the variables there and tried each one,
eliminating the ones that clearly weren't needed.  And I still got the
above error.  What am I missing?

Charley