Skip to main content

Notifications

Announcements

No record found.

Business Central forum

Adding Currency on Word Custom Report Layout (Invoice)

(0) ShareShare
ReportReport
Posted on by

Is it possible to add the customers currency on an invoice (Custom Report Layout template).

I found I can add LocalCurrency_Lbl but this only give the word local currency.  It doesn't show up as USD, CAD, etc.  All the other XML mappings seem to follow the format Lbl for description and then without Lbl for the actual dataset.  However I can't find currency in the XML mapping pane.

THANKS!

Categories:
  • JAngle Profile Picture
    JAngle 46 on at
    RE: Adding Currency on Word Custom Report Layout (Invoice)

    Hi Maarten

    This requires some additional logic but what I've done here is I've added to the currency table a field to show which bank account should be used on the document. This was down to there being more than one bank account for various currencies, so I couldn't rely on the logic the "Currency Code" on the bank account record.

                    IF "Currency Code" = '' THEN BEGIN
                        IF BankAccountTbl.GET(SalesSetup."LCY Doc. Bank Account") THEN BEGIN
                            FormatAddr.BankAcc(BankAccountAddr, BankAccountTbl);
                            BankAccountNumber := BankAccountTbl."Bank Account No.";
                            BankAccountSortCode := BankAccountTbl."Bank Branch No.";
                            BankAccountIBAN := BankAccountTbl.IBAN;
                            BankAccountCurrencyCode := STRSUBSTNO(DocCurrAndSymbol, GLSetup."LCY Code", GLSetup."Local Currency Symbol");
                            BankBIC := BankAccountTbl."SWIFT Code";
                        END;
                    END ELSE
                        IF CurrencyTbl.GET(Header."Currency Code") THEN BEGIN
                            IF BankAccountTbl.GET(CurrencyTbl."Document Bank Account") THEN BEGIN
                                FormatAddr.BankAcc(BankAccountAddr, BankAccountTbl);
                                BankAccountNumber := BankAccountTbl."Bank Account No.";
                                BankAccountSortCode := BankAccountTbl."Bank Branch No.";
                                BankAccountIBAN := BankAccountTbl.IBAN;
                                BankAccountCurrencyCode := STRSUBSTNO(DocCurrAndSymbol, BankAccountTbl."Currency Code", CurrencyTbl.Symbol);
                                BankBIC := BankAccountTbl."SWIFT Code";
                            END;
                        END;

  • Suggested answer
    JAngle Profile Picture
    JAngle 46 on at
    RE: Adding Currency on Word Custom Report Layout (Invoice)

    Using report 1306 as an example the below call is made to the FormatDocument codeunit and you see it passes a parameter for another function call which is on the Sales Invoice Header table. You simply need to set a new variable that makes a call to the same global function in the report in the OnAfterGetRecord trigger of the Sales Invoice Header.

    pastedimage1592812354660v1.png

    pastedimage1592812475484v2.png

  • Maarten VS Profile Picture
    Maarten VS 45 on at
    RE: Adding Currency on Word Custom Report Layout (Invoice)

    Thanks Josh, that is really useful feedback. I know that the currency is exposed via the TotalText, but it is not the "currency code" but the "currency symbol" that is actual used. So the text shows as "Total $". Not very useful is you are doing business in Canada, US, Australia,... I could change the symbol to the currency code, but that is rather dirty. So I'll explore the document layout editing apps first.

  • Suggested answer
    JAngle Profile Picture
    JAngle 46 on at
    RE: Adding Currency on Word Custom Report Layout (Invoice)

    It's not a piece of data exposed in the XML of the word doc template. It's something you could get your partner to do or you could arrange to do it yourself as an extension development.

    Screenshot_5F00_20200621_2D00_180426_5F00_Acode.jpg

    Screen grab shows the currency code of the sales invoice header is passed into a code unit to produce a text string. This is the total that has the currency showing. Simple enough to expose the currency code on it's own. You will have to do it from a copy of the report. Alternatively you could find a document layout editing app from appsource.

  • Maarten VS Profile Picture
    Maarten VS 45 on at
    RE: Adding Currency on Word Custom Report Layout (Invoice)

    Hi Paul, any luck on finding how to add the currency in the custom report? I would like to add a conditional field with the bank info depending on which currency the invoice is in, but got stuck too because the currency field is missing.

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

November Spotlight Star - Khushbu Rajvi

Congratulations to a top community star!

Forum Structure Changes Coming on 11/8!

In our never-ending quest to help the Dynamics 365 Community members get answers faster …

Dynamics 365 Community Platform update – Oct 28

Welcome to the next edition of the Community Platform Update. This is a status …

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,642 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,371 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans