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
|
|
recieve payment |
Author |
Message |
Pete |
|
Group | : Members |
Posts | : 17 |
Joined | : 2007-01-06 |
|
Profile |
|
Posted : 2008-11-18 16:59:36 |
I've looked at the threads posted here for help before posting this. I am trying to insert a record into the recieved payment table and for some reason it just wont have any of it
The command line works fine in the vb demo app, but not when running this code in an asp page. What am i missing
Dim cnQODBC As System.Data.Odbc.OdbcConnection
Dim daQODBC As System.Data.Odbc.OdbcDataAdapter
Dim dsQODBC As System.Data.DataSet
' open connection to QuickBooks
cnQODBC = New System.Data.Odbc.OdbcConnection("DSN=QuickBooks Data")
cnQODBC.Open()
' Read 12 lines out the file
Try
For LineCounter = 1 To 13
InputFileLine = Sr.ReadLine
Next
Do
' First Record
InputFileLine = Sr.ReadLine
daQODBC = New System.Data.Odbc.OdbcDataAdapter("SELECT TxnID, CustomerRefListID From InvoiceLine where RefNumber = '" & Trim(Mid(InputFileLine, 43, 6)) & "'", cnQODBC)
dsQODBC = New System.Data.DataSet
daQODBC.Fill(dsQODBC, "TempTable")
strTxnID = dsQODBC.Tables(0).Rows(1).Item(0).ToString
strCustRef = dsQODBC.Tables(0).Rows(1).Item(1).ToString
' Finished with dataset so dispose
daQODBC.Dispose()
dsQODBC.Dispose()
' Mark payment as paid
daQODBC = New System.Data.Odbc.OdbcDataAdapter
cmdQODBC = New System.Data.Odbc.OdbcCommand("INSERT INTO ReceivePaymentLine (CustomerRefListID, DepositToAccountRefListID, TotalAmount, PaymentMethodRefListID, RefNumber, AppliedToTxnTxnID, AppliedToTxnPaymentAmount, TxnDate, Memo ) Values ('20002-1167773758' , '4D0000-1168431348' , 58.75, 'A0000-1167772879', 'BACS11112008', '2ACB6-1225699749', 58.75, {d'2008-11-11'}, 'IMPORTED PAYMENT' ", cnQODBC)
daQODBC.InsertCommand = cmdQODBC
exit Do
Loop Until InStr(1, InputFileLine, "Transaction Count") > 0
Catch ex As Exception
' Write error scripts here
End Try
This runs ok but the payment doesn't get put into quickbooks... Help
|
|
|
i really do need help, this computer stuff is like double dutch |
| Top | |
|
|
Tom |
|
Group | : Administrator |
Posts | : 5510 |
Joined | : 2006-02-17 |
|
Profile |
|
Posted : 2008-11-18 18:08:07 |
I think a ) is missing:
cmdQODBC = New System.Data.Odbc.OdbcCommand("INSERT INTO ReceivePaymentLine (CustomerRefListID, DepositToAccountRefListID, TotalAmount, PaymentMethodRefListID, RefNumber, AppliedToTxnTxnID, AppliedToTxnPaymentAmount, TxnDate, Memo ) Values ('20002-1167773758' , '4D0000-1168431348' , 58.75, 'A0000-1167772879', 'BACS11112008', '2ACB6-1225699749', 58.75, {d'2008-11-11'}, 'IMPORTED PAYMENT' )", cnQODBC)
See: How do I create a new Customer, invoice them and mark the invoice as paid? for a complete example.
|
|
|
|
|