@seniorsistemas/yms-integration 1.35.0 → 1.36.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.
- package/bundles/seniorsistemas-yms-integration.umd.js +71 -21
- package/bundles/seniorsistemas-yms-integration.umd.js.map +1 -1
- package/bundles/seniorsistemas-yms-integration.umd.min.js +1 -1
- package/bundles/seniorsistemas-yms-integration.umd.min.js.map +1 -1
- package/esm2015/src/wms/components/document-grid/document-grid.component.js +3 -9
- package/esm2015/src/wms/components/document-grid/register-document/register-document.component.js +3 -10
- package/esm2015/src/wms/components/document-list/document-list.component.js +56 -5
- package/esm2015/src/wms/components/document-list/document-list.module.js +8 -3
- package/esm2015/src/wms/components/utils/invoice-conditions.js +12 -0
- package/esm5/src/wms/components/document-grid/document-grid.component.js +3 -9
- package/esm5/src/wms/components/document-grid/register-document/register-document.component.js +3 -10
- package/esm5/src/wms/components/document-list/document-list.component.js +58 -5
- package/esm5/src/wms/components/document-list/document-list.module.js +8 -3
- package/esm5/src/wms/components/utils/invoice-conditions.js +12 -0
- package/fesm2015/seniorsistemas-yms-integration.js +69 -21
- package/fesm2015/seniorsistemas-yms-integration.js.map +1 -1
- package/fesm5/seniorsistemas-yms-integration.js +71 -21
- package/fesm5/seniorsistemas-yms-integration.js.map +1 -1
- package/package.json +1 -1
- package/seniorsistemas-yms-integration.metadata.json +1 -1
- package/src/wms/components/document-grid/document-grid.component.d.ts +4 -4
- package/src/wms/components/document-grid/register-document/register-document.component.d.ts +1 -1
- package/src/wms/components/document-list/document-list.component.d.ts +19 -1
- package/src/wms/components/utils/invoice-conditions.d.ts +6 -0
|
@@ -3297,6 +3297,17 @@ var InvoiceCondition;
|
|
|
3297
3297
|
InvoiceCondition["REJECTED"] = "REJECTED";
|
|
3298
3298
|
})(InvoiceCondition || (InvoiceCondition = {}));
|
|
3299
3299
|
|
|
3300
|
+
function getInvoiceConditions(translate) {
|
|
3301
|
+
return [
|
|
3302
|
+
{ label: translate.instant("yms.int.wms_grid_document_invoice_no_way"), value: null },
|
|
3303
|
+
{ label: translate.instant("yms.int.wms_grid_document_invoice_condition_authorized"), value: InvoiceCondition.AUTHORIZED },
|
|
3304
|
+
{ label: translate.instant("yms.int.wms_grid_document_invoice_condition_manual_authorized"), value: InvoiceCondition.MANUAL_AUTHORIZED },
|
|
3305
|
+
{ label: translate.instant("yms.int.wms_grid_document_invoice_condition_partial_authorized"), value: InvoiceCondition.PARTIAL_AUTHORIZED },
|
|
3306
|
+
{ label: translate.instant("yms.int.wms_grid_document_invoice_condition_devolution"), value: InvoiceCondition.DEVOLUTION },
|
|
3307
|
+
{ label: translate.instant("yms.int.wms_grid_document_invoice_condition_rejected"), value: InvoiceCondition.REJECTED },
|
|
3308
|
+
];
|
|
3309
|
+
}
|
|
3310
|
+
|
|
3300
3311
|
var DocumentGridComponent = /** @class */ (function () {
|
|
3301
3312
|
function DocumentGridComponent(translate, documentService, confirmationService, integrationService, agendaService, utils) {
|
|
3302
3313
|
this.translate = translate;
|
|
@@ -3308,16 +3319,9 @@ var DocumentGridComponent = /** @class */ (function () {
|
|
|
3308
3319
|
this.viewDocument = new EventEmitter();
|
|
3309
3320
|
this.gridData = [];
|
|
3310
3321
|
this.enableButtonIsClienteExterno = true;
|
|
3322
|
+
this.invoiceConditions = getInvoiceConditions(this.translate);
|
|
3311
3323
|
this.summary = "yms.int.wms_saved_document_message_title";
|
|
3312
3324
|
this.ngUnsubscribe = new Subject();
|
|
3313
|
-
this.invoiceConditions = [
|
|
3314
|
-
{ label: this.translate.instant("yms.int.wms_grid_document_invoice_no_way"), value: null },
|
|
3315
|
-
{ label: this.translate.instant("yms.int.wms_grid_document_invoice_condition_authorized"), value: InvoiceCondition.AUTHORIZED },
|
|
3316
|
-
{ label: this.translate.instant("yms.int.wms_grid_document_invoice_condition_manual_authorized"), value: InvoiceCondition.MANUAL_AUTHORIZED },
|
|
3317
|
-
{ label: this.translate.instant("yms.int.wms_grid_document_invoice_condition_partial_authorized"), value: InvoiceCondition.PARTIAL_AUTHORIZED },
|
|
3318
|
-
{ label: this.translate.instant("yms.int.wms_grid_document_invoice_condition_devolution"), value: InvoiceCondition.DEVOLUTION },
|
|
3319
|
-
{ label: this.translate.instant("yms.int.wms_grid_document_invoice_condition_rejected"), value: InvoiceCondition.REJECTED },
|
|
3320
|
-
];
|
|
3321
3325
|
this.selection = [];
|
|
3322
3326
|
}
|
|
3323
3327
|
DocumentGridComponent.prototype.getFilteredInvoiceConditions = function (invoiceConditions) {
|
|
@@ -3701,14 +3705,7 @@ var RegisterDocumentComponent = /** @class */ (function () {
|
|
|
3701
3705
|
this.visible = new EventEmitter();
|
|
3702
3706
|
this.visibleChange = new EventEmitter();
|
|
3703
3707
|
this.isSaveFormValid = false;
|
|
3704
|
-
this.invoiceCondition =
|
|
3705
|
-
{ label: this.translate.instant("yms.int.wms_grid_document_invoice_no_way"), value: null },
|
|
3706
|
-
{ label: this.translate.instant("yms.int.wms_grid_document_invoice_condition_authorized"), value: InvoiceCondition.AUTHORIZED },
|
|
3707
|
-
{ label: this.translate.instant("yms.int.wms_grid_document_invoice_condition_manual_authorized"), value: InvoiceCondition.MANUAL_AUTHORIZED },
|
|
3708
|
-
{ label: this.translate.instant("yms.int.wms_grid_document_invoice_condition_partial_authorized"), value: InvoiceCondition.PARTIAL_AUTHORIZED },
|
|
3709
|
-
{ label: this.translate.instant("yms.int.wms_grid_document_invoice_condition_devolution"), value: InvoiceCondition.DEVOLUTION },
|
|
3710
|
-
{ label: this.translate.instant("yms.int.wms_grid_document_invoice_condition_rejected"), value: InvoiceCondition.REJECTED },
|
|
3711
|
-
];
|
|
3708
|
+
this.invoiceCondition = getInvoiceConditions(this.translate);
|
|
3712
3709
|
}
|
|
3713
3710
|
RegisterDocumentComponent.prototype.ngOnInit = function () {
|
|
3714
3711
|
this.getFormGroup();
|
|
@@ -4171,15 +4168,27 @@ var DocumentListDescritor = /** @class */ (function () {
|
|
|
4171
4168
|
}());
|
|
4172
4169
|
var DocumentListComponent = /** @class */ (function (_super) {
|
|
4173
4170
|
__extends(DocumentListComponent, _super);
|
|
4174
|
-
function DocumentListComponent(documentService) {
|
|
4171
|
+
function DocumentListComponent(documentService, translate, utils) {
|
|
4175
4172
|
var _this = _super.call(this) || this;
|
|
4176
4173
|
_this.documentService = documentService;
|
|
4174
|
+
_this.translate = translate;
|
|
4175
|
+
_this.utils = utils;
|
|
4177
4176
|
_this.getColumns = [];
|
|
4178
4177
|
_this.documents = [];
|
|
4178
|
+
_this.amendedDocuments = [];
|
|
4179
4179
|
_this.labels = [];
|
|
4180
4180
|
_this.selected = [];
|
|
4181
4181
|
_this.gridLoading = true;
|
|
4182
4182
|
_this.ngUnsubscribe = new Subject();
|
|
4183
|
+
_this.invoiceConditions = [
|
|
4184
|
+
{ label: _this.translate.instant("yms.int.wms_grid_document_invoice_no_way"), value: null },
|
|
4185
|
+
{ label: _this.translate.instant("yms.int.wms_grid_document_invoice_condition_authorized"), value: InvoiceCondition.AUTHORIZED },
|
|
4186
|
+
{ label: _this.translate.instant("yms.int.wms_grid_document_invoice_condition_manual_authorized"), value: InvoiceCondition.MANUAL_AUTHORIZED },
|
|
4187
|
+
{ label: _this.translate.instant("yms.int.wms_grid_document_invoice_condition_partial_authorized"), value: InvoiceCondition.PARTIAL_AUTHORIZED },
|
|
4188
|
+
{ label: _this.translate.instant("yms.int.wms_grid_document_invoice_condition_devolution"), value: InvoiceCondition.DEVOLUTION },
|
|
4189
|
+
{ label: _this.translate.instant("yms.int.wms_grid_document_invoice_condition_rejected"), value: InvoiceCondition.REJECTED },
|
|
4190
|
+
];
|
|
4191
|
+
_this.isAuthorized = function (condition) { return (condition === InvoiceCondition.AUTHORIZED); };
|
|
4183
4192
|
return _this;
|
|
4184
4193
|
}
|
|
4185
4194
|
DocumentListComponent.prototype.getColumnLabels = function () {
|
|
@@ -4226,6 +4235,42 @@ var DocumentListComponent = /** @class */ (function (_super) {
|
|
|
4226
4235
|
_this.searchDocument(event);
|
|
4227
4236
|
});
|
|
4228
4237
|
};
|
|
4238
|
+
DocumentListComponent.prototype.getFilteredInvoiceConditions = function (invoiceConditions) {
|
|
4239
|
+
if (invoiceConditions === InvoiceCondition.AUTHORIZED) {
|
|
4240
|
+
return this.invoiceConditions.filter(function (cond) { return cond.value === InvoiceCondition.AUTHORIZED; });
|
|
4241
|
+
}
|
|
4242
|
+
else {
|
|
4243
|
+
return this.invoiceConditions.filter(function (cond) { return cond.value !== InvoiceCondition.AUTHORIZED; });
|
|
4244
|
+
}
|
|
4245
|
+
};
|
|
4246
|
+
DocumentListComponent.prototype.onInvoiceConditionChange = function (event, document) {
|
|
4247
|
+
var _this = this;
|
|
4248
|
+
this.disabled = true;
|
|
4249
|
+
document.invoiceCondition = event.value;
|
|
4250
|
+
if (this.amendedDocuments.length > 0) {
|
|
4251
|
+
this.amendedDocuments.forEach(function (doc) {
|
|
4252
|
+
if (doc.id === document.id) {
|
|
4253
|
+
doc.invoiceCondition = event.value;
|
|
4254
|
+
}
|
|
4255
|
+
else {
|
|
4256
|
+
_this.amendedDocuments.push(document);
|
|
4257
|
+
}
|
|
4258
|
+
});
|
|
4259
|
+
}
|
|
4260
|
+
else {
|
|
4261
|
+
this.amendedDocuments.push(document);
|
|
4262
|
+
}
|
|
4263
|
+
};
|
|
4264
|
+
DocumentListComponent.prototype.save = function () {
|
|
4265
|
+
var _this = this;
|
|
4266
|
+
this.amendedDocuments.forEach(function (document) {
|
|
4267
|
+
_this.documentService.update(document.id, document).subscribe(function () {
|
|
4268
|
+
_this.utils.message("success", "yms.int.wms_saved_document_message_title", "saved_message_content");
|
|
4269
|
+
_this.disabled = false;
|
|
4270
|
+
});
|
|
4271
|
+
});
|
|
4272
|
+
this.amendedDocuments = [];
|
|
4273
|
+
};
|
|
4229
4274
|
DocumentListComponent.prototype.searchDocument = function (event) {
|
|
4230
4275
|
var _this = this;
|
|
4231
4276
|
var size = event.rows;
|
|
@@ -4256,10 +4301,12 @@ var DocumentListComponent = /** @class */ (function (_super) {
|
|
|
4256
4301
|
], DocumentListComponent.prototype, "wmsSystem", void 0);
|
|
4257
4302
|
DocumentListComponent = __decorate([
|
|
4258
4303
|
Component({
|
|
4259
|
-
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
|
|
4260
|
-
styles: [".table-col-width{width:250px}"]
|
|
4304
|
+
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]=\"getFilteredInvoiceConditions(rowData?.invoiceCondition)\"\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>",
|
|
4305
|
+
styles: [".table-col-width{width:250px}.button-save{margin:5px 0}"]
|
|
4261
4306
|
}),
|
|
4262
|
-
__metadata("design:paramtypes", [DocumentService
|
|
4307
|
+
__metadata("design:paramtypes", [DocumentService,
|
|
4308
|
+
TranslateService,
|
|
4309
|
+
UtilsMessageService])
|
|
4263
4310
|
], DocumentListComponent);
|
|
4264
4311
|
return DocumentListComponent;
|
|
4265
4312
|
}(DocumentListDescritor));
|
|
@@ -4275,7 +4322,10 @@ var DocumentListModule = /** @class */ (function () {
|
|
|
4275
4322
|
CommonModule,
|
|
4276
4323
|
TranslateModule,
|
|
4277
4324
|
LoadingStateModule,
|
|
4278
|
-
TableModule
|
|
4325
|
+
TableModule,
|
|
4326
|
+
DropdownModule,
|
|
4327
|
+
ButtonModule,
|
|
4328
|
+
FormsModule
|
|
4279
4329
|
],
|
|
4280
4330
|
declarations: [DocumentListComponent],
|
|
4281
4331
|
entryComponents: [DocumentListComponent],
|