fixing doc.invoice when db is empty