From ed0bfd3a71b2d6abc758481a57363a483856a125 Mon Sep 17 00:00:00 2001 From: Alexandre Faustino Date: Mon, 9 Dec 2024 11:57:55 +0000 Subject: [PATCH 01/21] Fix: jQuery `tipTip` function not available #915 --- includes/Assets.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/includes/Assets.php b/includes/Assets.php index c0eb10227..5ac10cd24 100644 --- a/includes/Assets.php +++ b/includes/Assets.php @@ -20,7 +20,7 @@ public static function instance() { public function __construct() { add_action( 'wp_enqueue_scripts', array( $this, 'frontend_scripts_styles' ) ); - add_action( 'admin_enqueue_scripts', array( $this, 'backend_scripts_styles' ) ); + add_action( 'admin_enqueue_scripts', array( $this, 'backend_scripts_styles' ), 11 ); // after WC } /** @@ -134,9 +134,13 @@ public function backend_scripts_styles ( $hook ) { wp_enqueue_style( 'wp-pointer' ); } + if ( ! wp_script_is( 'jquery-tiptip', 'enqueued' ) ) { + wp_enqueue_script( 'jquery-tiptip' ); + } + wp_enqueue_script( 'wpo-wcpdf-admin', - WPO_WCPDF()->plugin_url() . '/assets/js/admin-script'.$suffix.'.js', + WPO_WCPDF()->plugin_url() . '/assets/js/admin-script' . $suffix . '.js', array( 'jquery', 'wc-enhanced-select', 'jquery-blockui', 'jquery-tiptip', 'wp-pointer' ), WPO_WCPDF_VERSION ); From 4412162bcc9d760f4119b5fd40b361b62db4e4ba Mon Sep 17 00:00:00 2001 From: Mohamad <136313810+MohamadNateqi@users.noreply.github.com> Date: Mon, 9 Dec 2024 19:42:26 +0330 Subject: [PATCH 02/21] New: adds user info to order notes when generating documents (#913) --- includes/Main.php | 96 ++++++++++++++++++++++++++++++++++++++--------- 1 file changed, 79 insertions(+), 17 deletions(-) diff --git a/includes/Main.php b/includes/Main.php index 423c2b055..3d689b7ec 100644 --- a/includes/Main.php +++ b/includes/Main.php @@ -1265,16 +1265,44 @@ public function set_phpmailer_validator( $mailArray ) { * * @param object $document * @param string $trigger + * * @return void */ - public function log_document_creation_to_order_notes( $document, $trigger ) { + public function log_document_creation_to_order_notes( object $document, string $trigger ) { + if ( empty( $document ) || empty( $trigger ) || ! isset( WPO_WCPDF()->settings->debug_settings['log_to_order_notes'] ) ) { + return; + } + $triggers = $this->get_document_triggers(); - if ( ! empty( $document ) && isset( WPO_WCPDF()->settings->debug_settings['log_to_order_notes'] ) && ! empty( $trigger ) && array_key_exists( $trigger, $triggers ) ) { - /* translators: 1. document title, 2. creation trigger */ - $message = __( 'PDF %1$s created via %2$s.', 'woocommerce-pdf-invoices-packing-slips' ); - $note = sprintf( $message, $document->get_title(), $triggers[$trigger] ); - $this->log_to_order_notes( $note, $document ); + + if ( ! array_key_exists( $trigger, $triggers ) ) { + return; } + + $user_note = ''; + $manual_triggers = $this->get_document_triggers( 'manual' ); + + // Add user information if the trigger is manual. + if ( array_key_exists( $trigger, $manual_triggers ) ) { + $user = wp_get_current_user(); + + if ( ! empty( $user->user_login ) ) { + $user_note = sprintf( + ' (%s: %s)', + __( 'User', 'woocommerce-pdf-invoices-packing-slips' ), + esc_html( $user->user_login ) + ); + } + } + + $note = sprintf( + /* translators: 1. document title, 2. creation trigger */ + __( 'PDF %1$s created via %2$s.', 'woocommerce-pdf-invoices-packing-slips' ), + $document->get_title(), + $triggers[ $trigger ] + ); + + $this->log_to_order_notes( $note . $user_note, $document ); } /** @@ -1286,10 +1314,24 @@ public function log_document_creation_to_order_notes( $document, $trigger ) { */ public function log_document_deletion_to_order_notes( object $document ): void { if ( ! empty( WPO_WCPDF()->settings->debug_settings['log_to_order_notes'] ) ) { - /* translators: document title */ - $message = __( 'PDF %s deleted.', 'woocommerce-pdf-invoices-packing-slips' ); - $note = sprintf( $message, $document->get_title() ); - $this->log_to_order_notes( $note, $document ); + $user_note = ''; + $user = wp_get_current_user(); + + if ( ! empty( $user->user_login ) ) { + $user_note = sprintf( + ' (%s: %s)', + __( 'User', 'woocommerce-pdf-invoices-packing-slips' ), + esc_html( $user->user_login ) + ); + } + + $note = sprintf( + /* translators: document title */ + __( 'PDF %s deleted.', 'woocommerce-pdf-invoices-packing-slips' ), + $document->get_title() + ); + + $this->log_to_order_notes( $note . $user_note, $document ); } } @@ -1405,16 +1447,36 @@ public function log_document_creation_trigger_to_order_meta( $document, $trigger /** * Get the document triggers * + * @param string $trigger_type The trigger type: 'manual', 'automatic', or 'all'. Defaults to 'all'. + * * @return array */ - public function get_document_triggers() { - return apply_filters( 'wpo_wcpdf_document_triggers', [ - 'single' => __( 'single order action', 'woocommerce-pdf-invoices-packing-slips' ), - 'bulk' => __( 'bulk order action', 'woocommerce-pdf-invoices-packing-slips' ), - 'my_account' => __( 'my account', 'woocommerce-pdf-invoices-packing-slips' ), + public function get_document_triggers( string $trigger_type = 'all' ): array { + $manual_triggers = apply_filters( 'wpo_wcpdf_manual_document_triggers', array( + 'single' => __( 'single order action', 'woocommerce-pdf-invoices-packing-slips' ), + 'bulk' => __( 'bulk order action', 'woocommerce-pdf-invoices-packing-slips' ), + 'my_account' => __( 'my account', 'woocommerce-pdf-invoices-packing-slips' ), + 'document_data' => __( 'order document data (number and/or date set manually)', 'woocommerce-pdf-invoices-packing-slips' ), + ) ); + + $automatic_triggers = apply_filters( 'wpo_wcpdf_automatic_document_triggers', array( 'email_attachment' => __( 'email attachment', 'woocommerce-pdf-invoices-packing-slips' ), - 'document_data' => __( 'order document data (number and/or date set manually)', 'woocommerce-pdf-invoices-packing-slips' ), - ] ); + ) ); + + switch ( $trigger_type ) { + case 'manual': + $triggers = $manual_triggers; + break; + case 'automatic': + $triggers = $automatic_triggers; + break; + case 'all': + default: + $triggers = array_merge( $manual_triggers, $automatic_triggers ); + break; + } + + return apply_filters( 'wpo_wcpdf_document_triggers', $triggers, $trigger_type ); } /** From 406406fe3d8c305ec059bb4573c19411a0eb1c6a Mon Sep 17 00:00:00 2001 From: Mohamad <136313810+MohamadNateqi@users.noreply.github.com> Date: Tue, 10 Dec 2024 11:49:58 +0330 Subject: [PATCH 03/21] Fix: UBL issue with empty tax on line items (#904) --- ubl/Handlers/Invoice/InvoiceLineHandler.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ubl/Handlers/Invoice/InvoiceLineHandler.php b/ubl/Handlers/Invoice/InvoiceLineHandler.php index bbbb14d78..52382bcd0 100644 --- a/ubl/Handlers/Invoice/InvoiceLineHandler.php +++ b/ubl/Handlers/Invoice/InvoiceLineHandler.php @@ -23,6 +23,10 @@ public function handle( $data, $options = array() ) { $line_tax_data = $item[ $taxDataContainer ]; foreach ( $line_tax_data[ $taxDataKey ] as $tax_id => $tax ) { + if ( empty( $tax ) ) { + $tax = 0; + } + if ( ! is_numeric( $tax ) ) { continue; } From a94b2ac1292fca7ccf5952f7c0c89c5fb3b89560 Mon Sep 17 00:00:00 2001 From: Mohamad <136313810+MohamadNateqi@users.noreply.github.com> Date: Tue, 10 Dec 2024 12:38:18 +0330 Subject: [PATCH 04/21] Fix: server requirements admin notice issue (#914) --- includes/Settings/SettingsDebug.php | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/includes/Settings/SettingsDebug.php b/includes/Settings/SettingsDebug.php index 8fe787ff2..d66d10582 100644 --- a/includes/Settings/SettingsDebug.php +++ b/includes/Settings/SettingsDebug.php @@ -23,7 +23,7 @@ public static function instance() { public function __construct() { // Show a notice if the plugin requirements are not met. - add_action( 'admin_init', array( $this, 'display_server_requirement_notice' ) ); + add_action( 'admin_init', array( $this, 'handle_server_requirement_notice' ) ); add_action( 'admin_init', array( $this, 'init_settings' ) ); add_action( 'wpo_wcpdf_settings_output_debug', array( $this, 'output' ), 10, 1 ); @@ -1066,7 +1066,7 @@ public function get_server_config(): array { * * @return void */ - public function display_server_requirement_notice(): void { + public function handle_server_requirement_notice(): void { // Return if the notice has been dismissed. if ( get_option( 'wpo_wcpdf_dismiss_requirements_notice', false ) ) { return; @@ -1105,6 +1105,15 @@ public function display_server_requirement_notice(): void { } // Display the notice. + add_action( 'admin_notices', array( $this, 'display_server_requirement_notice' ) ); + } + + /** + * Display a notice informing the user that the server requirements are not met. + * + * @return void + */ + public function display_server_requirement_notice(): void { $status_page_url = admin_url( 'admin.php?page=wpo_wcpdf_options_page&tab=debug§ion=status' ); $dismiss_url = wp_nonce_url( add_query_arg( 'wpo_dismiss_requirements_notice', true ), 'dismiss_requirements_notice' ); $notice_message = sprintf( From 78a8e455556065ae51657ba50ad168e9f8e3009e Mon Sep 17 00:00:00 2001 From: Mohamad Nateqi Rostami Date: Tue, 10 Dec 2024 15:56:22 +0330 Subject: [PATCH 05/21] Add shop phone number field for e-Invoice support --- includes/Settings/SettingsGeneral.php | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/includes/Settings/SettingsGeneral.php b/includes/Settings/SettingsGeneral.php index 4b7ecbce7..f97f4c867 100644 --- a/includes/Settings/SettingsGeneral.php +++ b/includes/Settings/SettingsGeneral.php @@ -197,6 +197,19 @@ public function init_settings() { 'description' => __( 'Required for UBL output format.
You can display this number on the invoice from the document settings.', 'woocommerce-pdf-invoices-packing-slips' ) . ' ' . $requires_pro , ) ), + array( + 'type' => 'setting', + 'id' => 'shop_phone_number', + 'title' => __( 'Shop Phone Number', 'woocommerce-pdf-invoices-packing-slips' ), + 'callback' => 'text_input', + 'section' => 'general_settings', + 'args' => array( + 'option_name' => $option_name, + 'id' => 'shop_phone_number', + 'translatable' => true, + 'description' => __( 'Required for e-Invoice.', 'woocommerce-pdf-invoices-packing-slips' ) . ' ' . $requires_pro , + ) + ), array( 'type' => 'setting', 'id' => 'shop_address', From 2efde2996d7c6f660ecc9018af9cea09f95a7614 Mon Sep 17 00:00:00 2001 From: Mohamad Nateqi Rostami Date: Tue, 10 Dec 2024 18:03:48 +0330 Subject: [PATCH 06/21] Fix issues, WPCS --- includes/Settings/SettingsGeneral.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/includes/Settings/SettingsGeneral.php b/includes/Settings/SettingsGeneral.php index f97f4c867..a2e6c7399 100644 --- a/includes/Settings/SettingsGeneral.php +++ b/includes/Settings/SettingsGeneral.php @@ -181,7 +181,7 @@ public function init_settings() { 'option_name' => $option_name, 'id' => 'vat_number', 'translatable' => true, - 'description' => __( 'Required for UBL output format.
You can display this number on the invoice from the document settings.', 'woocommerce-pdf-invoices-packing-slips' ) . ' ' . $requires_pro , + 'description' => __( 'Required for UBL output format.
You can display this number on the invoice from the document settings.', 'woocommerce-pdf-invoices-packing-slips' ) . ' ' . $requires_pro, ) ), array( @@ -194,20 +194,20 @@ public function init_settings() { 'option_name' => $option_name, 'id' => 'coc_number', 'translatable' => true, - 'description' => __( 'Required for UBL output format.
You can display this number on the invoice from the document settings.', 'woocommerce-pdf-invoices-packing-slips' ) . ' ' . $requires_pro , + 'description' => __( 'Required for UBL output format.
You can display this number on the invoice from the document settings.', 'woocommerce-pdf-invoices-packing-slips' ) . ' ' . $requires_pro, ) ), array( 'type' => 'setting', - 'id' => 'shop_phone_number', + 'id' => 'phone_number', 'title' => __( 'Shop Phone Number', 'woocommerce-pdf-invoices-packing-slips' ), 'callback' => 'text_input', 'section' => 'general_settings', 'args' => array( 'option_name' => $option_name, - 'id' => 'shop_phone_number', + 'id' => 'phone_number', 'translatable' => true, - 'description' => __( 'Required for e-Invoice.', 'woocommerce-pdf-invoices-packing-slips' ) . ' ' . $requires_pro , +// 'description' => __( 'Required for e-Invoice.', 'woocommerce-pdf-invoices-packing-slips' ), ) ), array( From 60a1a00bc1bf865cd69a36cf8aff33b150a5aa36 Mon Sep 17 00:00:00 2001 From: Mohamad Nateqi Rostami Date: Tue, 10 Dec 2024 18:15:22 +0330 Subject: [PATCH 07/21] Update the ID --- includes/Settings/SettingsGeneral.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/includes/Settings/SettingsGeneral.php b/includes/Settings/SettingsGeneral.php index a2e6c7399..5e80c9506 100644 --- a/includes/Settings/SettingsGeneral.php +++ b/includes/Settings/SettingsGeneral.php @@ -199,13 +199,13 @@ public function init_settings() { ), array( 'type' => 'setting', - 'id' => 'phone_number', + 'id' => 'shop_phone_number', 'title' => __( 'Shop Phone Number', 'woocommerce-pdf-invoices-packing-slips' ), 'callback' => 'text_input', 'section' => 'general_settings', 'args' => array( 'option_name' => $option_name, - 'id' => 'phone_number', + 'id' => 'shop_phone_number', 'translatable' => true, // 'description' => __( 'Required for e-Invoice.', 'woocommerce-pdf-invoices-packing-slips' ), ) From 36e704ad1b4a84d42b82efa15307002f277aef87 Mon Sep 17 00:00:00 2001 From: Mohamad Nateqi Rostami Date: Wed, 11 Dec 2024 13:43:17 +0330 Subject: [PATCH 08/21] Improve the description of the "Remove released semaphore locks" tool --- views/advanced-tools.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/views/advanced-tools.php b/views/advanced-tools.php index 730387990..eac648bfa 100644 --- a/views/advanced-tools.php +++ b/views/advanced-tools.php @@ -60,7 +60,7 @@

-

+

