Simplifying the invoices javascript, and layout, and making use of the duplicatable functions