@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.
@@ -4149,42 +4149,30 @@
4149
4149
  _this.getColumns = [];
4150
4150
  _this.documents = [];
4151
4151
  _this.labels = [];
4152
+ _this.selected = [];
4153
+ _this.gridLoading = true;
4154
+ _this.ngUnsubscribe = new rxjs.Subject();
4152
4155
  return _this;
4153
4156
  }
4154
- DocumentListComponent.prototype.ngOnInit = function () {
4155
- this.getSystemIntegration();
4156
- };
4157
- DocumentListComponent.prototype.getSystemIntegration = function () {
4158
- var _this = this;
4159
- this.documentService.getSystemIntegration().subscribe(function (system) {
4160
- _this.wmsSystem = system.system;
4161
- _this.getDocumentBySchedulingId();
4162
- });
4163
- };
4164
- DocumentListComponent.prototype.getDocumentBySchedulingId = function () {
4165
- var _this = this;
4166
- this.documentService.list({
4167
- filterQuery: "schedulingId eq '" + this.agenda.id + "'"
4168
- }).subscribe(function (contents) {
4169
- if (contents.totalElements > 0) {
4170
- _this.documents = contents.contents;
4171
- _this.getColumns = _this.getColumnLabels();
4172
- }
4173
- });
4174
- };
4175
4157
  DocumentListComponent.prototype.getColumnLabels = function () {
4176
4158
  if (this.isWmsWIS()) {
4177
- return __spread(this.getLabelsInvoice());
4159
+ return __spread(this.getLabelsInvoice(), [
4160
+ { field: "partnerName", label: 'yms.int.wms_register_document_invoice_partnerName' },
4161
+ { field: "partnerDocument", label: 'yms.int.wms_register_document_invoice_partnerDocument' },
4162
+ { field: "code", label: 'yms.int.wms_register_document_invoice_code' },
4163
+ { field: "invoiceCondition", label: 'yms.int.wms_register_document_invoice_condition' },
4164
+ { field: "notes", label: 'yms.int.wms_register_document_invoice_notes' },
4165
+ ]);
4178
4166
  }
4179
4167
  if (this.isWmsSeniorConnect()) {
4180
4168
  return [
4181
- { label: 'yms.int.wms_purchaseOrder' },
4182
- { label: 'yms.int.wms_register_document_partner_name' },
4183
- { label: 'yms.int.wms_register_document_partner_document' }
4169
+ { field: "key", label: 'yms.int.wms_purchaseOrder' },
4170
+ { field: "partnerName", label: 'yms.int.wms_register_document_invoice_partnerName' },
4171
+ { field: "partnerDocument", label: 'yms.int.wms_register_document_invoice_partnerDocument' },
4184
4172
  ];
4185
4173
  }
4186
4174
  return __spread([
4187
- { label: 'yms.int.wms_register_document_invoice_key' }
4175
+ { field: "invoiceKey", label: 'yms.int.wms_register_document_invoice_key' }
4188
4176
  ], this.getLabelsInvoice());
4189
4177
  };
4190
4178
  DocumentListComponent.prototype.isWmsSeniorConnect = function () {
@@ -4195,10 +4183,40 @@
4195
4183
  };
4196
4184
  DocumentListComponent.prototype.getLabelsInvoice = function () {
4197
4185
  return [
4198
- { label: 'yms.int.wms_register_document_invoice_number' },
4199
- { label: 'yms.int.wms_register_document_invoice_serial_number' }
4186
+ { field: "invoiceNumber", label: 'yms.int.wms_register_document_invoice_number' },
4187
+ { field: "invoiceSerialNumber", label: 'yms.int.wms_register_document_invoice_serial_number' },
4200
4188
  ];
4201
4189
  };
4190
+ DocumentListComponent.prototype.getInvoiceConditionTranslation = function (invoiceCondition) {
4191
+ return invoiceCondition ? "yms.int.wms_document_invoice_condition_" + invoiceCondition : 'N/A';
4192
+ };
4193
+ DocumentListComponent.prototype.updateGridData = function (event) {
4194
+ var _this = this;
4195
+ this.documentService.getSystemIntegration().subscribe(function (system) {
4196
+ _this.wmsSystem = system.system;
4197
+ _this.searchDocument(event);
4198
+ });
4199
+ };
4200
+ DocumentListComponent.prototype.searchDocument = function (event) {
4201
+ var _this = this;
4202
+ var size = event.rows;
4203
+ var page = event.first / size;
4204
+ var sort = event.multiSortMeta;
4205
+ this.gridLoading = true;
4206
+ this.documentService.list({ page: page, size: size, sort: sort,
4207
+ filterQuery: "schedulingId eq '" + this.agenda.id + "'"
4208
+ })
4209
+ .pipe(operators.takeUntil(this.ngUnsubscribe), operators.finalize(function () {
4210
+ _this.gridLoading = false;
4211
+ }))
4212
+ .subscribe(function (contents) {
4213
+ if (contents.totalElements > 0) {
4214
+ _this.documents = contents.contents;
4215
+ _this.getColumns = _this.getColumnLabels();
4216
+ _this.gridTotalRecords = contents.totalElements;
4217
+ }
4218
+ });
4219
+ };
4202
4220
  __decorate([
4203
4221
  core.Input(),
4204
4222
  __metadata("design:type", Object)
@@ -4209,7 +4227,8 @@
4209
4227
  ], DocumentListComponent.prototype, "wmsSystem", void 0);
4210
4228
  DocumentListComponent = __decorate([
4211
4229
  core.Component({
4212
- 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>"
4230
+ 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>",
4231
+ styles: [".table-col-width{width:250px}"]
4213
4232
  }),
4214
4233
  __metadata("design:paramtypes", [DocumentService])
4215
4234
  ], DocumentListComponent);