mirror of
https://dev.azure.com/hugendubel/ISA/_git/ISA-Frontend
synced 2025-12-31 09:37:15 +01:00
Kulturpass Drucken Fix
This commit is contained in:
@@ -27,7 +27,8 @@ export class PrintShippingNoteActionHandler extends ActionHandler<OrderItemsCont
|
||||
printerType: 'Label',
|
||||
print: async (printer) => {
|
||||
try {
|
||||
for (const group of groupBy(data?.receipts, (receipt) => receipt?.buyer?.buyerNumber)) {
|
||||
const receipts = data?.receipts?.filter((r) => r?.receiptType & 1);
|
||||
for (const group of groupBy(receipts, (receipt) => receipt?.buyer?.buyerNumber)) {
|
||||
await this.domainPrinterService.printShippingNote({ printer, receipts: group?.items?.map((r) => r?.id) }).toPromise();
|
||||
}
|
||||
return {
|
||||
|
||||
@@ -27,7 +27,8 @@ export class PrintSmallamountinvoiceActionHandler extends ActionHandler<OrderIte
|
||||
printerType: 'Label',
|
||||
print: async (printer) => {
|
||||
try {
|
||||
for (const group of groupBy(data?.receipts, (receipt) => receipt?.buyer?.buyerNumber)) {
|
||||
const receipts = data?.receipts?.filter((r) => r?.receiptType & 128);
|
||||
for (const group of groupBy(receipts, (receipt) => receipt?.buyer?.buyerNumber)) {
|
||||
await this.omsPrintService
|
||||
.OMSPrintKleinbetragsrechnung({
|
||||
data: group?.items?.map((r) => r?.id),
|
||||
|
||||
@@ -175,7 +175,7 @@ export class SharedGoodsInOutOrderDetailsItemComponent extends ComponentStore<Sh
|
||||
switchMap(([done, orderItem]) =>
|
||||
this._domainReceiptService
|
||||
.getReceipts({
|
||||
receiptType: 65 as ReceiptType,
|
||||
receiptType: (1 + 64 + 128) as ReceiptType,
|
||||
ids: [orderItem.orderItemSubsetId],
|
||||
eagerLoading: 1,
|
||||
})
|
||||
@@ -184,7 +184,6 @@ export class SharedGoodsInOutOrderDetailsItemComponent extends ComponentStore<Sh
|
||||
(res) => {
|
||||
const receipts = res.result.map((r) => r.item3?.data).filter((f) => !!f);
|
||||
this.receipts = receipts;
|
||||
|
||||
if (typeof done === 'function') {
|
||||
done?.(receipts);
|
||||
}
|
||||
|
||||
@@ -177,16 +177,15 @@ export class SharedGoodsInOutOrderDetailsComponent extends SharedGoodsInOutOrder
|
||||
return;
|
||||
}
|
||||
let receipts: ReceiptDTO[] = [];
|
||||
if (action.command.includes('PRINT_SHIPPINGNOTE') || action.command.includes('PRINT_SMALLAMOUNTINVOICE')) {
|
||||
if (action.command.includes('PRINT_SHIPPINGNOTE') || action.command === 'PRINT_SMALLAMOUNTINVOICE') {
|
||||
const receiptsPromise = this.orderDetailsItemComponents.toArray().map(
|
||||
(timeComponent) =>
|
||||
(itemCmp) =>
|
||||
new Promise<ReceiptDTO[]>((resolve) => {
|
||||
timeComponent.loadReceipts((r) => resolve(r));
|
||||
itemCmp.loadReceipts((r) => resolve(r));
|
||||
})
|
||||
);
|
||||
|
||||
receipts = await Promise.all(receiptsPromise).then((r) => r.reduce((acc, val) => acc.concat(val), []));
|
||||
|
||||
receipts = unionBy(receipts, 'id');
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user