fix invoice number computing