Jump to content
Salesforce and other SMB Solutions are coming soon. ×

Calculating a invoice subtotal.


powderspecial

Recommended Posts

I am trying to calculate an invoice subtotal in the table INVOICE. The related table which contains all the line items is INVOICE_LINE. In invoice line you can specify what and how many of each product you want then it is suppose to calculate the subtotal. The INV_SUBTOTAL field is defined as a calculation product price * products purchased. In my current layout I have the invoice form then I have the invoice_line table in as a portal. When I add one row of data in invoice line it updates the subtotal and works fine, but when I add a second row it does not update the subtotal, it just remains the same total from the first row. I was wondering how to get the subtotal to update after I add new rows in the invoice line portal.

Link to comment
Share on other sites

I think aaa is off the mark here.

 

Your Invoice_Line table should be calculating the total for each line and then in the Invoice table, a sum() calculation is used to total the related Invoice_Line totals:

 

Invoice_Line fields:

Price (number)

Quantity (number)

Extended Price (calculation, number result) = Price * Quantity

 

Invoice fields:

Invoice Total (calculation, number result) = Sum ( Invoice_Line::Extended Price )

 

You may want to round the Extended Price to the nearest penny.

Link to comment
Share on other sites

Thanks. So basically what you are saying is that i need to add an extended price in the INVOICE_LINE table then use a sum function to get it to add up in my INVOICE table.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.



×
×
  • Create New...

Important Information

Terms of Use