I have an invoice and invoice details Payment tables. I need to calculate the total amount of the Net Charge, Paid and Discount for every invoice.
The Net Charge, Paid and Discount columns are not exists in the invoice table instead I'm planning to calculate their amount on the fly from the invoice details and Payment tables.
The calculation will be for each Individual invoice and also for all of invoice table rows based on a giving date period.
Please I need advice and answer regarding the following two points.
Is my above approach okay regarding the performance?
Should I create the Net Charge, Paid and Discount columns inside the invoice table?
Invoice Details Table