@seniorsistemas/yms-integration 1.34.0 → 1.35.0

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 (36) hide show
  1. package/bundles/seniorsistemas-yms-integration.umd.js +148 -59
  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 +19 -6
  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 -2
  11. package/esm2015/src/wms/components/document-list/document-list.component.js +7 -6
  12. package/esm2015/src/wms/entities/external-tenant/external-tenant-dto.js +1 -0
  13. package/esm2015/src/wms/entities/external-tenant/external-tenant.service.js +18 -0
  14. package/esm2015/src/wms/entities/invoice-condition/invoice-condition.js +2 -1
  15. package/esm5/seniorsistemas-yms-integration.js +44 -43
  16. package/esm5/src/wms/components/document-grid/document-grid.component.js +19 -6
  17. package/esm5/src/wms/components/document-grid/document-grid.module.js +3 -1
  18. package/esm5/src/wms/components/document-grid/insert-key/insert-key.component.js +66 -7
  19. package/esm5/src/wms/components/document-grid/insert-key/insert-key.module.js +4 -2
  20. package/esm5/src/wms/components/document-grid/register-document/register-document.component.js +3 -2
  21. package/esm5/src/wms/components/document-list/document-list.component.js +7 -6
  22. package/esm5/src/wms/entities/external-tenant/external-tenant-dto.js +1 -0
  23. package/esm5/src/wms/entities/external-tenant/external-tenant.service.js +21 -0
  24. package/esm5/src/wms/entities/invoice-condition/invoice-condition.js +2 -1
  25. package/fesm2015/seniorsistemas-yms-integration.js +100 -17
  26. package/fesm2015/seniorsistemas-yms-integration.js.map +1 -1
  27. package/fesm5/seniorsistemas-yms-integration.js +105 -17
  28. package/fesm5/seniorsistemas-yms-integration.js.map +1 -1
  29. package/package.json +1 -1
  30. package/seniorsistemas-yms-integration.d.ts +43 -42
  31. package/seniorsistemas-yms-integration.metadata.json +1 -1
  32. package/src/wms/components/document-grid/document-grid.component.d.ts +6 -1
  33. package/src/wms/components/document-grid/insert-key/insert-key.component.d.ts +13 -1
  34. package/src/wms/entities/external-tenant/external-tenant-dto.d.ts +7 -0
  35. package/src/wms/entities/external-tenant/external-tenant.service.d.ts +9 -0
  36. package/src/wms/entities/invoice-condition/invoice-condition.d.ts +2 -1
@@ -3353,6 +3353,7 @@
3353
3353
  InvoiceCondition["PARTIAL_AUTHORIZED"] = "PARTIAL_AUTHORIZED";
3354
3354
  InvoiceCondition["MANUAL_AUTHORIZED"] = "MANUAL_AUTHORIZED";
3355
3355
  InvoiceCondition["DEVOLUTION"] = "DEVOLUTION";
3356
+ InvoiceCondition["REJECTED"] = "REJECTED";
3356
3357
  })(InvoiceCondition || (InvoiceCondition = {}));
3357
3358
 
