@seniorsistemas/yms-integration 1.37.0-b333af94-daee-455c-9c78-2797113c9974 → 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 (21) hide show
  1. package/bundles/seniorsistemas-yms-integration.umd.js +80 -18
  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 +2 -2
  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 +35 -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 +2 -2
  10. package/esm5/src/wms/components/document-grid/insert-key/insert-key.component.js +47 -16
  11. package/esm5/src/wms/components/document-grid/register-document/register-document.component.js +36 -3
  12. package/esm5/src/wms/entities/document/document.service.js +4 -1
  13. package/fesm2015/seniorsistemas-yms-integration.js +78 -18
  14. package/fesm2015/seniorsistemas-yms-integration.js.map +1 -1
  15. package/fesm5/seniorsistemas-yms-integration.js +80 -18
  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/insert-key/insert-key.component.d.ts +7 -2
  20. package/src/wms/components/document-grid/register-document/register-document.component.d.ts +8 -1
  21. package/src/wms/entities/document/document.service.d.ts +1 -0
@@ -17,6 +17,9 @@ var DocumentService = /** @class */ (function (_super) {
17
17
  DocumentService.prototype.getSystemIntegration = function () {
18
18
  return this.http.get('yms_int/wms/queries/getSystemIntegration');
19
19
  };
20
+ DocumentService.prototype.getPlanta = function (plantaId) {
21
+ return this.http.get('yms/patio/entities/planta/' + plantaId);
22
+ };
20
23
  DocumentService = tslib_1.__decorate([
21
24
  Injectable(),
22
25
  tslib_1.__metadata("design:paramtypes", [HttpClient, MessageService])
@@ -24,4 +27,4 @@ var DocumentService = /** @class */ (function (_super) {
24
27
  return DocumentService;
25
28
  }(EntityService));
26
29
  export { DocumentService };
27
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZG9jdW1lbnQuc2VydmljZS5qcyIsInNvdXJjZVJvb3QiOiJuZzovL0BzZW5pb3JzaXN0ZW1hcy95bXMtaW50ZWdyYXRpb24vIiwic291cmNlcyI6WyJzcmMvd21zL2VudGl0aWVzL2RvY3VtZW50L2RvY3VtZW50LnNlcnZpY2UudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IjtBQUFBLE9BQU8sRUFBRSxhQUFhLEVBQUUsTUFBTSwyQ0FBMkMsQ0FBQztBQUMxRSxPQUFPLEVBQUUsVUFBVSxFQUFFLE1BQU0sZUFBZSxDQUFDO0FBRTNDLE9BQU8sRUFBRSxVQUFVLEVBQUUsTUFBTSxzQkFBc0IsQ0FBQztBQUNsRCxPQUFPLEVBQUUsY0FBYyxFQUFFLE1BQU0sYUFBYSxDQUFDO0FBSTdDO0lBQXFDLDJDQUEwQjtJQUMzRCx5QkFBc0IsSUFBZ0IsRUFBWSxjQUE4QjtRQUFoRixZQUNJLGtCQUFNLElBQUksRUFBRSxjQUFjLEVBQUUsK0JBQStCLEVBQUUsRUFBRSxDQUFDLFNBQ25FO1FBRnFCLFVBQUksR0FBSixJQUFJLENBQVk7UUFBWSxvQkFBYyxHQUFkLGNBQWMsQ0FBZ0I7O0lBRWhGLENBQUM7SUFFTSx1Q0FBYSxHQUFwQixVQUFxQixLQUF5QjtRQUMxQyxPQUFPLElBQUksQ0FBQyxJQUFJLENBQUMsSUFBSSxDQUFDLG1DQUFtQyxFQUFFLEtBQUssQ0FBQyxDQUFDO0lBQ3RFLENBQUM7SUFFTSw4Q0FBb0Is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NsYXNzIERvY3VtZW50U2VydmljZSBleHRlbmRzIEVudGl0eVNlcnZpY2U8RG9jdW1lbnREdG8+IHtcbiAgICBjb25zdHJ1Y3Rvcihwcm90ZWN0ZWQgaHR0cDogSHR0cENsaWVudCwgcHJvdGVjdGVkIG1lc3NhZ2VTZXJ2aWNlOiBNZXNzYWdlU2VydmljZSkge1xuICAgICAgICBzdXBlcihodHRwLCBtZXNzYWdlU2VydmljZSwgJ3ltc19pbnQvd21zL2VudGl0aWVzL2RvY3VtZW50JywgJycpO1xuICAgIH1cblxuICAgIHB1YmxpYyBmaW5kRG9jdW1lbnRzKGlucHV0OiBGaW5kRG9jdW1lbnRzSW5wdXQpIHtcbiAgICAgICAgcmV0dXJuIHRoaXMuaHR0cC5wb3N0KCd5bXNfaW50L3dtcy9xdWVyaWVzL2ZpbmREb2N1bWVudHMnLCBpbnB1dCk7XG4gICAgfVxuXG4gICAgcHVibGljIGdldFN5c3RlbUludGVncmF0aW9uKCkge1xuICAgICAgICByZXR1cm4gdGhpcy5odHRwLmdldCgneW1zX2ludC93bXMvcXVlcmllcy9nZXRTeXN0ZW1JbnRlZ3JhdGlvbicpO1xuICAgIH1cblxuICAgIHB1YmxpYyBnZXRQbGFudGEocGxhbnRhSWQ6IHN0cmluZykge1xuICAgICAgICByZXR1cm4gdGhpcy5odHRwLmdldCgneW1zL3BhdGlvL2VudGl0aWVzL3BsYW50YS8nICsgcGxhbnRhSWQpO1xuICAgIH1cbn1cbiJdfQ==
@@ -3037,6 +3037,9 @@ let DocumentService = class DocumentService extends EntityService {
3037
3037
  getSystemIntegration() {
3038
3038
  return this.http.get('yms_int/wms/queries/getSystemIntegration');
3039
3039
  }
3040
+ getPlanta(plantaId) {
3041
+ return this.http.get('yms/patio/entities/planta/' + plantaId);
3042
+ }
3040
3043
  };
3041
3044
  DocumentService = __decorate([
3042
3045
  Injectable(),
@@ -3421,7 +3424,7 @@ __decorate([
3421
3424
  DocumentGridComponent = __decorate([
3422
3425
  Component({
3423
3426
  selector: 'document-grid',
3424
- 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>",
3427
+ 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>",
3425
3428
  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}"]
3426
3429
  }),
3427
3430
  __metadata("design:paramtypes", [TranslateService,
@@ -3472,9 +3475,11 @@ class Document {
3472
3475
  }
3473
3476
 
3474
3477
  let RegisterDocumentComponent = class RegisterDocumentComponent {
3475
- constructor(fb, translate) {
3478
+ constructor(fb, translate, utils, documentService) {
3476
3479
  this.fb = fb;
3477
3480
  this.translate = translate;
3481
+ this.utils = utils;
3482
+ this.documentService = documentService;
3478
3483
  this.document = new EventEmitter();
3479
3484
  this.visible = new EventEmitter();
3480
3485
  this.visibleChange = new EventEmitter();
@@ -3482,12 +3487,22 @@ let RegisterDocumentComponent = class RegisterDocumentComponent {
3482
3487
  this.invoiceCondition = getInvoiceConditions(this.translate);
3483
3488
  }
3484
3489
  ngOnInit() {
3490
+ this.getYard();
3485
3491
  this.getFormGroup();
3486
3492
  this.watchFormChanges();
3487
3493
  }
3488
3494
  ngOnChanges() {
3489
3495
  this.visibilityConfig();
3490
3496
  }
3497
+ getYard() {
3498
+ this.documentService.getPlanta(this.agenda.planta.id)
3499
+ .pipe(catchError(err => {
3500
+ return throwError(err);
3501
+ }))
3502
+ .subscribe((content) => {
3503
+ this.planta = content;
3504
+ });
3505
+ }
3491
3506
  visibilityConfig() {
3492
3507
  if (!this.edit && this.visible) {
3493
3508
  this.formGroup.disable();
@@ -3538,9 +3553,23 @@ let RegisterDocumentComponent = class RegisterDocumentComponent {
3538
3553
  });
3539
3554
  }
3540
3555
  save() {
3556
+ const logistcUnitDocument = this.formGroup.get("logistcUnitDocument").value;
3557
+ this.validateYardDocument(logistcUnitDocument);
3541
3558
  this.document.emit(Document.fromDto(this.formGroup.getRawValue()));
3542
3559
  this.formGroup.reset();
3543
3560
  }
3561
+ validateYardDocument(logistcUnitDocument) {
3562
+ if (this.isWmsSeniorConnect()) {
3563
+ if (!this.planta.codigo) {
3564
+ this.utils.message("warn", "yms.int.yard_code_not_found_warning_header", "yms.int.yard_code_not_found_warning_description");
3565
+ return;
3566
+ }
3567
+ if (logistcUnitDocument !== this.planta.codigo) {
3568
+ this.utils.message("warn", "yms.int.document_yard_mismatch_agenda_warning_header", "yms.int.document_yard_mismatch_agenda_warning_description");
3569
+ return;
3570
+ }
3571
+ }
3572
+ }
3544
3573
  isWmsWis() {
3545
3574
  return this.wmsSystem === WmsSystem.WIS;
3546
3575
  }
@@ -3595,7 +3624,9 @@ RegisterDocumentComponent = __decorate([
3595
3624
  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>"
3596
3625
  }),
3597
3626
  __metadata("design:paramtypes", [FormBuilder,
3598
- TranslateService])
3627
+ TranslateService,
3628
+ UtilsMessageService,
3629
+ DocumentService])
3599
3630
  ], RegisterDocumentComponent);
3600
3631
 
3601
3632
  let RegisterDocumentModule = class RegisterDocumentModule {
@@ -3641,14 +3672,15 @@ let InsertKeyComponent = class InsertKeyComponent {
3641
3672
  this.confirmationService = confirmationService;
3642
3673
  this.translate = translate;
3643
3674
  this.externalTenantService = externalTenantService;
3644
- this.document = new EventEmitter();
3645
3675
  this.visible = new EventEmitter();
3676
+ this.document = new EventEmitter();
3646
3677
  this.visibleChange = new EventEmitter();
3647
3678
  this.isLoading = false;
3648
3679
  this.isPartnerloading = false;
3649
3680
  this.ngUnsubscribe = new Subject();
3650
3681
  }
3651
3682
  ngOnInit() {
3683
+ this.getYard();
3652
3684
  this.formGroup = this.formBuilder.group({
3653
3685
  key: [undefined],
3654
3686
  purchaseOrder: [undefined],
@@ -3660,6 +3692,15 @@ let InsertKeyComponent = class InsertKeyComponent {
3660
3692
  this.validateKeyDetails(nf);
3661
3693
  });
3662
3694
  }
3695
+ getYard() {
3696
+ this.documentService.getPlanta(this.agenda.planta.id)
3697
+ .pipe(catchError(err => {
3698
+ return throwError(err);
3699
+ }))
3700
+ .subscribe((content) => {
3701
+ this.planta = content;
3702
+ });
3703
+ }
3663
3704
  isWmsWis() {
3664
3705
  return this.wmsSystem === WmsSystem.WIS;
3665
3706
  }
@@ -3689,7 +3730,7 @@ let InsertKeyComponent = class InsertKeyComponent {
3689
3730
  this.utils.message("error", "yms.int.wms_error_search_document_message_header", "yms.int.wms_error_search_document_not_found_message_content");
3690
3731
  }
3691
3732
  else {
3692
- this.utils.translateMessage("error", "yms.int.wms_error_search_document_message_header", "yms.int.wms_error_unknown_search_document_message_content" + err.error.message);
3733
+ this.utils.translateMessage("error", "yms.int.wms_error_search_document_message_header", "yms.int.wms_error_unknown_search_document_message_content " + err.error.message);
3693
3734
  }
3694
3735
  this.confirmInvoiceDialog();
3695
3736
  return throwError(err);
@@ -3702,20 +3743,35 @@ let InsertKeyComponent = class InsertKeyComponent {
3702
3743
  return;
3703
3744
  }
3704
3745
  const document = content.contents[0];
3746
+ this.validateYardDocument(document.logistcUnitDocument);
3705
3747
  document.invoiceKey = this.formGroup.get('key').value;
3706
3748
  document.invoiceCondition = InvoiceCondition.AUTHORIZED;
3707
3749
  this.document.emit(document);
3708
3750
  this.formGroup.reset();
3709
3751
  });
3710
3752
  }
3753
+ validateYardDocument(logistcUnitDocument) {
3754
+ if (this.isWmsSeniorConnect()) {
3755
+ if (!this.planta.codigo) {
3756
+ this.utils.message("warn", "yms.int.yard_code_not_found_warning_header", "yms.int.yard_code_not_found_warning_description");
3757
+ return;
3758
+ }
3759
+ if (logistcUnitDocument !== this.planta.codigo) {
3760
+ this.utils.message("warn", "yms.int.document_yard_mismatch_agenda_warning_header", "yms.int.document_yard_mismatch_agenda_warning_description");
3761
+ return;
3762
+ }
3763
+ }
3764
+ }
3711
3765
  confirmInvoiceDialog() {
3712
- this.confirmationService.confirm({
3713
- message: this.translate.instant("yms.int.wms_message_confirm_invoice_dialog"),
3714
- acceptLabel: this.translate.instant("yms.int.wms_accept_confirm_invoice_dialog"),
3715
- rejectLabel: this.translate.instant("yms.int.wms_reject_confirm_invoice_dialog"),
3716
- header: this.translate.instant("yms.int.wms_header_content_confirm_invoice_dialog"),
3717
- accept: () => this.buildInvoice()
3718
- });
3766
+ if (this.isWmsWis()) {
3767
+ this.confirmationService.confirm({
3768
+ message: this.translate.instant("yms.int.wms_message_confirm_invoice_dialog"),
3769
+ acceptLabel: this.translate.instant("yms.int.wms_accept_confirm_invoice_dialog"),
3770
+ rejectLabel: this.translate.instant("yms.int.wms_reject_confirm_invoice_dialog"),
3771
+ header: this.translate.instant("yms.int.wms_header_content_confirm_invoice_dialog"),
3772
+ accept: () => this.buildInvoice()
3773
+ });
3774
+ }
3719
3775
  }
3720
3776
  buildInvoice() {
3721
3777
  this.isPartnerloading = true;
@@ -3788,18 +3844,22 @@ let InsertKeyComponent = class InsertKeyComponent {
3788
3844
  this.formGroup.reset();
3789
3845
  }
3790
3846
  };
3791
- __decorate([
3792
- Output(),
3793
- __metadata("design:type", EventEmitter)
3794
- ], InsertKeyComponent.prototype, "document", void 0);
3795
3847
  __decorate([
3796
3848
  Input(),
3797
- __metadata("design:type", EventEmitter)
3798
- ], InsertKeyComponent.prototype, "visible", void 0);
3849
+ __metadata("design:type", Agenda)
3850
+ ], InsertKeyComponent.prototype, "agenda", void 0);
3799
3851
  __decorate([
3800
3852
  Input(),
3801
3853
  __metadata("design:type", String)
3802
3854
  ], InsertKeyComponent.prototype, "wmsSystem", void 0);
3855
+ __decorate([
3856
+ Input(),
3857
+ __metadata("design:type", EventEmitter)
3858
+ ], InsertKeyComponent.prototype, "visible", void 0);
3859
+ __decorate([
3860
+ Output(),
3861
+ __metadata("design:type", EventEmitter)
3862
+ ], InsertKeyComponent.prototype, "document", void 0);
3803
3863
  __decorate([
3804
3864
  Output(),
3805
3865
  __metadata("design:type", Object)