Fix error double toDate and log error before breaking loop

This commit is contained in:
Schoumi 2018-11-19 15:41:30 +01:00
vecāks 73b9cba35e
revīzija 1a7c3128fa
1 mainīti faili ar 1 papildinājumiem un 1 dzēšanām

Parādīt failu

@ -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
}