3358
3359
  var DocumentGridComponent = /** @class */ (function () {
@@ -3368,15 +3369,24 @@
3368
3369
  this.enableButtonIsClienteExterno = true;
3369
3370
  this.summary = "yms.int.wms_saved_document_message_title";
3370
3371
  this.ngUnsubscribe = new rxjs.Subject();
3371
- this.invoiceCondition = [
3372
+ this.invoiceConditions = [
3372
3373
  { label: this.translate.instant("yms.int.wms_grid_document_invoice_no_way"), value: null },
3373
3374
  { label: this.translate.instant("yms.int.wms_grid_document_invoice_condition_authorized"), value: InvoiceCondition.AUTHORIZED },
3374
3375
  { label: this.translate.instant("yms.int.wms_grid_document_invoice_condition_manual_authorized"), value: InvoiceCondition.MANUAL_AUTHORIZED },
3375
3376
  { label: this.translate.instant("yms.int.wms_grid_document_invoice_condition_partial_authorized"), value: InvoiceCondition.PARTIAL_AUTHORIZED },
3376
- { label: this.translate.instant("yms.int.wms_grid_document_invoice_condition_devolucion"), value: InvoiceCondition.DEVOLUTION },
3377
+ { label: this.translate.instant("yms.int.wms_grid_document_invoice_condition_devolution"), value: InvoiceCondition.DEVOLUTION },
3378
+ { label: this.translate.instant("yms.int.wms_grid_document_invoice_condition_rejected"), value: InvoiceCondition.REJECTED },
3377
3379
  ];
3378
3380
  this.selection = [];
3379
3381
  }
3382
+ DocumentGridComponent.prototype.getFilteredInvoiceConditions = function (invoiceConditions) {
3383
+ if (invoiceConditions === InvoiceCondition.AUTHORIZED) {
3384
+ return this.invoiceConditions.filter(function (cond) { return cond.value === InvoiceCondition.AUTHORIZED; });
3385
+ }
3386
+ else {
3387
+ return this.invoiceConditions.filter(function (cond) { return cond.value !== InvoiceCondition.AUTHORIZED; });
3388
+ }
3389
+ };
3380
3390
  DocumentGridComponent.prototype.ngOnInit = function () {
3381
3391
  this.verifyClienteExterno();
3382
3392
  this.getProcessTypeByScheduling();
@@ -3492,7 +3502,6 @@
3492
3502
  _this.sucessMessage();
3493
3503
  });
3494
3504
  _this.disabled = true;
3495
- _this.listDocuments(false);
3496
3505
  }
3497
3506
  else {
3498
3507
  _this.documentService.update(data.id, data).subscribe(function () {
@@ -3501,6 +3510,7 @@
3501
3510
  });
3502
3511
  }
3503
3512
  });
3513
+ this.listDocuments(false);
3504
3514
  }
3505
3515
  };
3506
3516
  DocumentGridComponent.prototype.updateKeyByWms = function (data) {
@@ -3541,10 +3551,14 @@
3541
3551
  }
3542
3552
  });
3543
3553
  };
