Skip to main content

Notifications

Announcements

No record found.

Dynamics 365 Community / Forums / Finance forum / Cash Advance Remaining...
Finance forum
Suggested answer

Cash Advance Remaining Balance Does Not Deducted

Posted on by 1,980

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.

pastedimage1616413968270v1.png

Using payment method Employee as offset.

pastedimage1616414017627v2.png

Cash advance voucher.

pastedimage1616414099988v3.png

Expense report approved and processed for payment.

pastedimage1616414158756v4.png

Transaction on expense report lines.

pastedimage1616414222771v5.png

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

  • Suggested answer
    RE: Cash Advance Remaining Balance Does Not Deducted

    Hi Jefry,

    In order to settle Expense report line with Cash advance, it is necessary to setup payment method in following way:

    • Expense owner: Employee
    • Offset account type: Worker

    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
            {

Helpful resources

Quick Links

Replay now available! Dynamics 365 Community Call (CRM Edition)

Catch up on the first D365 Community Call held on 7/10

Community Spotlight of the Month

Kudos to Saurav Dhyani!

Congratulations to the June Top 10 community leaders!

These stars go above and beyond . . .

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 287,696 Super User

#2
Martin Dráb Profile Picture

Martin Dráb 225,490 Super User

#3
nmaenpaa Profile Picture

nmaenpaa 101,148

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans