@senior-agronegocio/angular-components 0.0.9875 → 0.0.9880

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.
Files changed (29) hide show
  1. package/bundles/senior-agronegocio-angular-components.umd.js +315 -268
  2. package/bundles/senior-agronegocio-angular-components.umd.js.map +1 -1
  3. package/bundles/senior-agronegocio-angular-components.umd.min.js +2 -2
  4. package/bundles/senior-agronegocio-angular-components.umd.min.js.map +1 -1
  5. package/components/event-control-board/common/event-operation.d.ts +2 -1
  6. package/components/event-control-board/event-control-board.component.d.ts +1 -1
  7. package/components/modal-invoice-pj/modal-shared-imports.d.ts +4 -7
  8. package/esm2015/components/event-control-board/common/event-operation.js +2 -1
  9. package/esm2015/components/event-control-board/event-control-board.component.js +6 -5
  10. package/esm2015/components/financial-title-table/financial-title-table.component.js +2 -2
  11. package/esm2015/components/modal-invoice-pj/for-fixation/modal-invoice-pj-for-fixation.component.js +7 -7
  12. package/esm2015/services/i18n/en-US.js +17 -2
  13. package/esm2015/services/i18n/es-CO.js +26 -3
  14. package/esm2015/services/i18n/pt-BR.js +31 -24
  15. package/esm5/components/event-control-board/common/event-operation.js +2 -1
  16. package/esm5/components/event-control-board/event-control-board.component.js +6 -5
  17. package/esm5/components/financial-title-table/financial-title-table.component.js +2 -2
  18. package/esm5/components/modal-invoice-pj/for-fixation/modal-invoice-pj-for-fixation.component.js +7 -7
  19. package/esm5/services/i18n/en-US.js +17 -2
  20. package/esm5/services/i18n/es-CO.js +26 -3
  21. package/esm5/services/i18n/pt-BR.js +31 -24
  22. package/fesm2015/senior-agronegocio-angular-components.js +295 -248
  23. package/fesm2015/senior-agronegocio-angular-components.js.map +1 -1
  24. package/fesm5/senior-agronegocio-angular-components.js +315 -268
  25. package/fesm5/senior-agronegocio-angular-components.js.map +1 -1
  26. package/package.json +1 -1
  27. package/services/i18n/en-US.d.ts +16 -1
  28. package/services/i18n/es-CO.d.ts +24 -1
  29. package/services/i18n/pt-BR.d.ts +29 -22
@@ -1010,28 +1010,28 @@
1010
1010
  "agro.angular_components.CIDASC_DATA_LOAD_COMPOSED_MEASURE_UNIT": "Carga Cidasc - Medida por hectare",
1011
1011
  "agro.angular_components.PRESCRIPTION_DATA_LOAD": "Carga de dados do NovoReceituário",
1012
1012
  "agro.angular_components.agronomic_prescription_origin_event": "Receituário Agronômico",
1013
- 'agro.angular_components.PRESCRIPTION_DATA_LOAD_PRODUCT_TYPE': 'Carga de dados do NovoReceituário - Tipo de Produto',
1014
- 'agro.angular_components.PRESCRIPTION_DATA_LOAD_ACTIVE_PRINCIPLE': 'Carga de dados do NovoReceituário - Princípio Ativo',
1015
- 'agro.angular_components.PRESCRIPTION_DATA_LOAD_FORMULATION': 'Carga de dados do NovoReceituário - Formulação',
1016
- 'agro.angular_components.PRESCRIPTION_DATA_LOAD_BULLETIN': 'Carga de dados do NovoReceituário - Bula',
1017
- 'agro.angular_components.PRESCRIPTION_DATA_LOAD_APPLICATION_UNIT': 'Carga de dados do NovoReceituário - Unidade de aplicação',
1018
- 'agro.angular_components.PRESCRIPTION_DATA_LOAD_SPECIE': 'Carga de dados do NovoReceituário - Espécie',
1019
- 'agro.angular_components.PRESCRIPTION_DATA_LOAD_APPLICATION_TYPE': 'Carga de dados do NovoReceituário - Tipo de aplicação',
1020
- 'agro.angular_components.PRESCRIPTION_DATA_LOAD_PROBLEMS': 'Carga de dados do NovoReceituário - Pragas e problemas',
1021
- 'agro.angular_components.PRESCRIPTION_DATA_LOAD_APPLICATION': 'Carga de dados do NovoReceituário - Aplicação',
1022
- 'agro.angular_components.PRESCRIPTION_DATA_LOAD_END': 'Carga de dados do NovoReceituário - Finalizar integração',
1023
- 'agro.angular_components.new_prescription_page': 'Parte {count}',
1024
- 'agro.angular_components.number_or_series': 'Número',
1025
- 'agro.angular_components.panel_title_external_invoice_add_external_invoice': 'Adicionar nota fiscal',
1026
- 'agro.angular_components.add_pj_invoice_modal_no_invoices_found': 'Nenhuma nota fiscal disponível para este produtor',
1027
- 'agro.angular_components.number': 'Número',
1028
- 'agro.angular_components.series': 'Série',
1029
- 'agro.angular_components.itens': 'Itens',
1030
- 'agro.angular_components.quantity': 'Quantidade',
1031
- 'agro.angular_components.issuance_date': 'Data de emissão',
1032
- 'agro.angular_components.no_register_found_for_external_invoices_summary': 'Nenhuma nota encontrada',
1033
- 'agro.angular_components.total_value': 'Valor total',
1034
- 'agro.angular_components.value_linked': 'Valor vinculado',
1013
+ "agro.angular_components.PRESCRIPTION_DATA_LOAD_PRODUCT_TYPE": "Carga de dados do NovoReceituário - Tipo de Produto",
1014
+ "agro.angular_components.PRESCRIPTION_DATA_LOAD_ACTIVE_PRINCIPLE": "Carga de dados do NovoReceituário - Princípio Ativo",
1015
+ "agro.angular_components.PRESCRIPTION_DATA_LOAD_FORMULATION": "Carga de dados do NovoReceituário - Formulação",
1016
+ "agro.angular_components.PRESCRIPTION_DATA_LOAD_BULLETIN": "Carga de dados do NovoReceituário - Bula",
1017
+ "agro.angular_components.PRESCRIPTION_DATA_LOAD_APPLICATION_UNIT": "Carga de dados do NovoReceituário - Unidade de aplicação",
1018
+ "agro.angular_components.PRESCRIPTION_DATA_LOAD_SPECIE": "Carga de dados do NovoReceituário - Espécie",
1019
+ "agro.angular_components.PRESCRIPTION_DATA_LOAD_APPLICATION_TYPE": "Carga de dados do NovoReceituário - Tipo de aplicação",
1020
+ "agro.angular_components.PRESCRIPTION_DATA_LOAD_PROBLEMS": "Carga de dados do NovoReceituário - Pragas e problemas",
1021
+ "agro.angular_components.PRESCRIPTION_DATA_LOAD_APPLICATION": "Carga de dados do NovoReceituário - Aplicação",
1022
+ "agro.angular_components.PRESCRIPTION_DATA_LOAD_END": "Carga de dados do NovoReceituário - Finalizar integração",
1023
+ "agro.angular_components.new_prescription_page": "Parte {count}",
1024
+ "agro.angular_components.number_or_series": "Número",
1025
+ "agro.angular_components.panel_title_external_invoice_add_external_invoice": "Adicionar nota fiscal",
1026
+ "agro.angular_components.add_pj_invoice_modal_no_invoices_found": "Nenhuma nota fiscal disponível para este produtor",
1027
+ "agro.angular_components.number": "Número",
1028
+ "agro.angular_components.series": "Série",
1029
+ "agro.angular_components.itens": "Itens",
1030
+ "agro.angular_components.quantity": "Quantidade",
1031
+ "agro.angular_components.issuance_date": "Data de emissão",
1032
+ "agro.angular_components.no_register_found_for_external_invoices_summary": "Nenhuma nota encontrada",
1033
+ "agro.angular_components.total_value": "Valor total",
1034
+ "agro.angular_components.value_linked": "Valor vinculado",
1035
1035
  "agro.angular_components.no_accounts_found_title": "Nenhuma conta encontrada",
