@@ -8,7 +8,7 @@ discard block |
||
8 | 8 | * @version 1.0.19 |
9 | 9 | */ |
10 | 10 | |
11 | -defined( 'ABSPATH' ) || exit; |
|
11 | +defined('ABSPATH') || exit; |
|
12 | 12 | |
13 | 13 | return array( |
14 | 14 | |
@@ -16,7 +16,7 @@ discard block |
||
16 | 16 | |
17 | 17 | 'placeholder' => '[email protected]', |
18 | 18 | 'value' => '', |
19 | - 'label' => __( 'Billing Email', 'invoicing' ), |
|
19 | + 'label' => __('Billing Email', 'invoicing'), |
|
20 | 20 | 'description' => '', |
21 | 21 | 'required' => true, |
22 | 22 | 'id' => 'mmdwqzpox', |
@@ -38,7 +38,7 @@ discard block |
||
38 | 38 | ), |
39 | 39 | |
40 | 40 | array( |
41 | - 'text' => __( 'Select Payment Method', 'invoicing' ), |
|
41 | + 'text' => __('Select Payment Method', 'invoicing'), |
|
42 | 42 | 'id' => 'gtscicd', |
43 | 43 | 'name' => 'gtscicd', |
44 | 44 | 'type' => 'gateway_select', |
@@ -50,8 +50,8 @@ discard block |
||
50 | 50 | |
51 | 51 | 'value' =>'', |
52 | 52 | 'class' => 'btn-primary', |
53 | - 'label' => __( 'Pay Now »', 'invoicing' ), |
|
54 | - 'description' => __( 'By continuing with your payment, you are agreeing to our privacy policy and terms of service.', 'invoicing' ), |
|
53 | + 'label' => __('Pay Now »', 'invoicing'), |
|
54 | + 'description' => __('By continuing with your payment, you are agreeing to our privacy policy and terms of service.', 'invoicing'), |
|
55 | 55 | 'id' => 'rtqljyy', |
56 | 56 | 'name' => 'rtqljyy', |
57 | 57 | 'type' => 'pay_button', |
@@ -18,15 +18,15 @@ |
||
18 | 18 | } |
19 | 19 | |
20 | 20 | switch( $items_type ) { |
21 | - case 'radio': |
|
22 | - wpinv_get_template( 'payment-forms/variations/radio.php', compact( 'form', 'items_type' ) ); |
|
23 | - break; |
|
24 | - case 'checkbox': |
|
25 | - wpinv_get_template( 'payment-forms/variations/checkbox.php', compact( 'form', 'items_type' ) ); |
|
26 | - break; |
|
27 | - case 'select': |
|
28 | - wpinv_get_template( 'payment-forms/variations/select.php', compact( 'form', 'items_type' ) ); |
|
29 | - break; |
|
21 | + case 'radio': |
|
22 | + wpinv_get_template( 'payment-forms/variations/radio.php', compact( 'form', 'items_type' ) ); |
|
23 | + break; |
|
24 | + case 'checkbox': |
|
25 | + wpinv_get_template( 'payment-forms/variations/checkbox.php', compact( 'form', 'items_type' ) ); |
|
26 | + break; |
|
27 | + case 'select': |
|
28 | + wpinv_get_template( 'payment-forms/variations/select.php', compact( 'form', 'items_type' ) ); |
|
29 | + break; |
|
30 | 30 | } |
31 | 31 | |
32 | 32 | // Display the cart totals. |
@@ -7,36 +7,36 @@ |
||
7 | 7 | * @version 1.0.19 |
8 | 8 | */ |
9 | 9 | |
10 | -defined( 'ABSPATH' ) || exit; |
|
10 | +defined('ABSPATH') || exit; |
|
11 | 11 | |
12 | -if ( empty( $form->get_items() ) ) { |
|
12 | +if (empty($form->get_items())) { |
|
13 | 13 | return; |
14 | 14 | } |
15 | 15 | |
16 | -if ( empty( $items_type ) ) { |
|
16 | +if (empty($items_type)) { |
|
17 | 17 | $items_type = 'total'; |
18 | 18 | } |
19 | 19 | |
20 | -switch( $items_type ) { |
|
20 | +switch ($items_type) { |
|
21 | 21 | case 'radio': |
22 | - wpinv_get_template( 'payment-forms/variations/radio.php', compact( 'form', 'items_type' ) ); |
|
22 | + wpinv_get_template('payment-forms/variations/radio.php', compact('form', 'items_type')); |
|
23 | 23 | break; |
24 | 24 | case 'checkbox': |
25 | - wpinv_get_template( 'payment-forms/variations/checkbox.php', compact( 'form', 'items_type' ) ); |
|
25 | + wpinv_get_template('payment-forms/variations/checkbox.php', compact('form', 'items_type')); |
|
26 | 26 | break; |
27 | 27 | case 'select': |
28 | - wpinv_get_template( 'payment-forms/variations/select.php', compact( 'form', 'items_type' ) ); |
|
28 | + wpinv_get_template('payment-forms/variations/select.php', compact('form', 'items_type')); |
|
29 | 29 | break; |
30 | 30 | } |
31 | 31 | |
32 | 32 | // Display the cart totals. |
33 | -if ( ! empty( $hide_cart ) ) { |
|
33 | +if (!empty($hide_cart)) { |
|
34 | 34 | echo '<div class="d-none">'; |
35 | 35 | } |
36 | 36 | |
37 | 37 | // Display the cart totals. |
38 | -wpinv_get_template( 'payment-forms/cart.php', compact( 'form', 'items_type' ) ); |
|
38 | +wpinv_get_template('payment-forms/cart.php', compact('form', 'items_type')); |
|
39 | 39 | |
40 | -if ( ! empty( $hide_cart ) ) { |
|
40 | +if (!empty($hide_cart)) { |
|
41 | 41 | echo '</div>'; |
42 | 42 | } |
@@ -8,7 +8,7 @@ discard block |
||
8 | 8 | */ |
9 | 9 | |
10 | 10 | if ( ! defined( 'ABSPATH' ) ) { |
11 | - exit; // Exit if accessed directly |
|
11 | + exit; // Exit if accessed directly |
|
12 | 12 | } |
13 | 13 | |
14 | 14 | /** |
@@ -17,10 +17,10 @@ discard block |
||
17 | 17 | class GetPaid_Meta_Box_Invoice_Items { |
18 | 18 | |
19 | 19 | /** |
20 | - * Output the metabox. |
|
21 | - * |
|
22 | - * @param WP_Post $post |
|
23 | - */ |
|
20 | + * Output the metabox. |
|
21 | + * |
|
22 | + * @param WP_Post $post |
|
23 | + */ |
|
24 | 24 | public static function output( $post ) { |
25 | 25 | |
26 | 26 | // Prepare the invoice. |
@@ -7,7 +7,7 @@ discard block |
||
7 | 7 | * |
8 | 8 | */ |
9 | 9 | |
10 | -if ( ! defined( 'ABSPATH' ) ) { |
|
10 | +if (!defined('ABSPATH')) { |
|
11 | 11 | exit; // Exit if accessed directly |
12 | 12 | } |
13 | 13 | |
@@ -21,51 +21,51 @@ discard block |
||
21 | 21 | * |
22 | 22 | * @param WP_Post $post |
23 | 23 | */ |
24 | - public static function output( $post ) { |
|
24 | + public static function output($post) { |
|
25 | 25 | |
26 | 26 | // Prepare the invoice. |
27 | - $invoice = new WPInv_Invoice( $post ); |
|
27 | + $invoice = new WPInv_Invoice($post); |
|
28 | 28 | |
29 | 29 | // Invoice items. |
30 | 30 | $items = $invoice->get_items(); |
31 | 31 | |
32 | 32 | // New item url. |
33 | - $new_item = admin_url( 'post-new.php?post_type=wpi_item' ); |
|
33 | + $new_item = admin_url('post-new.php?post_type=wpi_item'); |
|
34 | 34 | |
35 | 35 | // Totals. |
36 | - $total = wpinv_price( $invoice->get_total(), $invoice->get_currency() ); |
|
36 | + $total = wpinv_price($invoice->get_total(), $invoice->get_currency()); |
|
37 | 37 | |
38 | - if ( $invoice->is_recurring() && $invoice->is_parent() && $invoice->get_total() != $invoice->get_recurring_total() ) { |
|
39 | - $recurring_total = wpinv_price( $invoice->get_recurring_total(), $invoice->get_currency() ); |
|
40 | - $total .= '<small class="form-text text-muted">' . sprintf( __( 'Recurring Price: %s', 'invoicing' ), $recurring_total ) . '</small>'; |
|
38 | + if ($invoice->is_recurring() && $invoice->is_parent() && $invoice->get_total() != $invoice->get_recurring_total()) { |
|
39 | + $recurring_total = wpinv_price($invoice->get_recurring_total(), $invoice->get_currency()); |
|
40 | + $total .= '<small class="form-text text-muted">' . sprintf(__('Recurring Price: %s', 'invoicing'), $recurring_total) . '</small>'; |
|
41 | 41 | } |
42 | 42 | |
43 | 43 | $totals = array( |
44 | 44 | |
45 | 45 | 'subtotal' => array( |
46 | - 'label' => __( 'Items Subtotal', 'invoicing' ), |
|
47 | - 'value' => wpinv_price( $invoice->get_subtotal(), $invoice->get_currency() ), |
|
46 | + 'label' => __('Items Subtotal', 'invoicing'), |
|
47 | + 'value' => wpinv_price($invoice->get_subtotal(), $invoice->get_currency()), |
|
48 | 48 | ), |
49 | 49 | |
50 | 50 | 'discount' => array( |
51 | - 'label' => __( 'Total Discount', 'invoicing' ), |
|
52 | - 'value' => wpinv_price( $invoice->get_total_discount(), $invoice->get_currency() ), |
|
51 | + 'label' => __('Total Discount', 'invoicing'), |
|
52 | + 'value' => wpinv_price($invoice->get_total_discount(), $invoice->get_currency()), |
|
53 | 53 | ), |
54 | 54 | |
55 | 55 | 'tax' => array( |
56 | - 'label' => __( 'Total Tax', 'invoicing' ), |
|
57 | - 'value' => wpinv_price( $invoice->get_total_tax(), $invoice->get_currency() ), |
|
56 | + 'label' => __('Total Tax', 'invoicing'), |
|
57 | + 'value' => wpinv_price($invoice->get_total_tax(), $invoice->get_currency()), |
|
58 | 58 | ), |
59 | 59 | |
60 | 60 | 'total' => array( |
61 | - 'label' => __( 'Invoice Total', 'invoicing' ), |
|
61 | + 'label' => __('Invoice Total', 'invoicing'), |
|
62 | 62 | 'value' => $total, |
63 | 63 | ) |
64 | 64 | ); |
65 | 65 | |
66 | 66 | |
67 | - if ( ! wpinv_use_taxes() ) { |
|
68 | - unset( $totals['tax'] ); |
|
67 | + if (!wpinv_use_taxes()) { |
|
68 | + unset($totals['tax']); |
|
69 | 69 | } |
70 | 70 | ?> |
71 | 71 | |
@@ -81,10 +81,10 @@ discard block |
||
81 | 81 | } |
82 | 82 | </style> |
83 | 83 | |
84 | - <div class="bsui getpaid-invoice-items-inner <?php echo sanitize_html_class( $invoice->get_template( 'edit' ) ); ?> <?php echo empty( $items ) ? 'no-items' : 'has-items'; ?> <?php echo $invoice->is_paid() || $invoice->is_refunded() ? 'not-editable' : 'editable'; ?>" style="margin-top: 1.5rem"> |
|
84 | + <div class="bsui getpaid-invoice-items-inner <?php echo sanitize_html_class($invoice->get_template('edit')); ?> <?php echo empty($items) ? 'no-items' : 'has-items'; ?> <?php echo $invoice->is_paid() || $invoice->is_refunded() ? 'not-editable' : 'editable'; ?>" style="margin-top: 1.5rem"> |
|
85 | 85 | |
86 | - <?php if ( ! $invoice->is_paid() && ! $invoice->is_refunded() ) : ?> |
|
87 | - <?php do_action( 'wpinv_meta_box_before_invoice_template_row', $invoice->get_id() ); ?> |
|
86 | + <?php if (!$invoice->is_paid() && !$invoice->is_refunded()) : ?> |
|
87 | + <?php do_action('wpinv_meta_box_before_invoice_template_row', $invoice->get_id()); ?> |
|
88 | 88 | |
89 | 89 | <div class="row"> |
90 | 90 | <div class="col-12 col-sm-6"> |
@@ -93,15 +93,15 @@ discard block |
||
93 | 93 | array( |
94 | 94 | 'id' => 'wpinv_template', |
95 | 95 | 'name' => 'wpinv_template', |
96 | - 'label' => __( 'Template', 'invoicing' ), |
|
96 | + 'label' => __('Template', 'invoicing'), |
|
97 | 97 | 'label_type' => 'vertical', |
98 | - 'placeholder' => __( 'Choose a template', 'invoicing' ), |
|
98 | + 'placeholder' => __('Choose a template', 'invoicing'), |
|
99 | 99 | 'class' => 'form-control-sm', |
100 | - 'value' => $invoice->get_template( 'edit' ), |
|
100 | + 'value' => $invoice->get_template('edit'), |
|
101 | 101 | 'options' => array( |
102 | - 'quantity' => __( 'Quantity', 'invoicing' ), |
|
103 | - 'hours' => __( 'Hours', 'invoicing' ), |
|
104 | - 'amount' => __( 'Amount Only', 'invoicing' ), |
|
102 | + 'quantity' => __('Quantity', 'invoicing'), |
|
103 | + 'hours' => __('Hours', 'invoicing'), |
|
104 | + 'amount' => __('Amount Only', 'invoicing'), |
|
105 | 105 | ), |
106 | 106 | 'data-allow-clear' => 'false', |
107 | 107 | 'select2' => true, |
@@ -117,11 +117,11 @@ discard block |
||
117 | 117 | array( |
118 | 118 | 'id' => 'wpinv_currency', |
119 | 119 | 'name' => 'wpinv_currency', |
120 | - 'label' => __( 'Currency', 'invoicing' ), |
|
120 | + 'label' => __('Currency', 'invoicing'), |
|
121 | 121 | 'label_type' => 'vertical', |
122 | - 'placeholder' => __( 'Select Invoice Currency', 'invoicing' ), |
|
122 | + 'placeholder' => __('Select Invoice Currency', 'invoicing'), |
|
123 | 123 | 'class' => 'form-control-sm', |
124 | - 'value' => $invoice->get_currency( 'edit' ), |
|
124 | + 'value' => $invoice->get_currency('edit'), |
|
125 | 125 | 'required' => false, |
126 | 126 | 'data-allow-clear' => 'false', |
127 | 127 | 'select2' => true, |
@@ -133,24 +133,24 @@ discard block |
||
133 | 133 | </div> |
134 | 134 | </div> |
135 | 135 | |
136 | - <?php do_action( 'wpinv_meta_box_invoice_template_row', $invoice->get_id() ); ?> |
|
136 | + <?php do_action('wpinv_meta_box_invoice_template_row', $invoice->get_id()); ?> |
|
137 | 137 | <?php endif; ?> |
138 | 138 | |
139 | 139 | <table cellpadding="0" cellspacing="0" class="getpaid_invoice_items"> |
140 | 140 | <thead> |
141 | 141 | <tr> |
142 | - <th class="getpaid-item" colspan="2"><?php _e( 'Item', 'invoicing' ) ?></th> |
|
142 | + <th class="getpaid-item" colspan="2"><?php _e('Item', 'invoicing') ?></th> |
|
143 | 143 | <th class="getpaid-quantity hide-if-amount text-right"> |
144 | - <span class="getpaid-hide-if-hours"><?php _e( 'Quantity', 'invoicing' ) ?></span> |
|
145 | - <span class="getpaid-hide-if-quantity"><?php _e( 'Hours', 'invoicing' ) ?></span> |
|
144 | + <span class="getpaid-hide-if-hours"><?php _e('Quantity', 'invoicing') ?></span> |
|
145 | + <span class="getpaid-hide-if-quantity"><?php _e('Hours', 'invoicing') ?></span> |
|
146 | 146 | </th> |
147 | 147 | <th class="getpaid-price hide-if-amount text-right"> |
148 | - <span class="getpaid-hide-if-hours"><?php _e( 'Price', 'invoicing' ) ?></span> |
|
149 | - <span class="getpaid-hide-if-quantity"><?php _e( 'Rate', 'invoicing' ) ?></span> |
|
148 | + <span class="getpaid-hide-if-hours"><?php _e('Price', 'invoicing') ?></span> |
|
149 | + <span class="getpaid-hide-if-quantity"><?php _e('Rate', 'invoicing') ?></span> |
|
150 | 150 | </th> |
151 | 151 | <th class="getpaid-item-subtotal text-right"> |
152 | - <span class="getpaid-hide-if-hours getpaid-hide-if-quantity"><?php _e( 'Amount', 'invoicing' ) ?></span> |
|
153 | - <span class="hide-if-amount"><?php _e( 'Total', 'invoicing' ) ?></span> |
|
152 | + <span class="getpaid-hide-if-hours getpaid-hide-if-quantity"><?php _e('Amount', 'invoicing') ?></span> |
|
153 | + <span class="hide-if-amount"><?php _e('Total', 'invoicing') ?></span> |
|
154 | 154 | </th> |
155 | 155 | <th class="getpaid-item-actions hide-if-not-editable" width="70px"> </th> |
156 | 156 | </tr> |
@@ -158,8 +158,8 @@ discard block |
||
158 | 158 | <tbody class="getpaid_invoice_line_items"> |
159 | 159 | <tr class="hide-if-has-items hide-if-not-editable"> |
160 | 160 | <td colspan="2" class="pt-4 pb-4"> |
161 | - <button type="button" class="button button-primary add-invoice-item" data-toggle="modal" data-target="#getpaid-add-items-to-invoice"><?php _e( 'Add Existing Items', 'invoicing' ) ?></button> |
|
162 | - <a href="<?php echo esc_url( $new_item ); ?>" target="_blank" class="button button-secondary"><?php _e( 'Create New Item', 'invoicing' ) ?></a> |
|
161 | + <button type="button" class="button button-primary add-invoice-item" data-toggle="modal" data-target="#getpaid-add-items-to-invoice"><?php _e('Add Existing Items', 'invoicing') ?></button> |
|
162 | + <a href="<?php echo esc_url($new_item); ?>" target="_blank" class="button button-secondary"><?php _e('Create New Item', 'invoicing') ?></a> |
|
163 | 163 | </td> |
164 | 164 | <td class="hide-if-amount"> </th> |
165 | 165 | <td class="hide-if-amount"> </th> |
@@ -191,11 +191,11 @@ discard block |
||
191 | 191 | <div class="col-12 col-sm-6 offset-sm-6"> |
192 | 192 | <table class="getpaid-invoice-totals text-right w-100"> |
193 | 193 | <tbody> |
194 | - <?php foreach ( apply_filters( 'getpaid_invoice_subtotal_rows', $totals, $invoice ) as $key => $data ) : ?> |
|
195 | - <tr class="getpaid-totals-<?php echo sanitize_html_class( $key ); ?>"> |
|
196 | - <td class="label"><?php echo sanitize_text_field( $data['label'] ) ?>:</td> |
|
194 | + <?php foreach (apply_filters('getpaid_invoice_subtotal_rows', $totals, $invoice) as $key => $data) : ?> |
|
195 | + <tr class="getpaid-totals-<?php echo sanitize_html_class($key); ?>"> |
|
196 | + <td class="label"><?php echo sanitize_text_field($data['label']) ?>:</td> |
|
197 | 197 | <td width="1%"></td> |
198 | - <td class="value"><?php echo wp_kses_post( $data['value'] ) ?></td> |
|
198 | + <td class="value"><?php echo wp_kses_post($data['value']) ?></td> |
|
199 | 199 | </tr> |
200 | 200 | <?php endforeach; ?> |
201 | 201 | </tbody> |
@@ -208,18 +208,18 @@ discard block |
||
208 | 208 | <div class="getpaid-invoice-item-actions hide-if-no-items hide-if-not-editable"> |
209 | 209 | <div class="row"> |
210 | 210 | <div class="text-left col-12 col-sm-8"> |
211 | - <button type="button" class="button add-invoice-item" data-toggle="modal" data-target="#getpaid-add-items-to-invoice"><?php _e( 'Add Existing Item', 'invoicing' ) ?></button> |
|
212 | - <a href="<?php echo esc_url( $new_item ); ?>" target="_blank" class="button button-secondary"><?php _e( 'Create New Item', 'invoicing' ) ?></a> |
|
213 | - <?php do_action( 'getpaid-invoice-items-actions', $invoice ); ?> |
|
211 | + <button type="button" class="button add-invoice-item" data-toggle="modal" data-target="#getpaid-add-items-to-invoice"><?php _e('Add Existing Item', 'invoicing') ?></button> |
|
212 | + <a href="<?php echo esc_url($new_item); ?>" target="_blank" class="button button-secondary"><?php _e('Create New Item', 'invoicing') ?></a> |
|
213 | + <?php do_action('getpaid-invoice-items-actions', $invoice); ?> |
|
214 | 214 | </div> |
215 | 215 | <div class="text-right col-12 col-sm-4"> |
216 | - <button type="button" class="button button-primary recalculate-totals-button"><?php _e( 'Recalculate Totals', 'invoicing' ) ?></button> |
|
216 | + <button type="button" class="button button-primary recalculate-totals-button"><?php _e('Recalculate Totals', 'invoicing') ?></button> |
|
217 | 217 | </div> |
218 | 218 | </div> |
219 | 219 | </div> |
220 | 220 | |
221 | 221 | <div class="getpaid-invoice-item-actions hide-if-editable"> |
222 | - <p class="description m-2 text-right text-muted"><?php _e( 'This invoice is no longer editable', 'invoicing' ); ?></p> |
|
222 | + <p class="description m-2 text-right text-muted"><?php _e('This invoice is no longer editable', 'invoicing'); ?></p> |
|
223 | 223 | </div> |
224 | 224 | |
225 | 225 | <!-- Add items to an invoice --> |
@@ -227,8 +227,8 @@ discard block |
||
227 | 227 | <div class="modal-dialog modal-dialog-centered" role="document"> |
228 | 228 | <div class="modal-content"> |
229 | 229 | <div class="modal-header"> |
230 | - <h5 class="modal-title" id="getpaid-add-item-to-invoice-label"><?php _e( "Add Item(s)", 'invoicing' ); ?></h5> |
|
231 | - <button type="button" class="close" data-dismiss="modal" aria-label="<?php _e( "Close", 'invoicing' ); ?>"> |
|
230 | + <h5 class="modal-title" id="getpaid-add-item-to-invoice-label"><?php _e("Add Item(s)", 'invoicing'); ?></h5> |
|
231 | + <button type="button" class="close" data-dismiss="modal" aria-label="<?php _e("Close", 'invoicing'); ?>"> |
|
232 | 232 | <span aria-hidden="true">×</span> |
233 | 233 | </button> |
234 | 234 | </div> |
@@ -236,17 +236,17 @@ discard block |
||
236 | 236 | <table class="widefat"> |
237 | 237 | <thead> |
238 | 238 | <tr> |
239 | - <th class="pl-0 text-left"><?php _e( 'Item', 'invoicing' ) ?></th> |
|
239 | + <th class="pl-0 text-left"><?php _e('Item', 'invoicing') ?></th> |
|
240 | 240 | <th class="pr-0 text-right hide-if-amount"> |
241 | - <span class="getpaid-hide-if-hours"><?php _e( 'Quantity', 'invoicing' ) ?></span> |
|
242 | - <span class="getpaid-hide-if-quantity"><?php _e( 'Hours', 'invoicing' ) ?></span> |
|
241 | + <span class="getpaid-hide-if-hours"><?php _e('Quantity', 'invoicing') ?></span> |
|
242 | + <span class="getpaid-hide-if-quantity"><?php _e('Hours', 'invoicing') ?></span> |
|
243 | 243 | </th> |
244 | 244 | </tr> |
245 | 245 | </thead> |
246 | 246 | <tbody> |
247 | 247 | <tr> |
248 | 248 | <td class="pl-0 text-left"> |
249 | - <select class="getpaid-item-search regular-text" data-placeholder="<?php esc_attr_e( 'Search for an item…', 'invoicing' ); ?>"></select> |
|
249 | + <select class="getpaid-item-search regular-text" data-placeholder="<?php esc_attr_e('Search for an item…', 'invoicing'); ?>"></select> |
|
250 | 250 | </td> |
251 | 251 | <td class="pr-0 text-right hide-if-amount"> |
252 | 252 | <input type="number" class="w100" step="1" min="1" autocomplete="off" value="1" placeholder="1"> |
@@ -256,8 +256,8 @@ discard block |
||
256 | 256 | </table> |
257 | 257 | </div> |
258 | 258 | <div class="modal-footer"> |
259 | - <button type="button" class="btn btn-secondary getpaid-cancel" data-dismiss="modal"><?php _e( 'Cancel', 'invoicing' ); ?></button> |
|
260 | - <button type="button" class="btn btn-primary getpaid-add" data-dismiss="modal"><?php _e( 'Add', 'invoicing' ); ?></button> |
|
259 | + <button type="button" class="btn btn-secondary getpaid-cancel" data-dismiss="modal"><?php _e('Cancel', 'invoicing'); ?></button> |
|
260 | + <button type="button" class="btn btn-primary getpaid-add" data-dismiss="modal"><?php _e('Add', 'invoicing'); ?></button> |
|
261 | 261 | </div> |
262 | 262 | </div> |
263 | 263 | </div> |
@@ -268,8 +268,8 @@ discard block |
||
268 | 268 | <div class="modal-dialog modal-dialog-centered" role="document"> |
269 | 269 | <div class="modal-content"> |
270 | 270 | <div class="modal-header"> |
271 | - <h5 class="modal-title" id="getpaid-edit-invoice-item-label"><?php _e( "Edit Item", 'invoicing' ); ?></h5> |
|
272 | - <button type="button" class="close" data-dismiss="modal" aria-label="<?php _e( "Close", 'invoicing' ); ?>"> |
|
271 | + <h5 class="modal-title" id="getpaid-edit-invoice-item-label"><?php _e("Edit Item", 'invoicing'); ?></h5> |
|
272 | + <button type="button" class="close" data-dismiss="modal" aria-label="<?php _e("Close", 'invoicing'); ?>"> |
|
273 | 273 | <span aria-hidden="true">×</span> |
274 | 274 | </button> |
275 | 275 | </div> |
@@ -277,27 +277,27 @@ discard block |
||
277 | 277 | <div class="getpaid-edit-item-div"> |
278 | 278 | <input type="hidden" name="id" class="form-control form-control-sm item-id"> |
279 | 279 | <label class="form-group w-100"> |
280 | - <span><?php _e( 'Name', 'invoicing' ); ?></span> |
|
281 | - <input type="text" name="name" placeholder="<?php esc_attr_e( 'Item Name', 'invoicing' ); ?>" class="form-control form-control-sm item-name"> |
|
280 | + <span><?php _e('Name', 'invoicing'); ?></span> |
|
281 | + <input type="text" name="name" placeholder="<?php esc_attr_e('Item Name', 'invoicing'); ?>" class="form-control form-control-sm item-name"> |
|
282 | 282 | </label> |
283 | 283 | <label class="form-group w-100"> |
284 | - <span class="getpaid-hide-if-hours getpaid-hide-if-quantity item-price"><?php _e( 'Amount', 'invoicing' ); ?></span> |
|
285 | - <span class="hide-if-amount"><?php _e( 'Price', 'invoicing' ); ?></span> |
|
286 | - <input type="text" name="price" placeholder="<?php wpinv_sanitize_amount( 0 ); ?>" class="form-control form-control-sm item-price"> |
|
284 | + <span class="getpaid-hide-if-hours getpaid-hide-if-quantity item-price"><?php _e('Amount', 'invoicing'); ?></span> |
|
285 | + <span class="hide-if-amount"><?php _e('Price', 'invoicing'); ?></span> |
|
286 | + <input type="text" name="price" placeholder="<?php wpinv_sanitize_amount(0); ?>" class="form-control form-control-sm item-price"> |
|
287 | 287 | </label> |
288 | 288 | <label class="form-group w-100 hide-if-amount"> |
289 | - <span><?php _e( 'Quantity', 'invoicing' ); ?></span> |
|
289 | + <span><?php _e('Quantity', 'invoicing'); ?></span> |
|
290 | 290 | <input type="number" name="quantity" placeholder="1" class="form-control form-control-sm item-quantity"> |
291 | 291 | </label> |
292 | 292 | <label class="form-group w-100"> |
293 | - <span><?php _e( 'Item Description', 'invoicing' ); ?></span> |
|
294 | - <textarea name="description" placeholder="<?php esc_attr_e( 'Enter a description for this item', 'invoicing' ); ?>" class="form-control item-description"></textarea> |
|
293 | + <span><?php _e('Item Description', 'invoicing'); ?></span> |
|
294 | + <textarea name="description" placeholder="<?php esc_attr_e('Enter a description for this item', 'invoicing'); ?>" class="form-control item-description"></textarea> |
|
295 | 295 | </label> |
296 | 296 | </div> |
297 | 297 | </div> |
298 | 298 | <div class="modal-footer"> |
299 | - <button type="button" class="btn btn-secondary getpaid-cancel" data-dismiss="modal"><?php _e( 'Cancel', 'invoicing' ); ?></button> |
|
300 | - <button type="button" class="btn btn-primary getpaid-save" data-dismiss="modal"><?php _e( 'Save', 'invoicing' ); ?></button> |
|
299 | + <button type="button" class="btn btn-secondary getpaid-cancel" data-dismiss="modal"><?php _e('Cancel', 'invoicing'); ?></button> |
|
300 | + <button type="button" class="btn btn-primary getpaid-save" data-dismiss="modal"><?php _e('Save', 'invoicing'); ?></button> |
|
301 | 301 | </div> |
302 | 302 | </div> |
303 | 303 | </div> |
@@ -8,7 +8,7 @@ discard block |
||
8 | 8 | */ |
9 | 9 | |
10 | 10 | if ( ! defined( 'ABSPATH' ) ) { |
11 | - exit; // Exit if accessed directly |
|
11 | + exit; // Exit if accessed directly |
|
12 | 12 | } |
13 | 13 | |
14 | 14 | /** |
@@ -17,10 +17,10 @@ discard block |
||
17 | 17 | class GetPaid_Meta_Box_Invoice_Payment_Meta { |
18 | 18 | |
19 | 19 | /** |
20 | - * Output the metabox. |
|
21 | - * |
|
22 | - * @param WP_Post $post |
|
23 | - */ |
|
20 | + * Output the metabox. |
|
21 | + * |
|
22 | + * @param WP_Post $post |
|
23 | + */ |
|
24 | 24 | public static function output( $post ) { |
25 | 25 | |
26 | 26 | // Prepare the invoice. |
@@ -7,7 +7,7 @@ discard block |
||
7 | 7 | * |
8 | 8 | */ |
9 | 9 | |
10 | -if ( ! defined( 'ABSPATH' ) ) { |
|
10 | +if (!defined('ABSPATH')) { |
|
11 | 11 | exit; // Exit if accessed directly |
12 | 12 | } |
13 | 13 | |
@@ -21,10 +21,10 @@ discard block |
||
21 | 21 | * |
22 | 22 | * @param WP_Post $post |
23 | 23 | */ |
24 | - public static function output( $post ) { |
|
24 | + public static function output($post) { |
|
25 | 25 | |
26 | 26 | // Prepare the invoice. |
27 | - $invoice = new WPInv_Invoice( $post ); |
|
27 | + $invoice = new WPInv_Invoice($post); |
|
28 | 28 | |
29 | 29 | ?> |
30 | 30 | |
@@ -47,12 +47,12 @@ discard block |
||
47 | 47 | 'id' => 'wpinv_key', |
48 | 48 | 'name' => 'wpinv_key', |
49 | 49 | 'label' => sprintf( |
50 | - __( '%s Key:', 'invoicing' ), |
|
51 | - ucfirst( $invoice->get_invoice_quote_type() ) |
|
50 | + __('%s Key:', 'invoicing'), |
|
51 | + ucfirst($invoice->get_invoice_quote_type()) |
|
52 | 52 | ), |
53 | 53 | 'label_type' => 'vertical', |
54 | 54 | 'class' => 'form-control-sm', |
55 | - 'value' => $invoice->get_key( 'edit' ), |
|
55 | + 'value' => $invoice->get_key('edit'), |
|
56 | 56 | 'extra_attributes' => array( |
57 | 57 | 'onclick' => 'this.select();', |
58 | 58 | 'readonly' => 'true', |
@@ -67,8 +67,8 @@ discard block |
||
67 | 67 | 'id' => 'wpinv_view_url', |
68 | 68 | 'name' => 'wpinv_view_url', |
69 | 69 | 'label' => sprintf( |
70 | - __( '%s URL:', 'invoicing' ), |
|
71 | - ucfirst( $invoice->get_invoice_quote_type() ) |
|
70 | + __('%s URL:', 'invoicing'), |
|
71 | + ucfirst($invoice->get_invoice_quote_type()) |
|
72 | 72 | ), |
73 | 73 | 'label_type' => 'vertical', |
74 | 74 | 'class' => 'form-control-sm', |
@@ -81,7 +81,7 @@ discard block |
||
81 | 81 | ); |
82 | 82 | |
83 | 83 | // If the invoice is paid... |
84 | - if ( $invoice->is_paid() || $invoice->is_refunded() ) { |
|
84 | + if ($invoice->is_paid() || $invoice->is_refunded()) { |
|
85 | 85 | |
86 | 86 | // Payment date. |
87 | 87 | echo aui()->input( |
@@ -89,11 +89,11 @@ discard block |
||
89 | 89 | 'type' => 'datepicker', |
90 | 90 | 'id' => 'wpinv_date_completed', |
91 | 91 | 'name' => 'date_completed', |
92 | - 'label' => __( 'Payment Date:', 'invoicing' ), |
|
92 | + 'label' => __('Payment Date:', 'invoicing'), |
|
93 | 93 | 'label_type' => 'vertical', |
94 | 94 | 'placeholder' => 'YYYY-MM-DD 00:00', |
95 | 95 | 'class' => 'form-control-sm', |
96 | - 'value' => $invoice->get_date_completed( 'edit' ), |
|
96 | + 'value' => $invoice->get_date_completed('edit'), |
|
97 | 97 | 'extra_attributes' => array( |
98 | 98 | 'data-enable-time' => 'true', |
99 | 99 | 'data-time_24hr' => 'true', |
@@ -108,10 +108,10 @@ discard block |
||
108 | 108 | 'type' => 'text', |
109 | 109 | 'id' => 'wpinv_gateway', |
110 | 110 | 'name' => 'wpinv_gateway', |
111 | - 'label' => __( 'Gateway:', 'invoicing' ), |
|
111 | + 'label' => __('Gateway:', 'invoicing'), |
|
112 | 112 | 'label_type' => 'vertical', |
113 | 113 | 'class' => 'form-control-sm', |
114 | - 'value' => wpinv_get_gateway_admin_label( $invoice->get_gateway( 'edit' ) ), |
|
114 | + 'value' => wpinv_get_gateway_admin_label($invoice->get_gateway('edit')), |
|
115 | 115 | 'extra_attributes' => array( |
116 | 116 | 'onclick' => 'this.select();', |
117 | 117 | 'readonly' => 'true', |
@@ -125,11 +125,11 @@ discard block |
||
125 | 125 | 'type' => 'text', |
126 | 126 | 'id' => 'wpinv_transaction_id', |
127 | 127 | 'name' => 'wpinv_transaction_id', |
128 | - 'label' => __( 'Transaction ID:', 'invoicing' ), |
|
128 | + 'label' => __('Transaction ID:', 'invoicing'), |
|
129 | 129 | 'label_type' => 'vertical', |
130 | 130 | 'class' => 'form-control-sm', |
131 | - 'value' => $invoice->get_transaction_id( 'edit' ), |
|
132 | - 'help_text' => apply_filters( 'wpinv_invoice_transaction_link_' . $invoice->get_gateway( 'edit' ), '', $invoice->get_transaction_id(), $invoice ), |
|
131 | + 'value' => $invoice->get_transaction_id('edit'), |
|
132 | + 'help_text' => apply_filters('wpinv_invoice_transaction_link_' . $invoice->get_gateway('edit'), '', $invoice->get_transaction_id(), $invoice), |
|
133 | 133 | 'extra_attributes' => array( |
134 | 134 | 'onclick' => 'this.select();', |
135 | 135 | 'readonly' => 'true', |
@@ -143,10 +143,10 @@ discard block |
||
143 | 143 | 'type' => 'text', |
144 | 144 | 'id' => 'wpinv_currency', |
145 | 145 | 'name' => 'wpinv_currency', |
146 | - 'label' => __( 'Currency:', 'invoicing' ), |
|
146 | + 'label' => __('Currency:', 'invoicing'), |
|
147 | 147 | 'label_type' => 'vertical', |
148 | 148 | 'class' => 'form-control-sm', |
149 | - 'value' => $invoice->get_currency( 'edit' ), |
|
149 | + 'value' => $invoice->get_currency('edit'), |
|
150 | 150 | 'extra_attributes' => array( |
151 | 151 | 'onclick' => 'this.select();', |
152 | 152 | 'readonly' => 'true', |
@@ -156,7 +156,7 @@ discard block |
||
156 | 156 | |
157 | 157 | } else { |
158 | 158 | |
159 | - if ( 'wpi_invoice' == $invoice->get_post_type() ) { |
|
159 | + if ('wpi_invoice' == $invoice->get_post_type()) { |
|
160 | 160 | |
161 | 161 | // Payment URL. |
162 | 162 | echo aui()->input( |
@@ -164,7 +164,7 @@ discard block |
||
164 | 164 | 'type' => 'text', |
165 | 165 | 'id' => 'wpinv_payment_url', |
166 | 166 | 'name' => 'wpinv_payment_url', |
167 | - 'label' => __( 'Payment URL:', 'invoicing' ), |
|
167 | + 'label' => __('Payment URL:', 'invoicing'), |
|
168 | 168 | 'label_type' => 'vertical', |
169 | 169 | 'class' => 'form-control-sm', |
170 | 170 | 'value' => $invoice->get_checkout_payment_url(), |
@@ -180,13 +180,13 @@ discard block |
||
180 | 180 | array( |
181 | 181 | 'id' => 'wpinv_gateway', |
182 | 182 | 'name' => 'wpinv_gateway', |
183 | - 'label' => __( 'Gateway:', 'invoicing' ), |
|
183 | + 'label' => __('Gateway:', 'invoicing'), |
|
184 | 184 | 'label_type' => 'vertical', |
185 | - 'placeholder' => __( 'Select Gateway', 'invoicing' ), |
|
186 | - 'value' => $invoice->get_gateway( 'edit' ), |
|
185 | + 'placeholder' => __('Select Gateway', 'invoicing'), |
|
186 | + 'value' => $invoice->get_gateway('edit'), |
|
187 | 187 | 'select2' => true, |
188 | 188 | 'data-allow-clear' => 'false', |
189 | - 'options' => wp_list_pluck( wpinv_get_enabled_payment_gateways( true ), 'admin_label' ), |
|
189 | + 'options' => wp_list_pluck(wpinv_get_enabled_payment_gateways(true), 'admin_label'), |
|
190 | 190 | ) |
191 | 191 | ); |
192 | 192 |
@@ -8,7 +8,7 @@ discard block |
||
8 | 8 | */ |
9 | 9 | |
10 | 10 | if ( ! defined( 'ABSPATH' ) ) { |
11 | - exit; // Exit if accessed directly |
|
11 | + exit; // Exit if accessed directly |
|
12 | 12 | } |
13 | 13 | |
14 | 14 | /** |
@@ -17,10 +17,10 @@ discard block |
||
17 | 17 | class GetPaid_Meta_Box_Invoice_Details { |
18 | 18 | |
19 | 19 | /** |
20 | - * Output the metabox. |
|
21 | - * |
|
22 | - * @param WP_Post $post |
|
23 | - */ |
|
20 | + * Output the metabox. |
|
21 | + * |
|
22 | + * @param WP_Post $post |
|
23 | + */ |
|
24 | 24 | public static function output( $post ) { |
25 | 25 | |
26 | 26 | // Prepare the invoice. |
@@ -7,7 +7,7 @@ discard block |
||
7 | 7 | * |
8 | 8 | */ |
9 | 9 | |
10 | -if ( ! defined( 'ABSPATH' ) ) { |
|
10 | +if (!defined('ABSPATH')) { |
|
11 | 11 | exit; // Exit if accessed directly |
12 | 12 | } |
13 | 13 | |
@@ -21,13 +21,13 @@ discard block |
||
21 | 21 | * |
22 | 22 | * @param WP_Post $post |
23 | 23 | */ |
24 | - public static function output( $post ) { |
|
24 | + public static function output($post) { |
|
25 | 25 | |
26 | 26 | // Prepare the invoice. |
27 | - $invoice = new WPInv_Invoice( $post ); |
|
27 | + $invoice = new WPInv_Invoice($post); |
|
28 | 28 | |
29 | 29 | // Nonce field. |
30 | - wp_nonce_field( 'wpinv_details', 'wpinv_details_nonce' ) ; |
|
30 | + wp_nonce_field('wpinv_details', 'wpinv_details_nonce'); |
|
31 | 31 | |
32 | 32 | |
33 | 33 | ?> |
@@ -46,11 +46,11 @@ discard block |
||
46 | 46 | |
47 | 47 | <div class="bsui" style="margin-top: 1.5rem"> |
48 | 48 | |
49 | - <?php do_action( 'getpaid_invoice_edit_before_viewed_by_customer', $invoice ); ?> |
|
50 | - <?php if ( ! $invoice->is_draft() ) : ?> |
|
49 | + <?php do_action('getpaid_invoice_edit_before_viewed_by_customer', $invoice); ?> |
|
50 | + <?php if (!$invoice->is_draft()) : ?> |
|
51 | 51 | <div class="form-group"> |
52 | - <strong><?php _e( 'Viewed by Customer:', 'invoicing' );?></strong> |
|
53 | - <?php ( $invoice->get_is_viewed() ) ? _e( 'Yes', 'invoicing' ) : _e( 'No', 'invoicing' ); ?> |
|
52 | + <strong><?php _e('Viewed by Customer:', 'invoicing'); ?></strong> |
|
53 | + <?php ($invoice->get_is_viewed()) ? _e('Yes', 'invoicing') : _e('No', 'invoicing'); ?> |
|
54 | 54 | </div> |
55 | 55 | <?php endif; ?> |
56 | 56 | |
@@ -58,13 +58,13 @@ discard block |
||
58 | 58 | |
59 | 59 | // Date created. |
60 | 60 | $label = sprintf( |
61 | - __( '%s Date:', 'invoicing' ), |
|
62 | - ucfirst( $invoice->get_invoice_quote_type() ) |
|
61 | + __('%s Date:', 'invoicing'), |
|
62 | + ucfirst($invoice->get_invoice_quote_type()) |
|
63 | 63 | ); |
64 | 64 | |
65 | - $info = sprintf( |
|
66 | - __( 'The date this %s was created.', 'invoicing' ), |
|
67 | - strtolower( $invoice->get_invoice_quote_type() ) |
|
65 | + $info = sprintf( |
|
66 | + __('The date this %s was created.', 'invoicing'), |
|
67 | + strtolower($invoice->get_invoice_quote_type()) |
|
68 | 68 | ); |
69 | 69 | |
70 | 70 | echo aui()->input( |
@@ -72,11 +72,11 @@ discard block |
||
72 | 72 | 'type' => 'datepicker', |
73 | 73 | 'id' => 'wpinv_date_created', |
74 | 74 | 'name' => 'date_created', |
75 | - 'label' => $label . getpaid_get_help_tip( $info ), |
|
75 | + 'label' => $label . getpaid_get_help_tip($info), |
|
76 | 76 | 'label_type' => 'vertical', |
77 | 77 | 'placeholder' => 'YYYY-MM-DD 00:00', |
78 | 78 | 'class' => 'form-control-sm', |
79 | - 'value' => $invoice->get_date_created( 'edit' ), |
|
79 | + 'value' => $invoice->get_date_created('edit'), |
|
80 | 80 | 'extra_attributes' => array( |
81 | 81 | 'data-enable-time' => 'true', |
82 | 82 | 'data-time_24hr' => 'true', |
@@ -87,56 +87,56 @@ discard block |
||
87 | 87 | ); |
88 | 88 | |
89 | 89 | // Due date. |
90 | - if ( $invoice->is_type( 'invoice' ) && wpinv_get_option( 'overdue_active' ) && ( $invoice->needs_payment() || $invoice->is_draft() ) ) { |
|
90 | + if ($invoice->is_type('invoice') && wpinv_get_option('overdue_active') && ($invoice->needs_payment() || $invoice->is_draft())) { |
|
91 | 91 | |
92 | 92 | echo aui()->input( |
93 | 93 | array( |
94 | 94 | 'type' => 'text', |
95 | 95 | 'id' => 'wpinv_due_date', |
96 | 96 | 'name' => 'wpinv_due_date', |
97 | - 'label' => __( 'Due Date:', 'invoicing' ) . getpaid_get_help_tip( __( 'Leave blank to disable automated reminder emails for this invoice.', 'invoicing' ) ), |
|
97 | + 'label' => __('Due Date:', 'invoicing') . getpaid_get_help_tip(__('Leave blank to disable automated reminder emails for this invoice.', 'invoicing')), |
|
98 | 98 | 'label_type' => 'vertical', |
99 | - 'placeholder' => __( 'No due date', 'invoicing' ), |
|
99 | + 'placeholder' => __('No due date', 'invoicing'), |
|
100 | 100 | 'class' => 'form-control-sm', |
101 | - 'value' => $invoice->get_due_date( 'edit' ), |
|
101 | + 'value' => $invoice->get_due_date('edit'), |
|
102 | 102 | ) |
103 | 103 | ); |
104 | 104 | |
105 | 105 | } |
106 | 106 | |
107 | - do_action( 'wpinv_meta_box_details_after_due_date', $invoice->get_id() ); |
|
108 | - do_action( 'getpaid_metabox_after_due_date', $invoice ); |
|
107 | + do_action('wpinv_meta_box_details_after_due_date', $invoice->get_id()); |
|
108 | + do_action('getpaid_metabox_after_due_date', $invoice); |
|
109 | 109 | |
110 | 110 | // Status. |
111 | 111 | $label = sprintf( |
112 | - __( '%s Status:', 'invoicing' ), |
|
113 | - ucfirst( $invoice->get_invoice_quote_type() ) |
|
112 | + __('%s Status:', 'invoicing'), |
|
113 | + ucfirst($invoice->get_invoice_quote_type()) |
|
114 | 114 | ); |
115 | 115 | |
116 | - $status = $invoice->get_status( 'edit' ); |
|
116 | + $status = $invoice->get_status('edit'); |
|
117 | 117 | echo aui()->select( |
118 | 118 | array( |
119 | 119 | 'id' => 'wpinv_status', |
120 | 120 | 'name' => 'wpinv_status', |
121 | 121 | 'label' => $label, |
122 | 122 | 'label_type' => 'vertical', |
123 | - 'placeholder' => __( 'Select Status', 'invoicing' ), |
|
124 | - 'value' => array_key_exists( $status, $invoice->get_all_statuses() ) ? $status : $invoice->get_default_status(), |
|
123 | + 'placeholder' => __('Select Status', 'invoicing'), |
|
124 | + 'value' => array_key_exists($status, $invoice->get_all_statuses()) ? $status : $invoice->get_default_status(), |
|
125 | 125 | 'select2' => true, |
126 | 126 | 'data-allow-clear' => 'false', |
127 | - 'options' => wpinv_get_invoice_statuses( true, false, $invoice ) |
|
127 | + 'options' => wpinv_get_invoice_statuses(true, false, $invoice) |
|
128 | 128 | ) |
129 | 129 | ); |
130 | 130 | |
131 | 131 | // Invoice number. |
132 | 132 | $label = sprintf( |
133 | - __( '%s Number:', 'invoicing' ), |
|
134 | - ucfirst( $invoice->get_invoice_quote_type() ) |
|
133 | + __('%s Number:', 'invoicing'), |
|
134 | + ucfirst($invoice->get_invoice_quote_type()) |
|
135 | 135 | ); |
136 | 136 | |
137 | - $info = sprintf( |
|
138 | - __( 'Each %s number must be unique.', 'invoicing' ), |
|
139 | - strtolower( $invoice->get_invoice_quote_type() ) |
|
137 | + $info = sprintf( |
|
138 | + __('Each %s number must be unique.', 'invoicing'), |
|
139 | + strtolower($invoice->get_invoice_quote_type()) |
|
140 | 140 | ); |
141 | 141 | |
142 | 142 | echo aui()->input( |
@@ -144,11 +144,11 @@ discard block |
||
144 | 144 | 'type' => 'text', |
145 | 145 | 'id' => 'wpinv_number', |
146 | 146 | 'name' => 'wpinv_number', |
147 | - 'label' => $label . getpaid_get_help_tip( $info ), |
|
147 | + 'label' => $label . getpaid_get_help_tip($info), |
|
148 | 148 | 'label_type' => 'vertical', |
149 | - 'placeholder' => __( 'Autogenerate', 'invoicing' ), |
|
149 | + 'placeholder' => __('Autogenerate', 'invoicing'), |
|
150 | 150 | 'class' => 'form-control-sm', |
151 | - 'value' => $invoice->get_number( 'edit' ), |
|
151 | + 'value' => $invoice->get_number('edit'), |
|
152 | 152 | ) |
153 | 153 | ); |
154 | 154 | |
@@ -158,25 +158,25 @@ discard block |
||
158 | 158 | 'type' => 'text', |
159 | 159 | 'id' => 'wpinv_cc', |
160 | 160 | 'name' => 'wpinv_cc', |
161 | - 'label' => __( 'Email CC:', 'invoicing' ) . getpaid_get_help_tip( __( 'Enter a comma separated list of other emails that should be notified about the invoice.', 'invoicing' ) ), |
|
161 | + 'label' => __('Email CC:', 'invoicing') . getpaid_get_help_tip(__('Enter a comma separated list of other emails that should be notified about the invoice.', 'invoicing')), |
|
162 | 162 | 'label_type' => 'vertical', |
163 | - 'placeholder' => __( '[email protected], [email protected]', 'invoicing' ), |
|
163 | + 'placeholder' => __('[email protected], [email protected]', 'invoicing'), |
|
164 | 164 | 'class' => 'form-control-sm', |
165 | - 'value' => $invoice->get_email_cc( 'edit' ), |
|
165 | + 'value' => $invoice->get_email_cc('edit'), |
|
166 | 166 | ) |
167 | 167 | ); |
168 | 168 | |
169 | - do_action( 'wpinv_meta_box_details_inner', $invoice->get_id() ); |
|
169 | + do_action('wpinv_meta_box_details_inner', $invoice->get_id()); |
|
170 | 170 | |
171 | 171 | // Disable taxes. |
172 | - if ( wpinv_use_taxes() && ! ( $invoice->is_paid() || $invoice->is_refunded() ) ) { |
|
172 | + if (wpinv_use_taxes() && !($invoice->is_paid() || $invoice->is_refunded())) { |
|
173 | 173 | |
174 | 174 | echo aui()->input( |
175 | 175 | array( |
176 | 176 | 'id' => 'wpinv_taxable', |
177 | 177 | 'name' => 'disable_taxes', |
178 | 178 | 'type' => 'checkbox', |
179 | - 'label' => __( 'Disable taxes', 'invoicing' ), |
|
179 | + 'label' => __('Disable taxes', 'invoicing'), |
|
180 | 180 | 'value' => '1', |
181 | 181 | 'checked' => (bool) $invoice->get_disable_taxes(), |
182 | 182 | ) |
@@ -185,17 +185,17 @@ discard block |
||
185 | 185 | } |
186 | 186 | |
187 | 187 | // Apply a discount. |
188 | - if ( $invoice->get_discount_code( 'edit' ) ) { |
|
188 | + if ($invoice->get_discount_code('edit')) { |
|
189 | 189 | |
190 | 190 | echo aui()->input( |
191 | 191 | array( |
192 | 192 | 'type' => 'text', |
193 | 193 | 'id' => 'wpinv_discount_code', |
194 | 194 | 'name' => 'wpinv_discount_code', |
195 | - 'label' => __( 'Discount Code:', 'invoicing' ), |
|
195 | + 'label' => __('Discount Code:', 'invoicing'), |
|
196 | 196 | 'label_type' => 'vertical', |
197 | 197 | 'class' => 'form-control-sm', |
198 | - 'value' => $invoice->get_discount_code( 'edit' ), |
|
198 | + 'value' => $invoice->get_discount_code('edit'), |
|
199 | 199 | 'extra_attributes' => array( |
200 | 200 | 'onclick' => 'this.select();', |
201 | 201 | 'readonly' => 'true', |
@@ -205,7 +205,7 @@ discard block |
||
205 | 205 | |
206 | 206 | } |
207 | 207 | |
208 | - do_action( 'getpaid_metabox_after_invoice_details', $invoice ); |
|
208 | + do_action('getpaid_metabox_after_invoice_details', $invoice); |
|
209 | 209 | |
210 | 210 | ?> |
211 | 211 |
@@ -6,7 +6,7 @@ discard block |
||
6 | 6 | */ |
7 | 7 | |
8 | 8 | if ( ! defined( 'ABSPATH' ) ) { |
9 | - exit; // Exit if accessed directly |
|
9 | + exit; // Exit if accessed directly |
|
10 | 10 | } |
11 | 11 | |
12 | 12 | /** |
@@ -15,10 +15,10 @@ discard block |
||
15 | 15 | class GetPaid_Meta_Box_Resend_Invoice { |
16 | 16 | |
17 | 17 | /** |
18 | - * Output the metabox. |
|
19 | - * |
|
20 | - * @param WP_Post $post |
|
21 | - */ |
|
18 | + * Output the metabox. |
|
19 | + * |
|
20 | + * @param WP_Post $post |
|
21 | + */ |
|
22 | 22 | public static function output( $post ) { |
23 | 23 | |
24 | 24 | // Fetch the invoice. |
@@ -5,7 +5,7 @@ discard block |
||
5 | 5 | * |
6 | 6 | */ |
7 | 7 | |
8 | -if ( ! defined( 'ABSPATH' ) ) { |
|
8 | +if (!defined('ABSPATH')) { |
|
9 | 9 | exit; // Exit if accessed directly |
10 | 10 | } |
11 | 11 | |
@@ -19,12 +19,12 @@ discard block |
||
19 | 19 | * |
20 | 20 | * @param WP_Post $post |
21 | 21 | */ |
22 | - public static function output( $post ) { |
|
22 | + public static function output($post) { |
|
23 | 23 | |
24 | 24 | // Fetch the invoice. |
25 | - $invoice = new WPInv_Invoice( $post ); |
|
25 | + $invoice = new WPInv_Invoice($post); |
|
26 | 26 | |
27 | - do_action( 'wpinv_metabox_resend_invoice_before', $invoice ); |
|
27 | + do_action('wpinv_metabox_resend_invoice_before', $invoice); |
|
28 | 28 | |
29 | 29 | $invoice_actions = array( |
30 | 30 | 'resend-email' => array( |
@@ -38,11 +38,11 @@ discard block |
||
38 | 38 | 'getpaid-nonce', |
39 | 39 | 'getpaid-nonce' |
40 | 40 | ), |
41 | - 'label' => __( 'Resend Invoice', 'invoicing' ), |
|
41 | + 'label' => __('Resend Invoice', 'invoicing'), |
|
42 | 42 | ) |
43 | 43 | ); |
44 | 44 | |
45 | - if ( $invoice->needs_payment() ) { |
|
45 | + if ($invoice->needs_payment()) { |
|
46 | 46 | |
47 | 47 | $invoice_actions['send-reminder'] = array( |
48 | 48 | 'url' => wp_nonce_url( |
@@ -55,29 +55,29 @@ discard block |
||
55 | 55 | 'getpaid-nonce', |
56 | 56 | 'getpaid-nonce' |
57 | 57 | ), |
58 | - 'label' => __( 'Send Reminder', 'invoicing' ), |
|
58 | + 'label' => __('Send Reminder', 'invoicing'), |
|
59 | 59 | ); |
60 | 60 | |
61 | 61 | } |
62 | 62 | |
63 | - $invoice_actions = apply_filters( 'getpaid_edit_invoice_actions', $invoice_actions, $invoice ); |
|
63 | + $invoice_actions = apply_filters('getpaid_edit_invoice_actions', $invoice_actions, $invoice); |
|
64 | 64 | |
65 | - foreach ( $invoice_actions as $key => $action ) { |
|
65 | + foreach ($invoice_actions as $key => $action) { |
|
66 | 66 | |
67 | - if ( 'resend-email' === $key ) { |
|
68 | - echo wpautop( __( "This will send a copy of the invoice to the customer's email address.", 'invoicing' ) ); |
|
67 | + if ('resend-email' === $key) { |
|
68 | + echo wpautop(__("This will send a copy of the invoice to the customer's email address.", 'invoicing')); |
|
69 | 69 | } |
70 | 70 | |
71 | 71 | printf( |
72 | 72 | '<p class="wpi-meta-row wpi-%s"><a href="%s" class="button button-secondary">%s</a>', |
73 | - esc_attr( $key ), |
|
74 | - esc_url( $action['url'] ), |
|
75 | - sanitize_text_field( $action['label'] ) |
|
73 | + esc_attr($key), |
|
74 | + esc_url($action['url']), |
|
75 | + sanitize_text_field($action['label']) |
|
76 | 76 | ); |
77 | 77 | |
78 | 78 | } |
79 | 79 | |
80 | - do_action( 'wpinv_metabox_resend_invoice_after', $invoice ); |
|
80 | + do_action('wpinv_metabox_resend_invoice_after', $invoice); |
|
81 | 81 | |
82 | 82 | } |
83 | 83 |
@@ -1,39 +1,39 @@ |
||
1 | 1 | <?php |
2 | 2 | // MUST have WordPress. |
3 | -if ( !defined( 'WPINC' ) ) { |
|
4 | - exit( 'Do NOT access this file directly: ' . basename( __FILE__ ) ); |
|
3 | +if (!defined('WPINC')) { |
|
4 | + exit('Do NOT access this file directly: ' . basename(__FILE__)); |
|
5 | 5 | } |
6 | 6 | |
7 | 7 | class WPInv_Meta_Box_Notes { |
8 | - public static function output( $post ) { |
|
8 | + public static function output($post) { |
|
9 | 9 | global $post; |
10 | 10 | |
11 | - $notes = wpinv_get_invoice_notes( $post->ID ); |
|
11 | + $notes = wpinv_get_invoice_notes($post->ID); |
|
12 | 12 | |
13 | 13 | echo '<ul class="invoice_notes">'; |
14 | 14 | |
15 | - if ( $notes ) { |
|
16 | - foreach( $notes as $note ) { |
|
17 | - wpinv_get_invoice_note_line_item( $note ); |
|
15 | + if ($notes) { |
|
16 | + foreach ($notes as $note) { |
|
17 | + wpinv_get_invoice_note_line_item($note); |
|
18 | 18 | } |
19 | 19 | |
20 | 20 | } else { |
21 | - echo '<li>' . __( 'There are no notes yet.', 'invoicing' ) . '</li>'; |
|
21 | + echo '<li>' . __('There are no notes yet.', 'invoicing') . '</li>'; |
|
22 | 22 | } |
23 | 23 | |
24 | 24 | echo '</ul>'; |
25 | 25 | ?> |
26 | 26 | <div class="add_note"> |
27 | - <h4><?php _e( 'Add note', 'invoicing' ); ?></h4> |
|
27 | + <h4><?php _e('Add note', 'invoicing'); ?></h4> |
|
28 | 28 | <p> |
29 | 29 | <textarea type="text" name="invoice_note" id="add_invoice_note" class="input-text" cols="20" rows="5"></textarea> |
30 | 30 | </p> |
31 | 31 | <p> |
32 | 32 | <select name="invoice_note_type" id="invoice_note_type" class="regular-text"> |
33 | - <option value=""><?php _e( 'Private note', 'invoicing' ); ?></option> |
|
34 | - <option value="customer"><?php _e( 'Note to customer', 'invoicing' ); ?></option> |
|
33 | + <option value=""><?php _e('Private note', 'invoicing'); ?></option> |
|
34 | + <option value="customer"><?php _e('Note to customer', 'invoicing'); ?></option> |
|
35 | 35 | </select> |
36 | - <a href="#" class="add_note button"><?php _e( 'Add', 'invoicing' ); ?></a> <span class="description"><?php _e( 'Add a note for your reference, or add a customer note (the user will be notified).', 'invoicing' ); ?></span> |
|
36 | + <a href="#" class="add_note button"><?php _e('Add', 'invoicing'); ?></a> <span class="description"><?php _e('Add a note for your reference, or add a customer note (the user will be notified).', 'invoicing'); ?></span> |
|
37 | 37 | </p> |
38 | 38 | </div> |
39 | 39 | <?php |
@@ -8,7 +8,7 @@ discard block |
||
8 | 8 | */ |
9 | 9 | |
10 | 10 | if ( ! defined( 'ABSPATH' ) ) { |
11 | - exit; // Exit if accessed directly |
|
11 | + exit; // Exit if accessed directly |
|
12 | 12 | } |
13 | 13 | |
14 | 14 | /** |
@@ -17,10 +17,10 @@ discard block |
||
17 | 17 | class GetPaid_Meta_Box_Item_Details { |
18 | 18 | |
19 | 19 | /** |
20 | - * Output the metabox. |
|
21 | - * |
|
22 | - * @param WP_Post $post |
|
23 | - */ |
|
20 | + * Output the metabox. |
|
21 | + * |
|
22 | + * @param WP_Post $post |
|
23 | + */ |
|
24 | 24 | public static function output( $post ) { |
25 | 25 | |
26 | 26 | // Prepare the item. |
@@ -289,35 +289,35 @@ discard block |
||
289 | 289 | } |
290 | 290 | |
291 | 291 | /** |
292 | - * Save meta box data. |
|
293 | - * |
|
294 | - * @param int $post_id |
|
295 | - */ |
|
296 | - public static function save( $post_id ) { |
|
292 | + * Save meta box data. |
|
293 | + * |
|
294 | + * @param int $post_id |
|
295 | + */ |
|
296 | + public static function save( $post_id ) { |
|
297 | 297 | |
298 | 298 | // Prepare the item. |
299 | 299 | $item = new WPInv_Item( $post_id ); |
300 | 300 | |
301 | 301 | // Load new data. |
302 | 302 | $item->set_props( |
303 | - array( |
|
304 | - 'price' => isset( $_POST['wpinv_item_price'] ) ? (float) $_POST['wpinv_item_price'] : null, |
|
305 | - 'vat_rule' => isset( $_POST['wpinv_vat_rules'] ) ? wpinv_clean( $_POST['wpinv_vat_rules'] ) : null, |
|
306 | - 'vat_class' => isset( $_POST['wpinv_vat_class'] ) ? wpinv_clean( $_POST['wpinv_vat_class'] ) : null, |
|
307 | - 'type' => isset( $_POST['wpinv_item_type'] ) ? wpinv_clean( $_POST['wpinv_item_type'] ) : null, |
|
308 | - 'is_dynamic_pricing' => isset( $_POST['wpinv_name_your_price'] ), |
|
303 | + array( |
|
304 | + 'price' => isset( $_POST['wpinv_item_price'] ) ? (float) $_POST['wpinv_item_price'] : null, |
|
305 | + 'vat_rule' => isset( $_POST['wpinv_vat_rules'] ) ? wpinv_clean( $_POST['wpinv_vat_rules'] ) : null, |
|
306 | + 'vat_class' => isset( $_POST['wpinv_vat_class'] ) ? wpinv_clean( $_POST['wpinv_vat_class'] ) : null, |
|
307 | + 'type' => isset( $_POST['wpinv_item_type'] ) ? wpinv_clean( $_POST['wpinv_item_type'] ) : null, |
|
308 | + 'is_dynamic_pricing' => isset( $_POST['wpinv_name_your_price'] ), |
|
309 | 309 | 'minimum_price' => isset( $_POST['wpinv_minimum_price'] ) ? (float) $_POST['wpinv_minimum_price'] : null, |
310 | - 'is_recurring' => isset( $_POST['wpinv_is_recurring'] ), |
|
311 | - 'recurring_period' => isset( $_POST['wpinv_recurring_period'] ) ? wpinv_clean( $_POST['wpinv_recurring_period'] ) : null, |
|
312 | - 'recurring_interval' => isset( $_POST['wpinv_recurring_interval'] ) ? (int) $_POST['wpinv_recurring_interval'] : null, |
|
313 | - 'recurring_limit' => isset( $_POST['wpinv_recurring_limit'] ) ? (int) $_POST['wpinv_recurring_limit'] : null, |
|
314 | - 'is_free_trial' => isset( $_POST['wpinv_trial_interval'] ) ? ( 0 != (int) $_POST['wpinv_trial_interval'] ) : null, |
|
315 | - 'trial_period' => isset( $_POST['wpinv_trial_period'] ) ? wpinv_clean( $_POST['wpinv_trial_period'] ) : null, |
|
316 | - 'trial_interval' => isset( $_POST['wpinv_trial_interval'] ) ? (int) $_POST['wpinv_trial_interval'] : null, |
|
317 | - ) |
|
310 | + 'is_recurring' => isset( $_POST['wpinv_is_recurring'] ), |
|
311 | + 'recurring_period' => isset( $_POST['wpinv_recurring_period'] ) ? wpinv_clean( $_POST['wpinv_recurring_period'] ) : null, |
|
312 | + 'recurring_interval' => isset( $_POST['wpinv_recurring_interval'] ) ? (int) $_POST['wpinv_recurring_interval'] : null, |
|
313 | + 'recurring_limit' => isset( $_POST['wpinv_recurring_limit'] ) ? (int) $_POST['wpinv_recurring_limit'] : null, |
|
314 | + 'is_free_trial' => isset( $_POST['wpinv_trial_interval'] ) ? ( 0 != (int) $_POST['wpinv_trial_interval'] ) : null, |
|
315 | + 'trial_period' => isset( $_POST['wpinv_trial_period'] ) ? wpinv_clean( $_POST['wpinv_trial_period'] ) : null, |
|
316 | + 'trial_interval' => isset( $_POST['wpinv_trial_interval'] ) ? (int) $_POST['wpinv_trial_interval'] : null, |
|
317 | + ) |
|
318 | 318 | ); |
319 | 319 | |
320 | - $item->save(); |
|
321 | - do_action( 'getpaid_item_metabox_save', $post_id, $item ); |
|
322 | - } |
|
320 | + $item->save(); |
|
321 | + do_action( 'getpaid_item_metabox_save', $post_id, $item ); |
|
322 | + } |
|
323 | 323 | } |
@@ -7,7 +7,7 @@ discard block |
||
7 | 7 | * |
8 | 8 | */ |
9 | 9 | |
10 | -if ( ! defined( 'ABSPATH' ) ) { |
|
10 | +if (!defined('ABSPATH')) { |
|
11 | 11 | exit; // Exit if accessed directly |
12 | 12 | } |
13 | 13 | |
@@ -21,27 +21,27 @@ discard block |
||
21 | 21 | * |
22 | 22 | * @param WP_Post $post |
23 | 23 | */ |
24 | - public static function output( $post ) { |
|
24 | + public static function output($post) { |
|
25 | 25 | |
26 | 26 | // Prepare the item. |
27 | - $item = new WPInv_Item( $post ); |
|
27 | + $item = new WPInv_Item($post); |
|
28 | 28 | |
29 | 29 | // Nonce field. |
30 | - wp_nonce_field( 'getpaid_meta_nonce', 'getpaid_meta_nonce' ); |
|
30 | + wp_nonce_field('getpaid_meta_nonce', 'getpaid_meta_nonce'); |
|
31 | 31 | |
32 | 32 | // Set the currency position. |
33 | 33 | $position = wpinv_currency_position(); |
34 | 34 | |
35 | - if ( $position == 'left_space' ) { |
|
35 | + if ($position == 'left_space') { |
|
36 | 36 | $position = 'left'; |
37 | 37 | } |
38 | 38 | |
39 | - if ( $position == 'right_space' ) { |
|
39 | + if ($position == 'right_space') { |
|
40 | 40 | $position = 'right'; |
41 | 41 | } |
42 | 42 | |
43 | 43 | ?> |
44 | - <input type="hidden" id="_wpi_current_type" value="<?php echo esc_attr( $item->get_type( 'edit' ) ); ?>" /> |
|
44 | + <input type="hidden" id="_wpi_current_type" value="<?php echo esc_attr($item->get_type('edit')); ?>" /> |
|
45 | 45 | <style> |
46 | 46 | #poststuff .input-group-text, |
47 | 47 | #poststuff .form-control { |
@@ -55,21 +55,21 @@ discard block |
||
55 | 55 | </style> |
56 | 56 | <div class='bsui' style='max-width: 600px;padding-top: 10px;'> |
57 | 57 | |
58 | - <?php do_action( 'wpinv_item_details_metabox_before_price', $item ); ?> |
|
58 | + <?php do_action('wpinv_item_details_metabox_before_price', $item); ?> |
|
59 | 59 | <div class="form-group row"> |
60 | - <label class="col-sm-3 col-form-label" for="wpinv_item_price"><span><?php _e( 'Item Price', 'invoicing' )?></span></label> |
|
60 | + <label class="col-sm-3 col-form-label" for="wpinv_item_price"><span><?php _e('Item Price', 'invoicing')?></span></label> |
|
61 | 61 | <div class="col-sm-8"> |
62 | 62 | <div class="row"> |
63 | 63 | <div class="col-sm-4 getpaid-price-input"> |
64 | 64 | <div class="input-group input-group-sm"> |
65 | - <?php if( 'left' == $position ) : ?> |
|
65 | + <?php if ('left' == $position) : ?> |
|
66 | 66 | <div class="input-group-prepend"> |
67 | 67 | <span class="input-group-text" id="wpinv_item_price_symbol"><?php echo wpinv_currency_symbol(); ?></span> |
68 | 68 | </div> |
69 | 69 | <?php endif; ?> |
70 | - <input type="text" name="wpinv_item_price" id="wpinv_item_price" value="<?php echo esc_attr( $item->get_price( 'edit' ) ); ?>" placeholder="<?php echo esc_attr( wpinv_sanitize_amount( 0 ) ); ?>" class="form-control"> |
|
70 | + <input type="text" name="wpinv_item_price" id="wpinv_item_price" value="<?php echo esc_attr($item->get_price('edit')); ?>" placeholder="<?php echo esc_attr(wpinv_sanitize_amount(0)); ?>" class="form-control"> |
|
71 | 71 | |
72 | - <?php if( 'left' != $position ) : ?> |
|
72 | + <?php if ('left' != $position) : ?> |
|
73 | 73 | <div class="input-group-append"> |
74 | 74 | <span class="input-group-text" id="wpinv_item_price_symbol"><?php echo wpinv_currency_symbol(); ?></span> |
75 | 75 | </div> |
@@ -83,25 +83,25 @@ discard block |
||
83 | 83 | array( |
84 | 84 | 'id' => 'wpinv_recurring_interval', |
85 | 85 | 'name' => 'wpinv_recurring_interval', |
86 | - 'label' => __( 'Interval', 'invoicing' ), |
|
87 | - 'placeholder' => __( 'Select Interval', 'invoicing' ), |
|
88 | - 'value' => $item->get_recurring_interval( 'edit' ), |
|
86 | + 'label' => __('Interval', 'invoicing'), |
|
87 | + 'placeholder' => __('Select Interval', 'invoicing'), |
|
88 | + 'value' => $item->get_recurring_interval('edit'), |
|
89 | 89 | 'select2' => true, |
90 | 90 | 'data-allow-clear' => 'false', |
91 | 91 | 'options' => array( |
92 | - '1' => __( 'every', 'invoicing' ), |
|
93 | - '2' => __( 'every 2nd', 'invoicing' ), |
|
94 | - '3' => __( 'every 3rd', 'invoicing' ), |
|
95 | - '4' => __( 'every 4th', 'invoicing' ), |
|
96 | - '5' => __( 'every 5th', 'invoicing' ), |
|
97 | - '6' => __( 'every 6th', 'invoicing' ), |
|
98 | - '8' => __( 'every 8th', 'invoicing' ), |
|
99 | - '9' => __( 'every 9th', 'invoicing' ), |
|
100 | - '10' => __( 'every 10th', 'invoicing' ), |
|
101 | - '11' => __( 'every 11th', 'invoicing' ), |
|
102 | - '12' => __( 'every 12th', 'invoicing' ), |
|
103 | - '13' => __( 'every 13th', 'invoicing' ), |
|
104 | - '14' => __( 'every 14th', 'invoicing' ), |
|
92 | + '1' => __('every', 'invoicing'), |
|
93 | + '2' => __('every 2nd', 'invoicing'), |
|
94 | + '3' => __('every 3rd', 'invoicing'), |
|
95 | + '4' => __('every 4th', 'invoicing'), |
|
96 | + '5' => __('every 5th', 'invoicing'), |
|
97 | + '6' => __('every 6th', 'invoicing'), |
|
98 | + '8' => __('every 8th', 'invoicing'), |
|
99 | + '9' => __('every 9th', 'invoicing'), |
|
100 | + '10' => __('every 10th', 'invoicing'), |
|
101 | + '11' => __('every 11th', 'invoicing'), |
|
102 | + '12' => __('every 12th', 'invoicing'), |
|
103 | + '13' => __('every 13th', 'invoicing'), |
|
104 | + '14' => __('every 14th', 'invoicing'), |
|
105 | 105 | ) |
106 | 106 | ) |
107 | 107 | ); |
@@ -113,16 +113,16 @@ discard block |
||
113 | 113 | array( |
114 | 114 | 'id' => 'wpinv_recurring_period', |
115 | 115 | 'name' => 'wpinv_recurring_period', |
116 | - 'label' => __( 'Period', 'invoicing' ), |
|
117 | - 'placeholder' => __( 'Select Period', 'invoicing' ), |
|
118 | - 'value' => $item->get_recurring_period( 'edit' ), |
|
116 | + 'label' => __('Period', 'invoicing'), |
|
117 | + 'placeholder' => __('Select Period', 'invoicing'), |
|
118 | + 'value' => $item->get_recurring_period('edit'), |
|
119 | 119 | 'select2' => true, |
120 | 120 | 'data-allow-clear' => 'false', |
121 | 121 | 'options' => array( |
122 | - 'D' => __( 'day', 'invoicing' ), |
|
123 | - 'W' => __( 'week', 'invoicing' ), |
|
124 | - 'M' => __( 'month', 'invoicing' ), |
|
125 | - 'Y' => __( 'year', 'invoicing' ), |
|
122 | + 'D' => __('day', 'invoicing'), |
|
123 | + 'W' => __('week', 'invoicing'), |
|
124 | + 'M' => __('month', 'invoicing'), |
|
125 | + 'Y' => __('year', 'invoicing'), |
|
126 | 126 | ) |
127 | 127 | ) |
128 | 128 | ); |
@@ -134,9 +134,9 @@ discard block |
||
134 | 134 | <?php |
135 | 135 | |
136 | 136 | // Dynamic pricing. |
137 | - if( $item->supports_dynamic_pricing() ) { |
|
137 | + if ($item->supports_dynamic_pricing()) { |
|
138 | 138 | |
139 | - do_action( 'wpinv_item_details_metabox_before_dynamic_pricing_checkbox', $item ); |
|
139 | + do_action('wpinv_item_details_metabox_before_dynamic_pricing_checkbox', $item); |
|
140 | 140 | |
141 | 141 | // NYP toggle. |
142 | 142 | echo aui()->input( |
@@ -144,31 +144,31 @@ discard block |
||
144 | 144 | 'id' => 'wpinv_name_your_price', |
145 | 145 | 'name' => 'wpinv_name_your_price', |
146 | 146 | 'type' => 'checkbox', |
147 | - 'label' => apply_filters( 'wpinv_name_your_price_toggle_text', __( 'Let customers name their price', 'invoicing' ) ), |
|
147 | + 'label' => apply_filters('wpinv_name_your_price_toggle_text', __('Let customers name their price', 'invoicing')), |
|
148 | 148 | 'value' => '1', |
149 | 149 | 'checked' => $item->user_can_set_their_price(), |
150 | 150 | 'no_wrap' => true, |
151 | 151 | ) |
152 | 152 | ); |
153 | 153 | |
154 | - do_action( 'wpinv_item_details_metabox_dynamic_pricing_checkbox', $item ); |
|
154 | + do_action('wpinv_item_details_metabox_dynamic_pricing_checkbox', $item); |
|
155 | 155 | |
156 | 156 | } |
157 | 157 | |
158 | 158 | // Subscriptions. |
159 | - do_action( 'wpinv_item_details_metabox_before_subscription_checkbox', $item ); |
|
159 | + do_action('wpinv_item_details_metabox_before_subscription_checkbox', $item); |
|
160 | 160 | echo aui()->input( |
161 | 161 | array( |
162 | 162 | 'id' => 'wpinv_is_recurring', |
163 | 163 | 'name' => 'wpinv_is_recurring', |
164 | 164 | 'type' => 'checkbox', |
165 | - 'label' => apply_filters( 'wpinv_is_recurring_toggle_text', __( 'Charge customers a recurring amount for this item', 'invoicing' ) ), |
|
165 | + 'label' => apply_filters('wpinv_is_recurring_toggle_text', __('Charge customers a recurring amount for this item', 'invoicing')), |
|
166 | 166 | 'value' => '1', |
167 | 167 | 'checked' => $item->is_recurring(), |
168 | 168 | 'no_wrap' => true, |
169 | 169 | ) |
170 | 170 | ); |
171 | - do_action( 'wpinv_item_details_metabox_subscription_checkbox', $item ); |
|
171 | + do_action('wpinv_item_details_metabox_subscription_checkbox', $item); |
|
172 | 172 | |
173 | 173 | ?> |
174 | 174 | <div class="wpinv_show_if_recurring"> |
@@ -178,30 +178,30 @@ discard block |
||
178 | 178 | </div> |
179 | 179 | </div> |
180 | 180 | <div class="col-sm-1 pt-2 pl-0"> |
181 | - <span class="wpi-help-tip dashicons dashicons-editor-help wpinv_show_if_recurring" title="<?php esc_attr_e( 'Set the subscription price, billing interval and period.', 'invoicing' ); ?>"></span> |
|
181 | + <span class="wpi-help-tip dashicons dashicons-editor-help wpinv_show_if_recurring" title="<?php esc_attr_e('Set the subscription price, billing interval and period.', 'invoicing'); ?>"></span> |
|
182 | 182 | </div> |
183 | 183 | </div> |
184 | - <?php do_action( 'wpinv_item_details_metabox_after_price', $item ); ?> |
|
184 | + <?php do_action('wpinv_item_details_metabox_after_price', $item); ?> |
|
185 | 185 | |
186 | - <?php if( $item->supports_dynamic_pricing() ) : ?> |
|
187 | - <?php do_action( 'wpinv_item_details_metabox_before_minimum_price', $item ); ?> |
|
186 | + <?php if ($item->supports_dynamic_pricing()) : ?> |
|
187 | + <?php do_action('wpinv_item_details_metabox_before_minimum_price', $item); ?> |
|
188 | 188 | <div class="wpinv_show_if_dynamic wpinv_minimum_price"> |
189 | 189 | |
190 | 190 | <div class="form-group row"> |
191 | 191 | <label for="wpinv_minimum_price" class="col-sm-3 col-form-label"> |
192 | - <?php _e( 'Minimum Price', 'invoicing' );?> |
|
192 | + <?php _e('Minimum Price', 'invoicing'); ?> |
|
193 | 193 | </label> |
194 | 194 | <div class="col-sm-8"> |
195 | 195 | <div class="input-group input-group-sm"> |
196 | - <?php if( 'left' == $position ) : ?> |
|
196 | + <?php if ('left' == $position) : ?> |
|
197 | 197 | <div class="input-group-prepend"> |
198 | 198 | <span class="input-group-text" id="wpinv_item_minimum_price_symbol"><?php echo wpinv_currency_symbol(); ?></span> |
199 | 199 | </div> |
200 | 200 | <?php endif; ?> |
201 | 201 | |
202 | - <input type="text" name="wpinv_minimum_price" id="wpinv_minimum_price" value="<?php echo esc_attr( $item->get_minimum_price( 'edit' ) ); ?>" placeholder="<?php echo esc_attr( wpinv_sanitize_amount( 0 ) ); ?>" class="form-control"> |
|
202 | + <input type="text" name="wpinv_minimum_price" id="wpinv_minimum_price" value="<?php echo esc_attr($item->get_minimum_price('edit')); ?>" placeholder="<?php echo esc_attr(wpinv_sanitize_amount(0)); ?>" class="form-control"> |
|
203 | 203 | |
204 | - <?php if( 'left' != $position ) : ?> |
|
204 | + <?php if ('left' != $position) : ?> |
|
205 | 205 | <div class="input-group-append"> |
206 | 206 | <span class="input-group-text" id="wpinv_item_minimum_price_symbol"><?php echo wpinv_currency_symbol(); ?></span> |
207 | 207 | </div> |
@@ -210,45 +210,45 @@ discard block |
||
210 | 210 | </div> |
211 | 211 | |
212 | 212 | <div class="col-sm-1 pt-2 pl-0"> |
213 | - <span class="wpi-help-tip dashicons dashicons-editor-help" title="<?php esc_attr_e( 'Enter the minimum amount that users are allowed to set', 'invoicing' ); ?>"></span> |
|
213 | + <span class="wpi-help-tip dashicons dashicons-editor-help" title="<?php esc_attr_e('Enter the minimum amount that users are allowed to set', 'invoicing'); ?>"></span> |
|
214 | 214 | </div> |
215 | 215 | </div> |
216 | 216 | |
217 | 217 | </div> |
218 | - <?php do_action( 'wpinv_item_details_metabox_minimum_price', $item ); ?> |
|
218 | + <?php do_action('wpinv_item_details_metabox_minimum_price', $item); ?> |
|
219 | 219 | <?php endif; ?> |
220 | 220 | |
221 | - <?php do_action( 'wpinv_item_details_metabox_before_maximum_renewals', $item ); ?> |
|
221 | + <?php do_action('wpinv_item_details_metabox_before_maximum_renewals', $item); ?> |
|
222 | 222 | <div class="wpinv_show_if_recurring wpinv_maximum_renewals"> |
223 | 223 | |
224 | 224 | <div class="form-group row"> |
225 | 225 | <label for="wpinv_recurring_limit" class="col-sm-3 col-form-label"> |
226 | - <?php _e( 'Maximum Renewals', 'invoicing' );?> |
|
226 | + <?php _e('Maximum Renewals', 'invoicing'); ?> |
|
227 | 227 | </label> |
228 | 228 | <div class="col-sm-8"> |
229 | - <input type="number" value="<?php echo esc_attr( $item->get_recurring_limit( 'edit' ) ); ?>" placeholder="0" name="wpinv_recurring_limit" id="wpinv_recurring_limit" style="width: 100%;" /> |
|
229 | + <input type="number" value="<?php echo esc_attr($item->get_recurring_limit('edit')); ?>" placeholder="0" name="wpinv_recurring_limit" id="wpinv_recurring_limit" style="width: 100%;" /> |
|
230 | 230 | </div> |
231 | 231 | <div class="col-sm-1 pt-2 pl-0"> |
232 | - <span class="wpi-help-tip dashicons dashicons-editor-help" title="<?php esc_attr_e( 'Leave empty if you want the subscription to renew until it is cancelled.', 'invoicing' ); ?>"></span> |
|
232 | + <span class="wpi-help-tip dashicons dashicons-editor-help" title="<?php esc_attr_e('Leave empty if you want the subscription to renew until it is cancelled.', 'invoicing'); ?>"></span> |
|
233 | 233 | </div> |
234 | 234 | </div> |
235 | 235 | |
236 | 236 | </div> |
237 | - <?php do_action( 'wpinv_item_details_metabox_maximum_renewals', $item ); ?> |
|
237 | + <?php do_action('wpinv_item_details_metabox_maximum_renewals', $item); ?> |
|
238 | 238 | |
239 | - <?php do_action( 'wpinv_item_details_metabox_before_free_trial', $item ); ?> |
|
239 | + <?php do_action('wpinv_item_details_metabox_before_free_trial', $item); ?> |
|
240 | 240 | <div class="wpinv_show_if_recurring wpinv_free_trial"> |
241 | 241 | |
242 | 242 | <div class="form-group row"> |
243 | - <label class="col-sm-3 col-form-label" for="wpinv_trial_interval"><?php _e( 'Free Trial', 'invoicing' )?></label> |
|
243 | + <label class="col-sm-3 col-form-label" for="wpinv_trial_interval"><?php _e('Free Trial', 'invoicing')?></label> |
|
244 | 244 | |
245 | 245 | <div class="col-sm-8"> |
246 | 246 | <div class="row"> |
247 | 247 | <div class="col-sm-6"> |
248 | - <?php $value = $item->has_free_trial() ? $item->get_trial_interval( 'edit' ) : 0;?> |
|
248 | + <?php $value = $item->has_free_trial() ? $item->get_trial_interval('edit') : 0; ?> |
|
249 | 249 | |
250 | 250 | <div> |
251 | - <input type="number" name="wpinv_trial_interval" style="width: 100%;" placeholder="0" id="wpinv_trial_interval" value="<?php echo esc_attr( $value ); ?>" > |
|
251 | + <input type="number" name="wpinv_trial_interval" style="width: 100%;" placeholder="0" id="wpinv_trial_interval" value="<?php echo esc_attr($value); ?>" > |
|
252 | 252 | </div> |
253 | 253 | </div> |
254 | 254 | <div class="col-sm-6"> |
@@ -257,17 +257,17 @@ discard block |
||
257 | 257 | array( |
258 | 258 | 'id' => 'wpinv_trial_period', |
259 | 259 | 'name' => 'wpinv_trial_period', |
260 | - 'label' => __( 'Trial Period', 'invoicing' ), |
|
261 | - 'placeholder' => __( 'Trial Period', 'invoicing' ), |
|
262 | - 'value' => $item->get_recurring_period( 'edit' ), |
|
260 | + 'label' => __('Trial Period', 'invoicing'), |
|
261 | + 'placeholder' => __('Trial Period', 'invoicing'), |
|
262 | + 'value' => $item->get_recurring_period('edit'), |
|
263 | 263 | 'select2' => true, |
264 | 264 | 'data-allow-clear' => 'false', |
265 | 265 | 'no_wrap' => true, |
266 | 266 | 'options' => array( |
267 | - 'D' => __( 'day(s)', 'invoicing' ), |
|
268 | - 'W' => __( 'week(s)', 'invoicing' ), |
|
269 | - 'M' => __( 'month(s)', 'invoicing' ), |
|
270 | - 'Y' => __( 'year(s)', 'invoicing' ), |
|
267 | + 'D' => __('day(s)', 'invoicing'), |
|
268 | + 'W' => __('week(s)', 'invoicing'), |
|
269 | + 'M' => __('month(s)', 'invoicing'), |
|
270 | + 'Y' => __('year(s)', 'invoicing'), |
|
271 | 271 | ) |
272 | 272 | ) |
273 | 273 | ); |
@@ -278,15 +278,15 @@ discard block |
||
278 | 278 | </div> |
279 | 279 | |
280 | 280 | <div class="col-sm-1 pt-2 pl-0"> |
281 | - <span class="wpi-help-tip dashicons dashicons-editor-help" title="<?php esc_attr_e( 'An optional period of time to wait before charging the first recurring payment.', 'invoicing' ); ?>"></span> |
|
281 | + <span class="wpi-help-tip dashicons dashicons-editor-help" title="<?php esc_attr_e('An optional period of time to wait before charging the first recurring payment.', 'invoicing'); ?>"></span> |
|
282 | 282 | </div> |
283 | 283 | |
284 | 284 | </div> |
285 | 285 | |
286 | 286 | </div> |
287 | - <?php do_action( 'wpinv_item_details_metabox__free_trial', $item ); ?> |
|
287 | + <?php do_action('wpinv_item_details_metabox__free_trial', $item); ?> |
|
288 | 288 | |
289 | - <?php do_action( 'wpinv_item_details_metabox_item_details', $item ); ?> |
|
289 | + <?php do_action('wpinv_item_details_metabox_item_details', $item); ?> |
|
290 | 290 | </div> |
291 | 291 | <?php |
292 | 292 | |
@@ -297,31 +297,31 @@ discard block |
||
297 | 297 | * |
298 | 298 | * @param int $post_id |
299 | 299 | */ |
300 | - public static function save( $post_id ) { |
|
300 | + public static function save($post_id) { |
|
301 | 301 | |
302 | 302 | // Prepare the item. |
303 | - $item = new WPInv_Item( $post_id ); |
|
303 | + $item = new WPInv_Item($post_id); |
|
304 | 304 | |
305 | 305 | // Load new data. |
306 | 306 | $item->set_props( |
307 | 307 | array( |
308 | - 'price' => isset( $_POST['wpinv_item_price'] ) ? (float) $_POST['wpinv_item_price'] : null, |
|
309 | - 'vat_rule' => isset( $_POST['wpinv_vat_rules'] ) ? wpinv_clean( $_POST['wpinv_vat_rules'] ) : null, |
|
310 | - 'vat_class' => isset( $_POST['wpinv_vat_class'] ) ? wpinv_clean( $_POST['wpinv_vat_class'] ) : null, |
|
311 | - 'type' => isset( $_POST['wpinv_item_type'] ) ? wpinv_clean( $_POST['wpinv_item_type'] ) : null, |
|
312 | - 'is_dynamic_pricing' => isset( $_POST['wpinv_name_your_price'] ), |
|
313 | - 'minimum_price' => isset( $_POST['wpinv_minimum_price'] ) ? (float) $_POST['wpinv_minimum_price'] : null, |
|
314 | - 'is_recurring' => isset( $_POST['wpinv_is_recurring'] ), |
|
315 | - 'recurring_period' => isset( $_POST['wpinv_recurring_period'] ) ? wpinv_clean( $_POST['wpinv_recurring_period'] ) : null, |
|
316 | - 'recurring_interval' => isset( $_POST['wpinv_recurring_interval'] ) ? (int) $_POST['wpinv_recurring_interval'] : null, |
|
317 | - 'recurring_limit' => isset( $_POST['wpinv_recurring_limit'] ) ? (int) $_POST['wpinv_recurring_limit'] : null, |
|
318 | - 'is_free_trial' => isset( $_POST['wpinv_trial_interval'] ) ? ( 0 != (int) $_POST['wpinv_trial_interval'] ) : null, |
|
319 | - 'trial_period' => isset( $_POST['wpinv_trial_period'] ) ? wpinv_clean( $_POST['wpinv_trial_period'] ) : null, |
|
320 | - 'trial_interval' => isset( $_POST['wpinv_trial_interval'] ) ? (int) $_POST['wpinv_trial_interval'] : null, |
|
308 | + 'price' => isset($_POST['wpinv_item_price']) ? (float) $_POST['wpinv_item_price'] : null, |
|
309 | + 'vat_rule' => isset($_POST['wpinv_vat_rules']) ? wpinv_clean($_POST['wpinv_vat_rules']) : null, |
|
310 | + 'vat_class' => isset($_POST['wpinv_vat_class']) ? wpinv_clean($_POST['wpinv_vat_class']) : null, |
|
311 | + 'type' => isset($_POST['wpinv_item_type']) ? wpinv_clean($_POST['wpinv_item_type']) : null, |
|
312 | + 'is_dynamic_pricing' => isset($_POST['wpinv_name_your_price']), |
|
313 | + 'minimum_price' => isset($_POST['wpinv_minimum_price']) ? (float) $_POST['wpinv_minimum_price'] : null, |
|
314 | + 'is_recurring' => isset($_POST['wpinv_is_recurring']), |
|
315 | + 'recurring_period' => isset($_POST['wpinv_recurring_period']) ? wpinv_clean($_POST['wpinv_recurring_period']) : null, |
|
316 | + 'recurring_interval' => isset($_POST['wpinv_recurring_interval']) ? (int) $_POST['wpinv_recurring_interval'] : null, |
|
317 | + 'recurring_limit' => isset($_POST['wpinv_recurring_limit']) ? (int) $_POST['wpinv_recurring_limit'] : null, |
|
318 | + 'is_free_trial' => isset($_POST['wpinv_trial_interval']) ? (0 != (int) $_POST['wpinv_trial_interval']) : null, |
|
319 | + 'trial_period' => isset($_POST['wpinv_trial_period']) ? wpinv_clean($_POST['wpinv_trial_period']) : null, |
|
320 | + 'trial_interval' => isset($_POST['wpinv_trial_interval']) ? (int) $_POST['wpinv_trial_interval'] : null, |
|
321 | 321 | ) |
322 | 322 | ); |
323 | 323 | |
324 | 324 | $item->save(); |
325 | - do_action( 'getpaid_item_metabox_save', $post_id, $item ); |
|
325 | + do_action('getpaid_item_metabox_save', $post_id, $item); |
|
326 | 326 | } |
327 | 327 | } |
@@ -8,7 +8,7 @@ discard block |
||
8 | 8 | */ |
9 | 9 | |
10 | 10 | if ( ! defined( 'ABSPATH' ) ) { |
11 | - exit; // Exit if accessed directly |
|
11 | + exit; // Exit if accessed directly |
|
12 | 12 | } |
13 | 13 | |
14 | 14 | /** |
@@ -17,10 +17,10 @@ discard block |
||
17 | 17 | class GetPaid_Meta_Box_Invoice_Address { |
18 | 18 | |
19 | 19 | /** |
20 | - * Output the metabox. |
|
21 | - * |
|
22 | - * @param WP_Post $post |
|
23 | - */ |
|
20 | + * Output the metabox. |
|
21 | + * |
|
22 | + * @param WP_Post $post |
|
23 | + */ |
|
24 | 24 | public static function output( $post ) { |
25 | 25 | |
26 | 26 | // Prepare the invoice. |
@@ -300,18 +300,18 @@ discard block |
||
300 | 300 | } |
301 | 301 | |
302 | 302 | /** |
303 | - * Save meta box data. |
|
304 | - * |
|
305 | - * @param int $post_id |
|
306 | - */ |
|
307 | - public static function save( $post_id ) { |
|
303 | + * Save meta box data. |
|
304 | + * |
|
305 | + * @param int $post_id |
|
306 | + */ |
|
307 | + public static function save( $post_id ) { |
|
308 | 308 | |
309 | 309 | // Prepare the invoice. |
310 | 310 | $invoice = new WPInv_Invoice( $post_id ); |
311 | 311 | |
312 | 312 | // Load new data. |
313 | 313 | $invoice->set_props( |
314 | - array( |
|
314 | + array( |
|
315 | 315 | 'template' => isset( $_POST['wpinv_template'] ) ? wpinv_clean( $_POST['wpinv_template'] ) : null, |
316 | 316 | 'email_cc' => isset( $_POST['wpinv_cc'] ) ? wpinv_clean( $_POST['wpinv_cc'] ) : null, |
317 | 317 | 'disable_taxes' => isset( $_POST['disable_taxes'] ), |
@@ -332,7 +332,7 @@ discard block |
||
332 | 332 | 'due_date' => isset( $_POST['wpinv_due_date'] ) ? wpinv_clean( $_POST['wpinv_due_date'] ) : null, |
333 | 333 | 'number' => isset( $_POST['wpinv_number'] ) ? wpinv_clean( $_POST['wpinv_number'] ) : null, |
334 | 334 | 'status' => isset( $_POST['wpinv_status'] ) ? wpinv_clean( $_POST['wpinv_status'] ) : null, |
335 | - ) |
|
335 | + ) |
|
336 | 336 | ); |
337 | 337 | |
338 | 338 | // Recalculate totals. |
@@ -362,6 +362,6 @@ discard block |
||
362 | 362 | } |
363 | 363 | |
364 | 364 | // Fires after an invoice is saved. |
365 | - do_action( 'wpinv_invoice_metabox_saved', $invoice ); |
|
366 | - } |
|
365 | + do_action( 'wpinv_invoice_metabox_saved', $invoice ); |
|
366 | + } |
|
367 | 367 | } |
@@ -7,7 +7,7 @@ discard block |
||
7 | 7 | * |
8 | 8 | */ |
9 | 9 | |
10 | -if ( ! defined( 'ABSPATH' ) ) { |
|
10 | +if (!defined('ABSPATH')) { |
|
11 | 11 | exit; // Exit if accessed directly |
12 | 12 | } |
13 | 13 | |
@@ -21,12 +21,12 @@ discard block |
||
21 | 21 | * |
22 | 22 | * @param WP_Post $post |
23 | 23 | */ |
24 | - public static function output( $post ) { |
|
24 | + public static function output($post) { |
|
25 | 25 | |
26 | 26 | // Prepare the invoice. |
27 | - $invoice = new WPInv_Invoice( $post ); |
|
27 | + $invoice = new WPInv_Invoice($post); |
|
28 | 28 | |
29 | - wp_nonce_field( 'getpaid_meta_nonce', 'getpaid_meta_nonce' ); |
|
29 | + wp_nonce_field('getpaid_meta_nonce', 'getpaid_meta_nonce'); |
|
30 | 30 | |
31 | 31 | ?> |
32 | 32 | |
@@ -41,13 +41,13 @@ discard block |
||
41 | 41 | <div class="col-12 col-sm-6"> |
42 | 42 | <div id="getpaid-invoice-user-id-wrapper" class="form-group"> |
43 | 43 | <div> |
44 | - <label for="post_author_override"><?php _e( 'Customer', 'invoicing' );?></label> |
|
44 | + <label for="post_author_override"><?php _e('Customer', 'invoicing'); ?></label> |
|
45 | 45 | </div> |
46 | 46 | <?php |
47 | 47 | wpinv_dropdown_users( |
48 | 48 | array( |
49 | 49 | 'name' => 'post_author_override', |
50 | - 'selected' => $invoice->get_id() ? $invoice->get_user_id( 'edit' ) : get_current_user_id(), |
|
50 | + 'selected' => $invoice->get_id() ? $invoice->get_user_id('edit') : get_current_user_id(), |
|
51 | 51 | 'include_selected' => true, |
52 | 52 | 'show' => 'display_name_with_login', |
53 | 53 | 'orderby' => 'user_email', |
@@ -65,7 +65,7 @@ discard block |
||
65 | 65 | 'type' => 'text', |
66 | 66 | 'id' => 'getpaid-invoice-new-user-email', |
67 | 67 | 'name' => 'wpinv_email', |
68 | - 'label' => __( 'Email', 'invoicing' ) . '<span class="required">*</span>', |
|
68 | + 'label' => __('Email', 'invoicing') . '<span class="required">*</span>', |
|
69 | 69 | 'label_type' => 'vertical', |
70 | 70 | 'placeholder' => '[email protected]', |
71 | 71 | 'class' => 'form-control-sm', |
@@ -75,18 +75,18 @@ discard block |
||
75 | 75 | </div> |
76 | 76 | </div> |
77 | 77 | <div class="col-12 col-sm-6 form-group mt-sm-4"> |
78 | - <?php if ( ! $invoice->is_paid() && ! $invoice->is_refunded() ) : ?> |
|
78 | + <?php if (!$invoice->is_paid() && !$invoice->is_refunded()) : ?> |
|
79 | 79 | <a id="getpaid-invoice-fill-user-details" class="button button-small button-secondary" href="javascript:void(0)"> |
80 | 80 | <i aria-hidden="true" class="fa fa-refresh"></i> |
81 | - <?php _e( 'Fill User Details', 'invoicing' );?> |
|
81 | + <?php _e('Fill User Details', 'invoicing'); ?> |
|
82 | 82 | </a> |
83 | 83 | <a id="getpaid-invoice-create-new-user-button" class="button button-small button-secondary" href="javascript:void(0)"> |
84 | 84 | <i aria-hidden="true" class="fa fa-plus"></i> |
85 | - <?php _e( 'Add New User', 'invoicing' );?> |
|
85 | + <?php _e('Add New User', 'invoicing'); ?> |
|
86 | 86 | </a> |
87 | 87 | <a id="getpaid-invoice-cancel-create-new-user" class="button button-small button-secondary d-none" href="javascript:void(0)"> |
88 | 88 | <i aria-hidden="true" class="fa fa-close"></i> |
89 | - <?php _e( 'Cancel', 'invoicing' );?> |
|
89 | + <?php _e('Cancel', 'invoicing'); ?> |
|
90 | 90 | </a> |
91 | 91 | <?php endif; ?> |
92 | 92 | </div> |
@@ -99,11 +99,11 @@ discard block |
||
99 | 99 | 'type' => 'text', |
100 | 100 | 'id' => 'wpinv_first_name', |
101 | 101 | 'name' => 'wpinv_first_name', |
102 | - 'label' => __( 'First Name', 'invoicing' ), |
|
102 | + 'label' => __('First Name', 'invoicing'), |
|
103 | 103 | 'label_type' => 'vertical', |
104 | 104 | 'placeholder' => 'Jane', |
105 | 105 | 'class' => 'form-control-sm', |
106 | - 'value' => $invoice->get_first_name( 'edit' ), |
|
106 | + 'value' => $invoice->get_first_name('edit'), |
|
107 | 107 | ) |
108 | 108 | ); |
109 | 109 | ?> |
@@ -115,11 +115,11 @@ discard block |
||
115 | 115 | 'type' => 'text', |
116 | 116 | 'id' => 'wpinv_last_name', |
117 | 117 | 'name' => 'wpinv_last_name', |
118 | - 'label' => __( 'Last Name', 'invoicing' ), |
|
118 | + 'label' => __('Last Name', 'invoicing'), |
|
119 | 119 | 'label_type' => 'vertical', |
120 | 120 | 'placeholder' => 'Doe', |
121 | 121 | 'class' => 'form-control-sm', |
122 | - 'value' => $invoice->get_last_name( 'edit' ), |
|
122 | + 'value' => $invoice->get_last_name('edit'), |
|
123 | 123 | ) |
124 | 124 | ); |
125 | 125 | ?> |
@@ -134,11 +134,11 @@ discard block |
||
134 | 134 | 'type' => 'text', |
135 | 135 | 'id' => 'wpinv_company', |
136 | 136 | 'name' => 'wpinv_company', |
137 | - 'label' => __( 'Company', 'invoicing' ), |
|
137 | + 'label' => __('Company', 'invoicing'), |
|
138 | 138 | 'label_type' => 'vertical', |
139 | 139 | 'placeholder' => 'Acme Corporation', |
140 | 140 | 'class' => 'form-control-sm', |
141 | - 'value' => $invoice->get_company( 'edit' ), |
|
141 | + 'value' => $invoice->get_company('edit'), |
|
142 | 142 | ) |
143 | 143 | ); |
144 | 144 | ?> |
@@ -150,11 +150,11 @@ discard block |
||
150 | 150 | 'type' => 'text', |
151 | 151 | 'id' => 'wpinv_vat_number', |
152 | 152 | 'name' => 'wpinv_vat_number', |
153 | - 'label' => __( 'Vat Number', 'invoicing' ), |
|
153 | + 'label' => __('Vat Number', 'invoicing'), |
|
154 | 154 | 'label_type' => 'vertical', |
155 | 155 | 'placeholder' => '1234567890', |
156 | 156 | 'class' => 'form-control-sm', |
157 | - 'value' => $invoice->get_vat_number( 'edit' ), |
|
157 | + 'value' => $invoice->get_vat_number('edit'), |
|
158 | 158 | ) |
159 | 159 | ); |
160 | 160 | ?> |
@@ -169,11 +169,11 @@ discard block |
||
169 | 169 | 'type' => 'text', |
170 | 170 | 'id' => 'wpinv_address', |
171 | 171 | 'name' => 'wpinv_address', |
172 | - 'label' => __( 'Address', 'invoicing' ), |
|
172 | + 'label' => __('Address', 'invoicing'), |
|
173 | 173 | 'label_type' => 'vertical', |
174 | 174 | 'placeholder' => 'Blekersdijk 295', |
175 | 175 | 'class' => 'form-control-sm', |
176 | - 'value' => $invoice->get_address( 'edit' ), |
|
176 | + 'value' => $invoice->get_address('edit'), |
|
177 | 177 | ) |
178 | 178 | ); |
179 | 179 | ?> |
@@ -185,11 +185,11 @@ discard block |
||
185 | 185 | 'type' => 'text', |
186 | 186 | 'id' => 'wpinv_city', |
187 | 187 | 'name' => 'wpinv_city', |
188 | - 'label' => __( 'City', 'invoicing' ), |
|
188 | + 'label' => __('City', 'invoicing'), |
|
189 | 189 | 'label_type' => 'vertical', |
190 | 190 | 'placeholder' => 'Dolembreux', |
191 | 191 | 'class' => 'form-control-sm', |
192 | - 'value' => $invoice->get_vat_number( 'edit' ), |
|
192 | + 'value' => $invoice->get_vat_number('edit'), |
|
193 | 193 | ) |
194 | 194 | ); |
195 | 195 | ?> |
@@ -203,11 +203,11 @@ discard block |
||
203 | 203 | array( |
204 | 204 | 'id' => 'wpinv_country', |
205 | 205 | 'name' => 'wpinv_country', |
206 | - 'label' => __( 'Country', 'invoicing' ), |
|
206 | + 'label' => __('Country', 'invoicing'), |
|
207 | 207 | 'label_type' => 'vertical', |
208 | - 'placeholder' => __( 'Choose a country', 'invoicing' ), |
|
208 | + 'placeholder' => __('Choose a country', 'invoicing'), |
|
209 | 209 | 'class' => 'form-control-sm', |
210 | - 'value' => $invoice->get_country( 'edit' ), |
|
210 | + 'value' => $invoice->get_country('edit'), |
|
211 | 211 | 'options' => wpinv_get_country_list(), |
212 | 212 | 'data-allow-clear' => 'false', |
213 | 213 | 'select2' => true, |
@@ -218,20 +218,20 @@ discard block |
||
218 | 218 | <div class="col-12 col-sm-6"> |
219 | 219 | <?php |
220 | 220 | |
221 | - $states = wpinv_get_country_states( $invoice->get_country( 'edit' ) ); |
|
221 | + $states = wpinv_get_country_states($invoice->get_country('edit')); |
|
222 | 222 | |
223 | - if ( empty( $states ) ) { |
|
223 | + if (empty($states)) { |
|
224 | 224 | |
225 | 225 | echo aui()->input( |
226 | 226 | array( |
227 | 227 | 'type' => 'text', |
228 | 228 | 'id' => 'wpinv_state', |
229 | 229 | 'name' => 'wpinv_state', |
230 | - 'label' => __( 'State', 'invoicing' ), |
|
230 | + 'label' => __('State', 'invoicing'), |
|
231 | 231 | 'label_type' => 'vertical', |
232 | 232 | 'placeholder' => 'Liège', |
233 | 233 | 'class' => 'form-control-sm', |
234 | - 'value' => $invoice->get_state( 'edit' ), |
|
234 | + 'value' => $invoice->get_state('edit'), |
|
235 | 235 | ) |
236 | 236 | ); |
237 | 237 | |
@@ -241,11 +241,11 @@ discard block |
||
241 | 241 | array( |
242 | 242 | 'id' => 'wpinv_state', |
243 | 243 | 'name' => 'wpinv_state', |
244 | - 'label' => __( 'State', 'invoicing' ), |
|
244 | + 'label' => __('State', 'invoicing'), |
|
245 | 245 | 'label_type' => 'vertical', |
246 | - 'placeholder' => __( 'Select a state', 'invoicing' ), |
|
246 | + 'placeholder' => __('Select a state', 'invoicing'), |
|
247 | 247 | 'class' => 'form-control-sm', |
248 | - 'value' => $invoice->get_state( 'edit' ), |
|
248 | + 'value' => $invoice->get_state('edit'), |
|
249 | 249 | 'options' => $states, |
250 | 250 | 'data-allow-clear' => 'false', |
251 | 251 | 'select2' => true, |
@@ -266,11 +266,11 @@ discard block |
||
266 | 266 | 'type' => 'text', |
267 | 267 | 'id' => 'wpinv_zip', |
268 | 268 | 'name' => 'wpinv_zip', |
269 | - 'label' => __( 'Zip / Postal Code', 'invoicing' ), |
|
269 | + 'label' => __('Zip / Postal Code', 'invoicing'), |
|
270 | 270 | 'label_type' => 'vertical', |
271 | 271 | 'placeholder' => '4140', |
272 | 272 | 'class' => 'form-control-sm', |
273 | - 'value' => $invoice->get_zip( 'edit' ), |
|
273 | + 'value' => $invoice->get_zip('edit'), |
|
274 | 274 | ) |
275 | 275 | ); |
276 | 276 | ?> |
@@ -282,11 +282,11 @@ discard block |
||
282 | 282 | 'type' => 'text', |
283 | 283 | 'id' => 'wpinv_phone', |
284 | 284 | 'name' => 'wpinv_phone', |
285 | - 'label' => __( 'Phone', 'invoicing' ), |
|
285 | + 'label' => __('Phone', 'invoicing'), |
|
286 | 286 | 'label_type' => 'vertical', |
287 | 287 | 'placeholder' => '0493 18 45822', |
288 | 288 | 'class' => 'form-control-sm', |
289 | - 'value' => $invoice->get_phone( 'edit' ), |
|
289 | + 'value' => $invoice->get_phone('edit'), |
|
290 | 290 | ) |
291 | 291 | ); |
292 | 292 | ?> |
@@ -302,34 +302,34 @@ discard block |
||
302 | 302 | * |
303 | 303 | * @param int $post_id |
304 | 304 | */ |
305 | - public static function save( $post_id ) { |
|
305 | + public static function save($post_id) { |
|
306 | 306 | |
307 | 307 | // Prepare the invoice. |
308 | - $invoice = new WPInv_Invoice( $post_id ); |
|
308 | + $invoice = new WPInv_Invoice($post_id); |
|
309 | 309 | |
310 | 310 | // Load new data. |
311 | 311 | $invoice->set_props( |
312 | 312 | array( |
313 | - 'template' => isset( $_POST['wpinv_template'] ) ? wpinv_clean( $_POST['wpinv_template'] ) : null, |
|
314 | - 'email_cc' => isset( $_POST['wpinv_cc'] ) ? wpinv_clean( $_POST['wpinv_cc'] ) : null, |
|
315 | - 'disable_taxes' => isset( $_POST['disable_taxes'] ), |
|
316 | - 'currency' => isset( $_POST['wpinv_currency'] ) ? wpinv_clean( $_POST['wpinv_currency'] ) : null, |
|
317 | - 'gateway' => isset( $_POST['wpinv_gateway'] ) ? wpinv_clean( $_POST['wpinv_gateway'] ) : null, |
|
318 | - 'address' => isset( $_POST['wpinv_address'] ) ? wpinv_clean( $_POST['wpinv_address'] ) : null, |
|
319 | - 'vat_number' => isset( $_POST['wpinv_vat_number'] ) ? wpinv_clean( $_POST['wpinv_vat_number'] ) : null, |
|
320 | - 'company' => isset( $_POST['wpinv_company'] ) ? wpinv_clean( $_POST['wpinv_company'] ) : null, |
|
321 | - 'zip' => isset( $_POST['wpinv_zip'] ) ? wpinv_clean( $_POST['wpinv_zip'] ) : null, |
|
322 | - 'state' => isset( $_POST['wpinv_state'] ) ? wpinv_clean( $_POST['wpinv_state'] ) : null, |
|
323 | - 'city' => isset( $_POST['wpinv_city'] ) ? wpinv_clean( $_POST['wpinv_city'] ) : null, |
|
324 | - 'country' => isset( $_POST['wpinv_country'] ) ? wpinv_clean( $_POST['wpinv_country'] ) : null, |
|
325 | - 'phone' => isset( $_POST['wpinv_phone'] ) ? wpinv_clean( $_POST['wpinv_phone'] ) : null, |
|
326 | - 'first_name' => isset( $_POST['wpinv_first_name'] ) ? wpinv_clean( $_POST['wpinv_first_name'] ) : null, |
|
327 | - 'last_name' => isset( $_POST['wpinv_last_name'] ) ? wpinv_clean( $_POST['wpinv_last_name'] ) : null, |
|
328 | - 'author' => isset( $_POST['post_author_override'] ) ? wpinv_clean( $_POST['post_author_override'] ) : null, |
|
329 | - 'date_created' => isset( $_POST['date_created'] ) ? wpinv_clean( $_POST['date_created'] ) : null, |
|
330 | - 'due_date' => isset( $_POST['wpinv_due_date'] ) ? wpinv_clean( $_POST['wpinv_due_date'] ) : null, |
|
331 | - 'number' => isset( $_POST['wpinv_number'] ) ? wpinv_clean( $_POST['wpinv_number'] ) : null, |
|
332 | - 'status' => isset( $_POST['wpinv_status'] ) ? wpinv_clean( $_POST['wpinv_status'] ) : null, |
|
313 | + 'template' => isset($_POST['wpinv_template']) ? wpinv_clean($_POST['wpinv_template']) : null, |
|
314 | + 'email_cc' => isset($_POST['wpinv_cc']) ? wpinv_clean($_POST['wpinv_cc']) : null, |
|
315 | + 'disable_taxes' => isset($_POST['disable_taxes']), |
|
316 | + 'currency' => isset($_POST['wpinv_currency']) ? wpinv_clean($_POST['wpinv_currency']) : null, |
|
317 | + 'gateway' => isset($_POST['wpinv_gateway']) ? wpinv_clean($_POST['wpinv_gateway']) : null, |
|
318 | + 'address' => isset($_POST['wpinv_address']) ? wpinv_clean($_POST['wpinv_address']) : null, |
|
319 | + 'vat_number' => isset($_POST['wpinv_vat_number']) ? wpinv_clean($_POST['wpinv_vat_number']) : null, |
|
320 | + 'company' => isset($_POST['wpinv_company']) ? wpinv_clean($_POST['wpinv_company']) : null, |
|
321 | + 'zip' => isset($_POST['wpinv_zip']) ? wpinv_clean($_POST['wpinv_zip']) : null, |
|
322 | + 'state' => isset($_POST['wpinv_state']) ? wpinv_clean($_POST['wpinv_state']) : null, |
|
323 | + 'city' => isset($_POST['wpinv_city']) ? wpinv_clean($_POST['wpinv_city']) : null, |
|
324 | + 'country' => isset($_POST['wpinv_country']) ? wpinv_clean($_POST['wpinv_country']) : null, |
|
325 | + 'phone' => isset($_POST['wpinv_phone']) ? wpinv_clean($_POST['wpinv_phone']) : null, |
|
326 | + 'first_name' => isset($_POST['wpinv_first_name']) ? wpinv_clean($_POST['wpinv_first_name']) : null, |
|
327 | + 'last_name' => isset($_POST['wpinv_last_name']) ? wpinv_clean($_POST['wpinv_last_name']) : null, |
|
328 | + 'author' => isset($_POST['post_author_override']) ? wpinv_clean($_POST['post_author_override']) : null, |
|
329 | + 'date_created' => isset($_POST['date_created']) ? wpinv_clean($_POST['date_created']) : null, |
|
330 | + 'due_date' => isset($_POST['wpinv_due_date']) ? wpinv_clean($_POST['wpinv_due_date']) : null, |
|
331 | + 'number' => isset($_POST['wpinv_number']) ? wpinv_clean($_POST['wpinv_number']) : null, |
|
332 | + 'status' => isset($_POST['wpinv_status']) ? wpinv_clean($_POST['wpinv_status']) : null, |
|
333 | 333 | ) |
334 | 334 | ); |
335 | 335 | |
@@ -337,17 +337,17 @@ discard block |
||
337 | 337 | $invoice->recalculate_total(); |
338 | 338 | |
339 | 339 | // If we're creating a new user... |
340 | - if ( ! empty( $_POST['wpinv_new_user'] ) && is_email( $_POST['wpinv_email'] ) ) { |
|
340 | + if (!empty($_POST['wpinv_new_user']) && is_email($_POST['wpinv_email'])) { |
|
341 | 341 | |
342 | 342 | // Attempt to create the user. |
343 | - $user = wpinv_create_user( sanitize_email( $_POST['wpinv_email'] ) ); |
|
343 | + $user = wpinv_create_user(sanitize_email($_POST['wpinv_email'])); |
|
344 | 344 | |
345 | 345 | |
346 | 346 | // If successful, update the invoice author. |
347 | - if ( is_numeric( $user ) ) { |
|
348 | - $invoice->set_author( $user ); |
|
347 | + if (is_numeric($user)) { |
|
348 | + $invoice->set_author($user); |
|
349 | 349 | } else { |
350 | - wpinv_error_log( $user->get_error_message(), __( 'Invoice add new user', 'invoicing' ), __FILE__, __LINE__ ); |
|
350 | + wpinv_error_log($user->get_error_message(), __('Invoice add new user', 'invoicing'), __FILE__, __LINE__); |
|
351 | 351 | } |
352 | 352 | } |
353 | 353 | |
@@ -355,11 +355,11 @@ discard block |
||
355 | 355 | $invoice->save(); |
356 | 356 | |
357 | 357 | // (Maybe) send new user notification. |
358 | - if ( ! empty( $user ) && is_numeric( $user ) && apply_filters( 'getpaid_send_new_user_notification', true ) ) { |
|
359 | - wp_send_new_user_notifications( $user, 'user' ); |
|
358 | + if (!empty($user) && is_numeric($user) && apply_filters('getpaid_send_new_user_notification', true)) { |
|
359 | + wp_send_new_user_notifications($user, 'user'); |
|
360 | 360 | } |
361 | 361 | |
362 | 362 | // Fires after an invoice is saved. |
363 | - do_action( 'wpinv_invoice_metabox_saved', $invoice ); |
|
363 | + do_action('wpinv_invoice_metabox_saved', $invoice); |
|
364 | 364 | } |
365 | 365 | } |