diff --git a/shop/components/invoice-pdf.tsx b/shop/components/invoice-pdf.tsx index 36c5151..8172900 100644 --- a/shop/components/invoice-pdf.tsx +++ b/shop/components/invoice-pdf.tsx @@ -171,44 +171,35 @@ export const InvoicePDF = ({ order, orderSnapshot, customer }: any) => { Datum: {new Date(order.created_at || Date.now()).toLocaleDateString('de-DE')} - - - Beschreibung - Preis (netto) - - + {Object.entries(groupedItems).map(([deviceName, devItems], groupIdx) => ( - - - Gerät: {deviceName} + + + + Gerät: {deviceName} + {devItems.map((item: any, idx: number) => ( - - - - {item.product_name} ({item.category_name}) - - - - {formattedPrice(item.base_price)} {item.billing_interval === 'one_time' ? 'einmalig' : 'mtl.'} - - + + + + {item.product_name} ({item.category_name}) + + + {formattedPrice(item.base_price)} {item.billing_interval === 'one_time' ? 'einmalig' : 'mtl.'} + {item.selected_modules?.map((mod: any, mIdx: number) => { const qty = mod.quantity || 1; const price = mod.total_price ?? (mod.price * qty); return ( - - - - + {mod.module_name} {qty > 1 ? `(x${qty})` : ''} - - - - - +{formattedPrice(price)} mtl. - - + + + + {mod.module_name} {qty > 1 ? `(x${qty})` : ''} + + + +{formattedPrice(price)} mtl. + ); })}