| @@ -14,8 +14,9 @@ | ||
| 14 | 14 | |
| 15 | 15 | <?php |
| 16 | 16 | |
| 17 | 17 | use FluentCart\Framework\Support\Arr; |
| 18 | +use FluentCart\App\Modules\Tax\TaxModule; | |
| 18 | 19 | use FluentCart\App\Services\Renderer\Receipt\TaxSummaryHelper; |
| 19 | 20 | $allOrderItems = $order->order_items ? $order->order_items->toArray() : []; |
| 20 | 21 | $orderItems = array_filter($allOrderItems, function ($item) { |
| 21 | 22 | return !in_array($item['payment_type'] ?? '', ['signup_fee', 'fee']); |
| @@ -26,8 +27,9 @@ | ||
| 26 | 27 | $transaction = $order->getLatestTransaction(); |
| 27 | 28 | $isRefund = $is_refund ?? false; |
| 28 | 29 | $isReversed = $order->isReverseChargeTaxOrder(); |
| 29 | 30 | $rcMode = $order->getOrderRcMode(); |
| 31 | + $fctEmailDisplayMode = ($order instanceof \FluentCart\App\Models\Order) ? TaxSummaryHelper::getTaxDisplayMode() : 'itemized'; | |
| 30 | 32 | |
| 31 | 33 | ?> |
| 32 | 34 | |
| 33 | 35 | <table role="presentation" style="border-spacing:0;padding: 0; width: 100%;border: none"> |
| @@ -59,9 +61,9 @@ | ||
| 59 | 61 | <span style="font-size:12px;font-weight:400;color:rgb(75,85,99)">x <?php echo esc_html($item['quantity']); ?></span> |
| 60 | 62 | <?php endif; ?> |
| 61 | 63 | |
| 62 | 64 | <p style="margin: 0; font-size: 14px; color: #758195; font-weight: 400; line-height: 15px;"> |
| 63 | - - <?php echo esc_html($item['title']); ?> | |
| 65 | + - <?php echo esc_html(!empty($item['variation_display_title']) ? $item['variation_display_title'] : $item['title']); ?> | |
| 64 | 66 | </p> |
| 65 | 67 | |
| 66 | 68 | <?php if ($item['payment_type'] === 'subscription' && !empty($item['payment_info'])): ?> |
| 67 | 69 | <p style="font-size:12px;color:rgb(75,85,99);line-height:20px;margin: 3px 0 0 0;"> |
| @@ -74,9 +76,9 @@ | ||
| 74 | 76 | <?php |
| 75 | 77 | $otherInfo = is_array($item['other_info'] ?? null) ? $item['other_info'] : []; |
| 76 | 78 | $packageInfo = Arr::get($item, 'package_info', ''); |
| 77 | 79 | if (!$packageInfo && Arr::get($otherInfo, 'package_name')) { |
| 78 | - $packageInfo = \FluentCart\App\Services\Renderer\ProductCardRender::buildPackageInfoFromOtherInfo($otherInfo); | |
| 80 | + $packageInfo = \FluentCart\App\Services\Renderer\PackageDescriptionRenderer::buildPackageInfoFromOtherInfo($otherInfo); | |
| 79 | 81 | } |
| 80 | 82 | if ($packageInfo): |
| 81 | 83 | ?> |
| 82 | 84 | <p style="font-size:12px;color:rgb(107,114,128);line-height:18px;margin: 5px 0 0 0;"> |
| @@ -94,9 +96,9 @@ | ||
| 94 | 96 | |
| 95 | 97 | <?php |
| 96 | 98 | $itemRates = TaxSummaryHelper::getItemTaxRates($item); |
| 97 | 99 | ?> |
| 98 | - <?php if (!empty($itemRates)): ?> | |
| 100 | + <?php if ($fctEmailDisplayMode !== 'simplified' && !empty($itemRates)): ?> | |
| 99 | 101 | <tr> |
| 100 | 102 | <td colspan="3" style="padding: 0 16px 8px;"> |
| 101 | 103 | <table width="100%" style="border-spacing:0;border-collapse:collapse;"> |
| 102 | 104 | <?php foreach ($itemRates as $rate): |
| @@ -128,9 +130,9 @@ | ||
| 128 | 130 | <?php endforeach; ?> |
| 129 | 131 | </table> |
| 130 | 132 | </td> |
| 131 | 133 | </tr> |
| 132 | - <?php elseif (!empty($item['tax_amount'])): ?> | |
| 134 | + <?php elseif ($fctEmailDisplayMode !== 'simplified' && !empty($item['tax_amount'])): ?> | |
| 133 | 135 | <?php |
| 134 | 136 | $itemIsInclusive = TaxSummaryHelper::isPrimaryTaxInclusive($order); |
| 135 | 137 | $reversedAmountStyle = ($isReversed && (!$itemIsInclusive || $rcMode === 'dynamic')) ? 'text-decoration:line-through;opacity:0.6;' : ''; |
| 136 | 138 | $pillBg = $itemIsInclusive ? '#EAF3DE' : '#FAEEDA'; |
| @@ -190,9 +192,9 @@ | ||
| 190 | 192 | } |
| 191 | 193 | } |
| 192 | 194 | $sfRates = $sfSibling ? TaxSummaryHelper::getItemTaxRates($sfSibling) : []; |
| 193 | 195 | ?> |
| 194 | - <?php if (!empty($sfRates)): ?> | |
| 196 | + <?php if ($fctEmailDisplayMode !== 'simplified' && !empty($sfRates)): ?> | |
| 195 | 197 | <tr> |
| 196 | 198 | <td colspan="3" style="padding: 0 16px 8px;"> |
| 197 | 199 | <table width="100%" style="border-spacing:0;border-collapse:collapse;"> |
| 198 | 200 | <?php foreach ($sfRates as $sfRate): |
| @@ -233,9 +235,9 @@ | ||
| 233 | 235 | $sfOtherInfo = is_array($item['other_info'] ?? null) ? $item['other_info'] : []; |
| 234 | 236 | $sfTax = (int) Arr::get($sfOtherInfo, 'signup_fee_tax', 0); |
| 235 | 237 | } |
| 236 | 238 | ?> |
| 237 | - <?php if ($sfTax > 0): ?> | |
| 239 | + <?php if ($fctEmailDisplayMode !== 'simplified' && $sfTax > 0): ?> | |
| 238 | 240 | <?php |
| 239 | 241 | $sfIsInclusive = TaxSummaryHelper::isPrimaryTaxInclusive($order); |
| 240 | 242 | $reversedAmountStyle = ($isReversed && (!$sfIsInclusive || $rcMode === 'dynamic')) ? 'text-decoration:line-through;opacity:0.6;' : ''; |
| 241 | 243 | $sfFallbackBg = $sfIsInclusive ? '#EAF3DE' : '#FAEEDA'; |
| @@ -269,15 +271,19 @@ | ||
| 269 | 271 | <?php endif; ?> |
| 270 | 272 | <?php endforeach; ?> |
| 271 | 273 | </tbody> |
| 272 | 274 | </table> |
| 273 | -<table style="border-spacing:0;padding: 0; width: 100%;border: none;"> | |
| 275 | +<table style="border-spacing:0;padding: 0; width: 100%;border: none;margin-top:8px;"> | |
| 274 | 276 | <tr> |
| 277 | + <td colspan="2" style="border-top:1px solid #e5e7eb;padding-top:12px;font-size:0;line-height:0;"> </td> | |
| 278 | + </tr> | |
| 279 | + <tr> | |
| 275 | 280 | <td style="width: 50%;"></td> |
| 276 | 281 | <td style="width: 100%;"> |
| 277 | - <table role="presentation" | |
| 278 | - style="background-color:rgb(249,250,251);padding:16px;border-radius:8px;margin: 0; width: 100%;border: none;"> | |
| 282 | + <table role="presentation" width="400" | |
| 283 | + style="margin: 0 0 0 auto; width: 400px; max-width: 100%; border: none;"> | |
| 279 | 284 | <tbody> |
| 285 | + <!-- Zone A: plain subtotal / shipping / fees / discount --> | |
| 280 | 286 | <?php if ($order->subtotal != $order->total_amount): ?> |
| 281 | 287 | <tr style="width:100%"> |
| 282 | 288 | <td style="width:70%"> |
| 283 | 289 | <p style="font-size:14px;color:rgb(55,65,81);line-height:24px;margin: 0;"> |
| @@ -300,8 +306,9 @@ | ||
| 300 | 306 | $emailRcShippingAdj = (int) \FluentCart\Framework\Support\Arr::get($emailTaxSummaryEarly, 'rcShippingAdjustment', 0); |
| 301 | 307 | ?> |
| 302 | 308 | <?php if ($order->shipping_total > 0): |
| 303 | 309 | $emailDisplayShipping = max(0, (int) $order->shipping_total - $emailRcShippingAdj); |
| 310 | + $emailShippingMethodTitle = (string) \FluentCart\Framework\Support\Arr::get($order->config, 'shipping_method_title', ''); | |
| 304 | 311 | ?> |
| 305 | 312 | <tr style="width:100%"> |
| 306 | 313 | <td style="width:70%"> |
| 307 | 314 | <p style="font-size:14px;color:rgb(55,65,81);line-height:24px;margin: 0;"> |
| @@ -306,8 +313,13 @@ | ||
| 306 | 313 | <td style="width:70%"> |
| 307 | 314 | <p style="font-size:14px;color:rgb(55,65,81);line-height:24px;margin: 0;"> |
| 308 | 315 | <?php echo esc_html__('Shipping', 'fluent-cart'); ?> |
| 309 | 316 | </p> |
| 317 | + <?php if ($emailShippingMethodTitle): ?> | |
| 318 | + <p style="font-size:12px;color:rgb(107,114,128);line-height:18px;margin:0;"> | |
| 319 | + <?php echo esc_html($emailShippingMethodTitle); ?> | |
| 320 | + </p> | |
| 321 | + <?php endif; ?> | |
| 310 | 322 | </td> |
| 311 | 323 | <td style="width:30%;text-align:right"> |
| 312 | 324 | <p style="font-size:14px;color:rgb(55,65,81);margin:0;line-height:24px;"> |
| 313 | 325 | <?php echo esc_html(\FluentCart\App\Helpers\Helper::toDecimal($emailDisplayShipping)); ?> |
| @@ -383,25 +395,149 @@ | ||
| 383 | 395 | $emailTaxSummary = isset($emailTaxSummaryEarly) ? $emailTaxSummaryEarly : (($order instanceof \FluentCart\App\Models\Order) |
| 384 | 396 | ? TaxSummaryHelper::computeTaxSummary($order) |
| 385 | 397 | : ['shouldRender' => false]); |
| 386 | 398 | if ($emailTaxSummary['shouldRender']): |
| 399 | + $emailFoldedRateLines = Arr::get($emailTaxSummary, 'foldedRateLines', []); | |
| 400 | + $emailIncludedInPrices = (int) Arr::get($emailTaxSummary, 'includedInPrices', 0); | |
| 401 | + $emailPayableTax = (int) Arr::get($emailTaxSummary, 'payableTax', 0); | |
| 402 | + $emailTotalOrderTax = (int) Arr::get($emailTaxSummary, 'totalOrderTax', 0); | |
| 387 | 403 | ?> |
| 404 | + </tbody> | |
| 405 | + </table><!-- /Zone A --> | |
| 406 | + <!-- Zone B: tax breakdown inside its own grey box --> | |
| 407 | + <table role="presentation" align="right" width="400" | |
| 408 | + style="border-spacing:0;border-collapse:collapse;margin:12px 0 0 auto;width:400px;max-width:100%;border:none;"> | |
| 409 | + <tbody> | |
| 410 | + <tr> | |
| 411 | + <td style="background-color:rgb(249,250,251);padding:16px;border-radius:8px;"> | |
| 412 | + <table role="presentation" width="100%" | |
| 413 | + style="width:100%;border-spacing:0;border-collapse:collapse;border:none;"> | |
| 414 | + <tbody> | |
| 415 | + <?php if (($emailTaxSummary['displayMode'] ?? '') === 'simplified' && !empty($emailTaxSummary['simpleLine'])): ?> | |
| 416 | + <tr style="width:100%"> | |
| 417 | + <td style="width:70%"> | |
| 418 | + <p style="font-size:14px; font-weight:700; color:#1e293b; line-height:24px; margin:0;"> | |
| 419 | + <?php echo esc_html($emailTaxSummary['simpleLine']['label']); ?> | |
| 420 | + </p> | |
| 421 | + </td> | |
| 422 | + <td style="width:30%; text-align:right"> | |
| 423 | + <p style="font-size:14px; font-weight:700; color:#1e293b; margin:0; line-height:24px;"> | |
| 424 | + <?php echo esc_html($emailTaxSummary['simpleLine']['value']); ?> | |
| 425 | + </p> | |
| 426 | + </td> | |
| 427 | + </tr> | |
| 428 | + <?php endif; ?> | |
| 429 | + <?php if (($emailTaxSummary['displayMode'] ?? '') !== 'simplified'): ?> | |
| 388 | 430 | <tr style="width:100%"> |
| 389 | - <td colspan="2" style="padding:12px 0 4px;"> | |
| 431 | + <td colspan="2" style="padding:0 0 4px;"> | |
| 390 | 432 | <p style="font-size:10px; font-weight:600; text-transform:uppercase; |
| 391 | 433 | letter-spacing:0.06em; color:#94a3b8; margin:0;"> |
| 392 | - <?php echo esc_html__('TAX', 'fluent-cart'); ?> | |
| 434 | + <?php if (!empty($emailFoldedRateLines)): ?> | |
| 435 | + <?php echo esc_html__('Tax breakdown by rate', 'fluent-cart'); ?> | |
| 436 | + <?php else: ?> | |
| 437 | + <?php echo esc_html__('TAX', 'fluent-cart'); ?> | |
| 438 | + <?php endif; ?> | |
| 393 | 439 | </p> |
| 394 | 440 | </td> |
| 395 | 441 | </tr> |
| 396 | - <?php if ($emailTaxSummary['isReverseCharge']): ?> | |
| 397 | - <?php | |
| 398 | - $rcReversedTotal = (int) Arr::get($emailTaxSummary, 'reversedTaxTotal', 0); | |
| 399 | - $rcReversedShipping = (int) Arr::get($emailTaxSummary, 'reversedShippingTax', 0); | |
| 400 | - $rcReversedValue = $rcReversedTotal > 0 | |
| 401 | - ? \FluentCart\App\Helpers\Helper::toDecimal($rcReversedTotal) | |
| 402 | - : __('Charge reversed', 'fluent-cart'); | |
| 403 | - ?> | |
| 442 | + <?php | |
| 443 | + $rcReversedTotal = (int) Arr::get($emailTaxSummary, 'reversedTaxTotal', 0); | |
| 444 | + $rcReversedShipping = (int) Arr::get($emailTaxSummary, 'reversedShippingTax', 0); | |
| 445 | + $rcReversedValue = $rcReversedTotal > 0 | |
| 446 | + ? \FluentCart\App\Helpers\Helper::toDecimal($rcReversedTotal) | |
| 447 | + : __('Charge reversed', 'fluent-cart'); | |
| 448 | + ?> | |
| 449 | + <?php if (!empty($emailFoldedRateLines)): ?> | |
| 450 | + <tr style="width:100%"> | |
| 451 | + <td colspan="2" style="padding:0 0 4px;"> | |
| 452 | + <table style="width:100%;border-collapse:collapse;border-spacing:0;table-layout:fixed;"> | |
| 453 | + <tbody> | |
| 454 | + <tr> | |
| 455 | + <td style="width:58%;font-size:11px;text-transform:uppercase;color:rgb(107,114,128);font-weight:600;padding:2px 12px 2px 0;border:none;white-space:nowrap;"> | |
| 456 | + <?php echo esc_html__('Rate', 'fluent-cart'); ?> | |
| 457 | + </td> | |
| 458 | + <td style="width:24%;font-size:11px;text-transform:uppercase;color:rgb(107,114,128);font-weight:600;padding:2px 12px 2px 0;text-align:right;border:none;white-space:nowrap;"> | |
| 459 | + <?php echo esc_html__('Taxable base', 'fluent-cart'); ?> | |
| 460 | + </td> | |
| 461 | + <td style="width:18%;font-size:11px;text-transform:uppercase;color:rgb(107,114,128);font-weight:600;padding:2px 0 2px 0;text-align:right;border:none;white-space:nowrap;"> | |
| 462 | + <?php echo esc_html__('Tax', 'fluent-cart'); ?> | |
| 463 | + </td> | |
| 464 | + </tr> | |
| 465 | + <?php foreach ($emailFoldedRateLines as $emailFoldedLine): | |
| 466 | + $emailFoldedColor = !empty($emailFoldedLine['inclusive']) ? '#94a3b8' : '#1e293b'; | |
| 467 | + ?> | |
| 468 | + <tr> | |
| 469 | + <td style="width:58%;font-size:14px;line-height:20px;padding:3px 12px 3px 0;border:none;color:<?php echo esc_attr($emailFoldedColor); ?>;white-space:normal;word-break:break-word;overflow-wrap:break-word;vertical-align:top;"> | |
| 470 | + <?php echo esc_html($emailFoldedLine['label']); ?> | |
| 471 | + </td> | |
| 472 | + <td style="width:24%;font-size:13px;line-height:20px;padding:3px 12px 3px 0;text-align:right;border:none;color:#94a3b8;white-space:nowrap;vertical-align:top;"> | |
| 473 | + <?php echo esc_html(\FluentCart\App\Helpers\Helper::toDecimal($emailFoldedLine['base'])); ?> | |
| 474 | + </td> | |
| 475 | + <td style="width:18%;font-size:13px;line-height:20px;padding:3px 0 3px 0;text-align:right;border:none;color:<?php echo esc_attr($emailFoldedColor); ?>;white-space:nowrap;vertical-align:top;"> | |
| 476 | + <?php echo esc_html(\FluentCart\App\Helpers\Helper::toDecimal($emailFoldedLine['tax'])); ?> | |
| 477 | + </td> | |
| 478 | + </tr> | |
| 479 | + <?php endforeach; ?> | |
| 480 | + </tbody> | |
| 481 | + </table> | |
| 482 | + </td> | |
| 483 | + </tr> | |
| 484 | + <?php if ($emailTaxSummary['isReverseCharge']): ?> | |
| 485 | + <tr style="width:100%"> | |
| 486 | + <td style="width:70%"> | |
| 487 | + <p style="font-size:14px; font-weight:700; color:#1e293b; line-height:24px; margin:0; border-top:1px solid #e2e8f0; padding-top:4px;"> | |
| 488 | + <?php echo esc_html__('VAT reversed', 'fluent-cart'); ?> | |
| 489 | + </p> | |
| 490 | + </td> | |
| 491 | + <td style="width:30%; text-align:right"> | |
| 492 | + <p style="font-size:14px; font-weight:700; color:#1e293b; margin:0; line-height:24px; border-top:1px solid #e2e8f0; padding-top:4px;"> | |
| 493 | + <?php echo esc_html($rcReversedValue); ?> | |
| 494 | + </p> | |
| 495 | + </td> | |
| 496 | + </tr> | |
| 497 | + <?php else: ?> | |
| 498 | + <tr style="width:100%"> | |
| 499 | + <td style="width:70%"> | |
| 500 | + <p style="font-size:14px; font-weight:700; color:#1e293b; line-height:24px; margin:0; border-top:1px solid #e2e8f0; padding-top:4px;"> | |
| 501 | + <?php echo esc_html__('Total tax', 'fluent-cart'); ?> | |
| 502 | + </p> | |
| 503 | + </td> | |
| 504 | + <td style="width:30%; text-align:right"> | |
| 505 | + <p style="font-size:14px; font-weight:700; color:#1e293b; margin:0; line-height:24px; border-top:1px solid #e2e8f0; padding-top:4px;"> | |
| 506 | + <?php echo esc_html(\FluentCart\App\Helpers\Helper::toDecimal($emailTotalOrderTax)); ?> | |
| 507 | + </p> | |
| 508 | + </td> | |
| 509 | + </tr> | |
| 510 | + <?php if ($emailIncludedInPrices > 0): ?> | |
| 511 | + <tr style="width:100%"> | |
| 512 | + <td style="width:70%"> | |
| 513 | + <p style="font-size:13px; color:#94a3b8; line-height:22px; margin:0;"> | |
| 514 | + <?php echo esc_html__('of which included in prices', 'fluent-cart'); ?> | |
| 515 | + </p> | |
| 516 | + </td> | |
| 517 | + <td style="width:30%; text-align:right"> | |
| 518 | + <p style="font-size:13px; color:#94a3b8; margin:0; line-height:22px;"> | |
| 519 | + <?php echo esc_html(\FluentCart\App\Helpers\Helper::toDecimal($emailIncludedInPrices)); ?> | |
| 520 | + </p> | |
| 521 | + </td> | |
| 522 | + </tr> | |
| 523 | + <?php endif; ?> | |
| 524 | + <?php if ($emailPayableTax > 0 && $emailIncludedInPrices > 0): ?> | |
| 525 | + <tr style="width:100%"> | |
| 526 | + <td style="width:70%;border-top:1px solid #e2e8f0;padding-top:6px;margin-top:6px;"> | |
| 527 | + <p style="font-size:14px; font-weight:700; color:#1e293b; line-height:24px; margin:0;"> | |
| 528 | + <?php echo esc_html__('Payable now (added)', 'fluent-cart'); ?> | |
| 529 | + </p> | |
| 530 | + </td> | |
| 531 | + <td style="width:30%; text-align:right;border-top:1px solid #e2e8f0;padding-top:6px;margin-top:6px;"> | |
| 532 | + <p style="font-size:14px; font-weight:700; color:#1e293b; margin:0; line-height:24px;"> | |
| 533 | + <?php echo esc_html(\FluentCart\App\Helpers\Helper::toDecimal($emailPayableTax)); ?> | |
| 534 | + </p> | |
| 535 | + </td> | |
| 536 | + </tr> | |
| 537 | + <?php endif; ?> | |
| 538 | + <?php endif; ?> | |
| 539 | + <?php elseif ($emailTaxSummary['isReverseCharge']): ?> | |
| 404 | 540 | <?php if ($emailTaxSummary['showRcShippingRow'] && $rcReversedShipping > 0): ?> |
| 405 | 541 | <tr style="width:100%"> |
| 406 | 542 | <td style="width:70%"> |
| 407 | 543 | <p style="font-size:14px; color:#94a3b8; line-height:24px; margin:0;"> |
| @@ -429,12 +565,38 @@ | ||
| 429 | 565 | </tr> |
| 430 | 566 | <?php else: ?> |
| 431 | 567 | <?php |
| 432 | 568 | $emailFeeRowsList = Arr::get($emailTaxSummary, 'feeTaxLineRows', []); |
| 433 | - $rowCount = (int) ($emailTaxSummary['inclusiveTax'] > 0) + (int) ($emailTaxSummary['exclusiveTax'] > 0) + count($emailFeeRowsList) + (int) ($emailTaxSummary['shippingTax'] > 0); | |
| 434 | - $shouldShowBreakdown = $rowCount >= 2 || ($rowCount === 1 && !($emailTaxSummary['payableTax'] > 0 || $emailTaxSummary['inclusiveTax'] > 0 || (int) Arr::get($emailTaxSummary, 'inclusiveFeeTax', 0) > 0)); | |
| 569 | + $emailTaxRateLines = Arr::get($emailTaxSummary, 'taxRateLines', []); | |
| 570 | + $emailShippingLines = Arr::get($emailTaxSummary, 'shippingTaxLines', []); | |
| 571 | + $productTaxRowCount = !empty($emailTaxRateLines) | |
| 572 | + ? count($emailTaxRateLines) | |
| 573 | + : (int) ($emailTaxSummary['inclusiveTax'] > 0) + (int) ($emailTaxSummary['exclusiveTax'] > 0); | |
| 574 | + $rowCount = $productTaxRowCount + count($emailFeeRowsList) + (int) ($emailTaxSummary['shippingTax'] > 0); | |
| 575 | + $shouldShowBreakdown = !empty($emailTaxRateLines) | |
| 576 | + || !empty($emailShippingLines) | |
| 577 | + || $rowCount >= 2 | |
| 578 | + || ($rowCount === 1 && !($emailTaxSummary['payableTax'] > 0 || $emailTaxSummary['inclusiveTax'] > 0 || (int) Arr::get($emailTaxSummary, 'inclusiveFeeTax', 0) > 0)); | |
| 435 | 579 | ?> |
| 436 | - <?php if ($emailTaxSummary['inclusiveTax'] > 0 && $shouldShowBreakdown): ?> | |
| 580 | + <?php if (!empty($emailTaxRateLines) && $shouldShowBreakdown): ?> | |
| 581 | + <?php foreach ($emailTaxRateLines as $emailTaxRateLine): | |
| 582 | + $emailTaxRateColor = !empty($emailTaxRateLine['inclusive']) ? '#94a3b8' : '#1e293b'; | |
| 583 | + $emailTaxRateWeight = !empty($emailTaxRateLine['inclusive']) ? 'normal' : '600'; ?> | |
| 584 | + <tr style="width:100%"> | |
| 585 | + <td style="width:70%"> | |
| 586 | + <p style="font-size:14px; font-weight:<?php echo esc_attr($emailTaxRateWeight); ?>; color:<?php echo esc_attr($emailTaxRateColor); ?>; line-height:24px; margin:0;"> | |
| 587 | + <?php echo esc_html($emailTaxRateLine['label']); ?> | |
| 588 | + </p> | |
| 589 | + </td> | |
| 590 | + <td style="width:30%; text-align:right"> | |
| 591 | + <p style="font-size:14px; font-weight:<?php echo esc_attr($emailTaxRateWeight); ?>; color:<?php echo esc_attr($emailTaxRateColor); ?>; margin:0; line-height:24px;"> | |
| 592 | + <?php echo esc_html(\FluentCart\App\Helpers\Helper::toDecimal($emailTaxRateLine['order_tax'])); ?> | |
| 593 | + </p> | |
| 594 | + </td> | |
| 595 | + </tr> | |
| 596 | + <?php endforeach; ?> | |
| 597 | + <?php endif; ?> | |
| 598 | + <?php if (empty($emailTaxRateLines) && $emailTaxSummary['inclusiveTax'] > 0 && $shouldShowBreakdown): ?> | |
| 437 | 599 | <tr style="width:100%"> |
| 438 | 600 | <td style="width:70%"> |
| 439 | 601 | <p style="font-size:14px; color:#94a3b8; line-height:24px; margin:0;"> |
| 440 | 602 | <?php echo esc_html__('Included in item prices', 'fluent-cart'); ?> |
| @@ -446,9 +608,9 @@ | ||
| 446 | 608 | </p> |
| 447 | 609 | </td> |
| 448 | 610 | </tr> |
| 449 | 611 | <?php endif; ?> |
| 450 | - <?php if ($emailTaxSummary['exclusiveTax'] > 0 && $shouldShowBreakdown): ?> | |
| 612 | + <?php if (empty($emailTaxRateLines) && $emailTaxSummary['exclusiveTax'] > 0 && $shouldShowBreakdown): ?> | |
| 451 | 613 | <tr style="width:100%"> |
| 452 | 614 | <td style="width:70%"> |
| 453 | 615 | <p style="font-size:14px; font-weight:600; color:#1e293b; line-height:24px; margin:0;"> |
| 454 | 616 | <?php echo esc_html__('Added on products', 'fluent-cart'); ?> |
| @@ -480,9 +642,8 @@ | ||
| 480 | 642 | <?php endforeach; ?> |
| 481 | 643 | <?php endif; ?> |
| 482 | 644 | <?php if ($emailTaxSummary['shippingTax'] > 0 && $shouldShowBreakdown): |
| 483 | 645 | $isShippingInclusive = (bool) Arr::get($emailTaxSummary, 'isShippingInclusive', false); |
| 484 | - $emailShippingLines = Arr::get($emailTaxSummary, 'shippingTaxLines', []); | |
| 485 | 646 | $emailShippingColor = $isShippingInclusive ? '#94a3b8' : '#1e293b'; |
| 486 | 647 | $emailShippingWeight = $isShippingInclusive ? 'normal' : '600'; |
| 487 | 648 | if (!empty($emailShippingLines)): |
| 488 | 649 | foreach ($emailShippingLines as $shLine): ?> |
| @@ -543,8 +704,19 @@ | ||
| 543 | 704 | </tr> |
| 544 | 705 | <?php endif; ?> |
| 545 | 706 | <?php endif; ?> |
| 546 | 707 | <?php endif; ?> |
| 708 | + </tbody> | |
| 709 | + </table> | |
| 710 | + </td> | |
| 711 | + </tr> | |
| 712 | + </tbody> | |
| 713 | + </table><!-- /Zone B: grey tax box --> | |
| 714 | + <table role="presentation" width="400" | |
| 715 | + style="margin:12px 0 0 auto; width: 400px; max-width: 100%; border: none;"> | |
| 716 | + <tbody> | |
| 717 | + <!-- Zone C: plain refund / total / payment --> | |
| 718 | + <?php endif; ?> | |
| 547 | 719 | |
| 548 | 720 | <?php if ($order->total_refund > 0 && $isRefund): ?> |
| 549 | 721 | <tr style="width:100%"> |
| 550 | 722 | <td style="width:70%"> |
| @@ -608,9 +780,9 @@ | ||
| 608 | 780 | </table> |
| 609 | 781 | <?php |
| 610 | 782 | if($order->isReverseChargeTaxOrder()): ?> |
| 611 | 783 | <div style="text-align: right; font-size: 14px; margin-top: 10px;"> |
| 612 | - <?php echo '*' . esc_html__('Tax to be paid on reverse charge basis', 'fluent-cart'); ?> | |
| 784 | + <?php echo '*' . esc_html(TaxModule::getReverseChargeNoticeText()); ?> | |
| 613 | 785 | </div> |
| 614 | 786 | |
| 615 | 787 | <?php endif ?> |
| 616 | 788 | </td> |
| @@ -615,5 +787,4 @@ | ||
| 615 | 787 | <?php endif ?> |
| 616 | 788 | </td> |
| 617 | 789 | </tr> |
| 618 | 790 | </table> |
| 619 | - | |