many updates :-)

This commit is contained in:
Gerhard Scheikl
2026-05-08 10:40:19 +02:00
parent 5b2aa5d62b
commit 770c6fd16a
16 changed files with 876 additions and 151 deletions
@@ -57,6 +57,7 @@ export interface RawLineItem {
quantity: number;
originalUnitPriceSet: { shopMoney: RawMoney };
taxLines: RawTaxLine[];
imageUrl: string | null;
}
export interface RawTaxLine {
@@ -119,6 +120,7 @@ const QUERY = `#graphql
sku
quantity
originalUnitPriceSet { shopMoney { amount currencyCode } }
image { url altText }
taxLines {
title
rate
@@ -219,7 +221,17 @@ export async function loadOrderForInvoice(
totalTaxSet: order.totalTaxSet,
totalPriceSet: order.totalPriceSet,
taxLines: order.taxLines || [],
lineItems: (order.lineItems?.edges || []).map((e) => e.node),
lineItems: (order.lineItems?.edges || []).map((e) => {
const node = e.node as unknown as RawLineItem & { image?: { url: string | null } | null };
return {
title: node.title,
sku: node.sku,
quantity: node.quantity,
originalUnitPriceSet: node.originalUnitPriceSet,
taxLines: node.taxLines,
imageUrl: node.image?.url ?? null,
};
}),
purchasingEntity: { company: purchasingCompany },
};
}