@ironcode/vas-lib 3.0.0-alpha.2 → 3.0.0-alpha.5
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/cjs/lib/control-value/vas-camera-control-value.model.d.ts +4 -2
- package/cjs/lib/control-value/vas-camera-control-value.model.d.ts.map +1 -1
- package/cjs/lib/control-value/vas-camera-control-value.model.js.map +1 -1
- package/cjs/lib/entity/vas-base.model.d.ts +1 -1
- package/cjs/lib/entity/vas-base.model.d.ts.map +1 -1
- package/cjs/lib/entity/vas-base.model.js.map +1 -1
- package/cjs/lib/entity/vas-field.dto.d.ts +3 -4
- package/cjs/lib/entity/vas-field.dto.d.ts.map +1 -1
- package/cjs/lib/entity/vas-field.dto.js.map +1 -1
- package/cjs/lib/entity/vas-field.model.js +1 -1
- package/cjs/lib/entity/vas-field.model.js.map +1 -1
- package/cjs/lib/entity/vas-form.model.d.ts +1 -1
- package/cjs/lib/entity/vas-form.model.d.ts.map +1 -1
- package/cjs/lib/entity/vas-form.model.js.map +1 -1
- package/cjs/lib/entity/vas-job-copy.d.ts +12 -12
- package/cjs/lib/entity/vas-job-copy.d.ts.map +1 -1
- package/cjs/lib/entity/vas-job-copy.js.map +1 -1
- package/cjs/lib/entity/vas-job.dto.d.ts +9 -3
- package/cjs/lib/entity/vas-job.dto.d.ts.map +1 -1
- package/cjs/lib/entity/vas-job.dto.js.map +1 -1
- package/cjs/lib/entity/vas-job.model.d.ts +25 -13
- package/cjs/lib/entity/vas-job.model.d.ts.map +1 -1
- package/cjs/lib/entity/vas-job.model.js +139 -90
- package/cjs/lib/entity/vas-job.model.js.map +1 -1
- package/cjs/lib/model/estimate-control/estimate-control-value.dto.d.ts +14 -0
- package/cjs/lib/model/estimate-control/estimate-control-value.dto.d.ts.map +1 -0
- package/cjs/lib/model/estimate-control/estimate-control-value.dto.js +3 -0
- package/cjs/lib/model/estimate-control/estimate-control-value.dto.js.map +1 -0
- package/cjs/lib/model/estimate-control/estimate-control-value.model.d.ts +11 -0
- package/cjs/lib/model/estimate-control/estimate-control-value.model.d.ts.map +1 -0
- package/cjs/lib/model/estimate-control/estimate-control-value.model.js +84 -0
- package/cjs/lib/model/estimate-control/estimate-control-value.model.js.map +1 -0
- package/cjs/lib/model/estimate-control/estimate-item.dto.d.ts +16 -0
- package/cjs/lib/model/estimate-control/estimate-item.dto.d.ts.map +1 -0
- package/cjs/lib/model/estimate-control/estimate-item.dto.js +3 -0
- package/cjs/lib/model/estimate-control/estimate-item.dto.js.map +1 -0
- package/cjs/lib/model/estimate-control/estimate-item.model.d.ts +24 -0
- package/cjs/lib/model/estimate-control/estimate-item.model.d.ts.map +1 -0
- package/cjs/lib/model/estimate-control/estimate-item.model.js +121 -0
- package/cjs/lib/model/estimate-control/estimate-item.model.js.map +1 -0
- package/cjs/lib/model/estimate-control/estimate.dto.d.ts +37 -0
- package/cjs/lib/model/estimate-control/estimate.dto.d.ts.map +1 -0
- package/cjs/lib/model/estimate-control/estimate.dto.js +3 -0
- package/cjs/lib/model/estimate-control/estimate.dto.js.map +1 -0
- package/cjs/lib/model/estimate-control/estimate.model.d.ts +55 -0
- package/cjs/lib/model/estimate-control/estimate.model.d.ts.map +1 -0
- package/cjs/lib/model/estimate-control/estimate.model.js +265 -0
- package/cjs/lib/model/estimate-control/estimate.model.js.map +1 -0
- package/cjs/lib/model/estimate-control/estimate.types.d.ts +3 -0
- package/cjs/lib/model/estimate-control/estimate.types.d.ts.map +1 -0
- package/cjs/lib/model/estimate-control/estimate.types.js +3 -0
- package/cjs/lib/model/estimate-control/estimate.types.js.map +1 -0
- package/cjs/lib/model/estimate-control/index.d.ts +8 -0
- package/cjs/lib/model/estimate-control/index.d.ts.map +1 -0
- package/cjs/lib/model/estimate-control/index.js +11 -0
- package/cjs/lib/model/estimate-control/index.js.map +1 -0
- package/cjs/lib/model/index.d.ts +2 -0
- package/cjs/lib/model/index.d.ts.map +1 -1
- package/cjs/lib/model/index.js +2 -0
- package/cjs/lib/model/index.js.map +1 -1
- package/cjs/lib/model/report-invocation.d.ts +40 -0
- package/cjs/lib/model/report-invocation.d.ts.map +1 -0
- package/cjs/lib/model/report-invocation.js +3 -0
- package/cjs/lib/model/report-invocation.js.map +1 -0
- package/cjs/lib/utils/get-value-by-path.d.ts +5 -15
- package/cjs/lib/utils/get-value-by-path.d.ts.map +1 -1
- package/cjs/lib/utils/get-value-by-path.js +48 -59
- package/cjs/lib/utils/get-value-by-path.js.map +1 -1
- package/cjs/lib/utils/index.d.ts +8 -0
- package/cjs/lib/utils/index.d.ts.map +1 -0
- package/cjs/lib/utils/index.js +11 -0
- package/cjs/lib/utils/index.js.map +1 -0
- package/cjs/lib/utils/is-array-string.d.ts +3 -0
- package/cjs/lib/utils/is-array-string.d.ts.map +1 -1
- package/cjs/lib/utils/is-array-string.js +3 -0
- package/cjs/lib/utils/is-array-string.js.map +1 -1
- package/cjs/lib/utils/is-numeric.d.ts +2 -0
- package/cjs/lib/utils/is-numeric.d.ts.map +1 -0
- package/cjs/lib/utils/is-numeric.js +10 -0
- package/cjs/lib/utils/is-numeric.js.map +1 -0
- package/cjs/lib/utils/is-plain-object.d.ts +3 -0
- package/cjs/lib/utils/is-plain-object.d.ts.map +1 -1
- package/cjs/lib/utils/is-plain-object.js +3 -0
- package/cjs/lib/utils/is-plain-object.js.map +1 -1
- package/cjs/lib/utils/try-json.d.ts +2 -2
- package/cjs/lib/utils/try-json.js +2 -2
- package/cjs/lib/utils/try-json.js.map +1 -1
- package/cjs/public-api.d.ts +1 -0
- package/cjs/public-api.d.ts.map +1 -1
- package/cjs/public-api.js +1 -0
- package/cjs/public-api.js.map +1 -1
- package/fesm2022/ironcode-vas-lib.mjs +694 -154
- package/fesm2022/ironcode-vas-lib.mjs.map +1 -1
- package/lib/control-value/vas-camera-control-value.model.d.ts +4 -2
- package/lib/entity/vas-base.model.d.ts +1 -1
- package/lib/entity/vas-field.dto.d.ts +3 -4
- package/lib/entity/vas-form.model.d.ts +1 -1
- package/lib/entity/vas-job-copy.d.ts +12 -12
- package/lib/entity/vas-job.dto.d.ts +9 -3
- package/lib/entity/vas-job.model.d.ts +25 -13
- package/lib/model/estimate-control/estimate-control-value.dto.d.ts +13 -0
- package/lib/model/estimate-control/estimate-control-value.model.d.ts +10 -0
- package/lib/model/estimate-control/estimate-item.dto.d.ts +15 -0
- package/lib/model/estimate-control/estimate-item.model.d.ts +23 -0
- package/lib/model/estimate-control/estimate.dto.d.ts +36 -0
- package/lib/model/estimate-control/estimate.model.d.ts +54 -0
- package/lib/model/estimate-control/estimate.types.d.ts +2 -0
- package/lib/model/estimate-control/index.d.ts +7 -0
- package/lib/model/index.d.ts +2 -0
- package/lib/model/report-invocation.d.ts +39 -0
- package/lib/utils/get-value-by-path.d.ts +5 -15
- package/lib/utils/index.d.ts +7 -0
- package/lib/utils/is-array-string.d.ts +4 -0
- package/lib/utils/is-numeric.d.ts +1 -0
- package/lib/utils/is-plain-object.d.ts +3 -0
- package/lib/utils/omit.d.ts +7 -0
- package/lib/utils/try-json.d.ts +2 -2
- package/package.json +3 -2
- package/public-api.d.ts +1 -0
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.EstimateItemModel = void 0;
|
|
4
|
+
const big_js_1 = require("big.js");
|
|
5
|
+
const uuid_1 = require("uuid");
|
|
6
|
+
const b = (value = '0') => {
|
|
7
|
+
try {
|
|
8
|
+
if (typeof value === 'string') {
|
|
9
|
+
return new big_js_1.Big(value.replace(/[^\d^.]/g, ''));
|
|
10
|
+
}
|
|
11
|
+
return new big_js_1.Big(value);
|
|
12
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
13
|
+
}
|
|
14
|
+
catch (e) {
|
|
15
|
+
console.error(`failed to construct Big from value '${value}'`);
|
|
16
|
+
return new big_js_1.Big('0');
|
|
17
|
+
}
|
|
18
|
+
};
|
|
19
|
+
class EstimateItemModel {
|
|
20
|
+
constructor(id, description, type, quantity, quantityAdjusted, units, unitsAdjusted, price, priceAdjusted, workCategory, costCategory, comment) {
|
|
21
|
+
this.id = id;
|
|
22
|
+
this.description = description;
|
|
23
|
+
this.type = type;
|
|
24
|
+
this.quantity = quantity;
|
|
25
|
+
this.quantityAdjusted = quantityAdjusted;
|
|
26
|
+
this.units = units;
|
|
27
|
+
this.unitsAdjusted = unitsAdjusted;
|
|
28
|
+
this.price = price;
|
|
29
|
+
this.priceAdjusted = priceAdjusted;
|
|
30
|
+
this.workCategory = workCategory;
|
|
31
|
+
this.costCategory = costCategory;
|
|
32
|
+
this.comment = comment;
|
|
33
|
+
}
|
|
34
|
+
getTotalUnits(adjusted = false) {
|
|
35
|
+
return adjusted ?
|
|
36
|
+
b(this.quantityAdjusted || '0').mul(this.unitsAdjusted || '0').toFixed(2) :
|
|
37
|
+
b(this.quantity || '0').mul(this.units || '0').toFixed(2);
|
|
38
|
+
}
|
|
39
|
+
getLineValue(labourRate = '1', timeBasis = '1', adjusted = false) {
|
|
40
|
+
const cat = this.costCategory || 'none';
|
|
41
|
+
if (this.workCategory === 'removed') {
|
|
42
|
+
return '0';
|
|
43
|
+
}
|
|
44
|
+
const units = (adjusted ? this.unitsAdjusted : this.units) || 0;
|
|
45
|
+
const quantity = (adjusted ? this.quantityAdjusted : this.quantity) || 0;
|
|
46
|
+
const price = (adjusted ? this.priceAdjusted : this.price) || '';
|
|
47
|
+
try {
|
|
48
|
+
switch (cat) {
|
|
49
|
+
case 'labour': {
|
|
50
|
+
return price != '' ?
|
|
51
|
+
price :
|
|
52
|
+
b(quantity || '0')
|
|
53
|
+
.mul(units || '0')
|
|
54
|
+
.mul(labourRate || '0')
|
|
55
|
+
.div(timeBasis || '1')
|
|
56
|
+
.toFixed(2);
|
|
57
|
+
}
|
|
58
|
+
case 'pm': {
|
|
59
|
+
return b(price || '0')
|
|
60
|
+
.mul(quantity || '0')
|
|
61
|
+
.toFixed(2);
|
|
62
|
+
}
|
|
63
|
+
case 'parts': {
|
|
64
|
+
return b(price || '0')
|
|
65
|
+
.mul(quantity || '0')
|
|
66
|
+
.toFixed(2);
|
|
67
|
+
}
|
|
68
|
+
case 'specialist': {
|
|
69
|
+
return b(price || '0')
|
|
70
|
+
.mul(quantity || '0')
|
|
71
|
+
.toFixed(2);
|
|
72
|
+
}
|
|
73
|
+
default: {
|
|
74
|
+
return '0';
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
catch (e) {
|
|
79
|
+
console.warn(e);
|
|
80
|
+
}
|
|
81
|
+
return '0';
|
|
82
|
+
}
|
|
83
|
+
toDto() {
|
|
84
|
+
return {
|
|
85
|
+
id: this.id,
|
|
86
|
+
description: this.description,
|
|
87
|
+
type: this.type,
|
|
88
|
+
quantity: this.quantity,
|
|
89
|
+
quantityAdjusted: this.quantityAdjusted,
|
|
90
|
+
units: this.units,
|
|
91
|
+
unitsAdjusted: this.unitsAdjusted,
|
|
92
|
+
price: this.price,
|
|
93
|
+
priceAdjusted: this.priceAdjusted,
|
|
94
|
+
workCategory: this.workCategory,
|
|
95
|
+
costCategory: this.costCategory,
|
|
96
|
+
comment: this.comment
|
|
97
|
+
};
|
|
98
|
+
}
|
|
99
|
+
static create() {
|
|
100
|
+
return new EstimateItemModel((0, uuid_1.v4)(), '', '', 1, 1, 0, 0, '', '', 'none', 'none', '');
|
|
101
|
+
}
|
|
102
|
+
static fromDto(dto) {
|
|
103
|
+
return new EstimateItemModel(dto.id || (0, uuid_1.v4)(), dto.description || '', dto.type || '', dto.quantity || 0, dto.quantityAdjusted || 0, dto.units || 0, dto.unitsAdjusted || 0, dto.price || '', dto.priceAdjusted || '', dto.workCategory || 'none', dto.costCategory || 'none', dto.comment || '');
|
|
104
|
+
}
|
|
105
|
+
static equal(a, b) {
|
|
106
|
+
return ((a === null || a === void 0 ? void 0 : a.id) === (b === null || b === void 0 ? void 0 : b.id) &&
|
|
107
|
+
(a === null || a === void 0 ? void 0 : a.description) === (b === null || b === void 0 ? void 0 : b.description) &&
|
|
108
|
+
(a === null || a === void 0 ? void 0 : a.type) === (b === null || b === void 0 ? void 0 : b.type) &&
|
|
109
|
+
(a === null || a === void 0 ? void 0 : a.quantity) === (b === null || b === void 0 ? void 0 : b.quantity) &&
|
|
110
|
+
(a === null || a === void 0 ? void 0 : a.quantityAdjusted) === (b === null || b === void 0 ? void 0 : b.quantityAdjusted) &&
|
|
111
|
+
(a === null || a === void 0 ? void 0 : a.units) === (b === null || b === void 0 ? void 0 : b.units) &&
|
|
112
|
+
(a === null || a === void 0 ? void 0 : a.unitsAdjusted) === (b === null || b === void 0 ? void 0 : b.unitsAdjusted) &&
|
|
113
|
+
(a === null || a === void 0 ? void 0 : a.price) === (b === null || b === void 0 ? void 0 : b.price) &&
|
|
114
|
+
(a === null || a === void 0 ? void 0 : a.priceAdjusted) === (b === null || b === void 0 ? void 0 : b.priceAdjusted) &&
|
|
115
|
+
(a === null || a === void 0 ? void 0 : a.workCategory) === (b === null || b === void 0 ? void 0 : b.workCategory) &&
|
|
116
|
+
(a === null || a === void 0 ? void 0 : a.costCategory) === (b === null || b === void 0 ? void 0 : b.costCategory) &&
|
|
117
|
+
(a === null || a === void 0 ? void 0 : a.comment) === (b === null || b === void 0 ? void 0 : b.comment));
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
exports.EstimateItemModel = EstimateItemModel;
|
|
121
|
+
//# sourceMappingURL=estimate-item.model.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"estimate-item.model.js","sourceRoot":"","sources":["../../../../../../projects/vas-lib/src/lib/model/estimate-control/estimate-item.model.ts"],"names":[],"mappings":";;;AAAA,mCAA6B;AAE7B,+BAAkC;AAGlC,MAAM,CAAC,GAAG,CAAC,QAA+B,GAAG,EAAE,EAAE;IAC/C,IAAI,CAAC;QACH,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;YAC9B,OAAO,IAAI,YAAG,CAAC,KAAK,CA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AD,CAAC,CAAE,KAAK,OAAK,CAAC,aAAD,CAAC,uBAAD,CAAC,CAAE,KAAK,CAAA;YACrB,CAAA,CAAC,aAAD,CAAC,uBAAD,CAAC,CAAE,aAAa,OAAK,CAAC,aAAD,CAAC,uBAAD,CAAC,CAAE,aAAa,CAAA;YACrC,CAAA,CAAC,aAAD,CAAC,uBAAD,CAAC,CAAE,KAAK,OAAK,CAAC,aAAD,CAAC,uBAAD,CAAC,CAAE,KAAK,CAAA;YACrB,CAAA,CAAC,aAAD,CAAC,uBAAD,CAAC,CAAE,aAAa,OAAK,CAAC,aAAD,CAAC,uBAAD,CAAC,CAAE,aAAa,CAAA;YACrC,CAAA,CAAC,aAAD,CAAC,uBAAD,CAAC,CAAE,YAAY,OAAK,CAAC,aAAD,CAAC,uBAAD,CAAC,CAAE,YAAY,CAAA;YACnC,CAAA,CAAC,aAAD,CAAC,uBAAD,CAAC,CAAE,YAAY,OAAK,CAAC,aAAD,CAAC,uBAAD,CAAC,CAAE,YAAY,CAAA;YACnC,CAAA,CAAC,aAAD,CAAC,uBAAD,CAAC,CAAE,OAAO,OAAK,CAAC,aAAD,CAAC,uBAAD,CAAC,CAAE,OAAO,CAAA,CAC1B,CAAC;IACJ,CAAC;CAEF;AAlJD,8CAkJC","sourcesContent":["import { Big } from 'big.js';\nimport { EstimateItemDto } from './estimate-item.dto';\nimport { v4 as uuid } from 'uuid';\nimport { EstimateCostCategory, EstimateWorkCategory } from './estimate.types';\n\nconst b = (value: string | number | Big = '0') => {\n try {\n if (typeof value === 'string') {\n return new Big(value.replace(/[^\\d^.]/g, ''));\n }\n return new Big(value);\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n } catch (e) {\n console.error(`failed to construct Big from value '${value}'`);\n return new Big('0');\n }\n};\n\nexport class EstimateItemModel {\n\n constructor(\n public id: string,\n public description: string,\n public type: string,\n public quantity: number,\n public quantityAdjusted: number,\n public units: number,\n public unitsAdjusted: number,\n public price: string,\n public priceAdjusted: string,\n public workCategory: EstimateWorkCategory,\n public costCategory: EstimateCostCategory,\n public comment: string\n ) {\n }\n\n getTotalUnits(adjusted = false): string {\n return adjusted ?\n b(this.quantityAdjusted || '0').mul(this.unitsAdjusted || '0').toFixed(2) :\n b(this.quantity || '0').mul(this.units || '0').toFixed(2);\n }\n\n getLineValue(\n labourRate = '1',\n timeBasis = '1',\n adjusted = false\n ): string {\n const cat: EstimateCostCategory = this.costCategory || 'none';\n\n if (this.workCategory === 'removed') {\n return '0';\n }\n\n const units = (adjusted ? this.unitsAdjusted : this.units) || 0;\n const quantity = (adjusted ? this.quantityAdjusted : this.quantity) || 0;\n const price = (adjusted ? this.priceAdjusted : this.price) || '';\n\n try {\n switch (cat) {\n case 'labour': {\n return price != '' ?\n price :\n b(quantity || '0')\n .mul(units || '0')\n .mul(labourRate || '0')\n .div(timeBasis || '1')\n .toFixed(2);\n }\n case 'pm': {\n return b(price || '0')\n .mul(quantity || '0')\n .toFixed(2);\n }\n case 'parts': {\n return b(price || '0')\n .mul(quantity || '0')\n .toFixed(2);\n }\n case 'specialist': {\n return b(price || '0')\n .mul(quantity || '0')\n .toFixed(2);\n }\n default: {\n return '0';\n }\n }\n } catch (e) {\n console.warn(e);\n }\n return '0';\n }\n\n toDto(): EstimateItemDto {\n return {\n id: this.id,\n description: this.description,\n type: this.type,\n quantity: this.quantity,\n quantityAdjusted: this.quantityAdjusted,\n units: this.units,\n unitsAdjusted: this.unitsAdjusted,\n price: this.price,\n priceAdjusted: this.priceAdjusted,\n workCategory: this.workCategory,\n costCategory: this.costCategory,\n comment: this.comment\n };\n }\n\n static create(): EstimateItemModel {\n return new EstimateItemModel(\n uuid(),\n '',\n '',\n 1,\n 1,\n 0,\n 0,\n '',\n '',\n 'none',\n 'none',\n ''\n );\n }\n\n static fromDto(dto: Partial<EstimateItemDto>): EstimateItemModel {\n return new EstimateItemModel(\n dto.id || uuid(),\n dto.description || '',\n dto.type || '',\n dto.quantity || 0,\n dto.quantityAdjusted || 0,\n dto.units || 0,\n dto.unitsAdjusted || 0,\n dto.price || '',\n dto.priceAdjusted || '',\n dto.workCategory || 'none',\n dto.costCategory || 'none',\n dto.comment || ''\n );\n }\n\n static equal(\n a: EstimateItemDto | undefined,\n b: EstimateItemDto | undefined\n ): boolean {\n return (\n a?.id === b?.id &&\n a?.description === b?.description &&\n a?.type === b?.type &&\n a?.quantity === b?.quantity &&\n a?.quantityAdjusted === b?.quantityAdjusted &&\n a?.units === b?.units &&\n a?.unitsAdjusted === b?.unitsAdjusted &&\n a?.price === b?.price &&\n a?.priceAdjusted === b?.priceAdjusted &&\n a?.workCategory === b?.workCategory &&\n a?.costCategory === b?.costCategory &&\n a?.comment === b?.comment\n );\n }\n\n}\n"]}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { EstimateItemDto } from './estimate-item.dto';
|
|
2
|
+
import { EstimateSource, EstimateSundryMethod } from './estimate.model';
|
|
3
|
+
import { EstimateCostCategory } from './estimate.types';
|
|
4
|
+
export type CostCategorySummary = Record<EstimateCostCategory, string>;
|
|
5
|
+
export interface CostCategorySummaryTotals {
|
|
6
|
+
net: string;
|
|
7
|
+
vat: string;
|
|
8
|
+
gross: string;
|
|
9
|
+
hours: string;
|
|
10
|
+
labourRate: string;
|
|
11
|
+
}
|
|
12
|
+
export type EstimateSummaryDto = CostCategorySummary & CostCategorySummaryTotals;
|
|
13
|
+
export interface EstimateDto {
|
|
14
|
+
id: string;
|
|
15
|
+
source: EstimateSource;
|
|
16
|
+
label: string;
|
|
17
|
+
comment: string;
|
|
18
|
+
timestamp: string;
|
|
19
|
+
version: number;
|
|
20
|
+
net: string;
|
|
21
|
+
vat: string;
|
|
22
|
+
gross: string;
|
|
23
|
+
labourRate: string;
|
|
24
|
+
vatRate: string;
|
|
25
|
+
sundryRate: string;
|
|
26
|
+
sundryMax: string;
|
|
27
|
+
sundryFixed: string;
|
|
28
|
+
sundryMethod: EstimateSundryMethod;
|
|
29
|
+
partsDiscount: string;
|
|
30
|
+
paintDiscount: string;
|
|
31
|
+
timeBasis: string;
|
|
32
|
+
adjusted: boolean;
|
|
33
|
+
items: Array<EstimateItemDto>;
|
|
34
|
+
summary: EstimateSummaryDto;
|
|
35
|
+
summaryAdjusted: EstimateSummaryDto | null;
|
|
36
|
+
}
|
|
37
|
+
//# sourceMappingURL=estimate.dto.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"estimate.dto.d.ts","sourceRoot":"","sources":["../../../../../../projects/vas-lib/src/lib/model/estimate-control/estimate.dto.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AACtD,OAAO,EAAE,cAAc,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AACxE,OAAO,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AAExD,MAAM,MAAM,mBAAmB,GAAG,MAAM,CAAC,oBAAoB,EAAE,MAAM,CAAC,CAAC;AAEvE,MAAM,WAAW,yBAAyB;IACxC,GAAG,EAAE,MAAM,CAAC;IACZ,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,MAAM,kBAAkB,GAAG,mBAAmB,GAAG,yBAAyB,CAAC;AAEjF,MAAM,WAAW,WAAW;IAC1B,EAAE,EAAE,MAAM,CAAC;IACX,MAAM,EAAE,cAAc,CAAC;IACvB,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;IAChB,GAAG,EAAE,MAAM,CAAC;IACZ,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,EAAE,oBAAoB,CAAC;IACnC,aAAa,EAAE,MAAM,CAAC;IACtB,aAAa,EAAE,MAAM,CAAC;IACtB,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,OAAO,CAAC;IAClB,KAAK,EAAE,KAAK,CAAC,eAAe,CAAC,CAAC;IAC9B,OAAO,EAAE,kBAAkB,CAAC;IAC5B,eAAe,EAAE,kBAAkB,GAAG,IAAI,CAAC;CAC5C"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"estimate.dto.js","sourceRoot":"","sources":["../../../../../../projects/vas-lib/src/lib/model/estimate-control/estimate.dto.ts"],"names":[],"mappings":"","sourcesContent":["import { EstimateItemDto } from './estimate-item.dto';\nimport { EstimateSource, EstimateSundryMethod } from './estimate.model';\nimport { EstimateCostCategory } from './estimate.types';\n\nexport type CostCategorySummary = Record<EstimateCostCategory, string>;\n\nexport interface CostCategorySummaryTotals {\n net: string;\n vat: string;\n gross: string;\n hours: string;\n labourRate: string;\n}\n\nexport type EstimateSummaryDto = CostCategorySummary & CostCategorySummaryTotals;\n\nexport interface EstimateDto {\n id: string;\n source: EstimateSource;\n label: string;\n comment: string;\n timestamp: string;\n version: number;\n net: string;\n vat: string;\n gross: string;\n labourRate: string;\n vatRate: string;\n sundryRate: string;\n sundryMax: string;\n sundryFixed: string;\n sundryMethod: EstimateSundryMethod;\n partsDiscount: string;\n paintDiscount: string;\n timeBasis: string;\n adjusted: boolean;\n items: Array<EstimateItemDto>;\n summary: EstimateSummaryDto;\n summaryAdjusted: EstimateSummaryDto | null;\n}\n"]}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { EstimateItemModel } from './estimate-item.model';
|
|
2
|
+
import { EstimateDto, EstimateSummaryDto } from './estimate.dto';
|
|
3
|
+
import { EstimateItemDto } from './estimate-item.dto';
|
|
4
|
+
export declare type EstimateSundryMethod = 'percentage' | 'percentage-with-max' | 'fixed';
|
|
5
|
+
export declare type EstimateSource = 'audatex' | 'glassmatix' | 'manual' | 'ibody';
|
|
6
|
+
export declare class EstimateModel {
|
|
7
|
+
id: string;
|
|
8
|
+
source: EstimateSource;
|
|
9
|
+
label: string;
|
|
10
|
+
comment: string;
|
|
11
|
+
timestamp: string;
|
|
12
|
+
version: number;
|
|
13
|
+
net: string;
|
|
14
|
+
vat: string;
|
|
15
|
+
gross: string;
|
|
16
|
+
labourRate: string;
|
|
17
|
+
vatRate: string;
|
|
18
|
+
sundryRate: string;
|
|
19
|
+
sundryMax: string;
|
|
20
|
+
sundryFixed: string;
|
|
21
|
+
sundryMethod: EstimateSundryMethod;
|
|
22
|
+
partsDiscount: string;
|
|
23
|
+
paintDiscount: string;
|
|
24
|
+
timeBasis: string;
|
|
25
|
+
adjusted: boolean;
|
|
26
|
+
items: Array<EstimateItemModel>;
|
|
27
|
+
summaryNet: EstimateSummaryDto;
|
|
28
|
+
summary: EstimateSummaryDto;
|
|
29
|
+
summaryAdjusted: EstimateSummaryDto;
|
|
30
|
+
static create(source?: EstimateSource): EstimateModel;
|
|
31
|
+
static fromDto(dto: Partial<EstimateDto>): EstimateModel;
|
|
32
|
+
addItem(modelOrDto: EstimateItemModel | Partial<EstimateItemDto>, opts?: {
|
|
33
|
+
calculate?: boolean;
|
|
34
|
+
}): void;
|
|
35
|
+
addItems(items: Array<EstimateItemModel>, opts?: {
|
|
36
|
+
calculate?: boolean;
|
|
37
|
+
}): void;
|
|
38
|
+
calculate(): void;
|
|
39
|
+
/**
|
|
40
|
+
* Returns the net summary (before sundries and discounts) of the estimate.
|
|
41
|
+
* By summary, we mean grouping the costs by cost category.
|
|
42
|
+
*
|
|
43
|
+
* @param adjusted if the values should be calculated using the original or
|
|
44
|
+
* adjusted values
|
|
45
|
+
*/
|
|
46
|
+
getSummaryNet(adjusted?: boolean): EstimateSummaryDto;
|
|
47
|
+
/**
|
|
48
|
+
* Applies the sundry and discount values to the net summary.
|
|
49
|
+
|
|
50
|
+
*/
|
|
51
|
+
getSummary(summaryNet: EstimateDto['summary'], sundryRate: string, sundryMax: string, sundryFixed: string, sundryMethod: EstimateSundryMethod, partsDiscount: string, paintDiscount: string, adjusted: boolean): EstimateDto['summary'];
|
|
52
|
+
toDto(): EstimateDto;
|
|
53
|
+
getTotalHours(adjusted?: boolean): string;
|
|
54
|
+
}
|
|
55
|
+
//# sourceMappingURL=estimate.model.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"estimate.model.d.ts","sourceRoot":"","sources":["../../../../../../projects/vas-lib/src/lib/model/estimate-control/estimate.model.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAC1D,OAAO,EAAuB,WAAW,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AACtF,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAEtD,MAAM,CAAC,OAAO,MAAM,oBAAoB,GAAG,YAAY,GAAG,qBAAqB,GAAG,OAAO,CAAC;AAE1F,MAAM,CAAC,OAAO,MAAM,cAAc,GAAG,SAAS,GAAG,YAAY,GAAG,QAAQ,GAAG,OAAO,CAAC;AAenF,qBAAa,aAAa;IAEjB,EAAE,EAAE,MAAM,CAAU;IACpB,MAAM,EAAE,cAAc,CAAY;IAClC,KAAK,EAAE,MAAM,CAAM;IACnB,OAAO,EAAE,MAAM,CAAM;IACrB,SAAS,EAAE,MAAM,CAA0B;IAC3C,OAAO,EAAE,MAAM,CAAK;IACpB,GAAG,EAAE,MAAM,CAAU;IACrB,GAAG,EAAE,MAAM,CAAU;IACrB,KAAK,EAAE,MAAM,CAAU;IACvB,UAAU,EAAE,MAAM,CAAO;IACzB,OAAO,EAAE,MAAM,CAAU;IACzB,UAAU,EAAE,MAAM,CAAU;IAC5B,SAAS,EAAE,MAAM,CAAU;IAC3B,WAAW,EAAE,MAAM,CAAU;IAC7B,YAAY,E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ateModel = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const big_js_1 = require("big.js");
|
|
6
|
+
const moment_1 = tslib_1.__importDefault(require("moment"));
|
|
7
|
+
const uuid_1 = require("uuid");
|
|
8
|
+
const estimate_item_model_1 = require("./estimate-item.model");
|
|
9
|
+
const b = (value = '0') => {
|
|
10
|
+
try {
|
|
11
|
+
if (typeof value === 'string') {
|
|
12
|
+
return new big_js_1.Big(value.replace(/[^\d^.]/g, ''));
|
|
13
|
+
}
|
|
14
|
+
return new big_js_1.Big(value);
|
|
15
|
+
}
|
|
16
|
+
catch (e) {
|
|
17
|
+
console.error(`failed to construct Big from value '${value}'`);
|
|
18
|
+
return new big_js_1.Big('0');
|
|
19
|
+
}
|
|
20
|
+
};
|
|
21
|
+
class EstimateModel {
|
|
22
|
+
constructor() {
|
|
23
|
+
this.id = (0, uuid_1.v4)();
|
|
24
|
+
this.source = 'manual';
|
|
25
|
+
this.label = '';
|
|
26
|
+
this.comment = '';
|
|
27
|
+
this.timestamp = (0, moment_1.default)().toISOString();
|
|
28
|
+
this.version = 1;
|
|
29
|
+
this.net = '0.00';
|
|
30
|
+
this.vat = '0.00';
|
|
31
|
+
this.gross = '0.00';
|
|
32
|
+
this.labourRate = '1';
|
|
33
|
+
this.vatRate = '0.00';
|
|
34
|
+
this.sundryRate = '0.00';
|
|
35
|
+
this.sundryMax = '0.00';
|
|
36
|
+
this.sundryFixed = '0.00';
|
|
37
|
+
this.sundryMethod = 'fixed';
|
|
38
|
+
this.partsDiscount = '0.00';
|
|
39
|
+
this.paintDiscount = '0.00';
|
|
40
|
+
this.timeBasis = '1';
|
|
41
|
+
this.adjusted = false;
|
|
42
|
+
this.items = [];
|
|
43
|
+
this.summaryNet = {
|
|
44
|
+
labour: '0.00',
|
|
45
|
+
none: '0.00',
|
|
46
|
+
parts: '0.00',
|
|
47
|
+
pm: '0.00',
|
|
48
|
+
pl: '0.00',
|
|
49
|
+
specialist: '0.00',
|
|
50
|
+
other: '0.00',
|
|
51
|
+
gross: '0.00',
|
|
52
|
+
net: '0.00',
|
|
53
|
+
hours: '0.00',
|
|
54
|
+
vat: '0.00',
|
|
55
|
+
labourRate: '0.00',
|
|
56
|
+
};
|
|
57
|
+
this.summary = {
|
|
58
|
+
labour: '0.00',
|
|
59
|
+
none: '0.00',
|
|
60
|
+
parts: '0.00',
|
|
61
|
+
pm: '0.00',
|
|
62
|
+
pl: '0.00',
|
|
63
|
+
specialist: '0.00',
|
|
64
|
+
other: '0.00',
|
|
65
|
+
gross: '0.00',
|
|
66
|
+
net: '0.00',
|
|
67
|
+
hours: '0.00',
|
|
68
|
+
vat: '0.00',
|
|
69
|
+
labourRate: '0.00',
|
|
70
|
+
};
|
|
71
|
+
this.summaryAdjusted = {
|
|
72
|
+
labour: '0.00',
|
|
73
|
+
none: '0.00',
|
|
74
|
+
parts: '0.00',
|
|
75
|
+
pm: '0.00',
|
|
76
|
+
pl: '0.00',
|
|
77
|
+
specialist: '0.00',
|
|
78
|
+
other: '0.00',
|
|
79
|
+
gross: '0.00',
|
|
80
|
+
net: '0.00',
|
|
81
|
+
hours: '0.00',
|
|
82
|
+
vat: '0.00',
|
|
83
|
+
labourRate: '0.00',
|
|
84
|
+
};
|
|
85
|
+
}
|
|
86
|
+
static create(source = 'manual') {
|
|
87
|
+
const model = new EstimateModel();
|
|
88
|
+
model.source = source;
|
|
89
|
+
return model;
|
|
90
|
+
}
|
|
91
|
+
static fromDto(dto) {
|
|
92
|
+
var _a;
|
|
93
|
+
const model = new EstimateModel();
|
|
94
|
+
Object.assign(model, Object.assign(Object.assign({}, dto), { items: (_a = dto.items) === null || _a === void 0 ? void 0 : _a.map(item => estimate_item_model_1.EstimateItemModel.fromDto(item)) }));
|
|
95
|
+
model.calculate();
|
|
96
|
+
return model;
|
|
97
|
+
}
|
|
98
|
+
addItem(modelOrDto, opts) {
|
|
99
|
+
this.items.push(modelOrDto instanceof estimate_item_model_1.EstimateItemModel ?
|
|
100
|
+
modelOrDto :
|
|
101
|
+
estimate_item_model_1.EstimateItemModel.fromDto(modelOrDto));
|
|
102
|
+
if (!opts || (opts && opts.calculate)) {
|
|
103
|
+
this.calculate();
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
addItems(items, opts) {
|
|
107
|
+
this.items = this.items.concat(items);
|
|
108
|
+
if (!opts || (opts && opts.calculate)) {
|
|
109
|
+
this.calculate();
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
calculate() {
|
|
113
|
+
this.summaryNet = this.getSummaryNet(false);
|
|
114
|
+
if (this.adjusted) {
|
|
115
|
+
this.summaryAdjusted = this.getSummary(this.summaryNet, this.sundryRate, this.sundryMax, this.sundryFixed, this.sundryMethod, this.partsDiscount, this.paintDiscount, this.adjusted);
|
|
116
|
+
}
|
|
117
|
+
this.summary = this.getSummary(this.summaryNet, this.sundryRate, this.sundryMax, this.sundryFixed, this.sundryMethod, this.partsDiscount, this.paintDiscount, this.adjusted);
|
|
118
|
+
this.net = b(0)
|
|
119
|
+
.add(this.summary.labour)
|
|
120
|
+
.add(this.summary.none)
|
|
121
|
+
.add(this.summary.parts)
|
|
122
|
+
.add(this.summary.pm)
|
|
123
|
+
.add(this.summary.specialist)
|
|
124
|
+
.toFixed(2);
|
|
125
|
+
this.vat = b(this.net || '0').mul(this.vatRate || '0').toFixed(2);
|
|
126
|
+
this.gross = b(this.net || '0').add(this.vat || '0').toFixed(2);
|
|
127
|
+
}
|
|
128
|
+
/**
|
|
129
|
+
* Returns the net summary (before sundries and discounts) of the estimate.
|
|
130
|
+
* By summary, we mean grouping the costs by cost category.
|
|
131
|
+
*
|
|
132
|
+
* @param adjusted if the values should be calculated using the original or
|
|
133
|
+
* adjusted values
|
|
134
|
+
*/
|
|
135
|
+
getSummaryNet(adjusted = false) {
|
|
136
|
+
const summary = this.items.reduce((map, item) => {
|
|
137
|
+
map[item.costCategory] = b(map[item.costCategory] || '0')
|
|
138
|
+
.add(item.getLineValue(this.labourRate, this.timeBasis, adjusted))
|
|
139
|
+
.toFixed(2);
|
|
140
|
+
return map;
|
|
141
|
+
}, {
|
|
142
|
+
labour: '0.00',
|
|
143
|
+
none: '0.00',
|
|
144
|
+
parts: '0.00',
|
|
145
|
+
pm: '0.00',
|
|
146
|
+
pl: '0.00',
|
|
147
|
+
specialist: '0.00',
|
|
148
|
+
other: '0.00',
|
|
149
|
+
net: '0.00',
|
|
150
|
+
vat: '0.00',
|
|
151
|
+
gross: '0.00',
|
|
152
|
+
hours: '0.00',
|
|
153
|
+
labourRate: '0',
|
|
154
|
+
});
|
|
155
|
+
if (this.source === 'audatex') {
|
|
156
|
+
const mechHours = this.items
|
|
157
|
+
.filter(item => item.workCategory !== 'paint')
|
|
158
|
+
.reduce((h, item) => h.add(b(item.getTotalUnits(adjusted))), b())
|
|
159
|
+
.div(this.timeBasis || '1')
|
|
160
|
+
.round(2);
|
|
161
|
+
const paintHours = this.items
|
|
162
|
+
.filter(item => item.workCategory === 'paint')
|
|
163
|
+
.reduce((h, item) => h.add(b(item.getTotalUnits(adjusted))), b())
|
|
164
|
+
.div(this.timeBasis || '1')
|
|
165
|
+
.round(1);
|
|
166
|
+
const mechCost = mechHours.mul(this.labourRate || '0');
|
|
167
|
+
const paintCost = paintHours.mul(this.labourRate || '0');
|
|
168
|
+
summary.labour = mechCost.add(paintCost).toFixed(2);
|
|
169
|
+
}
|
|
170
|
+
return summary;
|
|
171
|
+
}
|
|
172
|
+
/**
|
|
173
|
+
* Applies the sundry and discount values to the net summary.
|
|
174
|
+
|
|
175
|
+
*/
|
|
176
|
+
getSummary(summaryNet, sundryRate, sundryMax, sundryFixed, sundryMethod, partsDiscount, paintDiscount, adjusted) {
|
|
177
|
+
const partsDisc = b('1').minus(partsDiscount || '0');
|
|
178
|
+
const paintDisc = b('1').minus(paintDiscount || '0');
|
|
179
|
+
let partsSundry = '0.00';
|
|
180
|
+
if (sundryMethod === 'percentage') {
|
|
181
|
+
partsSundry = b(summaryNet.parts).mul(sundryRate || '1').toFixed(2);
|
|
182
|
+
}
|
|
183
|
+
else if (sundryMethod === 'percentage-with-max') {
|
|
184
|
+
partsSundry = b(summaryNet.parts).mul(sundryRate || '1').toFixed(2);
|
|
185
|
+
partsSundry = Math.min(parseFloat(sundryMax || '0'), parseFloat(partsSundry)).toFixed();
|
|
186
|
+
}
|
|
187
|
+
else if (sundryMethod === 'fixed') {
|
|
188
|
+
partsSundry = b(sundryFixed).toFixed(2);
|
|
189
|
+
}
|
|
190
|
+
const parts = b(summaryNet.parts).add(partsSundry);
|
|
191
|
+
const net = b(0)
|
|
192
|
+
.add(summaryNet.labour)
|
|
193
|
+
.add(summaryNet.none)
|
|
194
|
+
.add(parts)
|
|
195
|
+
.add(summaryNet.pm)
|
|
196
|
+
.add(summaryNet.specialist)
|
|
197
|
+
.toFixed(2);
|
|
198
|
+
const vat = b(net || '0')
|
|
199
|
+
.mul(this.vatRate || '0')
|
|
200
|
+
.toFixed(2);
|
|
201
|
+
const gross = b(net || '0').add(vat || '0').toFixed(2);
|
|
202
|
+
return {
|
|
203
|
+
labour: summaryNet.labour,
|
|
204
|
+
none: summaryNet.none,
|
|
205
|
+
parts: b(parts).mul(partsDisc).toFixed(2),
|
|
206
|
+
pm: b(summaryNet.pm).mul(paintDisc).toFixed(2),
|
|
207
|
+
pl: summaryNet.pl,
|
|
208
|
+
specialist: summaryNet.specialist,
|
|
209
|
+
other: summaryNet.other,
|
|
210
|
+
net: net,
|
|
211
|
+
vat: vat,
|
|
212
|
+
gross: gross,
|
|
213
|
+
labourRate: this.labourRate,
|
|
214
|
+
hours: this.getTotalHours(adjusted)
|
|
215
|
+
};
|
|
216
|
+
}
|
|
217
|
+
toDto() {
|
|
218
|
+
return {
|
|
219
|
+
id: this.id,
|
|
220
|
+
source: this.source,
|
|
221
|
+
label: this.label,
|
|
222
|
+
comment: this.comment,
|
|
223
|
+
timestamp: this.timestamp,
|
|
224
|
+
version: this.version,
|
|
225
|
+
net: this.net,
|
|
226
|
+
vat: this.vat,
|
|
227
|
+
gross: this.gross,
|
|
228
|
+
labourRate: this.labourRate,
|
|
229
|
+
vatRate: this.vatRate,
|
|
230
|
+
sundryRate: this.sundryRate,
|
|
231
|
+
sundryMax: this.sundryMax,
|
|
232
|
+
sundryFixed: this.sundryFixed,
|
|
233
|
+
sundryMethod: this.sundryMethod,
|
|
234
|
+
partsDiscount: this.partsDiscount,
|
|
235
|
+
paintDiscount: this.paintDiscount,
|
|
236
|
+
timeBasis: this.timeBasis,
|
|
237
|
+
items: this.items.map(i => i.toDto()),
|
|
238
|
+
adjusted: this.adjusted,
|
|
239
|
+
summary: this.summary,
|
|
240
|
+
summaryAdjusted: this.summaryAdjusted
|
|
241
|
+
};
|
|
242
|
+
}
|
|
243
|
+
getTotalHours(adjusted = false) {
|
|
244
|
+
if (this.source === 'audatex') {
|
|
245
|
+
const mechUnitsHours = this.items
|
|
246
|
+
.filter(item => item.workCategory !== 'paint')
|
|
247
|
+
.reduce((h, item) => h.add(b(item.getTotalUnits(adjusted))), b())
|
|
248
|
+
.round(2)
|
|
249
|
+
.div(this.timeBasis || '1');
|
|
250
|
+
const paintHours = this.items
|
|
251
|
+
.filter(item => item.workCategory === 'paint')
|
|
252
|
+
.reduce((h, item) => h.add(b(item.getTotalUnits(adjusted))), b())
|
|
253
|
+
.round(1)
|
|
254
|
+
.div(this.timeBasis || '1');
|
|
255
|
+
return mechUnitsHours.add(paintHours).toFixed(2);
|
|
256
|
+
}
|
|
257
|
+
const units = this.items
|
|
258
|
+
.filter(i => i.costCategory === 'labour')
|
|
259
|
+
.reduce((p, c) => p.add(b(c.getTotalUnits(adjusted))), b('0'))
|
|
260
|
+
.toFixed(2);
|
|
261
|
+
return b(units).div(this.timeBasis || '1').toFixed(2);
|
|
262
|
+
}
|
|
263
|
+
}
|
|
264
|
+
exports.EstimateModel = EstimateModel;
|
|
265
|
+
//# sourceMappingURL=estimate.model.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"estimate.model.js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QACd,OAAO,CAAC,CAAC,KAAK,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,SAAS,IAAI,GAAG,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;IACxD,CAAC;CACF;AArSD,sCAqSC","sourcesContent":["import { Big } from 'big.js';\nimport moment from 'moment';\nimport { v4 as uuid } from 'uuid';\nimport { EstimateItemModel } from './estimate-item.model';\nimport { CostCategorySummary, EstimateDto, EstimateSummaryDto } from './estimate.dto';\nimport { EstimateItemDto } from './estimate-item.dto';\n\nexport declare type EstimateSundryMethod = 'percentage' | 'percentage-with-max' | 'fixed';\n\nexport declare type EstimateSource = 'audatex' | 'glassmatix' | 'manual' | 'ibody';\n\nconst b = (value: string | number | Big = '0') => {\n try {\n if (typeof value === 'string') {\n return new Big(value.replace(/[^\\d^.]/g, ''));\n }\n return new Big(value);\n } catch (e) {\n console.error(`failed to construct Big from value '${value}'`);\n return new Big('0');\n }\n};\n\n\nexport class EstimateModel {\n\n public id: string = uuid();\n public source: EstimateSource = 'manual';\n public label: string = '';\n public comment: string = '';\n public timestamp: string = moment().toISOString();\n public version: number = 1;\n public net: string = '0.00';\n public vat: string = '0.00';\n public gross: string = '0.00';\n public labourRate: string = '1';\n public vatRate: string = '0.00';\n public sundryRate: string = '0.00';\n public sundryMax: string = '0.00';\n public sundryFixed: string = '0.00';\n public sundryMethod: EstimateSundryMethod = 'fixed';\n public partsDiscount: string = '0.00';\n public paintDiscount: string = '0.00';\n public timeBasis: string = '1';\n public adjusted = false;\n public items: Array<EstimateItemModel> = [];\n public summaryNet: EstimateSummaryDto = {\n labour: '0.00',\n none: '0.00',\n parts: '0.00',\n pm: '0.00',\n pl: '0.00',\n specialist: '0.00',\n other: '0.00',\n gross: '0.00',\n net: '0.00',\n hours: '0.00',\n vat: '0.00',\n labourRate: '0.00',\n };\n public summary: EstimateSummaryDto = {\n labour: '0.00',\n none: '0.00',\n parts: '0.00',\n pm: '0.00',\n pl: '0.00',\n specialist: '0.00',\n other: '0.00',\n gross: '0.00',\n net: '0.00',\n hours: '0.00',\n vat: '0.00',\n labourRate: '0.00',\n };\n public summaryAdjusted: EstimateSummaryDto = {\n labour: '0.00',\n none: '0.00',\n parts: '0.00',\n pm: '0.00',\n pl: '0.00',\n specialist: '0.00',\n other: '0.00',\n gross: '0.00',\n net: '0.00',\n hours: '0.00',\n vat: '0.00',\n labourRate: '0.00',\n };\n\n static create(source: EstimateSource = 'manual'): EstimateModel {\n const model = new EstimateModel();\n model.source = source;\n return model;\n }\n\n static fromDto(dto: Partial<EstimateDto>): EstimateModel {\n const model = new EstimateModel();\n Object.assign(model, {\n ...dto,\n items: dto.items?.map(item => EstimateItemModel.fromDto(item)),\n });\n model.calculate();\n return model;\n }\n\n addItem(\n modelOrDto: EstimateItemModel | Partial<EstimateItemDto>,\n opts?: { calculate?: boolean }\n ) {\n this.items.push(modelOrDto instanceof EstimateItemModel ?\n modelOrDto :\n EstimateItemModel.fromDto(modelOrDto)\n );\n if (!opts || (opts && opts.calculate)) {\n this.calculate();\n }\n }\n\n addItems(items: Array<EstimateItemModel>, opts?: { calculate?: boolean }) {\n this.items = this.items.concat(items);\n if (!opts || (opts && opts.calculate)) {\n this.calculate();\n }\n }\n\n calculate(): void {\n this.summaryNet = this.getSummaryNet(false);\n\n if (this.adjusted) {\n this.summaryAdjusted = this.getSummary(\n this.summaryNet,\n this.sundryRate,\n this.sundryMax,\n this.sundryFixed,\n this.sundryMethod,\n this.partsDiscount,\n this.paintDiscount,\n this.adjusted\n );\n }\n this.summary = this.getSummary(\n this.summaryNet,\n this.sundryRate,\n this.sundryMax,\n this.sundryFixed,\n this.sundryMethod,\n this.partsDiscount,\n this.paintDiscount,\n this.adjusted\n );\n\n this.net = b(0)\n .add(this.summary.labour)\n .add(this.summary.none)\n .add(this.summary.parts)\n .add(this.summary.pm)\n .add(this.summary.specialist)\n .toFixed(2);\n this.vat = b(this.net || '0').mul(this.vatRate || '0').toFixed(2);\n this.gross = b(this.net || '0').add(this.vat || '0').toFixed(2);\n }\n\n /**\n * Returns the net summary (before sundries and discounts) of the estimate.\n * By summary, we mean grouping the costs by cost category.\n *\n * @param adjusted if the values should be calculated using the original or\n * adjusted values\n */\n getSummaryNet(adjusted = false): EstimateSummaryDto {\n const summary = this.items.reduce((map, item) => {\n map[item.costCategory] = b(map[item.costCategory] || '0')\n .add(item.getLineValue(this.labourRate, this.timeBasis, adjusted))\n .toFixed(2);\n return map;\n }, {\n labour: '0.00',\n none: '0.00',\n parts: '0.00',\n pm: '0.00',\n pl: '0.00',\n specialist: '0.00',\n other: '0.00',\n net: '0.00',\n vat: '0.00',\n gross: '0.00',\n hours: '0.00',\n labourRate: '0',\n } as EstimateSummaryDto);\n\n if (this.source === 'audatex') {\n const mechHours = this.items\n .filter(item => item.workCategory !== 'paint')\n .reduce((h, item) => h.add(b(item.getTotalUnits(adjusted))), b())\n .div(this.timeBasis || '1')\n .round(2);\n const paintHours = this.items\n .filter(item => item.workCategory === 'paint')\n .reduce((h, item) => h.add(b(item.getTotalUnits(adjusted))), b())\n .div(this.timeBasis || '1')\n .round(1);\n\n const mechCost = mechHours.mul(this.labourRate || '0');\n const paintCost = paintHours.mul(this.labourRate || '0');\n summary.labour = mechCost.add(paintCost).toFixed(2);\n }\n return summary;\n }\n\n /**\n * Applies the sundry and discount values to the net summary.\n\n */\n getSummary(\n summaryNet: EstimateDto['summary'],\n sundryRate: string,\n sundryMax: string,\n sundryFixed: string,\n sundryMethod: EstimateSundryMethod,\n partsDiscount: string,\n paintDiscount: string,\n adjusted: boolean\n ): EstimateDto['summary'] {\n const partsDisc = b('1').minus(partsDiscount || '0');\n const paintDisc = b('1').minus(paintDiscount || '0');\n\n let partsSundry = '0.00';\n\n if (sundryMethod === 'percentage') {\n partsSundry = b(summaryNet.parts).mul(sundryRate || '1').toFixed(2);\n } else if (sundryMethod === 'percentage-with-max') {\n partsSundry = b(summaryNet.parts).mul(sundryRate || '1').toFixed(2);\n partsSundry = Math.min(\n parseFloat(sundryMax || '0'),\n parseFloat(partsSundry)\n ).toFixed();\n } else if (sundryMethod === 'fixed') {\n partsSundry = b(sundryFixed).toFixed(2);\n }\n\n const parts = b(summaryNet.parts).add(partsSundry);\n\n const net = b(0)\n .add(summaryNet.labour)\n .add(summaryNet.none)\n .add(parts)\n .add(summaryNet.pm)\n .add(summaryNet.specialist)\n .toFixed(2);\n const vat = b(net || '0')\n .mul(this.vatRate || '0')\n .toFixed(2);\n const gross = b(net || '0').add(vat || '0').toFixed(2);\n\n return {\n labour: summaryNet.labour,\n none: summaryNet.none,\n parts: b(parts).mul(partsDisc).toFixed(2),\n pm: b(summaryNet.pm).mul(paintDisc).toFixed(2),\n pl: summaryNet.pl,\n specialist: summaryNet.specialist,\n other: summaryNet.other,\n net: net,\n vat: vat,\n gross: gross,\n labourRate: this.labourRate,\n hours: this.getTotalHours(adjusted)\n };\n }\n\n toDto(): EstimateDto {\n return {\n id: this.id,\n source: this.source,\n label: this.label,\n comment: this.comment,\n timestamp: this.timestamp,\n version: this.version,\n net: this.net,\n vat: this.vat,\n gross: this.gross,\n labourRate: this.labourRate,\n vatRate: this.vatRate,\n sundryRate: this.sundryRate,\n sundryMax: this.sundryMax,\n sundryFixed: this.sundryFixed,\n sundryMethod: this.sundryMethod,\n partsDiscount: this.partsDiscount,\n paintDiscount: this.paintDiscount,\n timeBasis: this.timeBasis,\n items: this.items.map(i => i.toDto()),\n adjusted: this.adjusted,\n summary: this.summary,\n summaryAdjusted: this.summaryAdjusted\n };\n }\n\n getTotalHours(adjusted = false): string {\n if (this.source === 'audatex') {\n const mechUnitsHours = this.items\n .filter(item => item.workCategory !== 'paint')\n .reduce((h, item) => h.add(b(item.getTotalUnits(adjusted))), b())\n .round(2)\n .div(this.timeBasis || '1');\n const paintHours = this.items\n .filter(item => item.workCategory === 'paint')\n .reduce((h, item) => h.add(b(item.getTotalUnits(adjusted))), b())\n .round(1)\n .div(this.timeBasis || '1');\n return mechUnitsHours.add(paintHours).toFixed(2);\n }\n const units = this.items\n .filter(i => i.costCategory === 'labour')\n .reduce((p, c) => p.add(b(c.getTotalUnits(adjusted))), b('0'))\n .toFixed(2);\n return b(units).div(this.timeBasis || '1').toFixed(2);\n }\n}\n"]}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export declare type EstimateWorkCategory = 'none' | 'blend' | 'check' | 'new' | 'paint' | 'rr' | 'removed' | 'repair' | 'specialist';
|
|
2
|
+
export declare type EstimateCostCategory = 'labour' | 'none' | 'pm' | 'pl' | 'parts' | 'other' | 'specialist';
|
|
3
|
+
//# sourceMappingURL=estimate.types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"estimate.types.d.ts","sourceRoot":"","sources":["../../../../../../projects/vas-lib/src/lib/model/estimate-control/estimate.types.ts"],"names":[],"mappings":"AACA,MAAM,CAAC,OAAO,MAAM,oBAAoB,GACtC,MAAM,GACJ,OAAO,GACP,OAAO,GACP,KAAK,GACL,OAAO,GACP,IAAI,GACJ,SAAS,GACT,QAAQ,GACR,YAAY,CAAC;AAEjB,MAAM,CAAC,OAAO,MAAM,oBAAoB,GACtC,QAAQ,GACR,MAAM,GACN,IAAI,GACJ,IAAI,GACJ,OAAO,GACP,OAAO,GACP,YAAY,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"estimate.types.js","sourceRoot":"","sources":["../../../../../../projects/vas-lib/src/lib/model/estimate-control/estimate.types.ts"],"names":[],"mappings":"","sourcesContent":["\nexport declare type EstimateWorkCategory =\n 'none'\n | 'blend'\n | 'check'\n | 'new'\n | 'paint'\n | 'rr'\n | 'removed'\n | 'repair'\n | 'specialist';\n\nexport declare type EstimateCostCategory =\n 'labour' |\n 'none' |\n 'pm' |\n 'pl' |\n 'parts' |\n 'other' |\n 'specialist';\n"]}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export * from './estimate.dto';
|
|
2
|
+
export * from './estimate.model';
|
|
3
|
+
export * from './estimate.types';
|
|
4
|
+
export * from './estimate-control-value.dto';
|
|
5
|
+
export * from './estimate-control-value.model';
|
|
6
|
+
export * from './estimate-item.dto';
|
|
7
|
+
export * from './estimate-item.model';
|
|
8
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../projects/vas-lib/src/lib/model/estimate-control/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,kBAAkB,CAAC;AACjC,cAAc,kBAAkB,CAAC;AACjC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,gCAAgC,CAAC;AAC/C,cAAc,qBAAqB,CAAC;AACpC,cAAc,uBAAuB,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
4
|
+
tslib_1.__exportStar(require("./estimate.dto"), exports);
|
|
5
|
+
tslib_1.__exportStar(require("./estimate.model"), exports);
|
|
6
|
+
tslib_1.__exportStar(require("./estimate.types"), exports);
|
|
7
|
+
tslib_1.__exportStar(require("./estimate-control-value.dto"), exports);
|
|
8
|
+
tslib_1.__exportStar(require("./estimate-control-value.model"), exports);
|
|
9
|
+
tslib_1.__exportStar(require("./estimate-item.dto"), exports);
|
|
10
|
+
tslib_1.__exportStar(require("./estimate-item.model"), exports);
|
|
11
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../projects/vas-lib/src/lib/model/estimate-control/index.ts"],"names":[],"mappings":";;;AAAA,yDAA+B;AAC/B,2DAAiC;AACjC,2DAAiC;AACjC,uEAA6C;AAC7C,yEAA+C;AAC/C,8DAAoC;AACpC,gEAAsC","sourcesContent":["export * from './estimate.dto';\nexport * from './estimate.model';\nexport * from './estimate.types';\nexport * from './estimate-control-value.dto';\nexport * from './estimate-control-value.model';\nexport * from './estimate-item.dto';\nexport * from './estimate-item.model';\n"]}
|
package/cjs/lib/model/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../projects/vas-lib/src/lib/model/index.ts"],"names":[],"mappings":"AAAA,cAAc,oCAAoC,CAAA;AAClD,cAAc,gBAAgB,CAAC;AAC/B,cAAc,wBAAwB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../projects/vas-lib/src/lib/model/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAA;AAClC,cAAc,oCAAoC,CAAA;AAClD,cAAc,gBAAgB,CAAC;AAC/B,cAAc,qBAAqB,CAAA;AACnC,cAAc,wBAAwB,CAAC"}
|
package/cjs/lib/model/index.js
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const tslib_1 = require("tslib");
|
|
4
|
+
tslib_1.__exportStar(require("./estimate-control"), exports);
|
|
4
5
|
tslib_1.__exportStar(require("./firebase-document-meta.interface"), exports);
|
|
5
6
|
tslib_1.__exportStar(require("./geo-location"), exports);
|
|
7
|
+
tslib_1.__exportStar(require("./report-invocation"), exports);
|
|
6
8
|
tslib_1.__exportStar(require("./vas-time-range.model"), exports);
|
|
7
9
|
//# sourceMappingURL=index.js.map
|