@seniorsistemas/yms-integration 1.38.0 → 1.39.0-340cde47-7c98-4d6d-900d-d167f4d9aadc

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 +94 -16
  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 +11 -4
  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 +11 -4
  12. package/esm5/src/wms/entities/document/document.service.js +4 -1
  13. package/fesm2015/seniorsistemas-yms-integration.js +90 -16
  14. package/fesm2015/seniorsistemas-yms-integration.js.map +1 -1
  15. package/fesm5/seniorsistemas-yms-integration.js +94 -16
  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
@@ -3316,6 +3316,9 @@
3316
3316
  DocumentService.prototype.getSystemIntegration = function () {
3317
3317
  return this.http.get('yms_int/wms/queries/getSystemIntegration');
3318
3318
  };
3319
+ DocumentService.prototype.getYard = function (yardId) {
3320
+ return this.http.get('yms/patio/entities/planta/' + yardId);
3321
+ };
3319
3322
  DocumentService = __decorate([
3320
3323
  core.Injectable(),
3321
3324
  __metadata("design:paramtypes", [http.HttpClient, api.MessageService])
@@ -3368,13 +3371,14 @@
3368
3371
  }
3369
3372
 
3370
3373
  var DocumentGridComponent = /** @class */ (function () {
3371
- function DocumentGridComponent(translate, documentService, confirmationService, integrationService, agendaService, utils) {
3374
+ function DocumentGridComponent(translate, documentService, confirmationService, integrationService, agendaService, utils, wmsService) {
3372
3375
  this.translate = translate;
3373
3376
  this.documentService = documentService;
3374
3377
  this.confirmationService = confirmationService;
3375
3378
  this.integrationService = integrationService;
3376
3379
  this.agendaService = agendaService;
3377
3380
  this.utils = utils;
3381
+ this.wmsService = wmsService;
3378
3382
  this.viewDocument = new core.EventEmitter();
3379
3383
  this.gridData = [];
3380
3384
  this.enableButtonIsClienteExterno = true;
@@ -3392,9 +3396,43 @@
3392
3396
  }
3393
3397
  };
3394
3398
  DocumentGridComponent.prototype.ngOnInit = function () {
3399
+ var _this = this;
3395
3400
  this.verifyClienteExterno();
3396
3401
  this.getProcessTypeByScheduling();
3397
3402
  this.listDocuments(false);
3403
+ this.wmsService.getSystemIntegration()
3404
+ .subscribe(function (_a) {
3405
+ var system = _a.system;
3406
+ _this.wmsSystem = system;
3407
+ if (_this.isWmsSeniorConnect()) {
3408
+ _this.getYard();
3409
+ _this.getSchedule();
3410
+ }
3411
+ });
3412
+ };
3413
+ DocumentGridComponent.prototype.getYard = function () {
3414
+ var _this = this;
3415
+ this.documentService.getYard(this.agenda.planta.id)
3416
+ .pipe(operators.catchError(function (err) {
3417
+ return rxjs.throwError(err);
3418
+ }))
3419
+ .subscribe(function (content) {
3420
+ _this.yard = content;
3421
+ });
3422
+ };
3423
+ DocumentGridComponent.prototype.getSchedule = function () {
3424
+ var _this = this;
3425
+ if (this.agenda.externalTenant && this.agenda.externalTenant.cnpj) {
3426
+ this.schedule = this.agenda;
3427
+ return;
3428
+ }
3429
+ this.agendaService.get(this.agenda.id)
3430
+ .pipe(operators.catchError(function (err) {
3431
+ return rxjs.throwError(err);
3432
+ }))
3433
+ .subscribe(function (content) {
3434
+ _this.schedule = content;
3435
+ });
3398
3436
  };
3399
3437
  DocumentGridComponent.prototype.verifyClienteExterno = function () {
3400
3438
  var _this = this;
@@ -3534,7 +3572,7 @@
3534
3572
  accept: function () {
3535
3573
  _this.removeDocumentIfIdUndfined();
3536
3574
  if (_this.selection.length < 1) {
3537
- return rxjs.empty();
3575
+ return null;
3538
3576
  }
3539
3577
  return rxjs.forkJoin(_this.selection.map(function (document) { return _this.documentService.delete(document.id); }))
3540
3578
  .pipe(operators.takeUntil(_this.ngUnsubscribe))
@@ -3656,6 +3694,30 @@
3656
3694
  DocumentGridComponent.prototype.sucessMessage = function () {
3657
3695
  return this.utils.message("success", this.summary, "saved_message_content");
3658
3696
  };
3697
+ DocumentGridComponent.prototype.validateDocument = function (document) {
3698
+ if (this.isWmsSeniorConnect()) {
3699
+ if (!this.yard.codigo) {
3700
+ this.buildMessage("yms.int.yard_code_not_found_warning_description");
3701
+ return false;
3702
+ }
3703
+ if (document.logistcUnitDocument !== this.yard.codigo) {
3704
+ this.buildMessage("yms.int.document_yard_mismatch_agenda_warning_description");
3705
+ return false;
3706
+ }
3707
+ if (!this.schedule.externalTenant) {
3708
+ this.buildMessage("yms.int.partner_not_informed_agenda_warning_description");
3709
+ return false;
3710
+ }
3711
+ if (document.partnerDocument !== this.schedule.externalTenant.cnpj) {
3712
+ this.buildMessage("yms.int.partner_differs_from_agenda_warning_description");
3713
+ return false;
3714
+ }
3715
+ }
3716
+ return true;
3717
+ };
3718
+ DocumentGridComponent.prototype.buildMessage = function (description) {
3719
+ this.utils.message("warn", "yms.int.documento_invalido_warning_header", description);
3720
+ };
3659
3721
  __decorate([
3660
3722
  core.Input(),
3661
3723
  __metadata("design:type", Object)
@@ -3703,7 +3765,7 @@
3703
3765
  DocumentGridComponent = __decorate([
3704
3766
  core.Component({
3705
3767
  selector: 'document-grid',
3706
- 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>",
3768
+ 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>",
3707
3769
  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}"]
3708
3770
  }),
3709
3771
  __metadata("design:paramtypes", [core$1.TranslateService,
@@ -3711,7 +3773,8 @@
3711
3773
  api.ConfirmationService,
3712
3774
  IntegrationService,
3713
3775
  AgendaService,
3714
- UtilsMessageService])
3776
+ UtilsMessageService,
3777
+ FormWmsService])
3715
3778
  ], DocumentGridComponent);
3716
3779
  return DocumentGridComponent;
3717
3780
  }());
@@ -3759,9 +3822,10 @@
3759
3822
  }());
