Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Quickbooks transactions still!
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Produits tierce partie
Divers
Thread ID:
00498369
Message ID:
00502517
Vues:
18
Hi Mat,

Saw your question about a problem with exporting to and importing to QuickBooks. I had to write a routine not too long ago for a customer that would export check payment info from VFP (6.x) to a Quicken IIF file. After alot of trials and tribulation, and pouring over docs, and web sites, I got it to work. I've attached the code I use for you as a starting point (please excuse the formatting). You'll have to modify it of course, but I hope it will help.

If there are any questions, maybe I can help.

Phillip Grant
Grant Computer Consulting
731.642.2162
pgrant@iswt.com
* Author.....:	Phillip Grant
* Date.......:	December 1, 1999
* Notice.....:	Copyright(c)1999, Grant Computer Consulting
* Compiler...:	Visual FoxPro 06.00.8492.00 for Windows
*
* Description:	Takes the query result and outputs it to the user-
*					selected QuickBooks IIF file
*
* Example....:	!TRNS,TRNSID,TRNSTYPE,PAYMETH,DATE,ACCNT,NAME,AMOUNT,DOCNUM,MEMO
*		!SPL,SPLID,TRNSTYPE,PAYMETH,DATE,ACCNT,NAME,AMOUNT,DOCNUM,MEMO
*		!ENDTRNS
*		TRNS,,PAYMENT,"Check",07/16/1998,"1499 - Undeposited Funds - Other","Direct Billings",500,999,"Check #999"
*		SPL,,PAYMENT,"Check",07/16/1998,"1200 - Accounts Receivable","Direct Billings",-500,999,"Check #999"
*		ENDTRNS		
*
*******************************************************************************

*!* * Constants for output file
#DEFINE TAB_DELIM	CHR(9)
#DEFINE COMMA_DELIM	","
#DEFINE NL_CR		CHR(13) + CHR(10)

#DEFINE HEADER_LINE_1 	"!TRNS" + TAB_DELIM + "TRNSID" + TAB_DELIM + "TRNSTYPE" + TAB_DELIM + "PAYMETH" + TAB_DELIM + "DATE" + TAB_DELIM + "ACCNT" + TAB_DELIM + "NAME" + TAB_DELIM + "AMOUNT" + TAB_DELIM + "DOCNUM" + TAB_DELIM + "MEMO"
#DEFINE HEADER_LINE_2 	"!SPL" + TAB_DELIM + "SPLID" + TAB_DELIM + "TRNSTYPE" + TAB_DELIM + "PAYMETH" + TAB_DELIM + "DATE" + TAB_DELIM + "ACCNT" + TAB_DELIM + "NAME" + TAB_DELIM + "AMOUNT" + TAB_DELIM + "DOCNUM" + TAB_DELIM + "MEMO"
#DEFINE HEADER_LINE_3 	"!ENDTRNS" + TAB_DELIM + TAB_DELIM + TAB_DELIM + TAB_DELIM + TAB_DELIM + TAB_DELIM + TAB_DELIM + TAB_DELIM + TAB_DELIM

#DEFINE TRANS_HEADER	"TRNS"
#DEFINE ENDTRANS_HEADER	"ENDTRNS" + TAB_DELIM + TAB_DELIM + TAB_DELIM + TAB_DELIM + TAB_DELIM + TAB_DELIM + TAB_DELIM + TAB_DELIM + TAB_DELIM
#DEFINE SPLIT_HEADER	"SPL"

#DEFINE TYPE_HEADER	"PAYMENT"
#DEFINE METHOD_HEADER	"CHECK"
#DEFINE FUND_ACCT_NAME	"Undeposited Funds"
#DEFINE RECV_ACCT_NAME	"Accounts Receivable"
#DEFINE JOB_NAME	"Direct Billings"


