当前位置:网站首页>Model problems of stock in and stock out and inventory system

Model problems of stock in and stock out and inventory system

2022-04-23 17:14:00 ZHZHK001

My current idea is :


Scheme 1 ,1 Tables : Only stock in / stock out table
No inventory table , Inventory data is calculated in real time according to receipt / issue
The disadvantage is that there are a lot of stock in and stock out data , The amount of real-time inventory query data will be larger and larger
There are also problems with scheme 2


Option two ,2 Tables : An inventory statement + Warehouse in and out table , In and out of the warehouse ,2 Data update of two tables at the same time
There is no problem when the stock in record is added
The problem is :
The issue record is added ( In particular, add the previous delivery record )、
Out of stock 、 Modification and deletion of warehousing records
These circumstances will affect the rationality of all subsequent records , The amount of data processing is large
such as
A library 2022-02-10 Enter into 100
A library 2022-02-11 Enter into 10 When deleting , Next 2 This piece of data is invalid , Enter into 10 Change to in 6 ,2-13 Out 15 It doesn't work
A library 2022-02-12 Out 105
A library 2022-02-13 Out 15


Option three , Scheme 2 upgrade
2 Tables : An inventory statement + Warehouse in and out table , In and out of the warehouse ,2 Data update of two tables at the same time
Issue / receipt records can only be added but not deleted 、 Change ,【 Notes of receipt / issue records can be changed 】
If there is a problem , Add a record for today , Hedge against previous data
such as 2022-02-14【 today 】 Find out 2022-02-13A There are too many entries in the warehouse 100 individual
So the way to deal with it is :
2022-02-14【 today 】 Add a record 2022-02-14 A Warehouse out 100 individual Type selection hedging

The delivery process
Inventory query whether there is enough stock out ,
yes , An inventory statement update, Warehouse in and out table insert
no , Cancel operation
remarks : The quantity of record lines in the inventory table may be... During delivery 0

Warehousing process
An inventory statement A library B Whether the material has inventory records
yes , An inventory statement UPDAGE, Warehouse in and out table insert
all , An inventory statement insert, Warehouse in and out table insert


Option four , Scheme I upgrade
Issue / receipt records can only be added but not deleted 、 Change ,【 Notes of receipt / issue records can be changed 】
If there is a problem , Add a record for today , Hedge against previous data
such as 2022-02-14【 today 】 Find out 2022-02-13A There are too many entries in the warehouse 100 individual
So the way to deal with it is :
2022-02-14【 today 】 Add a record 2022-02-14 A Warehouse out 100 individual Type selection hedging

I don't know what other better model
At present, I personally prefer to use the model of scheme 3 , If anyone has a better model , Please advise


The data table structure is :
An inventory statement
id
Warehouse id
materiel id
Number
remarks
The creator
Creation time
Reviser
Modification time

Warehouse in and out table
id
fromid
toid
materiel id
Number
remarks
type 【 Out of stock 、 Put in storage 、 hedging 】
The creator
Creation time
Reviser
Modification time
Other fields such as order number

版权声明
本文为[ZHZHK001]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204230553251144.html