I’m wondering if anyone else has seen a similar behavior.
We have modified the original AP Automation scripts from Epicor, with the guidance and supervision of an Epicor consultant, and it works beautifully - 99% of the time. The other 1% of the time, it creates an AP Invoice for which ERP claims there is a variance and it cannot be posted.
I’ve run enough SQL to know that there is no variance. If I simply restart the workflow for that document in Docstar and it comes into ERP again, it has a 99.9% chance of being perfectly fine. If I simply delete and recreate the line in ERP, it will be just fine.
It really seems that the API is inconsistent, either by some inherent code issue, or that it gets overwhelmed or something, but no error is returned to Docstar from ERP. The API process ‘worked’ as far as everyone is concerned. I cannot think of a way to monitor the API process to determine where it is going wrong, or determine what ERP thinks is a variance on a single line, non-PO based invoice for $300 - yes - no cents - with no taxes or misc. charges.
Any and all suggestions and ideas would be welcome.
We do have an open ticket with Epicor and are trying to get this escalated to the API Devs.
@MikeGross it could be a long shot, but when I was getting variances I ran the E10_Read Invoice Integration manually on that invoice and found that Epicor was sending back an amount in DocInvoiceVariance that DS uses that for a variance. I would run all of the Read Invoices to see if any of them were returning variances.
I also had some variables not getting reset properly, so a restart was not a total restart.
Appreciate the insight Greg. It’s actually a variance on the ERP side, as Docstar thinks everything is fine and ERP accepts the Invoice via the API. So it’s hard to tell where the actual problem is, but this
is definitely a possibility given the complexity of our workflow!!
Thanks for the hint sir!!
@MikeGross It still could be sending the variance and ECM is not trapping it, so it let’s the invoice get created. I made a dashboard that had all of the data in the DS batch so I could see what was happening.
@MikeGross Here is the query since I am not sure you can load them into your version.
/*
* Disclaimer!!!
* This is not a real query being executed, but a simplified version for general vision.
* Executing it with any other tool may produce a different result.
*/
select
[APInvHed].[GroupID] as [APInvHed_GroupID],
(0) as [Calculated_Selected],
[APInvDtl].[InvoiceNum] as [APInvDtl_InvoiceNum],
[APInvHed].[DocInvoiceAmt] as [APInvHed_DocInvoiceAmt],
[APInvHed].[DocRounding] as [APInvHed_DocRounding],
[TotalDtl].[Calculated_SubTotal] as [Calculated_SubTotal],
[TotalDtl].[Calculated_MiscCharge] as [Calculated_MiscCharge],
[APInvDtl].[InvoiceLine] as [APInvDtl_InvoiceLine],
[APInvDtl].[LineType] as [APInvDtl_LineType],
[APInvDtl].[UnitCost] as [APInvDtl_UnitCost],
[APInvDtl].[PartNum] as [APInvDtl_PartNum],
[APInvDtl].[PONum] as [APInvDtl_PONum],
[APInvDtl].[POLine] as [APInvDtl_POLine],
[APInvDtl].[PORelNum] as [APInvDtl_PORelNum],
[APInvDtl].[Description] as [APInvDtl_Description],
[APInvDtl].[SysRowID] as [APInvDtl_SysRowID],
[APInvHed].[SysRowID] as [APInvHed_SysRowID],
[APInvDtl].[VendorNum] as [APInvDtl_VendorNum],
[APInvHed].[InvoiceNum] as [APInvHed_InvoiceNum],
[APInvHed].[VendorNum] as [APInvHed_VendorNum]
from Erp.APInvHed as APInvHed
left outer join Erp.APInvDtl as APInvDtl on
APInvHed.Company = APInvDtl.Company
and APInvHed.VendorNum = APInvDtl.VendorNum
and APInvHed.InvoiceNum = APInvDtl.InvoiceNum
inner join (select
[DtlLines].[VendorNum] as [DtlLines_VendorNum],
[DtlLines].[InvoiceNum] as [DtlLines_InvoiceNum],
(sum(DtlLines.ExtCost)) as [Calculated_SubTotal],
(Sum(DtlLines.DocTotalMiscChrg)) as [Calculated_MiscCharge]
from Erp.APInvDtl as DtlLines
inner join Erp.APInvHed as APInvHedGrp on
DtlLines.Company = APInvHedGrp.Company
and DtlLines.VendorNum = APInvHedGrp.VendorNum
and DtlLines.InvoiceNum = APInvHedGrp.InvoiceNum
and ( APInvHedGrp.GroupID = 'DOCSTAR' and APInvHedGrp.Posted = 0 )
group by [DtlLines].[VendorNum],
[DtlLines].[InvoiceNum]) as TotalDtl on
TotalDtl.DtlLines_VendorNum = APInvHed.VendorNum
and TotalDtl.DtlLines_InvoiceNum = APInvHed.InvoiceNum
where (APInvHed.GroupID = 'DOCSTAR' and APInvHed.Posted = 0)