Invoice import/export - Magento 2
Invoices management should be happening in NetSuite, but the initial invoice is pushed to NetSuite in case you make use of an authorize & capture payment method in Magento, or create an invoice using any other mean.
Invoice export
Invoices are pushed to NetSuite as CashSale objects. The cash sale is initialized from the NetSuite order (same behaviour as when you press "Bill" inside NetSuite) so all the custom workflows will happen. The line items will be forced to match the Magento's invoice.
Invoice Export events
Event name | Data |
|---|---|
netsuite_new_cashsale_send_before | magento_invoice - Magento invoice object netsuite_cashsale - Netsuite invoice object |
Export notes
Discounts and taxes are added as separate line items with IDs specified for discount and tax items.
Invoice import
One can also create cash sales in NetSuite and as long as the sales order initiated from Magento, the cash sale will be imported as an invoice inside Magento.
Invoices are imported only when last_import_date > lastModifiedDate of the NetSuite object.
Event name | Data |
|---|---|
netsuite_cash_sale_import_before | magento_invoice - Magento invoice object netsuite_cashsale - Netsuite invoice object |
netsuite_cash_sale_import_after | netsuite_item - NetSuite \Record magento_invoice - Magento object |
Totals Calculation
Is done on Magento side (RocketWeb\NetSuite\Helper\Mapper\Invoice). So if totals differ in Magento and NS - that can be the case.
Discounts
Discounts are calculated from the first item which matches specified Discount item internal NS ID (rocketweb_netsuite/orders/discount_item_id).
Taxes
Taxes are taken from taxTotal standard field.
No comments to display
No comments to display