3554
+ DocumentGridComponent.prototype.notSavedDocuments = function () {
3555
+ return this.gridData.some(function (document) { return !document.id; });
3556
+ };
3544
3557
  DocumentGridComponent.prototype.listDocuments = function (isDelete) {
3545
3558
  var _this = this;
3546
3559
  this.documentService.list({
3547
- filterQuery: "schedulingId eq '" + this.agenda.id + "'"
3560
+ filterQuery: "schedulingId eq '" + this.agenda.id + "'",
3561
+ size: 100
3548
3562
  })
3549
3563
  .subscribe(function (contents) {
3550
3564
  var _a;
@@ -3683,7 +3697,7 @@
3683
3697
  DocumentGridComponent = __decorate([
3684
3698
  core.Component({
3685
3699
  selector: 'document-grid',
3686
- 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>",
3700
+ 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>",
3687
3701
  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}"]
3688
3702
  }),
3689
3703
  __metadata("design:paramtypes", [core$1.TranslateService,
@@ -3751,7 +3765,8 @@
3751
3765
  { label: this.translate.instant("yms.int.wms_grid_document_invoice_condition_authorized"), value: InvoiceCondition.AUTHORIZED },
3752
3766
  { label: this.translate.instant("yms.int.wms_grid_document_invoice_condition_manual_authorized"), value: InvoiceCondition.MANUAL_AUTHORIZED },
3753
3767
  { label: this.translate.instant("yms.int.wms_grid_document_invoice_condition_partial_authorized"), value: InvoiceCondition.PARTIAL_AUTHORIZED },
3754
- { label: this.translate.instant("yms.int.wms_grid_document_invoice_condition_devolucion"), value: InvoiceCondition.DEVOLUTION },
3768
+ { label: this.translate.instant("yms.int.wms_grid_document_invoice_condition_devolution"), value: InvoiceCondition.DEVOLUTION },
3769
+ { label: this.translate.instant("yms.int.wms_grid_document_invoice_condition_rejected"), value: InvoiceCondition.REJECTED },
3755
3770
  ];
3756
3771
  }
3757
3772
  RegisterDocumentComponent.prototype.ngOnInit = function () {
@@ -3895,15 +3910,35 @@
3895
3910
  return RegisterDocumentModule;
3896
3911
  }());
3897
3912
 
3913
+ var ExternalTenantService = /** @class */ (function (_super) {
3914
+ __extends(ExternalTenantService, _super);
3915
+ function ExternalTenantService(http, messageService) {
3916
+ var _this = _super.call(this, http, messageService, 'yms/agenda/entities/externalTenant', '') || this;
3917
+ _this.http = http;
3918
+ _this.messageService = messageService;
3919
+ return _this;
3920
+ }
3921
+ ExternalTenantService = __decorate([
3922
+ core.Injectable(),
3923
+ __metadata("design:paramtypes", [http.HttpClient, api.MessageService])
3924
+ ], ExternalTenantService);
3925
+ return ExternalTenantService;
3926
+ }(EntityService));
3927
+
3898
3928
  var InsertKeyComponent = /** @class */ (function () {
3899
- function InsertKeyComponent(formBuilder, documentService, utils) {
3929
+ function InsertKeyComponent(formBuilder, documentService, utils, confirmationService, translate, externalTenantService) {
3900
3930
  this.formBuilder = formBuilder;
3901
3931
  this.documentService = documentService;
3902
3932
  this.utils = utils;
3933
+ this.confirmationService = confirmationService;
3934
+ this.translate = translate;
3935
+ this.externalTenantService = externalTenantService;
3903
3936
  this.document = new core.EventEmitter();
3904
3937
  this.visible = new core.EventEmitter();
3905
3938
  this.visibleChange = new core.EventEmitter();
3906
3939
  this.isLoading = false;
3940
+ this.isPartnerloading = false;
3941
+ this.ngUnsubscribe = new rxjs.Subject();
3907
3942
  }
3908
3943
  InsertKeyComponent.prototype.ngOnInit = function () {
3909
3944
  var _this = this;
@@ -3949,6 +3984,7 @@
3949
3984
  else {
3950
3985
  _this.utils.translateMessage("error", "yms.int.wms_error_search_document_message_header", "yms.int.wms_error_unknown_search_document_message_content" + err.error.message);
3951
3986
  }
3987
+ _this.confirmInvoiceDialog();
3952
3988
  return rxjs.throwError(err);
3953
3989
  }), operators.finalize(function () {
3954
3990
  _this.isLoading = false;
@@ -3958,10 +3994,56 @@
3958
3994
  _this.utils.message("warn", "yms.int.wms_insert_key_warning_message_header", "yms.int.wms_insert_key_warning_message_description");
3959
3995
  return;
3960
3996
  }
3961
- _this.document.emit(content.contents[0]);
3997
+ var document = content.contents[0];
3998
+ document.invoiceKey = _this.formGroup.get('key').value;
3999
+ document.invoiceCondition = InvoiceCondition.AUTHORIZED;
4000
+ _this.document.emit(document);
3962
4001
  _this.formGroup.reset();
3963
4002
  });
3964
4003
  };
4004
+ InsertKeyComponent.prototype.confirmInvoiceDialog = function () {
4005
+ var _this = this;
4006
+ this.confirmationService.confirm({
4007
+ message: this.translate.instant("yms.int.wms_message_confirm_invoice_dialog"),
4008
+ acceptLabel: this.translate.instant("yms.int.wms_accept_confirm_invoice_dialog"),
4009
+ rejectLabel: this.translate.instant("yms.int.wms_reject_confirm_invoice_dialog"),
4010
+ header: this.translate.instant("yms.int.wms_header_content_confirm_invoice_dialog"),
4011
+ accept: function () { return _this.buildInvoice(); }
4012
+ });
4013
+ };
4014
+ InsertKeyComponent.prototype.buildInvoice = function () {
4015
+ var _this = this;
4016
+ this.isPartnerloading = true;
4017
+ var partnerDocument = this.formGroup.get('partnerDocument').value;
4018
+ this.externalTenantService.list({
4019
+ filterQuery: "cnpj eq '" + partnerDocument + "'"
4020
+ })
4021
+ .pipe(operators.takeUntil(this.ngUnsubscribe), operators.finalize(function () {
4022
+ _this.isPartnerloading = false;
4023
+ }))
4024
+ .subscribe(function (contents) {
4025
+ var documentInvoice = _this.createDocumentInvoice(contents);
4026
+ _this.document.emit(documentInvoice);
4027
+ _this.formGroup.reset();
4028
+ });
4029
+ };
4030
+ InsertKeyComponent.prototype.createDocumentInvoice = function (partners) {
4031
+ var documentInvoice = {
4032
+ invoiceKey: this.formGroup.get('key').value,
4033
+ invoiceNumber: this.formGroup.get('invoiceNumber').value,
4034
+ invoiceSerialNumber: this.formGroup.get('invoiceSerie').value,
4035
+ partnerDocument: this.formGroup.get('partnerDocument').value,
4036
+ partnerName: null,
4037
+ type: null,
4038
+ key: null,
4039
+ schedulingId: null
4040
+ };
4041
+ if (partners.totalElements > 0) {
4042
+ var partner = partners.contents[0];
4043
+ documentInvoice.partnerName = partner.descricao;
4044
+ }
4045
+ return documentInvoice;
4046
+ };
3965
4047
  InsertKeyComponent.prototype.validateKeyDetails = function (nf) {
3966
4048
  if (!nf) {
3967
4049
  this.keyErrorMessage = null;
@@ -4019,12 +4101,15 @@
4019
4101
  InsertKeyComponent = __decorate([
4020
4102
  core.Component({
4021
4103
  selector: "insert-key",
4022
- 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",
4104
+ 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",
4023
4105
  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}"]
4024
4106
  }),
4025
4107
  __metadata("design:paramtypes", [forms.FormBuilder,
4026
4108
  DocumentService,
4027
- UtilsMessageService])
4109
+ UtilsMessageService,
4110
+ api.ConfirmationService,
4111
+ core$1.TranslateService,
4112
+ ExternalTenantService])
4028
4113
  ], InsertKeyComponent);
4029
4114
  return InsertKeyComponent;
4030
4115
  }());
