APPROVED ANSWER
replied on February 26, 2021
Oh, I didn't realize that you were using Javascript.
It may be possible that your formula isn't recognizing that all of your subtotals have been updated at the end of your sumtotal() function.
You could try updating your script to tell it that the subtotalcol1 (2, 3, 4) fields were changes after you update their values. Something like this (after line 29):
$('.subtotalcol1 input').trigger('change');
$('.subtotalcol2 input').trigger('change');
$('.subtotalcol3 input').trigger('change');
$('.subtotalcol4 input').trigger('change');
Alternately, you should be able to do those subtotals from the table using formulas instead of Javascript - I'm happy to help with that if you'd like.