1036
1036
  "agro.angular_components.no_accounts_found_description": "Não foram encontradas contas para o produtor selecionado.",
1037
1037
  "agro.angular_components.details": "Detalhes",
@@ -1061,7 +1061,14 @@
1061
1061
  "agro.angular_components.error_loading_accounts_description": "Ocorreu um erro ao carregar as contas do produtor. Tente novamente mais tarde.",
1062
1062
  "agro.angular_components.close": "Fechar",
1063
1063
  "agro.angular_components.value_paid": "Valor a pagar",
1064
- "agro.angular_components.timeout_request_error": "Tempo de requisição excedida. Tente novamente mais tarde."
1064
+ "agro.angular_components.timeout_request_error": "Tempo de requisição excedida. Tente novamente mais tarde.",
1065
+ "agro.angular_components.max_linked_invoices": "Valor máximo de notas vinculadas atingido",
1066
+ "agro.angular_components.max_linked_invoices_description": "Todos os itens de fixação já estão com o valor máximo de notas vinculadas",
1067
+ "agro.angular_components.invoice_created_successfully": "Nota fiscal criada com sucesso.",
1068
+ "agro.angular_components.invoice_already_linked": "Nota fiscal já está totalmente vinculada a outro item",
1069
+ "agro.angular_components.link_invoice": "Vincular nota fiscal",
1070
+ "agro.grain_classification.label_number": "Ticket",
1071
+ "agro.grain_classification.origination_create_stock_movement_event": "Movimentação de estoque",
1065
1072
  };
1066
1073
 
1067
1074
  var enUS = {
@@ -1329,7 +1336,7 @@
1329
1336
  "agro.angular_components.PRESCRIPTION_DATA_LOAD_PROBLEMS": "NewPrescription data load - Pests and Problems",
1330
1337
  "agro.angular_components.PRESCRIPTION_DATA_LOAD_APPLICATION": "NewPrescription data load - Application",
1331
1338
  "agro.angular_components.PRESCRIPTION_DATA_LOAD_END": "NewPrescription data load - End Integration",
1332
- 'agro.angular_components.new_prescription_page': 'Part {count}',
1339
+ "agro.angular_components.new_prescription_page": "Part {count}",
1333
1340
  "agro.angular_components.number_or_series": "Número ou série",
1334
1341
  "agro.angular_components.panel_title_external_invoice_add_external_invoice": "Adicionar nota fiscal",
1335
1342
  "agro.angular_components.add_pj_invoice_modal_no_invoices_found": "Nenhuma nota fiscal disponível para este produtor",
@@ -1368,6 +1375,21 @@
1368
1375
  "agro.angular_components.close": "Close",
1369
1376
  "agro.angular_components.value_paid": "Value to pay",
1370
1377
  "agro.angular_components.timeout_request_error": "Request timeout. Please try again later.",
1378
+ "agro.angular_components.TRANSFER_CANCEL_INCOMING_INVOICE": "Incoming invoice cancellation",
1379
+ "agro.angular_components.TRANSFER_CANCEL_OUTGOING_INVOICE": "Outgoing invoice cancellation",
1380
+ "agro.angular_components.TRANSFER_REVERSE_PRODUCER_BALANCE": "Producer balance reversal",
1381
+ "agro.angular_components.TRANSFER_CONCLUDE_CANCEL": "Cancellation conclusion",
1382
+ "agro.angular_components.no_register_found_for_external_invoices_summary": "No invoices found",
1383
+ "agro.angular_components.total_value": "Total value",
1384
+ "agro.angular_components.value_linked": "Linked value",
1385
+ "agro.grain_classification.label_number": "Ticket",
1386
+ "agro.grain_classification.ticket_search_label": "Search Ticket",
1387
+ "agro.grain_classification.origination_create_stock_movement_event": "Stock Movement",
1388
+ "agro.angular_components.max_linked_invoices": "Maximum linked invoices value reached",
1389
+ "agro.angular_components.max_linked_invoices_description": "All fixation items already have the maximum value of linked invoices",
1390
+ "agro.angular_components.invoice_created_successfully": "Invoice created successfully.",
1391
+ "agro.angular_components.invoice_already_linked": "Invoice is already fully linked to another item",
1392
+ "agro.angular_components.link_invoice": "Link invoice",
1371
1393
  };
