@seniorsistemas/yms-integration 1.34.0 → 1.35.0-8aa74870-17c9-4899-8712-915a47eb2c89

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 (43) hide show
  1. package/bundles/seniorsistemas-yms-integration.umd.js +213 -74
  2. package/bundles/seniorsistemas-yms-integration.umd.js.map +1 -1
  3. package/bundles/seniorsistemas-yms-integration.umd.min.js +1 -1
  4. package/bundles/seniorsistemas-yms-integration.umd.min.js.map +1 -1
  5. package/esm2015/seniorsistemas-yms-integration.js +44 -43
  6. package/esm2015/src/wms/components/document-grid/document-grid.component.js +18 -11
  7. package/esm2015/src/wms/components/document-grid/document-grid.module.js +3 -1
  8. package/esm2015/src/wms/components/document-grid/insert-key/insert-key.component.js +64 -7
  9. package/esm2015/src/wms/components/document-grid/insert-key/insert-key.module.js +4 -2
  10. package/esm2015/src/wms/components/document-grid/register-document/register-document.component.js +3 -9
  11. package/esm2015/src/wms/components/document-list/document-list.component.js +61 -9
  12. package/esm2015/src/wms/components/document-list/document-list.module.js +8 -3
  13. package/esm2015/src/wms/components/utils/invoice-conditions.js +12 -0
  14. package/esm2015/src/wms/entities/external-tenant/external-tenant-dto.js +1 -0
  15. package/esm2015/src/wms/entities/external-tenant/external-tenant.service.js +18 -0
  16. package/esm2015/src/wms/entities/invoice-condition/invoice-condition.js +2 -1
  17. package/esm5/seniorsistemas-yms-integration.js +44 -43
  18. package/esm5/src/wms/components/document-grid/document-grid.component.js +18 -11
  19. package/esm5/src/wms/components/document-grid/document-grid.module.js +3 -1
  20. package/esm5/src/wms/components/document-grid/insert-key/insert-key.component.js +66 -7
  21. package/esm5/src/wms/components/document-grid/insert-key/insert-key.module.js +4 -2
  22. package/esm5/src/wms/components/document-grid/register-document/register-document.component.js +3 -9
  23. package/esm5/src/wms/components/document-list/document-list.component.js +63 -9
  24. package/esm5/src/wms/components/document-list/document-list.module.js +8 -3
  25. package/esm5/src/wms/components/utils/invoice-conditions.js +12 -0
  26. package/esm5/src/wms/entities/external-tenant/external-tenant-dto.js +1 -0
  27. package/esm5/src/wms/entities/external-tenant/external-tenant.service.js +21 -0
  28. package/esm5/src/wms/entities/invoice-condition/invoice-condition.js +2 -1
  29. package/fesm2015/seniorsistemas-yms-integration.js +163 -32
  30. package/fesm2015/seniorsistemas-yms-integration.js.map +1 -1
  31. package/fesm5/seniorsistemas-yms-integration.js +170 -32
  32. package/fesm5/seniorsistemas-yms-integration.js.map +1 -1
  33. package/package.json +1 -1
  34. package/seniorsistemas-yms-integration.d.ts +43 -42
  35. package/seniorsistemas-yms-integration.metadata.json +1 -1
  36. package/src/wms/components/document-grid/document-grid.component.d.ts +7 -2
  37. package/src/wms/components/document-grid/insert-key/insert-key.component.d.ts +13 -1
  38. package/src/wms/components/document-grid/register-document/register-document.component.d.ts +1 -1
  39. package/src/wms/components/document-list/document-list.component.d.ts +19 -1
  40. package/src/wms/components/utils/invoice-conditions.d.ts +6 -0
  41. package/src/wms/entities/external-tenant/external-tenant-dto.d.ts +7 -0
  42. package/src/wms/entities/external-tenant/external-tenant.service.d.ts +9 -0
  43. package/src/wms/entities/invoice-condition/invoice-condition.d.ts +2 -1
@@ -0,0 +1,21 @@
1
+ import * as tslib_1 from "tslib";
2
+ import { EntityService } from './../../../sam-senior/core/entity-service';
3
+ import { Injectable } from '@angular/core';
4
+ import { HttpClient } from '@angular/common/http';
5
+ import { MessageService } from 'primeng/api';
6
+ var ExternalTenantService = /** @class */ (function (_super) {
7
+ tslib_1.__extends(ExternalTenantService, _super);
8
+ function ExternalTenantService(http, messageService) {
9
+ var _this = _super.call(this, http, messageService, 'yms/agenda/entities/externalTenant', '') || this;
10
+ _this.http = http;
11
+ _this.messageService = messageService;
12
+ return _this;
13
+ }
14
+ ExternalTenantService = tslib_1.__decorate([
15
+ Injectable(),
16
+ tslib_1.__metadata("design:paramtypes", [HttpClient, MessageService])
17
+ ], ExternalTenantService);
18
+ return ExternalTenantService;
19
+ }(EntityService));
20
+ export { ExternalTenantService };
21
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZXh0ZXJuYWwtdGVuYW50LnNlcnZpY2UuanMiLCJzb3VyY2VSb290Ijoibmc6Ly9Ac2VuaW9yc2lzdGVtYXMveW1zLWludGVncmF0aW9uLyIsInNvdXJjZXMiOlsic3JjL3dtcy9lbnRpdGllcy9leHRlcm5hbC10ZW5hbnQvZXh0ZXJuYWwtdGVuYW50LnNlcnZpY2UudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IjtBQUFBLE9BQU8sRUFBRSxhQUFhLEVBQUUsTUFBTSwyQ0FBMkMsQ0FBQztBQUMxRSxPQUFPLEVBQUUsVUFBVSxFQUFFLE1BQU0sZUFBZSxDQUFDO0FBQzNDLE9BQU8sRUFBRSxVQUFVLEVBQUUsTUFBTSxzQkFBc0IsQ0FBQztBQUNsRCxPQUFPLEVBQUUsY0FBYyxFQUFFLE1BQU0sYUFBYSxDQUFDO0FBSTdDO0lBQTJDLGlEQUFnQztJQUN2RSwrQkFBc0IsSUFBZ0IsRUFBWSxjQUE4QjtRQUFoRixZQUNJLGtCQUFNLElBQUksRUFBRSxjQUFjLEVBQUUsb0NBQW9DLEVBQUUsRUFBRSxDQUFDLFNBQ3hFO1FBRnFCLFVBQUksR0FBSixJQUFJLENBQVk7UUFBWSxvQkFBYyxHQUFkLGNBQWMsQ0FBZ0I7O0lBRWhGLENBQUM7SUFIUSxxQkFBcUI7UUFEakMsVUFBVSxFQUFFO2lEQUVtQixVQUFVLEVBQTRCLGNBQWM7T0FEdkUscUJBQXFCLENBSWpDO0lBQUQsNEJBQUM7Q0FBQSxBQUpELENBQTJDLGFBQWEsR0FJdkQ7U0FKWSxxQkFBcUIiLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgeyBFbnRpdHlTZXJ2aWNlIH0gZnJvbSAnLi8uLi8uLi8uLi9zYW0tc2VuaW9yL2NvcmUvZW50aXR5LXNlcnZpY2UnO1xuaW1wb3J0IHsgSW5qZWN0YWJsZSB9IGZyb20gJ0Bhbmd1bGFyL2NvcmUnO1xuaW1wb3J0IHsgSHR0cENsaWVudCB9IGZyb20gJ0Bhbmd1bGFyL2NvbW1vbi9odHRwJztcbmltcG9ydCB7IE1lc3NhZ2VTZXJ2aWNlIH0gZnJvbSAncHJpbWVuZy9hcGknO1xuaW1wb3J0IHsgRXh0ZXJuYWxUZW5hbnREdG8gfSBmcm9tICcuL2V4dGVybmFsLXRlbmFudC1kdG8nO1xuXG5ASW5qZWN0YWJsZSgpXG5leHBvcnQgY2xhc3MgRXh0ZXJuYWxUZW5hbnRTZXJ2aWNlIGV4dGVuZHMgRW50aXR5U2VydmljZTxFeHRlcm5hbFRlbmFudER0bz4ge1xuICAgIGNvbnN0cnVjdG9yKHByb3RlY3RlZCBodHRwOiBIdHRwQ2xpZW50LCBwcm90ZWN0ZWQgbWVzc2FnZVNlcnZpY2U6IE1lc3NhZ2VTZXJ2aWNlKSB7XG4gICAgICAgIHN1cGVyKGh0dHAsIG1lc3NhZ2VTZXJ2aWNlLCAneW1zL2FnZW5kYS9lbnRpdGllcy9leHRlcm5hbFRlbmFudCcsICcnKTtcbiAgICB9XG59XG4iXX0=
@@ -4,5 +4,6 @@ export var InvoiceCondition;
4
4
  InvoiceCondition["PARTIAL_AUTHORIZED"] = "PARTIAL_AUTHORIZED";
