MYOB Greentree Integration
This ERPGate connection enables .wms to send messages back to MYOB Greentree ERP to confirm that a purchase order has been completed.
Note: This connection is currently only for Purchase Orders coming in with a LineType of PORecINLineItem
, NOT Purchase Shipments which have the LineType of POSHINLineItem
.
The XSL used for the inbound process is BWM_PurchaseOrders.xsl
.
ERPGate classes used |
Greentree |
Transmission method and format |
HTTP POST Request is sent containing an XML document. |

Connections location |
erpgate1.dotwms.com |
CredentialDriver |
Greentree |
BaseURL |
Greentree Domain Include the full URL (http://, etc) including the trailing forward slash. For example, 'https://test.com/' |
Username |
Greentree Username |
Password |
Greentree Password |
AccessToken |
Greentree ApiKey The ApiKey is the site's Greentree serial number. |

Connection ID |
513 |
Connection Name |
Bendigo Woollen Mills - Greentree- Purchase Order Completion |
Connection Driver |
Greentree Upload Purchase Order Completion |
Trigger |
PUSH |
Notes |
Push purchase order completion to MYOB Greentree ERP. |

Connection ID |
513 |
SettingName |
Greentreee.ValidateLotSerial |
SettingValue |
Create |
Description |
If this setting value is 'None', no checks are completed to see if Greentree has the batch listed in their system. If the setting value is anything other than ‘None', the connection will poll Greentree to make sure the batch exists in Greentree (and if it does not then the connection will create the batch number in Greentree). |

ExportFileTypeID |
1227 |
Export Name |
BWM Purchase Order Receipt Export |
Trigger After |
RCP_COMPLETE |
ExportFileType Function |
GenericSQL |
ExportFileType Format |
XML |
Export Conditions |
Copy
|
Export File Save Path |
https://erpgate1.dotwms.com/push/?Connection=513&Key=%PushAPIKey% |
Export Notes |
Sends all completed receipts to the upload connection. |

SELECT
WarehouseCode AS 'HEADER_WarehouseCode',
ShipmentNumber AS 'HEADER_ShipmentNumber',
JobCloseTime AS 'HEADER_JobCloseTime',
SupplierName AS 'HEADER_SupplierName',
Additional02 AS 'HEADER_Additional02',
RCPA.ItemCode,
RCPE.OrderLineNumber,
SUM(RCPA.ReceivedQuantity) AS 'ReceivedQuantity',
ITM.StockUnit,
ULD.Barcode AS 'ULDBarcode',
RCPA.BatchNumber
FROM RCP
INNER JOIN WHS ON WHS.WarehouseID = RCP.WarehouseID
INNER JOIN RCPA ON RCPA.ReceiptID = RCP.ReceiptID
INNER JOIN RCPE ON RCPE.ExpectedLineID = RCPA.ExpectedLineID
INNER JOIN ULD ON ULD.ULDID = RCPA.ULDID
INNER JOIN ITM ON ITM.ItemCode = RCPA.ItemCode AND ITM.InstanceID = RCP.InstanceID AND ITM.TenantID = RCP.TenantID
WHERE RCP.ReceiptID = :DocumentKey
AND RCP.InstanceID = :InstanceID
AND RCP.TenantID = :TenantID
AND RCP.WarehouseID = :WarehouseID
AND RCP.Additional01 = 'PURCHASEORDER'
GROUP BY OrderLineNumber, ItemCode, BatchNumber

{"XSLT":"<?xml version=\"1.0\" encoding=\"UTF-8\"?><xsl:stylesheet version=\"1.0\" xmlns:xsl=\"http:\/\/www.w3.org\/1999\/XSL\/Transform\"><xsl:key name=\"item-lines\" match=\"Line\" use=\"OrderLineNumber\"\/><xsl:template match=\"\/GenericReport\"><GenericReport><WarehouseCode><xsl:value-of select=\"WarehouseCode\"\/><\/WarehouseCode><ShipmentNumber><xsl:value-of select=\"ShipmentNumber\"\/><\/ShipmentNumber><JobCloseTime><xsl:value-of select=\"JobCloseTime\"\/><\/JobCloseTime><SupplierName><xsl:value-of select=\"SupplierName\"\/><\/SupplierName><Additional02><xsl:value-of select=\"Additional02\"\/><\/Additional02><xsl:for-each select=\"Line[count(. | key('item-lines', .\/OrderLineNumber)[1]) = 1]\"><xsl:variable name=\"thisItemCode\" select=\"ItemCode\"\/><xsl:variable name=\"thisOrderLineNumber\" select=\"OrderLineNumber\"\/><Line><ItemCode><xsl:value-of select=\"ItemCode\"\/><\/ItemCode><OrderLineNumber><xsl:value-of select=\"OrderLineNumber\"\/><\/OrderLineNumber><ReceivedQuantity><xsl:value-of select=\"sum(..\/Line\/ReceivedQuantity[$thisOrderLineNumber=..\/OrderLineNumber])\"\/><\/ReceivedQuantity><StockUnit><xsl:value-of select=\"StockUnit\"\/><\/StockUnit><xsl:for-each select=\"..\/Line[$thisOrderLineNumber=.\/OrderLineNumber]\"><Characteristic><ULDBarcode><xsl:value-of select=\"ULDBarcode\"\/><\/ULDBarcode><BatchNumber><xsl:value-of select=\"BatchNumber\"\/><\/BatchNumber><Quantity><xsl:value-of select=\"ReceivedQuantity\"\/><\/Quantity><\/Characteristic><\/xsl:for-each><\/Line><\/xsl:for-each><\/GenericReport><\/xsl:template><\/xsl:stylesheet>"}