2024.2 [b2b] Rma Import
The Rma Import is the post-process of the Order Export Process. Once the Order is exported and a Rma is created for it in NetSuite, the Rma Import is triggered. As part of NetSuite Import Process (see: 2024.2 2. Import process), \RocketWeb\NetSuiteRma\Model\Process\Import\Rma::process() transforms the NetSuite Rma into the Magento Rma.
Transform the NetSuite Rma into Magento Format
NetSuite Connector uses \RocketWeb\NetSuiteRma\Model\Mapper\ToMagento\Rma::getMagentoFormat() to build proper Magento Rma object.
That method uses RocketWeb/NetSuiteRma/Model/MagentoOrderRepository.php to find Magento Order related to NetSuite Rma. Data from this order is used in the mapper object to set general information about Rma.
As the next step Rma Items is filtered and added set to Magento Rma (see: \RocketWeb\NetSuiteRma\Model\Mapper\ToMagento\Rma\ItemsMapper::prepareItems()). Only linked with NetSuite Products can be added to the Magento Rma.
Save Magento Invoice
New/Updated Magento Rma object is saved by\Magento\Rma\Api\RmaManagementInterface::saveRma();