by Mike.Sheen » Sat Dec 17, 2016 12:28 pm
Hi jak,
the "Export Jiwa Sales Orders" action is used to only send to Magento orders in Jiwa which have shipped.
If you search the plugin code for the method "CreateMagentoShipments" you can see the criteria it uses:
- Code: Select all
string SQL = @"SELECT SO_Main.InvoiceNo
FROM SO_Main
LEFT JOIN SO_CustomSettingValues order_id_value ON order_id_value.InvoiceID = SO_Main.InvoiceID
LEFT JOIN SO_CustomSetting order_id ON order_id.SettingID = order_id_value.SettingID
LEFT JOIN SO_CustomSettingValues shipment_id_value ON shipment_id_value.InvoiceID = SO_Main.InvoiceID
LEFT JOIN SO_CustomSetting shipment_id ON shipment_id.SettingID = shipment_id_value.SettingID
JOIN SO_History ON SO_History.InvoiceID = SO_Main.InvoiceID AND SO_History.HistoryNo = SO_Main.CurrentHistoryNo
WHERE SO_Main.LastSavedDateTime > @JiwaSalesOrdersLastSyncDateTime
AND order_id.SettingName = @magento_increment_id_SettingName
AND order_id_value.Contents IS NOT NULL
AND LTRIM(RTRIM(order_id_value.Contents)) <> ''
AND shipment_id.SettingName = @magento_shipment_id_SettingName
AND (shipment_id_value.Contents IS NULL OR LTRIM(RTRIM(order_id_value.Contents)) = '')
AND SO_History.Status = 5 -- 5 = Delivery
ORDER BY SO_Main.LastSavedDateTime, SO_Main.InvoiceNo";
The custom field on the sales order "magento_increment_id" must be NOT blank or NULL, and the custom field "magento_shipment_id" must be blank or NULL (that means no shipment created in Magento yet).
The sales order history status must also be set to Delivery (value 5).
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