If we have at least one incoming payment corresponding to one of the sales orders linked with the invoice, then it creates a Batch-input, via FB05, it clears the invoice and creates items for each sales orders, taking into account the cash discount.
If there is an incoming payment for the sales order:
Posting key = 09/19
Special GL = “A”
If there isn’t any incoming payment
Posting key = 06/16
Without Special GL