@seniorsistemas/yms-integration 1.37.0 → 1.38.0-0be270cf-7979-4065-88af-d4097b6f6e51

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 (24) hide show
  1. package/bundles/seniorsistemas-yms-integration.umd.js +98 -27
  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 +10 -5
  6. package/esm2015/src/wms/components/document-grid/insert-key/insert-key.component.js +46 -16
  7. package/esm2015/src/wms/components/document-grid/register-document/register-document.component.js +40 -4
  8. package/esm2015/src/wms/components/document-list/document-list.component.js +6 -3
  9. package/esm2015/src/wms/entities/document/document.service.js +4 -1
  10. package/esm5/src/wms/components/document-grid/document-grid.component.js +10 -8
  11. package/esm5/src/wms/components/document-grid/insert-key/insert-key.component.js +47 -16
  12. package/esm5/src/wms/components/document-grid/register-document/register-document.component.js +41 -4
  13. package/esm5/src/wms/components/document-list/document-list.component.js +6 -3
  14. package/esm5/src/wms/entities/document/document.service.js +4 -1
  15. package/fesm2015/seniorsistemas-yms-integration.js +96 -24
  16. package/fesm2015/seniorsistemas-yms-integration.js.map +1 -1
  17. package/fesm5/seniorsistemas-yms-integration.js +98 -27
  18. package/fesm5/seniorsistemas-yms-integration.js.map +1 -1
  19. package/package.json +1 -1
  20. package/seniorsistemas-yms-integration.metadata.json +1 -1
  21. package/src/wms/components/document-grid/document-grid.component.d.ts +1 -0
  22. package/src/wms/components/document-grid/insert-key/insert-key.component.d.ts +7 -2
  23. package/src/wms/components/document-grid/register-document/register-document.component.d.ts +9 -1
  24. 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.getPlanta = function (plantaId) {
3261
+ return this.http.get('yms/patio/entities/planta/' + plantaId);
3262
+ };
3260
3263
  DocumentService = __decorate([
3261
3264
  Injectable(),
3262
3265
  __metadata("design:paramtypes", [HttpClient, MessageService])
@@ -3541,8 +3544,7 @@ var DocumentGridComponent = /** @class */ (function () {
3541
3544
  DocumentGridComponent.prototype.wmsSeniorConnectIntegration = function () {
3542
3545
  var columns = __spread([
3543
3546
  { field: "key", header: this.translate.instant("yms.int.wms_purchaseOrder") }
3544
- ], this.getColumnPartner());
3545
- this.addInvoiceSituationIfNotClienteExterno(columns);
3547
+ ], this.getColumnPartner(), this.getColumnlogistcUnit());
3546
3548
  return columns;
3547
3549
  };
3548
3550
  DocumentGridComponent.prototype.wmsWisIntegration = function () {
@@ -3567,10 +3569,7 @@ var DocumentGridComponent = /** @class */ (function () {
3567
3569
  return __spread([
3568
3570
  { field: "invoiceNumber", header: this.translate.instant("yms.int.wms_register_document_invoice_number") },
3569
3571
  { field: "invoiceSerialNumber", header: this.translate.instant("yms.int.wms_register_document_invoice_serial_number") }
3570
- ], this.getColumnPartner(), [
3571
- { field: "logistcUnitName", header: this.translate.instant("yms.int.wms_register_document_logistc_unit_name") },
3572
- { field: "logistcUnitDocument", header: this.translate.instant("yms.int.wms_register_document_logistc_unit_document") },
3573
- ]);
3572
+ ], this.getColumnPartner(), this.getColumnlogistcUnit());
3574
3573
  };
3575
3574
  DocumentGridComponent.prototype.getColumnPartner = function () {
3576
3575
  return [
@@ -3578,6 +3577,12 @@ var DocumentGridComponent = /** @class */ (function () {
3578
3577
  { field: "partnerDocument", header: this.translate.instant("yms.int.wms_register_document_partner_document") },
3579
3578
  ];
3580
3579
  };
3580
+ DocumentGridComponent.prototype.getColumnlogistcUnit = function () {
3581
+ return [
3582
+ { field: "logistcUnitName", header: this.translate.instant("yms.int.wms_register_document_logistc_unit_name") },
3583
+ { field: "logistcUnitDocument", header: this.translate.instant("yms.int.wms_register_document_logistc_unit_document") },
3584
+ ];
3585
+ };
3581
3586
  DocumentGridComponent.prototype.addInvoiceSituationIfNotClienteExterno = function (columns) {
3582
3587
  if (!this.isClienteExterno) {
3583
3588
  columns.push(this.getColumninvoiceCondition());
@@ -3642,7 +3647,7 @@ var DocumentGridComponent = /** @class */ (function () {
3642
3647
  DocumentGridComponent = __decorate([
3643
3648
  Component({
3644
3649
  selector: 'document-grid',
3645
- 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>",
3650
+ 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>",
3646
3651
  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}"]
3647
3652
  }),
3648
3653
  __metadata("design:paramtypes", [TranslateService,
@@ -3698,9 +3703,11 @@ var Document = /** @class */ (function () {
3698
3703
  }());
3699
3704
 
3700
3705
  var RegisterDocumentComponent = /** @class */ (function () {
3701
- function RegisterDocumentComponent(fb, translate) {
3706
+ function RegisterDocumentComponent(fb, translate, utils, documentService) {
3702
3707
  this.fb = fb;
3703
3708
  this.translate = translate;
3709
+ this.utils = utils;
3710
+ this.documentService = documentService;
3704
3711
  this.document = new EventEmitter();
3705
3712
  this.visible = new EventEmitter();
3706
3713
  this.visibleChange = new EventEmitter();
@@ -3708,12 +3715,23 @@ var RegisterDocumentComponent = /** @class */ (function () {
3708
3715
  this.invoiceCondition = getInvoiceConditions(this.translate);
3709
3716
  }
3710
3717
  RegisterDocumentComponent.prototype.ngOnInit = function () {
3718
+ this.getYard();
3711
3719
  this.getFormGroup();
3712
3720
  this.watchFormChanges();
3713
3721
  };
3714
3722
  RegisterDocumentComponent.prototype.ngOnChanges = function () {
3715
3723
  this.visibilityConfig();
3716
3724
  };
3725
+ RegisterDocumentComponent.prototype.getYard = function () {
3726
+ var _this = this;
3727
+ this.documentService.getPlanta(this.agenda.planta.id)
3728
+ .pipe(catchError(function (err) {
3729
+ return throwError(err);
3730
+ }))
3731
+ .subscribe(function (content) {
3732
+ _this.planta = content;
3733
+ });
3734
+ };
3717
3735
  RegisterDocumentComponent.prototype.visibilityConfig = function () {
3718
3736
  if (!this.edit && this.visible) {
3719
3737
  this.formGroup.disable();
@@ -3764,12 +3782,29 @@ var RegisterDocumentComponent = /** @class */ (function () {
3764
3782
  });
3765
3783
  };
3766
3784
  RegisterDocumentComponent.prototype.save = function () {
3785
+ var logistcUnitDocument = this.formGroup.get("logistcUnitDocument").value;
3786
+ this.validateYardDocument(logistcUnitDocument);
3767
3787
  this.document.emit(Document.fromDto(this.formGroup.getRawValue()));
3768
3788
  this.formGroup.reset();
3769
3789
  };
3790
+ RegisterDocumentComponent.prototype.validateYardDocument = function (logistcUnitDocument) {
3791
+ if (this.isWmsSeniorConnect()) {
3792
+ if (!this.planta.codigo) {
3793
+ this.utils.message("warn", "yms.int.yard_code_not_found_warning_header", "yms.int.yard_code_not_found_warning_description");
3794
+ return;
3795
+ }
3796
+ if (logistcUnitDocument !== this.planta.codigo) {
3797
+ this.utils.message("warn", "yms.int.document_yard_mismatch_agenda_warning_header", "yms.int.document_yard_mismatch_agenda_warning_description");
3798
+ return;
3799
+ }
3800
+ }
3801
+ };
3770
3802
  RegisterDocumentComponent.prototype.isWmsWis = function () {
3771
3803
  return this.wmsSystem === WmsSystem.WIS;
3772
3804
  };
3805
+ RegisterDocumentComponent.prototype.isWmsSenior = function () {
3806
+ return this.wmsSystem === WmsSystem.SENIOR;
3807
+ };
3773
3808
  RegisterDocumentComponent.prototype.isWmsSeniorConnect = function () {
3774
3809
  return this.wmsSystem === WmsSystem.SENIOR_CONNECT;
3775
3810
  };
@@ -3815,9 +3850,12 @@ var RegisterDocumentComponent = /** @class */ (function () {
3815
3850
  RegisterDocumentComponent = __decorate([
3816
3851
  Component({
3817
3852
  selector: "register-document",
3818
- 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\">\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\">\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>"
3853
+ 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>"
3819
3854
  }),
3820
- __metadata("design:paramtypes", [FormBuilder, TranslateService])
3855
+ __metadata("design:paramtypes", [FormBuilder,
3856
+ TranslateService,
3857
+ UtilsMessageService,
3858
+ DocumentService])
3821
3859
  ], RegisterDocumentComponent);
3822
3860
  return RegisterDocumentComponent;
3823
3861
  }());
@@ -3871,8 +3909,8 @@ var InsertKeyComponent = /** @class */ (function () {
3871
3909
  this.confirmationService = confirmationService;
3872
3910
  this.translate = translate;
3873
3911
  this.externalTenantService = externalTenantService;
3874
- this.document = new EventEmitter();
3875
3912
  this.visible = new EventEmitter();
3913
+ this.document = new EventEmitter();
3876
3914
  this.visibleChange = new EventEmitter();
3877
3915
  this.isLoading = false;
3878
3916
  this.isPartnerloading = false;
@@ -3880,6 +3918,7 @@ var InsertKeyComponent = /** @class */ (function () {
3880
3918
  }
3881
3919
  InsertKeyComponent.prototype.ngOnInit = function () {
3882
3920
  var _this = this;
3921
+ this.getYard();
3883
3922
  this.formGroup = this.formBuilder.group({
3884
3923
  key: [undefined],
3885
3924
  purchaseOrder: [undefined],
@@ -3891,6 +3930,16 @@ var InsertKeyComponent = /** @class */ (function () {
3891
3930
  _this.validateKeyDetails(nf);
3892
3931
  });
3893
3932
  };
3933
+ InsertKeyComponent.prototype.getYard = function () {
3934
+ var _this = this;
3935
+ this.documentService.getPlanta(this.agenda.planta.id)
3936
+ .pipe(catchError(function (err) {
3937
+ return throwError(err);
3938
+ }))
3939
+ .subscribe(function (content) {
3940
+ _this.planta = content;
3941
+ });
3942
+ };
3894
3943
  InsertKeyComponent.prototype.isWmsWis = function () {
3895
3944
  return this.wmsSystem === WmsSystem.WIS;
3896
3945
  };
@@ -3921,7 +3970,7 @@ var InsertKeyComponent = /** @class */ (function () {
3921
3970
  _this.utils.message("error", "yms.int.wms_error_search_document_message_header", "yms.int.wms_error_search_document_not_found_message_content");
3922
3971
  }
3923
3972
  else {
3924
- _this.utils.translateMessage("error", "yms.int.wms_error_search_document_message_header", "yms.int.wms_error_unknown_search_document_message_content" + err.error.message);
3973
+ _this.utils.translateMessage("error", "yms.int.wms_error_search_document_message_header", "yms.int.wms_error_unknown_search_document_message_content " + err.error.message);
3925
3974
  }
3926
3975
  _this.confirmInvoiceDialog();
3927
3976
  return throwError(err);
@@ -3934,21 +3983,36 @@ var InsertKeyComponent = /** @class */ (function () {
3934
3983
  return;
3935
3984
  }
3936
3985
  var document = content.contents[0];
3986
+ _this.validateYardDocument(document.logistcUnitDocument);
3937
3987
  document.invoiceKey = _this.formGroup.get('key').value;
3938
3988
  document.invoiceCondition = InvoiceCondition.AUTHORIZED;
3939
3989
  _this.document.emit(document);
3940
3990
  _this.formGroup.reset();
3941
3991
  });
3942
3992
  };
3993
+ InsertKeyComponent.prototype.validateYardDocument = function (logistcUnitDocument) {
3994
+ if (this.isWmsSeniorConnect()) {
3995
+ if (!this.planta.codigo) {
3996
+ this.utils.message("warn", "yms.int.yard_code_not_found_warning_header", "yms.int.yard_code_not_found_warning_description");
3997
+ return;
3998
+ }
3999
+ if (logistcUnitDocument !== this.planta.codigo) {
4000
+ this.utils.message("warn", "yms.int.document_yard_mismatch_agenda_warning_header", "yms.int.document_yard_mismatch_agenda_warning_description");
4001
+ return;
4002
+ }
4003
+ }
4004
+ };
3943
4005
  InsertKeyComponent.prototype.confirmInvoiceDialog = function () {
3944
4006
  var _this = this;
3945
- this.confirmationService.confirm({
3946
- message: this.translate.instant("yms.int.wms_message_confirm_invoice_dialog"),
3947
- acceptLabel: this.translate.instant("yms.int.wms_accept_confirm_invoice_dialog"),
3948
- rejectLabel: this.translate.instant("yms.int.wms_reject_confirm_invoice_dialog"),
3949
- header: this.translate.instant("yms.int.wms_header_content_confirm_invoice_dialog"),
3950
- accept: function () { return _this.buildInvoice(); }
3951
- });
4007
+ if (this.isWmsWis()) {
4008
+ this.confirmationService.confirm({
4009
+ message: this.translate.instant("yms.int.wms_message_confirm_invoice_dialog"),
4010
+ acceptLabel: this.translate.instant("yms.int.wms_accept_confirm_invoice_dialog"),
4011
+ rejectLabel: this.translate.instant("yms.int.wms_reject_confirm_invoice_dialog"),
4012
+ header: this.translate.instant("yms.int.wms_header_content_confirm_invoice_dialog"),
4013
+ accept: function () { return _this.buildInvoice(); }
4014
+ });
4015
+ }
3952
4016
  };
3953
4017
  InsertKeyComponent.prototype.buildInvoice = function () {
3954
4018
  var _this = this;
@@ -4021,18 +4085,22 @@ var InsertKeyComponent = /** @class */ (function () {
4021
4085
  InsertKeyComponent.prototype.onDialogShow = function () {
4022
4086
  this.formGroup.reset();
4023
4087
  };
4024
- __decorate([
4025
- Output(),
4026
- __metadata("design:type", EventEmitter)
4027
- ], InsertKeyComponent.prototype, "document", void 0);
4028
4088
  __decorate([
4029
4089
  Input(),
4030
- __metadata("design:type", EventEmitter)
4031
- ], InsertKeyComponent.prototype, "visible", void 0);
4090
+ __metadata("design:type", Agenda)
4091
+ ], InsertKeyComponent.prototype, "agenda", void 0);
4032
4092
  __decorate([
4033
4093
  Input(),
4034
4094
  __metadata("design:type", String)
4035
4095
  ], InsertKeyComponent.prototype, "wmsSystem", void 0);
4096
+ __decorate([
4097
+ Input(),
4098
+ __metadata("design:type", EventEmitter)
4099
+ ], InsertKeyComponent.prototype, "visible", void 0);
4100
+ __decorate([
4101
+ Output(),
4102
+ __metadata("design:type", EventEmitter)
4103
+ ], InsertKeyComponent.prototype, "document", void 0);
4036
4104
  __decorate([
4037
4105
  Output(),
4038
4106
  __metadata("design:type", Object)
@@ -4208,6 +4276,9 @@ var DocumentListComponent = /** @class */ (function (_super) {
4208
4276
  { field: "key", label: 'yms.int.wms_purchaseOrder' },
4209
4277
  { field: "partnerName", label: 'yms.int.wms_register_document_invoice_partner_name' },
4210
4278
  { field: "partnerDocument", label: 'yms.int.wms_register_document_invoice_partner_document' },
4279
+ { field: "logistcUnitName", label: 'yms.int.wms_register_document_logistc_unit_name' },
4280
+ { field: "logistcUnitDocument", label: 'yms.int.wms_register_document_logistc_unit_document' },
4281
+ { field: "notes", label: 'yms.int.wms_register_document_notes' },
4211
4282
  ];
4212
4283
  }
4213
4284
  return __spread([
@@ -4302,8 +4373,8 @@ var DocumentListComponent = /** @class */ (function (_super) {
4302
4373
  ], DocumentListComponent.prototype, "wmsSystem", void 0);
4303
4374
  DocumentListComponent = __decorate([
4304
4375
  Component({
4305
- template: "<div class=\"ui-g\">\n <div class=\"ui-g-12\">\n <p-table\n selectionMode=\"single\"\n [(selection)]=\"selected\"\n [value]=\"documents\"\n [columns]=\"getColumns\"\n dataKey=\"id\"\n rows=\"10\"\n [paginator]=\"true\"\n [totalRecords]=\"gridTotalRecords\"\n [lazy]=\"true\"\n [resizableColumns]=\"true\"\n (onLazyLoad)=\"updateGridData($event)\"\n *sLoadingState=\"gridLoading\"\n sortMode=\"multiple\"\n styleClass=\"sds-table-scrollable\"\n [rowsPerPageOptions]=\"[10, 20, 50, 100, 200]\"\n paginatorDropdownScrollHeight=\"250px\"\n [scrollable]=\"true\"\n >\n <ng-template pTemplate=\"colgroup\" let-columns>\n <colgroup>\n <col *ngFor=\"let col of columns\" class=\"table-col-width\">\n </colgroup>\n </ng-template>\n\n <ng-template pTemplate=\"header\" let-columns>\n <tr>\n <th *ngFor=\"let col of columns\" pResizableColumn [pSortableColumn]=\"col.field\" scope=\"col\">\n <div class=\"senior-header\">\n <span class=\"senior-header-title\">{{ col.label | translate }}</span>\n <p-sortIcon [field]=\"col.field\"></p-sortIcon>\n </div>\n </th>\n </tr>\n </ng-template>\n\n <ng-template pTemplate=\"body\" let-rowData let-columns=\"columns\">\n <tr *ngIf=\"isWmsWIS()\">\n <td>{{ rowData?.invoiceNumber || 'N/A' }}</td>\n <td>{{ rowData?.invoiceSerialNumber || 'N/A' }}</td>\n <td>{{ rowData?.invoiceKey || 'N/A' }}</td>\n <td>{{ rowData?.partnerName || 'N/A' }}</td>\n <td>{{ rowData?.partnerDocument || 'N/A' }}</td>\n <td>{{ rowData?.code || 'N/A' }}</td>\n <td>\n <p-dropdown\n inputId=\"invoiceCondition\"\n name=\"invoiceCondition\"\n [autoWidth]=\"false\"\n [options]=\"getFilteredInvoiceConditions(rowData?.invoiceCondition)\"\n appendTo=\"body\"\n [(ngModel)]=\"rowData.invoiceCondition\"\n [disabled]=\"isAuthorized(rowData.invoiceCondition)\"\n (onChange)=\"onInvoiceConditionChange($event, rowData)\">\n </p-dropdown>\n </td>\n <td>{{ rowData?.notes || 'N/A' }}</td>\n </tr>\n <tr *ngIf=\"isWmsSeniorConnect()\">\n <td>{{rowData?.key}}</td>\n <td>{{rowData?.partnerName}}</td>\n <td>{{rowData?.partnerDocument}}</td>\n </tr>\n <tr *ngIf=\"!isWmsWIS() && !isWmsSeniorConnect()\">\n <td>{{rowData?.invoiceKey}}</td>\n <td>{{rowData?.invoiceNumber}}</td>\n <td>{{rowData?.invoiceSerialNumber}}</td>\n </tr>\n </ng-template>\n\n <ng-template pTemplate=\"paginatorright\">\n <span>\n {{ gridTotalRecords + \" \" + \n ('yms.int.wms_register_document_total_elements' | translate:{value: gridTotalRecords}) }}\n </span>\n </ng-template>\n </p-table>\n <div class=\"button-save\">\n <s-button priority=\"primary\" [label]=\"'save' | translate\"\n [disabled]=\"!disabled || !this.documents\"\n (click)=\"save()\">\n </s-button>\n </div>\n </div>\n</div>",
4306
- styles: [".table-col-width{width:250px}.button-save{margin:5px 0}"]
4376
+ 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\" [style.width]=\"col.field === 'notes' ? '400px' : '250px'\">\n </colgroup>\n </ng-template>\n\n <ng-template pTemplate=\"header\" let-columns>\n <tr>\n <th *ngFor=\"let col of columns\" pResizableColumn [pSortableColumn]=\"col.field\" scope=\"col\">\n <div class=\"senior-header\">\n <span class=\"senior-header-title\">{{ col.label | translate }}</span>\n <p-sortIcon [field]=\"col.field\"></p-sortIcon>\n </div>\n </th>\n </tr>\n </ng-template>\n\n <ng-template pTemplate=\"body\" let-rowData let-columns=\"columns\">\n <tr *ngIf=\"isWmsWIS()\">\n <td>{{ rowData?.invoiceNumber || 'N/A' }}</td>\n <td>{{ rowData?.invoiceSerialNumber || 'N/A' }}</td>\n <td>{{ rowData?.invoiceKey || 'N/A' }}</td>\n <td>{{ rowData?.partnerName || 'N/A' }}</td>\n <td>{{ rowData?.partnerDocument || 'N/A' }}</td>\n <td>{{ rowData?.code || 'N/A' }}</td>\n <td>\n <p-dropdown\n inputId=\"invoiceCondition\"\n name=\"invoiceCondition\"\n [autoWidth]=\"false\"\n [options]=\"getFilteredInvoiceConditions(rowData?.invoiceCondition)\"\n appendTo=\"body\"\n [(ngModel)]=\"rowData.invoiceCondition\"\n [disabled]=\"isAuthorized(rowData.invoiceCondition)\"\n (onChange)=\"onInvoiceConditionChange($event, rowData)\">\n </p-dropdown>\n </td>\n <td>{{ rowData?.notes || 'N/A' }}</td>\n </tr>\n <tr *ngIf=\"isWmsSeniorConnect()\">\n <td>{{rowData?.key}}</td>\n <td>{{rowData?.partnerName}}</td>\n <td>{{rowData?.partnerDocument}}</td>\n <td>{{rowData?.logistcUnitName}}</td>\n <td>{{rowData?.logistcUnitDocument}}</td>\n <td>{{rowData?.notes}}</td>\n </tr>\n <tr *ngIf=\"!isWmsWIS() && !isWmsSeniorConnect()\">\n <td>{{rowData?.invoiceKey}}</td>\n <td>{{rowData?.invoiceNumber}}</td>\n <td>{{rowData?.invoiceSerialNumber}}</td>\n </tr>\n </ng-template>\n\n <ng-template pTemplate=\"paginatorright\">\n <span>\n {{ gridTotalRecords + \" \" + \n ('yms.int.wms_register_document_total_elements' | translate:{value: gridTotalRecords}) }}\n </span>\n </ng-template>\n </p-table>\n <div class=\"button-save\">\n <s-button priority=\"primary\" [label]=\"'save' | translate\"\n [disabled]=\"!disabled || !this.documents\"\n (click)=\"save()\">\n </s-button>\n </div>\n </div>\n</div>",
4377
+ styles: [".button-save{margin:5px 0}"]
4307
4378
  }),
4308
4379
  __metadata("design:paramtypes", [DocumentService,
4309
4380
  TranslateService,