@@ -7,10 +7,10 @@ discard block |
||
7 | 7 | * @version 1.0.19 |
8 | 8 | */ |
9 | 9 | |
10 | -defined( 'ABSPATH' ) || exit; |
|
10 | +defined('ABSPATH') || exit; |
|
11 | 11 | |
12 | -$invoice = new WPInv_Invoice( $invoice ); |
|
13 | -$address_row = wpinv_get_invoice_address_markup( $invoice->get_user_info() ); |
|
12 | +$invoice = new WPInv_Invoice($invoice); |
|
13 | +$address_row = wpinv_get_invoice_address_markup($invoice->get_user_info()); |
|
14 | 14 | $phone = $invoice->get_phone(); |
15 | 15 | $email = $invoice->get_email(); |
16 | 16 | $vat_number = $invoice->get_vat_number(); |
@@ -22,47 +22,47 @@ discard block |
||
22 | 22 | |
23 | 23 | |
24 | 24 | <div class="invoice-billing-address-label col-2"> |
25 | - <strong><?php esc_html_e( 'To:', 'invoicing' ); ?></strong> |
|
25 | + <strong><?php esc_html_e('To:', 'invoicing'); ?></strong> |
|
26 | 26 | </div> |
27 | 27 | |
28 | 28 | |
29 | 29 | <div class="invoice-billing-address-value col-10"> |
30 | 30 | |
31 | - <?php do_action( 'getpaid_billing_address_top' ); ?> |
|
31 | + <?php do_action('getpaid_billing_address_top'); ?> |
|
32 | 32 | |
33 | - <?php if ( ! empty( $address_row ) ) : ?> |
|
33 | + <?php if (!empty($address_row)) : ?> |
|
34 | 34 | <div class="billing-address"> |
35 | - <?php echo wp_kses_post( $address_row ); ?> |
|
35 | + <?php echo wp_kses_post($address_row); ?> |
|
36 | 36 | </div> |
37 | 37 | <?php endif; ?> |
38 | 38 | |
39 | 39 | |
40 | - <?php if ( ! empty( $phone ) ) : ?> |
|
40 | + <?php if (!empty($phone)) : ?> |
|
41 | 41 | <div class="billing-phone"> |
42 | - <?php echo wp_sprintf( esc_html__( 'Phone: %s', 'invoicing' ), esc_html( $phone ) ); ?> |
|
42 | + <?php echo wp_sprintf(esc_html__('Phone: %s', 'invoicing'), esc_html($phone)); ?> |
|
43 | 43 | </div> |
44 | 44 | <?php endif; ?> |
45 | 45 | |
46 | 46 | |
47 | - <?php if ( ! empty( $email ) ) : ?> |
|
47 | + <?php if (!empty($email)) : ?> |
|
48 | 48 | <div class="billing-email"> |
49 | - <?php echo wp_sprintf( esc_html__( 'Email: %s', 'invoicing' ), esc_html( $email ) ); ?> |
|
49 | + <?php echo wp_sprintf(esc_html__('Email: %s', 'invoicing'), esc_html($email)); ?> |
|
50 | 50 | </div> |
51 | 51 | <?php endif; ?> |
52 | 52 | |
53 | - <?php if ( ! empty( $vat_number ) ) : ?> |
|
53 | + <?php if (!empty($vat_number)) : ?> |
|
54 | 54 | <div class="vat-number"> |
55 | - <?php echo wp_sprintf( esc_html__( 'Vat Number: %s', 'invoicing' ), esc_html( $vat_number ) ); ?> |
|
55 | + <?php echo wp_sprintf(esc_html__('Vat Number: %s', 'invoicing'), esc_html($vat_number)); ?> |
|
56 | 56 | </div> |
57 | 57 | <?php endif; ?> |
58 | 58 | |
59 | - <?php if ( ! empty( $company_id ) ) : ?> |
|
59 | + <?php if (!empty($company_id)) : ?> |
|
60 | 60 | <div class="company-id"> |
61 | - <?php echo wp_sprintf( esc_html__( 'Company ID: %s', 'invoicing' ), esc_html( $company_id ) ); ?> |
|
61 | + <?php echo wp_sprintf(esc_html__('Company ID: %s', 'invoicing'), esc_html($company_id)); ?> |
|
62 | 62 | </div> |
63 | 63 | <?php endif; ?> |
64 | 64 | |
65 | - <?php do_action( 'getpaid_billing_address_bottom' ); ?> |
|
65 | + <?php do_action('getpaid_billing_address_bottom'); ?> |
|
66 | 66 | |
67 | 67 | </div> |
68 | 68 |
@@ -8,7 +8,7 @@ discard block |
||
8 | 8 | * @var WPInv_Invoice $invoice |
9 | 9 | */ |
10 | 10 | |
11 | -defined( 'ABSPATH' ) || exit; |
|
11 | +defined('ABSPATH') || exit; |
|
12 | 12 | |
13 | 13 | ?> |
14 | 14 | |
@@ -16,48 +16,48 @@ discard block |
||
16 | 16 | |
17 | 17 | <?php |
18 | 18 | |
19 | - $actions = array(); |
|
19 | + $actions = array(); |
|
20 | 20 | |
21 | 21 | echo sprintf( |
22 | 22 | '<a href="javascript:void(0)" class="btn btn-sm m-1 d-inline-block btn-secondary invoice-action-print d-none d-lg-inline-block" onclick="window.print();">%s</a>', |
23 | 23 | sprintf( |
24 | - esc_html__( 'Print %s', 'invoicing' ), |
|
25 | - esc_html( ucfirst( $invoice->get_invoice_quote_type() ) ) |
|
24 | + esc_html__('Print %s', 'invoicing'), |
|
25 | + esc_html(ucfirst($invoice->get_invoice_quote_type())) |
|
26 | 26 | ) |
27 | 27 | ); |
28 | 28 | |
29 | - if ( is_user_logged_in() ) { |
|
29 | + if (is_user_logged_in()) { |
|
30 | 30 | |
31 | 31 | $actions[] = sprintf( |
32 | 32 | '<a href="%s" class="btn btn-sm btn-secondary m-1 d-inline-block invoice-action-history">%s</a>', |
33 | - esc_url( wpinv_get_history_page_uri( $invoice->get_post_type() ) ), |
|
33 | + esc_url(wpinv_get_history_page_uri($invoice->get_post_type())), |
|
34 | 34 | sprintf( |
35 | - __( '%s History', 'invoicing' ), |
|
36 | - esc_html( ucfirst( $invoice->get_invoice_quote_type() ) ) |
|
35 | + __('%s History', 'invoicing'), |
|
36 | + esc_html(ucfirst($invoice->get_invoice_quote_type())) |
|
37 | 37 | ) |
38 | 38 | ); |
39 | 39 | |
40 | 40 | } |
41 | 41 | |
42 | - if ( wpinv_current_user_can_manage_invoicing() ) { |
|
42 | + if (wpinv_current_user_can_manage_invoicing()) { |
|
43 | 43 | |
44 | 44 | $actions[] = sprintf( |
45 | 45 | '<a href="%s" class="btn btn-sm btn-secondary m-1 d-inline-block invoice-action-edit">%s</a>', |
46 | - esc_url( get_edit_post_link( $invoice->get_id() ) ), |
|
46 | + esc_url(get_edit_post_link($invoice->get_id())), |
|
47 | 47 | sprintf( |
48 | - __( 'Edit %s', 'invoicing' ), |
|
49 | - esc_html( ucfirst( $invoice->get_invoice_quote_type() ) ) |
|
48 | + __('Edit %s', 'invoicing'), |
|
49 | + esc_html(ucfirst($invoice->get_invoice_quote_type())) |
|
50 | 50 | ) |
51 | 51 | ); |
52 | 52 | |
53 | 53 | } |
54 | 54 | |
55 | - $actions = apply_filters( 'getpaid_invoice_header_right_actions_array', $actions, $invoice ); |
|
56 | - echo wp_kses_post( implode( '', $actions ) ); |
|
55 | + $actions = apply_filters('getpaid_invoice_header_right_actions_array', $actions, $invoice); |
|
56 | + echo wp_kses_post(implode('', $actions)); |
|
57 | 57 | |
58 | 58 | ?> |
59 | 59 | |
60 | - <?php do_action( 'wpinv_invoice_display_right_actions', $invoice ); ?> |
|
60 | + <?php do_action('wpinv_invoice_display_right_actions', $invoice); ?> |
|
61 | 61 | </div> |
62 | 62 | |
63 | 63 | <?php |
@@ -7,11 +7,11 @@ |
||
7 | 7 | * @version 1.0.19 |
8 | 8 | */ |
9 | 9 | |
10 | -defined( 'ABSPATH' ) || exit; |
|
10 | +defined('ABSPATH') || exit; |
|
11 | 11 | |
12 | 12 | ?> |
13 | 13 | <h2 class="h3 text-dark"> |
14 | - <?php echo esc_html( apply_filters( 'getpaid_invoice_type_label', esc_html( ucfirst( $invoice->get_invoice_quote_type() ) ), $invoice ) ); ?> |
|
14 | + <?php echo esc_html(apply_filters('getpaid_invoice_type_label', esc_html(ucfirst($invoice->get_invoice_quote_type())), $invoice)); ?> |
|
15 | 15 | </h2> |
16 | 16 | |
17 | 17 | <?php |
@@ -32,33 +32,33 @@ discard block |
||
32 | 32 | // Item name. |
33 | 33 | if ( 'name' == $column ) { |
34 | 34 | |
35 | - // Display the name. |
|
36 | - echo '<div class="mb-1">' . esc_html( $item->get_name() ) . '</div>'; |
|
35 | + // Display the name. |
|
36 | + echo '<div class="mb-1">' . esc_html( $item->get_name() ) . '</div>'; |
|
37 | 37 | |
38 | - // And an optional description. |
|
39 | - $description = $item->get_description(); |
|
38 | + // And an optional description. |
|
39 | + $description = $item->get_description(); |
|
40 | 40 | |
41 | - if ( ! empty( $description ) ) { |
|
42 | - echo "<small class='form-text text-muted pr-2 m-0'>" . wp_kses_post( $description ) . "</small>"; |
|
41 | + if ( ! empty( $description ) ) { |
|
42 | + echo "<small class='form-text text-muted pr-2 m-0'>" . wp_kses_post( $description ) . "</small>"; |
|
43 | 43 | } |
44 | 44 | |
45 | - // Fires before printing the line item actions. |
|
46 | - do_action( 'getpaid_before_invoice_line_item_actions', $item, $invoice ); |
|
45 | + // Fires before printing the line item actions. |
|
46 | + do_action( 'getpaid_before_invoice_line_item_actions', $item, $invoice ); |
|
47 | 47 | |
48 | - $actions = apply_filters( 'getpaid-invoice-page-line-item-actions', array(), $item, $invoice ); |
|
48 | + $actions = apply_filters( 'getpaid-invoice-page-line-item-actions', array(), $item, $invoice ); |
|
49 | 49 | |
50 | - if ( ! empty( $actions ) ) { |
|
50 | + if ( ! empty( $actions ) ) { |
|
51 | 51 | |
52 | - $sanitized = array(); |
|
53 | - foreach ( $actions as $key => $action ) { |
|
54 | - $key = sanitize_html_class( $key ); |
|
55 | - $action = wp_kses_post( $action ); |
|
56 | - $sanitized[] = "<span class='$key'>$action</span>"; |
|
52 | + $sanitized = array(); |
|
53 | + foreach ( $actions as $key => $action ) { |
|
54 | + $key = sanitize_html_class( $key ); |
|
55 | + $action = wp_kses_post( $action ); |
|
56 | + $sanitized[] = "<span class='$key'>$action</span>"; |
|
57 | 57 | } |
58 | 58 | |
59 | - echo "<small class='form-text getpaid-line-item-actions'>"; |
|
60 | - echo wp_kses_post( implode( ' | ', $sanitized ) ); |
|
61 | - echo '</small>'; |
|
59 | + echo "<small class='form-text getpaid-line-item-actions'>"; |
|
60 | + echo wp_kses_post( implode( ' | ', $sanitized ) ); |
|
61 | + echo '</small>'; |
|
62 | 62 | |
63 | 63 | } |
64 | 64 | } |
@@ -66,26 +66,26 @@ discard block |
||
66 | 66 | // Item price. |
67 | 67 | if ( 'price' == $column ) { |
68 | 68 | |
69 | - // Display the item price (or recurring price if this is a renewal invoice) |
|
70 | - $price = $invoice->is_renewal() ? $item->get_price() : $item->get_initial_price(); |
|
71 | - wpinv_the_price( $price, $invoice->get_currency() ); |
|
69 | + // Display the item price (or recurring price if this is a renewal invoice) |
|
70 | + $price = $invoice->is_renewal() ? $item->get_price() : $item->get_initial_price(); |
|
71 | + wpinv_the_price( $price, $invoice->get_currency() ); |
|
72 | 72 | |
73 | 73 | } |
74 | 74 | |
75 | 75 | // Tax rate. |
76 | 76 | if ( 'tax_rate' == $column ) { |
77 | - echo floatval( round( getpaid_get_invoice_tax_rate( $invoice, $item ), 2 ) ) . '%'; |
|
77 | + echo floatval( round( getpaid_get_invoice_tax_rate( $invoice, $item ), 2 ) ) . '%'; |
|
78 | 78 | } |
79 | 79 | |
80 | 80 | // Item quantity. |
81 | 81 | if ( 'quantity' == $column ) { |
82 | - echo (float) $item->get_quantity(); |
|
82 | + echo (float) $item->get_quantity(); |
|
83 | 83 | } |
84 | 84 | |
85 | 85 | // Item sub total. |
86 | 86 | if ( 'subtotal' == $column ) { |
87 | - $subtotal = $invoice->is_renewal() ? $item->get_recurring_sub_total() : $item->get_sub_total(); |
|
88 | - wpinv_the_price( $subtotal, $invoice->get_currency() ); |
|
87 | + $subtotal = $invoice->is_renewal() ? $item->get_recurring_sub_total() : $item->get_sub_total(); |
|
88 | + wpinv_the_price( $subtotal, $invoice->get_currency() ); |
|
89 | 89 | } |
90 | 90 | |
91 | 91 | // Fires when printing a line item column. |
@@ -10,89 +10,89 @@ |
||
10 | 10 | * @var array $columns |
11 | 11 | */ |
12 | 12 | |
13 | -defined( 'ABSPATH' ) || exit; |
|
13 | +defined('ABSPATH') || exit; |
|
14 | 14 | |
15 | -do_action( 'getpaid_before_invoice_line_item', $invoice, $item ); |
|
15 | +do_action('getpaid_before_invoice_line_item', $invoice, $item); |
|
16 | 16 | |
17 | 17 | ?> |
18 | 18 | |
19 | -<div class='getpaid-invoice-item item-<?php echo (int) $item->get_id(); ?> item-type-<?php echo sanitize_html_class( $item->get_type() ); ?> border-bottom'> |
|
19 | +<div class='getpaid-invoice-item item-<?php echo (int) $item->get_id(); ?> item-type-<?php echo sanitize_html_class($item->get_type()); ?> border-bottom'> |
|
20 | 20 | |
21 | 21 | <div class="form-row"> |
22 | 22 | |
23 | - <?php foreach ( array_keys( $columns ) as $column ) : ?> |
|
23 | + <?php foreach (array_keys($columns) as $column) : ?> |
|
24 | 24 | |
25 | - <div class="<?php echo 'name' == $column ? 'col-12 col-sm-6' : 'col-12 col-sm'; ?> getpaid-invoice-item-<?php echo sanitize_html_class( $column ); ?>"> |
|
25 | + <div class="<?php echo 'name' == $column ? 'col-12 col-sm-6' : 'col-12 col-sm'; ?> getpaid-invoice-item-<?php echo sanitize_html_class($column); ?>"> |
|
26 | 26 | |
27 | 27 | <?php |
28 | 28 | |
29 | 29 | // Fires before printing a line item column. |
30 | - do_action( "getpaid_invoice_line_item_before_$column", $item, $invoice ); |
|
30 | + do_action("getpaid_invoice_line_item_before_$column", $item, $invoice); |
|
31 | 31 | |
32 | 32 | // Item name. |
33 | - if ( 'name' == $column ) { |
|
33 | + if ('name' == $column) { |
|
34 | 34 | |
35 | 35 | // Display the name. |
36 | - echo '<div class="mb-1">' . esc_html( $item->get_name() ) . '</div>'; |
|
36 | + echo '<div class="mb-1">' . esc_html($item->get_name()) . '</div>'; |
|
37 | 37 | |
38 | 38 | // And an optional description. |
39 | 39 | $description = $item->get_description(); |
40 | 40 | |
41 | - if ( ! empty( $description ) ) { |
|
42 | - echo "<small class='form-text text-muted pr-2 m-0'>" . wp_kses_post( $description ) . "</small>"; |
|
41 | + if (!empty($description)) { |
|
42 | + echo "<small class='form-text text-muted pr-2 m-0'>" . wp_kses_post($description) . "</small>"; |
|
43 | 43 | } |
44 | 44 | |
45 | 45 | // Fires before printing the line item actions. |
46 | - do_action( 'getpaid_before_invoice_line_item_actions', $item, $invoice ); |
|
46 | + do_action('getpaid_before_invoice_line_item_actions', $item, $invoice); |
|
47 | 47 | |
48 | - $actions = apply_filters( 'getpaid-invoice-page-line-item-actions', array(), $item, $invoice ); |
|
48 | + $actions = apply_filters('getpaid-invoice-page-line-item-actions', array(), $item, $invoice); |
|
49 | 49 | |
50 | - if ( ! empty( $actions ) ) { |
|
50 | + if (!empty($actions)) { |
|
51 | 51 | |
52 | - $sanitized = array(); |
|
53 | - foreach ( $actions as $key => $action ) { |
|
54 | - $key = sanitize_html_class( $key ); |
|
55 | - $action = wp_kses_post( $action ); |
|
52 | + $sanitized = array(); |
|
53 | + foreach ($actions as $key => $action) { |
|
54 | + $key = sanitize_html_class($key); |
|
55 | + $action = wp_kses_post($action); |
|
56 | 56 | $sanitized[] = "<span class='$key'>$action</span>"; |
57 | 57 | } |
58 | 58 | |
59 | 59 | echo "<small class='form-text getpaid-line-item-actions'>"; |
60 | - echo wp_kses_post( implode( ' | ', $sanitized ) ); |
|
60 | + echo wp_kses_post(implode(' | ', $sanitized)); |
|
61 | 61 | echo '</small>'; |
62 | 62 | |
63 | 63 | } |
64 | 64 | } |
65 | 65 | |
66 | 66 | // Item price. |
67 | - if ( 'price' == $column ) { |
|
67 | + if ('price' == $column) { |
|
68 | 68 | |
69 | 69 | // Display the item price (or recurring price if this is a renewal invoice) |
70 | 70 | $price = $invoice->is_renewal() ? $item->get_price() : $item->get_initial_price(); |
71 | - wpinv_the_price( $price, $invoice->get_currency() ); |
|
71 | + wpinv_the_price($price, $invoice->get_currency()); |
|
72 | 72 | |
73 | 73 | } |
74 | 74 | |
75 | 75 | // Tax rate. |
76 | - if ( 'tax_rate' == $column ) { |
|
77 | - echo floatval( round( getpaid_get_invoice_tax_rate( $invoice, $item ), 2 ) ) . '%'; |
|
76 | + if ('tax_rate' == $column) { |
|
77 | + echo floatval(round(getpaid_get_invoice_tax_rate($invoice, $item), 2)) . '%'; |
|
78 | 78 | } |
79 | 79 | |
80 | 80 | // Item quantity. |
81 | - if ( 'quantity' == $column ) { |
|
81 | + if ('quantity' == $column) { |
|
82 | 82 | echo (float) $item->get_quantity(); |
83 | 83 | } |
84 | 84 | |
85 | 85 | // Item sub total. |
86 | - if ( 'subtotal' == $column ) { |
|
86 | + if ('subtotal' == $column) { |
|
87 | 87 | $subtotal = $invoice->is_renewal() ? $item->get_recurring_sub_total() : $item->get_sub_total(); |
88 | - wpinv_the_price( $subtotal, $invoice->get_currency() ); |
|
88 | + wpinv_the_price($subtotal, $invoice->get_currency()); |
|
89 | 89 | } |
90 | 90 | |
91 | 91 | // Fires when printing a line item column. |
92 | - do_action( "getpaid_invoice_line_item_$column", $item, $invoice ); |
|
92 | + do_action("getpaid_invoice_line_item_$column", $item, $invoice); |
|
93 | 93 | |
94 | 94 | // Fires after printing a line item column. |
95 | - do_action( "getpaid_invoice_line_item_after_$column", $item, $invoice ); |
|
95 | + do_action("getpaid_invoice_line_item_after_$column", $item, $invoice); |
|
96 | 96 | |
97 | 97 | ?> |
98 | 98 |
@@ -39,40 +39,40 @@ |
||
39 | 39 | if ( 'tax' == $key ) { |
40 | 40 | wpinv_the_price( $invoice->get_total_tax(), $invoice->get_currency() ); |
41 | 41 | |
42 | - if ( wpinv_use_taxes() && ! $invoice->get_disable_taxes() ) { |
|
42 | + if ( wpinv_use_taxes() && ! $invoice->get_disable_taxes() ) { |
|
43 | 43 | |
44 | - $taxes = $invoice->get_total_tax(); |
|
45 | - if ( empty( $taxes ) && GetPaid_Payment_Form_Submission_Taxes::is_eu_transaction( $invoice->get_country() ) ) { |
|
46 | - echo ' <em class="text-muted small">'; |
|
47 | - _x( '(Reverse charged)', 'This is a legal term for reverse charging tax in the EU', 'invoicing' ); |
|
48 | - echo '</em>'; |
|
44 | + $taxes = $invoice->get_total_tax(); |
|
45 | + if ( empty( $taxes ) && GetPaid_Payment_Form_Submission_Taxes::is_eu_transaction( $invoice->get_country() ) ) { |
|
46 | + echo ' <em class="text-muted small">'; |
|
47 | + _x( '(Reverse charged)', 'This is a legal term for reverse charging tax in the EU', 'invoicing' ); |
|
48 | + echo '</em>'; |
|
49 | 49 | } |
50 | 50 | } |
51 | 51 | } |
52 | 52 | |
53 | 53 | // Total Fee. |
54 | 54 | if ( 'fee' == $key ) { |
55 | - wpinv_the_price( $invoice->get_total_fees(), $invoice->get_currency() ); |
|
55 | + wpinv_the_price( $invoice->get_total_fees(), $invoice->get_currency() ); |
|
56 | 56 | } |
57 | 57 | |
58 | 58 | // Total discount. |
59 | 59 | if ( 'discount' == $key ) { |
60 | - wpinv_the_price( $invoice->get_total_discount(), $invoice->get_currency() ); |
|
60 | + wpinv_the_price( $invoice->get_total_discount(), $invoice->get_currency() ); |
|
61 | 61 | } |
62 | 62 | |
63 | 63 | // Shipping. |
64 | 64 | if ( 'shipping' == $key ) { |
65 | - wpinv_the_price( $invoice->get_shipping(), $invoice->get_currency() ); |
|
65 | + wpinv_the_price( $invoice->get_shipping(), $invoice->get_currency() ); |
|
66 | 66 | } |
67 | 67 | |
68 | 68 | // Sub total. |
69 | 69 | if ( 'subtotal' == $key ) { |
70 | - wpinv_the_price( $invoice->get_subtotal(), $invoice->get_currency() ); |
|
70 | + wpinv_the_price( $invoice->get_subtotal(), $invoice->get_currency() ); |
|
71 | 71 | } |
72 | 72 | |
73 | 73 | // Total. |
74 | 74 | if ( 'total' == $key ) { |
75 | - wpinv_the_price( $invoice->get_total(), $invoice->get_currency() ); |
|
75 | + wpinv_the_price( $invoice->get_total(), $invoice->get_currency() ); |
|
76 | 76 | } |
77 | 77 | |
78 | 78 | // Fires when printing a cart total. |
@@ -9,26 +9,26 @@ discard block |
||
9 | 9 | * @var WPInv_Invoice $invoice |
10 | 10 | */ |
11 | 11 | |
12 | -defined( 'ABSPATH' ) || exit; |
|
12 | +defined('ABSPATH') || exit; |
|
13 | 13 | |
14 | 14 | // Totals rows. |
15 | -$totals = getpaid_invoice_totals_rows( $invoice ); |
|
15 | +$totals = getpaid_invoice_totals_rows($invoice); |
|
16 | 16 | |
17 | -do_action( 'getpaid_before_invoice_line_totals', $invoice, $totals ); |
|
17 | +do_action('getpaid_before_invoice_line_totals', $invoice, $totals); |
|
18 | 18 | |
19 | 19 | ?> |
20 | 20 | <div class='getpaid-invoice-line-totals'> |
21 | 21 | <div class="row"> |
22 | 22 | <div class="col-12 offset-sm-6 col-sm-6 border-sm-left pl-sm-0"> |
23 | 23 | |
24 | - <?php foreach ( $totals as $key => $label ) : ?> |
|
24 | + <?php foreach ($totals as $key => $label) : ?> |
|
25 | 25 | |
26 | - <div class="getpaid-invoice-line-totals-col <?php echo sanitize_html_class( $key ); ?>"> |
|
26 | + <div class="getpaid-invoice-line-totals-col <?php echo sanitize_html_class($key); ?>"> |
|
27 | 27 | |
28 | 28 | <div class="form-row"> |
29 | 29 | |
30 | 30 | <div class="col-8 getpaid-invoice-line-totals-label"> |
31 | - <?php echo esc_html( $label ); ?> |
|
31 | + <?php echo esc_html($label); ?> |
|
32 | 32 | </div> |
33 | 33 | |
34 | 34 | <div class="col-4 getpaid-invoice-line-totals-value pl-0"> |
@@ -36,47 +36,47 @@ discard block |
||
36 | 36 | <?php |
37 | 37 | |
38 | 38 | // Total tax. |
39 | - if ( 'tax' == $key ) { |
|
40 | - wpinv_the_price( $invoice->get_total_tax(), $invoice->get_currency() ); |
|
39 | + if ('tax' == $key) { |
|
40 | + wpinv_the_price($invoice->get_total_tax(), $invoice->get_currency()); |
|
41 | 41 | |
42 | - if ( wpinv_use_taxes() && ! $invoice->get_disable_taxes() ) { |
|
42 | + if (wpinv_use_taxes() && !$invoice->get_disable_taxes()) { |
|
43 | 43 | |
44 | 44 | $taxes = $invoice->get_total_tax(); |
45 | - if ( empty( $taxes ) && GetPaid_Payment_Form_Submission_Taxes::is_eu_transaction( $invoice->get_country() ) ) { |
|
45 | + if (empty($taxes) && GetPaid_Payment_Form_Submission_Taxes::is_eu_transaction($invoice->get_country())) { |
|
46 | 46 | echo ' <em class="text-muted small">'; |
47 | - _x( '(Reverse charged)', 'This is a legal term for reverse charging tax in the EU', 'invoicing' ); |
|
47 | + _x('(Reverse charged)', 'This is a legal term for reverse charging tax in the EU', 'invoicing'); |
|
48 | 48 | echo '</em>'; |
49 | 49 | } |
50 | 50 | } |
51 | 51 | } |
52 | 52 | |
53 | 53 | // Total Fee. |
54 | - if ( 'fee' == $key ) { |
|
55 | - wpinv_the_price( $invoice->get_total_fees(), $invoice->get_currency() ); |
|
54 | + if ('fee' == $key) { |
|
55 | + wpinv_the_price($invoice->get_total_fees(), $invoice->get_currency()); |
|
56 | 56 | } |
57 | 57 | |
58 | 58 | // Total discount. |
59 | - if ( 'discount' == $key ) { |
|
60 | - wpinv_the_price( $invoice->get_total_discount(), $invoice->get_currency() ); |
|
59 | + if ('discount' == $key) { |
|
60 | + wpinv_the_price($invoice->get_total_discount(), $invoice->get_currency()); |
|
61 | 61 | } |
62 | 62 | |
63 | 63 | // Shipping. |
64 | - if ( 'shipping' == $key ) { |
|
65 | - wpinv_the_price( $invoice->get_shipping(), $invoice->get_currency() ); |
|
64 | + if ('shipping' == $key) { |
|
65 | + wpinv_the_price($invoice->get_shipping(), $invoice->get_currency()); |
|
66 | 66 | } |
67 | 67 | |
68 | 68 | // Sub total. |
69 | - if ( 'subtotal' == $key ) { |
|
70 | - wpinv_the_price( $invoice->get_subtotal(), $invoice->get_currency() ); |
|
69 | + if ('subtotal' == $key) { |
|
70 | + wpinv_the_price($invoice->get_subtotal(), $invoice->get_currency()); |
|
71 | 71 | } |
72 | 72 | |
73 | 73 | // Total. |
74 | - if ( 'total' == $key ) { |
|
75 | - wpinv_the_price( $invoice->get_total(), $invoice->get_currency() ); |
|
74 | + if ('total' == $key) { |
|
75 | + wpinv_the_price($invoice->get_total(), $invoice->get_currency()); |
|
76 | 76 | } |
77 | 77 | |
78 | 78 | // Fires when printing a cart total. |
79 | - do_action( "getpaid_invoice_cart_totals_$key", $invoice ); |
|
79 | + do_action("getpaid_invoice_cart_totals_$key", $invoice); |
|
80 | 80 | |
81 | 81 | ?> |
82 | 82 | |
@@ -90,4 +90,4 @@ discard block |
||
90 | 90 | </div> |
91 | 91 | </div> <!-- end .getpaid-invoice-line-totals --> |
92 | 92 | |
93 | -<?php do_action( 'getpaid_after_invoice_line_totals', $invoice, $totals ); ?> |
|
93 | +<?php do_action('getpaid_after_invoice_line_totals', $invoice, $totals); ?> |
@@ -31,21 +31,21 @@ discard block |
||
31 | 31 | // Item name. |
32 | 32 | if ( 'name' == $column ) { |
33 | 33 | |
34 | - // Display the name. |
|
35 | - echo '<div class="mb-1">' . esc_html( $fee['name'] ) . '</div>'; |
|
34 | + // Display the name. |
|
35 | + echo '<div class="mb-1">' . esc_html( $fee['name'] ) . '</div>'; |
|
36 | 36 | |
37 | - // And an optional description. |
|
38 | - $description = empty( $fee['description'] ) ? esc_html__( 'Fee', 'invoicing' ) : esc_html( $fee['description'] ); |
|
39 | - echo wp_kses_post( "<small class='form-text text-muted pr-2 m-0'>$description</small>" ); |
|
37 | + // And an optional description. |
|
38 | + $description = empty( $fee['description'] ) ? esc_html__( 'Fee', 'invoicing' ) : esc_html( $fee['description'] ); |
|
39 | + echo wp_kses_post( "<small class='form-text text-muted pr-2 m-0'>$description</small>" ); |
|
40 | 40 | |
41 | 41 | } |
42 | 42 | |
43 | 43 | // Item price. |
44 | 44 | if ( 'price' == $column ) { |
45 | 45 | |
46 | - // Display the item price (or recurring price if this is a renewal invoice) |
|
47 | - if ( $invoice->is_recurring() && $invoice->is_renewal() ) { |
|
48 | - wpinv_the_price( $fee['recurring_fee'], $invoice->get_currency() ); |
|
46 | + // Display the item price (or recurring price if this is a renewal invoice) |
|
47 | + if ( $invoice->is_recurring() && $invoice->is_renewal() ) { |
|
48 | + wpinv_the_price( $fee['recurring_fee'], $invoice->get_currency() ); |
|
49 | 49 | } else { |
50 | 50 | wpinv_the_price( $fee['initial_fee'], $invoice->get_currency() ); |
51 | 51 | } |
@@ -53,20 +53,20 @@ discard block |
||
53 | 53 | |
54 | 54 | // Item quantity. |
55 | 55 | if ( 'quantity' == $column ) { |
56 | - echo '—'; |
|
56 | + echo '—'; |
|
57 | 57 | } |
58 | 58 | |
59 | 59 | // Item tax. |
60 | 60 | if ( 'tax_rate' == $column ) { |
61 | - echo '—'; |
|
61 | + echo '—'; |
|
62 | 62 | } |
63 | 63 | |
64 | 64 | // Item sub total. |
65 | 65 | if ( 'subtotal' == $column ) { |
66 | 66 | |
67 | - // Display the item price (or recurring price if this is a renewal invoice) |
|
68 | - if ( $invoice->is_recurring() && $invoice->is_renewal() ) { |
|
69 | - wpinv_the_price( $fee['recurring_fee'], $invoice->get_currency() ); |
|
67 | + // Display the item price (or recurring price if this is a renewal invoice) |
|
68 | + if ( $invoice->is_recurring() && $invoice->is_renewal() ) { |
|
69 | + wpinv_the_price( $fee['recurring_fee'], $invoice->get_currency() ); |
|
70 | 70 | } else { |
71 | 71 | wpinv_the_price( $fee['initial_fee'], $invoice->get_currency() ); |
72 | 72 | } |
@@ -9,9 +9,9 @@ discard block |
||
9 | 9 | * @var array $fee |
10 | 10 | */ |
11 | 11 | |
12 | -defined( 'ABSPATH' ) || exit; |
|
12 | +defined('ABSPATH') || exit; |
|
13 | 13 | |
14 | -do_action( 'getpaid_before_invoice_fee_item', $invoice, $fee ); |
|
14 | +do_action('getpaid_before_invoice_fee_item', $invoice, $fee); |
|
15 | 15 | |
16 | 16 | ?> |
17 | 17 | |
@@ -19,64 +19,64 @@ discard block |
||
19 | 19 | |
20 | 20 | <div class="form-row"> |
21 | 21 | |
22 | - <?php foreach ( array_keys( $columns ) as $column ) : ?> |
|
22 | + <?php foreach (array_keys($columns) as $column) : ?> |
|
23 | 23 | |
24 | - <div class="<?php echo 'name' == $column ? 'col-12 col-sm-6' : 'col-12 col-sm'; ?> getpaid-invoice-item-<?php echo sanitize_html_class( $column ); ?>"> |
|
24 | + <div class="<?php echo 'name' == $column ? 'col-12 col-sm-6' : 'col-12 col-sm'; ?> getpaid-invoice-item-<?php echo sanitize_html_class($column); ?>"> |
|
25 | 25 | |
26 | 26 | <?php |
27 | 27 | |
28 | 28 | // Fires before printing a fee item column. |
29 | - do_action( "getpaid_invoice_fee_item_before_$column", $fee, $invoice ); |
|
29 | + do_action("getpaid_invoice_fee_item_before_$column", $fee, $invoice); |
|
30 | 30 | |
31 | 31 | // Item name. |
32 | - if ( 'name' == $column ) { |
|
32 | + if ('name' == $column) { |
|
33 | 33 | |
34 | 34 | // Display the name. |
35 | - echo '<div class="mb-1">' . esc_html( $fee['name'] ) . '</div>'; |
|
35 | + echo '<div class="mb-1">' . esc_html($fee['name']) . '</div>'; |
|
36 | 36 | |
37 | 37 | // And an optional description. |
38 | - $description = empty( $fee['description'] ) ? esc_html__( 'Fee', 'invoicing' ) : esc_html( $fee['description'] ); |
|
39 | - echo wp_kses_post( "<small class='form-text text-muted pr-2 m-0'>$description</small>" ); |
|
38 | + $description = empty($fee['description']) ? esc_html__('Fee', 'invoicing') : esc_html($fee['description']); |
|
39 | + echo wp_kses_post("<small class='form-text text-muted pr-2 m-0'>$description</small>"); |
|
40 | 40 | |
41 | 41 | } |
42 | 42 | |
43 | 43 | // Item price. |
44 | - if ( 'price' == $column ) { |
|
44 | + if ('price' == $column) { |
|
45 | 45 | |
46 | 46 | // Display the item price (or recurring price if this is a renewal invoice) |
47 | - if ( $invoice->is_recurring() && $invoice->is_renewal() ) { |
|
48 | - wpinv_the_price( $fee['recurring_fee'], $invoice->get_currency() ); |
|
47 | + if ($invoice->is_recurring() && $invoice->is_renewal()) { |
|
48 | + wpinv_the_price($fee['recurring_fee'], $invoice->get_currency()); |
|
49 | 49 | } else { |
50 | - wpinv_the_price( $fee['initial_fee'], $invoice->get_currency() ); |
|
50 | + wpinv_the_price($fee['initial_fee'], $invoice->get_currency()); |
|
51 | 51 | } |
52 | 52 | } |
53 | 53 | |
54 | 54 | // Item quantity. |
55 | - if ( 'quantity' == $column ) { |
|
55 | + if ('quantity' == $column) { |
|
56 | 56 | echo '—'; |
57 | 57 | } |
58 | 58 | |
59 | 59 | // Item tax. |
60 | - if ( 'tax_rate' == $column ) { |
|
60 | + if ('tax_rate' == $column) { |
|
61 | 61 | echo '—'; |
62 | 62 | } |
63 | 63 | |
64 | 64 | // Item sub total. |
65 | - if ( 'subtotal' == $column ) { |
|
65 | + if ('subtotal' == $column) { |
|
66 | 66 | |
67 | 67 | // Display the item price (or recurring price if this is a renewal invoice) |
68 | - if ( $invoice->is_recurring() && $invoice->is_renewal() ) { |
|
69 | - wpinv_the_price( $fee['recurring_fee'], $invoice->get_currency() ); |
|
68 | + if ($invoice->is_recurring() && $invoice->is_renewal()) { |
|
69 | + wpinv_the_price($fee['recurring_fee'], $invoice->get_currency()); |
|
70 | 70 | } else { |
71 | - wpinv_the_price( $fee['initial_fee'], $invoice->get_currency() ); |
|
71 | + wpinv_the_price($fee['initial_fee'], $invoice->get_currency()); |
|
72 | 72 | } |
73 | 73 | } |
74 | 74 | |
75 | 75 | // Fires when printing a fee item column. |
76 | - do_action( "getpaid_invoice_fee_item_$column", $fee, $invoice ); |
|
76 | + do_action("getpaid_invoice_fee_item_$column", $fee, $invoice); |
|
77 | 77 | |
78 | 78 | // Fires after printing a fee item column. |
79 | - do_action( "getpaid_invoice_fee_item_after_$column", $fee, $invoice ); |
|
79 | + do_action("getpaid_invoice_fee_item_after_$column", $fee, $invoice); |
|
80 | 80 | |
81 | 81 | ?> |
82 | 82 |
@@ -7,17 +7,17 @@ discard block |
||
7 | 7 | * @version 1.0.19 |
8 | 8 | */ |
9 | 9 | |
10 | -defined( 'ABSPATH' ) || exit; |
|
10 | +defined('ABSPATH') || exit; |
|
11 | 11 | |
12 | 12 | // Prepare the company name. |
13 | -$company_name = wpinv_get_option( 'vat_company_name' ); |
|
13 | +$company_name = wpinv_get_option('vat_company_name'); |
|
14 | 14 | |
15 | -if ( empty( $company_name ) ) { |
|
15 | +if (empty($company_name)) { |
|
16 | 16 | $company_name = wpinv_get_business_name(); |
17 | 17 | } |
18 | 18 | |
19 | 19 | // Prepare the VAT number. |
20 | -$vat_number = wpinv_get_option( 'vat_number' ); |
|
20 | +$vat_number = wpinv_get_option('vat_number'); |
|
21 | 21 | |
22 | 22 | ?> |
23 | 23 | <div class="getpaid-company-address form-group"> |
@@ -25,36 +25,36 @@ discard block |
||
25 | 25 | <div class="row"> |
26 | 26 | |
27 | 27 | <div class="invoice-company-address-label col-2"> |
28 | - <strong><?php esc_html_e( 'From:', 'invoicing' ); ?></strong> |
|
28 | + <strong><?php esc_html_e('From:', 'invoicing'); ?></strong> |
|
29 | 29 | </div> |
30 | 30 | |
31 | 31 | <div class="invoice-company-address-value col-10"> |
32 | 32 | |
33 | - <?php do_action( 'getpaid_company_address_top' ); ?> |
|
33 | + <?php do_action('getpaid_company_address_top'); ?> |
|
34 | 34 | |
35 | 35 | <div class="name"> |
36 | - <a target="_blank" class="text-dark" href="<?php echo esc_url( wpinv_get_business_website() ); ?>"> |
|
37 | - <?php echo esc_html( $company_name ); ?> |
|
36 | + <a target="_blank" class="text-dark" href="<?php echo esc_url(wpinv_get_business_website()); ?>"> |
|
37 | + <?php echo esc_html($company_name); ?> |
|
38 | 38 | </a> |
39 | 39 | </div> |
40 | 40 | |
41 | - <?php if ( $address = wpinv_get_business_address() ) { ?> |
|
42 | - <?php echo wp_kses_post( $address ); ?> |
|
41 | + <?php if ($address = wpinv_get_business_address()) { ?> |
|
42 | + <?php echo wp_kses_post($address); ?> |
|
43 | 43 | <?php } ?> |
44 | 44 | |
45 | - <?php if ( $email_from = wpinv_mail_get_from_address() ) { ?> |
|
45 | + <?php if ($email_from = wpinv_mail_get_from_address()) { ?> |
|
46 | 46 | <div class="email_from"> |
47 | - <?php echo wp_sprintf( esc_html__( 'Email: %s', 'invoicing' ), esc_html( $email_from ) ); ?> |
|
47 | + <?php echo wp_sprintf(esc_html__('Email: %s', 'invoicing'), esc_html($email_from)); ?> |
|
48 | 48 | </div> |
49 | 49 | <?php } ?> |
50 | 50 | |
51 | - <?php if ( ! empty( $vat_number ) ) { ?> |
|
51 | + <?php if (!empty($vat_number)) { ?> |
|
52 | 52 | <div class="email_from"> |
53 | - <?php echo wp_sprintf( esc_html__( 'VAT Number: %s', 'invoicing' ), esc_html( $vat_number ) ); ?> |
|
53 | + <?php echo wp_sprintf(esc_html__('VAT Number: %s', 'invoicing'), esc_html($vat_number)); ?> |
|
54 | 54 | </div> |
55 | 55 | <?php } ?> |
56 | 56 | |
57 | - <?php do_action( 'getpaid_company_address_bottom' ); ?> |
|
57 | + <?php do_action('getpaid_company_address_bottom'); ?> |
|
58 | 58 | |
59 | 59 | </div> |
60 | 60 |
@@ -42,92 +42,92 @@ discard block |
||
42 | 42 | <tr class="wpinv-item wpinv-item-<?php echo sanitize_html_class( $invoice->get_status() ); ?>"> |
43 | 43 | <?php |
44 | 44 | |
45 | - foreach ( wpinv_get_user_invoices_columns( $post_type ) as $column_id => $column_name ) : |
|
45 | + foreach ( wpinv_get_user_invoices_columns( $post_type ) as $column_id => $column_name ) : |
|
46 | 46 | |
47 | - $column_id = sanitize_html_class( $column_id ); |
|
48 | - $class = empty( $column_name['class'] ) ? '' : sanitize_html_class( $column_name['class'] ); |
|
47 | + $column_id = sanitize_html_class( $column_id ); |
|
48 | + $class = empty( $column_name['class'] ) ? '' : sanitize_html_class( $column_name['class'] ); |
|
49 | 49 | |
50 | - echo "<td class='" . esc_attr( $column_id . $class ) . "'>"; |
|
51 | - switch ( $column_id ) { |
|
50 | + echo "<td class='" . esc_attr( $column_id . $class ) . "'>"; |
|
51 | + switch ( $column_id ) { |
|
52 | 52 | |
53 | - case 'invoice-number': |
|
54 | - echo wp_kses_post( wpinv_invoice_link( $invoice ) ); |
|
55 | - break; |
|
53 | + case 'invoice-number': |
|
54 | + echo wp_kses_post( wpinv_invoice_link( $invoice ) ); |
|
55 | + break; |
|
56 | 56 | |
57 | - case 'created-date': |
|
58 | - echo esc_html( getpaid_format_date_value( $invoice->get_date_created() ) ); |
|
59 | - break; |
|
57 | + case 'created-date': |
|
58 | + echo esc_html( getpaid_format_date_value( $invoice->get_date_created() ) ); |
|
59 | + break; |
|
60 | 60 | |
61 | - case 'payment-date': |
|
62 | - if ( $invoice->needs_payment() ) { |
|
63 | - echo '—'; |
|
64 | - } else { |
|
65 | - echo esc_html( getpaid_format_date_value( $invoice->get_date_completed() ) ); |
|
66 | - } |
|
61 | + case 'payment-date': |
|
62 | + if ( $invoice->needs_payment() ) { |
|
63 | + echo '—'; |
|
64 | + } else { |
|
65 | + echo esc_html( getpaid_format_date_value( $invoice->get_date_completed() ) ); |
|
66 | + } |
|
67 | 67 | |
68 | - break; |
|
68 | + break; |
|
69 | 69 | |
70 | - case 'invoice-status': |
|
71 | - echo wp_kses_post( $invoice->get_status_label_html() ); |
|
70 | + case 'invoice-status': |
|
71 | + echo wp_kses_post( $invoice->get_status_label_html() ); |
|
72 | 72 | |
73 | - break; |
|
73 | + break; |
|
74 | 74 | |
75 | - case 'invoice-total': |
|
76 | - wpinv_the_price( $invoice->get_total(), $invoice->get_currency() ); |
|
75 | + case 'invoice-total': |
|
76 | + wpinv_the_price( $invoice->get_total(), $invoice->get_currency() ); |
|
77 | 77 | |
78 | - break; |
|
78 | + break; |
|
79 | 79 | |
80 | - case 'invoice-actions': |
|
81 | - $actions = array( |
|
80 | + case 'invoice-actions': |
|
81 | + $actions = array( |
|
82 | 82 | |
83 | - 'pay' => array( |
|
84 | - 'url' => $invoice->get_checkout_payment_url(), |
|
85 | - 'name' => __( 'Pay Now', 'invoicing' ), |
|
86 | - 'class' => 'btn-success', |
|
87 | - ), |
|
83 | + 'pay' => array( |
|
84 | + 'url' => $invoice->get_checkout_payment_url(), |
|
85 | + 'name' => __( 'Pay Now', 'invoicing' ), |
|
86 | + 'class' => 'btn-success', |
|
87 | + ), |
|
88 | 88 | |
89 | - 'print' => array( |
|
90 | - 'url' => $invoice->get_view_url(), |
|
91 | - 'name' => __( 'View', 'invoicing' ), |
|
92 | - 'class' => 'btn-secondary', |
|
93 | - 'attrs' => 'target="_blank"', |
|
94 | - ), |
|
95 | - ); |
|
89 | + 'print' => array( |
|
90 | + 'url' => $invoice->get_view_url(), |
|
91 | + 'name' => __( 'View', 'invoicing' ), |
|
92 | + 'class' => 'btn-secondary', |
|
93 | + 'attrs' => 'target="_blank"', |
|
94 | + ), |
|
95 | + ); |
|
96 | 96 | |
97 | - if ( ! $invoice->needs_payment() ) { |
|
98 | - unset( $actions['pay'] ); |
|
99 | - } |
|
97 | + if ( ! $invoice->needs_payment() ) { |
|
98 | + unset( $actions['pay'] ); |
|
99 | + } |
|
100 | 100 | |
101 | - if ( $invoice->needs_payment() ) { |
|
102 | - $actions['delete'] = array( |
|
103 | - 'url' => getpaid_get_authenticated_action_url( 'delete_invoice', add_query_arg( 'invoice_id', $invoice->get_id() ) ), |
|
104 | - 'name' => __( 'Delete', 'invoicing' ), |
|
105 | - 'class' => 'btn-danger', |
|
106 | - ); |
|
107 | - } |
|
101 | + if ( $invoice->needs_payment() ) { |
|
102 | + $actions['delete'] = array( |
|
103 | + 'url' => getpaid_get_authenticated_action_url( 'delete_invoice', add_query_arg( 'invoice_id', $invoice->get_id() ) ), |
|
104 | + 'name' => __( 'Delete', 'invoicing' ), |
|
105 | + 'class' => 'btn-danger', |
|
106 | + ); |
|
107 | + } |
|
108 | 108 | |
109 | - $actions = apply_filters( 'wpinv_user_invoices_actions', $actions, $invoice, $post_type ); |
|
109 | + $actions = apply_filters( 'wpinv_user_invoices_actions', $actions, $invoice, $post_type ); |
|
110 | 110 | |
111 | - foreach ( $actions as $key => $action ) { |
|
112 | - $class = ! empty( $action['class'] ) ? sanitize_html_class( $action['class'] ) : ''; |
|
113 | - echo '<a href="' . esc_url( $action['url'] ) . '" class="btn btn-sm btn-block ' . esc_attr( $class . ' ' . sanitize_html_class( $key ) ) . '" ' . ( ! empty( $action['attrs'] ) ? esc_html( $action['attrs'] ) : '' ) . '>' . esc_attr( $action['name'] ) . '</a>'; |
|
114 | - } |
|
111 | + foreach ( $actions as $key => $action ) { |
|
112 | + $class = ! empty( $action['class'] ) ? sanitize_html_class( $action['class'] ) : ''; |
|
113 | + echo '<a href="' . esc_url( $action['url'] ) . '" class="btn btn-sm btn-block ' . esc_attr( $class . ' ' . sanitize_html_class( $key ) ) . '" ' . ( ! empty( $action['attrs'] ) ? esc_html( $action['attrs'] ) : '' ) . '>' . esc_attr( $action['name'] ) . '</a>'; |
|
114 | + } |
|
115 | 115 | |
116 | - break; |
|
116 | + break; |
|
117 | 117 | |
118 | - default: |
|
119 | - do_action( "wpinv_user_invoices_column_$column_id", $invoice ); |
|
120 | - break; |
|
118 | + default: |
|
119 | + do_action( "wpinv_user_invoices_column_$column_id", $invoice ); |
|
120 | + break; |
|
121 | 121 | |
122 | 122 | |
123 | - } |
|
123 | + } |
|
124 | 124 | |
125 | - do_action( "wpinv_user_invoices_column_after_$column_id", $invoice ); |
|
125 | + do_action( "wpinv_user_invoices_column_after_$column_id", $invoice ); |
|
126 | 126 | |
127 | - echo '</td>'; |
|
127 | + echo '</td>'; |
|
128 | 128 | |
129 | - endforeach; |
|
130 | - ?> |
|
129 | + endforeach; |
|
130 | + ?> |
|
131 | 131 | </tr> |
132 | 132 | |
133 | 133 | <?php endforeach; ?> |
@@ -141,18 +141,18 @@ discard block |
||
141 | 141 | <?php if ( 1 < $invoices->max_num_pages ) : ?> |
142 | 142 | <div class="invoicing-Pagination"> |
143 | 143 | <?php |
144 | - $big = 999999; |
|
145 | - |
|
146 | - echo wp_kses_post( |
|
147 | - paginate_links( |
|
148 | - array( |
|
149 | - 'base' => str_replace( $big, '%#%', esc_url( get_pagenum_link( $big ) ) ), |
|
150 | - 'format' => '?paged=%#%', |
|
151 | - 'total' => $invoices->max_num_pages, |
|
152 | - ) |
|
153 | - ) |
|
144 | + $big = 999999; |
|
145 | + |
|
146 | + echo wp_kses_post( |
|
147 | + paginate_links( |
|
148 | + array( |
|
149 | + 'base' => str_replace( $big, '%#%', esc_url( get_pagenum_link( $big ) ) ), |
|
150 | + 'format' => '?paged=%#%', |
|
151 | + 'total' => $invoices->max_num_pages, |
|
152 | + ) |
|
153 | + ) |
|
154 | 154 | ); |
155 | - ?> |
|
155 | + ?> |
|
156 | 156 | </div> |
157 | 157 | <?php endif; ?> |
158 | 158 |
@@ -7,27 +7,27 @@ discard block |
||
7 | 7 | * @version 1.0.19 |
8 | 8 | */ |
9 | 9 | |
10 | -defined( 'ABSPATH' ) || exit; |
|
10 | +defined('ABSPATH') || exit; |
|
11 | 11 | |
12 | 12 | // Current page. |
13 | -$current_page = empty( $_GET['page'] ) ? 1 : absint( $_GET['page'] ); |
|
13 | +$current_page = empty($_GET['page']) ? 1 : absint($_GET['page']); |
|
14 | 14 | |
15 | 15 | // Fires before displaying user invoices. |
16 | -do_action( 'wpinv_before_user_invoices', $invoices->invoices, $invoices->total, $invoices->max_num_pages, $post_type ); |
|
16 | +do_action('wpinv_before_user_invoices', $invoices->invoices, $invoices->total, $invoices->max_num_pages, $post_type); |
|
17 | 17 | |
18 | 18 | ?> |
19 | 19 | |
20 | 20 | |
21 | 21 | <div class="table-responsive"> |
22 | - <table class="table table-bordered table-hover getpaid-user-invoices <?php echo sanitize_html_class( $post_type ); ?>"> |
|
22 | + <table class="table table-bordered table-hover getpaid-user-invoices <?php echo sanitize_html_class($post_type); ?>"> |
|
23 | 23 | |
24 | 24 | |
25 | 25 | <thead> |
26 | 26 | <tr> |
27 | 27 | |
28 | - <?php foreach ( wpinv_get_user_invoices_columns( $post_type ) as $column_id => $column_name ) : ?> |
|
29 | - <th class="<?php echo sanitize_html_class( $column_id ); ?> <?php echo ( ! empty( $column_name['class'] ) ? sanitize_html_class( $column_name['class'] ) : ''); ?> border-bottom-0"> |
|
30 | - <span class="nobr"><?php echo esc_html( $column_name['title'] ); ?></span> |
|
28 | + <?php foreach (wpinv_get_user_invoices_columns($post_type) as $column_id => $column_name) : ?> |
|
29 | + <th class="<?php echo sanitize_html_class($column_id); ?> <?php echo (!empty($column_name['class']) ? sanitize_html_class($column_name['class']) : ''); ?> border-bottom-0"> |
|
30 | + <span class="nobr"><?php echo esc_html($column_name['title']); ?></span> |
|
31 | 31 | </th> |
32 | 32 | <?php endforeach; ?> |
33 | 33 | |
@@ -37,43 +37,43 @@ discard block |
||
37 | 37 | |
38 | 38 | |
39 | 39 | <tbody> |
40 | - <?php foreach ( $invoices->invoices as $invoice ) : ?> |
|
40 | + <?php foreach ($invoices->invoices as $invoice) : ?> |
|
41 | 41 | |
42 | - <tr class="wpinv-item wpinv-item-<?php echo sanitize_html_class( $invoice->get_status() ); ?>"> |
|
42 | + <tr class="wpinv-item wpinv-item-<?php echo sanitize_html_class($invoice->get_status()); ?>"> |
|
43 | 43 | <?php |
44 | 44 | |
45 | - foreach ( wpinv_get_user_invoices_columns( $post_type ) as $column_id => $column_name ) : |
|
45 | + foreach (wpinv_get_user_invoices_columns($post_type) as $column_id => $column_name) : |
|
46 | 46 | |
47 | - $column_id = sanitize_html_class( $column_id ); |
|
48 | - $class = empty( $column_name['class'] ) ? '' : sanitize_html_class( $column_name['class'] ); |
|
47 | + $column_id = sanitize_html_class($column_id); |
|
48 | + $class = empty($column_name['class']) ? '' : sanitize_html_class($column_name['class']); |
|
49 | 49 | |
50 | - echo "<td class='" . esc_attr( $column_id . $class ) . "'>"; |
|
51 | - switch ( $column_id ) { |
|
50 | + echo "<td class='" . esc_attr($column_id . $class) . "'>"; |
|
51 | + switch ($column_id) { |
|
52 | 52 | |
53 | 53 | case 'invoice-number': |
54 | - echo wp_kses_post( wpinv_invoice_link( $invoice ) ); |
|
54 | + echo wp_kses_post(wpinv_invoice_link($invoice)); |
|
55 | 55 | break; |
56 | 56 | |
57 | 57 | case 'created-date': |
58 | - echo esc_html( getpaid_format_date_value( $invoice->get_date_created() ) ); |
|
58 | + echo esc_html(getpaid_format_date_value($invoice->get_date_created())); |
|
59 | 59 | break; |
60 | 60 | |
61 | 61 | case 'payment-date': |
62 | - if ( $invoice->needs_payment() ) { |
|
62 | + if ($invoice->needs_payment()) { |
|
63 | 63 | echo '—'; |
64 | 64 | } else { |
65 | - echo esc_html( getpaid_format_date_value( $invoice->get_date_completed() ) ); |
|
65 | + echo esc_html(getpaid_format_date_value($invoice->get_date_completed())); |
|
66 | 66 | } |
67 | 67 | |
68 | 68 | break; |
69 | 69 | |
70 | 70 | case 'invoice-status': |
71 | - echo wp_kses_post( $invoice->get_status_label_html() ); |
|
71 | + echo wp_kses_post($invoice->get_status_label_html()); |
|
72 | 72 | |
73 | 73 | break; |
74 | 74 | |
75 | 75 | case 'invoice-total': |
76 | - wpinv_the_price( $invoice->get_total(), $invoice->get_currency() ); |
|
76 | + wpinv_the_price($invoice->get_total(), $invoice->get_currency()); |
|
77 | 77 | |
78 | 78 | break; |
79 | 79 | |
@@ -82,47 +82,47 @@ discard block |
||
82 | 82 | |
83 | 83 | 'pay' => array( |
84 | 84 | 'url' => $invoice->get_checkout_payment_url(), |
85 | - 'name' => __( 'Pay Now', 'invoicing' ), |
|
85 | + 'name' => __('Pay Now', 'invoicing'), |
|
86 | 86 | 'class' => 'btn-success', |
87 | 87 | ), |
88 | 88 | |
89 | 89 | 'print' => array( |
90 | 90 | 'url' => $invoice->get_view_url(), |
91 | - 'name' => __( 'View', 'invoicing' ), |
|
91 | + 'name' => __('View', 'invoicing'), |
|
92 | 92 | 'class' => 'btn-secondary', |
93 | 93 | 'attrs' => 'target="_blank"', |
94 | 94 | ), |
95 | 95 | ); |
96 | 96 | |
97 | - if ( ! $invoice->needs_payment() ) { |
|
98 | - unset( $actions['pay'] ); |
|
97 | + if (!$invoice->needs_payment()) { |
|
98 | + unset($actions['pay']); |
|
99 | 99 | } |
100 | 100 | |
101 | - if ( $invoice->needs_payment() ) { |
|
101 | + if ($invoice->needs_payment()) { |
|
102 | 102 | $actions['delete'] = array( |
103 | - 'url' => getpaid_get_authenticated_action_url( 'delete_invoice', add_query_arg( 'invoice_id', $invoice->get_id() ) ), |
|
104 | - 'name' => __( 'Delete', 'invoicing' ), |
|
103 | + 'url' => getpaid_get_authenticated_action_url('delete_invoice', add_query_arg('invoice_id', $invoice->get_id())), |
|
104 | + 'name' => __('Delete', 'invoicing'), |
|
105 | 105 | 'class' => 'btn-danger', |
106 | 106 | ); |
107 | 107 | } |
108 | 108 | |
109 | - $actions = apply_filters( 'wpinv_user_invoices_actions', $actions, $invoice, $post_type ); |
|
109 | + $actions = apply_filters('wpinv_user_invoices_actions', $actions, $invoice, $post_type); |
|
110 | 110 | |
111 | - foreach ( $actions as $key => $action ) { |
|
112 | - $class = ! empty( $action['class'] ) ? sanitize_html_class( $action['class'] ) : ''; |
|
113 | - echo '<a href="' . esc_url( $action['url'] ) . '" class="btn btn-sm btn-block ' . esc_attr( $class . ' ' . sanitize_html_class( $key ) ) . '" ' . ( ! empty( $action['attrs'] ) ? esc_html( $action['attrs'] ) : '' ) . '>' . esc_attr( $action['name'] ) . '</a>'; |
|
111 | + foreach ($actions as $key => $action) { |
|
112 | + $class = !empty($action['class']) ? sanitize_html_class($action['class']) : ''; |
|
113 | + echo '<a href="' . esc_url($action['url']) . '" class="btn btn-sm btn-block ' . esc_attr($class . ' ' . sanitize_html_class($key)) . '" ' . (!empty($action['attrs']) ? esc_html($action['attrs']) : '') . '>' . esc_attr($action['name']) . '</a>'; |
|
114 | 114 | } |
115 | 115 | |
116 | 116 | break; |
117 | 117 | |
118 | 118 | default: |
119 | - do_action( "wpinv_user_invoices_column_$column_id", $invoice ); |
|
119 | + do_action("wpinv_user_invoices_column_$column_id", $invoice); |
|
120 | 120 | break; |
121 | 121 | |
122 | 122 | |
123 | 123 | } |
124 | 124 | |
125 | - do_action( "wpinv_user_invoices_column_after_$column_id", $invoice ); |
|
125 | + do_action("wpinv_user_invoices_column_after_$column_id", $invoice); |
|
126 | 126 | |
127 | 127 | echo '</td>'; |
128 | 128 | |
@@ -136,9 +136,9 @@ discard block |
||
136 | 136 | </table> |
137 | 137 | </div> |
138 | 138 | |
139 | - <?php do_action( 'wpinv_before_user_invoices_pagination' ); ?> |
|
139 | + <?php do_action('wpinv_before_user_invoices_pagination'); ?> |
|
140 | 140 | |
141 | - <?php if ( 1 < $invoices->max_num_pages ) : ?> |
|
141 | + <?php if (1 < $invoices->max_num_pages) : ?> |
|
142 | 142 | <div class="invoicing-Pagination"> |
143 | 143 | <?php |
144 | 144 | $big = 999999; |
@@ -146,7 +146,7 @@ discard block |
||
146 | 146 | echo wp_kses_post( |
147 | 147 | paginate_links( |
148 | 148 | array( |
149 | - 'base' => str_replace( $big, '%#%', esc_url( get_pagenum_link( $big ) ) ), |
|
149 | + 'base' => str_replace($big, '%#%', esc_url(get_pagenum_link($big))), |
|
150 | 150 | 'format' => '?paged=%#%', |
151 | 151 | 'total' => $invoices->max_num_pages, |
152 | 152 | ) |
@@ -156,4 +156,4 @@ discard block |
||
156 | 156 | </div> |
157 | 157 | <?php endif; ?> |
158 | 158 | |
159 | -<?php do_action( 'wpinv_after_user_invoices', $invoices->invoices, $invoices->total, $invoices->max_num_pages, $post_type ); ?> |
|
159 | +<?php do_action('wpinv_after_user_invoices', $invoices->invoices, $invoices->total, $invoices->max_num_pages, $post_type); ?> |
@@ -64,8 +64,8 @@ |
||
64 | 64 | $description = wpinv_get_gateway_description( $gateway ); |
65 | 65 | |
66 | 66 | if ( wpinv_is_test_mode( $gateway ) ) { |
67 | - $sandbox_notice = apply_filters( "getpaid_{$gateway}_sandbox_notice", __( 'SANDBOX ENABLED: No real payments will occur.', 'invoicing' ) ); |
|
68 | - $description = "$description $sandbox_notice"; |
|
67 | + $sandbox_notice = apply_filters( "getpaid_{$gateway}_sandbox_notice", __( 'SANDBOX ENABLED: No real payments will occur.', 'invoicing' ) ); |
|
68 | + $description = "$description $sandbox_notice"; |
|
69 | 69 | } |
70 | 70 | |
71 | 71 | echo wp_kses_post( wpautop( $description ) ); |
@@ -7,45 +7,45 @@ discard block |
||
7 | 7 | * @version 1.0.19 |
8 | 8 | */ |
9 | 9 | |
10 | -defined( 'ABSPATH' ) || exit; |
|
10 | +defined('ABSPATH') || exit; |
|
11 | 11 | |
12 | 12 | // The payment methods select title. |
13 | -if ( empty( $text ) ) { |
|
14 | - $text = __( 'Select Payment Method', 'invoicing' ); |
|
13 | +if (empty($text)) { |
|
14 | + $text = __('Select Payment Method', 'invoicing'); |
|
15 | 15 | } |
16 | 16 | |
17 | 17 | // An array of active payment methods. |
18 | -$gateways = wpinv_get_enabled_payment_gateways( true ); |
|
18 | +$gateways = wpinv_get_enabled_payment_gateways(true); |
|
19 | 19 | |
20 | 20 | // The current invoice id. |
21 | 21 | $invoice_id = 0; |
22 | 22 | $chosen_gateway = wpinv_get_default_gateway(); |
23 | 23 | |
24 | -if ( ! empty( $form->invoice ) ) { |
|
24 | +if (!empty($form->invoice)) { |
|
25 | 25 | $invoice_id = $form->invoice->get_id(); |
26 | 26 | $chosen_gateway = $form->invoice->get_gateway(); |
27 | 27 | } |
28 | 28 | |
29 | 29 | ?> |
30 | 30 | |
31 | - <?php do_action( 'getpaid_before_payment_form_gateway_select', $form ); ?> |
|
31 | + <?php do_action('getpaid_before_payment_form_gateway_select', $form); ?> |
|
32 | 32 | <div class="mt-4 mb-4 getpaid-gateways"> |
33 | 33 | |
34 | - <?php do_action( 'wpinv_payment_mode_top', $invoice_id, $chosen_gateway, $gateways, $form ); ?> |
|
34 | + <?php do_action('wpinv_payment_mode_top', $invoice_id, $chosen_gateway, $gateways, $form); ?> |
|
35 | 35 | |
36 | 36 | <div class="getpaid-select-gateway-title-div"> |
37 | - <h6><?php echo esc_html( $text ); ?></h6> |
|
37 | + <h6><?php echo esc_html($text); ?></h6> |
|
38 | 38 | </div> |
39 | 39 | |
40 | 40 | <div class="getpaid-available-gateways-div"> |
41 | 41 | |
42 | - <?php foreach ( array_keys( $gateways ) as $gateway ) : ?> |
|
42 | + <?php foreach (array_keys($gateways) as $gateway) : ?> |
|
43 | 43 | |
44 | - <div class="pt-1 pb-1 getpaid-gateway getpaid-gateway-<?php echo sanitize_html_class( $gateway ); ?>" data-checkout-label='<?php echo esc_attr( apply_filters( "getpaid_gateway_{$gateway}_checkout_button_label", '' ) ); ?>'> |
|
44 | + <div class="pt-1 pb-1 getpaid-gateway getpaid-gateway-<?php echo sanitize_html_class($gateway); ?>" data-checkout-label='<?php echo esc_attr(apply_filters("getpaid_gateway_{$gateway}_checkout_button_label", '')); ?>'> |
|
45 | 45 | |
46 | 46 | <label class="d-block w-100 getpaid-gateway-radio"> |
47 | - <input type="radio" value="<?php echo esc_attr( $gateway ); ?>" <?php checked( $gateway, $chosen_gateway ); ?> name="wpi-gateway"> |
|
48 | - <span><?php echo esc_html( wpinv_get_gateway_checkout_label( $gateway ) ); ?></span> |
|
47 | + <input type="radio" value="<?php echo esc_attr($gateway); ?>" <?php checked($gateway, $chosen_gateway); ?> name="wpi-gateway"> |
|
48 | + <span><?php echo esc_html(wpinv_get_gateway_checkout_label($gateway)); ?></span> |
|
49 | 49 | </label> |
50 | 50 | |
51 | 51 | </div> |
@@ -56,22 +56,22 @@ discard block |
||
56 | 56 | |
57 | 57 | <div class="getpaid-gateway-descriptions-div"> |
58 | 58 | |
59 | - <?php foreach ( array_keys( $gateways ) as $gateway ) : ?> |
|
59 | + <?php foreach (array_keys($gateways) as $gateway) : ?> |
|
60 | 60 | |
61 | - <div class="my-2 p-3 bg-light border getpaid-gateway-description getpaid-description-<?php echo sanitize_html_class( $gateway ); ?>" style="display: none;"> |
|
61 | + <div class="my-2 p-3 bg-light border getpaid-gateway-description getpaid-description-<?php echo sanitize_html_class($gateway); ?>" style="display: none;"> |
|
62 | 62 | <?php |
63 | 63 | |
64 | - $description = wpinv_get_gateway_description( $gateway ); |
|
64 | + $description = wpinv_get_gateway_description($gateway); |
|
65 | 65 | |
66 | - if ( wpinv_is_test_mode( $gateway ) ) { |
|
67 | - $sandbox_notice = apply_filters( "getpaid_{$gateway}_sandbox_notice", __( 'SANDBOX ENABLED: No real payments will occur.', 'invoicing' ) ); |
|
66 | + if (wpinv_is_test_mode($gateway)) { |
|
67 | + $sandbox_notice = apply_filters("getpaid_{$gateway}_sandbox_notice", __('SANDBOX ENABLED: No real payments will occur.', 'invoicing')); |
|
68 | 68 | $description = "$description $sandbox_notice"; |
69 | 69 | } |
70 | 70 | |
71 | - echo wp_kses_post( wpautop( $description ) ); |
|
71 | + echo wp_kses_post(wpautop($description)); |
|
72 | 72 | |
73 | - do_action( 'wpinv_' . $gateway . '_checkout_fields', $invoice_id ); |
|
74 | - do_action( 'wpinv_' . $gateway . '_cc_form', $invoice_id, $form ); |
|
73 | + do_action('wpinv_' . $gateway . '_checkout_fields', $invoice_id); |
|
74 | + do_action('wpinv_' . $gateway . '_cc_form', $invoice_id, $form); |
|
75 | 75 | |
76 | 76 | ?> |
77 | 77 | </div> |
@@ -84,7 +84,7 @@ discard block |
||
84 | 84 | <?php |
85 | 85 | aui()->alert( |
86 | 86 | array( |
87 | - 'content' => __( 'None of the available payment gateways support purchasing recurring items.', 'invoicing' ), |
|
87 | + 'content' => __('None of the available payment gateways support purchasing recurring items.', 'invoicing'), |
|
88 | 88 | 'type' => 'danger', |
89 | 89 | ), |
90 | 90 | true |
@@ -96,7 +96,7 @@ discard block |
||
96 | 96 | <?php |
97 | 97 | aui()->alert( |
98 | 98 | array( |
99 | - 'content' => __( 'None of the available payment gateways support purchasing multiple subscriptions in a single order.', 'invoicing' ), |
|
99 | + 'content' => __('None of the available payment gateways support purchasing multiple subscriptions in a single order.', 'invoicing'), |
|
100 | 100 | 'type' => 'danger', |
101 | 101 | ), |
102 | 102 | true |
@@ -108,7 +108,7 @@ discard block |
||
108 | 108 | <?php |
109 | 109 | aui()->alert( |
110 | 110 | array( |
111 | - 'content' => __( 'None of the available payment gateways support purchasing multiple subscriptions with different billing schedules in a single order.', 'invoicing' ), |
|
111 | + 'content' => __('None of the available payment gateways support purchasing multiple subscriptions with different billing schedules in a single order.', 'invoicing'), |
|
112 | 112 | 'type' => 'danger', |
113 | 113 | ), |
114 | 114 | true |
@@ -120,7 +120,7 @@ discard block |
||
120 | 120 | <?php |
121 | 121 | aui()->alert( |
122 | 122 | array( |
123 | - 'content' => __( 'There is no active payment gateway available to process your request.', 'invoicing' ), |
|
123 | + 'content' => __('There is no active payment gateway available to process your request.', 'invoicing'), |
|
124 | 124 | 'type' => 'danger', |
125 | 125 | ), |
126 | 126 | true |
@@ -128,7 +128,7 @@ discard block |
||
128 | 128 | ?> |
129 | 129 | </div> |
130 | 130 | |
131 | - <?php do_action( 'wpinv_payment_mode_bottom', $invoice_id, $chosen_gateway, $gateways, $form ); ?> |
|
131 | + <?php do_action('wpinv_payment_mode_bottom', $invoice_id, $chosen_gateway, $gateways, $form); ?> |
|
132 | 132 | |
133 | 133 | </div> |
134 | - <?php do_action( 'getpaid_after_payment_form_gateway_select', $form ); ?> |
|
134 | + <?php do_action('getpaid_after_payment_form_gateway_select', $form); ?> |