3760
3823
 
3761
3824
  var RegisterDocumentComponent = /** @class */ (function () {
3762
- function RegisterDocumentComponent(fb, translate) {
3825
+ function RegisterDocumentComponent(fb, translate, documentGridComponent) {
3763
3826
  this.fb = fb;
3764
3827
  this.translate = translate;
3828
+ this.documentGridComponent = documentGridComponent;
3765
3829
  this.document = new core.EventEmitter();
3766
3830
  this.visible = new core.EventEmitter();
3767
3831
  this.visibleChange = new core.EventEmitter();
@@ -3825,7 +3889,11 @@
3825
3889
  });
3826
3890
  };
3827
3891
  RegisterDocumentComponent.prototype.save = function () {
3828
- this.document.emit(Document.fromDto(this.formGroup.getRawValue()));
3892
+ var document = Document.fromDto(this.formGroup.getRawValue());
3893
+ if (!this.documentGridComponent.validateDocument(document)) {
3894
+ return;
3895
+ }
3896
+ this.document.emit(document);
3829
3897
  this.formGroup.reset();
3830
3898
  };
3831
3899
  RegisterDocumentComponent.prototype.isWmsWis = function () {
@@ -3882,7 +3950,8 @@
3882
3950
  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>"
3883
3951
  }),
