Apply Credit Memo - Error in BO Call / BL Tester

While creating Apply Credit Memo through BPM Custom code, error is coming. The same error is coming in BL Tester. Anyone has solution to fix the issue, please suggest.

GetHdrDocumentInfo Method call throws error.

Erp.Contracts.ApplyCreditMemoSvcContract ApplyCMHed = null;
ApplyCMHed = Ice.Assemblies.ServiceRenderer.GetService<Erp.Contracts.ApplyCreditMemoSvcContract>(Db);
var ApplyCMHedds = new Erp.Tablesets.ApplyCreditMemoTableset();
ApplyCMHed.GetNewCashHead(ref ApplyCMHedds, strgroupID);
ApplyCMHed.OnDocumentTypeChanging(ref ApplyCMHedds, “CM”);
ApplyCMHed.GetHdrDocumentInfo(10100, ref ApplyCMHedds);

image
Server Side Exception

BPM runtime caught an unexpected exception of ‘DivideByZeroException’ type.

See more info in the Inner Exception section of Exception Details.

Exception caught in: Epicor.ServiceModel

Error Detail

============

Description: BPM runtime caught an unexpected exception of ‘DivideByZeroException’ type.

See more info in the Inner Exception section of Exception Details.

Program: CommonLanguageRuntimeLibrary

Method: FCallDivide

Original Exception Type: DivideByZeroException

Framework Method: calcCashHeadBalance

Framework Line Number: 433

Framework Column Number: 13

Framework Source: calcCashHeadBalance at offset 197 in file:line:column C:_projects\ERP\RL10.2.300.0\Source\Server\Services\BO\ApplyCreditMemo\ApplyCreditMemo.cs:433:13

Client Stack Trace

==================

at Epicor.ServiceModel.Channels.ImplBase`1.ShouldRethrowNonRetryableException(Exception ex, DataSet[] dataSets)

at Erp.Proxy.BO.ARInvoiceImpl.OnChangeBlockedFin(Int32 invoiceNum, ARInvoiceDataSet ds)

at Erp.Adapters.ARInvoiceAdapter.OnChangeBlockedFin(Int32 invoiceNum)

Inner Exception

===============

Attempted to divide by zero.

Did you get any solution for this ?