I try to import to A/R 5.5A invoices from another system.
Here is a sample of a summary invoice :
RTTCode RTDate RTCCode RTDesc RTTAmt RTAmt RTTax1Amt RTTax2Amt
CUST 01-Feb-11 DIST Description $2,426.60 $2,130.00 $106.50 $190.10
CUST 01-Feb-11 DIST Description $135,478.75 $118,919.25 $5,945.96 $10,613.54
CUST 01-Feb-11 DIST Description $3,083.57 $2,706.67 $135.33 $241.57
CUST 01-Feb-11 DIST Description $3,179.93 $2,791.25 $139.56 $249.12
CUST 01-Feb-11 DIST Description $100,762.00 $88,445.90 $4,422.30 $7,893.80
CUST 01-Feb-11 DIST Description $63,132.69 $55,416.01 $2,770.80 $4,945.88
CUST 01-Feb-11 DIST Description $15,554.96 $13,653.69 $682.68 $1,218.59
$323,618.50 $284,062.77 $14,203.13 $25,352.60
total taxable amount tax 1 tax 2
and here is the code that I use:
ARINVOICE3headerFields("IDCUST").Value = fldRTTCode.Value
'ARINVOICE3headerFields("TEXTTRX").Value = 3 ' code 3 to change to credit note
ARINVOICE3headerFields("IDINVC").Value = fldRTInvNo.Value
ARINVOICE3headerFields("DATEINVC").Value = fldRTDate.Value
Line1:
ARINVOICE3detail1.RecordCreate 0
ARINVOICE3detail1Fields("IDDIST").Value = fldRTCCode.Value ' Distribution Code
ARINVOICE3detail1Fields("TEXTDESC").Value = fldRTDesc.Value ' Distribution description
ARINVOICE3detail1Fields("AMTEXTN").Value = Round(fldRTAmt.Value, 2) ' Extended Amount w/ TIP
ARINVOICE3headerFields("SWMANTX").Value = "1" ' Do Not Calc. Tax
ARINVOICE3detail1Fields("BASETAX1").Value = fldRTAmt.Value
ARINVOICE3detail1Fields("CNTLINE").PutWithoutVerification (-1)
ARINVOICE3detail1Fields("AMTTAX1").Value = fldRTTax1Amt.Value
ARINVOICE3detail1Fields("CNTLINE").PutWithoutVerification (-1)
ARINVOICE3detail1Fields("BASETAX2").Value = fldRTAmt.Value + fldRTTax1Amt.Value
ARINVOICE3detail1Fields("CNTLINE").PutWithoutVerification (-1)
ARINVOICE3detail1Fields("AMTTAX2").Value = fldRTTax2Amt.Value
ARINVOICE3detail1Fields("CNTLINE").PutWithoutVerification (-1)
ARINVOICE3detail1.insert
varRTTax1Amt = Round(varRTTax1Amt + fldRTTax1Amt.Value, 2)
varRTTax2Amt = Round(varRTTax2Amt + fldRTTax2Amt.Value, 2)
varSubTot = Round(varSubTot + fldRTAmt.Value, 2)
ARINVOICE3detail1.Read
ARINVOICE3headerFields("SWMANTX").Value = "1" ' Do Not Calc. Tax
ARINVOICE3detail1.Read
ARINVOICE3headerFields("BASETAX1").Value = Round(varSubTot, 2)
ARINVOICE3detail1Fields("CNTLINE").PutWithoutVerification ("-1") ' Line Number
ARINVOICE3headerFields("AMTTAX1").Value = Round(varRTTax1Amt, 2) ' Tax Amount 1
ARINVOICE3detail1Fields("CNTLINE").PutWithoutVerification ("-1") ' Line Number
ARINVOICE3detail1.Read
ARINVOICE3headerFields("BASETAX2").Value = Round(varSubTot + varRTTax1Amt, 2)
ARINVOICE3detail1Fields("CNTLINE").PutWithoutVerification ("-1") ' Line Number
ARINVOICE3headerFields("AMTTAX2").Value = Round(varRTTax2Amt, 2) ' Tax Amount 2
ARINVOICE3detail1Fields("CNTLINE").PutWithoutVerification ("-1") ' Line Number
ARINVOICE3detail1.Read
Then goes back to LINE1: to insert all detail lines>
Everything works fine except the amount for BASETAX1 & BASETAX2 (both field & header) which is different by a few cents from the original amount.
ACCPAC vs Original
BASETAX1 RTAmt
2,129.99 2,130.00
118,919.26 118,919.25
2,706.66 2,706.67
2,791.26 2,791.25
88,445.90 88,445.90
55,416.03 55,416.01
13,653.70 13,653.69
Subtotal, tax 1 , tax 2 and total fields are correct.
Here is a sample of a summary invoice :
RTTCode RTDate RTCCode RTDesc RTTAmt RTAmt RTTax1Amt RTTax2Amt
CUST 01-Feb-11 DIST Description $2,426.60 $2,130.00 $106.50 $190.10
CUST 01-Feb-11 DIST Description $135,478.75 $118,919.25 $5,945.96 $10,613.54
CUST 01-Feb-11 DIST Description $3,083.57 $2,706.67 $135.33 $241.57
CUST 01-Feb-11 DIST Description $3,179.93 $2,791.25 $139.56 $249.12
CUST 01-Feb-11 DIST Description $100,762.00 $88,445.90 $4,422.30 $7,893.80
CUST 01-Feb-11 DIST Description $63,132.69 $55,416.01 $2,770.80 $4,945.88
CUST 01-Feb-11 DIST Description $15,554.96 $13,653.69 $682.68 $1,218.59
$323,618.50 $284,062.77 $14,203.13 $25,352.60
total taxable amount tax 1 tax 2
and here is the code that I use:
ARINVOICE3headerFields("IDCUST").Value = fldRTTCode.Value
'ARINVOICE3headerFields("TEXTTRX").Value = 3 ' code 3 to change to credit note
ARINVOICE3headerFields("IDINVC").Value = fldRTInvNo.Value
ARINVOICE3headerFields("DATEINVC").Value = fldRTDate.Value
Line1:
ARINVOICE3detail1.RecordCreate 0
ARINVOICE3detail1Fields("IDDIST").Value = fldRTCCode.Value ' Distribution Code
ARINVOICE3detail1Fields("TEXTDESC").Value = fldRTDesc.Value ' Distribution description
ARINVOICE3detail1Fields("AMTEXTN").Value = Round(fldRTAmt.Value, 2) ' Extended Amount w/ TIP
ARINVOICE3headerFields("SWMANTX").Value = "1" ' Do Not Calc. Tax
ARINVOICE3detail1Fields("BASETAX1").Value = fldRTAmt.Value
ARINVOICE3detail1Fields("CNTLINE").PutWithoutVerification (-1)
ARINVOICE3detail1Fields("AMTTAX1").Value = fldRTTax1Amt.Value
ARINVOICE3detail1Fields("CNTLINE").PutWithoutVerification (-1)
ARINVOICE3detail1Fields("BASETAX2").Value = fldRTAmt.Value + fldRTTax1Amt.Value
ARINVOICE3detail1Fields("CNTLINE").PutWithoutVerification (-1)
ARINVOICE3detail1Fields("AMTTAX2").Value = fldRTTax2Amt.Value
ARINVOICE3detail1Fields("CNTLINE").PutWithoutVerification (-1)
ARINVOICE3detail1.insert
varRTTax1Amt = Round(varRTTax1Amt + fldRTTax1Amt.Value, 2)
varRTTax2Amt = Round(varRTTax2Amt + fldRTTax2Amt.Value, 2)
varSubTot = Round(varSubTot + fldRTAmt.Value, 2)
ARINVOICE3detail1.Read
ARINVOICE3headerFields("SWMANTX").Value = "1" ' Do Not Calc. Tax
ARINVOICE3detail1.Read
ARINVOICE3headerFields("BASETAX1").Value = Round(varSubTot, 2)
ARINVOICE3detail1Fields("CNTLINE").PutWithoutVerification ("-1") ' Line Number
ARINVOICE3headerFields("AMTTAX1").Value = Round(varRTTax1Amt, 2) ' Tax Amount 1
ARINVOICE3detail1Fields("CNTLINE").PutWithoutVerification ("-1") ' Line Number
ARINVOICE3detail1.Read
ARINVOICE3headerFields("BASETAX2").Value = Round(varSubTot + varRTTax1Amt, 2)
ARINVOICE3detail1Fields("CNTLINE").PutWithoutVerification ("-1") ' Line Number
ARINVOICE3headerFields("AMTTAX2").Value = Round(varRTTax2Amt, 2) ' Tax Amount 2
ARINVOICE3detail1Fields("CNTLINE").PutWithoutVerification ("-1") ' Line Number
ARINVOICE3detail1.Read
Then goes back to LINE1: to insert all detail lines>
Everything works fine except the amount for BASETAX1 & BASETAX2 (both field & header) which is different by a few cents from the original amount.
ACCPAC vs Original
BASETAX1 RTAmt
2,129.99 2,130.00
118,919.26 118,919.25
2,706.66 2,706.67
2,791.26 2,791.25
88,445.90 88,445.90
55,416.03 55,416.01
13,653.70 13,653.69
Subtotal, tax 1 , tax 2 and total fields are correct.