Service Manager. Credit Goods into Stock
Hi,
On the Service Manager, Customer Returns tab, I want to change the warehouse for the Credit Note when Credit Goods Into Stock is ticked.
If not ticked, just leave as current warehouse.
I have it working - to a point.
The credit note warehouse is changing, but it seems to be setting the overall Jiwa warehouse without changing the bottom status bar. I know because when I open sales orders or purchase orders or other module the warehouse of the opened form is the adjusted warehouse.
How can I stop that from happening, so that if Credit Goods into Stock is ticked, I can set the warehouse the credit should go to without changing the Jiwa current warehouse?
This is my code so far
Second question, ideally I'd like to pop up a warehouse selection box so the user can choose the warehouse. Not quite so important but would be handy.
Cheers
On the Service Manager, Customer Returns tab, I want to change the warehouse for the Credit Note when Credit Goods Into Stock is ticked.
If not ticked, just leave as current warehouse.
I have it working - to a point.
The credit note warehouse is changing, but it seems to be setting the overall Jiwa warehouse without changing the bottom status bar. I know because when I open sales orders or purchase orders or other module the warehouse of the opened form is the adjusted warehouse.
How can I stop that from happening, so that if Credit Goods into Stock is ticked, I can set the warehouse the credit should go to without changing the Jiwa current warehouse?
This is my code so far
- Code: Select all
Public Class BusinessLogicPlugin
Inherits System.MarshalByRefObject
Implements JiwaApplication.IJiwaBusinessLogicPlugin
'Private _ServiceJob As JiwaFinancials.Jiwa.JiwaServiceManager.Job
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 JiwaBusinessLogic As JiwaApplication.IJiwaBusinessLogic, ByVal Plugin As JiwaApplication.Plugin.Plugin) Implements JiwaApplication.IJiwaBusinessLogicPlugin.Setup
If TypeOf(JiwaBusinessLogic) Is JiwaFinancials.Jiwa.JiwaServiceManager.Job Then
Dim jobObject As JiwaFinancials.Jiwa.JiwaServiceManager.Job = DirectCast(JiwaBusinessLogic, JiwaFinancials.Jiwa.JiwaServiceManager.Job)
AddHandler jobObject.CreateCustomerReturnCreditNoteBeforeSalesOrderSave, AddressOf ChgCreditWarehouse
'_ServiceJob = jobObject
End If
End Sub
Public Sub ChgCreditWarehouse(ByVal SalesOrder As JiwaSales.SalesOrder.SalesOrder)
If SalesOrder.CreditIntoStock = True Then
' salesOrder.LogicalWarehouseResidingIn.IN_LogicalID = "DEB9E973927E486B8E81" 'This doesn't work
SalesOrder.Warehouse.IN_LogicalID = "DEB9E973927E486B8E81"
Else
Exit Sub
End If
End Sub
End Class
Second question, ideally I'd like to pop up a warehouse selection box so the user can choose the warehouse. Not quite so important but would be handy.
Cheers