POS价格更新和库存管理 [英] POS price updation and stock managemnt

查看:87
本文介绍了POS价格更新和库存管理的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发POS和库存管理Web应用程序,并且在更新价目表时遇到了问题。



当价格发生变化时一个产品。我想更新数据库中的价格,但这个价格变化不得影响商店中已经存在的相同产品的旧库存,我正在寻找处理此问题的逻辑。



如何用更新的价格区分旧库存和新库存。



请帮我解决这个问题。



在此先感谢。



我的尝试:



产品的版本控制,但是在生成销售报告时会遇到麻烦,如果产品价格经常变化会很烦人

I am working on a POS and Inventory Management Web Application and am facing an issue in updating the price list.

When there is a change in the price of a product. I want to update the price in the database but this price change must not affect the old stock of the same product already in the store am looking for a logic to handle this.

How can i differentiate the old stock and the new stock with the updated price.

Please help me in solving this issue.

Thanks In Advance.

What I have tried:

versioning for the product but it makes trouble while generating the sales reports and also it will be annoying if a price of a product changes frequently

推荐答案

日期时间是关键。使用价格更新的数据时间和库存到货的数据时间。

数据库中的每个产品都有一个唯一的ID或代码,比如product_id,每个产品应该只有一个id。至于保存价格变化的记录,你需要一张表格来说明price_change以保持这3条信息的最小值:

Date time is the key here. Use the data time of price update and that of stock arrival.
Every product in your database will have a unique id or code, say product_id, every product should have only one id. As for keeping records of price change, you will need a table say price_change to keep min these 3 pieces of information:
product_id, datetime, price



每个价格变化都应作为新记录插入此表格。

如果您不希望每次插入都有另一个ID,您可以使用product_id + datetime根据到货日期时间识别每个价格变化和特定批次的库存。


Every price change should be inserted into this table as a new record.
If you do not want to have another id for every insertion, you can use the combination of the product_id + datetime to identify each price change and a particular batch of stock based on its arrival date time.


这篇关于POS价格更新和库存管理的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