Module: Cancellations adjustments

Executive summary

In most ERP systems, the sales transactions and other movements are stored in a way that new data are only being added into database and are never deleted. If there is a movement of a sale of 10 pieces and later it is cancelled, in ERP system data there is an information of -10 pcs movement and then another information of +10 pcs movement (cancellation and return of the goods). For a better forecast of future sales, STOCK needs “cleaned” sales, which means sales cleaned from cancellations. We need only the amount of pieces that was actually sold and was not cancelled or returned.

Functional description

The following description is valid for version 2 of the module Cleaning cancellations. There are 2 ways to clean cancellations:

  1. Cleaning based on relations between movement ID and cancellation ID, that is needed for import into SIDI from data in ERP systems. Warning: this functionality is in progress and unfinished.
  2. Automatic cleaning, when STOCK searches and finds which cancellation is cleaning which movement, based on SIDI settings. This way it is not necessary to have the exact relation between a movement and cancellation. The following description is only dealing with the second cleaning type (automatic cleaning). The automatic cleaning is done in several phases:
  1. For proper cleaning to work, the value of cancellation and value of movement must be exactly the same (in MU) and at the same time there has to be the same customer in the movement as well as in the cancellation.
  2. In the next phase it is enough, if the movement and cancellation values are the same. This means, that a sale to the customer X may be cleaned by a cancellation from the customer Y. Or sale to the customer X may be cleaned by a cancellation from an undefined customer.
  3. Only the customer has to be the same. In this case it is possible, that form example a sale of 10 pieces is cleaned by a cancellation of 2 pieces and thus the final value of the sale will be 8 pieces.
  4. There is not the same value or the customer’s name.

Note: the functionality for preference of matching values or matching prices is in progress, but unfinished.

It is always necessary, that the product is the same and the warehouse/store is the same. It is not possible to clean a movement of one product with a cancellation of another product. In each mentioned phase, the cleaning works according to this algorithm:

The algorithm

All movements are checked, from the oldest ones to the newest ones, and for every movement we search for a cancellation that happened later than the movement. The movement will then be decreased by this cancellation. A newer cancellation has priority. Cancellation size in MU doesn’t have to be the same as the movement size (only valid for cleaning phases 3 and 4, see above). If the cancellation is lower, only a part of a movement is cleaned. If the cancellation is higher, all movement is cleaned and the rest of cancellation remains for potential cleaning of another movement. Example: if the cancellation on -20 pieces and the movement is 15 pcs, we clean all movement of 15 pcs, cancellation is decreased to -5 pcs and may be used to clean another movement.

Configuration:

Cancellation cleaning may be configured in SIDI. It is possible to switch it off (default settings is “on”) and it is also possible to set movement types, that should be cleaned (default settings is only cleaning of sales and forecast inputs). Furthermore, maximal time difference between a movement and cancellation may be set, default settings is 365 days. If a cancellation happens later than 365 days after the movement is created, it will not be cleaned. Examples of cancellations that will not be used to clean any movements based on the rules above: (currently undergoing further development).