How to Access Sales Order History from SaveStart SO  Topic is solved

Discussions relating to plugin development, and the Jiwa API.

How to Access Sales Order History from SaveStart SO

Postby Ernst » Fri Dec 19, 2014 7:39 pm

Took me a while to figure out how to get to my sales order history area in the save SO plugin.
Though other might like to see how.
Now if Mike can show me how to access lines and line details in the same area.. that would be great.
Osmosis...my foot.. More like Blood, Sweat and Tears. :)

This Plugin, check No GST on Freight if Tax Exempt, and also no Freight for certain customers in certain warehouses.

Private Sub SalesOrder_SaveStart(sender As Object, e As System.EventArgs)
Dim salesOrder As JiwaSales.SalesOrder.SalesOrder = DirectCast(sender, JiwaSales.SalesOrder.SalesOrder)
Dim SalesOrderH As JiwaSales.SalesOrder.SalesOrderHistory = salesOrder.SalesOrderHistorys(salesorder.CurrentHistoryNo)
' If Tax Exempt No entered, check no GST on Freight.
If salesOrder.TaxExemptionNo.Trim.Length > 0 Then
If salesOrderH.CartageCharge1.GSTAmount > 0 Or salesOrderH.CartageCharge2.GSTAmount > 0 Or salesOrderH.CartageCharge3.GSTAmount > 0 Then
System.Windows.Forms.MessageBox.Show("Tax Exempt Orders should not have GST on Freight")
End If
End If
' No Freight for Cust1/Cust2.
If ( salesOrder.Debtor.DebtorID = "000000003S00000003F5" Or salesOrder.Debtor.DebtorID = "000000003S00000003F9") And ( salesOrder.LogicalWarehouseResidingIn.IN_LogicalID = "6D449A62032B40FDA67E" Or salesOrder.LogicalWarehouseResidingIn.IN_LogicalID = "C0D32995FCF941BEA907" ) And ( salesOrderH.CartageCharge1.IncGSTAmount + salesOrderH.CartageCharge2.IncGSTAmount + salesOrderH.CartageCharge3.IncGSTAmount ) > 0 And salesOrder.Reference <> "OR" Then
Throw New System.Exception("No Freight or Freight GST for Cust1 and Cust2 in Main Warehouses - Please correct")
End If

' End If
End Sub
End Class
User avatar
Ernst
Kohai
Kohai
 
Posts: 219
Joined: Tue Feb 19, 2008 3:43 pm
Topics Solved: 12

Re: How to Access Sales Order History from SaveStart SO  Topic is solved

Postby Mike.Sheen » Sun Dec 21, 2014 3:12 pm

Ernst wrote:Now if Mike can show me how to access lines and line details in the same area.. that would be great.


Using your example provided - access to the sales order lines and line details is as follows:

Code: Select all
For each salesOrderLine As JiwaSales.SalesOrder.SalesOrderLine In salesOrder.SalesOrderLines
    ' This  gives you access to each sales order line for the currently selected snapshot - eg: salesOrderLine.PartNo: http://help.jiwa.com.au/Jiwa7/7.00.100/reference/index.aspx?topic=html/1099736474.htm
    For each lineDetail As JiwaSales.SalesOrder.SalesOrder.LineDetail in salesOrderLine.LineDetails
        ' This gives you access each LineDetail for each sales order line - eg: lineDetail.SerialNo : http://help.jiwa.com.au/Jiwa7/7.00.100/reference/index.aspx?topic=html/283894749.htm
    Next
Next


Ernst wrote:Osmosis...my foot.. More like Blood, Sweat and Tears. :)


My apologies if you have had trouble working out what you needed to achieve - we're doing the best we can with the resources we have.

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: 2444
Joined: Tue Feb 12, 2008 11:12 am
Location: Perth, Republic of Western Australia
Topics Solved: 756

Re: How to Access Sales Order History from SaveStart SO

Postby Ernst » Thu Jan 08, 2015 12:50 pm

Great.. thanks for the Help. appreciate it.
User avatar
Ernst
Kohai
Kohai
 
Posts: 219
Joined: Tue Feb 19, 2008 3:43 pm
Topics Solved: 12


Return to Technical and or Programming

Who is online

Users browsing this forum: No registered users and 5 guests