I'm trying to design a system that aggregates transaction amounts recorded in units of both weight and volume.
Obviously, showing the total weight in kilograms of things you have individually weighed in pounds is simple (just multiply by a conversion rate), but it's not easy to show the weight in kilograms of something you've measured in gallons... (unless it's water or another common substance).
How can I allow users to track amounts in both weight and volume, and show accurate totals? Are there any applications that have solved this elegantly?
Any suggestions are welcome! :)
Our agriculture application lets users track inventory of an arbitrary number of "resources"--chemicals, fertilizers, grain, etc. We're trying to make record keeping lightweight and simple, but our customers run businesses that require powerful, flexible record keeping.
- Users can add resources to our system, giving them a name (ie, "Fertilizer-X", "RoundUp", "blue corn") and attributes (ie "organic: yes", or "EPA number: 1234")
- When users record a transaction, they specify which resource was moved, the amount, and the unit (ie, "purchased 1000 lbs of Fertilizer-X", or "used 300 gallons of SuperFertilizer")
- In reports, a user can see usage statistics for these "resources" in aggregate (ie, not just "purchased 1000 lbs of Fertilizer-X yesterday", but also "total amount of Fertilizer-X used this year")
Ideas so far
- When adding a resource, require users to choose weight or volume as the method of measurement. This would be permanent and uneditable, as changing it would break our ability to calculate totals.
- When adding a resource, require users to specify a permanent volume-to-weight conversion rate. Again, this would be permanent, as changing the method would prevent us from calculating inventory amounts.
- When adding a resource, require users to choose weight or volume as the method of measurement but allow users to change from weight to volume (or vice versa) at some later date as long as they provide a conversion rate when they do so (and have the system convert all their old data).
- When adding a resource, require users to choose weight or volume as the method of measurement or a conversion rate. If they want to change the rate later, let them. If they want to change the method of measurement, require a conversion rate.
Even worse ideas :-)
- Research and hard-code weight/volume conversion relationships for hundreds (thousands?) of substances and only allow users to choose from our list. They could then record amounts in any unit. (Not feasible.)
- Research and hard-code which unit type (weight or volume) each substance should use--again, for hundreds (thousands?) of possible substances--and only allow users to choose from our list. They could only record amounts in weight or volume, whichever we mandate for each substance. (Not feasible.)
- System-wide, only allow users to record amounts in weight, or in volume (not good enough for our industry, not helpful to our users).
- For each type of resource (ie fertilizer, pesticide), only allow users to record amounts in weight, or in volume (still not good enough for our users).
- Don't show aggregate values for things that have mixed unit types (a technical challange, and rather useless to users--not to mention confusing).