Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

a/r invoices importing BASETAX1 & BASETAX2

Status
Not open for further replies.

mydcba

Technical User
Apr 12, 2006
12
CA
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.
 
The other system might calculate tax on the document total instead of by detail line. The Tax Group in Tax Services will determine that in Accpac.
 
I switched Tax Calculation Method to "by detail" but still doesn't work.
If the invoice type is "summary" and not "item" will that make a difference. In my case invoice type is "summary".

The other system calculate the tax by detail line.
 
If you simply want to have the same tax then don't worry about setting up the tax amounts on the detail line. Put the header tax amounts and then call the function to distribute the taxes to the lines.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top