hi , i am developing an application for pharmacies and small
Pharmaceutical companies , the situation is :
the pharmacy can buy a specific medicine ("Cetal" for example with item_id "1") from a store with different expiry dates (2016 and 2017 i.e.) .
so , my stock table (item_detail) has these columns
( patch_no , item_id , qty , expiry_date ) -- for example .
the "patch_no" column is for distinguishing the same medicine , for example
insert into item_detail values
(1 , 1 , 50 , '10/10/2016) ;
insert into item_detail values
(2 , 1 , 50 , '10/10/2016) ;
first problem , in any application , when a pharmacy buy medicines , there is a "purchase invoice " , which should insert the medicine automatically into the stock table(item_detail) .
which means that there will be "2" records for the same medicine(cetal) in the "purchase invoice " , which i think it is not a normal thing .
another section of this problem is the user has to write the "discount" and "bonus" in each record for the same medicine , and may be there 3 rows not 2 .
second problem is about " sales invoice " , when the pharmaceutical company sells a medicine with different batches ,
the same thing will happen , may be i can store the invoice with 2 rows for the same medicine , but the report printed will only have the sum(quantity) group by item_id , but writing the discount and bonus problem still exists , and another problem is i
do not have a proof that i sold him 2 different patches , because the buyer has an invoice which is different from the one i have , he have the sum(quantity) , without expiry dates .
i think this is enough for one post .
thank you so much
- talking about " sales invoice "