i create daily stock distribution order and want to distribute a value (warehouse stock) based on 2 different values(pharmacy stock & pharmacy sales).
For example, my stock in warehouse is 20 units and in a pharmacy the stock for same item is 10 units but the sales of that item in that pharmacy for 2 months is only 2 units. so in this scenario i have no need to send anymore stock to that pharmacy.
another example, my stock in warehouse is 100 units and in a pharmacy the stock is 5 units but the sales is 30 units. so now i have to dispatch some quantity to fulfill the sales need.
what i want is to distribute my warehouse stock based on the sales of the pharmacy but not exceeding the sales or the stock of the pharmacy.
For example, my stock in warehouse is 20 units and in a pharmacy the stock for same item is 10 units but the sales of that item in that pharmacy for 2 months is only 2 units. so in this scenario i have no need to send anymore stock to that pharmacy.
another example, my stock in warehouse is 100 units and in a pharmacy the stock is 5 units but the sales is 30 units. so now i have to dispatch some quantity to fulfill the sales need.
what i want is to distribute my warehouse stock based on the sales of the pharmacy but not exceeding the sales or the stock of the pharmacy.