@seniorsistemas/yms-integration 1.38.0 → 1.39.0-f91ecbab-02b2-4fa0-803c-5027c0257424

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 (22) hide show
  1. package/bundles/seniorsistemas-yms-integration.umd.js +92 -15
  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/src/wms/components/document-grid/document-grid.component.js +64 -7
  6. package/esm2015/src/wms/components/document-grid/insert-key/insert-key.component.js +21 -10
  7. package/esm2015/src/wms/components/document-grid/register-document/register-document.component.js +9 -3
  8. package/esm2015/src/wms/entities/document/document.service.js +4 -1
  9. package/esm5/src/wms/components/document-grid/document-grid.component.js +68 -7
  10. package/esm5/src/wms/components/document-grid/insert-key/insert-key.component.js +21 -10
  11. package/esm5/src/wms/components/document-grid/register-document/register-document.component.js +9 -3
  12. package/esm5/src/wms/entities/document/document.service.js +4 -1
  13. package/fesm2015/seniorsistemas-yms-integration.js +88 -15
  14. package/fesm2015/seniorsistemas-yms-integration.js.map +1 -1
  15. package/fesm5/seniorsistemas-yms-integration.js +92 -15
  16. package/fesm5/seniorsistemas-yms-integration.js.map +1 -1
  17. package/package.json +1 -1
  18. package/seniorsistemas-yms-integration.metadata.json +1 -1
  19. package/src/wms/components/document-grid/document-grid.component.d.ts +9 -1
  20. package/src/wms/components/document-grid/insert-key/insert-key.component.d.ts +7 -3
  21. package/src/wms/components/document-grid/register-document/register-document.component.d.ts +3 -1
  22. package/src/wms/entities/document/document.service.d.ts +1 -0
