scheduler-node-models 1.0.49 → 1.0.51

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.
@@ -1,6 +1,7 @@
1
1
  import { Style, Worksheet } from "exceljs";
2
- export interface Formula {
2
+ export declare class Formula {
3
3
  formula: string;
4
+ constructor(formula: string);
4
5
  }
5
6
  export declare class Report {
6
7
  getCellID(col: string | number, row: number): string;
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,13 @@ class Report {
38
45
  if (numFmt && numFmt !== '') {
39
46
  sheet.getCell(begin).numFmt = numFmt;
40
47
  }
41
- sheet.getCell(begin).value = value;
48
+ if (value instanceof Formula) {
49
+ console.log('Formula');
50
+ sheet.getCell(begin).value = { formula: value.formula };
51
+ }
52
+ else {
53
+ sheet.getCell(begin).value = value;
54
+ }
42
55
  }
43
56
  getDateString(date) {
44
57
  const months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "scheduler-node-models",
3
- "version": "1.0.49",
3
+ "version": "1.0.51",
4
4
  "main": "./index.js",
5
5
  "types": "./index.d.ts",
6
6
  "files": [
@@ -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 iformula = { 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, iformula);
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
  }