total amount in Sales Invoice Header

qedqed Member Posts: 14
I thought of the Total Amount as a value that is accesible at any moment.
Apparantly it isn't. It turns out to be zero if you access it in the Invoice Header.
I tried everything, CALCSUMS, CREATETOTALS but nothing worked so far.

Help will be appreciated.

Answers

  • navisi0nenavisi0ne Member Posts: 36
    You have to release the document.
  • qedqed Member Posts: 14
    Although I don't exactly know what you mean by releasing, I don;t think that's it. I manage to change and recompile the document, but the totals only are correct if i reference them in the footer. If i reference the total amount in the header i get nothing.
  • Luc_VanDyckLuc_VanDyck Member, Moderator, Administrator Posts: 3,633
    He means that the total fields are filled in when you release the Sales Invoice using Functions -> Release (or Ctrl-F11) on the Sales Invoice form. It's codeunit 414 that performs this task, together with modifying the status field.
    No support using PM or e-mail - Please use this forum. BC TechDays 2024: 13 & 14 June 2024, Antwerp (Belgium)
  • qedqed Member Posts: 14
    Ah, now i get it. But this invoice is allready posted. I'm printing it from the posted invoice form and there you (obviously) don't have a release function.
  • krikikriki Member, Moderator Posts: 9,118
    qed wrote:
    Ah, now i get it. But this invoice is allready posted. I'm printing it from the posted invoice form and there you (obviously) don't have a release function.
    Bad news : this amount is calculated on-the-fly when you open the statistics-form of the posted invoice. Look at the code in the form to see how it is calculated.
    Regards,Alain Krikilion
    No PM,please use the forum. || May the <SOLVED>-attribute be in your title!


  • SavatageSavatage Member Posts: 7,142
    kriki wrote:
    [when you open the statistics-form of the posted invoice.
    <F9>

    I have the "Amount Including Tax" field on my Posted Invoice Header
    and it shows the inv total.
  • qedqed Member Posts: 14
    OK. So apparently i can't see the code behind teh statistics form. I can see that it uses the global variable CustAmount, but i don't know how it's populated.

    The thing is, I only want to show the Amount field of the Sales Header table. It's allready released, since I'm trying to print a posted invoice, but somehow it always returns zero OR the line amount. I really don't get this. Why can't i just use "Sales Invoice Header"."Amount Including VAT" and be done with it?
  • SavatageSavatage Member Posts: 7,142
    Savatage wrote:
    kriki wrote:
    [when you open the statistics-form of the posted invoice.
    <F9>

    I have the "Amount Including Tax" field on my Posted Invoice Header
    and it shows the inv total.
    In the sales Invoice Header Table view the properties of
    "Amount Including Tax" or what ever your name is

    It should have a calcformula like...

    Sum("Sales Invoice Line"."Amount Including Tax" WHERE (Document No.=FIELD(No.)))
  • qedqed Member Posts: 14
    In the Sales Invoice Line OnPreDataItem() I added the line:
    TotalAmountInv := "Sales Invoice Header"."Amount Including VAT";

    TotalAmountInv is a global variable I defined (decimal)

    The global gets filled with the Amount value from the Sales Invoice Header. I can reference this global from the Sales Invoice Line Header section.

    Thanx for all the help, in the end it put me on the right track.
Sign In or Register to comment.