@seniorsistemas/yms-integration 1.34.0-f92e36ef-86fe-4fc7-9c1b-d5eb149d27e7 → 1.35.0-edb4b1f3-35b3-4e2e-822e-0ece0140f6fb

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 +63 -21
  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 +3 -9
  6. package/esm2015/src/wms/components/document-grid/register-document/register-document.component.js +3 -10
  7. package/esm2015/src/wms/components/document-list/document-list.component.js +48 -5
  8. package/esm2015/src/wms/components/document-list/document-list.module.js +8 -3
  9. package/esm2015/src/wms/components/utils/invoice-conditions.js +12 -0
  10. package/esm5/src/wms/components/document-grid/document-grid.component.js +3 -9
  11. package/esm5/src/wms/components/document-grid/register-document/register-document.component.js +3 -10
  12. package/esm5/src/wms/components/document-list/document-list.component.js +50 -5
  13. package/esm5/src/wms/components/document-list/document-list.module.js +8 -3
  14. package/esm5/src/wms/components/utils/invoice-conditions.js +12 -0
  15. package/fesm2015/seniorsistemas-yms-integration.js +61 -21
  16. package/fesm2015/seniorsistemas-yms-integration.js.map +1 -1
  17. package/fesm5/seniorsistemas-yms-integration.js +63 -21
  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 +4 -4
  22. package/src/wms/components/document-grid/register-document/register-document.component.d.ts +1 -1
  23. package/src/wms/components/document-list/document-list.component.d.ts +15 -1
  24. package/src/wms/components/utils/invoice-conditions.d.ts +6 -0
@@ -3075,6 +3075,17 @@ var InvoiceCondition;
3075
3075
  InvoiceCondition["REJECTED"] = "REJECTED";
3076
3076
  })(InvoiceCondition || (InvoiceCondition = {}));
3077
3077
 
