Hello,
The below code is causing problems when being sent to Sage Accpac 55 Accounts Receivable.
Here's the problem:
- I am creating a receipt entry from my program. The user specifies the amount then transfers it to Accpac.
- The user can split the amount to pay several invoices, if desired.
- The amounts are correct when transferring, although, once the transfer is complete, the values are completely wrong in Accpac.
Scenario:
Say you have an entry with four or more details.
- Detail 'A' has a balance of $23.54;
- Detail 'B' has a balance of $307.85;
- Detail 'C' has a balance of $414.60;
- Detail 'D' has a balance of $104.45.
I have a total of $100 and want to place $25 on detail entry 'C' and the remaining $75 on detail entry 'B'.
Results:
When transferred to Accpac AR, the batch information is correct, the header information is correct but the details are completely wrong.
The total amount of $100 (Not $25) is applied to detail 'C' providing a Net Balance of $314.60.
Detail B is applying the entire remaining invoice balance (Not $75). Thus Applied Amount is $307.85 and a Net Balance of $0.00
Due to this conflict, the receipt unapplied amount is -$307.85.
I have been told that this code has never produced any problems when used in earlier Sage Accpac ERP versions.
...
'// Details.
With ARPOOP
.Browse "", 1
.Fetch
.Fields("PAYMTYPE").PutWithoutVerification ("CA") '// Batch Type.
.Fields("CNTBTCH").PutWithoutVerification (BatchInfo.BatchNum) '// Batch Number.
.Fields("CNTITEM").PutWithoutVerification (BatchInfo.EntryNum) '// Entry Number.
.Fields("IDCUST").PutWithoutVerification (ccrOneCust.strID) '// ID Customer.
.Fields("AMTRMIT").PutWithoutVerification (g_dblAppliedAmt) '// Receipt Amount.
.Process
'// Determine which lines to apply payment.
For i = 0 To g_intMultiple - 1
.Fields("PAYMTYPE").PutWithoutVerification ("CA") '// Batch Type.
.Fields("CNTBTCH").PutWithoutVerification (BatchInfo.BatchNum) '// Batch Number.
.Fields("CNTITEM").PutWithoutVerification (BatchInfo.EntryNum) '// Entry Number.
.Fields("CNTKEY").PutWithoutVerification (Str(g_intArLocation(i) * -1)) '// Count key.
.Fields("AMTRMIT").PutWithoutVerification (g_dblAppliedAmt) '// Receipt Amount.
.Read '// Put the correct record as the currect record.
.Fields("APPLY").value = "Y" '// Apply.
.Update '// Update the superview, but do not commit to the tables.
Next i
End With
ARTCR.Insert '// Commit to the tables.
ARBTA.Fields("CNTLASTITM").value = BatchInfo.EntryNum
ARBTA.Update
...
I have also tried entering the exact amount the user entered for each entry with the following (which produced a 'View Call Failed' error):
.Fields("PAYMAMT").value = g_strAppliedAmt(i).Amount
Any help would be greatly appreciated.
The below code is causing problems when being sent to Sage Accpac 55 Accounts Receivable.
Here's the problem:
- I am creating a receipt entry from my program. The user specifies the amount then transfers it to Accpac.
- The user can split the amount to pay several invoices, if desired.
- The amounts are correct when transferring, although, once the transfer is complete, the values are completely wrong in Accpac.
Scenario:
Say you have an entry with four or more details.
- Detail 'A' has a balance of $23.54;
- Detail 'B' has a balance of $307.85;
- Detail 'C' has a balance of $414.60;
- Detail 'D' has a balance of $104.45.
I have a total of $100 and want to place $25 on detail entry 'C' and the remaining $75 on detail entry 'B'.
Results:
When transferred to Accpac AR, the batch information is correct, the header information is correct but the details are completely wrong.
The total amount of $100 (Not $25) is applied to detail 'C' providing a Net Balance of $314.60.
Detail B is applying the entire remaining invoice balance (Not $75). Thus Applied Amount is $307.85 and a Net Balance of $0.00
Due to this conflict, the receipt unapplied amount is -$307.85.
I have been told that this code has never produced any problems when used in earlier Sage Accpac ERP versions.
...
'// Details.
With ARPOOP
.Browse "", 1
.Fetch
.Fields("PAYMTYPE").PutWithoutVerification ("CA") '// Batch Type.
.Fields("CNTBTCH").PutWithoutVerification (BatchInfo.BatchNum) '// Batch Number.
.Fields("CNTITEM").PutWithoutVerification (BatchInfo.EntryNum) '// Entry Number.
.Fields("IDCUST").PutWithoutVerification (ccrOneCust.strID) '// ID Customer.
.Fields("AMTRMIT").PutWithoutVerification (g_dblAppliedAmt) '// Receipt Amount.
.Process
'// Determine which lines to apply payment.
For i = 0 To g_intMultiple - 1
.Fields("PAYMTYPE").PutWithoutVerification ("CA") '// Batch Type.
.Fields("CNTBTCH").PutWithoutVerification (BatchInfo.BatchNum) '// Batch Number.
.Fields("CNTITEM").PutWithoutVerification (BatchInfo.EntryNum) '// Entry Number.
.Fields("CNTKEY").PutWithoutVerification (Str(g_intArLocation(i) * -1)) '// Count key.
.Fields("AMTRMIT").PutWithoutVerification (g_dblAppliedAmt) '// Receipt Amount.
.Read '// Put the correct record as the currect record.
.Fields("APPLY").value = "Y" '// Apply.
.Update '// Update the superview, but do not commit to the tables.
Next i
End With
ARTCR.Insert '// Commit to the tables.
ARBTA.Fields("CNTLASTITM").value = BatchInfo.EntryNum
ARBTA.Update
...
I have also tried entering the exact amount the user entered for each entry with the following (which produced a 'View Call Failed' error):
.Fields("PAYMAMT").value = g_strAppliedAmt(i).Amount
Any help would be greatly appreciated.