Page 1 of 1

How to Access Sales Order History from SaveStart SO

PostPosted: Fri Dec 19, 2014 7:39 pm
by Ernst
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

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

PostPosted: Sun Dec 21, 2014 3:12 pm
by Mike.Sheen
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

Re: How to Access Sales Order History from SaveStart SO

PostPosted: Thu Jan 08, 2015 12:50 pm
by Ernst
Great.. thanks for the Help. appreciate it.