Totalling issue

yuppicide
Member Posts: 410
Re-visiting an issue I have with Navision 3.10 totaling.
When I go to print multiple copies of a Sales Order things are fine. If I go to Posted Invoices, not fine. Let's say an order is $200 and I want 3 copies. The second copy comes out as $400, third copy as $600. This issue has been here since they bought the software.
I see this code:
.. and on my report I have the following:
This shows a Subtotal, Shipping cost, and Total amount the customer has to pay. If the order runs into multiple pages, the only thing shown on page 1 is a Subtotal. The second page shows all three.
Now, if I add in Total1 := 0; on the bottom portion, after the END ELSE BEGIN that will fix my problem on orders that run into multiple pages.. because it skips the top portion of that code and goes to the END ELSE BEGIN, but then if the order is multiple pages it won't print a SubTotal on page 1. On orders that are single pages, my numbers still come out wrong on the 2nd and 3rd copy.
I can't wrap my head around how to fix it and it's probably something simple/close to my reach since I've got this far.
When I go to print multiple copies of a Sales Order things are fine. If I go to Posted Invoices, not fine. Let's say an order is $200 and I want 3 copies. The second copy comes out as $400, third copy as $600. This issue has been here since they bought the software.
I see this code:
//CurrReport.SHOWOUTPUT(OnLineNumber = NumberOfLines); IF (OnLineNumber = NumberOfLines) THEN BEGIN text1 := 'Subtotal:'; Text2 := 'Shipping:'; Text3 := 'Total:'; //SubTotal := AmountExclInvDisc; SubTotal := Total1; Frt := Freight; Total := TempSalesLine."Amount Including Tax"; END ELSE BEGIN text1 := ''; Text2 := ''; Text3 := 'Subtotal'; SubTotal := 0; Frt := 0; Total := 0; END;
.. and on my report I have the following:
=<Subtotal> =<Frt> =<Total1+Frt>
This shows a Subtotal, Shipping cost, and Total amount the customer has to pay. If the order runs into multiple pages, the only thing shown on page 1 is a Subtotal. The second page shows all three.
Now, if I add in Total1 := 0; on the bottom portion, after the END ELSE BEGIN that will fix my problem on orders that run into multiple pages.. because it skips the top portion of that code and goes to the END ELSE BEGIN, but then if the order is multiple pages it won't print a SubTotal on page 1. On orders that are single pages, my numbers still come out wrong on the 2nd and 3rd copy.
I can't wrap my head around how to fix it and it's probably something simple/close to my reach since I've got this far.
0
Comments
-
By default NAV uses the CurrReport.CREATETOTALS function to reset and track totals properly. If you look in the SalesInvLine - OnPreDataItem() you will see the function being called and the fields being used. Instead of using the total fields that were created outside of using this function you need to setup the variables to be included in the CREATETOTALS.
I am looking at a newer version but my line reads:
CurrReport.CREATETOTALS(TaxLiable,AmountExclInvDisc,TempSalesInvoiceLine.Amount,TempSalesInvoiceLine."Amount Including VAT");
These are generally the variables that are used to present the totals, a developer has changed how this works to try to use different variables but have not used the default NAV functionality. The total section would generally use the variables included in the statement above to provide the subtotal, invoice discount amount, tax amount and total.
Here is a link to the MSDN details for the function being used, I hope this can provide clarity http://msdn.microsoft.com/en-us/library/dd301337.aspx.Tim Whitaker | Senior NAV Consultant/Developer | The Software Workshop Ltd. | http://www.thesoftwareworkshop.com0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 320 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions