@senior-agronegocio/angular-components 0.0.9852 → 0.0.9855
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-agronegocio-angular-components.umd.js +917 -374
- package/bundles/senior-agronegocio-angular-components.umd.js.map +1 -1
- package/bundles/senior-agronegocio-angular-components.umd.min.js +2 -2
- package/bundles/senior-agronegocio-angular-components.umd.min.js.map +1 -1
- package/components/event-control-board/event-control-board.component.d.ts +1 -1
- package/components/index.d.ts +1 -0
- package/components/modal-invoice-pj-selector/index.d.ts +4 -0
- package/components/modal-invoice-pj-selector/modal-invoice-pj-selector-options.interface.d.ts +10 -0
- package/components/modal-invoice-pj-selector/modal-invoice-pj-selector.component.d.ts +41 -0
- package/components/modal-invoice-pj-selector/modal-invoice-pj-selector.module.d.ts +2 -0
- package/components/modal-invoice-pj-selector/services/agro-invoice/agro-invoice.module.d.ts +2 -0
- package/components/modal-invoice-pj-selector/services/agro-invoice/agro-invoice.service.d.ts +16 -0
- package/components/modal-invoice-pj-selector/services/agro-invoice/index.d.ts +2 -0
- package/components/modal-invoice-pj-selector/services/agro-invoice/interfaces.d.ts +73 -0
- package/esm2015/common/agro-object-stringifier.class.js +2 -2
- package/esm2015/common/agro-regex.constant.js +2 -2
- package/esm2015/common/agro-string-utils.class.js +39 -51
- package/esm2015/components/event-control-board/event-control-board.component.js +12 -15
- package/esm2015/components/index.js +2 -1
- package/esm2015/components/modal-invoice-pj-selector/index.js +4 -0
- package/esm2015/components/modal-invoice-pj-selector/modal-invoice-pj-selector-options.interface.js +1 -0
- package/esm2015/components/modal-invoice-pj-selector/modal-invoice-pj-selector.component.js +193 -0
- package/esm2015/components/modal-invoice-pj-selector/modal-invoice-pj-selector.module.js +42 -0
- package/esm2015/components/modal-invoice-pj-selector/services/agro-invoice/agro-invoice.module.js +28 -0
- package/esm2015/components/modal-invoice-pj-selector/services/agro-invoice/agro-invoice.service.js +48 -0
- package/esm2015/components/modal-invoice-pj-selector/services/agro-invoice/index.js +3 -0
- package/esm2015/components/modal-invoice-pj-selector/services/agro-invoice/interfaces.js +13 -0
- package/esm2015/lib-translation.module.js +3 -1
- package/esm2015/pipe/index.js +5 -4
- package/esm2015/pipe/kilogram/index.js +3 -0
- package/esm2015/pipe/kilogram/kilogram.module.js +17 -0
- package/esm2015/pipe/kilogram/kilogram.pipe.js +38 -0
- package/esm2015/pipe/telephone/telephone.pipe.js +27 -18
- package/esm2015/public-api.js +2 -2
- package/esm2015/services/entity-service.js +124 -0
- package/esm2015/services/i18n/en-US.js +19 -2
- package/esm2015/services/i18n/es-CO.js +18 -1
- package/esm2015/services/i18n/pt-BR.js +20 -2
- package/esm2015/services/lib-translation.service.js +2 -2
- package/esm5/common/agro-object-stringifier.class.js +2 -2
- package/esm5/common/agro-regex.constant.js +2 -2
- package/esm5/common/agro-string-utils.class.js +46 -58
- package/esm5/components/event-control-board/event-control-board.component.js +12 -15
- package/esm5/components/index.js +2 -1
- package/esm5/components/modal-invoice-pj-selector/index.js +4 -0
- package/esm5/components/modal-invoice-pj-selector/modal-invoice-pj-selector-options.interface.js +1 -0
- package/esm5/components/modal-invoice-pj-selector/modal-invoice-pj-selector.component.js +202 -0
- package/esm5/components/modal-invoice-pj-selector/modal-invoice-pj-selector.module.js +45 -0
- package/esm5/components/modal-invoice-pj-selector/services/agro-invoice/agro-invoice.module.js +31 -0
- package/esm5/components/modal-invoice-pj-selector/services/agro-invoice/agro-invoice.service.js +55 -0
- package/esm5/components/modal-invoice-pj-selector/services/agro-invoice/index.js +3 -0
- package/esm5/components/modal-invoice-pj-selector/services/agro-invoice/interfaces.js +13 -0
- package/esm5/lib-translation.module.js +3 -1
- package/esm5/pipe/index.js +5 -4
- package/esm5/pipe/kilogram/index.js +3 -0
- package/esm5/pipe/kilogram/kilogram.module.js +20 -0
- package/esm5/pipe/kilogram/kilogram.pipe.js +41 -0
- package/esm5/pipe/telephone/telephone.pipe.js +27 -18
- package/esm5/public-api.js +2 -2
- package/esm5/services/entity-service.js +135 -0
- package/esm5/services/i18n/en-US.js +19 -2
- package/esm5/services/i18n/es-CO.js +18 -1
- package/esm5/services/i18n/pt-BR.js +20 -2
- package/esm5/services/lib-translation.service.js +2 -2
- package/fesm2015/senior-agronegocio-angular-components.js +735 -235
- package/fesm2015/senior-agronegocio-angular-components.js.map +1 -1
- package/fesm5/senior-agronegocio-angular-components.js +920 -383
- package/fesm5/senior-agronegocio-angular-components.js.map +1 -1
- package/package.json +1 -1
- package/pipe/index.d.ts +4 -3
- package/pipe/kilogram/index.d.ts +2 -0
- package/pipe/kilogram/kilogram.module.d.ts +2 -0
- package/pipe/kilogram/kilogram.pipe.d.ts +8 -0
- package/public-api.d.ts +1 -1
- package/senior-agronegocio-angular-components.metadata.json +1 -1
- package/services/entity-service.d.ts +72 -0
- package/services/i18n/en-US.d.ts +17 -0
- package/services/i18n/es-CO.d.ts +17 -0
- package/services/i18n/pt-BR.d.ts +18 -0
|
@@ -360,7 +360,7 @@
|
|
|
360
360
|
* Validação de Placa de Veículo Antiga
|
|
361
361
|
* Formato: AAA-0000
|
|
362
362
|
*/
|
|
363
|
-
isOldLicensePlate: /^[A-Z]{3}
|
|
363
|
+
isOldLicensePlate: /^[A-Z]{3}\d{4}$/,
|
|
364
364
|
isISODate: /^\d{4}-\d{2}-\d{2}$/,
|
|
365
365
|
isISOTime: /^\d{2}:\d{2}:\d{2}$/,
|
|
366
366
|
isISODateTime: /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(?:\.\d+)?Z$/,
|
|
@@ -2496,8 +2496,9 @@
|
|
|
2496
2496
|
*/
|
|
2497
2497
|
AgroStringUtils.removeMask = function (value, mask) {
|
|
2498
2498
|
var e_1, _a;
|
|
2499
|
-
if (!value || !mask)
|
|
2499
|
+
if (!value || !mask) {
|
|
2500
2500
|
return value;
|
|
2501
|
+
}
|
|
2501
2502
|
var valueChars = value.toString().split("");
|
|
2502
2503
|
var maskChars = mask.split("");
|
|
2503
2504
|
var unmaskedValue = "";
|
|
@@ -2505,65 +2506,52 @@
|
|
|
2505
2506
|
var isDigit = function (c) { return /\d/.test(c); };
|
|
2506
2507
|
var isAlpha = function (c) { return /[A-Za-z]/.test(c); };
|
|
2507
2508
|
var isAlnum = function (c) { return /[A-Za-z0-9]/.test(c); };
|
|
2509
|
+
var extractNext = function (testFn) {
|
|
2510
|
+
var k = j;
|
|
2511
|
+
while (k < valueChars.length && !testFn(valueChars[k])) {
|
|
2512
|
+
k++;
|
|
2513
|
+
}
|
|
2514
|
+
if (k < valueChars.length) {
|
|
2515
|
+
var found = valueChars[k];
|
|
2516
|
+
j = k + 1;
|
|
2517
|
+
return found;
|
|
2518
|
+
}
|
|
2519
|
+
var fallback = valueChars[j];
|
|
2520
|
+
j++;
|
|
2521
|
+
return fallback;
|
|
2522
|
+
};
|
|
2523
|
+
var processMaskChar = function (maskChar) {
|
|
2524
|
+
var _a, _b;
|
|
2525
|
+
if (j >= valueChars.length) {
|
|
2526
|
+
return;
|
|
2527
|
+
}
|
|
2528
|
+
var current = valueChars[j];
|
|
2529
|
+
switch (maskChar) {
|
|
2530
|
+
case "9":
|
|
2531
|
+
unmaskedValue += (_a = extractNext(isDigit)) !== null && _a !== void 0 ? _a : "";
|
|
2532
|
+
break;
|
|
2533
|
+
case "A":
|
|
2534
|
+
unmaskedValue += (_b = extractNext(isAlpha)) !== null && _b !== void 0 ? _b : "";
|
|
2535
|
+
break;
|
|
2536
|
+
default:
|
|
2537
|
+
handleSeparator(maskChar, current);
|
|
2538
|
+
break;
|
|
2539
|
+
}
|
|
2540
|
+
};
|
|
2541
|
+
var handleSeparator = function (maskChar, current) {
|
|
2542
|
+
if (current === maskChar) {
|
|
2543
|
+
j++; // separador presente no valor
|
|
2544
|
+
}
|
|
2545
|
+
if (isAlnum(current)) {
|
|
2546
|
+
unmaskedValue += current;
|
|
2547
|
+
j++;
|
|
2548
|
+
}
|
|
2549
|
+
// se for pontuação diferente, apenas ignora (não consome j)
|
|
2550
|
+
};
|
|
2508
2551
|
try {
|
|
2509
2552
|
for (var maskChars_1 = __values(maskChars), maskChars_1_1 = maskChars_1.next(); !maskChars_1_1.done; maskChars_1_1 = maskChars_1.next()) {
|
|
2510
2553
|
var maskChar = maskChars_1_1.value;
|
|
2511
|
-
|
|
2512
|
-
break;
|
|
2513
|
-
var current = valueChars[j];
|
|
2514
|
-
// Placeholder para dígito '9'
|
|
2515
|
-
if (maskChar === "9") {
|
|
2516
|
-
// procura próximo dígito a partir de j
|
|
2517
|
-
var k = j;
|
|
2518
|
-
while (k < valueChars.length && !isDigit(valueChars[k]))
|
|
2519
|
-
k++;
|
|
2520
|
-
if (k < valueChars.length) {
|
|
2521
|
-
// encontrou dígito: consome
|
|
2522
|
-
unmaskedValue += valueChars[k];
|
|
2523
|
-
j = k + 1;
|
|
2524
|
-
}
|
|
2525
|
-
else {
|
|
2526
|
-
// não há dígito futuro: captura o caractere atual como dado
|
|
2527
|
-
unmaskedValue += valueChars[j];
|
|
2528
|
-
j++;
|
|
2529
|
-
}
|
|
2530
|
-
continue;
|
|
2531
|
-
}
|
|
2532
|
-
// Placeholder para letra 'A'
|
|
2533
|
-
if (maskChar === "A") {
|
|
2534
|
-
// procura próxima letra a partir de j
|
|
2535
|
-
var k = j;
|
|
2536
|
-
while (k < valueChars.length && !isAlpha(valueChars[k]))
|
|
2537
|
-
k++;
|
|
2538
|
-
if (k < valueChars.length) {
|
|
2539
|
-
unmaskedValue += valueChars[k];
|
|
2540
|
-
j = k + 1;
|
|
2541
|
-
}
|
|
2542
|
-
else {
|
|
2543
|
-
unmaskedValue += valueChars[j];
|
|
2544
|
-
j++;
|
|
2545
|
-
}
|
|
2546
|
-
continue;
|
|
2547
|
-
}
|
|
2548
|
-
// maskChar é um separador literal opcional.
|
|
2549
|
-
if (current === maskChar) {
|
|
2550
|
-
// separador presente no valor: consome-o
|
|
2551
|
-
j++;
|
|
2552
|
-
continue;
|
|
2553
|
-
}
|
|
2554
|
-
// separador ausente:
|
|
2555
|
-
// - se o caractere atual for alfanumérico, trata como dado e captura;
|
|
2556
|
-
// - se não for alfanumérico (pontuação), ignora — não avança j, permite
|
|
2557
|
-
// que o próximo placeholder pule/consuma ou procure pelo tipo esperado.
|
|
2558
|
-
if (isAlnum(current)) {
|
|
2559
|
-
unmaskedValue += current;
|
|
2560
|
-
j++;
|
|
2561
|
-
}
|
|
2562
|
-
else {
|
|
2563
|
-
// ignora caractere não-alfanumérico no lugar do separador (não consome)
|
|
2564
|
-
// assim o próximo placeholder poderá procurar o caractere do tipo esperado
|
|
2565
|
-
// sem perder a posição atual.
|
|
2566
|
-
}
|
|
2554
|
+
processMaskChar(maskChar);
|
|
2567
2555
|
}
|
|
2568
2556
|
}
|
|
2569
2557
|
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
@@ -3912,7 +3900,7 @@
|
|
|
3912
3900
|
"agro.angular_components.save": "Salvar",
|
|
3913
3901
|
"agro.angular_components.select": "Selecione",
|
|
3914
3902
|
"agro.angular_components.updated_by": "Atualizado por",
|
|
3915
|
-
|
|
3903
|
+
error_invalid: "Valor inválido",
|
|
3916
3904
|
"agro.angular_components.choose_label": "Escolha",
|
|
3917
3905
|
"agro.angular_components.remove_label": "Remover",
|
|
3918
3906
|
"agro.angular_components.cancel_label": "Cancelar",
|
|
@@ -3999,6 +3987,7 @@
|
|
|
3999
3987
|
"agro.angular_components.ORIGINATION_CREATE_EFFECTIVE_BALANCE": "Emissão de saldo efetivo",
|
|
4000
3988
|
"agro.angular_components.PRODUCER_NET_VALUE_EFFECTIVE_BALANCE_CONFIRMATION": "Confirmação de saldo efetivo",
|
|
4001
3989
|
"agro.angular_components.CLOSE_INVOICE_FIXATION": "Fechamento de NF",
|
|
3990
|
+
"agro.angular_components.INVOICE_CLOSE_INVOICE": "Solicitação de cancelamento da NF",
|
|
4002
3991
|
"agro.angular_components.ORIGINATION_CREATE_EFFECTIVE_CONFIRMATION": "Confirmação efetiva",
|
|
4003
3992
|
"agro.angular_components.ORIGINATION_CREATE_PROVISIONAL_BALANCE": "Saldo provisório",
|
|
4004
3993
|
"agro.angular_components.CLOSE_INVOICE_TRANSFER": "Fechamento de NF",
|
|
@@ -4008,6 +3997,23 @@
|
|
|
4008
3997
|
"agro.angular_components.TRANSFER_CREATE_SERVICE_INVOICE": "Emissão NF de serviço",
|
|
4009
3998
|
"agro.angular_components.TRANSFER_CANCEL_SERVICE_INVOICE": "Cancelamento de NF de serviço",
|
|
4010
3999
|
"agro.angular_components.REOPEN_INVOICE_FIXATION": "Reabertura da NF",
|
|
4000
|
+
"agro.angular_components.CIDASC_INTEGRATION": "Envio ao Cidasc",
|
|
4001
|
+
"agro.angular_components.CIDASC_CANCELLATION": "Cancelamento do Receituário",
|
|
4002
|
+
"agro.angular_components.CIDASC_DATA_LOAD_CULTURE": "Carga Cidasc - Cultura",
|
|
4003
|
+
"agro.angular_components.CIDASC_DATA_LOAD_PEST": "Carga Cidasc - Praga",
|
|
4004
|
+
"agro.angular_components.CIDASC_DATA_LOAD_PRODUCT": "Carga Cidasc - Produto",
|
|
4005
|
+
"agro.angular_components.CIDASC_DATA_LOAD_MEASURE_UNIT": "Carga Cidasc - Unidade de medida",
|
|
4006
|
+
"agro.angular_components.CIDASC_DATA_LOAD_COMPOSED_MEASURE_UNIT": "Carga Cidasc - Medida por hectare",
|
|
4007
|
+
"agro.angular_components.agronomic_prescription_origin_event": "Receituário Agronômico",
|
|
4008
|
+
"agro.angular_components.number_or_series": "Número ou série",
|
|
4009
|
+
"agro.angular_components.panel_title_external_invoice_add_external_invoice": "Adicionar nota fiscal",
|
|
4010
|
+
"agro.angular_components.add_pj_invoice_modal_no_invoices_found": "Nenhuma nota fiscal disponível para este produtor",
|
|
4011
|
+
"agro.angular_components.number": "Número",
|
|
4012
|
+
"agro.angular_components.series": "Série",
|
|
4013
|
+
"agro.angular_components.itens": "Itens",
|
|
4014
|
+
"agro.angular_components.quantity": "Quantidade",
|
|
4015
|
+
"agro.angular_components.issuance_date": "Data de emissão",
|
|
4016
|
+
"agro.angular_components.no_register_found_for_external_invoices_summary": "Nenhuma nota encontrada",
|
|
4011
4017
|
};
|
|
4012
4018
|
|
|
4013
4019
|
var enUS = {
|
|
@@ -4165,7 +4171,7 @@
|
|
|
4165
4171
|
"agro.angular_components.save": "Save",
|
|
4166
4172
|
"agro.angular_components.select": "Select",
|
|
4167
4173
|
"agro.angular_components.updated_by": "Updated by",
|
|
4168
|
-
error_invalid: "Invalid value",
|
|
4174
|
+
"error_invalid": "Invalid value",
|
|
4169
4175
|
"agro.angular_components.choose_label": "Choose",
|
|
4170
4176
|
"agro.angular_components.remove_label": "Remove",
|
|
4171
4177
|
"agro.angular_components.cancel_label": "Cancel",
|
|
@@ -4255,6 +4261,23 @@
|
|
|
4255
4261
|
"agro.angular_components.TRANSFER_CREATE_SERVICE_INVOICE": "Service invoice issuance",
|
|
4256
4262
|
"agro.angular_components.TRANSFER_CANCEL_SERVICE_INVOICE": "Service invoice cancellation",
|
|
4257
4263
|
"agro.angular_components.REOPEN_INVOICE_FIXATION": "Reopen invoice fixation",
|
|
4264
|
+
"agro.angular_components.INVOICE_CLOSE_INVOICE": "Invoice cancellation request",
|
|
4265
|
+
"agro.angular_components.CIDASC_INTEGRATION": "Send to Cidasc",
|
|
4266
|
+
"agro.angular_components.CIDASC_CANCELLATION": "Prescription Cancellation",
|
|
4267
|
+
"agro.angular_components.CIDASC_DATA_LOAD_CULTURE": "Cidasc Load - Culture",
|
|
4268
|
+
"agro.angular_components.CIDASC_DATA_LOAD_PEST": "Cidasc Load - Pest",
|
|
4269
|
+
"agro.angular_components.CIDASC_DATA_LOAD_PRODUCT": "Cidasc Load - Product",
|
|
4270
|
+
"agro.angular_components.CIDASC_DATA_LOAD_MEASURE_UNIT": "Cidasc Load - Unit of measure",
|
|
4271
|
+
"agro.angular_components.CIDASC_DATA_LOAD_COMPOSED_MEASURE_UNIT": "Cidasc Load - Measure per hectare",
|
|
4272
|
+
"agro.angular_components.agronomic_prescription_origin_event": "Agronomic Prescription",
|
|
4273
|
+
"agro.angular_components.number_or_series": "Número ou série",
|
|
4274
|
+
"agro.angular_components.panel_title_external_invoice_add_external_invoice": "Adicionar nota fiscal",
|
|
4275
|
+
"agro.angular_components.add_pj_invoice_modal_no_invoices_found": "Nenhuma nota fiscal disponível para este produtor",
|
|
4276
|
+
"agro.angular_components.number": "Número",
|
|
4277
|
+
"agro.angular_components.series": "Série",
|
|
4278
|
+
"agro.angular_components.itens": "Itens",
|
|
4279
|
+
"agro.angular_components.quantity": "Quantidade",
|
|
4280
|
+
"agro.angular_components.issuance_date": "Data de emissão",
|
|
4258
4281
|
};
|
|
4259
4282
|
|
|
4260
4283
|
var esCO = {
|
|
@@ -4502,6 +4525,23 @@
|
|
|
4502
4525
|
"agro.angular_components.TRANSFER_CREATE_SERVICE_INVOICE": "Emisión de NF de servicio",
|
|
4503
4526
|
"agro.angular_components.TRANSFER_CANCEL_SERVICE_INVOICE": "Cancelación de NF de servicio",
|
|
4504
4527
|
"agro.angular_components.REOPEN_INVOICE_FIXATION": "Reapertura de factura",
|
|
4528
|
+
"agro.angular_components.INVOICE_CLOSE_INVOICE": "Solicitud de cancelación de la factura",
|
|
4529
|
+
"agro.angular_components.CIDASC_INTEGRATION": "Envío a Cidasc",
|
|
4530
|
+
"agro.angular_components.CIDASC_CANCELLATION": "Cancelación de Receta",
|
|
4531
|
+
"agro.angular_components.CIDASC_DATA_LOAD_CULTURE": "Carga Cidasc - Cultivo",
|
|
4532
|
+
"agro.angular_components.CIDASC_DATA_LOAD_PEST": "Carga Cidasc - Plaga",
|
|
4533
|
+
"agro.angular_components.CIDASC_DATA_LOAD_PRODUCT": "Carga Cidasc - Producto",
|
|
4534
|
+
"agro.angular_components.CIDASC_DATA_LOAD_MEASURE_UNIT": "Carga Cidasc - Unidad de medida",
|
|
4535
|
+
"agro.angular_components.CIDASC_DATA_LOAD_COMPOSED_MEASURE_UNIT": "Carga Cidasc - Medida por hectárea",
|
|
4536
|
+
"agro.angular_components.agronomic_prescription_origin_event": "Recetario Agronómico",
|
|
4537
|
+
"agro.angular_components.number_or_series": "Número ou série",
|
|
4538
|
+
"agro.angular_components.panel_title_external_invoice_add_external_invoice": "Adicionar nota fiscal",
|
|
4539
|
+
"agro.angular_components.add_pj_invoice_modal_no_invoices_found": "Nenhuma nota fiscal disponível para este produtor",
|
|
4540
|
+
"agro.angular_components.number": "Número",
|
|
4541
|
+
"agro.angular_components.series": "Série",
|
|
4542
|
+
"agro.angular_components.itens": "Itens",
|
|
4543
|
+
"agro.angular_components.quantity": "Quantidade",
|
|
4544
|
+
"agro.angular_components.issuance_date": "Data de emissão",
|
|
4505
4545
|
};
|
|
4506
4546
|
|
|
4507
4547
|
var LibTranslationService = /** @class */ (function () {
|
|
@@ -4512,7 +4552,7 @@
|
|
|
4512
4552
|
"es-CO": esCO,
|
|
4513
4553
|
};
|
|
4514
4554
|
this.currentTranslation = {};
|
|
4515
|
-
this.setLang(
|
|
4555
|
+
this.setLang("pt-BR");
|
|
4516
4556
|
}
|
|
4517
4557
|
LibTranslationService.prototype.getLangOfUser = function () {
|
|
4518
4558
|
return AgroPlatformUtils.getCurrentTenantLocale() || "pt-BR";
|
|
@@ -4555,127 +4595,409 @@
|
|
|
4555
4595
|
return LibTranslationService;
|
|
4556
4596
|
}());
|
|
4557
4597
|
|
|
4558
|
-
var
|
|
4559
|
-
function
|
|
4560
|
-
this.
|
|
4561
|
-
this.config = config;
|
|
4562
|
-
this.ref = ref;
|
|
4563
|
-
this.translate = translate;
|
|
4564
|
-
this.loading = false;
|
|
4565
|
-
this.reasonMinLength = exports.AGRO_NUMBERS.FIFTEEN;
|
|
4566
|
-
this.ngUnsubscribe = new rxjs.Subject();
|
|
4567
|
-
this.cpSize = {
|
|
4568
|
-
sm: 12,
|
|
4569
|
-
md: exports.AGRO_NUMBERS.TWELVE,
|
|
4570
|
-
lg: exports.AGRO_NUMBERS.TWELVE,
|
|
4571
|
-
xl: exports.AGRO_NUMBERS.TWELVE,
|
|
4572
|
-
};
|
|
4573
|
-
this.priority = angularComponents.ButtonPriority;
|
|
4598
|
+
var KilogramPipe = /** @class */ (function () {
|
|
4599
|
+
function KilogramPipe(decimalPipe) {
|
|
4600
|
+
this.decimalPipe = decimalPipe;
|
|
4574
4601
|
}
|
|
4575
|
-
|
|
4576
|
-
|
|
4577
|
-
|
|
4578
|
-
|
|
4579
|
-
|
|
4580
|
-
|
|
4581
|
-
|
|
4582
|
-
|
|
4583
|
-
|
|
4584
|
-
|
|
4585
|
-
|
|
4586
|
-
|
|
4587
|
-
|
|
4588
|
-
|
|
4589
|
-
};
|
|
4590
|
-
CancelEventDialogComponent.prototype.setFormFields = function () {
|
|
4591
|
-
this.formFields = [
|
|
4592
|
-
new angularComponents.FormField({
|
|
4593
|
-
name: "reason",
|
|
4594
|
-
label: this.translate.instant("agro.angular_components.cancel_reason"),
|
|
4595
|
-
type: angularComponents.FieldType.String,
|
|
4596
|
-
multiple: false,
|
|
4597
|
-
required: function () { return true; },
|
|
4598
|
-
size: this.cpSize,
|
|
4599
|
-
maxLength: exports.AGRO_NUMBERS.ONE_HUNDRED,
|
|
4600
|
-
}),
|
|
4601
|
-
];
|
|
4602
|
-
};
|
|
4603
|
-
CancelEventDialogComponent.prototype.setDataConfigDialog = function () {
|
|
4604
|
-
var _a, _b, _c, _d;
|
|
4605
|
-
this.cancelEventDialogConfig = (_b = (_a = this.config.data) === null || _a === void 0 ? void 0 : _a.cancelEventDialogConfig) !== null && _b !== void 0 ? _b : {};
|
|
4606
|
-
this.reasonMinLength = (_d = (_c = this.cancelEventDialogConfig) === null || _c === void 0 ? void 0 : _c.reasonMinLength) !== null && _d !== void 0 ? _d : exports.AGRO_NUMBERS.FIFTEEN;
|
|
4602
|
+
KilogramPipe.prototype.transform = function (value, format, kgCaseInsensitive) {
|
|
4603
|
+
if (format === void 0) { format = "1.3-3"; }
|
|
4604
|
+
if (kgCaseInsensitive === void 0) { kgCaseInsensitive = "UPPER"; }
|
|
4605
|
+
if (value == null || isNaN(value)) {
|
|
4606
|
+
return "";
|
|
4607
|
+
}
|
|
4608
|
+
var str = this.decimalPipe.transform(value, format);
|
|
4609
|
+
var kgStr = "kg";
|
|
4610
|
+
if (!str) {
|
|
4611
|
+
console.info("Formato do peso inválido para transformação");
|
|
4612
|
+
return "";
|
|
4613
|
+
}
|
|
4614
|
+
str = str.replace(/,/g, ".");
|
|
4615
|
+
return this.replaceLastDotWithComma(str) + " " + (kgCaseInsensitive === "UPPER" ? kgStr.toUpperCase() : kgStr.toLowerCase());
|
|
4607
4616
|
};
|
|
4608
|
-
|
|
4609
|
-
|
|
4610
|
-
|
|
4611
|
-
|
|
4612
|
-
|
|
4613
|
-
|
|
4614
|
-
maxlength: this.translate.instant("agro.angular_components.error_max_length_transfer_code"),
|
|
4615
|
-
pattern: this.translate.instant("agro.angular_components.error_invalid"),
|
|
4616
|
-
FormDateError_data1: this.translate.instant("agro.angular_components.initial_invalid_date"),
|
|
4617
|
-
FormDateError_data2: this.translate.instant("agro.angular_components.end_invalid_date"),
|
|
4618
|
-
};
|
|
4617
|
+
KilogramPipe.prototype.replaceLastDotWithComma = function (value) {
|
|
4618
|
+
var lastDotIndex = value.lastIndexOf(".");
|
|
4619
|
+
if (lastDotIndex === -1) {
|
|
4620
|
+
return value;
|
|
4621
|
+
}
|
|
4622
|
+
return value.substring(0, lastDotIndex) + "," + value.substring(lastDotIndex + 1);
|
|
4619
4623
|
};
|
|
4620
|
-
|
|
4621
|
-
|
|
4622
|
-
|
|
4623
|
-
|
|
4624
|
-
|
|
4625
|
-
|
|
4626
|
-
|
|
4627
|
-
|
|
4628
|
-
|
|
4629
|
-
|
|
4630
|
-
|
|
4631
|
-
|
|
4632
|
-
|
|
4633
|
-
|
|
4634
|
-
|
|
4635
|
-
|
|
4636
|
-
|
|
4637
|
-
|
|
4638
|
-
|
|
4639
|
-
|
|
4640
|
-
|
|
4641
|
-
})
|
|
4624
|
+
KilogramPipe.ctorParameters = function () { return [
|
|
4625
|
+
{ type: common.DecimalPipe }
|
|
4626
|
+
]; };
|
|
4627
|
+
KilogramPipe = __decorate([
|
|
4628
|
+
core.Pipe({
|
|
4629
|
+
name: "kilogram",
|
|
4630
|
+
})
|
|
4631
|
+
], KilogramPipe);
|
|
4632
|
+
return KilogramPipe;
|
|
4633
|
+
}());
|
|
4634
|
+
|
|
4635
|
+
var KilogramModule = /** @class */ (function () {
|
|
4636
|
+
function KilogramModule() {
|
|
4637
|
+
}
|
|
4638
|
+
KilogramModule = __decorate([
|
|
4639
|
+
core.NgModule({
|
|
4640
|
+
declarations: [KilogramPipe],
|
|
4641
|
+
imports: [
|
|
4642
|
+
common.CommonModule
|
|
4643
|
+
],
|
|
4644
|
+
exports: [KilogramPipe]
|
|
4645
|
+
})
|
|
4646
|
+
], KilogramModule);
|
|
4647
|
+
return KilogramModule;
|
|
4648
|
+
}());
|
|
4649
|
+
|
|
4650
|
+
var CnpjCpfPipe = /** @class */ (function () {
|
|
4651
|
+
function CnpjCpfPipe() {
|
|
4652
|
+
}
|
|
4653
|
+
CnpjCpfPipe.prototype.transform = function (value) {
|
|
4654
|
+
var args = [];
|
|
4655
|
+
for (var _i = 1; _i < arguments.length; _i++) {
|
|
4656
|
+
args[_i - 1] = arguments[_i];
|
|
4657
|
+
}
|
|
4658
|
+
if (typeof value !== "string" && typeof value === "number") {
|
|
4659
|
+
value = value === null || value === void 0 ? void 0 : value.toString();
|
|
4660
|
+
}
|
|
4661
|
+
if (typeof value !== "string") {
|
|
4662
|
+
return value;
|
|
4663
|
+
}
|
|
4664
|
+
if (AgroStringUtils.validateCNPJ(value)) {
|
|
4665
|
+
return AgroStringUtils.applyMask(value, exports.AgroStringMasks.CNPJ);
|
|
4666
|
+
}
|
|
4667
|
+
if (AgroStringUtils.validateCPF(value)) {
|
|
4668
|
+
return AgroStringUtils.applyMask(value, exports.AgroStringMasks.CPF);
|
|
4669
|
+
}
|
|
4670
|
+
return value;
|
|
4642
4671
|
};
|
|
4643
|
-
|
|
4644
|
-
|
|
4645
|
-
|
|
4646
|
-
|
|
4647
|
-
|
|
4648
|
-
|
|
4649
|
-
|
|
4650
|
-
|
|
4651
|
-
|
|
4672
|
+
CnpjCpfPipe = __decorate([
|
|
4673
|
+
core.Pipe({
|
|
4674
|
+
name: "cnpjCpf",
|
|
4675
|
+
})
|
|
4676
|
+
], CnpjCpfPipe);
|
|
4677
|
+
return CnpjCpfPipe;
|
|
4678
|
+
}());
|
|
4679
|
+
|
|
4680
|
+
var CnpjCpfPipeModule = /** @class */ (function () {
|
|
4681
|
+
function CnpjCpfPipeModule() {
|
|
4682
|
+
}
|
|
4683
|
+
CnpjCpfPipeModule = __decorate([
|
|
4684
|
+
core.NgModule({
|
|
4685
|
+
declarations: [CnpjCpfPipe],
|
|
4686
|
+
imports: [common.CommonModule],
|
|
4687
|
+
exports: [CnpjCpfPipe],
|
|
4688
|
+
})
|
|
4689
|
+
], CnpjCpfPipeModule);
|
|
4690
|
+
return CnpjCpfPipeModule;
|
|
4691
|
+
}());
|
|
4692
|
+
|
|
4693
|
+
var AgroObjectStringifier = /** @class */ (function () {
|
|
4694
|
+
function AgroObjectStringifier() {
|
|
4695
|
+
}
|
|
4696
|
+
/**
|
|
4697
|
+
* Formata um objeto concatenando valores segundo as chaves e pipes informados.
|
|
4698
|
+
*
|
|
4699
|
+
* @param separator Separador entre os valores (ex: "-")
|
|
4700
|
+
* @param fields Campos a extrair. Podem conter subpropriedades ("propriedade.subPropriedade") e pipes ("propriedade|nomeDaPipe:arg1:arg2")
|
|
4701
|
+
* @param obj Objeto origem
|
|
4702
|
+
*/
|
|
4703
|
+
AgroObjectStringifier.formatObject = function (separator, fields, obj, usePipes) {
|
|
4704
|
+
function mapField(field) {
|
|
4705
|
+
var value = AgroObjectStringifier.resolvePath(obj, field);
|
|
4706
|
+
if (usePipes === null || usePipes === void 0 ? void 0 : usePipes.hasOwnProperty(field)) {
|
|
4707
|
+
return usePipes[field].transform(value);
|
|
4652
4708
|
}
|
|
4653
|
-
|
|
4709
|
+
return value !== null && value !== void 0 ? value : "";
|
|
4710
|
+
}
|
|
4711
|
+
function filterValid(v) {
|
|
4712
|
+
return typeof v === "number" || AgroStringUtils.isValid(v);
|
|
4713
|
+
}
|
|
4714
|
+
return fields.map(mapField).filter(filterValid).join(" " + separator + " ");
|
|
4654
4715
|
};
|
|
4655
|
-
|
|
4656
|
-
|
|
4716
|
+
/** Resolve um caminho tipo "empresa.cargo" dentro de um objeto */
|
|
4717
|
+
AgroObjectStringifier.resolvePath = function (obj, path) {
|
|
4718
|
+
function reducer(acc, key) {
|
|
4719
|
+
return acc === null || acc === void 0 ? void 0 : acc[key];
|
|
4720
|
+
}
|
|
4721
|
+
return path.split(".").reduce(reducer, obj);
|
|
4657
4722
|
};
|
|
4658
|
-
|
|
4659
|
-
|
|
4660
|
-
|
|
4661
|
-
|
|
4662
|
-
|
|
4663
|
-
|
|
4664
|
-
|
|
4665
|
-
|
|
4666
|
-
|
|
4667
|
-
|
|
4668
|
-
core.
|
|
4669
|
-
|
|
4670
|
-
|
|
4671
|
-
|
|
4723
|
+
return AgroObjectStringifier;
|
|
4724
|
+
}());
|
|
4725
|
+
|
|
4726
|
+
var StringifierPipe = /** @class */ (function () {
|
|
4727
|
+
function StringifierPipe() {
|
|
4728
|
+
}
|
|
4729
|
+
StringifierPipe.prototype.transform = function (value, separator, paths, pipes) {
|
|
4730
|
+
return AgroObjectStringifier.formatObject(separator, paths, value, pipes);
|
|
4731
|
+
};
|
|
4732
|
+
StringifierPipe = __decorate([
|
|
4733
|
+
core.Pipe({ name: "stringifier" })
|
|
4734
|
+
], StringifierPipe);
|
|
4735
|
+
return StringifierPipe;
|
|
4736
|
+
}());
|
|
4737
|
+
|
|
4738
|
+
var StringifierPipeModule = /** @class */ (function () {
|
|
4739
|
+
function StringifierPipeModule() {
|
|
4740
|
+
}
|
|
4741
|
+
StringifierPipeModule = __decorate([
|
|
4742
|
+
core.NgModule({
|
|
4743
|
+
declarations: [StringifierPipe],
|
|
4744
|
+
imports: [common.CommonModule],
|
|
4745
|
+
exports: [StringifierPipe],
|
|
4672
4746
|
})
|
|
4673
|
-
],
|
|
4674
|
-
return
|
|
4747
|
+
], StringifierPipeModule);
|
|
4748
|
+
return StringifierPipeModule;
|
|
4675
4749
|
}());
|
|
4676
4750
|
|
|
4677
|
-
var
|
|
4678
|
-
|
|
4751
|
+
var TelephonePipe = /** @class */ (function () {
|
|
4752
|
+
function TelephonePipe() {
|
|
4753
|
+
}
|
|
4754
|
+
/**
|
|
4755
|
+
* Transforma um número de telefone aplicando máscara automaticamente.
|
|
4756
|
+
* @param value Valor do telefone.
|
|
4757
|
+
* @param withDDI Define se deve forçar formatação com DDI (mesmo que não exista).
|
|
4758
|
+
*/
|
|
4759
|
+
TelephonePipe.prototype.transform = function (value, withDDI) {
|
|
4760
|
+
if (withDDI === void 0) { withDDI = false; }
|
|
4761
|
+
if (!value) {
|
|
4762
|
+
return "";
|
|
4763
|
+
}
|
|
4764
|
+
var digits = this.cleanDigits(value);
|
|
4765
|
+
if (!digits) {
|
|
4766
|
+
return value.toString();
|
|
4767
|
+
}
|
|
4768
|
+
var _a = this.extractParts(digits, withDDI), ddi = _a.ddi, ddd = _a.ddd, number = _a.number;
|
|
4769
|
+
return this.formatPhone(ddi, ddd, number, value.toString(), withDDI);
|
|
4770
|
+
};
|
|
4771
|
+
/** Remove todos os caracteres não numéricos */
|
|
4772
|
+
TelephonePipe.prototype.cleanDigits = function (value) {
|
|
4773
|
+
return value.toString().replace(/\D+/g, "");
|
|
4774
|
+
};
|
|
4775
|
+
/** Extrai DDI, DDD e número, considerando se deve aplicar DDI forçado */
|
|
4776
|
+
TelephonePipe.prototype.extractParts = function (digits, withDDI) {
|
|
4777
|
+
var len = digits.length;
|
|
4778
|
+
if (withDDI) {
|
|
4779
|
+
return this.extractWithDDI(digits);
|
|
4780
|
+
}
|
|
4781
|
+
if (len <= exports.AGRO_NUMBERS.NINE) {
|
|
4782
|
+
return { ddi: "", ddd: "", number: digits };
|
|
4783
|
+
}
|
|
4784
|
+
if (len <= exports.AGRO_NUMBERS.ELEVEN) {
|
|
4785
|
+
return this.extractWithDDD(digits);
|
|
4786
|
+
}
|
|
4787
|
+
return this.extractWithDDI(digits);
|
|
4788
|
+
};
|
|
4789
|
+
/** Extrai DDD e número (sem DDI) */
|
|
4790
|
+
TelephonePipe.prototype.extractWithDDD = function (digits) {
|
|
4791
|
+
var ddd = digits.slice(0, 2);
|
|
4792
|
+
var number = digits.slice(2);
|
|
4793
|
+
return { ddi: "", ddd: ddd, number: number };
|
|
4794
|
+
};
|
|
4795
|
+
/** Extrai DDI, DDD e número */
|
|
4796
|
+
TelephonePipe.prototype.extractWithDDI = function (digits) {
|
|
4797
|
+
var len = digits.length;
|
|
4798
|
+
var ddiLen = exports.AGRO_NUMBERS.ONE;
|
|
4799
|
+
if (len >= exports.AGRO_NUMBERS.FOURTEEN) {
|
|
4800
|
+
ddiLen = exports.AGRO_NUMBERS.THREE;
|
|
4801
|
+
}
|
|
4802
|
+
if (len >= exports.AGRO_NUMBERS.TWELVE) {
|
|
4803
|
+
ddiLen = exports.AGRO_NUMBERS.TWO;
|
|
4804
|
+
}
|
|
4805
|
+
var ddi = digits.slice(exports.AGRO_NUMBERS.ZERO, ddiLen);
|
|
4806
|
+
var ddd = digits.slice(ddiLen, ddiLen + exports.AGRO_NUMBERS.TWO);
|
|
4807
|
+
var number = digits.slice(ddiLen + exports.AGRO_NUMBERS.TWO);
|
|
4808
|
+
return { ddi: ddi, ddd: ddd, number: number };
|
|
4809
|
+
};
|
|
4810
|
+
/** Monta o número formatado */
|
|
4811
|
+
TelephonePipe.prototype.formatPhone = function (ddi, ddd, number, fallback, withDDI) {
|
|
4812
|
+
if (!number) {
|
|
4813
|
+
return fallback;
|
|
4814
|
+
}
|
|
4815
|
+
var formatted = "";
|
|
4816
|
+
if (withDDI || ddi) {
|
|
4817
|
+
formatted += "+" + (ddi || "55") + " ";
|
|
4818
|
+
}
|
|
4819
|
+
if (ddd) {
|
|
4820
|
+
formatted += "(" + ddd + ") ";
|
|
4821
|
+
}
|
|
4822
|
+
formatted += this.formatNumber(number);
|
|
4823
|
+
return formatted;
|
|
4824
|
+
};
|
|
4825
|
+
/** Aplica máscara de 8 ou 9 dígitos */
|
|
4826
|
+
TelephonePipe.prototype.formatNumber = function (number) {
|
|
4827
|
+
var len = number.length;
|
|
4828
|
+
if (len === exports.AGRO_NUMBERS.NINE) {
|
|
4829
|
+
return number.slice(exports.AGRO_NUMBERS.ZERO, exports.AGRO_NUMBERS.FIVE) + "-" + number.slice(exports.AGRO_NUMBERS.FIVE);
|
|
4830
|
+
}
|
|
4831
|
+
if (len === exports.AGRO_NUMBERS.EIGHT) {
|
|
4832
|
+
return number.slice(exports.AGRO_NUMBERS.ZERO, exports.AGRO_NUMBERS.FOUR) + "-" + number.slice(exports.AGRO_NUMBERS.FOUR);
|
|
4833
|
+
}
|
|
4834
|
+
return number;
|
|
4835
|
+
};
|
|
4836
|
+
TelephonePipe = __decorate([
|
|
4837
|
+
core.Pipe({ name: "telephone" })
|
|
4838
|
+
], TelephonePipe);
|
|
4839
|
+
return TelephonePipe;
|
|
4840
|
+
}());
|
|
4841
|
+
|
|
4842
|
+
var TelephonePipeModule = /** @class */ (function () {
|
|
4843
|
+
function TelephonePipeModule() {
|
|
4844
|
+
}
|
|
4845
|
+
TelephonePipeModule = __decorate([
|
|
4846
|
+
core.NgModule({
|
|
4847
|
+
declarations: [TelephonePipe],
|
|
4848
|
+
imports: [common.CommonModule],
|
|
4849
|
+
exports: [TelephonePipe],
|
|
4850
|
+
})
|
|
4851
|
+
], TelephonePipeModule);
|
|
4852
|
+
return TelephonePipeModule;
|
|
4853
|
+
}());
|
|
4854
|
+
|
|
4855
|
+
var LibTranslatePipe = /** @class */ (function () {
|
|
4856
|
+
function LibTranslatePipe(translateService) {
|
|
4857
|
+
this.translateService = translateService;
|
|
4858
|
+
}
|
|
4859
|
+
LibTranslatePipe.prototype.transform = function (value) {
|
|
4860
|
+
var args = [];
|
|
4861
|
+
for (var _i = 1; _i < arguments.length; _i++) {
|
|
4862
|
+
args[_i - 1] = arguments[_i];
|
|
4863
|
+
}
|
|
4864
|
+
if (args.length > 0) {
|
|
4865
|
+
return this.translateService.instant(value, args[0]);
|
|
4866
|
+
}
|
|
4867
|
+
return this.translateService.instant(value);
|
|
4868
|
+
};
|
|
4869
|
+
LibTranslatePipe.ctorParameters = function () { return [
|
|
4870
|
+
{ type: LibTranslationService }
|
|
4871
|
+
]; };
|
|
4872
|
+
LibTranslatePipe = __decorate([
|
|
4873
|
+
core.Pipe({
|
|
4874
|
+
name: 'libTranslate'
|
|
4875
|
+
})
|
|
4876
|
+
], LibTranslatePipe);
|
|
4877
|
+
return LibTranslatePipe;
|
|
4878
|
+
}());
|
|
4879
|
+
|
|
4880
|
+
var CancelEventDialogComponent = /** @class */ (function () {
|
|
4881
|
+
function CancelEventDialogComponent(formBuilder, config, ref, translate) {
|
|
4882
|
+
this.formBuilder = formBuilder;
|
|
4883
|
+
this.config = config;
|
|
4884
|
+
this.ref = ref;
|
|
4885
|
+
this.translate = translate;
|
|
4886
|
+
this.loading = false;
|
|
4887
|
+
this.reasonMinLength = exports.AGRO_NUMBERS.FIFTEEN;
|
|
4888
|
+
this.ngUnsubscribe = new rxjs.Subject();
|
|
4889
|
+
this.cpSize = {
|
|
4890
|
+
sm: 12,
|
|
4891
|
+
md: exports.AGRO_NUMBERS.TWELVE,
|
|
4892
|
+
lg: exports.AGRO_NUMBERS.TWELVE,
|
|
4893
|
+
xl: exports.AGRO_NUMBERS.TWELVE,
|
|
4894
|
+
};
|
|
4895
|
+
this.priority = angularComponents.ButtonPriority;
|
|
4896
|
+
}
|
|
4897
|
+
CancelEventDialogComponent.prototype.ngOnInit = function () {
|
|
4898
|
+
this.setFormGroup();
|
|
4899
|
+
this.setFormFields();
|
|
4900
|
+
this.setDataConfigDialog();
|
|
4901
|
+
this.setTranslations();
|
|
4902
|
+
};
|
|
4903
|
+
CancelEventDialogComponent.prototype.ngOnDestroy = function () {
|
|
4904
|
+
this.ngUnsubscribe.next();
|
|
4905
|
+
this.ngUnsubscribe.complete();
|
|
4906
|
+
};
|
|
4907
|
+
CancelEventDialogComponent.prototype.setFormGroup = function () {
|
|
4908
|
+
this.formGroup = this.formBuilder.group({
|
|
4909
|
+
reason: [{ value: null, disabled: false }, forms.Validators.compose([forms.Validators.required, forms.Validators.minLength(this.reasonMinLength)])],
|
|
4910
|
+
});
|
|
4911
|
+
};
|
|
4912
|
+
CancelEventDialogComponent.prototype.setFormFields = function () {
|
|
4913
|
+
this.formFields = [
|
|
4914
|
+
new angularComponents.FormField({
|
|
4915
|
+
name: "reason",
|
|
4916
|
+
label: this.translate.instant("agro.angular_components.cancel_reason"),
|
|
4917
|
+
type: angularComponents.FieldType.String,
|
|
4918
|
+
multiple: false,
|
|
4919
|
+
required: function () { return true; },
|
|
4920
|
+
size: this.cpSize,
|
|
4921
|
+
maxLength: exports.AGRO_NUMBERS.ONE_HUNDRED,
|
|
4922
|
+
}),
|
|
4923
|
+
];
|
|
4924
|
+
};
|
|
4925
|
+
CancelEventDialogComponent.prototype.setDataConfigDialog = function () {
|
|
4926
|
+
var _a, _b, _c, _d;
|
|
4927
|
+
this.cancelEventDialogConfig = (_b = (_a = this.config.data) === null || _a === void 0 ? void 0 : _a.cancelEventDialogConfig) !== null && _b !== void 0 ? _b : {};
|
|
4928
|
+
this.reasonMinLength = (_d = (_c = this.cancelEventDialogConfig) === null || _c === void 0 ? void 0 : _c.reasonMinLength) !== null && _d !== void 0 ? _d : exports.AGRO_NUMBERS.FIFTEEN;
|
|
4929
|
+
};
|
|
4930
|
+
CancelEventDialogComponent.prototype.setTranslations = function () {
|
|
4931
|
+
this.translations = {
|
|
4932
|
+
required: this.translate.instant("agro.angular_components.error_required"),
|
|
4933
|
+
min: this.translate.instant("agro.angular_components.error_min_value"),
|
|
4934
|
+
max: this.translate.instant("agro.angular_components.error_max_value"),
|
|
4935
|
+
minlength: this.translate.instant("agro.angular_components.error_min_length", { valor: this.reasonMinLength }),
|
|
4936
|
+
maxlength: this.translate.instant("agro.angular_components.error_max_length_transfer_code"),
|
|
4937
|
+
pattern: this.translate.instant("agro.angular_components.error_invalid"),
|
|
4938
|
+
FormDateError_data1: this.translate.instant("agro.angular_components.initial_invalid_date"),
|
|
4939
|
+
FormDateError_data2: this.translate.instant("agro.angular_components.end_invalid_date"),
|
|
4940
|
+
};
|
|
4941
|
+
};
|
|
4942
|
+
CancelEventDialogComponent.prototype.handleConfirmClick = function () {
|
|
4943
|
+
var _a, _b;
|
|
4944
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
4945
|
+
var reason;
|
|
4946
|
+
return __generator(this, function (_c) {
|
|
4947
|
+
switch (_c.label) {
|
|
4948
|
+
case 0:
|
|
4949
|
+
if (this.formGroup.invalid && ((_a = this.cancelEventDialogConfig) === null || _a === void 0 ? void 0 : _a.withReason)) {
|
|
4950
|
+
this.validateAllFormFields(this.formGroup);
|
|
4951
|
+
return [2 /*return*/];
|
|
4952
|
+
}
|
|
4953
|
+
reason = (_b = this.formGroup.get("reason")) === null || _b === void 0 ? void 0 : _b.value;
|
|
4954
|
+
this.loading = true;
|
|
4955
|
+
return [4 /*yield*/, this.cancelEventDialogConfig.cancelFunction(reason)];
|
|
4956
|
+
case 1:
|
|
4957
|
+
_c.sent();
|
|
4958
|
+
this.loading = false;
|
|
4959
|
+
this.ref.close(true);
|
|
4960
|
+
return [2 /*return*/];
|
|
4961
|
+
}
|
|
4962
|
+
});
|
|
4963
|
+
});
|
|
4964
|
+
};
|
|
4965
|
+
CancelEventDialogComponent.prototype.validateAllFormFields = function (formGroup) {
|
|
4966
|
+
var _this = this;
|
|
4967
|
+
Object.keys(formGroup.controls).forEach(function (field) {
|
|
4968
|
+
var control = formGroup.get(field);
|
|
4969
|
+
if (control instanceof forms.FormControl) {
|
|
4970
|
+
control.markAsDirty({ onlySelf: true });
|
|
4971
|
+
}
|
|
4972
|
+
if (control instanceof forms.FormGroup) {
|
|
4973
|
+
_this.validateAllFormFields(control);
|
|
4974
|
+
}
|
|
4975
|
+
});
|
|
4976
|
+
};
|
|
4977
|
+
CancelEventDialogComponent.prototype.handleCancelClick = function () {
|
|
4978
|
+
this.ref.close();
|
|
4979
|
+
};
|
|
4980
|
+
CancelEventDialogComponent.ctorParameters = function () { return [
|
|
4981
|
+
{ type: forms.FormBuilder },
|
|
4982
|
+
{ type: primeng.DynamicDialogConfig },
|
|
4983
|
+
{ type: primeng.DynamicDialogRef },
|
|
4984
|
+
{ type: LibTranslationService }
|
|
4985
|
+
]; };
|
|
4986
|
+
__decorate([
|
|
4987
|
+
core.Input()
|
|
4988
|
+
], CancelEventDialogComponent.prototype, "cancelEventDialogConfig", void 0);
|
|
4989
|
+
CancelEventDialogComponent = __decorate([
|
|
4990
|
+
core.Component({
|
|
4991
|
+
selector: "s-cancel-event-dialog",
|
|
4992
|
+
template: "<div class=\"content\" *sLoadingState=\"loading\">\r\n <div class=\"top\">\r\n <div *ngIf=\"cancelEventDialogConfig?.message\" class=\"message-container\">\r\n <span>{{ cancelEventDialogConfig?.message }}</span>\r\n </div>\r\n <div class=\"form-container\" *ngIf=\"cancelEventDialogConfig?.withReason\">\r\n <s-dynamic-form [fields]=\"formFields\" [form]=\"formGroup\" [errorMessages]=\"translations\">\r\n </s-dynamic-form>\r\n </div>\r\n </div>\r\n <div class=\"footer\">\r\n <s-button [priority]=\"priority.Secondary\" label=\"{{ 'agro.angular_components.no' | libTranslate }}\"\r\n (click)=\"handleCancelClick()\"></s-button>\r\n <s-button [priority]=\"priority.Primary\" label=\"{{ 'agro.angular_components.yes' | libTranslate }}\" (click)=\"handleConfirmClick()\"></s-button>\r\n </div>\r\n</div>\r\n",
|
|
4993
|
+
styles: [".message-container{padding:.5rem}.footer{display:-ms-flexbox;display:flex;width:100%;-ms-flex-direction:row;flex-direction:row;-ms-flex-pack:end;justify-content:flex-end;padding:.5rem}.content{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;height:100%;box-sizing:border-box}.content.loading{min-height:150px;display:-ms-flexbox;display:flex;width:100%}.content .top{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;-ms-flex-pack:justify;justify-content:space-between}@media screen and (max-width:760px){.content{-ms-flex-pack:justify;justify-content:space-between}.content .top{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;-ms-flex-pack:justify;justify-content:space-between}}"]
|
|
4994
|
+
})
|
|
4995
|
+
], CancelEventDialogComponent);
|
|
4996
|
+
return CancelEventDialogComponent;
|
|
4997
|
+
}());
|
|
4998
|
+
|
|
4999
|
+
var EventOperation;
|
|
5000
|
+
(function (EventOperation) {
|
|
4679
5001
|
EventOperation["PROVISIONAL"] = "PROVISIONAL";
|
|
4680
5002
|
EventOperation["EFFECTIVE"] = "EFFECTIVE";
|
|
4681
5003
|
EventOperation["TICKET"] = "TICKET";
|
|
@@ -5633,20 +5955,17 @@
|
|
|
5633
5955
|
return translatedErrorMessages;
|
|
5634
5956
|
};
|
|
5635
5957
|
EventControlBoardComponent.prototype.getProducerInvoiceIdFromParams = function (param) {
|
|
5636
|
-
var _a, _b, _c, _d;
|
|
5637
|
-
if (
|
|
5638
|
-
return
|
|
5639
|
-
}
|
|
5640
|
-
if ((_b = (_a = param === null || param === void 0 ? void 0 : param.invoice) === null || _a === void 0 ? void 0 : _a.generalData) === null || _b === void 0 ? void 0 : _b.transactionalId) {
|
|
5641
|
-
return (_d = (_c = param === null || param === void 0 ? void 0 : param.invoice) === null || _c === void 0 ? void 0 : _c.generalData) === null || _d === void 0 ? void 0 : _d.transactionalId;
|
|
5642
|
-
}
|
|
5643
|
-
if (param === null || param === void 0 ? void 0 : param.producerInvoiceId) {
|
|
5644
|
-
return param === null || param === void 0 ? void 0 : param.producerInvoiceId;
|
|
5645
|
-
}
|
|
5646
|
-
if (param === null || param === void 0 ? void 0 : param.externalId) {
|
|
5647
|
-
return param === null || param === void 0 ? void 0 : param.externalId;
|
|
5958
|
+
var _a, _b, _c, _d, _e;
|
|
5959
|
+
if (!param) {
|
|
5960
|
+
return null;
|
|
5648
5961
|
}
|
|
5649
|
-
return
|
|
5962
|
+
return (_e = [
|
|
5963
|
+
(_a = param.producerInvoiceIds) === null || _a === void 0 ? void 0 : _a[0],
|
|
5964
|
+
(_c = (_b = param.invoice) === null || _b === void 0 ? void 0 : _b.generalData) === null || _c === void 0 ? void 0 : _c.transactionalId,
|
|
5965
|
+
param.producerInvoiceId,
|
|
5966
|
+
param.externalId,
|
|
5967
|
+
(_d = param.externalInvoiceIds) === null || _d === void 0 ? void 0 : _d[0],
|
|
5968
|
+
].find(function (id) { return id; })) !== null && _e !== void 0 ? _e : null;
|
|
5650
5969
|
};
|
|
5651
5970
|
EventControlBoardComponent.prototype.getProducerBalanceEntryControlIdFromParams = function (param) {
|
|
5652
5971
|
var producerBalanceEntryControlId = param.producerBalanceEntryControlId;
|
|
@@ -5816,7 +6135,7 @@
|
|
|
5816
6135
|
EventControlBoardComponent = __decorate([
|
|
5817
6136
|
core.Component({
|
|
5818
6137
|
selector: "event-control-board",
|
|
5819
|
-
template: "<ng-container *sLoadingState=\"gridLoading\">\r\n <p-panel>\r\n <p-header>\r\n {{ \"agro.angular_components.event_control_header\" | libTranslate }}\r\n </p-header>\r\n <div class=\"ui-g\">\r\n <div class=\"ui-g-12\">\r\n <s-button\r\n id=\"refresh-button\"\r\n [priority]=\"ButtonPriority.Primary\"\r\n iconClass=\"fa fa-refresh\"\r\n [label]=\"'agro.angular_components.refresh' | libTranslate\"\r\n (click)=\"onSearch()\"\r\n >\r\n </s-button>\r\n <s-button\r\n *ngIf=\"standalone && showCancelButton\"\r\n id=\"cancel-button-agro-events-lib\"\r\n iconClass=\"fa fa-times\"\r\n [label]=\"'agro.angular_components.cancel' | libTranslate\"\r\n (click)=\"openCancelModal()\"\r\n >\r\n </s-button>\r\n </div>\r\n </div>\r\n <div class=\"ui-g\">\r\n <div class=\"ui-g-12 ui-md-12\" *ngIf=\"!gridData || gridData?.length === 0\">\r\n <s-empty-state\r\n iconClass=\"fa fa-exclamation-triangle\"\r\n title=\"{{ 'agro.angular_components.nothing_found' | libTranslate }}\"\r\n [showPrimaryAction]=\"false\"\r\n description=\"{{ 'agro.angular_components.table_empty_description' | libTranslate }}\"\r\n >\r\n </s-empty-state>\r\n </div>\r\n <ng-container *ngIf=\"gridData?.length > 0\">\r\n <p-table\r\n stylelass=\"custom-table\"\r\n #eventControlTable\r\n [value]=\"gridDataResolved\"\r\n [columns]=\"gridColumns\"\r\n dataKey=\"id\"\r\n [lazy]=\"true\"\r\n [scrollable]=\"true\"\r\n [resizableColumns]=\"true\"\r\n [paginator]=\"!standalone\"\r\n [totalRecords]=\"gridTotalRecords\"\r\n [rows]=\"10\"\r\n [responsive]=\"true\"\r\n (onLazyLoad)=\"onGridChange($event)\"\r\n [sortOrder]=\"getSortOrder()\"\r\n [first]=\"getRowIndex()\"\r\n [lazyLoadOnInit]=\"false\"\r\n sortMode=\"multiple\"\r\n [rows]=\"getPageSize()\"\r\n [rowsPerPageOptions]=\"[10, 20, 50, 100]\"\r\n >\r\n <ng-template pTemplate=\"header\" let-columns>\r\n <tr>\r\n <ng-container *ngIf=\"!standalone\">\r\n <th\r\n *ngFor=\"let col of columns\"\r\n class=\"ui-lg-1 ui-md-1\"\r\n [pSortableColumn]=\"col.field\"\r\n scope=\"col\"\r\n >\r\n <div class=\"senior-header\">\r\n <span class=\"senior-header-title\">{{\r\n col.header\r\n }}</span>\r\n <p-sortIcon [field]=\"col.field\"></p-sortIcon>\r\n </div>\r\n </th>\r\n </ng-container>\r\n <th class=\"ui-lg-8 ui-md-7\" scope=\"col\">\r\n {{ \"agro.angular_components.panel_title_events_events\" | libTranslate }}\r\n </th>\r\n </tr>\r\n </ng-template>\r\n <ng-template pTemplate=\"body\" let-rowData>\r\n <tr>\r\n <ng-container *ngIf=\"!standalone\">\r\n <td class=\"ui-lg-1 ui-md-1\">\r\n {{ rowData.e070emp?.nomEmp }}\r\n </td>\r\n <td class=\"ui-lg-1 ui-md-1\">\r\n {{ rowData.e070fil?.nomFil }}\r\n </td>\r\n <td class=\"ui-lg-1 ui-md-1\">\r\n <ng-container [ngSwitch]=\"rowData.eventOrigin\">\r\n <span *ngSwitchCase=\"'BALANCE_ENTRY_CONTROL'\">\r\n {{\r\n \"agro.angular_components.balance_entry_control_event\"\r\n | libTranslate\r\n }}\r\n </span>\r\n <span *ngSwitchCase=\"'TICKET'\">\r\n {{\r\n \"agro.angular_components.ticket_maintenance_header\"\r\n | libTranslate\r\n }}\r\n </span>\r\n <span *ngSwitchCase=\"'TRANSFER'\">\r\n {{\r\n \"agro.angular_components.transfer_origin_event\"\r\n | libTranslate\r\n }}\r\n </span>\r\n <span *ngSwitchCase=\"'INVOICE'\">\r\n {{\r\n \"agro.angular_components.invoice_creating_event\"\r\n | libTranslate\r\n }}\r\n </span>\r\n <span *ngSwitchCase=\"'CHANGE_REQUEST'\">\r\n {{\r\n \"agro.angular_components.change_request_event\"\r\n | libTranslate\r\n }}\r\n </span>\r\n <span *ngSwitchCase=\"'FIXATION'\">\r\n {{\r\n \"agro.angular_components.fixation_event\"\r\n | libTranslate\r\n }}\r\n </span>\r\n <span *ngSwitchCase=\"'CANCEL_FIXATION'\">\r\n {{\r\n \"agro.angular_components.cancel_fixation_event\"\r\n | libTranslate\r\n }}\r\n </span>\r\n <span *ngSwitchCase=\"'TRANSFER_CANCELLATION'\">\r\n {{\r\n \"agro.angular_components.transfer_cancellation_event\"\r\n | libTranslate\r\n }}\r\n </span>\r\n </ng-container>\r\n </td>\r\n <td class=\"ui-lg-1 ui ui-md-1\">\r\n {{ rowData.controlCode || \"\" }}\r\n </td>\r\n </ng-container>\r\n <td class=\"ui-lg-8 ui-md-7\">\r\n <ng-container *ngFor=\"let group of rowData.groups\">\r\n <s-event-steps\r\n [steps]=\"group.steps || []\"\r\n [activeIndex]=\"group.activeIndex\"\r\n (stepSelected)=\"stepSelected($event)\"\r\n >\r\n </s-event-steps>\r\n </ng-container>\r\n </td>\r\n </tr>\r\n </ng-template>\r\n <ng-template\r\n *ngIf=\"!standalone\"\r\n pTemplate=\"paginatorright\"\r\n class=\"custom-table\"\r\n >\r\n <span>\r\n {{\r\n \"agro.angular_components.registers_found\"\r\n | libTranslate : { total: gridTotalRecords }\r\n }}\r\n </span>\r\n </ng-template>\r\n </p-table>\r\n </ng-container>\r\n </div>\r\n </p-panel>\r\n</ng-container>\r\n<s-sidebar [visible]=\"showSidebar\" (visibleChange)=\"closeSidebar()\" header=\"{{ 'agro.angular_components.event_details_header' | libTranslate }}\">\r\n <div class=\"ui-fluid\">\r\n <p-fieldset [legend]=\"sidebarTitle\" [toggleable]=\"false\">\r\n <div class=\"ui-g\">\r\n <div class=\"ui-g-4\">\r\n <span\r\n ><strong>{{\r\n \"agro.angular_components.event_origin_label\" | libTranslate\r\n }}</strong></span\r\n >\r\n <ng-container [ngSwitch]=\"selectedStep?.eventType\">\r\n <p *ngSwitchCase=\"'BALANCE_ENTRY_CONTROL'\">\r\n {{ \"agro.angular_components.balance_entry_control_event\" | libTranslate }}\r\n </p>\r\n <p *ngSwitchCase=\"'TICKET'\">\r\n {{ \"agro.angular_components.ticket_maintenance_header\" | libTranslate }}\r\n </p>\r\n <p *ngSwitchCase=\"'TRANSFER'\">\r\n {{ \"agro.angular_components.transfer_origin_event\" | libTranslate }}\r\n </p>\r\n <p *ngSwitchCase=\"'INVOICE'\">\r\n {{ \"agro.angular_components.invoice_creating_event\" | libTranslate }}\r\n </p>\r\n <p *ngSwitchCase=\"'CHANGE_REQUEST'\">\r\n {{ \"agro.angular_components.change_request_event\" | libTranslate }}\r\n </p>\r\n <p *ngSwitchCase=\"'FIXATION'\">\r\n {{ \"agro.angular_components.fixation_event\" | libTranslate }}\r\n </p>\r\n <p *ngSwitchCase=\"'CANCEL_FIXATION'\">\r\n {{ \"agro.angular_components.cancel_fixation_event\" | libTranslate }}\r\n </p>\r\n <p *ngSwitchCase=\"'TRANSFER_CANCELLATION'\">\r\n {{ \"agro.angular_components.transfer_cancellation_event\" | libTranslate }}\r\n </p>\r\n </ng-container>\r\n </div>\r\n <div class=\"ui-g-4\" *ngIf=\"producerInvoice?.producerBalanceEntryControl.producer.e001pes.nomPes\">\r\n <span\r\n ><strong>{{ \"agro.angular_components.supplier\" | libTranslate }}</strong></span\r\n >\r\n <p>{{ producerInvoice?.producerBalanceEntryControl.producer.e001pes.nomPes }}</p>\r\n </div>\r\n <div class=\"ui-g-4\" *ngIf=\"producerInvoice?.producerBalanceEntryControl.ruralEstate.name\">\r\n <span\r\n ><strong>{{ \"agro.angular_components.rural_estate\" | libTranslate }}</strong></span\r\n >\r\n <p>{{ producerInvoice?.producerBalanceEntryControl.ruralEstate.name }}</p>\r\n </div>\r\n <div class=\"ui-g-4\" *ngIf=\"selectedStep?.controlCode\">\r\n <span\r\n ><strong>{{ \"agro.angular_components.control_code\" | libTranslate }}</strong></span\r\n >\r\n <p>{{ selectedStep?.controlCode }}</p>\r\n </div>\r\n <div class=\"ui-g-4\">\r\n <span\r\n ><strong>{{ \"agro.angular_components.status_label\" | libTranslate }}</strong></span\r\n >\r\n <ng-container [ngSwitch]=\"selectedStep?.item.status\">\r\n <p *ngSwitchCase=\"'SUCCESS'\">\r\n <s-badge\r\n [color]=\"BadgeColors.Green\"\r\n text=\"{{\r\n 'agro.angular_components.panel_title_events_completed_successfully'\r\n | libTranslate\r\n }}\"\r\n [selectable]=\"false\"\r\n >\r\n </s-badge>\r\n </p>\r\n <p *ngSwitchCase=\"'PROCESSING'\">\r\n <s-badge\r\n [color]=\"BadgeColors.Orange\"\r\n text=\"{{ 'agro.angular_components.processing' | libTranslate }}\"\r\n [selectable]=\"false\"\r\n >\r\n </s-badge>\r\n </p>\r\n <p *ngSwitchCase=\"'FAILED'\">\r\n <s-badge\r\n [color]=\"BadgeColors.Red\"\r\n text=\"{{\r\n 'agro.angular_components.panel_title_events_ended_with_error'\r\n | libTranslate\r\n }}\"\r\n [selectable]=\"false\"\r\n >\r\n </s-badge>\r\n </p>\r\n <p *ngSwitchCase=\"'PENDING'\">\r\n <s-badge\r\n [color]=\"BadgeColors.Gray\"\r\n text=\"{{ 'agro.angular_components.pending' | libTranslate }}\"\r\n [selectable]=\"false\"\r\n >\r\n </s-badge>\r\n </p>\r\n </ng-container>\r\n </div>\r\n <div class=\"ui-g-4\">\r\n <span\r\n ><strong>{{\r\n \"agro.angular_components.last_update_date\" | libTranslate\r\n }}</strong></span\r\n >\r\n <p>{{ selectedStep?.item.lastModifiedDate | date : \"dd/MM/yyyy HH:mm:ss\" }}</p>\r\n </div>\r\n <div class=\"ui-g-4\" *ngIf=\"selectedStep?.item.status === 'FAILED'\">\r\n <span\r\n ><strong>{{\r\n \"agro.angular_components.event_error_message\" | libTranslate\r\n }}</strong></span\r\n >\r\n <p>{{ selectedStep?.item.message || \"-\" }}</p>\r\n </div>\r\n </div>\r\n </p-fieldset>\r\n </div>\r\n <s-footer>\r\n <div class=\"ui-g\">\r\n <div class=\"ui-g-12 width-fit\">\r\n <s-button\r\n id=\"sidebar-close-button\"\r\n [priority]=\"ButtonPriority.Primary\"\r\n [label]=\"'agro.angular_components.events_close' | libTranslate\"\r\n [auxiliary]=\"false\"\r\n (click)=\"closeSidebar()\"\r\n >\r\n </s-button>\r\n <s-button\r\n *ngIf=\"showReprocessButton\"\r\n id=\"sidebar-reprocess-button\"\r\n [priority]=\"ButtonPriority.Secondary\"\r\n iconClass=\"fa fa-refresh\"\r\n [label]=\"'agro.angular_components.reprocess_event' | libTranslate\"\r\n [auxiliary]=\"false\"\r\n (click)=\"openModal()\"\r\n >\r\n </s-button>\r\n </div>\r\n </div>\r\n </s-footer>\r\n</s-sidebar>\r\n\r\n<p-dialog [header]=\"'agro.angular_components.event_modal_title' | libTranslate\" [(visible)]=\"displayModal\" [modal]=\"true\" class=\"dialog\">\r\n <div class=\"event-modal-text\">{{ \"agro.angular_components.event_modal\" | libTranslate }}</div>\r\n <p-footer>\r\n <div class=\"ui-dialog-buttonpane ui-widget-content ui-helper-clearfix\">\r\n <button\r\n id=\"modal-yes\"\r\n type=\"button\"\r\n pButton\r\n icon=\"fa fa-check\"\r\n (click)=\"confirmModal()\"\r\n label=\"{{ 'agro.angular_components.yes' | libTranslate }}\"\r\n class=\"ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only\"\r\n ></button>\r\n <button\r\n id=\"modal-no\"\r\n type=\"button\"\r\n pButton\r\n icon=\"fa fa-close\"\r\n (click)=\"cancelModal()\"\r\n label=\"{{ 'agro.angular_components.no' | libTranslate }}\"\r\n class=\"ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only\"\r\n ></button>\r\n </div>\r\n </p-footer>\r\n</p-dialog>\r\n",
|
|
6138
|
+
template: "<ng-container *sLoadingState=\"gridLoading\">\r\n <p-panel>\r\n <p-header>\r\n {{ \"agro.angular_components.event_control_header\" | libTranslate }}\r\n </p-header>\r\n <div class=\"ui-g\">\r\n <div class=\"ui-g-12\">\r\n <s-button\r\n id=\"refresh-button\"\r\n [priority]=\"ButtonPriority.Primary\"\r\n iconClass=\"fa fa-refresh\"\r\n [label]=\"'agro.angular_components.refresh' | libTranslate\"\r\n (click)=\"onSearch()\"\r\n >\r\n </s-button>\r\n <s-button\r\n *ngIf=\"standalone && showCancelButton\"\r\n id=\"cancel-button-agro-events-lib\"\r\n iconClass=\"fa fa-times\"\r\n [label]=\"'agro.angular_components.cancel' | libTranslate\"\r\n (click)=\"openCancelModal()\"\r\n >\r\n </s-button>\r\n </div>\r\n </div>\r\n <div class=\"ui-g\">\r\n <div class=\"ui-g-12 ui-md-12\" *ngIf=\"!gridData || gridData?.length === 0\">\r\n <s-empty-state\r\n iconClass=\"fa fa-exclamation-triangle\"\r\n title=\"{{ 'agro.angular_components.nothing_found' | libTranslate }}\"\r\n [showPrimaryAction]=\"false\"\r\n description=\"{{ 'agro.angular_components.table_empty_description' | libTranslate }}\"\r\n >\r\n </s-empty-state>\r\n </div>\r\n <ng-container *ngIf=\"gridData?.length > 0\">\r\n <p-table\r\n stylelass=\"custom-table\"\r\n #eventControlTable\r\n [value]=\"gridDataResolved\"\r\n [columns]=\"gridColumns\"\r\n dataKey=\"id\"\r\n [lazy]=\"true\"\r\n [scrollable]=\"true\"\r\n [resizableColumns]=\"true\"\r\n [paginator]=\"!standalone\"\r\n [totalRecords]=\"gridTotalRecords\"\r\n [rows]=\"10\"\r\n [responsive]=\"true\"\r\n (onLazyLoad)=\"onGridChange($event)\"\r\n [sortOrder]=\"getSortOrder()\"\r\n [first]=\"getRowIndex()\"\r\n [lazyLoadOnInit]=\"false\"\r\n sortMode=\"multiple\"\r\n [rows]=\"getPageSize()\"\r\n [rowsPerPageOptions]=\"[10, 20, 50, 100]\"\r\n >\r\n <ng-template pTemplate=\"header\" let-columns>\r\n <tr>\r\n <ng-container *ngIf=\"!standalone\">\r\n <th *ngFor=\"let col of columns\" class=\"ui-lg-1 ui-md-1\" [pSortableColumn]=\"col.field\" scope=\"col\">\r\n <div class=\"senior-header\">\r\n <span class=\"senior-header-title\">{{ col.header }}</span>\r\n <p-sortIcon [field]=\"col.field\"></p-sortIcon>\r\n </div>\r\n </th>\r\n </ng-container>\r\n <th class=\"ui-lg-8 ui-md-7\" scope=\"col\">\r\n {{ \"agro.angular_components.panel_title_events_events\" | libTranslate }}\r\n </th>\r\n </tr>\r\n </ng-template>\r\n <ng-template pTemplate=\"body\" let-rowData>\r\n <tr>\r\n <ng-container *ngIf=\"!standalone\">\r\n <td class=\"ui-lg-1 ui-md-1\">\r\n {{ rowData.e070emp?.nomEmp }}\r\n </td>\r\n <td class=\"ui-lg-1 ui-md-1\">\r\n {{ rowData.e070fil?.nomFil }}\r\n </td>\r\n <td class=\"ui-lg-1 ui-md-1\">\r\n <ng-container [ngSwitch]=\"rowData.eventOrigin\">\r\n <span *ngSwitchCase=\"'BALANCE_ENTRY_CONTROL'\">\r\n {{ \"agro.angular_components.balance_entry_control_event\" | libTranslate }}\r\n </span>\r\n <span *ngSwitchCase=\"'TICKET'\">\r\n {{ \"agro.angular_components.ticket_maintenance_header\" | libTranslate }}\r\n </span>\r\n <span *ngSwitchCase=\"'TRANSFER'\">\r\n {{ \"agro.angular_components.transfer_origin_event\" | libTranslate }}\r\n </span>\r\n <span *ngSwitchCase=\"'INVOICE'\">\r\n {{ \"agro.angular_components.invoice_creating_event\" | libTranslate }}\r\n </span>\r\n <span *ngSwitchCase=\"'CHANGE_REQUEST'\">\r\n {{ \"agro.angular_components.change_request_event\" | libTranslate }}\r\n </span>\r\n <span *ngSwitchCase=\"'FIXATION'\">\r\n {{ \"agro.angular_components.fixation_event\" | libTranslate }}\r\n </span>\r\n <span *ngSwitchCase=\"'CANCEL_FIXATION'\">\r\n {{ \"agro.angular_components.cancel_fixation_event\" | libTranslate }}\r\n </span>\r\n <span *ngSwitchCase=\"'TRANSFER_CANCELLATION'\">\r\n {{ \"agro.angular_components.transfer_cancellation_event\" | libTranslate }}\r\n </span>\r\n <span *ngSwitchCase=\"'AGRONOMIC_PRESCRIPTION'\">\r\n {{ \"agro.angular_components.agronomic_prescription_origin_event\" | libTranslate }}\r\n </span>\r\n <span *ngSwitchCase=\"'PRESCRIPTION_INTEGRATION_HUB'\">\r\n {{ \"agro.angular_components.agronomic_prescription_origin_event\" | libTranslate }}\r\n </span>\r\n </ng-container>\r\n </td>\r\n <td class=\"ui-lg-1 ui ui-md-1\">\r\n {{ rowData.controlCode || \"\" }}\r\n </td>\r\n </ng-container>\r\n <td class=\"ui-lg-8 ui-md-7\">\r\n <ng-container *ngFor=\"let group of rowData.groups\">\r\n <s-event-steps\r\n [steps]=\"group.steps || []\"\r\n [activeIndex]=\"group.activeIndex\"\r\n (stepSelected)=\"stepSelected($event)\"\r\n >\r\n </s-event-steps>\r\n </ng-container>\r\n </td>\r\n </tr>\r\n </ng-template>\r\n <ng-template *ngIf=\"!standalone\" pTemplate=\"paginatorright\" class=\"custom-table\">\r\n <span>\r\n {{ \"agro.angular_components.registers_found\" | libTranslate: { total: gridTotalRecords } }}\r\n </span>\r\n </ng-template>\r\n </p-table>\r\n </ng-container>\r\n </div>\r\n </p-panel>\r\n</ng-container>\r\n<s-sidebar\r\n [visible]=\"showSidebar\"\r\n (visibleChange)=\"closeSidebar()\"\r\n header=\"{{ 'agro.angular_components.event_details_header' | libTranslate }}\"\r\n>\r\n <div class=\"ui-fluid\">\r\n <p-fieldset [legend]=\"sidebarTitle\" [toggleable]=\"false\">\r\n <div class=\"ui-g\">\r\n <div class=\"ui-g-4\">\r\n <span\r\n ><strong>{{ \"agro.angular_components.event_origin_label\" | libTranslate }}</strong></span\r\n >\r\n <ng-container [ngSwitch]=\"selectedStep?.eventType\">\r\n <p *ngSwitchCase=\"'BALANCE_ENTRY_CONTROL'\">\r\n {{ \"agro.angular_components.balance_entry_control_event\" | libTranslate }}\r\n </p>\r\n <p *ngSwitchCase=\"'TICKET'\">\r\n {{ \"agro.angular_components.ticket_maintenance_header\" | libTranslate }}\r\n </p>\r\n <p *ngSwitchCase=\"'TRANSFER'\">\r\n {{ \"agro.angular_components.transfer_origin_event\" | libTranslate }}\r\n </p>\r\n <p *ngSwitchCase=\"'INVOICE'\">\r\n {{ \"agro.angular_components.invoice_creating_event\" | libTranslate }}\r\n </p>\r\n <p *ngSwitchCase=\"'CHANGE_REQUEST'\">\r\n {{ \"agro.angular_components.change_request_event\" | libTranslate }}\r\n </p>\r\n <p *ngSwitchCase=\"'FIXATION'\">\r\n {{ \"agro.angular_components.fixation_event\" | libTranslate }}\r\n </p>\r\n <p *ngSwitchCase=\"'CANCEL_FIXATION'\">\r\n {{ \"agro.angular_components.cancel_fixation_event\" | libTranslate }}\r\n </p>\r\n <p *ngSwitchCase=\"'TRANSFER_CANCELLATION'\">\r\n {{ \"agro.angular_components.transfer_cancellation_event\" | libTranslate }}\r\n </p>\r\n <p *ngSwitchCase=\"'AGRONOMIC_PRESCRIPTION'\">\r\n {{ \"agro.angular_components.agronomic_prescription_origin_event\" | libTranslate }}\r\n </p>\r\n <p *ngSwitchCase=\"'PRESCRIPTION_INTEGRATION_HUB'\">\r\n {{ \"agro.angular_components.agronomic_prescription_origin_event\" | libTranslate }}\r\n </p>\r\n </ng-container>\r\n </div>\r\n <div class=\"ui-g-4\" *ngIf=\"producerInvoice?.producerBalanceEntryControl.producer.e001pes.nomPes\">\r\n <span\r\n ><strong>{{ \"agro.angular_components.supplier\" | libTranslate }}</strong></span\r\n >\r\n <p>{{ producerInvoice?.producerBalanceEntryControl.producer.e001pes.nomPes }}</p>\r\n </div>\r\n <div class=\"ui-g-4\" *ngIf=\"producerInvoice?.producerBalanceEntryControl.ruralEstate.name\">\r\n <span\r\n ><strong>{{ \"agro.angular_components.rural_estate\" | libTranslate }}</strong></span\r\n >\r\n <p>{{ producerInvoice?.producerBalanceEntryControl.ruralEstate.name }}</p>\r\n </div>\r\n <div class=\"ui-g-4\" *ngIf=\"selectedStep?.controlCode\">\r\n <span\r\n ><strong>{{ \"agro.angular_components.control_code\" | libTranslate }}</strong></span\r\n >\r\n <p>{{ selectedStep?.controlCode }}</p>\r\n </div>\r\n <div class=\"ui-g-4\">\r\n <span\r\n ><strong>{{ \"agro.angular_components.status_label\" | libTranslate }}</strong></span\r\n >\r\n <ng-container [ngSwitch]=\"selectedStep?.item.status\">\r\n <p *ngSwitchCase=\"'SUCCESS'\">\r\n <s-badge\r\n [color]=\"BadgeColors.Green\"\r\n text=\"{{ 'agro.angular_components.panel_title_events_completed_successfully' | libTranslate }}\"\r\n [selectable]=\"false\"\r\n >\r\n </s-badge>\r\n </p>\r\n <p *ngSwitchCase=\"'PROCESSING'\">\r\n <s-badge\r\n [color]=\"BadgeColors.Orange\"\r\n text=\"{{ 'agro.angular_components.processing' | libTranslate }}\"\r\n [selectable]=\"false\"\r\n >\r\n </s-badge>\r\n </p>\r\n <p *ngSwitchCase=\"'FAILED'\">\r\n <s-badge\r\n [color]=\"BadgeColors.Red\"\r\n text=\"{{ 'agro.angular_components.panel_title_events_ended_with_error' | libTranslate }}\"\r\n [selectable]=\"false\"\r\n >\r\n </s-badge>\r\n </p>\r\n <p *ngSwitchCase=\"'PENDING'\">\r\n <s-badge\r\n [color]=\"BadgeColors.Gray\"\r\n text=\"{{ 'agro.angular_components.pending' | libTranslate }}\"\r\n [selectable]=\"false\"\r\n >\r\n </s-badge>\r\n </p>\r\n </ng-container>\r\n </div>\r\n <div class=\"ui-g-4\">\r\n <span\r\n ><strong>{{ \"agro.angular_components.last_update_date\" | libTranslate }}</strong></span\r\n >\r\n <p>{{ selectedStep?.item.lastModifiedDate | date: \"dd/MM/yyyy HH:mm:ss\" }}</p>\r\n </div>\r\n <div class=\"ui-g-4\" *ngIf=\"selectedStep?.item.status === 'FAILED'\">\r\n <span\r\n ><strong>{{ \"agro.angular_components.event_error_message\" | libTranslate }}</strong></span\r\n >\r\n <p>{{ selectedStep?.item.message || \"-\" }}</p>\r\n </div>\r\n </div>\r\n </p-fieldset>\r\n </div>\r\n <s-footer>\r\n <div class=\"ui-g\">\r\n <div class=\"ui-g-12 width-fit\">\r\n <s-button\r\n id=\"sidebar-close-button\"\r\n [priority]=\"ButtonPriority.Primary\"\r\n [label]=\"'agro.angular_components.events_close' | libTranslate\"\r\n [auxiliary]=\"false\"\r\n (click)=\"closeSidebar()\"\r\n >\r\n </s-button>\r\n <s-button\r\n *ngIf=\"showReprocessButton\"\r\n id=\"sidebar-reprocess-button\"\r\n [priority]=\"ButtonPriority.Secondary\"\r\n iconClass=\"fa fa-refresh\"\r\n [label]=\"'agro.angular_components.reprocess_event' | libTranslate\"\r\n [auxiliary]=\"false\"\r\n (click)=\"openModal()\"\r\n >\r\n </s-button>\r\n </div>\r\n </div>\r\n </s-footer>\r\n</s-sidebar>\r\n\r\n<p-dialog [header]=\"'agro.angular_components.event_modal_title' | libTranslate\" [(visible)]=\"displayModal\" [modal]=\"true\" class=\"dialog\">\r\n <div class=\"event-modal-text\">{{ \"agro.angular_components.event_modal\" | libTranslate }}</div>\r\n <p-footer>\r\n <div class=\"ui-dialog-buttonpane ui-widget-content ui-helper-clearfix\">\r\n <button\r\n id=\"modal-yes\"\r\n type=\"button\"\r\n pButton\r\n icon=\"fa fa-check\"\r\n (click)=\"confirmModal()\"\r\n label=\"{{ 'agro.angular_components.yes' | libTranslate }}\"\r\n class=\"ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only\"\r\n ></button>\r\n <button\r\n id=\"modal-no\"\r\n type=\"button\"\r\n pButton\r\n icon=\"fa fa-close\"\r\n (click)=\"cancelModal()\"\r\n label=\"{{ 'agro.angular_components.no' | libTranslate }}\"\r\n class=\"ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only\"\r\n ></button>\r\n </div>\r\n </p-footer>\r\n</p-dialog>\r\n",
|
|
5820
6139
|
providers: [{ provide: core.LOCALE_ID, useValue: "pt-BR" }],
|
|
5821
6140
|
styles: [".frozen{border-left:2px solid #ddd}.dialog{width:\"600px\";height:\"300px\";z-index:100000}:host ::ng-deep #cancel-button-agro-events-lib{background-color:#9c3a3a!important;border-color:#9c3a3a!important}:host ::ng-deep #cancel-button-agro-events-lib:hover{background-color:#642525!important}"]
|
|
5822
6141
|
})
|
|
@@ -6590,33 +6909,8 @@
|
|
|
6590
6909
|
return TicketModule;
|
|
6591
6910
|
}());
|
|
6592
6911
|
|
|
6593
|
-
var
|
|
6594
|
-
function
|
|
6595
|
-
this.translateService = translateService;
|
|
6596
|
-
}
|
|
6597
|
-
LibTranslatePipe.prototype.transform = function (value) {
|
|
6598
|
-
var args = [];
|
|
6599
|
-
for (var _i = 1; _i < arguments.length; _i++) {
|
|
6600
|
-
args[_i - 1] = arguments[_i];
|
|
6601
|
-
}
|
|
6602
|
-
if (args.length > 0) {
|
|
6603
|
-
return this.translateService.instant(value, args[0]);
|
|
6604
|
-
}
|
|
6605
|
-
return this.translateService.instant(value);
|
|
6606
|
-
};
|
|
6607
|
-
LibTranslatePipe.ctorParameters = function () { return [
|
|
6608
|
-
{ type: LibTranslationService }
|
|
6609
|
-
]; };
|
|
6610
|
-
LibTranslatePipe = __decorate([
|
|
6611
|
-
core.Pipe({
|
|
6612
|
-
name: 'libTranslate'
|
|
6613
|
-
})
|
|
6614
|
-
], LibTranslatePipe);
|
|
6615
|
-
return LibTranslatePipe;
|
|
6616
|
-
}());
|
|
6617
|
-
|
|
6618
|
-
var LibTranslationModule = /** @class */ (function () {
|
|
6619
|
-
function LibTranslationModule() {
|
|
6912
|
+
var LibTranslationModule = /** @class */ (function () {
|
|
6913
|
+
function LibTranslationModule() {
|
|
6620
6914
|
}
|
|
6621
6915
|
LibTranslationModule = __decorate([
|
|
6622
6916
|
core.NgModule({
|
|
@@ -6626,6 +6920,7 @@
|
|
|
6626
6920
|
imports: [
|
|
6627
6921
|
common.CommonModule
|
|
6628
6922
|
],
|
|
6923
|
+
providers: [LibTranslationService],
|
|
6629
6924
|
exports: [
|
|
6630
6925
|
LibTranslatePipe
|
|
6631
6926
|
]
|
|
@@ -6734,200 +7029,442 @@
|
|
|
6734
7029
|
return EventControlBoardModule;
|
|
6735
7030
|
}());
|
|
6736
7031
|
|
|
6737
|
-
var
|
|
6738
|
-
function
|
|
7032
|
+
var AgroEntityService = /** @class */ (function () {
|
|
7033
|
+
function AgroEntityService(http, messageService, entityUrl, actionsUrl, queriesUrl, translate) {
|
|
7034
|
+
this.http = http;
|
|
7035
|
+
this.messageService = messageService;
|
|
7036
|
+
this.entityUrl = entityUrl;
|
|
7037
|
+
this.actionsUrl = actionsUrl;
|
|
7038
|
+
this.queriesUrl = queriesUrl;
|
|
7039
|
+
this.translate = translate;
|
|
7040
|
+
this.http = http;
|
|
7041
|
+
this.messageService = messageService;
|
|
7042
|
+
this.entityUrl = entityUrl;
|
|
7043
|
+
this.actionsUrl = actionsUrl;
|
|
7044
|
+
this.queriesUrl = queriesUrl;
|
|
7045
|
+
this.translate = translate;
|
|
7046
|
+
this.defaultCatch = this.defaultCatch.bind(this);
|
|
6739
7047
|
}
|
|
6740
|
-
|
|
6741
|
-
var
|
|
6742
|
-
|
|
6743
|
-
|
|
7048
|
+
AgroEntityService.prototype.getListQueryParams = function (listParams) {
|
|
7049
|
+
var ten = 10;
|
|
7050
|
+
var _a = listParams.page, page = _a === void 0 ? 0 : _a, _b = listParams.size, size = _b === void 0 ? ten : _b, _c = listParams.sort, sort = _c === void 0 ? [] : _c, _d = listParams.filterQuery, filterQuery = _d === void 0 ? "" : _d, _e = listParams.displayFields, displayFields = _e === void 0 ? [] : _e;
|
|
7051
|
+
var params = new http.HttpParams();
|
|
7052
|
+
params = params.append("size", String(size));
|
|
7053
|
+
params = params.append("offset", String(page));
|
|
7054
|
+
if (sort && sort.length) {
|
|
7055
|
+
params = params.append("orderby", sort.map(this.getBodyFilters()).join(", "));
|
|
6744
7056
|
}
|
|
6745
|
-
if (
|
|
6746
|
-
|
|
7057
|
+
if (filterQuery) {
|
|
7058
|
+
params = params.append("filter", filterQuery);
|
|
6747
7059
|
}
|
|
6748
|
-
if (
|
|
6749
|
-
|
|
7060
|
+
if (displayFields && displayFields.length) {
|
|
7061
|
+
params = params.append("displayfields", displayFields.join());
|
|
6750
7062
|
}
|
|
6751
|
-
|
|
6752
|
-
|
|
7063
|
+
return params;
|
|
7064
|
+
};
|
|
7065
|
+
AgroEntityService.prototype.getBodyParams = function (listParams) {
|
|
7066
|
+
var ten = 10;
|
|
7067
|
+
var _a = listParams.page, page = _a === void 0 ? 0 : _a, _b = listParams.size, size = _b === void 0 ? ten : _b, _c = listParams.sort, sort = _c === void 0 ? [] : _c, _d = listParams.filterQuery, filterQuery = _d === void 0 ? "" : _d, _e = listParams.displayFields, displayFields = _e === void 0 ? [] : _e;
|
|
7068
|
+
var bodyParams = {};
|
|
7069
|
+
bodyParams.size = size;
|
|
7070
|
+
bodyParams.offset = page;
|
|
7071
|
+
if (sort && sort.length) {
|
|
7072
|
+
bodyParams.orderBy = sort.map(this.getBodyFilters()).join(", ");
|
|
6753
7073
|
}
|
|
6754
|
-
if (
|
|
6755
|
-
|
|
7074
|
+
if (filterQuery) {
|
|
7075
|
+
bodyParams.filter = filterQuery;
|
|
6756
7076
|
}
|
|
6757
|
-
|
|
7077
|
+
if (displayFields && displayFields.length) {
|
|
7078
|
+
bodyParams.displayfields = displayFields.join();
|
|
7079
|
+
}
|
|
7080
|
+
return bodyParams;
|
|
6758
7081
|
};
|
|
6759
|
-
|
|
6760
|
-
|
|
6761
|
-
|
|
6762
|
-
|
|
6763
|
-
|
|
6764
|
-
return CnpjCpfPipe;
|
|
6765
|
-
}());
|
|
6766
|
-
|
|
6767
|
-
var CnpjCpfPipeModule = /** @class */ (function () {
|
|
6768
|
-
function CnpjCpfPipeModule() {
|
|
6769
|
-
}
|
|
6770
|
-
CnpjCpfPipeModule = __decorate([
|
|
6771
|
-
core.NgModule({
|
|
6772
|
-
declarations: [CnpjCpfPipe],
|
|
6773
|
-
imports: [common.CommonModule],
|
|
6774
|
-
exports: [CnpjCpfPipe],
|
|
6775
|
-
})
|
|
6776
|
-
], CnpjCpfPipeModule);
|
|
6777
|
-
return CnpjCpfPipeModule;
|
|
6778
|
-
}());
|
|
6779
|
-
|
|
6780
|
-
var AgroObjectStringifier = /** @class */ (function () {
|
|
6781
|
-
function AgroObjectStringifier() {
|
|
6782
|
-
}
|
|
6783
|
-
/**
|
|
6784
|
-
* Formata um objeto concatenando valores segundo as chaves e pipes informados.
|
|
6785
|
-
*
|
|
6786
|
-
* @param separator Separador entre os valores (ex: "-")
|
|
6787
|
-
* @param fields Campos a extrair. Podem conter subpropriedades ("propriedade.subPropriedade") e pipes ("propriedade|nomeDaPipe:arg1:arg2")
|
|
6788
|
-
* @param obj Objeto origem
|
|
6789
|
-
*/
|
|
6790
|
-
AgroObjectStringifier.formatObject = function (separator, fields, obj, usePipes) {
|
|
6791
|
-
function mapField(field) {
|
|
6792
|
-
var value = AgroObjectStringifier.resolvePath(obj, field);
|
|
6793
|
-
if (usePipes === null || usePipes === void 0 ? void 0 : usePipes.hasOwnProperty(field)) {
|
|
6794
|
-
return usePipes[field].transform(value);
|
|
7082
|
+
AgroEntityService.prototype.getBodyFilters = function () {
|
|
7083
|
+
return function (s) {
|
|
7084
|
+
var order = "";
|
|
7085
|
+
if (s.order === 1) {
|
|
7086
|
+
order = " asc";
|
|
6795
7087
|
}
|
|
6796
|
-
|
|
7088
|
+
if (s.order === -1) {
|
|
7089
|
+
order = " desc";
|
|
7090
|
+
}
|
|
7091
|
+
return "" + s.field + order;
|
|
7092
|
+
};
|
|
7093
|
+
};
|
|
7094
|
+
AgroEntityService.prototype.defaultCatch = function (errorMsgs) {
|
|
7095
|
+
var _this = this;
|
|
7096
|
+
if (errorMsgs === void 0) { errorMsgs = []; }
|
|
7097
|
+
var unauthorized_401 = 401;
|
|
7098
|
+
// errorMsgs = [...errorMsgs, ...DefaultErrorMessages];
|
|
7099
|
+
errorMsgs = __spread(errorMsgs);
|
|
7100
|
+
var zero = 0;
|
|
7101
|
+
return operators.catchError(function (err) {
|
|
7102
|
+
if (err) {
|
|
7103
|
+
var errorMessage = errorMsgs.find(function (eMsg) { return eMsg.status === (err === null || err === void 0 ? void 0 : err.status) || zero; });
|
|
7104
|
+
var summary = err.status ? String(err.status) : "Error";
|
|
7105
|
+
var detail = _this.getErrorMessage(err);
|
|
7106
|
+
if (err.status === unauthorized_401) {
|
|
7107
|
+
summary = _this.translate.instant("agro.angular_components.error_unauthorized_title");
|
|
7108
|
+
detail = _this.translate.instant("agro.angular_components.error_unauthorized_description");
|
|
7109
|
+
}
|
|
7110
|
+
if (errorMessage) {
|
|
7111
|
+
summary = errorMessage.summary ? _this.translate.instant(errorMessage.summary) : summary;
|
|
7112
|
+
detail = errorMessage.detail ? _this.translate.instant(errorMessage.detail) : detail;
|
|
7113
|
+
}
|
|
7114
|
+
_this.messageService.add({
|
|
7115
|
+
severity: "error",
|
|
7116
|
+
summary: summary,
|
|
7117
|
+
detail: detail,
|
|
7118
|
+
});
|
|
7119
|
+
}
|
|
7120
|
+
return rxjs.throwError(err);
|
|
7121
|
+
});
|
|
7122
|
+
};
|
|
7123
|
+
AgroEntityService.prototype.getErrorMessage = function (err) {
|
|
7124
|
+
if (err.error && err.error.message) {
|
|
7125
|
+
return err.error.message;
|
|
6797
7126
|
}
|
|
6798
|
-
|
|
6799
|
-
return
|
|
7127
|
+
if (err.statusText) {
|
|
7128
|
+
return err.statusText;
|
|
6800
7129
|
}
|
|
6801
|
-
|
|
6802
|
-
|
|
6803
|
-
/** Resolve um caminho tipo "empresa.cargo" dentro de um objeto */
|
|
6804
|
-
AgroObjectStringifier.resolvePath = function (obj, path) {
|
|
6805
|
-
function reducer(acc, key) {
|
|
6806
|
-
return acc === null || acc === void 0 ? void 0 : acc[key];
|
|
7130
|
+
if (err.message) {
|
|
7131
|
+
return err.message;
|
|
6807
7132
|
}
|
|
6808
|
-
return
|
|
7133
|
+
return "Error";
|
|
6809
7134
|
};
|
|
6810
|
-
|
|
6811
|
-
|
|
6812
|
-
|
|
6813
|
-
var StringifierPipe = /** @class */ (function () {
|
|
6814
|
-
function StringifierPipe() {
|
|
6815
|
-
}
|
|
6816
|
-
StringifierPipe.prototype.transform = function (value, separator, paths, pipes) {
|
|
6817
|
-
return AgroObjectStringifier.formatObject(separator, paths, value, pipes);
|
|
7135
|
+
AgroEntityService.prototype.list = function (listParams, errorMessage) {
|
|
7136
|
+
if (errorMessage === void 0) { errorMessage = []; }
|
|
7137
|
+
return this.http.get(this.entityUrl, { params: this.getListQueryParams(listParams) }).pipe(this.defaultCatch(errorMessage));
|
|
6818
7138
|
};
|
|
6819
|
-
|
|
6820
|
-
|
|
6821
|
-
|
|
6822
|
-
|
|
7139
|
+
AgroEntityService.prototype.get = function (id, errorMessage) {
|
|
7140
|
+
if (errorMessage === void 0) { errorMessage = []; }
|
|
7141
|
+
return this.http.get(this.entityUrl + "/" + id).pipe(this.defaultCatch(errorMessage));
|
|
7142
|
+
};
|
|
7143
|
+
AgroEntityService.prototype.insert = function (entity, errorMessage) {
|
|
7144
|
+
if (errorMessage === void 0) { errorMessage = []; }
|
|
7145
|
+
return this.http.post("" + this.entityUrl, entity).pipe(this.defaultCatch(errorMessage));
|
|
7146
|
+
};
|
|
7147
|
+
AgroEntityService.prototype.update = function (id, entity, errorMessage) {
|
|
7148
|
+
if (errorMessage === void 0) { errorMessage = []; }
|
|
7149
|
+
return this.http.put(this.entityUrl + "/" + id, entity).pipe(this.defaultCatch(errorMessage));
|
|
7150
|
+
};
|
|
7151
|
+
AgroEntityService.prototype.delete = function (id, errorMessage) {
|
|
7152
|
+
if (errorMessage === void 0) { errorMessage = []; }
|
|
7153
|
+
return this.http.delete(this.entityUrl + "/" + id).pipe(this.defaultCatch(errorMessage));
|
|
7154
|
+
};
|
|
7155
|
+
AgroEntityService.prototype.listCustomFilter = function (listParams, action, errorMessage) {
|
|
7156
|
+
if (errorMessage === void 0) { errorMessage = []; }
|
|
7157
|
+
return this.http.post(this.actionsUrl + "/" + action, this.getBodyParams(listParams)).pipe(this.defaultCatch(errorMessage));
|
|
7158
|
+
};
|
|
7159
|
+
return AgroEntityService;
|
|
6823
7160
|
}());
|
|
6824
7161
|
|
|
6825
|
-
var
|
|
6826
|
-
|
|
7162
|
+
var statusLookup;
|
|
7163
|
+
(function (statusLookup) {
|
|
7164
|
+
statusLookup["PENDING"] = "PENDING";
|
|
7165
|
+
statusLookup["FINISHED"] = "FINISHED";
|
|
7166
|
+
statusLookup["ERROR"] = "ERROR";
|
|
7167
|
+
})(statusLookup || (statusLookup = {}));
|
|
7168
|
+
var statusIntegration;
|
|
7169
|
+
(function (statusIntegration) {
|
|
7170
|
+
statusIntegration["SUCCESS"] = "SUCCESS";
|
|
7171
|
+
statusIntegration["IN_PROGRESS"] = "IN_PROGRESS";
|
|
7172
|
+
statusIntegration["ERROR"] = "ERROR";
|
|
7173
|
+
})(statusIntegration || (statusIntegration = {}));
|
|
7174
|
+
|
|
7175
|
+
var AgroInvoiceService = /** @class */ (function (_super) {
|
|
7176
|
+
__extends(AgroInvoiceService, _super);
|
|
7177
|
+
function AgroInvoiceService(http, messageService, translate) {
|
|
7178
|
+
var _this = _super.call(this, http, messageService, "agro/invoice/entities/invoice", "agro/invoice/actions", "agro/invoice/queries", translate) || this;
|
|
7179
|
+
_this.http = http;
|
|
7180
|
+
_this.messageService = messageService;
|
|
7181
|
+
_this.translate = translate;
|
|
7182
|
+
_this.pooling = new rxjs.Subject();
|
|
7183
|
+
return _this;
|
|
6827
7184
|
}
|
|
6828
|
-
|
|
6829
|
-
|
|
6830
|
-
|
|
6831
|
-
|
|
6832
|
-
|
|
6833
|
-
|
|
6834
|
-
|
|
6835
|
-
|
|
6836
|
-
|
|
7185
|
+
AgroInvoiceService.prototype.invoiceLookupFilter = function (data) {
|
|
7186
|
+
var _this = this;
|
|
7187
|
+
return this.http
|
|
7188
|
+
.post(this.queriesUrl + "/invoiceLookup", data)
|
|
7189
|
+
.pipe(operators.switchMap(function (res) { return _this.pollInvoiceResult(res.requestId); }));
|
|
7190
|
+
};
|
|
7191
|
+
AgroInvoiceService.prototype.cancelActivePooling = function () {
|
|
7192
|
+
this.pooling.next();
|
|
7193
|
+
};
|
|
7194
|
+
AgroInvoiceService.prototype.pollInvoiceResult = function (requestId) {
|
|
7195
|
+
var _this = this;
|
|
7196
|
+
var delays = Array.from({ length: 10 }, function (_, index) {
|
|
7197
|
+
if (index === 0)
|
|
7198
|
+
return 1000;
|
|
7199
|
+
return (index + 1) * 1000;
|
|
7200
|
+
});
|
|
7201
|
+
return rxjs.scheduled(delays, rxjs.asyncScheduler).pipe(operators.concatMap(function (delay) {
|
|
7202
|
+
return rxjs.timer(delay).pipe(operators.switchMap(function () { return _this.http.post(_this.queriesUrl + "/getInvoiceLookup", { requestId: requestId }); }), operators.tap(function (res) {
|
|
7203
|
+
if (res.status === statusLookup.ERROR) {
|
|
7204
|
+
throw new Error(res.message);
|
|
7205
|
+
}
|
|
7206
|
+
}));
|
|
7207
|
+
}), operators.scan(function (_, curr) { return curr; }, null), operators.filter(function (res) { return (res === null || res === void 0 ? void 0 : res.status) === statusLookup.FINISHED; }), operators.take(1), operators.defaultIfEmpty(null), operators.takeUntil(this.pooling));
|
|
7208
|
+
};
|
|
7209
|
+
AgroInvoiceService.ctorParameters = function () { return [
|
|
7210
|
+
{ type: http.HttpClient },
|
|
7211
|
+
{ type: api.MessageService },
|
|
7212
|
+
{ type: LibTranslationService }
|
|
7213
|
+
]; };
|
|
7214
|
+
AgroInvoiceService = __decorate([
|
|
7215
|
+
core.Injectable()
|
|
7216
|
+
], AgroInvoiceService);
|
|
7217
|
+
return AgroInvoiceService;
|
|
7218
|
+
}(AgroEntityService));
|
|
6837
7219
|
|
|
6838
|
-
var
|
|
6839
|
-
|
|
7220
|
+
var INVOICE_ITEMS = "invoiceItems.*";
|
|
7221
|
+
var ModalInvoicePjSelectorComponent = /** @class */ (function () {
|
|
7222
|
+
function ModalInvoicePjSelectorComponent(translate, invoiceService) {
|
|
7223
|
+
this.translate = translate;
|
|
7224
|
+
this.invoiceService = invoiceService;
|
|
7225
|
+
this.whenSelectInvoices = new core.EventEmitter();
|
|
7226
|
+
this.buttonPriority = angularComponents.ButtonPriority;
|
|
7227
|
+
this.gridColumns = [
|
|
7228
|
+
{ field: "number", header: this.translate.instant("agro.angular_components.number") },
|
|
7229
|
+
{ field: "series", header: this.translate.instant("agro.angular_components.series") },
|
|
7230
|
+
{ field: "invoiceItems", header: this.translate.instant("agro.angular_components.itens") },
|
|
7231
|
+
{ field: "quantity", header: this.translate.instant("agro.angular_components.quantity") },
|
|
7232
|
+
{ field: "issuanceDate", header: this.translate.instant("agro.angular_components.issuance_date") },
|
|
7233
|
+
];
|
|
7234
|
+
this.dontHaveAnyInvoice = false;
|
|
7235
|
+
this.gridLoading = true;
|
|
7236
|
+
this.gridTotalRecords = exports.AGRO_NUMBERS.ZERO;
|
|
7237
|
+
this.selected = [];
|
|
7238
|
+
this.unselectedIds = new Set();
|
|
7239
|
+
this.visible = false;
|
|
7240
|
+
this.searchValue = new forms.FormControl("", []);
|
|
7241
|
+
this.ngUnsubscribe = new rxjs.Subject();
|
|
7242
|
+
this.currentParams = {
|
|
7243
|
+
page: 0,
|
|
7244
|
+
size: 10,
|
|
7245
|
+
sort: [{ field: "issuanceDate", order: 1 }],
|
|
7246
|
+
displayFields: ["*", INVOICE_ITEMS, "issuanceDate"],
|
|
7247
|
+
filterQuery: "",
|
|
7248
|
+
};
|
|
6840
7249
|
}
|
|
6841
|
-
|
|
6842
|
-
|
|
6843
|
-
|
|
6844
|
-
* @param withDDI Define se deve forçar formatação com DDI (mesmo que não exista).
|
|
6845
|
-
*/
|
|
6846
|
-
TelephonePipe.prototype.transform = function (value, withDDI) {
|
|
6847
|
-
if (withDDI === void 0) { withDDI = false; }
|
|
6848
|
-
if (!value)
|
|
6849
|
-
return "";
|
|
6850
|
-
var digits = this.cleanDigits(value);
|
|
6851
|
-
if (!digits)
|
|
6852
|
-
return value.toString();
|
|
6853
|
-
var _a = this.extractParts(digits, withDDI), ddi = _a.ddi, ddd = _a.ddd, number = _a.number;
|
|
6854
|
-
return this.formatPhone(ddi, ddd, number, value.toString(), withDDI);
|
|
7250
|
+
ModalInvoicePjSelectorComponent.prototype.ngOnDestroy = function () {
|
|
7251
|
+
this.ngUnsubscribe.next();
|
|
7252
|
+
this.ngUnsubscribe.complete();
|
|
6855
7253
|
};
|
|
6856
|
-
|
|
6857
|
-
|
|
6858
|
-
return value.toString().replace(/\D+/g, "");
|
|
7254
|
+
ModalInvoicePjSelectorComponent.prototype.ngOnInit = function () {
|
|
7255
|
+
this.whenSearchValueChanges();
|
|
6859
7256
|
};
|
|
6860
|
-
|
|
6861
|
-
|
|
6862
|
-
|
|
6863
|
-
|
|
6864
|
-
|
|
7257
|
+
ModalInvoicePjSelectorComponent.prototype.whenSearchValueChanges = function () {
|
|
7258
|
+
var _this = this;
|
|
7259
|
+
this.searchValue.valueChanges
|
|
7260
|
+
.pipe(operators.takeUntil(this.ngUnsubscribe))
|
|
7261
|
+
.pipe(operators.debounceTime(exports.AGRO_NUMBERS.THREE_HUNDRED))
|
|
7262
|
+
.subscribe(function (value) {
|
|
7263
|
+
if (value) {
|
|
7264
|
+
_this.updateGridData({ first: 0, rows: 10, multiSortMeta: [{ field: "issuanceDate", order: 1 }] }, value);
|
|
7265
|
+
}
|
|
7266
|
+
else {
|
|
7267
|
+
_this.updateGridData({ first: 0, rows: 10, multiSortMeta: [{ field: "issuanceDate", order: 1 }] });
|
|
7268
|
+
}
|
|
7269
|
+
});
|
|
7270
|
+
};
|
|
7271
|
+
ModalInvoicePjSelectorComponent.prototype.tryToSearchAgain = function () {
|
|
7272
|
+
this.gridLoading = true;
|
|
7273
|
+
this.updateGridData({ first: 0, rows: 10, multiSortMeta: [{ field: "issuanceDate", order: 1 }] });
|
|
7274
|
+
};
|
|
7275
|
+
ModalInvoicePjSelectorComponent.prototype.open = function () {
|
|
7276
|
+
if (this.checkIfOptionsIsValid()) {
|
|
7277
|
+
this.visible = true;
|
|
7278
|
+
this.gridData = [];
|
|
7279
|
+
this.gridLoading = true;
|
|
7280
|
+
this.gridTotalRecords = 0;
|
|
7281
|
+
this.selected = [];
|
|
7282
|
+
this.unselectedIds.clear();
|
|
7283
|
+
this.currentParams = {
|
|
7284
|
+
page: 0,
|
|
7285
|
+
size: 10,
|
|
7286
|
+
sort: [],
|
|
7287
|
+
filterQuery: "",
|
|
7288
|
+
displayFields: ["*", INVOICE_ITEMS],
|
|
7289
|
+
};
|
|
7290
|
+
this.updateGridData({ first: 0, rows: 10, multiSortMeta: [{ field: "issuanceDate", order: 1 }] });
|
|
7291
|
+
this.selected = [];
|
|
6865
7292
|
}
|
|
6866
|
-
|
|
6867
|
-
|
|
7293
|
+
};
|
|
7294
|
+
ModalInvoicePjSelectorComponent.prototype.checkIfOptionsIsValid = function () {
|
|
7295
|
+
if (!this.options) {
|
|
7296
|
+
return false;
|
|
6868
7297
|
}
|
|
6869
|
-
if (
|
|
6870
|
-
return
|
|
7298
|
+
if (!this.options.companyId || !this.options.branchId) {
|
|
7299
|
+
return false;
|
|
6871
7300
|
}
|
|
6872
|
-
return
|
|
7301
|
+
return true;
|
|
6873
7302
|
};
|
|
6874
|
-
|
|
6875
|
-
|
|
6876
|
-
var
|
|
6877
|
-
|
|
6878
|
-
|
|
7303
|
+
ModalInvoicePjSelectorComponent.prototype.updateGridData = function (event, searchValue) {
|
|
7304
|
+
var _this = this;
|
|
7305
|
+
var _a;
|
|
7306
|
+
this.cancelPooling();
|
|
7307
|
+
var companyId = this.options.companyId;
|
|
7308
|
+
var branchId = this.options.branchId;
|
|
7309
|
+
var producerId = this.options.producersIds[0];
|
|
7310
|
+
var ruralEstateId = this.options.ruralEstateIds[0];
|
|
7311
|
+
var size = event.rows;
|
|
7312
|
+
var page = event.first / size;
|
|
7313
|
+
var sizePage = event.rows;
|
|
7314
|
+
this.currentParams = {
|
|
7315
|
+
page: page,
|
|
7316
|
+
size: size,
|
|
7317
|
+
sort: ((_a = event.multiSortMeta) === null || _a === void 0 ? void 0 : _a.length) ? event.multiSortMeta : [{ field: "issuanceDate", order: 1 }],
|
|
7318
|
+
displayFields: ["*", INVOICE_ITEMS, "issuanceDate"],
|
|
7319
|
+
};
|
|
7320
|
+
this.gridLoading = true;
|
|
7321
|
+
this.dontHaveAnyInvoice = false;
|
|
7322
|
+
var filterBody = {
|
|
7323
|
+
filter: {
|
|
7324
|
+
companyId: companyId,
|
|
7325
|
+
branchId: branchId,
|
|
7326
|
+
producerIds: [producerId],
|
|
7327
|
+
ruralEstateIds: [ruralEstateId],
|
|
7328
|
+
multiProducts: false,
|
|
7329
|
+
productId: this.options.productId,
|
|
7330
|
+
},
|
|
7331
|
+
pageRequest: {
|
|
7332
|
+
offset: page,
|
|
7333
|
+
size: sizePage,
|
|
7334
|
+
orderBy: this.currentParams.sort.map(function (sort) { return ({ field: sort.field, order: sort.order === 1 ? "asc" : "desc" }); }),
|
|
7335
|
+
},
|
|
7336
|
+
};
|
|
7337
|
+
this.invoiceService
|
|
7338
|
+
.invoiceLookupFilter(filterBody)
|
|
7339
|
+
.pipe(operators.takeUntil(this.ngUnsubscribe), operators.finalize(function () {
|
|
7340
|
+
_this.gridLoading = false;
|
|
7341
|
+
}))
|
|
7342
|
+
.subscribe(function (result) {
|
|
7343
|
+
var _a;
|
|
7344
|
+
_this.gridData = ((_a = result === null || result === void 0 ? void 0 : result.result) === null || _a === void 0 ? void 0 : _a.invoices) || [];
|
|
7345
|
+
if (_this.gridData.length === 0 && !searchValue) {
|
|
7346
|
+
_this.dontHaveAnyInvoice = true;
|
|
7347
|
+
}
|
|
7348
|
+
_this.gridTotalRecords = result.result.totalElements;
|
|
7349
|
+
}, function (error) {
|
|
7350
|
+
console.info("Erro ao buscar notas fiscais: ", error);
|
|
7351
|
+
}, function () {
|
|
7352
|
+
_this.gridLoading = false;
|
|
7353
|
+
});
|
|
6879
7354
|
};
|
|
6880
|
-
|
|
6881
|
-
|
|
6882
|
-
var len = digits.length;
|
|
6883
|
-
var ddiLen = 1;
|
|
6884
|
-
if (len >= 14)
|
|
6885
|
-
ddiLen = 3;
|
|
6886
|
-
else if (len >= 12)
|
|
6887
|
-
ddiLen = 2;
|
|
6888
|
-
var ddi = digits.slice(0, ddiLen);
|
|
6889
|
-
var ddd = digits.slice(ddiLen, ddiLen + 2);
|
|
6890
|
-
var number = digits.slice(ddiLen + 2);
|
|
6891
|
-
return { ddi: ddi, ddd: ddd, number: number };
|
|
7355
|
+
ModalInvoicePjSelectorComponent.prototype.cancelPooling = function () {
|
|
7356
|
+
this.invoiceService.cancelActivePooling();
|
|
6892
7357
|
};
|
|
6893
|
-
|
|
6894
|
-
|
|
6895
|
-
|
|
6896
|
-
|
|
6897
|
-
|
|
6898
|
-
|
|
6899
|
-
|
|
6900
|
-
|
|
6901
|
-
|
|
6902
|
-
|
|
6903
|
-
|
|
7358
|
+
ModalInvoicePjSelectorComponent.prototype.add = function () {
|
|
7359
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
7360
|
+
return __generator(this, function (_a) {
|
|
7361
|
+
try {
|
|
7362
|
+
this.whenSelectInvoices.emit(this.selected);
|
|
7363
|
+
this.resetSpecs();
|
|
7364
|
+
}
|
|
7365
|
+
catch (error) {
|
|
7366
|
+
return [2 /*return*/, null];
|
|
7367
|
+
}
|
|
7368
|
+
return [2 /*return*/];
|
|
7369
|
+
});
|
|
7370
|
+
});
|
|
6904
7371
|
};
|
|
6905
|
-
|
|
6906
|
-
|
|
6907
|
-
|
|
6908
|
-
|
|
6909
|
-
|
|
6910
|
-
|
|
6911
|
-
|
|
6912
|
-
return number;
|
|
7372
|
+
ModalInvoicePjSelectorComponent.prototype.resetSpecs = function () {
|
|
7373
|
+
this.selected = [];
|
|
7374
|
+
this.dontHaveAnyInvoice = false;
|
|
7375
|
+
this.visible = false;
|
|
7376
|
+
this.gridData = [];
|
|
7377
|
+
this.gridLoading = false;
|
|
7378
|
+
this.gridTotalRecords = 0;
|
|
6913
7379
|
};
|
|
6914
|
-
|
|
6915
|
-
|
|
6916
|
-
|
|
6917
|
-
|
|
7380
|
+
ModalInvoicePjSelectorComponent.prototype.cancel = function () {
|
|
7381
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
7382
|
+
return __generator(this, function (_a) {
|
|
7383
|
+
this.resetSpecs();
|
|
7384
|
+
return [2 /*return*/];
|
|
7385
|
+
});
|
|
7386
|
+
});
|
|
7387
|
+
};
|
|
7388
|
+
ModalInvoicePjSelectorComponent.prototype.getItemsQuantity = function (row) {
|
|
7389
|
+
var _a;
|
|
7390
|
+
return ((_a = row.invoiceItems) === null || _a === void 0 ? void 0 : _a.reduce(function (sum, item) { return sum + (item.quantity || 0); }, 0)) || 0;
|
|
7391
|
+
};
|
|
7392
|
+
ModalInvoicePjSelectorComponent.ctorParameters = function () { return [
|
|
7393
|
+
{ type: LibTranslationService },
|
|
7394
|
+
{ type: AgroInvoiceService }
|
|
7395
|
+
]; };
|
|
7396
|
+
__decorate([
|
|
7397
|
+
core.Input()
|
|
7398
|
+
], ModalInvoicePjSelectorComponent.prototype, "options", void 0);
|
|
7399
|
+
__decorate([
|
|
7400
|
+
core.Output()
|
|
7401
|
+
], ModalInvoicePjSelectorComponent.prototype, "whenSelectInvoices", void 0);
|
|
7402
|
+
ModalInvoicePjSelectorComponent = __decorate([
|
|
7403
|
+
core.Component({
|
|
7404
|
+
selector: "s-modal-invoice-pj-selector",
|
|
7405
|
+
template: "<p-dialog\r\n header=\"{{ 'agro.angular_components.panel_title_external_invoice_add_external_invoice' | libTranslate }}\"\r\n [(visible)]=\"visible\"\r\n [modal]=\"true\"\r\n class=\"add-invoice-modal\"\r\n [closeOnEscape]=\"false\"\r\n (onHide)=\"cancelPooling()\"\r\n [dismissableMask]=\"false\"\r\n>\r\n <ng-container *ngIf=\"!dontHaveAnyInvoice\">\r\n <div class=\"ui-g\">\r\n <label for=\"invoiceSearchInput\">{{ \"agro.angular_components.number_or_series\" | libTranslate }}</label>\r\n <input\r\n type=\"text\"\r\n id=\"invoiceSearchInput\"\r\n pInputText\r\n [formControl]=\"searchValue\"\r\n [placeholder]=\"'' | libTranslate\"\r\n [required]=\"false\"\r\n />\r\n <div class=\"ui-g-12\">\r\n <p-table\r\n [(selection)]=\"selected\"\r\n [value]=\"gridData\"\r\n [columns]=\"gridColumns\"\r\n [scrollable]=\"true\"\r\n dataKey=\"id\"\r\n [rows]=\"10\"\r\n [paginator]=\"true\"\r\n [lazyLoadOnInit]=\"false\"\r\n [totalRecords]=\"gridTotalRecords\"\r\n [lazy]=\"true\"\r\n (onLazyLoad)=\"updateGridData($event)\"\r\n [resizableColumns]=\"true\"\r\n *sLoadingState=\"gridLoading\"\r\n sortMode=\"multiple\"\r\n [selectionMode]=\"'multiple'\"\r\n >\r\n <ng-template pTemplate=\"header\" let-columns>\r\n <tr>\r\n <th class=\"checkbox\" scope=\"col\">\r\n <p-tableHeaderCheckbox></p-tableHeaderCheckbox>\r\n </th>\r\n <ng-container *ngFor=\"let col of columns\">\r\n <th class=\"column\" scope=\"col\" *ngIf=\"['invoiceItems', 'quantity'].includes(col.field)\">\r\n {{ col.header }}\r\n </th>\r\n <th\r\n class=\"column\"\r\n [pSortableColumn]=\"col.field\"\r\n scope=\"col\"\r\n *ngIf=\"!['invoiceItems', 'quantity'].includes(col.field)\"\r\n >\r\n {{ col.header }}\r\n <p-sortIcon [field]=\"col.field\"></p-sortIcon>\r\n </th>\r\n </ng-container>\r\n </tr>\r\n </ng-template>\r\n\r\n <ng-template pTemplate=\"body\" let-rowData let-columns=\"columns\" let-rowIndex=\"rowIndex\">\r\n <tr>\r\n <td class=\"checkbox\" tabindex=\"0\">\r\n <p-tableCheckbox [value]=\"rowData\"></p-tableCheckbox>\r\n </td>\r\n <td\r\n [pSelectableRow]=\"rowData\"\r\n [pSelectableRowIndex]=\"rowIndex\"\r\n *ngFor=\"let col of columns\"\r\n class=\"column\"\r\n tabindex=\"0\"\r\n >\r\n <ng-container [ngSwitch]=\"col.field\">\r\n <ng-container *ngSwitchCase=\"'issuanceDate'\">\r\n {{ rowData[col.field] | localizedDate: \"L\" | async }}\r\n </ng-container>\r\n <ng-container *ngSwitchCase=\"'invoiceItems'\">\r\n {{ rowData[col.field]?.length || 0 }}\r\n </ng-container>\r\n <ng-container *ngSwitchCase=\"'quantity'\">\r\n {{ getItemsQuantity(rowData) | kilogram }}\r\n </ng-container>\r\n <ng-container *ngSwitchDefault> {{ rowData[col.field] }} </ng-container>\r\n </ng-container>\r\n </td>\r\n </tr>\r\n </ng-template>\r\n\r\n <ng-template pTemplate=\"paginatorright\">\r\n <span>{{ gridTotalRecords }} registros encontrados</span>\r\n </ng-template>\r\n </p-table>\r\n </div>\r\n </div>\r\n </ng-container>\r\n\r\n <ng-container *ngIf=\"dontHaveAnyInvoice\">\r\n <s-empty-state\r\n iconClass=\"fa fa-exclamation-triangle\"\r\n title=\"{{ 'agro.angular_components.add_pj_invoice_modal_no_invoices_found' | libTranslate }}\"\r\n primaryActionLabel=\"{{ 'agro.angular_components.error_server_try_again' | libTranslate }}\"\r\n (primaryAction)=\"tryToSearchAgain()\"\r\n description=\"{{ 'agro.angular_components.no_register_found_for_external_invoices_summary' | libTranslate }}\"\r\n >\r\n </s-empty-state>\r\n </ng-container>\r\n\r\n <p-footer class=\"footer\" *ngIf=\"!dontHaveAnyInvoice\">\r\n <s-button\r\n [priority]=\"buttonPriority.Primary\"\r\n label=\"{{ 'agro.angular_components.panel_title_external_invoice_add_external_invoice' | libTranslate }}\"\r\n [disabled]=\"!selected?.length\"\r\n (click)=\"add()\"\r\n (keydown.enter)=\"add()\"\r\n ></s-button>\r\n <s-button\r\n [priority]=\"buttonPriority.Link\"\r\n label=\"{{ 'agro.angular_components.cancel' | libTranslate }}\"\r\n (click)=\"cancel()\"\r\n (keydown.enter)=\"cancel()\"\r\n ></s-button>\r\n </p-footer>\r\n</p-dialog>\r\n",
|
|
7406
|
+
styles: [".footer{width:100%;display:-ms-flexbox;display:flex;-ms-flex-pack:justify;justify-content:space-between;-ms-flex-align:center;align-items:center}.add-invoice-modal{width:480px;max-width:480px}.add-invoice-modal input[type=text]{width:100%}.add-invoice-modal .ui-dialog{width:480px!important}.add-invoice-modal .ui-dialog .ui-dialog-content{min-height:175px}td.checkbox,th.checkbox{width:50px}td.column,th.column{min-width:150px;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}"]
|
|
7407
|
+
})
|
|
7408
|
+
], ModalInvoicePjSelectorComponent);
|
|
7409
|
+
return ModalInvoicePjSelectorComponent;
|
|
6918
7410
|
}());
|
|
6919
7411
|
|
|
6920
|
-
var
|
|
6921
|
-
function
|
|
7412
|
+
var AgroInvoiceModule = /** @class */ (function () {
|
|
7413
|
+
function AgroInvoiceModule() {
|
|
6922
7414
|
}
|
|
6923
|
-
|
|
7415
|
+
AgroInvoiceModule = __decorate([
|
|
6924
7416
|
core.NgModule({
|
|
6925
|
-
|
|
6926
|
-
|
|
6927
|
-
|
|
7417
|
+
imports: [
|
|
7418
|
+
http.HttpClientModule,
|
|
7419
|
+
platformComponents.PermissionsModule.forChild([
|
|
7420
|
+
{
|
|
7421
|
+
name: 'invoice',
|
|
7422
|
+
actions: ['Visualizar', 'Incluir', 'Editar', 'Excluir'],
|
|
7423
|
+
uri: "res://senior.com.br/agro/origination/entities/invoice",
|
|
7424
|
+
},
|
|
7425
|
+
]),
|
|
7426
|
+
],
|
|
7427
|
+
providers: [
|
|
7428
|
+
AgroInvoiceService,
|
|
7429
|
+
],
|
|
7430
|
+
declarations: [],
|
|
7431
|
+
exports: [],
|
|
6928
7432
|
})
|
|
6929
|
-
],
|
|
6930
|
-
return
|
|
7433
|
+
], AgroInvoiceModule);
|
|
7434
|
+
return AgroInvoiceModule;
|
|
7435
|
+
}());
|
|
7436
|
+
|
|
7437
|
+
var ModalInvoicePjSelectorModule = /** @class */ (function () {
|
|
7438
|
+
function ModalInvoicePjSelectorModule() {
|
|
7439
|
+
}
|
|
7440
|
+
ModalInvoicePjSelectorModule = __decorate([
|
|
7441
|
+
core.NgModule({
|
|
7442
|
+
declarations: [ModalInvoicePjSelectorComponent],
|
|
7443
|
+
providers: [common.DecimalPipe, common.DatePipe],
|
|
7444
|
+
imports: [
|
|
7445
|
+
common.CommonModule,
|
|
7446
|
+
forms.ReactiveFormsModule,
|
|
7447
|
+
angularComponents.LocaleModule.forChild(),
|
|
7448
|
+
angularComponents.EmptyStateModule,
|
|
7449
|
+
angularComponents.BignumberInputModule,
|
|
7450
|
+
primeng.InputTextModule,
|
|
7451
|
+
angularComponents.ButtonModule,
|
|
7452
|
+
angularComponents.TableModule,
|
|
7453
|
+
primeng.SharedModule,
|
|
7454
|
+
table.TableModule,
|
|
7455
|
+
AgroInvoiceModule,
|
|
7456
|
+
primeng.DialogModule,
|
|
7457
|
+
KilogramModule,
|
|
7458
|
+
angularComponents.LoadingStateModule,
|
|
7459
|
+
primeng.ConfirmDialogModule,
|
|
7460
|
+
LibTranslationModule,
|
|
7461
|
+
KilogramModule,
|
|
7462
|
+
angularComponents.TableHeaderCheckboxModule,
|
|
7463
|
+
],
|
|
7464
|
+
exports: [ModalInvoicePjSelectorComponent],
|
|
7465
|
+
})
|
|
7466
|
+
], ModalInvoicePjSelectorModule);
|
|
7467
|
+
return ModalInvoicePjSelectorModule;
|
|
6931
7468
|
}());
|
|
6932
7469
|
|
|
6933
7470
|
var HostProjectConfigsInjectionToken = new core.InjectionToken("hostProjectConfigs");
|
|
@@ -6959,6 +7496,8 @@
|
|
|
6959
7496
|
exports.AgroCookieUtils = AgroCookieUtils;
|
|
6960
7497
|
exports.AgroDateUtils = AgroDateUtils;
|
|
6961
7498
|
exports.AgroFormValidator = AgroFormValidator;
|
|
7499
|
+
exports.AgroInvoiceModule = AgroInvoiceModule;
|
|
7500
|
+
exports.AgroInvoiceService = AgroInvoiceService;
|
|
6962
7501
|
exports.AgroLogics = AgroLogics;
|
|
6963
7502
|
exports.AgroNameUtils = AgroNameUtils;
|
|
6964
7503
|
exports.AgroNumberUtils = AgroNumberUtils;
|
|
@@ -6988,9 +7527,13 @@
|
|
|
6988
7527
|
exports.FixationModule = FixationModule;
|
|
6989
7528
|
exports.HostProjectConfigsInjectionToken = HostProjectConfigsInjectionToken;
|
|
6990
7529
|
exports.InvoiceModule = InvoiceModule;
|
|
7530
|
+
exports.KilogramModule = KilogramModule;
|
|
7531
|
+
exports.KilogramPipe = KilogramPipe;
|
|
6991
7532
|
exports.LibTranslatePipe = LibTranslatePipe;
|
|
6992
7533
|
exports.LibTranslationModule = LibTranslationModule;
|
|
6993
7534
|
exports.LibTranslationService = LibTranslationService;
|
|
7535
|
+
exports.ModalInvoicePjSelectorComponent = ModalInvoicePjSelectorComponent;
|
|
7536
|
+
exports.ModalInvoicePjSelectorModule = ModalInvoicePjSelectorModule;
|
|
6994
7537
|
exports.OriginationModule = OriginationModule;
|
|
6995
7538
|
exports.PaginatorStorageService = PaginatorStorageService;
|
|
6996
7539
|
exports.PrimitiveManager = PrimitiveManager;
|