Hi all
Does anybody know any way to partially unsettle two customer transactions through x ?
I can reverse the entire settlement using...
public static void unsettleCustomerTransaction(CustTrans _custTrans) { CustTable custTable = CustTable::find(_custTrans.AccountNum); SpecTransManager specTransManager = SpecTransManager::newRefTableId(custTable, tableNum(CustSettlement), true); CustSettlement custSettlement; while select custSettlement where custsettlement.TransRecId == _custTrans.RecId && custSettlement.TransCompany == _custTrans.DataAreaId && custSettlement.CanBeReversed { if (!specTransManager.existForOtherSpec(custSettlement.DataAreaId, custSettlement.TableId, custSettlement.RecId)) { custSettlement.CustVendSettlement::markThisAndRelatedOffsets(specTransManager, _custTrans.CurrencyCode); CustTrans::reverseTransact(custTable, null, SettleDatePrinc::DaysDate, dateNull(), true); specTransManager.deleteAll(); } } }
and I can settle transactions with a chosen amount using the SpecTransManager and insert which allows setting of the settlement amount.
specTransManager.insert(custTransOpenToSettle.company(), custTransOpenToSettle.TableId, custTransOpenToSettle.RecId, _settleAmount1 ? _settleAmount1 : custTransOpenToSettle.AmountCur, _custTrans1.CurrencyCode);
But I can't use the same process for unsettling them. Firstly in most cases there is no open transaction, but even if there is, simply trying to change the sign and use the standard functionality doesn't work.
I have seen that the unsettle process from the customer transaction screen doesn't allow specific amounts to be specified, so I guess it's impossible, but if anybody has any other ideas I would love to hear them.
Thanks
Andrew
Hi Andrew,
There is no support out of the box for partly unsettle transactions. You can fully unsettle and partly settle again to get the required outcome.