Go to previous topic
Go to next topic
Last Post 11 Apr 2024 06:16 PM by  Steve L
totalamount - tax
 16 Replies
Author Messages


Basic Member


Posts:281
Basic Member


--
28 Mar 2024 02:32 PM

    Hi Stephen,

    I like to know where to find the syntax for the following amount.

    in/salesOrder/formattedTotalTaxAmount - in/salesOrder/formattedTotalTaxAmount

    or how to get to display the following in the Invoice:

    For example:
    sub total amount without tax  = 9
    total tax amount = 1
    Total amount =10

    Regards, Ton
     

    0


    Basic Member


    Posts:281
    Basic Member


    --
    28 Mar 2024 05:47 PM

    Sorry, I like to get this amount.
    in/salesOrder/formattedTotalAmount - in/salesOrder/formattedTotalTaxAmount

     

    0


    Veteran Member


    Posts:2956
    Veteran Member


    --
    03 Apr 2024 03:06 PM

    Hi Ton

    If you're looking to edit the email or print templates, you can follow the section here and see which example values can be extracted. 

    I hope this helps. Thank you

    0


    Basic Member


    Posts:281
    Basic Member


    --
    04 Apr 2024 05:32 AM

    Hi Stephen,

    I have search this topic and cannot find the value I need.

    The automated accounting department of a customer needs 3 values to read the pdf invoice I sent to them.
    - the total amount with tax
    - total of tax.
    - total amount without the tax.
    The last value total amount minus tax I cannot find.
    So I was thinking I can take the total amout and do a subtract with the total of tax.

    For example.
    subtotal of order items = 10
    Handling with tax = 2
    Shipping with tax = 3
    Total exclude tax = 15 (formattedTotalAmount minus formattedTotalTaxAmount)
    Tax= 1.50
    Total = 16,50

    Is it not possible to substract these values from each other?
    Or is there another way to get this?

    Regards, Ton

    0


    Veteran Member


    Posts:2956
    Veteran Member


    --
    09 Apr 2024 11:00 PM

    That's correct, there is no "Total Amount Without Tax". Instead you just have to do SubTotalAmount + HandlingAmount + ShippingAmount, which gets you the same thing.

    Thank you

    0


    Basic Member


    Posts:281
    Basic Member


    --
    10 Apr 2024 06:22 AM

    Hi Stephen,

    I have tried all kind of combination, however I cannot get the job done. :-(
    Nothing gives me the the value I seek/
    It is al about how to write the syntax how to add those values.
    xsl:value-of select="in/salesOrder/SubTotalAmount + HandlingAmount + ShippingAmount"
    xsl:value-of select="in/salesOrder/SubTotalAmount + in/salesOrder/HandlingAmount + in/salesOrder/ShippingAmount"

    Zahlungskosten: € 2,41
    Versand: € 27,83
    Ex VAT:
    MwSt: € 10,55
    Gesamt: € 60,79

    Can you let me know what I am doingwrong here?

    NB: I left the brackets away in order not to disturb the forum

    With regards, Ton

    0


    Veteran Member


    Posts:2956
    Veteran Member


    --
    10 Apr 2024 01:10 PM
    It should be case-sensitive like this below. Refer to the documentation link I sent you earlier. Notice the elements in the XML are camelCase.

    xsl:value-of select="in/salesOrder/subTotalAmount + in/salesOrder/handlingAmount + in/salesOrder/shippingAmount"
    0


    Basic Member


    Posts:281
    Basic Member


    --
    10 Apr 2024 03:42 PM

    Hi Stephen,

    The calculation works ok, however the output is not workable.
    - there are 4 fractions like Euro 4.1234 instead of 2 Euro 4.12
    - the . is used in the Englisch language and in the the europian notification they use the ,
    - I have place the Euro sign before the amount myself.

    Net:    € 35.4822
    BTW:    € 7,45
    Totaal:    € 42,93

    Then I tried to use the formatted value of the subtotalamount and that gives an error.
    All this is going beyond my knowledge and I preciate the support from you sofar.

    Do you know if this feature of "formatted Net value" will be availabe in a future version?

    With regards, Ton

    0


    Veteran Member


    Posts:2956
    Veteran Member


    --
    10 Apr 2024 03:45 PM

    You can try using the format-number function like this to get the 2 decimals:

    xsl:value-of select="format-number(in/salesOrder/subTotalAmount + in/salesOrder/handlingAmount + in/salesOrder/shippingAmount, '0.00', 2)"

    See here for more info:

    https://www.w3schools.com...unc_formatnumber.asp

    0


    Basic Member


    Posts:281
    Basic Member


    --
    10 Apr 2024 04:16 PM

    Hi Stephen,

    Thanks for your answer.
    However the output is total broken now.
    Note: I removed the brackets in order to not disturb the forum.

    Net:    xsl:value-of select="format-number(in/salesOrder/subTotalAmount + in/salesOrder/handlingAmount + in/salesOrder/shippingAmount, '0.00', 2)" /
    BTW:    xsl:value-of select="in/salesOrder/formattedTotalTaxAmount" /
    Totaal:    xsl:value-of select="in/salesOrder/formattedTotalAmount" /

    0


    Veteran Member


    Posts:2956
    Veteran Member


    --
    10 Apr 2024 06:05 PM

    Sorry just try it like this (notice i removed the last parameter "2"):

    xsl:value-of select="format-number(in/salesOrder/subTotalAmount + in/salesOrder/handlingAmount + in/salesOrder/shippingAmount, '0.00')" /

    0


    Basic Member


    Posts:281
    Basic Member


    --
    11 Apr 2024 11:03 AM

    Hi Stephen,

    Almost! I can see and smell the finisch.
    The output below is valid for the us style.
    Net:    € 3.43
    BTW:    € 0,72
    Totaal:    € 4,15

    I found on stackoverflow dot com the code to transform from US style to European style.
    I was not able to test this because I cannot acces the stylesheet because I' am at your server.
    Also, I do not know if this code is ok.

    Put at the top in the css stylesheet.
    xsl:decimal-format name="european" decimal-separator="," grouping-separator="."/

    then the following code in the template.
    xsl:value-of select='format-number(ACTUAL, "###.###,00", "european")' /

    like so?
    € xsl:value-of select="format-number(in/salesOrder/subTotalAmount + in/salesOrder/handlingAmount + in/salesOrder/shippingAmount, "###.###,00", "european")" /

    Or do you have a better / simple solution?

    NB: again I removed the brackets to not disturb the forum

    Regards, Ton

    0


    Veteran Member


    Posts:2956
    Veteran Member


    --
    11 Apr 2024 03:18 PM

    Yes, that should work fine except don't put a double-quote and instead use a single-quote where it says 'european'. To append the symbol, you can also use the concat() function to append text.

    xsl:value-of select="concat('€ ', format-number(in/salesOrder/subTotalAmount + in/salesOrder/handlingAmount + in/salesOrder/shippingAmount, "###.###,00", 'european'))" /

     

    0


    Basic Member


    Posts:281
    Basic Member


    --
    11 Apr 2024 04:40 PM

    I get the output below.
    Net:    xsl:value-of select="concat('€ ', format-number(in/salesOrder/subTotalAmount + in/salesOrder/handlingAmount + in/salesOrder/shippingAmount, "###.###,00", 'european'))" /
    BTW:    xsl:value-of select="in/salesOrder/formattedTotalTaxAmount" /
    Totaal:    xsl:value-of select="in/salesOrder/formattedTotalAmount" /

    Then have add at the top of the invoice print template the following:
    xsl:decimal-format name="european" decimal-separator="," grouping-separator="."/
    This makes no difference.

    According stackoverflow dot com:
    To realize a european value notation you have to define your own decimal-format at the top level of the stylesheet
    xsl:decimal-format name="european" decimal-separator="," grouping-separator="."/

    I do not know where and in which css file to put this.
    Also, my website is hosted on the revindex server and I' am afraid to damage something on the server.
     

    0


    Veteran Member


    Posts:2956
    Veteran Member


    --
    11 Apr 2024 06:03 PM

    Try this without using decimal-format.

    xsl:value-of select="translate(format-number(in/salesOrder/subTotalAmount + in/salesOrder/handlingAmount + in/salesOrder/shippingAmount, '#,###.00'), '.', ',')" /

    0


    Basic Member


    Posts:281
    Basic Member


    --
    11 Apr 2024 06:16 PM

    Dear Stephen,

    BINGO !!! HOERA !!!

    Net:    € 35,48
    BTW:    € 7,45
    Totaal:    € 42,93

    Many, Many thaks for your 5 star help in this topic.

    Regards, Ton

    0


    Veteran Member


    Posts:2956
    Veteran Member


    --
    11 Apr 2024 06:16 PM
    You're welcome :)
    0


    ---