MassGenerateCashDtl / GenerateCashDtl

Hi

Having followed thorough the TraceLog for a a cash receipt to payout an invoice, neither MassGenerateCashDtl nor GenerateCashDtl is actually allocating the payment against the invoice. The receipt is created but shows as unallocated.

MassGenerateCashDtl returns successfully but nothing has been applied against he invoice and no message.

GenerateCashDtl suggests ‘Invoice is not valid for the selected customer’ which seems weird as the invoice number itself would determine who the customer is

I read MassGenerateCashDtls and using the same fields required for ARInvSel but no joy.

Any ideas please?

I’ve written a full integration using that API. I’ll take a look to see if I can help early next week for you if someone doesn’t reply beforehand.

Thanks Jeff.

Here’s my generalized/trimmed pseudo call stack (using wrapper v1.1.11)… hope there’s something in here that helps.

// ----- BEGIN BY LOCKING THE BATCH
postData = new { groupID = groupID, programName = "CR" };
respData = EpicorRest.DynamicPost("Erp.BO.BankBatchSvc", "LockARBatch", postData);

// ------ CASH GROUP
postData = new { ds = new object() };
respData = EpicorRest.DynamicPost("Erp.BO.CashGrpSvc", "GetNewCashGrp", postData);

ds.CashGrp[0].GroupID = groupID;

postData = new { BankAcctId = bankAcctId, ds };
respData = EpicorRest.DynamicPost("Erp.BO.CashGrpSvc", "GetGrpBankInfo", postData);

postData = new { tranDate = tranDate.ToShortDateString(), ds };  // Date from the bank deposit date
respData = EpicorRest.DynamicPost("Erp.BO.CashGrpSvc", "GetGrpFiscal", postData);

postData = new { ds };
respData = EpicorRest.DynamicPost("Erp.BO.CashGrpSvc", "UpdateMaster", postData);

// ------ CASH RECEIPT
postData = new { ds = new object(), groupID = groupID, tranType = "PayInv" };
respData = EpicorRest.DynamicPost("Erp.BO.CashRecSvc", "GetNewCashHeadType", postData);

ds.CashHead[0].CheckRef = groupID;
ds.CashHead[0].ReceiptAmt = receiptAmt;

postData = new { ds };
respData = EpicorRest.DynamicPost("Erp.BO.CashRecSvc", "ChangeReceiptAmt", postData);

postData = new { custID = custID, ds };
respData = EpicorRest.DynamicPost("Erp.BO.CashRecSvc", "GetCustomerInfo", postData);

ds.CashHead[0].CustNumCustID = custID;

postData = new { ds };
respData = EpicorRest.DynamicPost("Erp.BO.CashRecSvc", "PreUpdate", postData);

postData = new { ds, ipGroupID = groupID, ipTableName = "CashHead", updGroupTotals = true, ipIgnoreValidation = 0 };
respData = EpicorRest.DynamicPost("Erp.BO.CashRecSvc", "UpdateMaster", postData);

Int64 headNum = respData.parameters.ds.CashHead[0].HeadNum.Value;

// ------ PAY INVOICES
postData = new { pcGroupID = groupID, ipHeadNum = headNum, useDisc = true, ds = invoicesToProcess };
respData = EpicorRest.DynamicPost("Erp.BO.CashRecSvc", "MassGenerateCashDtl", postData);

// ------ WRAP UP / UNLOCK THE BATCH
postData = new { groupID = groupID };
respData = EpicorRest.DynamicPost("Erp.BO.CashGrpSvc", "LeaveCashGrp", postData);
1 Like

Many thanks Jeff. That has certainly helped get a working solution together.

Now to refine for more than a single invoice.