@seniorsistemas/yms-integration 1.31.1-f472999f-36a6-412f-af44-e2024a57be58 → 1.32.0-7a92407d-4195-45d3-80d8-96605c56a35a

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 (34) hide show
  1. package/bundles/seniorsistemas-yms-integration.umd.js +108 -22
  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/erp-senior/recebimento/form/recebimento-form.component.js +1 -1
  6. package/esm2015/src/wms/components/document-grid/document-grid.component.js +45 -14
  7. package/esm2015/src/wms/components/document-grid/document-grid.module.js +6 -3
  8. package/esm2015/src/wms/components/document-grid/insert-key/insert-key.component.js +38 -3
  9. package/esm2015/src/wms/components/document-grid/register-document/register-document.component.js +16 -7
  10. package/esm2015/src/wms/components/document-grid/register-document/register-document.module.js +4 -3
  11. package/esm2015/src/wms/entities/document/document-dto.js +1 -1
  12. package/esm2015/src/wms/entities/document/document.js +2 -1
  13. package/esm2015/src/wms/entities/invoice-condition/invoice-condition.js +8 -0
  14. package/esm5/src/erp-senior/recebimento/form/recebimento-form.component.js +1 -1
  15. package/esm5/src/wms/components/document-grid/document-grid.component.js +45 -14
  16. package/esm5/src/wms/components/document-grid/document-grid.module.js +6 -3
  17. package/esm5/src/wms/components/document-grid/insert-key/insert-key.component.js +39 -3
  18. package/esm5/src/wms/components/document-grid/register-document/register-document.component.js +16 -7
  19. package/esm5/src/wms/components/document-grid/register-document/register-document.module.js +4 -3
  20. package/esm5/src/wms/entities/document/document-dto.js +1 -1
  21. package/esm5/src/wms/entities/document/document.js +2 -1
  22. package/esm5/src/wms/entities/invoice-condition/invoice-condition.js +8 -0
  23. package/fesm2015/seniorsistemas-yms-integration.js +107 -22
  24. package/fesm2015/seniorsistemas-yms-integration.js.map +1 -1
  25. package/fesm5/seniorsistemas-yms-integration.js +108 -22
  26. package/fesm5/seniorsistemas-yms-integration.js.map +1 -1
  27. package/package.json +1 -1
  28. package/seniorsistemas-yms-integration.metadata.json +1 -1
  29. package/src/wms/components/document-grid/document-grid.component.d.ts +9 -0
  30. package/src/wms/components/document-grid/insert-key/insert-key.component.d.ts +4 -0
  31. package/src/wms/components/document-grid/register-document/register-document.component.d.ts +8 -3
  32. package/src/wms/entities/document/document-dto.d.ts +1 -0
  33. package/src/wms/entities/document/document.d.ts +2 -0
  34. package/src/wms/entities/invoice-condition/invoice-condition.d.ts +6 -0
@@ -3288,6 +3288,14 @@ var ProcessType;
3288
3288
  ProcessType["RECEBIMENTO_WMS"] = "RECEBIMENTO_WMS";
3289
3289
  })(ProcessType || (ProcessType = {}));
3290
3290
 
