
Atronics wrote:Putting a parent debtor on hold causes child accounts to also be on hold. This is fine. However, taking the parent off "On Hold" does not also reset the child accounts. Is there a plugin to manage this?

public void Setup(JiwaFinancials.Jiwa.JiwaApplication.IJiwaBusinessLogic JiwaBusinessLogic, JiwaFinancials.Jiwa.JiwaApplication.Plugin.Plugin Plugin)
{
JiwaFinancials.Jiwa.JiwaDebtors.Debtor debtor = (JiwaFinancials.Jiwa.JiwaDebtors.Debtor)JiwaBusinessLogic;
debtor.SaveEnd += Debtor_SaveEnd;
}
private void Debtor_SaveEnd(object sender, System.EventArgs e)
{
JiwaFinancials.Jiwa.JiwaDebtors.Debtor debtor = (JiwaFinancials.Jiwa.JiwaDebtors.Debtor)sender;
if (debtor.BranchDebtors.Count > 0 && debtor.AccountOnHold == false)
{
// update all branch debtors
foreach (JiwaFinancials.Jiwa.JiwaDebtors.BranchDebtor branchDebtor in debtor.BranchDebtors)
{
JiwaFinancials.Jiwa.JiwaDebtors.Debtor child = JiwaFinancials.Jiwa.JiwaApplication.Manager.Instance.BusinessLogicFactory.CreateBusinessLogic<JiwaFinancials.Jiwa.JiwaDebtors.Debtor>(null);
child.Read(branchDebtor.RecID);
child.AccountOnHold = false;
child.Save();
}
}
}

Return to Technical and or Programming
Users browsing this forum: No registered users and 0 guests