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 : How do I access a bills payment history?Search Forum

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

 New Topic 
 
 Post Reply 
[1]  
 How do I access a bills payment history? 
 Author   Message 
  HerbR 
  
 Group: Members 
 Posts: 6 
 Joined: 2007-07-10 
 Profile
 Posted : 2007-07-10 12:26:43

I need to access and display the payment history for a bill similar to the "Transaction History - Bill" screen from the history menu item when displaying a bill.  The program will be driven from a CSV file which contains the bill refnum.  I need to display the history (check number, date paid, amount paid, open balance) for each bill.  Typically, there are upwards of 500 bills per file.

Thanks,

HerbR

 

  Top 
  Tom 
  6c3c1_sdk-qodbc.gif
 Group: Administrator 
 Posts: 5510 
 Joined: 2006-02-17 
 Profile
 Posted : 2007-07-11 12:23:22

This is a complex area, so I'm going to start with the simple answer. For the payment history only for Bill Ref. No. 9000 :-

I can extract the Payments from the BillPaymentCheckLine table by linking the Bill table and limiting the payment to Ref. No. 9000 by using:

SELECT BillPaymentCheckLine.TxnDate as Date, BillPaymentCheckLine.RefNumber as Number,
BillPaymentCheckLine.AppliedToTxnAmount as Payment, BillPaymentCheckLine.AppliedToTxnDiscountAmount as Discount
FROM Bill , BillPaymentCheckLine
Where Bill.TxnID=BillPaymentCheckLine.AppliedToTxnTXNID
and Bill.RefNumber='9000'

 

  Top 
  HerbR 
  
 Group: Members 
 Posts: 6 
 Joined: 2007-07-10 
 Profile
 Posted : 2007-07-12 00:12:34
Perfect!  Thanks 

  Top 
  HerbR 
  
 Group: Members 
 Posts: 6 
 Joined: 2007-07-10 
 Profile
 Posted : 2007-07-12 06:39:38

I tried running this code which would appear to do what I need.  It worked except each row took 2.5 to 3 minutes to complete.  So I guessed that the problem might be the reference to multiple tables (i.e. a join), so I split the request into two parts.  First I retrieved the desired Bills, including the TxnId and saved these in a memory table.  This took approximately 2 second per Bill (slow but usable). I then loop through the table (there are about 800 Bills) and retrieved the history with the following SQl:

SELECT TxnDate, RefNumber, AppliedToTxnAmount  INTO :checkdate, :checknumber, :payment
   FROM BillPaymentCheckLine
   WHERE AppliedToTxnTXNID = :txnid;

I write in Powerbuilder and the above syntax is correct.  The ":" indicates local client side variables.  Each SELECT takes 2.5 to 3 minutes.  That means the program would not finish until late tomorrow (about 30 hours!!!).  That is both not usable and REDICULUS.  I can do the process manually in front of a workstation faster.

HELP!!!

 

  Top 
  Tom 
  6c3c1_sdk-qodbc.gif
 Group: Administrator 
 Posts: 5510 
 Joined: 2006-02-17 
 Profile
 Posted : 2007-07-12 09:46:45

The main problem arrises because there's no optimized index (jump-in) on the AppliedToTxnTxnID column for the WHERE clause to use.

I've requested it as an enhancement to the QODBC Software Engineer. I don't have a time frame for the enhancement at this stage. I will post an update when the enchancement is done or if it's denied.

Try:

SELECT TxnDate, RefNumber, AppliedToTxnAmount  INTO :checkdate, :checknumber, :payment
   FROM BillPaymentCheckLine NOSYNC 
   WHERE AppliedToTxnTXNID = :txnid;

to manually force the query to run against the optimized table.

 

  Top 
  HerbR 
  
 Group: Members 
 Posts: 6 
 Joined: 2007-07-10 
 Profile
 Posted : 2007-07-12 11:59:54
Thanks.  I will try this tomorrow.  

  Top 
  Tom 
  6c3c1_sdk-qodbc.gif
 Group: Administrator 
 Posts: 5510 
 Joined: 2006-02-17 
 Profile
 Posted : 2007-08-08 11:03:41
Please update to QODBC Release v7.1.0.230 as enhancements have been made to the QODBC Optimizer (Release 7.1.0.220 Fixes). See: How can I get the latest version of QODBC? 

  Top 
  HerbR 
  
 Group: Members 
 Posts: 6 
 Joined: 2007-07-10 
 Profile
 Posted : 2007-09-20 03:17:47
 I try this. 

  Top 
  HerbR 
  
 Group: Members 
 Posts: 6 
 Joined: 2007-07-10 
 Profile
 Posted : 2007-09-25 02:09:37
I installed the latest QODBC build, rebuilt the program and ran it.  I got the same results (2.5 to 3 minutes per bill).  Do I need to do something other then install the latest QODBC build. 

  Top 
  Tom 
  6c3c1_sdk-qodbc.gif
 Group: Administrator 
 Posts: 5510 
 Joined: 2006-02-17 
 Profile
 Posted : 2007-09-25 09:23:12

I just ran:

SELECT BillPaymentCheckLine.TxnDate as Date, BillPaymentCheckLine.RefNumber as Number,
BillPaymentCheckLine.AppliedToTxnAmount as Payment, BillPaymentCheckLine.AppliedToTxnDiscountAmount as Discount
FROM Bill , BillPaymentCheckLine
Where Bill.TxnID=BillPaymentCheckLine.AppliedToTxnTXNID

using QODBC v8.00.00.234 and got 161 rows returned within seconds.

Using sp_statistics BillPaymentCheckLine we can see that there is now a special QODBC optimized index to use for the AppliedToTxnTxnID lookups:

 

  Top 
 New Topic 
 
 Post Reply 
[1]  

Jump to