@tomei/finance 0.6.99 → 0.6.100
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
package/src/document/document.ts
CHANGED
|
@@ -262,9 +262,12 @@ export default class Document extends AccountSystemEntity {
|
|
|
262
262
|
* @returns {void}
|
|
263
263
|
*/
|
|
264
264
|
async reCalculateAmount(): Promise<void> {
|
|
265
|
+
const roundToTwoDecimals = (value: number): number =>
|
|
266
|
+
Math.round(value * 100) / 100;
|
|
267
|
+
|
|
265
268
|
this.Amount = 0;
|
|
266
269
|
for (const documentItem of this._DocumentItems) {
|
|
267
|
-
this.Amount
|
|
270
|
+
this.Amount = roundToTwoDecimals(this.Amount + documentItem.Amount);
|
|
268
271
|
}
|
|
269
272
|
}
|
|
270
273
|
|