Add set_total_advance_paid, change UI, fix JS