1372
1394
 
1373
1395
  var esCO = {
@@ -1634,7 +1656,7 @@
1634
1656
  "agro.angular_components.PRESCRIPTION_DATA_LOAD_PROBLEMS": "Carga de datos de la Nueva Receta - Plagas y problemas",
1635
1657
  "agro.angular_components.PRESCRIPTION_DATA_LOAD_APPLICATION": "Carga de datos de la Nueva Receta - Aplicación",
1636
1658
  "agro.angular_components.PRESCRIPTION_DATA_LOAD_END": "Carga de datos de la Nueva Receta - Finalizar integración",
1637
- 'agro.angular_components.new_prescription_page': 'Parte {count}',
1659
+ "agro.angular_components.new_prescription_page": "Parte {count}",
1638
1660
  "agro.angular_components.agronomic_prescription_origin_event": "Recetario Agronómico",
1639
1661
  "agro.angular_components.no_accounts_found_title": "Ninguna cuenta encontrada",
1640
1662
  "agro.angular_components.no_accounts_found_description": "No se encontraron cuentas para el productor seleccionado.",
@@ -1665,7 +1687,30 @@
1665
1687
  "agro.angular_components.error_loading_accounts_description": "Ocurrió un error al cargar las cuentas del productor. Intente nuevamente más tarde.",
1666
1688
  "agro.angular_components.close": "Cerrar",
1667
1689
  "agro.angular_components.value_paid": "Valor a pagar",
1668
- "agro.angular_components.timeout_request_error": "Tiempo de solicitud excedido. Intente nuevamente más tarde."
1690
+ "agro.angular_components.timeout_request_error": "Tiempo de solicitud excedido. Intente nuevamente más tarde.",
1691
+ "agro.angular_components.TRANSFER_CANCEL_INCOMING_INVOICE": "Cancelación de NF de entrada",
1692
+ "agro.angular_components.TRANSFER_CANCEL_OUTGOING_INVOICE": "Cancelación de NF de salida ",
1693
+ "agro.angular_components.TRANSFER_REVERSE_PRODUCER_BALANCE": "Reverso de los saldos de productores",
1694
+ "agro.angular_components.TRANSFER_CONCLUDE_CANCEL": "Conclusión de la cancelación",
1695
+ "agro.angular_components.panel_title_external_invoice_add_external_invoice": "Agregar factura",
1696
+ "agro.angular_components.add_pj_invoice_modal_no_invoices_found": "Ninguna factura disponible para este productor",
1697
+ "agro.angular_components.number": "Número",
1698
+ "agro.angular_components.series": "Serie",
1699
+ "agro.angular_components.itens": "Ítems",
1700
+ "agro.angular_components.quantity": "Cantidad",
1701
+ "agro.angular_components.issuance_date": "Fecha de emisión",
1702
+ "agro.angular_components.no_register_found_for_external_invoices_summary": "Ninguna nota encontrada",
1703
+ "agro.angular_components.total_value": "Valor total",
1704
+ "agro.angular_components.value_linked": "Valor vinculado",
1705
+ "agro.angular_components.number_or_series": "Número o serie",
1706
+ "agro.grain_classification.label_number": "Ticket",
1707
+ "agro.grain_classification.ticket_search_label": "Consultar Ticket",
1708
+ "agro.grain_classification.origination_create_stock_movement_event": "Movimiento de inventario",
1709
+ "agro.angular_components.max_linked_invoices": "Valor máximo de facturas vinculadas alcanzado",
1710
+ "agro.angular_components.max_linked_invoices_description": "Todos los ítems de fijación ya tienen el valor máximo de facturas vinculadas",
1711
+ "agro.angular_components.invoice_created_successfully": "Factura creada con éxito.",
1712
+ "agro.angular_components.invoice_already_linked": "La factura ya está totalmente vinculada a otro ítem",
1713
+ "agro.angular_components.link_invoice": "Vincular factura",
1669
1714
  };
1670
1715
 
1671
1716
 
@@ -5552,6 +5597,238 @@
5552
5597
  return EventStepsModule;
5553
5598
  }());
5554
5599
 
