Fixed a bug in create invoice.