Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Suggested answer

Cash Advance Remaining Balance Does Not Deducted

(0) ShareShare
ReportReport
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
    Michal Krejza Profile Picture
    on at
    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
            {

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Daivat Vartak – Community Spotlight

We are honored to recognize Daivat Vartak as our March 2025 Community…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Kudos to the February Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 293,238 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 231,923 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156 Moderator

Leaderboard

Product updates

Dynamics 365 release plans