5
5
  InvoiceCondition["MANUAL_AUTHORIZED"] = "MANUAL_AUTHORIZED";
6
6
  InvoiceCondition["DEVOLUTION"] = "DEVOLUTION";
7
+ InvoiceCondition["REJECTED"] = "REJECTED";
7
8
  })(InvoiceCondition || (InvoiceCondition = {}));
8
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW52b2ljZS1jb25kaXRpb24uanMiLCJzb3VyY2VSb290Ijoibmc6Ly9Ac2VuaW9yc2lzdGVtYXMveW1zLWludGVncmF0aW9uLyIsInNvdXJjZXMiOlsic3JjL3dtcy9lbnRpdGllcy9pbnZvaWNlLWNvbmRpdGlvbi9pbnZvaWNlLWNvbmRpdGlvbi50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxNQUFNLENBQU4sSUFBWSxnQkFLWDtBQUxELFdBQVksZ0JBQWdCO0lBQ3hCLDZDQUF5QixDQUFBO0lBQ3pCLDZEQUF5QyxDQUFBO0lBQ3pDLDJEQUF1QyxDQUFBO0lBQ3ZDLDZDQUF5QixDQUFBO0FBQzdCLENBQUMsRUFMVyxnQkFBZ0IsS0FBaEIsZ0JBQWdCLFFBSzNCIiwic291cmNlc0NvbnRlbnQiOlsiZXhwb3J0IGVudW0gSW52b2ljZUNvbmRpdGlvbiB7XG4gICAgQVVUSE9SSVpFRCA9IFwiQVVUSE9SSVpFRFwiLFxuICAgIFBBUlRJQUxfQVVUSE9SSVpFRCA9IFwiUEFSVElBTF9BVVRIT1JJWkVEXCIsXG4gICAgTUFOVUFMX0FVVEhPUklaRUQgPSBcIk1BTlVBTF9BVVRIT1JJWkVEXCIsXG4gICAgREVWT0xVVElPTiA9IFwiREVWT0xVVElPTlwiLFxufVxuIl19
9
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW52b2ljZS1jb25kaXRpb24uanMiLCJzb3VyY2VSb290Ijoibmc6Ly9Ac2VuaW9yc2lzdGVtYXMveW1zLWludGVncmF0aW9uLyIsInNvdXJjZXMiOlsic3JjL3dtcy9lbnRpdGllcy9pbnZvaWNlLWNvbmRpdGlvbi9pbnZvaWNlLWNvbmRpdGlvbi50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxNQUFNLENBQU4sSUFBWSxnQkFNWDtBQU5ELFdBQVksZ0JBQWdCO0lBQ3hCLDZDQUF5QixDQUFBO0lBQ3pCLDZEQUF5QyxDQUFBO0lBQ3pDLDJEQUF1QyxDQUFBO0lBQ3ZDLDZDQUF5QixDQUFBO0lBQ3pCLHlDQUFxQixDQUFBO0FBQ3pCLENBQUMsRUFOVyxnQkFBZ0IsS0FBaEIsZ0JBQWdCLFFBTTNCIiwic291cmNlc0NvbnRlbnQiOlsiZXhwb3J0IGVudW0gSW52b2ljZUNvbmRpdGlvbiB7XG4gICAgQVVUSE9SSVpFRCA9IFwiQVVUSE9SSVpFRFwiLFxuICAgIFBBUlRJQUxfQVVUSE9SSVpFRCA9IFwiUEFSVElBTF9BVVRIT1JJWkVEXCIsXG4gICAgTUFOVUFMX0FVVEhPUklaRUQgPSBcIk1BTlVBTF9BVVRIT1JJWkVEXCIsXG4gICAgREVWT0xVVElPTiA9IFwiREVWT0xVVElPTlwiLFxuICAgIFJFSkVDVEVEID0gXCJSRUpFQ1RFRFwiLFxufVxuIl19
@@ -3072,8 +3072,20 @@ var InvoiceCondition;
3072
3072
  InvoiceCondition["PARTIAL_AUTHORIZED"] = "PARTIAL_AUTHORIZED";
3073
3073
  InvoiceCondition["MANUAL_AUTHORIZED"] = "MANUAL_AUTHORIZED";
3074
3074
  InvoiceCondition["DEVOLUTION"] = "DEVOLUTION";
3075
+ InvoiceCondition["REJECTED"] = "REJECTED";
3075
3076
  })(InvoiceCondition || (InvoiceCondition = {}));
3076
3077
 
3078
+ function getInvoiceConditions(translate) {
3079
+ return [
3080
+ { label: translate.instant("yms.int.wms_grid_document_invoice_no_way"), value: null },
3081
+ { label: translate.instant("yms.int.wms_grid_document_invoice_condition_authorized"), value: InvoiceCondition.AUTHORIZED },
3082
+ { label: translate.instant("yms.int.wms_grid_document_invoice_condition_manual_authorized"), value: InvoiceCondition.MANUAL_AUTHORIZED },
3083
+ { label: translate.instant("yms.int.wms_grid_document_invoice_condition_partial_authorized"), value: InvoiceCondition.PARTIAL_AUTHORIZED },
3084
+ { label: translate.instant("yms.int.wms_grid_document_invoice_condition_devolution"), value: InvoiceCondition.DEVOLUTION },
3085
+ { label: translate.instant("yms.int.wms_grid_document_invoice_condition_rejected"), value: InvoiceCondition.REJECTED },
3086
+ ];
3087
+ }
3088
+
3077
3089
  let DocumentGridComponent = class DocumentGridComponent {
3078
3090
  constructor(translate, documentService, confirmationService, integrationService, agendaService, utils) {
3079
3091
  this.translate = translate;
@@ -3085,17 +3097,19 @@ let DocumentGridComponent = class DocumentGridComponent {
3085
3097
  this.viewDocument = new EventEmitter();
3086
3098
  this.gridData = [];
3087
3099
  this.enableButtonIsClienteExterno = true;
3100
+ this.invoiceConditions = getInvoiceConditions(this.translate);
3088
3101
  this.summary = "yms.int.wms_saved_document_message_title";
3089
3102
  this.ngUnsubscribe = new Subject();
3090
- this.invoiceCondition = [
3091
- { label: this.translate.instant("yms.int.wms_grid_document_invoice_no_way"), value: null },
3092
- { label: this.translate.instant("yms.int.wms_grid_document_invoice_condition_authorized"), value: InvoiceCondition.AUTHORIZED },
3093
- { label: this.translate.instant("yms.int.wms_grid_document_invoice_condition_manual_authorized"), value: InvoiceCondition.MANUAL_AUTHORIZED },
3094
- { label: this.translate.instant("yms.int.wms_grid_document_invoice_condition_partial_authorized"), value: InvoiceCondition.PARTIAL_AUTHORIZED },
3095
- { label: this.translate.instant("yms.int.wms_grid_document_invoice_condition_devolucion"), value: InvoiceCondition.DEVOLUTION },
3096
- ];
3097
3103
  this.selection = [];
3098
3104
  }
3105
+ getFilteredInvoiceConditions(invoiceConditions) {
3106
+ if (invoiceConditions === InvoiceCondition.AUTHORIZED) {
3107
+ return this.invoiceConditions.filter(cond => cond.value === InvoiceCondition.AUTHORIZED);
3108
+ }
3109
+ else {
3110
+ return this.invoiceConditions.filter(cond => cond.value !== InvoiceCondition.AUTHORIZED);
3111
+ }
3112
+ }
3099
3113
  ngOnInit() {
3100
3114
  this.verifyClienteExterno();
3101
3115
  this.getProcessTypeByScheduling();
@@ -3207,7 +3221,6 @@ let DocumentGridComponent = class DocumentGridComponent {
3207
3221
  this.sucessMessage();
3208
3222
  });
3209
3223
  this.disabled = true;
3210
- this.listDocuments(false);
3211
3224
  }
3212
3225
  else {
3213
3226
  this.documentService.update(data.id, data).subscribe(() => {
@@ -3216,6 +3229,7 @@ let DocumentGridComponent = class DocumentGridComponent {
3216
3229
  });
3217
3230
  }
3218
3231
  });
3232
+ this.listDocuments(false);
3219
3233
  }
3220
3234
  }
3221
3235
  updateKeyByWms(data) {
@@ -3254,9 +3268,13 @@ let DocumentGridComponent = class DocumentGridComponent {
3254
3268
  }
3255
3269
  });
3256
3270
  }