5600
+ var ProducerInvoice = /** @class */ (function () {
5601
+ function ProducerInvoice() {
5602
+ }
5603
+ ProducerInvoice.fromDto = function (producerInvoiceDto, originEntity) {
5604
+ var model = __assign({}, producerInvoiceDto);
5605
+ model.createdDate = model.createdDate && moment(model.createdDate).toDate();
5606
+ model.lastModifiedDate = model.lastModifiedDate && moment(model.lastModifiedDate).toDate();
5607
+ var lookupSeparator = " - ";
5608
+ var displayFields = [
5609
+ "id",
5610
+ "weight",
5611
+ "percentage",
5612
+ "invoiceErpxId",
5613
+ "provisionalId",
5614
+ "effectiveId",
5615
+ "isMainProducer",
5616
+ "createdBy",
5617
+ "createdDate",
5618
+ "lastModifiedBy",
5619
+ "lastModifiedDate",
5620
+ ];
5621
+ model.label = displayFields.map(function (field) { return model[field]; }).join(lookupSeparator);
5622
+ return model;
5623
+ };
5624
+ ProducerInvoice.toDto = function (producerInvoice, originEntity) {
5625
+ var dto = __assign({}, producerInvoice);
5626
+ dto.createdDate = dto.createdDate && moment(dto.createdDate).format();
5627
+ dto.lastModifiedDate = dto.lastModifiedDate && moment(dto.lastModifiedDate).format();
5628
+ delete dto.label;
5629
+ return dto;
5630
+ };
5631
+ return ProducerInvoice;
5632
+ }());
5633
+
5634
+ var AgroEntityService = /** @class */ (function () {
5635
+ function AgroEntityService(http, messageService, entityUrl, actionsUrl, queriesUrl, translate) {
5636
+ this.http = http;
5637
+ this.messageService = messageService;
5638
+ this.entityUrl = entityUrl;
5639
+ this.actionsUrl = actionsUrl;
5640
+ this.queriesUrl = queriesUrl;
5641
+ this.translate = translate;
5642
+ this.http = http;
5643
+ this.messageService = messageService;
5644
+ this.entityUrl = entityUrl;
5645
+ this.actionsUrl = actionsUrl;
5646
+ this.queriesUrl = queriesUrl;
5647
+ this.translate = translate;
5648
+ this.defaultCatch = this.defaultCatch.bind(this);
5649
+ }
5650
+ AgroEntityService.prototype.getListQueryParams = function (listParams) {
5651
+ var ten = 10;
5652
+ 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;
5653
+ var params = new http.HttpParams();
5654
+ params = params.append('size', String(size));
5655
+ params = params.append('offset', String(page));
5656
+ if (sort === null || sort === void 0 ? void 0 : sort.length) {
5657
+ params = params.append('orderby', sort.map(this.getBodyFilters()).join(', '));
5658
+ }
5659
+ if (filterQuery) {
5660
+ params = params.append('filter', filterQuery);
5661
+ }
5662
+ if (displayFields === null || displayFields === void 0 ? void 0 : displayFields.length) {
5663
+ params = params.append('displayfields', displayFields.join());
5664
+ }
5665
+ return params;
5666
+ };
5667
+ AgroEntityService.prototype.getBodyParams = function (listParams) {
5668
+ var ten = 10;
5669
+ 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;
5670
+ var bodyParams = {};
5671
+ bodyParams.size = size;
5672
+ bodyParams.offset = page;
5673
+ if (sort === null || sort === void 0 ? void 0 : sort.length) {
5674
+ bodyParams.orderBy = sort.map(this.getBodyFilters()).join(', ');
5675
+ }
5676
+ if (filterQuery) {
5677
+ bodyParams.filter = filterQuery;
5678
+ }
5679
+ if (displayFields === null || displayFields === void 0 ? void 0 : displayFields.length) {
5680
+ bodyParams.displayfields = displayFields.join();
5681
+ }
5682
+ return bodyParams;
5683
+ };
5684
+ AgroEntityService.prototype.getBodyFilters = function () {
5685
+ return function (s) {
5686
+ var order = '';
5687
+ if (s.order === 1) {
5688
+ order = ' asc';
5689
+ }
5690
+ if (s.order === -1) {
5691
+ order = ' desc';
5692
+ }
5693
+ return "" + s.field + order;
5694
+ };
5695
+ };
5696
+ AgroEntityService.prototype.defaultCatch = function (errorMsgs) {
5697
+ var _this = this;
5698
+ if (errorMsgs === void 0) { errorMsgs = []; }
5699
+ var unauthorized401 = 401;
5700
+ errorMsgs = __spread(errorMsgs);
5701
+ var zero = 0;
5702
+ return operators.catchError(function (err) {
5703
+ if (err) {
5704
+ var errorMessage = errorMsgs.find(function (eMsg) { return eMsg.status === (err === null || err === void 0 ? void 0 : err.status) || zero; });
5705
+ var summary = err.status ? String(err.status) : 'Error';
5706
+ var detail = _this.getErrorMessage(err);
5707
+ if (err.status === unauthorized401) {
5708
+ summary = _this.translate.instant('agro.angular_components.error_unauthorized_title');
5709
+ detail = _this.translate.instant('agro.angular_components.error_unauthorized_description');
5710
+ }
5711
+ if (errorMessage) {
5712
+ summary = errorMessage.summary ? _this.translate.instant(errorMessage.summary) : summary;
5713
+ detail = errorMessage.detail ? _this.translate.instant(errorMessage.detail) : detail;
5714
+ }
5715
+ _this.messageService.add({
5716
+ severity: 'error',
5717
+ summary: summary,
5718
+ detail: detail,
5719
+ });
5720
+ }
5721
+ return rxjs.throwError(err);
5722
+ });
5723
+ };
5724
+ AgroEntityService.prototype.getErrorMessage = function (err) {
5725
+ var _a;
5726
+ if ((_a = err === null || err === void 0 ? void 0 : err.error) === null || _a === void 0 ? void 0 : _a.message) {
5727
+ return err.error.message;
5728
+ }
5729
+ if (err.statusText) {
5730
+ return err.statusText;
5731
+ }
5732
+ if (err.message) {
5733
+ return err.message;
5734
+ }
5735
+ return 'Error';
5736
+ };
5737
+ AgroEntityService.prototype.list = function (listParams, errorMessage) {
5738
+ if (errorMessage === void 0) { errorMessage = []; }
5739
+ return this.http
5740
+ .get(this.entityUrl, { params: this.getListQueryParams(listParams) })
5741
+ .pipe(this.defaultCatch(errorMessage));
5742
+ };
5743
+ AgroEntityService.prototype.get = function (id, errorMessage) {
5744
+ if (errorMessage === void 0) { errorMessage = []; }
5745
+ return this.http.get(this.entityUrl + "/" + id).pipe(this.defaultCatch(errorMessage));
5746
+ };
5747
+ AgroEntityService.prototype.insert = function (entity, errorMessage) {
5748
+ if (errorMessage === void 0) { errorMessage = []; }
5749
+ return this.http.post("" + this.entityUrl, entity).pipe(this.defaultCatch(errorMessage));
5750
+ };
5751
+ AgroEntityService.prototype.update = function (id, entity, errorMessage) {
5752
+ if (errorMessage === void 0) { errorMessage = []; }
5753
+ return this.http.put(this.entityUrl + "/" + id, entity).pipe(this.defaultCatch(errorMessage));
5754
+ };
5755
+ AgroEntityService.prototype.delete = function (id, errorMessage) {
5756
+ if (errorMessage === void 0) { errorMessage = []; }
5757
+ return this.http.delete(this.entityUrl + "/" + id).pipe(this.defaultCatch(errorMessage));
5758
+ };
5759
+ AgroEntityService.prototype.listCustomFilter = function (listParams, action, errorMessage) {
5760
+ if (errorMessage === void 0) { errorMessage = []; }
5761
+ return this.http
5762
+ .post(this.actionsUrl + "/" + action, this.getBodyParams(listParams))
5763
+ .pipe(this.defaultCatch(errorMessage));
5764
+ };
5765
+ AgroEntityService.prototype.insertBulk = function (entities) {
5766
+ var body = entities ? { entities: entities } : {};
5767
+ return this.http.post(this.entityUrl + "/bulk", body).pipe(this.defaultCatch());
5768
+ };
5769
+ return AgroEntityService;
5770
+ }());
5771
+
5772
+ var ProducerInvoiceService = /** @class */ (function (_super) {
5773
+ __extends(ProducerInvoiceService, _super);
5774
+ function ProducerInvoiceService(http, messageService, translate) {
5775
+ var _this = _super.call(this, http, messageService, "agro/origination/entities/producerInvoice", "agro/origination/actions", "agro/origination/queries", translate) || this;
5776
+ _this.http = http;
5777
+ _this.messageService = messageService;
5778
+ _this.translate = translate;
5779
+ return _this;
5780
+ }
5781
+ ProducerInvoiceService.prototype.getTotalLinkedInInvoices = function (invoiceId, fixationId) {
5782
+ return __awaiter(this, void 0, void 0, function () {
5783
+ var filter;
5784
+ var _this = this;
5785
+ return __generator(this, function (_a) {
5786
+ filter = "fixationItem.fixation.id eq '" + fixationId + "' " + ("and invoiceId in ('" + invoiceId.join("','") + "') ");
5787
+ return [2 /*return*/, new Promise(function (resolve, reject) {
5788
+ _this.list({
5789
+ filterQuery: filter,
5790
+ size: exports.AGRO_NUMBERS.ONE_HUNDRED,
5791
+ }).subscribe({
5792
+ next: function (data) {
5793
+ var invoiceList = data.contents;
5794
+ var producerInvoice = new Map();
5795
+ if (invoiceList.length) {
5796
+ invoiceList.forEach(function (invoice) {
5797
+ var _a;
5798
+ producerInvoice.set(invoice.invoiceId, ((_a = producerInvoice.get(invoice.invoiceId)) !== null && _a !== void 0 ? _a : 0) + invoice.linkedValue);
5799
+ });
5800
+ }
5801
+ resolve(Array.from(producerInvoice.entries()).map(function (_a) {
5802
+ var _b = __read(_a, 2), key = _b[0], value = _b[1];
5803
+ return {
5804
+ invoiceId: key,
5805
+ totalLinked: value,
5806
+ };
5807
+ }));
5808
+ },
5809
+ error: function (err) { return reject(new Error(typeof err === 'string' ? err : JSON.stringify(err))); },
5810
+ });
5811
+ })];
5812
+ });
5813
+ });
5814
+ };
5815
+ ProducerInvoiceService.prototype.deleteAllProducerInvoice = function (fixationId) {
5816
+ return this.http.post(this.actionsUrl + "/deleteAllProducerInvoice", { fixationId: fixationId }).pipe(this.defaultCatch());
5817
+ };
5818
+ ProducerInvoiceService.ctorParameters = function () { return [
5819
+ { type: http.HttpClient },
5820
+ { type: api.MessageService },
5821
+ { type: LibTranslationService }
5822
+ ]; };
5823
+ ProducerInvoiceService.ɵprov = core["ɵɵdefineInjectable"]({ factory: function ProducerInvoiceService_Factory() { return new ProducerInvoiceService(core["ɵɵinject"](http.HttpClient), core["ɵɵinject"](api.MessageService), core["ɵɵinject"](LibTranslationService)); }, token: ProducerInvoiceService, providedIn: "root" });
5824
+ ProducerInvoiceService = __decorate([
5825
+ core.Injectable({
5826
+ providedIn: 'root'
5827
+ })
5828
+ ], ProducerInvoiceService);
5829
+ return ProducerInvoiceService;
5830
+ }(AgroEntityService));
5831
+
5555
5832
  var CancelEventDialogComponent = /** @class */ (function () {
5556
5833
  function CancelEventDialogComponent(formBuilder, config, ref, translate) {
5557
5834
  this.formBuilder = formBuilder;
@@ -5722,6 +5999,7 @@
5722
5999
  EventOperation["PRESCRIPTION_DATA_LOAD_PROBLEMS"] = "PRESCRIPTION_DATA_LOAD_PROBLEMS";
5723
6000
  EventOperation["PRESCRIPTION_DATA_LOAD_APPLICATION"] = "PRESCRIPTION_DATA_LOAD_APPLICATION";
5724
6001
  EventOperation["PRESCRIPTION_DATA_LOAD_END"] = "PRESCRIPTION_DATA_LOAD_END";
6002
+ EventOperation["ORIGINATION_CREATE_STOCK_MOVEMENT"] = "ORIGINATION_CREATE_STOCK_MOVEMENT";
5725
6003
  })(EventOperation || (EventOperation = {}));
5726
6004
 
5727
6005
  var InputFields;
@@ -5897,144 +6175,6 @@
5897
6175
  FormDateError_data2: 'agro.angular_components.end_invalid_date'
5898
6176
  };
