Fixed simialr bug to 1259 for invoices