From 63d057f6e678de0e600991f7b87caf1c6e2e8e92 Mon Sep 17 00:00:00 2001 From: Alexandre Faustino Date: Wed, 11 Dec 2024 15:07:24 +0000 Subject: [PATCH 09/21] v3.9.1-beta-3 --- woocommerce-pdf-invoices-packingslips.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/woocommerce-pdf-invoices-packingslips.php b/woocommerce-pdf-invoices-packingslips.php index 27b94e059..d39f0084f 100644 --- a/woocommerce-pdf-invoices-packingslips.php +++ b/woocommerce-pdf-invoices-packingslips.php @@ -4,14 +4,14 @@ * Requires Plugins: woocommerce * Plugin URI: https://wpovernight.com/downloads/woocommerce-pdf-invoices-packing-slips-bundle/ * Description: Create, print & email PDF or UBL Invoices & PDF Packing Slips for WooCommerce orders. - * Version: 3.9.1-beta-2 + * Version: 3.9.1-beta-3 * Author: WP Overnight * Author URI: https://www.wpovernight.com * License: GPLv2 or later * License URI: https://opensource.org/licenses/gpl-license.php * Text Domain: woocommerce-pdf-invoices-packing-slips * WC requires at least: 3.3 - * WC tested up to: 9.4 + * WC tested up to: 9.5 */ if ( ! defined( 'ABSPATH' ) ) { @@ -22,7 +22,7 @@ class WPO_WCPDF { - public $version = '3.9.1-beta-2'; + public $version = '3.9.1-beta-3'; public $version_php = '7.4'; public $version_woo = '3.3'; public $version_wp = '4.4'; From a04f2b2339acb6e277889360a3c3c0a69f6746fe Mon Sep 17 00:00:00 2001 From: Alexandre Faustino Date: Wed, 11 Dec 2024 15:09:43 +0000 Subject: [PATCH 10/21] Update readme.txt --- readme.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/readme.txt b/readme.txt index c6a8530cd..2bdcbb231 100644 --- a/readme.txt +++ b/readme.txt @@ -4,8 +4,8 @@ Donate link: https://wpovernight.com/downloads/woocommerce-pdf-invoices-packing- Tags: woocommerce, pdf, ubl, invoices, packing slips Requires at least: 4.4 Tested up to: 6.7 -Requires PHP: 7.2 -Stable tag: 3.9.1-beta-2 +Requires PHP: 7.4 +Stable tag: 3.9.1-beta-3 License: GPLv2 or later License URI: http://www.gnu.org/licenses/gpl-2.0.html From 3a41c2e1a1e24f4955ed7e494621488035040e78 Mon Sep 17 00:00:00 2001 From: Mohamad Nateqi Rostami Date: Wed, 11 Dec 2024 18:55:10 +0330 Subject: [PATCH 11/21] Add methods to get/print phone number --- includes/Documents/OrderDocument.php | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/includes/Documents/OrderDocument.php b/includes/Documents/OrderDocument.php index cabd24df9..d950a0243 100644 --- a/includes/Documents/OrderDocument.php +++ b/includes/Documents/OrderDocument.php @@ -1130,7 +1130,7 @@ public function header_logo(): void { $attachment_src = wp_get_attachment_image_url( $attachment_id, 'full' ); $attachment_path = wp_normalize_path( realpath( get_attached_file( $attachment_id ) ) ); $src = apply_filters( 'wpo_wcpdf_use_path', true ) ? $attachment_path : $attachment_src; - + if ( empty( $src ) ) { wcpdf_log_error( 'Header logo file not found.', 'critical' ); return; @@ -1229,6 +1229,16 @@ public function shop_address() { echo $this->get_shop_address(); } + /** + * Return/Show shop/company phone number if provided. + */ + public function get_shop_phone_number() { + return $this->get_settings_text( 'shop_phone_number' ); + } + public function shop_phone_number() { + echo $this->get_shop_phone_number(); + } + /** * Return/Show shop/company footer imprint, copyright etc. */ From e695f4dc76ea410adb427b9fe0d4232c9cc6dec8 Mon Sep 17 00:00:00 2001 From: Mohamad Nateqi Rostami Date: Wed, 11 Dec 2024 19:54:41 +0330 Subject: [PATCH 12/21] Add shop phone number setting to common setting getter --- includes/Settings.php | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/includes/Settings.php b/includes/Settings.php index 887c0f7eb..145bb4399 100644 --- a/includes/Settings.php +++ b/includes/Settings.php @@ -506,22 +506,27 @@ public function add_settings_fields( $settings_fields, $page, $option_group, $op } - public function get_common_document_settings() { - $common_settings = array( + /** + * Get document general settings. + * + * @return array + */ + public function get_common_document_settings(): array { + return array( 'paper_size' => isset( $this->general_settings['paper_size'] ) ? $this->general_settings['paper_size'] : '', - 'font_subsetting' => isset( $this->general_settings['font_subsetting'] ) || ( defined("DOMPDF_ENABLE_FONTSUBSETTING") && DOMPDF_ENABLE_FONTSUBSETTING === true ) ? true : false, + 'font_subsetting' => isset( $this->general_settings['font_subsetting'] ) || ( defined( "DOMPDF_ENABLE_FONTSUBSETTING" ) && DOMPDF_ENABLE_FONTSUBSETTING === true ) ? true : false, 'header_logo' => isset( $this->general_settings['header_logo'] ) ? $this->general_settings['header_logo'] : '', 'header_logo_height' => isset( $this->general_settings['header_logo_height'] ) ? $this->general_settings['header_logo_height'] : '', 'vat_number' => isset( $this->general_settings['vat_number'] ) ? $this->general_settings['vat_number'] : '', 'coc_number' => isset( $this->general_settings['coc_number'] ) ? $this->general_settings['coc_number'] : '', 'shop_name' => isset( $this->general_settings['shop_name'] ) ? $this->general_settings['shop_name'] : '', + 'shop_phone_number' => isset( $this->general_settings['shop_phone_number'] ) ? $this->general_settings['shop_phone_number'] : '', 'shop_address' => isset( $this->general_settings['shop_address'] ) ? $this->general_settings['shop_address'] : '', 'footer' => isset( $this->general_settings['footer'] ) ? $this->general_settings['footer'] : '', 'extra_1' => isset( $this->general_settings['extra_1'] ) ? $this->general_settings['extra_1'] : '', 'extra_2' => isset( $this->general_settings['extra_2'] ) ? $this->general_settings['extra_2'] : '', 'extra_3' => isset( $this->general_settings['extra_3'] ) ? $this->general_settings['extra_3'] : '', ); - return $common_settings; } public function get_document_settings( $document_type, $output_format = 'pdf' ) { From 23695ea809bb4193f743da2a5f9c34f94bb8d249 Mon Sep 17 00:00:00 2001 From: Mohamad Nateqi Rostami Date: Wed, 11 Dec 2024 19:57:42 +0330 Subject: [PATCH 13/21] Code improvements --- includes/Settings.php | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/includes/Settings.php b/includes/Settings.php index 145bb4399..600688855 100644 --- a/includes/Settings.php +++ b/includes/Settings.php @@ -513,19 +513,19 @@ public function add_settings_fields( $settings_fields, $page, $option_group, $op */ public function get_common_document_settings(): array { return array( - 'paper_size' => isset( $this->general_settings['paper_size'] ) ? $this->general_settings['paper_size'] : '', - 'font_subsetting' => isset( $this->general_settings['font_subsetting'] ) || ( defined( "DOMPDF_ENABLE_FONTSUBSETTING" ) && DOMPDF_ENABLE_FONTSUBSETTING === true ) ? true : false, - 'header_logo' => isset( $this->general_settings['header_logo'] ) ? $this->general_settings['header_logo'] : '', - 'header_logo_height' => isset( $this->general_settings['header_logo_height'] ) ? $this->general_settings['header_logo_height'] : '', - 'vat_number' => isset( $this->general_settings['vat_number'] ) ? $this->general_settings['vat_number'] : '', - 'coc_number' => isset( $this->general_settings['coc_number'] ) ? $this->general_settings['coc_number'] : '', - 'shop_name' => isset( $this->general_settings['shop_name'] ) ? $this->general_settings['shop_name'] : '', - 'shop_phone_number' => isset( $this->general_settings['shop_phone_number'] ) ? $this->general_settings['shop_phone_number'] : '', - 'shop_address' => isset( $this->general_settings['shop_address'] ) ? $this->general_settings['shop_address'] : '', - 'footer' => isset( $this->general_settings['footer'] ) ? $this->general_settings['footer'] : '', - 'extra_1' => isset( $this->general_settings['extra_1'] ) ? $this->general_settings['extra_1'] : '', - 'extra_2' => isset( $this->general_settings['extra_2'] ) ? $this->general_settings['extra_2'] : '', - 'extra_3' => isset( $this->general_settings['extra_3'] ) ? $this->general_settings['extra_3'] : '', + 'paper_size' => $this->general_settings['paper_size'] ?? '', + 'font_subsetting' => isset( $this->general_settings['font_subsetting'] ) || ( defined( "DOMPDF_ENABLE_FONTSUBSETTING" ) && DOMPDF_ENABLE_FONTSUBSETTING === true ), + 'header_logo' => $this->general_settings['header_logo'] ?? '', + 'header_logo_height' => $this->general_settings['header_logo_height'] ?? '', + 'vat_number' => $this->general_settings['vat_number'] ?? '', + 'coc_number' => $this->general_settings['coc_number'] ?? '', + 'shop_name' => $this->general_settings['shop_name'] ?? '', + 'shop_phone_number' => $this->general_settings['shop_phone_number'] ?? '', + 'shop_address' => $this->general_settings['shop_address'] ?? '', + 'footer' => $this->general_settings['footer'] ?? '', + 'extra_1' => $this->general_settings['extra_1'] ?? '', + 'extra_2' => $this->general_settings['extra_2'] ?? '', + 'extra_3' => $this->general_settings['extra_3'] ?? '', ); } From d9841cae0018d3193bbc41cd1fc52fe370eee02d Mon Sep 17 00:00:00 2001 From: Mohamad Nateqi Rostami Date: Wed, 11 Dec 2024 20:07:10 +0330 Subject: [PATCH 14/21] Fix get_shop_phone_number --- includes/Documents/OrderDocument.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/includes/Documents/OrderDocument.php b/includes/Documents/OrderDocument.php index d950a0243..0ab5edcb6 100644 --- a/includes/Documents/OrderDocument.php +++ b/includes/Documents/OrderDocument.php @@ -1233,7 +1233,7 @@ public function shop_address() { * Return/Show shop/company phone number if provided. */ public function get_shop_phone_number() { - return $this->get_settings_text( 'shop_phone_number' ); + return $this->get_settings_text( 'shop_phone_number', '', false ); } public function shop_phone_number() { echo $this->get_shop_phone_number(); From 18d85caae2609d4f613d82f474afdb8245eb0461 Mon Sep 17 00:00:00 2001 From: Alexandre Faustino Date: Fri, 13 Dec 2024 10:34:44 +0000 Subject: [PATCH 15/21] New: adds support for multiple UBL formats (#927) --- assets/js/admin-script.js | 11 +++++++++++ assets/js/admin-script.min.js | 2 +- includes/Documents/Invoice.php | 25 ++++++++++++++++++++----- includes/Documents/OrderDocument.php | 11 +++++++++++ includes/Settings/SettingsGeneral.php | 2 +- ubl/Builders/SabreBuilder.php | 2 +- ubl/Documents/Document.php | 1 + ubl/Documents/UblDocument.php | 8 ++++++-- 8 files changed, 52 insertions(+), 10 deletions(-) diff --git a/assets/js/admin-script.js b/assets/js/admin-script.js index 29ab0b02f..ba4046df8 100644 --- a/assets/js/admin-script.js +++ b/assets/js/admin-script.js @@ -55,6 +55,17 @@ jQuery( function( $ ) { $( this ).closest( 'tr' ).nextAll( 'tr' ).has( 'input#next_invoice_number' ).first().show(); } } ).trigger( 'change' ); + + // disable encrypted pdf option for non UBL 2.1 formats + $( "[name='wpo_wcpdf_documents_settings_invoice_ubl[ubl_format]']" ).on( 'change', function( event ) { + let $encryptedPdfCheckbox = $( this ).closest( 'form' ).find( "[name='wpo_wcpdf_documents_settings_invoice_ubl[include_encrypted_pdf]']" ); + + if ( $( this ).val() !== 'ubl_2_1' ) { + $encryptedPdfCheckbox.prop( 'checked', false ).prop( 'disabled', true ); + } else { + $encryptedPdfCheckbox.prop( 'disabled', false ); + } + } ).trigger( 'change' ); // enable settings document switch $( '.wcpdf_document_settings_sections > h2' ).on( 'click', function() { diff --git a/assets/js/admin-script.min.js b/assets/js/admin-script.min.js index 3b7f2d1de..c43e6e076 100644 --- a/assets/js/admin-script.min.js +++ b/assets/js/admin-script.min.js @@ -1 +1 @@ -jQuery(function(a){function b(){m=w.val(),n=x.val(),o=y.val(),p=z.val(),q=A.serialize()}function c(){w.val("").trigger("change")}function d(){!1==u.attr("data-preview-states-lock")&&(1200>=a(this).width()&&(1200=t||a(this).width()==t)&&("full"==u.attr("data-preview-state")?(u.find(".preview-document").show(),u.find(".sidebar").hide(),u.find(".slide-left").hide(),u.find(".slide-right").show(),u.attr("data-preview-states",3),u.attr("data-preview-state","full"),u.attr("data-from-preview-state","sidebar"),u.addClass("static")):"closed"==u.attr("data-preview-state")&&a(this).width()!==t?(u.find(".preview-document").hide(),u.find(".sidebar").show(),u.find(".slide-left").show(),u.find(".slide-right").hide(),u.attr("data-preview-states",3),u.attr("data-preview-state","closed"),u.attr("data-from-preview-state",""),u.removeClass("static")):(u.find(".preview-document, .sidebar").show(),u.find(".slide-left, .slide-right").show(),u.attr("data-preview-states",3),u.attr("data-preview-state","sidebar"),u.attr("data-from-preview-state",""),u.removeClass("static")))),t=a(this).width()}function e(a){window.scrollTo(0,0);let b=a;setTimeout(function(){b.addClass("static")},300)}function f(b,c){g();let d=a(b.target);if(!i(d.attr("name"))){if(d.hasClass("remove-requirement")||"disable_for"==d.attr("id"))return;if(-1!==jQuery.inArray(b.type,["keyup","paste"])){if(d.is("input[type=\"checkbox\"], select"))return;c="keyup"==b.type?1e3:0}h(c)}}function g(b){a(".preview-data-wrapper .save-settings p").css("margin-right","0")}function h(a){a="number"==typeof a?a:0,b(),clearTimeout(r),r=setTimeout(function(){j()},a)}function i(b){let c=!1;if(!b)return c;let d=b.includes("[")?b.match(/\[(.*?)\]/)[1]:b;return-1!==a.inArray(d,wpo_wcpdf_admin.preview_excluded_settings)&&(c=!0),c}function j(){let b=wpo_wcpdf_admin.pdfjs_worker,c="preview-canvas",d={action:"wpo_wcpdf_preview",security:p,order_id:m,document_type:n,output_format:o,data:q};v.children(".notice").remove(),v.block({message:null,overlayCSS:{background:"#fff",opacity:.6}}),B=a.ajax({type:"POST",url:wpo_wcpdf_admin.ajaxurl,data:d,beforeSend:function(a,b){null!=B&&B.abort()},success:function(d,e,f){if(d.data.error)a("#"+c).remove(),v.append("

"+d.data.error+"

");else if(d.data.preview_data&&d.data.output_format)switch(a("#"+c).remove(),d.data.output_format){default:case"pdf":v.append(""),k(b,c,d.data.preview_data);break;case"ubl":let a=d.data.preview_data,e=a.replace(/&/g,"&").replace(//g,">").replace(/ /g," ").replace(/\n/g,"
");v.html("
"+e+"
")}v.unblock()},error:function(b,d,e){if("abort"!=d){let d=b.status+": "+b.statusText;a("#"+c).remove(),v.append("

"+d+"

"),v.unblock()}}})}function k(a,b,c){c=window.atob(c),pdfjsLib.GlobalWorkerOptions.workerSrc=a;let d=pdfjsLib.getDocument({data:c});d.promise.then(function(a){let c=1;a.getPage(1).then(function(a){let c=2,d=a.getViewport({scale:2}),e=document.getElementById(b),f=e.getContext("2d");e.height=d.height,e.width=d.width;let g={canvasContext:f,viewport:d},h=a.render(g);h.promise.then(function(){})})},function(a){console.error(a)})}function l(b){let c=b.closest(".preview-data").find("#preview-order-search-results"),d=b.val(),e=b.data("nonce"),f="wpo_wcpdf_preview_order_search",g={security:e,action:f,search:d,document_type:n};c.parent().find("img.preview-order-search-clear").hide(),c.children(".error").remove(),c.children("a").remove(),c.hide(),a.ajax({type:"POST",url:wpo_wcpdf_admin.ajaxurl,data:g,success:function(d){d.data&&(d.data.error?(c.append(""+d.data.error+""),c.show()):a.each(d.data,function(a,b){let d="#"+b.order_number+" - "+b.billing_first_name+" "+b.billing_last_name;0"+b.date_created+""+b.total+"";c.append(d+e),c.show()})),b.removeClass("ajax-waiting"),b.closest("div").find("img.preview-order-search-clear").show()}})}a(".wcpdf-extensions .more").hide(),a(".wcpdf-extensions > li").on("click",function(b){a(this).toggleClass("expanded"),a(this).find(".more").slideToggle()}),a(".edit-next-number").on("click",function(b){a(this).hide(),a(this).siblings("input").prop("disabled",!1),a(this).siblings(".save-next-number.button").show()}),a(".save-next-number").on("click",function(b){$input=a(this).siblings("input"),$input.addClass("ajax-waiting");let c=$input.val();if(0 h2").on("click",function(){a(this).parent().find("ul").toggleClass("active")}),a.each(wpo_wcpdf_admin.pointers,function(b,c){a(c.target).pointer({content:c.content,position:{edge:c.position.edge,align:c.position.align},pointerClass:c.pointer_class,pointerWidth:c.pointer_width,close:function(){jQuery.post(wpo_wcpdf_admin.ajaxurl,{pointer:b,action:"dismiss-wp-pointer"})}}),-1===a.inArray(b,wpo_wcpdf_admin.dismissed_pointers.split(","))&&a(c.target).pointer("open")}),a(".woocommerce-help-tip").tipTip({attribute:"data-tip",fadeIn:50,fadeOut:50,delay:200}),a("#wpo-wcpdf-preview-wrapper #due_date").on("change",function(){const b=a("#wpo-wcpdf-preview-wrapper #due_date"),c=a("#wpo-wcpdf-preview-wrapper #due_date_days");b.is(":checked")?c.prop("disabled",!1):c.prop("disabled",!0)}).trigger("change");let m,n,o,p,q,r,s,t,u=a("#wpo-wcpdf-preview-wrapper"),v=a("#wpo-wcpdf-preview-wrapper .preview"),w=a("#wpo-wcpdf-preview-wrapper input[name=\"order_id\"]"),x=a("#wpo-wcpdf-preview-wrapper input[name=\"document_type\"]"),y=a("#wpo-wcpdf-preview-wrapper input[name=\"output_format\"]"),z=a("#wpo-wcpdf-preview-wrapper input[name=\"nonce\"]"),A=a("#wpo-wcpdf-settings"),B=null;(function a(){x.val(x.data("default")).trigger("change")})(),c(),b(),t=a(window).width(),d(),a(window).on("resize",d),a(".slide-left").on("click",function(){let a=u.attr("data-preview-states"),b=u.attr("data-preview-state");u.find(".preview-data-wrapper ul").removeClass("active"),3==a?"closed"==b?(u.find(".preview-document").show(),u.find(".slide-right").show(),u.attr("data-preview-state","sidebar"),u.attr("data-from-preview-state","closed")):(u.find(".slide-left").hide(),u.find(".sidebar").delay(300).hide(0),u.attr("data-preview-state","full"),u.attr("data-from-preview-state","sidebar"),e(u)):(u.find(".preview-document").show(),u.find(".slide-left").hide(),u.find(".slide-right").show(),u.attr("data-preview-state","full"),u.attr("data-from-preview-state","closed"),e(u))}),a(".slide-right").on("click",function(){let a=u.attr("data-preview-states"),b=u.attr("data-preview-state");u.find(".preview-data-wrapper ul").removeClass("active"),3==a?"full"==b?(u.find(".slide-left").delay(400).show(0),u.find(".sidebar").show(),u.attr("data-preview-state","sidebar"),u.attr("data-from-preview-state","full")):(u.find(".preview-document").hide(300),u.find(".slide-right").hide(),u.attr("data-preview-state","closed"),u.attr("data-from-preview-state","sidebar")):(u.find(".preview-document").hide(300),u.find(".slide-left").show(),u.find(".slide-right").hide(),u.attr("data-preview-state","closed"),u.attr("data-from-preview-state","full")),u.removeClass("static")}),a(".preview-document .preview-data p").on("click",function(){let b=a(this).closest(".preview-data");b.siblings(".preview-data").find("ul").removeClass("active"),b.find("ul").toggleClass("active")}),a(".preview-document .preview-data ul > li").on("click",function(){let b=a(this).closest(".preview-data");b.find("ul").toggleClass("active"),a(this).hasClass("order-search")?(b.find("p.last-order").hide(),b.find("input[name=\"preview-order-search\"]").addClass("active"),b.find("p.order-search").show().find(".order-search-label").text(a(this).text())):(b.find("p.last-order").show(),b.find("p.order-search").hide(),b.find("input[name=\"preview-order-search\"]").removeClass("active").val(""),b.find("#preview-order-search-results").hide(),b.find("img.preview-order-search-clear").hide(),c(),h())}),h(),a(document).on("wpo-wcpdf-settings-changed",function(a,b){g(),h(b)}),a(document).on("wpo-wcpdf-refresh-preview wpo_wcpdf_refresh_preview",function(a,b){h(b)}),a(document).on("click","#preview-order-search-results a",function(b){b.preventDefault(),a(".preview-document .order-search-label").text("#"+a(this).data("order_id")),w.val(a(this).data("order_id")).trigger("change"),a(this).closest("div").hide(),a(this).closest("div").children("a").remove(),h()}),a(document).on("keyup paste","#wpo-wcpdf-settings input, #wpo-wcpdf-settings textarea",f),a(document).on("change","#wpo-wcpdf-settings input[type=\"checkbox\"], #wpo-wcpdf-settings input[type=\"radio\"], #wpo-wcpdf-settings select",function(a){a.isTrigger||f(a)}),a(document).on("select2:select select2:unselect","#wpo-wcpdf-settings select.wc-enhanced-select",f),a(document.body).on("wpo-wcpdf-media-upload-setting-updated",f),a(document).on("click",".wpo_remove_image_button, #wpo-wcpdf-settings .remove-requirement",f),a(document.body).on("click",".preview-data-wrapper .save-settings p input",function(b){a("#wpo-wcpdf-settings input#submit").trigger("click")}),a(document).on("click","img.preview-order-search-clear",function(b){b.preventDefault(),a(this).closest("div").find("input#preview-order-search").val(""),a(this).closest(".preview-data").find("#preview-order-search-results").children("a").remove(),a(this).closest(".preview-data").find("#preview-order-search-results").children(".error").remove(),a(this).closest(".preview-data").find("#preview-order-search-results").hide(),a(this).hide()}),a("#wpo-wcpdf-preview-wrapper ul.preview-data-option-list li").on("click",function(){let b=a(this).closest("ul").data("input-name"),c=a("#wpo-wcpdf-preview-wrapper :input[name="+b+"]");c.val(a(this).data("value")).trigger("change")}),x.on("change",function(){let b=a(this).val();if(b.length){let c=a(this).attr("name"),d=a("#wpo-wcpdf-preview-wrapper ul.preview-data-option-list[data-input-name="+c+"]"),e=d.find("li[data-value="+b+"]");d.parent().find(".current-label").text(e.text()),h()}}).trigger("change"),w.on("change",function(){h()}).trigger("change"),a("#preview-order-search").on("keyup paste",function(c){let d=a(this);d.addClass("ajax-waiting");let e="keyup"==c.type?1e3:0;b(),clearTimeout(s),s=setTimeout(function(){l(d)},e)}),function b(){a(".settings_category").not("#general").find(".form-table").hide(),a("#general > h2").addClass("active"),a(".settings_category h2").each(function(b){const c=localStorage.getItem("wcpdf_accordion_state_"+b);"true"===c&&a(this).addClass("active").next(".form-table").show()}),a(".settings_category h2").on("click",function(){const b=a(".settings_category h2").index(this);a(this).toggleClass("active").next(".form-table").slideToggle("fast",function(){const c=a(this).is(":visible");localStorage.setItem("wcpdf_accordion_state_"+b,c)})})}()}); \ No newline at end of file +jQuery(function(a){function b(){m=w.val(),n=x.val(),o=y.val(),p=z.val(),q=A.serialize()}function c(){w.val("").trigger("change")}function d(){!1==u.attr("data-preview-states-lock")&&(1200>=a(this).width()&&(1200=t||a(this).width()==t)&&("full"==u.attr("data-preview-state")?(u.find(".preview-document").show(),u.find(".sidebar").hide(),u.find(".slide-left").hide(),u.find(".slide-right").show(),u.attr("data-preview-states",3),u.attr("data-preview-state","full"),u.attr("data-from-preview-state","sidebar"),u.addClass("static")):"closed"==u.attr("data-preview-state")&&a(this).width()!==t?(u.find(".preview-document").hide(),u.find(".sidebar").show(),u.find(".slide-left").show(),u.find(".slide-right").hide(),u.attr("data-preview-states",3),u.attr("data-preview-state","closed"),u.attr("data-from-preview-state",""),u.removeClass("static")):(u.find(".preview-document, .sidebar").show(),u.find(".slide-left, .slide-right").show(),u.attr("data-preview-states",3),u.attr("data-preview-state","sidebar"),u.attr("data-from-preview-state",""),u.removeClass("static")))),t=a(this).width()}function e(a){window.scrollTo(0,0);let b=a;setTimeout(function(){b.addClass("static")},300)}function f(b,c){g();let d=a(b.target);if(!i(d.attr("name"))){if(d.hasClass("remove-requirement")||"disable_for"==d.attr("id"))return;if(-1!==jQuery.inArray(b.type,["keyup","paste"])){if(d.is("input[type=\"checkbox\"], select"))return;c="keyup"==b.type?1e3:0}h(c)}}function g(b){a(".preview-data-wrapper .save-settings p").css("margin-right","0")}function h(a){a="number"==typeof a?a:0,b(),clearTimeout(r),r=setTimeout(function(){j()},a)}function i(b){let c=!1;if(!b)return c;let d=b.includes("[")?b.match(/\[(.*?)\]/)[1]:b;return-1!==a.inArray(d,wpo_wcpdf_admin.preview_excluded_settings)&&(c=!0),c}function j(){let b=wpo_wcpdf_admin.pdfjs_worker,c="preview-canvas",d={action:"wpo_wcpdf_preview",security:p,order_id:m,document_type:n,output_format:o,data:q};v.children(".notice").remove(),v.block({message:null,overlayCSS:{background:"#fff",opacity:.6}}),B=a.ajax({type:"POST",url:wpo_wcpdf_admin.ajaxurl,data:d,beforeSend:function(a,b){null!=B&&B.abort()},success:function(d,e,f){if(d.data.error)a("#"+c).remove(),v.append("