LOCAL lnArea, lcHeaderStr, lcTranStr, lcSplitStr, lcCentury, lcCentury1, lcCentury2
lnArea = SELECT(0)
lcCentury = SET( 'CENTURY' )
lcCentury1 = SET( 'CENTURY', 1 )
lcCentury2 = SET( 'CENTURY', 2 )
SET CENTURY TO 99 ROLLOVER 48

*!* * Build The output file
IF !FILE( 'qb_export.dbf' )
	CREATE TABLE qb_export FREE ( time_stamp T, output M )
ELSE
	USE qb_export IN 0
ENDIF
SELECT qb_export

*!* * Put in the header record info
APPEND BLANK
REPLACE qb_export.time_stamp WITH DATETIME()
REPLACE qb_export.output 	WITH 	HEADER_LINE_1 + NL_CR + ;
					HEADER_LINE_2 + NL_CR + ;
					HEADER_LINE_3 + NL_CR

*!* * Now, loop thru the query results and build each transaction
SELECT Daily_Payments_Report
lcRecCount = ALLTRIM(STR(RECCOUNT()))
GO TOP
SCAN
	WAIT WINDOW "Building Export File, RECORD: " + ALLTRIM(STR(RECNO())) + " of " + lcRecCount NOWAIT

	*!* * Build the Transaction string
	lcTranStr = TRANS_HEADER + TAB_DELIM + TAB_DELIM + TYPE_HEADER + TAB_DELIM + METHOD_HEADER + TAB_DELIM + DTOC( date_paid ) + TAB_DELIM + ;
			FUND_ACCT_NAME + TAB_DELIM + JOB_NAME + TAB_DELIM + ALLTRIM( STR( ABS( amt_paid ), 10, 2 ) ) + TAB_DELIM + ALLTRIM( chk_no ) + TAB_DELIM + ;
			'"PH#: ' + TRANSFORM( phone_no, "@R (999) 999-9999" ) + '"'

	*!* * Build the Split Transaction string
	lcSplitStr = SPLIT_HEADER + TAB_DELIM + TAB_DELIM + TYPE_HEADER + TAB_DELIM + METHOD_HEADER + TAB_DELIM + DTOC( date_paid ) + TAB_DELIM + ;
			RECV_ACCT_NAME + TAB_DELIM + JOB_NAME + TAB_DELIM + ALLTRIM( STR( -( amt_paid ), 10, 2 ) ) + TAB_DELIM + ALLTRIM( chk_no ) + TAB_DELIM + ;
			'"PH#: ' + TRANSFORM( phone_no, "@R (999) 999-9999" ) + '"'
	
	*!* * Put them both in the tmp memo
	REPLACE qb_export.output 	WITH 	qb_export.output + ;
						lcTranStr + NL_CR + ;
						lcSplitStr + NL_CR + ;
						ENDTRANS_HEADER + NL_CR 
ENDSCAN

*!* * Now output it to the IIF file
COPY MEMO qb_export.output TO (ThisForm.icPrintFileName)

SET CENTURY &lcCentury
RETURN
>Hi all,
> Well, I just can't seem to get it. I can import a simple vendor or
>customer list, but not a transaction!. What I've done. I used the Quickbooks
>sample Invoice .IIF file as a template for building my .IIF. The two .IIF's
>are formatted exactly the same. I find that no matter what I do I cannot
>successfully import one of my transactions to Quickbooks. I've even cut and
>paste the transaction in the sample file to my .IIF. Interesting, I can
>change the data and format of my transaction to match the sample transaction
>and when I click import I still get a transaction out of balance message.
>the darn app just coasts right by my transaction and imports the sample
>successfully...and I'm tellin ya there exactly the same! Can anyone explain
>what is goin on here. I just can't seem to grasp this...... Could it be the way I'm formatting the currency values or sumthin?????
>
>TIA
>
>Mat
Phillip Grant
Grant Computer Consulting
731.642.2162
phillip@grantcomputer.com
BrainBench Certified: Visual FoxPro, RDBMS Concepts
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform