feat: rename invoice (RE-) to order confirmation (BE-) throughout the application
All checks were successful
Staging Build / build (push) Successful in 2m42s
All checks were successful
Staging Build / build (push) Successful in 2m42s
This commit is contained in:
@@ -7,8 +7,8 @@ export default async function AdminOrdersPage() {
|
|||||||
<div className="p-8 space-y-6">
|
<div className="p-8 space-y-6">
|
||||||
<div className="flex justify-between items-center">
|
<div className="flex justify-between items-center">
|
||||||
<div>
|
<div>
|
||||||
<h1 className="text-3xl font-bold tracking-tight text-gradient">Bestellungen & Rechnungen</h1>
|
<h1 className="text-3xl font-bold tracking-tight text-gradient">Bestellungen</h1>
|
||||||
<p className="text-slate-400">Verwalten Sie alle Kundenbestellungen und greifen Sie auf generierte PDFs zu.</p>
|
<p className="text-slate-400">Verwalten Sie alle Kundenbestellungen und greifen Sie auf generierte Bestellbestätigungen zu.</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
@@ -136,7 +136,7 @@ export default async function MyOrdersPage() {
|
|||||||
<>
|
<>
|
||||||
<Button variant="ghost" size="sm" asChild className="text-xs text-slate-400 hover:text-white">
|
<Button variant="ghost" size="sm" asChild className="text-xs text-slate-400 hover:text-white">
|
||||||
<a href={o.pdf_url} target="_blank" rel="noopener noreferrer">
|
<a href={o.pdf_url} target="_blank" rel="noopener noreferrer">
|
||||||
<ExternalLink className="w-3 h-3 mr-1" /> Rechnung ansehen
|
<ExternalLink className="w-3 h-3 mr-1" /> Bestellbestätigung ansehen
|
||||||
</a>
|
</a>
|
||||||
</Button>
|
</Button>
|
||||||
<Button variant="ghost" size="sm" asChild className="text-xs text-slate-400 hover:text-white">
|
<Button variant="ghost" size="sm" asChild className="text-xs text-slate-400 hover:text-white">
|
||||||
|
|||||||
@@ -124,7 +124,7 @@ export default async function OrderSuccessPage({
|
|||||||
<div className="flex gap-2 pt-2">
|
<div className="flex gap-2 pt-2">
|
||||||
<Button variant="outline" size="sm" asChild className="border-white/10 hover:bg-white/10">
|
<Button variant="outline" size="sm" asChild className="border-white/10 hover:bg-white/10">
|
||||||
<a href={o.pdf_url} target="_blank" rel="noopener noreferrer">
|
<a href={o.pdf_url} target="_blank" rel="noopener noreferrer">
|
||||||
<ExternalLink className="w-4 h-4 mr-2" /> Rechnung ansehen
|
<ExternalLink className="w-4 h-4 mr-2" /> Bestellbestätigung ansehen
|
||||||
</a>
|
</a>
|
||||||
</Button>
|
</Button>
|
||||||
<Button variant="secondary" size="sm" asChild>
|
<Button variant="secondary" size="sm" asChild>
|
||||||
|
|||||||
@@ -182,7 +182,7 @@ export function OrdersTable({ initialOrders }: OrdersTableProps) {
|
|||||||
</Button>
|
</Button>
|
||||||
</div>
|
</div>
|
||||||
) : (
|
) : (
|
||||||
<span className="text-xs text-slate-500 italic">Keine Rechnung</span>
|
<span className="text-xs text-slate-500 italic">Keine Bestätigung</span>
|
||||||
)}
|
)}
|
||||||
</TableCell>
|
</TableCell>
|
||||||
</TableRow>
|
</TableRow>
|
||||||
|
|||||||
@@ -117,10 +117,10 @@ export const InvoicePDF = ({ order, orderSnapshot, customer }: any) => {
|
|||||||
</View>
|
</View>
|
||||||
</View>
|
</View>
|
||||||
|
|
||||||
<Text style={styles.title}>Bestellbestätigung / Rechnung</Text>
|
<Text style={styles.title}>Bestellbestätigung</Text>
|
||||||
|
|
||||||
<View style={styles.section}>
|
<View style={styles.section}>
|
||||||
<Text style={styles.label}>Rechnungsempfänger</Text>
|
<Text style={styles.label}>Besteller / Kunde</Text>
|
||||||
<Text>{customer.company_name}</Text>
|
<Text>{customer.company_name}</Text>
|
||||||
<Text>{customer.first_name} {customer.last_name}</Text>
|
<Text>{customer.first_name} {customer.last_name}</Text>
|
||||||
<Text>{customer.address}</Text>
|
<Text>{customer.address}</Text>
|
||||||
|
|||||||
@@ -14,13 +14,13 @@ import { getProducts, getCategories } from '@/lib/actions/products'
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Erzeugt eine menschenlesbare, nicht-sequenzielle Bestellnummer.
|
* Erzeugt eine menschenlesbare, nicht-sequenzielle Bestellnummer.
|
||||||
* Format: RE-YYYY-NNNNN (z.B. RE-2026-84731)
|
* Format: BE-YYYY-NNNNN (z.B. BE-2026-84731)
|
||||||
* Kein Rückschluss auf Gesamtanzahl der Bestellungen möglich.
|
* Kein Rückschluss auf Gesamtanzahl der Bestellungen möglich.
|
||||||
*/
|
*/
|
||||||
function generateOrderNumber(): string {
|
function generateOrderNumber(): string {
|
||||||
const year = new Date().getFullYear()
|
const year = new Date().getFullYear()
|
||||||
const rand = Math.floor(10000 + Math.random() * 90000) // 5-stellig, niemals < 10000
|
const rand = Math.floor(10000 + Math.random() * 90000) // 5-stellig, niemals < 10000
|
||||||
return `RE-${year}-${rand}`
|
return `BE-${year}-${rand}`
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -203,7 +203,7 @@ export async function submitOrder(params: {
|
|||||||
)
|
)
|
||||||
|
|
||||||
// 6. PDF in Supabase Storage hochladen
|
// 6. PDF in Supabase Storage hochladen
|
||||||
const fileName = `invoice_${order.id}.pdf`
|
const fileName = `bestellbestaetigung_${order.id}.pdf`
|
||||||
const { error: uploadError } = await supabase
|
const { error: uploadError } = await supabase
|
||||||
.storage
|
.storage
|
||||||
.from('invoices')
|
.from('invoices')
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ ALTER TABLE public.orders
|
|||||||
|
|
||||||
-- Update existing orders to have a unique order_number
|
-- Update existing orders to have a unique order_number
|
||||||
UPDATE public.orders
|
UPDATE public.orders
|
||||||
SET order_number = 'RE-' || EXTRACT(YEAR FROM created_at)::text || '-' || floor(10000 + random() * 90000)::text
|
SET order_number = 'BE-' || EXTRACT(YEAR FROM created_at)::text || '-' || floor(10000 + random() * 90000)::text
|
||||||
WHERE order_number IS NULL;
|
WHERE order_number IS NULL;
|
||||||
|
|
||||||
-- Now add unique constraint and make it not null
|
-- Now add unique constraint and make it not null
|
||||||
|
|||||||
Reference in New Issue
Block a user