scheduler-node-models 1.0.49 → 1.0.50
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/general/report.d.ts
CHANGED
package/general/report.js
CHANGED
@@ -1,6 +1,13 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.Report = void 0;
|
3
|
+
exports.Report = exports.Formula = void 0;
|
4
|
+
class Formula {
|
5
|
+
formula = "";
|
6
|
+
constructor(formula) {
|
7
|
+
this.formula = formula;
|
8
|
+
}
|
9
|
+
}
|
10
|
+
exports.Formula = Formula;
|
4
11
|
class Report {
|
5
12
|
getCellID(col, row) {
|
6
13
|
if (typeof col === 'string') {
|
@@ -38,7 +45,12 @@ class Report {
|
|
38
45
|
if (numFmt && numFmt !== '') {
|
39
46
|
sheet.getCell(begin).numFmt = numFmt;
|
40
47
|
}
|
41
|
-
|
48
|
+
if (value instanceof Formula) {
|
49
|
+
sheet.getCell(begin).value = { formula: value.formula };
|
50
|
+
}
|
51
|
+
else {
|
52
|
+
sheet.getCell(begin).value = value;
|
53
|
+
}
|
42
54
|
}
|
43
55
|
getDateString(date) {
|
44
56
|
const months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep',
|
package/package.json
CHANGED
@@ -421,9 +421,9 @@ class ChargeStatusReport extends general_1.Report {
|
|
421
421
|
cell.style = style;
|
422
422
|
cell.value = { formula: formula };
|
423
423
|
style.numFmt = this.numformats.get('pct');
|
424
|
-
const
|
425
|
-
|
426
|
-
this.setCell(sheet, this.getCellID(11, row), this.getCellID(11, row), style,
|
424
|
+
const oformula = new general_1.Formula(`IFERROR(${this.getCellID(5, row)}/`
|
425
|
+
+ `${this.getCellID(3, row)},"N/A")`);
|
426
|
+
this.setCell(sheet, this.getCellID(11, row), this.getCellID(11, row), style, oformula);
|
427
427
|
}
|
428
428
|
}
|
429
429
|
}
|