Most Powerful Open Source ERP

Merging Deliveries

Description of the merge method.
  • Last Update:2016-05-16
  • Version:001
  • Language:en

Description of the merge method.

Table of Contents

The merge method description:

merge(delivery_list)

context: main_delivery – has to be included in the delivery_list too

returns: newly created merged delivery

functionality:

  • does sanity checks (check if deliveries have the same portal type, etc.) – if fail return an error
  • check existence of simulation movements
  • if no simulation movements:
    • create a temporary applied rule
    • add temporary simulation movements based on delivery lines
    • do merge by using the builder on a main delivery
  • if simulation movements exists:
    • in case of deliveries without orders:
      • move movements to main delivery's applied rule
      • rebuild with delivery builder
    • in case of deliveries with orders:
      • group chosen movements into the main delivery group
      • rebuild with delivery builder
  • cancel old deliveries

Related Articles