@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
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import moment from 'moment';
|
|
2
2
|
import { __awaiter, __decorate } from 'tslib';
|
|
3
|
-
import { Subject, BehaviorSubject, of, throwError } from 'rxjs';
|
|
3
|
+
import { Subject, BehaviorSubject, of, throwError, scheduled, asyncScheduler, timer } from 'rxjs';
|
|
4
4
|
import sockjsClient from 'sockjs-client';
|
|
5
|
-
import { ɵɵdefineInjectable, Injectable, ɵɵinject, NgModule, Input, Component, EventEmitter, Output, LOCALE_ID,
|
|
6
|
-
import { filter, take, finalize, switchMap, map, catchError, takeUntil } from 'rxjs/operators';
|
|
5
|
+
import { ɵɵdefineInjectable, Injectable, ɵɵinject, NgModule, Pipe, Input, Component, EventEmitter, Output, LOCALE_ID, InjectionToken } from '@angular/core';
|
|
6
|
+
import { filter, take, finalize, switchMap, map, catchError, takeUntil, concatMap, tap, scan, defaultIfEmpty, debounceTime } from 'rxjs/operators';
|
|
7
7
|
import { Client, FrameImpl } from '@stomp/stompjs';
|
|
8
8
|
import { get } from 'js-cookie';
|
|
9
|
-
import { CommonModule, registerLocaleData } from '@angular/common';
|
|
9
|
+
import { CommonModule, DecimalPipe, registerLocaleData, DatePipe } from '@angular/common';
|
|
10
10
|
import localePt from '@angular/common/locales/pt';
|
|
11
11
|
import { Validators, FormControl, FormGroup, FormBuilder, FormsModule, ReactiveFormsModule } from '@angular/forms';
|
|
12
|
-
import { ButtonPriority, FormField, FieldType, BadgeColors, StepState as StepState$1, ButtonModule, CustomFieldsModule, ControlErrorsModule, EmptyStateModule, DynamicFormModule, TokenListModule, SidebarModule, LoadingStateModule, NumberInputModule, TableModule as TableModule$1, ObjectCardModule, LocaleModule, BadgeModule } from '@seniorsistemas/angular-components';
|
|
13
|
-
import { DynamicDialogConfig, DynamicDialogRef, MessageService as MessageService$1, DialogService, DialogModule, FieldsetModule } from 'primeng';
|
|
14
|
-
import { HttpParams, HttpClient } from '@angular/common/http';
|
|
12
|
+
import { ButtonPriority, FormField, FieldType, BadgeColors, StepState as StepState$1, ButtonModule, CustomFieldsModule, ControlErrorsModule, EmptyStateModule, DynamicFormModule, TokenListModule, SidebarModule, LoadingStateModule, NumberInputModule, TableModule as TableModule$1, ObjectCardModule, LocaleModule, BadgeModule, BignumberInputModule, TableHeaderCheckboxModule } from '@seniorsistemas/angular-components';
|
|
13
|
+
import { DynamicDialogConfig, DynamicDialogRef, MessageService as MessageService$1, DialogService, DialogModule, FieldsetModule, InputTextModule as InputTextModule$1, SharedModule as SharedModule$2, ConfirmDialogModule as ConfirmDialogModule$1 } from 'primeng';
|
|
14
|
+
import { HttpParams, HttpClient, HttpClientModule } from '@angular/common/http';
|
|
15
15
|
import { MessageService, SharedModule as SharedModule$1 } from 'primeng/api';
|
|
16
16
|
import { user } from '@seniorsistemas/senior-platform-data';
|
|
17
17
|
import { ConfirmDialogModule } from 'primeng/confirmdialog';
|
|
@@ -184,7 +184,7 @@ const AGRO_REGEX = {
|
|
|
184
184
|
* Validação de Placa de Veículo Antiga
|
|
185
185
|
* Formato: AAA-0000
|
|
186
186
|
*/
|
|
187
|
-
isOldLicensePlate: /^[A-Z]{3}
|
|
187
|
+
isOldLicensePlate: /^[A-Z]{3}\d{4}$/,
|
|
188
188
|
isISODate: /^\d{4}-\d{2}-\d{2}$/,
|
|
189
189
|
isISOTime: /^\d{2}:\d{2}:\d{2}$/,
|
|
190
190
|
isISODateTime: /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(?:\.\d+)?Z$/,
|
|
@@ -2284,8 +2284,9 @@ class AgroStringUtils {
|
|
|
2284
2284
|
* pode ser uma string personalizada onde '9' representa um dígito a ser mantido da string.
|
|
2285
2285
|
*/
|
|
2286
2286
|
static removeMask(value, mask) {
|
|
2287
|
-
if (!value || !mask)
|
|
2287
|
+
if (!value || !mask) {
|
|
2288
2288
|
return value;
|
|
2289
|
+
}
|
|
2289
2290
|
const valueChars = value.toString().split("");
|
|
2290
2291
|
const maskChars = mask.split("");
|
|
2291
2292
|
let unmaskedValue = "";
|
|
@@ -2293,63 +2294,50 @@ class AgroStringUtils {
|
|
|
2293
2294
|
const isDigit = (c) => /\d/.test(c);
|
|
2294
2295
|
const isAlpha = (c) => /[A-Za-z]/.test(c);
|
|
2295
2296
|
const isAlnum = (c) => /[A-Za-z0-9]/.test(c);
|
|
2296
|
-
|
|
2297
|
-
|
|
2298
|
-
|
|
2299
|
-
|
|
2300
|
-
// Placeholder para dígito '9'
|
|
2301
|
-
if (maskChar === "9") {
|
|
2302
|
-
// procura próximo dígito a partir de j
|
|
2303
|
-
let k = j;
|
|
2304
|
-
while (k < valueChars.length && !isDigit(valueChars[k]))
|
|
2305
|
-
k++;
|
|
2306
|
-
if (k < valueChars.length) {
|
|
2307
|
-
// encontrou dígito: consome
|
|
2308
|
-
unmaskedValue += valueChars[k];
|
|
2309
|
-
j = k + 1;
|
|
2310
|
-
}
|
|
2311
|
-
else {
|
|
2312
|
-
// não há dígito futuro: captura o caractere atual como dado
|
|
2313
|
-
unmaskedValue += valueChars[j];
|
|
2314
|
-
j++;
|
|
2315
|
-
}
|
|
2316
|
-
continue;
|
|
2297
|
+
const extractNext = (testFn) => {
|
|
2298
|
+
let k = j;
|
|
2299
|
+
while (k < valueChars.length && !testFn(valueChars[k])) {
|
|
2300
|
+
k++;
|
|
2317
2301
|
}
|
|
2318
|
-
|
|
2319
|
-
|
|
2320
|
-
|
|
2321
|
-
|
|
2322
|
-
|
|
2323
|
-
|
|
2324
|
-
|
|
2325
|
-
|
|
2326
|
-
|
|
2327
|
-
|
|
2328
|
-
|
|
2329
|
-
|
|
2330
|
-
|
|
2331
|
-
|
|
2332
|
-
|
|
2302
|
+
if (k < valueChars.length) {
|
|
2303
|
+
const found = valueChars[k];
|
|
2304
|
+
j = k + 1;
|
|
2305
|
+
return found;
|
|
2306
|
+
}
|
|
2307
|
+
const fallback = valueChars[j];
|
|
2308
|
+
j++;
|
|
2309
|
+
return fallback;
|
|
2310
|
+
};
|
|
2311
|
+
const processMaskChar = (maskChar) => {
|
|
2312
|
+
var _a, _b;
|
|
2313
|
+
if (j >= valueChars.length) {
|
|
2314
|
+
return;
|
|
2315
|
+
}
|
|
2316
|
+
const current = valueChars[j];
|
|
2317
|
+
switch (maskChar) {
|
|
2318
|
+
case "9":
|
|
2319
|
+
unmaskedValue += (_a = extractNext(isDigit)) !== null && _a !== void 0 ? _a : "";
|
|
2320
|
+
break;
|
|
2321
|
+
case "A":
|
|
2322
|
+
unmaskedValue += (_b = extractNext(isAlpha)) !== null && _b !== void 0 ? _b : "";
|
|
2323
|
+
break;
|
|
2324
|
+
default:
|
|
2325
|
+
handleSeparator(maskChar, current);
|
|
2326
|
+
break;
|
|
2333
2327
|
}
|
|
2334
|
-
|
|
2328
|
+
};
|
|
2329
|
+
const handleSeparator = (maskChar, current) => {
|
|
2335
2330
|
if (current === maskChar) {
|
|
2336
|
-
// separador presente no valor
|
|
2337
|
-
j++;
|
|
2338
|
-
continue;
|
|
2331
|
+
j++; // separador presente no valor
|
|
2339
2332
|
}
|
|
2340
|
-
// separador ausente:
|
|
2341
|
-
// - se o caractere atual for alfanumérico, trata como dado e captura;
|
|
2342
|
-
// - se não for alfanumérico (pontuação), ignora — não avança j, permite
|
|
2343
|
-
// que o próximo placeholder pule/consuma ou procure pelo tipo esperado.
|
|
2344
2333
|
if (isAlnum(current)) {
|
|
2345
2334
|
unmaskedValue += current;
|
|
2346
2335
|
j++;
|
|
2347
2336
|
}
|
|
2348
|
-
|
|
2349
|
-
|
|
2350
|
-
|
|
2351
|
-
|
|
2352
|
-
}
|
|
2337
|
+
// se for pontuação diferente, apenas ignora (não consome j)
|
|
2338
|
+
};
|
|
2339
|
+
for (const maskChar of maskChars) {
|
|
2340
|
+
processMaskChar(maskChar);
|
|
2353
2341
|
}
|
|
2354
2342
|
return unmaskedValue;
|
|
2355
2343
|
}
|
|
@@ -3506,7 +3494,7 @@ const ptBR = {
|
|
|
3506
3494
|
"agro.angular_components.save": "Salvar",
|
|
3507
3495
|
"agro.angular_components.select": "Selecione",
|
|
3508
3496
|
"agro.angular_components.updated_by": "Atualizado por",
|
|
3509
|
-
|
|
3497
|
+
error_invalid: "Valor inválido",
|
|
3510
3498
|
"agro.angular_components.choose_label": "Escolha",
|
|
3511
3499
|
"agro.angular_components.remove_label": "Remover",
|
|
3512
3500
|
"agro.angular_components.cancel_label": "Cancelar",
|
|
@@ -3593,6 +3581,7 @@ const ptBR = {
|
|
|
3593
3581
|
"agro.angular_components.ORIGINATION_CREATE_EFFECTIVE_BALANCE": "Emissão de saldo efetivo",
|
|
3594
3582
|
"agro.angular_components.PRODUCER_NET_VALUE_EFFECTIVE_BALANCE_CONFIRMATION": "Confirmação de saldo efetivo",
|
|
3595
3583
|
"agro.angular_components.CLOSE_INVOICE_FIXATION": "Fechamento de NF",
|
|
3584
|
+
"agro.angular_components.INVOICE_CLOSE_INVOICE": "Solicitação de cancelamento da NF",
|
|
3596
3585
|
"agro.angular_components.ORIGINATION_CREATE_EFFECTIVE_CONFIRMATION": "Confirmação efetiva",
|
|
3597
3586
|
"agro.angular_components.ORIGINATION_CREATE_PROVISIONAL_BALANCE": "Saldo provisório",
|
|
3598
3587
|
"agro.angular_components.CLOSE_INVOICE_TRANSFER": "Fechamento de NF",
|
|
@@ -3602,6 +3591,23 @@ const ptBR = {
|
|
|
3602
3591
|
"agro.angular_components.TRANSFER_CREATE_SERVICE_INVOICE": "Emissão NF de serviço",
|
|
3603
3592
|
"agro.angular_components.TRANSFER_CANCEL_SERVICE_INVOICE": "Cancelamento de NF de serviço",
|
|
3604
3593
|
"agro.angular_components.REOPEN_INVOICE_FIXATION": "Reabertura da NF",
|
|
3594
|
+
"agro.angular_components.CIDASC_INTEGRATION": "Envio ao Cidasc",
|
|
3595
|
+
"agro.angular_components.CIDASC_CANCELLATION": "Cancelamento do Receituário",
|
|
3596
|
+
"agro.angular_components.CIDASC_DATA_LOAD_CULTURE": "Carga Cidasc - Cultura",
|
|
3597
|
+
"agro.angular_components.CIDASC_DATA_LOAD_PEST": "Carga Cidasc - Praga",
|
|
3598
|
+
"agro.angular_components.CIDASC_DATA_LOAD_PRODUCT": "Carga Cidasc - Produto",
|
|
3599
|
+
"agro.angular_components.CIDASC_DATA_LOAD_MEASURE_UNIT": "Carga Cidasc - Unidade de medida",
|
|
3600
|
+
"agro.angular_components.CIDASC_DATA_LOAD_COMPOSED_MEASURE_UNIT": "Carga Cidasc - Medida por hectare",
|
|
3601
|
+
"agro.angular_components.agronomic_prescription_origin_event": "Receituário Agronômico",
|
|
3602
|
+
"agro.angular_components.number_or_series": "Número ou série",
|
|
3603
|
+
"agro.angular_components.panel_title_external_invoice_add_external_invoice": "Adicionar nota fiscal",
|
|
3604
|
+
"agro.angular_components.add_pj_invoice_modal_no_invoices_found": "Nenhuma nota fiscal disponível para este produtor",
|
|
3605
|
+
"agro.angular_components.number": "Número",
|
|
3606
|
+
"agro.angular_components.series": "Série",
|
|
3607
|
+
"agro.angular_components.itens": "Itens",
|
|
3608
|
+
"agro.angular_components.quantity": "Quantidade",
|
|
3609
|
+
"agro.angular_components.issuance_date": "Data de emissão",
|
|
3610
|
+
"agro.angular_components.no_register_found_for_external_invoices_summary": "Nenhuma nota encontrada",
|
|
3605
3611
|
};
|
|
3606
3612
|
|
|
3607
3613
|
const enUS = {
|
|
@@ -3759,7 +3765,7 @@ const enUS = {
|
|
|
3759
3765
|
"agro.angular_components.save": "Save",
|
|
3760
3766
|
"agro.angular_components.select": "Select",
|
|
3761
3767
|
"agro.angular_components.updated_by": "Updated by",
|
|
3762
|
-
error_invalid: "Invalid value",
|
|
3768
|
+
"error_invalid": "Invalid value",
|
|
3763
3769
|
"agro.angular_components.choose_label": "Choose",
|
|
3764
3770
|
"agro.angular_components.remove_label": "Remove",
|
|
3765
3771
|
"agro.angular_components.cancel_label": "Cancel",
|
|
@@ -3849,6 +3855,23 @@ const enUS = {
|
|
|
3849
3855
|
"agro.angular_components.TRANSFER_CREATE_SERVICE_INVOICE": "Service invoice issuance",
|
|
3850
3856
|
"agro.angular_components.TRANSFER_CANCEL_SERVICE_INVOICE": "Service invoice cancellation",
|
|
3851
3857
|
"agro.angular_components.REOPEN_INVOICE_FIXATION": "Reopen invoice fixation",
|
|
3858
|
+
"agro.angular_components.INVOICE_CLOSE_INVOICE": "Invoice cancellation request",
|
|
3859
|
+
"agro.angular_components.CIDASC_INTEGRATION": "Send to Cidasc",
|
|
3860
|
+
"agro.angular_components.CIDASC_CANCELLATION": "Prescription Cancellation",
|
|
3861
|
+
"agro.angular_components.CIDASC_DATA_LOAD_CULTURE": "Cidasc Load - Culture",
|
|
3862
|
+
"agro.angular_components.CIDASC_DATA_LOAD_PEST": "Cidasc Load - Pest",
|
|
3863
|
+
"agro.angular_components.CIDASC_DATA_LOAD_PRODUCT": "Cidasc Load - Product",
|
|
3864
|
+
"agro.angular_components.CIDASC_DATA_LOAD_MEASURE_UNIT": "Cidasc Load - Unit of measure",
|
|
3865
|
+
"agro.angular_components.CIDASC_DATA_LOAD_COMPOSED_MEASURE_UNIT": "Cidasc Load - Measure per hectare",
|
|
3866
|
+
"agro.angular_components.agronomic_prescription_origin_event": "Agronomic Prescription",
|
|
3867
|
+
"agro.angular_components.number_or_series": "Número ou série",
|
|
3868
|
+
"agro.angular_components.panel_title_external_invoice_add_external_invoice": "Adicionar nota fiscal",
|
|
3869
|
+
"agro.angular_components.add_pj_invoice_modal_no_invoices_found": "Nenhuma nota fiscal disponível para este produtor",
|
|
3870
|
+
"agro.angular_components.number": "Número",
|
|
3871
|
+
"agro.angular_components.series": "Série",
|
|
3872
|
+
"agro.angular_components.itens": "Itens",
|
|
3873
|
+
"agro.angular_components.quantity": "Quantidade",
|
|
3874
|
+
"agro.angular_components.issuance_date": "Data de emissão",
|
|
3852
3875
|
};
|
|
3853
3876
|
|
|
3854
3877
|
const esCO = {
|
|
@@ -4096,6 +4119,23 @@ const esCO = {
|
|
|
4096
4119
|
"agro.angular_components.TRANSFER_CREATE_SERVICE_INVOICE": "Emisión de NF de servicio",
|
|
4097
4120
|
"agro.angular_components.TRANSFER_CANCEL_SERVICE_INVOICE": "Cancelación de NF de servicio",
|
|
4098
4121
|
"agro.angular_components.REOPEN_INVOICE_FIXATION": "Reapertura de factura",
|
|
4122
|
+
"agro.angular_components.INVOICE_CLOSE_INVOICE": "Solicitud de cancelación de la factura",
|
|
4123
|
+
"agro.angular_components.CIDASC_INTEGRATION": "Envío a Cidasc",
|
|
4124
|
+
"agro.angular_components.CIDASC_CANCELLATION": "Cancelación de Receta",
|
|
4125
|
+
"agro.angular_components.CIDASC_DATA_LOAD_CULTURE": "Carga Cidasc - Cultivo",
|
|
4126
|
+
"agro.angular_components.CIDASC_DATA_LOAD_PEST": "Carga Cidasc - Plaga",
|
|
4127
|
+
"agro.angular_components.CIDASC_DATA_LOAD_PRODUCT": "Carga Cidasc - Producto",
|
|
4128
|
+
"agro.angular_components.CIDASC_DATA_LOAD_MEASURE_UNIT": "Carga Cidasc - Unidad de medida",
|
|
4129
|
+
"agro.angular_components.CIDASC_DATA_LOAD_COMPOSED_MEASURE_UNIT": "Carga Cidasc - Medida por hectárea",
|
|
4130
|
+
"agro.angular_components.agronomic_prescription_origin_event": "Recetario Agronómico",
|
|
4131
|
+
"agro.angular_components.number_or_series": "Número ou série",
|
|
4132
|
+
"agro.angular_components.panel_title_external_invoice_add_external_invoice": "Adicionar nota fiscal",
|
|
4133
|
+
"agro.angular_components.add_pj_invoice_modal_no_invoices_found": "Nenhuma nota fiscal disponível para este produtor",
|
|
4134
|
+
"agro.angular_components.number": "Número",
|
|
4135
|
+
"agro.angular_components.series": "Série",
|
|
4136
|
+
"agro.angular_components.itens": "Itens",
|
|
4137
|
+
"agro.angular_components.quantity": "Quantidade",
|
|
4138
|
+
"agro.angular_components.issuance_date": "Data de emissão",
|
|
4099
4139
|
};
|
|
4100
4140
|
|
|
4101
4141
|
let LibTranslationService = class LibTranslationService {
|
|
@@ -4106,7 +4146,7 @@ let LibTranslationService = class LibTranslationService {
|
|
|
4106
4146
|
"es-CO": esCO,
|
|
4107
4147
|
};
|
|
4108
4148
|
this.currentTranslation = {};
|
|
4109
|
-
this.setLang(
|
|
4149
|
+
this.setLang("pt-BR");
|
|
4110
4150
|
}
|
|
4111
4151
|
getLangOfUser() {
|
|
4112
4152
|
return AgroPlatformUtils.getCurrentTenantLocale() || "pt-BR";
|
|
@@ -4147,6 +4187,251 @@ LibTranslationService = __decorate([
|
|
|
4147
4187
|
})
|
|
4148
4188
|
], LibTranslationService);
|
|
4149
4189
|
|
|
4190
|
+
let KilogramPipe = class KilogramPipe {
|
|
4191
|
+
constructor(decimalPipe) {
|
|
4192
|
+
this.decimalPipe = decimalPipe;
|
|
4193
|
+
}
|
|
4194
|
+
transform(value, format = "1.3-3", kgCaseInsensitive = "UPPER") {
|
|
4195
|
+
if (value == null || isNaN(value)) {
|
|
4196
|
+
return "";
|
|
4197
|
+
}
|
|
4198
|
+
let str = this.decimalPipe.transform(value, format);
|
|
4199
|
+
const kgStr = "kg";
|
|
4200
|
+
if (!str) {
|
|
4201
|
+
console.info("Formato do peso inválido para transformação");
|
|
4202
|
+
return "";
|
|
4203
|
+
}
|
|
4204
|
+
str = str.replace(/,/g, ".");
|
|
4205
|
+
return `${this.replaceLastDotWithComma(str)} ${kgCaseInsensitive === "UPPER" ? kgStr.toUpperCase() : kgStr.toLowerCase()}`;
|
|
4206
|
+
}
|
|
4207
|
+
replaceLastDotWithComma(value) {
|
|
4208
|
+
const lastDotIndex = value.lastIndexOf(".");
|
|
4209
|
+
if (lastDotIndex === -1) {
|
|
4210
|
+
return value;
|
|
4211
|
+
}
|
|
4212
|
+
return `${value.substring(0, lastDotIndex)},${value.substring(lastDotIndex + 1)}`;
|
|
4213
|
+
}
|
|
4214
|
+
};
|
|
4215
|
+
KilogramPipe.ctorParameters = () => [
|
|
4216
|
+
{ type: DecimalPipe }
|
|
4217
|
+
];
|
|
4218
|
+
KilogramPipe = __decorate([
|
|
4219
|
+
Pipe({
|
|
4220
|
+
name: "kilogram",
|
|
4221
|
+
})
|
|
4222
|
+
], KilogramPipe);
|
|
4223
|
+
|
|
4224
|
+
let KilogramModule = class KilogramModule {
|
|
4225
|
+
};
|
|
4226
|
+
KilogramModule = __decorate([
|
|
4227
|
+
NgModule({
|
|
4228
|
+
declarations: [KilogramPipe],
|
|
4229
|
+
imports: [
|
|
4230
|
+
CommonModule
|
|
4231
|
+
],
|
|
4232
|
+
exports: [KilogramPipe]
|
|
4233
|
+
})
|
|
4234
|
+
], KilogramModule);
|
|
4235
|
+
|
|
4236
|
+
let CnpjCpfPipe = class CnpjCpfPipe {
|
|
4237
|
+
transform(value, ...args) {
|
|
4238
|
+
if (typeof value !== "string" && typeof value === "number") {
|
|
4239
|
+
value = value === null || value === void 0 ? void 0 : value.toString();
|
|
4240
|
+
}
|
|
4241
|
+
if (typeof value !== "string") {
|
|
4242
|
+
return value;
|
|
4243
|
+
}
|
|
4244
|
+
if (AgroStringUtils.validateCNPJ(value)) {
|
|
4245
|
+
return AgroStringUtils.applyMask(value, AgroStringMasks.CNPJ);
|
|
4246
|
+
}
|
|
4247
|
+
if (AgroStringUtils.validateCPF(value)) {
|
|
4248
|
+
return AgroStringUtils.applyMask(value, AgroStringMasks.CPF);
|
|
4249
|
+
}
|
|
4250
|
+
return value;
|
|
4251
|
+
}
|
|
4252
|
+
};
|
|
4253
|
+
CnpjCpfPipe = __decorate([
|
|
4254
|
+
Pipe({
|
|
4255
|
+
name: "cnpjCpf",
|
|
4256
|
+
})
|
|
4257
|
+
], CnpjCpfPipe);
|
|
4258
|
+
|
|
4259
|
+
let CnpjCpfPipeModule = class CnpjCpfPipeModule {
|
|
4260
|
+
};
|
|
4261
|
+
CnpjCpfPipeModule = __decorate([
|
|
4262
|
+
NgModule({
|
|
4263
|
+
declarations: [CnpjCpfPipe],
|
|
4264
|
+
imports: [CommonModule],
|
|
4265
|
+
exports: [CnpjCpfPipe],
|
|
4266
|
+
})
|
|
4267
|
+
], CnpjCpfPipeModule);
|
|
4268
|
+
|
|
4269
|
+
class AgroObjectStringifier {
|
|
4270
|
+
/**
|
|
4271
|
+
* Formata um objeto concatenando valores segundo as chaves e pipes informados.
|
|
4272
|
+
*
|
|
4273
|
+
* @param separator Separador entre os valores (ex: "-")
|
|
4274
|
+
* @param fields Campos a extrair. Podem conter subpropriedades ("propriedade.subPropriedade") e pipes ("propriedade|nomeDaPipe:arg1:arg2")
|
|
4275
|
+
* @param obj Objeto origem
|
|
4276
|
+
*/
|
|
4277
|
+
static formatObject(separator, fields, obj, usePipes) {
|
|
4278
|
+
function mapField(field) {
|
|
4279
|
+
const value = AgroObjectStringifier.resolvePath(obj, field);
|
|
4280
|
+
if (usePipes === null || usePipes === void 0 ? void 0 : usePipes.hasOwnProperty(field)) {
|
|
4281
|
+
return usePipes[field].transform(value);
|
|
4282
|
+
}
|
|
4283
|
+
return value !== null && value !== void 0 ? value : "";
|
|
4284
|
+
}
|
|
4285
|
+
function filterValid(v) {
|
|
4286
|
+
return typeof v === "number" || AgroStringUtils.isValid(v);
|
|
4287
|
+
}
|
|
4288
|
+
return fields.map(mapField).filter(filterValid).join(` ${separator} `);
|
|
4289
|
+
}
|
|
4290
|
+
/** Resolve um caminho tipo "empresa.cargo" dentro de um objeto */
|
|
4291
|
+
static resolvePath(obj, path) {
|
|
4292
|
+
function reducer(acc, key) {
|
|
4293
|
+
return acc === null || acc === void 0 ? void 0 : acc[key];
|
|
4294
|
+
}
|
|
4295
|
+
return path.split(".").reduce(reducer, obj);
|
|
4296
|
+
}
|
|
4297
|
+
}
|
|
4298
|
+
|
|
4299
|
+
let StringifierPipe = class StringifierPipe {
|
|
4300
|
+
transform(value, separator, paths, pipes) {
|
|
4301
|
+
return AgroObjectStringifier.formatObject(separator, paths, value, pipes);
|
|
4302
|
+
}
|
|
4303
|
+
};
|
|
4304
|
+
StringifierPipe = __decorate([
|
|
4305
|
+
Pipe({ name: "stringifier" })
|
|
4306
|
+
], StringifierPipe);
|
|
4307
|
+
|
|
4308
|
+
let StringifierPipeModule = class StringifierPipeModule {
|
|
4309
|
+
};
|
|
4310
|
+
StringifierPipeModule = __decorate([
|
|
4311
|
+
NgModule({
|
|
4312
|
+
declarations: [StringifierPipe],
|
|
4313
|
+
imports: [CommonModule],
|
|
4314
|
+
exports: [StringifierPipe],
|
|
4315
|
+
})
|
|
4316
|
+
], StringifierPipeModule);
|
|
4317
|
+
|
|
4318
|
+
let TelephonePipe = class TelephonePipe {
|
|
4319
|
+
/**
|
|
4320
|
+
* Transforma um número de telefone aplicando máscara automaticamente.
|
|
4321
|
+
* @param value Valor do telefone.
|
|
4322
|
+
* @param withDDI Define se deve forçar formatação com DDI (mesmo que não exista).
|
|
4323
|
+
*/
|
|
4324
|
+
transform(value, withDDI = false) {
|
|
4325
|
+
if (!value) {
|
|
4326
|
+
return "";
|
|
4327
|
+
}
|
|
4328
|
+
const digits = this.cleanDigits(value);
|
|
4329
|
+
if (!digits) {
|
|
4330
|
+
return value.toString();
|
|
4331
|
+
}
|
|
4332
|
+
const { ddi, ddd, number } = this.extractParts(digits, withDDI);
|
|
4333
|
+
return this.formatPhone(ddi, ddd, number, value.toString(), withDDI);
|
|
4334
|
+
}
|
|
4335
|
+
/** Remove todos os caracteres não numéricos */
|
|
4336
|
+
cleanDigits(value) {
|
|
4337
|
+
return value.toString().replace(/\D+/g, "");
|
|
4338
|
+
}
|
|
4339
|
+
/** Extrai DDI, DDD e número, considerando se deve aplicar DDI forçado */
|
|
4340
|
+
extractParts(digits, withDDI) {
|
|
4341
|
+
const len = digits.length;
|
|
4342
|
+
if (withDDI) {
|
|
4343
|
+
return this.extractWithDDI(digits);
|
|
4344
|
+
}
|
|
4345
|
+
if (len <= AGRO_NUMBERS.NINE) {
|
|
4346
|
+
return { ddi: "", ddd: "", number: digits };
|
|
4347
|
+
}
|
|
4348
|
+
if (len <= AGRO_NUMBERS.ELEVEN) {
|
|
4349
|
+
return this.extractWithDDD(digits);
|
|
4350
|
+
}
|
|
4351
|
+
return this.extractWithDDI(digits);
|
|
4352
|
+
}
|
|
4353
|
+
/** Extrai DDD e número (sem DDI) */
|
|
4354
|
+
extractWithDDD(digits) {
|
|
4355
|
+
const ddd = digits.slice(0, 2);
|
|
4356
|
+
const number = digits.slice(2);
|
|
4357
|
+
return { ddi: "", ddd, number };
|
|
4358
|
+
}
|
|
4359
|
+
/** Extrai DDI, DDD e número */
|
|
4360
|
+
extractWithDDI(digits) {
|
|
4361
|
+
const len = digits.length;
|
|
4362
|
+
let ddiLen = AGRO_NUMBERS.ONE;
|
|
4363
|
+
if (len >= AGRO_NUMBERS.FOURTEEN) {
|
|
4364
|
+
ddiLen = AGRO_NUMBERS.THREE;
|
|
4365
|
+
}
|
|
4366
|
+
if (len >= AGRO_NUMBERS.TWELVE) {
|
|
4367
|
+
ddiLen = AGRO_NUMBERS.TWO;
|
|
4368
|
+
}
|
|
4369
|
+
const ddi = digits.slice(AGRO_NUMBERS.ZERO, ddiLen);
|
|
4370
|
+
const ddd = digits.slice(ddiLen, ddiLen + AGRO_NUMBERS.TWO);
|
|
4371
|
+
const number = digits.slice(ddiLen + AGRO_NUMBERS.TWO);
|
|
4372
|
+
return { ddi, ddd, number };
|
|
4373
|
+
}
|
|
4374
|
+
/** Monta o número formatado */
|
|
4375
|
+
formatPhone(ddi, ddd, number, fallback, withDDI) {
|
|
4376
|
+
if (!number) {
|
|
4377
|
+
return fallback;
|
|
4378
|
+
}
|
|
4379
|
+
let formatted = "";
|
|
4380
|
+
if (withDDI || ddi) {
|
|
4381
|
+
formatted += `+${ddi || "55"} `;
|
|
4382
|
+
}
|
|
4383
|
+
if (ddd) {
|
|
4384
|
+
formatted += `(${ddd}) `;
|
|
4385
|
+
}
|
|
4386
|
+
formatted += this.formatNumber(number);
|
|
4387
|
+
return formatted;
|
|
4388
|
+
}
|
|
4389
|
+
/** Aplica máscara de 8 ou 9 dígitos */
|
|
4390
|
+
formatNumber(number) {
|
|
4391
|
+
const len = number.length;
|
|
4392
|
+
if (len === AGRO_NUMBERS.NINE) {
|
|
4393
|
+
return `${number.slice(AGRO_NUMBERS.ZERO, AGRO_NUMBERS.FIVE)}-${number.slice(AGRO_NUMBERS.FIVE)}`;
|
|
4394
|
+
}
|
|
4395
|
+
if (len === AGRO_NUMBERS.EIGHT) {
|
|
4396
|
+
return `${number.slice(AGRO_NUMBERS.ZERO, AGRO_NUMBERS.FOUR)}-${number.slice(AGRO_NUMBERS.FOUR)}`;
|
|
4397
|
+
}
|
|
4398
|
+
return number;
|
|
4399
|
+
}
|
|
4400
|
+
};
|
|
4401
|
+
TelephonePipe = __decorate([
|
|
4402
|
+
Pipe({ name: "telephone" })
|
|
4403
|
+
], TelephonePipe);
|
|
4404
|
+
|
|
4405
|
+
let TelephonePipeModule = class TelephonePipeModule {
|
|
4406
|
+
};
|
|
4407
|
+
TelephonePipeModule = __decorate([
|
|
4408
|
+
NgModule({
|
|
4409
|
+
declarations: [TelephonePipe],
|
|
4410
|
+
imports: [CommonModule],
|
|
4411
|
+
exports: [TelephonePipe],
|
|
4412
|
+
})
|
|
4413
|
+
], TelephonePipeModule);
|
|
4414
|
+
|
|
4415
|
+
let LibTranslatePipe = class LibTranslatePipe {
|
|
4416
|
+
constructor(translateService) {
|
|
4417
|
+
this.translateService = translateService;
|
|
4418
|
+
}
|
|
4419
|
+
transform(value, ...args) {
|
|
4420
|
+
if (args.length > 0) {
|
|
4421
|
+
return this.translateService.instant(value, args[0]);
|
|
4422
|
+
}
|
|
4423
|
+
return this.translateService.instant(value);
|
|
4424
|
+
}
|
|
4425
|
+
};
|
|
4426
|
+
LibTranslatePipe.ctorParameters = () => [
|
|
4427
|
+
{ type: LibTranslationService }
|
|
4428
|
+
];
|
|
4429
|
+
LibTranslatePipe = __decorate([
|
|
4430
|
+
Pipe({
|
|
4431
|
+
name: 'libTranslate'
|
|
4432
|
+
})
|
|
4433
|
+
], LibTranslatePipe);
|
|
4434
|
+
|
|
4150
4435
|
let CancelEventDialogComponent = class CancelEventDialogComponent {
|
|
4151
4436
|
constructor(formBuilder, config, ref, translate) {
|
|
4152
4437
|
this.formBuilder = formBuilder;
|
|
@@ -5139,20 +5424,17 @@ let EventControlBoardComponent = class EventControlBoardComponent {
|
|
|
5139
5424
|
return translatedErrorMessages;
|
|
5140
5425
|
}
|
|
5141
5426
|
getProducerInvoiceIdFromParams(param) {
|
|
5142
|
-
var _a, _b, _c, _d;
|
|
5143
|
-
if (
|
|
5144
|
-
return
|
|
5145
|
-
}
|
|
5146
|
-
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) {
|
|
5147
|
-
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;
|
|
5148
|
-
}
|
|
5149
|
-
if (param === null || param === void 0 ? void 0 : param.producerInvoiceId) {
|
|
5150
|
-
return param === null || param === void 0 ? void 0 : param.producerInvoiceId;
|
|
5151
|
-
}
|
|
5152
|
-
if (param === null || param === void 0 ? void 0 : param.externalId) {
|
|
5153
|
-
return param === null || param === void 0 ? void 0 : param.externalId;
|
|
5427
|
+
var _a, _b, _c, _d, _e;
|
|
5428
|
+
if (!param) {
|
|
5429
|
+
return null;
|
|
5154
5430
|
}
|
|
5155
|
-
return
|
|
5431
|
+
return (_e = [
|
|
5432
|
+
(_a = param.producerInvoiceIds) === null || _a === void 0 ? void 0 : _a[0],
|
|
5433
|
+
(_c = (_b = param.invoice) === null || _b === void 0 ? void 0 : _b.generalData) === null || _c === void 0 ? void 0 : _c.transactionalId,
|
|
5434
|
+
param.producerInvoiceId,
|
|
5435
|
+
param.externalId,
|
|
5436
|
+
(_d = param.externalInvoiceIds) === null || _d === void 0 ? void 0 : _d[0],
|
|
5437
|
+
].find((id) => id)) !== null && _e !== void 0 ? _e : null;
|
|
5156
5438
|
}
|
|
5157
5439
|
getProducerBalanceEntryControlIdFromParams(param) {
|
|
5158
5440
|
const { producerBalanceEntryControlId } = param;
|
|
@@ -5313,7 +5595,7 @@ __decorate([
|
|
|
5313
5595
|
EventControlBoardComponent = __decorate([
|
|
5314
5596
|
Component({
|
|
5315
5597
|
selector: "event-control-board",
|
|
5316
|
-
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",
|
|
5598
|
+
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",
|
|
5317
5599
|
providers: [{ provide: LOCALE_ID, useValue: "pt-BR" }],
|
|
5318
5600
|
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}"]
|
|
5319
5601
|
})
|
|
@@ -5994,26 +6276,6 @@ TicketModule = __decorate([
|
|
|
5994
6276
|
})
|
|
5995
6277
|
], TicketModule);
|
|
5996
6278
|
|
|
5997
|
-
let LibTranslatePipe = class LibTranslatePipe {
|
|
5998
|
-
constructor(translateService) {
|
|
5999
|
-
this.translateService = translateService;
|
|
6000
|
-
}
|
|
6001
|
-
transform(value, ...args) {
|
|
6002
|
-
if (args.length > 0) {
|
|
6003
|
-
return this.translateService.instant(value, args[0]);
|
|
6004
|
-
}
|
|
6005
|
-
return this.translateService.instant(value);
|
|
6006
|
-
}
|
|
6007
|
-
};
|
|
6008
|
-
LibTranslatePipe.ctorParameters = () => [
|
|
6009
|
-
{ type: LibTranslationService }
|
|
6010
|
-
];
|
|
6011
|
-
LibTranslatePipe = __decorate([
|
|
6012
|
-
Pipe({
|
|
6013
|
-
name: 'libTranslate'
|
|
6014
|
-
})
|
|
6015
|
-
], LibTranslatePipe);
|
|
6016
|
-
|
|
6017
6279
|
let LibTranslationModule = class LibTranslationModule {
|
|
6018
6280
|
};
|
|
6019
6281
|
LibTranslationModule = __decorate([
|
|
@@ -6024,6 +6286,7 @@ LibTranslationModule = __decorate([
|
|
|
6024
6286
|
imports: [
|
|
6025
6287
|
CommonModule
|
|
6026
6288
|
],
|
|
6289
|
+
providers: [LibTranslationService],
|
|
6027
6290
|
exports: [
|
|
6028
6291
|
LibTranslatePipe
|
|
6029
6292
|
]
|
|
@@ -6118,175 +6381,412 @@ EventControlBoardModule = __decorate([
|
|
|
6118
6381
|
})
|
|
6119
6382
|
], EventControlBoardModule);
|
|
6120
6383
|
|
|
6121
|
-
|
|
6122
|
-
|
|
6123
|
-
|
|
6124
|
-
|
|
6384
|
+
class AgroEntityService {
|
|
6385
|
+
constructor(http, messageService, entityUrl, actionsUrl, queriesUrl, translate) {
|
|
6386
|
+
this.http = http;
|
|
6387
|
+
this.messageService = messageService;
|
|
6388
|
+
this.entityUrl = entityUrl;
|
|
6389
|
+
this.actionsUrl = actionsUrl;
|
|
6390
|
+
this.queriesUrl = queriesUrl;
|
|
6391
|
+
this.translate = translate;
|
|
6392
|
+
this.http = http;
|
|
6393
|
+
this.messageService = messageService;
|
|
6394
|
+
this.entityUrl = entityUrl;
|
|
6395
|
+
this.actionsUrl = actionsUrl;
|
|
6396
|
+
this.queriesUrl = queriesUrl;
|
|
6397
|
+
this.translate = translate;
|
|
6398
|
+
this.defaultCatch = this.defaultCatch.bind(this);
|
|
6399
|
+
}
|
|
6400
|
+
getListQueryParams(listParams) {
|
|
6401
|
+
const ten = 10;
|
|
6402
|
+
const { page = 0, size = ten, sort = [], filterQuery = "", displayFields = [] } = listParams;
|
|
6403
|
+
let params = new HttpParams();
|
|
6404
|
+
params = params.append("size", String(size));
|
|
6405
|
+
params = params.append("offset", String(page));
|
|
6406
|
+
if (sort && sort.length) {
|
|
6407
|
+
params = params.append("orderby", sort.map(this.getBodyFilters()).join(", "));
|
|
6125
6408
|
}
|
|
6126
|
-
if (
|
|
6127
|
-
|
|
6409
|
+
if (filterQuery) {
|
|
6410
|
+
params = params.append("filter", filterQuery);
|
|
6128
6411
|
}
|
|
6129
|
-
if (
|
|
6130
|
-
|
|
6412
|
+
if (displayFields && displayFields.length) {
|
|
6413
|
+
params = params.append("displayfields", displayFields.join());
|
|
6131
6414
|
}
|
|
6132
|
-
|
|
6133
|
-
|
|
6415
|
+
return params;
|
|
6416
|
+
}
|
|
6417
|
+
getBodyParams(listParams) {
|
|
6418
|
+
const ten = 10;
|
|
6419
|
+
const { page = 0, size = ten, sort = [], filterQuery = "", displayFields = [] } = listParams;
|
|
6420
|
+
const bodyParams = {};
|
|
6421
|
+
bodyParams.size = size;
|
|
6422
|
+
bodyParams.offset = page;
|
|
6423
|
+
if (sort && sort.length) {
|
|
6424
|
+
bodyParams.orderBy = sort.map(this.getBodyFilters()).join(", ");
|
|
6134
6425
|
}
|
|
6135
|
-
|
|
6426
|
+
if (filterQuery) {
|
|
6427
|
+
bodyParams.filter = filterQuery;
|
|
6428
|
+
}
|
|
6429
|
+
if (displayFields && displayFields.length) {
|
|
6430
|
+
bodyParams.displayfields = displayFields.join();
|
|
6431
|
+
}
|
|
6432
|
+
return bodyParams;
|
|
6136
6433
|
}
|
|
6137
|
-
|
|
6138
|
-
|
|
6139
|
-
|
|
6140
|
-
|
|
6141
|
-
|
|
6142
|
-
], CnpjCpfPipe);
|
|
6143
|
-
|
|
6144
|
-
let CnpjCpfPipeModule = class CnpjCpfPipeModule {
|
|
6145
|
-
};
|
|
6146
|
-
CnpjCpfPipeModule = __decorate([
|
|
6147
|
-
NgModule({
|
|
6148
|
-
declarations: [CnpjCpfPipe],
|
|
6149
|
-
imports: [CommonModule],
|
|
6150
|
-
exports: [CnpjCpfPipe],
|
|
6151
|
-
})
|
|
6152
|
-
], CnpjCpfPipeModule);
|
|
6153
|
-
|
|
6154
|
-
class AgroObjectStringifier {
|
|
6155
|
-
/**
|
|
6156
|
-
* Formata um objeto concatenando valores segundo as chaves e pipes informados.
|
|
6157
|
-
*
|
|
6158
|
-
* @param separator Separador entre os valores (ex: "-")
|
|
6159
|
-
* @param fields Campos a extrair. Podem conter subpropriedades ("propriedade.subPropriedade") e pipes ("propriedade|nomeDaPipe:arg1:arg2")
|
|
6160
|
-
* @param obj Objeto origem
|
|
6161
|
-
*/
|
|
6162
|
-
static formatObject(separator, fields, obj, usePipes) {
|
|
6163
|
-
function mapField(field) {
|
|
6164
|
-
const value = AgroObjectStringifier.resolvePath(obj, field);
|
|
6165
|
-
if (usePipes === null || usePipes === void 0 ? void 0 : usePipes.hasOwnProperty(field)) {
|
|
6166
|
-
return usePipes[field].transform(value);
|
|
6434
|
+
getBodyFilters() {
|
|
6435
|
+
return (s) => {
|
|
6436
|
+
let order = "";
|
|
6437
|
+
if (s.order === 1) {
|
|
6438
|
+
order = " asc";
|
|
6167
6439
|
}
|
|
6168
|
-
|
|
6440
|
+
if (s.order === -1) {
|
|
6441
|
+
order = " desc";
|
|
6442
|
+
}
|
|
6443
|
+
return `${s.field}${order}`;
|
|
6444
|
+
};
|
|
6445
|
+
}
|
|
6446
|
+
defaultCatch(errorMsgs = []) {
|
|
6447
|
+
const unauthorized_401 = 401;
|
|
6448
|
+
// errorMsgs = [...errorMsgs, ...DefaultErrorMessages];
|
|
6449
|
+
errorMsgs = [...errorMsgs];
|
|
6450
|
+
const zero = 0;
|
|
6451
|
+
return catchError((err) => {
|
|
6452
|
+
if (err) {
|
|
6453
|
+
const errorMessage = errorMsgs.find((eMsg) => eMsg.status === (err === null || err === void 0 ? void 0 : err.status) || zero);
|
|
6454
|
+
let summary = err.status ? String(err.status) : "Error";
|
|
6455
|
+
let detail = this.getErrorMessage(err);
|
|
6456
|
+
if (err.status === unauthorized_401) {
|
|
6457
|
+
summary = this.translate.instant("agro.angular_components.error_unauthorized_title");
|
|
6458
|
+
detail = this.translate.instant("agro.angular_components.error_unauthorized_description");
|
|
6459
|
+
}
|
|
6460
|
+
if (errorMessage) {
|
|
6461
|
+
summary = errorMessage.summary ? this.translate.instant(errorMessage.summary) : summary;
|
|
6462
|
+
detail = errorMessage.detail ? this.translate.instant(errorMessage.detail) : detail;
|
|
6463
|
+
}
|
|
6464
|
+
this.messageService.add({
|
|
6465
|
+
severity: "error",
|
|
6466
|
+
summary,
|
|
6467
|
+
detail,
|
|
6468
|
+
});
|
|
6469
|
+
}
|
|
6470
|
+
return throwError(err);
|
|
6471
|
+
});
|
|
6472
|
+
}
|
|
6473
|
+
getErrorMessage(err) {
|
|
6474
|
+
if (err.error && err.error.message) {
|
|
6475
|
+
return err.error.message;
|
|
6169
6476
|
}
|
|
6170
|
-
|
|
6171
|
-
return
|
|
6477
|
+
if (err.statusText) {
|
|
6478
|
+
return err.statusText;
|
|
6172
6479
|
}
|
|
6173
|
-
|
|
6174
|
-
|
|
6175
|
-
/** Resolve um caminho tipo "empresa.cargo" dentro de um objeto */
|
|
6176
|
-
static resolvePath(obj, path) {
|
|
6177
|
-
function reducer(acc, key) {
|
|
6178
|
-
return acc === null || acc === void 0 ? void 0 : acc[key];
|
|
6480
|
+
if (err.message) {
|
|
6481
|
+
return err.message;
|
|
6179
6482
|
}
|
|
6180
|
-
return
|
|
6483
|
+
return "Error";
|
|
6484
|
+
}
|
|
6485
|
+
list(listParams, errorMessage = []) {
|
|
6486
|
+
return this.http.get(this.entityUrl, { params: this.getListQueryParams(listParams) }).pipe(this.defaultCatch(errorMessage));
|
|
6487
|
+
}
|
|
6488
|
+
get(id, errorMessage = []) {
|
|
6489
|
+
return this.http.get(`${this.entityUrl}/${id}`).pipe(this.defaultCatch(errorMessage));
|
|
6490
|
+
}
|
|
6491
|
+
insert(entity, errorMessage = []) {
|
|
6492
|
+
return this.http.post(`${this.entityUrl}`, entity).pipe(this.defaultCatch(errorMessage));
|
|
6493
|
+
}
|
|
6494
|
+
update(id, entity, errorMessage = []) {
|
|
6495
|
+
return this.http.put(`${this.entityUrl}/${id}`, entity).pipe(this.defaultCatch(errorMessage));
|
|
6496
|
+
}
|
|
6497
|
+
delete(id, errorMessage = []) {
|
|
6498
|
+
return this.http.delete(`${this.entityUrl}/${id}`).pipe(this.defaultCatch(errorMessage));
|
|
6499
|
+
}
|
|
6500
|
+
listCustomFilter(listParams, action, errorMessage = []) {
|
|
6501
|
+
return this.http.post(`${this.actionsUrl}/${action}`, this.getBodyParams(listParams)).pipe(this.defaultCatch(errorMessage));
|
|
6181
6502
|
}
|
|
6182
6503
|
}
|
|
6183
6504
|
|
|
6184
|
-
|
|
6185
|
-
|
|
6186
|
-
|
|
6187
|
-
|
|
6188
|
-
|
|
6189
|
-
|
|
6190
|
-
|
|
6191
|
-
|
|
6505
|
+
var statusLookup;
|
|
6506
|
+
(function (statusLookup) {
|
|
6507
|
+
statusLookup["PENDING"] = "PENDING";
|
|
6508
|
+
statusLookup["FINISHED"] = "FINISHED";
|
|
6509
|
+
statusLookup["ERROR"] = "ERROR";
|
|
6510
|
+
})(statusLookup || (statusLookup = {}));
|
|
6511
|
+
var statusIntegration;
|
|
6512
|
+
(function (statusIntegration) {
|
|
6513
|
+
statusIntegration["SUCCESS"] = "SUCCESS";
|
|
6514
|
+
statusIntegration["IN_PROGRESS"] = "IN_PROGRESS";
|
|
6515
|
+
statusIntegration["ERROR"] = "ERROR";
|
|
6516
|
+
})(statusIntegration || (statusIntegration = {}));
|
|
6192
6517
|
|
|
6193
|
-
let
|
|
6518
|
+
let AgroInvoiceService = class AgroInvoiceService extends AgroEntityService {
|
|
6519
|
+
constructor(http, messageService, translate) {
|
|
6520
|
+
super(http, messageService, `agro/invoice/entities/invoice`, `agro/invoice/actions`, `agro/invoice/queries`, translate);
|
|
6521
|
+
this.http = http;
|
|
6522
|
+
this.messageService = messageService;
|
|
6523
|
+
this.translate = translate;
|
|
6524
|
+
this.pooling = new Subject();
|
|
6525
|
+
}
|
|
6526
|
+
invoiceLookupFilter(data) {
|
|
6527
|
+
return this.http
|
|
6528
|
+
.post(`${this.queriesUrl}/invoiceLookup`, data)
|
|
6529
|
+
.pipe(switchMap((res) => this.pollInvoiceResult(res.requestId)));
|
|
6530
|
+
}
|
|
6531
|
+
cancelActivePooling() {
|
|
6532
|
+
this.pooling.next();
|
|
6533
|
+
}
|
|
6534
|
+
pollInvoiceResult(requestId) {
|
|
6535
|
+
const delays = Array.from({ length: 10 }, (_, index) => {
|
|
6536
|
+
if (index === 0)
|
|
6537
|
+
return 1000;
|
|
6538
|
+
return (index + 1) * 1000;
|
|
6539
|
+
});
|
|
6540
|
+
return scheduled(delays, asyncScheduler).pipe(concatMap((delay) => timer(delay).pipe(switchMap(() => this.http.post(`${this.queriesUrl}/getInvoiceLookup`, { requestId })), tap((res) => {
|
|
6541
|
+
if (res.status === statusLookup.ERROR) {
|
|
6542
|
+
throw new Error(res.message);
|
|
6543
|
+
}
|
|
6544
|
+
}))), scan((_, curr) => curr, null), filter((res) => (res === null || res === void 0 ? void 0 : res.status) === statusLookup.FINISHED), take(1), defaultIfEmpty(null), takeUntil(this.pooling));
|
|
6545
|
+
}
|
|
6194
6546
|
};
|
|
6195
|
-
|
|
6196
|
-
|
|
6197
|
-
|
|
6198
|
-
|
|
6199
|
-
|
|
6200
|
-
|
|
6201
|
-
|
|
6547
|
+
AgroInvoiceService.ctorParameters = () => [
|
|
6548
|
+
{ type: HttpClient },
|
|
6549
|
+
{ type: MessageService },
|
|
6550
|
+
{ type: LibTranslationService }
|
|
6551
|
+
];
|
|
6552
|
+
AgroInvoiceService = __decorate([
|
|
6553
|
+
Injectable()
|
|
6554
|
+
], AgroInvoiceService);
|
|
6202
6555
|
|
|
6203
|
-
|
|
6204
|
-
|
|
6205
|
-
|
|
6206
|
-
|
|
6207
|
-
|
|
6208
|
-
|
|
6209
|
-
|
|
6210
|
-
|
|
6211
|
-
|
|
6212
|
-
|
|
6213
|
-
|
|
6214
|
-
|
|
6215
|
-
|
|
6216
|
-
|
|
6556
|
+
const INVOICE_ITEMS = "invoiceItems.*";
|
|
6557
|
+
let ModalInvoicePjSelectorComponent = class ModalInvoicePjSelectorComponent {
|
|
6558
|
+
constructor(translate, invoiceService) {
|
|
6559
|
+
this.translate = translate;
|
|
6560
|
+
this.invoiceService = invoiceService;
|
|
6561
|
+
this.whenSelectInvoices = new EventEmitter();
|
|
6562
|
+
this.buttonPriority = ButtonPriority;
|
|
6563
|
+
this.gridColumns = [
|
|
6564
|
+
{ field: "number", header: this.translate.instant("agro.angular_components.number") },
|
|
6565
|
+
{ field: "series", header: this.translate.instant("agro.angular_components.series") },
|
|
6566
|
+
{ field: "invoiceItems", header: this.translate.instant("agro.angular_components.itens") },
|
|
6567
|
+
{ field: "quantity", header: this.translate.instant("agro.angular_components.quantity") },
|
|
6568
|
+
{ field: "issuanceDate", header: this.translate.instant("agro.angular_components.issuance_date") },
|
|
6569
|
+
];
|
|
6570
|
+
this.dontHaveAnyInvoice = false;
|
|
6571
|
+
this.gridLoading = true;
|
|
6572
|
+
this.gridTotalRecords = AGRO_NUMBERS.ZERO;
|
|
6573
|
+
this.selected = [];
|
|
6574
|
+
this.unselectedIds = new Set();
|
|
6575
|
+
this.visible = false;
|
|
6576
|
+
this.searchValue = new FormControl("", []);
|
|
6577
|
+
this.ngUnsubscribe = new Subject();
|
|
6578
|
+
this.currentParams = {
|
|
6579
|
+
page: 0,
|
|
6580
|
+
size: 10,
|
|
6581
|
+
sort: [{ field: "issuanceDate", order: 1 }],
|
|
6582
|
+
displayFields: ["*", INVOICE_ITEMS, "issuanceDate"],
|
|
6583
|
+
filterQuery: "",
|
|
6584
|
+
};
|
|
6217
6585
|
}
|
|
6218
|
-
|
|
6219
|
-
|
|
6220
|
-
|
|
6586
|
+
ngOnDestroy() {
|
|
6587
|
+
this.ngUnsubscribe.next();
|
|
6588
|
+
this.ngUnsubscribe.complete();
|
|
6221
6589
|
}
|
|
6222
|
-
|
|
6223
|
-
|
|
6224
|
-
|
|
6225
|
-
|
|
6226
|
-
|
|
6590
|
+
ngOnInit() {
|
|
6591
|
+
this.whenSearchValueChanges();
|
|
6592
|
+
}
|
|
6593
|
+
whenSearchValueChanges() {
|
|
6594
|
+
this.searchValue.valueChanges
|
|
6595
|
+
.pipe(takeUntil(this.ngUnsubscribe))
|
|
6596
|
+
.pipe(debounceTime(AGRO_NUMBERS.THREE_HUNDRED))
|
|
6597
|
+
.subscribe((value) => {
|
|
6598
|
+
if (value) {
|
|
6599
|
+
this.updateGridData({ first: 0, rows: 10, multiSortMeta: [{ field: "issuanceDate", order: 1 }] }, value);
|
|
6600
|
+
}
|
|
6601
|
+
else {
|
|
6602
|
+
this.updateGridData({ first: 0, rows: 10, multiSortMeta: [{ field: "issuanceDate", order: 1 }] });
|
|
6603
|
+
}
|
|
6604
|
+
});
|
|
6605
|
+
}
|
|
6606
|
+
tryToSearchAgain() {
|
|
6607
|
+
this.gridLoading = true;
|
|
6608
|
+
this.updateGridData({ first: 0, rows: 10, multiSortMeta: [{ field: "issuanceDate", order: 1 }] });
|
|
6609
|
+
}
|
|
6610
|
+
open() {
|
|
6611
|
+
if (this.checkIfOptionsIsValid()) {
|
|
6612
|
+
this.visible = true;
|
|
6613
|
+
this.gridData = [];
|
|
6614
|
+
this.gridLoading = true;
|
|
6615
|
+
this.gridTotalRecords = 0;
|
|
6616
|
+
this.selected = [];
|
|
6617
|
+
this.unselectedIds.clear();
|
|
6618
|
+
this.currentParams = {
|
|
6619
|
+
page: 0,
|
|
6620
|
+
size: 10,
|
|
6621
|
+
sort: [],
|
|
6622
|
+
filterQuery: "",
|
|
6623
|
+
displayFields: ["*", INVOICE_ITEMS],
|
|
6624
|
+
};
|
|
6625
|
+
this.updateGridData({ first: 0, rows: 10, multiSortMeta: [{ field: "issuanceDate", order: 1 }] });
|
|
6626
|
+
this.selected = [];
|
|
6227
6627
|
}
|
|
6228
|
-
|
|
6229
|
-
|
|
6628
|
+
}
|
|
6629
|
+
checkIfOptionsIsValid() {
|
|
6630
|
+
if (!this.options) {
|
|
6631
|
+
return false;
|
|
6230
6632
|
}
|
|
6231
|
-
if (
|
|
6232
|
-
return
|
|
6633
|
+
if (!this.options.companyId || !this.options.branchId) {
|
|
6634
|
+
return false;
|
|
6233
6635
|
}
|
|
6234
|
-
return
|
|
6636
|
+
return true;
|
|
6235
6637
|
}
|
|
6236
|
-
|
|
6237
|
-
|
|
6238
|
-
|
|
6239
|
-
const
|
|
6240
|
-
|
|
6638
|
+
updateGridData(event, searchValue) {
|
|
6639
|
+
var _a;
|
|
6640
|
+
this.cancelPooling();
|
|
6641
|
+
const companyId = this.options.companyId;
|
|
6642
|
+
const branchId = this.options.branchId;
|
|
6643
|
+
const producerId = this.options.producersIds[0];
|
|
6644
|
+
const ruralEstateId = this.options.ruralEstateIds[0];
|
|
6645
|
+
const size = event.rows;
|
|
6646
|
+
const page = event.first / size;
|
|
6647
|
+
const sizePage = event.rows;
|
|
6648
|
+
this.currentParams = {
|
|
6649
|
+
page,
|
|
6650
|
+
size,
|
|
6651
|
+
sort: ((_a = event.multiSortMeta) === null || _a === void 0 ? void 0 : _a.length) ? event.multiSortMeta : [{ field: "issuanceDate", order: 1 }],
|
|
6652
|
+
displayFields: ["*", INVOICE_ITEMS, "issuanceDate"],
|
|
6653
|
+
};
|
|
6654
|
+
this.gridLoading = true;
|
|
6655
|
+
this.dontHaveAnyInvoice = false;
|
|
6656
|
+
const filterBody = {
|
|
6657
|
+
filter: {
|
|
6658
|
+
companyId,
|
|
6659
|
+
branchId,
|
|
6660
|
+
producerIds: [producerId],
|
|
6661
|
+
ruralEstateIds: [ruralEstateId],
|
|
6662
|
+
multiProducts: false,
|
|
6663
|
+
productId: this.options.productId,
|
|
6664
|
+
},
|
|
6665
|
+
pageRequest: {
|
|
6666
|
+
offset: page,
|
|
6667
|
+
size: sizePage,
|
|
6668
|
+
orderBy: this.currentParams.sort.map((sort) => ({ field: sort.field, order: sort.order === 1 ? "asc" : "desc" })),
|
|
6669
|
+
},
|
|
6670
|
+
};
|
|
6671
|
+
this.invoiceService
|
|
6672
|
+
.invoiceLookupFilter(filterBody)
|
|
6673
|
+
.pipe(takeUntil(this.ngUnsubscribe), finalize(() => {
|
|
6674
|
+
this.gridLoading = false;
|
|
6675
|
+
}))
|
|
6676
|
+
.subscribe((result) => {
|
|
6677
|
+
var _a;
|
|
6678
|
+
this.gridData = ((_a = result === null || result === void 0 ? void 0 : result.result) === null || _a === void 0 ? void 0 : _a.invoices) || [];
|
|
6679
|
+
if (this.gridData.length === 0 && !searchValue) {
|
|
6680
|
+
this.dontHaveAnyInvoice = true;
|
|
6681
|
+
}
|
|
6682
|
+
this.gridTotalRecords = result.result.totalElements;
|
|
6683
|
+
}, (error) => {
|
|
6684
|
+
console.info("Erro ao buscar notas fiscais: ", error);
|
|
6685
|
+
}, () => {
|
|
6686
|
+
this.gridLoading = false;
|
|
6687
|
+
});
|
|
6241
6688
|
}
|
|
6242
|
-
|
|
6243
|
-
|
|
6244
|
-
const len = digits.length;
|
|
6245
|
-
let ddiLen = 1;
|
|
6246
|
-
if (len >= 14)
|
|
6247
|
-
ddiLen = 3;
|
|
6248
|
-
else if (len >= 12)
|
|
6249
|
-
ddiLen = 2;
|
|
6250
|
-
const ddi = digits.slice(0, ddiLen);
|
|
6251
|
-
const ddd = digits.slice(ddiLen, ddiLen + 2);
|
|
6252
|
-
const number = digits.slice(ddiLen + 2);
|
|
6253
|
-
return { ddi, ddd, number };
|
|
6689
|
+
cancelPooling() {
|
|
6690
|
+
this.invoiceService.cancelActivePooling();
|
|
6254
6691
|
}
|
|
6255
|
-
|
|
6256
|
-
|
|
6257
|
-
|
|
6258
|
-
|
|
6259
|
-
|
|
6260
|
-
|
|
6261
|
-
|
|
6262
|
-
|
|
6263
|
-
|
|
6264
|
-
|
|
6265
|
-
return formatted;
|
|
6692
|
+
add() {
|
|
6693
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
6694
|
+
try {
|
|
6695
|
+
this.whenSelectInvoices.emit(this.selected);
|
|
6696
|
+
this.resetSpecs();
|
|
6697
|
+
}
|
|
6698
|
+
catch (error) {
|
|
6699
|
+
return null;
|
|
6700
|
+
}
|
|
6701
|
+
});
|
|
6266
6702
|
}
|
|
6267
|
-
|
|
6268
|
-
|
|
6269
|
-
|
|
6270
|
-
|
|
6271
|
-
|
|
6272
|
-
|
|
6273
|
-
|
|
6274
|
-
|
|
6703
|
+
resetSpecs() {
|
|
6704
|
+
this.selected = [];
|
|
6705
|
+
this.dontHaveAnyInvoice = false;
|
|
6706
|
+
this.visible = false;
|
|
6707
|
+
this.gridData = [];
|
|
6708
|
+
this.gridLoading = false;
|
|
6709
|
+
this.gridTotalRecords = 0;
|
|
6710
|
+
}
|
|
6711
|
+
cancel() {
|
|
6712
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
6713
|
+
this.resetSpecs();
|
|
6714
|
+
});
|
|
6715
|
+
}
|
|
6716
|
+
getItemsQuantity(row) {
|
|
6717
|
+
var _a;
|
|
6718
|
+
return ((_a = row.invoiceItems) === null || _a === void 0 ? void 0 : _a.reduce((sum, item) => sum + (item.quantity || 0), 0)) || 0;
|
|
6275
6719
|
}
|
|
6276
6720
|
};
|
|
6277
|
-
|
|
6278
|
-
|
|
6279
|
-
|
|
6721
|
+
ModalInvoicePjSelectorComponent.ctorParameters = () => [
|
|
6722
|
+
{ type: LibTranslationService },
|
|
6723
|
+
{ type: AgroInvoiceService }
|
|
6724
|
+
];
|
|
6725
|
+
__decorate([
|
|
6726
|
+
Input()
|
|
6727
|
+
], ModalInvoicePjSelectorComponent.prototype, "options", void 0);
|
|
6728
|
+
__decorate([
|
|
6729
|
+
Output()
|
|
6730
|
+
], ModalInvoicePjSelectorComponent.prototype, "whenSelectInvoices", void 0);
|
|
6731
|
+
ModalInvoicePjSelectorComponent = __decorate([
|
|
6732
|
+
Component({
|
|
6733
|
+
selector: "s-modal-invoice-pj-selector",
|
|
6734
|
+
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",
|
|
6735
|
+
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}"]
|
|
6736
|
+
})
|
|
6737
|
+
], ModalInvoicePjSelectorComponent);
|
|
6280
6738
|
|
|
6281
|
-
let
|
|
6739
|
+
let AgroInvoiceModule = class AgroInvoiceModule {
|
|
6282
6740
|
};
|
|
6283
|
-
|
|
6741
|
+
AgroInvoiceModule = __decorate([
|
|
6284
6742
|
NgModule({
|
|
6285
|
-
|
|
6286
|
-
|
|
6287
|
-
|
|
6743
|
+
imports: [
|
|
6744
|
+
HttpClientModule,
|
|
6745
|
+
PermissionsModule.forChild([
|
|
6746
|
+
{
|
|
6747
|
+
name: 'invoice',
|
|
6748
|
+
actions: ['Visualizar', 'Incluir', 'Editar', 'Excluir'],
|
|
6749
|
+
uri: `res://senior.com.br/agro/origination/entities/invoice`,
|
|
6750
|
+
},
|
|
6751
|
+
]),
|
|
6752
|
+
],
|
|
6753
|
+
providers: [
|
|
6754
|
+
AgroInvoiceService,
|
|
6755
|
+
],
|
|
6756
|
+
declarations: [],
|
|
6757
|
+
exports: [],
|
|
6288
6758
|
})
|
|
6289
|
-
],
|
|
6759
|
+
], AgroInvoiceModule);
|
|
6760
|
+
|
|
6761
|
+
let ModalInvoicePjSelectorModule = class ModalInvoicePjSelectorModule {
|
|
6762
|
+
};
|
|
6763
|
+
ModalInvoicePjSelectorModule = __decorate([
|
|
6764
|
+
NgModule({
|
|
6765
|
+
declarations: [ModalInvoicePjSelectorComponent],
|
|
6766
|
+
providers: [DecimalPipe, DatePipe],
|
|
6767
|
+
imports: [
|
|
6768
|
+
CommonModule,
|
|
6769
|
+
ReactiveFormsModule,
|
|
6770
|
+
LocaleModule.forChild(),
|
|
6771
|
+
EmptyStateModule,
|
|
6772
|
+
BignumberInputModule,
|
|
6773
|
+
InputTextModule$1,
|
|
6774
|
+
ButtonModule,
|
|
6775
|
+
TableModule$1,
|
|
6776
|
+
SharedModule$2,
|
|
6777
|
+
TableModule,
|
|
6778
|
+
AgroInvoiceModule,
|
|
6779
|
+
DialogModule,
|
|
6780
|
+
KilogramModule,
|
|
6781
|
+
LoadingStateModule,
|
|
6782
|
+
ConfirmDialogModule$1,
|
|
6783
|
+
LibTranslationModule,
|
|
6784
|
+
KilogramModule,
|
|
6785
|
+
TableHeaderCheckboxModule,
|
|
6786
|
+
],
|
|
6787
|
+
exports: [ModalInvoicePjSelectorComponent],
|
|
6788
|
+
})
|
|
6789
|
+
], ModalInvoicePjSelectorModule);
|
|
6290
6790
|
|
|
6291
6791
|
var AgroAngularComponentsModule_1;
|
|
6292
6792
|
const HostProjectConfigsInjectionToken = new InjectionToken("hostProjectConfigs");
|
|
@@ -6311,5 +6811,5 @@ AgroAngularComponentsModule = AgroAngularComponentsModule_1 = __decorate([
|
|
|
6311
6811
|
* Generated bundle index. Do not edit.
|
|
6312
6812
|
*/
|
|
6313
6813
|
|
|
6314
|
-
export { AGRO_NUMBERS, AGRO_REGEX, AgroAngularComponentsModule, AgroArrayUtils, AgroCookieUtils, AgroDateUtils, AgroEntityStatus, AgroFormValidator, AgroLogics, AgroNameUtils, AgroNumberUtils, AgroObjectUtils, AgroPlatformUtils, AgroStringMasks, AgroStringUtils, AsyncLock, CancelEventDialogComponent, CancelEventDialogModule, CnpjCpfPipe, CnpjCpfPipeModule, Colors, DateComparisonType, E001TnsModule, E001pesModule, E070EmpModule, E070FilModule, E075DerModule, E205depService, EventControlBoardComponent, EventControlBoardModule, EventControlBoardService, EventControlItemModule, EventControlModule, EventStepsComponent, EventStepsModule, ExternalInvoiceModule, FixationModule, HostProjectConfigsInjectionToken, HttpCodes, InvoiceModule, LibTranslatePipe, LibTranslationModule, LibTranslationService, NumberComparisonType, OriginationModule, PaginatorStorageService, PrimitiveManager, ProducerInvoiceModule, RuralEstateModule, SharedModule, StringifierPipe, StringifierPipeModule, TelephonePipe, TelephonePipeModule, TicketModule, TransferModule, UserInformationService, WebsocketModule, WebsocketService, LibTranslatePipe as ɵa, LibTranslationService as ɵb };
|
|
6814
|
+
export { AGRO_NUMBERS, AGRO_REGEX, AgroAngularComponentsModule, AgroArrayUtils, AgroCookieUtils, AgroDateUtils, AgroEntityStatus, AgroFormValidator, AgroInvoiceModule, AgroInvoiceService, AgroLogics, AgroNameUtils, AgroNumberUtils, AgroObjectUtils, AgroPlatformUtils, AgroStringMasks, AgroStringUtils, AsyncLock, CancelEventDialogComponent, CancelEventDialogModule, CnpjCpfPipe, CnpjCpfPipeModule, Colors, DateComparisonType, E001TnsModule, E001pesModule, E070EmpModule, E070FilModule, E075DerModule, E205depService, EventControlBoardComponent, EventControlBoardModule, EventControlBoardService, EventControlItemModule, EventControlModule, EventStepsComponent, EventStepsModule, ExternalInvoiceModule, FixationModule, HostProjectConfigsInjectionToken, HttpCodes, InvoiceModule, KilogramModule, KilogramPipe, LibTranslatePipe, LibTranslationModule, LibTranslationService, ModalInvoicePjSelectorComponent, ModalInvoicePjSelectorModule, NumberComparisonType, OriginationModule, PaginatorStorageService, PrimitiveManager, ProducerInvoiceModule, RuralEstateModule, SharedModule, StringifierPipe, StringifierPipeModule, TelephonePipe, TelephonePipeModule, TicketModule, TransferModule, UserInformationService, WebsocketModule, WebsocketService, LibTranslatePipe as ɵa, LibTranslationService as ɵb };
|
|
6315
6815
|
//# sourceMappingURL=senior-agronegocio-angular-components.js.map
|