Member Login

Username
Password
Forget Password
New Sign Up
Search Forum

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

Forum : Differentiate between a payment and a discount to pay commissionsSearch Forum

Forum Home > QODBC - ODBC Driver for QuickBooks > QODBC Reporting Forum

 New Topic 
 
 Post Reply 
[1]  
 Differentiate between a payment and a discount to pay commissions 
 Author   Message 
  Pete 
  
 Group: Members 
 Posts: 3 
 Joined: 2006-05-11 
 Profile
 Posted : 2006-06-08 00:25:13

When I run the "SalesByItemDetail" report on a cash basis, the report returns both payment and time discount amounts.  I need to differentiate between the actual payment amount and the discount amount because I pay commissions on only the payment made and not any discounts given.  How can I tell the difference between the payment and discount amount?  If the report doesn't allow this, what table would help me tell the difference?

thanks.
Pete Lee

 

  Top 
  Tom 
  6c3c1_sdk-qodbc.gif
 Group: Administrator 
 Posts: 5510 
 Joined: 2006-02-17 
 Profile
 Posted : 2006-06-08 11:48:38

First we need to understand, what happens when we apply a discount to a invoice payment. The following shows a $100 discount applied to a $1,040 invoice and the resulting $940 payment made by the Customer:

Using QODBC we can extract the same info by doing:

SELECT ReceivePaymentLine.TxnDate as "Date", Invoice.CustomerRefFullName as "Job",
ReceivePaymentLine.AppliedToTxnRefNumber as "Number", Invoice.SubTotal as "Orig. Amt.",
ReceivePaymentLine.AppliedToTxnDiscountAmount as "Discount",
ReceivePaymentLine.AppliedToTxnAmount as "Payment" FROM ReceivePaymentLine, Invoice
where ReceivePaymentLine.AppliedToTxnTxnID= Invoice.TxnID
and ReceivePaymentLine.CustomerRefFullName='Baker, Chris'

If I run a Cash basis Sales By Item Detail report for the Customer in QuickBooks I see:

and I can extract the same by using the following stored procedure in QODBC:

sp_report SalesByItemDetail show TxnType as Type, Date, RefNumber as Num, Memo, Name,
Quantity as Qty, UnitPrice as "Sales Price", (Quantity * UnitPrice) as "Original Amount",
Amount as "Paid Amount" parameters DateMacro = 'ThisMonthToDate',
ReportBasis = 'Cash' where Name='Baker, Chris:Family Room'

As you can see, the original amount and the paid amount to pay the commision on is displayed. If I had a fixed 10% commision rate I could even add a column like: (0.1 * Amount) as "Commission" to the report:

sp_report SalesByItemDetail show TxnType as Type, Date, RefNumber as Num, Memo, Name,
Quantity as Qty, UnitPrice as "Sales Price", (Quantity * UnitPrice) as "Original Amount",
Amount as "Paid Amount", (0.1 * Amount) as "Commission" parameters DateMacro = 'ThisMonthToDate',
ReportBasis = 'Cash' where Name='Baker, Chris:Family Room'

 

  Top 
  Pete 
  
 Group: Members 
 Posts: 3 
 Joined: 2006-05-11 
 Profile
 Posted : 2006-06-09 00:09:29

Hi Tom,  Thank you for quick response.  The info you gave me was usefull.  The one part that I still need help with is in your last screen shot of "SalesByItemDetail" report.  Lines 2,3, and 6 appear to be the discount details and I wouldn't want to pay commissions on the discount.  So is there some way I can tell that those lines are discount items and not actual payments.  I know I can't just assume that the lower amounts are discount items because we have customers that do partial payments on an invoice making the payment amounts small also.  So what I really need to determine is when the detail line on the "SalesByItemDetail" report is an actual payment versus the discount given.

 

Thanks.
Pete

 

  Top 
  Tom 
  6c3c1_sdk-qodbc.gif
 Group: Administrator 
 Posts: 5510 
 Joined: 2006-02-17 
 Profile
 Posted : 2006-06-09 08:27:48

Sorry, QuickBooks doesn't label the discount line for us in the Sales By Item Detail report. Wouldn't that be nice? That's why I also showed you how to see if a REAL discount was applied to a invoice or not? You can also do a date range like this:-

SELECT ReceivePaymentLine.TxnDate as "Date", Invoice.CustomerRefFullName as "Job",
ReceivePaymentLine.AppliedToTxnRefNumber as "Number", Invoice.SubTotal as "Orig. Amt.",
ReceivePaymentLine.AppliedToTxnDiscountAmount as "Discount",
ReceivePaymentLine.AppliedToTxnAmount as "Payment" FROM ReceivePaymentLine, Invoice
where ReceivePaymentLine.AppliedToTxnTxnID= Invoice.TxnID
and (ReceivePaymentLine.TxnDate >= {d '2006-06-01'} and ReceivePaymentLine.TxnDate < {d '2006-07-01'})

 

  Top 
  Tom 
  6c3c1_sdk-qodbc.gif
 Group: Administrator 
 Posts: 5510 
 Joined: 2006-02-17 
 Profile
 Posted : 2006-08-16 09:10:45

You can also add the Sales Rep info like this:-

SELECT Invoice.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
where ReceivePaymentLine.AppliedToTxnTxnID= Invoice.TxnID
and (ReceivePaymentLine.TxnDate >= {d '2006-06-01'} and ReceivePaymentLine.TxnDate < {d '2008-07-01'})
Order by Invoice.SalesRepRefFullName, Invoice.CustomerRefFullName


 

  Top 
 New Topic 
 
 Post Reply 
[1]  

Jump to