| @@ -29,8 +29,11 @@ | ||
| 29 | 29 | * @return string Rendered HTML |
| 30 | 30 | */ |
| 31 | 31 | public function renderField(array $field, $invoice = null): string { |
| 32 | 32 | $type = $field['type'] ?? 'text'; |
| 33 | + if ('attachments' === $type) { | |
| 34 | + return \EasyInvoice\Services\DocumentAttachments::renderField($field, $invoice); | |
| 35 | + } | |
| 33 | 36 | |
| 34 | 37 | // Convert field type to camelCase for method name generation |
| 35 | 38 | $method_name = 'render' . easy_invoice_str_replace('_', '', ucwords($type, '_')) . 'Field'; |
| 36 | 39 | |
| @@ -610,9 +613,9 @@ | ||
| 610 | 613 | } |
| 611 | 614 | |
| 612 | 615 | // Check if toggle state is enabled (either from selected gateways or toggle state field) |
| 613 | 616 | $toggle_enabled = $has_custom_selection; |
| 614 | - if ($invoice && method_exists($invoice, 'getPaymentGatewaysToggleState')) { | |
| 617 | + if ($invoice && is_callable([$invoice, 'getPaymentGatewaysToggleState'])) { | |
| 615 | 618 | $toggle_state = $invoice->getPaymentGatewaysToggleState(); |
| 616 | 619 | if ($toggle_state === '1') { |
| 617 | 620 | $toggle_enabled = true; |
| 618 | 621 | } |