Sales Order non inventory dialog form  Topic is solved

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

Sales Order non inventory dialog form

Postby DannyC » Thu Jul 21, 2016 1:56 pm

Hi,

I've been asked to change the general ledger sales account for non inventory items, based on the sales order branch/division.

I am having a hard time finding a few things:
1. I can't find the event that pops up the dialog for non inventory items. I've tried SalesOrderLine.Adding but that gets fired after the dialog has been OKed. I can't find any other relevant event.
2. I can't find the actual non inventory form, so even if I was able to locate an event to hook into, I can't find the form anyway.

Can you give me a heads up?

Cheers

Danny
User avatar
DannyC
Senpai
Senpai
 
Posts: 718
Joined: Fri Mar 22, 2013 12:23 pm
Topics Solved: 31

Re: Sales Order non inventory dialog form

Postby Mike.Sheen » Sun Jul 31, 2016 2:05 pm

Hi Danny,

Short answer is currently you can't - the dialog has the account properties private - if they were public then you could do something like this:

Code: Select all
Public Class ApplicationManagerPlugin
    Inherits System.MarshalByRefObject
    Implements JiwaApplication.IJiwaApplicationManagerPlugin

    Public Overrides Function InitializeLifetimeService() As Object
        ' returning null here will prevent the lease manager
        ' from deleting the Object.
        Return Nothing
    End Function

    Public Sub Setup(ByVal Plugin As JiwaApplication.Plugin.Plugin) Implements JiwaApplication.IJiwaApplicationManagerPlugin.Setup
      AddHandler JiwaApplication.Manager.Instance.DialogFactory.AfterDialogStart, AddressOf AfterDialogStart
    End Sub
   
   Private Sub AfterDialogStart(ByVal JiwaDialog As JiwaApplication.IJiwaDialog)
      If TypeOf JiwaDialog Is JiwaSalesUI.SalesOrder.NonInventoryDialog Then
         Dim NonInventoryDialog As JiwaSalesUI.SalesOrder.NonInventoryDialog = JiwaDialog
         Dim salesOrderForm As JiwaSalesUI.SalesOrder.SalesOrderEntryForm = NonInventoryDialog.Owner
         
         If salesOrderForm.SalesOrder.Branch.Description = "Perth" Then
            ' Change inventory sales account here
                                NonInventoryDialog.SalesAccount.ReadRecord("SomeID")
         End If
      End If
   End Sub   

End Class


Note that the dialog you couldn't find is called JiwaFinancials.Jiwa.JiwaSalesUI.SalesOrder.NonInventoryDialog.

We can log a bug to make this dialog and it's properties available - but do you care about how it displays anyway? - can't you just hook into the line added event of the sales order and set the account then ? Sure - that means the user is shown a GL account which will be ignored and overridden - but that might not be that important if the business rule is to always set it based on rules anyway.

Mike
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: Sales Order non inventory dialog form

Postby DannyC » Tue Aug 09, 2016 10:49 am

can't you just hook into the line added event of the sales order and set the account then ? Sure - that means the user is shown a GL account which will be ignored and overridden

Understood, but 99% of customers want to see the visual confirmation that the account is set correctly in the non inventory form. It wouldn't pass UAT.

This may complicate matters, but would it possibly be feasible to design a custom non-inventory form which displays instead of Jiwa's form? We would then have full control over the values passed into each field, and then pass those values into the sales order line.

cheers

Danny
User avatar
DannyC
Senpai
Senpai
 
Posts: 718
Joined: Fri Mar 22, 2013 12:23 pm
Topics Solved: 31

Re: Sales Order non inventory dialog form  Topic is solved

Postby Mike.Sheen » Wed Nov 09, 2016 3:04 pm

This has been logged as DEV-5653. It will be in build 07.00.176.00

EDIT: The issue linked to above has a plugin attached which should do what you want - but note you'll need 07.00.176.00 or later to use it. We should see 07.00.176.00 (as a dev build) tomorrow AM.
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 1 guest