Help with javascript,

hello I need to create an automation as per attached scheme.

Total 3 schemes: primary key “id booking”
A> Reservations
B> Note for cash flow
C> note for selling services

In the “Reservations” scheme, the “welded” check field must have a “true” value, if the total value of “B” “money flow” is equal to or greater than the total “selling service”

Hi,
I am not sure, if that can be done by “java script”. We use it for changing values/visibility, while entering data in form. However your case seems to be a little different. Because the value of “welded” can be changed even if item in another schema changes. Is it correct?
Michal