Batch Totals for Purchase Invoices (7 replies)
David, you can map an empty field to the Posted Document Total and that will allow you to display the total for the invoice/credit note. I would let your customer go down this route as it's easier.
What may be difficult would be to get a batch total (since Sage200 doesn't really have a concept of a batch):
- Place a filter after the Sage200 to filter unsuccessful documents.
- Hierarchise the data so you have a Batch level, then the documents, then the details.
- Add a map transform which sums the total of the documents and use this field on the Audit summary (of the Map transform).
Thanks
Thank you for advising me. I implemented the three steps and get the following error:
Error occurred whilst processing transform [BatchTotal].
Invalid procedure call or argument
Where BatchTotal is the name of the map transform in step 3 above
Here is the full stack trace less any customer-specific info:
Invalid procedure call or argument
Time='03/05/19 16:52:22' App='IManEngine:3.2.100' ADO-version='6.3' Computer=''
Method: TransformTaskListGenerator.PerformSubstitution
Number: 5 = &H5 = vbObjectError + 2147221509 = ERRMAP_APP_FIRST + 2147216311
Source: IManEngine
Description: Invalid procedure call or argument
Call Stack: TransformTaskListGenerator.PerformSubstitution(sStatement={Text}) --------------------
Value Of sStatement:
'Filename: %[PLInvoice.SYS.INPUTFILE], Total Amount: %[PLInvoice.TotalAmount]'
Env: m=1, lOffset=21, sResult={Text}
Value Of sResult:
'Filename: sageinvs00000001.csv, Total Amount: %[PLInvoice.TotalAmount]'
Call Stack: TransformTaskListGenerator.GenerateMatchingFiles(sStatement={Text}) ------------------
Value Of sStatement:
'Filename: %[PLInvoice.SYS.INPUTFILE], Total Amount: %[PLInvoice.TotalAmount]'
Env: l=1, sTransactionId='PLInvoice'
Call Stack: AuditLogger.ReplaceSummaryTokens(sTfmId='BATCHTOTAL', sSummaryString={Text}) --------
Value Of sSummaryString:
'Filename: %[PLInvoice.SYS.INPUTFILE], Total Amount: %[PLInvoice.TotalAmount]'
Env: l=0, sResult =''
Call Stack: AuditLogger.GenerateEmailHeader() ----------------------------------------------------
Env: l=1, sResult={Text}
Value Of sResult:
'
Batch Total for Purchase Transactions File
'
Call Stack: AuditLogger.AddTransformSummaries(sTransformId='BATCHTOTAL') -------------------------
Call Stack: TransformCoordinator.RunTransform(sTransformId='BATCHTOTAL') -------------------------
Env: eTransformType=5, bWriteSummaries=True, bSummariesHandled=False
Call Stack: TransformCoordinator.RunTransformStream(sParentTransform='GROUPBYFILENAME') ----------
Env: sTransformId='BATCHTOTAL', l=0, m=0
Call Stack: TransformCoordinator.RunTransformStream(sParentTransform='REMOVEDUPLICATES') ---------
Env: sTransformId='GROUPBYFILENAME', l=2, m=2
Call Stack: TransformCoordinator.RunTransformStream(sParentTransform='SUPPLIEREXISTS') -----------
Env: sTransformId='REMOVEDUPLICATES', l=0, m=0
Call Stack: TransformCoordinator.RunTransformStream(sParentTransform='') -------------------------
Env: sTransformId='SUPPLIEREXISTS', l=0, m=0
Call Stack: TransformCoordinator.Process() -------------------------------------------------------
Call Stack: IntManEng.Main() ---------------------------------------------------------------------
Env: sCmd='"OPALS200PURCH"'
It would appear from the error there's an issue with the InvoiceTotal field.
Is this a field? Can you send a screenshot of the field in the Preview?
David, try removing the square brackets.
Filename: %PLInvoice.SYS.INPUTFILE, Total Amount: %PLInvoice.TotalAmount
I removed the brackets. This enabled the TotalAmount to appear in the audit report. However, SYS.INPUTFILE which is part of the hierarchy appeared as 0. Does this still need to be in square brackets?
Try that; this is a bug in our old code (which the Map transform still is).
One of my customers is going live today and decided at the 11th hour that they want a batch total adding to the audit summary in the Sage 200 Connector. What is the easiest way to do this?