[ic] HELP !!! - problem in log_transaction

Andrei Gologan interchange-users@icdevgroup.org
Mon Jan 13 15:45:01 2003


well i have a biiiiig problem. I inserted some code into log_transaction. we
have to types of items limited and not limited ....for the not limited it
works fine , for the limited it should decrement the inventory table as well
as quantity in another table: menge
If on the order there is only just ONE limited article it works out fine.
If there are 2 or more limited items ist works out for the first one, and
for the rest it inserts bogus data, aparently no logic .....
I know it works, but it is something I cannot get ....

here is the code:

[if variable DECREMENT_INVENTORY]Inventory of [item-code] now:
        [data
                table=inventory
                col=quantity
                key="[item-code]"
                increment=1
                value="-[item-quantity]"
        ]

[if-item-field limitiert eq 1]
[query list=1 sql="SELECT quantity FROM menge WHERE username='[data session
username]' AND sku='[item-code]'"]
[query sql="update menge set quantity='[calc][sql-param
quantity]-[item-quantity][/calc]' where sku='[item-code]' and
username='[data session username]'" ]
[/query]
[/if-item-field]

[/if]

THANK YOU !!! for any help !!

Andrei