Forum Discussion

erhan_79's avatar
erhan_79
Post Prodigy
5 years ago
Solved

Matchig Order and Stock

Hi There ;

 

i need your kind support to create below column ;

 

i have a table named "Table A " as below which shows  order numbers , materials and quantities 

 

 and other table named " Table B " which shows stock quantities that  have based on material ;

 

 

and i would like to create as yellow marked a matched ( or distrubuted) quantites from stock to orders. I mean i am trying to match stock quantities with order quatities.Ssytem will distrubute the stock quantities to order quantities.Rules will be like that ;

 

  • First order has the priority , 
  • when there is no enough stock quantity system will give only the available stock quantity .
  • as you see for material A : total order quatity is 300 ad total stock quantity is 300 too.So matched all of them .But for material B : order quantitiy 1000 but stock quantity is 950 so Order 3 is the latest order , so system gave 50 qty minus to order3 material B 

 

 

 

1 Reply