/**
  * get_settings.
  *
  * @version 2.5.2
  */
 function get_settings()
 {
     $settings = array();
     $invoice_types = 'yes' === get_option('wcj_invoicing_hide_disabled_docs_settings', 'no') ? wcj_get_enabled_invoice_types() : wcj_get_invoice_types();
     foreach ($invoice_types as $invoice_type) {
         $settings = array_merge($settings, array(array('title' => strtoupper($invoice_type['desc']), 'type' => 'title', 'id' => 'wcj_invoicing_' . $invoice_type['id'] . '_numbering_options'), array('title' => __('Sequential', 'woocommerce-jetpack'), 'id' => 'wcj_invoicing_' . $invoice_type['id'] . '_sequential_enabled', 'default' => 'no', 'type' => 'checkbox'), array('title' => __('Counter', 'woocommerce-jetpack'), 'id' => 'wcj_invoicing_' . $invoice_type['id'] . '_numbering_counter', 'default' => 1, 'type' => 'number'), array('title' => __('Counter Width', 'woocommerce-jetpack'), 'id' => 'wcj_invoicing_' . $invoice_type['id'] . '_numbering_counter_width', 'default' => 0, 'type' => 'number'), array('title' => __('Prefix', 'woocommerce-jetpack'), 'id' => 'wcj_invoicing_' . $invoice_type['id'] . '_numbering_prefix', 'default' => '', 'type' => 'text', 'css' => 'width:300px'), array('title' => __('Suffix', 'woocommerce-jetpack'), 'id' => 'wcj_invoicing_' . $invoice_type['id'] . '_numbering_suffix', 'default' => '', 'type' => 'text', 'css' => 'width:300px'), array('type' => 'sectionend', 'id' => 'wcj_invoicing_' . $invoice_type['id'] . '_numbering_options')));
     }
     return $this->add_standard_settings($settings);
 }
 /**
  * get_settings.
  */
 function get_settings()
 {
     $settings = array();
     $invoice_types = wcj_get_invoice_types();
     foreach ($invoice_types as $invoice_type) {
         $settings[] = array('title' => strtoupper($invoice_type['desc']), 'type' => 'title', 'desc' => '', 'id' => 'wcj_invoicing_' . $invoice_type['id'] . '_footer_options');
         $settings = array_merge($settings, array(array('title' => __('Enable Footer', 'woocommerce-jetpack'), 'id' => 'wcj_invoicing_' . $invoice_type['id'] . '_footer_enabled', 'default' => 'yes', 'type' => 'checkbox'), array('title' => __('Footer Text', 'woocommerce-jetpack'), 'id' => 'wcj_invoicing_' . $invoice_type['id'] . '_footer_text', 'default' => 'Page %page_number% / %total_pages%', 'type' => 'textarea', 'css' => 'width:66%;min-width:300px;height:165px;', 'desc' => apply_filters('get_wc_jetpack_plus_message', '', 'desc'), 'desc_tip' => __('You can use HTML here, as well as any WordPress shortcodes. There is two more predefined values you can use: %page_number% and %total_pages%.', 'woocommerce-jetpack'), 'custom_attributes' => apply_filters('get_wc_jetpack_plus_message', '', 'readonly')), array('title' => __('Footer Text Color', 'woocommerce-jetpack'), 'id' => 'wcj_invoicing_' . $invoice_type['id'] . '_footer_text_color', 'default' => '#cccccc', 'type' => 'color', 'css' => 'width:6em;'), array('title' => __('Footer Line Color', 'woocommerce-jetpack'), 'id' => 'wcj_invoicing_' . $invoice_type['id'] . '_footer_line_color', 'default' => '#cccccc', 'type' => 'color', 'css' => 'width:6em;'), array('title' => __('Footer Margin', 'woocommerce-jetpack'), 'id' => 'wcj_invoicing_' . $invoice_type['id'] . '_margin_footer', 'default' => 10, 'type' => 'number')));
         $settings[] = array('type' => 'sectionend', 'id' => 'wcj_invoicing_' . $invoice_type['id'] . '_footer_options');
     }
     return $settings;
 }
 /**
  * get_settings.
  *
  * @version 2.3.0
  */
 function get_settings()
 {
     $settings = array();
     $invoice_types = wcj_get_invoice_types();
     foreach ($invoice_types as $invoice_type) {
         $settings[] = array('title' => strtoupper($invoice_type['desc']), 'type' => 'title', 'desc' => '', 'id' => 'wcj_invoicing_' . $invoice_type['id'] . '_header_options');
         $settings = array_merge($settings, array(array('title' => __('Enable Header', 'woocommerce-jetpack'), 'id' => 'wcj_invoicing_' . $invoice_type['id'] . '_header_enabled', 'default' => 'yes', 'type' => 'checkbox'), array('title' => __('Header Image', 'woocommerce-jetpack'), 'id' => 'wcj_invoicing_' . $invoice_type['id'] . '_header_image', 'default' => '', 'type' => 'text', 'css' => 'width:33%;min-width:300px;', 'desc' => __('Enter a URL to an image you want to show in the invoice\'s header. Upload your image using the <a href="/wp-admin/media-new.php">media uploader</a>.', 'woocommerce-jetpack'), 'desc_tip' => __('Leave blank to disable', 'woocommerce-jetpack')), array('title' => __('Header Image Width in mm', 'woocommerce-jetpack'), 'id' => 'wcj_invoicing_' . $invoice_type['id'] . '_header_image_width_mm', 'default' => 50, 'type' => 'number'), array('title' => __('Header Title', 'woocommerce-jetpack'), 'id' => 'wcj_invoicing_' . $invoice_type['id'] . '_header_title_text', 'default' => $invoice_type['title'], 'type' => 'text'), array('title' => __('Header Text', 'woocommerce-jetpack'), 'id' => 'wcj_invoicing_' . $invoice_type['id'] . '_header_text', 'default' => __('Company Name', 'woocommerce-jetpack'), 'type' => 'text'), array('title' => __('Header Text Color', 'woocommerce-jetpack'), 'id' => 'wcj_invoicing_' . $invoice_type['id'] . '_header_text_color', 'default' => '#cccccc', 'type' => 'color', 'css' => 'width:6em;'), array('title' => __('Header Line Color', 'woocommerce-jetpack'), 'id' => 'wcj_invoicing_' . $invoice_type['id'] . '_header_line_color', 'default' => '#cccccc', 'type' => 'color', 'css' => 'width:6em;'), array('title' => __('Header Margin', 'woocommerce-jetpack'), 'id' => 'wcj_invoicing_' . $invoice_type['id'] . '_margin_header', 'default' => 10, 'type' => 'number')));
         $settings[] = array('type' => 'sectionend', 'id' => 'wcj_invoicing_' . $invoice_type['id'] . '_header_options');
     }
     return $settings;
 }
 /**
  * get_settings.
  *
  * @version 2.4.7
  */
 function get_settings()
 {
     $settings = array();
     $invoice_types = 'yes' === get_option('wcj_invoicing_hide_disabled_docs_settings', 'no') ? wcj_get_enabled_invoice_types() : wcj_get_invoice_types();
     foreach ($invoice_types as $invoice_type) {
         $settings[] = array('title' => strtoupper($invoice_type['desc']), 'type' => 'title', 'id' => 'wcj_invoicing_' . $invoice_type['id'] . '_header_options');
         $settings = array_merge($settings, array(array('title' => __('Enable Header', 'woocommerce-jetpack'), 'id' => 'wcj_invoicing_' . $invoice_type['id'] . '_header_enabled', 'default' => 'yes', 'type' => 'checkbox'), array('title' => __('Header Image', 'woocommerce-jetpack'), 'id' => 'wcj_invoicing_' . $invoice_type['id'] . '_header_image', 'default' => '', 'type' => 'text', 'css' => 'width:33%;min-width:300px;', 'desc' => __('Enter a URL to an image you want to show in the invoice\'s header. Upload your image using the <a href="/wp-admin/media-new.php">media uploader</a>.', 'woocommerce-jetpack'), 'desc_tip' => __('Leave blank to disable', 'woocommerce-jetpack')), array('title' => __('Header Image Width in mm', 'woocommerce-jetpack'), 'id' => 'wcj_invoicing_' . $invoice_type['id'] . '_header_image_width_mm', 'default' => 50, 'type' => 'number'), array('title' => __('Header Title', 'woocommerce-jetpack'), 'id' => 'wcj_invoicing_' . $invoice_type['id'] . '_header_title_text', 'default' => $invoice_type['title'], 'type' => 'text'), array('title' => __('Header Text', 'woocommerce-jetpack'), 'id' => 'wcj_invoicing_' . $invoice_type['id'] . '_header_text', 'default' => __('Company Name', 'woocommerce-jetpack'), 'type' => 'text'), array('title' => __('Header Text Color', 'woocommerce-jetpack'), 'id' => 'wcj_invoicing_' . $invoice_type['id'] . '_header_text_color', 'default' => '#cccccc', 'type' => 'color', 'css' => 'width:6em;'), array('title' => __('Header Line Color', 'woocommerce-jetpack'), 'id' => 'wcj_invoicing_' . $invoice_type['id'] . '_header_line_color', 'default' => '#cccccc', 'type' => 'color', 'css' => 'width:6em;'), array('title' => __('Header Margin', 'woocommerce-jetpack'), 'id' => 'wcj_invoicing_' . $invoice_type['id'] . '_margin_header', 'default' => 10, 'type' => 'number')));
         $settings[] = array('type' => 'sectionend', 'id' => 'wcj_invoicing_' . $invoice_type['id'] . '_header_options');
     }
     $settings = array_merge($settings, array(array('title' => __('PDF Invoicing Header General Options', 'woocommerce-jetpack'), 'type' => 'title', 'id' => 'wcj_invoicing_general_header_options'), array('title' => __('Default Images Directory', 'woocommerce-jetpack'), 'desc' => __('Default images directory in TCPDF library (K_PATH_IMAGES).', 'woocommerce-jetpack'), 'desc_tip' => __('Try changing this if you have issues displaying image in header.', 'woocommerce-jetpack'), 'id' => 'wcj_invoicing_general_header_images_path', 'default' => 'empty', 'type' => 'select', 'options' => array('empty' => __('Empty', 'woocommerce-jetpack'), 'tcpdf_default' => __('TCPDF Default', 'woocommerce-jetpack'), 'abspath' => __('ABSPATH', 'woocommerce-jetpack'), 'document_root' => __('DOCUMENT_ROOT', 'woocommerce-jetpack'))), array('type' => 'sectionend', 'id' => 'wcj_invoicing_general_header_options')));
     return $this->add_standard_settings($settings);
 }
 function wcj_get_enabled_invoice_types()
 {
     $invoice_types = wcj_get_invoice_types();
     $enabled_invoice_types = array();
     foreach ($invoice_types as $k => $invoice_type) {
         $z = 0 === $k ? get_option('wcj_invoicing_' . $invoice_type['id'] . '_create_on') : apply_filters('wcj_get_option_filter', 'disabled', get_option('wcj_invoicing_' . $invoice_type['id'] . '_create_on'));
         if ('disabled' === $z) {
             continue;
         }
         $enabled_invoice_types[] = $invoice_type;
     }
     return $enabled_invoice_types;
 }
 /**
  * get_settings.
  *
  * @version 2.5.2
  */
 function get_settings()
 {
     $settings = array();
     $invoice_types = 'yes' === get_option('wcj_invoicing_hide_disabled_docs_settings', 'no') ? wcj_get_enabled_invoice_types() : wcj_get_invoice_types();
     foreach ($invoice_types as $invoice_type) {
         ob_start();
         include 'defaults/wcj-content-template-' . $invoice_type['id'] . '.php';
         $default_template = ob_get_clean();
         $settings = array_merge($settings, array(array('title' => strtoupper($invoice_type['desc']), 'type' => 'title', 'id' => 'wcj_invoicing_' . $invoice_type['id'] . '_templates_options'), array('title' => __('HTML Template', 'woocommerce-jetpack'), 'id' => 'wcj_invoicing_' . $invoice_type['id'] . '_template', 'default' => $default_template, 'type' => 'textarea', 'css' => 'width:66%;min-width:300px;height:500px;'), array('type' => 'sectionend', 'id' => 'wcj_invoicing_' . $invoice_type['id'] . '_templates_options')));
     }
     $settings = array_merge($settings, array(array('title' => __('Available Shortcodes', 'woocommerce-jetpack'), 'type' => 'title', 'desc' => sprintf(__('For the list of available shortcodes, please visit %s.', 'woocommerce-jetpack'), '<a target="_blank" href="http://booster.io/category/shortcodes/?utm_source=shortcodes_list&utm_medium=module_button&utm_campaign=booster_documentation">http://booster.io/category/shortcodes/</a>'), 'id' => 'wcj_invoicing_templates_desc'), array('type' => 'sectionend', 'id' => 'wcj_invoicing_templates_desc')));
     return $this->add_standard_settings($settings);
 }
 /**
  * get_settings.
  */
 function get_settings()
 {
     $settings = array();
     $invoice_types = wcj_get_invoice_types();
     foreach ($invoice_types as $invoice_type) {
         $settings[] = array('title' => strtoupper($invoice_type['desc']), 'type' => 'title', 'desc' => '', 'id' => 'wcj_invoicing_' . $invoice_type['id'] . '_emails_options');
         //$available_emails = apply_filters( 'woocommerce_resend_order_emails_available', array( 'new_order', 'customer_processing_order', 'customer_completed_order', 'customer_invoice' ) );
         $available_emails = array('new_order' => __('Admin - New Order', 'woocommerce'), 'customer_processing_order' => __('Customer - Processing Order', 'woocommerce'), 'customer_completed_order' => __('Customer - Completed Order', 'woocommerce'), 'customer_invoice' => __('Customer - Invoice', 'woocommerce'));
         $settings[] = array('title' => __('Attach PDF to emails', 'woocommerce'), 'id' => 'wcj_invoicing_' . $invoice_type['id'] . '_attach_to_emails', 'type' => 'multiselect', 'class' => 'chosen_select', 'css' => 'width: 450px;', 'default' => '', 'options' => $available_emails, 'custom_attributes' => array('data-placeholder' => __('Select some emails', 'woocommerce')));
         $settings[] = array('type' => 'sectionend', 'id' => 'wcj_invoicing_' . $invoice_type['id'] . '_emails_options');
     }
     return $settings;
 }
 /**
  * get_settings.
  *
  * @version 2.3.10
  */
 function get_settings()
 {
     $settings = array();
     $invoice_types = wcj_get_invoice_types();
     foreach ($invoice_types as $invoice_type) {
         $settings[] = array('title' => strtoupper($invoice_type['desc']), 'type' => 'title', 'desc' => '', 'id' => 'wcj_invoicing_' . $invoice_type['id'] . '_numbering_options');
         $settings[] = array('title' => __('Sequential', 'woocommerce-jetpack'), 'id' => 'wcj_invoicing_' . $invoice_type['id'] . '_sequential_enabled', 'default' => 'no', 'type' => 'checkbox');
         $settings[] = array('title' => __('Counter', 'woocommerce-jetpack'), 'id' => 'wcj_invoicing_' . $invoice_type['id'] . '_numbering_counter', 'default' => 1, 'type' => 'number');
         $settings[] = array('title' => __('Prefix', 'woocommerce-jetpack'), 'id' => 'wcj_invoicing_' . $invoice_type['id'] . '_numbering_prefix', 'default' => '', 'type' => 'text');
         $settings[] = array('title' => __('Counter Width', 'woocommerce-jetpack'), 'id' => 'wcj_invoicing_' . $invoice_type['id'] . '_numbering_counter_width', 'default' => 0, 'type' => 'number');
         $settings[] = array('title' => __('Suffix', 'woocommerce-jetpack'), 'id' => 'wcj_invoicing_' . $invoice_type['id'] . '_numbering_suffix', 'default' => '', 'type' => 'text');
         $settings[] = array('type' => 'sectionend', 'id' => 'wcj_invoicing_' . $invoice_type['id'] . '_numbering_options');
     }
     return $settings;
 }
 /**
  * get_settings.
  *
  * @version 2.4.7
  */
 function get_settings()
 {
     $settings = array();
     $invoice_types = 'yes' === get_option('wcj_invoicing_hide_disabled_docs_settings', 'no') ? wcj_get_enabled_invoice_types() : wcj_get_invoice_types();
     foreach ($invoice_types as $invoice_type) {
         $settings[] = array('title' => strtoupper($invoice_type['desc']), 'type' => 'title', 'id' => 'wcj_invoicing_' . $invoice_type['id'] . '_page_options');
         $settings[] = array('title' => __('Page Orientation', 'woocommerce-jetpack'), 'id' => 'wcj_invoicing_' . $invoice_type['id'] . '_page_orientation', 'default' => 'P', 'type' => 'select', 'options' => array('P' => __('Portrait', 'woocommerce-jetpack'), 'L' => __('Landscape', 'woocommerce-jetpack')));
         $settings[] = array('title' => __('Page Format', 'woocommerce-jetpack'), 'id' => 'wcj_invoicing_' . $invoice_type['id'] . '_page_format', 'default' => 'A4', 'type' => 'select', 'options' => $this->get_page_formats());
         $settings[] = array('title' => __('Margin Left', 'woocommerce-jetpack'), 'id' => 'wcj_invoicing_' . $invoice_type['id'] . '_margin_left', 'default' => 15, 'type' => 'number');
         $settings[] = array('title' => __('Margin Right', 'woocommerce-jetpack'), 'id' => 'wcj_invoicing_' . $invoice_type['id'] . '_margin_right', 'default' => 15, 'type' => 'number');
         $settings[] = array('title' => __('Margin Top', 'woocommerce-jetpack'), 'id' => 'wcj_invoicing_' . $invoice_type['id'] . '_margin_top', 'default' => 27, 'type' => 'number');
         $settings[] = array('title' => __('Margin Bottom', 'woocommerce-jetpack'), 'id' => 'wcj_invoicing_' . $invoice_type['id'] . '_margin_bottom', 'default' => 0, 'type' => 'number');
         $settings[] = array('type' => 'sectionend', 'id' => 'wcj_invoicing_' . $invoice_type['id'] . '_page_options');
     }
     return $this->add_standard_settings($settings);
 }
 /**
  * get_settings.
  */
 function get_settings()
 {
     $settings = array();
     $invoice_types = wcj_get_invoice_types();
     foreach ($invoice_types as $invoice_type) {
         ob_start();
         include 'defaults/wcj-content-template-' . $invoice_type['id'] . '.php';
         $default_template = ob_get_clean();
         $settings[] = array('title' => strtoupper($invoice_type['desc']), 'type' => 'title', 'desc' => '', 'id' => 'wcj_invoicing_' . $invoice_type['id'] . '_templates_options');
         $settings[] = array('title' => __('HTML Template', 'woocommerce-jetpack'), 'id' => 'wcj_invoicing_' . $invoice_type['id'] . '_template', 'default' => $default_template, 'type' => 'textarea', 'css' => 'width:66%;min-width:300px;height:500px;');
         $settings[] = array('type' => 'sectionend', 'id' => 'wcj_invoicing_' . $invoice_type['id'] . '_templates_options');
     }
     $settings[] = array('title' => __('Available Shortcodes', 'woocommerce-jetpack'), 'type' => 'title', 'desc' => wcj_get_shortcodes_list(), 'id' => 'wcj_invoicing_templates_desc');
     $settings[] = array('type' => 'sectionend', 'id' => 'wcj_invoicing_templates_desc');
     return $settings;
 }
 /**
  * get_settings.
  *
  * @version 2.4.8
  */
 function get_settings()
 {
     $settings = array();
     $invoice_types = 'yes' === get_option('wcj_invoicing_hide_disabled_docs_settings', 'no') ? wcj_get_enabled_invoice_types() : wcj_get_invoice_types();
     foreach ($invoice_types as $invoice_type) {
         $settings[] = array('title' => strtoupper($invoice_type['desc']), 'type' => 'title', 'id' => 'wcj_invoicing_' . $invoice_type['id'] . '_styling_options');
         ob_start();
         include 'defaults/wcj-' . $invoice_type['id'] . '.css';
         $default_template = ob_get_clean();
         $settings[] = array('title' => __('CSS', 'woocommerce-jetpack'), 'id' => 'wcj_invoicing_' . $invoice_type['id'] . '_css', 'default' => $default_template, 'type' => 'textarea', 'css' => 'width:66%;min-width:300px;height:200px;');
         $settings[] = array('title' => __('Font Family', 'woocommerce-jetpack'), 'desc' => apply_filters('booster_get_message', '', 'desc'), 'id' => 'wcj_invoicing_' . $invoice_type['id'] . '_general_font_family', 'default' => 'dejavusans', 'type' => 'select', 'options' => array('dejavusans' => 'DejaVu Sans', 'courier' => 'Courier', 'helvetica' => 'Helvetica', 'times' => 'Times', 'droidsansfallback' => 'Droid Sans Fallback', 'angsanaupc' => 'AngsanaUPC', 'cordiaupc' => 'CordiaUPC', 'thsarabun' => 'THSarabunPSK'), 'custom_attributes' => apply_filters('booster_get_message', '', 'disabled'));
         $settings[] = array('title' => __('Font Size', 'woocommerce-jetpack'), 'id' => 'wcj_invoicing_' . $invoice_type['id'] . '_general_font_size', 'default' => 8, 'type' => 'number');
         $settings[] = array('title' => __('Make Font Shadowed', 'woocommerce-jetpack'), 'id' => 'wcj_invoicing_' . $invoice_type['id'] . '_general_font_shadowed', 'default' => 'no', 'type' => 'checkbox');
         $settings[] = array('type' => 'sectionend', 'id' => 'wcj_invoicing_' . $invoice_type['id'] . '_styling_options');
     }
     return $this->add_standard_settings($settings);
 }
 /**
  * get_settings.
  *
  * @version 2.3.9
  */
 function get_settings()
 {
     $settings = array();
     $invoice_types = wcj_get_invoice_types();
     foreach ($invoice_types as $invoice_type) {
         $settings[] = array('title' => strtoupper($invoice_type['desc']), 'type' => 'title', 'id' => 'wcj_invoicing_' . $invoice_type['id'] . '_styling_options');
         ob_start();
         include 'defaults/wcj-' . $invoice_type['id'] . '.css';
         $default_template = ob_get_clean();
         $settings[] = array('title' => __('CSS', 'woocommerce-jetpack'), 'id' => 'wcj_invoicing_' . $invoice_type['id'] . '_css', 'default' => $default_template, 'type' => 'textarea', 'css' => 'width:66%;min-width:300px;height:200px;');
         $settings[] = array('title' => __('Font Family', 'woocommerce-jetpack'), 'desc' => apply_filters('get_wc_jetpack_plus_message', '', 'desc'), 'id' => 'wcj_invoicing_' . $invoice_type['id'] . '_general_font_family', 'default' => 'dejavusans', 'type' => 'select', 'options' => array('dejavusans' => 'DejaVu Sans', 'courier' => 'Courier', 'helvetica' => 'Helvetica', 'times' => 'Times', 'droidsansfallback' => 'Droid Sans Fallback'), 'custom_attributes' => apply_filters('get_wc_jetpack_plus_message', '', 'disabled'));
         $settings[] = array('title' => __('Font Size', 'woocommerce-jetpack'), 'id' => 'wcj_invoicing_' . $invoice_type['id'] . '_general_font_size', 'default' => 8, 'type' => 'number');
         $settings[] = array('title' => __('Make Font Shadowed', 'woocommerce-jetpack'), 'id' => 'wcj_invoicing_' . $invoice_type['id'] . '_general_font_shadowed', 'default' => 'no', 'type' => 'checkbox');
         $settings[] = array('type' => 'sectionend', 'id' => 'wcj_invoicing_' . $invoice_type['id'] . '_styling_options');
     }
     return $settings;
 }
 /**
  * get_settings.
  */
 function get_settings()
 {
     $settings = array();
     $invoice_types = wcj_get_invoice_types();
     foreach ($invoice_types as $invoice_type) {
         $settings[] = array('title' => strtoupper($invoice_type['desc']), 'type' => 'title', 'desc' => '', 'id' => 'wcj_invoicing_' . $invoice_type['id'] . '_page_options');
         $settings[] = array('title' => __('Page Orientation', 'woocommerce-jetpack'), 'id' => 'wcj_invoicing_' . $invoice_type['id'] . '_page_orientation', 'default' => 'P', 'type' => 'select', 'options' => array('P' => __('Portrait', 'woocommerce-jetpack'), 'L' => __('Landscape', 'woocommerce-jetpack')));
         $page_formats = array();
         for ($i = 1; $i < 8; $i++) {
             $page_formats['A' . $i] = 'A' . $i;
         }
         $settings[] = array('title' => __('Page Format', 'woocommerce-jetpack'), 'id' => 'wcj_invoicing_' . $invoice_type['id'] . '_page_format', 'default' => 'A4', 'type' => 'select', 'options' => $page_formats);
         $settings[] = array('title' => __('Margin Left', 'woocommerce-jetpack'), 'id' => 'wcj_invoicing_' . $invoice_type['id'] . '_margin_left', 'default' => 15, 'type' => 'number');
         $settings[] = array('title' => __('Margin Right', 'woocommerce-jetpack'), 'id' => 'wcj_invoicing_' . $invoice_type['id'] . '_margin_right', 'default' => 15, 'type' => 'number');
         $settings[] = array('title' => __('Margin Top', 'woocommerce-jetpack'), 'id' => 'wcj_invoicing_' . $invoice_type['id'] . '_margin_top', 'default' => 27, 'type' => 'number');
         $settings[] = array('title' => __('Margin Bottom', 'woocommerce-jetpack'), 'id' => 'wcj_invoicing_' . $invoice_type['id'] . '_margin_bottom', 'default' => 0, 'type' => 'number');
         $settings[] = array('type' => 'sectionend', 'id' => 'wcj_invoicing_' . $invoice_type['id'] . '_page_options');
     }
     return $settings;
 }
 /**
  * prepare_pdf.
  *
  * @version 2.5.2
  */
 function prepare_pdf()
 {
     $invoice_type = $this->invoice_type;
     // Create new PDF document
     require_once wcj_plugin_path() . '/includes/classes/class-wcj-tcpdf.php';
     $pdf = new WCJ_TCPDF(get_option('wcj_invoicing_' . $invoice_type . '_page_orientation', 'P'), PDF_UNIT, get_option('wcj_invoicing_' . $invoice_type . '_page_format', 'A4'), true, 'UTF-8', false);
     $pdf->set_invoice_type($invoice_type);
     // Set document information
     $pdf->SetCreator(PDF_CREATOR);
     //		$pdf->SetAuthor( 'Algoritmika Ltd.' );
     $invoice_title = $invoice_type;
     $invoice_types = wcj_get_invoice_types();
     foreach ($invoice_types as $invoice_type_data) {
         if ($invoice_type === $invoice_type_data['id']) {
             $invoice_title = $invoice_type_data['title'];
             break;
         }
     }
     $pdf->SetTitle($invoice_title);
     $pdf->SetSubject('Invoice PDF');
     $pdf->SetKeywords('invoice, PDF');
     // Header - set default header data
     if ('yes' === get_option('wcj_invoicing_' . $invoice_type . '_header_enabled')) {
         $the_logo = '';
         $the_logo_width_mm = 0;
         if ('' != get_option('wcj_invoicing_' . $invoice_type . '_header_image')) {
             $the_logo = parse_url(get_option('wcj_invoicing_' . $invoice_type . '_header_image'), PHP_URL_PATH);
             $the_logo_width_mm = get_option('wcj_invoicing_' . $invoice_type . '_header_image_width_mm');
         }
         $pdf->SetHeaderData($the_logo, $the_logo_width_mm, do_shortcode(get_option('wcj_invoicing_' . $invoice_type . '_header_title_text')), do_shortcode(get_option('wcj_invoicing_' . $invoice_type . '_header_text')), wcj_hex2rgb(get_option('wcj_invoicing_' . $invoice_type . '_header_text_color')), wcj_hex2rgb(get_option('wcj_invoicing_' . $invoice_type . '_header_line_color')));
     } else {
         $pdf->SetPrintHeader(false);
     }
     // Footer
     if ('yes' === get_option('wcj_invoicing_' . $invoice_type . '_footer_enabled')) {
         $pdf->setFooterData(wcj_hex2rgb(get_option('wcj_invoicing_' . $invoice_type . '_footer_text_color')), wcj_hex2rgb(get_option('wcj_invoicing_' . $invoice_type . '_footer_line_color')));
     } else {
         $pdf->SetPrintFooter(false);
     }
     // Set Header and Footer fonts
     $pdf->setHeaderFont(array(get_option('wcj_invoicing_' . $invoice_type . '_general_font_family', 'dejavusans'), '', PDF_FONT_SIZE_MAIN));
     $pdf->setFooterFont(array(get_option('wcj_invoicing_' . $invoice_type . '_general_font_family', 'dejavusans'), '', PDF_FONT_SIZE_DATA));
     // Set default monospaced font
     $pdf->SetDefaultMonospacedFont(PDF_FONT_MONOSPACED);
     // Set margins
     $pdf->SetMargins(get_option('wcj_invoicing_' . $invoice_type . '_margin_left'), get_option('wcj_invoicing_' . $invoice_type . '_margin_top'), get_option('wcj_invoicing_' . $invoice_type . '_margin_right'));
     $pdf->SetHeaderMargin(get_option('wcj_invoicing_' . $invoice_type . '_margin_header'));
     $pdf->SetFooterMargin(get_option('wcj_invoicing_' . $invoice_type . '_margin_footer'));
     // Set auto page breaks
     $pdf->SetAutoPageBreak(TRUE, get_option('wcj_invoicing_' . $invoice_type . '_margin_bottom'));
     // Set image scale factor
     $pdf->setImageScale(PDF_IMAGE_SCALE_RATIO);
     /*// Set some language-dependent strings (optional)
     		if (@file_exists(dirname(__FILE__).'/lang/eng.php')) {
     			require_once(dirname(__FILE__).'/lang/eng.php');
     			$pdf->setLanguageArray($l);
     		}*/
     // Set default font subsetting mode
     $pdf->setFontSubsetting(true);
     // Set font
     /* if ( 'DroidSansFallback' === apply_filters( 'booster_get_option', 'dejavusans', get_option( 'wcj_invoicing_' . $invoice_type . '_general_font_family', 'dejavusans' ) ) ) {
     			$pdf->addTTFfont( wcj_plugin_path() . '/includes/lib/tcpdf_min/fonts/' . 'DroidSansFallback.ttf' );
     		} */
     // dejavusans is a UTF-8 Unicode font, if you only need to print standard ASCII chars, you can use core fonts like  helvetica or times to reduce file size.
     $pdf->SetFont(apply_filters('booster_get_option', 'dejavusans', get_option('wcj_invoicing_' . $invoice_type . '_general_font_family', 'dejavusans')), '', apply_filters('booster_get_option', 8, get_option('wcj_invoicing_' . $invoice_type . '_general_font_size', 8)), '', true);
     // Add a page
     $pdf->AddPage();
     // Set text shadow effect
     if ('yes' === get_option('wcj_invoicing_' . $invoice_type . '_general_font_shadowed', 'yes')) {
         $pdf->setTextShadow(array('enabled' => true, 'depth_w' => 0.2, 'depth_h' => 0.2, 'color' => array(196, 196, 196), 'opacity' => 1, 'blend_mode' => 'Normal'));
     }
     return $pdf;
 }
 /**
  * get_settings.
  *
  * @version 2.3.10
  */
 function get_settings()
 {
     $settings = array();
     $invoice_types = wcj_get_invoice_types();
     foreach ($invoice_types as $invoice_type) {
         $settings[] = array('title' => strtoupper($invoice_type['desc']), 'type' => 'title', 'id' => 'wcj_invoicing_' . $invoice_type['id'] . '_display_options');
         $settings = array_merge($settings, array(array('title' => __('Admin\'s "Orders" Page', 'woocommerce-jetpack'), 'desc' => __('Add Column', 'woocommerce-jetpack'), 'id' => 'wcj_invoicing_' . $invoice_type['id'] . '_admin_orders_page_column', 'default' => 'yes', 'type' => 'checkbox'), array('title' => '', 'desc' => __('Column Title', 'woocommerce-jetpack'), 'id' => 'wcj_invoicing_' . $invoice_type['id'] . '_admin_page_column_text', 'default' => $invoice_type['title'], 'type' => 'text'), array('title' => '', 'desc' => __('Create Button', 'woocommerce-jetpack'), 'desc_tip' => __('Set empty to disable the button', 'woocommerce-jetpack'), 'id' => 'wcj_invoicing_' . $invoice_type['id'] . '_admin_column_create_btn', 'default' => __('Create', 'woocommerce-jetpack'), 'type' => 'text'), array('title' => '', 'desc' => __('Delete Button', 'woocommerce-jetpack'), 'desc_tip' => __('Set empty to disable the button', 'woocommerce-jetpack'), 'id' => 'wcj_invoicing_' . $invoice_type['id'] . '_admin_column_delete_btn', 'default' => __('Delete', 'woocommerce-jetpack'), 'type' => 'text'), array('title' => __('Customer\'s "My Account" Page', 'woocommerce-jetpack'), 'desc' => __('Add link', 'woocommerce-jetpack'), 'id' => 'wcj_invoicing_' . $invoice_type['id'] . '_enabled_for_customers', 'default' => 'no', 'type' => 'checkbox'), array('title' => '', 'desc' => __('Link Text', 'woocommerce-jetpack'), 'id' => 'wcj_invoicing_' . $invoice_type['id'] . '_link_text', 'default' => $invoice_type['title'], 'type' => 'text'), array('title' => __('Enable "Save as"', 'woocommerce-jetpack'), 'desc' => __('Enable', 'woocommerce-jetpack'), 'desc_tip' => __('Enable "save as" pdf instead of view pdf in browser', 'woocommerce-jetpack'), 'id' => 'wcj_invoicing_' . $invoice_type['id'] . '_save_as_enabled', 'default' => 'yes', 'type' => 'checkbox'), array('title' => __('PDF File Name', 'woocommerce-jetpack'), 'desc' => __('Enter file name for PDF documents. You can use shortcodes here, e.g. [wcj_' . $invoice_type['id'] . '_number]', 'woocommerce-jetpack'), 'id' => 'wcj_invoicing_' . $invoice_type['id'] . '_file_name', 'default' => '[wcj_' . $invoice_type['id'] . '_number]', 'type' => 'text')));
         $settings[] = array('type' => 'sectionend', 'id' => 'wcj_invoicing_' . $invoice_type['id'] . '_display_options');
     }
     return $settings;
 }
 /**
  * get_settings.
  *
  * @version 2.3.9
  */
 function get_settings()
 {
     $settings = array();
     $invoice_types = wcj_get_invoice_types();
     foreach ($invoice_types as $invoice_type) {
         $settings[] = array('title' => strtoupper($invoice_type['desc']), 'type' => 'title', 'desc' => '', 'id' => 'wcj_invoicing_' . $invoice_type['id'] . '_emails_options');
         //$available_emails = apply_filters( 'woocommerce_resend_order_emails_available', array( 'new_order', 'cancelled_order', 'customer_processing_order', 'customer_completed_order', 'customer_invoice', 'customer_refunded_order' ) );
         $available_emails = array('new_order' => __('Admin - New Order', 'woocommerce'), 'cancelled_order' => __('Admin - Cancelled Order', 'woocommerce'), 'customer_processing_order' => __('Customer - Processing Order', 'woocommerce'), 'customer_completed_order' => __('Customer - Completed Order', 'woocommerce'), 'customer_invoice' => __('Customer - Invoice', 'woocommerce'), 'customer_refunded_order' => __('Customer - Refunded Order', 'woocommerce'));
         if ('yes' === get_option('wcj_emails_enabled', 'no')) {
             for ($i = 1; $i <= apply_filters('wcj_get_option_filter', 1, get_option('wcj_emails_custom_emails_total_number', 1)); $i++) {
                 $available_emails['wcj_custom' . '_' . $i] = __('Custom', 'woocommerce-jetpack') . ' #' . $i;
             }
         }
         $settings[] = array('title' => __('Attach PDF to emails', 'woocommerce'), 'id' => 'wcj_invoicing_' . $invoice_type['id'] . '_attach_to_emails', 'type' => 'multiselect', 'class' => 'chosen_select', 'css' => 'width: 450px;', 'default' => '', 'options' => $available_emails, 'custom_attributes' => array('data-placeholder' => __('Select some emails', 'woocommerce')));
         $settings = apply_filters('wcj_pdf_invoicing_emails_settings', $settings, $invoice_type['id']);
         $settings[] = array('type' => 'sectionend', 'id' => 'wcj_invoicing_' . $invoice_type['id'] . '_emails_options');
     }
     return $settings;
 }
 }
 /**
  * get_settings.
  *
  * @version 2.3.0
  */
 function get_settings()
 {
     $settings = array(array('title' => __('PDF Invoicing General Options', 'woocommerce-jetpack'), 'type' => 'title', 'desc' => '', 'id' => 'wcj_pdf_invoicing_options'));
     // Hooks Array
     $create_on_array = array();
     $create_on_array['disabled'] = __('Disabled', 'woocommerce-jetpack');
     $create_on_array['woocommerce_new_order'] = __('Create on New Order', 'woocommerce-jetpack');
     $order_statuses = wcj_get_order_statuses(true);
     foreach ($order_statuses as $status => $desc) {
         $create_on_array['woocommerce_order_status_' . $status] = __('Create on Order Status', 'woocommerce-jetpack') . ' ' . $desc;
     }
     $create_on_array['manual'] = __('Manual Only', 'woocommerce-jetpack');
     // Settings
     $invoice_types = wcj_get_invoice_types();
     foreach ($invoice_types as $k => $invoice_type) {
         $settings[] = array('title' => $invoice_type['title'], 'id' => 'wcj_invoicing_' . $invoice_type['id'] . '_create_on', 'default' => 'disabled', 'type' => 'select', 'class' => 'chosen_select', 'options' => $create_on_array, 'desc' => 0 === $k ? '' : apply_filters('get_wc_jetpack_plus_message', '', 'desc'), 'custom_attributes' => 0 === $k ? '' : apply_filters('get_wc_jetpack_plus_message', '', 'disabled'));
     }
     $settings[] = array('type' => 'sectionend', 'id' => 'wcj_pdf_invoicing_options');
     return $this->add_enable_module_setting($settings);
Esempio n. 18
0
 /**
  * get_settings.
  */
 function get_settings()
 {
     $settings = array(array('title' => __('PDF Invoicing General Options', 'woocommerce-jetpack'), 'type' => 'title', 'desc' => '', 'id' => 'wcj_pdf_invoicing_options'), array('title' => __('PDF Invoicing', 'woocommerce-jetpack'), 'desc' => '<strong>' . __('Enable Module', 'woocommerce-jetpack') . '</strong>', 'desc_tip' => __('WooCommerce Invoices, Proforma Invoices, Credit Notes and Packing Slips.', 'woocommerce-jetpack'), 'id' => 'wcj_pdf_invoicing_enabled', 'default' => 'no', 'type' => 'checkbox'));
     // Hooks Array
     $create_on_array = array();
     $create_on_array['disabled'] = __('Disabled', 'woocommerce-jetpack');
     $create_on_array['woocommerce_new_order'] = __('Create on New Order', 'woocommerce-jetpack');
     $order_statuses = wcj_get_order_statuses(true);
     foreach ($order_statuses as $status => $desc) {
         $create_on_array['woocommerce_order_status_' . $status] = __('Create on Order Status', 'woocommerce-jetpack') . ' ' . $desc;
     }
     // Settings
     $invoice_types = wcj_get_invoice_types();
     foreach ($invoice_types as $k => $invoice_type) {
         $settings[] = array('title' => $invoice_type['title'], 'id' => 'wcj_invoicing_' . $invoice_type['id'] . '_create_on', 'default' => 'disabled', 'type' => 'select', 'class' => 'chosen_select', 'options' => $create_on_array, 'desc' => 0 === $k ? '' : apply_filters('get_wc_jetpack_plus_message', '', 'desc'), 'custom_attributes' => 0 === $k ? '' : apply_filters('get_wc_jetpack_plus_message', '', 'disabled'));
     }
     $settings[] = array('type' => 'sectionend', 'id' => 'wcj_pdf_invoicing_options');
     return $settings;
 }
 /**
  * get_settings.
  *
  * @version 2.5.9
  */
 function get_settings()
 {
     $settings = array(array('title' => __('PDF Invoicing General Options', 'woocommerce-jetpack'), 'type' => 'title', 'id' => 'wcj_pdf_invoicing_options'));
     // Hooks Array
     $create_on_array = array();
     $create_on_array['disabled'] = __('Disabled', 'woocommerce-jetpack');
     $create_on_array['woocommerce_new_order'] = __('Create on New Order', 'woocommerce-jetpack');
     $order_statuses = wcj_get_order_statuses(true);
     foreach ($order_statuses as $status => $desc) {
         $create_on_array['woocommerce_order_status_' . $status] = __('Create on Order Status', 'woocommerce-jetpack') . ' ' . $desc;
     }
     $create_on_array['manual'] = __('Manual Only', 'woocommerce-jetpack');
     // Settings
     $invoice_types = wcj_get_invoice_types();
     foreach ($invoice_types as $k => $invoice_type) {
         $settings[] = array('title' => $invoice_type['title'], 'id' => 'wcj_invoicing_' . $invoice_type['id'] . '_create_on', 'default' => 'disabled', 'type' => 'select', 'class' => 'chosen_select', 'options' => $create_on_array, 'desc' => 0 === $k ? '' : apply_filters('booster_get_message', '', 'desc'), 'custom_attributes' => 0 === $k ? '' : apply_filters('booster_get_message', '', 'disabled'));
         $settings[] = array('id' => 'wcj_invoicing_' . $invoice_type['id'] . '_skip_zero_total', 'default' => 'no', 'type' => 'checkbox', 'desc' => __('Do not create if order total equals zero', 'woocommerce-jetpack'), 'custom_attributes' => 0 === $k ? '' : apply_filters('booster_get_message', '', 'disabled'));
     }
     $settings[] = array('title' => __('Hide Disabled Docs Settings', 'woocommerce-jetpack'), 'desc' => __('Hide', 'woocommerce-jetpack'), 'id' => 'wcj_invoicing_hide_disabled_docs_settings', 'default' => 'no', 'type' => 'checkbox');
     $settings[] = array('type' => 'sectionend', 'id' => 'wcj_pdf_invoicing_options');
     return $this->add_standard_settings($settings);
 }