@@ -3257,6 +3257,9 @@ var DocumentService = /** @class */ (function (_super) {
3257
3257
  DocumentService.prototype.getSystemIntegration = function () {
3258
3258
  return this.http.get('yms_int/wms/queries/getSystemIntegration');
3259
3259
  };
3260
+ DocumentService.prototype.getYard = function (yardId) {
3261
+ return this.http.get('yms/patio/entities/planta/' + yardId);
3262
+ };
3260
3263
  DocumentService = __decorate([
3261
3264
  Injectable(),
3262
3265
  __metadata("design:paramtypes", [HttpClient, MessageService])
@@ -3309,13 +3312,14 @@ function getInvoiceConditions(translate) {
3309
3312
  }
3310
3313
 
3311
3314
  var DocumentGridComponent = /** @class */ (function () {
3312
- function DocumentGridComponent(translate, documentService, confirmationService, integrationService, agendaService, utils) {
3315
+ function DocumentGridComponent(translate, documentService, confirmationService, integrationService, agendaService, utils, wmsService) {
3313
3316
  this.translate = translate;
3314
3317
  this.documentService = documentService;
3315
3318
  this.confirmationService = confirmationService;
3316
3319
  this.integrationService = integrationService;
3317
3320
  this.agendaService = agendaService;
3318
3321
  this.utils = utils;
3322
+ this.wmsService = wmsService;
3319
3323
  this.viewDocument = new EventEmitter();
3320
3324
  this.gridData = [];
3321
3325
  this.enableButtonIsClienteExterno = true;
@@ -3333,9 +3337,43 @@ var DocumentGridComponent = /** @class */ (function () {
3333
3337
  }
3334
3338
  };
3335
3339
  DocumentGridComponent.prototype.ngOnInit = function () {
3340
+ var _this = this;
3336
3341
  this.verifyClienteExterno();
3337
3342
  this.getProcessTypeByScheduling();
3338
3343
  this.listDocuments(false);
3344
+ this.wmsService.getSystemIntegration()
3345
+ .subscribe(function (_a) {
3346
+ var system = _a.system;
3347
+ _this.wmsSystem = system;
3348
+ if (_this.isWmsSeniorConnect()) {
3349
+ _this.getYard();
3350
+ _this.getSchedule();
3351
+ }
3352
+ });
3353
+ };
3354
+ DocumentGridComponent.prototype.getYard = function () {
3355
+ var _this = this;
3356
+ this.documentService.getYard(this.agenda.planta.id)
3357
+ .pipe(catchError(function (err) {
3358
+ return throwError(err);
3359
+ }))
3360
+ .subscribe(function (content) {
3361
+ _this.yard = content;
3362
+ });
3363
+ };
3364
+ DocumentGridComponent.prototype.getSchedule = function () {
3365
+ var _this = this;
3366
+ if (this.agenda.externalTenant && this.agenda.externalTenant.cnpj) {
3367
+ this.schedule = this.agenda;
3368
+ return;
3369
+ }
3370
+ this.agendaService.get(this.agenda.id)
3371
+ .pipe(catchError(function (err) {
3372
+ return throwError(err);
3373
+ }))
3374
+ .subscribe(function (content) {
3375
+ _this.schedule = content;
3376
+ });
3339
3377
  };
3340
3378
  DocumentGridComponent.prototype.verifyClienteExterno = function () {
3341
3379
  var _this = this;
@@ -3475,7 +3513,7 @@ var DocumentGridComponent = /** @class */ (function () {
3475
3513
  accept: function () {
3476
3514
  _this.removeDocumentIfIdUndfined();
3477
3515
  if (_this.selection.length < 1) {
3478
- return empty();
3516
+ return null;
3479
3517
  }
3480
3518
  return forkJoin(_this.selection.map(function (document) { return _this.documentService.delete(document.id); }))
3481
3519
  .pipe(takeUntil(_this.ngUnsubscribe))
@@ -3597,6 +3635,30 @@ var DocumentGridComponent = /** @class */ (function () {
3597
3635
  DocumentGridComponent.prototype.sucessMessage = function () {
3598
3636
  return this.utils.message("success", this.summary, "saved_message_content");
3599
3637
  };
3638
+ DocumentGridComponent.prototype.validateDocument = function (document) {
3639
+ if (this.isWmsSeniorConnect()) {
3640
+ if (!this.yard.codigo) {
3641
+ this.buildMessage("yms.int.yard_code_not_found_warning_description");
3642
+ return false;
3643
+ }
3644
+ if (document.logistcUnitDocument !== this.yard.codigo) {
3645
+ this.buildMessage("yms.int.document_yard_mismatch_agenda_warning_description");
3646
+ return false;
3647
+ }
3648
+ if (!this.schedule.externalTenant) {
3649
+ this.buildMessage("yms.int.partner_not_informed_agenda_warning_description");
3650
+ return false;
3651
+ }
3652
+ if (document.partnerDocument !== this.schedule.externalTenant.cnpj) {
3653
+ this.buildMessage("yms.int.partner_differs_from_agenda_warning_description");
3654
+ return false;
3655
+ }
3656
+ }
3657
+ return true;
3658
+ };
3659
+ DocumentGridComponent.prototype.buildMessage = function (description) {
3660
+ this.utils.message("warn", "yms.int.documento_invalido_warning_header", description);
3661
+ };
3600
3662
  __decorate([
3601
3663
  Input(),
3602
3664
  __metadata("design:type", Object)
@@ -3644,7 +3706,7 @@ var DocumentGridComponent = /** @class */ (function () {
3644
3706
  DocumentGridComponent = __decorate([
3645
3707
  Component({
3646
3708
  selector: 'document-grid',
3647
- 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() || isWmsSeniorConnect()\" (click)=\"selection = [rowData]\">\n <span>{{rowData[\"logistcUnitName\"]}}</span>\n </td>\n <td *ngIf=\"isWmsWIS() || isWmsSilt() || isWmsSeniorConnect()\" (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 && isWmsWIS()\" (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>",
3709
+ 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() || isWmsSeniorConnect()\" (click)=\"selection = [rowData]\">\n <span>{{rowData[\"logistcUnitName\"]}}</span>\n </td>\n <td *ngIf=\"isWmsWIS() || isWmsSilt() || isWmsSeniorConnect()\" (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 && isWmsWIS()\" (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 [agenda]=\"agenda\"\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>",
3648
3710
  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}"]
3649
3711
  }),
3650
3712
  __metadata("design:paramtypes", [TranslateService,
@@ -3652,7 +3714,8 @@ var DocumentGridComponent = /** @class */ (function () {
3652
3714
  ConfirmationService,
3653
3715
  IntegrationService,
3654
3716
  AgendaService,
3655
- UtilsMessageService])
3717
+ UtilsMessageService,
3718
+ FormWmsService])
3656
3719
  ], DocumentGridComponent);
3657
3720
  return DocumentGridComponent;
3658
3721
  }());
@@ -3700,9 +3763,10 @@ var Document = /** @class */ (function () {
3700
3763
  }());
3701
3764
 
3702
3765
  var RegisterDocumentComponent = /** @class */ (function () {
3703
- function RegisterDocumentComponent(fb, translate) {
3766
+ function RegisterDocumentComponent(fb, translate, documentGridComponent) {
3704
3767
  this.fb = fb;
3705
3768
  this.translate = translate;
3769
+ this.documentGridComponent = documentGridComponent;
3706
3770
  this.document = new EventEmitter();
3707
3771
  this.visible = new EventEmitter();
3708
3772
  this.visibleChange = new EventEmitter();
@@ -3767,6 +3831,9 @@ var RegisterDocumentComponent = /** @class */ (function () {
3767
3831
  };
3768
3832
  RegisterDocumentComponent.prototype.save = function () {
3769
3833
  this.document.emit(Document.fromDto(this.formGroup.getRawValue()));
3834
+ if (!this.documentGridComponent.validateDocument(document)) {
3835
+ return;
3836
+ }
3770
3837
  this.formGroup.reset();
3771
3838
  };
3772
3839
  RegisterDocumentComponent.prototype.isWmsWis = function () {
@@ -3823,7 +3890,8 @@ var RegisterDocumentComponent = /** @class */ (function () {
3823
3890
  template: "<s-sidebar\n [visible]=\"visible\"\n header=\"{{ 'yms.int.wms_register_document_add_document' | translate }} {{ wmsSystem }}\"\n (visibleChange)=\"close()\"\n (onclose)=\"close()\">\n <form [formGroup]=\"formGroup\">\n <div class=\"ui-g ui-fluid\">\n <div class=\"ui-g-6\" *ngIf=\"isWmsSeniorConnect()\">\n <label for=\"key\">{{'yms.int.wms_purchaseOrder' | translate}}</label>\n <input id=\"key\" pInputText type=\"text\" formControlName=\"key\">\n </div>\n <div class=\"ui-g-6\" *ngIf=\"!isWmsSeniorConnect() && !isWmsWis()\">\n <label for=\"invoiceKey\">{{'yms.int.wms_register_document_invoice_key' | translate}}</label>\n <input id=\"invoiceKey\" pInputText type=\"text\" formControlName=\"invoiceKey\">\n </div>\n <div class=\"ui-g-6\" *ngIf=\"!isWmsSeniorConnect()\">\n <label for=\"invoiceNumber\">{{'yms.int.wms_register_document_invoice_number' | translate}}</label>\n <input id=\"invoiceNumber\" pInputText type=\"text\" formControlName=\"invoiceNumber\">\n </div>\n <div class=\"ui-g-6\" *ngIf=\"!isWmsSeniorConnect()\">\n <label for=\"invoiceSerialNumber\">\n {{'yms.int.wms_register_document_invoice_serial_number' | translate}}\n </label>\n <input id=\"invoiceSerialNumber\" pInputText type=\"text\" formControlName=\"invoiceSerialNumber\">\n </div>\n <div class=\"ui-g-8\">\n <label for=\"logistcUnitName\">{{'yms.int.wms_register_document_logistc_unit_name' | translate}}</label>\n <input id=\"logistcUnitName\" pInputText type=\"text\" formControlName=\"logistcUnitName\">\n </div>\n <div class=\"ui-g-4\">\n <label for=\"logistcUnitDocument\">\n {{'yms.int.wms_register_document_logistc_unit_document' | translate}}\n </label>\n <input id=\"logistcUnitDocument\" pInputText type=\"text\" formControlName=\"logistcUnitDocument\">\n </div>\n <div class=\"ui-g-8\" *ngIf=\"!isWmsSeniorConnect() && !isWmsWis()\">\n <label for=\"documentOwnerName\">{{'yms.int.wms_register_document_owner_name' | translate}}</label>\n <input id=\"documentOwnerName\" pInputText type=\"text\" formControlName=\"ownerName\">\n </div>\n <div class=\"ui-g-4\" *ngIf=\"!isWmsSeniorConnect() && !isWmsWis()\">\n <label for=\"ownerDocument\">{{'yms.int.wms_register_document_owner_document' | translate}}</label>\n <input id=\"ownerDocument\" pInputText type=\"text\" formControlName=\"ownerDocument\">\n </div>\n <div class=\"ui-g-8\">\n <label for=\"partnerName\">{{'yms.int.wms_register_document_partner_name' | translate}}</label>\n <input id=\"partnerName\" pInputText type=\"text\" formControlName=\"partnerName\">\n </div>\n <div class=\"ui-g-4\">\n <label for=\"partnerDocument\">{{'yms.int.wms_register_document_partner_document' | translate}}</label>\n <input id=\"partnerDocument\" pInputText type=\"text\" formControlName=\"partnerDocument\">\n </div>\n <div class=\"ui-g-12\">\n <label for=\"notes\" id=\"notes\">{{'yms.int.wms_register_document_notes' | translate}}</label>\n <textarea id=\"notes\" rows=\"4\" pInputTextarea autoResize=\"autoResize\" formControlName=\"notes\"></textarea>\n </div>\n <div class=\"ui-g-4\" *ngIf=\"isWmsSenior() || isWmsWis()\">\n <label for=\"code\">\n {{'yms.int.wms_register_document_order_receiving_code' | translate}}\n </label>\n <input id=\"code\" pInputText type=\"text\" formControlName=\"code\">\n </div>\n <div class=\"ui-g-4\" *ngIf=\"!isClienteExterno && isWmsWis()\">\n <label for=\"invoiceCondition\" id=\"invoiceCondition\">\n {{'yms.int.wms_grid_document_invoice_condition' | translate}}\n </label>\n <p-dropdown\n inputId=\"invoiceCondition\"\n name=\"invoiceCondition\"\n [autoWidth]=\"false\"\n [options]=\"invoiceCondition\"\n formControlName=\"invoiceCondition\"\n ></p-dropdown>\n </div>\n </div>\n </form>\n <div class=\"space-between\">\n <button\n pButton label=\"{{'save' | translate}}\"\n (click)=\"save()\"\n [attr.data-hidden]=\"hideSaveButton\"\n [disabled]=\"!isSaveFormValid\">\n </button>\n <button\n type=\"button\" class=\"ui-button-link\" pButton label=\"{{'cancel' | translate}}\" (click)=\"close()\">\n </button>\n </div>\n</s-sidebar>"
3824
3891
  }),
3825
3892
  __metadata("design:paramtypes", [FormBuilder,
3826
- TranslateService])
3893
+ TranslateService,
3894
+ DocumentGridComponent])
3827
3895
  ], RegisterDocumentComponent);
3828
3896
  return RegisterDocumentComponent;
3829
3897
  }());
@@ -3870,15 +3938,16 @@ var ExternalTenantService = /** @class */ (function (_super) {
3870
3938
  }(EntityService));
3871
3939
 
3872
3940
  var InsertKeyComponent = /** @class */ (function () {
3873
- function InsertKeyComponent(formBuilder, documentService, utils, confirmationService, translate, externalTenantService) {
3941
+ function InsertKeyComponent(formBuilder, documentService, utils, confirmationService, translate, externalTenantService, documentGridComponent) {
3874
3942
  this.formBuilder = formBuilder;
3875
3943
  this.documentService = documentService;
3876
3944
  this.utils = utils;
3877
3945
  this.confirmationService = confirmationService;
3878
3946
  this.translate = translate;
3879
3947
  this.externalTenantService = externalTenantService;
3880
- this.document = new EventEmitter();
3948
+ this.documentGridComponent = documentGridComponent;
3881
3949
  this.visible = new EventEmitter();
3950
+ this.document = new EventEmitter();
3882
3951
  this.visibleChange = new EventEmitter();
3883
3952
  this.isLoading = false;
3884
3953
  this.isPartnerloading = false;
@@ -3940,6 +4009,9 @@ var InsertKeyComponent = /** @class */ (function () {
3940
4009
  return;
3941
4010
  }
3942
4011
  var document = content.contents[0];
4012
+ if (!_this.documentGridComponent.validateDocument(document)) {
4013
+ return;
4014
+ }
3943
4015
  document.invoiceKey = _this.formGroup.get('key').value;
3944
4016
  document.invoiceCondition = InvoiceCondition.AUTHORIZED;
3945
4017
  _this.document.emit(document);
@@ -4029,18 +4101,22 @@ var InsertKeyComponent = /** @class */ (function () {
4029
4101
  InsertKeyComponent.prototype.onDialogShow = function () {
4030
4102
  this.formGroup.reset();
4031
4103
  };
4032
- __decorate([
4033
- Output(),
4034
- __metadata("design:type", EventEmitter)
4035
- ], InsertKeyComponent.prototype, "document", void 0);
4036
4104
  __decorate([
4037
4105
  Input(),
4038
- __metadata("design:type", EventEmitter)
4039
- ], InsertKeyComponent.prototype, "visible", void 0);
4106
+ __metadata("design:type", Agenda)
4107
+ ], InsertKeyComponent.prototype, "agenda", void 0);
4040
4108
  __decorate([
4041
4109
  Input(),
4042
4110
  __metadata("design:type", String)
4043
4111
  ], InsertKeyComponent.prototype, "wmsSystem", void 0);
4112
+ __decorate([
4113
+ Input(),
4114
+ __metadata("design:type", EventEmitter)
4115
+ ], InsertKeyComponent.prototype, "visible", void 0);
4116
+ __decorate([
4117
+ Output(),
4118
+ __metadata("design:type", EventEmitter)
4119
+ ], InsertKeyComponent.prototype, "document", void 0);
4044
4120
  __decorate([
4045
4121
  Output(),
4046
4122
  __metadata("design:type", Object)
@@ -4056,7 +4132,8 @@ var InsertKeyComponent = /** @class */ (function () {
4056
4132
  UtilsMessageService,
4057
4133
  ConfirmationService,
4058
4134
  TranslateService,
4059
- ExternalTenantService])
4135
+ ExternalTenantService,
4136
+ DocumentGridComponent])
4060
4137
  ], InsertKeyComponent);
4061
4138
  return InsertKeyComponent;
4062
4139
  }());