@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.
- package/bundles/senior-agronegocio-angular-components.umd.js +315 -268
- 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/common/event-operation.d.ts +2 -1
- package/components/event-control-board/event-control-board.component.d.ts +1 -1
- package/components/modal-invoice-pj/modal-shared-imports.d.ts +4 -7
- package/esm2015/components/event-control-board/common/event-operation.js +2 -1
- package/esm2015/components/event-control-board/event-control-board.component.js +6 -5
- package/esm2015/components/financial-title-table/financial-title-table.component.js +2 -2
- package/esm2015/components/modal-invoice-pj/for-fixation/modal-invoice-pj-for-fixation.component.js +7 -7
- package/esm2015/services/i18n/en-US.js +17 -2
- package/esm2015/services/i18n/es-CO.js +26 -3
- package/esm2015/services/i18n/pt-BR.js +31 -24
- package/esm5/components/event-control-board/common/event-operation.js +2 -1
- package/esm5/components/event-control-board/event-control-board.component.js +6 -5
- package/esm5/components/financial-title-table/financial-title-table.component.js +2 -2
- package/esm5/components/modal-invoice-pj/for-fixation/modal-invoice-pj-for-fixation.component.js +7 -7
- package/esm5/services/i18n/en-US.js +17 -2
- package/esm5/services/i18n/es-CO.js +26 -3
- package/esm5/services/i18n/pt-BR.js +31 -24
- package/fesm2015/senior-agronegocio-angular-components.js +295 -248
- package/fesm2015/senior-agronegocio-angular-components.js.map +1 -1
- package/fesm5/senior-agronegocio-angular-components.js +315 -268
- package/fesm5/senior-agronegocio-angular-components.js.map +1 -1
- package/package.json +1 -1
- package/services/i18n/en-US.d.ts +16 -1
- package/services/i18n/es-CO.d.ts +24 -1
- package/services/i18n/pt-BR.d.ts +29 -22
|
@@ -730,28 +730,28 @@ const ptBR = {
|
|
|
730
730
|
"agro.angular_components.CIDASC_DATA_LOAD_COMPOSED_MEASURE_UNIT": "Carga Cidasc - Medida por hectare",
|
|
731
731
|
"agro.angular_components.PRESCRIPTION_DATA_LOAD": "Carga de dados do NovoReceituário",
|
|
732
732
|
"agro.angular_components.agronomic_prescription_origin_event": "Receituário Agronômico",
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
733
|
+
"agro.angular_components.PRESCRIPTION_DATA_LOAD_PRODUCT_TYPE": "Carga de dados do NovoReceituário - Tipo de Produto",
|
|
734
|
+
"agro.angular_components.PRESCRIPTION_DATA_LOAD_ACTIVE_PRINCIPLE": "Carga de dados do NovoReceituário - Princípio Ativo",
|
|
735
|
+
"agro.angular_components.PRESCRIPTION_DATA_LOAD_FORMULATION": "Carga de dados do NovoReceituário - Formulação",
|
|
736
|
+
"agro.angular_components.PRESCRIPTION_DATA_LOAD_BULLETIN": "Carga de dados do NovoReceituário - Bula",
|
|
737
|
+
"agro.angular_components.PRESCRIPTION_DATA_LOAD_APPLICATION_UNIT": "Carga de dados do NovoReceituário - Unidade de aplicação",
|
|
738
|
+
"agro.angular_components.PRESCRIPTION_DATA_LOAD_SPECIE": "Carga de dados do NovoReceituário - Espécie",
|
|
739
|
+
"agro.angular_components.PRESCRIPTION_DATA_LOAD_APPLICATION_TYPE": "Carga de dados do NovoReceituário - Tipo de aplicação",
|
|
740
|
+
"agro.angular_components.PRESCRIPTION_DATA_LOAD_PROBLEMS": "Carga de dados do NovoReceituário - Pragas e problemas",
|
|
741
|
+
"agro.angular_components.PRESCRIPTION_DATA_LOAD_APPLICATION": "Carga de dados do NovoReceituário - Aplicação",
|
|
742
|
+
"agro.angular_components.PRESCRIPTION_DATA_LOAD_END": "Carga de dados do NovoReceituário - Finalizar integração",
|
|
743
|
+
"agro.angular_components.new_prescription_page": "Parte {count}",
|
|
744
|
+
"agro.angular_components.number_or_series": "Número",
|
|
745
|
+
"agro.angular_components.panel_title_external_invoice_add_external_invoice": "Adicionar nota fiscal",
|
|
746
|
+
"agro.angular_components.add_pj_invoice_modal_no_invoices_found": "Nenhuma nota fiscal disponível para este produtor",
|
|
747
|
+
"agro.angular_components.number": "Número",
|
|
748
|
+
"agro.angular_components.series": "Série",
|
|
749
|
+
"agro.angular_components.itens": "Itens",
|
|
750
|
+
"agro.angular_components.quantity": "Quantidade",
|
|
751
|
+
"agro.angular_components.issuance_date": "Data de emissão",
|
|
752
|
+
"agro.angular_components.no_register_found_for_external_invoices_summary": "Nenhuma nota encontrada",
|
|
753
|
+
"agro.angular_components.total_value": "Valor total",
|
|
754
|
+
"agro.angular_components.value_linked": "Valor vinculado",
|
|
755
755
|
"agro.angular_components.no_accounts_found_title": "Nenhuma conta encontrada",
|
|
756
756
|
"agro.angular_components.no_accounts_found_description": "Não foram encontradas contas para o produtor selecionado.",
|
|
757
757
|
"agro.angular_components.details": "Detalhes",
|
|
@@ -781,7 +781,14 @@ const ptBR = {
|
|
|
781
781
|
"agro.angular_components.error_loading_accounts_description": "Ocorreu um erro ao carregar as contas do produtor. Tente novamente mais tarde.",
|
|
782
782
|
"agro.angular_components.close": "Fechar",
|
|
783
783
|
"agro.angular_components.value_paid": "Valor a pagar",
|
|
784
|
-
"agro.angular_components.timeout_request_error": "Tempo de requisição excedida. Tente novamente mais tarde."
|
|
784
|
+
"agro.angular_components.timeout_request_error": "Tempo de requisição excedida. Tente novamente mais tarde.",
|
|
785
|
+
"agro.angular_components.max_linked_invoices": "Valor máximo de notas vinculadas atingido",
|
|
786
|
+
"agro.angular_components.max_linked_invoices_description": "Todos os itens de fixação já estão com o valor máximo de notas vinculadas",
|
|
787
|
+
"agro.angular_components.invoice_created_successfully": "Nota fiscal criada com sucesso.",
|
|
788
|
+
"agro.angular_components.invoice_already_linked": "Nota fiscal já está totalmente vinculada a outro item",
|
|
789
|
+
"agro.angular_components.link_invoice": "Vincular nota fiscal",
|
|
790
|
+
"agro.grain_classification.label_number": "Ticket",
|
|
791
|
+
"agro.grain_classification.origination_create_stock_movement_event": "Movimentação de estoque",
|
|
785
792
|
};
|
|
786
793
|
|
|
787
794
|
const enUS = {
|
|
@@ -1049,7 +1056,7 @@ const enUS = {
|
|
|
1049
1056
|
"agro.angular_components.PRESCRIPTION_DATA_LOAD_PROBLEMS": "NewPrescription data load - Pests and Problems",
|
|
1050
1057
|
"agro.angular_components.PRESCRIPTION_DATA_LOAD_APPLICATION": "NewPrescription data load - Application",
|
|
1051
1058
|
"agro.angular_components.PRESCRIPTION_DATA_LOAD_END": "NewPrescription data load - End Integration",
|
|
1052
|
-
|
|
1059
|
+
"agro.angular_components.new_prescription_page": "Part {count}",
|
|
1053
1060
|
"agro.angular_components.number_or_series": "Número ou série",
|
|
1054
1061
|
"agro.angular_components.panel_title_external_invoice_add_external_invoice": "Adicionar nota fiscal",
|
|
1055
1062
|
"agro.angular_components.add_pj_invoice_modal_no_invoices_found": "Nenhuma nota fiscal disponível para este produtor",
|
|
@@ -1088,6 +1095,21 @@ const enUS = {
|
|
|
1088
1095
|
"agro.angular_components.close": "Close",
|
|
1089
1096
|
"agro.angular_components.value_paid": "Value to pay",
|
|
1090
1097
|
"agro.angular_components.timeout_request_error": "Request timeout. Please try again later.",
|
|
1098
|
+
"agro.angular_components.TRANSFER_CANCEL_INCOMING_INVOICE": "Incoming invoice cancellation",
|
|
1099
|
+
"agro.angular_components.TRANSFER_CANCEL_OUTGOING_INVOICE": "Outgoing invoice cancellation",
|
|
1100
|
+
"agro.angular_components.TRANSFER_REVERSE_PRODUCER_BALANCE": "Producer balance reversal",
|
|
1101
|
+
"agro.angular_components.TRANSFER_CONCLUDE_CANCEL": "Cancellation conclusion",
|
|
1102
|
+
"agro.angular_components.no_register_found_for_external_invoices_summary": "No invoices found",
|
|
1103
|
+
"agro.angular_components.total_value": "Total value",
|
|
1104
|
+
"agro.angular_components.value_linked": "Linked value",
|
|
1105
|
+
"agro.grain_classification.label_number": "Ticket",
|
|
1106
|
+
"agro.grain_classification.ticket_search_label": "Search Ticket",
|
|
1107
|
+
"agro.grain_classification.origination_create_stock_movement_event": "Stock Movement",
|
|
1108
|
+
"agro.angular_components.max_linked_invoices": "Maximum linked invoices value reached",
|
|
1109
|
+
"agro.angular_components.max_linked_invoices_description": "All fixation items already have the maximum value of linked invoices",
|
|
1110
|
+
"agro.angular_components.invoice_created_successfully": "Invoice created successfully.",
|
|
1111
|
+
"agro.angular_components.invoice_already_linked": "Invoice is already fully linked to another item",
|
|
1112
|
+
"agro.angular_components.link_invoice": "Link invoice",
|
|
1091
1113
|
};
|
|
1092
1114
|
|
|
1093
1115
|
const esCO = {
|
|
@@ -1354,7 +1376,7 @@ const esCO = {
|
|
|
1354
1376
|
"agro.angular_components.PRESCRIPTION_DATA_LOAD_PROBLEMS": "Carga de datos de la Nueva Receta - Plagas y problemas",
|
|
1355
1377
|
"agro.angular_components.PRESCRIPTION_DATA_LOAD_APPLICATION": "Carga de datos de la Nueva Receta - Aplicación",
|
|
1356
1378
|
"agro.angular_components.PRESCRIPTION_DATA_LOAD_END": "Carga de datos de la Nueva Receta - Finalizar integración",
|
|
1357
|
-
|
|
1379
|
+
"agro.angular_components.new_prescription_page": "Parte {count}",
|
|
1358
1380
|
"agro.angular_components.agronomic_prescription_origin_event": "Recetario Agronómico",
|
|
1359
1381
|
"agro.angular_components.no_accounts_found_title": "Ninguna cuenta encontrada",
|
|
1360
1382
|
"agro.angular_components.no_accounts_found_description": "No se encontraron cuentas para el productor seleccionado.",
|
|
@@ -1385,7 +1407,30 @@ const esCO = {
|
|
|
1385
1407
|
"agro.angular_components.error_loading_accounts_description": "Ocurrió un error al cargar las cuentas del productor. Intente nuevamente más tarde.",
|
|
1386
1408
|
"agro.angular_components.close": "Cerrar",
|
|
1387
1409
|
"agro.angular_components.value_paid": "Valor a pagar",
|
|
1388
|
-
"agro.angular_components.timeout_request_error": "Tiempo de solicitud excedido. Intente nuevamente más tarde."
|
|
1410
|
+
"agro.angular_components.timeout_request_error": "Tiempo de solicitud excedido. Intente nuevamente más tarde.",
|
|
1411
|
+
"agro.angular_components.TRANSFER_CANCEL_INCOMING_INVOICE": "Cancelación de NF de entrada",
|
|
1412
|
+
"agro.angular_components.TRANSFER_CANCEL_OUTGOING_INVOICE": "Cancelación de NF de salida ",
|
|
1413
|
+
"agro.angular_components.TRANSFER_REVERSE_PRODUCER_BALANCE": "Reverso de los saldos de productores",
|
|
1414
|
+
"agro.angular_components.TRANSFER_CONCLUDE_CANCEL": "Conclusión de la cancelación",
|
|
1415
|
+
"agro.angular_components.panel_title_external_invoice_add_external_invoice": "Agregar factura",
|
|
1416
|
+
"agro.angular_components.add_pj_invoice_modal_no_invoices_found": "Ninguna factura disponible para este productor",
|
|
1417
|
+
"agro.angular_components.number": "Número",
|
|
1418
|
+
"agro.angular_components.series": "Serie",
|
|
1419
|
+
"agro.angular_components.itens": "Ítems",
|
|
1420
|
+
"agro.angular_components.quantity": "Cantidad",
|
|
1421
|
+
"agro.angular_components.issuance_date": "Fecha de emisión",
|
|
1422
|
+
"agro.angular_components.no_register_found_for_external_invoices_summary": "Ninguna nota encontrada",
|
|
1423
|
+
"agro.angular_components.total_value": "Valor total",
|
|
1424
|
+
"agro.angular_components.value_linked": "Valor vinculado",
|
|
1425
|
+
"agro.angular_components.number_or_series": "Número o serie",
|
|
1426
|
+
"agro.grain_classification.label_number": "Ticket",
|
|
1427
|
+
"agro.grain_classification.ticket_search_label": "Consultar Ticket",
|
|
1428
|
+
"agro.grain_classification.origination_create_stock_movement_event": "Movimiento de inventario",
|
|
1429
|
+
"agro.angular_components.max_linked_invoices": "Valor máximo de facturas vinculadas alcanzado",
|
|
1430
|
+
"agro.angular_components.max_linked_invoices_description": "Todos los ítems de fijación ya tienen el valor máximo de facturas vinculadas",
|
|
1431
|
+
"agro.angular_components.invoice_created_successfully": "Factura creada con éxito.",
|
|
1432
|
+
"agro.angular_components.invoice_already_linked": "La factura ya está totalmente vinculada a otro ítem",
|
|
1433
|
+
"agro.angular_components.link_invoice": "Vincular factura",
|
|
1389
1434
|
};
|
|
1390
1435
|
|
|
1391
1436
|
var AgroEntityStatus;
|
|
@@ -5092,6 +5137,218 @@ EventStepsModule = __decorate([
|
|
|
5092
5137
|
})
|
|
5093
5138
|
], EventStepsModule);
|
|
5094
5139
|
|
|
5140
|
+
class ProducerInvoice {
|
|
5141
|
+
static fromDto(producerInvoiceDto, originEntity) {
|
|
5142
|
+
const model = Object.assign({}, producerInvoiceDto);
|
|
5143
|
+
model.createdDate = model.createdDate && moment(model.createdDate).toDate();
|
|
5144
|
+
model.lastModifiedDate = model.lastModifiedDate && moment(model.lastModifiedDate).toDate();
|
|
5145
|
+
const lookupSeparator = " - ";
|
|
5146
|
+
const displayFields = [
|
|
5147
|
+
"id",
|
|
5148
|
+
"weight",
|
|
5149
|
+
"percentage",
|
|
5150
|
+
"invoiceErpxId",
|
|
5151
|
+
"provisionalId",
|
|
5152
|
+
"effectiveId",
|
|
5153
|
+
"isMainProducer",
|
|
5154
|
+
"createdBy",
|
|
5155
|
+
"createdDate",
|
|
5156
|
+
"lastModifiedBy",
|
|
5157
|
+
"lastModifiedDate",
|
|
5158
|
+
];
|
|
5159
|
+
model.label = displayFields.map((field) => model[field]).join(lookupSeparator);
|
|
5160
|
+
return model;
|
|
5161
|
+
}
|
|
5162
|
+
static toDto(producerInvoice, originEntity) {
|
|
5163
|
+
const dto = Object.assign({}, producerInvoice);
|
|
5164
|
+
dto.createdDate = dto.createdDate && moment(dto.createdDate).format();
|
|
5165
|
+
dto.lastModifiedDate = dto.lastModifiedDate && moment(dto.lastModifiedDate).format();
|
|
5166
|
+
delete dto.label;
|
|
5167
|
+
return dto;
|
|
5168
|
+
}
|
|
5169
|
+
}
|
|
5170
|
+
|
|
5171
|
+
class AgroEntityService {
|
|
5172
|
+
constructor(http, messageService, entityUrl, actionsUrl, queriesUrl, translate) {
|
|
5173
|
+
this.http = http;
|
|
5174
|
+
this.messageService = messageService;
|
|
5175
|
+
this.entityUrl = entityUrl;
|
|
5176
|
+
this.actionsUrl = actionsUrl;
|
|
5177
|
+
this.queriesUrl = queriesUrl;
|
|
5178
|
+
this.translate = translate;
|
|
5179
|
+
this.http = http;
|
|
5180
|
+
this.messageService = messageService;
|
|
5181
|
+
this.entityUrl = entityUrl;
|
|
5182
|
+
this.actionsUrl = actionsUrl;
|
|
5183
|
+
this.queriesUrl = queriesUrl;
|
|
5184
|
+
this.translate = translate;
|
|
5185
|
+
this.defaultCatch = this.defaultCatch.bind(this);
|
|
5186
|
+
}
|
|
5187
|
+
getListQueryParams(listParams) {
|
|
5188
|
+
const ten = 10;
|
|
5189
|
+
const { page = 0, size = ten, sort = [], filterQuery = '', displayFields = [] } = listParams;
|
|
5190
|
+
let params = new HttpParams();
|
|
5191
|
+
params = params.append('size', String(size));
|
|
5192
|
+
params = params.append('offset', String(page));
|
|
5193
|
+
if (sort === null || sort === void 0 ? void 0 : sort.length) {
|
|
5194
|
+
params = params.append('orderby', sort.map(this.getBodyFilters()).join(', '));
|
|
5195
|
+
}
|
|
5196
|
+
if (filterQuery) {
|
|
5197
|
+
params = params.append('filter', filterQuery);
|
|
5198
|
+
}
|
|
5199
|
+
if (displayFields === null || displayFields === void 0 ? void 0 : displayFields.length) {
|
|
5200
|
+
params = params.append('displayfields', displayFields.join());
|
|
5201
|
+
}
|
|
5202
|
+
return params;
|
|
5203
|
+
}
|
|
5204
|
+
getBodyParams(listParams) {
|
|
5205
|
+
const ten = 10;
|
|
5206
|
+
const { page = 0, size = ten, sort = [], filterQuery = '', displayFields = [] } = listParams;
|
|
5207
|
+
const bodyParams = {};
|
|
5208
|
+
bodyParams.size = size;
|
|
5209
|
+
bodyParams.offset = page;
|
|
5210
|
+
if (sort === null || sort === void 0 ? void 0 : sort.length) {
|
|
5211
|
+
bodyParams.orderBy = sort.map(this.getBodyFilters()).join(', ');
|
|
5212
|
+
}
|
|
5213
|
+
if (filterQuery) {
|
|
5214
|
+
bodyParams.filter = filterQuery;
|
|
5215
|
+
}
|
|
5216
|
+
if (displayFields === null || displayFields === void 0 ? void 0 : displayFields.length) {
|
|
5217
|
+
bodyParams.displayfields = displayFields.join();
|
|
5218
|
+
}
|
|
5219
|
+
return bodyParams;
|
|
5220
|
+
}
|
|
5221
|
+
getBodyFilters() {
|
|
5222
|
+
return (s) => {
|
|
5223
|
+
let order = '';
|
|
5224
|
+
if (s.order === 1) {
|
|
5225
|
+
order = ' asc';
|
|
5226
|
+
}
|
|
5227
|
+
if (s.order === -1) {
|
|
5228
|
+
order = ' desc';
|
|
5229
|
+
}
|
|
5230
|
+
return `${s.field}${order}`;
|
|
5231
|
+
};
|
|
5232
|
+
}
|
|
5233
|
+
defaultCatch(errorMsgs = []) {
|
|
5234
|
+
const unauthorized401 = 401;
|
|
5235
|
+
errorMsgs = [...errorMsgs];
|
|
5236
|
+
const zero = 0;
|
|
5237
|
+
return catchError((err) => {
|
|
5238
|
+
if (err) {
|
|
5239
|
+
const errorMessage = errorMsgs.find((eMsg) => eMsg.status === (err === null || err === void 0 ? void 0 : err.status) || zero);
|
|
5240
|
+
let summary = err.status ? String(err.status) : 'Error';
|
|
5241
|
+
let detail = this.getErrorMessage(err);
|
|
5242
|
+
if (err.status === unauthorized401) {
|
|
5243
|
+
summary = this.translate.instant('agro.angular_components.error_unauthorized_title');
|
|
5244
|
+
detail = this.translate.instant('agro.angular_components.error_unauthorized_description');
|
|
5245
|
+
}
|
|
5246
|
+
if (errorMessage) {
|
|
5247
|
+
summary = errorMessage.summary ? this.translate.instant(errorMessage.summary) : summary;
|
|
5248
|
+
detail = errorMessage.detail ? this.translate.instant(errorMessage.detail) : detail;
|
|
5249
|
+
}
|
|
5250
|
+
this.messageService.add({
|
|
5251
|
+
severity: 'error',
|
|
5252
|
+
summary,
|
|
5253
|
+
detail,
|
|
5254
|
+
});
|
|
5255
|
+
}
|
|
5256
|
+
return throwError(err);
|
|
5257
|
+
});
|
|
5258
|
+
}
|
|
5259
|
+
getErrorMessage(err) {
|
|
5260
|
+
var _a;
|
|
5261
|
+
if ((_a = err === null || err === void 0 ? void 0 : err.error) === null || _a === void 0 ? void 0 : _a.message) {
|
|
5262
|
+
return err.error.message;
|
|
5263
|
+
}
|
|
5264
|
+
if (err.statusText) {
|
|
5265
|
+
return err.statusText;
|
|
5266
|
+
}
|
|
5267
|
+
if (err.message) {
|
|
5268
|
+
return err.message;
|
|
5269
|
+
}
|
|
5270
|
+
return 'Error';
|
|
5271
|
+
}
|
|
5272
|
+
list(listParams, errorMessage = []) {
|
|
5273
|
+
return this.http
|
|
5274
|
+
.get(this.entityUrl, { params: this.getListQueryParams(listParams) })
|
|
5275
|
+
.pipe(this.defaultCatch(errorMessage));
|
|
5276
|
+
}
|
|
5277
|
+
get(id, errorMessage = []) {
|
|
5278
|
+
return this.http.get(`${this.entityUrl}/${id}`).pipe(this.defaultCatch(errorMessage));
|
|
5279
|
+
}
|
|
5280
|
+
insert(entity, errorMessage = []) {
|
|
5281
|
+
return this.http.post(`${this.entityUrl}`, entity).pipe(this.defaultCatch(errorMessage));
|
|
5282
|
+
}
|
|
5283
|
+
update(id, entity, errorMessage = []) {
|
|
5284
|
+
return this.http.put(`${this.entityUrl}/${id}`, entity).pipe(this.defaultCatch(errorMessage));
|
|
5285
|
+
}
|
|
5286
|
+
delete(id, errorMessage = []) {
|
|
5287
|
+
return this.http.delete(`${this.entityUrl}/${id}`).pipe(this.defaultCatch(errorMessage));
|
|
5288
|
+
}
|
|
5289
|
+
listCustomFilter(listParams, action, errorMessage = []) {
|
|
5290
|
+
return this.http
|
|
5291
|
+
.post(`${this.actionsUrl}/${action}`, this.getBodyParams(listParams))
|
|
5292
|
+
.pipe(this.defaultCatch(errorMessage));
|
|
5293
|
+
}
|
|
5294
|
+
insertBulk(entities) {
|
|
5295
|
+
const body = entities ? { entities } : {};
|
|
5296
|
+
return this.http.post(`${this.entityUrl}/bulk`, body).pipe(this.defaultCatch());
|
|
5297
|
+
}
|
|
5298
|
+
}
|
|
5299
|
+
|
|
5300
|
+
let ProducerInvoiceService = class ProducerInvoiceService extends AgroEntityService {
|
|
5301
|
+
constructor(http, messageService, translate) {
|
|
5302
|
+
super(http, messageService, `agro/origination/entities/producerInvoice`, `agro/origination/actions`, `agro/origination/queries`, translate);
|
|
5303
|
+
this.http = http;
|
|
5304
|
+
this.messageService = messageService;
|
|
5305
|
+
this.translate = translate;
|
|
5306
|
+
}
|
|
5307
|
+
getTotalLinkedInInvoices(invoiceId, fixationId) {
|
|
5308
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
5309
|
+
const filter = `fixationItem.fixation.id eq '${fixationId}' ` + `and invoiceId in ('${invoiceId.join("','")}') `;
|
|
5310
|
+
return new Promise((resolve, reject) => {
|
|
5311
|
+
this.list({
|
|
5312
|
+
filterQuery: filter,
|
|
5313
|
+
size: AGRO_NUMBERS.ONE_HUNDRED,
|
|
5314
|
+
}).subscribe({
|
|
5315
|
+
next: (data) => {
|
|
5316
|
+
const invoiceList = data.contents;
|
|
5317
|
+
const producerInvoice = new Map();
|
|
5318
|
+
if (invoiceList.length) {
|
|
5319
|
+
invoiceList.forEach((invoice) => {
|
|
5320
|
+
var _a;
|
|
5321
|
+
producerInvoice.set(invoice.invoiceId, ((_a = producerInvoice.get(invoice.invoiceId)) !== null && _a !== void 0 ? _a : 0) + invoice.linkedValue);
|
|
5322
|
+
});
|
|
5323
|
+
}
|
|
5324
|
+
resolve(Array.from(producerInvoice.entries()).map(([key, value]) => {
|
|
5325
|
+
return {
|
|
5326
|
+
invoiceId: key,
|
|
5327
|
+
totalLinked: value,
|
|
5328
|
+
};
|
|
5329
|
+
}));
|
|
5330
|
+
},
|
|
5331
|
+
error: (err) => reject(new Error(typeof err === 'string' ? err : JSON.stringify(err))),
|
|
5332
|
+
});
|
|
5333
|
+
});
|
|
5334
|
+
});
|
|
5335
|
+
}
|
|
5336
|
+
deleteAllProducerInvoice(fixationId) {
|
|
5337
|
+
return this.http.post(`${this.actionsUrl}/deleteAllProducerInvoice`, { fixationId }).pipe(this.defaultCatch());
|
|
5338
|
+
}
|
|
5339
|
+
};
|
|
5340
|
+
ProducerInvoiceService.ctorParameters = () => [
|
|
5341
|
+
{ type: HttpClient },
|
|
5342
|
+
{ type: MessageService },
|
|
5343
|
+
{ type: LibTranslationService }
|
|
5344
|
+
];
|
|
5345
|
+
ProducerInvoiceService.ɵprov = ɵɵdefineInjectable({ factory: function ProducerInvoiceService_Factory() { return new ProducerInvoiceService(ɵɵinject(HttpClient), ɵɵinject(MessageService), ɵɵinject(LibTranslationService)); }, token: ProducerInvoiceService, providedIn: "root" });
|
|
5346
|
+
ProducerInvoiceService = __decorate([
|
|
5347
|
+
Injectable({
|
|
5348
|
+
providedIn: 'root'
|
|
5349
|
+
})
|
|
5350
|
+
], ProducerInvoiceService);
|
|
5351
|
+
|
|
5095
5352
|
let CancelEventDialogComponent = class CancelEventDialogComponent {
|
|
5096
5353
|
constructor(formBuilder, config, ref, translate) {
|
|
5097
5354
|
this.formBuilder = formBuilder;
|
|
@@ -5251,6 +5508,7 @@ var EventOperation;
|
|
|
5251
5508
|
EventOperation["PRESCRIPTION_DATA_LOAD_PROBLEMS"] = "PRESCRIPTION_DATA_LOAD_PROBLEMS";
|
|
5252
5509
|
EventOperation["PRESCRIPTION_DATA_LOAD_APPLICATION"] = "PRESCRIPTION_DATA_LOAD_APPLICATION";
|
|
5253
5510
|
EventOperation["PRESCRIPTION_DATA_LOAD_END"] = "PRESCRIPTION_DATA_LOAD_END";
|
|
5511
|
+
EventOperation["ORIGINATION_CREATE_STOCK_MOVEMENT"] = "ORIGINATION_CREATE_STOCK_MOVEMENT";
|
|
5254
5512
|
})(EventOperation || (EventOperation = {}));
|
|
5255
5513
|
|
|
5256
5514
|
var InputFields;
|
|
@@ -5426,135 +5684,6 @@ const LookupErrorMessages = {
|
|
|
5426
5684
|
FormDateError_data2: 'agro.angular_components.end_invalid_date'
|
|
5427
5685
|
};
|
|
5428
5686
|
|
|
5429
|
-
class AgroEntityService {
|
|
5430
|
-
constructor(http, messageService, entityUrl, actionsUrl, queriesUrl, translate) {
|
|
5431
|
-
this.http = http;
|
|
5432
|
-
this.messageService = messageService;
|
|
5433
|
-
this.entityUrl = entityUrl;
|
|
5434
|
-
this.actionsUrl = actionsUrl;
|
|
5435
|
-
this.queriesUrl = queriesUrl;
|
|
5436
|
-
this.translate = translate;
|
|
5437
|
-
this.http = http;
|
|
5438
|
-
this.messageService = messageService;
|
|
5439
|
-
this.entityUrl = entityUrl;
|
|
5440
|
-
this.actionsUrl = actionsUrl;
|
|
5441
|
-
this.queriesUrl = queriesUrl;
|
|
5442
|
-
this.translate = translate;
|
|
5443
|
-
this.defaultCatch = this.defaultCatch.bind(this);
|
|
5444
|
-
}
|
|
5445
|
-
getListQueryParams(listParams) {
|
|
5446
|
-
const ten = 10;
|
|
5447
|
-
const { page = 0, size = ten, sort = [], filterQuery = '', displayFields = [] } = listParams;
|
|
5448
|
-
let params = new HttpParams();
|
|
5449
|
-
params = params.append('size', String(size));
|
|
5450
|
-
params = params.append('offset', String(page));
|
|
5451
|
-
if (sort === null || sort === void 0 ? void 0 : sort.length) {
|
|
5452
|
-
params = params.append('orderby', sort.map(this.getBodyFilters()).join(', '));
|
|
5453
|
-
}
|
|
5454
|
-
if (filterQuery) {
|
|
5455
|
-
params = params.append('filter', filterQuery);
|
|
5456
|
-
}
|
|
5457
|
-
if (displayFields === null || displayFields === void 0 ? void 0 : displayFields.length) {
|
|
5458
|
-
params = params.append('displayfields', displayFields.join());
|
|
5459
|
-
}
|
|
5460
|
-
return params;
|
|
5461
|
-
}
|
|
5462
|
-
getBodyParams(listParams) {
|
|
5463
|
-
const ten = 10;
|
|
5464
|
-
const { page = 0, size = ten, sort = [], filterQuery = '', displayFields = [] } = listParams;
|
|
5465
|
-
const bodyParams = {};
|
|
5466
|
-
bodyParams.size = size;
|
|
5467
|
-
bodyParams.offset = page;
|
|
5468
|
-
if (sort === null || sort === void 0 ? void 0 : sort.length) {
|
|
5469
|
-
bodyParams.orderBy = sort.map(this.getBodyFilters()).join(', ');
|
|
5470
|
-
}
|
|
5471
|
-
if (filterQuery) {
|
|
5472
|
-
bodyParams.filter = filterQuery;
|
|
5473
|
-
}
|
|
5474
|
-
if (displayFields === null || displayFields === void 0 ? void 0 : displayFields.length) {
|
|
5475
|
-
bodyParams.displayfields = displayFields.join();
|
|
5476
|
-
}
|
|
5477
|
-
return bodyParams;
|
|
5478
|
-
}
|
|
5479
|
-
getBodyFilters() {
|
|
5480
|
-
return (s) => {
|
|
5481
|
-
let order = '';
|
|
5482
|
-
if (s.order === 1) {
|
|
5483
|
-
order = ' asc';
|
|
5484
|
-
}
|
|
5485
|
-
if (s.order === -1) {
|
|
5486
|
-
order = ' desc';
|
|
5487
|
-
}
|
|
5488
|
-
return `${s.field}${order}`;
|
|
5489
|
-
};
|
|
5490
|
-
}
|
|
5491
|
-
defaultCatch(errorMsgs = []) {
|
|
5492
|
-
const unauthorized401 = 401;
|
|
5493
|
-
errorMsgs = [...errorMsgs];
|
|
5494
|
-
const zero = 0;
|
|
5495
|
-
return catchError((err) => {
|
|
5496
|
-
if (err) {
|
|
5497
|
-
const errorMessage = errorMsgs.find((eMsg) => eMsg.status === (err === null || err === void 0 ? void 0 : err.status) || zero);
|
|
5498
|
-
let summary = err.status ? String(err.status) : 'Error';
|
|
5499
|
-
let detail = this.getErrorMessage(err);
|
|
5500
|
-
if (err.status === unauthorized401) {
|
|
5501
|
-
summary = this.translate.instant('agro.angular_components.error_unauthorized_title');
|
|
5502
|
-
detail = this.translate.instant('agro.angular_components.error_unauthorized_description');
|
|
5503
|
-
}
|
|
5504
|
-
if (errorMessage) {
|
|
5505
|
-
summary = errorMessage.summary ? this.translate.instant(errorMessage.summary) : summary;
|
|
5506
|
-
detail = errorMessage.detail ? this.translate.instant(errorMessage.detail) : detail;
|
|
5507
|
-
}
|
|
5508
|
-
this.messageService.add({
|
|
5509
|
-
severity: 'error',
|
|
5510
|
-
summary,
|
|
5511
|
-
detail,
|
|
5512
|
-
});
|
|
5513
|
-
}
|
|
5514
|
-
return throwError(err);
|
|
5515
|
-
});
|
|
5516
|
-
}
|
|
5517
|
-
getErrorMessage(err) {
|
|
5518
|
-
var _a;
|
|
5519
|
-
if ((_a = err === null || err === void 0 ? void 0 : err.error) === null || _a === void 0 ? void 0 : _a.message) {
|
|
5520
|
-
return err.error.message;
|
|
5521
|
-
}
|
|
5522
|
-
if (err.statusText) {
|
|
5523
|
-
return err.statusText;
|
|
5524
|
-
}
|
|
5525
|
-
if (err.message) {
|
|
5526
|
-
return err.message;
|
|
5527
|
-
}
|
|
5528
|
-
return 'Error';
|
|
5529
|
-
}
|
|
5530
|
-
list(listParams, errorMessage = []) {
|
|
5531
|
-
return this.http
|
|
5532
|
-
.get(this.entityUrl, { params: this.getListQueryParams(listParams) })
|
|
5533
|
-
.pipe(this.defaultCatch(errorMessage));
|
|
5534
|
-
}
|
|
5535
|
-
get(id, errorMessage = []) {
|
|
5536
|
-
return this.http.get(`${this.entityUrl}/${id}`).pipe(this.defaultCatch(errorMessage));
|
|
5537
|
-
}
|
|
5538
|
-
insert(entity, errorMessage = []) {
|
|
5539
|
-
return this.http.post(`${this.entityUrl}`, entity).pipe(this.defaultCatch(errorMessage));
|
|
5540
|
-
}
|
|
5541
|
-
update(id, entity, errorMessage = []) {
|
|
5542
|
-
return this.http.put(`${this.entityUrl}/${id}`, entity).pipe(this.defaultCatch(errorMessage));
|
|
5543
|
-
}
|
|
5544
|
-
delete(id, errorMessage = []) {
|
|
5545
|
-
return this.http.delete(`${this.entityUrl}/${id}`).pipe(this.defaultCatch(errorMessage));
|
|
5546
|
-
}
|
|
5547
|
-
listCustomFilter(listParams, action, errorMessage = []) {
|
|
5548
|
-
return this.http
|
|
5549
|
-
.post(`${this.actionsUrl}/${action}`, this.getBodyParams(listParams))
|
|
5550
|
-
.pipe(this.defaultCatch(errorMessage));
|
|
5551
|
-
}
|
|
5552
|
-
insertBulk(entities) {
|
|
5553
|
-
const body = entities ? { entities } : {};
|
|
5554
|
-
return this.http.post(`${this.entityUrl}/bulk`, body).pipe(this.defaultCatch());
|
|
5555
|
-
}
|
|
5556
|
-
}
|
|
5557
|
-
|
|
5558
5687
|
let EventControlItemService = class EventControlItemService extends AgroEntityService {
|
|
5559
5688
|
constructor(http, messageService, translate) {
|
|
5560
5689
|
super(http, messageService, `agro/agro_events/entities/eventControlItem`, `agro/agro_events/actions`, `agro/agro_events/queries`, translate);
|
|
@@ -5624,89 +5753,6 @@ class PaginatorStorageService {
|
|
|
5624
5753
|
}
|
|
5625
5754
|
}
|
|
5626
5755
|
|
|
5627
|
-
class ProducerInvoice {
|
|
5628
|
-
static fromDto(producerInvoiceDto, originEntity) {
|
|
5629
|
-
const model = Object.assign({}, producerInvoiceDto);
|
|
5630
|
-
model.createdDate = model.createdDate && moment(model.createdDate).toDate();
|
|
5631
|
-
model.lastModifiedDate = model.lastModifiedDate && moment(model.lastModifiedDate).toDate();
|
|
5632
|
-
const lookupSeparator = " - ";
|
|
5633
|
-
const displayFields = [
|
|
5634
|
-
"id",
|
|
5635
|
-
"weight",
|
|
5636
|
-
"percentage",
|
|
5637
|
-
"invoiceErpxId",
|
|
5638
|
-
"provisionalId",
|
|
5639
|
-
"effectiveId",
|
|
5640
|
-
"isMainProducer",
|
|
5641
|
-
"createdBy",
|
|
5642
|
-
"createdDate",
|
|
5643
|
-
"lastModifiedBy",
|
|
5644
|
-
"lastModifiedDate",
|
|
5645
|
-
];
|
|
5646
|
-
model.label = displayFields.map((field) => model[field]).join(lookupSeparator);
|
|
5647
|
-
return model;
|
|
5648
|
-
}
|
|
5649
|
-
static toDto(producerInvoice, originEntity) {
|
|
5650
|
-
const dto = Object.assign({}, producerInvoice);
|
|
5651
|
-
dto.createdDate = dto.createdDate && moment(dto.createdDate).format();
|
|
5652
|
-
dto.lastModifiedDate = dto.lastModifiedDate && moment(dto.lastModifiedDate).format();
|
|
5653
|
-
delete dto.label;
|
|
5654
|
-
return dto;
|
|
5655
|
-
}
|
|
5656
|
-
}
|
|
5657
|
-
|
|
5658
|
-
let ProducerInvoiceService = class ProducerInvoiceService extends AgroEntityService {
|
|
5659
|
-
constructor(http, messageService, translate) {
|
|
5660
|
-
super(http, messageService, `agro/origination/entities/producerInvoice`, `agro/origination/actions`, `agro/origination/queries`, translate);
|
|
5661
|
-
this.http = http;
|
|
5662
|
-
this.messageService = messageService;
|
|
5663
|
-
this.translate = translate;
|
|
5664
|
-
}
|
|
5665
|
-
getTotalLinkedInInvoices(invoiceId, fixationId) {
|
|
5666
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
5667
|
-
const filter = `fixationItem.fixation.id eq '${fixationId}' ` + `and invoiceId in ('${invoiceId.join("','")}') `;
|
|
5668
|
-
return new Promise((resolve, reject) => {
|
|
5669
|
-
this.list({
|
|
5670
|
-
filterQuery: filter,
|
|
5671
|
-
size: AGRO_NUMBERS.ONE_HUNDRED,
|
|
5672
|
-
}).subscribe({
|
|
5673
|
-
next: (data) => {
|
|
5674
|
-
const invoiceList = data.contents;
|
|
5675
|
-
const producerInvoice = new Map();
|
|
5676
|
-
if (invoiceList.length) {
|
|
5677
|
-
invoiceList.forEach((invoice) => {
|
|
5678
|
-
var _a;
|
|
5679
|
-
producerInvoice.set(invoice.invoiceId, ((_a = producerInvoice.get(invoice.invoiceId)) !== null && _a !== void 0 ? _a : 0) + invoice.linkedValue);
|
|
5680
|
-
});
|
|
5681
|
-
}
|
|
5682
|
-
resolve(Array.from(producerInvoice.entries()).map(([key, value]) => {
|
|
5683
|
-
return {
|
|
5684
|
-
invoiceId: key,
|
|
5685
|
-
totalLinked: value,
|
|
5686
|
-
};
|
|
5687
|
-
}));
|
|
5688
|
-
},
|
|
5689
|
-
error: (err) => reject(new Error(typeof err === 'string' ? err : JSON.stringify(err))),
|
|
5690
|
-
});
|
|
5691
|
-
});
|
|
5692
|
-
});
|
|
5693
|
-
}
|
|
5694
|
-
deleteAllProducerInvoice(fixationId) {
|
|
5695
|
-
return this.http.post(`${this.actionsUrl}/deleteAllProducerInvoice`, { fixationId }).pipe(this.defaultCatch());
|
|
5696
|
-
}
|
|
5697
|
-
};
|
|
5698
|
-
ProducerInvoiceService.ctorParameters = () => [
|
|
5699
|
-
{ type: HttpClient },
|
|
5700
|
-
{ type: MessageService },
|
|
5701
|
-
{ type: LibTranslationService }
|
|
5702
|
-
];
|
|
5703
|
-
ProducerInvoiceService.ɵprov = ɵɵdefineInjectable({ factory: function ProducerInvoiceService_Factory() { return new ProducerInvoiceService(ɵɵinject(HttpClient), ɵɵinject(MessageService), ɵɵinject(LibTranslationService)); }, token: ProducerInvoiceService, providedIn: "root" });
|
|
5704
|
-
ProducerInvoiceService = __decorate([
|
|
5705
|
-
Injectable({
|
|
5706
|
-
providedIn: 'root'
|
|
5707
|
-
})
|
|
5708
|
-
], ProducerInvoiceService);
|
|
5709
|
-
|
|
5710
5756
|
let EventControlBoardComponent = class EventControlBoardComponent {
|
|
5711
5757
|
constructor(translate, formBuilder, websocketService, eventControlService, paginatorStorageService, eventControlItemService, producerInvoiceService, messageService, dialogService) {
|
|
5712
5758
|
this.translate = translate;
|
|
@@ -5960,6 +6006,7 @@ let EventControlBoardComponent = class EventControlBoardComponent {
|
|
|
5960
6006
|
'eventControlItem.sequence',
|
|
5961
6007
|
'eventControlItem.eventOperation',
|
|
5962
6008
|
'eventControlItem.output',
|
|
6009
|
+
'eventControlItem.input',
|
|
5963
6010
|
'eventControlItem.status',
|
|
5964
6011
|
'eventControlItem.subTitle',
|
|
5965
6012
|
'eventControlItem.message',
|
|
@@ -6023,9 +6070,9 @@ let EventControlBoardComponent = class EventControlBoardComponent {
|
|
|
6023
6070
|
return detail.eventOperation;
|
|
6024
6071
|
}
|
|
6025
6072
|
getEventOperationSubLocalLabel(detail) {
|
|
6026
|
-
const
|
|
6027
|
-
const translation = this.translate.instant(
|
|
6028
|
-
if (translation !==
|
|
6073
|
+
const translationKey = "agro.angular_components." + detail.eventOperation;
|
|
6074
|
+
const translation = this.translate.instant(translationKey);
|
|
6075
|
+
if (translation !== translationKey) {
|
|
6029
6076
|
return translation;
|
|
6030
6077
|
}
|
|
6031
6078
|
return null;
|
|
@@ -7354,8 +7401,8 @@ let ModalInvoicePjForFixationComponent = class ModalInvoicePjForFixationComponen
|
|
|
7354
7401
|
if (this.options.fixationItems.filter((item) => item.requiredValue > item.totalValueInvoices).length === 0) {
|
|
7355
7402
|
this.messageService.add({
|
|
7356
7403
|
severity: 'warn',
|
|
7357
|
-
summary: this.translate.instant('agro.
|
|
7358
|
-
detail: this.translate.instant('agro.
|
|
7404
|
+
summary: this.translate.instant('agro.angular_components.max_linked_invoices'),
|
|
7405
|
+
detail: this.translate.instant('agro.angular_components.max_linked_invoices_description'),
|
|
7359
7406
|
});
|
|
7360
7407
|
return;
|
|
7361
7408
|
}
|
|
@@ -7400,8 +7447,8 @@ let ModalInvoicePjForFixationComponent = class ModalInvoicePjForFixationComponen
|
|
|
7400
7447
|
.subscribe(() => {
|
|
7401
7448
|
this.messageService.add({
|
|
7402
7449
|
severity: 'success',
|
|
7403
|
-
summary: this.translate.instant('agro.
|
|
7404
|
-
detail: this.translate.instant('agro.
|
|
7450
|
+
summary: this.translate.instant('agro.angular_components.success'),
|
|
7451
|
+
detail: this.translate.instant('agro.angular_components.invoice_created_successfully'),
|
|
7405
7452
|
});
|
|
7406
7453
|
this.cancel();
|
|
7407
7454
|
});
|
|
@@ -7417,8 +7464,8 @@ let ModalInvoicePjForFixationComponent = class ModalInvoicePjForFixationComponen
|
|
|
7417
7464
|
if (invoice.linkedValue >= invoice.totalValue) {
|
|
7418
7465
|
this.messageService.add({
|
|
7419
7466
|
severity: 'warn',
|
|
7420
|
-
summary: this.translate.instant('agro.
|
|
7421
|
-
detail: this.translate.instant('agro.
|
|
7467
|
+
summary: this.translate.instant('agro.angular_components.link_invoice'),
|
|
7468
|
+
detail: this.translate.instant('agro.angular_components.invoice_already_linked'),
|
|
7422
7469
|
});
|
|
7423
7470
|
isValid = false;
|
|
7424
7471
|
}
|
|
@@ -7637,7 +7684,7 @@ let FinancialTitleTableComponent = class FinancialTitleTableComponent {
|
|
|
7637
7684
|
this.getFields("branch", "agro.angular_components.branch", ["branch.cod", "branch.desc"], FieldType.String, null),
|
|
7638
7685
|
this.getFields("producer", "agro.angular_components.producer", ["producer.cod", "producer.desc"], FieldType.String, null),
|
|
7639
7686
|
...this.gridColumns.filter((col) => !["valuePaid", "valueNet"].includes(col.field)),
|
|
7640
|
-
this.getFields("valueFees", "agro.angular_components.value_fees", ["values.
|
|
7687
|
+
this.getFields("valueFees", "agro.angular_components.value_fees", ["values.interestValue"], FieldType.Money, null),
|
|
7641
7688
|
this.getFields("valueFine", "agro.angular_components.value_fine", ["values.fineValue"], FieldType.Money, null),
|
|
7642
7689
|
this.getFields("valueCharge", "agro.angular_components.value_charge", ["values.chargeValue"], FieldType.Money, null),
|
|
7643
7690
|
this.getFields("valueCorrection", "agro.angular_components.value_correction", ["values.monetaryCorrectionValue"], FieldType.Money, null),
|