Fix error double toDate and log error before breaking loop

This commit is contained in:
Schoumi 2018-11-19 15:41:30 +01:00
父節點 73b9cba35e
當前提交 1a7c3128fa
共有 1 個文件被更改,包括 1 次插入1 次删除

查看文件

@ -179,6 +179,7 @@ async function getAllDeclaration(params, declarationList) {
accData.lastSaved = declarationList[i]
this.saveAccountData(accData, { merge: false })
} catch (error) {
log('error',error)
break
}
}
@ -243,7 +244,6 @@ async function getDeclaration(params, periode) {
}
let year = 2000 + Math.floor(periode / 100)
bill.filename = '' + year + '-' + month + '.pdf'
bill.date = bill.date.toDate()
bill.filestream = await buildDeclarationPDF(data, periode)
return bill
}