
To add a new action when posting an AP Invoice journal, you can follow these steps:
Create two new fields in the API parameter: One for the Account and the second for the Offset Account.
When you click on "Post," you need to create two lines in the voucher using the Account and Offset Account from the parameter. If there are no errors, continue with the normal code to create the voucher.
After creating the voucher, when you open the voucher screen in the journal, you should see four lines. Two lines will be created using the Account and Offset Account from the parameter, and the other two lines will be created using the Account and Offset Account entered in the journal.
To accomplish this, you will need to customize the code or develop a custom extension to handle the additional logic and create the extra voucher lines.