powderspecial Posted March 31, 2005 Share Posted March 31, 2005 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 More sharing options...
aaa Posted March 31, 2005 Share Posted March 31, 2005 Make price as lookup field. Or click to INV_SUBTOTAL field for refreshing. Link to comment Share on other sites More sharing options...
Ender Posted March 31, 2005 Share Posted March 31, 2005 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 More sharing options...
powderspecial Posted March 31, 2005 Author Share Posted March 31, 2005 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 More sharing options...
Ender Posted March 31, 2005 Share Posted March 31, 2005 You got it. Hey, the Fighting Souix are going down next weekend! Go Gophers! Link to comment Share on other sites More sharing options...
powderspecial Posted March 31, 2005 Author Share Posted March 31, 2005 Thanks for your helps. I dont know about that, but the Gophers are pretty good. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.