"+d.data.error+"

");else if(d.data.preview_data&&d.data.output_format)switch(a("#"+c).remove(),d.data.output_format){default:case"pdf":v.append(""),k(b,c,d.data.preview_data);break;case"ubl":let a=d.data.preview_data,e=a.replace(/&/g,"&").replace(//g,">").replace(/ /g," ").replace(/\n/g,"
");v.html("
"+e+"
")}v.unblock()},error:function(b,d,e){if("abort"!=d){let d=b.status+": "+b.statusText;a("#"+c).remove(),v.append("

"+d+"

"),v.unblock()}}})}function k(a,b,c){c=window.atob(c),pdfjsLib.GlobalWorkerOptions.workerSrc=a;let d=pdfjsLib.getDocument({data:c});d.promise.then(function(a){let c=1;a.getPage(1).then(function(a){let c=2,d=a.getViewport({scale:2}),e=document.getElementById(b),f=e.getContext("2d");e.height=d.height,e.width=d.width;let g={canvasContext:f,viewport:d},h=a.render(g);h.promise.then(function(){})})},function(a){console.error(a)})}function l(b){let c=b.closest(".preview-data").find("#preview-order-search-results"),d=b.val(),e=b.data("nonce"),f="wpo_wcpdf_preview_order_search",g={security:e,action:f,search:d,document_type:n};c.parent().find("img.preview-order-search-clear").hide(),c.children(".error").remove(),c.children("a").remove(),c.hide(),a.ajax({type:"POST",url:wpo_wcpdf_admin.ajaxurl,data:g,success:function(d){d.data&&(d.data.error?(c.append(""+d.data.error+""),c.show()):a.each(d.data,function(a,b){let d="#"+b.order_number+" - "+b.billing_first_name+" "+b.billing_last_name;0"+b.date_created+""+b.total+"";c.append(d+e),c.show()})),b.removeClass("ajax-waiting"),b.closest("div").find("img.preview-order-search-clear").show()}})}a(".wcpdf-extensions .more").hide(),a(".wcpdf-extensions > li").on("click",function(b){a(this).toggleClass("expanded"),a(this).find(".more").slideToggle()}),a(".edit-next-number").on("click",function(b){a(this).hide(),a(this).siblings("input").prop("disabled",!1),a(this).siblings(".save-next-number.button").show()}),a(".save-next-number").on("click",function(b){$input=a(this).siblings("input"),$input.addClass("ajax-waiting");let c=$input.val();if(0 h2").on("click",function(){a(this).parent().find("ul").toggleClass("active")}),a.each(wpo_wcpdf_admin.pointers,function(b,c){a(c.target).pointer({content:c.content,position:{edge:c.position.edge,align:c.position.align},pointerClass:c.pointer_class,pointerWidth:c.pointer_width,close:function(){jQuery.post(wpo_wcpdf_admin.ajaxurl,{pointer:b,action:"dismiss-wp-pointer"})}}),-1===a.inArray(b,wpo_wcpdf_admin.dismissed_pointers.split(","))&&a(c.target).pointer("open")}),a(".woocommerce-help-tip").tipTip({attribute:"data-tip",fadeIn:50,fadeOut:50,delay:200}),a("#wpo-wcpdf-preview-wrapper #due_date").on("change",function(){const b=a("#wpo-wcpdf-preview-wrapper #due_date"),c=a("#wpo-wcpdf-preview-wrapper #due_date_days");b.is(":checked")?c.prop("disabled",!1):c.prop("disabled",!0)}).trigger("change");let m,n,o,p,q,r,s,t,u=a("#wpo-wcpdf-preview-wrapper"),v=a("#wpo-wcpdf-preview-wrapper .preview"),w=a("#wpo-wcpdf-preview-wrapper input[name=\"order_id\"]"),x=a("#wpo-wcpdf-preview-wrapper input[name=\"document_type\"]"),y=a("#wpo-wcpdf-preview-wrapper input[name=\"output_format\"]"),z=a("#wpo-wcpdf-preview-wrapper input[name=\"nonce\"]"),A=a("#wpo-wcpdf-settings"),B=null;(function a(){x.val(x.data("default")).trigger("change")})(),c(),b(),t=a(window).width(),d(),a(window).on("resize",d),a(".slide-left").on("click",function(){let a=u.attr("data-preview-states"),b=u.attr("data-preview-state");u.find(".preview-data-wrapper ul").removeClass("active"),3==a?"closed"==b?(u.find(".preview-document").show(),u.find(".slide-right").show(),u.attr("data-preview-state","sidebar"),u.attr("data-from-preview-state","closed")):(u.find(".slide-left").hide(),u.find(".sidebar").delay(300).hide(0),u.attr("data-preview-state","full"),u.attr("data-from-preview-state","sidebar"),e(u)):(u.find(".preview-document").show(),u.find(".slide-left").hide(),u.find(".slide-right").show(),u.attr("data-preview-state","full"),u.attr("data-from-preview-state","closed"),e(u))}),a(".slide-right").on("click",function(){let a=u.attr("data-preview-states"),b=u.attr("data-preview-state");u.find(".preview-data-wrapper ul").removeClass("active"),3==a?"full"==b?(u.find(".slide-left").delay(400).show(0),u.find(".sidebar").show(),u.attr("data-preview-state","sidebar"),u.attr("data-from-preview-state","full")):(u.find(".preview-document").hide(300),u.find(".slide-right").hide(),u.attr("data-preview-state","closed"),u.attr("data-from-preview-state","sidebar")):(u.find(".preview-document").hide(300),u.find(".slide-left").show(),u.find(".slide-right").hide(),u.attr("data-preview-state","closed"),u.attr("data-from-preview-state","full")),u.removeClass("static")}),a(".preview-document .preview-data p").on("click",function(){let b=a(this).closest(".preview-data");b.siblings(".preview-data").find("ul").removeClass("active"),b.find("ul").toggleClass("active")}),a(".preview-document .preview-data ul > li").on("click",function(){let b=a(this).closest(".preview-data");b.find("ul").toggleClass("active"),a(this).hasClass("order-search")?(b.find("p.last-order").hide(),b.find("input[name=\"preview-order-search\"]").addClass("active"),b.find("p.order-search").show().find(".order-search-label").text(a(this).text())):(b.find("p.last-order").show(),b.find("p.order-search").hide(),b.find("input[name=\"preview-order-search\"]").removeClass("active").val(""),b.find("#preview-order-search-results").hide(),b.find("img.preview-order-search-clear").hide(),c(),h())}),h(),a(document).on("wpo-wcpdf-settings-changed",function(a,b){g(),h(b)}),a(document).on("wpo-wcpdf-refresh-preview wpo_wcpdf_refresh_preview",function(a,b){h(b)}),a(document).on("click","#preview-order-search-results a",function(b){b.preventDefault(),a(".preview-document .order-search-label").text("#"+a(this).data("order_id")),w.val(a(this).data("order_id")).trigger("change"),a(this).closest("div").hide(),a(this).closest("div").children("a").remove(),h()}),a(document).on("keyup paste","#wpo-wcpdf-settings input, #wpo-wcpdf-settings textarea",f),a(document).on("change","#wpo-wcpdf-settings input[type=\"checkbox\"], #wpo-wcpdf-settings input[type=\"radio\"], #wpo-wcpdf-settings select",function(a){a.isTrigger||f(a)}),a(document).on("select2:select select2:unselect","#wpo-wcpdf-settings select.wc-enhanced-select",f),a(document.body).on("wpo-wcpdf-media-upload-setting-updated",f),a(document).on("click",".wpo_remove_image_button, #wpo-wcpdf-settings .remove-requirement",f),a(document.body).on("click",".preview-data-wrapper .save-settings p input",function(b){a("#wpo-wcpdf-settings input#submit").trigger("click")}),a(document).on("click","img.preview-order-search-clear",function(b){b.preventDefault(),a(this).closest("div").find("input#preview-order-search").val(""),a(this).closest(".preview-data").find("#preview-order-search-results").children("a").remove(),a(this).closest(".preview-data").find("#preview-order-search-results").children(".error").remove(),a(this).closest(".preview-data").find("#preview-order-search-results").hide(),a(this).hide()}),a("#wpo-wcpdf-preview-wrapper ul.preview-data-option-list li").on("click",function(){let b=a(this).closest("ul").data("input-name"),c=a("#wpo-wcpdf-preview-wrapper :input[name="+b+"]");c.val(a(this).data("value")).trigger("change")}),x.on("change",function(){let b=a(this).val();if(b.length){let c=a(this).attr("name"),d=a("#wpo-wcpdf-preview-wrapper ul.preview-data-option-list[data-input-name="+c+"]"),e=d.find("li[data-value="+b+"]");d.parent().find(".current-label").text(e.text()),h()}}).trigger("change"),w.on("change",function(){h()}).trigger("change"),a("#preview-order-search").on("keyup paste",function(c){let d=a(this);d.addClass("ajax-waiting");let e="keyup"==c.type?1e3:0;b(),clearTimeout(s),s=setTimeout(function(){l(d)},e)}),function b(){a(".settings_category").not("#general").find(".form-table").hide(),a("#general > h2").addClass("active"),a(".settings_category h2").each(function(b){const c=localStorage.getItem("wcpdf_accordion_state_"+b);"true"===c&&a(this).addClass("active").next(".form-table").show()}),a(".settings_category h2").on("click",function(){const b=a(".settings_category h2").index(this);a(this).toggleClass("active").next(".form-table").slideToggle("fast",function(){const c=a(this).is(":visible");localStorage.setItem("wcpdf_accordion_state_"+b,c)})})}()}); \ No newline at end of file diff --git a/includes/Documents/Invoice.php b/includes/Documents/Invoice.php index 7c3d6203f..7dd214c58 100644 --- a/includes/Documents/Invoice.php +++ b/includes/Documents/Invoice.php @@ -579,7 +579,7 @@ public function get_ubl_settings_fields( $option_name ) { $settings_fields = array( array( 'type' => 'section', - 'id' => $this->type.'_ubl', + 'id' => $this->type . '_ubl', 'title' => '', 'callback' => 'section', ), @@ -588,18 +588,32 @@ public function get_ubl_settings_fields( $option_name ) { 'id' => 'enabled', 'title' => __( 'Enable', 'woocommerce-pdf-invoices-packing-slips' ), 'callback' => 'checkbox', - 'section' => $this->type.'_ubl', + 'section' => $this->type . '_ubl', 'args' => array( 'option_name' => $option_name, 'id' => 'enabled', ) ), + array( + 'type' => 'setting', + 'id' => 'ubl_format', + 'title' => __( 'Format', 'woocommerce-pdf-invoices-packing-slips' ), + 'callback' => 'select', + 'section' => $this->type . '_ubl', + 'args' => array( + 'option_name' => $option_name, + 'id' => 'ubl_format', + 'options' => apply_filters( 'wpo_wcpdf_document_ubl_settings_formats', array( + 'ubl_2_1' => __( 'UBL 2.1' , 'woocommerce-pdf-invoices-packing-slips' ), + ), $this ), + ) + ), array( 'type' => 'setting', 'id' => 'attach_to_email_ids', 'title' => __( 'Attach to:', 'woocommerce-pdf-invoices-packing-slips' ), 'callback' => 'multiple_checkboxes', - 'section' => $this->type.'_ubl', + 'section' => $this->type . '_ubl', 'args' => array( 'option_name' => $option_name, 'id' => 'attach_to_email_ids', @@ -613,11 +627,11 @@ public function get_ubl_settings_fields( $option_name ) { 'id' => 'include_encrypted_pdf', 'title' => __( 'Include encrypted PDF:', 'woocommerce-pdf-invoices-packing-slips' ), 'callback' => 'checkbox', - 'section' => $this->type.'_ubl', + 'section' => $this->type . '_ubl', 'args' => array( 'option_name' => $option_name, 'id' => 'include_encrypted_pdf', - 'description' => __( 'Include the PDF Invoice file encrypted in the UBL file.', 'woocommerce-pdf-invoices-packing-slips' ), + 'description' => __( 'Embed the encrypted PDF invoice file within the UBL document. Note that this option may not be supported by all UBL formats.', 'woocommerce-pdf-invoices-packing-slips' ), ) ), ); @@ -687,6 +701,7 @@ public function get_settings_categories( string $output_format ): array { 'title' => __( 'General', 'woocommerce-pdf-invoices-packing-slips' ), 'members' => array( 'enabled', + 'ubl_format', 'attach_to_email_ids', 'include_encrypted_pdf', ), diff --git a/includes/Documents/OrderDocument.php b/includes/Documents/OrderDocument.php index 0ab5edcb6..2e2490f3c 100644 --- a/includes/Documents/OrderDocument.php +++ b/includes/Documents/OrderDocument.php @@ -342,6 +342,17 @@ public function is_enabled( $output_format = 'pdf' ) { return apply_filters( 'wpo_wcpdf_document_is_enabled', $is_enabled, $this->type, $output_format ); } + + /** + * Get the UBL format + * + * @return string|false + */ + public function get_ubl_format() { + $ubl_format = $this->get_setting( 'ubl_format', false, 'ubl' ); + + return apply_filters( 'wpo_wcpdf_document_ubl_format', $ubl_format, $this ); + } public function get_hook_prefix() { return 'wpo_wcpdf_' . $this->slug . '_get_'; diff --git a/includes/Settings/SettingsGeneral.php b/includes/Settings/SettingsGeneral.php index 5e80c9506..da9bab033 100644 --- a/includes/Settings/SettingsGeneral.php +++ b/includes/Settings/SettingsGeneral.php @@ -207,7 +207,7 @@ public function init_settings() { 'option_name' => $option_name, 'id' => 'shop_phone_number', 'translatable' => true, -// 'description' => __( 'Required for e-Invoice.', 'woocommerce-pdf-invoices-packing-slips' ), + 'description' => __( 'Mandatory for certain UBL formats.', 'woocommerce-pdf-invoices-packing-slips' ), ) ), array( diff --git a/ubl/Builders/SabreBuilder.php b/ubl/Builders/SabreBuilder.php index 6b8676de7..f9eda847a 100644 --- a/ubl/Builders/SabreBuilder.php +++ b/ubl/Builders/SabreBuilder.php @@ -23,7 +23,7 @@ public function build( Document $document ) { $namespaces = array_flip( $document->get_namespaces() ); $this->service->namespaceMap = $namespaces; - return $this->service->write( 'Invoice', $document->get_data() ); + return $this->service->write( $document->get_root_element(), $document->get_data() ); } } diff --git a/ubl/Documents/Document.php b/ubl/Documents/Document.php index 2ce96d446..c9b38bca9 100644 --- a/ubl/Documents/Document.php +++ b/ubl/Documents/Document.php @@ -31,6 +31,7 @@ public function set_order_document( OrderDocument $order_document ) { $this->order_document = $order_document; } + abstract public function get_root_element(); abstract public function get_format(); abstract public function get_namespaces(); abstract public function get_data(); diff --git a/ubl/Documents/UblDocument.php b/ubl/Documents/UblDocument.php index cfa85f15d..6d48cfbd8 100644 --- a/ubl/Documents/UblDocument.php +++ b/ubl/Documents/UblDocument.php @@ -9,6 +9,10 @@ } class UblDocument extends Document { + + public function get_root_element() { + return apply_filters( 'wpo_wc_ubl_document_root_element', 'Invoice', $this ); + } public function get_format() { $format = apply_filters( 'wpo_wc_ubl_document_format' , array( @@ -82,7 +86,7 @@ public function get_format() { 'enabled' => true, 'handler' => \WPO\IPS\UBL\Handlers\Invoice\InvoiceLineHandler::class, ), - ) ); + ), $this ); foreach ( $format as $key => $element ) { if ( false === $element['enabled'] ) { @@ -98,7 +102,7 @@ public function get_namespaces() { 'cac' => 'urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2', 'cbc' => 'urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2', '' => 'urn:oasis:names:specification:ubl:schema:xsd:Invoice-2', - ) ); + ), $this ); } public function get_data() { From dc9c8a0d074a570b0d44460e5c256468e484d6d5 Mon Sep 17 00:00:00 2001 From: Alexandre Faustino Date: Fri, 13 Dec 2024 10:41:08 +0000 Subject: [PATCH 16/21] v3.9.1-beta-4 --- readme.txt | 2 +- woocommerce-pdf-invoices-packingslips.php | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/readme.txt b/readme.txt index 2bdcbb231..826a37d6d 100644 --- a/readme.txt +++ b/readme.txt @@ -5,7 +5,7 @@ Tags: woocommerce, pdf, ubl, invoices, packing slips Requires at least: 4.4 Tested up to: 6.7 Requires PHP: 7.4 -Stable tag: 3.9.1-beta-3 +Stable tag: 3.9.1-beta-4 License: GPLv2 or later License URI: http://www.gnu.org/licenses/gpl-2.0.html diff --git a/woocommerce-pdf-invoices-packingslips.php b/woocommerce-pdf-invoices-packingslips.php index d39f0084f..c57f423b7 100644 --- a/woocommerce-pdf-invoices-packingslips.php +++ b/woocommerce-pdf-invoices-packingslips.php @@ -4,7 +4,7 @@ * Requires Plugins: woocommerce * Plugin URI: https://wpovernight.com/downloads/woocommerce-pdf-invoices-packing-slips-bundle/ * Description: Create, print & email PDF or UBL Invoices & PDF Packing Slips for WooCommerce orders. - * Version: 3.9.1-beta-3 + * Version: 3.9.1-beta-4 * Author: WP Overnight * Author URI: https://www.wpovernight.com * License: GPLv2 or later @@ -22,7 +22,7 @@ class WPO_WCPDF { - public $version = '3.9.1-beta-3'; + public $version = '3.9.1-beta-4'; public $version_php = '7.4'; public $version_woo = '3.3'; public $version_wp = '4.4'; From a4bf98e4f2605769837a14dd87dfca7b3f701fec Mon Sep 17 00:00:00 2001 From: Alexandre Faustino Date: Fri, 13 Dec 2024 12:21:33 +0000 Subject: [PATCH 17/21] Update settings-styles.css --- assets/css/settings-styles.css | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/assets/css/settings-styles.css b/assets/css/settings-styles.css index a883b8c46..a62674491 100644 --- a/assets/css/settings-styles.css +++ b/assets/css/settings-styles.css @@ -393,6 +393,12 @@ body.woocommerce_page_wpo_wcpdf_options_page { padding-top: 0.7em; } +#wpo-wcpdf-preview-wrapper .sidebar .form-table > tbody > tr > td p.description > span.wpo-warning { + width: 100%; + box-sizing: border-box; + word-wrap: break-word; +} + #wpo-wcpdf-preview-wrapper .sidebar .form-table > tbody > tr > td > input[type="text"], #wpo-wcpdf-preview-wrapper .sidebar .form-table > tbody > tr > td > input[type="url"], #wpo-wcpdf-preview-wrapper .sidebar .form-table > tbody > tr > td > select, From 7a3ab4a08be88825e6a64fccda31e41cbfc969ea Mon Sep 17 00:00:00 2001 From: Alexandre Faustino Date: Fri, 13 Dec 2024 12:23:19 +0000 Subject: [PATCH 18/21] Revert "Update settings-styles.css" This reverts commit a4bf98e4f2605769837a14dd87dfca7b3f701fec. --- assets/css/settings-styles.css | 6 ------ 1 file changed, 6 deletions(-) diff --git a/assets/css/settings-styles.css b/assets/css/settings-styles.css index a62674491..a883b8c46 100644 --- a/assets/css/settings-styles.css +++ b/assets/css/settings-styles.css @@ -393,12 +393,6 @@ body.woocommerce_page_wpo_wcpdf_options_page { padding-top: 0.7em; } -#wpo-wcpdf-preview-wrapper .sidebar .form-table > tbody > tr > td p.description > span.wpo-warning { - width: 100%; - box-sizing: border-box; - word-wrap: break-word; -} - #wpo-wcpdf-preview-wrapper .sidebar .form-table > tbody > tr > td > input[type="text"], #wpo-wcpdf-preview-wrapper .sidebar .form-table > tbody > tr > td > input[type="url"], #wpo-wcpdf-preview-wrapper .sidebar .form-table > tbody > tr > td > select, From b1b50b8a79ab6a5a0a59cf2f68b15372b16d9273 Mon Sep 17 00:00:00 2001 From: Alexandre Faustino Date: Fri, 13 Dec 2024 12:28:14 +0000 Subject: [PATCH 19/21] Fix: AJAX preview loading when disabled on settings pages (#928) --- assets/js/admin-script.js | 14 +++++++++++--- assets/js/admin-script.min.js | 2 +- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/assets/js/admin-script.js b/assets/js/admin-script.js index ba4046df8..ad8f7e413 100644 --- a/assets/js/admin-script.js +++ b/assets/js/admin-script.js @@ -55,11 +55,11 @@ jQuery( function( $ ) { $( this ).closest( 'tr' ).nextAll( 'tr' ).has( 'input#next_invoice_number' ).first().show(); } } ).trigger( 'change' ); - + // disable encrypted pdf option for non UBL 2.1 formats $( "[name='wpo_wcpdf_documents_settings_invoice_ubl[ubl_format]']" ).on( 'change', function( event ) { let $encryptedPdfCheckbox = $( this ).closest( 'form' ).find( "[name='wpo_wcpdf_documents_settings_invoice_ubl[include_encrypted_pdf]']" ); - + if ( $( this ).val() !== 'ubl_2_1' ) { $encryptedPdfCheckbox.prop( 'checked', false ).prop( 'disabled', true ); } else { @@ -384,7 +384,14 @@ jQuery( function( $ ) { } ); // Trigger the Preview - function triggerPreview( timeoutDuration ) { + function triggerPreview( timeoutDuration = 0 ) { + $previewStates = $( '#wpo-wcpdf-preview-wrapper' ).data( 'preview-states' ); + + // Check if preview is disabled and return + if ( 'undefined' === $previewStates || 1 === $previewStates ) { + return; + } + timeoutDuration = typeof timeoutDuration == 'number' ? timeoutDuration : 0; loadPreviewData(); @@ -441,6 +448,7 @@ jQuery( function( $ ) { // Load the Preview with AJAX function ajaxLoadPreview() { + console.log( 'Loading preview...' ); let worker = wpo_wcpdf_admin.pdfjs_worker; let canvasId = 'preview-canvas'; let data = { diff --git a/assets/js/admin-script.min.js b/assets/js/admin-script.min.js index c43e6e076..40823d016 100644 --- a/assets/js/admin-script.min.js +++ b/assets/js/admin-script.min.js @@ -1 +1 @@ -jQuery(function(a){function b(){m=w.val(),n=x.val(),o=y.val(),p=z.val(),q=A.serialize()}function c(){w.val("").trigger("change")}function d(){!1==u.attr("data-preview-states-lock")&&(1200>=a(this).width()&&(1200=t||a(this).width()==t)&&("full"==u.attr("data-preview-state")?(u.find(".preview-document").show(),u.find(".sidebar").hide(),u.find(".slide-left").hide(),u.find(".slide-right").show(),u.attr("data-preview-states",3),u.attr("data-preview-state","full"),u.attr("data-from-preview-state","sidebar"),u.addClass("static")):"closed"==u.attr("data-preview-state")&&a(this).width()!==t?(u.find(".preview-document").hide(),u.find(".sidebar").show(),u.find(".slide-left").show(),u.find(".slide-right").hide(),u.attr("data-preview-states",3),u.attr("data-preview-state","closed"),u.attr("data-from-preview-state",""),u.removeClass("static")):(u.find(".preview-document, .sidebar").show(),u.find(".slide-left, .slide-right").show(),u.attr("data-preview-states",3),u.attr("data-preview-state","sidebar"),u.attr("data-from-preview-state",""),u.removeClass("static")))),t=a(this).width()}function e(a){window.scrollTo(0,0);let b=a;setTimeout(function(){b.addClass("static")},300)}function f(b,c){g();let d=a(b.target);if(!i(d.attr("name"))){if(d.hasClass("remove-requirement")||"disable_for"==d.attr("id"))return;if(-1!==jQuery.inArray(b.type,["keyup","paste"])){if(d.is("input[type=\"checkbox\"], select"))return;c="keyup"==b.type?1e3:0}h(c)}}function g(b){a(".preview-data-wrapper .save-settings p").css("margin-right","0")}function h(a){a="number"==typeof a?a:0,b(),clearTimeout(r),r=setTimeout(function(){j()},a)}function i(b){let c=!1;if(!b)return c;let d=b.includes("[")?b.match(/\[(.*?)\]/)[1]:b;return-1!==a.inArray(d,wpo_wcpdf_admin.preview_excluded_settings)&&(c=!0),c}function j(){let b=wpo_wcpdf_admin.pdfjs_worker,c="preview-canvas",d={action:"wpo_wcpdf_preview",security:p,order_id:m,document_type:n,output_format:o,data:q};v.children(".notice").remove(),v.block({message:null,overlayCSS:{background:"#fff",opacity:.6}}),B=a.ajax({type:"POST",url:wpo_wcpdf_admin.ajaxurl,data:d,beforeSend:function(a,b){null!=B&&B.abort()},success:function(d,e,f){if(d.data.error)a("#"+c).remove(),v.append("

