Parent debtor on hold  Topic is solved

Discussions relating to Jiwa 7 plugin development, and the Jiwa 7 API.

Parent debtor on hold

Postby Atronics » Wed May 11, 2016 2:38 pm

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?
Atronics
Frequent Contributor
Frequent Contributor
 
Posts: 119
Joined: Fri Feb 29, 2008 4:40 pm
Topics Solved: 10

Re: Parent debtor on hold

Postby Mike.Sheen » Mon May 23, 2016 8:26 pm

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?


No, we don't have a plugin already which does this.

It should be fairly easy to write one, though. I estimate an hour of development time to write the plugin.
Mike Sheen
Chief Software Engineer
Jiwa Financials

If I do answer your question to your satisfaction, please mark it as the post solving the topic so others with the same issue can readily identify the solution
User avatar
Mike.Sheen
Overflow Error
Overflow Error
 
Posts: 2583
Joined: Tue Feb 12, 2008 11:12 am
Location: Perth, Republic of Western Australia
Topics Solved: 807

Re: Parent debtor on hold  Topic is solved

Postby Mike.Sheen » Fri May 27, 2016 8:16 pm

This worked for me in demo data:

Code: Select all
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();
      }
   }
}


Working plugin attached.
Attachments
Plugin Remove child debtors on hold.xml
Sample Plugin
(28.75 KiB) Downloaded 393 times
Mike Sheen
Chief Software Engineer
Jiwa Financials

If I do answer your question to your satisfaction, please mark it as the post solving the topic so others with the same issue can readily identify the solution
User avatar
Mike.Sheen
Overflow Error
Overflow Error
 
Posts: 2583
Joined: Tue Feb 12, 2008 11:12 am
Location: Perth, Republic of Western Australia
Topics Solved: 807


Return to Technical and or Programming

Who is online

Users browsing this forum: No registered users and 0 guests