Add Qty and Show in the another field

The problem with this code is that whenever we input value, save the previous value. Lets understand with example, Data is present in all fields ( field1= 1 ), ( field2= 0 ) , ( field3= 4 ), When we input value in the field, the previous value in it is returned. If the ( field1= 1 ) or I did ( 1 to 10 ) so it automatically takes ( 1 ). If the ( field2= 0 ) or I did ( 0 to 5) so it automatically takes 0.

I have attached a video below for better understanding. :point_down:

Test-SAL-ORD-2024-00001-GoogleChrome2024-04-0912-55-30-ezgif.com-video-to-gif-converter

Is there any solution to this problem?
If anyone knows, please help.
Thank you.