"+d.data.error+"

");else if(d.data.preview_data&&d.data.output_format)switch(a("#"+c).remove(),d.data.output_format){default:case"pdf":v.append(""),k(b,c,d.data.preview_data);break;case"ubl":let a=d.data.preview_data,e=a.replace(/&/g,"&").replace(//g,">").replace(/ /g," ").replace(/\n/g,"
");v.html("
"+e+"
")}v.unblock()},error:function(b,d,e){if("abort"!=d){let d=b.status+": "+b.statusText;a("#"+c).remove(),v.append("

"+d+"

"),v.unblock()}}})}function k(a,b,c){c=window.atob(c),pdfjsLib.GlobalWorkerOptions.workerSrc=a;let d=pdfjsLib.getDocument({data:c});d.promise.then(function(a){let c=1;a.getPage(1).then(function(a){let c=2,d=a.getViewport({scale:2}),e=document.getElementById(b),f=e.getContext("2d");e.height=d.height,e.width=d.width;let g={canvasContext:f,viewport:d},h=a.render(g);h.promise.then(function(){})})},function(a){console.error(a)})}function l(b){let c=b.closest(".preview-data").find("#preview-order-search-results"),d=b.val(),e=b.data("nonce"),f="wpo_wcpdf_preview_order_search",g={security:e,action:f,search:d,document_type:n};c.parent().find("img.preview-order-search-clear").hide(),c.children(".error").remove(),c.children("a").remove(),c.hide(),a.ajax({type:"POST",url:wpo_wcpdf_admin.ajaxurl,data:g,success:function(d){d.data&&(d.data.error?(c.append(""+d.data.error+""),c.show()):a.each(d.data,function(a,b){let d="#"+b.order_number+" - "+b.billing_first_name+" "+b.billing_last_name;0"+b.date_created+""+b.total+"";c.append(d+e),c.show()})),b.removeClass("ajax-waiting"),b.closest("div").find("img.preview-order-search-clear").show()}})}a(".wcpdf-extensions .more").hide(),a(".wcpdf-extensions > li").on("click",function(b){a(this).toggleClass("expanded"),a(this).find(".more").slideToggle()}),a(".edit-next-number").on("click",function(b){a(this).hide(),a(this).siblings("input").prop("disabled",!1),a(this).siblings(".save-next-number.button").show()}),a(".save-next-number").on("click",function(b){$input=a(this).siblings("input"),$input.addClass("ajax-waiting");let c=$input.val();if(0 h2").on("click",function(){a(this).parent().find("ul").toggleClass("active")}),a.each(wpo_wcpdf_admin.pointers,function(b,c){a(c.target).pointer({content:c.content,position:{edge:c.position.edge,align:c.position.align},pointerClass:c.pointer_class,pointerWidth:c.pointer_width,close:function(){jQuery.post(wpo_wcpdf_admin.ajaxurl,{pointer:b,action:"dismiss-wp-pointer"})}}),-1===a.inArray(b,wpo_wcpdf_admin.dismissed_pointers.split(","))&&a(c.target).pointer("open")}),a(".woocommerce-help-tip").tipTip({attribute:"data-tip",fadeIn:50,fadeOut:50,delay:200}),a("#wpo-wcpdf-preview-wrapper #due_date").on("change",function(){const b=a("#wpo-wcpdf-preview-wrapper #due_date"),c=a("#wpo-wcpdf-preview-wrapper #due_date_days");b.is(":checked")?c.prop("disabled",!1):c.prop("disabled",!0)}).trigger("change");let m,n,o,p,q,r,s,t,u=a("#wpo-wcpdf-preview-wrapper"),v=a("#wpo-wcpdf-preview-wrapper .preview"),w=a("#wpo-wcpdf-preview-wrapper input[name=\"order_id\"]"),x=a("#wpo-wcpdf-preview-wrapper input[name=\"document_type\"]"),y=a("#wpo-wcpdf-preview-wrapper input[name=\"output_format\"]"),z=a("#wpo-wcpdf-preview-wrapper input[name=\"nonce\"]"),A=a("#wpo-wcpdf-settings"),B=null;(function a(){x.val(x.data("default")).trigger("change")})(),c(),b(),t=a(window).width(),d(),a(window).on("resize",d),a(".slide-left").on("click",function(){let a=u.attr("data-preview-states"),b=u.attr("data-preview-state");u.find(".preview-data-wrapper ul").removeClass("active"),3==a?"closed"==b?(u.find(".preview-document").show(),u.find(".slide-right").show(),u.attr("data-preview-state","sidebar"),u.attr("data-from-preview-state","closed")):(u.find(".slide-left").hide(),u.find(".sidebar").delay(300).hide(0),u.attr("data-preview-state","full"),u.attr("data-from-preview-state","sidebar"),e(u)):(u.find(".preview-document").show(),u.find(".slide-left").hide(),u.find(".slide-right").show(),u.attr("data-preview-state","full"),u.attr("data-from-preview-state","closed"),e(u))}),a(".slide-right").on("click",function(){let a=u.attr("data-preview-states"),b=u.attr("data-preview-state");u.find(".preview-data-wrapper ul").removeClass("active"),3==a?"full"==b?(u.find(".slide-left").delay(400).show(0),u.find(".sidebar").show(),u.attr("data-preview-state","sidebar"),u.attr("data-from-preview-state","full")):(u.find(".preview-document").hide(300),u.find(".slide-right").hide(),u.attr("data-preview-state","closed"),u.attr("data-from-preview-state","sidebar")):(u.find(".preview-document").hide(300),u.find(".slide-left").show(),u.find(".slide-right").hide(),u.attr("data-preview-state","closed"),u.attr("data-from-preview-state","full")),u.removeClass("static")}),a(".preview-document .preview-data p").on("click",function(){let b=a(this).closest(".preview-data");b.siblings(".preview-data").find("ul").removeClass("active"),b.find("ul").toggleClass("active")}),a(".preview-document .preview-data ul > li").on("click",function(){let b=a(this).closest(".preview-data");b.find("ul").toggleClass("active"),a(this).hasClass("order-search")?(b.find("p.last-order").hide(),b.find("input[name=\"preview-order-search\"]").addClass("active"),b.find("p.order-search").show().find(".order-search-label").text(a(this).text())):(b.find("p.last-order").show(),b.find("p.order-search").hide(),b.find("input[name=\"preview-order-search\"]").removeClass("active").val(""),b.find("#preview-order-search-results").hide(),b.find("img.preview-order-search-clear").hide(),c(),h())}),h(),a(document).on("wpo-wcpdf-settings-changed",function(a,b){g(),h(b)}),a(document).on("wpo-wcpdf-refresh-preview wpo_wcpdf_refresh_preview",function(a,b){h(b)}),a(document).on("click","#preview-order-search-results a",function(b){b.preventDefault(),a(".preview-document .order-search-label").text("#"+a(this).data("order_id")),w.val(a(this).data("order_id")).trigger("change"),a(this).closest("div").hide(),a(this).closest("div").children("a").remove(),h()}),a(document).on("keyup paste","#wpo-wcpdf-settings input, #wpo-wcpdf-settings textarea",f),a(document).on("change","#wpo-wcpdf-settings input[type=\"checkbox\"], #wpo-wcpdf-settings input[type=\"radio\"], #wpo-wcpdf-settings select",function(a){a.isTrigger||f(a)}),a(document).on("select2:select select2:unselect","#wpo-wcpdf-settings select.wc-enhanced-select",f),a(document.body).on("wpo-wcpdf-media-upload-setting-updated",f),a(document).on("click",".wpo_remove_image_button, #wpo-wcpdf-settings .remove-requirement",f),a(document.body).on("click",".preview-data-wrapper .save-settings p input",function(b){a("#wpo-wcpdf-settings input#submit").trigger("click")}),a(document).on("click","img.preview-order-search-clear",function(b){b.preventDefault(),a(this).closest("div").find("input#preview-order-search").val(""),a(this).closest(".preview-data").find("#preview-order-search-results").children("a").remove(),a(this).closest(".preview-data").find("#preview-order-search-results").children(".error").remove(),a(this).closest(".preview-data").find("#preview-order-search-results").hide(),a(this).hide()}),a("#wpo-wcpdf-preview-wrapper ul.preview-data-option-list li").on("click",function(){let b=a(this).closest("ul").data("input-name"),c=a("#wpo-wcpdf-preview-wrapper :input[name="+b+"]");c.val(a(this).data("value")).trigger("change")}),x.on("change",function(){let b=a(this).val();if(b.length){let c=a(this).attr("name"),d=a("#wpo-wcpdf-preview-wrapper ul.preview-data-option-list[data-input-name="+c+"]"),e=d.find("li[data-value="+b+"]");d.parent().find(".current-label").text(e.text()),h()}}).trigger("change"),w.on("change",function(){h()}).trigger("change"),a("#preview-order-search").on("keyup paste",function(c){let d=a(this);d.addClass("ajax-waiting");let e="keyup"==c.type?1e3:0;b(),clearTimeout(s),s=setTimeout(function(){l(d)},e)}),function b(){a(".settings_category").not("#general").find(".form-table").hide(),a("#general > h2").addClass("active"),a(".settings_category h2").each(function(b){const c=localStorage.getItem("wcpdf_accordion_state_"+b);"true"===c&&a(this).addClass("active").next(".form-table").show()}),a(".settings_category h2").on("click",function(){const b=a(".settings_category h2").index(this);a(this).toggleClass("active").next(".form-table").slideToggle("fast",function(){const c=a(this).is(":visible");localStorage.setItem("wcpdf_accordion_state_"+b,c)})})}()}); \ No newline at end of file +jQuery(function(a){function b(){m=w.val(),n=x.val(),o=y.val(),p=z.val(),q=A.serialize()}function c(){w.val("").trigger("change")}function d(){!1==u.attr("data-preview-states-lock")&&(1200>=a(this).width()&&(1200=t||a(this).width()==t)&&("full"==u.attr("data-preview-state")?(u.find(".preview-document").show(),u.find(".sidebar").hide(),u.find(".slide-left").hide(),u.find(".slide-right").show(),u.attr("data-preview-states",3),u.attr("data-preview-state","full"),u.attr("data-from-preview-state","sidebar"),u.addClass("static")):"closed"==u.attr("data-preview-state")&&a(this).width()!==t?(u.find(".preview-document").hide(),u.find(".sidebar").show(),u.find(".slide-left").show(),u.find(".slide-right").hide(),u.attr("data-preview-states",3),u.attr("data-preview-state","closed"),u.attr("data-from-preview-state",""),u.removeClass("static")):(u.find(".preview-document, .sidebar").show(),u.find(".slide-left, .slide-right").show(),u.attr("data-preview-states",3),u.attr("data-preview-state","sidebar"),u.attr("data-from-preview-state",""),u.removeClass("static")))),t=a(this).width()}function e(a){window.scrollTo(0,0);let b=a;setTimeout(function(){b.addClass("static")},300)}function f(b,c){g();let d=a(b.target);if(!i(d.attr("name"))){if(d.hasClass("remove-requirement")||"disable_for"==d.attr("id"))return;if(-1!==jQuery.inArray(b.type,["keyup","paste"])){if(d.is("input[type=\"checkbox\"], select"))return;c="keyup"==b.type?1e3:0}h(c)}}function g(b){a(".preview-data-wrapper .save-settings p").css("margin-right","0")}function h(c=0){$previewStates=a("#wpo-wcpdf-preview-wrapper").data("preview-states");"undefined"===$previewStates||1===$previewStates||(c="number"==typeof c?c:0,b(),clearTimeout(r),r=setTimeout(function(){j()},c))}function i(b){let c=!1;if(!b)return c;let d=b.includes("[")?b.match(/\[(.*?)\]/)[1]:b;return-1!==a.inArray(d,wpo_wcpdf_admin.preview_excluded_settings)&&(c=!0),c}function j(){console.log("Loading preview...");let b=wpo_wcpdf_admin.pdfjs_worker,c="preview-canvas",d={action:"wpo_wcpdf_preview",security:p,order_id:m,document_type:n,output_format:o,data:q};v.children(".notice").remove(),v.block({message:null,overlayCSS:{background:"#fff",opacity:.6}}),B=a.ajax({type:"POST",url:wpo_wcpdf_admin.ajaxurl,data:d,beforeSend:function(a,b){null!=B&&B.abort()},success:function(d,e,f){if(d.data.error)a("#"+c).remove(),v.append("

