taxtank-core 2.1.12 → 2.1.14

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.
@@ -5193,6 +5193,9 @@ class ServiceSubscription extends ServiceSubscription$1 {
5193
5193
  upgrade(prices) {
5194
5194
  const subscription = plainToClass(ServiceSubscription, this);
5195
5195
  subscription.items.forEach(item => {
5196
+ if (item.price.isNew()) {
5197
+ return;
5198
+ }
5196
5199
  item.price = prices.findBy('id', ServicePrice.priceMap[item.price.id]);
5197
5200
  });
5198
5201
  return subscription;
@@ -23756,12 +23759,12 @@ const COMPARE_OPERATORS = {
23756
23759
  function compareWithControlValidator(controlName, operator, alias) {
23757
23760
  return (control) => {
23758
23761
  // skip validation until control is attached to a parent FormGroup
23759
- if (!control?.parent) {
23762
+ if (!control?.parent || !control.value) {
23760
23763
  return null;
23761
23764
  }
23762
23765
  const group = control.parent;
23763
23766
  const fieldToCompare = group.get(controlName);
23764
- const isValid = control.value ? COMPARE_OPERATORS[operator](control.value, fieldToCompare.value) : true;
23767
+ const isValid = COMPARE_OPERATORS[operator](control.value, fieldToCompare.value);
23765
23768
  return isValid ? null : { compareWithControl: `The value should be ${operator} than ${alias}` };
23766
23769
  };
23767
23770
  }
@@ -24208,8 +24211,10 @@ class MoneyScheduleFilterForm extends AbstractForm {
24208
24211
  const value = this.value;
24209
24212
  const monthIndex = value.month;
24210
24213
  // calendar year start and FinYear start are different. we need to convert FinYear to regular one
24211
- this.onFilter.emit(new Date(new FinancialYear().getYearByMonth(monthIndex), monthIndex, 1));
24212
- let filteredEvents = calendarEvents;
24214
+ const startDate = new Date(new FinancialYear().getYearByMonth(monthIndex), monthIndex, 1);
24215
+ const endDate = moment(startDate).add(1, 'month').toDate();
24216
+ this.onFilter.emit(startDate);
24217
+ let filteredEvents = calendarEvents.filterByDate(startDate, endDate);
24213
24218
  if (value.eventType !== CalendarEventTypeEnum.ALL) {
24214
24219
  filteredEvents = filteredEvents.filterBy('extendedProps.type', value.eventType);
24215
24220
  }