
Hi all,
I made a cash advance for an employee Julia (Contoso USMF) and already approved and paid it, let's say 1000 USD. Cash advance journal successfully generated and also I did payment for the cash advance. Now Julia have to make an expense report. Payment method is set to employee. I have set employee vendor in HR module. When expense report approved, I can't see Julia remaining balance is deducted. Do you know what step I'm missing?
I was following this guide to test.
http://d365tour.com/en/microsoft-dynamics-d365o/trade-logistics-d365fo-en/cash-advance/
Here are some of my screenshots.
My original and final balance of cash advance.
Using payment method Employee as offset.
Cash advance voucher.
Expense report approved and processed for payment.
Transaction on expense report lines.
And when I back to cash advance, still remaining balance not deducted.
One thing that I wondered is, how D365FO know that cash advance which has been made because when creating expense report, I think I didn't refer it to cash advance ID. Maybe something missing in my step? Kindly help.
Thank you.
Jefry
Hi Jefry,
In order to settle Expense report line with Cash advance, it is necessary to setup payment method in following way:
In your setup the Expense owner is not setup correctly and therefore expense is not settled with cash advance.
To your second question - in the current design (10.0.17) - it is not possible to select which Cash advance will be settled with Expense line. System simply selects the Cash advance with highest balance in accounting currency connected to employee from expense. Below is an example of code responsible for selecting the cash advance.
////// Insert records into TrvAccountingDistribution when expense line (distribution) amount is less than available cash advance. /// /// /// The current TrvExpTable record. /// private static void insertTrvDistForExpAmountLessThanCashAdv(TrvExpTable _trvExpTable) { TrvSubmitAccDistribution trvSubmitAccDistributionView; TrvTaxUncommittedDistributionView trvTaxUncommittedDistributionView; TrvAccountingDistribution trvAccountingDistribution; TrvAccountingDistribution trvAccountingDistributionSum; TrvCashAdvance trvCashAdvance; CurrencyCode cashAdvanceCurrencyCode; RefRecId cashAdvanceOldRecId; container remainingBalanceContainer; AmountMST trvAccountingDistributionAmountMST; AmountMST remainingExpenseLineAmount = 0; AmountMST remainingAdvanceAmount = 0; AmountMST cashAdvanceForContainer = 0; AmountMST cashAdvanceBalanceAmount = 0; int numItems, i; ttsBegin; // Select all cash advances and consume them against each distribution of expense line. while select RecId, BalanceMST, CurrencyCode from trvCashAdvance order by trvCashAdvance.BalanceMST desc where trvCashAdvance.RequestingWorker == _trvExpTable.CreatingWorker && trvCashAdvance.CashAdvanceStatus == TrvWorkflowCashAdvanceStatus::Paid && trvCashAdvance.BalanceMST > 0 {