Link to home
Start Free TrialLog in
Avatar of townsma
townsmaFlag for Indonesia

asked on

How to make a summary function from multiple fields?

We have a crystal report template we use for creating invoices.  We need to summarise the taxes, the problem is, the taxes are compound taxes, and not always made up of the same components.

Each item on the invoice can have up to three taxes defined. Local, State, plus withholding taxes, of which there are over 15 kinds.  In the database we have six fields, three that define which tax has been used, and what the tax amount is.  For example:

Desc                                           Price     TaxCode1  Tax Amount1  TaxCode2  Tax Amount2  TaxCode3  Tax Amount3
Widget 1                                   100.00       VAT               10.00               Empty                        0     Empty                 0
Widget 2                                    100.00      VAT                10.00             PPN                11.00          Empty                 0
Widget 3                                    100.00      PPN                10                 PPH23              -2.30         PPH25               -10.00

What I need in the footer is

VAT           20.00
PPN          21.00
PPH23     -2.30
PPH25     -10.00

Can anyone tell me how to make a Crystal Reports Function to calculate these summaries.

The complication is the tax names, and taxes used, varies from invoice to invoice, and from installation to installation.  So we need to summarize them based on the names in the actual database.

Many thanks for you help.
ASKER CERTIFIED SOLUTION
Avatar of Mike McCracken
Mike McCracken

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Mike McCracken
Mike McCracken

If you are printing multiple invoices on a report use this one.  Same report but a group on invoice number is added and the totals are reset in the group header

mlmcc
Multiple-InvoiceTaxes-Calc.rpt
Tax-Calcs.xls
Avatar of townsma

ASKER

Great answer, appears to work perfectly.

Many thanks