When implementing GL or modifying stock group posting codes for general ledger integration, we can easily update the posting codes on each item as follows.
In Exoconfig, go to Stock, Stock Groups then set the GL posting codes by double clicking on each one. (Note: this data can be entered via Quick Inserts if there are a significant number of stock groups).
Run the following script to update the items
Update stock_items set stock_items.sales_gl_code=stock_groups.sales_gl_code
From dbo.stock_items inner join
dbo.stock_groups on dbo.stock_items.stockgroup=dbo.stock_groups.groupno
Complete for purch_gl_code
Next check the gl posting on lookup items as the purch_gl_code should be the same as the cos_gl_code.