Well, couldn't find an explanation for this bug or the proper way to perform payment cancellation that won<t reverse the full deposit amount instead of reversing only the payment line, so I fixed the code in the class BankPaymentCancelType::construct() as follow. Now the behavior is the same as it was in AX 2009:
else if (_custTrans)
{
bankPaymCancelType = new BankPaymCancelType_CustTrans();
//Begin
if(_bankDeposit)
{
bankPaymCancelType.init(_custTrans,
_custVendPaymJournalFee,
_bankAccountTransToCancel,
ReasonTableRef::checkCreateInCompany( _reasonRefID, _bankAccountTransToCancel.DataAreaId),
_ledgerVoucher,
_ledgerVoucherObject,
_bankDeposit.AmountMST,
_bankDeposit.AmountCur,
_bankDeposit.BankTransAmountCur,
BankParameters::find().nsfTransactionType,
_bankAccountTransToCancel.Txt);
}
else
{
bankPaymCancelType.init(_custTrans,
_custVendPaymJournalFee,
_bankAccountTransToCancel,
ReasonTableRef::checkCreateInCompany( _reasonRefID, _bankAccountTransToCancel.DataAreaId),
_ledgerVoucher,
_ledgerVoucherObject,
-_custTrans.AmountMST,
-_custTrans.AmountCur,
-_custTrans.AmountCur,
BankParameters::find().nsfTransactionType,
_bankAccountTransToCancel.Txt);
}
// AX 2012 base: reverses the full deposit slip amount instead of reversing only the payment line
/*
bankPaymCancelType.init(_custTrans,
_custVendPaymJournalFee,
_bankAccountTransToCancel,
ReasonTableRef::checkCreateInCompany( _reasonRefID, _bankAccountTransToCancel.DataAreaId),
_ledgerVoucher,
_ledgerVoucherObject,
_bankAccountTransToCancel.AmountMST,
_bankAccountTransToCancel.AmountCur,
_bankAccountTransToCancel.BankTransAmountCur,
BankParameters::find().nsfTransactionType,
_bankAccountTransToCancel.Txt);
*/
//End
}