Atlassian uses cookies to improve your browsing experience, perform analytics and research, and conduct advertising. Accept all cookies to indicate that you agree to our use of cookies on your device. Atlassian cookies and tracking notice, (opens new window)
Payment Print/Export generates duplicate C_DepositBatch on re-run
Description
MPaySelectionCheck.confirmPrint(MPaySelectionCheck[], MPaymentBatch, boolean) will, if the last parameter is true, generate a C_DepositBatch record when you confirm your Payment Print/Export. This is desired behaviour.
If you go back to Payment Print/Export and re-run it for the same C_PaymentSelection, it will not re-create C_Payment records for the C_PaySelectionCheck lines. This is also desired behaviour. However, it will create a new (duplicate) C_DepositBatch record and a new C_DepositBatchLine record for each line. This is not desirable behaviour.
It should not be too hard to fix this, by moving the code that creates the header (C_DepositBatch) record until after the call that creates the payment (the call to confirmPrint(MPaySelectionCheck, MPaymentBatch)). The code can the inspect the created payment, see if it already belongs to a deposit batch, and only create a deposit batch if it isn't already allocated to one.
Environment
Not OS specific. Working with mercurial repository changeset# 12212:3bf205c237a3
Activity
Show:
Andres Lopez Andrade June 25, 2020 at 2:25 PM
Triaged by Andres Lopez
Still reproducible on 7.1z
Jeremy Krieg September 27, 2018 at 3:53 AM
Sorry, I meant to flag this is a minor, not a major issue. I think it should be considered minor because there is an easy workaround (ie, don't run Payment Print/Export twice for the same PaySelection). On the other hand, perhaps it should be considered major because of the potential headaches it could cause to the organisation that inadvertently stumbles upon this bug.
MPaySelectionCheck.confirmPrint(MPaySelectionCheck[], MPaymentBatch, boolean) will, if the last parameter is true, generate a C_DepositBatch record when you confirm your Payment Print/Export. This is desired behaviour.
If you go back to Payment Print/Export and re-run it for the same C_PaymentSelection, it will not re-create C_Payment records for the C_PaySelectionCheck lines. This is also desired behaviour. However, it will create a new (duplicate) C_DepositBatch record and a new C_DepositBatchLine record for each line. This is not desirable behaviour.
It should not be too hard to fix this, by moving the code that creates the header (C_DepositBatch) record until after the call that creates the payment (the call to confirmPrint(MPaySelectionCheck, MPaymentBatch)). The code can the inspect the created payment, see if it already belongs to a deposit batch, and only create a deposit batch if it isn't already allocated to one.