builds invoice item and invoice relationships