Hi Forum,
I've been trying to import Cash Receipts via a BOI script and i am going nowhere.
Once i was able to import the lines but they came in with no AmountPosted.
Then i changed the script to find the invoice Lines and all of a sudden, no invoices came in.
Here is the script that I am using to see if someone can point me to what i am doing wrong.
When i SetValue("AmountPosted", nAmt) in the lines, i get no Receipt Detail When i don't Set The value i get all lines except that the Amt Posted column in the detail grid shows 0.00.
I set the PostingAmt variable with the total deposit Amount and shows 0.00.
Header:
strCust = "" : strCust = "0150110"
retVal = oCashRec.nSetKeyValue("DepositNo$", sDeposit)
retVal = oCashRec.nSetKeyValue("ARDivisionNo$", "00")
retVal = oCashRec.nSetKeyValue("CustomerNo$", strCust)
'retVal = oCashRec.nSetKeyValue("CreditCardEntryNo$", " ")
retVal = oCashRec.nSetKeyValue("DepositType$", "C")
retVal = oCashRec.nSetKeyValue("CheckNo$", sCheck)
retVal = oCashRec.nSetValue("CorporateTaxOverrd$", "N")
retVal = oCashRec.nSetValue("PostingAmount", nPostAmt)
retVal = oCashRec.nSetKey()
Detail:
retVal = oCashRec.oLines.nAddLine()
retVal = oCashRec.oLines.nSetKeyValue("DepositNo$", sDeposit)
retVal = oCashRec.oLines.nSetKeyValue("ARDivisionNo$", "00")
retVal = oCashRec.oLines.nSetKeyValue("CustomerNo$", strCust)
'retVal = oCashRec.oLines.nSetKeyValue("CreditCardEntryNo$", " ")
retVal = oCashRec.oLines.nSetKeyValue("DepositType$", "C")
retVal = oCashRec.oLines.nSetKeyValue("CheckNo$", sCheck)
retVal = oCashRec.oLines.nSetKey()
retVal = oCashRec.oLines.nSetValue("LineType$", "I")
retVal = oCashRec.oLines.nSetValue("InvoiceNo$", strInvoice)
retVal = oCashRec.oLines.nSetValue("InvoiceType$", "IN")
'retVal = oCashRec.oLines.nSetValue("AmountPosted", nAmt1)
'MsgBox(oCashRec.oLines.sLastErrorMsg & vbCRLF & "Setting Line Amt: " & nAmt1)
retVal = oCashRec.olines.nWrite()
nAmtTot = nAmtTot + nAmt1
If retVal = 0 Then
MsgBox(oCashRec.oLines.sLastErrorMsg & vbCRLF & "Setting Line: " & strInvoice & "-" & nAmt1)
end if
Header Write:
retVal = 0
retVal = oCashRec.nWrite()
Error message is "Deposit out of Balance"
No Errors writing the lines...
Regards,
Manuel Roman