@@ -4044,7 +4129,8 @@
4044
4129
  angularComponents.LoadingStateModule
4045
4130
  ],
4046
4131
  exports: [InsertKeyComponent],
4047
- declarations: [InsertKeyComponent]
4132
+ declarations: [InsertKeyComponent],
4133
+ providers: [ExternalTenantService]
4048
4134
  })
4049
4135
  ], InsertKeyModule);
4050
4136
  return InsertKeyModule;
@@ -4058,6 +4144,7 @@
4058
4144
  declarations: [DocumentGridComponent],
4059
4145
  entryComponents: [DocumentGridComponent],
4060
4146
  exports: [DocumentGridComponent],
4147
+ providers: [ExternalTenantService],
4061
4148
  imports: [
4062
4149
  common.CommonModule,
4063
4150
  core$1.TranslateModule,
@@ -4157,8 +4244,9 @@
4157
4244
  DocumentListComponent.prototype.getColumnLabels = function () {
4158
4245
  if (this.isWmsWIS()) {
4159
4246
  return __spread(this.getLabelsInvoice(), [
4160
- { field: "partnerName", label: 'yms.int.wms_register_document_invoice_partnerName' },
4161
- { field: "partnerDocument", label: 'yms.int.wms_register_document_invoice_partnerDocument' },
4247
+ { field: "invoiceKey", label: 'yms.int.wms_register_document_invoice_invoice_key' },
4248
+ { field: "partnerName", label: 'yms.int.wms_register_document_invoice_partner_name' },
4249
+ { field: "partnerDocument", label: 'yms.int.wms_register_document_invoice_partner_document' },
4162
4250
  { field: "code", label: 'yms.int.wms_register_document_invoice_code' },
4163
4251
  { field: "invoiceCondition", label: 'yms.int.wms_register_document_invoice_condition' },
4164
4252
  { field: "notes", label: 'yms.int.wms_register_document_invoice_notes' },
@@ -4167,8 +4255,8 @@
4167
4255
  if (this.isWmsSeniorConnect()) {
4168
4256
  return [
4169
4257
  { field: "key", label: 'yms.int.wms_purchaseOrder' },
4170
- { field: "partnerName", label: 'yms.int.wms_register_document_invoice_partnerName' },
4171
- { field: "partnerDocument", label: 'yms.int.wms_register_document_invoice_partnerDocument' },
4258
+ { field: "partnerName", label: 'yms.int.wms_register_document_invoice_partner_name' },
4259
+ { field: "partnerDocument", label: 'yms.int.wms_register_document_invoice_partner_document' },
4172
4260
  ];
4173
4261
  }
4174
4262
  return __spread([
@@ -4227,7 +4315,7 @@
4227
4315
  ], DocumentListComponent.prototype, "wmsSystem", void 0);
4228
4316
  DocumentListComponent = __decorate([
4229
4317
  core.Component({
4230
- 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>",
4318
+ 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 {{ 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>",
4231
4319
  styles: [".table-col-width{width:250px}"]
4232
4320
  }),
4233
4321
  __metadata("design:paramtypes", [DocumentService])
@@ -14463,50 +14551,51 @@
14463
14551
  exports.ɵba = EntityService$2;
14464
14552
  exports.ɵbb = EntityService$1;
14465
14553
  exports.ɵbc = UtilsMessageService;
14466
- exports.ɵbd = RegisterDocumentModule;
14467
- exports.ɵbe = RegisterDocumentComponent;
14468
- exports.ɵbf = InsertKeyModule;
14469
- exports.ɵbg = InsertKeyComponent;
14470
- exports.ɵbh = IntegrationService$1;
14471
- exports.ɵbi = RecebimentoFormComponent;
14472
- exports.ɵbj = DerivacaoService;
14473
- exports.ɵbk = NotaValidatorService;
14474
- exports.ɵbl = TransgeniaService;
14475
- exports.ɵbm = VerificaNotafiscal;
14476
- exports.ɵbn = BuildFormField;
14477
- exports.ɵbo = ExpedicaoFormComponent;
14478
- exports.ɵbp = ExpedicaoInfoComponent;
14479
- exports.ɵbq = RecebimentoInfoComponent;
14480
- exports.ɵbr = DevolucaoFormComponent;
14481
- exports.ɵbs = DevolucaoService;
14482
- exports.ɵbt = DevolucaoChegadaVeiculoOverride;
14483
- exports.ɵbu = RecebimentoOrdemCompraFormComponent;
14484
- exports.ɵbv = OrdemCompraService;
14485
- exports.ɵbw = RecebimentoOrdemCompraService;
14486
- exports.ɵbx = RecebimentoOrdemCompraChegadaVeiculoOverride;
14487
- exports.ɵby = RecebimentoOrdemCompraInfoComponent;
14488
- exports.ɵbz = DevolucaoInfoComponent;
14554
+ exports.ɵbd = ExternalTenantService;
14555
+ exports.ɵbe = RegisterDocumentModule;
14556
+ exports.ɵbf = RegisterDocumentComponent;
14557
+ exports.ɵbg = InsertKeyModule;
14558
+ exports.ɵbh = InsertKeyComponent;
14559
+ exports.ɵbi = IntegrationService$1;
14560
+ exports.ɵbj = RecebimentoFormComponent;
14561
+ exports.ɵbk = DerivacaoService;
14562
+ exports.ɵbl = NotaValidatorService;
14563
+ exports.ɵbm = TransgeniaService;
14564
+ exports.ɵbn = VerificaNotafiscal;
14565
+ exports.ɵbo = BuildFormField;
14566
+ exports.ɵbp = ExpedicaoFormComponent;
14567
+ exports.ɵbq = ExpedicaoInfoComponent;
14568
+ exports.ɵbr = RecebimentoInfoComponent;
14569
+ exports.ɵbs = DevolucaoFormComponent;
14570
+ exports.ɵbt = DevolucaoService;
14571
+ exports.ɵbu = DevolucaoChegadaVeiculoOverride;
14572
+ exports.ɵbv = RecebimentoOrdemCompraFormComponent;
14573
+ exports.ɵbw = OrdemCompraService;
14574
+ exports.ɵbx = RecebimentoOrdemCompraService;
14575
+ exports.ɵby = RecebimentoOrdemCompraChegadaVeiculoOverride;
14576
+ exports.ɵbz = RecebimentoOrdemCompraInfoComponent;
14489
14577
  exports.ɵc = ViewImageComponent;
14490
- exports.ɵca = ContratoFormComponent;
14491
- exports.ɵcb = OrdemCompraFormComponent;
14492
- exports.ɵcc = ProcessoAvulsoFormComponent;
14493
- exports.ɵcd = ProcessoAvulsoService;
14494
- exports.ɵce = ProcessoAvulsoChegadaVeiculoOverride;
14495
- exports.ɵcf = ProcessoAvulsoInfoComponent;
14496
- exports.ɵcg = LogIntegracaoDescritor;
14497
- exports.ɵch = LogIntegracaoComponent;
14498
- exports.ɵci = LogIntegracaoService;
14499
- exports.ɵcj = DerivacaoModule;
14500
- exports.ɵck = DevolucaoModule;
14501
- exports.ɵcl = OrdemCompraModule;
14502
- exports.ɵcm = RecebimentoOrdemCompraModule;
14503
- exports.ɵcn = TransgeniaModule;
14504
- exports.ɵco = ProcessoAvulsoModule;
14505
- exports.ɵcp = LogIntegracaoModule;
14506
- exports.ɵcq = NotaFormModule;
14507
- exports.ɵcr = DirectivesModule;
14508
- exports.ɵcs = TrimDirective;
14509
- exports.ɵct = NotaFormComponent;
14578
+ exports.ɵca = DevolucaoInfoComponent;
14579
+ exports.ɵcb = ContratoFormComponent;
14580
+ exports.ɵcc = OrdemCompraFormComponent;
14581
+ exports.ɵcd = ProcessoAvulsoFormComponent;
14582
+ exports.ɵce = ProcessoAvulsoService;
14583
+ exports.ɵcf = ProcessoAvulsoChegadaVeiculoOverride;
14584
+ exports.ɵcg = ProcessoAvulsoInfoComponent;
14585
+ exports.ɵch = LogIntegracaoDescritor;
14586
+ exports.ɵci = LogIntegracaoComponent;
14587
+ exports.ɵcj = LogIntegracaoService;
14588
+ exports.ɵck = DerivacaoModule;
14589
+ exports.ɵcl = DevolucaoModule;
14590
+ exports.ɵcm = OrdemCompraModule;
14591
+ exports.ɵcn = RecebimentoOrdemCompraModule;
14592
+ exports.ɵco = TransgeniaModule;
14593
+ exports.ɵcp = ProcessoAvulsoModule;
14594
+ exports.ɵcq = LogIntegracaoModule;
14595
+ exports.ɵcr = NotaFormModule;
14596
+ exports.ɵcs = DirectivesModule;
14597
+ exports.ɵct = TrimDirective;
14598
+ exports.ɵcu = NotaFormComponent;
14510
14599
  exports.ɵd = LogDescritor;
14511
14600
  exports.ɵe = LogsComponent;
14512
14601
  exports.ɵf = PortariasService;