"+d.data.error+"

");else if(d.data.preview_data&&d.data.output_format)switch(a("#"+c).remove(),d.data.output_format){default:case"pdf":v.append(""),k(b,c,d.data.preview_data);break;case"ubl":let a=d.data.preview_data,e=a.replace(/&/g,"&").replace(//g,">").replace(/ /g," ").replace(/\n/g,"
");v.html("
"+e+"
")}v.unblock()},error:function(b,d,e){if("abort"!=d){let d=b.status+": "+b.statusText;a("#"+c).remove(),v.append("

"+d+"

"),v.unblock()}}})}function k(a,b,c){c=window.atob(c),pdfjsLib.GlobalWorkerOptions.workerSrc=a;let d=pdfjsLib.getDocument({data:c});d.promise.then(function(a){let c=1;a.getPage(1).then(function(a){let c=2,d=a.getViewport({scale:2}),e=document.getElementById(b),f=e.getContext("2d");e.height=d.height,e.width=d.width;let g={canvasContext:f,viewport:d},h=a.render(g);h.promise.then(function(){})})},function(a){console.error(a)})}function l(b){let c=b.closest(".preview-data").find("#preview-order-search-results"),d=b.val(),e=b.data("nonce"),f="wpo_wcpdf_preview_order_search",g={security:e,action:f,search:d,document_type:n};c.parent().find("img.preview-order-search-clear").hide(),c.children(".error").remove(),c.children("a").remove(),c.hide(),a.ajax({type:"POST",url:wpo_wcpdf_admin.ajaxurl,data:g,success:function(d){d.data&&(d.data.error?(c.append(""+d.data.error+""),c.show()):a.each(d.data,function(a,b){let d="#"+b.order_number+" - "+b.billing_first_name+" "+b.billing_last_name;0"+b.date_created+""+b.total+"";c.append(d+e),c.show()})),b.removeClass("ajax-waiting"),b.closest("div").find("img.preview-order-search-clear").show()}})}a(".wcpdf-extensions .more").hide(),a(".wcpdf-extensions > li").on("click",function(b){a(this).toggleClass("expanded"),a(this).find(".more").slideToggle()}),a(".edit-next-number").on("click",function(b){a(this).hide(),a(this).siblings("input").prop("disabled",!1),a(this).siblings(".save-next-number.button").show()}),a(".save-next-number").on("click",function(b){$input=a(this).siblings("input"),$input.addClass("ajax-waiting");let c=$input.val();if(0 h2").on("click",function(){a(this).parent().find("ul").toggleClass("active")}),a.each(wpo_wcpdf_admin.pointers,function(b,c){a(c.target).pointer({content:c.content,position:{edge:c.position.edge,align:c.position.align},pointerClass:c.pointer_class,pointerWidth:c.pointer_width,close:function(){jQuery.post(wpo_wcpdf_admin.ajaxurl,{pointer:b,action:"dismiss-wp-pointer"})}}),-1===a.inArray(b,wpo_wcpdf_admin.dismissed_pointers.split(","))&&a(c.target).pointer("open")}),a(".woocommerce-help-tip").tipTip({attribute:"data-tip",fadeIn:50,fadeOut:50,delay:200}),a("#wpo-wcpdf-preview-wrapper #due_date").on("change",function(){const b=a("#wpo-wcpdf-preview-wrapper #due_date"),c=a("#wpo-wcpdf-preview-wrapper #due_date_days");b.is(":checked")?c.prop("disabled",!1):c.prop("disabled",!0)}).trigger("change");let m,n,o,p,q,r,s,t,u=a("#wpo-wcpdf-preview-wrapper"),v=a("#wpo-wcpdf-preview-wrapper .preview"),w=a("#wpo-wcpdf-preview-wrapper input[name=\"order_id\"]"),x=a("#wpo-wcpdf-preview-wrapper input[name=\"document_type\"]"),y=a("#wpo-wcpdf-preview-wrapper input[name=\"output_format\"]"),z=a("#wpo-wcpdf-preview-wrapper input[name=\"nonce\"]"),A=a("#wpo-wcpdf-settings"),B=null;(function a(){x.val(x.data("default")).trigger("change")})(),c(),b(),t=a(window).width(),d(),a(window).on("resize",d),a(".slide-left").on("click",function(){let a=u.attr("data-preview-states"),b=u.attr("data-preview-state");u.find(".preview-data-wrapper ul").removeClass("active"),3==a?"closed"==b?(u.find(".preview-document").show(),u.find(".slide-right").show(),u.attr("data-preview-state","sidebar"),u.attr("data-from-preview-state","closed")):(u.find(".slide-left").hide(),u.find(".sidebar").delay(300).hide(0),u.attr("data-preview-state","full"),u.attr("data-from-preview-state","sidebar"),e(u)):(u.find(".preview-document").show(),u.find(".slide-left").hide(),u.find(".slide-right").show(),u.attr("data-preview-state","full"),u.attr("data-from-preview-state","closed"),e(u))}),a(".slide-right").on("click",function(){let a=u.attr("data-preview-states"),b=u.attr("data-preview-state");u.find(".preview-data-wrapper ul").removeClass("active"),3==a?"full"==b?(u.find(".slide-left").delay(400).show(0),u.find(".sidebar").show(),u.attr("data-preview-state","sidebar"),u.attr("data-from-preview-state","full")):(u.find(".preview-document").hide(300),u.find(".slide-right").hide(),u.attr("data-preview-state","closed"),u.attr("data-from-preview-state","sidebar")):(u.find(".preview-document").hide(300),u.find(".slide-left").show(),u.find(".slide-right").hide(),u.attr("data-preview-state","closed"),u.attr("data-from-preview-state","full")),u.removeClass("static")}),a(".preview-document .preview-data p").on("click",function(){let b=a(this).closest(".preview-data");b.siblings(".preview-data").find("ul").removeClass("active"),b.find("ul").toggleClass("active")}),a(".preview-document .preview-data ul > li").on("click",function(){let b=a(this).closest(".preview-data");b.find("ul").toggleClass("active"),a(this).hasClass("order-search")?(b.find("p.last-order").hide(),b.find("input[name=\"preview-order-search\"]").addClass("active"),b.find("p.order-search").show().find(".order-search-label").text(a(this).text())):(b.find("p.last-order").show(),b.find("p.order-search").hide(),b.find("input[name=\"preview-order-search\"]").removeClass("active").val(""),b.find("#preview-order-search-results").hide(),b.find("img.preview-order-search-clear").hide(),c(),h())}),h(),a(document).on("wpo-wcpdf-settings-changed",function(a,b){g(),h(b)}),a(document).on("wpo-wcpdf-refresh-preview wpo_wcpdf_refresh_preview",function(a,b){h(b)}),a(document).on("click","#preview-order-search-results a",function(b){b.preventDefault(),a(".preview-document .order-search-label").text("#"+a(this).data("order_id")),w.val(a(this).data("order_id")).trigger("change"),a(this).closest("div").hide(),a(this).closest("div").children("a").remove(),h()}),a(document).on("keyup paste","#wpo-wcpdf-settings input, #wpo-wcpdf-settings textarea",f),a(document).on("change","#wpo-wcpdf-settings input[type=\"checkbox\"], #wpo-wcpdf-settings input[type=\"radio\"], #wpo-wcpdf-settings select",function(a){a.isTrigger||f(a)}),a(document).on("select2:select select2:unselect","#wpo-wcpdf-settings select.wc-enhanced-select",f),a(document.body).on("wpo-wcpdf-media-upload-setting-updated",f),a(document).on("click",".wpo_remove_image_button, #wpo-wcpdf-settings .remove-requirement",f),a(document.body).on("click",".preview-data-wrapper .save-settings p input",function(b){a("#wpo-wcpdf-settings input#submit").trigger("click")}),a(document).on("click","img.preview-order-search-clear",function(b){b.preventDefault(),a(this).closest("div").find("input#preview-order-search").val(""),a(this).closest(".preview-data").find("#preview-order-search-results").children("a").remove(),a(this).closest(".preview-data").find("#preview-order-search-results").children(".error").remove(),a(this).closest(".preview-data").find("#preview-order-search-results").hide(),a(this).hide()}),a("#wpo-wcpdf-preview-wrapper ul.preview-data-option-list li").on("click",function(){let b=a(this).closest("ul").data("input-name"),c=a("#wpo-wcpdf-preview-wrapper :input[name="+b+"]");c.val(a(this).data("value")).trigger("change")}),x.on("change",function(){let b=a(this).val();if(b.length){let c=a(this).attr("name"),d=a("#wpo-wcpdf-preview-wrapper ul.preview-data-option-list[data-input-name="+c+"]"),e=d.find("li[data-value="+b+"]");d.parent().find(".current-label").text(e.text()),h()}}).trigger("change"),w.on("change",function(){h()}).trigger("change"),a("#preview-order-search").on("keyup paste",function(c){let d=a(this);d.addClass("ajax-waiting");let e="keyup"==c.type?1e3:0;b(),clearTimeout(s),s=setTimeout(function(){l(d)},e)}),function b(){a(".settings_category").not("#general").find(".form-table").hide(),a("#general > h2").addClass("active"),a(".settings_category h2").each(function(b){const c=localStorage.getItem("wcpdf_accordion_state_"+b);"true"===c&&a(this).addClass("active").next(".form-table").show()}),a(".settings_category h2").on("click",function(){const b=a(".settings_category h2").index(this);a(this).toggleClass("active").next(".form-table").slideToggle("fast",function(){const c=a(this).is(":visible");localStorage.setItem("wcpdf_accordion_state_"+b,c)})})}()}); \ No newline at end of file From d26222fb7abaa71b434a524a74ec87d6889ac0d0 Mon Sep 17 00:00:00 2001 From: Alexandre Faustino Date: Fri, 13 Dec 2024 12:36:21 +0000 Subject: [PATCH 20/21] Remove unused legacy notice code: `check_auto_increment_increment()` --- includes/Settings.php | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/includes/Settings.php b/includes/Settings.php index 600688855..869b75aea 100644 --- a/includes/Settings.php +++ b/includes/Settings.php @@ -62,9 +62,6 @@ public function __construct() { // settings capabilities add_filter( 'option_page_capability_wpo_wcpdf_general_settings', array( $this, 'user_settings_capability' ) ); - // admin notice for auto_increment_increment - // add_action( 'admin_notices', array( $this, 'check_auto_increment_increment') ); - // AJAX set number store add_action( 'wp_ajax_wpo_wcpdf_set_next_number', array( $this, 'set_number_store' ) ); @@ -157,17 +154,6 @@ public function user_can_manage_settings() { return current_user_can( $this->user_settings_capability() ); } - function check_auto_increment_increment() { - global $wpdb; - $row = $wpdb->get_row( "SHOW VARIABLES LIKE 'auto_increment_increment'" ); - if ( ! empty( $row ) && ! empty( $row->Value ) && $row->Value != 1 ) { - /* translators: database row value */ - $error = wp_kses_post( sprintf( __( "Warning! Your database has an AUTO_INCREMENT step size of %d, your invoice numbers may not be sequential. Enable the 'Calculate document numbers (slow)' setting in the Advanced tab to use an alternate method." , 'woocommerce-pdf-invoices-packing-slips' ), intval( $row->Value ) ) ); - printf( '

%s