3291
+ var InvoiceCondition;
3292
+ (function (InvoiceCondition) {
3293
+ InvoiceCondition["AUTHORIZED"] = "AUTHORIZED";
3294
+ InvoiceCondition["PARTIAL_AUTHORIZED"] = "PARTIAL_AUTHORIZED";
3295
+ InvoiceCondition["MANUAL_AUTHORIZED"] = "MANUAL_AUTHORIZED";
3296
+ InvoiceCondition["DEVOLUTION"] = "DEVOLUTION";
3297
+ })(InvoiceCondition || (InvoiceCondition = {}));
3298
+
3291
3299
  var DocumentGridComponent = /** @class */ (function () {
3292
3300
  function DocumentGridComponent(translate, documentService, confirmationService, integrationService, agendaService, utils) {
3293
3301
  this.translate = translate;
@@ -3299,7 +3307,15 @@ var DocumentGridComponent = /** @class */ (function () {
3299
3307
  this.viewDocument = new EventEmitter();
3300
3308
  this.gridData = [];
3301
3309
  this.enableButtonIsClienteExterno = true;
3310
+ this.summary = "yms.int.wms_saved_document_message_title";
3302
3311
  this.ngUnsubscribe = new Subject();
3312
+ this.invoiceCondition = [
3313
+ { label: this.translate.instant("yms.int.wms_grid_document_invoice_no_way"), value: null },
3314
+ { label: this.translate.instant("yms.int.wms_grid_document_invoice_condition_authorized"), value: InvoiceCondition.AUTHORIZED },
3315
+ { label: this.translate.instant("yms.int.wms_grid_document_invoice_condition_manual_authorized"), value: InvoiceCondition.MANUAL_AUTHORIZED },
3316
+ { label: this.translate.instant("yms.int.wms_grid_document_invoice_condition_partial_authorized"), value: InvoiceCondition.PARTIAL_AUTHORIZED },
3317
+ { label: this.translate.instant("yms.int.wms_grid_document_invoice_condition_devolucion"), value: InvoiceCondition.AUTHORIZED },
3318
+ ];
3303
3319
  this.selection = [];
3304
3320
  }
3305
3321
  DocumentGridComponent.prototype.ngOnInit = function () {
@@ -3336,7 +3352,7 @@ var DocumentGridComponent = /** @class */ (function () {
3336
3352
  }
3337
3353
  this.gridData.push(document);
3338
3354
  this.disabled = false;
3339
- this.utils.message("success", "yms.int.wms_saved_document_message_title", "yms.int.wms_success_message_description");
3355
+ this.utils.message("success", this.summary, "yms.int.wms_success_message_description");
3340
3356
  this.visibleDocumentRegister = false;
3341
3357
  this.visibleInvoiceKey = false;
3342
3358
  };
@@ -3416,11 +3432,17 @@ var DocumentGridComponent = /** @class */ (function () {
3416
3432
  }
3417
3433
  data.key = _this.updateKeyByWms(data);
3418
3434
  _this.documentService.insert(data).subscribe(function () {
3419
- _this.utils.message("success", "yms.int.wms_saved_document_message_title", "saved_message_content");
3435
+ _this.sucessMessage();
3420
3436
  });
3421
3437
  _this.disabled = true;
3422
3438
  _this.listDocuments(false);
3423
3439
  }
3440
+ else {
3441
+ _this.documentService.update(data.id, data).subscribe(function () {
3442
+ _this.sucessMessage();
3443
+ _this.disabled = true;
3444
+ });
3445
+ }
3424
3446
  });
3425
3447
  }
3426
3448
  };
@@ -3487,17 +3509,27 @@ var DocumentGridComponent = /** @class */ (function () {
3487
3509
  if (this.isWmsSeniorConnect()) {
3488
3510
  return __spread([
3489
3511
  { field: "key", header: this.translate.instant("yms.int.wms_purchaseOrder") }
3490
- ], this.getColumnPartner());
3512
+ ], this.getColumnPartner(), [
3513
+ this.getColumninvoiceCondition(),
3514
+ ]);
3491
3515
  }
3492
- if (this.isWmsWIS()) {
3493
- return this.getColumnInvoiceAndlogistcUnit();
3516
+ else if (this.isWmsWIS()) {
3517
+ return __spread(this.getColumnInvoiceAndlogistcUnit(), [
3518
+ this.getColumninvoiceCondition(),
3519
+ ]);
3494
3520
  }
3495
- return __spread([
3496
- { field: "invoiceKey", header: this.translate.instant("yms.int.wms_register_document_invoice_key") }
3497
- ], this.getColumnInvoiceAndlogistcUnit(), [
3498
- { field: "ownerName", header: this.translate.instant("yms.int.wms_register_document_owner_name") },
3499
- { field: "ownerDocument", header: this.translate.instant("yms.int.wms_register_document_owner_document") },
3500
- ]);
3521
+ else {
3522
+ return __spread([
3523
+ { field: "invoiceKey", header: this.translate.instant("yms.int.wms_register_document_invoice_key") }
3524
+ ], this.getColumnInvoiceAndlogistcUnit(), [
3525
+ { field: "ownerName", header: this.translate.instant("yms.int.wms_register_document_owner_name") },
3526
+ { field: "ownerDocument", header: this.translate.instant("yms.int.wms_register_document_owner_document") },
3527
+ this.getColumninvoiceCondition(),
3528
+ ]);
3529
+ }
3530
+ };
3531
+ DocumentGridComponent.prototype.getColumninvoiceCondition = function () {
3532
+ return { field: "invoiceCondition", header: this.translate.instant("yms.int.wms_grid_document_invoice_condition") };
3501
3533
  };
3502
3534
  DocumentGridComponent.prototype.getColumnInvoiceAndlogistcUnit = function () {
3503
3535
  return __spread([
@@ -3520,6 +3552,12 @@ var DocumentGridComponent = /** @class */ (function () {
3520
3552
  DocumentGridComponent.prototype.isWmsWIS = function () {
3521
3553
  return this.wmsSystem === WmsSystem.WIS;
3522
3554
  };
3555
+ DocumentGridComponent.prototype.isWmsSilt = function () {
3556
+ return this.wmsSystem === WmsSystem.SENIOR;
3557
+ };
3558
+ DocumentGridComponent.prototype.sucessMessage = function () {
3559
+ return this.utils.message("success", this.summary, "saved_message_content");
3560
+ };
3523
3561
  __decorate([
3524
3562
  Input(),
3525
3563
  __metadata("design:type", Object)
@@ -3567,8 +3605,8 @@ var DocumentGridComponent = /** @class */ (function () {
3567
3605
  DocumentGridComponent = __decorate([
3568
3606
  Component({
3569
3607
  selector: 'document-grid',
3570
- template: "<div *ngIf=\"this.processType === 'RECEBIMENTO_WMS'; else processNotConfigured\">\n <p-panel>\n <p-header>\n <div class=\"buttons\">\n <div>\n <s-button\n label=\"{{'yms.int.wms_add_document' | translate}}\"\n priority=\"primary\"\n [model]=\"getActions()\"\n [auxiliary]=\"false\"\n [disabled]=\"!enableButtonIsClienteExterno\">\n </s-button>\n <s-button\n label=\"{{'yms.wms_view_button' | translate}}\"\n priority=\"secondary\"\n [auxiliary]=\"false\"\n [disabled]=\"!selection || selection.length !== 1\"\n (onClick)=\"view()\">\n </s-button>\n <s-button\n label=\"{{'yms.wms_delete_button' | translate}}\"\n priority=\"secondary\"\n [disabled]=\"!selection || !selection.length || !enableButtonIsClienteExterno\"\n (click)=\"onDelete()\">\n </s-button>\n </div>\n <s-button\n id=\"refresh-button\"\n priority=\"default\"\n iconClass=\"fa fa-refresh\"\n (onClick)=\"listDocuments(false)\"\n >\n </s-button>\n </div>\n </p-header>\n <div class=\"ui-g\">\n <div class=\"ui-g-12\" *ngIf=\"gridData && gridData.length; else emptyList\">\n <p-table #documentTable [value]=\"gridData\"\n [columns]=\"gridColumns\" dataKey=\"key\" [lazy]=\"true\" [scrollable]=\"true\" [resizableColumns]=\"true\"\n sortMode=\"multiple\" [paginator]=\"true\" [totalRecords]=\"documentTotalRecords\" rows=\"10\"\n [rowsPerPageOptions]=\"[10, 20, 50, 100]\" [(selection)]=\"selection\"\n [loading]=\"loading\">\n <ng-template pTemplate=\"colgroup\" let-columns>\n <colgroup>\n <col *ngFor=\"let col of columns\" [style.width]=\"col.width\"/>\n </colgroup>\n </ng-template>\n <ng-template pTemplate=\"header\" let-columns>\n <tr>\n <th id=\"checkbox\" class=\"table-checkbox\">\n <p-tableHeaderCheckbox></p-tableHeaderCheckbox>\n </th>\n <th id=\"col\" *ngFor=\"let col of columns\" [pSortableColumn]=\"col.field\" pResizableColumn>\n <div class=\"senior-header\">\n <span class=\"senior-header-title\">{{ col.header }}</span>\n <p-sortIcon [field]=\"col.field\"></p-sortIcon>\n </div>\n </th>\n </tr>\n </ng-template>\n <ng-template pTemplate=\"body\" let-rowData let-columns let-expanded=\"expanded\">\n <tr [pSelectableRow]=\"rowData\">\n <td class=\"table-checkbox\">\n <p-tableCheckbox [value]=\"rowData\"></p-tableCheckbox>\n </td>\n <td *ngFor=\"let column of getGridColumns()\" (click)=\"selection = [rowData]\">\n <span>{{ rowData[ column.field ] }}</span>\n </td>\n </tr>\n </ng-template>\n <ng-template pTemplate=\"paginatorright\">\n <span [translate]=\"'total_records'\" [translateParams]=\"{ value: documentTotalRecords }\"></span>\n </ng-template>\n </p-table> \n </div>\n </div>\n <register-document\n [wmsSystem]=\"wmsSystem\"\n [edit]=\"edit\"\n [viewDocument]=\"selection\"\n (document)=\"onChangeDocument($event)\"\n [(visible)]=\"visibleDocumentRegister\"\n [agenda]=\"agenda\">\n </register-document> \n <insert-key [wmsSystem]=\"wmsSystem\" \n (document)=\"onChangeDocument($event)\" [(visible)]=\"visibleInvoiceKey\"></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 <register-document\n [wmsSystem]=\"wmsSystem\"\n [edit]=\"edit\"\n [viewDocument]=\"selection\"\n (document)=\"onChangeDocument($event)\"\n [(visible)]=\"visibleDocumentRegister\"\n [agenda]=\"agenda\">\n </register-document> \n <insert-key [wmsSystem]=\"wmsSystem\" \n (document)=\"onChangeDocument($event)\" [(visible)]=\"visibleInvoiceKey\"></insert-key>\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 >\n </s-empty-state>\n </div>\n</ng-template>",
3571
- 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}"]
3608
+ template: "<div *ngIf=\"this.processType === 'RECEBIMENTO_WMS'; else processNotConfigured\">\n <p-panel>\n <p-header>\n <div class=\"buttons\">\n <div>\n <s-button\n label=\"{{'yms.int.wms_add_document' | translate}}\"\n priority=\"primary\"\n [model]=\"getActions()\"\n [auxiliary]=\"false\"\n [disabled]=\"!enableButtonIsClienteExterno\">\n </s-button>\n <s-button\n label=\"{{'yms.wms_view_button' | translate}}\"\n priority=\"secondary\"\n [auxiliary]=\"false\"\n [disabled]=\"!selection || selection.length !== 1\"\n (onClick)=\"view()\">\n </s-button>\n <s-button\n label=\"{{'yms.wms_delete_button' | translate}}\"\n priority=\"secondary\"\n [disabled]=\"!selection || !selection.length || !enableButtonIsClienteExterno\"\n (click)=\"onDelete()\">\n </s-button>\n </div>\n <s-button\n id=\"refresh-button\"\n priority=\"default\"\n iconClass=\"fa fa-refresh\"\n (onClick)=\"listDocuments(false)\"\n >\n </s-button>\n </div>\n </p-header>\n <div class=\"ui-g\">\n <div class=\"ui-g-12\" *ngIf=\"gridData && gridData.length; else emptyList\">\n <p-table #documentTable [value]=\"gridData\"\n [columns]=\"gridColumns\" dataKey=\"key\" [lazy]=\"true\" [scrollable]=\"true\" [resizableColumns]=\"true\"\n sortMode=\"multiple\" [paginator]=\"true\" [totalRecords]=\"documentTotalRecords\" rows=\"10\"\n [rowsPerPageOptions]=\"[10, 20, 50, 100]\" [(selection)]=\"selection\"\n [loading]=\"loading\">\n <ng-template pTemplate=\"colgroup\" let-columns>\n <colgroup>\n <col *ngFor=\"let col of columns\" [style.width]=\"col.width\"/>\n </colgroup>\n </ng-template>\n <ng-template pTemplate=\"header\" let-columns>\n <tr>\n <th id=\"checkbox\" class=\"table-checkbox\">\n <p-tableHeaderCheckbox></p-tableHeaderCheckbox>\n </th>\n <th id=\"col\" *ngFor=\"let col of columns\" [pSortableColumn]=\"col.field\" pResizableColumn>\n <div class=\"senior-header\">\n <span class=\"senior-header-title\">{{ col.header }}</span>\n <p-sortIcon [field]=\"col.field\"></p-sortIcon>\n </div>\n </th>\n </tr>\n </ng-template>\n <ng-template pTemplate=\"body\" let-rowData let-columns let-expanded=\"expanded\">\n <tr [pSelectableRow]=\"rowData\">\n <td class=\"table-checkbox\">\n <p-tableCheckbox [value]=\"rowData\"></p-tableCheckbox>\n </td>\n <td *ngIf=\"isWmsSeniorConnect()\" (click)=\"selection = [rowData]\">\n <span>{{rowData[\"key\"]}}</span>\n </td>\n <td *ngIf=\"isWmsSilt()\" (click)=\"selection = [rowData]\">\n <span>{{rowData[\"invoiceKey\"]}}</span>\n </td>\n <td *ngIf=\"isWmsWIS() || isWmsSilt()\" (click)=\"selection = [rowData]\">\n <span>{{rowData[\"invoiceNumber\"]}}</span>\n </td>\n <td *ngIf=\"isWmsWIS() || isWmsSilt()\" (click)=\"selection = [rowData]\">\n <span>{{rowData[\"invoiceSerialNumber\"]}}</span>\n </td>\n <td *ngIf=\"isWmsWIS() || isWmsSeniorConnect() || isWmsSilt()\" (click)=\"selection = [rowData]\">\n <span>{{rowData[\"partnerName\"]}}</span>\n </td>\n <td *ngIf=\"isWmsWIS() || isWmsSeniorConnect() || isWmsSilt()\" (click)=\"selection = [rowData]\">\n <span>{{rowData[\"partnerDocument\"]}}</span>\n </td>\n <td *ngIf=\"isWmsWIS() || isWmsSilt()\" (click)=\"selection = [rowData]\">\n <span>{{rowData[\"logistcUnitName\"]}}</span>\n </td>\n <td *ngIf=\"isWmsWIS() || isWmsSilt()\" (click)=\"selection = [rowData]\">\n <span>{{rowData[\"logistcUnitDocument\"]}}</span>\n </td>\n <td *ngIf=\"isWmsSilt()\" (click)=\"selection = [rowData]\">\n <span>{{rowData[\"ownerName\"]}}</span>\n </td>\n <td *ngIf=\"isWmsSilt()\" (click)=\"selection = [rowData]\">\n <span>{{rowData[\"ownerDocument\"]}}</span>\n </td>\n <td (click)=\"selection = [rowData]\">\n <p-dropdown\n inputId=\"invoiceCondition\"\n name=\"invoiceCondition\"\n [autoWidth]=\"false\"\n [options]=\"invoiceCondition\"\n appendTo=\"body\"\n [(ngModel)]=\"rowData.invoiceCondition\"\n (onChange)=\"disabled = false\">\n </p-dropdown>\n </td>\n </tr>\n </ng-template>\n <ng-template pTemplate=\"paginatorright\">\n <span [translate]=\"'total_records'\" [translateParams]=\"{ value: documentTotalRecords }\"></span>\n </ng-template>\n </p-table> \n </div>\n </div>\n <register-document\n [wmsSystem]=\"wmsSystem\"\n [edit]=\"edit\"\n [viewDocument]=\"selection\"\n (document)=\"onChangeDocument($event)\"\n [(visible)]=\"visibleDocumentRegister\"\n [agenda]=\"agenda\">\n </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>",
3609
+ 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}"]
3572
3610
  }),
3573
3611
  __metadata("design:paramtypes", [TranslateService,
3574
3612
  DocumentService,
@@ -3602,6 +3640,7 @@ var Document = /** @class */ (function () {
3602
3640
  "ownerDocument",
3603
3641
  "partnerName",
3604
3642
  "partnerDocument",
3643
+ "invoiceCondition",
3605
3644
  "notes",
3606
3645
  "code",
3607
3646
  "createdBy",
@@ -3622,13 +3661,20 @@ var Document = /** @class */ (function () {
3622
3661
  }());
3623
3662
 
3624
3663
  var RegisterDocumentComponent = /** @class */ (function () {
3625
- function RegisterDocumentComponent(fb, utils) {
3664
+ function RegisterDocumentComponent(fb, translate) {
3626
3665
  this.fb = fb;
3627
- this.utils = utils;
3666
+ this.translate = translate;
3628
3667
  this.document = new EventEmitter();
3629
3668
  this.visible = new EventEmitter();
3630
3669
  this.visibleChange = new EventEmitter();
3631
3670
  this.isSaveFormValid = false;
3671
+ this.invoiceCondition = [
3672
+ { label: this.translate.instant("yms.int.wms_grid_document_invoice_no_way"), value: null },
3673
+ { label: this.translate.instant("yms.int.wms_grid_document_invoice_condition_authorized"), value: InvoiceCondition.AUTHORIZED },
3674
+ { label: this.translate.instant("yms.int.wms_grid_document_invoice_condition_manual_authorized"), value: InvoiceCondition.MANUAL_AUTHORIZED },
3675
+ { label: this.translate.instant("yms.int.wms_grid_document_invoice_condition_partial_authorized"), value: InvoiceCondition.PARTIAL_AUTHORIZED },
3676
+ { label: this.translate.instant("yms.int.wms_grid_document_invoice_condition_devolucion"), value: InvoiceCondition.AUTHORIZED },
3677
+ ];
3632
3678
  }
3633
3679
  RegisterDocumentComponent.prototype.ngOnInit = function () {
3634
3680
  this.getFormGroup();
@@ -3666,6 +3712,7 @@ var RegisterDocumentComponent = /** @class */ (function () {
3666
3712
  this.formGroup.get('partnerDocument').setValue(document.partnerDocument);
3667
3713
  this.formGroup.get('ownerDocument').setValue(document.ownerDocument);
3668
3714
  this.formGroup.get('ownerName').setValue(document.ownerName);
3715
+ this.formGroup.get('invoiceCondition').setValue(document.invoiceCondition);
3669
3716
  };
3670
3717
  RegisterDocumentComponent.prototype.getFormGroup = function () {
3671
3718
  this.formGroup = this.fb.group({
@@ -3682,6 +3729,7 @@ var RegisterDocumentComponent = /** @class */ (function () {
3682
3729
  partnerDocument: [undefined],
3683
3730
  notes: [undefined],
3684
3731
  code: [undefined],
3732
+ invoiceCondition: [undefined],
3685
3733
  });
3686
3734
  };
3687
3735
  RegisterDocumentComponent.prototype.save = function () {
@@ -3732,10 +3780,9 @@ var RegisterDocumentComponent = /** @class */ (function () {
3732
3780
  RegisterDocumentComponent = __decorate([
3733
3781
  Component({
3734
3782
  selector: "register-document",
3735
- 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>\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>"
3783
+ 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\">\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>"
3736
3784
  }),
3737
- __metadata("design:paramtypes", [FormBuilder,
3738
- UtilsMessageService])
3785
+ __metadata("design:paramtypes", [FormBuilder, TranslateService])
3739
3786
  ], RegisterDocumentComponent);
3740
3787
  return RegisterDocumentComponent;
3741
3788
  }());
@@ -3755,7 +3802,8 @@ var RegisterDocumentModule = /** @class */ (function () {
3755
3802
  InputTextModule$1,
3756
3803
  ControlErrorsModule,
3757
3804
  InputTextareaModule,
3758
- ReactiveFormsModule
3805
+ ReactiveFormsModule,
3806
+ DropdownModule,
3759
3807
  ],
3760
3808
  exports: [RegisterDocumentComponent],
3761
3809
  declarations: [RegisterDocumentComponent],
@@ -3776,6 +3824,7 @@ var InsertKeyComponent = /** @class */ (function () {
3776
3824
  this.isLoading = false;
3777
3825
  }
3778
3826
  InsertKeyComponent.prototype.ngOnInit = function () {
3827
+ var _this = this;
3779
3828
  this.formGroup = this.formBuilder.group({
3780
3829
  key: [undefined],
3781
3830
  purchaseOrder: [undefined],
@@ -3783,6 +3832,9 @@ var InsertKeyComponent = /** @class */ (function () {
3783
3832
  invoiceSerie: [undefined],
3784
3833
  partnerDocument: [undefined]
3785
3834
  });
3835
+ this.formGroup.get('key').valueChanges.subscribe(function (nf) {
3836
+ _this.validateKeyDetails(nf);
3837
+ });
3786
3838
  };
3787
3839
  InsertKeyComponent.prototype.isWmsWis = function () {
3788
3840
  return this.wmsSystem === WmsSystem.WIS;
@@ -3828,6 +3880,38 @@ var InsertKeyComponent = /** @class */ (function () {
3828
3880
  _this.formGroup.reset();
3829
3881
  });
3830
3882
  };
3883
+ InsertKeyComponent.prototype.validateKeyDetails = function (nf) {
3884
+ if (!nf) {
3885
+ this.keyErrorMessage = null;
3886
+ this.setValuesOfKey(undefined, undefined, undefined);
3887
+ return;
3888
+ }
3889
+ var nfLength = 44;
3890
+ if (nf.length === nfLength) {
3891
+ this.keyErrorMessage = null;
3892
+ this.extractKeyDetails(nf);
3893
+ }
3894
+ else {
3895
+ this.keyErrorMessage = "yms.int.wms_error_key_message";
3896
+ }
3897
+ };
3898
+ InsertKeyComponent.prototype.extractKeyDetails = function (nf) {
3899
+ var startCnpj = 6;
3900
+ var endCnpj = 20;
3901
+ var cnpj = nf.substring(startCnpj, endCnpj);
3902
+ var startSerie = 22;
3903
+ var endSerie = 25;
3904
+ var serie = nf.substring(startSerie, endSerie);
3905
+ var startInvoice = 25;
3906
+ var endInvoice = 34;
3907
+ var invoice = nf.substring(startInvoice, endInvoice);
3908
+ this.setValuesOfKey(invoice, serie, cnpj);
3909
+ };
3910
+ InsertKeyComponent.prototype.setValuesOfKey = function (invoiceNumber, invoiceSerie, partnerDocument) {
3911
+ this.formGroup.get('invoiceNumber').setValue(invoiceNumber);
3912
+ this.formGroup.get('invoiceSerie').setValue(invoiceSerie);
3913
+ this.formGroup.get('partnerDocument').setValue(partnerDocument);
3914
+ };
3831
3915
  InsertKeyComponent.prototype.cancel = function () {
3832
3916
  this.visibleChange.emit(false);
3833
3917
  };
@@ -3853,8 +3937,8 @@ var InsertKeyComponent = /** @class */ (function () {
3853
3937
  InsertKeyComponent = __decorate([
3854
3938
  Component({
3855
3939
  selector: "insert-key",
3856
- template: "<form [formGroup]=\"formGroup\">\n <p-dialog [(visible)]=\"visible\" [modal]=\"true\" \n [draggable]=\"false\" (visibleChange)=\"cancel()\" (onShow)=\"onDialogShow()\">\n <p-header>{{'yms.int.wms_search_document' | translate}} {{ wmsSystem }}</p-header>\n <s-loading-state [loading]=\"isLoading\">\n <div class=\"flex py-2 justify-content-center spacing-bottom\" \n *ngIf=\"!isWmsSeniorConnect() && !isWmsWis()\">\n <label for=\"key\">{{'yms.int.wms_insert_key_label' | translate}}</label>\n <input id=\"key\" class=\"size-input\" pInputText type=\"text\" formControlName=\"key\">\n </div>\n <div class=\"flex py-2 justify-content-center spacing-bottom\" *ngIf=\"isWmsSeniorConnect()\">\n <label for=\"purchaseOrder\">{{'yms.int.wms_purchaseOrder' | translate}} </label>\n <input id=\"purchaseOrder\" class=\"size-input\" pInputText type=\"text\" formControlName=\"purchaseOrder\">\n </div>\n <div class=\"flex py-2 justify-content-center spacing-bottom\" *ngIf=\"isWmsWis()\">\n <label for=\"invoiceNumber\">{{'yms.int.wms_invoice_number' | translate}}</label>\n <input id=\"invoiceNumber\" class=\"size-input\" pInputText type=\"text\" formControlName=\"invoiceNumber\">\n </div>\n <div class=\"flex py-2 justify-content-center spacing-bottom\" *ngIf=\"isWmsWis()\">\n <label for=\"invoiceSerie\">{{'yms.int.wms_invoice_serie' | translate}}</label>\n <input id=\"invoiceSerie\" class=\"size-input\" pInputText type=\"text\" formControlName=\"invoiceSerie\">\n </div>\n <div class=\"flex py-2 justify-content-center spacing-bottom\" *ngIf=\"isWmsWis()\">\n <label for=\"partnerDocument\">{{'yms.int.wms_partner_document' | translate}}</label>\n <input id=\"partnerDocument\" class=\"size-input\" pInputText type=\"text\" formControlName=\"partnerDocument\">\n </div>\n <div class=\"separator\"></div>\n <div class=\"spacing-top\">\n <s-button pButton label=\"{{'yms.int.wms_search' | translate}}\" (click)=\"add()\"></s-button>\n <s-button\n type=\"button\"\n class=\"ui-button-link\"\n pButton label=\"{{'cancel' | translate}}\"\n (click)=\"cancel()\">\n </s-button>\n </div>\n </s-loading-state>\n </p-dialog>\n\n</form>\n",
3857
- styles: [".spacing-top{margin-top:10px}.spacing-bottom{margin-bottom:10px}.separator{width:100%;margin:5px 0;height:1px;background-color:#ccc}.size-input{width:480px}"]
3940
+ template: "<form [formGroup]=\"formGroup\">\n <p-dialog [(visible)]=\"visible\" [modal]=\"true\" \n [draggable]=\"false\" (visibleChange)=\"cancel()\" (onShow)=\"onDialogShow()\">\n <p-header>{{'yms.int.wms_search_document' | translate}} {{ wmsSystem }}</p-header>\n <s-loading-state [loading]=\"isLoading\">\n <div class=\"flex py-2 justify-content-center spacing-bottom\"\n *ngIf=\"!isWmsSeniorConnect()\">\n <label for=\"key\">{{'yms.int.wms_insert_key_label' | translate}}</label>\n <input id=\"key\" class=\"size-input\" pInputText type=\"text\" formControlName=\"key\">\n <span class=\"error-message\">{{keyErrorMessage | translate}}</span>\n </div>\n <div class=\"flex py-2 justify-content-center spacing-bottom\" *ngIf=\"isWmsSeniorConnect()\">\n <label for=\"purchaseOrder\">{{'yms.int.wms_purchaseOrder' | translate}} </label>\n <input id=\"purchaseOrder\" class=\"size-input\" pInputText type=\"text\" formControlName=\"purchaseOrder\">\n </div>\n <div class=\"flex py-2 justify-content-center spacing-bottom\" *ngIf=\"isWmsWis()\">\n <label for=\"invoiceNumber\">{{'yms.int.wms_invoice_number' | translate}}</label>\n <input id=\"invoiceNumber\" class=\"size-input\" pInputText type=\"text\" formControlName=\"invoiceNumber\">\n </div>\n <div class=\"flex py-2 justify-content-center spacing-bottom\" *ngIf=\"isWmsWis()\">\n <label for=\"invoiceSerie\">{{'yms.int.wms_invoice_serie' | translate}}</label>\n <input id=\"invoiceSerie\" class=\"size-input\" pInputText type=\"text\" formControlName=\"invoiceSerie\">\n </div>\n <div class=\"flex py-2 justify-content-center spacing-bottom\" *ngIf=\"isWmsWis()\">\n <label for=\"partnerDocument\">{{'yms.int.wms_partner_document' | translate}}</label>\n <input id=\"partnerDocument\" class=\"size-input\" pInputText type=\"text\" formControlName=\"partnerDocument\">\n </div>\n <div class=\"separator\"></div>\n <div class=\"spacing-top\">\n <s-button pButton label=\"{{'yms.int.wms_search' | translate}}\" (click)=\"add()\"></s-button>\n <s-button\n type=\"button\"\n class=\"ui-button-link\"\n pButton label=\"{{'cancel' | translate}}\"\n (click)=\"cancel()\">\n </s-button>\n </div>\n </s-loading-state>\n </p-dialog>\n\n</form>\n",
3941
+ styles: [".spacing-top{margin-top:10px}.spacing-bottom{margin-bottom:10px}.separator{width:100%;margin:5px 0;height:1px;background-color:#ccc}.size-input{width:480px}.error-message{color:#c13018;display:flex}"]
3858
3942
  }),
3859
3943
  __metadata("design:paramtypes", [FormBuilder,
3860
3944
  DocumentService,
@@ -3902,7 +3986,9 @@ var DocumentGridModule = /** @class */ (function () {
3902
3986
  InsertKeyModule,
3903
3987
  ButtonModule$1,
3904
3988
  ComponentsModule,
3905
- EmptyStateModule
3989
+ EmptyStateModule,
3990
+ DropdownModule,
3991
+ FormsModule
3906
3992
  ],
3907
3993
  })
3908
3994
  ], DocumentGridModule);