Bug in purchasing/includes/db/invoice_db.inc gives error. Fixed.