Hi All,
I have created a batch for the settlement and i have created a method as a code
///
/// Settle the marked customer transaction.
///
///
/// A CustTable record.
///
///
/// A CustTrans record.
///
///
/// A CustTrans record.
///
///
/// Returns true or false.
///
public boolean doSettlement(CustTable _custTable,CustTrans _invCustTrans, CustTrans _payCustTrans)
{
boolean ret = false;
CustTransOpen invCustTransOpen, payCustTransOpen;
SpecTransManager specTransManager;
SpecTrans specTransExists, specTransDel;
;
invCustTransOpen = CustTransOpen::findRefId(_invCustTrans.RecId);
payCustTransOpen = CustTransOpen::findRefId(_payCustTrans.RecId);
ttsbegin;
// If record exists related to customer transactions in Spectrans table then deletes the record and insert again
select count(RecId) from specTransExists
where specTransExists.SpecCompany == _custTable.DataAreaId
&& specTransExists.SpecTableId == _custTable.TableId
&& specTransExists.SpecRecId == _custTable.RecId;
if (specTransExists.RecId != 0)
{
delete_from specTransDel
where specTransDel.SpecCompany == _custTable.DataAreaId
&& specTransDel.SpecTableId == _custTable.TableId
&& specTransDel.SpecRecId == _custTable.RecId;
}
//Mark for settlement
SpecTransExecutionContext specTransExecutionContext = SpecTransExecutionContext::newFromSource(_custTable);
specTransManager = SpecTransManager::construct(specTransExecutionContext.parmSpecContext());
//invoices
if (!specTransManager.exist(invCustTransOpen.DataAreaId, invCustTransOpen.TableId, invCustTransOpen.RecId))
{
specTransManager.insert(invCustTransOpen.DataAreaId, invCustTransOpen.TableId, invCustTransOpen.RecId, invCustTransOpen.remainAmountCashDisc(), _invCustTrans.CurrencyCode);
}
//Payment(s)
if (!specTransManager.exist(payCustTransOpen.DataAreaId, payCustTransOpen.TableId, payCustTransOpen.RecId))
{
specTransManager.insert(payCustTransOpen.DataAreaId, payCustTransOpen.TableId, payCustTransOpen.RecId, payCustTransOpen.remainAmountCashDisc(), _payCustTrans.CurrencyCode);
}
ttscommit;
//Settle
ret = CustTrans::settleTransaction(
specTransExecutionContext,
CustTransSettleTransactionParameters::construct());
//if full settled and no durther settlement required then updated as paid
this.updateDepositTableAsPaidIfFullySettled(_invCustTrans);
return ret;
}
it seems working fine as far as settling the amount but when I do the same from the settlement -> settlement transaction extra line appears


Please let me know if I am doing any thing wrong or I need to change any thing in my code to make sure settlement transcation and my batch works same???