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

Small issue using API to update parts



Hello folks,

I've got a puzzler of a problem that I've been trying to solve for the better part of two months. It hasn't been that big of an issue before now because it was a relatively minor issue. Now, though, it's elevating in importance.

Within the web application, a user wants to update a product. Approximately 3 months ago, I was assuming that the update did not need to include the vendor. When the vendor was not included, the vendor that already existed with the part was removed. To fix that, I learned to include the vendor.

Yesterday, about a 5 weeks later, I noticed that every time a product was updated, the vendor was duplicated. Here's the CLI call to update the product:

cd /usr/local/ledgersmb;./ic.pl "taxaccounts=2150
&IC_inventory=1510--Inventory
&IC_income=4010--Sales
&IC_expense=5010--Purchases
&IC_tax_2150=0
&weightunit=lbs
&action=Save
&employee=script+user--10157
&login=scriptuser
&password=scriptuserpass
&path=bin/mozilla
&id=423431
&partnumber=18231240
&description=product+description
&pricegroup_1=Retail--10161
&pricebreak_1=
&customerprice_1=80.00
&customercurr_1=USD
&pricegroup_2=Wholesale--10163
&pricebreak_2=
&customerprice_2=30.00
&customercurr_2=USD
&customer_rows=3
&sellprice=40
&listprice=80
&lastcost=24.89
&unit=1
&weight=9
&markup=
&rop=0
&bin=
&obsolete=
&vendor_1=vendor+name--10433
&partnumber_1=18231240
&lastcost_1=24.89
&vendorcurr_1=USD
&leadtime_1=30
&vendor_rows=2"

My question: Why would the vendor be duplicated? I'm including the same information as is passed when going through the web interface for LedgerSMB. What am I missing here?

For now, I've conditionalled the addition of the vendor. If a vendor doesn't exist, then I'm not adding the lines to update the vendor. But I'm still getting cases where the vendor is removed when the vendor is not added.

Any help/insight would be appreciated,
Charley