Can't insert coded field into collection

You just needed to put your #inputRevenueItemTotalAmount text box on your page as .text as it is the input in that box is of text type string.

//From this....
$w('#inputRevenueItemTotalAmount').value...
//To this....
$w('#inputRevenueItemTotalAmount').text... 

Then this line of code probably would have worked as you are inputting a number value using toString which will convert it to a text type string, of which your text box on the page uses and not number value.

$w('#inputRevenueItemTotalAmount').text = total.toString();