taxtank-core 0.29.9 → 0.29.12

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
  }
@@ -19215,30 +19215,6 @@
19215
19215
  return SoleBusinessLossForm;
19216
19216
  }(AbstractForm));
19217
19217
 
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
19218
  var SoleContactForm = /** @class */ (function (_super) {
19243
19219
  __extends(SoleContactForm, _super);
19244
19220
  function SoleContactForm(contact) {
@@ -19249,7 +19225,7 @@
19249
19225
  firstName: new forms.FormControl(contact.firstName, forms.Validators.required),
19250
19226
  lastName: new forms.FormControl(contact.lastName, forms.Validators.required),
19251
19227
  email: new forms.FormControl(contact.email, [forms.Validators.required, forms.Validators.email]),
19252
- phone: new PhoneForm(contact.phone || classTransformer.plainToClass(Phone, {})),
19228
+ phone: new forms.FormControl(contact.phone),
19253
19229
  address: new AddressForm(contact.address || classTransformer.plainToClass(Address, {}))
19254
19230
  }, contact) || this;
19255
19231
  }
@@ -19803,6 +19779,31 @@
19803
19779
  return LoginForm;
19804
19780
  }(AbstractForm));
19805
19781
 
19782
+ var phonePattern = /^(((\s*)?([- ()]?\d[- ()]?){0,30}(\s*)?)|)$/;
19783
+ /**
19784
+ * Validator for phone number
19785
+ * Allowed special symbols"-", "(", ")"
19786
+ */
19787
+ function phoneNumberValidator() {
19788
+ return function (control) {
19789
+ return phonePattern.test(control.value) ? null : { phoneInvalid: true };
19790
+ };
19791
+ }
19792
+
19793
+ var PhoneForm = /** @class */ (function (_super) {
19794
+ __extends(PhoneForm, _super);
19795
+ function PhoneForm(
19796
+ // no default value because this form is always built-in, so phone passed from parent form
19797
+ phone) {
19798
+ return _super.call(this, {
19799
+ type: new forms.FormControl((phone === null || phone === void 0 ? void 0 : phone.type) || exports.PhoneTypeEnum.MOBILE, forms.Validators.required),
19800
+ country: new forms.FormControl((phone === null || phone === void 0 ? void 0 : phone.country) || Country.australia, forms.Validators.required),
19801
+ number: new forms.FormControl((phone === null || phone === void 0 ? void 0 : phone.number) || null, [forms.Validators.required, phoneNumberValidator()])
19802
+ }, phone) || this;
19803
+ }
19804
+ return PhoneForm;
19805
+ }(AbstractForm));
19806
+
19806
19807
  // @TODO Alex: Create a model and handle request fields via class-transformer
19807
19808
  var PasswordForm = /** @class */ (function (_super) {
19808
19809
  __extends(PasswordForm, _super);
@@ -20855,10 +20856,8 @@
20855
20856
  }, controls), transaction) || this;
20856
20857
  _this.registeredForGst = registeredForGst;
20857
20858
  _this.watchChartAccounts();
20858
- if (_this.isGstApplicable()) {
20859
- _this.watchAmountWithGST();
20860
- _this.watchIsGst();
20861
- }
20859
+ _this.watchAmountWithGST();
20860
+ _this.watchIsGst();
20862
20861
  return _this;
20863
20862
  }
20864
20863
  TransactionBaseForm.prototype.watchIsGst = function () {
@@ -21148,6 +21147,11 @@
21148
21147
  });
21149
21148
  return _this;
21150
21149
  }
21150
+ DepreciationForm.prototype.submit = function (data, includeDisabledFields) {
21151
+ if (data === void 0) { data = {}; }
21152
+ if (includeDisabledFields === void 0) { includeDisabledFields = false; }
21153
+ return _super.prototype.submit.call(this, data, true);
21154
+ };
21151
21155
  return DepreciationForm;
21152
21156
  }(TransactionBaseForm));
21153
21157