feat: rework admin portal with pricing breakdown and document management

- Added pricing snapshot columns to the leads table: daily_subtotal, weekend_subtotal, subtotal_eur, vat_eur, total_eur, deposit_eur, total_days, weekday_count, weekend_day_count.
- Updated create_lead RPC to accept and store new pricing parameters.
- Enhanced frontend app.js to compute and send pricing details during lead creation.
- Introduced new UI elements in admin.html for displaying pricing and documents in a tabbed dialog.
- Updated i18n.js with new translation keys for pricing and document management.
- Improved styles in styles.css for new dialog components and pricing cards.
- Added migration script 06-admin-pricing-documents.sql for database schema changes.
This commit is contained in:
LagoESP
2026-04-29 17:27:37 +02:00
parent bc61ffa206
commit 30e296f61b
9 changed files with 1187 additions and 40 deletions
+88
View File
@@ -170,6 +170,50 @@ export const translations = {
adminPeriod: "Zeitraum",
adminKaution: "Kaution (€)",
adminMaxKmWeekend: "Max. km/Wochenendtag",
adminTotalPrice: "Gesamtbetrag",
adminLifetimeValueCol: "Gesamtwert",
adminTabGeneral: "Allgemein",
adminTabGeneralEn: "General",
adminTabPricing: "Preise",
adminTabPricingEn: "Pricing",
adminTabDocuments: "Dokumente",
adminTabDocumentsEn: "Documents",
adminTabNotes: "Notiz",
adminTabNotesEn: "Notes",
adminTabOrderHistory: "Order History",
adminLifetimeValue: "Gesamtwert aller Buchungen",
adminLifetimeValueEn: "Lifetime value",
adminDownload: "Download",
adminNoDocuments: "Keine Dokumente hochgeladen",
adminNoDocumentsEn: "No documents uploaded",
adminIdDoc: "Ausweis / Führerschein",
adminIdDocEn: "ID / Driving license",
adminIncomeDoc: "Lohnzettel",
adminIncomeDocEn: "Pay slip",
adminOtherDoc: "Sonstiges",
adminOtherDocEn: "Other",
adminWeekdays: "Wochentage",
adminWeekdaysEn: "Weekdays",
adminWeekendRateLabel: "Wochenendmiete",
adminWeekendRateLabelEn: "Weekend rate",
adminSubtotalLabel: "Zwischensumme",
adminSubtotalLabelEn: "Subtotal",
adminVatLabel: "MwSt. (20%)",
adminVatLabelEn: "VAT (20%)",
adminTotalLabel: "Gesamtbetrag",
adminTotalLabelEn: "Total",
adminDepositLabel: "Kaution",
adminDepositLabelEn: "Deposit",
adminIncludedKmLabel: "Inkl. km",
adminIncludedKmLabelEn: "Included km",
adminTotalDaysLabel: "Tage gesamt",
adminTotalDaysLabelEn: "Total days",
adminFirstContacted: "Erster Kontakt",
adminFirstContactedEn: "First contacted",
adminNote: "Notiz",
adminNoteEn: "Note",
adminSave: "Speichern",
adminSaveEn: "Save",
},
en: {
navCars: "Fleet",
@@ -341,6 +385,50 @@ export const translations = {
adminPeriod: "Period",
adminKaution: "Deposit (€)",
adminMaxKmWeekend: "Max. km/weekend day",
adminTotalPrice: "Total",
adminLifetimeValueCol: "Lifetime",
adminTabGeneral: "General",
adminTabGeneralEn: "Allgemein",
adminTabPricing: "Pricing",
adminTabPricingEn: "Preise",
adminTabDocuments: "Documents",
adminTabDocumentsEn: "Dokumente",
adminTabNotes: "Notes",
adminTabNotesEn: "Notiz",
adminTabOrderHistory: "Order History",
adminLifetimeValue: "Lifetime value",
adminLifetimeValueEn: "Gesamtwert aller Buchungen",
adminDownload: "Download",
adminNoDocuments: "No documents uploaded",
adminNoDocumentsEn: "Keine Dokumente hochgeladen",
adminIdDoc: "ID / Driving license",
adminIdDocEn: "Ausweis / Führerschein",
adminIncomeDoc: "Pay slip",
adminIncomeDocEn: "Lohnzettel",
adminOtherDoc: "Other",
adminOtherDocEn: "Sonstiges",
adminWeekdays: "Weekdays",
adminWeekdaysEn: "Wochentage",
adminWeekendRateLabel: "Weekend rate",
adminWeekendRateLabelEn: "Wochenendmiete",
adminSubtotalLabel: "Subtotal",
adminSubtotalLabelEn: "Zwischensumme",
adminVatLabel: "VAT (20%)",
adminVatLabelEn: "MwSt. (20%)",
adminTotalLabel: "Total",
adminTotalLabelEn: "Gesamtbetrag",
adminDepositLabel: "Deposit",
adminDepositLabelEn: "Kaution",
adminIncludedKmLabel: "Included km",
adminIncludedKmLabelEn: "Inkl. km",
adminTotalDaysLabel: "Total days",
adminTotalDaysLabelEn: "Tage gesamt",
adminFirstContacted: "First contacted",
adminFirstContactedEn: "Erster Kontakt",
adminNote: "Note",
adminNoteEn: "Notiz",
adminSave: "Save",
adminSaveEn: "Speichern",
},
};