3271
+ notSavedDocuments() {
3272
+ return this.gridData.some(document => !document.id);
3273
+ }
3257
3274
  listDocuments(isDelete) {
3258
3275
  this.documentService.list({
3259
- filterQuery: `schedulingId eq '${this.agenda.id}'`
3276
+ filterQuery: `schedulingId eq '${this.agenda.id}'`,
3277
+ size: 100
3260
3278
  })
3261
3279
  .subscribe((contents) => {
3262
3280
  this.gridData = isDelete ? this.gridData.filter(item => !item.id) : [];
@@ -3398,7 +3416,7 @@ __decorate([
3398
3416
  DocumentGridComponent = __decorate([
3399
3417
  Component({
3400
3418
  selector: 'document-grid',
3401
- template: "<div *ngIf=\"this.processType === 'RECEBIMENTO_WMS'; else processNotConfigured\">\n <p-panel>\n <p-header>\n <div class=\"buttons\">\n <div>\n <s-button\n label=\"{{'yms.int.wms_add_document' | translate}}\"\n priority=\"primary\"\n [model]=\"getActions()\"\n [auxiliary]=\"false\"\n [disabled]=\"!enableButtonIsClienteExterno\">\n </s-button>\n <s-button\n label=\"{{'yms.wms_view_button' | translate}}\"\n priority=\"secondary\"\n [auxiliary]=\"false\"\n [disabled]=\"!selection || selection.length !== 1\"\n (onClick)=\"view()\">\n </s-button>\n <s-button\n label=\"{{'yms.wms_delete_button' | translate}}\"\n priority=\"secondary\"\n [disabled]=\"!selection || !selection.length || !enableButtonIsClienteExterno\"\n (click)=\"onDelete()\">\n </s-button>\n </div>\n <s-button\n id=\"refresh-button\"\n priority=\"default\"\n iconClass=\"fa fa-refresh\"\n (onClick)=\"listDocuments(false)\"\n >\n </s-button>\n </div>\n </p-header>\n <div class=\"ui-g\">\n <div class=\"ui-g-12\" *ngIf=\"gridData && gridData.length; else emptyList\">\n <p-table #documentTable [value]=\"gridData\"\n [columns]=\"gridColumns\" dataKey=\"key\" [lazy]=\"true\" [scrollable]=\"true\" [resizableColumns]=\"true\"\n sortMode=\"multiple\" [paginator]=\"true\" [totalRecords]=\"documentTotalRecords\" rows=\"10\"\n [rowsPerPageOptions]=\"[10, 20, 50, 100]\" [(selection)]=\"selection\"\n [loading]=\"loading\">\n <ng-template pTemplate=\"colgroup\" let-columns>\n <colgroup>\n <col *ngFor=\"let col of columns\" [style.width]=\"col.width\"/>\n </colgroup>\n </ng-template>\n <ng-template pTemplate=\"header\" let-columns>\n <tr>\n <th id=\"checkbox\" class=\"table-checkbox\">\n <p-tableHeaderCheckbox></p-tableHeaderCheckbox>\n </th>\n <th id=\"col\" *ngFor=\"let col of columns\" [pSortableColumn]=\"col.field\" pResizableColumn>\n <div class=\"senior-header\">\n <span class=\"senior-header-title\">{{ col.header }}</span>\n <p-sortIcon [field]=\"col.field\"></p-sortIcon>\n </div>\n </th>\n </tr>\n </ng-template>\n <ng-template pTemplate=\"body\" let-rowData let-columns let-expanded=\"expanded\">\n <tr [pSelectableRow]=\"rowData\">\n <td class=\"table-checkbox\">\n <p-tableCheckbox [value]=\"rowData\"></p-tableCheckbox>\n </td>\n <td *ngIf=\"isWmsSeniorConnect()\" (click)=\"selection = [rowData]\">\n <span>{{rowData[\"key\"]}}</span>\n </td>\n <td *ngIf=\"isWmsSilt()\" (click)=\"selection = [rowData]\">\n <span>{{rowData[\"invoiceKey\"]}}</span>\n </td>\n <td *ngIf=\"isWmsWIS() || isWmsSilt()\" (click)=\"selection = [rowData]\">\n <span>{{rowData[\"invoiceNumber\"]}}</span>\n </td>\n <td *ngIf=\"isWmsWIS() || isWmsSilt()\" (click)=\"selection = [rowData]\">\n <span>{{rowData[\"invoiceSerialNumber\"]}}</span>\n </td>\n <td *ngIf=\"isWmsWIS() || isWmsSeniorConnect() || isWmsSilt()\" (click)=\"selection = [rowData]\">\n <span>{{rowData[\"partnerName\"]}}</span>\n </td>\n <td *ngIf=\"isWmsWIS() || isWmsSeniorConnect() || isWmsSilt()\" (click)=\"selection = [rowData]\">\n <span>{{rowData[\"partnerDocument\"]}}</span>\n </td>\n <td *ngIf=\"isWmsWIS() || isWmsSilt()\" (click)=\"selection = [rowData]\">\n <span>{{rowData[\"logistcUnitName\"]}}</span>\n </td>\n <td *ngIf=\"isWmsWIS() || isWmsSilt()\" (click)=\"selection = [rowData]\">\n <span>{{rowData[\"logistcUnitDocument\"]}}</span>\n </td>\n <td *ngIf=\"isWmsSilt()\" (click)=\"selection = [rowData]\">\n <span>{{rowData[\"ownerName\"]}}</span>\n </td>\n <td *ngIf=\"isWmsSilt()\" (click)=\"selection = [rowData]\">\n <span>{{rowData[\"ownerDocument\"]}}</span>\n </td>\n <td *ngIf=\"!isClienteExterno\" (click)=\"selection = [rowData]\">\n <p-dropdown\n inputId=\"invoiceCondition\"\n name=\"invoiceCondition\"\n [autoWidth]=\"false\"\n [options]=\"invoiceCondition\"\n appendTo=\"body\"\n [(ngModel)]=\"rowData.invoiceCondition\"\n (onChange)=\"disabled = false\">\n </p-dropdown>\n </td>\n </tr>\n </ng-template>\n <ng-template pTemplate=\"paginatorright\">\n <span [translate]=\"'total_records'\" [translateParams]=\"{ value: documentTotalRecords }\"></span>\n </ng-template>\n </p-table> \n </div>\n </div>\n <register-document\n [wmsSystem]=\"wmsSystem\"\n [edit]=\"edit\"\n [viewDocument]=\"selection\"\n (document)=\"onChangeDocument($event)\"\n [(visible)]=\"visibleDocumentRegister\"\n [agenda]=\"agenda\"\n [isClienteExterno]=\"isClienteExterno\">\n </register-document> \n <insert-key\n [wmsSystem]=\"wmsSystem\" \n (document)=\"onChangeDocument($event)\"\n [(visible)]=\"visibleInvoiceKey\">\n </insert-key>\n </p-panel>\n</div>\n <div class=\"button-save\">\n <s-button \n priority=\"primary\" [label]=\"'save' | translate\"\n [disabled]=\"disabled || !this.gridData || !enableButtonIsClienteExterno\"\n (click)=\"save()\">\n </s-button>\n </div>\n\n<ng-template #emptyList>\n <div class=\"center\">\n <s-empty-state\n iconClass=\"fa fa-exclamation-triangle\" [title]=\"'detail_empty_state_title' | translate\"\n [description]=\"'detail_empty_state_description' | translate\">\n </s-empty-state>\n </div>\n</ng-template>\n\n<ng-template #processNotConfigured>\n <div class=\"center\">\n <s-empty-state\n iconClass=\"fa fa-exclamation-triangle\"\n [title]=\"'yms.int.wms_there_no_process_type_configured_for_this_type_scheduling' | translate\">\n </s-empty-state>\n </div>\n</ng-template>",
3419
+ template: "<div *ngIf=\"this.processType === 'RECEBIMENTO_WMS'; else processNotConfigured\">\n <p-panel>\n <p-header>\n <div class=\"buttons\">\n <div>\n <s-button\n label=\"{{'yms.int.wms_add_document' | translate}}\"\n priority=\"primary\"\n [model]=\"getActions()\"\n [auxiliary]=\"false\"\n [disabled]=\"!enableButtonIsClienteExterno\">\n </s-button>\n <s-button\n label=\"{{'yms.wms_view_button' | translate}}\"\n priority=\"secondary\"\n [auxiliary]=\"false\"\n [disabled]=\"!selection || selection.length !== 1\"\n (onClick)=\"view()\">\n </s-button>\n <s-button\n label=\"{{'yms.wms_delete_button' | translate}}\"\n priority=\"secondary\"\n [disabled]=\"!selection || !selection.length || !enableButtonIsClienteExterno\"\n (click)=\"onDelete()\">\n </s-button>\n </div>\n <s-button\n id=\"refresh-button\"\n priority=\"default\"\n iconClass=\"fa fa-refresh\"\n (onClick)=\"listDocuments(false)\"\n [disabled]=\"notSavedDocuments()\"\n >\n </s-button>\n </div>\n </p-header>\n <div class=\"ui-g\">\n <div class=\"ui-g-12\" *ngIf=\"gridData && gridData.length; else emptyList\">\n <p-table #documentTable [value]=\"gridData\"\n [columns]=\"gridColumns\" dataKey=\"key\" [scrollable]=\"true\" [resizableColumns]=\"true\"\n [paginator]=\"true\" [totalRecords]=\"documentTotalRecords\" rows=\"10\"\n [rowsPerPageOptions]=\"[10, 20, 50, 100]\" [(selection)]=\"selection\"\n [loading]=\"loading\">\n <ng-template pTemplate=\"colgroup\" let-columns>\n <colgroup>\n <col *ngFor=\"let col of columns\" [style.width]=\"col.width\"/>\n </colgroup>\n </ng-template>\n <ng-template pTemplate=\"header\" let-columns>\n <tr>\n <th id=\"checkbox\" class=\"table-checkbox\">\n <p-tableHeaderCheckbox></p-tableHeaderCheckbox>\n </th>\n <th id=\"col\" *ngFor=\"let col of columns\" pResizableColumn>\n <div class=\"senior-header\">\n <span class=\"senior-header-title\">{{ col.header }}</span>\n </div>\n </th>\n </tr>\n </ng-template>\n <ng-template pTemplate=\"body\" let-rowData let-columns let-expanded=\"expanded\">\n <tr [pSelectableRow]=\"rowData\">\n <td class=\"table-checkbox\">\n <p-tableCheckbox [value]=\"rowData\"></p-tableCheckbox>\n </td>\n <td *ngIf=\"isWmsSeniorConnect()\" (click)=\"selection = [rowData]\">\n <span>{{rowData[\"key\"]}}</span>\n </td>\n <td *ngIf=\"isWmsSilt()\" (click)=\"selection = [rowData]\">\n <span>{{rowData[\"invoiceKey\"]}}</span>\n </td>\n <td *ngIf=\"isWmsWIS() || isWmsSilt()\" (click)=\"selection = [rowData]\">\n <span>{{rowData[\"invoiceNumber\"]}}</span>\n </td>\n <td *ngIf=\"isWmsWIS() || isWmsSilt()\" (click)=\"selection = [rowData]\">\n <span>{{rowData[\"invoiceSerialNumber\"]}}</span>\n </td>\n <td *ngIf=\"isWmsWIS() || isWmsSeniorConnect() || isWmsSilt()\" (click)=\"selection = [rowData]\">\n <span>{{rowData[\"partnerName\"]}}</span>\n </td>\n <td *ngIf=\"isWmsWIS() || isWmsSeniorConnect() || isWmsSilt()\" (click)=\"selection = [rowData]\">\n <span>{{rowData[\"partnerDocument\"]}}</span>\n </td>\n <td *ngIf=\"isWmsWIS() || isWmsSilt()\" (click)=\"selection = [rowData]\">\n <span>{{rowData[\"logistcUnitName\"]}}</span>\n </td>\n <td *ngIf=\"isWmsWIS() || isWmsSilt()\" (click)=\"selection = [rowData]\">\n <span>{{rowData[\"logistcUnitDocument\"]}}</span>\n </td>\n <td *ngIf=\"isWmsSilt()\" (click)=\"selection = [rowData]\">\n <span>{{rowData[\"ownerName\"]}}</span>\n </td>\n <td *ngIf=\"isWmsSilt()\" (click)=\"selection = [rowData]\">\n <span>{{rowData[\"ownerDocument\"]}}</span>\n </td>\n <td *ngIf=\"!isClienteExterno\" (click)=\"selection = [rowData]\">\n <p-dropdown\n inputId=\"invoiceCondition\"\n name=\"invoiceCondition\"\n [autoWidth]=\"false\"\n [options]=\"getFilteredInvoiceConditions(rowData?.invoiceCondition)\"\n appendTo=\"body\"\n [(ngModel)]=\"rowData.invoiceCondition\"\n (onChange)=\"disabled = false\">\n </p-dropdown>\n </td>\n </tr>\n </ng-template>\n <ng-template pTemplate=\"paginatorright\">\n <span [translate]=\"'yms.main.total_records'\" \n [translateParams]=\"{ value: documentTotalRecords }\">\n </span>\n </ng-template>\n </p-table> \n </div>\n </div>\n <register-document\n [wmsSystem]=\"wmsSystem\"\n [edit]=\"edit\"\n [viewDocument]=\"selection\"\n (document)=\"onChangeDocument($event)\"\n [(visible)]=\"visibleDocumentRegister\"\n [agenda]=\"agenda\"\n [isClienteExterno]=\"isClienteExterno\">\n </register-document> \n <insert-key\n [wmsSystem]=\"wmsSystem\" \n (document)=\"onChangeDocument($event)\"\n [(visible)]=\"visibleInvoiceKey\">\n </insert-key>\n </p-panel>\n</div>\n <div class=\"button-save\">\n <s-button \n priority=\"primary\" [label]=\"'save' | translate\"\n [disabled]=\"disabled || !this.gridData || !enableButtonIsClienteExterno\"\n (click)=\"save()\">\n </s-button>\n </div>\n\n<ng-template #emptyList>\n <div class=\"center\">\n <s-empty-state\n iconClass=\"fa fa-exclamation-triangle\" [title]=\"'detail_empty_state_title' | translate\"\n [description]=\"'detail_empty_state_description' | translate\">\n </s-empty-state>\n </div>\n</ng-template>\n\n<ng-template #processNotConfigured>\n <div class=\"center\">\n <s-empty-state\n iconClass=\"fa fa-exclamation-triangle\"\n [title]=\"'yms.int.wms_there_no_process_type_configured_for_this_type_scheduling' | translate\">\n </s-empty-state>\n </div>\n</ng-template>",
3402
3420
  styles: [".buttons{display:flex;justify-content:space-between}.center{flex-direction:column;text-align:center}.ui-g{display:block}.button-save{margin:5px 0}#refresh-button{color:#fff}.table-checkbox{width:50px}.invoice-condition .p-dropdown{position:relative;z-index:1000}"]
3403
3421
  }),
3404
3422
  __metadata("design:paramtypes", [TranslateService,
@@ -3456,13 +3474,7 @@ let RegisterDocumentComponent = class RegisterDocumentComponent {
3456
3474
  this.visible = new EventEmitter();
3457
3475
  this.visibleChange = new EventEmitter();
3458
3476
  this.isSaveFormValid = false;
3459
- this.invoiceCondition = [
3460
- { label: this.translate.instant("yms.int.wms_grid_document_invoice_no_way"), value: null },
3461
- { label: this.translate.instant("yms.int.wms_grid_document_invoice_condition_authorized"), value: InvoiceCondition.AUTHORIZED },
3462
- { label: this.translate.instant("yms.int.wms_grid_document_invoice_condition_manual_authorized"), value: InvoiceCondition.MANUAL_AUTHORIZED },
3463
- { label: this.translate.instant("yms.int.wms_grid_document_invoice_condition_partial_authorized"), value: InvoiceCondition.PARTIAL_AUTHORIZED },
3464
- { label: this.translate.instant("yms.int.wms_grid_document_invoice_condition_devolucion"), value: InvoiceCondition.DEVOLUTION },
3465
- ];
3477
+ this.invoiceCondition = getInvoiceConditions(this.translate);
3466
3478
  }
3467
3479
  ngOnInit() {
3468
3480
  this.getFormGroup();
@@ -3600,15 +3612,32 @@ RegisterDocumentModule = __decorate([
3600
3612
  })
3601
3613
  ], RegisterDocumentModule);
3602
3614
 
3615
+ let ExternalTenantService = class ExternalTenantService extends EntityService {
3616
+ constructor(http, messageService) {
3617
+ super(http, messageService, 'yms/agenda/entities/externalTenant', '');
3618
+ this.http = http;
3619
+ this.messageService = messageService;
3620
+ }
3621
+ };
3622
+ ExternalTenantService = __decorate([
3623
+ Injectable(),
3624
+ __metadata("design:paramtypes", [HttpClient, MessageService])
3625
+ ], ExternalTenantService);
3626
+
3603
3627
  let InsertKeyComponent = class InsertKeyComponent {
3604
- constructor(formBuilder, documentService, utils) {
3628
+ constructor(formBuilder, documentService, utils, confirmationService, translate, externalTenantService) {
3605
3629
  this.formBuilder = formBuilder;
3606
3630
  this.documentService = documentService;
3607
3631
  this.utils = utils;
3632
+ this.confirmationService = confirmationService;
3633
+ this.translate = translate;
3634
+ this.externalTenantService = externalTenantService;
3608
3635
  this.document = new EventEmitter();
3609
3636
  this.visible = new EventEmitter();
3610
3637
  this.visibleChange = new EventEmitter();
3611
3638
  this.isLoading = false;
3639
+ this.isPartnerloading = false;
3640
+ this.ngUnsubscribe = new Subject();
3612
3641
  }
3613
3642
  ngOnInit() {
3614
3643
  this.formGroup = this.formBuilder.group({
@@ -3652,6 +3681,7 @@ let InsertKeyComponent = class InsertKeyComponent {
3652
3681
  else {
3653
3682
  this.utils.translateMessage("error", "yms.int.wms_error_search_document_message_header", "yms.int.wms_error_unknown_search_document_message_content" + err.error.message);
3654
3683
  }
3684
+ this.confirmInvoiceDialog();
3655
3685
  return throwError(err);
3656
3686
  }), finalize(() => {
3657
3687
  this.isLoading = false;
@@ -3661,10 +3691,54 @@ let InsertKeyComponent = class InsertKeyComponent {
3661
3691
  this.utils.message("warn", "yms.int.wms_insert_key_warning_message_header", "yms.int.wms_insert_key_warning_message_description");
3662
3692
  return;
3663
3693
  }
3664
- this.document.emit(content.contents[0]);
3694
+ const document = content.contents[0];
3695
+ document.invoiceKey = this.formGroup.get('key').value;
3696
+ document.invoiceCondition = InvoiceCondition.AUTHORIZED;
3697
+ this.document.emit(document);
3665
3698
  this.formGroup.reset();
3666
3699
  });
3667
3700
  }
3701
+ confirmInvoiceDialog() {
3702
+ this.confirmationService.confirm({
3703
+ message: this.translate.instant("yms.int.wms_message_confirm_invoice_dialog"),
3704
+ acceptLabel: this.translate.instant("yms.int.wms_accept_confirm_invoice_dialog"),
3705
+ rejectLabel: this.translate.instant("yms.int.wms_reject_confirm_invoice_dialog"),
3706
+ header: this.translate.instant("yms.int.wms_header_content_confirm_invoice_dialog"),
3707
+ accept: () => this.buildInvoice()
3708
+ });
3709
+ }
3710
+ buildInvoice() {
3711
+ this.isPartnerloading = true;
3712
+ const partnerDocument = this.formGroup.get('partnerDocument').value;
3713
+ this.externalTenantService.list({
3714
+ filterQuery: `cnpj eq '${partnerDocument}'`
3715
+ })
3716
+ .pipe(takeUntil(this.ngUnsubscribe), finalize(() => {
3717
+ this.isPartnerloading = false;
3718
+ }))
3719
+ .subscribe((contents) => {
3720
+ const documentInvoice = this.createDocumentInvoice(contents);
3721
+ this.document.emit(documentInvoice);
3722
+ this.formGroup.reset();
3723
+ });
3724
+ }
3725
+ createDocumentInvoice(partners) {
3726
+ const documentInvoice = {
3727
+ invoiceKey: this.formGroup.get('key').value,
3728
+ invoiceNumber: this.formGroup.get('invoiceNumber').value,
3729
+ invoiceSerialNumber: this.formGroup.get('invoiceSerie').value,
3730
+ partnerDocument: this.formGroup.get('partnerDocument').value,
3731
+ partnerName: null,
3732
+ type: null,
3733
+ key: null,
3734
+ schedulingId: null
3735
+ };
3736
+ if (partners.totalElements > 0) {
3737
+ const partner = partners.contents[0];
3738
+ documentInvoice.partnerName = partner.descricao;
3739
+ }
3740
+ return documentInvoice;
3741
+ }
3668
3742
  validateKeyDetails(nf) {
3669
3743
  if (!nf) {
3670
3744
  this.keyErrorMessage = null;
@@ -3723,12 +3797,15 @@ __decorate([
3723
3797
  InsertKeyComponent = __decorate([
3724
3798
  Component({
3725
3799
  selector: "insert-key",
3726
- template: "<form [formGroup]=\"formGroup\">\n <p-dialog [(visible)]=\"visible\" [modal]=\"true\" \n [draggable]=\"false\" (visibleChange)=\"cancel()\" (onShow)=\"onDialogShow()\">\n <p-header>{{'yms.int.wms_search_document' | translate}} {{ wmsSystem }}</p-header>\n <s-loading-state [loading]=\"isLoading\">\n <div class=\"flex py-2 justify-content-center spacing-bottom\"\n *ngIf=\"!isWmsSeniorConnect()\">\n <label for=\"key\">{{'yms.int.wms_insert_key_label' | translate}}</label>\n <input id=\"key\" class=\"size-input\" pInputText type=\"text\" formControlName=\"key\">\n <span class=\"error-message\">{{keyErrorMessage | translate}}</span>\n </div>\n <div class=\"flex py-2 justify-content-center spacing-bottom\" *ngIf=\"isWmsSeniorConnect()\">\n <label for=\"purchaseOrder\">{{'yms.int.wms_purchaseOrder' | translate}} </label>\n <input id=\"purchaseOrder\" class=\"size-input\" pInputText type=\"text\" formControlName=\"purchaseOrder\">\n </div>\n <div class=\"flex py-2 justify-content-center spacing-bottom\" *ngIf=\"isWmsWis()\">\n <label for=\"invoiceNumber\">{{'yms.int.wms_invoice_number' | translate}}</label>\n <input id=\"invoiceNumber\" class=\"size-input\" pInputText type=\"text\" formControlName=\"invoiceNumber\">\n </div>\n <div class=\"flex py-2 justify-content-center spacing-bottom\" *ngIf=\"isWmsWis()\">\n <label for=\"invoiceSerie\">{{'yms.int.wms_invoice_serie' | translate}}</label>\n <input id=\"invoiceSerie\" class=\"size-input\" pInputText type=\"text\" formControlName=\"invoiceSerie\">\n </div>\n <div class=\"flex py-2 justify-content-center spacing-bottom\" *ngIf=\"isWmsWis()\">\n <label for=\"partnerDocument\">{{'yms.int.wms_partner_document' | translate}}</label>\n <input id=\"partnerDocument\" class=\"size-input\" pInputText type=\"text\" formControlName=\"partnerDocument\">\n </div>\n <div class=\"separator\"></div>\n <div class=\"spacing-top\">\n <s-button pButton label=\"{{'yms.int.wms_search' | translate}}\" (click)=\"add()\"></s-button>\n <s-button\n type=\"button\"\n class=\"ui-button-link\"\n pButton label=\"{{'cancel' | translate}}\"\n (click)=\"cancel()\">\n </s-button>\n </div>\n </s-loading-state>\n </p-dialog>\n\n</form>\n",
3800
+ template: "<form [formGroup]=\"formGroup\">\n <p-dialog [(visible)]=\"visible\" [modal]=\"true\" \n [draggable]=\"false\" (visibleChange)=\"cancel()\" (onShow)=\"onDialogShow()\">\n <p-header>{{'yms.int.wms_search_document' | translate}} {{ wmsSystem }}</p-header>\n <s-loading-state [loading]=\"isLoading || isPartnerloading\">\n <div class=\"flex py-2 justify-content-center spacing-bottom\"\n *ngIf=\"!isWmsSeniorConnect()\">\n <label for=\"key\">{{'yms.int.wms_insert_key_label' | translate}}</label>\n <input id=\"key\" class=\"size-input\" pInputText type=\"text\" formControlName=\"key\">\n <span class=\"error-message\">{{keyErrorMessage | translate}}</span>\n </div>\n <div class=\"flex py-2 justify-content-center spacing-bottom\" *ngIf=\"isWmsSeniorConnect()\">\n <label for=\"purchaseOrder\">{{'yms.int.wms_purchaseOrder' | translate}} </label>\n <input id=\"purchaseOrder\" class=\"size-input\" pInputText type=\"text\" formControlName=\"purchaseOrder\">\n </div>\n <div class=\"flex py-2 justify-content-center spacing-bottom\" *ngIf=\"isWmsWis()\">\n <label for=\"invoiceNumber\">{{'yms.int.wms_invoice_number' | translate}}</label>\n <input id=\"invoiceNumber\" class=\"size-input\" pInputText type=\"text\" formControlName=\"invoiceNumber\">\n </div>\n <div class=\"flex py-2 justify-content-center spacing-bottom\" *ngIf=\"isWmsWis()\">\n <label for=\"invoiceSerie\">{{'yms.int.wms_invoice_serie' | translate}}</label>\n <input id=\"invoiceSerie\" class=\"size-input\" pInputText type=\"text\" formControlName=\"invoiceSerie\">\n </div>\n <div class=\"flex py-2 justify-content-center spacing-bottom\" *ngIf=\"isWmsWis()\">\n <label for=\"partnerDocument\">{{'yms.int.wms_partner_document' | translate}}</label>\n <input id=\"partnerDocument\" class=\"size-input\" pInputText type=\"text\" formControlName=\"partnerDocument\">\n </div>\n <div class=\"separator\"></div>\n <div class=\"spacing-top\">\n <s-button pButton label=\"{{'yms.int.wms_search' | translate}}\" (click)=\"add()\"></s-button>\n <s-button\n type=\"button\"\n class=\"ui-button-link\"\n pButton label=\"{{'cancel' | translate}}\"\n (click)=\"cancel()\">\n </s-button>\n </div>\n </s-loading-state>\n </p-dialog>\n\n</form>\n",
3727
3801
  styles: [".spacing-top{margin-top:10px}.spacing-bottom{margin-bottom:10px}.separator{width:100%;margin:5px 0;height:1px;background-color:#ccc}.size-input{width:480px}.error-message{color:#c13018;display:flex}"]
3728
3802
  }),
3729
3803
  __metadata("design:paramtypes", [FormBuilder,
3730
3804
  DocumentService,
3731
- UtilsMessageService])
3805
+ UtilsMessageService,
3806
+ ConfirmationService,
3807
+ TranslateService,
3808
+ ExternalTenantService])
3732
3809
  ], InsertKeyComponent);
3733
3810
 
3734
3811
  let InsertKeyModule = class InsertKeyModule {
@@ -3745,7 +3822,8 @@ InsertKeyModule = __decorate([
3745
3822
  LoadingStateModule
3746
3823
  ],
3747
3824
  exports: [InsertKeyComponent],
3748
- declarations: [InsertKeyComponent]
3825
+ declarations: [InsertKeyComponent],
3826
+ providers: [ExternalTenantService]
3749
3827
  })
3750
3828
  ], InsertKeyModule);
3751
3829
 
@@ -3756,6 +3834,7 @@ DocumentGridModule = __decorate([
3756
3834
  declarations: [DocumentGridComponent],
3757
3835
  entryComponents: [DocumentGridComponent],
3758
3836
  exports: [DocumentGridComponent],
3837
+ providers: [ExternalTenantService],
3759
3838
  imports: [
3760
3839
  CommonModule,
3761
3840
  TranslateModule,
@@ -3834,22 +3913,35 @@ DocumentListDescritor = __decorate([
3834
3913
  })
3835
3914
  ], DocumentListDescritor);
3836
3915
  let DocumentListComponent = class DocumentListComponent extends DocumentListDescritor {
3837
- constructor(documentService) {
3916
+ constructor(documentService, translate, utils) {
3838
3917
  super();
3839
3918
  this.documentService = documentService;
3919
+ this.translate = translate;
3920
+ this.utils = utils;
3840
3921
  this.getColumns = [];
3841
3922
  this.documents = [];
3923
+ this.amendedDocuments = [];
3842
3924
  this.labels = [];
3843
3925
  this.selected = [];
3844
3926
  this.gridLoading = true;
3845
3927
  this.ngUnsubscribe = new Subject();
3928
+ this.invoiceConditions = [
3929
+ { label: this.translate.instant("yms.int.wms_grid_document_invoice_no_way"), value: null },
3930
+ { label: this.translate.instant("yms.int.wms_grid_document_invoice_condition_authorized"), value: InvoiceCondition.AUTHORIZED },
3931
+ { label: this.translate.instant("yms.int.wms_grid_document_invoice_condition_manual_authorized"), value: InvoiceCondition.MANUAL_AUTHORIZED },
3932
+ { label: this.translate.instant("yms.int.wms_grid_document_invoice_condition_partial_authorized"), value: InvoiceCondition.PARTIAL_AUTHORIZED },
3933
+ { label: this.translate.instant("yms.int.wms_grid_document_invoice_condition_devolution"), value: InvoiceCondition.DEVOLUTION },
3934
+ { label: this.translate.instant("yms.int.wms_grid_document_invoice_condition_rejected"), value: InvoiceCondition.REJECTED },
3935
+ ];
3936
+ this.isAuthorized = (condition) => (condition === InvoiceCondition.AUTHORIZED);
3846
3937
  }
3847
3938
  getColumnLabels() {
3848
3939
  if (this.isWmsWIS()) {
3849
3940
  return [
3850
3941
  ...this.getLabelsInvoice(),
3851
- { field: "partnerName", label: 'yms.int.wms_register_document_invoice_partnerName' },
3852
- { field: "partnerDocument", label: 'yms.int.wms_register_document_invoice_partnerDocument' },
3942
+ { field: "invoiceKey", label: 'yms.int.wms_register_document_invoice_invoice_key' },
3943
+ { field: "partnerName", label: 'yms.int.wms_register_document_invoice_partner_name' },
3944
+ { field: "partnerDocument", label: 'yms.int.wms_register_document_invoice_partner_document' },
3853
3945
  { field: "code", label: 'yms.int.wms_register_document_invoice_code' },
3854
3946
  { field: "invoiceCondition", label: 'yms.int.wms_register_document_invoice_condition' },
3855
3947
  { field: "notes", label: 'yms.int.wms_register_document_invoice_notes' },
@@ -3858,8 +3950,8 @@ let DocumentListComponent = class DocumentListComponent extends DocumentListDesc
3858
3950
  if (this.isWmsSeniorConnect()) {
3859
3951
  return [
3860
3952
  { field: "key", label: 'yms.int.wms_purchaseOrder' },
3861
- { field: "partnerName", label: 'yms.int.wms_register_document_invoice_partnerName' },
3862
- { field: "partnerDocument", label: 'yms.int.wms_register_document_invoice_partnerDocument' },
3953
+ { field: "partnerName", label: 'yms.int.wms_register_document_invoice_partner_name' },
3954
+ { field: "partnerDocument", label: 'yms.int.wms_register_document_invoice_partner_document' },
3863
3955
  ];
3864
3956
  }
3865
3957
  return [
@@ -3888,6 +3980,40 @@ let DocumentListComponent = class DocumentListComponent extends DocumentListDesc
3888
3980
  this.searchDocument(event);
3889
3981
  });
3890
3982
  }
3983
+ getFilteredInvoiceConditions(invoiceConditions) {
3984
+ if (invoiceConditions === InvoiceCondition.AUTHORIZED) {
3985
+ return this.invoiceConditions.filter(cond => cond.value === InvoiceCondition.AUTHORIZED);
3986
+ }
3987
+ else {
3988
+ return this.invoiceConditions.filter(cond => cond.value !== InvoiceCondition.AUTHORIZED);
3989
+ }
3990
+ }
3991
+ onInvoiceConditionChange(event, document) {
3992
+ this.disabled = true;
3993
+ document.invoiceCondition = event.value;
3994
+ if (this.amendedDocuments.length > 0) {
3995
+ this.amendedDocuments.forEach((doc) => {
3996
+ if (doc.id === document.id) {
3997
+ doc.invoiceCondition = event.value;
3998
+ }
3999
+ else {
4000
+ this.amendedDocuments.push(document);
4001
+ }
4002
+ });
4003
+ }
4004
+ else {
4005
+ this.amendedDocuments.push(document);
4006
+ }
4007
+ }
4008
+ save() {
4009
+ this.amendedDocuments.forEach((document) => {
4010
+ this.documentService.update(document.id, document).subscribe(() => {
4011
+ this.utils.message("success", "yms.int.wms_saved_document_message_title", "saved_message_content");
4012
+ this.disabled = false;
4013
+ });
4014
+ });
4015
+ this.amendedDocuments = [];
4016
+ }
3891
4017
  searchDocument(event) {
3892
4018
  const size = event.rows;
3893
4019
  const page = event.first / size;
@@ -3918,10 +4044,12 @@ __decorate([
3918
4044
  ], DocumentListComponent.prototype, "wmsSystem", void 0);
3919
4045
  DocumentListComponent = __decorate([
3920
4046
  Component({
3921
- template: "<div class=\"ui-g\">\n <div class=\"ui-g-12\">\n <p-table\n selectionMode=\"single\"\n [(selection)]=\"selected\"\n [value]=\"documents\"\n [columns]=\"getColumns\"\n dataKey=\"id\"\n rows=\"10\"\n [paginator]=\"true\"\n [totalRecords]=\"gridTotalRecords\"\n [lazy]=\"true\"\n [resizableColumns]=\"true\"\n (onLazyLoad)=\"updateGridData($event)\"\n *sLoadingState=\"gridLoading\"\n sortMode=\"multiple\"\n styleClass=\"sds-table-scrollable\"\n [rowsPerPageOptions]=\"[10, 20, 50, 100, 200]\"\n paginatorDropdownScrollHeight=\"250px\"\n [scrollable]=\"true\"\n >\n <ng-template pTemplate=\"colgroup\" let-columns>\n <colgroup>\n <col *ngFor=\"let col of columns\" class=\"table-col-width\">\n </colgroup>\n </ng-template>\n\n <ng-template pTemplate=\"header\" let-columns>\n <tr>\n <th *ngFor=\"let col of columns\" pResizableColumn [pSortableColumn]=\"col.field\" scope=\"col\">\n <div class=\"senior-header\">\n <span class=\"senior-header-title\">{{ col.label | translate }}</span>\n <p-sortIcon [field]=\"col.field\"></p-sortIcon>\n </div>\n </th>\n </tr>\n </ng-template>\n\n <ng-template pTemplate=\"body\" let-rowData let-columns=\"columns\">\n <tr *ngIf=\"isWmsWIS()\">\n <td>{{ rowData?.invoiceNumber || 'N/A' }}</td>\n <td>{{ rowData?.invoiceSerialNumber || 'N/A' }}</td>\n <td>{{ rowData?.partnerName || 'N/A' }}</td>\n <td>{{ rowData?.partnerDocument || 'N/A' }}</td>\n <td>{{ rowData?.code || 'N/A' }}</td>\n <td>\n {{ getInvoiceConditionTranslation(rowData?.invoiceCondition) | translate }}\n </td>\n <td>{{ rowData?.notes || 'N/A' }}</td>\n </tr>\n <tr *ngIf=\"isWmsSeniorConnect()\">\n <td>{{rowData?.key}}</td>\n <td>{{rowData?.partnerName}}</td>\n <td>{{rowData?.partnerDocument}}</td>\n </tr>\n <tr *ngIf=\"!isWmsWIS() && !isWmsSeniorConnect()\">\n <td>{{rowData?.invoiceKey}}</td>\n <td>{{rowData?.invoiceNumber}}</td>\n <td>{{rowData?.invoiceSerialNumber}}</td>\n </tr>\n </ng-template>\n\n <ng-template pTemplate=\"paginatorright\">\n <span>\n {{ gridTotalRecords + \" \" + \n ('yms.int.wms_register_document_total_elements' | translate:{value: gridTotalRecords}) }}\n </span>\n </ng-template>\n </p-table>\n </div>\n</div>",
3922
- styles: [".table-col-width{width:250px}"]
4047
+ template: "<div class=\"ui-g\">\n <div class=\"ui-g-12\">\n <p-table\n selectionMode=\"single\"\n [(selection)]=\"selected\"\n [value]=\"documents\"\n [columns]=\"getColumns\"\n dataKey=\"id\"\n rows=\"10\"\n [paginator]=\"true\"\n [totalRecords]=\"gridTotalRecords\"\n [lazy]=\"true\"\n [resizableColumns]=\"true\"\n (onLazyLoad)=\"updateGridData($event)\"\n *sLoadingState=\"gridLoading\"\n sortMode=\"multiple\"\n styleClass=\"sds-table-scrollable\"\n [rowsPerPageOptions]=\"[10, 20, 50, 100, 200]\"\n paginatorDropdownScrollHeight=\"250px\"\n [scrollable]=\"true\"\n >\n <ng-template pTemplate=\"colgroup\" let-columns>\n <colgroup>\n <col *ngFor=\"let col of columns\" class=\"table-col-width\">\n </colgroup>\n </ng-template>\n\n <ng-template pTemplate=\"header\" let-columns>\n <tr>\n <th *ngFor=\"let col of columns\" pResizableColumn [pSortableColumn]=\"col.field\" scope=\"col\">\n <div class=\"senior-header\">\n <span class=\"senior-header-title\">{{ col.label | translate }}</span>\n <p-sortIcon [field]=\"col.field\"></p-sortIcon>\n </div>\n </th>\n </tr>\n </ng-template>\n\n <ng-template pTemplate=\"body\" let-rowData let-columns=\"columns\">\n <tr *ngIf=\"isWmsWIS()\">\n <td>{{ rowData?.invoiceNumber || 'N/A' }}</td>\n <td>{{ rowData?.invoiceSerialNumber || 'N/A' }}</td>\n <td>{{ rowData?.invoiceKey || 'N/A' }}</td>\n <td>{{ rowData?.partnerName || 'N/A' }}</td>\n <td>{{ rowData?.partnerDocument || 'N/A' }}</td>\n <td>{{ rowData?.code || 'N/A' }}</td>\n <td>\n <p-dropdown\n inputId=\"invoiceCondition\"\n name=\"invoiceCondition\"\n [autoWidth]=\"false\"\n [options]=\"getFilteredInvoiceConditions(rowData?.invoiceCondition)\"\n appendTo=\"body\"\n [(ngModel)]=\"rowData.invoiceCondition\"\n [disabled]=\"isAuthorized(rowData.invoiceCondition)\"\n (onChange)=\"onInvoiceConditionChange($event, rowData)\">\n </p-dropdown>\n </td>\n <td>{{ rowData?.notes || 'N/A' }}</td>\n </tr>\n <tr *ngIf=\"isWmsSeniorConnect()\">\n <td>{{rowData?.key}}</td>\n <td>{{rowData?.partnerName}}</td>\n <td>{{rowData?.partnerDocument}}</td>\n </tr>\n <tr *ngIf=\"!isWmsWIS() && !isWmsSeniorConnect()\">\n <td>{{rowData?.invoiceKey}}</td>\n <td>{{rowData?.invoiceNumber}}</td>\n <td>{{rowData?.invoiceSerialNumber}}</td>\n </tr>\n </ng-template>\n\n <ng-template pTemplate=\"paginatorright\">\n <span>\n {{ gridTotalRecords + \" \" + \n ('yms.int.wms_register_document_total_elements' | translate:{value: gridTotalRecords}) }}\n </span>\n </ng-template>\n </p-table>\n <div class=\"button-save\">\n <s-button priority=\"primary\" [label]=\"'save' | translate\"\n [disabled]=\"!disabled || !this.documents\"\n (click)=\"save()\">\n </s-button>\n </div>\n </div>\n</div>",
4048
+ styles: [".table-col-width{width:250px}.button-save{margin:5px 0}"]
3923
4049
  }),
3924
- __metadata("design:paramtypes", [DocumentService])
4050
+ __metadata("design:paramtypes", [DocumentService,
4051
+ TranslateService,
4052
+ UtilsMessageService])
3925
4053
  ], DocumentListComponent);
3926
4054
 
3927
4055
  let DocumentListModule = class DocumentListModule {
@@ -3936,7 +4064,10 @@ DocumentListModule = __decorate([
3936
4064
  CommonModule,
3937
4065
  TranslateModule,
3938
4066
  LoadingStateModule,
3939
- TableModule
4067
+ TableModule,
4068
+ DropdownModule,
4069
+ ButtonModule,
4070
+ FormsModule
3940
4071
  ],
3941
4072
  declarations: [DocumentListComponent],
3942
4073
  entryComponents: [DocumentListComponent],
@@ -13568,5 +13699,5 @@ DockModule = __decorate([
13568
13699
  })
13569
13700
  ], DockModule);
13570
13701
 
13571
- export { AgendaModule, AgendaService$1 as AgendaService, BalancaModule, BalancasService, CamerasModule, CamerasService, CancelasModule, CidadeModule, CidadeService, ContratoCompraItemModule, ContratoCompraItemService, ContratoCompraModule, ContratoCompraService, ControladorCancelaComponent, ControladorCancelaDescritor, ControladorCancelasService, CoreModule, DockModule, DockService, DocumentListComponent, DocumentListModule, ERP_ENVIRONMENT, ERP_SENIOR_HEADER, EmpresaModule, EmpresaService, ErpFormConfigService, ErpProcessData, ErpProcessService, ErpSeniorModule, EstadoModule, EstadoService, ExpedicaoChegadaVeiculoOverride, ExpedicaoModule, ExpedicaoService, FamiliaProdutoModule, FamiliaProdutoService, FieldCustomizationService, FilialModule, FilialService, FormComponent, FormDescritor, FormSamComponent, FormSamDescritor, FormWmsComponent, FormWmsDescritor, HasChangeService, INFORMACAOES_ADICIONAIS_HEADER, InfoComponent, InfoDescritor, IntegrationWebSocket, LogsModule, LogsService, LprModule, LprService, PaisModule, PaisService, PedidoVendaItemModule, PedidoVendaItemService, PedidoVendaModule, PedidoVendaService, PessoaEnderecoModule, PessoaEnderecoService, PessoaFisicaModule, PessoaFisicaService, PessoaJuridicaModule, PessoaJuridicaService, PessoaModule, PessoaService, PortariasComponent, PortariasDescritor, PortariasModule, ProdutoModule, ProdutoService, RecebimentoChegadaVeiculoOverride, RecebimentoContratoModule, RecebimentoContratoService, RoyaltyModule, RoyaltyService, SAM_SENIOR_HEADER, SafraModule, SafraService, SamSeniorModule, SnapshotComponent, SnapshotDescritor, TransportadoraModule, TransportadoraService, UnidadeMedidaModule, UnidadeMedidaService, VisitorListComponent, VisitorListModule, VisitorListService, VisualizarBalancaComponent, VisualizarBalancaDescritor, WmsModule, highlightLanguages, Service as ɵa, CustomStompConfig as ɵb, EntityService$2 as ɵba, EntityService$1 as ɵbb, UtilsMessageService as ɵbc, RegisterDocumentModule as ɵbd, RegisterDocumentComponent as ɵbe, InsertKeyModule as ɵbf, InsertKeyComponent as ɵbg, IntegrationService$1 as ɵbh, RecebimentoFormComponent as ɵbi, DerivacaoService as ɵbj, NotaValidatorService as ɵbk, TransgeniaService as ɵbl, VerificaNotafiscal as ɵbm, BuildFormField as ɵbn, ExpedicaoFormComponent as ɵbo, ExpedicaoInfoComponent as ɵbp, RecebimentoInfoComponent as ɵbq, DevolucaoFormComponent as ɵbr, DevolucaoService as ɵbs, DevolucaoChegadaVeiculoOverride as ɵbt, RecebimentoOrdemCompraFormComponent as ɵbu, OrdemCompraService as ɵbv, RecebimentoOrdemCompraService as ɵbw, RecebimentoOrdemCompraChegadaVeiculoOverride as ɵbx, RecebimentoOrdemCompraInfoComponent as ɵby, DevolucaoInfoComponent as ɵbz, ViewImageComponent as ɵc, ContratoFormComponent as ɵca, OrdemCompraFormComponent as ɵcb, ProcessoAvulsoFormComponent as ɵcc, ProcessoAvulsoService as ɵcd, ProcessoAvulsoChegadaVeiculoOverride as ɵce, ProcessoAvulsoInfoComponent as ɵcf, LogIntegracaoDescritor as ɵcg, LogIntegracaoComponent as ɵch, LogIntegracaoService as ɵci, DerivacaoModule as ɵcj, DevolucaoModule as ɵck, OrdemCompraModule as ɵcl, RecebimentoOrdemCompraModule as ɵcm, TransgeniaModule as ɵcn, ProcessoAvulsoModule as ɵco, LogIntegracaoModule as ɵcp, NotaFormModule as ɵcq, DirectivesModule as ɵcr, TrimDirective as ɵcs, NotaFormComponent as ɵct, LogDescritor as ɵd, LogsComponent as ɵe, PortariasService as ɵf, EntradaComponent as ɵg, AgendasComponent as ɵh, ConfirmacaoComponent as ɵi, VisitedInfoDescritor as ɵj, VisitedInfoComponent as ɵk, VisitedInfoService as ɵl, SchedulingComponent as ɵm, LobbyService as ɵn, EntityService as ɵo, SchedulingService as ɵp, VisitanteComponent as ɵq, VisitanteFormComponent as ɵr, CredencialFormComponent as ɵs, FocusService as ɵt, FormWmsService as ɵu, DocumentGridModule as ɵv, DocumentGridComponent as ɵw, DocumentService as ɵx, IntegrationService as ɵy, AgendaService as ɵz };
13702
+ export { AgendaModule, AgendaService$1 as AgendaService, BalancaModule, BalancasService, CamerasModule, CamerasService, CancelasModule, CidadeModule, CidadeService, ContratoCompraItemModule, ContratoCompraItemService, ContratoCompraModule, ContratoCompraService, ControladorCancelaComponent, ControladorCancelaDescritor, ControladorCancelasService, CoreModule, DockModule, DockService, DocumentListComponent, DocumentListModule, ERP_ENVIRONMENT, ERP_SENIOR_HEADER, EmpresaModule, EmpresaService, ErpFormConfigService, ErpProcessData, ErpProcessService, ErpSeniorModule, EstadoModule, EstadoService, ExpedicaoChegadaVeiculoOverride, ExpedicaoModule, ExpedicaoService, FamiliaProdutoModule, FamiliaProdutoService, FieldCustomizationService, FilialModule, FilialService, FormComponent, FormDescritor, FormSamComponent, FormSamDescritor, FormWmsComponent, FormWmsDescritor, HasChangeService, INFORMACAOES_ADICIONAIS_HEADER, InfoComponent, InfoDescritor, IntegrationWebSocket, LogsModule, LogsService, LprModule, LprService, PaisModule, PaisService, PedidoVendaItemModule, PedidoVendaItemService, PedidoVendaModule, PedidoVendaService, PessoaEnderecoModule, PessoaEnderecoService, PessoaFisicaModule, PessoaFisicaService, PessoaJuridicaModule, PessoaJuridicaService, PessoaModule, PessoaService, PortariasComponent, PortariasDescritor, PortariasModule, ProdutoModule, ProdutoService, RecebimentoChegadaVeiculoOverride, RecebimentoContratoModule, RecebimentoContratoService, RoyaltyModule, RoyaltyService, SAM_SENIOR_HEADER, SafraModule, SafraService, SamSeniorModule, SnapshotComponent, SnapshotDescritor, TransportadoraModule, TransportadoraService, UnidadeMedidaModule, UnidadeMedidaService, VisitorListComponent, VisitorListModule, VisitorListService, VisualizarBalancaComponent, VisualizarBalancaDescritor, WmsModule, highlightLanguages, Service as ɵa, CustomStompConfig as ɵb, EntityService$2 as ɵba, EntityService$1 as ɵbb, UtilsMessageService as ɵbc, ExternalTenantService as ɵbd, RegisterDocumentModule as ɵbe, RegisterDocumentComponent as ɵbf, InsertKeyModule as ɵbg, InsertKeyComponent as ɵbh, IntegrationService$1 as ɵbi, RecebimentoFormComponent as ɵbj, DerivacaoService as ɵbk, NotaValidatorService as ɵbl, TransgeniaService as ɵbm, VerificaNotafiscal as ɵbn, BuildFormField as ɵbo, ExpedicaoFormComponent as ɵbp, ExpedicaoInfoComponent as ɵbq, RecebimentoInfoComponent as ɵbr, DevolucaoFormComponent as ɵbs, DevolucaoService as ɵbt, DevolucaoChegadaVeiculoOverride as ɵbu, RecebimentoOrdemCompraFormComponent as ɵbv, OrdemCompraService as ɵbw, RecebimentoOrdemCompraService as ɵbx, RecebimentoOrdemCompraChegadaVeiculoOverride as ɵby, RecebimentoOrdemCompraInfoComponent as ɵbz, ViewImageComponent as ɵc, DevolucaoInfoComponent as ɵca, ContratoFormComponent as ɵcb, OrdemCompraFormComponent as ɵcc, ProcessoAvulsoFormComponent as ɵcd, ProcessoAvulsoService as ɵce, ProcessoAvulsoChegadaVeiculoOverride as ɵcf, ProcessoAvulsoInfoComponent as ɵcg, LogIntegracaoDescritor as ɵch, LogIntegracaoComponent as ɵci, LogIntegracaoService as ɵcj, DerivacaoModule as ɵck, DevolucaoModule as ɵcl, OrdemCompraModule as ɵcm, RecebimentoOrdemCompraModule as ɵcn, TransgeniaModule as ɵco, ProcessoAvulsoModule as ɵcp, LogIntegracaoModule as ɵcq, NotaFormModule as ɵcr, DirectivesModule as ɵcs, TrimDirective as ɵct, NotaFormComponent as ɵcu, LogDescritor as ɵd, LogsComponent as ɵe, PortariasService as ɵf, EntradaComponent as ɵg, AgendasComponent as ɵh, ConfirmacaoComponent as ɵi, VisitedInfoDescritor as ɵj, VisitedInfoComponent as ɵk, VisitedInfoService as ɵl, SchedulingComponent as ɵm, LobbyService as ɵn, EntityService as ɵo, SchedulingService as ɵp, VisitanteComponent as ɵq, VisitanteFormComponent as ɵr, CredencialFormComponent as ɵs, FocusService as ɵt, FormWmsService as ɵu, DocumentGridModule as ɵv, DocumentGridComponent as ɵw, DocumentService as ɵx, IntegrationService as ɵy, AgendaService as ɵz };
13572
13703
  //# sourceMappingURL=seniorsistemas-yms-integration.js.map