@senior-gestao-empresarial/erpx-components 4.18.0-develop-6fcd6567 → 4.19.0-develop-6b84c27e

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.
@@ -3,7 +3,7 @@ import { Input, Component, NgModule, ɵɵdefineInjectable, Injectable, ɵɵinjec
3
3
  import { CommonModule } from '@angular/common';
4
4
  import { BreadcrumbModule as BreadcrumbModule$1 } from 'primeng/breadcrumb';
5
5
  import { NavigationEnd, PRIMARY_OUTLET, ActivatedRoute, Router, RouterModule } from '@angular/router';
6
- import { Subject, combineLatest, throwError } from 'rxjs';
6
+ import { Subject, combineLatest, merge, throwError } from 'rxjs';
7
7
  import { takeUntil, filter, startWith, distinctUntilChanged, skip, map, debounceTime, auditTime, scan, first, finalize, catchError } from 'rxjs/operators';
8
8
  import { TranslateService, TranslateModule } from '@ngx-translate/core';
9
9
  import { EnumLogicalOperator, E027StrLookup, BeneficioFiscalLookup, E027EqiLookup, CplTriNotaSaidaNaturezaReceitaPisCofinsLookup, ClassificacaoTributariaLookup, LookupValidationUtils, ErpLookupsModule, E210DxpLookup, E091PlfLookup, E044CcuLookup } from '@senior-gestao-empresarial/angular-components';
@@ -1827,23 +1827,24 @@ var TaxClassificationCalculationRule = /** @class */ (function () {
1827
1827
  var name = _a.name;
1828
1828
  return name === EnumTipoTributo.IBS_ESTORNO_CREDITO;
1829
1829
  }), ibsEstornoCreditoFormGroup = _c.formGroup, ibsEstornoCreditoFormField = _c.formField;
1830
- var dataKey_2 = ibsEstornoCreditoFormField.find(function (_a) {
1830
+ var classificacaoTributariaDataKey_1 = ibsEstornoCreditoFormField.find(function (_a) {
1831
1831
  var name = _a.name;
1832
1832
  return name === 'classificacaoTributaria';
1833
1833
  }).dataKey;
1834
- combineLatest([
1835
- ibsEstornoCreditoFormGroup
1836
- .get('classificacaoTributaria')
1837
- .valueChanges.pipe(startWith(ibsEstornoCreditoFormGroup.get('classificacaoTributaria').value), distinctUntilChanged(function (old, current) {
1838
- return (old === null || old === void 0 ? void 0 : old[dataKey_2]) === (current === null || current === void 0 ? void 0 : current[dataKey_2]);
1839
- }))
1840
- ])
1841
- .pipe(skip(1), map(function (_a) {
1842
- var _b = __read(_a, 1), taxClassification = _b[0];
1843
- return [taxClassification];
1834
+ var situacaoTributariaDataKey_1 = formField.find(function (field) { return field.name === 'situacaoTributaria'; }).dataKey;
1835
+ merge(ibsEstornoCreditoFormGroup
1836
+ .get('classificacaoTributaria')
1837
+ .valueChanges.pipe(distinctUntilChanged(function (old, current) {
1838
+ return (old === null || old === void 0 ? void 0 : old[classificacaoTributariaDataKey_1]) === (current === null || current === void 0 ? void 0 : current[classificacaoTributariaDataKey_1]);
1839
+ })), formGroup.get('situacaoTributaria').valueChanges.pipe(distinctUntilChanged(function (old, current) {
1840
+ return (old === null || old === void 0 ? void 0 : old[situacaoTributariaDataKey_1]) === (current === null || current === void 0 ? void 0 : current[situacaoTributariaDataKey_1]);
1841
+ }), map(function () { return null; })))
1842
+ .pipe(filter(function (taxClassification) {
1843
+ var _a;
1844
+ return (taxClassification === null || taxClassification === void 0 ? void 0 : taxClassification.id) !== ((_a = formGroup.get('classificacaoTributaria')
1845
+ .value) === null || _a === void 0 ? void 0 : _a.id);
1844
1846
  }))
1845
- .subscribe(function (_a) {
1846
- var _b = __read(_a, 1), taxClassification = _b[0];
1847
+ .subscribe(function (taxClassification) {
1847
1848
  formGroup
1848
1849
  .get('classificacaoTributaria')
1849
1850
  .setValue(taxClassification);
@@ -1856,23 +1857,24 @@ var TaxClassificationCalculationRule = /** @class */ (function () {
1856
1857
  var name = _a.name;
1857
1858
  return name === EnumTipoTributo.CBS_ESTORNO_CREDITO;
1858
1859
  }), cbsEstornoCreditoFormGroup = _d.formGroup, cbsEstornoCreditoFormField = _d.formField;
1859
- var dataKey_3 = cbsEstornoCreditoFormField.find(function (_a) {
1860
+ var classificacaoTributariaDataKey_2 = cbsEstornoCreditoFormField.find(function (_a) {
1860
1861
  var name = _a.name;
1861
1862
  return name === 'classificacaoTributaria';
1862
1863
  }).dataKey;
1863
- combineLatest([
1864
- cbsEstornoCreditoFormGroup
1865
- .get('classificacaoTributaria')
1866
- .valueChanges.pipe(startWith(cbsEstornoCreditoFormGroup.get('classificacaoTributaria').value), distinctUntilChanged(function (old, current) {
1867
- return (old === null || old === void 0 ? void 0 : old[dataKey_3]) === (current === null || current === void 0 ? void 0 : current[dataKey_3]);
1868
- }))
1869
- ])
1870
- .pipe(skip(1), map(function (_a) {
1871
- var _b = __read(_a, 1), taxClassification = _b[0];
1872
- return [taxClassification];
1864
+ var situacaoTributariaDataKey_2 = formField.find(function (field) { return field.name === 'situacaoTributaria'; }).dataKey;
1865
+ merge(cbsEstornoCreditoFormGroup
1866
+ .get('classificacaoTributaria')
1867
+ .valueChanges.pipe(distinctUntilChanged(function (old, current) {
1868
+ return (old === null || old === void 0 ? void 0 : old[classificacaoTributariaDataKey_2]) === (current === null || current === void 0 ? void 0 : current[classificacaoTributariaDataKey_2]);
1869
+ })), formGroup.get('situacaoTributaria').valueChanges.pipe(distinctUntilChanged(function (old, current) {
1870
+ return (old === null || old === void 0 ? void 0 : old[situacaoTributariaDataKey_2]) === (current === null || current === void 0 ? void 0 : current[situacaoTributariaDataKey_2]);
1871
+ }), map(function () { return null; })))
1872
+ .pipe(filter(function (taxClassification) {
1873
+ var _a;
1874
+ return (taxClassification === null || taxClassification === void 0 ? void 0 : taxClassification.id) !== ((_a = formGroup.get('classificacaoTributaria')
1875
+ .value) === null || _a === void 0 ? void 0 : _a.id);
1873
1876
  }))
1874
- .subscribe(function (_a) {
1875
- var _b = __read(_a, 1), taxClassification = _b[0];
1877
+ .subscribe(function (taxClassification) {
1876
1878
  formGroup
1877
1879
  .get('classificacaoTributaria')
1878
1880
  .setValue(taxClassification);
@@ -1885,7 +1887,7 @@ var TaxClassificationCalculationRule = /** @class */ (function () {
1885
1887
  var name = _a.name;
1886
1888
  return name === EnumTipoTributo.IBS_AJUSTE;
1887
1889
  }), ibsAjusteFormGroup = _e.formGroup, ibsAjusteFormField = _e.formField;
1888
- var dataKey_4 = ibsAjusteFormField.find(function (_a) {
1890
+ var dataKey_2 = ibsAjusteFormField.find(function (_a) {
1889
1891
  var name = _a.name;
1890
1892
  return name === 'classificacaoTributaria';
1891
1893
  }).dataKey;
@@ -1893,7 +1895,7 @@ var TaxClassificationCalculationRule = /** @class */ (function () {
1893
1895
  ibsAjusteFormGroup
1894
1896
  .get('classificacaoTributaria')
1895
1897
  .valueChanges.pipe(startWith(ibsAjusteFormGroup.get('classificacaoTributaria').value), distinctUntilChanged(function (old, current) {
1896
- return (old === null || old === void 0 ? void 0 : old[dataKey_4]) === (current === null || current === void 0 ? void 0 : current[dataKey_4]);
1898
+ return (old === null || old === void 0 ? void 0 : old[dataKey_2]) === (current === null || current === void 0 ? void 0 : current[dataKey_2]);
1897
1899
  }))
1898
1900
  ])
1899
1901
  .pipe(skip(1), map(function (_a) {
@@ -1914,7 +1916,7 @@ var TaxClassificationCalculationRule = /** @class */ (function () {
1914
1916
  var name = _a.name;
1915
1917
  return name === EnumTipoTributo.CBS_AJUSTE;
1916
1918
  }), cbsAjusteFormGroup = _f.formGroup, cbsAjusteFormField = _f.formField;
1917
- var dataKey_5 = cbsAjusteFormField.find(function (_a) {
1919
+ var dataKey_3 = cbsAjusteFormField.find(function (_a) {
1918
1920
  var name = _a.name;
1919
1921
  return name === 'classificacaoTributaria';
1920
1922
  }).dataKey;
@@ -1922,7 +1924,7 @@ var TaxClassificationCalculationRule = /** @class */ (function () {
1922
1924
  cbsAjusteFormGroup
1923
1925
  .get('classificacaoTributaria')
1924
1926
  .valueChanges.pipe(startWith(cbsAjusteFormGroup.get('classificacaoTributaria').value), distinctUntilChanged(function (old, current) {
1925
- return (old === null || old === void 0 ? void 0 : old[dataKey_5]) === (current === null || current === void 0 ? void 0 : current[dataKey_5]);
1927
+ return (old === null || old === void 0 ? void 0 : old[dataKey_3]) === (current === null || current === void 0 ? void 0 : current[dataKey_3]);
1926
1928
  }))
1927
1929
  ])
1928
1930
  .pipe(skip(1), map(function (_a) {
@@ -1943,23 +1945,24 @@ var TaxClassificationCalculationRule = /** @class */ (function () {
1943
1945
  var name = _a.name;
1944
1946
  return name === EnumTipoTributo.IBS_TRANSFERENCIA_CREDITO;
1945
1947
  }), ibsTransferenciaCreditoFormGroup = _g.formGroup, ibsTransferenciaCreditoFormField = _g.formField;
1946
- var dataKey_6 = ibsTransferenciaCreditoFormField.find(function (_a) {
1948
+ var classificacaoTributariaDataKey_3 = ibsTransferenciaCreditoFormField.find(function (_a) {
1947
1949
  var name = _a.name;
1948
1950
  return name === 'classificacaoTributaria';
1949
1951
  }).dataKey;
1950
- combineLatest([
1951
- ibsTransferenciaCreditoFormGroup
1952
- .get('classificacaoTributaria')
1953
- .valueChanges.pipe(startWith(ibsTransferenciaCreditoFormGroup.get('classificacaoTributaria').value), distinctUntilChanged(function (old, current) {
1954
- return (old === null || old === void 0 ? void 0 : old[dataKey_6]) === (current === null || current === void 0 ? void 0 : current[dataKey_6]);
1955
- }))
1956
- ])
1957
- .pipe(skip(1), map(function (_a) {
1958
- var _b = __read(_a, 1), taxClassification = _b[0];
1959
- return [taxClassification];
1952
+ var situacaoTributariaDataKey_3 = formField.find(function (field) { return field.name === 'situacaoTributaria'; }).dataKey;
1953
+ merge(ibsTransferenciaCreditoFormGroup
1954
+ .get('classificacaoTributaria')
1955
+ .valueChanges.pipe(distinctUntilChanged(function (old, current) {
1956
+ return (old === null || old === void 0 ? void 0 : old[classificacaoTributariaDataKey_3]) === (current === null || current === void 0 ? void 0 : current[classificacaoTributariaDataKey_3]);
1957
+ })), formGroup.get('situacaoTributaria').valueChanges.pipe(distinctUntilChanged(function (old, current) {
1958
+ return (old === null || old === void 0 ? void 0 : old[situacaoTributariaDataKey_3]) === (current === null || current === void 0 ? void 0 : current[situacaoTributariaDataKey_3]);
1959
+ }), map(function () { return null; })))
1960
+ .pipe(filter(function (taxClassification) {
1961
+ var _a;
1962
+ return (taxClassification === null || taxClassification === void 0 ? void 0 : taxClassification.id) !== ((_a = formGroup.get('classificacaoTributaria')
1963
+ .value) === null || _a === void 0 ? void 0 : _a.id);
1960
1964
  }))
1961
- .subscribe(function (_a) {
1962
- var _b = __read(_a, 1), taxClassification = _b[0];
1965
+ .subscribe(function (taxClassification) {
1963
1966
  formGroup
1964
1967
  .get('classificacaoTributaria')
1965
1968
  .setValue(taxClassification);
@@ -1972,23 +1975,24 @@ var TaxClassificationCalculationRule = /** @class */ (function () {
1972
1975
  var name = _a.name;
1973
1976
  return name === EnumTipoTributo.CBS_TRANSFERENCIA_CREDITO;
1974
1977
  }), cbsTransferenciaCreditoFormGroup = _h.formGroup, cbsTransferenciaCreditoFormField = _h.formField;
1975
- var dataKey_7 = cbsTransferenciaCreditoFormField.find(function (_a) {
1978
+ var classificacaoTributariaDataKey_4 = cbsTransferenciaCreditoFormField.find(function (_a) {
1976
1979
  var name = _a.name;
1977
1980
  return name === 'classificacaoTributaria';
1978
1981
  }).dataKey;
1979
- combineLatest([
1980
- cbsTransferenciaCreditoFormGroup
1981
- .get('classificacaoTributaria')
1982
- .valueChanges.pipe(startWith(cbsTransferenciaCreditoFormGroup.get('classificacaoTributaria').value), distinctUntilChanged(function (old, current) {
1983
- return (old === null || old === void 0 ? void 0 : old[dataKey_7]) === (current === null || current === void 0 ? void 0 : current[dataKey_7]);
1984
- }))
1985
- ])
1986
- .pipe(skip(1), map(function (_a) {
1987
- var _b = __read(_a, 1), taxClassification = _b[0];
1988
- return [taxClassification];
1982
+ var situacaoTributariaDataKey_4 = formField.find(function (field) { return field.name === 'situacaoTributaria'; }).dataKey;
1983
+ merge(cbsTransferenciaCreditoFormGroup
1984
+ .get('classificacaoTributaria')
1985
+ .valueChanges.pipe(distinctUntilChanged(function (old, current) {
1986
+ return (old === null || old === void 0 ? void 0 : old[classificacaoTributariaDataKey_4]) === (current === null || current === void 0 ? void 0 : current[classificacaoTributariaDataKey_4]);
1987
+ })), formGroup.get('situacaoTributaria').valueChanges.pipe(distinctUntilChanged(function (old, current) {
1988
+ return (old === null || old === void 0 ? void 0 : old[situacaoTributariaDataKey_4]) === (current === null || current === void 0 ? void 0 : current[situacaoTributariaDataKey_4]);
1989
+ }), map(function () { return null; })))
1990
+ .pipe(filter(function (taxClassification) {
1991
+ var _a;
1992
+ return (taxClassification === null || taxClassification === void 0 ? void 0 : taxClassification.id) !== ((_a = formGroup.get('classificacaoTributaria')
1993
+ .value) === null || _a === void 0 ? void 0 : _a.id);
1989
1994
  }))
1990
- .subscribe(function (_a) {
1991
- var _b = __read(_a, 1), taxClassification = _b[0];
1995
+ .subscribe(function (taxClassification) {
1992
1996
  formGroup
1993
1997
  .get('classificacaoTributaria')
1994
1998
  .setValue(taxClassification);