Relate Data for inventory

-1

Good afternoon I have a problem when it comes to relating data in mysql for a system that I am developing, the doubt that I have is that the company that I am working with buys its products wholesale, and sells them in the same way , but I'm looking for a way to enter the products in different levels, for example purchase: -Purchase 1 Box of Pencils containing 20 Boxes and Each box contains 12 pens, in this purchase we observed 3 levels Another example would be when buying medical pills -Buy 1 Box and each box has 20 boxes and each box has 12 blister packs and each blister 12 pads in this we see 4 levels At the time of the sale, it would be necessary to be able to make these different forms either by unit, blister, box or box. The problems I have is how to model the database knowing that we can have different levels of purchase according to the presentation you buy

    
asked by Mr. SYS 26.09.2018 в 20:34
source

2 answers

0

I think you could make a table that feed a teacher from a field I explain Example: The fields would be these:

Id | nombreproducto | padreproducto|
1     pastillas                           0
2     aspirinas 1×24                1
3     antigripales                     1
4     1 caja lapicero                0
5     20 cajitas                        4
6      caja12lapiceros            5

This would be the way to fill them where id would be the correlate of the table "fatherproduct" would be as it says its name the father id to which the product belongs ...

I think I could serve you ....

Greetings

    
answered by 27.09.2018 / 01:27
source
0

Well the products that are acquired are stored with their unit of measurement and description, accompanied by a code that differentiates them, and you can store code - description - unit of measure - price, quantity, etc.

  

00001 - aspirin 150 mg. Blister 1 x 24 - blister - $ 2.00,1000
  00002   - Aspirin 200 mg. Blister 1 x 18 - blister - $ 3.00, 3000
  00003 - metric tape 6m - unit - $ 5.00, 400

The previous example reflects that you have aspirin of various types, they are counted by blisters and the case of the metric tapes, they are counted by units.

It is a very simple example for you to have an idea of how you can organize your data, but it will depend to a great extent on the information that your company wants to store.

    
answered by 26.09.2018 в 20:58