From 420900fec1641d9faab51dac1ab8a3b1906ad154 Mon Sep 17 00:00:00 2001 From: Cyril Joseph Date: Fri, 15 Aug 2025 22:32:25 -0300 Subject: [PATCH] feedback updates --- src/app/carnet/edit/edit-carnet.component.ts | 6 ++--- .../core/services/carnet/carnet.service.ts | 24 +++++++++++++++++-- 2 files changed, 25 insertions(+), 5 deletions(-) diff --git a/src/app/carnet/edit/edit-carnet.component.ts b/src/app/carnet/edit/edit-carnet.component.ts index babb5ce..143072f 100644 --- a/src/app/carnet/edit/edit-carnet.component.ts +++ b/src/app/carnet/edit/edit-carnet.component.ts @@ -57,12 +57,12 @@ export class EditCarnetComponent { // set application type based on the route url const urlSegments = this.route.snapshot.url.map(segment => segment.path); - if (urlSegments.includes('duplicate-carnet')) { + if (urlSegments.includes('duplicate-carnet') || urlSegments.includes('process-duplicate-carnet')) { this.applicationType = 'duplicate'; - } else if (urlSegments.includes('extend-carnet')) { + } else if (urlSegments.includes('extend-carnet') || urlSegments.includes('process-extend-carnet')) { this.applicationType = 'extend'; } - else if (urlSegments.includes('additional-sets')) { + else if (urlSegments.includes('additional-sets') || urlSegments.includes('process-additional-sets')) { this.applicationType = 'additional'; } else { this.applicationType = 'edit'; diff --git a/src/app/core/services/carnet/carnet.service.ts b/src/app/core/services/carnet/carnet.service.ts index 7e7a44d..a39e4aa 100644 --- a/src/app/core/services/carnet/carnet.service.ts +++ b/src/app/core/services/carnet/carnet.service.ts @@ -79,7 +79,9 @@ export class CarnetService { P_SPID: this.userService.getUserSpid(), P_HEADERID: headerid } - return this.http.post(`${this.apiUrl}/${this.apiDb}/PrintGL`, data); + return this.http.post(`${this.apiUrl}/${this.apiDb}/PrintGL`, data, { + responseType: 'blob', // Important: Set responseType to 'blob' + }); } duplicateCarnet(carnetNumber: string): Observable { @@ -87,7 +89,9 @@ export class CarnetService { P_USERID: this.userService.getUser(), P_CARNETNO: carnetNumber } - return this.http.patch(`${this.apiUrl}/${this.apiDb}/DuplicateCarnet`, data); + return this.http.patch(`${this.apiUrl}/${this.apiDb}/DuplicateCarnet`, data, { + responseType: 'blob', // Important: Set responseType to 'blob' + }); } extendCarnet(carnetNumber: string): Observable { @@ -114,4 +118,20 @@ export class CarnetService { } return this.http.patch(`${this.apiUrl}/${this.apiDb}/CopyCarnet`, data); } + + resetCarnet(headerid: number): Observable { + const data = { + P_USERID: this.userService.getUser(), + P_HEADERID: headerid + } + return this.http.patch(`${this.apiUrl}/${this.apiDb}/ResetCarnet`, data); + } + + voidCarnet(headerid: number): Observable { + const data = { + P_USERID: this.userService.getUser(), + P_HEADERID: headerid + } + return this.http.patch(`${this.apiUrl}/${this.apiDb}/VoidCarnet`, data); + } }