@senior-gestao-empresarial/erpx-components 3.22.0 → 3.23.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.
- package/bundles/senior-gestao-empresarial-erpx-components.umd.js +1082 -340
- package/bundles/senior-gestao-empresarial-erpx-components.umd.js.map +1 -1
- package/bundles/senior-gestao-empresarial-erpx-components.umd.min.js +2 -2
- package/bundles/senior-gestao-empresarial-erpx-components.umd.min.js.map +1 -1
- package/components/tributos/erp-tributos.component.d.ts +2 -1
- package/components/tributos/erp-tributos.types.d.ts +8 -2
- package/components/tributos/rules/calculation/calculation-rules.registry.d.ts +3 -1
- package/components/tributos/rules/calculation/tax-classification-calculation-rule.d.ts +6 -0
- package/components/tributos/rules/calculation/taxable-base-calculation-rule.d.ts +1 -1
- package/components/tributos/rules/rules.service.d.ts +2 -1
- package/components/tributos/rules/types/document-type-field-mapping.d.ts +12 -12
- package/components/tributos/rules/types/rule-payload.d.ts +1 -0
- package/components/tributos/rules/validation/required/net-amount-application-validation-rule.d.ts +6 -0
- package/components/tributos/rules/validation/validation-rules.registry.d.ts +3 -1
- package/components/tributos/tax-reform-utilities.d.ts +8 -4
- package/esm2015/components/tributos/erp-tributos.component.js +87 -62
- package/esm2015/components/tributos/erp-tributos.types.js +10 -3
- package/esm2015/components/tributos/rules/calculation/calculation-rules.registry.js +78 -42
- package/esm2015/components/tributos/rules/calculation/tax-amount-calculation-rule.js +13 -26
- package/esm2015/components/tributos/rules/calculation/tax-classification-calculation-rule.js +47 -0
- package/esm2015/components/tributos/rules/calculation/taxable-base-calculation-rule.js +36 -5
- package/esm2015/components/tributos/rules/rules.service.js +11 -11
- package/esm2015/components/tributos/rules/status/status-rules.registry.js +3 -1
- package/esm2015/components/tributos/rules/status/tax-classification-status-rule.js +4 -30
- package/esm2015/components/tributos/rules/types/document-type-field-mapping.js +33 -23
- package/esm2015/components/tributos/rules/types/rule-payload.js +1 -1
- package/esm2015/components/tributos/rules/validation/required/net-amount-application-validation-rule.js +69 -0
- package/esm2015/components/tributos/rules/validation/required/tax-amount-required-validation-rule.js +117 -15
- package/esm2015/components/tributos/rules/validation/required/tax-classification-required-validation-rule.js +72 -15
- package/esm2015/components/tributos/rules/validation/required/tax-rate-required-validation-rule.js +130 -27
- package/esm2015/components/tributos/rules/validation/required/tax-situation-required-validation-rule.js +16 -14
- package/esm2015/components/tributos/rules/validation/required/taxable-base-required-validation-rule.js +119 -16
- package/esm2015/components/tributos/rules/validation/validation-rules.registry.js +194 -30
- package/esm2015/components/tributos/tax-reform-utilities.js +15 -11
- package/esm2015/senior-gestao-empresarial-erpx-components.js +17 -15
- package/esm5/components/tributos/erp-tributos.component.js +91 -65
- package/esm5/components/tributos/erp-tributos.types.js +10 -3
- package/esm5/components/tributos/rules/calculation/calculation-rules.registry.js +78 -42
- package/esm5/components/tributos/rules/calculation/tax-amount-calculation-rule.js +15 -28
- package/esm5/components/tributos/rules/calculation/tax-classification-calculation-rule.js +50 -0
- package/esm5/components/tributos/rules/calculation/taxable-base-calculation-rule.js +39 -5
- package/esm5/components/tributos/rules/rules.service.js +11 -11
- package/esm5/components/tributos/rules/status/status-rules.registry.js +3 -1
- package/esm5/components/tributos/rules/status/tax-classification-status-rule.js +4 -34
- package/esm5/components/tributos/rules/types/document-type-field-mapping.js +33 -23
- package/esm5/components/tributos/rules/types/rule-payload.js +1 -1
- package/esm5/components/tributos/rules/validation/required/net-amount-application-validation-rule.js +76 -0
- package/esm5/components/tributos/rules/validation/required/tax-amount-required-validation-rule.js +125 -15
- package/esm5/components/tributos/rules/validation/required/tax-classification-required-validation-rule.js +76 -15
- package/esm5/components/tributos/rules/validation/required/tax-rate-required-validation-rule.js +142 -27
- package/esm5/components/tributos/rules/validation/required/tax-situation-required-validation-rule.js +16 -14
- package/esm5/components/tributos/rules/validation/required/taxable-base-required-validation-rule.js +131 -16
- package/esm5/components/tributos/rules/validation/validation-rules.registry.js +194 -30
- package/esm5/components/tributos/tax-reform-utilities.js +16 -11
- package/esm5/senior-gestao-empresarial-erpx-components.js +17 -15
- package/fesm2015/senior-gestao-empresarial-erpx-components.js +1015 -322
- package/fesm2015/senior-gestao-empresarial-erpx-components.js.map +1 -1
- package/fesm5/senior-gestao-empresarial-erpx-components.js +1068 -328
- package/fesm5/senior-gestao-empresarial-erpx-components.js.map +1 -1
- package/package.json +1 -1
- package/senior-gestao-empresarial-erpx-components.d.ts +16 -14
- package/senior-gestao-empresarial-erpx-components.metadata.json +1 -1
|
@@ -586,7 +586,7 @@
|
|
|
586
586
|
EnumCampoTributo["ClassificacaoTributaria"] = "classificacao_tributaria";
|
|
587
587
|
EnumCampoTributo["CstDesoneracao"] = "cst_desoneracao";
|
|
588
588
|
EnumCampoTributo["ClassificacaoTributariaDesoneracao"] = "classificacao_tributaria_desoneracao";
|
|
589
|
-
EnumCampoTributo["
|
|
589
|
+
EnumCampoTributo["AplicarValorLiquidoDocumento"] = "AplicarValorLiquidoDocumento";
|
|
590
590
|
EnumCampoTributo["ClassificacaoTributariaCreditoPresumido"] = "classificacao_tributaria_credito_presumido";
|
|
591
591
|
})(exports.EnumCampoTributo || (exports.EnumCampoTributo = {}));
|
|
592
592
|
|
|
@@ -595,6 +595,7 @@
|
|
|
595
595
|
EnumGrupoTributo["IBS_ESTADUAL"] = "ibs_estadual";
|
|
596
596
|
EnumGrupoTributo["IBS_MUNICIPAL"] = "ibs_municipal";
|
|
597
597
|
EnumGrupoTributo["IBS_MUNICIPAL_DIFERIDO"] = "ibs_municipal_diferido";
|
|
598
|
+
EnumGrupoTributo["IBS_CREDITO_PRESUMIDO"] = "ibs_credito_presumido";
|
|
598
599
|
EnumGrupoTributo["IS"] = "is";
|
|
599
600
|
EnumGrupoTributo["ICMS"] = "icms";
|
|
600
601
|
EnumGrupoTributo["ICMS_ST"] = "icms_st";
|
|
@@ -615,7 +616,6 @@
|
|
|
615
616
|
EnumTipoTributo["CBS_CREDITO_PRESUMIDO"] = "CBS_CREDITO_PRESUMIDO";
|
|
616
617
|
EnumTipoTributo["CBS_TRIBUTACAO_REGULAR"] = "CBS_TRIBUTACAO_REGULAR";
|
|
617
618
|
EnumTipoTributo["CBS_GOVERNAMENTAL"] = "CBS_GOVERNAMENTAL";
|
|
618
|
-
EnumTipoTributo["IBS_ESTADUAL_CREDITO_PRESUMIDO"] = "IBS_ESTADUAL_CREDITO_PRESUMIDO";
|
|
619
619
|
EnumTipoTributo["IBS_ESTADUAL"] = "IBS_ESTADUAL";
|
|
620
620
|
EnumTipoTributo["IBS_ESTADUAL_DIFERIDO"] = "IBS_ESTADUAL_DIFERIDO";
|
|
621
621
|
EnumTipoTributo["IBS_ESTADUAL_TRIBUTACAO_REGULAR"] = "IBS_ESTADUAL_TRIBUTACAO_REGULAR";
|
|
@@ -624,6 +624,7 @@
|
|
|
624
624
|
EnumTipoTributo["IBS_MUNICIPAL_DIFERIDO"] = "IBS_MUNICIPAL_DIFERIDO";
|
|
625
625
|
EnumTipoTributo["IBS_MUNICIPAL_TRIBUTACAO_REGULAR"] = "IBS_MUNICIPAL_TRIBUTACAO_REGULAR";
|
|
626
626
|
EnumTipoTributo["IBS_MUNICIPAL_GOVERNAMENTAL"] = "IBS_MUNICIPAL_GOVERNAMENTAL";
|
|
627
|
+
EnumTipoTributo["IBS_CREDITO_PRESUMIDO"] = "IBS_CREDITO_PRESUMIDO";
|
|
627
628
|
EnumTipoTributo["IS"] = "IS";
|
|
628
629
|
EnumTipoTributo["PIS_FATURAMENTO"] = "PIS_FATURAMENTO";
|
|
629
630
|
EnumTipoTributo["PIS_RECUPERAR"] = "PIS_RECUPERAR";
|
|
@@ -800,6 +801,12 @@
|
|
|
800
801
|
EnumSituacao["VINATIVO"] = "VINATIVO";
|
|
801
802
|
})(exports.EnumSituacao || (exports.EnumSituacao = {}));
|
|
802
803
|
|
|
804
|
+
(function (EnumAplicarValorLiquidoDocumento) {
|
|
805
|
+
EnumAplicarValorLiquidoDocumento["SOMAR"] = "SOMAR";
|
|
806
|
+
EnumAplicarValorLiquidoDocumento["SUBTRAIR"] = "SUBTRAIR";
|
|
807
|
+
EnumAplicarValorLiquidoDocumento["NENHUM"] = "NENHUM";
|
|
808
|
+
})(exports.EnumAplicarValorLiquidoDocumento || (exports.EnumAplicarValorLiquidoDocumento = {}));
|
|
809
|
+
|
|
803
810
|
var isTaxFromTaxReform = function (tax) {
|
|
804
811
|
return (tax === exports.EnumTipoTributo.IS ||
|
|
805
812
|
tax === exports.EnumTipoTributo.CBS ||
|
|
@@ -808,25 +815,27 @@
|
|
|
808
815
|
tax === exports.EnumTipoTributo.CBS_TRIBUTACAO_REGULAR ||
|
|
809
816
|
tax === exports.EnumTipoTributo.CBS_GOVERNAMENTAL ||
|
|
810
817
|
tax === exports.EnumTipoTributo.IBS_ESTADUAL ||
|
|
811
|
-
tax === exports.EnumTipoTributo.IBS_ESTADUAL_CREDITO_PRESUMIDO ||
|
|
812
818
|
tax === exports.EnumTipoTributo.IBS_ESTADUAL_DIFERIDO ||
|
|
813
819
|
tax === exports.EnumTipoTributo.IBS_ESTADUAL_TRIBUTACAO_REGULAR ||
|
|
814
820
|
tax === exports.EnumTipoTributo.IBS_ESTADUAL_GOVERNAMENTAL ||
|
|
815
821
|
tax === exports.EnumTipoTributo.IBS_MUNICIPAL ||
|
|
816
822
|
tax === exports.EnumTipoTributo.IBS_MUNICIPAL_DIFERIDO ||
|
|
817
823
|
tax === exports.EnumTipoTributo.IBS_MUNICIPAL_TRIBUTACAO_REGULAR ||
|
|
818
|
-
tax === exports.EnumTipoTributo.IBS_MUNICIPAL_GOVERNAMENTAL
|
|
824
|
+
tax === exports.EnumTipoTributo.IBS_MUNICIPAL_GOVERNAMENTAL ||
|
|
825
|
+
tax === exports.EnumTipoTributo.IBS_CREDITO_PRESUMIDO);
|
|
819
826
|
};
|
|
820
827
|
var getBaseTaxByGroupTax = function (groupTax) {
|
|
821
828
|
switch (groupTax) {
|
|
822
|
-
case exports.EnumGrupoTributo.IS:
|
|
823
|
-
return exports.EnumTipoTributo.IS;
|
|
824
829
|
case exports.EnumGrupoTributo.CBS:
|
|
825
830
|
return exports.EnumTipoTributo.CBS;
|
|
826
831
|
case exports.EnumGrupoTributo.IBS_ESTADUAL:
|
|
827
832
|
return exports.EnumTipoTributo.IBS_ESTADUAL;
|
|
828
833
|
case exports.EnumGrupoTributo.IBS_MUNICIPAL:
|
|
829
834
|
return exports.EnumTipoTributo.IBS_MUNICIPAL;
|
|
835
|
+
case exports.EnumGrupoTributo.IBS_CREDITO_PRESUMIDO:
|
|
836
|
+
return exports.EnumTipoTributo.IBS_CREDITO_PRESUMIDO;
|
|
837
|
+
case exports.EnumGrupoTributo.IS:
|
|
838
|
+
return exports.EnumTipoTributo.IS;
|
|
830
839
|
default:
|
|
831
840
|
return null;
|
|
832
841
|
}
|
|
@@ -862,8 +871,6 @@
|
|
|
862
871
|
switch (tax) {
|
|
863
872
|
case exports.EnumTipoTributo.CBS:
|
|
864
873
|
return exports.EnumTipoTributo.CBS_CREDITO_PRESUMIDO;
|
|
865
|
-
case exports.EnumTipoTributo.IBS_ESTADUAL:
|
|
866
|
-
return exports.EnumTipoTributo.IBS_ESTADUAL_CREDITO_PRESUMIDO;
|
|
867
874
|
default:
|
|
868
875
|
return null;
|
|
869
876
|
}
|
|
@@ -900,7 +907,6 @@
|
|
|
900
907
|
case exports.EnumTipoTributo.CBS_TRIBUTACAO_REGULAR:
|
|
901
908
|
return exports.EnumTipoTributo.CBS_TRIBUTACAO_REGULAR;
|
|
902
909
|
case exports.EnumTipoTributo.IBS_ESTADUAL:
|
|
903
|
-
case exports.EnumTipoTributo.IBS_ESTADUAL_CREDITO_PRESUMIDO:
|
|
904
910
|
case exports.EnumTipoTributo.IBS_ESTADUAL_TRIBUTACAO_REGULAR:
|
|
905
911
|
case exports.EnumTipoTributo.IBS_ESTADUAL_DIFERIDO:
|
|
906
912
|
return exports.EnumTipoTributo.CBS_TRIBUTACAO_REGULAR;
|
|
@@ -921,13 +927,14 @@
|
|
|
921
927
|
return exports.EnumTipoTributo.CBS;
|
|
922
928
|
case exports.EnumTipoTributo.IBS_ESTADUAL:
|
|
923
929
|
case exports.EnumTipoTributo.IBS_ESTADUAL_DIFERIDO:
|
|
924
|
-
case exports.EnumTipoTributo.IBS_ESTADUAL_CREDITO_PRESUMIDO:
|
|
925
930
|
case exports.EnumTipoTributo.IBS_ESTADUAL_TRIBUTACAO_REGULAR:
|
|
926
931
|
return exports.EnumTipoTributo.IBS_ESTADUAL;
|
|
927
932
|
case exports.EnumTipoTributo.IBS_MUNICIPAL:
|
|
928
933
|
case exports.EnumTipoTributo.IBS_MUNICIPAL_DIFERIDO:
|
|
929
934
|
case exports.EnumTipoTributo.IBS_MUNICIPAL_TRIBUTACAO_REGULAR:
|
|
930
935
|
return exports.EnumTipoTributo.IBS_MUNICIPAL;
|
|
936
|
+
case exports.EnumTipoTributo.IBS_CREDITO_PRESUMIDO:
|
|
937
|
+
return exports.EnumTipoTributo.IBS_CREDITO_PRESUMIDO;
|
|
931
938
|
default:
|
|
932
939
|
return null;
|
|
933
940
|
}
|
|
@@ -941,13 +948,14 @@
|
|
|
941
948
|
return exports.EnumTipoTributo.CBS_TRIBUTACAO_REGULAR;
|
|
942
949
|
case exports.EnumTipoTributo.IBS_ESTADUAL:
|
|
943
950
|
case exports.EnumTipoTributo.IBS_ESTADUAL_DIFERIDO:
|
|
944
|
-
case exports.EnumTipoTributo.IBS_ESTADUAL_CREDITO_PRESUMIDO:
|
|
945
951
|
case exports.EnumTipoTributo.IBS_ESTADUAL_TRIBUTACAO_REGULAR:
|
|
946
952
|
return exports.EnumTipoTributo.IBS_ESTADUAL_TRIBUTACAO_REGULAR;
|
|
947
953
|
case exports.EnumTipoTributo.IBS_MUNICIPAL:
|
|
948
954
|
case exports.EnumTipoTributo.IBS_MUNICIPAL_DIFERIDO:
|
|
949
955
|
case exports.EnumTipoTributo.IBS_MUNICIPAL_TRIBUTACAO_REGULAR:
|
|
950
956
|
return exports.EnumTipoTributo.IBS_MUNICIPAL_TRIBUTACAO_REGULAR;
|
|
957
|
+
case exports.EnumTipoTributo.IBS_CREDITO_PRESUMIDO:
|
|
958
|
+
return exports.EnumTipoTributo.IBS_CREDITO_PRESUMIDO;
|
|
951
959
|
default:
|
|
952
960
|
return null;
|
|
953
961
|
}
|
|
@@ -975,7 +983,7 @@
|
|
|
975
983
|
var isPresumedCreditTax = function (tax) {
|
|
976
984
|
switch (tax) {
|
|
977
985
|
case exports.EnumTipoTributo.CBS_CREDITO_PRESUMIDO:
|
|
978
|
-
case exports.EnumTipoTributo.
|
|
986
|
+
case exports.EnumTipoTributo.IBS_CREDITO_PRESUMIDO:
|
|
979
987
|
return true;
|
|
980
988
|
default:
|
|
981
989
|
return false;
|
|
@@ -1001,6 +1009,10 @@
|
|
|
1001
1009
|
return false;
|
|
1002
1010
|
}
|
|
1003
1011
|
};
|
|
1012
|
+
var getGroupByGroupTax = function (_a) {
|
|
1013
|
+
var groups = _a.groups, groupTax = _a.groupTax;
|
|
1014
|
+
return groups.find(function (group) { return group.grupoTributo === groupTax; });
|
|
1015
|
+
};
|
|
1004
1016
|
var getBaseTaxItemFromGroup = function (_a) {
|
|
1005
1017
|
var group = _a.group;
|
|
1006
1018
|
var baseTax = getBaseTaxByGroupTax(group.grupoTributo);
|
|
@@ -1360,10 +1372,10 @@
|
|
|
1360
1372
|
case exports.EnumTipoTributo.IBS_ESTADUAL_DIFERIDO:
|
|
1361
1373
|
case exports.EnumTipoTributo.IBS_MUNICIPAL_DIFERIDO:
|
|
1362
1374
|
case exports.EnumTipoTributo.CBS_CREDITO_PRESUMIDO:
|
|
1363
|
-
case exports.EnumTipoTributo.IBS_ESTADUAL_CREDITO_PRESUMIDO:
|
|
1364
1375
|
case exports.EnumTipoTributo.CBS_TRIBUTACAO_REGULAR:
|
|
1365
1376
|
case exports.EnumTipoTributo.IBS_ESTADUAL_TRIBUTACAO_REGULAR:
|
|
1366
1377
|
case exports.EnumTipoTributo.IBS_MUNICIPAL_TRIBUTACAO_REGULAR:
|
|
1378
|
+
case exports.EnumTipoTributo.IBS_CREDITO_PRESUMIDO:
|
|
1367
1379
|
case exports.EnumTipoTributo.IS:
|
|
1368
1380
|
{
|
|
1369
1381
|
switch (documentType) {
|
|
@@ -1399,7 +1411,7 @@
|
|
|
1399
1411
|
}
|
|
1400
1412
|
break;
|
|
1401
1413
|
default:
|
|
1402
|
-
|
|
1414
|
+
throw new Error("Regra TaxAmountCalculationRule n\u00E3o implementada para o imposto " + taxType + ", documento " + documentType + ".");
|
|
1403
1415
|
}
|
|
1404
1416
|
}
|
|
1405
1417
|
break;
|
|
@@ -1413,37 +1425,24 @@
|
|
|
1413
1425
|
case exports.EnumTipoDocumento.PEDIDO_COMPRA:
|
|
1414
1426
|
case exports.EnumTipoDocumento.PEDIDO_VENDA:
|
|
1415
1427
|
{
|
|
1416
|
-
var baseTaxFormGroup = getBaseTaxItemFromGroup({ group: group }).formGroup;
|
|
1417
1428
|
rxjs.combineLatest([
|
|
1418
|
-
|
|
1429
|
+
formGroup
|
|
1419
1430
|
.get('baseCalculo')
|
|
1420
|
-
.valueChanges.pipe(operators.startWith(
|
|
1421
|
-
|
|
1431
|
+
.valueChanges.pipe(operators.startWith(formGroup.get('baseCalculo').value), operators.distinctUntilChanged()),
|
|
1432
|
+
formGroup
|
|
1422
1433
|
.get('aliquota')
|
|
1423
|
-
.valueChanges.pipe(operators.startWith(
|
|
1424
|
-
baseTaxFormGroup
|
|
1425
|
-
.get('reducaoAliquota')
|
|
1426
|
-
.valueChanges.pipe(operators.startWith(baseTaxFormGroup.get('reducaoAliquota').value), operators.distinctUntilChanged()),
|
|
1427
|
-
baseTaxFormGroup
|
|
1428
|
-
.get('reducaoAliquotaGovernamental')
|
|
1429
|
-
.valueChanges.pipe(operators.startWith(baseTaxFormGroup.get('reducaoAliquotaGovernamental').value), operators.distinctUntilChanged())
|
|
1434
|
+
.valueChanges.pipe(operators.startWith(formGroup.get('aliquota').value), operators.distinctUntilChanged())
|
|
1430
1435
|
])
|
|
1431
1436
|
.pipe(operators.skip(1), operators.map(function (_a) {
|
|
1432
|
-
var _b = __read(_a,
|
|
1433
|
-
return [
|
|
1434
|
-
new BigNumber(baseTaxTaxableBase),
|
|
1435
|
-
new BigNumber(baseTaxTaxRate),
|
|
1436
|
-
new BigNumber(baseTaxTaxRateReduction),
|
|
1437
|
-
new BigNumber(governamentalTaxRateReduction)
|
|
1438
|
-
];
|
|
1437
|
+
var _b = __read(_a, 2), taxableBase = _b[0], taxRate = _b[1];
|
|
1438
|
+
return [new BigNumber(taxableBase), new BigNumber(taxRate)];
|
|
1439
1439
|
}), operators.map(function (_a) {
|
|
1440
|
-
var _b = __read(_a,
|
|
1441
|
-
if (
|
|
1440
|
+
var _b = __read(_a, 2), taxableBase = _b[0], taxRate = _b[1];
|
|
1441
|
+
if (taxableBase.isNaN() || taxRate.isNaN())
|
|
1442
1442
|
return null;
|
|
1443
|
-
var taxAmount = _this.taxAmountCalculator.
|
|
1444
|
-
|
|
1445
|
-
taxRate:
|
|
1446
|
-
taxRateReduction: baseTaxTaxRateReduction
|
|
1443
|
+
var taxAmount = _this.taxAmountCalculator.calculateTaxAmount({
|
|
1444
|
+
taxableBase: taxableBase,
|
|
1445
|
+
taxRate: taxRate
|
|
1447
1446
|
});
|
|
1448
1447
|
return taxAmount.decimalPlaces(2).toNumber();
|
|
1449
1448
|
}), operators.filter(function (taxAmount) { return taxAmount !== formGroup.get('valor').value; }))
|
|
@@ -1550,7 +1549,7 @@
|
|
|
1550
1549
|
}
|
|
1551
1550
|
TaxableBaseCalculationRule.prototype.apply = function (_a) {
|
|
1552
1551
|
var _this = this;
|
|
1553
|
-
var documentType = _a.documentType, group = _a.group, _b = _a.item, taxType = _b.name, formGroup = _b.formGroup;
|
|
1552
|
+
var documentType = _a.documentType, groups = _a.groups, group = _a.group, _b = _a.item, taxType = _b.name, formGroup = _b.formGroup;
|
|
1554
1553
|
switch (taxType) {
|
|
1555
1554
|
case exports.EnumTipoTributo.CBS_DIFERIDO:
|
|
1556
1555
|
case exports.EnumTipoTributo.IBS_ESTADUAL_DIFERIDO:
|
|
@@ -1606,7 +1605,6 @@
|
|
|
1606
1605
|
}
|
|
1607
1606
|
break;
|
|
1608
1607
|
case exports.EnumTipoTributo.CBS_CREDITO_PRESUMIDO:
|
|
1609
|
-
case exports.EnumTipoTributo.IBS_ESTADUAL_CREDITO_PRESUMIDO:
|
|
1610
1608
|
{
|
|
1611
1609
|
switch (documentType) {
|
|
1612
1610
|
case exports.EnumTipoDocumento.NF_ENTRADA:
|
|
@@ -1714,6 +1712,41 @@
|
|
|
1714
1712
|
}
|
|
1715
1713
|
}
|
|
1716
1714
|
break;
|
|
1715
|
+
case exports.EnumTipoTributo.IBS_CREDITO_PRESUMIDO:
|
|
1716
|
+
{
|
|
1717
|
+
switch (documentType) {
|
|
1718
|
+
case exports.EnumTipoDocumento.NF_ENTRADA:
|
|
1719
|
+
case exports.EnumTipoDocumento.NF_SAIDA:
|
|
1720
|
+
case exports.EnumTipoDocumento.PEDIDO_COMPRA:
|
|
1721
|
+
case exports.EnumTipoDocumento.PEDIDO_VENDA:
|
|
1722
|
+
{
|
|
1723
|
+
rxjs.combineLatest([formGroup.get('aliquota').valueChanges.pipe(operators.startWith(formGroup.get('aliquota').value))])
|
|
1724
|
+
.pipe(operators.skip(1), operators.filter(function () { return new BigNumber(formGroup.get('baseCalculo').value).isNaN(); }), operators.map(function (_a) {
|
|
1725
|
+
var _b = __read(_a, 1), taxRate = _b[0];
|
|
1726
|
+
return [new BigNumber(taxRate)];
|
|
1727
|
+
}), operators.map(function () {
|
|
1728
|
+
var taxableBase = [exports.EnumGrupoTributo.IBS_ESTADUAL, exports.EnumGrupoTributo.IBS_MUNICIPAL]
|
|
1729
|
+
.map(function (groupTax) {
|
|
1730
|
+
var _a;
|
|
1731
|
+
var group = getGroupByGroupTax({ groups: groups, groupTax: groupTax });
|
|
1732
|
+
if (!group)
|
|
1733
|
+
return new BigNumber(0);
|
|
1734
|
+
var formGroup = getBaseTaxItemFromGroup({ group: group }).formGroup;
|
|
1735
|
+
return new BigNumber((_a = formGroup.get('valor').value) !== null && _a !== void 0 ? _a : 0);
|
|
1736
|
+
})
|
|
1737
|
+
.reduce(function (acc, val) { return acc.plus(val); }, new BigNumber(0));
|
|
1738
|
+
return taxableBase.decimalPlaces(2).toNumber();
|
|
1739
|
+
}), operators.filter(function (taxableBase) { return taxableBase !== formGroup.get('baseCalculo').value; }))
|
|
1740
|
+
.subscribe(function (taxableBase) {
|
|
1741
|
+
formGroup.get('baseCalculo').setValue(taxableBase);
|
|
1742
|
+
});
|
|
1743
|
+
}
|
|
1744
|
+
break;
|
|
1745
|
+
default:
|
|
1746
|
+
throw new Error("Regra TaxableBaseCalculationRule n\u00E3o implementada para o imposto " + taxType + ", documento " + documentType + ".");
|
|
1747
|
+
}
|
|
1748
|
+
}
|
|
1749
|
+
break;
|
|
1717
1750
|
default:
|
|
1718
1751
|
throw new Error("Regra TaxableBaseCalculationRule n\u00E3o implementada para o imposto " + taxType + ", documento " + documentType + ".");
|
|
1719
1752
|
}
|
|
@@ -1728,14 +1761,58 @@
|
|
|
1728
1761
|
return TaxableBaseCalculationRule;
|
|
1729
1762
|
}());
|
|
1730
1763
|
|
|
1764
|
+
var TaxClassificationCalculationRule = /** @class */ (function () {
|
|
1765
|
+
function TaxClassificationCalculationRule() {
|
|
1766
|
+
}
|
|
1767
|
+
TaxClassificationCalculationRule.prototype.apply = function (_a) {
|
|
1768
|
+
var documentType = _a.documentType, _b = _a.item, taxType = _b.name, formGroup = _b.formGroup, formField = _b.formField;
|
|
1769
|
+
switch (taxType) {
|
|
1770
|
+
case exports.EnumTipoTributo.CBS:
|
|
1771
|
+
case exports.EnumTipoTributo.IBS_ESTADUAL:
|
|
1772
|
+
case exports.EnumTipoTributo.IBS_MUNICIPAL:
|
|
1773
|
+
case exports.EnumTipoTributo.IS:
|
|
1774
|
+
{
|
|
1775
|
+
switch (documentType) {
|
|
1776
|
+
case exports.EnumTipoDocumento.NF_ENTRADA:
|
|
1777
|
+
case exports.EnumTipoDocumento.NF_SAIDA:
|
|
1778
|
+
case exports.EnumTipoDocumento.PEDIDO_COMPRA:
|
|
1779
|
+
case exports.EnumTipoDocumento.PEDIDO_VENDA:
|
|
1780
|
+
{
|
|
1781
|
+
var dataKey_1 = formField.find(function (field) { return field.name === 'situacaoTributaria'; }).dataKey;
|
|
1782
|
+
rxjs.combineLatest([
|
|
1783
|
+
formGroup.get('situacaoTributaria').valueChanges.pipe(operators.startWith(formGroup.get('situacaoTributaria').value), operators.distinctUntilChanged(function (old, current) { return (old === null || old === void 0 ? void 0 : old[dataKey_1]) === (current === null || current === void 0 ? void 0 : current[dataKey_1]); }))
|
|
1784
|
+
])
|
|
1785
|
+
.pipe(operators.skip(1), operators.map(function () { return null; }), operators.filter(function (taxClassification) { var _a; return (taxClassification === null || taxClassification === void 0 ? void 0 : taxClassification.id) !== ((_a = formGroup.get('classificacaoTributaria').value) === null || _a === void 0 ? void 0 : _a.id); }))
|
|
1786
|
+
.subscribe(function (taxClassification) {
|
|
1787
|
+
formGroup.get('classificacaoTributaria').setValue(taxClassification);
|
|
1788
|
+
});
|
|
1789
|
+
}
|
|
1790
|
+
break;
|
|
1791
|
+
default:
|
|
1792
|
+
throw new Error("Regra TaxClassificationCalculationRule n\u00E3o implementada para o imposto " + taxType + ", documento " + documentType + ".");
|
|
1793
|
+
}
|
|
1794
|
+
}
|
|
1795
|
+
break;
|
|
1796
|
+
default:
|
|
1797
|
+
throw new Error("Regra TaxClassificationCalculationRule n\u00E3o implementada para o imposto " + taxType + ", documento " + documentType + ".");
|
|
1798
|
+
}
|
|
1799
|
+
};
|
|
1800
|
+
TaxClassificationCalculationRule.ɵprov = core.ɵɵdefineInjectable({ factory: function TaxClassificationCalculationRule_Factory() { return new TaxClassificationCalculationRule(); }, token: TaxClassificationCalculationRule, providedIn: "root" });
|
|
1801
|
+
TaxClassificationCalculationRule = __decorate([
|
|
1802
|
+
core.Injectable({ providedIn: 'root' })
|
|
1803
|
+
], TaxClassificationCalculationRule);
|
|
1804
|
+
return TaxClassificationCalculationRule;
|
|
1805
|
+
}());
|
|
1806
|
+
|
|
1731
1807
|
var CalculationRulesRegistry = /** @class */ (function () {
|
|
1732
|
-
function CalculationRulesRegistry(taxableBaseCalculationRule, taxRateCalculationRule, effectiveTaxRateCalculationRule, taxAmountCalculationRule, grossAmountCalculationRule) {
|
|
1808
|
+
function CalculationRulesRegistry(taxableBaseCalculationRule, taxRateCalculationRule, effectiveTaxRateCalculationRule, taxAmountCalculationRule, grossAmountCalculationRule, taxClassificationCalculationRule) {
|
|
1733
1809
|
var _a, _b, _c, _d, _e;
|
|
1734
1810
|
this.taxableBaseCalculationRule = taxableBaseCalculationRule;
|
|
1735
1811
|
this.taxRateCalculationRule = taxRateCalculationRule;
|
|
1736
1812
|
this.effectiveTaxRateCalculationRule = effectiveTaxRateCalculationRule;
|
|
1737
1813
|
this.taxAmountCalculationRule = taxAmountCalculationRule;
|
|
1738
1814
|
this.grossAmountCalculationRule = grossAmountCalculationRule;
|
|
1815
|
+
this.taxClassificationCalculationRule = taxClassificationCalculationRule;
|
|
1739
1816
|
this.strategies = (_a = {},
|
|
1740
1817
|
_a[exports.EnumTipoDocumento.NF_ENTRADA] = (_b = {},
|
|
1741
1818
|
_b[exports.EnumTipoTributo.CBS] = [
|
|
@@ -1750,6 +1827,10 @@
|
|
|
1750
1827
|
{
|
|
1751
1828
|
field: exports.EnumCampoTributo.Valor,
|
|
1752
1829
|
rule: this.taxAmountCalculationRule
|
|
1830
|
+
},
|
|
1831
|
+
{
|
|
1832
|
+
field: exports.EnumCampoTributo.ClassificacaoTributaria,
|
|
1833
|
+
rule: this.taxClassificationCalculationRule
|
|
1753
1834
|
}
|
|
1754
1835
|
],
|
|
1755
1836
|
_b[exports.EnumTipoTributo.CBS_DIFERIDO] = [
|
|
@@ -1808,19 +1889,13 @@
|
|
|
1808
1889
|
{
|
|
1809
1890
|
field: exports.EnumCampoTributo.Valor,
|
|
1810
1891
|
rule: this.taxAmountCalculationRule
|
|
1811
|
-
}
|
|
1812
|
-
],
|
|
1813
|
-
_b[exports.EnumTipoTributo.IBS_ESTADUAL_DIFERIDO] = [
|
|
1814
|
-
{
|
|
1815
|
-
field: exports.EnumCampoTributo.BaseCalculo,
|
|
1816
|
-
rule: this.taxableBaseCalculationRule
|
|
1817
1892
|
},
|
|
1818
1893
|
{
|
|
1819
|
-
field: exports.EnumCampoTributo.
|
|
1820
|
-
rule: this.
|
|
1894
|
+
field: exports.EnumCampoTributo.ClassificacaoTributaria,
|
|
1895
|
+
rule: this.taxClassificationCalculationRule
|
|
1821
1896
|
}
|
|
1822
1897
|
],
|
|
1823
|
-
_b[exports.EnumTipoTributo.
|
|
1898
|
+
_b[exports.EnumTipoTributo.IBS_ESTADUAL_DIFERIDO] = [
|
|
1824
1899
|
{
|
|
1825
1900
|
field: exports.EnumCampoTributo.BaseCalculo,
|
|
1826
1901
|
rule: this.taxableBaseCalculationRule
|
|
@@ -1866,6 +1941,10 @@
|
|
|
1866
1941
|
{
|
|
1867
1942
|
field: exports.EnumCampoTributo.Valor,
|
|
1868
1943
|
rule: this.taxAmountCalculationRule
|
|
1944
|
+
},
|
|
1945
|
+
{
|
|
1946
|
+
field: exports.EnumCampoTributo.ClassificacaoTributaria,
|
|
1947
|
+
rule: this.taxClassificationCalculationRule
|
|
1869
1948
|
}
|
|
1870
1949
|
],
|
|
1871
1950
|
_b[exports.EnumTipoTributo.IBS_MUNICIPAL_DIFERIDO] = [
|
|
@@ -1902,10 +1981,24 @@
|
|
|
1902
1981
|
rule: this.taxAmountCalculationRule
|
|
1903
1982
|
}
|
|
1904
1983
|
],
|
|
1984
|
+
_b[exports.EnumTipoTributo.IBS_CREDITO_PRESUMIDO] = [
|
|
1985
|
+
{
|
|
1986
|
+
field: exports.EnumCampoTributo.BaseCalculo,
|
|
1987
|
+
rule: this.taxableBaseCalculationRule
|
|
1988
|
+
},
|
|
1989
|
+
{
|
|
1990
|
+
field: exports.EnumCampoTributo.Valor,
|
|
1991
|
+
rule: this.taxAmountCalculationRule
|
|
1992
|
+
}
|
|
1993
|
+
],
|
|
1905
1994
|
_b[exports.EnumTipoTributo.IS] = [
|
|
1906
1995
|
{
|
|
1907
1996
|
field: exports.EnumCampoTributo.Valor,
|
|
1908
1997
|
rule: this.taxAmountCalculationRule
|
|
1998
|
+
},
|
|
1999
|
+
{
|
|
2000
|
+
field: exports.EnumCampoTributo.ClassificacaoTributaria,
|
|
2001
|
+
rule: this.taxClassificationCalculationRule
|
|
1909
2002
|
}
|
|
1910
2003
|
],
|
|
1911
2004
|
_b),
|
|
@@ -1922,6 +2015,10 @@
|
|
|
1922
2015
|
{
|
|
1923
2016
|
field: exports.EnumCampoTributo.Valor,
|
|
1924
2017
|
rule: this.taxAmountCalculationRule
|
|
2018
|
+
},
|
|
2019
|
+
{
|
|
2020
|
+
field: exports.EnumCampoTributo.ClassificacaoTributaria,
|
|
2021
|
+
rule: this.taxClassificationCalculationRule
|
|
1925
2022
|
}
|
|
1926
2023
|
],
|
|
1927
2024
|
_c[exports.EnumTipoTributo.CBS_DIFERIDO] = [
|
|
@@ -1980,19 +2077,13 @@
|
|
|
1980
2077
|
{
|
|
1981
2078
|
field: exports.EnumCampoTributo.Valor,
|
|
1982
2079
|
rule: this.taxAmountCalculationRule
|
|
1983
|
-
}
|
|
1984
|
-
],
|
|
1985
|
-
_c[exports.EnumTipoTributo.IBS_ESTADUAL_DIFERIDO] = [
|
|
1986
|
-
{
|
|
1987
|
-
field: exports.EnumCampoTributo.BaseCalculo,
|
|
1988
|
-
rule: this.taxableBaseCalculationRule
|
|
1989
2080
|
},
|
|
1990
2081
|
{
|
|
1991
|
-
field: exports.EnumCampoTributo.
|
|
1992
|
-
rule: this.
|
|
2082
|
+
field: exports.EnumCampoTributo.ClassificacaoTributaria,
|
|
2083
|
+
rule: this.taxClassificationCalculationRule
|
|
1993
2084
|
}
|
|
1994
2085
|
],
|
|
1995
|
-
_c[exports.EnumTipoTributo.
|
|
2086
|
+
_c[exports.EnumTipoTributo.IBS_ESTADUAL_DIFERIDO] = [
|
|
1996
2087
|
{
|
|
1997
2088
|
field: exports.EnumCampoTributo.BaseCalculo,
|
|
1998
2089
|
rule: this.taxableBaseCalculationRule
|
|
@@ -2038,6 +2129,10 @@
|
|
|
2038
2129
|
{
|
|
2039
2130
|
field: exports.EnumCampoTributo.Valor,
|
|
2040
2131
|
rule: this.taxAmountCalculationRule
|
|
2132
|
+
},
|
|
2133
|
+
{
|
|
2134
|
+
field: exports.EnumCampoTributo.ClassificacaoTributaria,
|
|
2135
|
+
rule: this.taxClassificationCalculationRule
|
|
2041
2136
|
}
|
|
2042
2137
|
],
|
|
2043
2138
|
_c[exports.EnumTipoTributo.IBS_MUNICIPAL_DIFERIDO] = [
|
|
@@ -2074,10 +2169,24 @@
|
|
|
2074
2169
|
rule: this.taxAmountCalculationRule
|
|
2075
2170
|
}
|
|
2076
2171
|
],
|
|
2172
|
+
_c[exports.EnumTipoTributo.IBS_CREDITO_PRESUMIDO] = [
|
|
2173
|
+
{
|
|
2174
|
+
field: exports.EnumCampoTributo.BaseCalculo,
|
|
2175
|
+
rule: this.taxableBaseCalculationRule
|
|
2176
|
+
},
|
|
2177
|
+
{
|
|
2178
|
+
field: exports.EnumCampoTributo.Valor,
|
|
2179
|
+
rule: this.taxAmountCalculationRule
|
|
2180
|
+
}
|
|
2181
|
+
],
|
|
2077
2182
|
_c[exports.EnumTipoTributo.IS] = [
|
|
2078
2183
|
{
|
|
2079
2184
|
field: exports.EnumCampoTributo.Valor,
|
|
2080
2185
|
rule: this.taxAmountCalculationRule
|
|
2186
|
+
},
|
|
2187
|
+
{
|
|
2188
|
+
field: exports.EnumCampoTributo.ClassificacaoTributaria,
|
|
2189
|
+
rule: this.taxClassificationCalculationRule
|
|
2081
2190
|
}
|
|
2082
2191
|
],
|
|
2083
2192
|
_c),
|
|
@@ -2164,16 +2273,6 @@
|
|
|
2164
2273
|
rule: this.taxAmountCalculationRule
|
|
2165
2274
|
}
|
|
2166
2275
|
],
|
|
2167
|
-
_d[exports.EnumTipoTributo.IBS_ESTADUAL_CREDITO_PRESUMIDO] = [
|
|
2168
|
-
{
|
|
2169
|
-
field: exports.EnumCampoTributo.BaseCalculo,
|
|
2170
|
-
rule: this.taxableBaseCalculationRule
|
|
2171
|
-
},
|
|
2172
|
-
{
|
|
2173
|
-
field: exports.EnumCampoTributo.Valor,
|
|
2174
|
-
rule: this.taxAmountCalculationRule
|
|
2175
|
-
}
|
|
2176
|
-
],
|
|
2177
2276
|
_d[exports.EnumTipoTributo.IBS_ESTADUAL_TRIBUTACAO_REGULAR] = [
|
|
2178
2277
|
{
|
|
2179
2278
|
field: exports.EnumCampoTributo.BaseCalculo,
|
|
@@ -2246,6 +2345,16 @@
|
|
|
2246
2345
|
rule: this.taxAmountCalculationRule
|
|
2247
2346
|
}
|
|
2248
2347
|
],
|
|
2348
|
+
_d[exports.EnumTipoTributo.IBS_CREDITO_PRESUMIDO] = [
|
|
2349
|
+
{
|
|
2350
|
+
field: exports.EnumCampoTributo.BaseCalculo,
|
|
2351
|
+
rule: this.taxableBaseCalculationRule
|
|
2352
|
+
},
|
|
2353
|
+
{
|
|
2354
|
+
field: exports.EnumCampoTributo.Valor,
|
|
2355
|
+
rule: this.taxAmountCalculationRule
|
|
2356
|
+
}
|
|
2357
|
+
],
|
|
2249
2358
|
_d[exports.EnumTipoTributo.IS] = [
|
|
2250
2359
|
{
|
|
2251
2360
|
field: exports.EnumCampoTributo.Valor,
|
|
@@ -2336,16 +2445,6 @@
|
|
|
2336
2445
|
rule: this.taxAmountCalculationRule
|
|
2337
2446
|
}
|
|
2338
2447
|
],
|
|
2339
|
-
_e[exports.EnumTipoTributo.IBS_ESTADUAL_CREDITO_PRESUMIDO] = [
|
|
2340
|
-
{
|
|
2341
|
-
field: exports.EnumCampoTributo.BaseCalculo,
|
|
2342
|
-
rule: this.taxableBaseCalculationRule
|
|
2343
|
-
},
|
|
2344
|
-
{
|
|
2345
|
-
field: exports.EnumCampoTributo.Valor,
|
|
2346
|
-
rule: this.taxAmountCalculationRule
|
|
2347
|
-
}
|
|
2348
|
-
],
|
|
2349
2448
|
_e[exports.EnumTipoTributo.IBS_ESTADUAL_TRIBUTACAO_REGULAR] = [
|
|
2350
2449
|
{
|
|
2351
2450
|
field: exports.EnumCampoTributo.BaseCalculo,
|
|
@@ -2418,6 +2517,16 @@
|
|
|
2418
2517
|
rule: this.taxAmountCalculationRule
|
|
2419
2518
|
}
|
|
2420
2519
|
],
|
|
2520
|
+
_e[exports.EnumTipoTributo.IBS_CREDITO_PRESUMIDO] = [
|
|
2521
|
+
{
|
|
2522
|
+
field: exports.EnumCampoTributo.BaseCalculo,
|
|
2523
|
+
rule: this.taxableBaseCalculationRule
|
|
2524
|
+
},
|
|
2525
|
+
{
|
|
2526
|
+
field: exports.EnumCampoTributo.Valor,
|
|
2527
|
+
rule: this.taxAmountCalculationRule
|
|
2528
|
+
}
|
|
2529
|
+
],
|
|
2421
2530
|
_e[exports.EnumTipoTributo.IS] = [
|
|
2422
2531
|
{
|
|
2423
2532
|
field: exports.EnumCampoTributo.Valor,
|
|
@@ -2436,9 +2545,10 @@
|
|
|
2436
2545
|
{ type: TaxRateCalculationRule },
|
|
2437
2546
|
{ type: EffectiveTaxRateCalculationRule },
|
|
2438
2547
|
{ type: TaxAmountCalculationRule },
|
|
2439
|
-
{ type: GrossAmountCalculationRule }
|
|
2548
|
+
{ type: GrossAmountCalculationRule },
|
|
2549
|
+
{ type: TaxClassificationCalculationRule }
|
|
2440
2550
|
]; };
|
|
2441
|
-
CalculationRulesRegistry.ɵprov = core.ɵɵdefineInjectable({ factory: function CalculationRulesRegistry_Factory() { return new CalculationRulesRegistry(core.ɵɵinject(TaxableBaseCalculationRule), core.ɵɵinject(TaxRateCalculationRule), core.ɵɵinject(EffectiveTaxRateCalculationRule), core.ɵɵinject(TaxAmountCalculationRule), core.ɵɵinject(GrossAmountCalculationRule)); }, token: CalculationRulesRegistry, providedIn: "root" });
|
|
2551
|
+
CalculationRulesRegistry.ɵprov = core.ɵɵdefineInjectable({ factory: function CalculationRulesRegistry_Factory() { return new CalculationRulesRegistry(core.ɵɵinject(TaxableBaseCalculationRule), core.ɵɵinject(TaxRateCalculationRule), core.ɵɵinject(EffectiveTaxRateCalculationRule), core.ɵɵinject(TaxAmountCalculationRule), core.ɵɵinject(GrossAmountCalculationRule), core.ɵɵinject(TaxClassificationCalculationRule)); }, token: CalculationRulesRegistry, providedIn: "root" });
|
|
2442
2552
|
CalculationRulesRegistry = __decorate([
|
|
2443
2553
|
core.Injectable({ providedIn: 'root' })
|
|
2444
2554
|
], CalculationRulesRegistry);
|
|
@@ -2452,42 +2562,12 @@
|
|
|
2452
2562
|
var documentType = _a.documentType, _b = _a.item, taxType = _b.name, formGroup = _b.formGroup;
|
|
2453
2563
|
switch (taxType) {
|
|
2454
2564
|
case exports.EnumTipoTributo.CBS:
|
|
2455
|
-
case exports.EnumTipoTributo.IBS_ESTADUAL:
|
|
2456
|
-
case exports.EnumTipoTributo.IBS_MUNICIPAL:
|
|
2457
|
-
case exports.EnumTipoTributo.IS:
|
|
2458
|
-
{
|
|
2459
|
-
switch (documentType) {
|
|
2460
|
-
case exports.EnumTipoDocumento.NF_ENTRADA:
|
|
2461
|
-
case exports.EnumTipoDocumento.NF_SAIDA:
|
|
2462
|
-
{
|
|
2463
|
-
rxjs.combineLatest([
|
|
2464
|
-
formGroup
|
|
2465
|
-
.get('situacaoTributaria')
|
|
2466
|
-
.valueChanges.pipe(operators.startWith(formGroup.get('situacaoTributaria').value))
|
|
2467
|
-
])
|
|
2468
|
-
.pipe(operators.map(function (_a) {
|
|
2469
|
-
var _b = __read(_a, 1), taxSituation = _b[0];
|
|
2470
|
-
return [taxSituation];
|
|
2471
|
-
}))
|
|
2472
|
-
.subscribe(function (_a) {
|
|
2473
|
-
var _b = __read(_a, 1), taxSituation = _b[0];
|
|
2474
|
-
if (taxSituation) {
|
|
2475
|
-
formGroup.get('classificacaoTributaria').enable({ emitEvent: false });
|
|
2476
|
-
}
|
|
2477
|
-
else {
|
|
2478
|
-
formGroup.get('classificacaoTributaria').disable({ emitEvent: false });
|
|
2479
|
-
}
|
|
2480
|
-
});
|
|
2481
|
-
}
|
|
2482
|
-
break;
|
|
2483
|
-
default:
|
|
2484
|
-
throw new Error("Regra TaxClassificationStatusRule n\u00E3o implementada para o imposto " + taxType + ", documento " + documentType + ".");
|
|
2485
|
-
}
|
|
2486
|
-
}
|
|
2487
|
-
break;
|
|
2488
2565
|
case exports.EnumTipoTributo.CBS_TRIBUTACAO_REGULAR:
|
|
2566
|
+
case exports.EnumTipoTributo.IBS_ESTADUAL:
|
|
2489
2567
|
case exports.EnumTipoTributo.IBS_ESTADUAL_TRIBUTACAO_REGULAR:
|
|
2568
|
+
case exports.EnumTipoTributo.IBS_MUNICIPAL:
|
|
2490
2569
|
case exports.EnumTipoTributo.IBS_MUNICIPAL_TRIBUTACAO_REGULAR:
|
|
2570
|
+
case exports.EnumTipoTributo.IS:
|
|
2491
2571
|
{
|
|
2492
2572
|
switch (documentType) {
|
|
2493
2573
|
case exports.EnumTipoDocumento.NF_ENTRADA:
|
|
@@ -2571,6 +2651,7 @@
|
|
|
2571
2651
|
rule: this.taxClassificationStatusRule
|
|
2572
2652
|
}
|
|
2573
2653
|
],
|
|
2654
|
+
_b[exports.EnumTipoTributo.IBS_CREDITO_PRESUMIDO] = [],
|
|
2574
2655
|
_b[exports.EnumTipoTributo.IS] = [
|
|
2575
2656
|
{
|
|
2576
2657
|
field: exports.EnumCampoTributo.ClassificacaoTributaria,
|
|
@@ -2615,6 +2696,7 @@
|
|
|
2615
2696
|
rule: this.taxClassificationStatusRule
|
|
2616
2697
|
}
|
|
2617
2698
|
],
|
|
2699
|
+
_c[exports.EnumTipoTributo.IBS_CREDITO_PRESUMIDO] = [],
|
|
2618
2700
|
_c[exports.EnumTipoTributo.IS] = [
|
|
2619
2701
|
{
|
|
2620
2702
|
field: exports.EnumCampoTributo.ClassificacaoTributaria,
|
|
@@ -2645,7 +2727,6 @@
|
|
|
2645
2727
|
var documentType = _a.documentType, group = _a.group, _b = _a.item, taxType = _b.name, formGroup = _b.formGroup;
|
|
2646
2728
|
switch (taxType) {
|
|
2647
2729
|
case exports.EnumTipoTributo.CBS:
|
|
2648
|
-
case exports.EnumTipoTributo.IBS_ESTADUAL:
|
|
2649
2730
|
{
|
|
2650
2731
|
switch (documentType) {
|
|
2651
2732
|
case exports.EnumTipoDocumento.NF_ENTRADA:
|
|
@@ -2665,7 +2746,9 @@
|
|
|
2665
2746
|
.get('classificacaoTributaria')
|
|
2666
2747
|
.valueChanges.pipe(operators.startWith(formGroup.get('classificacaoTributaria').value)),
|
|
2667
2748
|
formGroup.get('valor').valueChanges.pipe(operators.startWith(formGroup.get('valor').value)),
|
|
2668
|
-
formGroup
|
|
2749
|
+
formGroup
|
|
2750
|
+
.get(exports.EnumCampoTributo.AplicarValorLiquidoDocumento)
|
|
2751
|
+
.valueChanges.pipe(operators.startWith(formGroup.get(exports.EnumCampoTributo.AplicarValorLiquidoDocumento).value)),
|
|
2669
2752
|
deferredTaxFormGroup
|
|
2670
2753
|
.get('aliquota')
|
|
2671
2754
|
.valueChanges.pipe(operators.startWith(deferredTaxFormGroup.get('aliquota').value)),
|
|
@@ -2677,7 +2760,7 @@
|
|
|
2677
2760
|
.valueChanges.pipe(operators.startWith(regularTaxationTaxFormGroup.get('aliquota').value))
|
|
2678
2761
|
])
|
|
2679
2762
|
.pipe(operators.map(function (_a) {
|
|
2680
|
-
var _b = __read(_a, 10), taxableBase = _b[0], taxRate = _b[1], effectiveTaxRate = _b[2], taxSituation = _b[3], taxClassication = _b[4], taxAmount = _b[5],
|
|
2763
|
+
var _b = __read(_a, 10), taxableBase = _b[0], taxRate = _b[1], effectiveTaxRate = _b[2], taxSituation = _b[3], taxClassication = _b[4], taxAmount = _b[5], applyNetDocumentValue = _b[6], deferredTaxRate = _b[7], presumedCreditTaxRate = _b[8], regularTaxationTaxRate = _b[9];
|
|
2681
2764
|
return [
|
|
2682
2765
|
new BigNumber(taxableBase),
|
|
2683
2766
|
new BigNumber(taxRate),
|
|
@@ -2685,14 +2768,14 @@
|
|
|
2685
2768
|
taxSituation,
|
|
2686
2769
|
taxClassication,
|
|
2687
2770
|
new BigNumber(taxAmount),
|
|
2688
|
-
|
|
2771
|
+
applyNetDocumentValue,
|
|
2689
2772
|
new BigNumber(deferredTaxRate),
|
|
2690
2773
|
new BigNumber(presumedCreditTaxRate),
|
|
2691
2774
|
new BigNumber(regularTaxationTaxRate)
|
|
2692
2775
|
];
|
|
2693
2776
|
}))
|
|
2694
2777
|
.subscribe(function (_a) {
|
|
2695
|
-
var _b = __read(_a, 10), taxableBase = _b[0], taxRate = _b[1], effectiveTaxRate = _b[2], taxSituation = _b[3], taxClassication = _b[4], taxAmount = _b[5],
|
|
2778
|
+
var _b = __read(_a, 10), taxableBase = _b[0], taxRate = _b[1], effectiveTaxRate = _b[2], taxSituation = _b[3], taxClassication = _b[4], taxAmount = _b[5], applyNetDocumentValue = _b[6], deferredTaxRate = _b[7], presumedCreditTaxRate = _b[8], regularTaxationTaxRate = _b[9];
|
|
2696
2779
|
var validators = [];
|
|
2697
2780
|
if (taxableBase.isFinite() ||
|
|
2698
2781
|
taxRate.isFinite() ||
|
|
@@ -2700,8 +2783,7 @@
|
|
|
2700
2783
|
taxSituation ||
|
|
2701
2784
|
taxClassication ||
|
|
2702
2785
|
taxAmount.isFinite() ||
|
|
2703
|
-
|
|
2704
|
-
netValueOperation === false ||
|
|
2786
|
+
applyNetDocumentValue ||
|
|
2705
2787
|
deferredTaxRate.isFinite() ||
|
|
2706
2788
|
presumedCreditTaxRate.isFinite() ||
|
|
2707
2789
|
regularTaxationTaxRate.isFinite()) {
|
|
@@ -2759,7 +2841,7 @@
|
|
|
2759
2841
|
}
|
|
2760
2842
|
}
|
|
2761
2843
|
break;
|
|
2762
|
-
case exports.EnumTipoTributo.
|
|
2844
|
+
case exports.EnumTipoTributo.IBS_ESTADUAL:
|
|
2763
2845
|
{
|
|
2764
2846
|
switch (documentType) {
|
|
2765
2847
|
case exports.EnumTipoDocumento.NF_ENTRADA:
|
|
@@ -2778,7 +2860,9 @@
|
|
|
2778
2860
|
.get('classificacaoTributaria')
|
|
2779
2861
|
.valueChanges.pipe(operators.startWith(formGroup.get('classificacaoTributaria').value)),
|
|
2780
2862
|
formGroup.get('valor').valueChanges.pipe(operators.startWith(formGroup.get('valor').value)),
|
|
2781
|
-
formGroup
|
|
2863
|
+
formGroup
|
|
2864
|
+
.get(exports.EnumCampoTributo.AplicarValorLiquidoDocumento)
|
|
2865
|
+
.valueChanges.pipe(operators.startWith(formGroup.get(exports.EnumCampoTributo.AplicarValorLiquidoDocumento).value)),
|
|
2782
2866
|
deferredTaxFormGroup
|
|
2783
2867
|
.get('aliquota')
|
|
2784
2868
|
.valueChanges.pipe(operators.startWith(deferredTaxFormGroup.get('aliquota').value)),
|
|
@@ -2787,7 +2871,7 @@
|
|
|
2787
2871
|
.valueChanges.pipe(operators.startWith(regularTaxationTaxFormGroup.get('aliquota').value))
|
|
2788
2872
|
])
|
|
2789
2873
|
.pipe(operators.map(function (_a) {
|
|
2790
|
-
var _b = __read(_a, 9), taxableBase = _b[0], taxRate = _b[1], effectiveTaxRate = _b[2], taxSituation = _b[3], taxClassication = _b[4], taxAmount = _b[5],
|
|
2874
|
+
var _b = __read(_a, 9), taxableBase = _b[0], taxRate = _b[1], effectiveTaxRate = _b[2], taxSituation = _b[3], taxClassication = _b[4], taxAmount = _b[5], applyNetDocumentValue = _b[6], deferredTaxRate = _b[7], regularTaxationTaxRate = _b[8];
|
|
2791
2875
|
return [
|
|
2792
2876
|
new BigNumber(taxableBase),
|
|
2793
2877
|
new BigNumber(taxRate),
|
|
@@ -2795,13 +2879,13 @@
|
|
|
2795
2879
|
taxSituation,
|
|
2796
2880
|
taxClassication,
|
|
2797
2881
|
new BigNumber(taxAmount),
|
|
2798
|
-
|
|
2882
|
+
applyNetDocumentValue,
|
|
2799
2883
|
new BigNumber(deferredTaxRate),
|
|
2800
2884
|
new BigNumber(regularTaxationTaxRate)
|
|
2801
2885
|
];
|
|
2802
2886
|
}))
|
|
2803
2887
|
.subscribe(function (_a) {
|
|
2804
|
-
var _b = __read(_a, 9), taxableBase = _b[0], taxRate = _b[1], effectiveTaxRate = _b[2], taxSituation = _b[3], taxClassication = _b[4], taxAmount = _b[5],
|
|
2888
|
+
var _b = __read(_a, 9), taxableBase = _b[0], taxRate = _b[1], effectiveTaxRate = _b[2], taxSituation = _b[3], taxClassication = _b[4], taxAmount = _b[5], applyNetDocumentValue = _b[6], deferredTaxRate = _b[7], regularTaxationTaxRate = _b[8];
|
|
2805
2889
|
var validators = [];
|
|
2806
2890
|
if (taxableBase.isFinite() ||
|
|
2807
2891
|
taxRate.isFinite() ||
|
|
@@ -2809,8 +2893,7 @@
|
|
|
2809
2893
|
taxSituation ||
|
|
2810
2894
|
taxClassication ||
|
|
2811
2895
|
taxAmount.isFinite() ||
|
|
2812
|
-
|
|
2813
|
-
netValueOperation === false ||
|
|
2896
|
+
applyNetDocumentValue ||
|
|
2814
2897
|
deferredTaxRate.isFinite() ||
|
|
2815
2898
|
regularTaxationTaxRate.isFinite()) {
|
|
2816
2899
|
validators = [forms.Validators.max(9999999999999.99), forms.Validators.required];
|
|
@@ -2867,68 +2950,178 @@
|
|
|
2867
2950
|
}
|
|
2868
2951
|
}
|
|
2869
2952
|
break;
|
|
2870
|
-
default:
|
|
2871
|
-
throw new Error("Regra TaxAmountRequiredValidationRule n\u00E3o implementada para o imposto " + taxType + ", documento " + documentType + ".");
|
|
2872
|
-
}
|
|
2873
|
-
};
|
|
2874
|
-
TaxAmountRequiredValidationRule.ɵprov = core.ɵɵdefineInjectable({ factory: function TaxAmountRequiredValidationRule_Factory() { return new TaxAmountRequiredValidationRule(); }, token: TaxAmountRequiredValidationRule, providedIn: "root" });
|
|
2875
|
-
TaxAmountRequiredValidationRule = __decorate([
|
|
2876
|
-
core.Injectable({ providedIn: 'root' })
|
|
2877
|
-
], TaxAmountRequiredValidationRule);
|
|
2878
|
-
return TaxAmountRequiredValidationRule;
|
|
2879
|
-
}());
|
|
2880
|
-
|
|
2881
|
-
var TaxClassificationRequiredValidationRule = /** @class */ (function () {
|
|
2882
|
-
function TaxClassificationRequiredValidationRule() {
|
|
2883
|
-
}
|
|
2884
|
-
TaxClassificationRequiredValidationRule.prototype.apply = function (_a) {
|
|
2885
|
-
var documentType = _a.documentType, _b = _a.item, taxType = _b.name, formGroup = _b.formGroup;
|
|
2886
|
-
switch (taxType) {
|
|
2887
|
-
case exports.EnumTipoTributo.CBS:
|
|
2888
|
-
case exports.EnumTipoTributo.IBS_ESTADUAL:
|
|
2889
2953
|
case exports.EnumTipoTributo.IBS_MUNICIPAL:
|
|
2890
2954
|
{
|
|
2891
2955
|
switch (documentType) {
|
|
2892
2956
|
case exports.EnumTipoDocumento.NF_ENTRADA:
|
|
2893
2957
|
case exports.EnumTipoDocumento.NF_SAIDA:
|
|
2894
2958
|
{
|
|
2959
|
+
var deferredTaxFormGroup = getDeferredTaxItemFromGroup({ group: group }).formGroup;
|
|
2960
|
+
var regularTaxationTaxFormGroup = getRegularTaxationTaxItemFromGroup({ group: group }).formGroup;
|
|
2895
2961
|
rxjs.combineLatest([
|
|
2896
2962
|
formGroup.get('baseCalculo').valueChanges.pipe(operators.startWith(formGroup.get('baseCalculo').value)),
|
|
2897
2963
|
formGroup.get('aliquota').valueChanges.pipe(operators.startWith(formGroup.get('aliquota').value)),
|
|
2898
2964
|
formGroup.get('aliquotaEfetiva').valueChanges.pipe(operators.startWith(formGroup.get('aliquotaEfetiva').value)),
|
|
2899
|
-
formGroup.get('valor').valueChanges.pipe(operators.startWith(formGroup.get('valor').value)),
|
|
2900
2965
|
formGroup
|
|
2901
2966
|
.get('situacaoTributaria')
|
|
2902
2967
|
.valueChanges.pipe(operators.startWith(formGroup.get('situacaoTributaria').value)),
|
|
2903
2968
|
formGroup
|
|
2904
2969
|
.get('classificacaoTributaria')
|
|
2905
2970
|
.valueChanges.pipe(operators.startWith(formGroup.get('classificacaoTributaria').value)),
|
|
2906
|
-
formGroup.get('
|
|
2971
|
+
formGroup.get('valor').valueChanges.pipe(operators.startWith(formGroup.get('valor').value)),
|
|
2972
|
+
formGroup
|
|
2973
|
+
.get(exports.EnumCampoTributo.AplicarValorLiquidoDocumento)
|
|
2974
|
+
.valueChanges.pipe(operators.startWith(formGroup.get(exports.EnumCampoTributo.AplicarValorLiquidoDocumento).value)),
|
|
2975
|
+
deferredTaxFormGroup
|
|
2976
|
+
.get('aliquota')
|
|
2977
|
+
.valueChanges.pipe(operators.startWith(deferredTaxFormGroup.get('aliquota').value)),
|
|
2978
|
+
regularTaxationTaxFormGroup
|
|
2979
|
+
.get('aliquota')
|
|
2980
|
+
.valueChanges.pipe(operators.startWith(regularTaxationTaxFormGroup.get('aliquota').value))
|
|
2907
2981
|
])
|
|
2908
2982
|
.pipe(operators.map(function (_a) {
|
|
2909
|
-
var _b = __read(_a,
|
|
2983
|
+
var _b = __read(_a, 9), taxableBase = _b[0], taxRate = _b[1], effectiveTaxRate = _b[2], taxSituation = _b[3], taxClassication = _b[4], taxAmount = _b[5], applyNetDocumentValue = _b[6], deferredTaxRate = _b[7], regularTaxationTaxRate = _b[8];
|
|
2910
2984
|
return [
|
|
2911
2985
|
new BigNumber(taxableBase),
|
|
2912
2986
|
new BigNumber(taxRate),
|
|
2913
2987
|
new BigNumber(effectiveTaxRate),
|
|
2914
|
-
new BigNumber(taxAmount),
|
|
2915
2988
|
taxSituation,
|
|
2916
2989
|
taxClassication,
|
|
2917
|
-
|
|
2990
|
+
new BigNumber(taxAmount),
|
|
2991
|
+
applyNetDocumentValue,
|
|
2992
|
+
new BigNumber(deferredTaxRate),
|
|
2993
|
+
new BigNumber(regularTaxationTaxRate)
|
|
2918
2994
|
];
|
|
2919
2995
|
}))
|
|
2920
2996
|
.subscribe(function (_a) {
|
|
2921
|
-
var _b = __read(_a,
|
|
2997
|
+
var _b = __read(_a, 9), taxableBase = _b[0], taxRate = _b[1], effectiveTaxRate = _b[2], taxSituation = _b[3], taxClassication = _b[4], taxAmount = _b[5], applyNetDocumentValue = _b[6], deferredTaxRate = _b[7], regularTaxationTaxRate = _b[8];
|
|
2922
2998
|
var validators = [];
|
|
2923
2999
|
if (taxableBase.isFinite() ||
|
|
2924
3000
|
taxRate.isFinite() ||
|
|
2925
3001
|
effectiveTaxRate.isFinite() ||
|
|
2926
|
-
taxAmount.isFinite() ||
|
|
2927
3002
|
taxSituation ||
|
|
2928
3003
|
taxClassication ||
|
|
2929
|
-
|
|
2930
|
-
|
|
2931
|
-
|
|
3004
|
+
taxAmount.isFinite() ||
|
|
3005
|
+
applyNetDocumentValue ||
|
|
3006
|
+
deferredTaxRate.isFinite() ||
|
|
3007
|
+
regularTaxationTaxRate.isFinite()) {
|
|
3008
|
+
validators = [forms.Validators.max(9999999999999.99), forms.Validators.required];
|
|
3009
|
+
}
|
|
3010
|
+
else {
|
|
3011
|
+
validators = [forms.Validators.max(9999999999999.99)];
|
|
3012
|
+
}
|
|
3013
|
+
formGroup.get('valor').setValidators(validators);
|
|
3014
|
+
formGroup.get('valor').updateValueAndValidity({ emitEvent: false });
|
|
3015
|
+
});
|
|
3016
|
+
}
|
|
3017
|
+
break;
|
|
3018
|
+
case exports.EnumTipoDocumento.PEDIDO_COMPRA:
|
|
3019
|
+
case exports.EnumTipoDocumento.PEDIDO_VENDA:
|
|
3020
|
+
{
|
|
3021
|
+
var deferredFormGroup = getDeferredTaxItemFromGroup({ group: group }).formGroup;
|
|
3022
|
+
rxjs.combineLatest([
|
|
3023
|
+
formGroup.get('baseCalculo').valueChanges.pipe(operators.startWith(formGroup.get('baseCalculo').value)),
|
|
3024
|
+
formGroup.get('aliquota').valueChanges.pipe(operators.startWith(formGroup.get('aliquota').value)),
|
|
3025
|
+
formGroup.get('aliquotaEfetiva').valueChanges.pipe(operators.startWith(formGroup.get('aliquota').value)),
|
|
3026
|
+
formGroup.get('valor').valueChanges.pipe(operators.startWith(formGroup.get('valor').value)),
|
|
3027
|
+
deferredFormGroup.get('aliquota').valueChanges.pipe(operators.startWith(deferredFormGroup.get('aliquota').value))
|
|
3028
|
+
])
|
|
3029
|
+
.pipe(operators.map(function (_a) {
|
|
3030
|
+
var _b = __read(_a, 5), taxableBase = _b[0], taxRate = _b[1], effectiveTaxRate = _b[2], taxAmount = _b[3], deferredTaxRate = _b[4];
|
|
3031
|
+
return [
|
|
3032
|
+
new BigNumber(taxableBase),
|
|
3033
|
+
new BigNumber(taxRate),
|
|
3034
|
+
new BigNumber(effectiveTaxRate),
|
|
3035
|
+
new BigNumber(taxAmount),
|
|
3036
|
+
new BigNumber(deferredTaxRate)
|
|
3037
|
+
];
|
|
3038
|
+
}))
|
|
3039
|
+
.subscribe(function (_a) {
|
|
3040
|
+
var _b = __read(_a, 5), taxableBase = _b[0], taxRate = _b[1], effectiveTaxRate = _b[2], taxAmount = _b[3], deferredTaxRate = _b[4];
|
|
3041
|
+
var validators = [];
|
|
3042
|
+
if (taxableBase.isFinite() ||
|
|
3043
|
+
taxRate.isFinite() ||
|
|
3044
|
+
effectiveTaxRate.isFinite() ||
|
|
3045
|
+
taxAmount.isFinite() ||
|
|
3046
|
+
deferredTaxRate.isFinite()) {
|
|
3047
|
+
validators = [forms.Validators.max(9999999999999.99), forms.Validators.required];
|
|
3048
|
+
}
|
|
3049
|
+
else {
|
|
3050
|
+
validators = [forms.Validators.max(9999999999999.99)];
|
|
3051
|
+
}
|
|
3052
|
+
formGroup.get('valor').setValidators(validators);
|
|
3053
|
+
formGroup.get('valor').updateValueAndValidity({ emitEvent: false });
|
|
3054
|
+
});
|
|
3055
|
+
}
|
|
3056
|
+
break;
|
|
3057
|
+
default:
|
|
3058
|
+
throw new Error("Regra TaxAmountRequiredValidationRule n\u00E3o implementada para o imposto " + taxType + ", documento " + documentType + ".");
|
|
3059
|
+
}
|
|
3060
|
+
}
|
|
3061
|
+
break;
|
|
3062
|
+
default:
|
|
3063
|
+
throw new Error("Regra TaxAmountRequiredValidationRule n\u00E3o implementada para o imposto " + taxType + ", documento " + documentType + ".");
|
|
3064
|
+
}
|
|
3065
|
+
};
|
|
3066
|
+
TaxAmountRequiredValidationRule.ɵprov = core.ɵɵdefineInjectable({ factory: function TaxAmountRequiredValidationRule_Factory() { return new TaxAmountRequiredValidationRule(); }, token: TaxAmountRequiredValidationRule, providedIn: "root" });
|
|
3067
|
+
TaxAmountRequiredValidationRule = __decorate([
|
|
3068
|
+
core.Injectable({ providedIn: 'root' })
|
|
3069
|
+
], TaxAmountRequiredValidationRule);
|
|
3070
|
+
return TaxAmountRequiredValidationRule;
|
|
3071
|
+
}());
|
|
3072
|
+
|
|
3073
|
+
var TaxClassificationRequiredValidationRule = /** @class */ (function () {
|
|
3074
|
+
function TaxClassificationRequiredValidationRule() {
|
|
3075
|
+
}
|
|
3076
|
+
TaxClassificationRequiredValidationRule.prototype.apply = function (_a) {
|
|
3077
|
+
var documentType = _a.documentType, _b = _a.item, taxType = _b.name, formGroup = _b.formGroup;
|
|
3078
|
+
switch (taxType) {
|
|
3079
|
+
case exports.EnumTipoTributo.CBS:
|
|
3080
|
+
case exports.EnumTipoTributo.IBS_ESTADUAL:
|
|
3081
|
+
case exports.EnumTipoTributo.IBS_MUNICIPAL:
|
|
3082
|
+
{
|
|
3083
|
+
switch (documentType) {
|
|
3084
|
+
case exports.EnumTipoDocumento.NF_ENTRADA:
|
|
3085
|
+
case exports.EnumTipoDocumento.NF_SAIDA:
|
|
3086
|
+
{
|
|
3087
|
+
rxjs.combineLatest([
|
|
3088
|
+
formGroup.get('baseCalculo').valueChanges.pipe(operators.startWith(formGroup.get('baseCalculo').value)),
|
|
3089
|
+
formGroup.get('aliquota').valueChanges.pipe(operators.startWith(formGroup.get('aliquota').value)),
|
|
3090
|
+
formGroup.get('aliquotaEfetiva').valueChanges.pipe(operators.startWith(formGroup.get('aliquotaEfetiva').value)),
|
|
3091
|
+
formGroup.get('valor').valueChanges.pipe(operators.startWith(formGroup.get('valor').value)),
|
|
3092
|
+
formGroup
|
|
3093
|
+
.get('situacaoTributaria')
|
|
3094
|
+
.valueChanges.pipe(operators.startWith(formGroup.get('situacaoTributaria').value)),
|
|
3095
|
+
formGroup
|
|
3096
|
+
.get('classificacaoTributaria')
|
|
3097
|
+
.valueChanges.pipe(operators.startWith(formGroup.get('classificacaoTributaria').value)),
|
|
3098
|
+
formGroup
|
|
3099
|
+
.get(exports.EnumCampoTributo.AplicarValorLiquidoDocumento)
|
|
3100
|
+
.valueChanges.pipe(operators.startWith(formGroup.get(exports.EnumCampoTributo.AplicarValorLiquidoDocumento).value))
|
|
3101
|
+
])
|
|
3102
|
+
.pipe(operators.map(function (_a) {
|
|
3103
|
+
var _b = __read(_a, 7), taxableBase = _b[0], taxRate = _b[1], effectiveTaxRate = _b[2], taxAmount = _b[3], taxSituation = _b[4], taxClassication = _b[5], applyNetDocumentValue = _b[6];
|
|
3104
|
+
return [
|
|
3105
|
+
new BigNumber(taxableBase),
|
|
3106
|
+
new BigNumber(taxRate),
|
|
3107
|
+
new BigNumber(effectiveTaxRate),
|
|
3108
|
+
new BigNumber(taxAmount),
|
|
3109
|
+
taxSituation,
|
|
3110
|
+
taxClassication,
|
|
3111
|
+
applyNetDocumentValue
|
|
3112
|
+
];
|
|
3113
|
+
}))
|
|
3114
|
+
.subscribe(function (_a) {
|
|
3115
|
+
var _b = __read(_a, 7), taxableBase = _b[0], taxRate = _b[1], effectiveTaxRate = _b[2], taxAmount = _b[3], taxSituation = _b[4], taxClassication = _b[5], applyNetDocumentValue = _b[6];
|
|
3116
|
+
var validators = [];
|
|
3117
|
+
if (taxableBase.isFinite() ||
|
|
3118
|
+
taxRate.isFinite() ||
|
|
3119
|
+
effectiveTaxRate.isFinite() ||
|
|
3120
|
+
taxAmount.isFinite() ||
|
|
3121
|
+
taxSituation ||
|
|
3122
|
+
taxClassication ||
|
|
3123
|
+
applyNetDocumentValue) {
|
|
3124
|
+
validators = [forms.Validators.required];
|
|
2932
3125
|
}
|
|
2933
3126
|
else {
|
|
2934
3127
|
validators = [];
|
|
@@ -2944,7 +3137,6 @@
|
|
|
2944
3137
|
}
|
|
2945
3138
|
break;
|
|
2946
3139
|
case exports.EnumTipoTributo.CBS_CREDITO_PRESUMIDO:
|
|
2947
|
-
case exports.EnumTipoTributo.IBS_ESTADUAL_CREDITO_PRESUMIDO:
|
|
2948
3140
|
{
|
|
2949
3141
|
switch (documentType) {
|
|
2950
3142
|
case exports.EnumTipoDocumento.NF_ENTRADA:
|
|
@@ -2980,6 +3172,50 @@
|
|
|
2980
3172
|
}
|
|
2981
3173
|
}
|
|
2982
3174
|
break;
|
|
3175
|
+
case exports.EnumTipoTributo.IBS_CREDITO_PRESUMIDO:
|
|
3176
|
+
{
|
|
3177
|
+
switch (documentType) {
|
|
3178
|
+
case exports.EnumTipoDocumento.NF_ENTRADA:
|
|
3179
|
+
case exports.EnumTipoDocumento.NF_SAIDA:
|
|
3180
|
+
{
|
|
3181
|
+
rxjs.combineLatest([
|
|
3182
|
+
formGroup.get('baseCalculo').valueChanges.pipe(operators.startWith(formGroup.get('baseCalculo').value)),
|
|
3183
|
+
formGroup.get('aliquota').valueChanges.pipe(operators.startWith(formGroup.get('aliquota').value)),
|
|
3184
|
+
formGroup
|
|
3185
|
+
.get('classificacaoTributaria')
|
|
3186
|
+
.valueChanges.pipe(operators.startWith(formGroup.get('classificacaoTributaria').value)),
|
|
3187
|
+
formGroup
|
|
3188
|
+
.get(exports.EnumCampoTributo.AplicarValorLiquidoDocumento)
|
|
3189
|
+
.valueChanges.pipe(operators.startWith(formGroup.get(exports.EnumCampoTributo.AplicarValorLiquidoDocumento).value))
|
|
3190
|
+
])
|
|
3191
|
+
.pipe(operators.map(function (_a) {
|
|
3192
|
+
var _b = __read(_a, 4), taxableBase = _b[0], taxRate = _b[1], taxClassication = _b[2], applyNetDocumentValue = _b[3];
|
|
3193
|
+
return [
|
|
3194
|
+
new BigNumber(taxableBase),
|
|
3195
|
+
new BigNumber(taxRate),
|
|
3196
|
+
taxClassication,
|
|
3197
|
+
applyNetDocumentValue
|
|
3198
|
+
];
|
|
3199
|
+
}))
|
|
3200
|
+
.subscribe(function (_a) {
|
|
3201
|
+
var _b = __read(_a, 4), taxableBase = _b[0], taxRate = _b[1], taxClassication = _b[2], applyNetDocumentValue = _b[3];
|
|
3202
|
+
var validators = [];
|
|
3203
|
+
if (taxableBase.isFinite() || taxRate.isFinite() || taxClassication || applyNetDocumentValue) {
|
|
3204
|
+
validators = [forms.Validators.required];
|
|
3205
|
+
}
|
|
3206
|
+
else {
|
|
3207
|
+
validators = [];
|
|
3208
|
+
}
|
|
3209
|
+
formGroup.get('classificacaoTributaria').setValidators(validators);
|
|
3210
|
+
formGroup.get('classificacaoTributaria').updateValueAndValidity({ emitEvent: false });
|
|
3211
|
+
});
|
|
3212
|
+
}
|
|
3213
|
+
break;
|
|
3214
|
+
default:
|
|
3215
|
+
throw new Error("Regra TaxClassificationRequiredValidationRule n\u00E3o implementada para o imposto " + taxType + ", documento " + documentType + ".");
|
|
3216
|
+
}
|
|
3217
|
+
}
|
|
3218
|
+
break;
|
|
2983
3219
|
case exports.EnumTipoTributo.CBS_TRIBUTACAO_REGULAR:
|
|
2984
3220
|
case exports.EnumTipoTributo.IBS_ESTADUAL_TRIBUTACAO_REGULAR:
|
|
2985
3221
|
case exports.EnumTipoTributo.IBS_MUNICIPAL_TRIBUTACAO_REGULAR:
|
|
@@ -3021,6 +3257,22 @@
|
|
|
3021
3257
|
}
|
|
3022
3258
|
}
|
|
3023
3259
|
break;
|
|
3260
|
+
// case EnumTipoTributo.IBS_CREDITO_PRESUMIDO:
|
|
3261
|
+
// {
|
|
3262
|
+
// switch (documentType) {
|
|
3263
|
+
// case EnumTipoDocumento.NF_ENTRADA:
|
|
3264
|
+
// case EnumTipoDocumento.NF_SAIDA:
|
|
3265
|
+
// break;
|
|
3266
|
+
// case EnumTipoDocumento.PEDIDO_COMPRA:
|
|
3267
|
+
// case EnumTipoDocumento.PEDIDO_VENDA:
|
|
3268
|
+
// break;
|
|
3269
|
+
// default:
|
|
3270
|
+
// throw new Error(
|
|
3271
|
+
// `Regra TaxClassificationRequiredValidationRule não implementada para o imposto ${taxType}, documento ${documentType}.`
|
|
3272
|
+
// );
|
|
3273
|
+
// }
|
|
3274
|
+
// }
|
|
3275
|
+
// break;
|
|
3024
3276
|
case exports.EnumTipoTributo.IS:
|
|
3025
3277
|
{
|
|
3026
3278
|
switch (documentType) {
|
|
@@ -3037,29 +3289,30 @@
|
|
|
3037
3289
|
formGroup
|
|
3038
3290
|
.get('classificacaoTributaria')
|
|
3039
3291
|
.valueChanges.pipe(operators.startWith(formGroup.get('classificacaoTributaria').value)),
|
|
3040
|
-
formGroup
|
|
3292
|
+
formGroup
|
|
3293
|
+
.get(exports.EnumCampoTributo.AplicarValorLiquidoDocumento)
|
|
3294
|
+
.valueChanges.pipe(operators.startWith(formGroup.get(exports.EnumCampoTributo.AplicarValorLiquidoDocumento).value))
|
|
3041
3295
|
])
|
|
3042
3296
|
.pipe(operators.map(function (_a) {
|
|
3043
|
-
var _b = __read(_a, 6), taxableBase = _b[0], taxRate = _b[1], taxAmount = _b[2], taxSituation = _b[3], taxClassication = _b[4],
|
|
3297
|
+
var _b = __read(_a, 6), taxableBase = _b[0], taxRate = _b[1], taxAmount = _b[2], taxSituation = _b[3], taxClassication = _b[4], applyNetDocumentValue = _b[5];
|
|
3044
3298
|
return [
|
|
3045
3299
|
new BigNumber(taxableBase),
|
|
3046
3300
|
new BigNumber(taxRate),
|
|
3047
3301
|
new BigNumber(taxAmount),
|
|
3048
3302
|
taxSituation,
|
|
3049
3303
|
taxClassication,
|
|
3050
|
-
|
|
3304
|
+
applyNetDocumentValue
|
|
3051
3305
|
];
|
|
3052
3306
|
}))
|
|
3053
3307
|
.subscribe(function (_a) {
|
|
3054
|
-
var _b = __read(_a, 6), taxableBase = _b[0], taxRate = _b[1], taxAmount = _b[2], taxSituation = _b[3], taxClassication = _b[4],
|
|
3308
|
+
var _b = __read(_a, 6), taxableBase = _b[0], taxRate = _b[1], taxAmount = _b[2], taxSituation = _b[3], taxClassication = _b[4], applyNetDocumentValue = _b[5];
|
|
3055
3309
|
var validators = [];
|
|
3056
3310
|
if (taxableBase.isFinite() ||
|
|
3057
3311
|
taxRate.isFinite() ||
|
|
3058
3312
|
taxAmount.isFinite() ||
|
|
3059
3313
|
taxSituation ||
|
|
3060
3314
|
taxClassication ||
|
|
3061
|
-
|
|
3062
|
-
netValueOperation === false) {
|
|
3315
|
+
applyNetDocumentValue) {
|
|
3063
3316
|
validators = [forms.Validators.required];
|
|
3064
3317
|
}
|
|
3065
3318
|
else {
|
|
@@ -3120,11 +3373,11 @@
|
|
|
3120
3373
|
.get('classificacaoTributaria')
|
|
3121
3374
|
.valueChanges.pipe(operators.startWith(formGroup.get('classificacaoTributaria').value), operators.distinctUntilChanged()),
|
|
3122
3375
|
formGroup
|
|
3123
|
-
.get(
|
|
3124
|
-
.valueChanges.pipe(operators.startWith(formGroup.get(
|
|
3376
|
+
.get(exports.EnumCampoTributo.AplicarValorLiquidoDocumento)
|
|
3377
|
+
.valueChanges.pipe(operators.startWith(formGroup.get(exports.EnumCampoTributo.AplicarValorLiquidoDocumento).value), operators.distinctUntilChanged())
|
|
3125
3378
|
])
|
|
3126
3379
|
.pipe(operators.map(function (_a) {
|
|
3127
|
-
var _b = __read(_a, 7), taxableBase = _b[0], taxRate = _b[1], effectiveTaxRate = _b[2], taxAmount = _b[3], taxSituation = _b[4], taxClassication = _b[5],
|
|
3380
|
+
var _b = __read(_a, 7), taxableBase = _b[0], taxRate = _b[1], effectiveTaxRate = _b[2], taxAmount = _b[3], taxSituation = _b[4], taxClassication = _b[5], applyNetDocumentValue = _b[6];
|
|
3128
3381
|
return [
|
|
3129
3382
|
new BigNumber(taxableBase),
|
|
3130
3383
|
new BigNumber(taxRate),
|
|
@@ -3132,11 +3385,11 @@
|
|
|
3132
3385
|
new BigNumber(taxAmount),
|
|
3133
3386
|
taxSituation,
|
|
3134
3387
|
taxClassication,
|
|
3135
|
-
|
|
3388
|
+
applyNetDocumentValue
|
|
3136
3389
|
];
|
|
3137
3390
|
}))
|
|
3138
3391
|
.subscribe(function (_a) {
|
|
3139
|
-
var _b = __read(_a, 7), taxableBase = _b[0], taxRate = _b[1], effectiveTaxRate = _b[2], taxAmount = _b[3], taxSituation = _b[4], taxClassication = _b[5],
|
|
3392
|
+
var _b = __read(_a, 7), taxableBase = _b[0], taxRate = _b[1], effectiveTaxRate = _b[2], taxAmount = _b[3], taxSituation = _b[4], taxClassication = _b[5], applyNetDocumentValue = _b[6];
|
|
3140
3393
|
var validators = [];
|
|
3141
3394
|
if (taxableBase.isFinite() ||
|
|
3142
3395
|
taxRate.isFinite() ||
|
|
@@ -3144,8 +3397,7 @@
|
|
|
3144
3397
|
taxAmount.isFinite() ||
|
|
3145
3398
|
taxSituation ||
|
|
3146
3399
|
taxClassication ||
|
|
3147
|
-
|
|
3148
|
-
netValueOperation === false) {
|
|
3400
|
+
applyNetDocumentValue) {
|
|
3149
3401
|
validators = [forms.Validators.max(999.9999), forms.Validators.required];
|
|
3150
3402
|
}
|
|
3151
3403
|
else {
|
|
@@ -3227,30 +3479,29 @@
|
|
|
3227
3479
|
.get('classificacaoTributaria')
|
|
3228
3480
|
.valueChanges.pipe(operators.startWith(formGroup.get('classificacaoTributaria').value), operators.distinctUntilChanged()),
|
|
3229
3481
|
formGroup
|
|
3230
|
-
.get(
|
|
3231
|
-
.valueChanges.pipe(operators.startWith(formGroup.get(
|
|
3482
|
+
.get(exports.EnumCampoTributo.AplicarValorLiquidoDocumento)
|
|
3483
|
+
.valueChanges.pipe(operators.startWith(formGroup.get(exports.EnumCampoTributo.AplicarValorLiquidoDocumento).value), operators.distinctUntilChanged())
|
|
3232
3484
|
])
|
|
3233
3485
|
.pipe(operators.map(function (_a) {
|
|
3234
|
-
var _b = __read(_a, 6), taxableBase = _b[0], taxRate = _b[1], taxAmount = _b[2], taxSituation = _b[3], taxClassication = _b[4],
|
|
3486
|
+
var _b = __read(_a, 6), taxableBase = _b[0], taxRate = _b[1], taxAmount = _b[2], taxSituation = _b[3], taxClassication = _b[4], applyNetDocumentValue = _b[5];
|
|
3235
3487
|
return [
|
|
3236
3488
|
new BigNumber(taxableBase),
|
|
3237
3489
|
new BigNumber(taxRate),
|
|
3238
3490
|
new BigNumber(taxAmount),
|
|
3239
3491
|
taxSituation,
|
|
3240
3492
|
taxClassication,
|
|
3241
|
-
|
|
3493
|
+
applyNetDocumentValue
|
|
3242
3494
|
];
|
|
3243
3495
|
}))
|
|
3244
3496
|
.subscribe(function (_a) {
|
|
3245
|
-
var _b = __read(_a, 6), taxableBase = _b[0], taxRate = _b[1], taxAmount = _b[2], taxSituation = _b[3], taxClassication = _b[4],
|
|
3497
|
+
var _b = __read(_a, 6), taxableBase = _b[0], taxRate = _b[1], taxAmount = _b[2], taxSituation = _b[3], taxClassication = _b[4], applyNetDocumentValue = _b[5];
|
|
3246
3498
|
var validators = [];
|
|
3247
3499
|
if (taxableBase.isFinite() ||
|
|
3248
3500
|
taxRate.isFinite() ||
|
|
3249
3501
|
taxAmount.isFinite() ||
|
|
3250
3502
|
taxSituation ||
|
|
3251
3503
|
taxClassication ||
|
|
3252
|
-
|
|
3253
|
-
netValueOperation === false) {
|
|
3504
|
+
applyNetDocumentValue) {
|
|
3254
3505
|
validators = [forms.Validators.max(999.9999), forms.Validators.required];
|
|
3255
3506
|
}
|
|
3256
3507
|
else {
|
|
@@ -3280,10 +3531,10 @@
|
|
|
3280
3531
|
var _b = __read(_a, 2), taxableBase = _b[0], taxRate = _b[1];
|
|
3281
3532
|
var validators = [];
|
|
3282
3533
|
if (taxableBase.isFinite() || taxRate.isFinite()) {
|
|
3283
|
-
validators = [forms.Validators.max(
|
|
3534
|
+
validators = [forms.Validators.max(999.9999), forms.Validators.required];
|
|
3284
3535
|
}
|
|
3285
3536
|
else {
|
|
3286
|
-
validators = [forms.Validators.max(
|
|
3537
|
+
validators = [forms.Validators.max(999.9999)];
|
|
3287
3538
|
}
|
|
3288
3539
|
formGroup.get('aliquota').setValidators(validators);
|
|
3289
3540
|
formGroup.get('aliquota').updateValueAndValidity({ emitEvent: false });
|
|
@@ -3296,7 +3547,6 @@
|
|
|
3296
3547
|
}
|
|
3297
3548
|
break;
|
|
3298
3549
|
case exports.EnumTipoTributo.CBS_CREDITO_PRESUMIDO:
|
|
3299
|
-
case exports.EnumTipoTributo.IBS_ESTADUAL_CREDITO_PRESUMIDO:
|
|
3300
3550
|
{
|
|
3301
3551
|
switch (documentType) {
|
|
3302
3552
|
case exports.EnumTipoDocumento.NF_ENTRADA:
|
|
@@ -3321,10 +3571,10 @@
|
|
|
3321
3571
|
var _b = __read(_a, 3), taxableBase = _b[0], taxRate = _b[1], taxClassication = _b[2];
|
|
3322
3572
|
var validators = [];
|
|
3323
3573
|
if (taxableBase.isFinite() || taxRate.isFinite() || taxClassication) {
|
|
3324
|
-
validators = [forms.Validators.max(
|
|
3574
|
+
validators = [forms.Validators.max(999.9999), forms.Validators.required];
|
|
3325
3575
|
}
|
|
3326
3576
|
else {
|
|
3327
|
-
validators = [forms.Validators.max(
|
|
3577
|
+
validators = [forms.Validators.max(999.9999)];
|
|
3328
3578
|
}
|
|
3329
3579
|
formGroup.get('aliquota').setValidators(validators);
|
|
3330
3580
|
formGroup.get('aliquota').updateValueAndValidity({ emitEvent: false });
|
|
@@ -3350,10 +3600,87 @@
|
|
|
3350
3600
|
var _b = __read(_a, 2), taxableBase = _b[0], taxRate = _b[1];
|
|
3351
3601
|
var validators = [];
|
|
3352
3602
|
if (taxableBase.isFinite() || taxRate.isFinite()) {
|
|
3353
|
-
validators = [forms.Validators.max(
|
|
3603
|
+
validators = [forms.Validators.max(999.9999), forms.Validators.required];
|
|
3354
3604
|
}
|
|
3355
3605
|
else {
|
|
3356
|
-
validators = [forms.Validators.max(
|
|
3606
|
+
validators = [forms.Validators.max(999.9999)];
|
|
3607
|
+
}
|
|
3608
|
+
formGroup.get('aliquota').setValidators(validators);
|
|
3609
|
+
formGroup.get('aliquota').updateValueAndValidity({ emitEvent: false });
|
|
3610
|
+
});
|
|
3611
|
+
}
|
|
3612
|
+
break;
|
|
3613
|
+
default:
|
|
3614
|
+
throw new Error("Regra TaxRateRequiredValidationRule n\u00E3o implementada para o imposto " + taxType + ", documento " + documentType + ".");
|
|
3615
|
+
}
|
|
3616
|
+
}
|
|
3617
|
+
break;
|
|
3618
|
+
case exports.EnumTipoTributo.IBS_CREDITO_PRESUMIDO:
|
|
3619
|
+
{
|
|
3620
|
+
switch (documentType) {
|
|
3621
|
+
case exports.EnumTipoDocumento.NF_ENTRADA:
|
|
3622
|
+
case exports.EnumTipoDocumento.NF_SAIDA:
|
|
3623
|
+
{
|
|
3624
|
+
rxjs.combineLatest([
|
|
3625
|
+
formGroup
|
|
3626
|
+
.get('baseCalculo')
|
|
3627
|
+
.valueChanges.pipe(operators.startWith(formGroup.get('baseCalculo').value), operators.distinctUntilChanged()),
|
|
3628
|
+
formGroup
|
|
3629
|
+
.get('aliquota')
|
|
3630
|
+
.valueChanges.pipe(operators.startWith(formGroup.get('aliquota').value), operators.distinctUntilChanged()),
|
|
3631
|
+
formGroup
|
|
3632
|
+
.get('classificacaoTributaria')
|
|
3633
|
+
.valueChanges.pipe(operators.startWith(formGroup.get('classificacaoTributaria').value), operators.distinctUntilChanged()),
|
|
3634
|
+
formGroup
|
|
3635
|
+
.get(exports.EnumCampoTributo.AplicarValorLiquidoDocumento)
|
|
3636
|
+
.valueChanges.pipe(operators.startWith(formGroup.get(exports.EnumCampoTributo.AplicarValorLiquidoDocumento).value), operators.distinctUntilChanged())
|
|
3637
|
+
])
|
|
3638
|
+
.pipe(operators.map(function (_a) {
|
|
3639
|
+
var _b = __read(_a, 4), taxableBase = _b[0], taxRate = _b[1], taxClassication = _b[2], applyNetDocumentValue = _b[3];
|
|
3640
|
+
return [
|
|
3641
|
+
new BigNumber(taxableBase),
|
|
3642
|
+
new BigNumber(taxRate),
|
|
3643
|
+
taxClassication,
|
|
3644
|
+
applyNetDocumentValue
|
|
3645
|
+
];
|
|
3646
|
+
}))
|
|
3647
|
+
.subscribe(function (_a) {
|
|
3648
|
+
var _b = __read(_a, 4), taxableBase = _b[0], taxRate = _b[1], taxClassication = _b[2], applyNetDocumentValue = _b[3];
|
|
3649
|
+
var validators = [];
|
|
3650
|
+
if (taxableBase.isFinite() || taxRate.isFinite() || taxClassication || applyNetDocumentValue) {
|
|
3651
|
+
validators = [forms.Validators.max(999.9999), forms.Validators.required];
|
|
3652
|
+
}
|
|
3653
|
+
else {
|
|
3654
|
+
validators = [forms.Validators.max(999.9999)];
|
|
3655
|
+
}
|
|
3656
|
+
formGroup.get('aliquota').setValidators(validators);
|
|
3657
|
+
formGroup.get('aliquota').updateValueAndValidity({ emitEvent: false });
|
|
3658
|
+
});
|
|
3659
|
+
}
|
|
3660
|
+
break;
|
|
3661
|
+
case exports.EnumTipoDocumento.PEDIDO_COMPRA:
|
|
3662
|
+
case exports.EnumTipoDocumento.PEDIDO_VENDA:
|
|
3663
|
+
{
|
|
3664
|
+
rxjs.combineLatest([
|
|
3665
|
+
formGroup
|
|
3666
|
+
.get('baseCalculo')
|
|
3667
|
+
.valueChanges.pipe(operators.startWith(formGroup.get('baseCalculo').value), operators.distinctUntilChanged()),
|
|
3668
|
+
formGroup
|
|
3669
|
+
.get('aliquota')
|
|
3670
|
+
.valueChanges.pipe(operators.startWith(formGroup.get('aliquota').value), operators.distinctUntilChanged())
|
|
3671
|
+
])
|
|
3672
|
+
.pipe(operators.map(function (_a) {
|
|
3673
|
+
var _b = __read(_a, 2), taxableBase = _b[0], taxRate = _b[1];
|
|
3674
|
+
return [new BigNumber(taxableBase), new BigNumber(taxRate)];
|
|
3675
|
+
}), operators.distinctUntilChanged())
|
|
3676
|
+
.subscribe(function (_a) {
|
|
3677
|
+
var _b = __read(_a, 2), taxableBase = _b[0], taxRate = _b[1];
|
|
3678
|
+
var validators = [];
|
|
3679
|
+
if (taxableBase.isFinite() || taxRate.isFinite()) {
|
|
3680
|
+
validators = [forms.Validators.max(999.9999), forms.Validators.required];
|
|
3681
|
+
}
|
|
3682
|
+
else {
|
|
3683
|
+
validators = [forms.Validators.max(999.9999)];
|
|
3357
3684
|
}
|
|
3358
3685
|
formGroup.get('aliquota').setValidators(validators);
|
|
3359
3686
|
formGroup.get('aliquota').updateValueAndValidity({ emitEvent: false });
|
|
@@ -3395,10 +3722,10 @@
|
|
|
3395
3722
|
var _b = __read(_a, 4), taxableBase = _b[0], taxRate = _b[1], taxClassication = _b[2], taxSituation = _b[3];
|
|
3396
3723
|
var validators = [];
|
|
3397
3724
|
if (taxableBase.isFinite() || taxRate.isFinite() || taxClassication || taxSituation) {
|
|
3398
|
-
validators = [forms.Validators.max(
|
|
3725
|
+
validators = [forms.Validators.max(999.9999), forms.Validators.required];
|
|
3399
3726
|
}
|
|
3400
3727
|
else {
|
|
3401
|
-
validators = [forms.Validators.max(
|
|
3728
|
+
validators = [forms.Validators.max(999.9999)];
|
|
3402
3729
|
}
|
|
3403
3730
|
formGroup.get('aliquota').setValidators(validators);
|
|
3404
3731
|
formGroup.get('aliquota').updateValueAndValidity({ emitEvent: false });
|
|
@@ -3424,10 +3751,51 @@
|
|
|
3424
3751
|
var _b = __read(_a, 2), taxableBase = _b[0], taxRate = _b[1];
|
|
3425
3752
|
var validators = [];
|
|
3426
3753
|
if (taxableBase.isFinite() || taxRate.isFinite()) {
|
|
3427
|
-
validators = [forms.Validators.max(
|
|
3754
|
+
validators = [forms.Validators.max(999.9999), forms.Validators.required];
|
|
3428
3755
|
}
|
|
3429
3756
|
else {
|
|
3430
|
-
validators = [forms.Validators.max(
|
|
3757
|
+
validators = [forms.Validators.max(999.9999)];
|
|
3758
|
+
}
|
|
3759
|
+
formGroup.get('aliquota').setValidators(validators);
|
|
3760
|
+
formGroup.get('aliquota').updateValueAndValidity({ emitEvent: false });
|
|
3761
|
+
});
|
|
3762
|
+
}
|
|
3763
|
+
break;
|
|
3764
|
+
default:
|
|
3765
|
+
throw new Error("Regra TaxRateRequiredValidationRule n\u00E3o implementada para o imposto " + taxType + ", documento " + documentType + ".");
|
|
3766
|
+
}
|
|
3767
|
+
}
|
|
3768
|
+
break;
|
|
3769
|
+
case exports.EnumTipoTributo.CBS_GOVERNAMENTAL:
|
|
3770
|
+
case exports.EnumTipoTributo.IBS_ESTADUAL_GOVERNAMENTAL:
|
|
3771
|
+
case exports.EnumTipoTributo.IBS_MUNICIPAL_GOVERNAMENTAL:
|
|
3772
|
+
{
|
|
3773
|
+
switch (documentType) {
|
|
3774
|
+
case exports.EnumTipoDocumento.NF_ENTRADA:
|
|
3775
|
+
case exports.EnumTipoDocumento.NF_SAIDA:
|
|
3776
|
+
case exports.EnumTipoDocumento.PEDIDO_COMPRA:
|
|
3777
|
+
case exports.EnumTipoDocumento.PEDIDO_VENDA:
|
|
3778
|
+
{
|
|
3779
|
+
rxjs.combineLatest([
|
|
3780
|
+
formGroup
|
|
3781
|
+
.get('baseCalculo')
|
|
3782
|
+
.valueChanges.pipe(operators.startWith(formGroup.get('baseCalculo').value), operators.distinctUntilChanged()),
|
|
3783
|
+
formGroup
|
|
3784
|
+
.get('aliquota')
|
|
3785
|
+
.valueChanges.pipe(operators.startWith(formGroup.get('aliquota').value), operators.distinctUntilChanged())
|
|
3786
|
+
])
|
|
3787
|
+
.pipe(operators.map(function (_a) {
|
|
3788
|
+
var _b = __read(_a, 2), taxableBase = _b[0], taxRate = _b[1];
|
|
3789
|
+
return [new BigNumber(taxableBase), new BigNumber(taxRate)];
|
|
3790
|
+
}))
|
|
3791
|
+
.subscribe(function (_a) {
|
|
3792
|
+
var _b = __read(_a, 2), taxableBase = _b[0], taxRate = _b[1];
|
|
3793
|
+
var validators = [];
|
|
3794
|
+
if (taxableBase.isFinite() || taxRate.isFinite()) {
|
|
3795
|
+
validators = [forms.Validators.max(999.9999), forms.Validators.required];
|
|
3796
|
+
}
|
|
3797
|
+
else {
|
|
3798
|
+
validators = [forms.Validators.max(999.9999)];
|
|
3431
3799
|
}
|
|
3432
3800
|
formGroup.get('aliquota').setValidators(validators);
|
|
3433
3801
|
formGroup.get('aliquota').updateValueAndValidity({ emitEvent: false });
|
|
@@ -3478,10 +3846,12 @@
|
|
|
3478
3846
|
.get('classificacaoTributaria')
|
|
3479
3847
|
.valueChanges.pipe(operators.startWith(formGroup.get('classificacaoTributaria').value)),
|
|
3480
3848
|
formGroup.get('valor').valueChanges.pipe(operators.startWith(formGroup.get('valor').value)),
|
|
3481
|
-
formGroup
|
|
3849
|
+
formGroup
|
|
3850
|
+
.get(exports.EnumCampoTributo.AplicarValorLiquidoDocumento)
|
|
3851
|
+
.valueChanges.pipe(operators.startWith(formGroup.get(exports.EnumCampoTributo.AplicarValorLiquidoDocumento).value))
|
|
3482
3852
|
])
|
|
3483
3853
|
.pipe(operators.map(function (_a) {
|
|
3484
|
-
var _b = __read(_a, 8), taxableBase = _b[0], taxTaxRate = _b[1], taxTaxRateReduction = _b[2], governamentalTaxRateReduction = _b[3], taxSituation = _b[4], taxClassication = _b[5], taxAmount = _b[6],
|
|
3854
|
+
var _b = __read(_a, 8), taxableBase = _b[0], taxTaxRate = _b[1], taxTaxRateReduction = _b[2], governamentalTaxRateReduction = _b[3], taxSituation = _b[4], taxClassication = _b[5], taxAmount = _b[6], applyNetDocumentValue = _b[7];
|
|
3485
3855
|
return [
|
|
3486
3856
|
new BigNumber(taxableBase),
|
|
3487
3857
|
new BigNumber(taxTaxRate),
|
|
@@ -3490,11 +3860,11 @@
|
|
|
3490
3860
|
taxSituation,
|
|
3491
3861
|
taxClassication,
|
|
3492
3862
|
new BigNumber(taxAmount),
|
|
3493
|
-
|
|
3863
|
+
applyNetDocumentValue
|
|
3494
3864
|
];
|
|
3495
3865
|
}))
|
|
3496
3866
|
.subscribe(function (_a) {
|
|
3497
|
-
var _b = __read(_a, 8), taxableBase = _b[0], taxTaxRate = _b[1], taxTaxRateReduction = _b[2], governamentalTaxRateReduction = _b[3], taxSituation = _b[4], taxClassication = _b[5], taxAmount = _b[6],
|
|
3867
|
+
var _b = __read(_a, 8), taxableBase = _b[0], taxTaxRate = _b[1], taxTaxRateReduction = _b[2], governamentalTaxRateReduction = _b[3], taxSituation = _b[4], taxClassication = _b[5], taxAmount = _b[6], applyNetDocumentValue = _b[7];
|
|
3498
3868
|
var validators = [];
|
|
3499
3869
|
if (taxableBase.isFinite() ||
|
|
3500
3870
|
taxTaxRate.isFinite() ||
|
|
@@ -3503,8 +3873,7 @@
|
|
|
3503
3873
|
taxSituation ||
|
|
3504
3874
|
taxClassication ||
|
|
3505
3875
|
taxAmount.isFinite() ||
|
|
3506
|
-
|
|
3507
|
-
netValueOperation === false) {
|
|
3876
|
+
applyNetDocumentValue) {
|
|
3508
3877
|
validators = [forms.Validators.required];
|
|
3509
3878
|
}
|
|
3510
3879
|
else {
|
|
@@ -3574,29 +3943,30 @@
|
|
|
3574
3943
|
.get('classificacaoTributaria')
|
|
3575
3944
|
.valueChanges.pipe(operators.startWith(formGroup.get('classificacaoTributaria').value)),
|
|
3576
3945
|
formGroup.get('valor').valueChanges.pipe(operators.startWith(formGroup.get('valor').value)),
|
|
3577
|
-
formGroup
|
|
3946
|
+
formGroup
|
|
3947
|
+
.get(exports.EnumCampoTributo.AplicarValorLiquidoDocumento)
|
|
3948
|
+
.valueChanges.pipe(operators.startWith(formGroup.get(exports.EnumCampoTributo.AplicarValorLiquidoDocumento).value))
|
|
3578
3949
|
])
|
|
3579
3950
|
.pipe(operators.map(function (_a) {
|
|
3580
|
-
var _b = __read(_a, 6), taxableBase = _b[0], taxTaxRate = _b[1], taxSituation = _b[2], taxClassication = _b[3], taxAmount = _b[4],
|
|
3951
|
+
var _b = __read(_a, 6), taxableBase = _b[0], taxTaxRate = _b[1], taxSituation = _b[2], taxClassication = _b[3], taxAmount = _b[4], applyNetDocumentValue = _b[5];
|
|
3581
3952
|
return [
|
|
3582
3953
|
new BigNumber(taxableBase),
|
|
3583
3954
|
new BigNumber(taxTaxRate),
|
|
3584
3955
|
taxSituation,
|
|
3585
3956
|
taxClassication,
|
|
3586
3957
|
new BigNumber(taxAmount),
|
|
3587
|
-
|
|
3958
|
+
applyNetDocumentValue
|
|
3588
3959
|
];
|
|
3589
3960
|
}))
|
|
3590
3961
|
.subscribe(function (_a) {
|
|
3591
|
-
var _b = __read(_a, 6), taxableBase = _b[0], taxTaxRate = _b[1], taxSituation = _b[2], taxClassication = _b[3], taxAmount = _b[4],
|
|
3962
|
+
var _b = __read(_a, 6), taxableBase = _b[0], taxTaxRate = _b[1], taxSituation = _b[2], taxClassication = _b[3], taxAmount = _b[4], applyNetDocumentValue = _b[5];
|
|
3592
3963
|
var validators = [];
|
|
3593
3964
|
if (taxableBase.isFinite() ||
|
|
3594
3965
|
taxTaxRate.isFinite() ||
|
|
3595
3966
|
taxSituation ||
|
|
3596
3967
|
taxClassication ||
|
|
3597
3968
|
taxAmount.isFinite() ||
|
|
3598
|
-
|
|
3599
|
-
netValueOperation === false) {
|
|
3969
|
+
applyNetDocumentValue) {
|
|
3600
3970
|
validators = [forms.Validators.required];
|
|
3601
3971
|
}
|
|
3602
3972
|
else {
|
|
@@ -3657,11 +4027,11 @@
|
|
|
3657
4027
|
.get('classificacaoTributaria')
|
|
3658
4028
|
.valueChanges.pipe(operators.startWith(formGroup.get('classificacaoTributaria').value)),
|
|
3659
4029
|
formGroup
|
|
3660
|
-
.get(
|
|
3661
|
-
.valueChanges.pipe(operators.startWith(formGroup.get(
|
|
4030
|
+
.get(exports.EnumCampoTributo.AplicarValorLiquidoDocumento)
|
|
4031
|
+
.valueChanges.pipe(operators.startWith(formGroup.get(exports.EnumCampoTributo.AplicarValorLiquidoDocumento).value), operators.distinctUntilChanged())
|
|
3662
4032
|
])
|
|
3663
4033
|
.pipe(operators.map(function (_a) {
|
|
3664
|
-
var _b = __read(_a, 7), taxableBase = _b[0], taxRate = _b[1], effectiveTaxRate = _b[2], taxAmount = _b[3], taxSituation = _b[4], taxClassication = _b[5],
|
|
4034
|
+
var _b = __read(_a, 7), taxableBase = _b[0], taxRate = _b[1], effectiveTaxRate = _b[2], taxAmount = _b[3], taxSituation = _b[4], taxClassication = _b[5], applyNetDocumentValue = _b[6];
|
|
3665
4035
|
return [
|
|
3666
4036
|
new BigNumber(taxableBase),
|
|
3667
4037
|
new BigNumber(taxRate),
|
|
@@ -3669,11 +4039,11 @@
|
|
|
3669
4039
|
new BigNumber(taxAmount),
|
|
3670
4040
|
taxSituation,
|
|
3671
4041
|
taxClassication,
|
|
3672
|
-
|
|
4042
|
+
applyNetDocumentValue
|
|
3673
4043
|
];
|
|
3674
4044
|
}))
|
|
3675
4045
|
.subscribe(function (_a) {
|
|
3676
|
-
var _b = __read(_a, 7), taxableBase = _b[0], taxRate = _b[1], effectiveTaxRate = _b[2], taxAmount = _b[3], taxSituation = _b[4], taxClassication = _b[5],
|
|
4046
|
+
var _b = __read(_a, 7), taxableBase = _b[0], taxRate = _b[1], effectiveTaxRate = _b[2], taxAmount = _b[3], taxSituation = _b[4], taxClassication = _b[5], applyNetDocumentValue = _b[6];
|
|
3677
4047
|
var validators = [];
|
|
3678
4048
|
if (taxableBase.isFinite() ||
|
|
3679
4049
|
taxRate.isFinite() ||
|
|
@@ -3681,8 +4051,7 @@
|
|
|
3681
4051
|
taxAmount.isFinite() ||
|
|
3682
4052
|
taxSituation ||
|
|
3683
4053
|
taxClassication ||
|
|
3684
|
-
|
|
3685
|
-
netValueOperation === false) {
|
|
4054
|
+
applyNetDocumentValue) {
|
|
3686
4055
|
validators = [forms.Validators.max(9999999999999.99), forms.Validators.required];
|
|
3687
4056
|
}
|
|
3688
4057
|
else {
|
|
@@ -3757,29 +4126,30 @@
|
|
|
3757
4126
|
formGroup
|
|
3758
4127
|
.get('classificacaoTributaria')
|
|
3759
4128
|
.valueChanges.pipe(operators.startWith(formGroup.get('classificacaoTributaria').value)),
|
|
3760
|
-
formGroup
|
|
4129
|
+
formGroup
|
|
4130
|
+
.get(exports.EnumCampoTributo.AplicarValorLiquidoDocumento)
|
|
4131
|
+
.valueChanges.pipe(operators.startWith(formGroup.get(exports.EnumCampoTributo.AplicarValorLiquidoDocumento).value))
|
|
3761
4132
|
])
|
|
3762
4133
|
.pipe(operators.map(function (_a) {
|
|
3763
|
-
var _b = __read(_a, 6), taxableBase = _b[0], taxRate = _b[1], taxAmount = _b[2], taxSituation = _b[3], taxClassication = _b[4],
|
|
4134
|
+
var _b = __read(_a, 6), taxableBase = _b[0], taxRate = _b[1], taxAmount = _b[2], taxSituation = _b[3], taxClassication = _b[4], applyNetDocumentValue = _b[5];
|
|
3764
4135
|
return [
|
|
3765
4136
|
new BigNumber(taxableBase),
|
|
3766
4137
|
new BigNumber(taxRate),
|
|
3767
4138
|
new BigNumber(taxAmount),
|
|
3768
4139
|
taxSituation,
|
|
3769
4140
|
taxClassication,
|
|
3770
|
-
|
|
4141
|
+
applyNetDocumentValue
|
|
3771
4142
|
];
|
|
3772
4143
|
}))
|
|
3773
4144
|
.subscribe(function (_a) {
|
|
3774
|
-
var _b = __read(_a, 6), taxableBase = _b[0], taxRate = _b[1], taxAmount = _b[2], taxSituation = _b[3], taxClassication = _b[4],
|
|
4145
|
+
var _b = __read(_a, 6), taxableBase = _b[0], taxRate = _b[1], taxAmount = _b[2], taxSituation = _b[3], taxClassication = _b[4], applyNetDocumentValue = _b[5];
|
|
3775
4146
|
var validators = [];
|
|
3776
4147
|
if (taxableBase.isFinite() ||
|
|
3777
4148
|
taxRate.isFinite() ||
|
|
3778
4149
|
taxAmount.isFinite() ||
|
|
3779
4150
|
taxSituation ||
|
|
3780
4151
|
taxClassication ||
|
|
3781
|
-
|
|
3782
|
-
netValueOperation === false) {
|
|
4152
|
+
applyNetDocumentValue) {
|
|
3783
4153
|
validators = [forms.Validators.max(9999999999999.99), forms.Validators.required];
|
|
3784
4154
|
}
|
|
3785
4155
|
else {
|
|
@@ -3821,7 +4191,6 @@
|
|
|
3821
4191
|
}
|
|
3822
4192
|
break;
|
|
3823
4193
|
case exports.EnumTipoTributo.CBS_CREDITO_PRESUMIDO:
|
|
3824
|
-
case exports.EnumTipoTributo.IBS_ESTADUAL_CREDITO_PRESUMIDO:
|
|
3825
4194
|
switch (documentType) {
|
|
3826
4195
|
case exports.EnumTipoDocumento.NF_ENTRADA:
|
|
3827
4196
|
case exports.EnumTipoDocumento.NF_SAIDA:
|
|
@@ -3888,6 +4257,81 @@
|
|
|
3888
4257
|
throw new Error("Regra TaxableBaseRequiredValidationRule n\u00E3o implementada para o imposto " + taxType + ", documento " + documentType + ".");
|
|
3889
4258
|
}
|
|
3890
4259
|
break;
|
|
4260
|
+
case exports.EnumTipoTributo.IBS_CREDITO_PRESUMIDO:
|
|
4261
|
+
switch (documentType) {
|
|
4262
|
+
case exports.EnumTipoDocumento.NF_ENTRADA:
|
|
4263
|
+
case exports.EnumTipoDocumento.NF_SAIDA:
|
|
4264
|
+
{
|
|
4265
|
+
rxjs.combineLatest([
|
|
4266
|
+
formGroup
|
|
4267
|
+
.get('baseCalculo')
|
|
4268
|
+
.valueChanges.pipe(operators.startWith(formGroup.get('baseCalculo').value), operators.distinctUntilChanged()),
|
|
4269
|
+
formGroup
|
|
4270
|
+
.get('aliquota')
|
|
4271
|
+
.valueChanges.pipe(operators.startWith(formGroup.get('aliquota').value), operators.distinctUntilChanged()),
|
|
4272
|
+
formGroup
|
|
4273
|
+
.get('classificacaoTributaria')
|
|
4274
|
+
.valueChanges.pipe(operators.startWith(formGroup.get('classificacaoTributaria').value), operators.distinctUntilChanged()),
|
|
4275
|
+
formGroup
|
|
4276
|
+
.get(exports.EnumCampoTributo.AplicarValorLiquidoDocumento)
|
|
4277
|
+
.valueChanges.pipe(operators.startWith(formGroup.get(exports.EnumCampoTributo.AplicarValorLiquidoDocumento).value), operators.distinctUntilChanged())
|
|
4278
|
+
])
|
|
4279
|
+
.pipe(operators.map(function (_a) {
|
|
4280
|
+
var _b = __read(_a, 4), taxableBase = _b[0], taxRate = _b[1], taxClassication = _b[2], applyNetDocumentValue = _b[3];
|
|
4281
|
+
return [
|
|
4282
|
+
new BigNumber(taxableBase),
|
|
4283
|
+
new BigNumber(taxRate),
|
|
4284
|
+
taxClassication,
|
|
4285
|
+
applyNetDocumentValue
|
|
4286
|
+
];
|
|
4287
|
+
}))
|
|
4288
|
+
.subscribe(function (_a) {
|
|
4289
|
+
var _b = __read(_a, 4), taxableBase = _b[0], taxRate = _b[1], taxClassication = _b[2], applyNetDocumentValue = _b[3];
|
|
4290
|
+
var validators = [];
|
|
4291
|
+
if (taxableBase.isFinite() || taxRate.isFinite() || taxClassication || applyNetDocumentValue) {
|
|
4292
|
+
validators = [forms.Validators.max(9999999999999.99), forms.Validators.required];
|
|
4293
|
+
}
|
|
4294
|
+
else {
|
|
4295
|
+
validators = [forms.Validators.max(9999999999999.99)];
|
|
4296
|
+
}
|
|
4297
|
+
formGroup.get('baseCalculo').setValidators(validators);
|
|
4298
|
+
formGroup.get('baseCalculo').updateValueAndValidity({ emitEvent: false });
|
|
4299
|
+
});
|
|
4300
|
+
}
|
|
4301
|
+
break;
|
|
4302
|
+
case exports.EnumTipoDocumento.PEDIDO_COMPRA:
|
|
4303
|
+
case exports.EnumTipoDocumento.PEDIDO_VENDA:
|
|
4304
|
+
{
|
|
4305
|
+
rxjs.combineLatest([
|
|
4306
|
+
formGroup
|
|
4307
|
+
.get('baseCalculo')
|
|
4308
|
+
.valueChanges.pipe(operators.startWith(formGroup.get('baseCalculo').value), operators.distinctUntilChanged()),
|
|
4309
|
+
formGroup
|
|
4310
|
+
.get('aliquota')
|
|
4311
|
+
.valueChanges.pipe(operators.startWith(formGroup.get('aliquota').value), operators.distinctUntilChanged())
|
|
4312
|
+
])
|
|
4313
|
+
.pipe(operators.map(function (_a) {
|
|
4314
|
+
var _b = __read(_a, 2), taxableBase = _b[0], taxRate = _b[1];
|
|
4315
|
+
return [new BigNumber(taxableBase), new BigNumber(taxRate)];
|
|
4316
|
+
}))
|
|
4317
|
+
.subscribe(function (_a) {
|
|
4318
|
+
var _b = __read(_a, 2), taxableBase = _b[0], taxRate = _b[1];
|
|
4319
|
+
var validators = [];
|
|
4320
|
+
if (taxableBase.isFinite() || taxRate.isFinite()) {
|
|
4321
|
+
validators = [forms.Validators.max(9999999999999.99), forms.Validators.required];
|
|
4322
|
+
}
|
|
4323
|
+
else {
|
|
4324
|
+
validators = [forms.Validators.max(9999999999999.99)];
|
|
4325
|
+
}
|
|
4326
|
+
formGroup.get('baseCalculo').setValidators(validators);
|
|
4327
|
+
formGroup.get('baseCalculo').updateValueAndValidity({ emitEvent: false });
|
|
4328
|
+
});
|
|
4329
|
+
}
|
|
4330
|
+
break;
|
|
4331
|
+
default:
|
|
4332
|
+
throw new Error("Regra TaxableBaseRequiredValidationRule n\u00E3o implementada para o imposto " + taxType + ", documento " + documentType + ".");
|
|
4333
|
+
}
|
|
4334
|
+
break;
|
|
3891
4335
|
case exports.EnumTipoTributo.CBS_TRIBUTACAO_REGULAR:
|
|
3892
4336
|
case exports.EnumTipoTributo.IBS_ESTADUAL_TRIBUTACAO_REGULAR:
|
|
3893
4337
|
case exports.EnumTipoTributo.IBS_MUNICIPAL_TRIBUTACAO_REGULAR:
|
|
@@ -3950,37 +4394,146 @@
|
|
|
3950
4394
|
validators = [forms.Validators.max(9999999999999.99), forms.Validators.required];
|
|
3951
4395
|
}
|
|
3952
4396
|
else {
|
|
3953
|
-
validators = [forms.Validators.max(9999999999999.99)];
|
|
4397
|
+
validators = [forms.Validators.max(9999999999999.99)];
|
|
4398
|
+
}
|
|
4399
|
+
formGroup.get('baseCalculo').setValidators(validators);
|
|
4400
|
+
formGroup.get('baseCalculo').updateValueAndValidity({ emitEvent: false });
|
|
4401
|
+
});
|
|
4402
|
+
}
|
|
4403
|
+
break;
|
|
4404
|
+
default:
|
|
4405
|
+
throw new Error("Regra TaxableBaseRequiredValidationRule n\u00E3o implementada para o imposto " + taxType + ", documento " + documentType + ".");
|
|
4406
|
+
}
|
|
4407
|
+
}
|
|
4408
|
+
break;
|
|
4409
|
+
case exports.EnumTipoTributo.CBS_GOVERNAMENTAL:
|
|
4410
|
+
case exports.EnumTipoTributo.IBS_ESTADUAL_GOVERNAMENTAL:
|
|
4411
|
+
case exports.EnumTipoTributo.IBS_MUNICIPAL_GOVERNAMENTAL:
|
|
4412
|
+
{
|
|
4413
|
+
switch (documentType) {
|
|
4414
|
+
case exports.EnumTipoDocumento.NF_ENTRADA:
|
|
4415
|
+
case exports.EnumTipoDocumento.NF_SAIDA:
|
|
4416
|
+
case exports.EnumTipoDocumento.PEDIDO_COMPRA:
|
|
4417
|
+
case exports.EnumTipoDocumento.PEDIDO_VENDA:
|
|
4418
|
+
{
|
|
4419
|
+
rxjs.combineLatest([
|
|
4420
|
+
formGroup
|
|
4421
|
+
.get('baseCalculo')
|
|
4422
|
+
.valueChanges.pipe(operators.startWith(formGroup.get('baseCalculo').value), operators.distinctUntilChanged()),
|
|
4423
|
+
formGroup
|
|
4424
|
+
.get('aliquota')
|
|
4425
|
+
.valueChanges.pipe(operators.startWith(formGroup.get('aliquota').value), operators.distinctUntilChanged())
|
|
4426
|
+
])
|
|
4427
|
+
.pipe(operators.map(function (_a) {
|
|
4428
|
+
var _b = __read(_a, 2), taxableBase = _b[0], taxRate = _b[1];
|
|
4429
|
+
return [new BigNumber(taxableBase), new BigNumber(taxRate)];
|
|
4430
|
+
}))
|
|
4431
|
+
.subscribe(function (_a) {
|
|
4432
|
+
var _b = __read(_a, 2), taxableBase = _b[0], taxRate = _b[1];
|
|
4433
|
+
var validators = [];
|
|
4434
|
+
if (taxableBase.isFinite() || taxRate.isFinite()) {
|
|
4435
|
+
validators = [forms.Validators.max(9999999999999.99), forms.Validators.required];
|
|
4436
|
+
}
|
|
4437
|
+
else {
|
|
4438
|
+
validators = [forms.Validators.max(9999999999999.99)];
|
|
4439
|
+
}
|
|
4440
|
+
formGroup.get('baseCalculo').setValidators(validators);
|
|
4441
|
+
formGroup.get('baseCalculo').updateValueAndValidity({ emitEvent: false });
|
|
4442
|
+
});
|
|
4443
|
+
}
|
|
4444
|
+
break;
|
|
4445
|
+
default:
|
|
4446
|
+
throw new Error("Regra TaxableBaseRequiredValidationRule n\u00E3o implementada para o imposto " + taxType + ", documento " + documentType + ".");
|
|
4447
|
+
}
|
|
4448
|
+
}
|
|
4449
|
+
break;
|
|
4450
|
+
default:
|
|
4451
|
+
throw new Error("Regra TaxableBaseRequiredValidationRule n\u00E3o implementada para o imposto " + taxType + ", documento " + documentType + ".");
|
|
4452
|
+
}
|
|
4453
|
+
};
|
|
4454
|
+
TaxableBaseRequiredValidationRule.ɵprov = core.ɵɵdefineInjectable({ factory: function TaxableBaseRequiredValidationRule_Factory() { return new TaxableBaseRequiredValidationRule(); }, token: TaxableBaseRequiredValidationRule, providedIn: "root" });
|
|
4455
|
+
TaxableBaseRequiredValidationRule = __decorate([
|
|
4456
|
+
core.Injectable({ providedIn: 'root' })
|
|
4457
|
+
], TaxableBaseRequiredValidationRule);
|
|
4458
|
+
return TaxableBaseRequiredValidationRule;
|
|
4459
|
+
}());
|
|
4460
|
+
|
|
4461
|
+
var NetAmountApplicationRequiredValidationRule = /** @class */ (function () {
|
|
4462
|
+
function NetAmountApplicationRequiredValidationRule() {
|
|
4463
|
+
}
|
|
4464
|
+
NetAmountApplicationRequiredValidationRule.prototype.apply = function (_a) {
|
|
4465
|
+
var documentType = _a.documentType, _b = _a.item, taxType = _b.name, formGroup = _b.formGroup;
|
|
4466
|
+
switch (taxType) {
|
|
4467
|
+
case exports.EnumTipoTributo.CBS:
|
|
4468
|
+
case exports.EnumTipoTributo.IBS_ESTADUAL:
|
|
4469
|
+
case exports.EnumTipoTributo.IBS_MUNICIPAL:
|
|
4470
|
+
case exports.EnumTipoTributo.IBS_CREDITO_PRESUMIDO:
|
|
4471
|
+
case exports.EnumTipoTributo.IS:
|
|
4472
|
+
{
|
|
4473
|
+
switch (documentType) {
|
|
4474
|
+
case exports.EnumTipoDocumento.NF_ENTRADA:
|
|
4475
|
+
case exports.EnumTipoDocumento.NF_SAIDA:
|
|
4476
|
+
{
|
|
4477
|
+
rxjs.combineLatest([
|
|
4478
|
+
formGroup.get('baseCalculo').valueChanges.pipe(operators.startWith(formGroup.get('baseCalculo').value)),
|
|
4479
|
+
formGroup.get('aliquota').valueChanges.pipe(operators.startWith(formGroup.get('aliquota').value)),
|
|
4480
|
+
formGroup
|
|
4481
|
+
.get('classificacaoTributaria')
|
|
4482
|
+
.valueChanges.pipe(operators.startWith(formGroup.get('classificacaoTributaria').value)),
|
|
4483
|
+
formGroup
|
|
4484
|
+
.get(exports.EnumCampoTributo.AplicarValorLiquidoDocumento)
|
|
4485
|
+
.valueChanges.pipe(operators.startWith(formGroup.get(exports.EnumCampoTributo.AplicarValorLiquidoDocumento).value))
|
|
4486
|
+
])
|
|
4487
|
+
.pipe(operators.map(function (_a) {
|
|
4488
|
+
var _b = __read(_a, 4), taxableBase = _b[0], taxRate = _b[1], taxClassification = _b[2], netAmountApplication = _b[3];
|
|
4489
|
+
return [
|
|
4490
|
+
new BigNumber(taxableBase),
|
|
4491
|
+
new BigNumber(taxRate),
|
|
4492
|
+
taxClassification,
|
|
4493
|
+
netAmountApplication
|
|
4494
|
+
];
|
|
4495
|
+
}))
|
|
4496
|
+
.subscribe(function (_a) {
|
|
4497
|
+
var _b = __read(_a, 4), taxableBase = _b[0], taxRate = _b[1], taxClassification = _b[2], netAmountApplication = _b[3];
|
|
4498
|
+
var validators = [];
|
|
4499
|
+
if (taxableBase.isFinite() || taxRate.isFinite() || taxClassification || netAmountApplication) {
|
|
4500
|
+
validators = [forms.Validators.required];
|
|
4501
|
+
}
|
|
4502
|
+
else {
|
|
4503
|
+
validators = [];
|
|
3954
4504
|
}
|
|
3955
|
-
formGroup.get(
|
|
3956
|
-
formGroup
|
|
4505
|
+
formGroup.get(exports.EnumCampoTributo.AplicarValorLiquidoDocumento).setValidators(validators);
|
|
4506
|
+
formGroup
|
|
4507
|
+
.get(exports.EnumCampoTributo.AplicarValorLiquidoDocumento)
|
|
4508
|
+
.updateValueAndValidity({ emitEvent: false });
|
|
3957
4509
|
});
|
|
3958
4510
|
}
|
|
3959
4511
|
break;
|
|
3960
4512
|
default:
|
|
3961
|
-
throw new Error("Regra
|
|
4513
|
+
throw new Error("Regra NetAmountApplicationRequiredValidationRule n\u00E3o implementada para o imposto " + taxType + ", documento " + documentType + ".");
|
|
3962
4514
|
}
|
|
3963
4515
|
}
|
|
3964
4516
|
break;
|
|
3965
4517
|
default:
|
|
3966
|
-
throw new Error("Regra
|
|
4518
|
+
throw new Error("Regra NetAmountApplicationRequiredValidationRule n\u00E3o implementada para o imposto " + taxType + ", documento " + documentType + ".");
|
|
3967
4519
|
}
|
|
3968
4520
|
};
|
|
3969
|
-
|
|
3970
|
-
|
|
4521
|
+
NetAmountApplicationRequiredValidationRule.ɵprov = core.ɵɵdefineInjectable({ factory: function NetAmountApplicationRequiredValidationRule_Factory() { return new NetAmountApplicationRequiredValidationRule(); }, token: NetAmountApplicationRequiredValidationRule, providedIn: "root" });
|
|
4522
|
+
NetAmountApplicationRequiredValidationRule = __decorate([
|
|
3971
4523
|
core.Injectable({ providedIn: 'root' })
|
|
3972
|
-
],
|
|
3973
|
-
return
|
|
4524
|
+
], NetAmountApplicationRequiredValidationRule);
|
|
4525
|
+
return NetAmountApplicationRequiredValidationRule;
|
|
3974
4526
|
}());
|
|
3975
4527
|
|
|
3976
4528
|
var ValidationRulesRegistry = /** @class */ (function () {
|
|
3977
|
-
function ValidationRulesRegistry(taxableBaseRequiredValidationRule, taxRateRequiredValidationRule, taxClassificationRequiredValidationRule, taxAmountRequiredValidationRule, taxSituationRequiredValidationRule) {
|
|
4529
|
+
function ValidationRulesRegistry(taxableBaseRequiredValidationRule, taxRateRequiredValidationRule, taxClassificationRequiredValidationRule, taxAmountRequiredValidationRule, taxSituationRequiredValidationRule, netAmountApplicationRequiredValidationRule) {
|
|
3978
4530
|
var _a, _b, _c, _d, _e;
|
|
3979
4531
|
this.taxableBaseRequiredValidationRule = taxableBaseRequiredValidationRule;
|
|
3980
4532
|
this.taxRateRequiredValidationRule = taxRateRequiredValidationRule;
|
|
3981
4533
|
this.taxClassificationRequiredValidationRule = taxClassificationRequiredValidationRule;
|
|
3982
4534
|
this.taxAmountRequiredValidationRule = taxAmountRequiredValidationRule;
|
|
3983
4535
|
this.taxSituationRequiredValidationRule = taxSituationRequiredValidationRule;
|
|
4536
|
+
this.netAmountApplicationRequiredValidationRule = netAmountApplicationRequiredValidationRule;
|
|
3984
4537
|
this.strategies = (_a = {},
|
|
3985
4538
|
_a[exports.EnumTipoDocumento.NF_ENTRADA] = (_b = {},
|
|
3986
4539
|
_b[exports.EnumTipoTributo.CBS] = [
|
|
@@ -4003,6 +4556,10 @@
|
|
|
4003
4556
|
{
|
|
4004
4557
|
field: exports.EnumCampoTributo.SituacaoTributaria,
|
|
4005
4558
|
rules: [this.taxSituationRequiredValidationRule]
|
|
4559
|
+
},
|
|
4560
|
+
{
|
|
4561
|
+
field: exports.EnumCampoTributo.AplicarValorLiquidoDocumento,
|
|
4562
|
+
rules: [this.netAmountApplicationRequiredValidationRule]
|
|
4006
4563
|
}
|
|
4007
4564
|
],
|
|
4008
4565
|
_b[exports.EnumTipoTributo.CBS_CREDITO_PRESUMIDO] = [
|
|
@@ -4037,6 +4594,16 @@
|
|
|
4037
4594
|
rules: [this.taxSituationRequiredValidationRule]
|
|
4038
4595
|
}
|
|
4039
4596
|
],
|
|
4597
|
+
_b[exports.EnumTipoTributo.CBS_GOVERNAMENTAL] = [
|
|
4598
|
+
{
|
|
4599
|
+
field: exports.EnumCampoTributo.BaseCalculo,
|
|
4600
|
+
rules: [this.taxableBaseRequiredValidationRule]
|
|
4601
|
+
},
|
|
4602
|
+
{
|
|
4603
|
+
field: exports.EnumCampoTributo.Aliquota,
|
|
4604
|
+
rules: [this.taxRateRequiredValidationRule]
|
|
4605
|
+
}
|
|
4606
|
+
],
|
|
4040
4607
|
_b[exports.EnumTipoTributo.IBS_ESTADUAL] = [
|
|
4041
4608
|
{
|
|
4042
4609
|
field: exports.EnumCampoTributo.BaseCalculo,
|
|
@@ -4057,9 +4624,13 @@
|
|
|
4057
4624
|
{
|
|
4058
4625
|
field: exports.EnumCampoTributo.SituacaoTributaria,
|
|
4059
4626
|
rules: [this.taxSituationRequiredValidationRule]
|
|
4627
|
+
},
|
|
4628
|
+
{
|
|
4629
|
+
field: exports.EnumCampoTributo.AplicarValorLiquidoDocumento,
|
|
4630
|
+
rules: [this.netAmountApplicationRequiredValidationRule]
|
|
4060
4631
|
}
|
|
4061
4632
|
],
|
|
4062
|
-
_b[exports.EnumTipoTributo.
|
|
4633
|
+
_b[exports.EnumTipoTributo.IBS_ESTADUAL_TRIBUTACAO_REGULAR] = [
|
|
4063
4634
|
{
|
|
4064
4635
|
field: exports.EnumCampoTributo.BaseCalculo,
|
|
4065
4636
|
rules: [this.taxableBaseRequiredValidationRule]
|
|
@@ -4069,11 +4640,15 @@
|
|
|
4069
4640
|
rules: [this.taxRateRequiredValidationRule]
|
|
4070
4641
|
},
|
|
4071
4642
|
{
|
|
4072
|
-
field: exports.EnumCampoTributo.
|
|
4643
|
+
field: exports.EnumCampoTributo.ClassificacaoTributaria,
|
|
4073
4644
|
rules: [this.taxClassificationRequiredValidationRule]
|
|
4645
|
+
},
|
|
4646
|
+
{
|
|
4647
|
+
field: exports.EnumCampoTributo.SituacaoTributaria,
|
|
4648
|
+
rules: [this.taxSituationRequiredValidationRule]
|
|
4074
4649
|
}
|
|
4075
4650
|
],
|
|
4076
|
-
_b[exports.EnumTipoTributo.
|
|
4651
|
+
_b[exports.EnumTipoTributo.IBS_ESTADUAL_GOVERNAMENTAL] = [
|
|
4077
4652
|
{
|
|
4078
4653
|
field: exports.EnumCampoTributo.BaseCalculo,
|
|
4079
4654
|
rules: [this.taxableBaseRequiredValidationRule]
|
|
@@ -4081,14 +4656,6 @@
|
|
|
4081
4656
|
{
|
|
4082
4657
|
field: exports.EnumCampoTributo.Aliquota,
|
|
4083
4658
|
rules: [this.taxRateRequiredValidationRule]
|
|
4084
|
-
},
|
|
4085
|
-
{
|
|
4086
|
-
field: exports.EnumCampoTributo.ClassificacaoTributaria,
|
|
4087
|
-
rules: [this.taxClassificationRequiredValidationRule]
|
|
4088
|
-
},
|
|
4089
|
-
{
|
|
4090
|
-
field: exports.EnumCampoTributo.SituacaoTributaria,
|
|
4091
|
-
rules: [this.taxSituationRequiredValidationRule]
|
|
4092
4659
|
}
|
|
4093
4660
|
],
|
|
4094
4661
|
_b[exports.EnumTipoTributo.IBS_MUNICIPAL] = [
|
|
@@ -4111,6 +4678,10 @@
|
|
|
4111
4678
|
{
|
|
4112
4679
|
field: exports.EnumCampoTributo.SituacaoTributaria,
|
|
4113
4680
|
rules: [this.taxSituationRequiredValidationRule]
|
|
4681
|
+
},
|
|
4682
|
+
{
|
|
4683
|
+
field: exports.EnumCampoTributo.AplicarValorLiquidoDocumento,
|
|
4684
|
+
rules: [this.netAmountApplicationRequiredValidationRule]
|
|
4114
4685
|
}
|
|
4115
4686
|
],
|
|
4116
4687
|
_b[exports.EnumTipoTributo.IBS_MUNICIPAL_TRIBUTACAO_REGULAR] = [
|
|
@@ -4131,6 +4702,34 @@
|
|
|
4131
4702
|
rules: [this.taxSituationRequiredValidationRule]
|
|
4132
4703
|
}
|
|
4133
4704
|
],
|
|
4705
|
+
_b[exports.EnumTipoTributo.IBS_MUNICIPAL_GOVERNAMENTAL] = [
|
|
4706
|
+
{
|
|
4707
|
+
field: exports.EnumCampoTributo.BaseCalculo,
|
|
4708
|
+
rules: [this.taxableBaseRequiredValidationRule]
|
|
4709
|
+
},
|
|
4710
|
+
{
|
|
4711
|
+
field: exports.EnumCampoTributo.Aliquota,
|
|
4712
|
+
rules: [this.taxRateRequiredValidationRule]
|
|
4713
|
+
}
|
|
4714
|
+
],
|
|
4715
|
+
_b[exports.EnumTipoTributo.IBS_CREDITO_PRESUMIDO] = [
|
|
4716
|
+
{
|
|
4717
|
+
field: exports.EnumCampoTributo.BaseCalculo,
|
|
4718
|
+
rules: [this.taxableBaseRequiredValidationRule]
|
|
4719
|
+
},
|
|
4720
|
+
{
|
|
4721
|
+
field: exports.EnumCampoTributo.Aliquota,
|
|
4722
|
+
rules: [this.taxRateRequiredValidationRule]
|
|
4723
|
+
},
|
|
4724
|
+
{
|
|
4725
|
+
field: exports.EnumCampoTributo.ClassificacaoTributariaCreditoPresumido,
|
|
4726
|
+
rules: [this.taxClassificationRequiredValidationRule]
|
|
4727
|
+
},
|
|
4728
|
+
{
|
|
4729
|
+
field: exports.EnumCampoTributo.AplicarValorLiquidoDocumento,
|
|
4730
|
+
rules: [this.netAmountApplicationRequiredValidationRule]
|
|
4731
|
+
}
|
|
4732
|
+
],
|
|
4134
4733
|
_b[exports.EnumTipoTributo.IS] = [
|
|
4135
4734
|
{
|
|
4136
4735
|
field: exports.EnumCampoTributo.BaseCalculo,
|
|
@@ -4147,6 +4746,10 @@
|
|
|
4147
4746
|
{
|
|
4148
4747
|
field: exports.EnumCampoTributo.SituacaoTributaria,
|
|
4149
4748
|
rules: [this.taxSituationRequiredValidationRule]
|
|
4749
|
+
},
|
|
4750
|
+
{
|
|
4751
|
+
field: exports.EnumCampoTributo.AplicarValorLiquidoDocumento,
|
|
4752
|
+
rules: [this.netAmountApplicationRequiredValidationRule]
|
|
4150
4753
|
}
|
|
4151
4754
|
],
|
|
4152
4755
|
_b),
|
|
@@ -4171,6 +4774,10 @@
|
|
|
4171
4774
|
{
|
|
4172
4775
|
field: exports.EnumCampoTributo.SituacaoTributaria,
|
|
4173
4776
|
rules: [this.taxSituationRequiredValidationRule]
|
|
4777
|
+
},
|
|
4778
|
+
{
|
|
4779
|
+
field: exports.EnumCampoTributo.AplicarValorLiquidoDocumento,
|
|
4780
|
+
rules: [this.netAmountApplicationRequiredValidationRule]
|
|
4174
4781
|
}
|
|
4175
4782
|
],
|
|
4176
4783
|
_c[exports.EnumTipoTributo.CBS_CREDITO_PRESUMIDO] = [
|
|
@@ -4205,6 +4812,16 @@
|
|
|
4205
4812
|
rules: [this.taxSituationRequiredValidationRule]
|
|
4206
4813
|
}
|
|
4207
4814
|
],
|
|
4815
|
+
_c[exports.EnumTipoTributo.CBS_GOVERNAMENTAL] = [
|
|
4816
|
+
{
|
|
4817
|
+
field: exports.EnumCampoTributo.BaseCalculo,
|
|
4818
|
+
rules: [this.taxableBaseRequiredValidationRule]
|
|
4819
|
+
},
|
|
4820
|
+
{
|
|
4821
|
+
field: exports.EnumCampoTributo.Aliquota,
|
|
4822
|
+
rules: [this.taxRateRequiredValidationRule]
|
|
4823
|
+
}
|
|
4824
|
+
],
|
|
4208
4825
|
_c[exports.EnumTipoTributo.IBS_ESTADUAL] = [
|
|
4209
4826
|
{
|
|
4210
4827
|
field: exports.EnumCampoTributo.BaseCalculo,
|
|
@@ -4225,9 +4842,13 @@
|
|
|
4225
4842
|
{
|
|
4226
4843
|
field: exports.EnumCampoTributo.SituacaoTributaria,
|
|
4227
4844
|
rules: [this.taxSituationRequiredValidationRule]
|
|
4845
|
+
},
|
|
4846
|
+
{
|
|
4847
|
+
field: exports.EnumCampoTributo.AplicarValorLiquidoDocumento,
|
|
4848
|
+
rules: [this.netAmountApplicationRequiredValidationRule]
|
|
4228
4849
|
}
|
|
4229
4850
|
],
|
|
4230
|
-
_c[exports.EnumTipoTributo.
|
|
4851
|
+
_c[exports.EnumTipoTributo.IBS_ESTADUAL_TRIBUTACAO_REGULAR] = [
|
|
4231
4852
|
{
|
|
4232
4853
|
field: exports.EnumCampoTributo.BaseCalculo,
|
|
4233
4854
|
rules: [this.taxableBaseRequiredValidationRule]
|
|
@@ -4237,11 +4858,15 @@
|
|
|
4237
4858
|
rules: [this.taxRateRequiredValidationRule]
|
|
4238
4859
|
},
|
|
4239
4860
|
{
|
|
4240
|
-
field: exports.EnumCampoTributo.
|
|
4861
|
+
field: exports.EnumCampoTributo.ClassificacaoTributaria,
|
|
4241
4862
|
rules: [this.taxClassificationRequiredValidationRule]
|
|
4863
|
+
},
|
|
4864
|
+
{
|
|
4865
|
+
field: exports.EnumCampoTributo.SituacaoTributaria,
|
|
4866
|
+
rules: [this.taxSituationRequiredValidationRule]
|
|
4242
4867
|
}
|
|
4243
4868
|
],
|
|
4244
|
-
_c[exports.EnumTipoTributo.
|
|
4869
|
+
_c[exports.EnumTipoTributo.IBS_ESTADUAL_GOVERNAMENTAL] = [
|
|
4245
4870
|
{
|
|
4246
4871
|
field: exports.EnumCampoTributo.BaseCalculo,
|
|
4247
4872
|
rules: [this.taxableBaseRequiredValidationRule]
|
|
@@ -4249,14 +4874,6 @@
|
|
|
4249
4874
|
{
|
|
4250
4875
|
field: exports.EnumCampoTributo.Aliquota,
|
|
4251
4876
|
rules: [this.taxRateRequiredValidationRule]
|
|
4252
|
-
},
|
|
4253
|
-
{
|
|
4254
|
-
field: exports.EnumCampoTributo.ClassificacaoTributaria,
|
|
4255
|
-
rules: [this.taxClassificationRequiredValidationRule]
|
|
4256
|
-
},
|
|
4257
|
-
{
|
|
4258
|
-
field: exports.EnumCampoTributo.SituacaoTributaria,
|
|
4259
|
-
rules: [this.taxSituationRequiredValidationRule]
|
|
4260
4877
|
}
|
|
4261
4878
|
],
|
|
4262
4879
|
_c[exports.EnumTipoTributo.IBS_MUNICIPAL] = [
|
|
@@ -4279,6 +4896,10 @@
|
|
|
4279
4896
|
{
|
|
4280
4897
|
field: exports.EnumCampoTributo.SituacaoTributaria,
|
|
4281
4898
|
rules: [this.taxSituationRequiredValidationRule]
|
|
4899
|
+
},
|
|
4900
|
+
{
|
|
4901
|
+
field: exports.EnumCampoTributo.AplicarValorLiquidoDocumento,
|
|
4902
|
+
rules: [this.netAmountApplicationRequiredValidationRule]
|
|
4282
4903
|
}
|
|
4283
4904
|
],
|
|
4284
4905
|
_c[exports.EnumTipoTributo.IBS_MUNICIPAL_TRIBUTACAO_REGULAR] = [
|
|
@@ -4299,6 +4920,34 @@
|
|
|
4299
4920
|
rules: [this.taxSituationRequiredValidationRule]
|
|
4300
4921
|
}
|
|
4301
4922
|
],
|
|
4923
|
+
_c[exports.EnumTipoTributo.IBS_MUNICIPAL_GOVERNAMENTAL] = [
|
|
4924
|
+
{
|
|
4925
|
+
field: exports.EnumCampoTributo.BaseCalculo,
|
|
4926
|
+
rules: [this.taxableBaseRequiredValidationRule]
|
|
4927
|
+
},
|
|
4928
|
+
{
|
|
4929
|
+
field: exports.EnumCampoTributo.Aliquota,
|
|
4930
|
+
rules: [this.taxRateRequiredValidationRule]
|
|
4931
|
+
}
|
|
4932
|
+
],
|
|
4933
|
+
_c[exports.EnumTipoTributo.IBS_CREDITO_PRESUMIDO] = [
|
|
4934
|
+
{
|
|
4935
|
+
field: exports.EnumCampoTributo.BaseCalculo,
|
|
4936
|
+
rules: [this.taxableBaseRequiredValidationRule]
|
|
4937
|
+
},
|
|
4938
|
+
{
|
|
4939
|
+
field: exports.EnumCampoTributo.Aliquota,
|
|
4940
|
+
rules: [this.taxRateRequiredValidationRule]
|
|
4941
|
+
},
|
|
4942
|
+
{
|
|
4943
|
+
field: exports.EnumCampoTributo.ClassificacaoTributariaCreditoPresumido,
|
|
4944
|
+
rules: [this.taxClassificationRequiredValidationRule]
|
|
4945
|
+
},
|
|
4946
|
+
{
|
|
4947
|
+
field: exports.EnumCampoTributo.AplicarValorLiquidoDocumento,
|
|
4948
|
+
rules: [this.netAmountApplicationRequiredValidationRule]
|
|
4949
|
+
}
|
|
4950
|
+
],
|
|
4302
4951
|
_c[exports.EnumTipoTributo.IS] = [
|
|
4303
4952
|
{
|
|
4304
4953
|
field: exports.EnumCampoTributo.BaseCalculo,
|
|
@@ -4315,6 +4964,10 @@
|
|
|
4315
4964
|
{
|
|
4316
4965
|
field: exports.EnumCampoTributo.SituacaoTributaria,
|
|
4317
4966
|
rules: [this.taxSituationRequiredValidationRule]
|
|
4967
|
+
},
|
|
4968
|
+
{
|
|
4969
|
+
field: exports.EnumCampoTributo.AplicarValorLiquidoDocumento,
|
|
4970
|
+
rules: [this.netAmountApplicationRequiredValidationRule]
|
|
4318
4971
|
}
|
|
4319
4972
|
],
|
|
4320
4973
|
_c),
|
|
@@ -4353,6 +5006,16 @@
|
|
|
4353
5006
|
rules: [this.taxRateRequiredValidationRule]
|
|
4354
5007
|
}
|
|
4355
5008
|
],
|
|
5009
|
+
_d[exports.EnumTipoTributo.CBS_GOVERNAMENTAL] = [
|
|
5010
|
+
{
|
|
5011
|
+
field: exports.EnumCampoTributo.BaseCalculo,
|
|
5012
|
+
rules: [this.taxableBaseRequiredValidationRule]
|
|
5013
|
+
},
|
|
5014
|
+
{
|
|
5015
|
+
field: exports.EnumCampoTributo.Aliquota,
|
|
5016
|
+
rules: [this.taxRateRequiredValidationRule]
|
|
5017
|
+
}
|
|
5018
|
+
],
|
|
4356
5019
|
_d[exports.EnumTipoTributo.IBS_ESTADUAL] = [
|
|
4357
5020
|
{
|
|
4358
5021
|
field: exports.EnumCampoTributo.BaseCalculo,
|
|
@@ -4367,7 +5030,7 @@
|
|
|
4367
5030
|
rules: [this.taxAmountRequiredValidationRule]
|
|
4368
5031
|
}
|
|
4369
5032
|
],
|
|
4370
|
-
_d[exports.EnumTipoTributo.
|
|
5033
|
+
_d[exports.EnumTipoTributo.IBS_ESTADUAL_TRIBUTACAO_REGULAR] = [
|
|
4371
5034
|
{
|
|
4372
5035
|
field: exports.EnumCampoTributo.BaseCalculo,
|
|
4373
5036
|
rules: [this.taxableBaseRequiredValidationRule]
|
|
@@ -4377,7 +5040,7 @@
|
|
|
4377
5040
|
rules: [this.taxRateRequiredValidationRule]
|
|
4378
5041
|
}
|
|
4379
5042
|
],
|
|
4380
|
-
_d[exports.EnumTipoTributo.
|
|
5043
|
+
_d[exports.EnumTipoTributo.IBS_ESTADUAL_GOVERNAMENTAL] = [
|
|
4381
5044
|
{
|
|
4382
5045
|
field: exports.EnumCampoTributo.BaseCalculo,
|
|
4383
5046
|
rules: [this.taxableBaseRequiredValidationRule]
|
|
@@ -4411,6 +5074,26 @@
|
|
|
4411
5074
|
rules: [this.taxRateRequiredValidationRule]
|
|
4412
5075
|
}
|
|
4413
5076
|
],
|
|
5077
|
+
_d[exports.EnumTipoTributo.IBS_MUNICIPAL_GOVERNAMENTAL] = [
|
|
5078
|
+
{
|
|
5079
|
+
field: exports.EnumCampoTributo.BaseCalculo,
|
|
5080
|
+
rules: [this.taxableBaseRequiredValidationRule]
|
|
5081
|
+
},
|
|
5082
|
+
{
|
|
5083
|
+
field: exports.EnumCampoTributo.Aliquota,
|
|
5084
|
+
rules: [this.taxRateRequiredValidationRule]
|
|
5085
|
+
}
|
|
5086
|
+
],
|
|
5087
|
+
_d[exports.EnumTipoTributo.IBS_CREDITO_PRESUMIDO] = [
|
|
5088
|
+
{
|
|
5089
|
+
field: exports.EnumCampoTributo.BaseCalculo,
|
|
5090
|
+
rules: [this.taxableBaseRequiredValidationRule]
|
|
5091
|
+
},
|
|
5092
|
+
{
|
|
5093
|
+
field: exports.EnumCampoTributo.Aliquota,
|
|
5094
|
+
rules: [this.taxRateRequiredValidationRule]
|
|
5095
|
+
}
|
|
5096
|
+
],
|
|
4414
5097
|
_d[exports.EnumTipoTributo.IS] = [
|
|
4415
5098
|
{
|
|
4416
5099
|
field: exports.EnumCampoTributo.BaseCalculo,
|
|
@@ -4457,6 +5140,16 @@
|
|
|
4457
5140
|
rules: [this.taxRateRequiredValidationRule]
|
|
4458
5141
|
}
|
|
4459
5142
|
],
|
|
5143
|
+
_e[exports.EnumTipoTributo.CBS_GOVERNAMENTAL] = [
|
|
5144
|
+
{
|
|
5145
|
+
field: exports.EnumCampoTributo.BaseCalculo,
|
|
5146
|
+
rules: [this.taxableBaseRequiredValidationRule]
|
|
5147
|
+
},
|
|
5148
|
+
{
|
|
5149
|
+
field: exports.EnumCampoTributo.Aliquota,
|
|
5150
|
+
rules: [this.taxRateRequiredValidationRule]
|
|
5151
|
+
}
|
|
5152
|
+
],
|
|
4460
5153
|
_e[exports.EnumTipoTributo.IBS_ESTADUAL] = [
|
|
4461
5154
|
{
|
|
4462
5155
|
field: exports.EnumCampoTributo.BaseCalculo,
|
|
@@ -4471,7 +5164,7 @@
|
|
|
4471
5164
|
rules: [this.taxAmountRequiredValidationRule]
|
|
4472
5165
|
}
|
|
4473
5166
|
],
|
|
4474
|
-
_e[exports.EnumTipoTributo.
|
|
5167
|
+
_e[exports.EnumTipoTributo.IBS_ESTADUAL_TRIBUTACAO_REGULAR] = [
|
|
4475
5168
|
{
|
|
4476
5169
|
field: exports.EnumCampoTributo.BaseCalculo,
|
|
4477
5170
|
rules: [this.taxableBaseRequiredValidationRule]
|
|
@@ -4481,7 +5174,7 @@
|
|
|
4481
5174
|
rules: [this.taxRateRequiredValidationRule]
|
|
4482
5175
|
}
|
|
4483
5176
|
],
|
|
4484
|
-
_e[exports.EnumTipoTributo.
|
|
5177
|
+
_e[exports.EnumTipoTributo.IBS_ESTADUAL_GOVERNAMENTAL] = [
|
|
4485
5178
|
{
|
|
4486
5179
|
field: exports.EnumCampoTributo.BaseCalculo,
|
|
4487
5180
|
rules: [this.taxableBaseRequiredValidationRule]
|
|
@@ -4515,6 +5208,26 @@
|
|
|
4515
5208
|
rules: [this.taxRateRequiredValidationRule]
|
|
4516
5209
|
}
|
|
4517
5210
|
],
|
|
5211
|
+
_e[exports.EnumTipoTributo.IBS_MUNICIPAL_GOVERNAMENTAL] = [
|
|
5212
|
+
{
|
|
5213
|
+
field: exports.EnumCampoTributo.BaseCalculo,
|
|
5214
|
+
rules: [this.taxableBaseRequiredValidationRule]
|
|
5215
|
+
},
|
|
5216
|
+
{
|
|
5217
|
+
field: exports.EnumCampoTributo.Aliquota,
|
|
5218
|
+
rules: [this.taxRateRequiredValidationRule]
|
|
5219
|
+
}
|
|
5220
|
+
],
|
|
5221
|
+
_e[exports.EnumTipoTributo.IBS_CREDITO_PRESUMIDO] = [
|
|
5222
|
+
{
|
|
5223
|
+
field: exports.EnumCampoTributo.BaseCalculo,
|
|
5224
|
+
rules: [this.taxableBaseRequiredValidationRule]
|
|
5225
|
+
},
|
|
5226
|
+
{
|
|
5227
|
+
field: exports.EnumCampoTributo.Aliquota,
|
|
5228
|
+
rules: [this.taxRateRequiredValidationRule]
|
|
5229
|
+
}
|
|
5230
|
+
],
|
|
4518
5231
|
_e[exports.EnumTipoTributo.IS] = [
|
|
4519
5232
|
{
|
|
4520
5233
|
field: exports.EnumCampoTributo.BaseCalculo,
|
|
@@ -4537,9 +5250,10 @@
|
|
|
4537
5250
|
{ type: TaxRateRequiredValidationRule },
|
|
4538
5251
|
{ type: TaxClassificationRequiredValidationRule },
|
|
4539
5252
|
{ type: TaxAmountRequiredValidationRule },
|
|
4540
|
-
{ type: TaxSituationRequiredValidationRule }
|
|
5253
|
+
{ type: TaxSituationRequiredValidationRule },
|
|
5254
|
+
{ type: NetAmountApplicationRequiredValidationRule }
|
|
4541
5255
|
]; };
|
|
4542
|
-
ValidationRulesRegistry.ɵprov = core.ɵɵdefineInjectable({ factory: function ValidationRulesRegistry_Factory() { return new ValidationRulesRegistry(core.ɵɵinject(TaxableBaseRequiredValidationRule), core.ɵɵinject(TaxRateRequiredValidationRule), core.ɵɵinject(TaxClassificationRequiredValidationRule), core.ɵɵinject(TaxAmountRequiredValidationRule), core.ɵɵinject(TaxSituationRequiredValidationRule)); }, token: ValidationRulesRegistry, providedIn: "root" });
|
|
5256
|
+
ValidationRulesRegistry.ɵprov = core.ɵɵdefineInjectable({ factory: function ValidationRulesRegistry_Factory() { return new ValidationRulesRegistry(core.ɵɵinject(TaxableBaseRequiredValidationRule), core.ɵɵinject(TaxRateRequiredValidationRule), core.ɵɵinject(TaxClassificationRequiredValidationRule), core.ɵɵinject(TaxAmountRequiredValidationRule), core.ɵɵinject(TaxSituationRequiredValidationRule), core.ɵɵinject(NetAmountApplicationRequiredValidationRule)); }, token: ValidationRulesRegistry, providedIn: "root" });
|
|
4543
5257
|
ValidationRulesRegistry = __decorate([
|
|
4544
5258
|
core.Injectable({ providedIn: 'root' })
|
|
4545
5259
|
], ValidationRulesRegistry);
|
|
@@ -4553,16 +5267,16 @@
|
|
|
4553
5267
|
this.calculationRulesRegistry = calculationRulesRegistry;
|
|
4554
5268
|
}
|
|
4555
5269
|
RulesService.prototype.apply = function (_a) {
|
|
4556
|
-
var group = _a.group, documentType = _a.documentType;
|
|
5270
|
+
var groups = _a.groups, group = _a.group, documentType = _a.documentType;
|
|
4557
5271
|
if (!isTaxFromTaxReform(getBaseTaxByGroupTax(group.grupoTributo)))
|
|
4558
5272
|
return;
|
|
4559
|
-
this.applyStatusRules({ group: group, documentType: documentType });
|
|
4560
|
-
this.applyValidationRules({ group: group, documentType: documentType });
|
|
4561
|
-
this.applyCalculationRules({ group: group, documentType: documentType });
|
|
5273
|
+
this.applyStatusRules({ groups: groups, group: group, documentType: documentType });
|
|
5274
|
+
this.applyValidationRules({ groups: groups, group: group, documentType: documentType });
|
|
5275
|
+
this.applyCalculationRules({ groups: groups, group: group, documentType: documentType });
|
|
4562
5276
|
};
|
|
4563
5277
|
RulesService.prototype.applyCalculationRules = function (_a) {
|
|
4564
5278
|
var e_1, _b, e_2, _c;
|
|
4565
|
-
var group = _a.group, documentType = _a.documentType;
|
|
5279
|
+
var groups = _a.groups, group = _a.group, documentType = _a.documentType;
|
|
4566
5280
|
try {
|
|
4567
5281
|
for (var _d = __values(group.item), _e = _d.next(); !_e.done; _e = _d.next()) {
|
|
4568
5282
|
var item = _e.value;
|
|
@@ -4570,7 +5284,7 @@
|
|
|
4570
5284
|
try {
|
|
4571
5285
|
for (var strategy_1 = (e_2 = void 0, __values(strategy)), strategy_1_1 = strategy_1.next(); !strategy_1_1.done; strategy_1_1 = strategy_1.next()) {
|
|
4572
5286
|
var rule = strategy_1_1.value.rule;
|
|
4573
|
-
rule.apply({ group: group, item: item, documentType: documentType });
|
|
5287
|
+
rule.apply({ groups: groups, group: group, item: item, documentType: documentType });
|
|
4574
5288
|
}
|
|
4575
5289
|
}
|
|
4576
5290
|
catch (e_2_1) { e_2 = { error: e_2_1 }; }
|
|
@@ -4592,7 +5306,7 @@
|
|
|
4592
5306
|
};
|
|
4593
5307
|
RulesService.prototype.applyValidationRules = function (_a) {
|
|
4594
5308
|
var e_3, _b, e_4, _c, e_5, _d;
|
|
4595
|
-
var group = _a.group, documentType = _a.documentType;
|
|
5309
|
+
var groups = _a.groups, group = _a.group, documentType = _a.documentType;
|
|
4596
5310
|
try {
|
|
4597
5311
|
for (var _e = __values(group.item), _f = _e.next(); !_f.done; _f = _e.next()) {
|
|
4598
5312
|
var item = _f.value;
|
|
@@ -4603,7 +5317,7 @@
|
|
|
4603
5317
|
try {
|
|
4604
5318
|
for (var rules_1 = (e_5 = void 0, __values(rules)), rules_1_1 = rules_1.next(); !rules_1_1.done; rules_1_1 = rules_1.next()) {
|
|
4605
5319
|
var rule = rules_1_1.value;
|
|
4606
|
-
rule.apply({ group: group, item: item, documentType: documentType });
|
|
5320
|
+
rule.apply({ groups: groups, group: group, item: item, documentType: documentType });
|
|
4607
5321
|
}
|
|
4608
5322
|
}
|
|
4609
5323
|
catch (e_5_1) { e_5 = { error: e_5_1 }; }
|
|
@@ -4634,7 +5348,7 @@
|
|
|
4634
5348
|
};
|
|
4635
5349
|
RulesService.prototype.applyStatusRules = function (_a) {
|
|
4636
5350
|
var e_6, _b, e_7, _c;
|
|
4637
|
-
var group = _a.group, documentType = _a.documentType;
|
|
5351
|
+
var groups = _a.groups, group = _a.group, documentType = _a.documentType;
|
|
4638
5352
|
try {
|
|
4639
5353
|
for (var _d = __values(group.item), _e = _d.next(); !_e.done; _e = _d.next()) {
|
|
4640
5354
|
var item = _e.value;
|
|
@@ -4642,7 +5356,7 @@
|
|
|
4642
5356
|
try {
|
|
4643
5357
|
for (var strategy_3 = (e_7 = void 0, __values(strategy)), strategy_3_1 = strategy_3.next(); !strategy_3_1.done; strategy_3_1 = strategy_3.next()) {
|
|
4644
5358
|
var rule = strategy_3_1.value.rule;
|
|
4645
|
-
rule.apply({ group: group, item: item, documentType: documentType });
|
|
5359
|
+
rule.apply({ groups: groups, group: group, item: item, documentType: documentType });
|
|
4646
5360
|
}
|
|
4647
5361
|
}
|
|
4648
5362
|
catch (e_7_1) { e_7 = { error: e_7_1 }; }
|
|
@@ -4712,6 +5426,7 @@
|
|
|
4712
5426
|
this.menuItemCBS = false;
|
|
4713
5427
|
this.menuItemIBSEstadual = false;
|
|
4714
5428
|
this.menuItemIBSMunicipal = false;
|
|
5429
|
+
this.menuItemIBSCreditoPresumido = false;
|
|
4715
5430
|
this.menuItemIS = false;
|
|
4716
5431
|
this.menuItemIcmsCreditoPresumido = false;
|
|
4717
5432
|
this.requiredItemCideTecnologia = false;
|
|
@@ -4972,8 +5687,8 @@
|
|
|
4972
5687
|
return 'cbs';
|
|
4973
5688
|
case exports.EnumTipoTributo.IBS_ESTADUAL:
|
|
4974
5689
|
case exports.EnumTipoTributo.IBS_ESTADUAL_DIFERIDO:
|
|
4975
|
-
case exports.EnumTipoTributo.IBS_ESTADUAL_CREDITO_PRESUMIDO:
|
|
4976
5690
|
case exports.EnumTipoTributo.IBS_ESTADUAL_TRIBUTACAO_REGULAR:
|
|
5691
|
+
case exports.EnumTipoTributo.IBS_CREDITO_PRESUMIDO:
|
|
4977
5692
|
return 'ibs-estadual';
|
|
4978
5693
|
case exports.EnumTipoTributo.IBS_MUNICIPAL:
|
|
4979
5694
|
case exports.EnumTipoTributo.IBS_MUNICIPAL_DIFERIDO:
|
|
@@ -5058,7 +5773,6 @@
|
|
|
5058
5773
|
break;
|
|
5059
5774
|
case exports.EnumTipoTributo.IBS_ESTADUAL:
|
|
5060
5775
|
case exports.EnumTipoTributo.IBS_ESTADUAL_DIFERIDO:
|
|
5061
|
-
case exports.EnumTipoTributo.IBS_ESTADUAL_CREDITO_PRESUMIDO:
|
|
5062
5776
|
case exports.EnumTipoTributo.IBS_ESTADUAL_TRIBUTACAO_REGULAR:
|
|
5063
5777
|
_this.montaIBSEstadual();
|
|
5064
5778
|
break;
|
|
@@ -5067,6 +5781,9 @@
|
|
|
5067
5781
|
case exports.EnumTipoTributo.IBS_MUNICIPAL_TRIBUTACAO_REGULAR:
|
|
5068
5782
|
_this.montaIBSMunicipal();
|
|
5069
5783
|
break;
|
|
5784
|
+
case exports.EnumTipoTributo.IBS_CREDITO_PRESUMIDO:
|
|
5785
|
+
_this.montaIBSCreditoPresumido();
|
|
5786
|
+
break;
|
|
5070
5787
|
case exports.EnumTipoTributo.IS:
|
|
5071
5788
|
_this.montaIS();
|
|
5072
5789
|
break;
|
|
@@ -5186,7 +5903,7 @@
|
|
|
5186
5903
|
}
|
|
5187
5904
|
finally { if (e_2) throw e_2.error; }
|
|
5188
5905
|
}
|
|
5189
|
-
this.rulesService.apply({ group: group, documentType: this.documento });
|
|
5906
|
+
this.rulesService.apply({ groups: this.grupos, group: group, documentType: this.documento });
|
|
5190
5907
|
}
|
|
5191
5908
|
}
|
|
5192
5909
|
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
@@ -5453,6 +6170,7 @@
|
|
|
5453
6170
|
}),
|
|
5454
6171
|
(_this.indexAccordion = [0]));
|
|
5455
6172
|
_this.rulesService.apply({
|
|
6173
|
+
groups: _this.grupos,
|
|
5456
6174
|
group: _this.grupos.find(function (group) { return group.grupoTributo === exports.EnumGrupoTributo.CBS; }),
|
|
5457
6175
|
documentType: _this.documento
|
|
5458
6176
|
});
|
|
@@ -5468,6 +6186,7 @@
|
|
|
5468
6186
|
}),
|
|
5469
6187
|
(_this.indexAccordion = [0]));
|
|
5470
6188
|
_this.rulesService.apply({
|
|
6189
|
+
groups: _this.grupos,
|
|
5471
6190
|
group: _this.grupos.find(function (group) { return group.grupoTributo === exports.EnumGrupoTributo.IBS_ESTADUAL; }),
|
|
5472
6191
|
documentType: _this.documento
|
|
5473
6192
|
});
|
|
@@ -5483,11 +6202,28 @@
|
|
|
5483
6202
|
}),
|
|
5484
6203
|
(_this.indexAccordion = [0]));
|
|
5485
6204
|
_this.rulesService.apply({
|
|
6205
|
+
groups: _this.grupos,
|
|
5486
6206
|
group: _this.grupos.find(function (group) { return group.grupoTributo === exports.EnumGrupoTributo.IBS_MUNICIPAL; }),
|
|
5487
6207
|
documentType: _this.documento
|
|
5488
6208
|
});
|
|
5489
6209
|
_this.changeDetector.detectChanges();
|
|
5490
6210
|
}
|
|
6211
|
+
}, {
|
|
6212
|
+
label: this.translate.instant('erpx.tributos.actions_ibs_credito_presumido_label'),
|
|
6213
|
+
disabled: this.menuItemIBSCreditoPresumido,
|
|
6214
|
+
visible: this.podeAdicionarImpostoManual(),
|
|
6215
|
+
command: function () {
|
|
6216
|
+
(_this.montaIBSCreditoPresumido().forEach(function (value) {
|
|
6217
|
+
_this.novoImpostoManual(value);
|
|
6218
|
+
}),
|
|
6219
|
+
(_this.indexAccordion = [0]));
|
|
6220
|
+
_this.rulesService.apply({
|
|
6221
|
+
groups: _this.grupos,
|
|
6222
|
+
group: _this.grupos.find(function (group) { return group.grupoTributo === exports.EnumGrupoTributo.IBS_CREDITO_PRESUMIDO; }),
|
|
6223
|
+
documentType: _this.documento
|
|
6224
|
+
});
|
|
6225
|
+
_this.changeDetector.detectChanges();
|
|
6226
|
+
}
|
|
5491
6227
|
}, {
|
|
5492
6228
|
label: this.translate.instant('erpx.tributos.actions_is_label'),
|
|
5493
6229
|
disabled: this.menuItemIS,
|
|
@@ -5498,6 +6234,7 @@
|
|
|
5498
6234
|
}),
|
|
5499
6235
|
(_this.indexAccordion = [0]));
|
|
5500
6236
|
_this.rulesService.apply({
|
|
6237
|
+
groups: _this.grupos,
|
|
5501
6238
|
group: _this.grupos.find(function (group) { return group.grupoTributo === exports.EnumGrupoTributo.IS; }),
|
|
5502
6239
|
documentType: _this.documento
|
|
5503
6240
|
});
|
|
@@ -6612,27 +7349,27 @@
|
|
|
6612
7349
|
campos.push({ campo: exports.EnumCampoTributo.SituacaoTributaria }, {
|
|
6613
7350
|
campo: exports.EnumCampoTributo.ClassificacaoTributaria
|
|
6614
7351
|
}, {
|
|
6615
|
-
campo: exports.EnumCampoTributo.
|
|
7352
|
+
campo: exports.EnumCampoTributo.AplicarValorLiquidoDocumento,
|
|
6616
7353
|
grupo: exports.EnumGrupoTributo.CBS
|
|
6617
7354
|
});
|
|
6618
7355
|
}
|
|
6619
|
-
var
|
|
7356
|
+
var campos_CBS_CREDITO_PRESUMIDO = [
|
|
6620
7357
|
{ campo: exports.EnumCampoTributo.BaseCalculo },
|
|
6621
7358
|
{ campo: exports.EnumCampoTributo.Aliquota },
|
|
6622
7359
|
{ campo: exports.EnumCampoTributo.Valor, disabled: true }
|
|
6623
7360
|
];
|
|
6624
7361
|
if (this.documento === exports.EnumTipoDocumento.NF_ENTRADA || this.documento === exports.EnumTipoDocumento.NF_SAIDA) {
|
|
6625
|
-
|
|
7362
|
+
campos_CBS_CREDITO_PRESUMIDO.push({
|
|
6626
7363
|
campo: exports.EnumCampoTributo.ClassificacaoTributariaCreditoPresumido
|
|
6627
7364
|
});
|
|
6628
7365
|
}
|
|
6629
|
-
var
|
|
7366
|
+
var campos_CBS_TRIBUTACAO_REGULAR = [
|
|
6630
7367
|
{ campo: exports.EnumCampoTributo.BaseCalculo },
|
|
6631
7368
|
{ campo: exports.EnumCampoTributo.Aliquota },
|
|
6632
7369
|
{ campo: exports.EnumCampoTributo.Valor, disabled: true }
|
|
6633
7370
|
];
|
|
6634
7371
|
if (this.documento === exports.EnumTipoDocumento.NF_ENTRADA || this.documento === exports.EnumTipoDocumento.NF_SAIDA) {
|
|
6635
|
-
|
|
7372
|
+
campos_CBS_TRIBUTACAO_REGULAR.push({ campo: exports.EnumCampoTributo.SituacaoTributaria }, {
|
|
6636
7373
|
campo: exports.EnumCampoTributo.ClassificacaoTributaria
|
|
6637
7374
|
});
|
|
6638
7375
|
}
|
|
@@ -6640,9 +7377,9 @@
|
|
|
6640
7377
|
{ campo: exports.EnumCampoTributo.BaseCalculo },
|
|
6641
7378
|
{ campo: exports.EnumCampoTributo.Aliquota },
|
|
6642
7379
|
{ campo: exports.EnumCampoTributo.Valor, disabled: true }
|
|
6643
|
-
], exports.EnumTipoTributo.CBS_DIFERIDO)), __assign({ name: exports.EnumTipoTributo.CBS_CREDITO_PRESUMIDO, label: 'erpx.tributos.enum_tipo_tributo_cbs_credito_presumido' }, this.montaCampos(
|
|
6644
|
-
{ campo: exports.EnumCampoTributo.BaseCalculo
|
|
6645
|
-
{ campo: exports.EnumCampoTributo.Aliquota
|
|
7380
|
+
], exports.EnumTipoTributo.CBS_DIFERIDO)), __assign({ name: exports.EnumTipoTributo.CBS_CREDITO_PRESUMIDO, label: 'erpx.tributos.enum_tipo_tributo_cbs_credito_presumido' }, this.montaCampos(campos_CBS_CREDITO_PRESUMIDO, exports.EnumTipoTributo.CBS_CREDITO_PRESUMIDO)), __assign({ name: exports.EnumTipoTributo.CBS_TRIBUTACAO_REGULAR, label: 'erpx.tributos.enum_tipo_tributo_cbs_tributacao_regular' }, this.montaCampos(campos_CBS_TRIBUTACAO_REGULAR, exports.EnumTipoTributo.CBS_TRIBUTACAO_REGULAR)), __assign({ name: exports.EnumTipoTributo.CBS_GOVERNAMENTAL, label: 'erpx.tributos.enum_tipo_tributo_cbs_governamental' }, this.montaCampos([
|
|
7381
|
+
{ campo: exports.EnumCampoTributo.BaseCalculo },
|
|
7382
|
+
{ campo: exports.EnumCampoTributo.Aliquota },
|
|
6646
7383
|
{ campo: exports.EnumCampoTributo.Valor, disabled: true }
|
|
6647
7384
|
], exports.EnumTipoTributo.CBS_GOVERNAMENTAL)));
|
|
6648
7385
|
this.grupos.unshift({
|
|
@@ -6704,27 +7441,14 @@
|
|
|
6704
7441
|
campo: exports.EnumCampoTributo.ClassificacaoTributaria
|
|
6705
7442
|
},
|
|
6706
7443
|
{
|
|
6707
|
-
campo: exports.EnumCampoTributo.
|
|
7444
|
+
campo: exports.EnumCampoTributo.AplicarValorLiquidoDocumento,
|
|
6708
7445
|
grupo: exports.EnumGrupoTributo.IBS_ESTADUAL
|
|
6709
7446
|
}
|
|
6710
7447
|
], exports.EnumTipoTributo.IBS_ESTADUAL)), __assign({ name: exports.EnumTipoTributo.IBS_ESTADUAL_DIFERIDO, label: 'erpx.tributos.enum_tipo_tributo_ibs_estadual_diferido' }, this.montaCampos([
|
|
6711
7448
|
{ campo: exports.EnumCampoTributo.BaseCalculo },
|
|
6712
7449
|
{ campo: exports.EnumCampoTributo.Aliquota },
|
|
6713
7450
|
{ campo: exports.EnumCampoTributo.Valor, disabled: true }
|
|
6714
|
-
], exports.EnumTipoTributo.IBS_ESTADUAL_DIFERIDO)), __assign({ name: exports.EnumTipoTributo.
|
|
6715
|
-
? [
|
|
6716
|
-
{ campo: exports.EnumCampoTributo.BaseCalculo },
|
|
6717
|
-
{ campo: exports.EnumCampoTributo.Aliquota },
|
|
6718
|
-
{ campo: exports.EnumCampoTributo.Valor, disabled: true }
|
|
6719
|
-
]
|
|
6720
|
-
: [
|
|
6721
|
-
{ campo: exports.EnumCampoTributo.BaseCalculo },
|
|
6722
|
-
{ campo: exports.EnumCampoTributo.Aliquota },
|
|
6723
|
-
{ campo: exports.EnumCampoTributo.Valor, disabled: true },
|
|
6724
|
-
{
|
|
6725
|
-
campo: exports.EnumCampoTributo.ClassificacaoTributariaCreditoPresumido
|
|
6726
|
-
}
|
|
6727
|
-
], exports.EnumTipoTributo.IBS_ESTADUAL_CREDITO_PRESUMIDO)), __assign({ name: exports.EnumTipoTributo.IBS_ESTADUAL_TRIBUTACAO_REGULAR, label: 'erpx.tributos.enum_tipo_tributo_ibs_estadual_tributacao_regular' }, this.montaCampos(this.documento === exports.EnumTipoDocumento.PEDIDO_VENDA || this.documento === exports.EnumTipoDocumento.PEDIDO_COMPRA
|
|
7451
|
+
], exports.EnumTipoTributo.IBS_ESTADUAL_DIFERIDO)), __assign({ name: exports.EnumTipoTributo.IBS_ESTADUAL_TRIBUTACAO_REGULAR, label: 'erpx.tributos.enum_tipo_tributo_ibs_estadual_tributacao_regular' }, this.montaCampos(this.documento === exports.EnumTipoDocumento.PEDIDO_VENDA || this.documento === exports.EnumTipoDocumento.PEDIDO_COMPRA
|
|
6728
7452
|
? [
|
|
6729
7453
|
{ campo: exports.EnumCampoTributo.BaseCalculo },
|
|
6730
7454
|
{ campo: exports.EnumCampoTributo.Aliquota },
|
|
@@ -6739,8 +7463,8 @@
|
|
|
6739
7463
|
campo: exports.EnumCampoTributo.ClassificacaoTributaria
|
|
6740
7464
|
}
|
|
6741
7465
|
], exports.EnumTipoTributo.IBS_ESTADUAL_TRIBUTACAO_REGULAR)), __assign({ name: exports.EnumTipoTributo.IBS_ESTADUAL_GOVERNAMENTAL, label: 'erpx.tributos.enum_tipo_tributo_ibs_estadual_governamental' }, this.montaCampos([
|
|
6742
|
-
{ campo: exports.EnumCampoTributo.BaseCalculo
|
|
6743
|
-
{ campo: exports.EnumCampoTributo.Aliquota
|
|
7466
|
+
{ campo: exports.EnumCampoTributo.BaseCalculo },
|
|
7467
|
+
{ campo: exports.EnumCampoTributo.Aliquota },
|
|
6744
7468
|
{ campo: exports.EnumCampoTributo.Valor, disabled: true }
|
|
6745
7469
|
], exports.EnumTipoTributo.IBS_ESTADUAL_GOVERNAMENTAL)));
|
|
6746
7470
|
this.grupos.unshift({
|
|
@@ -6802,7 +7526,7 @@
|
|
|
6802
7526
|
campo: exports.EnumCampoTributo.ClassificacaoTributaria
|
|
6803
7527
|
},
|
|
6804
7528
|
{
|
|
6805
|
-
campo: exports.EnumCampoTributo.
|
|
7529
|
+
campo: exports.EnumCampoTributo.AplicarValorLiquidoDocumento,
|
|
6806
7530
|
grupo: exports.EnumGrupoTributo.IBS_MUNICIPAL
|
|
6807
7531
|
}
|
|
6808
7532
|
], exports.EnumTipoTributo.IBS_MUNICIPAL)), __assign({ name: exports.EnumTipoTributo.IBS_MUNICIPAL_DIFERIDO, label: 'erpx.tributos.enum_tipo_tributo_ibs_municipal_diferido' }, this.montaCampos([
|
|
@@ -6824,8 +7548,8 @@
|
|
|
6824
7548
|
campo: exports.EnumCampoTributo.ClassificacaoTributaria
|
|
6825
7549
|
}
|
|
6826
7550
|
], exports.EnumTipoTributo.IBS_MUNICIPAL_TRIBUTACAO_REGULAR)), __assign({ name: exports.EnumTipoTributo.IBS_MUNICIPAL_GOVERNAMENTAL, label: 'erpx.tributos.enum_tipo_tributo_ibs_municipal_governamental' }, this.montaCampos([
|
|
6827
|
-
{ campo: exports.EnumCampoTributo.BaseCalculo
|
|
6828
|
-
{ campo: exports.EnumCampoTributo.Aliquota
|
|
7551
|
+
{ campo: exports.EnumCampoTributo.BaseCalculo },
|
|
7552
|
+
{ campo: exports.EnumCampoTributo.Aliquota },
|
|
6829
7553
|
{ campo: exports.EnumCampoTributo.Valor, disabled: true }
|
|
6830
7554
|
], exports.EnumTipoTributo.IBS_MUNICIPAL_GOVERNAMENTAL)));
|
|
6831
7555
|
this.grupos.unshift({
|
|
@@ -6835,6 +7559,31 @@
|
|
|
6835
7559
|
});
|
|
6836
7560
|
return item;
|
|
6837
7561
|
};
|
|
7562
|
+
ErpTributosComponent.prototype.montaIBSCreditoPresumido = function () {
|
|
7563
|
+
if (this.menuItemIBSCreditoPresumido)
|
|
7564
|
+
return;
|
|
7565
|
+
this.menuItemIBSCreditoPresumido = true;
|
|
7566
|
+
var item = [];
|
|
7567
|
+
var campos = [
|
|
7568
|
+
{ campo: exports.EnumCampoTributo.BaseCalculo },
|
|
7569
|
+
{ campo: exports.EnumCampoTributo.Aliquota },
|
|
7570
|
+
{ campo: exports.EnumCampoTributo.Valor, disabled: true }
|
|
7571
|
+
];
|
|
7572
|
+
if (this.documento === exports.EnumTipoDocumento.NF_ENTRADA || this.documento === exports.EnumTipoDocumento.NF_SAIDA) {
|
|
7573
|
+
campos.push({
|
|
7574
|
+
campo: exports.EnumCampoTributo.ClassificacaoTributariaCreditoPresumido
|
|
7575
|
+
}, {
|
|
7576
|
+
campo: exports.EnumCampoTributo.AplicarValorLiquidoDocumento
|
|
7577
|
+
});
|
|
7578
|
+
}
|
|
7579
|
+
item.unshift(__assign({ name: exports.EnumTipoTributo.IBS_CREDITO_PRESUMIDO, label: 'erpx.tributos.enum_tipo_tributo_ibs_credito_presumido' }, this.montaCampos(campos, exports.EnumTipoTributo.IBS_CREDITO_PRESUMIDO)));
|
|
7580
|
+
this.grupos.unshift({
|
|
7581
|
+
grupo: "" + ('erpx.tributos.enum_grupo_tributo_' + exports.EnumGrupoTributo.IBS_CREDITO_PRESUMIDO + '_label'),
|
|
7582
|
+
grupoTributo: exports.EnumGrupoTributo.IBS_CREDITO_PRESUMIDO,
|
|
7583
|
+
item: item
|
|
7584
|
+
});
|
|
7585
|
+
return item;
|
|
7586
|
+
};
|
|
6838
7587
|
ErpTributosComponent.prototype.montaIS = function () {
|
|
6839
7588
|
if (this.menuItemIS)
|
|
6840
7589
|
return;
|
|
@@ -6846,7 +7595,7 @@
|
|
|
6846
7595
|
{ campo: exports.EnumCampoTributo.Valor, disabled: true }
|
|
6847
7596
|
];
|
|
6848
7597
|
if (this.documento === exports.EnumTipoDocumento.NF_ENTRADA || this.documento === exports.EnumTipoDocumento.NF_SAIDA) {
|
|
6849
|
-
campos.push({ campo: exports.EnumCampoTributo.SituacaoTributaria }, { campo: exports.EnumCampoTributo.ClassificacaoTributaria }, { campo: exports.EnumCampoTributo.
|
|
7598
|
+
campos.push({ campo: exports.EnumCampoTributo.SituacaoTributaria }, { campo: exports.EnumCampoTributo.ClassificacaoTributaria }, { campo: exports.EnumCampoTributo.AplicarValorLiquidoDocumento, grupo: exports.EnumGrupoTributo.IS });
|
|
6850
7599
|
}
|
|
6851
7600
|
item.unshift(__assign({ name: exports.EnumTipoTributo.IS, label: 'erpx.tributos.enum_tipo_tributo_is' }, this.montaCampos(campos, exports.EnumTipoTributo.IS)));
|
|
6852
7601
|
this.grupos.unshift({
|
|
@@ -7589,12 +8338,13 @@
|
|
|
7589
8338
|
var formField = [];
|
|
7590
8339
|
var formGroup = {};
|
|
7591
8340
|
campos.map(function (it) {
|
|
7592
|
-
var _a
|
|
8341
|
+
var _a;
|
|
8342
|
+
var _b, _c;
|
|
7593
8343
|
if (it.campo == exports.EnumCampoTributo.BaseCalculo) {
|
|
7594
8344
|
formGroup = __assign(__assign({}, formGroup), { baseCalculo: [
|
|
7595
8345
|
{
|
|
7596
8346
|
value: null,
|
|
7597
|
-
disabled: (
|
|
8347
|
+
disabled: (_b = it.disabled) !== null && _b !== void 0 ? _b : false
|
|
7598
8348
|
},
|
|
7599
8349
|
forms.Validators.compose([forms.Validators.max(9999999999999.99)])
|
|
7600
8350
|
] });
|
|
@@ -7628,7 +8378,7 @@
|
|
|
7628
8378
|
formGroup = __assign(__assign({}, formGroup), { aliquota: [
|
|
7629
8379
|
{
|
|
7630
8380
|
value: null,
|
|
7631
|
-
disabled: (
|
|
8381
|
+
disabled: (_c = it.disabled) !== null && _c !== void 0 ? _c : false
|
|
7632
8382
|
},
|
|
7633
8383
|
forms.Validators.compose([forms.Validators.max(999.9999)])
|
|
7634
8384
|
] });
|
|
@@ -8641,25 +9391,27 @@
|
|
|
8641
9391
|
_this.setValidators(tributo);
|
|
8642
9392
|
}, id: tributo + 'ClassificacaoTributaria', name: 'classificacaoTributaria', formGroup: 'classificacaoTributaria', infoSign: _this.translate.instant('erpx_cpl_imp.impostos.classificacao_tributaria_desoneracao_info_sign'), label: _this.translate.instant('erpx_cpl_imp.impostos.classificacao_tributaria_desoneracao'), required: function () { return false; }, multiple: false, size: { sm: 12, md: 4, lg: 4, xl: 3 } })));
|
|
8643
9393
|
}
|
|
8644
|
-
else if (it.campo === exports.EnumCampoTributo.
|
|
8645
|
-
formGroup = __assign(__assign({}, formGroup), {
|
|
9394
|
+
else if (it.campo === exports.EnumCampoTributo.AplicarValorLiquidoDocumento) {
|
|
9395
|
+
formGroup = __assign(__assign({}, formGroup), (_a = {}, _a[exports.EnumCampoTributo.AplicarValorLiquidoDocumento] = [{ value: null, disabled: false }, forms.Validators.compose([])], _a));
|
|
8646
9396
|
formField.push(new angularComponents$1.FormField({
|
|
8647
|
-
name:
|
|
8648
|
-
label: _this.translate.instant('erpx.tributos.
|
|
8649
|
-
type: angularComponents$1.FieldType.
|
|
9397
|
+
name: exports.EnumCampoTributo.AplicarValorLiquidoDocumento,
|
|
9398
|
+
label: _this.translate.instant('erpx.tributos.aplicar_valor_liquido_documento'),
|
|
9399
|
+
type: angularComponents$1.FieldType.Enum,
|
|
9400
|
+
required: function () { return _this.isFieldRequired(exports.EnumCampoTributo.AplicarValorLiquidoDocumento, tributo); },
|
|
9401
|
+
showClear: true,
|
|
8650
9402
|
options: [
|
|
9403
|
+
tributo === exports.EnumTipoTributo.IBS_CREDITO_PRESUMIDO
|
|
9404
|
+
? {
|
|
9405
|
+
label: _this.translate.instant('erpx.tributos.enum_enum_aplicar_valor_liquido_documento_subtrair'),
|
|
9406
|
+
value: exports.EnumAplicarValorLiquidoDocumento.SUBTRAIR
|
|
9407
|
+
}
|
|
9408
|
+
: {
|
|
9409
|
+
label: _this.translate.instant('erpx.tributos.enum_enum_aplicar_valor_liquido_documento_somar'),
|
|
9410
|
+
value: exports.EnumAplicarValorLiquidoDocumento.SOMAR
|
|
9411
|
+
},
|
|
8651
9412
|
{
|
|
8652
|
-
label: _this.translate.instant('erpx.tributos.
|
|
8653
|
-
value:
|
|
8654
|
-
},
|
|
8655
|
-
{
|
|
8656
|
-
label: _this.translate.instant('erpx.tributos.false'),
|
|
8657
|
-
value: false
|
|
8658
|
-
},
|
|
8659
|
-
{
|
|
8660
|
-
label: _this.translate.instant('erpx.tributos.none'),
|
|
8661
|
-
value: null,
|
|
8662
|
-
disabled: true
|
|
9413
|
+
label: _this.translate.instant('erpx.tributos.enum_enum_aplicar_valor_liquido_documento_nenhum'),
|
|
9414
|
+
value: exports.EnumAplicarValorLiquidoDocumento.NENHUM
|
|
8663
9415
|
}
|
|
8664
9416
|
],
|
|
8665
9417
|
size: { sm: 12, md: 4, lg: 4, xl: 3 }
|
|
@@ -8738,18 +9490,6 @@
|
|
|
8738
9490
|
}
|
|
8739
9491
|
_this.updateTwoWayDataBinding();
|
|
8740
9492
|
});
|
|
8741
|
-
this.onSituacaoTributariaValueChanges(item);
|
|
8742
|
-
};
|
|
8743
|
-
ErpTributosComponent.prototype.onSituacaoTributariaValueChanges = function (item) {
|
|
8744
|
-
if (!item.formGroup.get('situacaoTributaria') || !item.formGroup.get('classificacaoTributaria'))
|
|
8745
|
-
return;
|
|
8746
|
-
item.formGroup
|
|
8747
|
-
.get('situacaoTributaria')
|
|
8748
|
-
// We are using debounceTime here because our Lookup Component is emitting two events unfortunately.
|
|
8749
|
-
.valueChanges.pipe(operators.debounceTime(50))
|
|
8750
|
-
.subscribe(function () {
|
|
8751
|
-
item.formGroup.get('classificacaoTributaria').reset(null);
|
|
8752
|
-
});
|
|
8753
9493
|
};
|
|
8754
9494
|
ErpTributosComponent.prototype.mapEnumTipoTributoToEnumTipImpCst = function (taxType) {
|
|
8755
9495
|
switch (taxType) {
|
|
@@ -10923,6 +11663,8 @@
|
|
|
10923
11663
|
exports.nonNullish = nonNullish;
|
|
10924
11664
|
exports.ɵa = ErpResumoComponent;
|
|
10925
11665
|
exports.ɵb = ErpResumoService;
|
|
11666
|
+
exports.ɵba = EntityService;
|
|
11667
|
+
exports.ɵbb = QuantidadeDisponivelDemandaModule;
|
|
10926
11668
|
exports.ɵc = ErpTributosService;
|
|
10927
11669
|
exports.ɵd = RulesService;
|
|
10928
11670
|
exports.ɵe = StatusRulesRegistry;
|
|
@@ -10933,20 +11675,20 @@
|
|
|
10933
11675
|
exports.ɵj = TaxClassificationRequiredValidationRule;
|
|
10934
11676
|
exports.ɵk = TaxAmountRequiredValidationRule;
|
|
10935
11677
|
exports.ɵl = TaxSituationRequiredValidationRule;
|
|
10936
|
-
exports.ɵm =
|
|
10937
|
-
exports.ɵn =
|
|
10938
|
-
exports.ɵo =
|
|
10939
|
-
exports.ɵp =
|
|
10940
|
-
exports.ɵq =
|
|
10941
|
-
exports.ɵr =
|
|
10942
|
-
exports.ɵs =
|
|
10943
|
-
exports.ɵt =
|
|
10944
|
-
exports.ɵu =
|
|
10945
|
-
exports.ɵv =
|
|
10946
|
-
exports.ɵw =
|
|
10947
|
-
exports.ɵx =
|
|
10948
|
-
exports.ɵy =
|
|
10949
|
-
exports.ɵz =
|
|
11678
|
+
exports.ɵm = NetAmountApplicationRequiredValidationRule;
|
|
11679
|
+
exports.ɵn = CalculationRulesRegistry;
|
|
11680
|
+
exports.ɵo = TaxableBaseCalculationRule;
|
|
11681
|
+
exports.ɵp = TaxAmountCalculator;
|
|
11682
|
+
exports.ɵq = EffectiveTaxRateCalculator;
|
|
11683
|
+
exports.ɵr = TaxRateCalculationRule;
|
|
11684
|
+
exports.ɵs = EffectiveTaxRateCalculationRule;
|
|
11685
|
+
exports.ɵt = TaxAmountCalculationRule;
|
|
11686
|
+
exports.ɵu = GrossAmountCalculationRule;
|
|
11687
|
+
exports.ɵv = GrossAmountCalculator;
|
|
11688
|
+
exports.ɵw = TaxClassificationCalculationRule;
|
|
11689
|
+
exports.ɵx = FocusService;
|
|
11690
|
+
exports.ɵy = ErpLoteSeriesService;
|
|
11691
|
+
exports.ɵz = QuantidadeDisponivelDemandaService;
|
|
10950
11692
|
|
|
10951
11693
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
10952
11694
|
|