@senior-agronegocio/angular-components 0.0.75 → 0.0.77

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.
@@ -2466,42 +2466,21 @@
2466
2466
  return matches ? matches.length : exports.AGRO_NUMBERS.ZERO;
2467
2467
  };
2468
2468
  AgroStringUtils.validateCPF = function (cpf) {
2469
- // Remover caracteres não numéricos
2470
- cpf = cpf.replace(/\D/g, "");
2471
- // Verificar se o CPF tem 11 dígitos
2472
- if (cpf.length !== exports.AGRO_NUMBERS.ELEVEN) {
2469
+ cpf = cpf.replace(/\D/g, '');
2470
+ if (cpf.length !== 11 || /^(\d)\1+$/.test(cpf)) {
2473
2471
  return false;
2474
2472
  }
2475
- // Verificar se todos os dígitos são iguais (caso contrário, é um sinal de CPF inválido)
2476
- if (/^(\d)\1{10}$/.test(cpf)) {
2477
- return false;
2478
- }
2479
- // Calcular o primeiro dígito verificador
2480
- var sum = exports.AGRO_NUMBERS.ZERO;
2481
- var remainder;
2482
- for (var i = exports.AGRO_NUMBERS.ONE; i <= exports.AGRO_NUMBERS.NINE; i++) {
2483
- sum += parseInt(cpf[i - exports.AGRO_NUMBERS.ONE]) * (exports.AGRO_NUMBERS.ELEVEN - i);
2484
- }
2485
- remainder = sum % exports.AGRO_NUMBERS.ELEVEN;
2486
- if (remainder === exports.AGRO_NUMBERS.TEN || remainder === exports.AGRO_NUMBERS.ELEVEN) {
2487
- remainder = exports.AGRO_NUMBERS.ZERO;
2488
- }
2489
- if (remainder !== parseInt(cpf[exports.AGRO_NUMBERS.NINE])) {
2490
- return false;
2491
- }
2492
- // Calcular o segundo dígito verificador
2493
- sum = exports.AGRO_NUMBERS.ZERO;
2494
- for (var i = exports.AGRO_NUMBERS.ONE; i <= exports.AGRO_NUMBERS.TEN; i++) {
2495
- sum += parseInt(cpf[i - exports.AGRO_NUMBERS.ONE]) * (exports.AGRO_NUMBERS.TWELVE - i);
2496
- }
2497
- remainder = sum % exports.AGRO_NUMBERS.ELEVEN;
2498
- if (remainder === exports.AGRO_NUMBERS.TEN || remainder === exports.AGRO_NUMBERS.ELEVEN) {
2499
- remainder = exports.AGRO_NUMBERS.ZERO;
2500
- }
2501
- if (remainder !== parseInt(cpf[exports.AGRO_NUMBERS.TEN])) {
2502
- return false;
2503
- }
2504
- return true;
2473
+ var calcVerifier = function (cpf, length) {
2474
+ var sum = 0;
2475
+ for (var i = 0; i < length; i++) {
2476
+ sum += parseInt(cpf[i]) * (length + 1 - i);
2477
+ }
2478
+ var result = sum % 11;
2479
+ return result < 2 ? 0 : 11 - result;
2480
+ };
2481
+ var digit1 = calcVerifier(cpf, 9);
2482
+ var digit2 = calcVerifier(cpf, 10);
2483
+ return digit1 === parseInt(cpf[9]) && digit2 === parseInt(cpf[10]);
2505
2484
  };
2506
2485
  AgroStringUtils.validateCNPJ = function (cnpj) {
2507
2486
  // Remove todos os caracteres não numéricos
@@ -3809,7 +3788,9 @@
3809
3788
  "agro.angular_components.ORIGINATION_CREATE_INVOICE": "Emissão de NF",
3810
3789
  "agro.angular_components.ORIGINATION_CREATE_EFFECTIVE_BALANCE": "Emissão de saldo efetivo",
3811
3790
  "agro.angular_components.PRODUCER_NET_VALUE_EFFECTIVE_BALANCE_CONFIRMATION": "Confirmação de saldo efetivo",
3812
- "agro.angular_components.CLOSE_INVOICE_FIXATION": "Fechamento de NF"
3791
+ "agro.angular_components.CLOSE_INVOICE_FIXATION": "Fechamento de NF",
3792
+ "agro.angular_components.ORIGINATION_CREATE_EFFECTIVE_CONFIRMATION": "Confirmação efetiva",
3793
+ "agro.angular_components.ORIGINATION_CREATE_PROVISIONAL_BALANCE": "Saldo provisório"
3813
3794
  };
3814
3795
 
3815
3796
  var enUS = {
@@ -4047,7 +4028,9 @@
4047
4028
  "agro.angular_components.ORIGINATION_CREATE_INVOICE": "Invoice Issuance",
4048
4029
  "agro.angular_components.ORIGINATION_CREATE_EFFECTIVE_BALANCE": "Effective balance issuance",
4049
4030
  "agro.angular_components.PRODUCER_NET_VALUE_EFFECTIVE_BALANCE_CONFIRMATION": "Effective balance confirmation",
4050
- "agro.angular_components.CLOSE_INVOICE_FIXATION": "Invoice fixation closure"
4031
+ "agro.angular_components.CLOSE_INVOICE_FIXATION": "Invoice fixation closure",
4032
+ "agro.angular_components.ORIGINATION_CREATE_EFFECTIVE_CONFIRMATION": "Effective confirmation",
4033
+ "agro.angular_components.ORIGINATION_CREATE_PROVISIONAL_BALANCE": "Provisional balance",
4051
4034
  };
4052
4035
 
4053
4036
  var esCO = {
@@ -4285,7 +4268,9 @@
4285
4268
  "agro.angular_components.ORIGINATION_CREATE_INVOICE": "Emisión de factura",
4286
4269
  "agro.angular_components.ORIGINATION_CREATE_EFFECTIVE_BALANCE": "Emisión de saldo efectivo",
4287
4270
  "agro.angular_components.PRODUCER_NET_VALUE_EFFECTIVE_BALANCE_CONFIRMATION": "Confirmación del saldo efectivo",
4288
- "agro.angular_components.CLOSE_INVOICE_FIXATION": "Cerrar factura de fijación"
4271
+ "agro.angular_components.CLOSE_INVOICE_FIXATION": "Cerrar factura de fijación",
4272
+ "agro.angular_components.ORIGINATION_CREATE_EFFECTIVE_CONFIRMATION": "Confirmación efectiva",
4273
+ "agro.angular_components.ORIGINATION_CREATE_PROVISIONAL_BALANCE": "Saldo provisional",
4289
4274
  };
4290
4275
 
4291
4276
  var LibTranslationService = /** @class */ (function () {
@@ -4495,6 +4480,10 @@
4495
4480
  EventOperation["CREATE_INVOICE_FIXATION"] = "CREATE_INVOICE_FIXATION";
4496
4481
  EventOperation["CANCEL_INVOICE_FIXATION"] = "CANCEL_INVOICE_FIXATION";
4497
4482
  EventOperation["CLOSE_INVOICE_FIXATION"] = "CLOSE_INVOICE_FIXATION";
4483
+ EventOperation["ORIGINATION_CREATE_EFFECTIVE_BALANCE"] = "ORIGINATION_CREATE_EFFECTIVE_BALANCE";
4484
+ EventOperation["ORIGINATION_CREATE_EFFECTIVE_CONFIRMATION"] = "ORIGINATION_CREATE_EFFECTIVE_CONFIRMATION";
4485
+ EventOperation["ORIGINATION_CREATE_INVOICE"] = "ORIGINATION_CREATE_INVOICE";
4486
+ EventOperation["ORIGINATION_CREATE_PROVISIONAL_BALANCE"] = "ORIGINATION_CREATE_PROVISIONAL_BALANCE";
4498
4487
  })(EventOperation || (EventOperation = {}));
4499
4488
 
4500
4489
  var EventOrigin;