5899
6177
 
5900
- var AgroEntityService = /** @class */ (function () {
5901
- function AgroEntityService(http, messageService, entityUrl, actionsUrl, queriesUrl, translate) {
5902
- this.http = http;
5903
- this.messageService = messageService;
5904
- this.entityUrl = entityUrl;
5905
- this.actionsUrl = actionsUrl;
5906
- this.queriesUrl = queriesUrl;
5907
- this.translate = translate;
5908
- this.http = http;
5909
- this.messageService = messageService;
5910
- this.entityUrl = entityUrl;
5911
- this.actionsUrl = actionsUrl;
5912
- this.queriesUrl = queriesUrl;
5913
- this.translate = translate;
5914
- this.defaultCatch = this.defaultCatch.bind(this);
5915
- }
5916
- AgroEntityService.prototype.getListQueryParams = function (listParams) {
5917
- var ten = 10;
5918
- 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;
5919
- var params = new http.HttpParams();
5920
- params = params.append('size', String(size));
5921
- params = params.append('offset', String(page));
5922
- if (sort === null || sort === void 0 ? void 0 : sort.length) {
5923
- params = params.append('orderby', sort.map(this.getBodyFilters()).join(', '));
5924
- }
5925
- if (filterQuery) {
5926
- params = params.append('filter', filterQuery);
5927
- }
5928
- if (displayFields === null || displayFields === void 0 ? void 0 : displayFields.length) {
5929
- params = params.append('displayfields', displayFields.join());
5930
- }
5931
- return params;
5932
- };
5933
- AgroEntityService.prototype.getBodyParams = function (listParams) {
5934
- var ten = 10;
5935
- 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;
5936
- var bodyParams = {};
5937
- bodyParams.size = size;
5938
- bodyParams.offset = page;
5939
- if (sort === null || sort === void 0 ? void 0 : sort.length) {
5940
- bodyParams.orderBy = sort.map(this.getBodyFilters()).join(', ');
5941
- }
5942
- if (filterQuery) {
5943
- bodyParams.filter = filterQuery;
5944
- }
5945
- if (displayFields === null || displayFields === void 0 ? void 0 : displayFields.length) {
5946
- bodyParams.displayfields = displayFields.join();
5947
- }
5948
- return bodyParams;
5949
- };
5950
- AgroEntityService.prototype.getBodyFilters = function () {
5951
- return function (s) {
5952
- var order = '';
5953
- if (s.order === 1) {
5954
- order = ' asc';
5955
- }
5956
- if (s.order === -1) {
5957
- order = ' desc';
5958
- }
5959
- return "" + s.field + order;
5960
- };
5961
- };
5962
- AgroEntityService.prototype.defaultCatch = function (errorMsgs) {
5963
- var _this = this;
5964
- if (errorMsgs === void 0) { errorMsgs = []; }
5965
- var unauthorized401 = 401;
5966
- errorMsgs = __spread(errorMsgs);
5967
- var zero = 0;
5968
- return operators.catchError(function (err) {
5969
- if (err) {
5970
- var errorMessage = errorMsgs.find(function (eMsg) { return eMsg.status === (err === null || err === void 0 ? void 0 : err.status) || zero; });
5971
- var summary = err.status ? String(err.status) : 'Error';
5972
- var detail = _this.getErrorMessage(err);
5973
- if (err.status === unauthorized401) {
5974
- summary = _this.translate.instant('agro.angular_components.error_unauthorized_title');
5975
- detail = _this.translate.instant('agro.angular_components.error_unauthorized_description');
5976
- }
5977
- if (errorMessage) {
5978
- summary = errorMessage.summary ? _this.translate.instant(errorMessage.summary) : summary;
5979
- detail = errorMessage.detail ? _this.translate.instant(errorMessage.detail) : detail;
5980
- }
5981
- _this.messageService.add({
5982
- severity: 'error',
5983
- summary: summary,
5984
- detail: detail,
5985
- });
5986
- }
5987
- return rxjs.throwError(err);
5988
- });
5989
- };
5990
- AgroEntityService.prototype.getErrorMessage = function (err) {
5991
- var _a;
5992
- if ((_a = err === null || err === void 0 ? void 0 : err.error) === null || _a === void 0 ? void 0 : _a.message) {
5993
- return err.error.message;
5994
- }
5995
- if (err.statusText) {
5996
- return err.statusText;
5997
- }
5998
- if (err.message) {
5999
- return err.message;
6000
- }
6001
- return 'Error';
6002
- };
6003
- AgroEntityService.prototype.list = function (listParams, errorMessage) {
6004
- if (errorMessage === void 0) { errorMessage = []; }
6005
- return this.http
6006
- .get(this.entityUrl, { params: this.getListQueryParams(listParams) })
6007
- .pipe(this.defaultCatch(errorMessage));
6008
- };
6009
- AgroEntityService.prototype.get = function (id, errorMessage) {
6010
- if (errorMessage === void 0) { errorMessage = []; }
6011
- return this.http.get(this.entityUrl + "/" + id).pipe(this.defaultCatch(errorMessage));
6012
- };
6013
- AgroEntityService.prototype.insert = function (entity, errorMessage) {
6014
- if (errorMessage === void 0) { errorMessage = []; }
6015
- return this.http.post("" + this.entityUrl, entity).pipe(this.defaultCatch(errorMessage));
6016
- };
6017
- AgroEntityService.prototype.update = function (id, entity, errorMessage) {
6018
- if (errorMessage === void 0) { errorMessage = []; }
6019
- return this.http.put(this.entityUrl + "/" + id, entity).pipe(this.defaultCatch(errorMessage));
6020
- };
6021
- AgroEntityService.prototype.delete = function (id, errorMessage) {
6022
- if (errorMessage === void 0) { errorMessage = []; }
6023
- return this.http.delete(this.entityUrl + "/" + id).pipe(this.defaultCatch(errorMessage));
6024
- };
6025
- AgroEntityService.prototype.listCustomFilter = function (listParams, action, errorMessage) {
6026
- if (errorMessage === void 0) { errorMessage = []; }
6027
- return this.http
6028
- .post(this.actionsUrl + "/" + action, this.getBodyParams(listParams))
6029
- .pipe(this.defaultCatch(errorMessage));
6030
- };
6031
- AgroEntityService.prototype.insertBulk = function (entities) {
6032
- var body = entities ? { entities: entities } : {};
6033
- return this.http.post(this.entityUrl + "/bulk", body).pipe(this.defaultCatch());
6034
- };
6035
- return AgroEntityService;
6036
- }());
6037
-
6038
6178
  var EventControlItemService = /** @class */ (function (_super) {
6039
6179
  __extends(EventControlItemService, _super);
6040
6180
  function EventControlItemService(http, messageService, translate) {
@@ -6148,100 +6288,6 @@
6148
6288
  return PaginatorStorageService;
6149
6289
  }());
6150
6290
 
6151
- var ProducerInvoice = /** @class */ (function () {
6152
- function ProducerInvoice() {
6153
- }
6154
- ProducerInvoice.fromDto = function (producerInvoiceDto, originEntity) {
6155
- var model = __assign({}, producerInvoiceDto);
6156
- model.createdDate = model.createdDate && moment(model.createdDate).toDate();
6157
- model.lastModifiedDate = model.lastModifiedDate && moment(model.lastModifiedDate).toDate();
6158
- var lookupSeparator = " - ";
6159
- var displayFields = [
6160
- "id",
6161
- "weight",
6162
- "percentage",
6163
- "invoiceErpxId",
6164
- "provisionalId",
6165
- "effectiveId",
6166
- "isMainProducer",
6167
- "createdBy",
6168
- "createdDate",
6169
- "lastModifiedBy",
6170
- "lastModifiedDate",
6171
- ];
6172
- model.label = displayFields.map(function (field) { return model[field]; }).join(lookupSeparator);
6173
- return model;
6174
- };
6175
- ProducerInvoice.toDto = function (producerInvoice, originEntity) {
6176
- var dto = __assign({}, producerInvoice);
6177
- dto.createdDate = dto.createdDate && moment(dto.createdDate).format();
6178
- dto.lastModifiedDate = dto.lastModifiedDate && moment(dto.lastModifiedDate).format();
6179
- delete dto.label;
6180
- return dto;
6181
- };
6182
- return ProducerInvoice;
6183
- }());
6184
-
6185
- var ProducerInvoiceService = /** @class */ (function (_super) {
6186
- __extends(ProducerInvoiceService, _super);
6187
- function ProducerInvoiceService(http, messageService, translate) {
6188
- var _this = _super.call(this, http, messageService, "agro/origination/entities/producerInvoice", "agro/origination/actions", "agro/origination/queries", translate) || this;
6189
- _this.http = http;
6190
- _this.messageService = messageService;
6191
- _this.translate = translate;
6192
- return _this;
6193
- }
6194
- ProducerInvoiceService.prototype.getTotalLinkedInInvoices = function (invoiceId, fixationId) {
6195
- return __awaiter(this, void 0, void 0, function () {
6196
- var filter;
6197
- var _this = this;
6198
- return __generator(this, function (_a) {
6199
- filter = "fixationItem.fixation.id eq '" + fixationId + "' " + ("and invoiceId in ('" + invoiceId.join("','") + "') ");
6200
- return [2 /*return*/, new Promise(function (resolve, reject) {
6201
- _this.list({
6202
- filterQuery: filter,
6203
- size: exports.AGRO_NUMBERS.ONE_HUNDRED,
6204
- }).subscribe({
6205
- next: function (data) {
6206
- var invoiceList = data.contents;
6207
- var producerInvoice = new Map();
6208
- if (invoiceList.length) {
6209
- invoiceList.forEach(function (invoice) {
6210
- var _a;
6211
- producerInvoice.set(invoice.invoiceId, ((_a = producerInvoice.get(invoice.invoiceId)) !== null && _a !== void 0 ? _a : 0) + invoice.linkedValue);
6212
- });
6213
- }
6214
- resolve(Array.from(producerInvoice.entries()).map(function (_a) {
6215
- var _b = __read(_a, 2), key = _b[0], value = _b[1];
6216
- return {
6217
- invoiceId: key,
6218
- totalLinked: value,
6219
- };
6220
- }));
6221
- },
6222
- error: function (err) { return reject(new Error(typeof err === 'string' ? err : JSON.stringify(err))); },
6223
- });
6224
- })];
6225
- });
6226
- });
6227
- };
6228
- ProducerInvoiceService.prototype.deleteAllProducerInvoice = function (fixationId) {
6229
- return this.http.post(this.actionsUrl + "/deleteAllProducerInvoice", { fixationId: fixationId }).pipe(this.defaultCatch());
6230
- };
6231
- ProducerInvoiceService.ctorParameters = function () { return [
6232
- { type: http.HttpClient },
6233
- { type: api.MessageService },
6234
- { type: LibTranslationService }
6235
- ]; };
6236
- ProducerInvoiceService.ɵprov = core["ɵɵdefineInjectable"]({ factory: function ProducerInvoiceService_Factory() { return new ProducerInvoiceService(core["ɵɵinject"](http.HttpClient), core["ɵɵinject"](api.MessageService), core["ɵɵinject"](LibTranslationService)); }, token: ProducerInvoiceService, providedIn: "root" });
6237
- ProducerInvoiceService = __decorate([
6238
- core.Injectable({
6239
- providedIn: 'root'
6240
- })
6241
- ], ProducerInvoiceService);
6242
- return ProducerInvoiceService;
6243
- }(AgroEntityService));
6244
-
6245
6291
  var EventControlBoardComponent = /** @class */ (function () {
6246
6292
  function EventControlBoardComponent(translate, formBuilder, websocketService, eventControlService, paginatorStorageService, eventControlItemService, producerInvoiceService, messageService, dialogService) {
6247
6293
  this.translate = translate;
@@ -6501,6 +6547,7 @@
6501
6547
  'eventControlItem.sequence',
6502
6548
  'eventControlItem.eventOperation',
6503
6549
  'eventControlItem.output',
6550
+ 'eventControlItem.input',
6504
6551
  'eventControlItem.status',
6505
6552
  'eventControlItem.subTitle',
6506
6553
  'eventControlItem.message',
@@ -6565,9 +6612,9 @@
6565
6612
  return detail.eventOperation;
6566
6613
  };
6567
6614
  EventControlBoardComponent.prototype.getEventOperationSubLocalLabel = function (detail) {
6568
- var tranlsationKey = "agro.angular_components." + detail.eventOperation;
6569
- var translation = this.translate.instant(tranlsationKey);
6570
- if (translation !== tranlsationKey) {
6615
+ var translationKey = "agro.angular_components." + detail.eventOperation;
6616
+ var translation = this.translate.instant(translationKey);
6617
+ if (translation !== translationKey) {
6571
6618
  return translation;
6572
6619
  }
6573
6620
  return null;
@@ -8043,8 +8090,8 @@
8043
8090
  if (this.options.fixationItems.filter(function (item) { return item.requiredValue > item.totalValueInvoices; }).length === 0) {
8044
8091
  this.messageService.add({
8045
8092
  severity: 'warn',
8046
- summary: this.translate.instant('agro.fixation.max_linked_invoices'),
8047
- detail: this.translate.instant('agro.fixation.max_linked_invoices_description'),
8093
+ summary: this.translate.instant('agro.angular_components.max_linked_invoices'),
8094
+ detail: this.translate.instant('agro.angular_components.max_linked_invoices_description'),
8048
8095
  });
8049
8096
  return;
8050
8097
  }
@@ -8094,8 +8141,8 @@
8094
8141
  .subscribe(function () {
8095
8142
  _this.messageService.add({
8096
8143
  severity: 'success',
8097
- summary: _this.translate.instant('agro.fixation.success'),
8098
- detail: _this.translate.instant('agro.fixation.invoice_created_successfully'),
8144
+ summary: _this.translate.instant('agro.angular_components.success'),
8145
+ detail: _this.translate.instant('agro.angular_components.invoice_created_successfully'),
8099
8146
  });
8100
8147
  _this.cancel();
8101
8148
  });
@@ -8120,8 +8167,8 @@
8120
8167
  if (invoice.linkedValue >= invoice.totalValue) {
8121
8168
  _this.messageService.add({
8122
8169
  severity: 'warn',
8123
- summary: _this.translate.instant('agro.fixation.link_invoice'),
8124
- detail: _this.translate.instant('agro.fixation.invoice_already_linked'),
8170
+ summary: _this.translate.instant('agro.angular_components.link_invoice'),
8171
+ detail: _this.translate.instant('agro.angular_components.invoice_already_linked'),
8125
8172
  });
8126
8173
  isValid = false;
8127
8174
  }
@@ -8369,7 +8416,7 @@
8369
8416
  this.getFields("branch", "agro.angular_components.branch", ["branch.cod", "branch.desc"], angularComponents.FieldType.String, null),
8370
8417
  this.getFields("producer", "agro.angular_components.producer", ["producer.cod", "producer.desc"], angularComponents.FieldType.String, null)
8371
8418
  ], this.gridColumns.filter(function (col) { return !["valuePaid", "valueNet"].includes(col.field); }), [
8372
- this.getFields("valueFees", "agro.angular_components.value_fees", ["values.feesValue"], angularComponents.FieldType.Money, null),
8419
+ this.getFields("valueFees", "agro.angular_components.value_fees", ["values.interestValue"], angularComponents.FieldType.Money, null),
8373
8420
  this.getFields("valueFine", "agro.angular_components.value_fine", ["values.fineValue"], angularComponents.FieldType.Money, null),
8374
8421
  this.getFields("valueCharge", "agro.angular_components.value_charge", ["values.chargeValue"], angularComponents.FieldType.Money, null),
8375
8422
  this.getFields("valueCorrection", "agro.angular_components.value_correction", ["values.monetaryCorrectionValue"], angularComponents.FieldType.Money, null),