| @@ -35,14 +35,13 @@ | ||
| 35 | 35 | ?> |
| 36 | 36 | </p> |
| 37 | 37 | |
| 38 | 38 | <?php |
| 39 | - $orderTaxRates = $order->orderTaxRates->first(); | |
| 40 | 39 | $companyName = Arr::get($order->billing_address->meta ?? [], 'other_data.company_name', ''); |
| 41 | 40 | $phone = Arr::get($order->billing_address->meta ?? [], 'other_data.phone', ''); |
| 42 | 41 | |
| 43 | 42 | if ($companyName == '') { |
| 44 | - $companyName = Arr::get($orderTaxRates->meta ?? [], 'vat_reverse.name', ''); | |
| 43 | + $companyName = $order->getCustomerTaxName(); | |
| 45 | 44 | } |
| 46 | 45 | |
| 47 | 46 | // show phone number |
| 48 | 47 | if ($phone !== ''): |
| @@ -61,17 +60,40 @@ | ||
| 61 | 60 | <?php |
| 62 | 61 | } |
| 63 | 62 | |
| 64 | 63 | // show order tax rates |
| 65 | - if ($orderTaxRates) : | |
| 66 | - $vatNumber = Arr::get($orderTaxRates->meta ?? [], 'vat_reverse.vat_number', ''); | |
| 67 | - if ($vatNumber !== '') : | |
| 68 | - ?> | |
| 69 | - <p style="font-size:12px;margin:0px;margin-top:8px;text-transform:uppercase;letter-spacing:1px;line-height:24px;margin-top:0px;margin-left:0px;margin-right:0px"> | |
| 70 | - <?php echo esc_html__('EU VAT', 'fluent-cart') . ': ' . esc_html($vatNumber); ?> | |
| 71 | - </p> | |
| 72 | - <?php | |
| 73 | - endif; | |
| 64 | + $vatNumber = $order->getCustomerTaxNumber(); | |
| 65 | + if ($vatNumber !== '') : | |
| 66 | + ?> | |
| 67 | + <p style="font-size:12px;margin:0px;margin-top:8px;text-transform:uppercase;letter-spacing:1px;line-height:24px;margin-top:0px;margin-left:0px;margin-right:0px"> | |
| 68 | + <?php | |
| 69 | + $vatLabel = __('VAT/Tax ID', 'fluent-cart'); | |
| 70 | + echo esc_html($vatLabel) . ': ' . esc_html($vatNumber); | |
| 71 | + ?> | |
| 72 | + </p> | |
| 73 | + <?php | |
| 74 | + endif; | |
| 75 | + | |
| 76 | + $legalRegId = Arr::get($order->billing_address->meta ?? [], 'other_data.legal_registration_id', ''); | |
| 77 | + if ($legalRegId === '') { | |
| 78 | + $legalRegId = Arr::get($order->getBusinessInfo(), 'legal_registration_id', ''); | |
| 79 | + } | |
| 80 | + if ($legalRegId !== ''): | |
| 81 | + ?> | |
| 82 | + <p style="font-size:12px;margin:0px;margin-top:8px;text-transform:uppercase;letter-spacing:1px;line-height:24px;margin-top:0px;margin-left:0px;margin-right:0px"> | |
| 83 | + <?php echo esc_html__('Reg. ID', 'fluent-cart') . ': ' . esc_html($legalRegId); ?> | |
| 84 | + </p> | |
| 85 | + <?php | |
| 86 | + endif; | |
| 87 | + | |
| 88 | + $reverseChargeDeclaration = Arr::get($order->getBusinessInfo(), 'reverse_charge_declaration', ''); | |
| 89 | + if ($reverseChargeDeclaration !== ''): | |
| 90 | + ?> | |
| 91 | + <p style="font-size:12px;margin:0px;margin-top:8px;line-height:24px;"> | |
| 92 | + <strong><?php echo esc_html__('Reverse Charge Declaration', 'fluent-cart'); ?>:</strong> | |
| 93 | + <?php echo esc_html($reverseChargeDeclaration); ?> | |
| 94 | + </p> | |
| 95 | + <?php | |
| 74 | 96 | endif; |
| 75 | 97 | ?> |
| 76 | 98 | </td> |
| 77 | 99 | <td style="width:50%;padding-right: 0;padding-left: 10px;"> |