law-common 11.0.1-beta.1 → 11.0.1-beta.2

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.
@@ -77,6 +77,8 @@ export declare class ClientEntityModel extends BaseEntityModel<EntityEnum.CLIENT
77
77
  get addressLineTwo(): string;
78
78
  get city(): string;
79
79
  get state(): string;
80
+ get creditNoteTransactions(): import("./billing-transaction.model").BillingTransactionEntityModel[];
81
+ get adjustedCreditNoteTransactions(): import("./billing-transaction.model").BillingTransactionEntityModel[];
80
82
  get totalCreditNoteAmount(): number;
81
83
  get totalCreditNoteAmountAdjusted(): number;
82
84
  get totalCreditNoteAmountPendingForAdjustment(): number;
@@ -1,9 +1,9 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.ClientEntityModel = void 0;
4
+ const utils_1 = require("../../utils");
4
5
  const code_util_1 = require("../../utils/code.util");
5
6
  const document_validate_util_1 = require("../../utils/document-validate.util");
6
- const utils_1 = require("../../utils");
7
7
  const relation_type_enum_1 = require("../enums/relation-type.enum");
8
8
  const entity_utils_interface_1 = require("../interface/entity.utils.interface");
9
9
  const base_entity_model_1 = require("./base.entity.model");
@@ -105,10 +105,14 @@ class ClientEntityModel extends base_entity_model_1.BaseEntityModel {
105
105
  var _a, _b;
106
106
  return (_b = (_a = this.parsedAddress) === null || _a === void 0 ? void 0 : _a.state) !== null && _b !== void 0 ? _b : "";
107
107
  }
108
+ get creditNoteTransactions() {
109
+ return this.projects.flatMap((project) => { var _a; return (_a = project.settledBillings) !== null && _a !== void 0 ? _a : []; }).flatMap((billing) => { var _a; return (_a = billing.creditNoteTransactions) !== null && _a !== void 0 ? _a : []; });
110
+ }
111
+ get adjustedCreditNoteTransactions() {
112
+ return this.projects.flatMap((project) => { var _a; return (_a = project.settledBillings) !== null && _a !== void 0 ? _a : []; }).flatMap((billing) => { var _a; return (_a = billing.adjustedCreditNoteTransactions) !== null && _a !== void 0 ? _a : []; });
113
+ }
108
114
  get totalCreditNoteAmount() {
109
- const creditNoteTransactions = this.projects
110
- .flatMap((project) => { var _a; return (_a = project.settledBillings) !== null && _a !== void 0 ? _a : []; })
111
- .flatMap((billing) => { var _a; return (_a = billing.creditNoteTransactions) !== null && _a !== void 0 ? _a : []; });
115
+ const creditNoteTransactions = this.projects.flatMap((project) => { var _a; return (_a = project.settledBillings) !== null && _a !== void 0 ? _a : []; }).flatMap((billing) => { var _a; return (_a = billing.creditNoteTransactions) !== null && _a !== void 0 ? _a : []; });
112
116
  return (0, utils_1.sumNormalised)(creditNoteTransactions, "amount");
113
117
  }
114
118
  get totalCreditNoteAmountAdjusted() {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "law-common",
3
- "version": "11.0.1-beta.1",
3
+ "version": "11.0.1-beta.2",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "files": [