can you please elaborate system count, if I am not wrong this is your book stock ?
if my understanding is correct then before counting you had 20 pc in storage location 2010
Now through some custom code you managed to enter 15 pc in storage location 2010 and 5 pc in storage location 2020 , when you are pressing the stock adjustment system showing all the stock in storage location 2010 whereas your expectation is 15 pc in 2010 and 5 pc in 2020 storage location
For me it looks like your custom code is not working properly or it is not designed to consider that scenario. Few more thing to take into consideration
1) PID is for a storage bin and you cannot have two storage location stock at the same time in same bin(not as per standard warehouse practice)
2) you mentioned about serial number which is not in WM and it is only at IM level