Requirement
In standard D365 Finance & Operation, you can manually select the transactions to settle, or Microsoft Dynamics AX/D365 FO can select the transactions automatically by using the automatic settlement functionality. You can enable this feature by selecting the Automatic settlement check box in the Accounts receivable Or Accounts payable parameters form.But the customer/Client wants the same functionality of automatic settlement vendor-wise & customer-wise.
Sample Code
1 enum field is provided in customer and vendor master. Values of enum is Manual Settlement (1) & Automatic Settlement (2).
[code language = “cpp”]
[ExtensionOf(classStr(OffsetVoucher))]
final class ACPLOffsetVoucher_Extension
protected boolean skipMarkTransaction(CustVendTrans _custVendTransCredit, CustVendTrans _custVendTransDebit, boolean _areBillingClassificationsEnabled, boolean _isRestricted)
{
boolean ret = next skipMarkTransaction(_custVendTransCredit, _custVendTransDebit, _areBillingClassificationsEnabled, _isRestricted);
if (_custVendTransCredit.tableId == tableNum(VendTrans))
{
if (VendTable::find(_custVendTransCredit.AccountNum).AcxSettlement == AcxSettlement::Manual)
{
ret = true;
}
}
else if (_custVendTransCredit.TableId == tableNum(CustTrans))
{
if (CustTable::find(_custVendTransCredit.AccountNum).AcxSettlement == AcxSettlement::Manual)
{
ret = true;
}
}
return ret;
}
}
[/code]
How to Achieve this in Ax 2012 as the Method skipMarkTransaction() does not Exist in Class OffsetVoucher