When we want to post item purchase, we can do it in one step (posting receipt and invoice in the same time) or in two steps (posting receipt in the first step, and then posting invoice). In my example, I have used second example. In my example, I also use line and invoice discounts, for better example.
But, in any case, we have some rules about posting groups. Some posting groups are used from document header, and other from document line. In following chart, you can see how system uses posting groups on documents.
When we finish posting of receipt, we will get only two entries in G/L Ledger. These are only entries about inventory:
When we post invoice related with posted receipt, we will get more entries in G/L Entries. You can find completely description of them in next table: