fix generate invoice