RE: Disable button from code
You didn't tell what you want to happen in that situation. Do you want to enable the button if at least one line has value > 0? Or do you want to enable only if all lines have value > 0?
My code already shows how to get the value for one transfer order line. And my example shows hot to enable/disable a button via code.
Once you have clarified this new requirement, I'm pretty sure you should be able to write code to achieve the desired functionality by applying what you have learned so far.
Of course if your logic is not anymore related to exactly one line, it should not be in the active method of the line table. Maybe active method of the header table would be correct.