Outgoing Documents
In this article, you will learn how to export and process outgoing documents between Business Central to Pulpo WMS.
Four types of outgoing documents are supported:
- Sales Order
- Purchase Return Order
- Transfer Order
- Warehouse Shipment
Sales Order
Sales Orders with Pulpo WMS location in header can’t have any other location in document lines. This ensures that all orders and its lines go to the correct warehouse.
Once exported Sales Order can't be deleted or manually posted for shipment in Business Central. Reopening and editing document is possible until Pulpo WMS starts working on this order.
Mandatory fields for export of Sales Order:
- Sell-to Customer No.
- Location Code (Pulpo WMS Location)
- Shipment Date
- Priority
- Ship-to Address details
- Inventory Item Lines
- No.
- Quantity
- Line No.
Note
It's recommended that "Default Qty. to Ship" is set to Blank in "Sales & Receivables Setup"
Purchase Return Order
In case that returning of goods to vendors is needed, Purchase Return Orders are used. Export of Purchase Return Orders for Pulpo WMS location is done as a sales/outgoing document with type=return and list of items and quantities that we expect to be shipped back to vendor.
Once exported Purchase Return Order can't be deleted or manually posted for shipment in Business Central. Reopening and editing document is possible until Pulpo WMS starts working on this order.
Mandatory fields for export of Purchase Return Order:
- Buy-from Vendor No.
- Location Code (Pulpo WMS Location)
- Expected Receipt Date
- Priority
- Ship-to details
- Inventory Item Lines
- No.
- Quantity
- Line No.
Note
It's recommended that "Default Qty. to Receive" is set to Blank in "Purchase & Payables Setup"
Transfer Order
If we want to transfer items from one Pulpo WMS location to another, we can do that with Transfer Order in Business Central. Both from and to locations must be Pulpo WMS locations. Direct transfer isn't supported in this case.
When exporting Transfer Order to Pulpo WMS it acts like outgoing document in source warehouse (type=warehouse_movement). Mandatory fields for export of Transfer Order:
- From Location Code
- To Location Code
- Shipment Date
- Priority
- Item Lines
- No.
- Quantity
- Line No.
Reception part of Transfer Order isn’t exported from Business Central to Pulpo WMS. warehouse_movement incoming document will be created automatically in destination warehouse in Pulpo WMS after shipment from source warehouse is done. Process in Business Central is then like in other incoming documents.
Warehouse Shipment
Warehouse Shipment is used in combination with Location setup "Require Shipment" and "Export Document Type" from Setup is Shipment. Warehouse Shipment should be created per order in Business Central.
Only Warehouse Shipments created from Sales Order, Purchase Return Order or Transfer Order can be exported to Pulpo WMS. Change of status in Warehouse Shipment, updates status in connected order.
Same rules in export apply as for above order types.
Export
Two ways of exports are supported:
- Batch export: export of all released, not yet exported outgoing documents
- Single export: export of single incoming document via action on order page
Batch exports are done to POST /sales/bulk/orders Pulpo WMS API, while single export is done to POST /sales/orders API. When document is successfully exported, Pulpo WMS ID is saved in header tables. If document is already exported, update can be done by calling PUT /sales/orders/%1 Pulpo WMS API.
After each API call is done, new entry is saved in Request Log table with type Sales Document, Purchase Return Document or Transfer Document. In case of errors or incomplete data, result will be saved in this log.
Statuses
Possible statuses of outgoing documents:
- Sent: document is successfully exported and it's in status Queue in Pulpo WMS. During this status it’s possible to edit document and send update to Pulpo WMS via action on pages.
- Picking: order has been added to the picking list in Pulpo WMS. No further editing is allowed on this order.
- Packing: picking of items from order have been finished in Pulpo WMS.
- Partially Shipped: warehouse employee in Pulpo WMS app has finished processing this document, but not all items from document have been shipped.
- Shipped: warehouse employee in Pulpo WMS app has finished processing this document and all items from document have been shipped.
- Canceled: document has been canceled from Pulpo WMS. Cancel can be done directly in Pulpo WMS or in Business Central via action on order pages.
Webhooks
When outgoing document is being processed in Pulpo WMS app, we need to know that in Business Central. For that Pulpo WMS webhooks used are:
picking_order_createdpicking_order_deletedpicking_order_finishedsales_order_cancelledsales_order_finished
Picking Order Created
When outgoing document is added to the new picking list in Pulpo WMS, picking_order_created webhook message is sent to Business Central via Azure Service Bus. Picking list can contain items from one or multiple outgoing documents.
Webhook Message is saved to Pulpo WMS Webhook Message table and from there is parsed and saved to Pulpo WMS Movement table. Document Type of webhook message is either sales_order, return or warehouse_movement. Movement Lines contain list of items added to picking list.
After Movement Line is inserted, if there are no errors:
- Status of outgoing document in Business Central is changed to Picking
Picking Order Deleted
When picking list is deleted in Pulpo WMS, picking_order_deleted webhook message is sent to Business Central via Azure Service Bus.
Webhook Message is saved to Pulpo WMS Webhook Message table and from there is parsed and saved to Pulpo WMS Movement table. Movement Lines contain list of items which were in picking list.
After Movement Line is inserted, if there are no errors:
- Status of outgoing document in Business Central is changed to Sent
Picking Order Finished
When picking is finished in Pulpo WMS, picking_order_finished webhook message is sent to Business Central via Azure Service Bus.
Webhook Message is saved to Pulpo WMS Webhook Message table and from there is parsed and saved to Pulpo WMS Movement table. Movement Lines contain list of picked items, quantities and order numbers.
After Movement Line is inserted, if there are no errors:
- Status of outgoing document is changed to Packing
- Qty. to Ship in document line is updated to Quantity from webhook message
Sales Order Canceled
When outgoing document is cancelled in Pulpo WMS, sales_order_cancelled webhook message is sent to Business Central via Azure Service Bus.
Webhook Message is saved to Pulpo WMS Webhook Message table and from there is parsed and saved to Pulpo WMS Closing table. Processing of new Closing without errors is done via job queue:
- Status of document is changed to Canceled
- Closing is marked as processed
Sales Order Finished
After items from document are packed and prepared for shipping in Pulpo WMS, sales_order_finished webhook message is sent to Business Central via Azure Service Bus.
Webhook Message is saved to Pulpo WMS Webhook Message table and from there is parsed and saved to Pulpo WMS Closing table. Closing Lines contain list of all shipped items and quantities.
Processing of new Closing without errors is done via job queue:
- Outgoing document is posted (for shipment)
- Status is changed to Partially Shipped or Shipped
- Closing is marked as processed