Also,
the Detail is missing:
if (item.quantity.value) {
calc_track(item);
}
etc...
which will re-calc the Amount, but it will not adjust the Total!
Also,
when adjusting the Quantity on Tracks/Details, the InvoiceTable Form will error with:
TypeError: item.master.taxrate is undefined
This is also not adjusting the Totals ON the InvoiceTable or on that particular Detail.

TypeError: item.master.taxrate is undefined

This can be seen on:
https://jampy.pythonanywhere.com/
Maybe the solution is to make a Detail read only?
Still, the OK button is missing on Invoices.
Thanks