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 convert an Estimate to a Sales Order?Search Forum

Forum Home > QODBC - ODBC Driver for QuickBooks > QODBC SQL Sample Scripts Forum

 New Topic 
 
 Post Reply 
[1]  
 How do I convert an Estimate to a Sales Order? 
 Author   Message 
  Piyush Varma 
  
 Group: Members 
 Posts: 66 
 Joined: 2006-04-06 
 Profile
 Posted : 2006-05-31 04:13:14
How do I convert an Estimate to a Sales Order please? Thank you. Piyush Varma 

  Top 
  Tom 
  6c3c1_sdk-qodbc.gif
 Group: Administrator 
 Posts: 5510 
 Joined: 2006-02-17 
 Profile
 Posted : 2006-05-31 13:49:13

To understand the process, I will do a simple one line estimate example.

FIRST TO CREATE THE ESTIMATE
The following SQL statement will create a new estimate:

INSERT INTO "EstimateLine" ("CustomerRefListID", "RefNumber", "EstimateLineItemRefListID",
"EstimateLineDesc", "EstimateLineRate", "EstimateLineAmount", "EstimateLineSalesTaxCodeRefListID",
"FQSaveToCache") VALUES ('470001-1071525403', '201', '250000-933272656',
'Building permit No 201', 100.00000, 100.00, '20000-999022286', 0)

which results in the following estimate in the QuickBooks 2006 Premier USA Edition - Sample Rock Castle Construction company file:

NEXT, TO CREATE  A SALES ORDER FROM A ESTIMATE
When we're ready to create the Sales Order we can read the EstimateLine table and insert it into the SalesOrderLine table like this:

INSERT INTO "SalesOrderLine" ("CustomerRefListID", "RefNumber", "Memo", "SalesOrderLineItemRefListID",
"SalesOrderLineDesc", "SalesOrderLineRate", "SalesOrderLineAmount", "SalesOrderLineSalesTaxCodeRefListID",
"FQSaveToCache")
Select "CustomerRefListID", "RefNumber", {fn CONCAT('Estimate ', "RefNumber")} as "Memo","EstimateLineItemRefListID",
"EstimateLineDesc", "EstimateLineRate", "EstimateLineAmount", "EstimateLineSalesTaxCodeRefListID",
"FQSaveToCache" from EstimateLine where "RefNumber"='201' and "EstimateLineSeqNo"=1

Note: This is one complete SQL statement, for multiple estimate lines you would set FQSaveToCache to 1 instead (using: 1 as "FQSaveToCache") and loop the EstimateLineSeqNos until the last one setting FQSaveToCache to 0.

The Estimate now appears as a Sales Order in QuickBooks with "Estimate 201" in the memo field the same way QuickBooks creates a Sales Order from a Estimate.

See: How do I create Estimates? for more on multiple lines.

 

  Top 
  Piyush Varma 
  
 Group: Members 
 Posts: 66 
 Joined: 2006-04-06 
 Profile
 Posted : 2006-06-01 03:04:26
Thank you very much, Tom. 

  Top 
 New Topic 
 
 Post Reply 
[1]  

Jump to