@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
|
@@ -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,40 @@ let DocumentListComponent = class DocumentListComponent extends DocumentListDesc
|
|
|
3971
3980
|
this.searchDocument(event);
|
|
3972
3981
|
});
|
|
3973
3982
|
}
|
|
3983
|
+
getFilteredInvoiceConditions(invoiceConditions) {
|
|
3984
|
+
if (invoiceConditions === InvoiceCondition.AUTHORIZED) {
|
|
3985
|
+
return this.invoiceConditions.filter(cond => cond.value === InvoiceCondition.AUTHORIZED);
|
|
3986
|
+
}
|
|
3987
|
+
else {
|
|
3988
|
+
return this.invoiceConditions.filter(cond => cond.value !== InvoiceCondition.AUTHORIZED);
|
|
3989
|
+
}
|
|
3990
|
+
}
|
|
3991
|
+
onInvoiceConditionChange(event, document) {
|
|
3992
|
+
this.disabled = true;
|
|
3993
|
+
document.invoiceCondition = event.value;
|
|
3994
|
+
if (this.amendedDocuments.length > 0) {
|
|
3995
|
+
this.amendedDocuments.forEach((doc) => {
|
|
3996
|
+
if (doc.id === document.id) {
|
|
3997
|
+
doc.invoiceCondition = event.value;
|
|
3998
|
+
}
|
|
3999
|
+
else {
|
|
4000
|
+
this.amendedDocuments.push(document);
|
|
4001
|
+
}
|
|
4002
|
+
});
|
|
4003
|
+
}
|
|
4004
|
+
else {
|
|
4005
|
+
this.amendedDocuments.push(document);
|
|
4006
|
+
}
|
|
4007
|
+
}
|
|
4008
|
+
save() {
|
|
4009
|
+
this.amendedDocuments.forEach((document) => {
|
|
4010
|
+
this.documentService.update(document.id, document).subscribe(() => {
|
|
4011
|
+
this.utils.message("success", "yms.int.wms_saved_document_message_title", "saved_message_content");
|
|
4012
|
+
this.disabled = false;
|
|
4013
|
+
});
|
|
4014
|
+
});
|
|
4015
|
+
this.amendedDocuments = [];
|
|
4016
|
+
}
|
|
3974
4017
|
searchDocument(event) {
|
|
3975
4018
|
const size = event.rows;
|
|
3976
4019
|
const page = event.first / size;
|
|
@@ -4001,10 +4044,12 @@ __decorate([
|
|
|
4001
4044
|
], DocumentListComponent.prototype, "wmsSystem", void 0);
|
|
4002
4045
|
DocumentListComponent = __decorate([
|
|
4003
4046
|
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
|
|
4005
|
-
styles: [".table-col-width{width:250px}"]
|
|
4047
|
+
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>",
|
|
4048
|
+
styles: [".table-col-width{width:250px}.button-save{margin:5px 0}"]
|
|
4006
4049
|
}),
|
|
4007
|
-
__metadata("design:paramtypes", [DocumentService
|
|
4050
|
+
__metadata("design:paramtypes", [DocumentService,
|
|
4051
|
+
TranslateService,
|
|
4052
|
+
UtilsMessageService])
|
|
4008
4053
|
], DocumentListComponent);
|
|
4009
4054
|
|
|
4010
4055
|
let DocumentListModule = class DocumentListModule {
|
|
@@ -4019,7 +4064,10 @@ DocumentListModule = __decorate([
|
|
|
4019
4064
|
CommonModule,
|
|
4020
4065
|
TranslateModule,
|
|
4021
4066
|
LoadingStateModule,
|
|
4022
|
-
TableModule
|
|
4067
|
+
TableModule,
|
|
4068
|
+
DropdownModule,
|
|
4069
|
+
ButtonModule,
|
|
4070
|
+
FormsModule
|
|
4023
4071
|
],
|
|
4024
4072
|
declarations: [DocumentListComponent],
|
|
4025
4073
|
entryComponents: [DocumentListComponent],
|