Setting the default PO Reorder method  Topic is solved

Discussions relating to plugin development, and the Jiwa API.

Setting the default PO Reorder method

Postby DannyC » Mon Jun 05, 2023 11:35 am

I've got the couple of Jiwa standard reorder methods and a couple of custom ones I've developed.

Client wants a particular one to be the default when a new purchase order is created but I can't work out which one I can denote as default.
User avatar
DannyC
Senpai
Senpai
 
Posts: 636
Joined: Fri Mar 22, 2013 12:23 pm
Topics Solved: 30

Re: Setting the default PO Reorder method  Topic is solved

Postby nsbandara » Thu Jun 08, 2023 3:55 am

Hi,

Please check following business logic plugin that sets Replenish to Minimum as the default re-order method.

Code: Select all
#region "BusinessLogicPlugin"
public class BusinessLogicPlugin : System.MarshalByRefObject, JiwaFinancials.Jiwa.JiwaApplication.IJiwaBusinessLogicPlugin
{

    public override object InitializeLifetimeService()
    {
        // returning null here will prevent the lease manager
        // from deleting the Object.
        return null;
    }

    public void Setup(JiwaFinancials.Jiwa.JiwaApplication.IJiwaBusinessLogic JiwaBusinessLogic, JiwaFinancials.Jiwa.JiwaApplication.Plugin.Plugin Plugin)
    {
        if(JiwaBusinessLogic is JiwaFinancials.Jiwa.JiwaPurchaseOrders.PurchaseOrder)
      {
         JiwaFinancials.Jiwa.JiwaPurchaseOrders.PurchaseOrder purchaseOrder = JiwaBusinessLogic as JiwaFinancials.Jiwa.JiwaPurchaseOrders.PurchaseOrder;
         purchaseOrder.CreateEnd += delegate(object sender, EventArgs e)
         {
            purchaseOrder.SelectedReorderMethodKey = "Replenish to Minimum"; //this should match re-order method name from the re-order method plugin
            if(purchaseOrder.Client != null)
            {
               JiwaFinancials.Jiwa.JiwaPurchaseOrdersUI.PurchaseOrders frmPurchaseOrders = purchaseOrder.Client as JiwaFinancials.Jiwa.JiwaPurchaseOrdersUI.PurchaseOrders;
               frmPurchaseOrders.ReorderMethodsUltraComboEditor.Value = purchaseOrder.ReOrderMethods["Replenish to Minimum"]; //key should match with re-order method name from the re-order method plugin
            }
         };
      }
    }
}
#endregion
User avatar
nsbandara
Occasional Contributor
Occasional Contributor
 
Posts: 43
Joined: Tue Jul 16, 2013 5:02 pm
Location: Sri Lanka
Topics Solved: 11


Return to Technical and or Programming

Who is online

Users browsing this forum: No registered users and 21 guests