From 182add517c10522b52d5aaa95924b04e0e62f428 Mon Sep 17 00:00:00 2001 From: Focuslinkstech <45756999+Focuslinkstech@users.noreply.github.com> Date: Tue, 8 Apr 2025 17:45:18 +0100 Subject: [PATCH] feat: implement custom invoice generation functionality --- system/controllers/invoices.php | 41 +++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 system/controllers/invoices.php diff --git a/system/controllers/invoices.php b/system/controllers/invoices.php new file mode 100644 index 00000000..a2a9d68b --- /dev/null +++ b/system/controllers/invoices.php @@ -0,0 +1,41 @@ + 'Premium Plan', + 'price' => 49.99, + 'routers' => 'router123', + // Add other required fields from tbl_transactions + ]; + + // Custom bills + $bills = [ + 'Additional Bandwidth' => 15.00, + 'Support Fee' => 10.00, + 'IP Address' => 5.00, + 'Custom Service' => 25.00, + 'Late Fee' => 5.00, + 'Discount' => -10.00, + ]; + + $add_cost = 20; + + $result = Invoice::sendInvoice( + userId: $userId, + invoice: $invoiceData, + bills: $bills, + status: $status, + invoiceNo: $invoiceNo + ); + + if($result) { + echo "Custom invoice sent! PDF generated at: system/uploads/invoices/invoice_{$invoiceNo}.pdf"; + } +} catch (Exception $e) { + echo "Invoice Error: " . $e->getMessage(); +}