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(); +}