Hi PMH

I agree with Alec re using the batch import functions to maintain the integrity of the database files. You can raise an inventory journal, export it, and see what the import batch file's structure needs to be. Under the help menu in Pastel, search for import file layouts - the layout of the inventory journal specific to your version of Pastel will be there.

When you post an inventory journal - the stock transaction will be written into the historylines file (acchistl). While the batch is open, you should write entries to the unposted file (accprdq), which clears on update of batch (skip if writing directly to tables). The stock qty needs to be adjusted in the multistoretransaction file (accstkst) in that period. The general ledger entries (inventory control and inventory adjustment) need to be written to the ledgertransaction (acctrn) file and the balances need to be updated in the LedgerMaster (accmas).

I am not a developer - not sure how long it would take to get all that right, tested and functioning - but it would seem like inventory journal batch imports would probably be easier.

Good luck