One,
I think this problem can be inspired from Microsoft's field types about currency. Microsoft's currency fields actually and numbers are the value of numerical conversion in accordance with the currency in different countries.
You see, no matter what way, it is seen as a property, but this property value can be different, and can be used to transform according to different parameters.
1 Save all units with a table (whether it is a denomination or metered, or other units)
2 Use a table to save the conversion relationship between different units (if necessary, can it be basically determined by a global constant?)
3 Then use a function to get it, where you need a different data, you will pass different parameters.
The benefits of doing this are very versatility, good maintenance, good extension.
two,
Too many solutions:
Create a "unit conversion form", one of which is the main count unit, and other units are converted to the conversion rate of the unit.
Establish a "Variety Archive" to save "Purchasing Main Total Unit", "Production Main Metrology Unit", "BOM Main Time Taste Unit", and the document of each module is used to carry out the library or used units.
Operate according to the conversion relationship when doing account statistics and queries.
When the user wants to do inquiry, the system can automatically follow this department, and then convert the unit to the department
After the corresponding main meter unit, it will be operated and displayed.
three,
Metering unit: at least support sales, production metering, best purchase, mainly to see what you have; sometimes the same as measurement unit is different, such as: two needles, first 1 box = 10 Two 1 box = 5; this measurement unit is converted into the material number into the material number; and the conversion relationship cannot be changed casually, otherwise the account is correct.
four,
1. You can pop up a drop-down box when the user is input, such as entering a "plus", and then the beginning of "plus", then "LaC", put all "Canada", For users to choose. This is also convenient to users.
2, the raw material number can make a string, how to define it, as long as it is not repeated. However, don't use the raw material number as a keyword, uniqueness is not sufficient condition of keywords, but also have invariance. For example, your system has been used for a while, in the stock, crafts and other tables, using raw materials numbers, suddenly users feel that the existing number system is not good, I want to change it, you will have a headache. Even if it is not a big change, the usual increase is deleted, if you don't pay attention, you will make a lot of problems. For example, usually numbers are always in order, and when the user removes a raw material, when the new raw material is added, the originally deleted number may be used, but if the warehouse is also removed, there is such a raw material in the warehouse when the raw material number is originally deleted. Your program is negligent, did not check, then you are dead now, and this error makes you can't touch your hair. Therefore, the raw material has to have a system number, which is an internal water number, which is not visible to the user. This is the keyword.
5. You can support different units. And can also be converted to each other between the units! Each material has a basic unit, and the rest may be a conversion unit or auxiliary unit, each conversion unit or auxiliary unit has a conversion ratio with the base unit. But one thing is that you must pay attention to the information deal with inventory, cost, etc. should be calculated using the basic unit, otherwise I haven't known the wrong thing. Regarding the issue of units is also a problem that is more difficult to handle. Some users have requested freedom of conversion of units after they have opened a single, which is what you said. However, I still have any big problems in dealing with these problems, because if your database is designed, these problems are still better. Sixth, I don't think your customers are ignorant. The system I have made is that the material code is 20, the material name is 30, and the material specification is 30. It is the same as your customer's request (not they used to use the company's products); and also support multi-unit , The measurement unit and the pricing unit can be different. Our approach is to have 3 units in the material table. One of these three units is the basic unit, and the other two is the conversion unit, and the conversion rate is defined between the converter unit and the basic unit (the conversion rate also includes fixed The distinction between the conversion rate and the change rate), including two units in the inventory system: basic unit (small unit) and one converter (large unit). For example, the material A can define his basic unit in the inventory system is 'only', the converting unit is 'box', in the definition of their conversion rate: 10 / box, so in stock, you can discharge Send X box y only, without converting only to do it; other systems can also support two units, one as a basic unit (unity and basic units of stocks), the other is the conversion unit. For example, in the procurement system, the pricing unit of the purchase of material A is 'box', the priced large unit can be 'box', 10 boxes / box. When purchasing, you can use N box M box to purchase, payment according to the number of boxes, the definition of the sales system is also the same.