Debtor account display in Sales Orders  Topic is solved

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

Debtor account display in Sales Orders

Postby Atronics » Thu Apr 14, 2016 1:39 pm

How can I change the curent display of the debtor in Sales Orders and Quotes from the standard "AccountNo - Account Name" to "AccountName - PhoneNo". I would also like to make the same change in Quotes and Purchase Orders
Attachments
Capture.JPG
Capture.JPG (16.42 KiB) Viewed 3201 times
Atronics
Frequent Contributor
Frequent Contributor
 
Posts: 119
Joined: Fri Feb 29, 2008 4:40 pm
Topics Solved: 10

Re: Debtor account display in Sales Orders  Topic is solved

Postby Mike.Sheen » Thu Apr 14, 2016 3:43 pm

Atronics wrote:How can I change the curent display of the debtor in Sales Orders and Quotes from the standard "AccountNo - Account Name" to "AccountName - PhoneNo". I would also like to make the same change in Quotes and Purchase Orders


Add handlers for the Read and Create end, then in there you set the text property of the control on the form which displays that information.

For example:

In the Setup method:
Code: Select all
public void Setup(JiwaFinancials.Jiwa.JiwaApplication.IJiwaForm JiwaForm, JiwaFinancials.Jiwa.JiwaApplication.Plugin.Plugin Plugin)
{
   if (JiwaForm is JiwaFinancials.Jiwa.JiwaSalesUI.SalesOrder.BaseSalesOrderEntryForm)
   {
      var salesOrderForm = (JiwaFinancials.Jiwa.JiwaSalesUI.SalesOrder.BaseSalesOrderEntryForm)JiwaForm;
      salesOrderForm.SalesOrder.ReadEnd += SalesOrder_ReadEnd;
      salesOrderForm.SalesOrder.Created += SalesOrder_Created;
   }
}


Then your create / readend handlers would look like this:

Code: Select all
private void SalesOrder_ReadEnd(object sender, System.EventArgs e)
{
   var salesOrder = (JiwaFinancials.Jiwa.JiwaSales.SalesOrder.SalesOrder)sender;
   var salesOrderForm = (JiwaFinancials.Jiwa.JiwaSalesUI.SalesOrder.BaseSalesOrderEntryForm)salesOrder.Client;
   
   // To get the phone number we'll read in in the debtor record
   JiwaFinancials.Jiwa.JiwaDebtors.Debtor debtor = JiwaFinancials.Jiwa.JiwaApplication.Manager.Instance.BusinessLogicFactory.CreateBusinessLogic<JiwaFinancials.Jiwa.JiwaDebtors.Debtor>(null);
   debtor.Read(salesOrder.Debtor.DebtorID);
   
   salesOrderForm.DebtorLookup.Text = String.Format("{0} - {1}", salesOrder.Debtor.AccountNo, debtor.Phone);
}


Sample plugin attached.
Attachments
Plugin Plugin - Custom Account Display.xml
Sample plugin
(38.3 KiB) Downloaded 703 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

Re: Debtor account display in Sales Orders

Postby Atronics » Thu Apr 14, 2016 6:55 pm

That was quick! Thanks, Mike.
Atronics
Frequent Contributor
Frequent Contributor
 
Posts: 119
Joined: Fri Feb 29, 2008 4:40 pm
Topics Solved: 10

Re: Debtor account display in Sales Orders

Postby Atronics » Fri Apr 29, 2016 10:14 am

Hi Mike,
This plugin causes an error on entering a Warehouse Purchase Order. I can't figure out the problem. The error is "Creditor not found Module: Read"
John I
Atronics
Frequent Contributor
Frequent Contributor
 
Posts: 119
Joined: Fri Feb 29, 2008 4:40 pm
Topics Solved: 10

Re: Debtor account display in Sales Orders

Postby Scott.Pearce » Fri Apr 29, 2016 10:23 am

Don't you already have a case open for this?
Scott Pearce
Senior Analyst/Programmer
Jiwa Financials
User avatar
Scott.Pearce
Senpai
Senpai
 
Posts: 765
Joined: Tue Feb 12, 2008 11:27 am
Location: New South Wales, Australia
Topics Solved: 230

Re: Debtor account display in Sales Orders

Postby Mike.Sheen » Fri Apr 29, 2016 11:59 pm

Scott.Pearce wrote:Don't you already have a case open for this?


Yes, there is a case logged for this - so this topic is now locked.
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 2 guests