Create a Professional Invoice Generator Add-On for Powerhouse Batteries Description / Requirements: Build a standalone invoice generator script for an existing PHP website called Powerhouse Batteries. This script will be run separately from the main site via admin.php but must seamlessly match the website’s modern, professional branding. Functional Requirements: Technology Stack: Backend: PHP 8+ (procedural or OOP with PDO for MySQL) Frontend: HTML5, CSS3 (match Powerhouse Batteries branding), JavaScript (vanilla or minimal libraries) Invoice Management: Create, edit, and delete invoices. Automatically generate unique invoice numbers (e.g., PHB-2025-0001). Store invoices in a MySQL table (invoices) with fields: id, invoice_number, customer_name, customer_email, customer_address, items (JSON), subtotal, vat, total, date_created, status (Paid/Unpaid). Currency & Calculations: Currency: South African Rand (ZAR) with proper formatting (R 1,234.56). Apply 15% VAT calculation automatically (editable). Invoice Builder Interface: Add multiple line items dynamically (description, quantity, price). Show live calculations for subtotal, VAT, and total. Responsive design with print and download (PDF) options. PDF Export & Email: Generate a professional PDF invoice using libraries like Dompdf or TCPDF. Include Powerhouse Batteries logo, company details, and branding colors. Ability to email invoice directly to the customer with PHPMailer. Admin Dashboard Integration: Accessible from admin.php via a new tab or button (e.g., “Manage Invoices”). Display list of all invoices with filters (by date, customer, status). View, edit, resend, or delete invoices. UI/UX Requirements: Clean, modern layout (inspired by SaaS billing dashboards). Use company colors and logo from the existing site. Mobile-friendly and professional look. Security: Protect with existing admin login session. Validate and sanitize all form inputs. CSRF token for invoice creation forms. Extra Features (Optional): Add a “Mark as Paid” button to update invoice status. Option to duplicate previous invoices. Include search and pagination for invoice list. Deliverables: Full working PHP script (separate from main site but accessible from admin.php). SQL file to create required tables. CSS/JS files matching the site’s branding. Fully functional PDF generation and email sending features. Clear setup instructions (e.g., database config, file structure). - Initial Deployment
verified