Buy Support
Incidents |
If you can't find your answer
in the FREE PUBLIC QDeveloper Forum, require URGENT Priority Support, or you need to send us
private or confidential information: |
Click Here
|
If you can't
login and post questions or you are having trouble viewing forum posts:
Click Here
|
Callback
Support |
If you live in USA, UK, Canada, Australia or New
Zealand, you can leave us details on your question and request us to call you back and discuss
them with you personally (charges apply). |
Click Here
|
Buy Support
Incidents |
If you can't find your answer
in the FREE PUBLIC QDeveloper Forum, require URGENT Priority Support, or you need to send us
private or confidential information: |
Click Here
|
|
Income by Customer Filtered by CURRENT Sales Rep |
Author |
Message |
Mark |
|
Group | : Members |
Posts | : 27 |
Joined | : 2007-01-20 |
|
Profile |
|
Posted : 2008-09-10 06:09:06 |
I am trying to generate a query that will give me the same information as is listed in the QB report income by customer filtered by Sales Rep. Not the sales rep that sold it but who is assigned now.
Basically I am trying to use it like a territory and we pay commission to the rep based on the increased income from this year over last year for the accounts that he is assigned. So if the reps customers generated 10,000 in income in Sept last year and 15,000 in income this year they will be paid commission on the difference of 15000 - 10000 = 5000 in income. But I can't pull a report that will tell me how much those customers had in income for last Sept because those customers were spread across 3 reps last year.
Could you suggest a way to like the customer table filtered by current rep to the income by customer report? |
|
|
|
Tom |
|
Group | : Administrator |
Posts | : 5510 |
Joined | : 2006-02-17 |
|
Profile |
|
Posted : 2008-09-10 22:47:28 |
Ok try something like this:
SELECT Customer.SalesRepRefFullName as "Rep", ReceivePaymentLine.TxnDate as "Date", Invoice.CustomerRefFullName as "Job",ReceivePaymentLine.AppliedToTxnRefNumber as "Inv No.", Invoice.SubTotal as "Orig. Amt.", ReceivePaymentLine.AppliedToTxnDiscountAmount as "Discount", ReceivePaymentLine.AppliedToTxnAmount as "Payment" FROM ReceivePaymentLine, Invoice, Customer where ReceivePaymentLine.AppliedToTxnTxnID= Invoice.TxnID and Invoice.CustomerRefListID = Customer.ListID and (ReceivePaymentLine.TxnDate >= {d '2008-01-01'} and ReceivePaymentLine.TxnDate < {d '2008-07-01'}) Order by Customer.SalesRepRefFullName, Invoice.CustomerRefFullName |
|
|
|
Mark |
|
Group | : Members |
Posts | : 27 |
Joined | : 2007-01-20 |
|
Profile |
|
Posted : 2008-09-16 02:19:43 |
Tom,
Thanks for that. That does give me sales for those customers but what I was looking for was income/GP like the income by customer summary report. I don't need it by invoice the summary is fine.
Thanks
|
|
|
|
Tom |
|
Group | : Administrator |
Posts | : 5510 |
Joined | : 2006-02-17 |
|
Profile |
|
Posted : 2008-09-16 08:12:13 |
Sorry, there's no real way to link in the COGS and Bills against the Customer to this report. My first example was for purely commissions and not income. You would need to do multiple queries on both the Sales and Bill tables.
See also: YTD Column not show in Sp_reports IncomeByCustomerSummary |
|
|
|
|