Version Description
- Fix: Apply filters for custom invoice number formatting in document too
- Fix: Parent fallback for missing dates from refunds
Download this release
Release Info
Developer | pomegranate |
Plugin | WooCommerce PDF Invoices & Packing Slips |
Version | 2.0.4 |
Comparing to | |
See all releases |
Code changes from version 2.0.3 to 2.0.4
assets/css/order-styles.css
CHANGED
@@ -40,18 +40,14 @@
|
|
40 |
display:none;
|
41 |
}
|
42 |
|
43 |
-
|
44 |
-
margin:15px 0px!important;
|
45 |
-
}
|
46 |
|
47 |
-
|
48 |
margin-left:20px!important;
|
49 |
-
}
|
50 |
-
|
51 |
-
#edit-invoice-date-number {
|
52 |
opacity:0.5;
|
53 |
}
|
54 |
-
|
|
|
55 |
opacity:1;
|
56 |
cursor:pointer;
|
57 |
-
}
|
40 |
display:none;
|
41 |
}
|
42 |
|
43 |
+
/* Edit buttons Invoice, Proforma and Credit */
|
|
|
|
|
44 |
|
45 |
+
.wpo-wcpdf-edit-date-number {
|
46 |
margin-left:20px!important;
|
|
|
|
|
|
|
47 |
opacity:0.5;
|
48 |
}
|
49 |
+
|
50 |
+
.wpo-wcpdf-edit-date-number:hover {
|
51 |
opacity:1;
|
52 |
cursor:pointer;
|
53 |
+
}
|
assets/js/order-script.js
CHANGED
@@ -32,7 +32,7 @@ jQuery(document).ready(function($) {
|
|
32 |
$('#wpo_wcpdf-data-input-box').insertAfter('#woocommerce-order-data');
|
33 |
|
34 |
// enable invoice number edit if user initiated
|
35 |
-
$( "
|
36 |
$form = $(this).closest('.wcpdf-data-fields');
|
37 |
$form.find(".read-only").hide();
|
38 |
$form.find(".editable").show();
|
32 |
$('#wpo_wcpdf-data-input-box').insertAfter('#woocommerce-order-data');
|
33 |
|
34 |
// enable invoice number edit if user initiated
|
35 |
+
$( ".wpo-wcpdf-edit-date-number" ).click(function() {
|
36 |
$form = $(this).closest('.wcpdf-data-fields');
|
37 |
$form.find(".read-only").hide();
|
38 |
$form.find(".editable").show();
|
includes/class-wcpdf-admin.php
CHANGED
@@ -164,7 +164,7 @@ class Admin {
|
|
164 |
$invoice_date = $invoice->get_date();
|
165 |
?>
|
166 |
<div class="wcpdf-data-fields">
|
167 |
-
<h4><?php _e( 'Invoice', 'woocommerce-pdf-invoices-packing-slips' ) ?><?php if ($invoice->exists()) : ?><span id="edit-
|
168 |
|
169 |
<!-- Read only -->
|
170 |
<div class="read-only">
|
@@ -173,7 +173,7 @@ class Admin {
|
|
173 |
<p class="form-field _wcpdf_invoice_number_field ">
|
174 |
<p>
|
175 |
<span><strong><?php _e( 'Invoice Number', 'woocommerce-pdf-invoices-packing-slips' ); ?>:</strong></span>
|
176 |
-
<span><?php if (!empty($invoice_number)) echo $invoice_number->
|
177 |
</p>
|
178 |
</p>
|
179 |
</div>
|
@@ -196,7 +196,7 @@ class Admin {
|
|
196 |
<p class="form-field _wcpdf_invoice_number_field ">
|
197 |
<label for="_wcpdf_invoice_number"><?php _e( 'Invoice Number (unformatted!)', 'woocommerce-pdf-invoices-packing-slips' ); ?>:</label>
|
198 |
<?php if ( $invoice->exists() && !empty($invoice_number) ) : ?>
|
199 |
-
<input type="text" class="short" style="" name="_wcpdf_invoice_number" id="_wcpdf_invoice_number" value="<?php echo $invoice_number->
|
200 |
<?php else : ?>
|
201 |
<input type="text" class="short" style="" name="_wcpdf_invoice_number" id="_wcpdf_invoice_number" value="" disabled="disabled" >
|
202 |
<?php endif; ?>
|
164 |
$invoice_date = $invoice->get_date();
|
165 |
?>
|
166 |
<div class="wcpdf-data-fields">
|
167 |
+
<h4><?php _e( 'Invoice', 'woocommerce-pdf-invoices-packing-slips' ) ?><?php if ($invoice->exists()) : ?><span id="" class="wpo-wcpdf-edit-date-number dashicons dashicons-edit"></span><?php endif; ?></h4>
|
168 |
|
169 |
<!-- Read only -->
|
170 |
<div class="read-only">
|
173 |
<p class="form-field _wcpdf_invoice_number_field ">
|
174 |
<p>
|
175 |
<span><strong><?php _e( 'Invoice Number', 'woocommerce-pdf-invoices-packing-slips' ); ?>:</strong></span>
|
176 |
+
<span><?php if (!empty($invoice_number)) echo $invoice_number->get_formatted(); ?></span>
|
177 |
</p>
|
178 |
</p>
|
179 |
</div>
|
196 |
<p class="form-field _wcpdf_invoice_number_field ">
|
197 |
<label for="_wcpdf_invoice_number"><?php _e( 'Invoice Number (unformatted!)', 'woocommerce-pdf-invoices-packing-slips' ); ?>:</label>
|
198 |
<?php if ( $invoice->exists() && !empty($invoice_number) ) : ?>
|
199 |
+
<input type="text" class="short" style="" name="_wcpdf_invoice_number" id="_wcpdf_invoice_number" value="<?php echo $invoice_number->get_plain(); ?>">
|
200 |
<?php else : ?>
|
201 |
<input type="text" class="short" style="" name="_wcpdf_invoice_number" id="_wcpdf_invoice_number" value="" disabled="disabled" >
|
202 |
<?php endif; ?>
|
includes/compatibility/class-wc-order-compatibility.php
CHANGED
@@ -82,7 +82,19 @@ class Order extends Data {
|
|
82 |
$value = parent::get_prop( $object, $prop, $context, self::$compat_props );
|
83 |
|
84 |
// 3.0+ date getters return a DateTime object, where previously MySQL date strings were returned
|
85 |
-
if ( WC_Core::is_wc_version_lt_3_0() && in_array( $prop, array( 'date_completed', 'date_paid', 'date_modified', 'date_created' ), true )
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
86 |
if ( is_numeric( $value ) ) { // incidental for WC2.7 orders
|
87 |
$value = new WC_DateTime( "@{$value}", new \DateTimeZone( 'UTC' ) );
|
88 |
$value->setTimezone( new \DateTimeZone( wc_timezone_string() ) );
|
82 |
$value = parent::get_prop( $object, $prop, $context, self::$compat_props );
|
83 |
|
84 |
// 3.0+ date getters return a DateTime object, where previously MySQL date strings were returned
|
85 |
+
if ( WC_Core::is_wc_version_lt_3_0() && in_array( $prop, array( 'date_completed', 'date_paid', 'date_modified', 'date_created' ), true ) ) {
|
86 |
+
// parent fallback for empty date values in refunds
|
87 |
+
if ( empty( $value ) && $object->order_type == 'refund' ) {
|
88 |
+
$parent_order_id = wp_get_post_parent_id( $object->id );
|
89 |
+
$parent_order = wc_get_order( $parent_order_id );
|
90 |
+
$value = parent::get_prop( $parent_order, $prop, $context, self::$compat_props );
|
91 |
+
}
|
92 |
+
|
93 |
+
// abort mission if still empty
|
94 |
+
if ( empty( $value ) ) {
|
95 |
+
return $value;
|
96 |
+
}
|
97 |
+
|
98 |
if ( is_numeric( $value ) ) { // incidental for WC2.7 orders
|
99 |
$value = new WC_DateTime( "@{$value}", new \DateTimeZone( 'UTC' ) );
|
100 |
$value->setTimezone( new \DateTimeZone( wc_timezone_string() ) );
|
includes/documents/abstract-wcpdf-order-document-methods.php
CHANGED
@@ -978,7 +978,7 @@ abstract class Order_Document_Methods extends Order_Document {
|
|
978 |
}
|
979 |
|
980 |
if ( $invoice_number = $this->get_number('invoice') ) {
|
981 |
-
return $formatted_invoice_number = $invoice_number->
|
982 |
} else {
|
983 |
return '';
|
984 |
}
|
978 |
}
|
979 |
|
980 |
if ( $invoice_number = $this->get_number('invoice') ) {
|
981 |
+
return $formatted_invoice_number = $invoice_number->get_formatted();
|
982 |
} else {
|
983 |
return '';
|
984 |
}
|
readme.txt
CHANGED
@@ -4,7 +4,7 @@ Donate link: https://wpovernight.com/downloads/woocommerce-pdf-invoices-packing-
|
|
4 |
Tags: woocommerce, pdf, invoices, packing slips, print, delivery notes, invoice, packing slip, export, email, bulk, automatic
|
5 |
Requires at least: 3.5
|
6 |
Tested up to: 4.8
|
7 |
-
Stable tag: 2.0.
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
@@ -102,6 +102,10 @@ There's a setting on the Status tab of the settings page that allows you to togg
|
|
102 |
|
103 |
**2.0 is a BIG update! Make a full site backup before upgrading**
|
104 |
|
|
|
|
|
|
|
|
|
105 |
= 2.0.3 =
|
106 |
* Fix: Better support for legacy invoice number filter (`wpo_wcpdf_invoice_number` - replaced by `wpo_wcpdf_formatted_document_number`)
|
107 |
* Fix: Document number formatting fallback to order date if no document date available
|
@@ -580,5 +584,5 @@ There's a setting on the Status tab of the settings page that allows you to togg
|
|
580 |
|
581 |
== Upgrade Notice ==
|
582 |
|
583 |
-
= 2.0.
|
584 |
**2.0 is a BIG update! Make a full site backup before upgrading!**
|
4 |
Tags: woocommerce, pdf, invoices, packing slips, print, delivery notes, invoice, packing slip, export, email, bulk, automatic
|
5 |
Requires at least: 3.5
|
6 |
Tested up to: 4.8
|
7 |
+
Stable tag: 2.0.4
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
102 |
|
103 |
**2.0 is a BIG update! Make a full site backup before upgrading**
|
104 |
|
105 |
+
= 2.0.4 =
|
106 |
+
* Fix: Apply filters for custom invoice number formatting in document too
|
107 |
+
* Fix: Parent fallback for missing dates from refunds
|
108 |
+
|
109 |
= 2.0.3 =
|
110 |
* Fix: Better support for legacy invoice number filter (`wpo_wcpdf_invoice_number` - replaced by `wpo_wcpdf_formatted_document_number`)
|
111 |
* Fix: Document number formatting fallback to order date if no document date available
|
584 |
|
585 |
== Upgrade Notice ==
|
586 |
|
587 |
+
= 2.0.4 =
|
588 |
**2.0 is a BIG update! Make a full site backup before upgrading!**
|
woocommerce-pdf-invoices-packingslips.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
* Plugin Name: WooCommerce PDF Invoices & Packing Slips
|
4 |
* Plugin URI: http://www.wpovernight.com
|
5 |
* Description: Create, print & email PDF invoices & packing slips for WooCommerce orders.
|
6 |
-
* Version: 2.0.
|
7 |
* Author: Ewout Fernhout
|
8 |
* Author URI: http://www.wpovernight.com
|
9 |
* License: GPLv2 or later
|
@@ -19,7 +19,7 @@ if ( !class_exists( 'WPO_WCPDF' ) ) :
|
|
19 |
|
20 |
class WPO_WCPDF {
|
21 |
|
22 |
-
public $version = '2.0.
|
23 |
public $plugin_basename;
|
24 |
public $legacy_mode;
|
25 |
|
3 |
* Plugin Name: WooCommerce PDF Invoices & Packing Slips
|
4 |
* Plugin URI: http://www.wpovernight.com
|
5 |
* Description: Create, print & email PDF invoices & packing slips for WooCommerce orders.
|
6 |
+
* Version: 2.0.4
|
7 |
* Author: Ewout Fernhout
|
8 |
* Author URI: http://www.wpovernight.com
|
9 |
* License: GPLv2 or later
|
19 |
|
20 |
class WPO_WCPDF {
|
21 |
|
22 |
+
public $version = '2.0.4';
|
23 |
public $plugin_basename;
|
24 |
public $legacy_mode;
|
25 |
|