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 a Sales Order into an Invoice?Search Forum

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

 New Topic 
 
 Post Reply 
[1]  
 How do I convert a Sales Order into an Invoice? 
 Author   Message 
  Piyush Varma 
  
 Group: Members 
 Posts: 66 
 Joined: 2006-04-06 
 Profile
 Posted : 2006-06-01 10:27:10
How can I convert a Sales Order into an Invoice and mark isFullyInvoiced=1 please?

Or can I link a Sales Order to an existing Invoice and then mark the SO as Fully Invoiced?

Thank you.

Piyush Varma 

  Top 
  Tom 
  6c3c1_sdk-qodbc.gif
 Group: Administrator 
 Posts: 5510 
 Joined: 2006-02-17 
 Profile
 Posted : 2006-06-05 10:01:41

To understand the process for everyone, I will do a simple one line estimate example, make it a Sales Order and then make it into a Invoice.

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.

NOW LET'S CREATE  A INVOICE  FROM THE SALES ORDER !
When we're ready to create the Invoice we can read the SalesOrderLine table and insert it into the InvoiceLine table like this:

INSERT INTO "InvoiceLine" ("CustomerRefListID", "RefNumber", "Memo", "InvoiceLineItemRefListID",
"InvoiceLineDesc", "InvoiceLineRate", "InvoiceLineAmount", "InvoiceLineSalesTaxCodeRefListID",
"FQSaveToCache")
Select "CustomerRefListID", {fn CONCAT('I', "RefNumber")} as "RefNumber",
{fn CONCAT('Sales Order ', "RefNumber")} as "Memo","SalesOrderLineItemRefListID",
"SalesOrderLineDesc", "SalesOrderLineRate", "SalesOrderLineAmount", "SalesOrderLineSalesTaxCodeRefListID",
"FQSaveToCache" from SalesOrderLine where "CustomerRefFullName" ='Lamb, Brad:Room Addition' and "RefNumber"='201'
and "SalesOrderLineSeqNo"=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 SalesOrderLineSeqNos until the last one setting FQSaveToCache to 0.

The Sales Order now appears as a Invoice in QuickBooks but is unlinked to the Sales Order line at this stage.

NOW LET'S CREATE  A LINKED INVOICE  FROM THE SALES ORDER !
If you are using QuickBooks 2007 (USA version) you can now create linked Sales Order invoices. When we're ready to create the Invoice we can read the SalesOrderLine table and insert it into the InvoiceLine table as a linked Invoice instead like this:

INSERT INTO "InvoiceLine" ("CustomerRefListID", "RefNumber",
"InvoiceLineLinkToTxnTxnID", "InvoiceLineLinkToTxnTxnLineID",
"FQSaveToCache")
Select "CustomerRefListID", {fn CONCAT('SOLink', "RefNumber")},
"TxnID", "SalesOrderLineTxnLineID",
0 as "FQSaveToCache" from SalesOrderLine
where "CustomerRefFullName" ='Lamb, Brad:Room Addition' and "RefNumber"='201'
and "SalesOrderLineSeqNo"=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 SalesOrderLineSeqNos until the last one setting FQSaveToCache to 0.

which results in the following linked Invoice in the QuickBooks 2007 Premier USA Edition - Sample Rock Castle Construction company file:

and because there was only one line in the example Sales Order, the Sales Order has also been marked, "INVOICED IN FULL".

 

  Top 
  Piyush Varma 
  
 Group: Members 
 Posts: 66 
 Joined: 2006-04-06 
 Profile
 Posted : 2006-06-06 03:57:05
Thank you very much, Tom. I anxiously await a solution to Sales Order to Invoice Line link puzzle. 

  Top 
  Tom 
  6c3c1_sdk-qodbc.gif
 Group: Administrator 
 Posts: 5510 
 Joined: 2006-02-17 
 Profile
 Posted : 2006-06-08 12:03:50
Sorry, linking a Sales Order to a Invoice is not possible under any released qbXML SDK by Intuit at this stage, the...." to be continued........". will be added as soon as we can link these types of transactions together. 

  Top 
  Piyush Varma 
  
 Group: Members 
 Posts: 66 
 Joined: 2006-04-06 
 Profile
 Posted : 2006-06-13 05:44:11

How can we request this feature to be added to qbXML please? It is crucial for our integration efforts. If you have already requested for this feature addition, when can we expect it? Is there any estimated date of release please? Thank you. Piyush

 

  Top 
  Tom 
  6c3c1_sdk-qodbc.gif
 Group: Administrator 
 Posts: 5510 
 Joined: 2006-02-17 
 Profile
 Posted : 2006-06-13 08:18:19
Sorry, I don't have a timetable other than later this year as part of the United State's release of QuickBooks 2007. 

  Top 
  Tom 
  6c3c1_sdk-qodbc.gif
 Group: Administrator 
 Posts: 5510 
 Joined: 2006-02-17 
 Profile
 Posted : 2006-07-13 20:30:18

It's now confirmed that the ability to create Invoices (InvoiceAdd) from Sales Orders will be available in the USA Editions of QuickBooks 2007. 

See: QuickBooks SDK 6.0 for U.S. editions of QuickBooks 2007 for more information.

 

  Top 
  Piyush Varma 
  
 Group: Members 
 Posts: 66 
 Joined: 2006-04-06 
 Profile
 Posted : 2006-07-14 04:26:55
Thank you very much, Tom for prompt information.

Will I need to upgrade Quick Books 2006 to Quick Books 2007 version to access these new features? And will I need to upgrade QODBC driver as well?

Piyush 

  Top 
  Tom 
  6c3c1_sdk-qodbc.gif
 Group: Administrator 
 Posts: 5510 
 Joined: 2006-02-17 
 Profile
 Posted : 2006-07-14 08:23:31
Yes, you will need QuickBooks 2007 and QODBC v7 when they are released. 

  Top 
  KofK 
  
 Group: Members 
 Posts: 43 
 Joined: 2006-04-04 
 Profile
 Posted : 2007-01-18 07:18:15
Can we create Invoices from Sales Orders ? If so, how?
 

  Top 
  Tom 
  6c3c1_sdk-qodbc.gif
 Group: Administrator 
 Posts: 5510 
 Joined: 2006-02-17 
 Profile
 Posted : 2007-01-19 14:29:52
I have added a NOW LET'S CREATE  A LINKED INVOICE  FROM THE SALES ORDER ! section above for QuickBooks 2007 users. 

  Top 
  Jay Talbott 
  
 Group: Members 
 Posts: 12 
 Joined: 2008-01-30 
 Profile
 Posted : 2008-06-04 00:13:12

Since I only have the QuickBooks Pro 2008 version, I don't have access to Sales Orders.

Studying the NOW LET'S CREATE  A LINKED INVOICE  FROM THE SALES ORDER !  can I correctly assume that if I add the sales order number to the InvoiceLineLinkToTxnTxnLineId field during the InvoiceLine insert, (since that field is not updateable) that the SO will be linked to Invoice?

I guess there is no way that I can test this <groan>.

 

Thanks for your assistance.

Jay Talbott

 

 
Jay Talbott 
 
  Top 
  Tom 
  6c3c1_sdk-qodbc.gif
 Group: Administrator 
 Posts: 5510 
 Joined: 2006-02-17 
 Profile
 Posted : 2008-06-04 08:23:47

As you don't have access to Sales Orders using QuickBooks Pro 2008, just create the invoice!

See: How do I create Invoices? 

 

 

  Top 
 New Topic 
 
 Post Reply 
[1]  

Jump to