When receipting a Supplier Invoice the following rules (Hierarchy) are used to determine which G/L Purchases code the Product/Service is coded to:
If an item is coded straight to a General Ledger code (ie in the Code column of the Invoice) the Purchase will go against this G/L code
If a Product is being purchased, the following priorities are used in choosing which Purchase G/L code the sale will go to:
1) Infusion will look to the Location the Product is set against and see if there is a Purchases G/L code against this Location for this Product
Products / Manage Products / Modify / Locations - PRODBALS
2) The next option is the Purchases G/L code for the Location the Invoice is against
Admin / Settings / Products / Manage Locations - LOCATIONS
3) The Product Purchases G/L Code is the next option
Products / Manage Products / Product Details / Settings - PRODUCTS
4) The Default Purchase G/L code setup in the Financial Control Link is used if there are no other options
Admin / Defaults / Manage Financial Defaults - TABLES
When the Purchase Order lines are for a Job, the Location of the Purchase Orders is used unless the Job has a different location, in which case it will use the Job Location, when it's using Location in 1) or 2)
If there is no Purchase G/L code field entered against a Location in step 1) the software will look to 2), and again if there is no Purchases G/L code against the Location for the Product it will move onto 3), and lastly use 4).
NB: The G/L codes against the Product Groups are used only when setting up Products, to populate G/L codes in PRODBALS and PRODUCTS.
See here for the tables that store the above GL Codes