Hi Jeff,
You would need to modify the plugin to hide or show the panel based on the debtor.
By adding a handler in the ReadEnd and CreateEnd events you can examine the debtor and then set the splitter control for the customer panel to be expanded or not.
With our current plugin we already do listen to the ReadEnd and CreateEnd events, so you can just modify that - so for example in the ReadEnd it currently looks like this:
- Code: Select all
Public Sub SalesOrder_ReadCompleted(sender As Object, e As System.EventArgs)
ReadCustomerSalesHistory()
DisplayProductDetailsForRow(0)
End Sub
Changing it to the below will hide the panel when the AccountNo is "1001":
- Code: Select all
Public Sub SalesOrder_ReadCompleted(sender As Object, e As System.EventArgs)
ReadCustomerSalesHistory()
DisplayProductDetailsForRow(0)
Dim salesOrder As JiwaSales.SalesOrder.SalesOrder = sender
If salesOrder.Debtor.AccountNo = "1001" Then
Splitter.Collapsed = True
Else
Splitter.Collapsed = False
End If
End Sub
Attached is a plugin demonstrating this. Disable the standard Customer Panel plugin, import the attached and search for "1001" and change that to be the account no you're using for cash sales (there will be two places "1001" occurs - the methods SalesOrder_ReadCompleted and SalesOrder_Created), then save and log out and log back in.
Mike