0
I am making a sales system in which 1 sale generates 12 installments for 3 users, being the seller, the manager and the supervisor, I would like to know the best method for storing these installments.
It would create 1 table for each user and when making the sale generate the 36 rows, a cronjob which would generate the instalments each month or so?
It is a system for about 100 users.
It is a little confused, can explain better? After all, it is 12 installments or 36? Anyway, creating a table per user is a bad idea, create a table only with a column indicating which is the user.
– bfavaretto
@bfavaretto are 3 types of users being them (seller, manager and supervisor) each sale generates 12 installments for each 1 of them with different values. for example: 1 seller makes a sale, from this sale 1.7% is the seller’s commission, 0.3% is the supervisor’s commission and 1.5 is the manager’s commission. and if this sale is by indication of some customer has more customer’s commission
– Kelvin Primo
@Kelvinprimo this is two different things, user type has to be a table "type" with id in user table:
tipo_id
or so. after each user id has to be in the sales table:usuario_id
– Jorge B.