Quantcast
Channel: Microsoft Dynamics NAV Forum - Recent Threads
Viewing all articles
Browse latest Browse all 29197

RE: Sales Orders Created $ Per Month Report

$
0
0

Might as well answer my own question here:

NOTE: I used ODBC Connection to SQL to draw from the tables directly to Excel to solve this problem as it's much quicker/easier to validate results and get them in Excel and then build a report rather than messing with the beautiful report builder built into NAV 2009 <sarcasm>. You can apply the same results in NAV.

I'm drawing my information from the following tables:

Sales Header Table / Sales Line Table

(gives me my open/released Sales Orders and my shipped not invoiced orders)

Sales Invoice Header Table / Sales Invoice Line Table

(gives me the Invoiced documents)

Using the data connections I first created 4 worksheets and connected each above table to a worksheet.

Then using some code on workbook_open() I added all of the Sales order No.'s from Sales Header Table in column A and the Sales Order No's from the Invoice header table in the same column (there will be some repeats if orders have been partially invoiced.. for me that's ok because I'll only show the amount invoiced on the one line and the amount back ordered on the other so#)

In Column B the code adds either Order or Invoice text to the cell to tell me which table to sum the amounts in.

before the on Open event runs (and adds all the SO#'s), the data connections refresh to give me up to date info.

Once the code adds the SO#'s, it's all just excel formula's from here.

I do a vlookup on the sales order # if type is invoice and put the invoice # in another column (can't reference the sales invoice line table by so#)

then I do vlookups on document date (something to filter monthly by) remember I want to know montly bookings, and the document date is created when the order is created and copied to the invoice header assuming the user doesn't change it. (it should be outside their allowable posting range in my case)

Once I have document dates I do SUMIFS sums on the line tables: (ensure your not double accounting for items on the invoice and sales order) sumifs all amounts on invoice as items not invoiced show as 0, on the sales order line, you have to make sure to not include qty's that have been invoiced.

now subtotal your sums and your done.... much easier than I anticipated.


Viewing all articles
Browse latest Browse all 29197

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>