jigneshpshah / greycube_helpmanual

Greycube Projects Help Manual
https://greycube.in
MIT License
9 stars 10 forks source link

Stock Reservation at Sales Order Level #6

Open jigneshpshah opened 5 years ago

jigneshpshah commented 5 years ago

Use Case : In certain sales channels , stock reservation is required when Sales Order is booked, the items needs to be delivered from the reserved stock.

Overall Design : In Company doctype create field “Reservation Warehouse” (Warehouse Link field) , which will be more like a virtual warehouse.

Whenever Reservation is to be done, do a background stock transfer for the quantity of the items from the actual stock warehouse ( with specific batch/serial if applicable ) to “Reservation Warehouse”.

When the Sales Order gets cancelled , the linked Stock Entry ( Material Transfer) also gets cancelled.

Tasks List

Overall Reservation Design Flow

stock reservation

jigneshpshah commented 5 years ago

Company Doctype

Add new field

Field Name - Default Reservation Warehouse Field Type - Link Option - Warehouse Default Value = Blank

jigneshpshah commented 5 years ago

Selling Settings

Add Field Allow Stock Reservation on Sales Order Field Type - checkbox Default value - 0 Description =To use reservation feature, ensure to set Default Reservation Warehouse in the Company

jigneshpshah commented 5 years ago

Sales Order & Stock Entry Doctype

Add Field to Sales Order

Reserve Stock Field Type = Checkbox Default Value = 0 Hidden = 1 If in Selling Settings > Allow Stock Reservation on Stock is checked.( true). make the Reserve Stock field visible and with default value =1.

Add Field to Sales Order Item Serial No Small Text Batch No Link

On Sales Order Submit If Reserve Stock is checked true Validate = If Default Reservation Warehouse is set for the company selected in the transaction ? If yes proceed further, else validate submit to false , with message "To enable reservation of stock on quotation, kindly set default reservation warehouse in the company doctype"

Step 1.

Add field Stock Entry Doctype Sales Order No Link Sales Order

Create Stock Entry purpose = "Material Transfer" Posting Date = Sales Order transaction_date Posting Time = Now Stock Entry Items Source Warehouse = "Delivery Warehouse" from Sales Order Item Target Warehouse = "Reservation Warehouse" Quantity = qty basic_rate = Valuation Rate basic_amount = qty x basic_rate stock_uom = stock_uom uom = uom conversion_uom = conversion_uom transfer_qty = qty retain_sample = 0 serial_no = serial_no batch_no = batch_no Difference Account = Default company Stock Adjustment Account cost_center = Default Company Cost Center

On Sales Order Cancellation On cancellation of quotation , cancel linked stock entry.