3884
3952
  __metadata("design:paramtypes", [forms.FormBuilder,
3885
- core$1.TranslateService])
3953
+ core$1.TranslateService,
3954
+ DocumentGridComponent])
3886
3955
  ], RegisterDocumentComponent);
3887
3956
  return RegisterDocumentComponent;
3888
3957
  }());
@@ -3929,15 +3998,16 @@
3929
3998
  }(EntityService));
3930
3999
 
3931
4000
  var InsertKeyComponent = /** @class */ (function () {
3932
- function InsertKeyComponent(formBuilder, documentService, utils, confirmationService, translate, externalTenantService) {
4001
+ function InsertKeyComponent(formBuilder, documentService, utils, confirmationService, translate, externalTenantService, documentGridComponent) {
3933
4002
  this.formBuilder = formBuilder;
3934
4003
  this.documentService = documentService;
3935
4004
  this.utils = utils;
3936
4005
  this.confirmationService = confirmationService;
3937
4006
  this.translate = translate;
3938
4007
  this.externalTenantService = externalTenantService;
3939
- this.document = new core.EventEmitter();
4008
+ this.documentGridComponent = documentGridComponent;
3940
4009
  this.visible = new core.EventEmitter();
4010
+ this.document = new core.EventEmitter();
3941
4011
  this.visibleChange = new core.EventEmitter();
3942
4012
  this.isLoading = false;
3943
4013
  this.isPartnerloading = false;
@@ -3999,6 +4069,9 @@
3999
4069
  return;
4000
4070
  }
4001
4071
  var document = content.contents[0];
4072
+ if (!_this.documentGridComponent.validateDocument(document)) {
4073
+ return;
4074
+ }
4002
4075
  document.invoiceKey = _this.formGroup.get('key').value;
4003
4076
  document.invoiceCondition = InvoiceCondition.AUTHORIZED;
4004
4077
  _this.document.emit(document);
@@ -4088,18 +4161,22 @@
4088
4161
  InsertKeyComponent.prototype.onDialogShow = function () {
4089
4162
  this.formGroup.reset();
4090
4163
  };
4091
- __decorate([
4092
- core.Output(),
4093
- __metadata("design:type", core.EventEmitter)
4094
- ], InsertKeyComponent.prototype, "document", void 0);
4095
4164
  __decorate([
4096
4165
  core.Input(),
4097
- __metadata("design:type", core.EventEmitter)
4098
- ], InsertKeyComponent.prototype, "visible", void 0);
4166
+ __metadata("design:type", Agenda)
4167
+ ], InsertKeyComponent.prototype, "agenda", void 0);
4099
4168
  __decorate([
4100
4169
  core.Input(),
4101
4170
  __metadata("design:type", String)
4102
4171
  ], InsertKeyComponent.prototype, "wmsSystem", void 0);
4172
+ __decorate([
4173
+ core.Input(),
4174
+ __metadata("design:type", core.EventEmitter)
4175
+ ], InsertKeyComponent.prototype, "visible", void 0);
4176
+ __decorate([
4177
+ core.Output(),
4178
+ __metadata("design:type", core.EventEmitter)
4179
+ ], InsertKeyComponent.prototype, "document", void 0);
4103
4180
  __decorate([
4104
4181
  core.Output(),
4105
4182
  __metadata("design:type", Object)
@@ -4115,7 +4192,8 @@
4115
4192
  UtilsMessageService,
4116
4193
  api.ConfirmationService,
4117
4194
  core$1.TranslateService,
4118
- ExternalTenantService])
4195
+ ExternalTenantService,
4196
+ DocumentGridComponent])
4119
4197
  ], InsertKeyComponent);
4120
4198
  return InsertKeyComponent;
4121
4199
  }());