taxtank-core 0.29.9 → 0.29.12-1

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.
@@ -2230,7 +2230,7 @@
2230
2230
  };
2231
2231
  Object.defineProperty(TransactionBase.prototype, "amountWithGst", {
2232
2232
  get: function () {
2233
- return this.isGST ? +(this.amount * ChartAccounts.GSTCoefficient).toFixed(2) : this.amount;
2233
+ return this.isGST ? +(Math.round(this.amount * ChartAccounts.GSTCoefficient)).toFixed(2) : this.amount;
2234
2234
  },
2235
2235
  enumerable: false,
2236
2236
  configurable: true
@@ -6193,7 +6193,7 @@
6193
6193
  __extends(PropertyDocument, _super);
6194
6194
  function PropertyDocument() {
6195
6195
  var _this = _super.apply(this, __spreadArray([], __read(arguments))) || this;
6196
- _this.type = exports.AssetTypeEnum.DOCUMENT;
6196
+ _this.type = exports.AssetTypeEnum.PROPERTY;
6197
6197
  _this.entityType = exports.AssetEntityTypeEnum.PROPERTIES;
6198
6198
  return _this;
6199
6199
  }
@@ -9056,7 +9056,7 @@
9056
9056
  var _this = this;
9057
9057
  this.items = [];
9058
9058
  properties.items.forEach(function (property) {
9059
- var depreciationsByType = new CollectionDictionary(depreciations, 'type');
9059
+ var depreciationsByType = new CollectionDictionary(depreciations.filterBy('property.id', property.id), 'type');
9060
9060
  depreciationsByType.keys.map(function (type) {
9061
9061
  _this.items.push(new PropertyReportItemDepreciation(depreciationsByType.get(type), property, chartAccounts.findBy('id', depreciationsByType.get(type).first.chartAccounts.id)));
9062
9062
  });
@@ -18158,6 +18158,8 @@
18158
18158
  this.chartAccountsService.get()
18159
18159
  ]).pipe(operators.map(function (_a) {
18160
18160
  var _b = __read(_a, 4), properties = _b[0], transactions = _b[1], depreciations = _b[2], chartAccounts = _b[3];
18161
+ var r = _this.create(transactions, depreciations, properties, chartAccounts);
18162
+ debugger;
18161
18163
  return new CollectionDictionary(_this.create(transactions, depreciations, properties, chartAccounts), 'propertyId');
18162
18164
  }));
18163
18165
  };
@@ -19215,30 +19217,6 @@
19215
19217
  return SoleBusinessLossForm;
19216
19218
  }(AbstractForm));
19217
19219
 
19218
- var phonePattern = /^(((\s*)?([- ()]?\d[- ()]?){0,30}(\s*)?)|)$/;
19219
- /**
19220
- * Validator for phone number
19221
- * Allowed special symbols"-", "(", ")"
19222
- */
19223
- function phoneNumberValidator() {
19224
- return function (control) {
19225
- return phonePattern.test(control.value) ? null : { phoneInvalid: true };
19226
- };
19227
- }
19228
-
19229
- var PhoneForm = /** @class */ (function (_super) {
19230
- __extends(PhoneForm, _super);
19231
- function PhoneForm(phone) {
19232
- if (phone === void 0) { phone = classTransformer.plainToClass(Phone, {}); }
19233
- return _super.call(this, {
19234
- type: new forms.FormControl(phone.type, forms.Validators.required),
19235
- country: new forms.FormControl(phone.country, forms.Validators.required),
19236
- number: new forms.FormControl(phone.number, [forms.Validators.required, phoneNumberValidator()])
19237
- }, phone) || this;
19238
- }
19239
- return PhoneForm;
19240
- }(AbstractForm));
19241
-
19242
19220
  var SoleContactForm = /** @class */ (function (_super) {
19243
19221
  __extends(SoleContactForm, _super);
19244
19222
  function SoleContactForm(contact) {
@@ -19249,7 +19227,7 @@
19249
19227
  firstName: new forms.FormControl(contact.firstName, forms.Validators.required),
19250
19228
  lastName: new forms.FormControl(contact.lastName, forms.Validators.required),
19251
19229
  email: new forms.FormControl(contact.email, [forms.Validators.required, forms.Validators.email]),
19252
- phone: new PhoneForm(contact.phone || classTransformer.plainToClass(Phone, {})),
19230
+ phone: new forms.FormControl(contact.phone),
19253
19231
  address: new AddressForm(contact.address || classTransformer.plainToClass(Address, {}))
19254
19232
  }, contact) || this;
19255
19233
  }
@@ -19803,6 +19781,31 @@
19803
19781
  return LoginForm;
19804
19782
  }(AbstractForm));
19805
19783
 
19784
+ var phonePattern = /^(((\s*)?([- ()]?\d[- ()]?){0,30}(\s*)?)|)$/;
19785
+ /**
19786
+ * Validator for phone number
19787
+ * Allowed special symbols"-", "(", ")"
19788
+ */
19789
+ function phoneNumberValidator() {
19790
+ return function (control) {
19791
+ return phonePattern.test(control.value) ? null : { phoneInvalid: true };
19792
+ };
19793
+ }
19794
+
19795
+ var PhoneForm = /** @class */ (function (_super) {
19796
+ __extends(PhoneForm, _super);
19797
+ function PhoneForm(
19798
+ // no default value because this form is always built-in, so phone passed from parent form
19799
+ phone) {
19800
+ return _super.call(this, {
19801
+ type: new forms.FormControl((phone === null || phone === void 0 ? void 0 : phone.type) || exports.PhoneTypeEnum.MOBILE, forms.Validators.required),
19802
+ country: new forms.FormControl((phone === null || phone === void 0 ? void 0 : phone.country) || Country.australia, forms.Validators.required),
19803
+ number: new forms.FormControl((phone === null || phone === void 0 ? void 0 : phone.number) || null, [forms.Validators.required, phoneNumberValidator()])
19804
+ }, phone) || this;
19805
+ }
19806
+ return PhoneForm;
19807
+ }(AbstractForm));
19808
+
19806
19809
  // @TODO Alex: Create a model and handle request fields via class-transformer
19807
19810
  var PasswordForm = /** @class */ (function (_super) {
19808
19811
  __extends(PasswordForm, _super);
@@ -20855,10 +20858,8 @@
20855
20858
  }, controls), transaction) || this;
20856
20859
  _this.registeredForGst = registeredForGst;
20857
20860
  _this.watchChartAccounts();
20858
- if (_this.isGstApplicable()) {
20859
- _this.watchAmountWithGST();
20860
- _this.watchIsGst();
20861
- }
20861
+ _this.watchAmountWithGST();
20862
+ _this.watchIsGst();
20862
20863
  return _this;
20863
20864
  }
20864
20865
  TransactionBaseForm.prototype.watchIsGst = function () {
@@ -21148,6 +21149,11 @@
21148
21149
  });
21149
21150
  return _this;
21150
21151
  }
21152
+ DepreciationForm.prototype.submit = function (data, includeDisabledFields) {
21153
+ if (data === void 0) { data = {}; }
21154
+ if (includeDisabledFields === void 0) { includeDisabledFields = false; }
21155
+ return _super.prototype.submit.call(this, data, true);
21156
+ };
21151
21157
  return DepreciationForm;
21152
21158
  }(TransactionBaseForm));
21153
21159