requireLogin(); // Get expense ID from URL $expense_id = $_GET['expense_id'] ?? 0; if (!$expense_id) { header("Location: expenses.php"); exit(); } try { // Fetch expense details $stmt = $pdo->prepare(" SELECT e.*, ec.category_name, COALESCE(es.subcategory_name, '-') as subcategory_name, u.full_name as paid_by_name, uc.full_name as created_by_name FROM expenses e JOIN expense_categories ec ON e.category_id = ec.id LEFT JOIN expense_subcategories es ON e.subcategory_id = es.id JOIN users u ON e.paid_by = u.id JOIN users uc ON e.created_by = uc.id WHERE e.id = ? "); $stmt->execute([$expense_id]); $expense = $stmt->fetch(PDO::FETCH_ASSOC); if (!$expense) { header("Location: expenses.php"); exit(); } } catch (PDOException $e) { header("Location: expenses.php"); exit(); } // Format payment method $payment_methods = [ 'cash' => 'Cash', 'upi' => 'UPI', 'credit_card' => 'Credit Card' ]; $payment_method_display = $payment_methods[$expense['paid_through']] ?? ucfirst($expense['paid_through']); ?> Payment Slip - <?php echo htmlspecialchars($expense['expense_number']); ?>
← Back to Expenses
KAYAL AQUA CONSULTANTS
Ethirmedu, Valayakaranoor Post
Komarapalayam - 638183, Tamil Nadu
Ph: +91 80565 26579 / +91 96989 20008 / +91 88389 66048
PAYMENT SLIP
Expense Details
Expense Number:
Date:
Time:
Category:
Subcategory:
Created By:
Payment Details
Paid To:
Paid By:
Payment Method:
Status: PAID
Expense Description
TOTAL AMOUNT PAID
Amount in words: 0) { $words .= ' and ' . numberToWords($paisa) . ' Paisa'; } $words .= ' Only'; echo $words; ?>
Notes:
Paid By:
Authorized Signature