>For inventory control I need:
>1. when invoice is saved, the parts in invoice will will automatically subtract from the product table.
>2. when invoice is saved, the ordering grid can't be touched.. so it can't be alter.
>3. when the quantity column has '-' quantity then it automatically added to the product table.
>------
>so my question is..
>I would like to know how to make a code so that when invoice is 'saved' it goes off seeking a data on
>gridlineitems and does it's job as shown above.
>Can anybody give me a hint?
>Thank you very much.
Evan,
It's not an easy and short one to do all these. I have an FPDOS 2.6 and VFP version but in Turkish you wouldn't understand much. To startup at least I could say tastrade.app (home()+"samples\tastrade") is a good example doing much of you want. Take a look at it and still have questions sure would help. Short notes for now :
1) Provide a save button. When clicked would add current grid contents to real table (an invoice entry is most likely to work with temporary cursor during entry), scan partcodes in product table and replace quantity with quantity - invoice.quantity.
2) If you use the way I suggested (use temp cursor for entry), you could easily set grid.readonly = .t. when grid is populated from an existing invoice or even simplier than you could set grid.recordsurce to an SQL that couldn't be edited at all.
3) If that "-" denotes minus sign, same as 1) nothing special, subtracting a negative value would add to stock.
Cetin