Version Description
July 3, 2015 =
Added: Filter for mpdf options
Fixed: Email it in not receiving email
Download this release
Release Info
Developer | baaaaas |
Plugin | WooCommerce PDF Invoices |
Version | 2.2.10 |
Comparing to | |
See all releases |
Code changes from version 2.2.9 to 2.2.10
- admin/classes/be-woocommerce-pdf-invoices.php +11 -12
- admin/classes/bewpi-general-settings.php +1 -1
- bootstrap.php +3 -3
- includes/classes/bewpi-document.php +34 -2
- readme.txt +6 -1
admin/classes/be-woocommerce-pdf-invoices.php
CHANGED
@@ -109,15 +109,10 @@ if ( ! class_exists( 'BE_WooCommerce_PDF_Invoices' ) ) {
|
|
109 |
* Initialize...
|
110 |
*/
|
111 |
public function init() {
|
112 |
-
|
113 |
$this->load_textdomain();
|
114 |
-
|
115 |
$this->create_invoices_dir();
|
116 |
-
|
117 |
$this->invoice_actions();
|
118 |
-
|
119 |
$this->init_review_admin_notice();
|
120 |
-
|
121 |
}
|
122 |
|
123 |
/**
|
@@ -283,13 +278,17 @@ if ( ! class_exists( 'BE_WooCommerce_PDF_Invoices' ) ) {
|
|
283 |
* @return string
|
284 |
*/
|
285 |
function add_email_it_in_account_to_email_headers( $headers, $status ) {
|
286 |
-
$general_options
|
287 |
-
|
288 |
-
|
289 |
-
|
290 |
-
|
291 |
-
|
292 |
-
|
|
|
|
|
|
|
|
|
293 |
return $headers;
|
294 |
}
|
295 |
|
109 |
* Initialize...
|
110 |
*/
|
111 |
public function init() {
|
|
|
112 |
$this->load_textdomain();
|
|
|
113 |
$this->create_invoices_dir();
|
|
|
114 |
$this->invoice_actions();
|
|
|
115 |
$this->init_review_admin_notice();
|
|
|
116 |
}
|
117 |
|
118 |
/**
|
278 |
* @return string
|
279 |
*/
|
280 |
function add_email_it_in_account_to_email_headers( $headers, $status ) {
|
281 |
+
$general_options = get_option( 'bewpi_general_settings' );
|
282 |
+
$email_it_in_account = $general_options['bewpi_email_it_in_account'];
|
283 |
+
|
284 |
+
if ( $status !== $general_options['bewpi_email_type'] )
|
285 |
+
return $headers;
|
286 |
+
|
287 |
+
if ( ! (bool)$general_options['bewpi_email_it_in'] || empty( $email_it_in_account ) )
|
288 |
+
return $headers;
|
289 |
+
|
290 |
+
$headers .= 'BCC: <' . $email_it_in_account . '>' . "\r\n";
|
291 |
+
|
292 |
return $headers;
|
293 |
}
|
294 |
|
admin/classes/bewpi-general-settings.php
CHANGED
@@ -130,7 +130,7 @@ if ( ! class_exists( 'BEWPI_General_Settings' ) ) {
|
|
130 |
// Header section
|
131 |
array(
|
132 |
'id' => 'bewpi-email-it-in-account',
|
133 |
-
'name' => $this->prefix . '
|
134 |
'title' => __( 'Email It In account', $this->textdomain ),
|
135 |
'callback' => array( &$this, 'input_callback' ),
|
136 |
'page' => $this->settings_key,
|
130 |
// Header section
|
131 |
array(
|
132 |
'id' => 'bewpi-email-it-in-account',
|
133 |
+
'name' => $this->prefix . 'email_it_in_account',
|
134 |
'title' => __( 'Email It In account', $this->textdomain ),
|
135 |
'callback' => array( &$this, 'input_callback' ),
|
136 |
'page' => $this->settings_key,
|
bootstrap.php
CHANGED
@@ -1,7 +1,7 @@
|
|
1 |
<?php
|
2 |
|
3 |
/**
|
4 |
-
* @version 2.2.
|
5 |
* @package WooCommerce PDF Invoices
|
6 |
* @author baaaaas
|
7 |
*
|
@@ -9,7 +9,7 @@
|
|
9 |
* Plugin Name: WooCommerce PDF Invoices
|
10 |
* Plugin URI:
|
11 |
* Description: Automatically or manually create and send PDF Invoices for WooCommerce orders and connect with Dropbox, Google Drive, OneDrive or Egnyte.
|
12 |
-
* Version: 2.2.
|
13 |
* Author: baaaaas
|
14 |
* Author URI:
|
15 |
* License: GPL-2.0+
|
@@ -22,7 +22,7 @@ if ( ! defined( 'ABSPATH' ) )
|
|
22 |
die( 'Access denied.' );
|
23 |
|
24 |
if ( ! defined( 'BEWPI_VERSION' ) )
|
25 |
-
define( 'BEWPI_VERSION', '2.2.
|
26 |
|
27 |
if ( ! defined( 'BEWPI_URL' ) )
|
28 |
define( 'BEWPI_URL', plugins_url( '', __FILE__ ) . '/' );
|
1 |
<?php
|
2 |
|
3 |
/**
|
4 |
+
* @version 2.2.10
|
5 |
* @package WooCommerce PDF Invoices
|
6 |
* @author baaaaas
|
7 |
*
|
9 |
* Plugin Name: WooCommerce PDF Invoices
|
10 |
* Plugin URI:
|
11 |
* Description: Automatically or manually create and send PDF Invoices for WooCommerce orders and connect with Dropbox, Google Drive, OneDrive or Egnyte.
|
12 |
+
* Version: 2.2.10
|
13 |
* Author: baaaaas
|
14 |
* Author URI:
|
15 |
* License: GPL-2.0+
|
22 |
die( 'Access denied.' );
|
23 |
|
24 |
if ( ! defined( 'BEWPI_VERSION' ) )
|
25 |
+
define( 'BEWPI_VERSION', '2.2.10' );
|
26 |
|
27 |
if ( ! defined( 'BEWPI_URL' ) )
|
28 |
define( 'BEWPI_URL', plugins_url( '', __FILE__ ) . '/' );
|
includes/classes/bewpi-document.php
CHANGED
@@ -66,9 +66,25 @@ if ( ! class_exists( 'BEWPI_Document' ) ) {
|
|
66 |
*/
|
67 |
protected function generate( $dest, $document ) {
|
68 |
set_time_limit(0);
|
69 |
-
|
|
|
70 |
include $mpdf_filename;
|
71 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
72 |
$mpdf->useOnlyCoreFonts = false; // false is default
|
73 |
$mpdf->SetTitle( $this->title );
|
74 |
$mpdf->SetAuthor( $this->author );
|
@@ -124,5 +140,21 @@ if ( ! class_exists( 'BEWPI_Document' ) ) {
|
|
124 |
public function get_filename() {
|
125 |
return $this->filename;
|
126 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
127 |
}
|
128 |
}
|
66 |
*/
|
67 |
protected function generate( $dest, $document ) {
|
68 |
set_time_limit(0);
|
69 |
+
|
70 |
+
$mpdf_filename = BEWPI_LIB_DIR . 'mpdf/mpdf.php';
|
71 |
include $mpdf_filename;
|
72 |
+
|
73 |
+
$mpdf_options = $this->get_mpdf_options();
|
74 |
+
$mpdf = new mPDF(
|
75 |
+
$mpdf_options['mode'], // mode
|
76 |
+
$mpdf_options['format'], // format
|
77 |
+
$mpdf_options['default_font_size'], // default_font_size
|
78 |
+
$mpdf_options['default_font'], // default_font
|
79 |
+
$mpdf_options['margin_left'], // margin_left
|
80 |
+
$mpdf_options['margin_right'], // margin_right
|
81 |
+
$mpdf_options['margin_top'], // margin_top
|
82 |
+
$mpdf_options['margin_bottom'], // margin_bottom
|
83 |
+
$mpdf_options['margin_header'], // margin_header
|
84 |
+
$mpdf_options['margin_footer'], // margin_footer
|
85 |
+
$mpdf_options['orientation'] // orientation
|
86 |
+
);
|
87 |
+
|
88 |
$mpdf->useOnlyCoreFonts = false; // false is default
|
89 |
$mpdf->SetTitle( $this->title );
|
90 |
$mpdf->SetAuthor( $this->author );
|
140 |
public function get_filename() {
|
141 |
return $this->filename;
|
142 |
}
|
143 |
+
|
144 |
+
private function get_mpdf_options() {
|
145 |
+
return apply_filters( 'bewpi_mpdf_options', array(
|
146 |
+
'mode' => '',
|
147 |
+
'format' => '',
|
148 |
+
'default_font_size' => 0,
|
149 |
+
'default_font' => 'opensans',
|
150 |
+
'margin_left' => 17,
|
151 |
+
'margin_right' => 17,
|
152 |
+
'margin_top' => 150,
|
153 |
+
'margin_bottom' => 50,
|
154 |
+
'margin_header' => 20,
|
155 |
+
'margin_footer' => 0,
|
156 |
+
'orientation' => 'P'
|
157 |
+
));
|
158 |
+
}
|
159 |
}
|
160 |
}
|
readme.txt
CHANGED
@@ -4,7 +4,7 @@ Donate link:
|
|
4 |
Tags: woocommerce pdf invoices, invoice, generate, pdf, woocommerce, attachment, email, completed order, customer invoice, processing order, attach, automatic, vat, rate, sequential, number
|
5 |
Requires at least: 3.5
|
6 |
Tested up to: 4.2
|
7 |
-
Stable tag: 2.2.
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
@@ -66,6 +66,11 @@ The manual installation method involves downloading our plugin and uploading it
|
|
66 |
|
67 |
== Changelog ==
|
68 |
|
|
|
|
|
|
|
|
|
|
|
69 |
= 2.2.9 - June 22, 2015 =
|
70 |
|
71 |
- Added: Client billing phone number
|
4 |
Tags: woocommerce pdf invoices, invoice, generate, pdf, woocommerce, attachment, email, completed order, customer invoice, processing order, attach, automatic, vat, rate, sequential, number
|
5 |
Requires at least: 3.5
|
6 |
Tested up to: 4.2
|
7 |
+
Stable tag: 2.2.10
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
66 |
|
67 |
== Changelog ==
|
68 |
|
69 |
+
= 2.2.10 - July 3, 2015 =
|
70 |
+
|
71 |
+
- Added: Filter for mpdf options
|
72 |
+
- Fixed: Email it in not receiving email
|
73 |
+
|
74 |
= 2.2.9 - June 22, 2015 =
|
75 |
|
76 |
- Added: Client billing phone number
|