3078
+ function getInvoiceConditions(translate) {
3079
+ return [
3080
+ { label: translate.instant("yms.int.wms_grid_document_invoice_no_way"), value: null },
3081
+ { label: translate.instant("yms.int.wms_grid_document_invoice_condition_authorized"), value: InvoiceCondition.AUTHORIZED },
3082
+ { label: translate.instant("yms.int.wms_grid_document_invoice_condition_manual_authorized"), value: InvoiceCondition.MANUAL_AUTHORIZED },
3083
+ { label: translate.instant("yms.int.wms_grid_document_invoice_condition_partial_authorized"), value: InvoiceCondition.PARTIAL_AUTHORIZED },
3084
+ { label: translate.instant("yms.int.wms_grid_document_invoice_condition_devolution"), value: InvoiceCondition.DEVOLUTION },
3085
+ { label: translate.instant("yms.int.wms_grid_document_invoice_condition_rejected"), value: InvoiceCondition.REJECTED },
3086
+ ];
3087
+ }
3088
+
3078
3089
  let DocumentGridComponent = class DocumentGridComponent {
3079
3090
  constructor(translate, documentService, confirmationService, integrationService, agendaService, utils) {
3080
3091
  this.translate = translate;
@@ -3086,16 +3097,9 @@ let DocumentGridComponent = class DocumentGridComponent {
3086
3097
  this.viewDocument = new EventEmitter();
3087
3098
  this.gridData = [];
3088
3099
  this.enableButtonIsClienteExterno = true;
3100
+ this.invoiceConditions = getInvoiceConditions(this.translate);
3089
3101
  this.summary = "yms.int.wms_saved_document_message_title";
3090
3102
  this.ngUnsubscribe = new Subject();
3091
- this.invoiceConditions = [
3092
- { label: this.translate.instant("yms.int.wms_grid_document_invoice_no_way"), value: null },
3093
- { label: this.translate.instant("yms.int.wms_grid_document_invoice_condition_authorized"), value: InvoiceCondition.AUTHORIZED },
3094
- { label: this.translate.instant("yms.int.wms_grid_document_invoice_condition_manual_authorized"), value: InvoiceCondition.MANUAL_AUTHORIZED },
3095
- { label: this.translate.instant("yms.int.wms_grid_document_invoice_condition_partial_authorized"), value: InvoiceCondition.PARTIAL_AUTHORIZED },
3096
- { label: this.translate.instant("yms.int.wms_grid_document_invoice_condition_devolution"), value: InvoiceCondition.DEVOLUTION },
3097
- { label: this.translate.instant("yms.int.wms_grid_document_invoice_condition_rejected"), value: InvoiceCondition.REJECTED },
3098
- ];
3099
3103
  this.selection = [];
3100
3104
  }
3101
3105
  getFilteredInvoiceConditions(invoiceConditions) {
@@ -3470,14 +3474,7 @@ let RegisterDocumentComponent = class RegisterDocumentComponent {
3470
3474
  this.visible = new EventEmitter();
3471
3475
  this.visibleChange = new EventEmitter();
3472
3476
  this.isSaveFormValid = false;
3473
- this.invoiceCondition = [
3474
- { label: this.translate.instant("yms.int.wms_grid_document_invoice_no_way"), value: null },
3475
- { label: this.translate.instant("yms.int.wms_grid_document_invoice_condition_authorized"), value: InvoiceCondition.AUTHORIZED },
3476
- { label: this.translate.instant("yms.int.wms_grid_document_invoice_condition_manual_authorized"), value: InvoiceCondition.MANUAL_AUTHORIZED },
3477
- { label: this.translate.instant("yms.int.wms_grid_document_invoice_condition_partial_authorized"), value: InvoiceCondition.PARTIAL_AUTHORIZED },
3478
- { label: this.translate.instant("yms.int.wms_grid_document_invoice_condition_devolution"), value: InvoiceCondition.DEVOLUTION },
3479
- { label: this.translate.instant("yms.int.wms_grid_document_invoice_condition_rejected"), value: InvoiceCondition.REJECTED },
3480
- ];
3477
+ this.invoiceCondition = getInvoiceConditions(this.translate);
3481
3478
  }
3482
3479
  ngOnInit() {
3483
3480
  this.getFormGroup();
@@ -3916,15 +3913,27 @@ DocumentListDescritor = __decorate([
3916
3913
  })
3917
3914
  ], DocumentListDescritor);
3918
3915
  let DocumentListComponent = class DocumentListComponent extends DocumentListDescritor {
3919
- constructor(documentService) {
3916
+ constructor(documentService, translate, utils) {
3920
3917
  super();
3921
3918
  this.documentService = documentService;
3919
+ this.translate = translate;
3920
+ this.utils = utils;
3922
3921
  this.getColumns = [];
3923
3922
  this.documents = [];
3923
+ this.amendedDocuments = [];
3924
3924
  this.labels = [];
3925
3925
  this.selected = [];
3926
3926
  this.gridLoading = true;
3927
3927
  this.ngUnsubscribe = new Subject();
3928
+ this.invoiceConditions = [
3929
+ { label: this.translate.instant("yms.int.wms_grid_document_invoice_no_way"), value: null },
3930
+ { label: this.translate.instant("yms.int.wms_grid_document_invoice_condition_authorized"), value: InvoiceCondition.AUTHORIZED },
3931
+ { label: this.translate.instant("yms.int.wms_grid_document_invoice_condition_manual_authorized"), value: InvoiceCondition.MANUAL_AUTHORIZED },
3932
+ { label: this.translate.instant("yms.int.wms_grid_document_invoice_condition_partial_authorized"), value: InvoiceCondition.PARTIAL_AUTHORIZED },
3933
+ { label: this.translate.instant("yms.int.wms_grid_document_invoice_condition_devolution"), value: InvoiceCondition.DEVOLUTION },
3934
+ { label: this.translate.instant("yms.int.wms_grid_document_invoice_condition_rejected"), value: InvoiceCondition.REJECTED },
3935
+ ];
3936
+ this.isAuthorized = (condition) => (condition === InvoiceCondition.AUTHORIZED);
3928
3937
  }
3929
3938
  getColumnLabels() {
3930
3939
  if (this.isWmsWIS()) {
@@ -3971,6 +3980,32 @@ let DocumentListComponent = class DocumentListComponent extends DocumentListDesc
3971
3980
  this.searchDocument(event);
3972
3981
  });
3973
3982
  }
3983
+ onInvoiceConditionChange(event, document) {
3984
+ this.disabled = true;
3985
+ document.invoiceCondition = event.value;
3986
+ if (this.amendedDocuments.length > 0) {
3987
+ this.amendedDocuments.forEach((doc) => {
3988
+ if (doc.id === document.id) {
3989
+ doc.invoiceCondition = event.value;
3990
+ }
3991
+ else {
3992
+ this.amendedDocuments.push(document);
3993
+ }
3994
+ });
3995
+ }
3996
+ else {
3997
+ this.amendedDocuments.push(document);
3998
+ }
3999
+ }
4000
+ save() {
4001
+ this.amendedDocuments.forEach((document) => {
4002
+ this.documentService.update(document.id, document).subscribe(() => {
4003
+ this.utils.message("success", "yms.int.wms_saved_document_message_title", "saved_message_content");
4004
+ this.disabled = false;
4005
+ });
4006
+ });
4007
+ this.amendedDocuments = [];
4008
+ }
3974
4009
  searchDocument(event) {
3975
4010
  const size = event.rows;
3976
4011
  const page = event.first / size;
@@ -4001,10 +4036,12 @@ __decorate([
4001
4036
  ], DocumentListComponent.prototype, "wmsSystem", void 0);
4002
4037
  DocumentListComponent = __decorate([
4003
4038
  Component({
4004
- 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 {{ getInvoiceConditionTranslation(rowData?.invoiceCondition) | translate }}\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>\n</div>",
4005
- styles: [".table-col-width{width:250px}"]
4039
+ 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]=\"invoiceConditions\"\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>",
4040
+ styles: [".table-col-width{width:250px}.button-save{margin:5px 0}"]
4006
4041
  }),
4007
- __metadata("design:paramtypes", [DocumentService])
4042
+ __metadata("design:paramtypes", [DocumentService,
4043
+ TranslateService,
4044
+ UtilsMessageService])
4008
4045
  ], DocumentListComponent);
4009
4046
 
4010
4047
  let DocumentListModule = class DocumentListModule {
@@ -4019,7 +4056,10 @@ DocumentListModule = __decorate([
4019
4056
  CommonModule,
4020
4057
  TranslateModule,
4021
4058
  LoadingStateModule,
4022
- TableModule
4059
+ TableModule,
4060
+ DropdownModule,
4061
+ ButtonModule,
4062
+ FormsModule
4023
4063
  ],
4024
4064
  declarations: [DocumentListComponent],
4025
4065
  entryComponents: [DocumentListComponent],