Creating user-defined units of measurement..
Posted: Mon Aug 26, 2002 3:16 pm
I'm developing a food costing application. My client just came to me with one little add on and I'm curious as to how to build it.
The entire application is a food costing application which all 5 of the restaurants in this company will access.
The little add on is the ability to write thier own custom conversions for units of measurement.
When the user inputs a recipe they choose various ingredients, the unit of measure and the amount of the ingredient.
Example:
Now they want to be able to define a unit of measure that relates specificaly to an ingredient, however, they want to be able to use the same name multiple times.
So in one case "slice" might equate to 0.5 ounces American Cheese, whereas in another case 'slice" might equate to 6.0 ounce roast beef 1/4 inch thick.
I've sketched out a possible DB schema for this feature which looks like:
Tables
units
i_id
u_name
u_description
equivalence
eq_id
u1_id
u2_id
mulltiplier
So a possible entry might look like:
Thus showing ( I think ) that :
1 schmear is equal to 2Oz: u1 * Multiplier == u2
Am i making any sense here?
Any input would be appreciated
The entire application is a food costing application which all 5 of the restaurants in this company will access.
The little add on is the ability to write thier own custom conversions for units of measurement.
When the user inputs a recipe they choose various ingredients, the unit of measure and the amount of the ingredient.
Example:
Code: Select all
Amount Unit Ingredient
8 ounce ground beefSo in one case "slice" might equate to 0.5 ounces American Cheese, whereas in another case 'slice" might equate to 6.0 ounce roast beef 1/4 inch thick.
I've sketched out a possible DB schema for this feature which looks like:
Tables
units
i_id
u_name
u_description
equivalence
eq_id
u1_id
u2_id
mulltiplier
So a possible entry might look like:
Code: Select all
Table units
u_id u_name u_description
001 schmear dollop applied by knife-like utensil
002 Oz One ounce
Table equivalence
eq_id u1_id u2_id multiplier
001 001 002 21 schmear is equal to 2Oz: u1 * Multiplier == u2
Am i making any sense here?
Any input would be appreciated