WooCommerce PDF Invoices - Version 2.4.4

Version Description

  • March 11, 2016 =

  • Added: Filter for email attachments

  • Fixed: Invoice action buttons on order page not showing due to conflict with other invoicing plugin

  • Fixed: Characters showing square like Rupee symbol

Download this release

Release Info

Developer baaaaas
Plugin Icon 128x128 WooCommerce PDF Invoices
Version 2.4.4
Comparing to
See all releases

Code changes from version 2.4.3 to 2.4.4

assets/css/admin.css CHANGED
@@ -36,7 +36,7 @@ form.bewpi-settings-form {
36
width: 25px;
37
cursor: pointer;
38
}
39
- .wpi-admin-order-create-invoice-btn {
40
background-image: url(../images/invoice-icon.png) !important;
41
background-repeat: no-repeat !important;
42
background-position: center center !important;
@@ -46,7 +46,7 @@ form.bewpi-settings-form {
46
height: 2em !important;
47
width: 2em;
48
}
49
- .wpi-admin-order-create-invoice-btn button {
50
display: none;
51
}
52
.notes {
36
width: 25px;
37
cursor: pointer;
38
}
39
+ .bewpi-admin-order-create-invoice-btn {
40
background-image: url(../images/invoice-icon.png) !important;
41
background-repeat: no-repeat !important;
42
background-position: center center !important;
46
height: 2em !important;
47
width: 2em;
48
}
49
+ .bewpi-admin-order-create-invoice-btn button {
50
display: none;
51
}
52
.notes {
bootstrap.php CHANGED
@@ -3,7 +3,7 @@
3
* Plugin Name: WooCommerce PDF Invoices
4
* Plugin URI: https://wordpress.org/plugins/woocommerce-pdf-invoices
5
* Description: Automatically generate and attach customizable PDF Invoices to WooCommerce emails and connect with Dropbox, Google Drive, OneDrive or Egnyte.
6
- * Version: 2.4.3
7
* Author: Bas Elbers
8
* Author URI: http://wcpdfinvoices.com
9
* License: GPL-2.0+
@@ -19,7 +19,7 @@ function bewpi_plugins_loaded() {
19
20
$wp_upload_dir = wp_upload_dir();
21
22
- define( 'BEWPI_VERSION', '2.4.3' );
23
define( 'BEWPI_URL', plugins_url( '', __FILE__ ) . '/' );
24
define( 'BEWPI_DIR', plugin_dir_path( __FILE__ ) . '/' );
25
define( 'BEWPI_TEMPLATES_DIR', plugin_dir_path( __FILE__ ) . 'includes/templates/' );
3
* Plugin Name: WooCommerce PDF Invoices
4
* Plugin URI: https://wordpress.org/plugins/woocommerce-pdf-invoices
5
* Description: Automatically generate and attach customizable PDF Invoices to WooCommerce emails and connect with Dropbox, Google Drive, OneDrive or Egnyte.
6
+ * Version: 2.4.4
7
* Author: Bas Elbers
8
* Author URI: http://wcpdfinvoices.com
9
* License: GPL-2.0+
19
20
$wp_upload_dir = wp_upload_dir();
21
22
+ define( 'BEWPI_VERSION', '2.4.4' );
23
define( 'BEWPI_URL', plugins_url( '', __FILE__ ) . '/' );
24
define( 'BEWPI_DIR', plugin_dir_path( __FILE__ ) . '/' );
25
define( 'BEWPI_TEMPLATES_DIR', plugin_dir_path( __FILE__ ) . 'includes/templates/' );
includes/abstracts/abstract-bewpi-document.php CHANGED
@@ -78,6 +78,7 @@ if ( ! class_exists( 'BEWPI_Abstract_Document' ) ) {
78
$mpdf->setAutoBottomMargin = 'stretch';
79
$mpdf->autoMarginPadding = 10;
80
$mpdf->useOnlyCoreFonts = false;
81
82
if ( ! empty ( $html_sections['header'] ) ) {
83
$mpdf->SetHTMLHeader($html_sections['header']);
78
$mpdf->setAutoBottomMargin = 'stretch';
79
$mpdf->autoMarginPadding = 10;
80
$mpdf->useOnlyCoreFonts = false;
81
+ $mpdf->useSubstitutions = true;
82
83
if ( ! empty ( $html_sections['header'] ) ) {
84
$mpdf->SetHTMLHeader($html_sections['header']);
includes/be-woocommerce-pdf-invoices.php CHANGED
@@ -363,11 +363,17 @@ if ( ! class_exists( 'BE_WooCommerce_PDF_Invoices' ) ) {
363
function attach_invoice_to_email( $attachments, $status, $order ) {
364
$general_options = get_option( 'bewpi_general_settings' );
365
366
- if ( $status == $general_options[ 'bewpi_email_type'] || $general_options['bewpi_new_order'] && $status == "new_order" ) {
367
$invoice = new BEWPI_Invoice( $order->id );
368
// create new invoice if doesn't exists, else get the full path..
369
$full_path = ( ! $invoice->exists() ) ? $invoice->save( "F" ) : $invoice->get_full_path();
370
- $attachments[] = $full_path;
371
}
372
373
return $attachments;
@@ -391,7 +397,7 @@ if ( ! class_exists( 'BE_WooCommerce_PDF_Invoices' ) ) {
391
public function woocommerce_order_page_action_view_invoice( $order ) {
392
$invoice = new BEWPI_Invoice( $order->id );
393
if ( $invoice->exists() )
394
- $this->show_invoice_button( 'View invoice', $order->id, 'view', '', array( 'class="button tips wpi-admin-order-create-invoice-btn"', 'target="_blank"' ) );
395
}
396
397
/**
363
function attach_invoice_to_email( $attachments, $status, $order ) {
364
$general_options = get_option( 'bewpi_general_settings' );
365
366
+ $attachments = apply_filters( 'bewpi_email_attachments', $attachments, $status, $order );
367
+
368
+ if ( $status == $general_options[ 'bewpi_email_type'] || ( $general_options['bewpi_new_order'] && $status == "new_order" ) ) {
369
$invoice = new BEWPI_Invoice( $order->id );
370
// create new invoice if doesn't exists, else get the full path..
371
$full_path = ( ! $invoice->exists() ) ? $invoice->save( "F" ) : $invoice->get_full_path();
372
+
373
+ // only add to attachments if it isn't already added.
374
+ if ( !in_array( $full_path, $attachments ) ) {
375
+ $attachments[] = $full_path;
376
+ }
377
}
378
379
return $attachments;
397
public function woocommerce_order_page_action_view_invoice( $order ) {
398
$invoice = new BEWPI_Invoice( $order->id );
399
if ( $invoice->exists() )
400
+ $this->show_invoice_button( 'View invoice', $order->id, 'view', '', array( 'class="button tips bewpi-admin-order-create-invoice-btn"', 'target="_blank"' ) );
401
}
402
403
/**
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.8
6
Tested up to: 4.4
7
- Stable tag: 2.4.3
8
License: GPLv2 or later
9
License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
@@ -152,8 +152,22 @@ To change the options of the PDF, use below example.
152
}
153
add_filter( 'bewpi_company_logo_url', 'convert_company_logo_to_base64' );`
154
155
== Changelog ==
156
157
= 2.4.3 - March 06, 2016 =
158
159
- Removed: Borders on template due to testing layout.
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.8
6
Tested up to: 4.4
7
+ Stable tag: 2.4.4
8
License: GPLv2 or later
9
License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
152
}
153
add_filter( 'bewpi_company_logo_url', 'convert_company_logo_to_base64' );`
154
155
+ = How to show 'Paid' watermark for BACS payment method and/or others? =
156
+ Add below function to your themes functions.php.
157
+
158
+ `function exclude_payment_method_for_watermark($payment_methods, $order_id){
159
+ return array();
160
+ }
161
+ add_filter('bewpi_paid_watermark_excluded_payment_methods', 'exclude_payment_method_for_watermark', 10, 2);`
162
+
163
== Changelog ==
164
165
+ = 2.4.4 - March 11, 2016 =
166
+
167
+ - Added: Filter for email attachments
168
+ - Fixed: Invoice action buttons on order page not showing due to conflict with other invoicing plugin
169
+ - Fixed: Characters showing square like Rupee symbol
170
+
171
= 2.4.3 - March 06, 2016 =
172
173
- Removed: Borders on template due to testing layout.