| @@ -64,9 +64,9 @@ | ||
| 64 | 64 | <html lang="en"> |
| 65 | 65 | <head> |
| 66 | 66 | <meta charset="UTF-8"> |
| 67 | 67 | <meta name="viewport" content="width=device-width, initial-scale=1.0"> |
| 68 | - <title><?php echo esc_html__('Invoice', 'yatra'); ?> - <?php echo htmlspecialchars($paymentRef, ENT_QUOTES, 'UTF-8'); ?></title> | |
| 68 | + <title><?php echo esc_html__('Invoice', 'yatra'); ?> - <?php echo htmlspecialchars($bookingRef !== '' ? $bookingRef : $paymentRef, ENT_QUOTES, 'UTF-8'); ?></title> | |
| 69 | 69 | <style> |
| 70 | 70 | @page { size: A4 portrait; margin: 0mm; } |
| 71 | 71 | * { margin: 0; padding: 0; box-sizing: border-box; } |
| 72 | 72 | body { margin: 0; padding: 0; font-family: "Noto Sans Devanagari", "Noto Sans Arabic", "Noto Sans CJK", "DejaVu Sans", sans-serif; font-size: 12px; color: #111; } |
| @@ -135,9 +135,13 @@ | ||
| 135 | 135 | <h3><?php esc_html_e('Invoice Details', 'yatra'); ?></h3> |
| 136 | 136 | <table class="details"> |
| 137 | 137 | <tr> |
| 138 | 138 | <td class="k"><?php esc_html_e('Invoice #:', 'yatra'); ?></td> |
| 139 | - <td class="v-wrap"><?php echo htmlspecialchars($paymentRef, ENT_QUOTES, 'UTF-8'); ?></td> | |
| 139 | + <?php // Always the booking reference — consistent whether the invoice is | |
| 140 | + // downloaded from the confirmation page or after a payment. Previously | |
| 141 | + // this used $paymentRef, which the post-payment path set to the payment | |
| 142 | + // number (PAY-xxxxxx), so the invoice number changed per download. ?> | |
| 143 | + <td class="v-wrap"><?php echo htmlspecialchars($bookingRef !== '' ? $bookingRef : $paymentRef, ENT_QUOTES, 'UTF-8'); ?></td> | |
| 140 | 144 | </tr> |
| 141 | 145 | <tr> |
| 142 | 146 | <td class="k"><?php esc_html_e('Date:', 'yatra'); ?></td> |
| 143 | 147 | <td class="v"><?php echo htmlspecialchars($paymentDate, ENT_QUOTES, 'UTF-8'); ?></td> |