Tax Report - Calculation problem

Hi - i’m trying to create a Tax Report, where Samba calculates the total amount of Sales per each Tax template, but i’m stuck.

I found this on an old post, so i tried to apply it to my own case

[Tax Breakdown:2, 2, 2]
Sales|{REPORT TICKET DETAILS:T.TotalAmount.Sum}
VAT 20%|[={REPORT TICKET DETAILS:TX.$1.Sum}/20*100]|{REPORT TICKET DETAILS:TX.VAT 20%.Sum}
VAT 5%|[={REPORT TICKET DETAILS:TX.$1.Sum}/5*100]|{REPORT TICKET DETAILS:TX.VAT 5%.Sum}

My version :

[Tax Breakdown:2, 2, 2]
Sales|{REPORT TICKET DETAILS:T.TotalAmount.Sum}
TVA 20%|[={REPORT TICKET DETAILS:TX.20%.Sum}/20*100]|{REPORT TICKET DETAILS:TX.20%.Sum}
TVA 10%|[={REPORT TICKET DETAILS:TX.10%.Sum}/20*100]|{REPORT TICKET DETAILS:TX.10%.Sum}

But i’m just getting this :
image

When it should be

80,89/20*100 = 404,45
44,76/10*100 = 447,60

I also want to add the actual Tax to this amount :

80,89/20*100 + 80,89 =  485,34 € 
44,76/10*100 + 44,76  =  492,36 € 

Can anyone help me get this on my report ?
Many thanks :slight_smile:

Sales|{REPORT TICKET DETAILS:T.TotalAmount.Sum}
Its worth nothing that
T.TotalAmount.sum already includes taxes.
Its final value after all ticket calculations (discounts, rounds, service charges, taxes etc.)

So to get a decent breakdown you’ll have to work ‘backwards’ to get your subtotals.

Assuming your Tax transaction types and tax templates are configured correctly -
You could just use TX.VAT 20% to show you total amount for that type of taxes without any additional formulas.

Here is how I generally break it down

[General Summary:1, 1]
@{REPORT TICKET DETAILS:T.TicketType,T.TotalAmount.sum.desc::{0}:,} // will list all ticket types and list them in a descending order based of total amount

>{REPORT TICKET DETAILS:[T.TicketType],=[T.TotalAmount.sum]-[CA.Discount.sum]-[CA.Round.sum]-[TX.20%.sum]-[TX.10%.sum]:(TY=$1)} // will give you subtotal before your calculations, make sure to include yours in case you have any, per ticket type
        Discounts|{REPORT TICKET DETAILS:CA.Discount.sum:(TY=$1)} // sum of all discounts per ticket type
        Rounds|{REPORT TICKET DETAILS:CA.Round.sum:(TY=$1)} // sum of all rounds per ticket type
    20% Tax|{REPORT TICKET DETAILS:TX.20%.sum:(TY=$1)} // sum of all 20% taxes per ticket type
    10% Tax|{REPORT TICKET DETAILS:TX.10%.sum:(TY=$1)} // sum of all 10% taxes per ticket type
>    $1 Total|{REPORT TICKET DETAILS:T.TotalAmount.sum:(TY=$1)} // total per ticket type
>GRAND TOTAL|{REPORT TICKET DETAILS:T.TotalAmount.sum} // total for all ticket types
1 Like