Sales Orders Create Purchase Orders  Topic is solved

Discussions relating to plugin development, and the Jiwa API.

Sales Orders Create Purchase Orders

Postby DannyC » Tue Aug 09, 2022 4:05 pm

v 7.2.1 SR5 (but possibly applies to SR12 too)

Referring to the standard plugin that ships with Jiwa.

I am changing it so that the creditor warehouse is something different from the default.
Just after the line
Code: Select all
PurchaseOrderUIObject.PurchaseOrder.CreateNew(JiwaFinancials.Jiwa.JiwaPurchaseOrders.PurchaseOrder.SupplierType.Creditor, JiwaFinancials.Jiwa.JiwaPurchaseOrders.PurchaseOrder.NewOrderSeedTypes.CreditorID, supplier.CreditorID, If(salesOrderForm.SalesOrder.SalesOrderType = JiwaFinancials.Jiwa.JiwaSales.SalesOrder.SalesOrder.SalesOrderTypes.e_SalesOrderNormalSalesOrder, JiwaFinancials.Jiwa.JiwaPurchaseOrders.PurchaseOrder.PurchaseOrderType.DefaultOrderType, JiwaFinancials.Jiwa.JiwaPurchaseOrders.PurchaseOrder.PurchaseOrderType.BackToBack))


I am getting a valid warehouseID.

Code: Select all
Dim WarehouseID As String = ""
WarehouseID = GetCR_WarehouseID(salesOrderForm.SalesOrder.Debtor.AccountNo, PurchaseOrderUIObject.Manager)
If WarehouseID <> "" Then
   PurchaseOrderUIObject.PurchaseOrder.Creditor.ReadWarehouseAddress(WarehouseID)
End If


My problem is that Creditor.ReadWarehouseAddress isn't doing anything. I thought it would read in the details from the WarehouseID and change the screen display to read the selected warehouse but nope. Nothing.

Is there something else I need to be doing?
User avatar
DannyC
Senpai
Senpai
 
Posts: 636
Joined: Fri Mar 22, 2013 12:23 pm
Topics Solved: 30

Re: Sales Orders Create Purchase Orders

Postby SBarnes » Tue Aug 09, 2022 6:36 pm

ReadWarehouseAddress execute the following SQL

Code: Select all
"SELECT Description, Address1, Address2, Address3, Address4, PostCode, Notes, CourierDetails, Country " &
                          "FROM CR_Warehouse " &
                          "WHERE CR_Warehouse.WarehouseID = @WarehouseID "


but it is a function and returns a JiwaApplication.Entities.Address it doesn't change anything so you need to assign the address you get back onto I think the MailingAddress property of the creditor on the purchase order. You may also need to to a read on the warehouse property of the creditor with you warehouse ID
Regards
Stuart Barnes
SBarnes
Shihan
Shihan
 
Posts: 1619
Joined: Fri Aug 15, 2008 3:27 pm
Topics Solved: 175

Re: Sales Orders Create Purchase Orders  Topic is solved

Postby SBarnes » Tue Aug 09, 2022 6:52 pm

Scratch all that just use PurchaseOrder.Creditor.Warehouse.ReadRecord it sets the address as well.

Code: Select all
Sub ReadRecord(ByVal CreditorID As String, ByVal WarehouseIDtoRead As String)
Regards
Stuart Barnes
SBarnes
Shihan
Shihan
 
Posts: 1619
Joined: Fri Aug 15, 2008 3:27 pm
Topics Solved: 175


Return to Technical and or Programming

Who is online

Users browsing this forum: No registered users and 22 guests

cron