MassGenerateCashDtl / GenerateCashDtl

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);
2 Likes