mirror of
https://dev.azure.com/hugendubel/ISA/_git/ISA-Frontend
synced 2025-12-28 22:42:11 +01:00
Merged PR 1844: feat(oms-data-access, oms-shared-task-list): add Tolino return receipt print support and improve task action typing
feat(oms-data-access, oms-shared-task-list): add Tolino return receipt print support and improve task action typing - Add `PrintTolinoReturnReceiptService` to `oms-data-access` for printing Tolino return receipts via office printers, including direct integration with the OMS print API. - Extend `TaskActionType` to include `receiptItemId` for more precise task identification and action handling. - Update `return-task-list-item` and `return-task-list` components in `oms-shared-task-list` to support the new Tolino print action, including UI and logic for triggering the print dialog. - Refactor print-related service and test code to use the new print API signature and improve type safety. - Add and update unit tests to cover new print flows and ensure correct integration. Ref: #5121
This commit is contained in:
committed by
Lorenz Hilpert
parent
bcd3c800b1
commit
543de57190
@@ -11,6 +11,7 @@ import { ResponseArgs } from '../models/response-args';
|
||||
import { PrintRequestOfIEnumerableOfLong } from '../models/print-request-of-ienumerable-of-long';
|
||||
import { PrintRequestOfIEnumerableOfDisplayOrderDTO } from '../models/print-request-of-ienumerable-of-display-order-dto';
|
||||
import { PrintRequestOfIEnumerableOfPriceQRCodeDTO } from '../models/print-request-of-ienumerable-of-price-qrcode-dto';
|
||||
import { PrintRequestOfLong } from '../models/print-request-of-long';
|
||||
@Injectable({
|
||||
providedIn: 'root',
|
||||
})
|
||||
@@ -25,6 +26,8 @@ class OMSPrintService extends __BaseService {
|
||||
static readonly OMSPrintReturnReceiptPath = '/print/return-receipt';
|
||||
static readonly OMSPrintKleinbetragsrechnungPath = '/print/kleinbetragsrechnung';
|
||||
static readonly OMSPrintKleinbetragsrechnungPdfPath = '/print/kleinbetragsrechnung/{receiptId}/pdf';
|
||||
static readonly OMSPrintTolinoRetourenscheinPath = '/print/tolino-retourenschein';
|
||||
static readonly OMSPrintTolinoRetourenscheinPdfPath = '/print/tolino-retourenschein/{receipItemtId}/pdf';
|
||||
|
||||
constructor(
|
||||
config: __Configuration,
|
||||
@@ -392,6 +395,78 @@ class OMSPrintService extends __BaseService {
|
||||
__map(_r => _r.body as Blob)
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Tolino Retourenschein
|
||||
* @param data Retourenbelegpostion PKs
|
||||
*/
|
||||
OMSPrintTolinoRetourenscheinResponse(data: PrintRequestOfLong): __Observable<__StrictHttpResponse<ResponseArgs>> {
|
||||
let __params = this.newParams();
|
||||
let __headers = new HttpHeaders();
|
||||
let __body: any = null;
|
||||
__body = data;
|
||||
let req = new HttpRequest<any>(
|
||||
'POST',
|
||||
this.rootUrl + `/print/tolino-retourenschein`,
|
||||
__body,
|
||||
{
|
||||
headers: __headers,
|
||||
params: __params,
|
||||
responseType: 'json'
|
||||
});
|
||||
|
||||
return this.http.request<any>(req).pipe(
|
||||
__filter(_r => _r instanceof HttpResponse),
|
||||
__map((_r) => {
|
||||
return _r as __StrictHttpResponse<ResponseArgs>;
|
||||
})
|
||||
);
|
||||
}
|
||||
/**
|
||||
* Tolino Retourenschein
|
||||
* @param data Retourenbelegpostion PKs
|
||||
*/
|
||||
OMSPrintTolinoRetourenschein(data: PrintRequestOfLong): __Observable<ResponseArgs> {
|
||||
return this.OMSPrintTolinoRetourenscheinResponse(data).pipe(
|
||||
__map(_r => _r.body as ResponseArgs)
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Tolino Retourenschein PDF
|
||||
* @param receipItemtId Retourenbelegposition PK
|
||||
*/
|
||||
OMSPrintTolinoRetourenscheinPdfResponse(receipItemtId: number): __Observable<__StrictHttpResponse<Blob>> {
|
||||
let __params = this.newParams();
|
||||
let __headers = new HttpHeaders();
|
||||
let __body: any = null;
|
||||
|
||||
let req = new HttpRequest<any>(
|
||||
'GET',
|
||||
this.rootUrl + `/print/tolino-retourenschein/${encodeURIComponent(String(receipItemtId))}/pdf`,
|
||||
__body,
|
||||
{
|
||||
headers: __headers,
|
||||
params: __params,
|
||||
responseType: 'blob'
|
||||
});
|
||||
|
||||
return this.http.request<any>(req).pipe(
|
||||
__filter(_r => _r instanceof HttpResponse),
|
||||
__map((_r) => {
|
||||
return _r as __StrictHttpResponse<Blob>;
|
||||
})
|
||||
);
|
||||
}
|
||||
/**
|
||||
* Tolino Retourenschein PDF
|
||||
* @param receipItemtId Retourenbelegposition PK
|
||||
*/
|
||||
OMSPrintTolinoRetourenscheinPdf(receipItemtId: number): __Observable<Blob> {
|
||||
return this.OMSPrintTolinoRetourenscheinPdfResponse(receipItemtId).pipe(
|
||||
__map(_r => _r.body as Blob)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
module OMSPrintService {
|
||||
|
||||
Reference in New Issue
Block a user