Version Description
- Fix: Layout issues with totals for documents with more than 1 page
- Fix: Allow setting an Invoice number and date manually
- Fix: Prevent errors on PHP8.0 when order not loaded for a document
Download this release
Release Info
Developer | pomegranate |
Plugin | WooCommerce PDF Invoices & Packing Slips |
Version | 2.8.2 |
Comparing to | |
See all releases |
Code changes from version 2.8.1 to 2.8.2
- includes/class-wcpdf-admin.php +37 -41
- includes/documents/abstract-wcpdf-order-document-methods.php +5 -5
- includes/documents/abstract-wcpdf-order-document.php +1 -1
- includes/documents/class-wcpdf-document-number.php +1 -1
- includes/documents/class-wcpdf-invoice.php +2 -2
- includes/documents/class-wcpdf-packing-slip.php +2 -2
- includes/legacy/class-wcpdf-legacy-export.php +4 -4
- readme.txt +6 -1
- templates/Simple/invoice.php +0 -1
- templates/Simple/style.css +1 -0
- woocommerce-pdf-invoices-packingslips.php +2 -2
includes/class-wcpdf-admin.php
CHANGED
@@ -181,12 +181,12 @@ class Admin {
|
|
181 |
$document_title = $document->get_title();
|
182 |
$icon = !empty($document->icon) ? $document->icon : WPO_WCPDF()->plugin_url() . "/assets/images/generic_document.png";
|
183 |
if ( $document = wcpdf_get_document( $document->get_type(), $order ) ) {
|
184 |
-
$document_title =
|
185 |
$listing_actions[$document->get_type()] = array(
|
186 |
'url' => wp_nonce_url( admin_url( "admin-ajax.php?action=generate_wpo_wcpdf&document_type={$document->get_type()}&order_ids=" . WCX_Order::get_id( $order ) ), 'generate_wpo_wcpdf' ),
|
187 |
'img' => $icon,
|
188 |
'alt' => "PDF " . $document_title,
|
189 |
-
'exists' =>
|
190 |
);
|
191 |
}
|
192 |
}
|
@@ -334,12 +334,12 @@ class Admin {
|
|
334 |
foreach ($documents as $document) {
|
335 |
$document_title = $document->get_title();
|
336 |
if ( $document = wcpdf_get_document( $document->get_type(), $order ) ) {
|
337 |
-
$document_title =
|
338 |
$meta_box_actions[$document->get_type()] = array(
|
339 |
'url' => wp_nonce_url( admin_url( "admin-ajax.php?action=generate_wpo_wcpdf&document_type={$document->get_type()}&order_ids=" . $post_id ), 'generate_wpo_wcpdf' ),
|
340 |
'alt' => esc_attr( "PDF " . $document_title ),
|
341 |
'title' => "PDF " . $document_title,
|
342 |
-
'exists' =>
|
343 |
);
|
344 |
}
|
345 |
}
|
@@ -365,7 +365,7 @@ class Admin {
|
|
365 |
|
366 |
do_action( 'wpo_wcpdf_meta_box_start', $order, $this );
|
367 |
|
368 |
-
if ( $invoice
|
369 |
// data
|
370 |
$data = array(
|
371 |
'number' => array(
|
@@ -381,8 +381,6 @@ class Admin {
|
|
381 |
// output
|
382 |
$this->output_number_date_edit_fields( $invoice, $data );
|
383 |
|
384 |
-
} else {
|
385 |
-
printf( '<div class="wcpdf-data-fields"><p>⚠ %s</p></div>', __( 'Invoice not generated for this order.', 'woocommerce-pdf-invoices-packing-slips' ) );
|
386 |
}
|
387 |
|
388 |
do_action( 'wpo_wcpdf_meta_box_end', $order, $this );
|
@@ -391,15 +389,15 @@ class Admin {
|
|
391 |
public function get_current_values_for_document( $document, $data ) {
|
392 |
$current = array(
|
393 |
'number' => array(
|
394 |
-
'plain' => ! empty( $document->get_number() ) ? $document->get_number()->get_plain() : '',
|
395 |
-
'formatted' => ! empty( $document->get_number() ) ? $document->get_number()->get_formatted() : '',
|
396 |
'name' => "_wcpdf_{$document->slug}_number",
|
397 |
),
|
398 |
'date' => array(
|
399 |
-
'formatted' => ! empty( $document->get_date() ) ? $document->get_date()->date_i18n( wc_date_format().' @ '.wc_time_format() ) : '',
|
400 |
-
'date' => ! empty( $document->get_date() ) ? $document->get_date()->date_i18n( 'Y-m-d' ) : '',
|
401 |
-
'hour' => ! empty( $document->get_date() ) ? $document->get_date()->date_i18n( 'H' ) : '',
|
402 |
-
'minute' => ! empty( $document->get_date() ) ? $document->get_date()->date_i18n( 'i' ) : '',
|
403 |
'name' => "_wcpdf_{$document->slug}_date",
|
404 |
),
|
405 |
);
|
@@ -429,49 +427,47 @@ class Admin {
|
|
429 |
<!-- Title -->
|
430 |
<h4>
|
431 |
<?= $document->get_title(); ?>
|
432 |
-
|
433 |
-
|
434 |
-
|
|
|
|
|
435 |
</h4>
|
436 |
|
437 |
<!-- Read only -->
|
438 |
<div class="read-only">
|
439 |
-
|
440 |
-
<
|
441 |
-
<p>
|
442 |
-
<
|
443 |
-
|
|
|
|
|
444 |
</p>
|
445 |
-
</
|
446 |
-
|
447 |
-
|
448 |
-
|
449 |
-
|
450 |
-
|
451 |
-
|
452 |
</p>
|
453 |
-
</
|
454 |
-
|
455 |
-
<?php
|
|
|
|
|
456 |
</div>
|
457 |
|
458 |
<!-- Editable -->
|
459 |
<div class="editable">
|
460 |
<p class="form-field <?= $data['number']['name']; ?>_field ">
|
461 |
<label for="<?= $data['number']['name']; ?>"><?= $data['number']['label']; ?></label>
|
462 |
-
|
463 |
-
<input type="text" class="short" style="" name="<?= $data['number']['name']; ?>" id="<?= $data['number']['name']; ?>" value="<?= $data['number']['plain']; ?>" disabled="disabled" > (<?= __( 'unformatted!', 'woocommerce-pdf-invoices-packing-slips' ) ?>)
|
464 |
-
<?php else : ?>
|
465 |
-
<input type="text" class="short" style="" name="<?= $data['number']['name']; ?>" id="<?= $data['number']['name']; ?>" value="" disabled="disabled" > (<?= __( 'unformatted!', 'woocommerce-pdf-invoices-packing-slips' ) ?>)
|
466 |
-
<?php endif; ?>
|
467 |
</p>
|
468 |
<p class="form-field form-field-wide">
|
469 |
<label for="<?= $data['date']['name'] ?>[date]"><?= $data['date']['label']; ?></label>
|
470 |
-
|
471 |
-
<input type="text" class="date-picker-field" name="<?= $data['date']['name'] ?>[date]" id="<?= $data['date']['name'] ?>[date]" maxlength="10" value="<?= $data['date']['date']; ?>" pattern="[0-9]{4}-(0[1-9]|1[012])-(0[1-9]|1[0-9]|2[0-9]|3[01])" disabled="disabled"/>@<input type="number" class="hour" disabled="disabled" placeholder="<?php _e( 'h', 'woocommerce' ); ?>" name="<?= $data['date']['name']; ?>[hour]" id="<?= $data['date']['name']; ?>[hour]" min="0" max="23" size="2" value="<?= $data['date']['hour']; ?>" pattern="([01]?[0-9]{1}|2[0-3]{1})" />:<input type="number" class="minute" placeholder="<?php _e( 'm', 'woocommerce' ); ?>" name="<?= $data['date']['name']; ?>[minute]" id="<?= $data['date']['name']; ?>[minute]" min="0" max="59" size="2" value="<?= $data['date']['minute']; ?>" pattern="[0-5]{1}[0-9]{1}" disabled="disabled" />
|
472 |
-
<?php else : ?>
|
473 |
-
<input type="text" class="date-picker-field" name="<?= $data['date']['name'] ?>[date]" id="<?= $data['date']['name'] ?>[date]" maxlength="10" disabled="disabled" value="<?php echo date_i18n( 'Y-m-d' ); ?>" pattern="[0-9]{4}-(0[1-9]|1[012])-(0[1-9]|1[0-9]|2[0-9]|3[01])" />@<input type="number" class="hour" disabled="disabled" placeholder="<?php _e( 'h', 'woocommerce' ); ?>" name="<?= $data['date']['name']; ?>[hour]" id="<?= $data['date']['name']; ?>[hour]" min="0" max="23" size="2" value="<?php echo date_i18n( 'H' ); ?>" pattern="([01]?[0-9]{1}|2[0-3]{1})" />:<input type="number" class="minute" placeholder="<?php _e( 'm', 'woocommerce' ); ?>" name="<?= $data['date']['name']; ?>[minute]" id="<?= $data['date']['name']; ?>[minute]" min="0" max="59" size="2" value="<?php echo date_i18n( 'i' ); ?>" pattern="[0-5]{1}[0-9]{1}" disabled="disabled" />
|
474 |
-
<?php endif; ?>
|
475 |
</p>
|
476 |
</div>
|
477 |
</section>
|
181 |
$document_title = $document->get_title();
|
182 |
$icon = !empty($document->icon) ? $document->icon : WPO_WCPDF()->plugin_url() . "/assets/images/generic_document.png";
|
183 |
if ( $document = wcpdf_get_document( $document->get_type(), $order ) ) {
|
184 |
+
$document_title = is_callable( array( $document, 'get_title' ) ) ? $document->get_title() : $document_title;
|
185 |
$listing_actions[$document->get_type()] = array(
|
186 |
'url' => wp_nonce_url( admin_url( "admin-ajax.php?action=generate_wpo_wcpdf&document_type={$document->get_type()}&order_ids=" . WCX_Order::get_id( $order ) ), 'generate_wpo_wcpdf' ),
|
187 |
'img' => $icon,
|
188 |
'alt' => "PDF " . $document_title,
|
189 |
+
'exists' => is_callable( array( $document, 'exists' ) ) ? $document->exists() : false,
|
190 |
);
|
191 |
}
|
192 |
}
|
334 |
foreach ($documents as $document) {
|
335 |
$document_title = $document->get_title();
|
336 |
if ( $document = wcpdf_get_document( $document->get_type(), $order ) ) {
|
337 |
+
$document_title = is_callable( array( $document, 'get_title' ) ) ? $document->get_title() : $document_title;
|
338 |
$meta_box_actions[$document->get_type()] = array(
|
339 |
'url' => wp_nonce_url( admin_url( "admin-ajax.php?action=generate_wpo_wcpdf&document_type={$document->get_type()}&order_ids=" . $post_id ), 'generate_wpo_wcpdf' ),
|
340 |
'alt' => esc_attr( "PDF " . $document_title ),
|
341 |
'title' => "PDF " . $document_title,
|
342 |
+
'exists' => is_callable( array( $document, 'exists' ) ) ? $document->exists() : false,
|
343 |
);
|
344 |
}
|
345 |
}
|
365 |
|
366 |
do_action( 'wpo_wcpdf_meta_box_start', $order, $this );
|
367 |
|
368 |
+
if ( $invoice ) {
|
369 |
// data
|
370 |
$data = array(
|
371 |
'number' => array(
|
381 |
// output
|
382 |
$this->output_number_date_edit_fields( $invoice, $data );
|
383 |
|
|
|
|
|
384 |
}
|
385 |
|
386 |
do_action( 'wpo_wcpdf_meta_box_end', $order, $this );
|
389 |
public function get_current_values_for_document( $document, $data ) {
|
390 |
$current = array(
|
391 |
'number' => array(
|
392 |
+
'plain' => $document->exists() && ! empty( $document->get_number() ) ? $document->get_number()->get_plain() : '',
|
393 |
+
'formatted' => $document->exists() && ! empty( $document->get_number() ) ? $document->get_number()->get_formatted() : '',
|
394 |
'name' => "_wcpdf_{$document->slug}_number",
|
395 |
),
|
396 |
'date' => array(
|
397 |
+
'formatted' => $document->exists() && ! empty( $document->get_date() ) ? $document->get_date()->date_i18n( wc_date_format().' @ '.wc_time_format() ) : '',
|
398 |
+
'date' => $document->exists() && ! empty( $document->get_date() ) ? $document->get_date()->date_i18n( 'Y-m-d' ) : date_i18n( 'Y-m-d' ),
|
399 |
+
'hour' => $document->exists() && ! empty( $document->get_date() ) ? $document->get_date()->date_i18n( 'H' ) : date_i18n( 'H' ),
|
400 |
+
'minute' => $document->exists() && ! empty( $document->get_date() ) ? $document->get_date()->date_i18n( 'i' ) : date_i18n( 'i' ),
|
401 |
'name' => "_wcpdf_{$document->slug}_date",
|
402 |
),
|
403 |
);
|
427 |
<!-- Title -->
|
428 |
<h4>
|
429 |
<?= $document->get_title(); ?>
|
430 |
+
<?php if( $document->exists() ) : ?>
|
431 |
+
<span class="wpo-wcpdf-edit-date-number dashicons dashicons-edit"></span>
|
432 |
+
<span class="wpo-wcpdf-delete-document dashicons dashicons-trash" data-nonce="<?php echo wp_create_nonce( "wpo_wcpdf_delete_document" ); ?>"></span>
|
433 |
+
<?php do_action( 'wpo_wcpdf_document_actions', $document ); ?>
|
434 |
+
<?php endif; ?>
|
435 |
</h4>
|
436 |
|
437 |
<!-- Read only -->
|
438 |
<div class="read-only">
|
439 |
+
<?php if( $document->exists() ) : ?>
|
440 |
+
<div class="<?= $document->get_type(); ?>-number">
|
441 |
+
<p class="form-field <?= $data['number']['name']; ?>_field">
|
442 |
+
<p>
|
443 |
+
<span><strong><?= $data['number']['label']; ?></strong></span>
|
444 |
+
<span><?= $data['number']['formatted']; ?></span>
|
445 |
+
</p>
|
446 |
</p>
|
447 |
+
</div>
|
448 |
+
<div class="<?= $document->get_type(); ?>-date">
|
449 |
+
<p class="form-field form-field-wide">
|
450 |
+
<p>
|
451 |
+
<span><strong><?= $data['date']['label']; ?></strong></span>
|
452 |
+
<span><?= $data['date']['formatted']; ?></span>
|
453 |
+
</p>
|
454 |
</p>
|
455 |
+
</div>
|
456 |
+
<?php do_action( 'wpo_wcpdf_meta_box_after_document_data', $document, $document->order ); ?>
|
457 |
+
<?php else : ?>
|
458 |
+
<span class="wpo-wcpdf-set-date-number button"><?php printf( __( 'Set %s number & date', 'woocommerce-pdf-invoices-packing-slips' ), $document->get_title() ); ?></span>
|
459 |
+
<?php endif; ?>
|
460 |
</div>
|
461 |
|
462 |
<!-- Editable -->
|
463 |
<div class="editable">
|
464 |
<p class="form-field <?= $data['number']['name']; ?>_field ">
|
465 |
<label for="<?= $data['number']['name']; ?>"><?= $data['number']['label']; ?></label>
|
466 |
+
<input type="text" class="short" style="" name="<?= $data['number']['name']; ?>" id="<?= $data['number']['name']; ?>" value="<?= $data['number']['plain']; ?>" disabled="disabled" > (<?= __( 'unformatted!', 'woocommerce-pdf-invoices-packing-slips' ) ?>)
|
|
|
|
|
|
|
|
|
467 |
</p>
|
468 |
<p class="form-field form-field-wide">
|
469 |
<label for="<?= $data['date']['name'] ?>[date]"><?= $data['date']['label']; ?></label>
|
470 |
+
<input type="text" class="date-picker-field" name="<?= $data['date']['name'] ?>[date]" id="<?= $data['date']['name'] ?>[date]" maxlength="10" value="<?= $data['date']['date']; ?>" pattern="[0-9]{4}-(0[1-9]|1[012])-(0[1-9]|1[0-9]|2[0-9]|3[01])" disabled="disabled"/>@<input type="number" class="hour" disabled="disabled" placeholder="<?php _e( 'h', 'woocommerce' ); ?>" name="<?= $data['date']['name']; ?>[hour]" id="<?= $data['date']['name']; ?>[hour]" min="0" max="23" size="2" value="<?= $data['date']['hour']; ?>" pattern="([01]?[0-9]{1}|2[0-3]{1})" />:<input type="number" class="minute" placeholder="<?php _e( 'm', 'woocommerce' ); ?>" name="<?= $data['date']['name']; ?>[minute]" id="<?= $data['date']['name']; ?>[minute]" min="0" max="59" size="2" value="<?= $data['date']['minute']; ?>" pattern="[0-5]{1}[0-9]{1}" disabled="disabled" />
|
|
|
|
|
|
|
|
|
471 |
</p>
|
472 |
</div>
|
473 |
</section>
|
includes/documents/abstract-wcpdf-order-document-methods.php
CHANGED
@@ -25,7 +25,7 @@ if ( !class_exists( '\\WPO\\WC\\PDF_Invoices\\Documents\\Order_Document_Methods'
|
|
25 |
|
26 |
abstract class Order_Document_Methods extends Order_Document {
|
27 |
public function is_refund( $order ) {
|
28 |
-
if (
|
29 |
$is_refund = $order->get_type() == 'shop_order_refund';
|
30 |
} else {
|
31 |
$is_refund = get_post_type( WCX_Order::get_id( $order ) ) == 'shop_order_refund';
|
@@ -35,7 +35,7 @@ abstract class Order_Document_Methods extends Order_Document {
|
|
35 |
}
|
36 |
|
37 |
public function get_refund_parent_id( $order ) {
|
38 |
-
if (
|
39 |
$parent_order_id = $order->get_parent_id();
|
40 |
} else {
|
41 |
$parent_order_id = wp_get_post_parent_id( WCX_Order::get_id( $order ) );
|
@@ -709,7 +709,7 @@ abstract class Order_Document_Methods extends Order_Document {
|
|
709 |
}
|
710 |
|
711 |
public function get_tax_rates_from_order( $order ) {
|
712 |
-
if ( !empty( $order ) &&
|
713 |
$tax_rates = array();
|
714 |
$tax_items = $order->get_items( array('tax') );
|
715 |
|
@@ -864,7 +864,7 @@ abstract class Order_Document_Methods extends Order_Document {
|
|
864 |
// WC2.4 fix order_total for refunded orders
|
865 |
// not if this is the actual refund!
|
866 |
if ( ! $this->is_refund( $this->order ) && apply_filters( 'wpo_wcpdf_remove_refund_totals', true, $this ) ) {
|
867 |
-
$total_refunded =
|
868 |
if ( version_compare( WOOCOMMERCE_VERSION, '2.4', '>=' ) && isset($totals['order_total']) && $total_refunded ) {
|
869 |
if ( version_compare( WOOCOMMERCE_VERSION, '3.0', '>=' ) ) {
|
870 |
$tax_display = get_option( 'woocommerce_tax_display_cart' );
|
@@ -1123,7 +1123,7 @@ abstract class Order_Document_Methods extends Order_Document {
|
|
1123 |
// return reason for refund if order is a refund
|
1124 |
if ( version_compare( WOOCOMMERCE_VERSION, '3.0', '>=' ) ) {
|
1125 |
$shipping_notes = $this->order->get_reason();
|
1126 |
-
} elseif (
|
1127 |
$shipping_notes = $this->order->get_refund_reason();
|
1128 |
} else {
|
1129 |
$shipping_notes = wpautop( wptexturize( WCX_Order::get_prop( $this->order, 'customer_note', 'view' ) ) );
|
25 |
|
26 |
abstract class Order_Document_Methods extends Order_Document {
|
27 |
public function is_refund( $order ) {
|
28 |
+
if ( is_callable( array( $order, 'get_type' ) ) ) { // WC 3.0+
|
29 |
$is_refund = $order->get_type() == 'shop_order_refund';
|
30 |
} else {
|
31 |
$is_refund = get_post_type( WCX_Order::get_id( $order ) ) == 'shop_order_refund';
|
35 |
}
|
36 |
|
37 |
public function get_refund_parent_id( $order ) {
|
38 |
+
if ( is_callable( array( $order, 'get_parent_id' ) ) ) { // WC3.0+
|
39 |
$parent_order_id = $order->get_parent_id();
|
40 |
} else {
|
41 |
$parent_order_id = wp_get_post_parent_id( WCX_Order::get_id( $order ) );
|
709 |
}
|
710 |
|
711 |
public function get_tax_rates_from_order( $order ) {
|
712 |
+
if ( !empty( $order ) && is_callable( array( $order, 'get_version' ) ) && version_compare( $order->get_version(), '3.7', '>=' ) && version_compare( WC_VERSION, '3.7', '>=' ) ) {
|
713 |
$tax_rates = array();
|
714 |
$tax_items = $order->get_items( array('tax') );
|
715 |
|
864 |
// WC2.4 fix order_total for refunded orders
|
865 |
// not if this is the actual refund!
|
866 |
if ( ! $this->is_refund( $this->order ) && apply_filters( 'wpo_wcpdf_remove_refund_totals', true, $this ) ) {
|
867 |
+
$total_refunded = is_callable( array( $this->order, 'get_total_refunded' ) ) ? $this->order->get_total_refunded() : 0;
|
868 |
if ( version_compare( WOOCOMMERCE_VERSION, '2.4', '>=' ) && isset($totals['order_total']) && $total_refunded ) {
|
869 |
if ( version_compare( WOOCOMMERCE_VERSION, '3.0', '>=' ) ) {
|
870 |
$tax_display = get_option( 'woocommerce_tax_display_cart' );
|
1123 |
// return reason for refund if order is a refund
|
1124 |
if ( version_compare( WOOCOMMERCE_VERSION, '3.0', '>=' ) ) {
|
1125 |
$shipping_notes = $this->order->get_reason();
|
1126 |
+
} elseif ( is_callable( array( $this->order, 'get_refund_reason' ) ) ) {
|
1127 |
$shipping_notes = $this->order->get_refund_reason();
|
1128 |
} else {
|
1129 |
$shipping_notes = wpautop( wptexturize( WCX_Order::get_prop( $this->order, 'customer_note', 'view' ) ) );
|
includes/documents/abstract-wcpdf-order-document.php
CHANGED
@@ -774,7 +774,7 @@ abstract class Order_Document {
|
|
774 |
if ( get_post_type( $this->order_id ) == 'shop_order_refund' ) {
|
775 |
$number = $this->order_id;
|
776 |
} else {
|
777 |
-
$number =
|
778 |
}
|
779 |
|
780 |
if ( $order_count == 1 ) {
|
774 |
if ( get_post_type( $this->order_id ) == 'shop_order_refund' ) {
|
775 |
$number = $this->order_id;
|
776 |
} else {
|
777 |
+
$number = is_callable( array( $this->order, 'get_order_number' ) ) ? $this->order->get_order_number() : '';
|
778 |
}
|
779 |
|
780 |
if ( $order_count == 1 ) {
|
includes/documents/class-wcpdf-document-number.php
CHANGED
@@ -141,7 +141,7 @@ class Document_Number {
|
|
141 |
$document_year = $document_date->date_i18n( 'Y' );
|
142 |
$document_month = $document_date->date_i18n( 'm' );
|
143 |
$document_day = $document_date->date_i18n( 'd' );
|
144 |
-
$order_number =
|
145 |
|
146 |
// make replacements
|
147 |
foreach ($formats as $key => $value) {
|
141 |
$document_year = $document_date->date_i18n( 'Y' );
|
142 |
$document_month = $document_date->date_i18n( 'm' );
|
143 |
$document_day = $document_date->date_i18n( 'd' );
|
144 |
+
$order_number = is_callable( array( $order, 'get_order_number' ) ) ? $order->get_order_number() : '';
|
145 |
|
146 |
// make replacements
|
147 |
foreach ($formats as $key => $value) {
|
includes/documents/class-wcpdf-invoice.php
CHANGED
@@ -135,9 +135,9 @@ class Invoice extends Order_Document_Methods {
|
|
135 |
} else {
|
136 |
if ( empty( $this->order ) ) {
|
137 |
$order = WCX::get_order ( $order_ids[0] );
|
138 |
-
$suffix =
|
139 |
} else {
|
140 |
-
$suffix =
|
141 |
}
|
142 |
}
|
143 |
} else {
|
135 |
} else {
|
136 |
if ( empty( $this->order ) ) {
|
137 |
$order = WCX::get_order ( $order_ids[0] );
|
138 |
+
$suffix = is_callable( array( $order, 'get_order_number' ) ) ? $order->get_order_number() : '';
|
139 |
} else {
|
140 |
+
$suffix = is_callable( array( $this->order, 'get_order_number' ) ) ? $this->order->get_order_number() : '';
|
141 |
}
|
142 |
}
|
143 |
} else {
|
includes/documents/class-wcpdf-packing-slip.php
CHANGED
@@ -52,9 +52,9 @@ class Packing_Slip extends Order_Document_Methods {
|
|
52 |
} else {
|
53 |
if ( empty( $this->order ) ) {
|
54 |
$order = WCX::get_order ( $order_ids[0] );
|
55 |
-
$suffix =
|
56 |
} else {
|
57 |
-
$suffix =
|
58 |
}
|
59 |
}
|
60 |
} else {
|
52 |
} else {
|
53 |
if ( empty( $this->order ) ) {
|
54 |
$order = WCX::get_order ( $order_ids[0] );
|
55 |
+
$suffix = is_callable( array( $order, 'get_order_number' ) ) ? $order->get_order_number() : '';
|
56 |
} else {
|
57 |
+
$suffix = is_callable( array( $this->order, 'get_order_number' ) ) ? $this->order->get_order_number() : '';
|
58 |
}
|
59 |
}
|
60 |
} else {
|
includes/legacy/class-wcpdf-legacy-export.php
CHANGED
@@ -70,8 +70,8 @@ class Legacy_Export {
|
|
70 |
wcpdf_deprecated_function( '$wpo_wcpdf->export->get_display_number()', '2.0' );
|
71 |
if ( empty( $this->document ) ) {
|
72 |
// we don't know what document type we're handling, so we return the order number
|
73 |
-
$order = WCX::get_order ( $order_id )
|
74 |
-
$order_number =
|
75 |
return $order_number;
|
76 |
}
|
77 |
|
@@ -80,9 +80,9 @@ class Legacy_Export {
|
|
80 |
} else {
|
81 |
if ( empty( $this->order ) ) {
|
82 |
$order = WCX::get_order ( $order_ids[0] );
|
83 |
-
$order_number =
|
84 |
} else {
|
85 |
-
$order_number =
|
86 |
}
|
87 |
}
|
88 |
|
70 |
wcpdf_deprecated_function( '$wpo_wcpdf->export->get_display_number()', '2.0' );
|
71 |
if ( empty( $this->document ) ) {
|
72 |
// we don't know what document type we're handling, so we return the order number
|
73 |
+
$order = WCX::get_order ( $order_id );
|
74 |
+
$order_number = is_callable( array( $order, 'get_order_number' ) ) ? $order->get_order_number() : '';
|
75 |
return $order_number;
|
76 |
}
|
77 |
|
80 |
} else {
|
81 |
if ( empty( $this->order ) ) {
|
82 |
$order = WCX::get_order ( $order_ids[0] );
|
83 |
+
$order_number = is_callable( array( $order, 'get_order_number' ) ) ? $order->get_order_number() : '';
|
84 |
} else {
|
85 |
+
$order_number = is_callable( array( $this->order, 'get_order_number' ) ) ? $this->order->get_order_number() : '';
|
86 |
}
|
87 |
}
|
88 |
|
readme.txt
CHANGED
@@ -5,7 +5,7 @@ Tags: woocommerce, pdf, invoices, packing slips, print, delivery notes, invoice,
|
|
5 |
Requires at least: 3.5
|
6 |
Tested up to: 5.6
|
7 |
Requires PHP: 7.1
|
8 |
-
Stable tag: 2.8.
|
9 |
License: GPLv2 or later
|
10 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
11 |
|
@@ -102,6 +102,11 @@ There's a setting on the Status tab of the settings page that allows you to togg
|
|
102 |
|
103 |
== Changelog ==
|
104 |
|
|
|
|
|
|
|
|
|
|
|
105 |
= 2.8.1 =
|
106 |
* Fix: Images and fonts loading from custom locations for uploads and temporary folders
|
107 |
|
5 |
Requires at least: 3.5
|
6 |
Tested up to: 5.6
|
7 |
Requires PHP: 7.1
|
8 |
+
Stable tag: 2.8.2
|
9 |
License: GPLv2 or later
|
10 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
11 |
|
102 |
|
103 |
== Changelog ==
|
104 |
|
105 |
+
= 2.8.2 =
|
106 |
+
* Fix: Layout issues with totals for documents with more than 1 page
|
107 |
+
* Fix: Allow setting an Invoice number and date manually
|
108 |
+
* Fix: Prevent errors on PHP8.0 when order not loaded for a document
|
109 |
+
|
110 |
= 2.8.1 =
|
111 |
* Fix: Images and fonts loading from custom locations for uploads and temporary folders
|
112 |
|
templates/Simple/invoice.php
CHANGED
@@ -139,7 +139,6 @@
|
|
139 |
<tfoot>
|
140 |
<?php foreach( $this->get_woocommerce_totals() as $key => $total ) : ?>
|
141 |
<tr class="<?php echo $key; ?>">
|
142 |
-
<td class="no-borders"></td>
|
143 |
<th class="description"><?php echo $total['label']; ?></th>
|
144 |
<td class="price"><span class="totals-price"><?php echo $total['value']; ?></span></td>
|
145 |
</tr>
|
139 |
<tfoot>
|
140 |
<?php foreach( $this->get_woocommerce_totals() as $key => $total ) : ?>
|
141 |
<tr class="<?php echo $key; ?>">
|
|
|
142 |
<th class="description"><?php echo $total['label']; ?></th>
|
143 |
<td class="price"><span class="totals-price"><?php echo $total['value']; ?></span></td>
|
144 |
</tr>
|
templates/Simple/style.css
CHANGED
@@ -238,6 +238,7 @@ dd:after {
|
|
238 |
table.totals {
|
239 |
width: 100%;
|
240 |
margin-top: 5mm;
|
|
|
241 |
}
|
242 |
|
243 |
table.totals th,
|
238 |
table.totals {
|
239 |
width: 100%;
|
240 |
margin-top: 5mm;
|
241 |
+
table-layout: fixed;
|
242 |
}
|
243 |
|
244 |
table.totals th,
|
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.8.
|
7 |
* Author: Ewout Fernhout
|
8 |
* Author URI: http://www.wpovernight.com
|
9 |
* License: GPLv2 or later
|
@@ -21,7 +21,7 @@ if ( !class_exists( 'WPO_WCPDF' ) ) :
|
|
21 |
|
22 |
class WPO_WCPDF {
|
23 |
|
24 |
-
public $version = '2.8.
|
25 |
public $plugin_basename;
|
26 |
public $legacy_mode;
|
27 |
public $legacy_textdomain;
|
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.8.2
|
7 |
* Author: Ewout Fernhout
|
8 |
* Author URI: http://www.wpovernight.com
|
9 |
* License: GPLv2 or later
|
21 |
|
22 |
class WPO_WCPDF {
|
23 |
|
24 |
+
public $version = '2.8.2';
|
25 |
public $plugin_basename;
|
26 |
public $legacy_mode;
|
27 |
public $legacy_textdomain;
|