getFieldConfigForJavaScript(); // Trigger form initialization to allow pro version to register new elements do_action('easy_invoice_form_init'); $tabs = $form_manager->getTabs(); $templates = $form_manager->getTemplates(); // Create a separate array for browse templates modal with all available templates $all_templates = apply_filters('easy_invoice_invoice_templates', [ 'standard' => [ 'name' => __('Standard', 'easy-invoice'), 'icon' => 'fas fa-file-invoice', 'description' => __('Clean and professional standard template', 'easy-invoice'), 'order' => 1, 'is_free' => true ], 'legacy' => [ 'name' => __('Legacy', 'easy-invoice'), 'icon' => 'fas fa-file-alt', 'description' => __('Clean, minimalist design with traditional business layout', 'easy-invoice'), 'order' => 2, 'is_free' => true ], 'professional' => [ 'name' => __('Professional', 'easy-invoice'), 'icon' => 'fas fa-briefcase', 'description' => __('Professional business template with modern design', 'easy-invoice'), 'order' => 3, 'is_free' => false ], 'modern' => [ 'name' => __('Modern', 'easy-invoice'), 'icon' => 'fas fa-rocket', 'description' => __('Modern and sleek design template', 'easy-invoice'), 'order' => 4, 'is_free' => false ], 'classic' => [ 'name' => __('Classic', 'easy-invoice'), 'icon' => 'fas fa-landmark', 'description' => __('Traditional business template', 'easy-invoice'), 'order' => 5, 'is_free' => false ], 'minimal' => [ 'name' => __('Minimal', 'easy-invoice'), 'icon' => 'fas fa-minus', 'description' => __('Simple and clean minimal template', 'easy-invoice'), 'order' => 6, 'is_free' => false ], 'corporate' => [ 'name' => __('Corporate', 'easy-invoice'), 'icon' => 'fas fa-building', 'description' => __('Professional corporate template', 'easy-invoice'), 'order' => 7, 'is_free' => false ], 'elegant' => [ 'name' => __('Elegant', 'easy-invoice'), 'icon' => 'fas fa-gem', 'description' => __('Elegant and sophisticated design', 'easy-invoice'), 'order' => 8, 'is_free' => false ], 'creative' => [ 'name' => __('Creative', 'easy-invoice'), 'icon' => 'fas fa-palette', 'description' => __('Creative and artistic design template', 'easy-invoice'), 'order' => 9, 'is_free' => false ] ]); // Load client data directly in PHP if invoice has a client $client_data = null; if ($invoice && $invoice->getClientId()) { $client = \EasyInvoice\Providers\ClientServiceProvider::getClientRepository()->find($invoice->getClientId()); if ($client) { $client_data = array( 'id' => $client->getId(), 'name' => $client->getBusinessClientName() ?: ($client->getFirstName() . ' ' . $client->getLastName()), 'email' => $client->getEmail() ?: '', 'phone' => $client->getExtraInfo() ?: '', 'company' => $client->getBusinessClientName() ?: '', 'address' => $client->getAddress() ?: '', 'website' => $client->getWebsite() ?: '', ); } } ?>