Home > Back-end >  HI, the problem of data table, please directly.
HI, the problem of data table, please directly.

Time:04-13

My database is designed so that the inventory table has two, one is put in storage table, 2 is put in storage historical records, example: residual have 12 pieces of this product, warehouse the same day with a 10 products, warehousing 22 products in total table, in the day of the history list 10 product inventory records, N days later I found 10 things I input the wrong information, I just out of the three pieces I modify the history table inventory data directly, warehousing, always watch how can keep the original data? Total inventory should be 15, the library history record is modified to 3. This, in addition to preserve the original data in multiple fields, there is no other better solutions to this problem? Ask everybody to give directions, thank you!

CodePudding user response:

Is this your business knowledge don't understand the problem, involving warehouse, financial management is very strict, first of all, will not be able to directly modify the data, the right should be:
1, the data entry (but not truly effective);
At this time of audit (2, the data of data will only be effective, and should not be able to modify);
3, need to modify the data in the form of red imitation (fill in a new negative data), or obsolete way (just as invalid identification data, do not delete);
4, usually a stronger presence just statistics, by the end of the month at the end of an inventory (checkout) should be done after the monthly data summary record,
.

Well, estimates that you do is not a formal business system,
Your problem is, you have to modify, you have changed the two tables of data at the same time, if you want to keep the previous data, in addition to increasing record contents, there is no way to a log (including your data is modified to increase the record)

CodePudding user response:

The building Lord do business not familiar, in fact, all kinds of management software, generally do not have what difficulty on the technology, is familiar with the business process, all related to money, things, are not allowed to modify the original data, can only be amended by strike a balance, if feel free to tamper with the original data, such a system is made by hand and reliable, and digital, paper documents are not allowed to alter, destroy, accounting regulation of accounting voucher is kept for 15 years