', $error ); - } - } - - public function settings_page() { // feedback on settings save settings_errors(); From 7b55afdad8248e44c127194500d3d705360e5a71 Mon Sep 17 00:00:00 2001 From: Alexandre Faustino Date: Fri, 13 Dec 2024 12:41:03 +0000 Subject: [PATCH 21/21] Fix: temp folder warning style issue (#930) --- assets/css/settings-styles.css | 6 ++++++ assets/css/settings-styles.min.css | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/assets/css/settings-styles.css b/assets/css/settings-styles.css index a883b8c46..a62674491 100644 --- a/assets/css/settings-styles.css +++ b/assets/css/settings-styles.css @@ -393,6 +393,12 @@ body.woocommerce_page_wpo_wcpdf_options_page { padding-top: 0.7em; } +#wpo-wcpdf-preview-wrapper .sidebar .form-table > tbody > tr > td p.description > span.wpo-warning { + width: 100%; + box-sizing: border-box; + word-wrap: break-word; +} + #wpo-wcpdf-preview-wrapper .sidebar .form-table > tbody > tr > td > input[type="text"], #wpo-wcpdf-preview-wrapper .sidebar .form-table > tbody > tr > td > input[type="url"], #wpo-wcpdf-preview-wrapper .sidebar .form-table > tbody > tr > td > select, diff --git a/assets/css/settings-styles.min.css b/assets/css/settings-styles.min.css index a28f7ba40..26706dc55 100644 --- a/assets/css/settings-styles.min.css +++ b/assets/css/settings-styles.min.css @@ -1 +1 @@ -span.wpo-warning{display:inline-block;border:1px solid red;border-left:4px solid red;padding:5px 15px;background-color:#fff}.wcpdf-extensions-ad,.wcpdf-promo-ad{position:relative;min-height:90px;border:1px solid #6e1edc;background-color:#f1e9fc;padding:15px;padding-left:100px;margin-top:30px}img.wpo-helper{position:absolute;bottom:0;left:3px}.wcpdf-extensions-ad h3,.wcpdf-promo-ad h3{margin:0;padding:20px;font-weight:400;font-family:serif;letter-spacing:-1px;font-size:2.25em}.wcpdf-promo-ad p{margin:0;padding:0 20px;font-size:1.15em}.wcpdf-promo-ad p.upgrade-tab{margin-top:30px;font-style:italic;font-size:1em}.wcpdf-promo-ad p.expiration{font-size:.8em;padding-top:8px}.wcpdf-extensions-ad a,.wcpdf-promo-ad a{color:#6e1edc}.wcpdf-extensions-ad a.dismiss,.wcpdf-promo-ad a.dismiss{padding:10px 20px}.wcpdf-promo-ad p strong.code{font-size:1.3em;font-family:serif;padding:.1em .4em;background:#6e1edc;color:#fff;border-radius:5px;font-weight:400}.wcpdf-extensions-ad i{padding-left:20px}.wcpdf-extensions-ad ul,.wcpdf-promo-ad ul{margin:0;margin-left:40px}.wcpdf-extensions li{margin:0}.wcpdf-extensions li ul{list-style-type:square;margin-top:.5em;margin-bottom:.5em}.wcpdf-extensions>li:before{content:"";border-color:transparent transparent transparent #111;border-style:solid;border-width:.35em .35em .35em .45em;display:block;height:0;width:0;left:-1em;top:.9em;position:relative}.wcpdf-extensions li:not(.expanded){cursor:pointer}.wcpdf-extensions .expanded:before{border-color:#111 transparent transparent transparent;left:-1.17em;border-width:.45em .45em .35em .35em!important}.wcpdf-extensions .more{padding:10px;background-color:#fff;border:1px solid #ccc;border-radius:5px}.wcpdf-extensions table td{vertical-align:top}.dropbox-logo{margin-bottom:-10px;margin-right:10px}.cloud-logo{margin-bottom:-10px;margin-top:-5px;margin-right:10px}#img-header_logo{max-height:200px;width:auto;max-width:100%}.multiple-text-input label{padding-right:1em}table.multiple-text-input td{padding:0}table.wcpdf_documents_settings_list{width:100%;border-collapse:collapse;border-spacing:0;background-color:#fff;border-top:2px solid #000}table.wcpdf_documents_settings_list tr.odd{background-color:#ebf5ff}table.wcpdf_documents_settings_list td{padding:5px}table.wcpdf_documents_settings_list a{text-decoration:none}table.wcpdf_documents_settings_list td.settings-icon{text-align:right}table.wcpdf_documents_settings_list td.title{font-weight:700}.wcpdf-settings-sections ul{height:3em}.wcpdf-settings-sections ul li{float:left;margin-right:10px}.wcpdf-settings-sections ul li a{text-decoration:none;display:inline-block;padding:.8em 1em;color:#50575e;border:1px solid #c3c4c7;box-sizing:border-box}.wcpdf-settings-sections ul li a.active{border:2px solid #51266b;padding:calc(.8em - 1px) calc(1em - 1px);color:#000}.wcpdf_document_settings_sections{position:relative}.wcpdf_document_settings_sections>h2{cursor:pointer;padding:1em .8em;margin:0;border:1px solid #c3c4c7;background:#fff}.wcpdf_document_settings_sections ul{background:#fff;list-style:none;margin:0;padding:0;width:100%;display:block;height:auto;display:none;box-sizing:border-box;position:absolute;border-left:1px solid #c3c4c7;border-right:1px solid #c3c4c7;z-index:1000;box-shadow:0 35px 35px -8px rgba(0,0,0,.1);-webkit-box-shadow:0 35px 35px -8px rgba(0,0,0,.1)}.wcpdf_document_settings_sections ul.active{display:block}.wcpdf_document_settings_sections ul li{box-sizing:border-box;padding:0;margin-bottom:0;border-bottom:1px solid #eaeaea;font-size:1.1em}.wcpdf_document_settings_sections ul li:last-child{border-color:#c3c4c7}.wcpdf_document_settings_sections ul li:hover{cursor:pointer;background:#51266b;color:#fff}.wcpdf_document_settings_sections ul li:hover a{color:#fff}.wcpdf_document_settings_sections ul li a{color:#000;text-decoration:none;padding:1.2em 1.6em;display:block}.wcpdf_document_settings_sections .arrow-down{font-size:.7em;color:#999;margin-left:8px;font-weight:400;float:right}.wcpdf_document_settings_sections p:hover,.wcpdf_document_settings_sections p:hover>.arrow-down{color:#222}.wcpdf_advanced_numbers_choose_table{margin-top:20px}.wcpdf_document_settings_document_output_formats{margin-bottom:30px}.edit-next-number{opacity:.5}.edit-next-number:hover{opacity:1;cursor:pointer}.wpo-wcpdf-pointer.wp-pointer-top .wp-pointer-arrow,.wpo-wcpdf-pointer.wp-pointer-top .wp-pointer-arrow-inner{border-bottom-color:#51266b}.wpo-wcpdf-pointer .wp-pointer-content h3{border-color:#51266b;background:#51266b}.wpo-wcpdf-pointer .wp-pointer-content h3:before{color:#51266b}body.woocommerce_page_wpo_wcpdf_options_page{background:#fdfdfd}.wrap [class$=icon32]+h2{font-size:18px;padding:1em}.wrap .notice{margin:15px 0 0}.nav-tab-wrapper:not(.wcpdf_debug_settings_sections>.nav-tab-wrapper) a.nav-tab{background:0 0;border:none;border-bottom:3px solid transparent;padding:1em 0;margin:0 1.2em;font-size:15px}.nav-tab-wrapper:not(.wcpdf_debug_settings_sections>.nav-tab-wrapper) a.nav-tab.nav-tab-active{border-bottom:3px solid #51266b}#wpo-wcpdf-preview-wrapper{width:100%;height:auto;position:relative;display:flex;align-items:flex-start}#wpo-wcpdf-preview-wrapper .preview-document,#wpo-wcpdf-preview-wrapper .sidebar{transition:.3s ease-in-out}#wpo-wcpdf-preview-wrapper .sidebar{height:auto;padding:4em 0 0 0;box-sizing:border-box;background:0 0;flex:0 0 35%;overflow-x:hidden}#wpo-wcpdf-preview-wrapper .sidebar>form{background:0 0!important;overflow:visible;padding:0;margin-left:2em;box-sizing:border-box;width:calc(100% - 4em);max-width:50vw}#wpo-wcpdf-preview-wrapper .sidebar>form.editor{max-width:none}#wpo-wcpdf-preview-wrapper .sidebar .form-table,#wpo-wcpdf-preview-wrapper .sidebar .form-table>tbody,#wpo-wcpdf-preview-wrapper .sidebar .form-table>tbody>tr,#wpo-wcpdf-preview-wrapper .sidebar .form-table>tbody>tr>td,#wpo-wcpdf-preview-wrapper .sidebar .form-table>tbody>tr>th{display:block;width:100%;padding:0}#wpo-wcpdf-preview-wrapper .sidebar .form-table>tbody>tr>th{padding-bottom:.6em}#wpo-wcpdf-preview-wrapper .sidebar .form-table>tbody>tr:not(:last-child)>td{padding-bottom:2.4em}#wpo-wcpdf-preview-wrapper .sidebar .form-table>tbody>tr>td p.description{font-size:.85em;padding-top:.7em}#wpo-wcpdf-preview-wrapper .sidebar .form-table>tbody>tr>td>input[type=text],#wpo-wcpdf-preview-wrapper .sidebar .form-table>tbody>tr>td>input[type=url],#wpo-wcpdf-preview-wrapper .sidebar .form-table>tbody>tr>td>select,#wpo-wcpdf-preview-wrapper .sidebar .form-table>tbody>tr>td>textarea{max-width:none;width:100%}#wpo-wcpdf-preview-wrapper input[type=text][size],#wpo-wcpdf-preview-wrapper input[type=url][size]{width:auto!important;max-width:100%!important}#wpo-wcpdf-preview-wrapper .sidebar .form-table>tbody>tr>td>input#next_invoice_number{width:auto!important}#wpo-wcpdf-preview-wrapper[data-preview-states="1"] .sidebar .form-table>tbody>tr,#wpo-wcpdf-preview-wrapper[data-preview-states="2"][data-preview-state=closed] .sidebar .form-table>tbody>tr,#wpo-wcpdf-preview-wrapper[data-preview-states="3"][data-preview-state=closed] .sidebar .form-table>tbody>tr{display:grid;grid-template-columns:1fr 2fr;gap:4em}#wpo-wcpdf-preview-wrapper .sidebar .settings_category h2{border-bottom:1px solid #c3c4c7;padding:1em 0 1em 5px;margin:0;font-weight:400;color:#222;font-family:sans-serif;font-size:1.3em;letter-spacing:-.01em;position:relative;transition:transform .3s;cursor:pointer}#wpo-wcpdf-preview-wrapper .sidebar .settings_category h2~.form-table{border-left:1px solid #c3c4c7;border-right:1px solid #c3c4c7;border-bottom:1px solid #c3c4c7;padding:2em;margin-top:-1px;background:#fff;margin-bottom:20px}#wpo-wcpdf-preview-wrapper .sidebar .settings_category h2::after{content:'\f347';font-family:dashicons;font-size:16px;color:#82878c;position:absolute;right:5px;top:50%;transform:translateY(-50%);transition:transform .15s}#wpo-wcpdf-preview-wrapper .sidebar .settings_category h2:hover:after{color:#222}#wpo-wcpdf-preview-wrapper .sidebar .settings_category h2.active::after{transform:translateY(-50%) rotate(180deg)}#wpo-wcpdf-preview-wrapper .my_account_buttons_custom{margin-top:1em}#wpo-wcpdf-settings .form-table .ui-tabs-nav{padding-left:0!important;margin-left:0!important}#wpo-wcpdf-settings .translations input,#wpo-wcpdf-settings .translations textarea{width:100%}#wpo-wcpdf-settings .wcpdf-attachment-settings-hint{border-left:4px solid #51266b}#wpo-wcpdf-settings .notice-info.inline{border-left-color:#51266b}#wpo-wcpdf-settings table#document-link-access-type{margin-top:-15px}#wpo-wcpdf-settings table#document-link-access-type td.option{padding-left:0}#wpo-wcpdf-settings table#document-link-access-type td{padding-top:0;padding-bottom:6px;font-size:12px}#wpo-wcpdf-settings .system-status-table{margin-top:2em}#wpo-wcpdf-preview-wrapper[data-preview-states="1"] .sidebar{flex:0 0 100%}#wpo-wcpdf-preview-wrapper[data-preview-states="2"][data-preview-state=closed] .sidebar{flex:0 0 95%}#wpo-wcpdf-preview-wrapper[data-preview-states="2"][data-preview-state=full] .sidebar{flex:0 0 95%;margin-left:-95%}#wpo-wcpdf-preview-wrapper[data-preview-states="3"][data-preview-state=closed] .sidebar{flex:0 0 95%}#wpo-wcpdf-preview-wrapper[data-preview-states="3"][data-preview-state=sidebar] .sidebar{flex:0 0 35%}#wpo-wcpdf-preview-wrapper[data-preview-states="3"][data-preview-state=full] .sidebar{margin-left:-35%}#wpo-wcpdf-preview-wrapper[data-preview-states="3"][data-from-preview-state=full] .sidebar{transition-delay:.4s}#wpo-wcpdf-preview-wrapper .preview-document{padding:0;box-sizing:border-box;position:sticky;top:2.4em;flex:0 0 60%}#wpo-wcpdf-preview-wrapper[data-preview-states="1"] .preview-document{display:none}#wpo-wcpdf-preview-wrapper[data-preview-states="2"][data-preview-state=closed] .preview-document{display:none}#wpo-wcpdf-preview-wrapper[data-preview-states="2"][data-preview-state=full] .preview-document{flex:0 0 95%}#wpo-wcpdf-preview-wrapper[data-preview-states="3"][data-preview-state=closed] .preview-document{flex:0 0 60%;margin-right:-60%}#wpo-wcpdf-preview-wrapper[data-preview-states="3"][data-preview-state=sidebar] .preview-document{flex:0 0 60%}#wpo-wcpdf-preview-wrapper[data-preview-states="3"][data-preview-state=full] .preview-document{flex:0 0 95%}#wpo-wcpdf-preview-wrapper[data-preview-states="3"][data-from-preview-state=full] .preview-document{transition-delay:.4s}.preview-document .preview{width:100%;box-sizing:border-box;padding-right:5%}.preview-document .preview>#preview-ubl{width:100%;height:100%;overflow-wrap:anywhere;background-color:#222;color:#fff;padding:2em}.preview-document .preview>#preview-canvas{display:block;max-width:800px;max-height:85vh;width:auto!important;margin:0 auto;background:#fff;box-shadow:8px 8px 8px rgba(0,0,0,.1),-8px -8px 8px rgba(0,0,0,.02);-webkit-box-shadow:8px 8px 8px rgba(0,0,0,.1),-8px -8px 8px rgba(0,0,0,.02)}#wpo-wcpdf-preview-wrapper[data-preview-states="2"] #preview-canvas{max-height:170vh}#wpo-wcpdf-preview-wrapper[data-preview-states="3"][data-from-preview-state=sidebar] #preview-canvas{max-height:170vh;transition:max-height .4s ease-in-out .3s}#wpo-wcpdf-preview-wrapper[data-preview-states="3"][data-from-preview-state=full] #preview-canvas{transition:max-height .4s ease-in-out 0s}.preview-document .preview-data-wrapper{width:100%;height:4em}.preview-document .preview-data-wrapper .preview-document-type,.preview-document .preview-data-wrapper .preview-order-data{float:right}.preview-document .preview-data-wrapper .preview-document-type{margin-right:30px}.preview-document .preview-data-wrapper .preview-document-type ul>li{text-decoration:none;color:initial;padding:1.4em 1.6em}.preview-document .preview-data-wrapper .preview-document-type ul>li:hover{color:#fff!important}.preview-document .preview-data-wrapper .save-settings{padding:1em 0 0 0;float:right;overflow:hidden;position:relative}.preview-document .preview-data-wrapper .save-settings p{padding:0;margin:0 0 0 2em;position:relative;margin-right:-200px;transition:margin-right .3s ease-out}.preview-document .preview-data-wrapper .save-settings p:after{content:'';display:block;pointer-events:none;position:absolute;box-sizing:border-box;border-radius:3px;right:0;top:0;background:0 0;width:100%;height:100%;z-index:10;border:0 solid #fff;animation:border-pulse 4s infinite}@keyframes border-pulse{0%{border-color:rgba(255,255,255,0);border-width:8px}50%{border-color:#fff;border-width:0}}.preview-document .preview-data-wrapper .save-settings p input:focus{outline-width:0;box-shadow:none}.preview-document .preview-data p{padding:1.4em 0;margin:0;color:#666;text-align:right;cursor:pointer;font-weight:lighter;float:right}.preview-document .preview-data p.order-search{display:none}.preview-document .preview-data input{float:right;margin:1em 0 0 1em;padding:.1em .5em;width:20ch;margin-right:-25ch;display:none}.preview-document .preview-data input.active{margin-right:0;display:inline-block}.preview-document .preview-data ul{position:absolute;right:0;top:4em;background:#fff;box-shadow:0 0 25px -10px rgba(0,0,0,.2);-webkit-box-shadow:0 0 25px -10px rgba(0,0,0,.2);list-style:none;margin:0;padding:0;min-width:24em;display:block;height:0;overflow:hidden}.preview-document .preview-data ul.active{height:auto;z-index:1}.preview-document .preview-data ul li{box-sizing:border-box;padding:0;margin-bottom:0;border-bottom:1px solid #eaeaea;font-size:1.1em}.preview-document .preview-data ul li:hover{cursor:pointer;background:#51266b;color:#fff}.preview-document .preview-data ul li a,.preview-document .preview-data.preview-order-data ul li{display:block;padding:1.4em 1.6em}.preview-document .preview-data .arrow-down{font-size:.8em;color:#999;margin-left:8px}.preview-document .preview-data p:hover,.preview-document .preview-data p:hover>.arrow-down{color:#222}.preview-document .preview-data #preview-order-search-results{display:none;position:absolute;right:0;top:4em;width:300px;box-shadow:0 0 25px -10px rgba(0,0,0,.2);-webkit-box-shadow:0 0 25px -10px rgba(0,0,0,.2);padding:20px 0;background-color:#fff;z-index:99}.preview-document .preview-data #preview-order-search-results a{display:block;border-left:1px solid #999;border-right:1px solid #999;border-top:1px solid #999;color:#000;padding:10px;margin:0 20px;text-decoration:none;cursor:pointer}.preview-document .preview-data #preview-order-search-results a:last-child{border-bottom:1px solid #999}.preview-document .preview-data #preview-order-search-results a:hover{background-color:#51266b;color:#fff}.preview-document .preview-data #preview-order-search-results .order-number{font-weight:700}.preview-document .preview-data #preview-order-search-results .date,.preview-document .preview-data #preview-order-search-results .total{margin-top:6px;display:inline-block}.preview-document .preview-data #preview-order-search-results .total{float:right}.preview-document .preview-data #preview-order-search-results .error{margin:0 20px}.preview-document .preview-order-search-wrapper{position:relative;float:right}.preview-document .preview-order-search-wrapper img.preview-order-search-clear{position:absolute;width:30px;height:16px;top:22px;right:6px;display:none;cursor:pointer}#wpo-wcpdf-preview-wrapper .gutter{flex:0 0 5%;position:sticky;top:2.4em;height:170vh}#wpo-wcpdf-preview-wrapper[data-preview-states="2"][data-preview-state=closed] .gutter .slide-left,#wpo-wcpdf-preview-wrapper[data-preview-states="3"][data-preview-state=closed] .gutter .slide-left{float:right}#wpo-wcpdf-preview-wrapper[data-preview-states="3"][data-preview-state=sidebar] .gutter .slide-left{border:none}#wpo-wcpdf-preview-wrapper .slider{box-sizing:border-box;padding-top:2.4em;color:#999;font-weight:700;cursor:pointer;font-size:.7em;line-height:1em;width:50%;height:100%;float:left}#wpo-wcpdf-preview-wrapper .slider.slide-left{text-align:right;padding-right:10px;border-right:1px solid #ccc}#wpo-wcpdf-preview-wrapper .slider.slide-right{text-align:left;padding-left:10px;border-left:1px solid #ccc;display:none}#wpo-wcpdf-preview-wrapper .gutter-arrow{width:0;height:0;border-top:3px solid transparent;border-bottom:3px solid transparent;display:block}#wpo-wcpdf-preview-wrapper .arrow-left{border-right:7px solid #999;float:right}#wpo-wcpdf-preview-wrapper .arrow-right{border-left:7px solid #999}#wpo-wcpdf-preview-wrapper .slider:hover>.arrow-left{border-right:7px solid #222}#wpo-wcpdf-preview-wrapper .slider:hover>.arrow-right{border-left:7px solid #222}#wpo-wcpdf-preview-wrapper .slider.slide-left:after{position:absolute;top:1.55em;right:2em;font-size:1.4em;display:none}#wpo-wcpdf-preview-wrapper .slider.slide-right:after{position:absolute;top:1.55em;left:2em;font-size:1.4em;display:none}#wpo-wcpdf-preview-wrapper[data-preview-states="1"] .gutter{display:none}#wpo-wcpdf-preview-wrapper[data-preview-states="3"][data-preview-state=sidebar] .gutter{height:100vh}#wpo-wcpdf-preview-wrapper[data-preview-state=full] .slide-right:after{display:inline-block}#wpo-wcpdf-preview-wrapper[data-preview-state=closed] .slide-left:after{display:inline-block}#wpo-wcpdf-preview-wrapper.static .gutter,#wpo-wcpdf-preview-wrapper.static .preview-document{position:static!important}#wpo-wcpdf-preview-wrapper.static .sidebar{height:170vh!important;overflow:hidden}#wpo-wcpdf-preview-wrapper input.readonly,#wpo-wcpdf-preview-wrapper input[readonly],#wpo-wcpdf-preview-wrapper textarea.readonly,#wpo-wcpdf-preview-wrapper textarea[readonly]{background-color:#f8f8f8}#wpo-wcpdf-preview-wrapper[data-preview-state=sidebar] .select2.select2-container{width:100%!important}.wcpdf_ubl_settings_sections{margin-bottom:4em}#wpo-wcpdf-preview-wrapper input#due_date_days{text-align:right}#wpo-wcpdf-preview-wrapper input#due_date_days:disabled{background-color:#eaeaea;color:#999}sup.wcpdf_beta{background-color:#51266b;color:#fff;font-size:7pt;padding:1px 2px;border-radius:2px}@media screen and (min-width:1920px){.preview-document .preview>#preview-canvas{max-width:900px}}@media screen and (max-width:1200px){.preview-document .preview>#preview-canvas{max-width:680px}.nav-tab-wrapper a.nav-tab{padding:1em 2em;margin:0 .5em .5em 0;border:1px solid #ccc;box-sizing:border-box;height:4em}.nav-tab-wrapper a.nav-tab.nav-tab-active{border:3px solid #51266b}.preview-document .preview>#preview-canvas{width:80vw!important}#wpo-wcpdf-preview-wrapper .sidebar>form{max-width:100%}#wpo-wcpdf-preview-wrapper[data-preview-state=closed] .select2.select2-container{width:100%!important}#wpo-wcpdf-preview-wrapper[data-preview-states="1"] .sidebar .form-table>tbody>tr,#wpo-wcpdf-preview-wrapper[data-preview-states="2"][data-preview-state=closed] .sidebar .form-table>tbody>tr,#wpo-wcpdf-preview-wrapper[data-preview-states="3"][data-preview-state=closed] .sidebar .form-table>tbody>tr{gap:2em}.preview-document .preview-data-wrapper{height:6em}.preview-document .preview-data p{padding:2.2em 0}#wpo-wcpdf-preview-wrapper .slider.slide-left:after,#wpo-wcpdf-preview-wrapper .slider.slide-right:after{top:1.5em;padding:1em;background:#fff;border:1px solid #ccc}#wpo-wcpdf-preview-wrapper .slider.slide-right:after{left:0}#wpo-wcpdf-preview-wrapper .slider.slide-left:after{right:0}#wpo-wcpdf-preview-wrapper .multiple-text-input tr td:nth-child(2),#wpo-wcpdf-preview-wrapper .multiple-text-input tr td:nth-child(3){float:left;margin-bottom:10px}#wpo-wcpdf-preview-wrapper .multiple-text-input tr td .woocommerce-help-tip:after{padding:.5em .8em;font-size:1.2em;line-height:inherit}}@media screen and (max-width:860px){#wpo-wcpdf-preview-wrapper[data-preview-states="1"] .sidebar .form-table>tbody>tr,#wpo-wcpdf-preview-wrapper[data-preview-states="2"][data-preview-state=closed] .sidebar .form-table>tbody>tr,#wpo-wcpdf-preview-wrapper[data-preview-states="3"][data-preview-state=closed] .sidebar .form-table>tbody>tr{display:block}}div.upgrade-table-description{padding:0 0 3em 1em}div.upgrade-table-description h1{font-family:serif;letter-spacing:-1px;font-size:3em}div.upgrade-table-description p{font-size:1.1em}#upgrade-table{width:100%;border-collapse:collapse;font-size:1.2em;margin-bottom:3em}#upgrade-table td,#upgrade-table th{padding:.8em 2em;border-bottom:1px solid #ccc;text-align:center}#upgrade-table th{font-weight:400;font-size:1.1em}#upgrade-table td:not(.last),#upgrade-table th:not(.last){width:200px}#upgrade-table tr:last-child td{border:none}#upgrade-table td.feature-label{text-align:left;padding-left:1em;font-weight:700;width:500px}#upgrade-table td.feature-label span.description{display:inline-block;padding-top:10px;font-size:.8em;line-height:1.4em;font-weight:400;color:#555}#upgrade-table td span.feature-available{display:inline-block;width:24px;height:24px;background-repeat:no-repeat;background-size:cover}#upgrade-table a,div.upgrade-table-description a{color:#6e1edc;white-space:nowrap}#upgrade-table .upgrade-links h4{margin:1em 0 .5em 0}#upgrade-table .upgrade-links p{margin:0;font-style:oblique;font-size:.8em}#plugin-recommendations a.upgrade_button,#upgrade-table .upgrade-links a.upgrade_button{display:inline-block;background:#fff;padding:1em 3em 1em 2em;border-radius:12px;border:1px solid #6e1edc;text-decoration:none;margin:2em 0;position:relative}#plugin-recommendations a.upgrade_button:after,#upgrade-table .upgrade-links a.upgrade_button:after{content:' \2192';display:block;position:absolute;right:1.8em;top:1.1em;transition:.5s}#plugin-recommendations a.upgrade_button:hover:after,#upgrade-table .upgrade-links a.upgrade_button:hover:after{right:1.1em;font-weight:700}#plugin-recommendations a.upgrade_button:focus,#plugin-recommendations a.upgrade_button:hover,#upgrade-table .upgrade-links a.upgrade_button:focus,#upgrade-table .upgrade-links a.upgrade_button:hover{background:#6e1edc;color:#fcfbf7}#plugin-recommendations{border-radius:8px;background-color:#f1e9fc;padding:4em 3em}#plugin-recommendations .card-container{max-width:1100px;display:grid;grid-template-columns:repeat(3,1fr);grid-gap:3em;padding:2em 0}#plugin-recommendations .recommendation-card{margin-top:0;border-radius:6px;background-color:#fff;box-shadow:0 0 25px -10px rgba(0,0,0,.2);box-sizing:border-box;font-size:15px;overflow:hidden;transition:.2s}#plugin-recommendations .recommendation-card:nth-child(n+4){display:none}#plugin-recommendations .recommendation-card:hover{scale:1.02}#plugin-recommendations .recommendation-card.currently-installed{opacity:.5}#plugin-recommendations .recommendation-card .card-content{padding:0 4em 3em 2em}#plugin-recommendations .recommendation-card img{width:100%}#plugin-recommendations .recommendation-card h5{text-align:left;font-size:1.4em;line-height:1.3em;font-weight:700;margin:1em 0}#plugin-recommendations .recommendation-card p{text-align:left;padding-bottom:10px}#plugin-recommendations .recommendation-card a.upgrade_button{margin:0}#plugin-recommendations .recommendation-card span.currently-installed{font-size:.7em;color:#fff;background-color:#6e1edc;padding:1em 2em;border-radius:12px;margin:0;display:inline-block}@media screen and (max-width:1100px){#upgrade-table{font-size:1em;line-height:1.2em}#upgrade-table td:not(.last),#upgrade-table th:not(.last){width:25%;padding:.8em 1em}#upgrade-table td.last,#upgrade-table th.last{width:0;padding:0}#upgrade-table td.feature-label span.description{padding-top:6px}#plugin-recommendations .card-container{grid-gap:2em}}@media screen and (max-width:968px){#plugin-recommendations .card-container{grid-template-columns:repeat(1,1fr);padding-right:40%}}@media screen and (max-width:782px){#wpo-wcpdf-preview-wrapper .sidebar .form-table>tbody>tr>td:has(input[type=checkbox]+input[type=text])>input{display:inline-block}}@media screen and (max-width:767px){#upgrade-table td.feature-label span.description{display:none}#upgrade-table td:not(.last),#upgrade-table th:not(.last){width:20%}#upgrade-table td.first{width:40%}#plugin-recommendations .card-container{padding-right:0}}@media screen and (max-width:649px){div.upgrade-table-description{padding-left:.8em}div.upgrade-table-description p{font-size:1em}#upgrade-table{font-size:.8em}#upgrade-table td,#upgrade-table th{padding:.5em .8em!important}#upgrade-table td span.feature-available{width:18px;height:18px}#upgrade-table .upgrade-links a{white-space:normal;padding:.6em .8em;border-radius:6px}#upgrade-table .upgrade-links a:after{display:none}#plugin-recommendations .card-container{justify-content:center}}@media screen and (max-width:782px){input[type=checkbox],input[type=radio]{margin-bottom:.5em}} \ No newline at end of file +span.wpo-warning{display:inline-block;border:1px solid red;border-left:4px solid red;padding:5px 15px;background-color:#fff}.wcpdf-extensions-ad,.wcpdf-promo-ad{position:relative;min-height:90px;border:1px solid #6e1edc;background-color:#f1e9fc;padding:15px;padding-left:100px;margin-top:30px}img.wpo-helper{position:absolute;bottom:0;left:3px}.wcpdf-extensions-ad h3,.wcpdf-promo-ad h3{margin:0;padding:20px;font-weight:400;font-family:serif;letter-spacing:-1px;font-size:2.25em}.wcpdf-promo-ad p{margin:0;padding:0 20px;font-size:1.15em}.wcpdf-promo-ad p.upgrade-tab{margin-top:30px;font-style:italic;font-size:1em}.wcpdf-promo-ad p.expiration{font-size:.8em;padding-top:8px}.wcpdf-extensions-ad a,.wcpdf-promo-ad a{color:#6e1edc}.wcpdf-extensions-ad a.dismiss,.wcpdf-promo-ad a.dismiss{padding:10px 20px}.wcpdf-promo-ad p strong.code{font-size:1.3em;font-family:serif;padding:.1em .4em;background:#6e1edc;color:#fff;border-radius:5px;font-weight:400}.wcpdf-extensions-ad i{padding-left:20px}.wcpdf-extensions-ad ul,.wcpdf-promo-ad ul{margin:0;margin-left:40px}.wcpdf-extensions li{margin:0}.wcpdf-extensions li ul{list-style-type:square;margin-top:.5em;margin-bottom:.5em}.wcpdf-extensions>li:before{content:"";border-color:transparent transparent transparent #111;border-style:solid;border-width:.35em .35em .35em .45em;display:block;height:0;width:0;left:-1em;top:.9em;position:relative}.wcpdf-extensions li:not(.expanded){cursor:pointer}.wcpdf-extensions .expanded:before{border-color:#111 transparent transparent transparent;left:-1.17em;border-width:.45em .45em .35em .35em!important}.wcpdf-extensions .more{padding:10px;background-color:#fff;border:1px solid #ccc;border-radius:5px}.wcpdf-extensions table td{vertical-align:top}.dropbox-logo{margin-bottom:-10px;margin-right:10px}.cloud-logo{margin-bottom:-10px;margin-top:-5px;margin-right:10px}#img-header_logo{max-height:200px;width:auto;max-width:100%}.multiple-text-input label{padding-right:1em}table.multiple-text-input td{padding:0}table.wcpdf_documents_settings_list{width:100%;border-collapse:collapse;border-spacing:0;background-color:#fff;border-top:2px solid #000}table.wcpdf_documents_settings_list tr.odd{background-color:#ebf5ff}table.wcpdf_documents_settings_list td{padding:5px}table.wcpdf_documents_settings_list a{text-decoration:none}table.wcpdf_documents_settings_list td.settings-icon{text-align:right}table.wcpdf_documents_settings_list td.title{font-weight:700}.wcpdf-settings-sections ul{height:3em}.wcpdf-settings-sections ul li{float:left;margin-right:10px}.wcpdf-settings-sections ul li a{text-decoration:none;display:inline-block;padding:.8em 1em;color:#50575e;border:1px solid #c3c4c7;box-sizing:border-box}.wcpdf-settings-sections ul li a.active{border:2px solid #51266b;padding:calc(.8em - 1px) calc(1em - 1px);color:#000}.wcpdf_document_settings_sections{position:relative}.wcpdf_document_settings_sections>h2{cursor:pointer;padding:1em .8em;margin:0;border:1px solid #c3c4c7;background:#fff}.wcpdf_document_settings_sections ul{background:#fff;list-style:none;margin:0;padding:0;width:100%;display:block;height:auto;display:none;box-sizing:border-box;position:absolute;border-left:1px solid #c3c4c7;border-right:1px solid #c3c4c7;z-index:1000;box-shadow:0 35px 35px -8px rgba(0,0,0,.1);-webkit-box-shadow:0 35px 35px -8px rgba(0,0,0,.1)}.wcpdf_document_settings_sections ul.active{display:block}.wcpdf_document_settings_sections ul li{box-sizing:border-box;padding:0;margin-bottom:0;border-bottom:1px solid #eaeaea;font-size:1.1em}.wcpdf_document_settings_sections ul li:last-child{border-color:#c3c4c7}.wcpdf_document_settings_sections ul li:hover{cursor:pointer;background:#51266b;color:#fff}.wcpdf_document_settings_sections ul li:hover a{color:#fff}.wcpdf_document_settings_sections ul li a{color:#000;text-decoration:none;padding:1.2em 1.6em;display:block}.wcpdf_document_settings_sections .arrow-down{font-size:.7em;color:#999;margin-left:8px;font-weight:400;float:right}.wcpdf_document_settings_sections p:hover,.wcpdf_document_settings_sections p:hover>.arrow-down{color:#222}.wcpdf_advanced_numbers_choose_table{margin-top:20px}.wcpdf_document_settings_document_output_formats{margin-bottom:30px}.edit-next-number{opacity:.5}.edit-next-number:hover{opacity:1;cursor:pointer}.wpo-wcpdf-pointer.wp-pointer-top .wp-pointer-arrow,.wpo-wcpdf-pointer.wp-pointer-top .wp-pointer-arrow-inner{border-bottom-color:#51266b}.wpo-wcpdf-pointer .wp-pointer-content h3{border-color:#51266b;background:#51266b}.wpo-wcpdf-pointer .wp-pointer-content h3:before{color:#51266b}body.woocommerce_page_wpo_wcpdf_options_page{background:#fdfdfd}.wrap [class$=icon32]+h2{font-size:18px;padding:1em}.wrap .notice{margin:15px 0 0}.nav-tab-wrapper:not(.wcpdf_debug_settings_sections>.nav-tab-wrapper) a.nav-tab{background:0 0;border:none;border-bottom:3px solid transparent;padding:1em 0;margin:0 1.2em;font-size:15px}.nav-tab-wrapper:not(.wcpdf_debug_settings_sections>.nav-tab-wrapper) a.nav-tab.nav-tab-active{border-bottom:3px solid #51266b}#wpo-wcpdf-preview-wrapper{width:100%;height:auto;position:relative;display:flex;align-items:flex-start}#wpo-wcpdf-preview-wrapper .preview-document,#wpo-wcpdf-preview-wrapper .sidebar{transition:.3s ease-in-out}#wpo-wcpdf-preview-wrapper .sidebar{height:auto;padding:4em 0 0 0;box-sizing:border-box;background:0 0;flex:0 0 35%;overflow-x:hidden}#wpo-wcpdf-preview-wrapper .sidebar>form{background:0 0!important;overflow:visible;padding:0;margin-left:2em;box-sizing:border-box;width:calc(100% - 4em);max-width:50vw}#wpo-wcpdf-preview-wrapper .sidebar>form.editor{max-width:none}#wpo-wcpdf-preview-wrapper .sidebar .form-table,#wpo-wcpdf-preview-wrapper .sidebar .form-table>tbody,#wpo-wcpdf-preview-wrapper .sidebar .form-table>tbody>tr,#wpo-wcpdf-preview-wrapper .sidebar .form-table>tbody>tr>td,#wpo-wcpdf-preview-wrapper .sidebar .form-table>tbody>tr>th{display:block;width:100%;padding:0}#wpo-wcpdf-preview-wrapper .sidebar .form-table>tbody>tr>th{padding-bottom:.6em}#wpo-wcpdf-preview-wrapper .sidebar .form-table>tbody>tr:not(:last-child)>td{padding-bottom:2.4em}#wpo-wcpdf-preview-wrapper .sidebar .form-table>tbody>tr>td p.description{font-size:.85em;padding-top:.7em}#wpo-wcpdf-preview-wrapper .sidebar .form-table>tbody>tr>td p.description>span.wpo-warning{width:100%;box-sizing:border-box;word-wrap:break-word}#wpo-wcpdf-preview-wrapper .sidebar .form-table>tbody>tr>td>input[type=text],#wpo-wcpdf-preview-wrapper .sidebar .form-table>tbody>tr>td>input[type=url],#wpo-wcpdf-preview-wrapper .sidebar .form-table>tbody>tr>td>select,#wpo-wcpdf-preview-wrapper .sidebar .form-table>tbody>tr>td>textarea{max-width:none;width:100%}#wpo-wcpdf-preview-wrapper input[type=text][size],#wpo-wcpdf-preview-wrapper input[type=url][size]{width:auto!important;max-width:100%!important}#wpo-wcpdf-preview-wrapper .sidebar .form-table>tbody>tr>td>input#next_invoice_number{width:auto!important}#wpo-wcpdf-preview-wrapper[data-preview-states="1"] .sidebar .form-table>tbody>tr,#wpo-wcpdf-preview-wrapper[data-preview-states="2"][data-preview-state=closed] .sidebar .form-table>tbody>tr,#wpo-wcpdf-preview-wrapper[data-preview-states="3"][data-preview-state=closed] .sidebar .form-table>tbody>tr{display:grid;grid-template-columns:1fr 2fr;gap:4em}#wpo-wcpdf-preview-wrapper .sidebar .settings_category h2{border-bottom:1px solid #c3c4c7;padding:1em 0 1em 5px;margin:0;font-weight:400;color:#222;font-family:sans-serif;font-size:1.3em;letter-spacing:-.01em;position:relative;transition:transform .3s;cursor:pointer}#wpo-wcpdf-preview-wrapper .sidebar .settings_category h2~.form-table{border-left:1px solid #c3c4c7;border-right:1px solid #c3c4c7;border-bottom:1px solid #c3c4c7;padding:2em;margin-top:-1px;background:#fff;margin-bottom:20px}#wpo-wcpdf-preview-wrapper .sidebar .settings_category h2::after{content:'\f347';font-family:dashicons;font-size:16px;color:#82878c;position:absolute;right:5px;top:50%;transform:translateY(-50%);transition:transform .15s}#wpo-wcpdf-preview-wrapper .sidebar .settings_category h2:hover:after{color:#222}#wpo-wcpdf-preview-wrapper .sidebar .settings_category h2.active::after{transform:translateY(-50%) rotate(180deg)}#wpo-wcpdf-preview-wrapper .my_account_buttons_custom{margin-top:1em}#wpo-wcpdf-settings .form-table .ui-tabs-nav{padding-left:0!important;margin-left:0!important}#wpo-wcpdf-settings .translations input,#wpo-wcpdf-settings .translations textarea{width:100%}#wpo-wcpdf-settings .wcpdf-attachment-settings-hint{border-left:4px solid #51266b}#wpo-wcpdf-settings .notice-info.inline{border-left-color:#51266b}#wpo-wcpdf-settings table#document-link-access-type{margin-top:-15px}#wpo-wcpdf-settings table#document-link-access-type td.option{padding-left:0}#wpo-wcpdf-settings table#document-link-access-type td{padding-top:0;padding-bottom:6px;font-size:12px}#wpo-wcpdf-settings .system-status-table{margin-top:2em}#wpo-wcpdf-preview-wrapper[data-preview-states="1"] .sidebar{flex:0 0 100%}#wpo-wcpdf-preview-wrapper[data-preview-states="2"][data-preview-state=closed] .sidebar{flex:0 0 95%}#wpo-wcpdf-preview-wrapper[data-preview-states="2"][data-preview-state=full] .sidebar{flex:0 0 95%;margin-left:-95%}#wpo-wcpdf-preview-wrapper[data-preview-states="3"][data-preview-state=closed] .sidebar{flex:0 0 95%}#wpo-wcpdf-preview-wrapper[data-preview-states="3"][data-preview-state=sidebar] .sidebar{flex:0 0 35%}#wpo-wcpdf-preview-wrapper[data-preview-states="3"][data-preview-state=full] .sidebar{margin-left:-35%}#wpo-wcpdf-preview-wrapper[data-preview-states="3"][data-from-preview-state=full] .sidebar{transition-delay:.4s}#wpo-wcpdf-preview-wrapper .preview-document{padding:0;box-sizing:border-box;position:sticky;top:2.4em;flex:0 0 60%}#wpo-wcpdf-preview-wrapper[data-preview-states="1"] .preview-document{display:none}#wpo-wcpdf-preview-wrapper[data-preview-states="2"][data-preview-state=closed] .preview-document{display:none}#wpo-wcpdf-preview-wrapper[data-preview-states="2"][data-preview-state=full] .preview-document{flex:0 0 95%}#wpo-wcpdf-preview-wrapper[data-preview-states="3"][data-preview-state=closed] .preview-document{flex:0 0 60%;margin-right:-60%}#wpo-wcpdf-preview-wrapper[data-preview-states="3"][data-preview-state=sidebar] .preview-document{flex:0 0 60%}#wpo-wcpdf-preview-wrapper[data-preview-states="3"][data-preview-state=full] .preview-document{flex:0 0 95%}#wpo-wcpdf-preview-wrapper[data-preview-states="3"][data-from-preview-state=full] .preview-document{transition-delay:.4s}.preview-document .preview{width:100%;box-sizing:border-box;padding-right:5%}.preview-document .preview>#preview-ubl{width:100%;height:100%;overflow-wrap:anywhere;background-color:#222;color:#fff;padding:2em}.preview-document .preview>#preview-canvas{display:block;max-width:800px;max-height:85vh;width:auto!important;margin:0 auto;background:#fff;box-shadow:8px 8px 8px rgba(0,0,0,.1),-8px -8px 8px rgba(0,0,0,.02);-webkit-box-shadow:8px 8px 8px rgba(0,0,0,.1),-8px -8px 8px rgba(0,0,0,.02)}#wpo-wcpdf-preview-wrapper[data-preview-states="2"] #preview-canvas{max-height:170vh}#wpo-wcpdf-preview-wrapper[data-preview-states="3"][data-from-preview-state=sidebar] #preview-canvas{max-height:170vh;transition:max-height .4s ease-in-out .3s}#wpo-wcpdf-preview-wrapper[data-preview-states="3"][data-from-preview-state=full] #preview-canvas{transition:max-height .4s ease-in-out 0s}.preview-document .preview-data-wrapper{width:100%;height:4em}.preview-document .preview-data-wrapper .preview-document-type,.preview-document .preview-data-wrapper .preview-order-data{float:right}.preview-document .preview-data-wrapper .preview-document-type{margin-right:30px}.preview-document .preview-data-wrapper .preview-document-type ul>li{text-decoration:none;color:initial;padding:1.4em 1.6em}.preview-document .preview-data-wrapper .preview-document-type ul>li:hover{color:#fff!important}.preview-document .preview-data-wrapper .save-settings{padding:1em 0 0 0;float:right;overflow:hidden;position:relative}.preview-document .preview-data-wrapper .save-settings p{padding:0;margin:0 0 0 2em;position:relative;margin-right:-200px;transition:margin-right .3s ease-out}.preview-document .preview-data-wrapper .save-settings p:after{content:'';display:block;pointer-events:none;position:absolute;box-sizing:border-box;border-radius:3px;right:0;top:0;background:0 0;width:100%;height:100%;z-index:10;border:0 solid #fff;animation:border-pulse 4s infinite}@keyframes border-pulse{0%{border-color:rgba(255,255,255,0);border-width:8px}50%{border-color:#fff;border-width:0}}.preview-document .preview-data-wrapper .save-settings p input:focus{outline-width:0;box-shadow:none}.preview-document .preview-data p{padding:1.4em 0;margin:0;color:#666;text-align:right;cursor:pointer;font-weight:lighter;float:right}.preview-document .preview-data p.order-search{display:none}.preview-document .preview-data input{float:right;margin:1em 0 0 1em;padding:.1em .5em;width:20ch;margin-right:-25ch;display:none}.preview-document .preview-data input.active{margin-right:0;display:inline-block}.preview-document .preview-data ul{position:absolute;right:0;top:4em;background:#fff;box-shadow:0 0 25px -10px rgba(0,0,0,.2);-webkit-box-shadow:0 0 25px -10px rgba(0,0,0,.2);list-style:none;margin:0;padding:0;min-width:24em;display:block;height:0;overflow:hidden}.preview-document .preview-data ul.active{height:auto;z-index:1}.preview-document .preview-data ul li{box-sizing:border-box;padding:0;margin-bottom:0;border-bottom:1px solid #eaeaea;font-size:1.1em}.preview-document .preview-data ul li:hover{cursor:pointer;background:#51266b;color:#fff}.preview-document .preview-data ul li a,.preview-document .preview-data.preview-order-data ul li{display:block;padding:1.4em 1.6em}.preview-document .preview-data .arrow-down{font-size:.8em;color:#999;margin-left:8px}.preview-document .preview-data p:hover,.preview-document .preview-data p:hover>.arrow-down{color:#222}.preview-document .preview-data #preview-order-search-results{display:none;position:absolute;right:0;top:4em;width:300px;box-shadow:0 0 25px -10px rgba(0,0,0,.2);-webkit-box-shadow:0 0 25px -10px rgba(0,0,0,.2);padding:20px 0;background-color:#fff;z-index:99}.preview-document .preview-data #preview-order-search-results a{display:block;border-left:1px solid #999;border-right:1px solid #999;border-top:1px solid #999;color:#000;padding:10px;margin:0 20px;text-decoration:none;cursor:pointer}.preview-document .preview-data #preview-order-search-results a:last-child{border-bottom:1px solid #999}.preview-document .preview-data #preview-order-search-results a:hover{background-color:#51266b;color:#fff}.preview-document .preview-data #preview-order-search-results .order-number{font-weight:700}.preview-document .preview-data #preview-order-search-results .date,.preview-document .preview-data #preview-order-search-results .total{margin-top:6px;display:inline-block}.preview-document .preview-data #preview-order-search-results .total{float:right}.preview-document .preview-data #preview-order-search-results .error{margin:0 20px}.preview-document .preview-order-search-wrapper{position:relative;float:right}.preview-document .preview-order-search-wrapper img.preview-order-search-clear{position:absolute;width:30px;height:16px;top:22px;right:6px;display:none;cursor:pointer}#wpo-wcpdf-preview-wrapper .gutter{flex:0 0 5%;position:sticky;top:2.4em;height:170vh}#wpo-wcpdf-preview-wrapper[data-preview-states="2"][data-preview-state=closed] .gutter .slide-left,#wpo-wcpdf-preview-wrapper[data-preview-states="3"][data-preview-state=closed] .gutter .slide-left{float:right}#wpo-wcpdf-preview-wrapper[data-preview-states="3"][data-preview-state=sidebar] .gutter .slide-left{border:none}#wpo-wcpdf-preview-wrapper .slider{box-sizing:border-box;padding-top:2.4em;color:#999;font-weight:700;cursor:pointer;font-size:.7em;line-height:1em;width:50%;height:100%;float:left}#wpo-wcpdf-preview-wrapper .slider.slide-left{text-align:right;padding-right:10px;border-right:1px solid #ccc}#wpo-wcpdf-preview-wrapper .slider.slide-right{text-align:left;padding-left:10px;border-left:1px solid #ccc;display:none}#wpo-wcpdf-preview-wrapper .gutter-arrow{width:0;height:0;border-top:3px solid transparent;border-bottom:3px solid transparent;display:block}#wpo-wcpdf-preview-wrapper .arrow-left{border-right:7px solid #999;float:right}#wpo-wcpdf-preview-wrapper .arrow-right{border-left:7px solid #999}#wpo-wcpdf-preview-wrapper .slider:hover>.arrow-left{border-right:7px solid #222}#wpo-wcpdf-preview-wrapper .slider:hover>.arrow-right{border-left:7px solid #222}#wpo-wcpdf-preview-wrapper .slider.slide-left:after{position:absolute;top:1.55em;right:2em;font-size:1.4em;display:none}#wpo-wcpdf-preview-wrapper .slider.slide-right:after{position:absolute;top:1.55em;left:2em;font-size:1.4em;display:none}#wpo-wcpdf-preview-wrapper[data-preview-states="1"] .gutter{display:none}#wpo-wcpdf-preview-wrapper[data-preview-states="3"][data-preview-state=sidebar] .gutter{height:100vh}#wpo-wcpdf-preview-wrapper[data-preview-state=full] .slide-right:after{display:inline-block}#wpo-wcpdf-preview-wrapper[data-preview-state=closed] .slide-left:after{display:inline-block}#wpo-wcpdf-preview-wrapper.static .gutter,#wpo-wcpdf-preview-wrapper.static .preview-document{position:static!important}#wpo-wcpdf-preview-wrapper.static .sidebar{height:170vh!important;overflow:hidden}#wpo-wcpdf-preview-wrapper input.readonly,#wpo-wcpdf-preview-wrapper input[readonly],#wpo-wcpdf-preview-wrapper textarea.readonly,#wpo-wcpdf-preview-wrapper textarea[readonly]{background-color:#f8f8f8}#wpo-wcpdf-preview-wrapper[data-preview-state=sidebar] .select2.select2-container{width:100%!important}.wcpdf_ubl_settings_sections{margin-bottom:4em}#wpo-wcpdf-preview-wrapper input#due_date_days{text-align:right}#wpo-wcpdf-preview-wrapper input#due_date_days:disabled{background-color:#eaeaea;color:#999}sup.wcpdf_beta{background-color:#51266b;color:#fff;font-size:7pt;padding:1px 2px;border-radius:2px}@media screen and (min-width:1920px){.preview-document .preview>#preview-canvas{max-width:900px}}@media screen and (max-width:1200px){.preview-document .preview>#preview-canvas{max-width:680px}.nav-tab-wrapper a.nav-tab{padding:1em 2em;margin:0 .5em .5em 0;border:1px solid #ccc;box-sizing:border-box;height:4em}.nav-tab-wrapper a.nav-tab.nav-tab-active{border:3px solid #51266b}.preview-document .preview>#preview-canvas{width:80vw!important}#wpo-wcpdf-preview-wrapper .sidebar>form{max-width:100%}#wpo-wcpdf-preview-wrapper[data-preview-state=closed] .select2.select2-container{width:100%!important}#wpo-wcpdf-preview-wrapper[data-preview-states="1"] .sidebar .form-table>tbody>tr,#wpo-wcpdf-preview-wrapper[data-preview-states="2"][data-preview-state=closed] .sidebar .form-table>tbody>tr,#wpo-wcpdf-preview-wrapper[data-preview-states="3"][data-preview-state=closed] .sidebar .form-table>tbody>tr{gap:2em}.preview-document .preview-data-wrapper{height:6em}.preview-document .preview-data p{padding:2.2em 0}#wpo-wcpdf-preview-wrapper .slider.slide-left:after,#wpo-wcpdf-preview-wrapper .slider.slide-right:after{top:1.5em;padding:1em;background:#fff;border:1px solid #ccc}#wpo-wcpdf-preview-wrapper .slider.slide-right:after{left:0}#wpo-wcpdf-preview-wrapper .slider.slide-left:after{right:0}#wpo-wcpdf-preview-wrapper .multiple-text-input tr td:nth-child(2),#wpo-wcpdf-preview-wrapper .multiple-text-input tr td:nth-child(3){float:left;margin-bottom:10px}#wpo-wcpdf-preview-wrapper .multiple-text-input tr td .woocommerce-help-tip:after{padding:.5em .8em;font-size:1.2em;line-height:inherit}}@media screen and (max-width:860px){#wpo-wcpdf-preview-wrapper[data-preview-states="1"] .sidebar .form-table>tbody>tr,#wpo-wcpdf-preview-wrapper[data-preview-states="2"][data-preview-state=closed] .sidebar .form-table>tbody>tr,#wpo-wcpdf-preview-wrapper[data-preview-states="3"][data-preview-state=closed] .sidebar .form-table>tbody>tr{display:block}}div.upgrade-table-description{padding:0 0 3em 1em}div.upgrade-table-description h1{font-family:serif;letter-spacing:-1px;font-size:3em}div.upgrade-table-description p{font-size:1.1em}#upgrade-table{width:100%;border-collapse:collapse;font-size:1.2em;margin-bottom:3em}#upgrade-table td,#upgrade-table th{padding:.8em 2em;border-bottom:1px solid #ccc;text-align:center}#upgrade-table th{font-weight:400;font-size:1.1em}#upgrade-table td:not(.last),#upgrade-table th:not(.last){width:200px}#upgrade-table tr:last-child td{border:none}#upgrade-table td.feature-label{text-align:left;padding-left:1em;font-weight:700;width:500px}#upgrade-table td.feature-label span.description{display:inline-block;padding-top:10px;font-size:.8em;line-height:1.4em;font-weight:400;color:#555}#upgrade-table td span.feature-available{display:inline-block;width:24px;height:24px;background-repeat:no-repeat;background-size:cover}#upgrade-table a,div.upgrade-table-description a{color:#6e1edc;white-space:nowrap}#upgrade-table .upgrade-links h4{margin:1em 0 .5em 0}#upgrade-table .upgrade-links p{margin:0;font-style:oblique;font-size:.8em}#plugin-recommendations a.upgrade_button,#upgrade-table .upgrade-links a.upgrade_button{display:inline-block;background:#fff;padding:1em 3em 1em 2em;border-radius:12px;border:1px solid #6e1edc;text-decoration:none;margin:2em 0;position:relative}#plugin-recommendations a.upgrade_button:after,#upgrade-table .upgrade-links a.upgrade_button:after{content:' \2192';display:block;position:absolute;right:1.8em;top:1.1em;transition:.5s}#plugin-recommendations a.upgrade_button:hover:after,#upgrade-table .upgrade-links a.upgrade_button:hover:after{right:1.1em;font-weight:700}#plugin-recommendations a.upgrade_button:focus,#plugin-recommendations a.upgrade_button:hover,#upgrade-table .upgrade-links a.upgrade_button:focus,#upgrade-table .upgrade-links a.upgrade_button:hover{background:#6e1edc;color:#fcfbf7}#plugin-recommendations{border-radius:8px;background-color:#f1e9fc;padding:4em 3em}#plugin-recommendations .card-container{max-width:1100px;display:grid;grid-template-columns:repeat(3,1fr);grid-gap:3em;padding:2em 0}#plugin-recommendations .recommendation-card{margin-top:0;border-radius:6px;background-color:#fff;box-shadow:0 0 25px -10px rgba(0,0,0,.2);box-sizing:border-box;font-size:15px;overflow:hidden;transition:.2s}#plugin-recommendations .recommendation-card:nth-child(n+4){display:none}#plugin-recommendations .recommendation-card:hover{scale:1.02}#plugin-recommendations .recommendation-card.currently-installed{opacity:.5}#plugin-recommendations .recommendation-card .card-content{padding:0 4em 3em 2em}#plugin-recommendations .recommendation-card img{width:100%}#plugin-recommendations .recommendation-card h5{text-align:left;font-size:1.4em;line-height:1.3em;font-weight:700;margin:1em 0}#plugin-recommendations .recommendation-card p{text-align:left;padding-bottom:10px}#plugin-recommendations .recommendation-card a.upgrade_button{margin:0}#plugin-recommendations .recommendation-card span.currently-installed{font-size:.7em;color:#fff;background-color:#6e1edc;padding:1em 2em;border-radius:12px;margin:0;display:inline-block}@media screen and (max-width:1100px){#upgrade-table{font-size:1em;line-height:1.2em}#upgrade-table td:not(.last),#upgrade-table th:not(.last){width:25%;padding:.8em 1em}#upgrade-table td.last,#upgrade-table th.last{width:0;padding:0}#upgrade-table td.feature-label span.description{padding-top:6px}#plugin-recommendations .card-container{grid-gap:2em}}@media screen and (max-width:968px){#plugin-recommendations .card-container{grid-template-columns:repeat(1,1fr);padding-right:40%}}@media screen and (max-width:782px){#wpo-wcpdf-preview-wrapper .sidebar .form-table>tbody>tr>td:has(input[type=checkbox]+input[type=text])>input{display:inline-block}}@media screen and (max-width:767px){#upgrade-table td.feature-label span.description{display:none}#upgrade-table td:not(.last),#upgrade-table th:not(.last){width:20%}#upgrade-table td.first{width:40%}#plugin-recommendations .card-container{padding-right:0}}@media screen and (max-width:649px){div.upgrade-table-description{padding-left:.8em}div.upgrade-table-description p{font-size:1em}#upgrade-table{font-size:.8em}#upgrade-table td,#upgrade-table th{padding:.5em .8em!important}#upgrade-table td span.feature-available{width:18px;height:18px}#upgrade-table .upgrade-links a{white-space:normal;padding:.6em .8em;border-radius:6px}#upgrade-table .upgrade-links a:after{display:none}#plugin-recommendations .card-container{justify-content:center}}@media screen and (max-width:782px){input[type=checkbox],input[type=radio]{margin-bottom:.5em}} \ No newline at end of file