requireLogin(); // Get sale ID from URL $sale_id = $_GET['sale_id'] ?? 0; if (!$sale_id) { header("Location: sales.php"); exit(); } try { // Fetch sale details $stmt = $pdo->prepare(" SELECT s.*, u.full_name as created_by_name FROM sales s JOIN users u ON s.created_by = u.id WHERE s.id = ? "); $stmt->execute([$sale_id]); $sale = $stmt->fetch(PDO::FETCH_ASSOC); if (!$sale) { header("Location: sales.php"); exit(); } // Fetch sale items $stmt = $pdo->prepare(" SELECT si.*, ps.name as product_name, u.unit_symbol FROM sales_items si JOIN products_services ps ON si.product_service_id = ps.id JOIN units u ON ps.unit_id = u.id WHERE si.sale_id = ? ORDER BY si.id "); $stmt->execute([$sale_id]); $sale_items = $stmt->fetchAll(PDO::FETCH_ASSOC); } catch (PDOException $e) { header("Location: sales.php"); exit(); } // Calculate totals $subtotal = $sale['total_amount']; $gst_amount = 0; // GST is 0% as requested $total_amount = $subtotal + $gst_amount; ?> Bill - <?php echo htmlspecialchars($sale['bill_number']); ?>
← Back to Sales
KAYAL AQUA CONSULTANTS
Ethirmedu, Valayakaranoor Post
Komarapalayam - 638183, Tamil Nadu
Ph: +91 80565 26579 / +91 96989 20008 / +91 88389 66048
SALES INVOICE
Bill Details
Bill Number:
Date:
Time:
Served By:
Customer Details
Name:
Phone:
Payment Status:
Payment Method:
S.No Product/Service Quantity Unit Rate (₹) Amount (₹)
Subtotal:
GST (0%):
TOTAL AMOUNT:
Payment Status: ✅ PAID via ⏳ PAYMENT PENDING ⚠️ PARTIAL PAYMENT RECEIVED
Notes:
Customer Signature
Authorized Signature