@seniorsistemas/yms-integration 1.33.0 → 1.34.0

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.
@@ -4090,42 +4090,30 @@ var DocumentListComponent = /** @class */ (function (_super) {
4090
4090
  _this.getColumns = [];
4091
4091
  _this.documents = [];
4092
4092
  _this.labels = [];
4093
+ _this.selected = [];
4094
+ _this.gridLoading = true;
4095
+ _this.ngUnsubscribe = new Subject();
4093
4096
  return _this;
4094
4097
  }
4095
- DocumentListComponent.prototype.ngOnInit = function () {
4096
- this.getSystemIntegration();
4097
- };
4098
- DocumentListComponent.prototype.getSystemIntegration = function () {
4099
- var _this = this;
4100
- this.documentService.getSystemIntegration().subscribe(function (system) {
4101
- _this.wmsSystem = system.system;
4102
- _this.getDocumentBySchedulingId();
4103
- });
4104
- };
4105
- DocumentListComponent.prototype.getDocumentBySchedulingId = function () {
4106
- var _this = this;
4107
- this.documentService.list({
4108
- filterQuery: "schedulingId eq '" + this.agenda.id + "'"
4109
- }).subscribe(function (contents) {
4110
- if (contents.totalElements > 0) {
4111
- _this.documents = contents.contents;
4112
- _this.getColumns = _this.getColumnLabels();
4113
- }
4114
- });
4115
- };
4116
4098
  DocumentListComponent.prototype.getColumnLabels = function () {
4117
4099
  if (this.isWmsWIS()) {
4118
- return __spread(this.getLabelsInvoice());
4100
+ return __spread(this.getLabelsInvoice(), [
4101
+ { field: "partnerName", label: 'yms.int.wms_register_document_invoice_partnerName' },
4102
+ { field: "partnerDocument", label: 'yms.int.wms_register_document_invoice_partnerDocument' },
4103
+ { field: "code", label: 'yms.int.wms_register_document_invoice_code' },
4104
+ { field: "invoiceCondition", label: 'yms.int.wms_register_document_invoice_condition' },
4105
+ { field: "notes", label: 'yms.int.wms_register_document_invoice_notes' },
4106
+ ]);
4119
4107
  }
4120
4108
  if (this.isWmsSeniorConnect()) {
4121
4109
  return [
4122
- { label: 'yms.int.wms_purchaseOrder' },
4123
- { label: 'yms.int.wms_register_document_partner_name' },
4124
- { label: 'yms.int.wms_register_document_partner_document' }
4110
+ { field: "key", label: 'yms.int.wms_purchaseOrder' },
4111
+ { field: "partnerName", label: 'yms.int.wms_register_document_invoice_partnerName' },
4112
+ { field: "partnerDocument", label: 'yms.int.wms_register_document_invoice_partnerDocument' },
4125
4113
  ];
4126
4114
  }
4127
4115
  return __spread([
4128
- { label: 'yms.int.wms_register_document_invoice_key' }
4116
+ { field: "invoiceKey", label: 'yms.int.wms_register_document_invoice_key' }
4129
4117
  ], this.getLabelsInvoice());
4130
4118
  };
4131
4119
  DocumentListComponent.prototype.isWmsSeniorConnect = function () {
@@ -4136,10 +4124,40 @@ var DocumentListComponent = /** @class */ (function (_super) {
4136
4124
  };
4137
4125
  DocumentListComponent.prototype.getLabelsInvoice = function () {
4138
4126
  return [
4139
- { label: 'yms.int.wms_register_document_invoice_number' },
4140
- { label: 'yms.int.wms_register_document_invoice_serial_number' }
4127
+ { field: "invoiceNumber", label: 'yms.int.wms_register_document_invoice_number' },
4128
+ { field: "invoiceSerialNumber", label: 'yms.int.wms_register_document_invoice_serial_number' },
4141
4129
  ];
4142
4130
  };
4131
+ DocumentListComponent.prototype.getInvoiceConditionTranslation = function (invoiceCondition) {
4132
+ return invoiceCondition ? "yms.int.wms_document_invoice_condition_" + invoiceCondition : 'N/A';
4133
+ };
4134
+ DocumentListComponent.prototype.updateGridData = function (event) {
4135
+ var _this = this;
4136
+ this.documentService.getSystemIntegration().subscribe(function (system) {
4137
+ _this.wmsSystem = system.system;
4138
+ _this.searchDocument(event);
4139
+ });
4140
+ };
4141
+ DocumentListComponent.prototype.searchDocument = function (event) {
4142
+ var _this = this;
4143
+ var size = event.rows;
4144
+ var page = event.first / size;
4145
+ var sort = event.multiSortMeta;
4146
+ this.gridLoading = true;
4147
+ this.documentService.list({ page: page, size: size, sort: sort,
4148
+ filterQuery: "schedulingId eq '" + this.agenda.id + "'"
4149
+ })
4150
+ .pipe(takeUntil(this.ngUnsubscribe), finalize(function () {
4151
+ _this.gridLoading = false;
4152
+ }))
4153
+ .subscribe(function (contents) {
4154
+ if (contents.totalElements > 0) {
4155
+ _this.documents = contents.contents;
4156
+ _this.getColumns = _this.getColumnLabels();
4157
+ _this.gridTotalRecords = contents.totalElements;
4158
+ }
4159
+ });
4160
+ };
4143
4161
  __decorate([
4144
4162
  Input(),
4145
4163
  __metadata("design:type", Object)
@@ -4150,7 +4168,8 @@ var DocumentListComponent = /** @class */ (function (_super) {
4150
4168
  ], DocumentListComponent.prototype, "wmsSystem", void 0);
4151
4169
  DocumentListComponent = __decorate([
4152
4170
  Component({
4153
- template: "<div> \n <p-table [value]=\"documents\">\n <ng-template pTemplate=\"header\">\n <tr>\n <th id=\"columns\" *ngFor=\"let column of getColumns\">\n <div class=\"senior-header\">\n <span class=\"senior-header-title\">{{ column.label | translate }}</span>\n </div>\n </th>\n </tr>\n </ng-template>\n <ng-template let-rowData pTemplate=\"body\">\n <tr *ngIf=\"isWmsWIS()\">\n <td id=\"\">{{rowData?.invoiceNumber}}</td>\n <td id=\"\">{{rowData?.invoiceSerialNumber}}</td>\n </tr>\n <tr *ngIf=\"isWmsSeniorConnect()\">\n <td id=\"\">{{rowData?.key}}</td>\n <td id=\"\">{{rowData?.partnerName}}</td>\n <td id=\"\">{{rowData?.partnerDocument}}</td>\n </tr>\n <tr *ngIf=\"!isWmsWIS() && !isWmsSeniorConnect()\">\n <td id=\"\">{{rowData?.invoiceKey}}</td>\n <td id=\"\">{{rowData?.invoiceNumber}}</td>\n <td id=\"\">{{rowData?.invoiceSerialNumber}}</td>\n </tr>\n </ng-template>\n </p-table>\n</div>"
4171
+ 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?.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>",
4172
+ styles: [".table-col-width{width:250px}"]
4154
4173
  }),
4155
4174
  __metadata("design:paramtypes", [DocumentService])
4156
4175
  ], DocumentListComponent);