PluginProbe
FluentCart A New Era of eCommerce – Faster, Lighter, and Simpler / 1.5.2
FluentCart A New Era of eCommerce – Faster, Lighter, and Simpler v1.5.2
1.6.6 1.6.5 1.6.4 1.6.3 1.6.2 1.6.1 1.6.0 1.5.4 1.5.5 1.5.3 1.5.2 1.5.1 1.5.0 1.4.2 1.4.1 1.4.0 1.3.28 1.3.27 1.3.26 1.3.25 1.3.23 1.3.22 1.3.21 1.3.20 1.3.19 All 49 releases
fluent-cart / app / Views / invoice / receipt_slip.php

receipt_slip.php in FluentCart A New Era of eCommerce – Faster, Lighter, and Simpler 1.5.2, at app/Views/invoice/receipt_slip.php

658 lines 44.3 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php if ( ! defined( 'ABSPATH' ) ) exit; ?>
2 <style>
3 html {
4 background-color: rgb(248, 249, 250);
5 font-family: ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
6 }
7
8 body {
9 background-color: rgb(248, 249, 250);
10 padding-top: 40px;
11 padding-bottom: 40px;
12 font-family: ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
13 }
14
15 p {
16 font-family: ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
17 font-size: 14px;
18 margin: 0px;
19 margin-bottom: 8px;
20 line-height: 24px;
21 }
22
23 .email_footer p {
24 font-size: 12px;
25 color: rgb(127, 140, 141);
26 margin: 0px;
27 line-height: 24px;
28 margin-bottom: 8px;
29 }
30
31 hr {
32 border-color: rgb(229, 231, 235);
33 margin-bottom: 20px;
34 width: 100%;
35 border: none;
36 border-top: 1px solid #eaeaea;
37 }
38
39 .space_bottom_30 {
40 display: block;
41 width: 100%;
42 margin-bottom: 30px;
43 }
44
45 .fct-transaction-table tr:last-child td {
46 border-bottom: none !important;
47 padding-bottom: 0 !important;
48 }
49 </style>
50
51 <?php
52
53 use FluentCart\Api\StoreSettings;
54 use FluentCart\App\Models\Order;
55 use FluentCart\Framework\Support\Arr;
56 use FluentCart\App\Helpers\AddressHelper;
57 use FluentCart\App\Modules\Tax\TaxModule;
58 use FluentCart\App\Services\DateTime\DateTime;
59 use FluentCart\App\Services\Renderer\Receipt\TaxSummaryHelper;
60
61 $settings = new StoreSettings();
62
63 /**
64 * @var Order $order
65 */
66
67 $profilePage = $settings->getCustomerProfilePage();
68 $orderTaxRates = $order->getPrimaryOrderTaxRate();
69
70
71 ?>
72
73 <div style="background-color: #fff;max-width: 620px;margin-left: auto;margin-right: auto;border: 1px solid #e7eaee;padding: 10px;border-radius: 8px;">
74 <div style=" border-radius: 5px;" id="receipt">
75 <div class="fct-email-template-content email-template-content"
76 style="font-family: Arial, Helvetica, sans-serif; margin: 0 auto; padding: 0px; width: 100%;">
77
78 <div class="fct-email-template-content-inner" style="font-size: 13px;line-height: 1.4;color: #333;">
79 <div style="padding: 20px;">
80
81 <table role="presentation"
82 style="width: 100%;border-collapse: collapse;margin-bottom: 10px;border: none;">
83 <tbody style="width:100%">
84 <tr style="width:100%">
85 <td style="width:60%;border: none;">
86 <h1 style="font-size:24px;font-weight:700;color:rgb(17,24,39);margin:0px">
87 <?php
88 $imageLink = $settings->get('store_logo.url');
89 $storeName = $settings->get('store_name');
90 if (empty($imageLink)) {
91 echo esc_html($storeName);
92 } else {
93 echo "<img src=".esc_url($imageLink)." alt=".esc_attr($storeName)." style='max-height: 40px;'>";
94 }
95 ?>
96 </h1>
97
98 <!-- show tax content -->
99 <?php
100 $storeVatNumber = Arr::get($orderTaxRates->meta ?? [], 'store_vat_number', '');
101 $taxcountry = Arr::get($orderTaxRates->meta ?? [], 'tax_country', '');
102 if (!empty($storeVatNumber)): ?>
103 <span class="fct_invoice_tax_content" style="font-weight: 500; font-size: 14px;">
104 <?php echo esc_html(TaxModule::getCountryTaxTitle($taxcountry)); ?>:
105 <?php
106 if ($storeVatNumber !== '') {
107 echo esc_html($storeVatNumber);
108 }
109 ?>
110 </span>
111 <?php endif; ?>
112 </td>
113 <td style="vertical-align: middle; width: 15%; text-align: right; border: none;padding-right: 10px;">
114 <p style="white-space: nowrap; color: #94a3b8; text-align: right; margin: 0;font-size:12px;">
115 <?php echo esc_html__('Order At', 'fluent-cart'); ?>
116 </p>
117 <p style="white-space: nowrap; font-weight: bold; color: #000; text-align: right; margin: 0;font-size:14px;">
118 <?php
119 echo esc_html(
120 date_i18n(
121 /* translators: Date format for order creation date */
122 __('M d, Y', 'fluent-cart'),
123 DateTime::anyTimeToGmt($order->created_at)->getTimestamp()
124 )
125 );
126 ?>
127 </p>
128 </td>
129 <td style="width:15%;text-align:right;border:none;vertical-align:baseline;">
130 <p style="white-space: nowrap; color: #94a3b8; text-align: right; margin: 0;font-size:12px;">
131 <?php echo esc_html__('Invoice number #', 'fluent-cart'); ?>
132 </p>
133 <p id="fct-order-invoice-no"
134 style="white-space: nowrap; font-weight: bold; color: #000; text-align: right; margin: 0;font-size:14px;">
135 <?php echo esc_html($order->invoice_no); ?>
136 </p>
137 </td>
138 </tr>
139 </tbody>
140 </table>
141
142 <?php if ($order->fulfillment_type === 'physical') : ?>
143 <div style="background: #f8f9fa;padding: 15px;margin-bottom: 20px;">
144 <div style="font-size: 18px;font-weight: bold;margin-bottom: 8px;">
145 <?php echo esc_html($settings->get('store_name')); ?>
146 </div>
147 <div style="margin-bottom: 3px;">
148 <?php echo esc_html($settings->get('store_address1')); ?>
149 </div>
150
151 <div>
152 <?php echo esc_html(AddressHelper::getStateNameByCode(
153 $settings->get('store_state'),
154 $settings->get('store_country')
155 )); ?>
156 <?php echo esc_html(AddressHelper::getCountryNameByCode($settings->get('store_country'))); ?>
157 </div>
158 </div>
159 <?php endif; ?>
160
161 <div style="display: grid;grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));gap: 20px;">
162 <?php if ($order->fulfillment_type === 'digital') : ?>
163 <div style="border-radius: 5px;print-color-adjust: exact;">
164 <h5 style="font-weight: bold;font-size: 14px;margin: 0 0 10px 0;color: #495057;border-bottom: 1px solid #dee2e6;padding-bottom: 5px;">
165 <?php echo esc_html($settings->get('store_name')); ?>
166 </h5>
167 <div style="margin-bottom: 3px;">
168 <?php echo esc_html($settings->get('store_address1')); ?>
169 </div>
170 <div>
171 <?php echo esc_html(AddressHelper::getStateNameByCode(
172 $settings->get('store_state'),
173 $settings->get('store_country')
174 )); ?>
175 <?php echo esc_html(AddressHelper::getCountryNameByCode($settings->get('store_country'))); ?>
176 </div>
177 </div>
178 <?php endif; ?>
179 <div style="border-radius: 5px;print-color-adjust: exact;">
180 <h5 style="font-weight: bold;font-size: 14px;margin: 0 0 10px 0;color: #495057;border-bottom: 1px solid #dee2e6;padding-bottom: 5px;">
181 <?php echo esc_html__('Bill To', 'fluent-cart'); ?>
182 </h5>
183 <?php if (!empty($order->billing_address)) : ?>
184
185 <div style="margin-bottom: 3px;">
186 <?php echo esc_html($order->billing_address->getAddressAsText()); ?>
187 </div>
188 <div style="margin-top: 10px;">
189 <?php echo esc_html($order->customer->email); ?>
190 </div>
191 <?php
192 $phoneNumber = Arr::get($order->billing_address->meta ?? [], 'other_data.phone', '');
193 if ($phoneNumber !== ''):
194 ?>
195 <div style="margin-top: 3px;">
196 <?php echo esc_html($phoneNumber); ?>
197 </div>
198 <?php endif; ?>
199 <div>
200 <?php
201 $companyName = Arr::get($order->billing_address->meta ?? [], 'other_data.company_name', '');
202 if ($companyName == '') {
203 $companyName = $order->getCustomerTaxName();
204 }
205 echo esc_html($companyName);
206 ?>
207 </div>
208 <div style="margin-top: 5px;">
209 <?php
210 $vatNumber = $order->getCustomerTaxNumber();
211
212 if ($vatNumber !== '') {
213 $vatLabel = __('VAT/Tax ID', 'fluent-cart');
214 echo esc_html($vatLabel) . ': ' . esc_html($vatNumber);
215 }
216 ?>
217 </div>
218 <?php
219 $reverseChargeDeclaration = Arr::get($order->getBusinessInfo(), 'reverse_charge_declaration', '');
220 if ($reverseChargeDeclaration !== ''):
221 ?>
222 <div style="margin-top: 5px;">
223 <strong><?php echo esc_html__('Reverse Charge Declaration', 'fluent-cart'); ?>:</strong>
224 <?php echo esc_html($reverseChargeDeclaration); ?>
225 </div>
226 <?php endif; ?>
227
228 <?php else: ?>
229 <div style="margin-top: 10px;">
230 <?php echo esc_html($order->customer->full_name); ?>
231 </div>
232 <div style="margin-top: 3px;">
233 <?php echo esc_html($order->customer->email); ?>
234 </div>
235 <?php endif; ?>
236 </div>
237 <?php if ($order->fulfillment_type === 'physical') : ?>
238 <div style="border-radius: 5px;print-color-adjust: exact;">
239 <h5 style="font-weight: bold;font-size: 14px;margin: 0 0 10px 0;color: #495057;border-bottom: 1px solid #dee2e6;padding-bottom: 5px;">
240 <?php echo esc_html__('Ship To', 'fluent-cart'); ?>
241 </h5>
242 <?php if (!empty($order->shipping_address)) : ?>
243 <div style="margin-bottom: 3px;">
244 <?php echo esc_html($order->shipping_address->getAddressAsText()); ?>
245 </div>
246 <?php
247 $phone = Arr::get($order->shipping_address->meta ?? [], 'other_data.phone', '');
248 if ($phone !== ''):
249 ?>
250 <div style="margin-top: 3px;">
251 <?php echo esc_html($phone); ?>
252 </div>
253 <?php endif; ?>
254 <?php else: ?>
255 <div style="margin-top: 10px;">
256 <?php echo esc_html($order->customer->full_name); ?>
257 </div>
258 <div style="margin-top: 3px;">
259 <?php echo esc_html($order->customer->email); ?>
260 </div>
261 <?php endif; ?>
262 </div>
263 <?php endif; ?>
264 </div>
265
266 <?php if ($order->order_items) : ?>
267 <table style="margin-top: 20px;margin-bottom: 10px;width: 100%;text-align: left;border-spacing: 0;border-collapse: collapse;border: none;">
268 <thead>
269 <tr>
270 <th style="background-color: #f8f9fa;padding: 12px 8px;font-weight: bold;print-color-adjust: exact;border: none;">
271 <?php echo esc_html__('Description', 'fluent-cart'); ?>
272 </th>
273 <th style="background-color: #f8f9fa;padding: 12px 8px;font-weight: bold;width: 80px;text-align: right;print-color-adjust: exact;border: none;">
274 <?php echo esc_html__('Qty', 'fluent-cart'); ?>
275 </th>
276 <th style="background-color: #f8f9fa;padding: 12px 8px;font-weight: bold;width: 80px;text-align: right;print-color-adjust: exact;border: none;">
277 <?php echo esc_html__('Unit price', 'fluent-cart'); ?>
278 </th>
279 <th style="background-color: #f8f9fa;padding: 12px 8px;font-weight: bold;width: 80px;text-align: right;print-color-adjust: exact;border: none;">
280 <?php echo esc_html__('Amount', 'fluent-cart'); ?>
281 </th>
282 </tr>
283 </thead>
284 <tbody>
285 <?php
286 $orderItems = $order->getProductItems()->toArray();
287 $transaction = $order->getLatestTransaction();
288
289 foreach ($orderItems as $item) :
290 ?>
291 <tr>
292 <td style="font-size:15px;padding: 12px 8px;border: none;border-bottom: 1px solid #dee2e6;print-color-adjust: exact;">
293 <?php echo esc_html($item['post_title']); ?>
294 <br>
295 <?php if (!empty($item['title'])) : ?>
296 <small style="font-size: 13px;color: #758195;">- <?php echo esc_html(!empty($item['variation_display_title']) ? $item['variation_display_title'] : $item['title']); ?></small>
297 <br>
298 <?php endif; ?>
299 <?php if (!empty($item['payment_info'])) : ?>
300 <small style="font-size: 13px;color: #758195;"><?php echo esc_html($item['payment_info']); ?></small>
301 <?php endif; ?>
302 </td>
303 <td style="padding: 12px 8px;border: none;border-bottom: 1px solid #dee2e6;text-align: right;">
304 <?php echo esc_html($item['quantity']); ?>
305 </td>
306 <td style="padding: 12px 8px;border: none;border-bottom: 1px solid #dee2e6;text-align: right">
307 <?php echo esc_html(\FluentCart\Api\CurrencySettings::getFormattedPrice($item['unit_price'])); ?>
308 </td>
309 <td style="padding: 12px 8px;border: none;border-bottom: 1px solid #dee2e6;text-align: right">
310 <?php echo esc_html($item['formatted_total']); ?>
311 </td>
312 </tr>
313 <?php endforeach; ?>
314 </tbody>
315 </table>
316
317 <div style="margin-top: 20px;">
318 <table style="max-width: 250px;width: 100%;margin-left: auto;border-collapse: collapse;background: #f8f9fa;print-color-adjust: exact;border: none;">
319 <tbody>
320 <?php
321 if ($order->subtotal != ($order->total_amount - $order->total_refund) || $order->tax_total > 0): ?>
322 <tr>
323 <td style="padding: 8px 20px 8px 0;text-align: right;border: none;">
324 <?php echo esc_html__('Subtotal', 'fluent-cart'); ?>
325 </td>
326 <td style="font-weight:700;padding: 8px 8px 8px 0;width: 100px;text-align: right;border: none;">
327 <?php echo esc_html(\FluentCart\App\Helpers\Helper::toDecimal($order->subtotal));
328 ?>
329 </td>
330 </tr>
331 <?php endif; ?>
332 <?php
333 $prorateCredit = (int) \FluentCart\Framework\Support\Arr::get($order->config, 'prorate_credit', 0);
334 $upgradeDiscount = $order->manual_discount_total - $prorateCredit;
335 // When the prorate credit IS the whole discount, label the row directly
336 // instead of showing "Discount" with a single redundant breakdown row.
337 $onlyProrateCredit = $prorateCredit > 0 && $upgradeDiscount <= 0 && $order->coupon_discount_total <= 0;
338 ?>
339 <?php if ($order->manual_discount_total + $order->coupon_discount_total > 0): ?>
340 <tr>
341 <td style="padding: 8px 20px 8px 0;text-align: right;border: none;">
342 <?php echo $onlyProrateCredit ? esc_html__('Prorate Credit', 'fluent-cart') : esc_html__('Discount', 'fluent-cart'); ?>
343 </td>
344 <td style="padding: 8px 8px 8px 0;width: 100px;text-align: right;border: none;">
345 - <?php echo esc_html(\FluentCart\App\Helpers\Helper::toDecimal($order->manual_discount_total + $order->coupon_discount_total)); ?>
346 </td>
347 </tr>
348 <?php if ($prorateCredit > 0 && $upgradeDiscount > 0): ?>
349 <tr>
350 <td style="padding: 2px 20px 2px 20px;text-align: right;border: none;font-size:12px;color:rgb(107,114,128);">
351 <?php echo esc_html__('Upgrade Discount', 'fluent-cart'); ?>
352 </td>
353 <td style="padding: 2px 8px 2px 0;width: 100px;text-align: right;border: none;font-size:12px;color:rgb(107,114,128);">
354 <?php echo esc_html(\FluentCart\App\Helpers\Helper::toDecimal($upgradeDiscount)); ?>
355 </td>
356 </tr>
357 <?php endif; ?>
358 <?php if ($prorateCredit > 0 && !$onlyProrateCredit): ?>
359 <tr>
360 <td style="padding: 2px 20px 2px 20px;text-align: right;border: none;font-size:12px;color:rgb(107,114,128);">
361 <?php echo esc_html__('Prorate Credit', 'fluent-cart'); ?>
362 </td>
363 <td style="padding: 2px 8px 2px 0;width: 100px;text-align: right;border: none;font-size:12px;color:rgb(107,114,128);">
364 <?php echo esc_html(\FluentCart\App\Helpers\Helper::toDecimal($prorateCredit)); ?>
365 </td>
366 </tr>
367 <?php endif; ?>
368 <?php endif; ?>
369 <?php if ($order->shipping_total > 0): ?>
370 <tr>
371 <td style="padding: 8px 20px 8px 0;text-align: right;border: none;">
372 <?php echo esc_html__('Shipping', 'fluent-cart'); ?>
373 </td>
374 <td style="padding: 8px 8px 8px 0;width: 100px;text-align: right;border: none;">
375 <?php echo esc_html(\FluentCart\App\Helpers\Helper::toDecimal($order->shipping_total)); ?>
376 </td>
377 </tr>
378 <?php endif; ?>
379 <?php
380 $feeItems = $order->feeItems()->get();
381 foreach ($feeItems as $feeItem): ?>
382 <tr>
383 <td style="padding: 8px 20px 8px 0;text-align: right;border: none;">
384 <?php echo esc_html($feeItem->title); ?>
385 </td>
386 <td style="padding: 8px 8px 8px 0;width: 100px;text-align: right;border: none;">
387 <?php echo esc_html(\FluentCart\App\Helpers\Helper::toDecimal($feeItem->subtotal)); ?>
388 </td>
389 </tr>
390 <?php endforeach; ?>
391 <?php if ($order->isReverseChargeTaxOrder()): ?>
392 <?php
393 $rcReversedTotal = $order->getReversedTaxTotal();
394 $rcChargeLabel = $rcReversedTotal > 0
395 ? sprintf(
396 /* translators: %1$s: formatted reversed tax amount */
397 __('Tax reversed: %1$s', 'fluent-cart'),
398 \FluentCart\App\Helpers\Helper::toDecimal($rcReversedTotal)
399 )
400 : __('Charge reversed', 'fluent-cart');
401 ?>
402 <tr>
403 <td style="padding: 8px 20px 8px 0;text-align: right;border: none;">
404 <?php echo esc_html__('Tax', 'fluent-cart'); ?>
405 </td>
406 <td style="padding: 8px 8px 8px 0;width: 100px;text-align: right;border: none;">
407 <?php echo esc_html($rcChargeLabel); ?>
408 </td>
409 </tr>
410 <?php elseif ($order->tax_total > 0): ?>
411 <?php
412 $invoiceTaxSummary = TaxSummaryHelper::computeTaxSummary($order);
413 $invFoldedRateLines = Arr::get($invoiceTaxSummary, 'foldedRateLines', []);
414 $invIncludedInPrices = (int) Arr::get($invoiceTaxSummary, 'includedInPrices', 0);
415 $invPayableTax = (int) Arr::get($invoiceTaxSummary, 'payableTax', 0);
416 $invTotalOrderTax = (int) Arr::get($invoiceTaxSummary, 'totalOrderTax', 0);
417 $invoiceTaxLines = Arr::get($invoiceTaxSummary, 'taxRateLines', []);
418 ?>
419 <tr>
420 <td colspan="2" style="padding: 4px 0;border: none;">
421 <table style="width:100%;border-collapse:collapse;background:#ffffff;border:1px solid #e2e8f0;border-radius:6px;print-color-adjust:exact;">
422 <tbody>
423 <?php if (!empty($invFoldedRateLines)): ?>
424 <tr>
425 <td colspan="2" style="padding: 8px 8px 4px 8px;border: none;">
426 <div style="font-size:11px;text-transform:uppercase;letter-spacing:0.04em;color:#94a3b8;font-weight:600;text-align:right;margin-bottom:4px;">
427 <?php esc_html_e('Tax breakdown by rate', 'fluent-cart'); ?>
428 </div>
429 <table style="width:100%;border-collapse:collapse;table-layout:fixed;">
430 <tbody>
431 <tr>
432 <td style="width:58%;font-size:11px;text-transform:uppercase;color:rgb(107,114,128);font-weight:600;padding:2px 8px 2px 0;border:none;vertical-align:top;">
433 <?php echo esc_html__('Rate', 'fluent-cart'); ?>
434 </td>
435 <td style="width:24%;font-size:11px;text-transform:uppercase;color:rgb(107,114,128);font-weight:600;padding:2px 8px 2px 0;text-align:right;border:none;white-space:nowrap;vertical-align:top;">
436 <?php echo esc_html__('Taxable base', 'fluent-cart'); ?>
437 </td>
438 <td style="width:18%;font-size:11px;text-transform:uppercase;color:rgb(107,114,128);font-weight:600;padding:2px 0;text-align:right;border:none;white-space:nowrap;vertical-align:top;">
439 <?php echo esc_html__('Tax', 'fluent-cart'); ?>
440 </td>
441 </tr>
442 <?php foreach ($invFoldedRateLines as $invFoldedLine): ?>
443 <?php $invMutedStyle = !empty($invFoldedLine['inclusive']) ? 'opacity:0.7;' : ''; ?>
444 <tr style="<?php echo esc_attr($invMutedStyle); ?>">
445 <td style="width:58%;padding:4px 8px 4px 0;border:none;white-space:normal;word-break:break-word;overflow-wrap:break-word;vertical-align:top;">
446 <?php echo esc_html($invFoldedLine['label']); ?>
447 </td>
448 <td style="width:24%;padding:4px 8px 4px 0;text-align:right;border:none;color:rgb(107,114,128);white-space:nowrap;vertical-align:top;">
449 <?php echo esc_html(\FluentCart\App\Helpers\Helper::toDecimal($invFoldedLine['base'])); ?>
450 </td>
451 <td style="width:18%;padding:4px 0;text-align:right;border:none;white-space:nowrap;vertical-align:top;">
452 <?php echo esc_html(\FluentCart\App\Helpers\Helper::toDecimal($invFoldedLine['tax'])); ?>
453 </td>
454 </tr>
455 <?php endforeach; ?>
456 </tbody>
457 </table>
458 </td>
459 </tr>
460 <tr style="font-weight:700;">
461 <td style="padding: 8px 20px 8px 0;text-align: right;border: none;border-top:1px solid #e2e8f0;padding-top:6px;margin-top:6px;">
462 <?php echo esc_html__('Total tax', 'fluent-cart'); ?>
463 </td>
464 <td style="padding: 8px 8px 8px 0;width: 100px;text-align: right;border: none;border-top:1px solid #e2e8f0;padding-top:6px;margin-top:6px;">
465 <?php echo esc_html(\FluentCart\App\Helpers\Helper::toDecimal($invTotalOrderTax)); ?>
466 </td>
467 </tr>
468 <?php if ($invIncludedInPrices > 0): ?>
469 <tr style="color:rgb(107,114,128);">
470 <td style="padding: 4px 20px 4px 0;text-align: right;border: none;font-size:12px;">
471 <?php echo esc_html__('of which included in prices', 'fluent-cart'); ?>
472 </td>
473 <td style="padding: 4px 8px 4px 0;width: 100px;text-align: right;border: none;font-size:12px;">
474 <?php echo esc_html(\FluentCart\App\Helpers\Helper::toDecimal($invIncludedInPrices)); ?>
475 </td>
476 </tr>
477 <?php endif; ?>
478 <?php if ($invPayableTax > 0 && $invIncludedInPrices > 0): ?>
479 <tr style="font-weight:700;">
480 <td style="padding: 8px 20px 8px 0;text-align: right;border: none;border-top:1px solid #e2e8f0;padding-top:6px;margin-top:6px;">
481 <?php echo esc_html__('Payable now (added)', 'fluent-cart'); ?>
482 </td>
483 <td style="padding: 8px 8px 8px 0;width: 100px;text-align: right;border: none;border-top:1px solid #e2e8f0;padding-top:6px;margin-top:6px;">
484 <?php echo esc_html(\FluentCart\App\Helpers\Helper::toDecimal($invPayableTax)); ?>
485 </td>
486 </tr>
487 <?php endif; ?>
488 <?php else: ?>
489 <?php if (!empty($invoiceTaxLines)): ?>
490 <?php foreach ($invoiceTaxLines as $invoiceTaxLine): ?>
491 <tr>
492 <td style="padding: 8px 20px 8px 0;text-align: right;border: none;">
493 <?php echo esc_html($invoiceTaxLine['label']); ?>
494 </td>
495 <td style="padding: 8px 8px 8px 0;width: 100px;text-align: right;border: none;">
496 <?php echo esc_html(\FluentCart\App\Helpers\Helper::toDecimal($invoiceTaxLine['order_tax'])); ?>
497 </td>
498 </tr>
499 <?php endforeach; ?>
500 <?php else: ?>
501 <tr>
502 <td style="padding: 8px 20px 8px 0;text-align: right;border: none;">
503 <?php echo esc_html__('Tax', 'fluent-cart');
504 echo esc_html(\FluentCart\App\Helpers\Helper::getOrderTaxLabel($order));
505 ?>
506 </td>
507 <td style="padding: 8px 8px 8px 0;width: 100px;text-align: right;border: none;">
508 <?php echo esc_html(\FluentCart\App\Helpers\Helper::toDecimal($order->tax_total)); ?>
509 </td>
510 </tr>
511 <?php endif; ?>
512 <?php if ($order->shipping_tax > 0): ?>
513 <?php
514 $invoiceShippingTaxLines = Arr::get($invoiceTaxSummary, 'shippingTaxLines', []);
515 ?>
516 <?php if (!empty($invoiceShippingTaxLines)): ?>
517 <?php foreach ($invoiceShippingTaxLines as $invoiceShippingTaxLine): ?>
518 <tr>
519 <td style="padding: 8px 20px 8px 0;text-align: right;border: none;">
520 <?php echo esc_html($invoiceShippingTaxLine['label']); ?>
521 </td>
522 <td style="padding: 8px 8px 8px 0;width: 100px;text-align: right;border: none;">
523 <?php echo esc_html(\FluentCart\App\Helpers\Helper::toDecimal($invoiceShippingTaxLine['shipping_tax'])); ?>
524 </td>
525 </tr>
526 <?php endforeach; ?>
527 <?php else: ?>
528 <tr>
529 <td style="padding: 8px 20px 8px 0;text-align: right;border: none;">
530 <?php echo esc_html__('Shipping Tax', 'fluent-cart');
531 echo esc_html(\FluentCart\App\Helpers\Helper::getOrderTaxLabel($order));
532 ?>
533 </td>
534 <td style="padding: 8px 8px 8px 0;width: 100px;text-align: right;border: none;">
535 <?php echo esc_html(\FluentCart\App\Helpers\Helper::toDecimal($order->shipping_tax)); ?>
536 </td>
537 </tr>
538 <?php endif; ?>
539 <?php endif; ?>
540 <?php endif; ?>
541 </tbody>
542 </table>
543 </td>
544 </tr>
545 <?php endif; ?>
546
547 <?php if ($order->total_refund > 0): ?>
548 <tr style="font-weight: bold;font-size: 14px;">
549 <td style="font-weight:500;padding: 8px 20px 8px 0;text-align: right;border:none;">
550 <?php echo esc_html__('Refund', 'fluent-cart'); ?>
551 </td>
552 <td style="padding: 8px 8px 8px 0;width: 100px;text-align: right;border:none;">
553 - <?php echo esc_html(\FluentCart\App\Helpers\Helper::toDecimal($order->total_refund)); ?>
554 </td>
555 </tr>
556 <?php endif; ?>
557 <tr style="font-weight: bold;font-size: 14px;">
558 <td style="font-weight:500;padding: 8px 20px 8px 0;text-align: right;border:none;">
559 <?php echo esc_html__('Total', 'fluent-cart'); ?>
560 </td>
561 <td style="padding: 8px 8px 8px 0;width: 100px;text-align: right;border:none;">
562 <?php echo esc_html(\FluentCart\Api\CurrencySettings::getFormattedPrice($order->total_amount - $order->total_refund)); ?>
563 </td>
564 </tr>
565 <tr style="font-weight: bold;font-size: 14px;">
566 <td style="font-weight:500;padding: 8px 20px 8px 0;text-align: right;border:none;">
567 <?php echo esc_html__('Amount Paid', 'fluent-cart'); ?>
568 </td>
569 <td style="padding: 8px 8px 8px 0;width: 100px;text-align: right;border:none;">
570 <?php echo esc_html(\FluentCart\Api\CurrencySettings::getFormattedPrice($order->total_paid - $order->total_refund)); ?>
571 </td>
572 </tr>
573 </tbody>
574 </table>
575 </div>
576 <?php endif; ?>
577
578 <!-- tax note -->
579 <?php
580 if($order->isReverseChargeTaxOrder()): ?>
581
582 <div style="text-align: right; font-size: 14px; margin-top: 10px;">
583 <?php echo '*' . esc_html__('Tax to be paid on reverse charge basis', 'fluent-cart'); ?>
584 </div>
585
586 <?php endif ?>
587
588 <?php
589 $transactions = $order->transactions;
590 if (!empty($transactions)) :
591 ?>
592 <div style="margin-top: 30px;">
593 <div style="font-weight: bold;font-size: 14px;color: #495057;margin: 0;padding: 0;">
594 <?php echo esc_html__('Payment history', 'fluent-cart'); ?>
595 </div>
596 <table class="fct-transaction-table"
597 style="margin-top: 10px;width: 100%;text-align: left;border-spacing: 0;border-collapse: collapse;border: none;">
598 <thead>
599 <tr>
600 <th style="background-color: #f8f9fa;padding: 12px 8px;font-weight: bold;print-color-adjust: exact;border:none;">
601 <?php echo esc_html__('Payment method', 'fluent-cart'); ?>
602 </th>
603 <th style="background-color: #f8f9fa;padding: 12px 8px;font-weight: bold; text-align: center;print-color-adjust: exact;border:none;">
604 <?php echo esc_html__('Date', 'fluent-cart'); ?>
605 </th>
606 <th style="background-color: #f8f9fa;padding: 12px 8px;font-weight: bold; text-align: right;print-color-adjust: exact;border:none;">
607 <?php echo esc_html__('Amount', 'fluent-cart'); ?>
608 </th>
609 </tr>
610 </thead>
611 <tbody>
612 <?php foreach ($transactions as $transaction) :
613 if ($transaction->transaction_type === 'refund') {
614 continue;
615 }
616 ?>
617 <tr>
618 <td style="padding: 10px;border:none;border-bottom: 1px solid #dee2e6;">
619 <?php echo esc_html($transaction->getPaymentMethodText()); ?>
620 </td>
621 <td style="padding: 10px;border:none;border-bottom: 1px solid #dee2e6;text-align: center;">
622 <?php
623 echo esc_html(
624 date_i18n(
625 /* translators: Date format for order creation date */
626 __('M d, Y', 'fluent-cart'),
627 DateTime::anyTimeToGmt($transaction->created_at)->getTimestamp()
628 )
629 );
630 ?>
631 </td>
632 <td style="padding: 10px;border:none;border-bottom: 1px solid #dee2e6;text-align: right;">
633 <?php echo esc_html(\FluentCart\Api\CurrencySettings::getFormattedPrice($transaction->total)); ?>
634 </td>
635 </tr>
636 <?php endforeach; ?>
637 </tbody>
638 </table>
639 </div>
640 <?php endif; ?>
641
642 </div>
643 </div>
644 </div>
645 <?php
646 // include(__DIR__ . '/../emails/components/cta.php')
647 ?>
648 </div>
649 </div>
650
651
652 <?php if ($is_first_time) {
653 do_action('fluent_cart/order/receipt_viewed', [
654 'order' => $order,
655 'order_operation' => $order_operation
656 ]);
657 } ?>
658