MultiShip


How to create a Multiship order in backend

Step 1: In backend; navigate to `Orders`. Click `New Orders`. Choose a customer

image.png

Step 2: Click button `Switch to Multiship`

Then click `Add Products` and add a few products to the order.
Then click `Add Recipient` to add a new shipping address:

image.png

Step 3: Add shipping addresses

In the popup the add new recipient, choose an existing address; or add new address. Click Get Shipping Methods And Rates and confirm the shipping method. When done, click `Save Recipient`.
After adding a new recipient, choose quantities for each products. When done, click button `Update Recipients and Items`. And choose a payment method

image.png

Step 3b: Upload recipients
Admin can also upload recipients using a csv file. Click button Upload Recipients

image.png

Then choose a csv file from your computer; and click `Add Recipients`
Note that upload recipients will wipe out all existing QAs.



Click `Submit Order` to create the order.

Confirm the order is created, and its status should be `New`. In the `Orders` grid; the column `Multiship` is Yes

image.png

DEV Create MS in BE

Dev note: Backend create MS order

Button `Update Recipients and Items` : Frans/MultiShip/view/adminhtml/templates/order/create/multiship/shipping_assignments.phtml

$block->getButtonHtml(__('Update Recipients and Items'), 'order.updateQuoteAddressItems(),order.itemsUpdate()',

Click handler is located at Frans/MultiShip/view/adminhtml/web/js/order/create/scripts-multiship.js, function updateQuoteAddressItems

 

Upload Recipients:
Most logics and validations are in `app/code/Frans/MultiShip/Controller/Adminhtml/Shipment/UploadRecipients.php`

 

How to create Credit Memo per specific shipping address

In Magento, a Creditmemo can be assigned to a specific shipping address. This guide shows how we perform credit memo per shipping address.

1/ Create a MS order. For example, create a MS order has 2 quote addresses (QA)

2/ Ship the two QA. Print the label. Click button `Daily Ship and Capture` to generate the invoice

3/ Now that the MS order is invoiced, go to BE MS order. Each shipped quote address should have a `Credit Memo` button:

image.png

4/ Click the button `Credit Memo` to create a new credit memo for QA 5591:

image.png

Verify that the New Memo page shows the correct shipment # and Quote Address number

5/ Verify Qty and Subtotal of items:

 

 

image.png

Only items and Qty of the selected QA 5591 is shown. Click button `Refund Offline` to create Credit Memo.

6/ Verify that the Order now does reflect the refunded Qty and Amount:

image.png

 

7/ When all shipments of the order have been refunded, the order is automatically closed.



Front end Multiship

To enable Multiship in FrontEnd, first we need to enable it in config:

Under Frans' Module , Multiship, Enable Front End Multiship, select Enable:

image.png

Click `Save Config`.



During Front-End checkout, log in, and button `Ship to Multiple Addresses` will be shown:

image.png


Multi-ship front end checkout will be shown:

image.png

Cron job to create partial invoice and send email of MS orders

First of all, configure cron schedule in Config --> Frans --> MultiShip --> Cron Settings

image.png


Then execute ./bin/magento cron:run
Make sure table `cron_schedule` has rows with job_code='multiship_shipment_email_cron'

Each cron execution will create logging rows into table `frans_ship_email_log` 

_____

To debug the cron:

1/ Sql to find shipments not invoiced:

SELECT *,shipment_status from sales_shipment
where invoice_id IS NULL AND ms_email_sent_at IS NULL AND created_at > date_sub(now(),INTERVAL 3 day)
and shipment_status in (4,11)