2024.1 Order Status
Order Status is the post-process of Order Export Process. Once the Order is exported and something changes with the Sales Order Status in NetSuite, this process (\RocketWeb\NetSuiteOrder\Model\Process\Import\Order::process()) takes care of updating the Magento Order Status. The workflow checks if the Magento Order for the given Sales Order exists. If it doesn't the update is skipped. Magento Order is loaded.
Transform NetSuite Status to Magento State
The mapping uses configuration to support NetSuite Sales Order Statuses with Magento Order State and Status (\RocketWeb\NetSuiteOrder\Model\Transform::netsuiteStatusToMagentoOrderState()). If no mapping is found, a default processing state is set.
Once the State and Status of the Magento Orders are set, the Last Import Date is set so we don't update the Order until the next change in NetSuite happens. An Event netsuite_order_import_save_before is triggered. In the scope of Order Status, we also update the Magento Order Item quantities, both invoiced and shipped.
Save Order
Magento Order is saved and an Event netsuite_order_import_after is triggered.