Sales Order and Reserve Transactions


When the order is received, the stocks are reserved according to the order. Reserved operation and running functions.

Function

Clarification

Tables or Columns

check_reserved_rows()

It edits the line reservation types depending on the reservation option on the basis of the document in the order. The order stage has been closed in the line and all lines except the over delivery stage are set as reserved.

This function is triggered where the "Reserve Inventory" checkbox and the saveFrom() function are used.

If the session has a spect_type while registering the order and it is equal to 5 and the product is not deleted, it saves the selected stock_row rows for the stock Spec to be reserved in the STOCKS_ROW_RESERVED table.

RESERVE_TYPE field in ORDER_ROW Table


Adding to the table STOCKS_ROW_RESERVED

add_reserve_row()

Updates the reserved information and line stages in the order.

It creates the waybill-invoice link of the order. If there is an order drawn from the invoices to the waybill, when the waybill is cancelled, deleting the connection with the order that was sent to the waybill and updating the order line stages are also done in the add_reserve_row function.

  1. CANCELLATION WAYBILL : If the waybill is cancelled, if there is an order drawn on the waybill; Waybill-order links are broken, order line stages and reservation types are updated.

  2. Even though it is drawn on the waybill, if not reserved is selected in the order line, the reserved type will not be changed, the reserved stages of the orders with CHANGE_RESERVE_STATUS 0, that is, in the no_change_order_list list, are not changed either. The non-receipt line that makes the stock movement preserves the reserved type in the order

  3. In Add and Update Transactions, if even a single line is reserved or partially reserved, reservation is selected on a document basis. In deletion and cancellation transactions, partially reserved and closed reserved lines will be updated as reserved below, so they should be selected as reserved on document basis.

  4. According to the total amount drawn to the waybills, the order stage is updated, and the reserve type is updated depending on the amount that makes the stock movement. (ORDER_ROW table)

  5. If there is no waybill on which the order is drawn, the underdelivery, closed and overdelivery stages are re-shipped, closed and missing reserved lines are updated as reserved.

  6. The IS_PROCESSED value is formed in the ORDERS table by checking the waybill and invoice associated with the order, and it is set to 1 if the RESERVED field is true if the paper_general_reserve_type is true. In other words, if even one line is reserved or partially reserved in addition and updating, it is selected as reserved on the basis of document and this field (RESERVED ="reserve stock") is always marked.

ORDER_ROW_RESERVED

When the delivery note issued;

If there is an order drawn on the waybill, it sends the is_order_process value as 1 to the add_reserve_row function, and orders that will not change the row reserves for which these transactions are updated, although they are related to the order and invoice. If the id values are added to the list, then the order is sent to the waybill, the line stages of the order are updated. If it is called on the waybill update or deletion page, the orders_ship records of that waybill are deleted first.

1. Waybill should not be in the list of interrupted orders

2.It must not have been called in the cancellation or deletion process

3- If it was called in the update process, it should not be in the list of orders that will not be changed

because the orders_ship records of these orders are not deleted in the update. The product quantities of the order are taken and the reserved types and quantities are calculated according to the values returned from this query. If it is called from the waybill, the order_id order_wrk_row_id ship_id and period_id fields are filled into the order_row_reserved table. The order link in the waybill lines is kept in the wrk_row_relation_id field.
If the inventory status list stock_id spect_id and the product is being reserved by sending quantities, values are not retrieved from order_row if the reserve is not the decoding process, it is retrieved in the order_row_reserved table. From this table;

1. the max. Reserve amount is determined

2. The amount to be canceled is added to the amount to be resolved or reserved. If the reserve amount is greater than the max.reserve amount, it gives a warning "You have exceeded the maximum reserved amount".

3.If the reserve amount value is greater than zero, values are assigned to the order_row_reserved table, which retrieves the values here and updates the order_row reserve_type fields, reserve_order_id the value of the reserve_type in that table, and updates the reserved field in the orders table.

Order Stage
Reserve Type
-1 Open, -2 Supply, -3 Closed, -4 Partial Production, -5 Production, -6 Shipment, -7 Underdelivery, -8 Overdelivery, -9 Canceled, -10 Closed(Manual)
-1 reserved, -2 partially reserved, -3 not reserved, -4 reserved
The order stage (order_currency) is based on the total quantity shipped.
reserve_type is calculated according to the quantities in the waybills that make stock movements. The reserve_type of the order lines is determined as a result of comparing the amount value of the order with the reserved amount value.
If the order amount is equal to the delivery note amount ---> Closed
if big ---> Missing Delivery
if it is small ---> It will be taken to the Overdelivery stage
If the order amount is less than the reserved amount ---> Reserved Closed
if greater ---> Partially Reserved
if there is none, that is, if it is 0 ----> It is updated as Not Reserved
If the order stage is -3, -7, -8 and the order amount value is greater than the waybill amount, the order stage is taken to the Dispatch-Delivery stage.
If the reserved type of the order is Not Reserved and the Order stage is Closed (Manual) and Canceled, the reserved type of the order is not changed, the order is what it is. Even if it is drawn on the waybill, if not reserved is selected in the order line, the reservation type is not changed.

If there is no waybill for the order, incomplete delivery, closed and overdelivery stages are re-shipped, closed and missing reserved lines are updated as reserved.

Feedback

Did you find this content helpful?