Passed
Push — master ( 8f8300...41d034 )
by Brian
04:55
created
templates/frontend-footer.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -7,7 +7,7 @@  discard block
 block discarded – undo
7 7
  * @version 1.0.19
8 8
  */
9 9
 
10
-defined( 'ABSPATH' ) || exit;
10
+defined('ABSPATH') || exit;
11 11
 
12 12
 ?>
13 13
 
@@ -16,8 +16,8 @@  discard block
 block discarded – undo
16 16
 		<div class="modal-dialog modal-dialog-centered modal-lg" role="checkout" style="max-width: 650px;">
17 17
 			<div class="modal-content">
18 18
 				<div class="modal-body">
19
-					<button type="button" class=" btn-close p-2 getpaid-payment-modal-close d-sm-none" data-dismiss="modal" aria-label="<?php esc_attr__( 'Close', 'invoicing' ); ?>">
20
-						<?php if ( empty( $GLOBALS['aui_bs5'] ) ) : ?>
19
+					<button type="button" class=" btn-close p-2 getpaid-payment-modal-close d-sm-none" data-dismiss="modal" aria-label="<?php esc_attr__('Close', 'invoicing'); ?>">
20
+						<?php if (empty($GLOBALS['aui_bs5'])) : ?>
21 21
                             <span aria-hidden="true">×</span>
22 22
                         <?php endif; ?>
23 23
 					</button>
Please login to merge, or discard this patch.
templates/payment-forms-admin/previews/alert.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -7,14 +7,14 @@
 block discarded – undo
7 7
  * @version 1.0.19
8 8
  */
9 9
 
10
-defined( 'ABSPATH' ) || exit;
10
+defined('ABSPATH') || exit;
11 11
 
12 12
 ?>
13 13
 
14 14
 <div class='alert mb-0' :class='form_element.class' role='alert'>
15 15
     <span v-html='form_element.text'></span>
16 16
     <button v-if='form_element.dismissible' type='button' class='close btn-close' @click.prevent='' style="margin-top: -4px;">
17
-        <?php if ( empty( $GLOBALS['aui_bs5'] ) ) : ?>
17
+        <?php if (empty($GLOBALS['aui_bs5'])) : ?>
18 18
             <span aria-hidden="true">×</span>
19 19
         <?php endif; ?>
20 20
     </button>
Please login to merge, or discard this patch.
includes/admin/meta-boxes/class-getpaid-meta-box-invoice-items.php 1 patch
Spacing   +158 added lines, -158 removed lines patch added patch discarded remove patch
@@ -7,7 +7,7 @@  discard block
 block discarded – undo
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
 
@@ -16,82 +16,82 @@  discard block
 block discarded – undo
16 16
  */
17 17
 class GetPaid_Meta_Box_Invoice_Items {
18 18
 
19
-    public static function get_columns( $invoice ) {
19
+    public static function get_columns($invoice) {
20 20
         $use_taxes          = $invoice->is_taxable() && wpinv_use_taxes();
21 21
         $columns            = array(
22
-            'id'     => __( 'ID', 'invoicing' ),
23
-            'title'  => __( 'Item', 'invoicing' ),
22
+            'id'     => __('ID', 'invoicing'),
23
+            'title'  => __('Item', 'invoicing'),
24 24
             'price'  => sprintf(
25 25
                 '<span class="getpaid-hide-if-hours getpaid-hide-if-quantity">%s</span>
26 26
                 <span class="getpaid-hide-if-hours hide-if-amount">%s</span>
27 27
                 <span class="getpaid-hide-if-quantity hide-if-amount">%s</span>',
28
-                __( 'Amount', 'invoicing' ),
29
-                __( 'Price', 'invoicing' ),
30
-                __( 'Rate', 'invoicing' )
28
+                __('Amount', 'invoicing'),
29
+                __('Price', 'invoicing'),
30
+                __('Rate', 'invoicing')
31 31
             ),
32 32
             'qty'    => sprintf(
33 33
                 '<span class="getpaid-hide-if-hours">%s</span><span class="getpaid-hide-if-quantity">%s</span>',
34
-                __( 'Quantity', 'invoicing' ),
35
-                __( 'Hours', 'invoicing' )
34
+                __('Quantity', 'invoicing'),
35
+                __('Hours', 'invoicing')
36 36
             ),
37
-            'total'  => __( 'Total', 'invoicing' ),
38
-            'tax'    => __( 'Tax (%)', 'invoicing' ),
37
+            'total'  => __('Total', 'invoicing'),
38
+            'tax'    => __('Tax (%)', 'invoicing'),
39 39
             'action' => '',
40 40
         );
41 41
 
42
-        if ( ! $use_taxes ) {
43
-            unset( $columns['tax'] );
42
+        if (!$use_taxes) {
43
+            unset($columns['tax']);
44 44
         }
45 45
 
46 46
         return $columns;
47 47
     }
48 48
 
49
-    public static function output( $post, $invoice = false ) {
49
+    public static function output($post, $invoice = false) {
50 50
 
51
-        if ( apply_filters( 'getpaid_use_new_invoice_items_metabox', false ) ) {
52
-            return self::output2( $post );
51
+        if (apply_filters('getpaid_use_new_invoice_items_metabox', false)) {
52
+            return self::output2($post);
53 53
         }
54 54
 
55
-        $post_id            = !empty( $post->ID ) ? $post->ID : 0;
56
-        $invoice            = $invoice instanceof WPInv_Invoice ? $invoice : new WPInv_Invoice( $post_id );
55
+        $post_id            = !empty($post->ID) ? $post->ID : 0;
56
+        $invoice            = $invoice instanceof WPInv_Invoice ? $invoice : new WPInv_Invoice($post_id);
57 57
         $use_taxes          = $invoice->is_taxable() && wpinv_use_taxes();
58
-        $item_types         = apply_filters( 'wpinv_item_types_for_quick_add_item', wpinv_get_item_types(), $post );
59
-        $columns            = self::get_columns( $invoice );
60
-        $cols               = count( $columns );
58
+        $item_types         = apply_filters('wpinv_item_types_for_quick_add_item', wpinv_get_item_types(), $post);
59
+        $columns            = self::get_columns($invoice);
60
+        $cols               = count($columns);
61 61
         $class              = '';
62 62
 
63
-        unset( $item_types['adv'] );
64
-        unset( $item_types['package'] );
63
+        unset($item_types['adv']);
64
+        unset($item_types['package']);
65 65
 
66
-        if ( $invoice->is_paid() ) {
66
+        if ($invoice->is_paid()) {
67 67
             $class .= ' wpinv-paid';
68 68
         }
69 69
 
70
-        if ( $invoice->is_refunded() ) {
70
+        if ($invoice->is_refunded()) {
71 71
             $class .= ' wpinv-refunded';
72 72
         }
73 73
 
74
-        if ( $invoice->is_recurring() ) {
74
+        if ($invoice->is_recurring()) {
75 75
             $class .= ' wpi-recurring';
76 76
         }
77 77
 
78 78
     ?>
79 79
 
80
-        <div class="wpinv-items-wrap<?php echo esc_attr( $class ); ?>" id="wpinv_items_wrap" data-status="<?php echo esc_attr( $invoice->get_status() ); ?>">
80
+        <div class="wpinv-items-wrap<?php echo esc_attr($class); ?>" id="wpinv_items_wrap" data-status="<?php echo esc_attr($invoice->get_status()); ?>">
81 81
             <table id="wpinv_items" class="wpinv-items" cellspacing="0" cellpadding="0">
82 82
 
83 83
                 <thead>
84 84
                     <tr>
85
-                        <?php foreach ( $columns as $key => $label ) : ?>
86
-                            <th class="<?php echo esc_attr( $key ); echo 'total' == $key || 'qty' == $key ? ' hide-if-amount' : '' ?>"><?php echo wp_kses_post( $label ); ?></th>
85
+                        <?php foreach ($columns as $key => $label) : ?>
86
+                            <th class="<?php echo esc_attr($key); echo 'total' == $key || 'qty' == $key ? ' hide-if-amount' : '' ?>"><?php echo wp_kses_post($label); ?></th>
87 87
                         <?php endforeach; ?>
88 88
                     </tr>
89 89
                 </thead>
90 90
 
91 91
                 <tbody class="wpinv-line-items">
92 92
                     <?php
93
-                        foreach ( $invoice->get_items() as $int => $item ) {
94
-                            self::output_row( $columns, $item, $invoice, $int % 2 == 0 ? 'even' : 'odd' );
93
+                        foreach ($invoice->get_items() as $int => $item) {
94
+                            self::output_row($columns, $item, $invoice, $int % 2 == 0 ? 'even' : 'odd');
95 95
                         }
96 96
                     ?>
97 97
                 </tbody>
@@ -108,7 +108,7 @@  discard block
 block discarded – undo
108 108
                                             <div class="wp-clearfix">
109 109
                                                 <label class="wpi-item-name">
110 110
                                                     <span class="input-text-wrap">
111
-                                                        <input type="text" style="width: 100%" placeholder="<?php esc_attr_e( 'Item Name', 'invoicing' );?>" class="wpinv-quick-item-name" name="_wpinv_quick[name]">
111
+                                                        <input type="text" style="width: 100%" placeholder="<?php esc_attr_e('Item Name', 'invoicing'); ?>" class="wpinv-quick-item-name" name="_wpinv_quick[name]">
112 112
                                                     </span>
113 113
                                                 </label>
114 114
                                             </div>
@@ -116,8 +116,8 @@  discard block
 block discarded – undo
116 116
                                             <div class="wp-clearfix">
117 117
                                                 <label class="wpi-item-price">
118 118
                                                     <span class="input-text-wrap">
119
-                                                    <input type="text" style="width: 200px" placeholder="<?php esc_attr_e( 'Item Price', 'invoicing' );?>" class="wpinv-quick-item-price" name="_wpinv_quick[price]">
120
-                                                        &times; <input type="text" style="width: 140px" placeholder="<?php esc_attr_e( 'Item Quantity', 'invoicing' );?>" class="wpinv-quick-item-qty" name="_wpinv_quick[qty]">
119
+                                                    <input type="text" style="width: 200px" placeholder="<?php esc_attr_e('Item Price', 'invoicing'); ?>" class="wpinv-quick-item-price" name="_wpinv_quick[price]">
120
+                                                        &times; <input type="text" style="width: 140px" placeholder="<?php esc_attr_e('Item Quantity', 'invoicing'); ?>" class="wpinv-quick-item-qty" name="_wpinv_quick[qty]">
121 121
                                                     </span>
122 122
                                                 </label>
123 123
                                             </div>
@@ -125,7 +125,7 @@  discard block
 block discarded – undo
125 125
                                             <div class="wp-clearfix">
126 126
                                                 <label class="wpi-item-name">
127 127
                                                     <span class="input-text-wrap">
128
-                                                        <textarea rows="4" style="width: 100%" placeholder="<?php esc_attr_e( 'Item Description', 'invoicing' );?>" class="wpinv-quick-item-description" name="_wpinv_quick[description]"></textarea>
128
+                                                        <textarea rows="4" style="width: 100%" placeholder="<?php esc_attr_e('Item Description', 'invoicing'); ?>" class="wpinv-quick-item-description" name="_wpinv_quick[description]"></textarea>
129 129
                                                     </span>
130 130
                                                 </label>
131 131
                                             </div>
@@ -133,7 +133,7 @@  discard block
 block discarded – undo
133 133
                                             <div class="wp-clearfix">
134 134
                                                 <label class="wpi-item-type">
135 135
                                                     <span class="input-text-wrap">
136
-                                                        <?php wpinv_html_select( array(
136
+                                                        <?php wpinv_html_select(array(
137 137
                                                             'options'          => $item_types,
138 138
                                                             'name'             => '_wpinv_quick[type]',
139 139
                                                             'id'               => '_wpinv_quick_type',
@@ -141,19 +141,19 @@  discard block
 block discarded – undo
141 141
                                                             'show_option_all'  => false,
142 142
                                                             'show_option_none' => false,
143 143
                                                             'class'            => 'gdmbx2-text-medium wpinv-quick-type',
144
-                                                        ) ); ?>
144
+                                                        )); ?>
145 145
                                                     </span>
146 146
                                                 </label>
147 147
                                             </div>
148 148
 
149
-                                            <?php if ( $use_taxes ) : ?>
149
+                                            <?php if ($use_taxes) : ?>
150 150
                                                 <div class="wp-clearfix">
151 151
                                                     <label class="wpi-vat-rule">
152 152
                                                         <span class="input-text-wrap">
153 153
                                                             <?php
154
-                                                                wpinv_html_select( array(
154
+                                                                wpinv_html_select(array(
155 155
                                                                     'options'          => array_merge(
156
-                                                                        array( '' => __( 'Select VAT Rule', 'invoicing' ) ),
156
+                                                                        array('' => __('Select VAT Rule', 'invoicing')),
157 157
                                                                         getpaid_get_tax_rules()
158 158
                                                                     ),
159 159
                                                                     'name'             => '_wpinv_quick[vat_rule]',
@@ -162,7 +162,7 @@  discard block
 block discarded – undo
162 162
                                                                     'show_option_none' => false,
163 163
                                                                     'class'            => 'gdmbx2-text-medium wpinv-quick-vat-rule',
164 164
                                                                     'selected'         => 'digital',
165
-                                                                ) );
165
+                                                                ));
166 166
                                                             ?>
167 167
                                                         </span>
168 168
                                                     </label>
@@ -171,9 +171,9 @@  discard block
 block discarded – undo
171 171
                                                     <label class="wpi-vat-class">
172 172
                                                         <span class="input-text-wrap">
173 173
                                                             <?php
174
-                                                                wpinv_html_select( array(
174
+                                                                wpinv_html_select(array(
175 175
                                                                     'options'          => array_merge(
176
-                                                                        array( '' => __( 'Select VAT Class', 'invoicing' ) ),
176
+                                                                        array('' => __('Select VAT Class', 'invoicing')),
177 177
                                                                         getpaid_get_tax_classes()
178 178
                                                                     ),
179 179
                                                                     'name'             => '_wpinv_quick[vat_class]',
@@ -182,7 +182,7 @@  discard block
 block discarded – undo
182 182
                                                                     'show_option_none' => false,
183 183
                                                                     'class'            => 'gdmbx2-text-medium wpinv-quick-vat-class',
184 184
                                                                     'selected'         => '_standard',
185
-                                                                ) );
185
+                                                                ));
186 186
                                                             ?>
187 187
                                                         </span>
188 188
                                                     </label>
@@ -203,29 +203,29 @@  discard block
 block discarded – undo
203 203
                         </td>
204 204
                     </tr>
205 205
                     <tr class="totals">
206
-                        <td colspan="<?php echo ( (int) $cols - 4 ); ?>"></td>
206
+                        <td colspan="<?php echo ((int) $cols - 4); ?>"></td>
207 207
                         <td colspan="4">
208 208
                             <table cellspacing="0" cellpadding="0">
209 209
                                 <tr class="subtotal">
210
-                                    <td class="name"><?php esc_html_e( 'Sub Total:', 'invoicing' );?></td>
211
-                                    <td class="total"><?php wpinv_the_price( $invoice->get_subtotal(), $invoice->get_currency() );?></td>
210
+                                    <td class="name"><?php esc_html_e('Sub Total:', 'invoicing'); ?></td>
211
+                                    <td class="total"><?php wpinv_the_price($invoice->get_subtotal(), $invoice->get_currency()); ?></td>
212 212
                                     <td class="action"></td>
213 213
                                 </tr>
214 214
                                 <tr class="discount">
215
-                                    <td class="name"><?php esc_html_e( 'Discount:', 'invoicing' ) ; ?></td>
216
-                                    <td class="total"><?php wpinv_the_price( $invoice->get_total_discount(), $invoice->get_currency() );?></td>
215
+                                    <td class="name"><?php esc_html_e('Discount:', 'invoicing'); ?></td>
216
+                                    <td class="total"><?php wpinv_the_price($invoice->get_total_discount(), $invoice->get_currency()); ?></td>
217 217
                                     <td class="action"></td>
218 218
                                 </tr>
219
-                                <?php if ( $use_taxes ) : ?>
219
+                                <?php if ($use_taxes) : ?>
220 220
                                 <tr class="tax">
221
-                                    <td class="name"><?php esc_html_e( 'Tax:', 'invoicing' );?></td>
222
-                                    <td class="total"><?php wpinv_the_price( $invoice->get_total_tax(), $invoice->get_currency() );?></td>
221
+                                    <td class="name"><?php esc_html_e('Tax:', 'invoicing'); ?></td>
222
+                                    <td class="total"><?php wpinv_the_price($invoice->get_total_tax(), $invoice->get_currency()); ?></td>
223 223
                                     <td class="action"></td>
224 224
                                 </tr>
225 225
                                 <?php endif; ?>
226 226
                                 <tr class="total">
227
-                                    <td class="name"><?php esc_html_e( 'Total:', 'invoicing' );?></td>
228
-                                    <td class="total"><?php wpinv_the_price( $invoice->get_total(), $invoice->get_currency() );?></td>
227
+                                    <td class="name"><?php esc_html_e('Total:', 'invoicing'); ?></td>
228
+                                    <td class="total"><?php wpinv_the_price($invoice->get_total(), $invoice->get_currency()); ?></td>
229 229
                                     <td class="action"></td>
230 230
                                 </tr>
231 231
                             </table>
@@ -236,7 +236,7 @@  discard block
 block discarded – undo
236 236
             </table>
237 237
             <div class="wpinv-actions">
238 238
                 <?php
239
-                    if ( ! $invoice->is_paid() && ! $invoice->is_refunded() ) {
239
+                    if (!$invoice->is_paid() && !$invoice->is_refunded()) {
240 240
                         wpinv_item_dropdown(
241 241
                             array(
242 242
                                 'name'             => 'wpinv_invoice_item',
@@ -246,61 +246,61 @@  discard block
 block discarded – undo
246 246
                             )
247 247
                         );
248 248
 
249
-                        echo "&nbsp;" . '<button class="button button-primary" id="wpinv-add-item">' . sprintf( esc_html__( 'Add item to %s', 'invoicing' ), esc_html( $invoice->get_label() ) ) . '</button>';
250
-                        echo "&nbsp;" . '<button class="button button-primary" id="wpinv-new-item">' . esc_html__( 'Create new item', 'invoicing' ) . '</button>';
251
-                        echo "&nbsp;" . '<button class="button button-primary wpinv-flr" id="wpinv-recalc-totals">' . esc_html__( 'Recalculate Totals', 'invoicing' ) . '</button>';
249
+                        echo "&nbsp;" . '<button class="button button-primary" id="wpinv-add-item">' . sprintf(esc_html__('Add item to %s', 'invoicing'), esc_html($invoice->get_label())) . '</button>';
250
+                        echo "&nbsp;" . '<button class="button button-primary" id="wpinv-new-item">' . esc_html__('Create new item', 'invoicing') . '</button>';
251
+                        echo "&nbsp;" . '<button class="button button-primary wpinv-flr" id="wpinv-recalc-totals">' . esc_html__('Recalculate Totals', 'invoicing') . '</button>';
252 252
 
253 253
                     }
254 254
                 ?>
255
-                <?php do_action( 'wpinv_invoice_items_actions', $invoice ); ?>
255
+                <?php do_action('wpinv_invoice_items_actions', $invoice); ?>
256 256
             </div>
257 257
         </div>
258 258
         <?php
259 259
     }
260 260
 
261
-    public static function output_row( $columns, $item, $invoice, $class='even' ) {
261
+    public static function output_row($columns, $item, $invoice, $class = 'even') {
262 262
 
263 263
     ?>
264
-        <tr class="item item-<?php echo esc_attr( $class ); ?>" data-item-id="<?php echo esc_attr( $item->get_id() ); ?>">
265
-            <?php foreach ( array_keys( $columns ) as $column ) : ?>
266
-                <td class="<?php echo esc_attr( $column ); echo 'total' == $column || 'qty' == $column ? ' hide-if-amount' : '' ?>">
264
+        <tr class="item item-<?php echo esc_attr($class); ?>" data-item-id="<?php echo esc_attr($item->get_id()); ?>">
265
+            <?php foreach (array_keys($columns) as $column) : ?>
266
+                <td class="<?php echo esc_attr($column); echo 'total' == $column || 'qty' == $column ? ' hide-if-amount' : '' ?>">
267 267
                     <?php
268
-                        switch ( $column ) {
268
+                        switch ($column) {
269 269
                             case 'id':
270 270
                                 echo (int) $item->get_id();
271 271
                                 break;
272 272
                             case 'title':
273 273
                                 printf(
274 274
                                     '<a href="%s" target="_blank">%s</a>',
275
-                                    esc_url( get_edit_post_link( $item->get_id() ) ),
276
-                                    esc_html( $item->get_raw_name() )
275
+                                    esc_url(get_edit_post_link($item->get_id())),
276
+                                    esc_html($item->get_raw_name())
277 277
                                 );
278 278
 
279
-                                $summary = apply_filters( 'getpaid_admin_invoice_line_item_summary', $item->get_description(), $item, $invoice );
280
-                                if ( $summary !== '' ) {
279
+                                $summary = apply_filters('getpaid_admin_invoice_line_item_summary', $item->get_description(), $item, $invoice);
280
+                                if ($summary !== '') {
281 281
                                     printf(
282 282
                                         '<span class="meta">%s</span>',
283
-                                        wp_kses_post( wpautop( $summary ) )
283
+                                        wp_kses_post(wpautop($summary))
284 284
                                     );
285 285
                                 }
286 286
 
287 287
                                 printf(
288 288
                                     '<input type="hidden" value="%s" name="getpaid_items[%s][name]" class="getpaid-recalculate-prices-on-change" />',
289
-                                    esc_attr( $item->get_raw_name() ),
289
+                                    esc_attr($item->get_raw_name()),
290 290
                                     (int) $item->get_id()
291 291
                                 );
292 292
 
293 293
                                 printf(
294 294
                                     '<textarea style="display: none;" name="getpaid_items[%s][description]" class="getpaid-recalculate-prices-on-change">%s</textarea>',
295 295
                                     (int) $item->get_id(),
296
-                                    esc_attr( $item->get_description() )
296
+                                    esc_attr($item->get_description())
297 297
                                 );
298 298
 
299 299
                                 break;
300 300
                             case 'price':
301 301
                                 printf(
302 302
                                     '<input type="text" value="%s" name="getpaid_items[%s][price]" style="width: 100px;" class="getpaid-admin-invoice-item-price getpaid-recalculate-prices-on-change" />',
303
-                                    esc_attr( getpaid_unstandardize_amount( $item->get_price() ) ),
303
+                                    esc_attr(getpaid_unstandardize_amount($item->get_price())),
304 304
                                     (int) $item->get_id()
305 305
                                 );
306 306
 
@@ -308,26 +308,26 @@  discard block
 block discarded – undo
308 308
                             case 'qty':
309 309
                                 printf(
310 310
                                     '<input type="text" style="width: 100px;" value="%s" name="getpaid_items[%s][quantity]" class="getpaid-admin-invoice-item-quantity getpaid-recalculate-prices-on-change" />',
311
-                                    floatval( $item->get_quantity() ),
311
+                                    floatval($item->get_quantity()),
312 312
                                     (int) $item->get_id()
313 313
                                 );
314 314
 
315 315
                                 break;
316 316
                             case 'total':
317
-                                wpinv_the_price( $item->get_sub_total(), $invoice->get_currency() );
317
+                                wpinv_the_price($item->get_sub_total(), $invoice->get_currency());
318 318
 
319 319
                                 break;
320 320
                             case 'tax':
321
-                                echo floatval( wpinv_round_amount( getpaid_get_invoice_tax_rate( $invoice, $item ), 2 ) ) . '%';
321
+                                echo floatval(wpinv_round_amount(getpaid_get_invoice_tax_rate($invoice, $item), 2)) . '%';
322 322
 
323 323
                                 break;
324 324
                             case 'action':
325
-                                if ( ! $invoice->is_paid() && ! $invoice->is_refunded() ) {
325
+                                if (!$invoice->is_paid() && !$invoice->is_refunded()) {
326 326
                                     echo '<i class="fa fa-trash wpinv-item-remove"></i>';
327 327
                                 }
328 328
                                 break;
329 329
                         }
330
-                        do_action( 'getpaid_admin_edit_invoice_item_' . $column, $item, $invoice );
330
+                        do_action('getpaid_admin_edit_invoice_item_' . $column, $item, $invoice);
331 331
                     ?>
332 332
                 </td>
333 333
             <?php endforeach; ?>
@@ -340,10 +340,10 @@  discard block
 block discarded – undo
340 340
 	 *
341 341
 	 * @param WP_Post $post
342 342
 	 */
343
-    public static function output2( $post ) {
343
+    public static function output2($post) {
344 344
 
345 345
         // Prepare the invoice.
346
-        $invoice = new WPInv_Invoice( $post );
346
+        $invoice = new WPInv_Invoice($post);
347 347
 
348 348
         // Invoice items.
349 349
         $items = $invoice->get_items();
@@ -351,28 +351,28 @@  discard block
 block discarded – undo
351 351
         $totals = array(
352 352
 
353 353
             'subtotal'  => array(
354
-                'label' => __( 'Items Subtotal', 'invoicing' ),
355
-                'value' => wpinv_price( $invoice->get_subtotal(), $invoice->get_currency() ),
354
+                'label' => __('Items Subtotal', 'invoicing'),
355
+                'value' => wpinv_price($invoice->get_subtotal(), $invoice->get_currency()),
356 356
             ),
357 357
 
358 358
             'discount'  => array(
359
-                'label' => __( 'Total Discount', 'invoicing' ),
360
-                'value' => wpinv_price( $invoice->get_total_discount(), $invoice->get_currency() ),
359
+                'label' => __('Total Discount', 'invoicing'),
360
+                'value' => wpinv_price($invoice->get_total_discount(), $invoice->get_currency()),
361 361
             ),
362 362
 
363 363
             'tax'       => array(
364
-                'label' => __( 'Total Tax', 'invoicing' ),
365
-                'value' => wpinv_price( $invoice->get_total_tax(), $invoice->get_currency() ),
364
+                'label' => __('Total Tax', 'invoicing'),
365
+                'value' => wpinv_price($invoice->get_total_tax(), $invoice->get_currency()),
366 366
             ),
367 367
 
368 368
             'total'     => array(
369
-                'label' => __( 'Invoice Total', 'invoicing' ),
370
-                'value' => wpinv_price( $invoice->get_total(), $invoice->get_currency() ),
369
+                'label' => __('Invoice Total', 'invoicing'),
370
+                'value' => wpinv_price($invoice->get_total(), $invoice->get_currency()),
371 371
             )
372 372
         );
373 373
 
374
-        if ( ! wpinv_use_taxes() ) {
375
-            unset( $totals['tax'] );
374
+        if (!wpinv_use_taxes()) {
375
+            unset($totals['tax']);
376 376
         }
377 377
 
378 378
         $item_args = array(
@@ -380,7 +380,7 @@  discard block
 block discarded – undo
380 380
             'orderby'        => 'title',
381 381
             'order'          => 'ASC',
382 382
             'posts_per_page' => -1,
383
-            'post_status'    => array( 'publish' ),
383
+            'post_status'    => array('publish'),
384 384
             'meta_query'     => array(
385 385
                 array(
386 386
                     'key'       => '_wpinv_type',
@@ -404,10 +404,10 @@  discard block
 block discarded – undo
404 404
             }
405 405
         </style>
406 406
 
407
-                <div class="bsui getpaid-invoice-items-inner <?php echo empty( $items ) ? 'no-items' : 'has-items'; ?> <?php echo $invoice->is_paid() || $invoice->is_refunded() ? 'not-editable' : 'editable'; ?>" style="margin-top: 1.5rem; padding: 0 12px 12px;">
407
+                <div class="bsui getpaid-invoice-items-inner <?php echo empty($items) ? 'no-items' : 'has-items'; ?> <?php echo $invoice->is_paid() || $invoice->is_refunded() ? 'not-editable' : 'editable'; ?>" style="margin-top: 1.5rem; padding: 0 12px 12px;">
408 408
 
409
-                    <?php if ( ! $invoice->is_paid() && ! $invoice->is_refunded() ) : ?>
410
-                        <?php do_action( 'wpinv_meta_box_before_invoice_template_row', $invoice->get_id() ); ?>
409
+                    <?php if (!$invoice->is_paid() && !$invoice->is_refunded()) : ?>
410
+                        <?php do_action('wpinv_meta_box_before_invoice_template_row', $invoice->get_id()); ?>
411 411
 
412 412
                         <div class="row">
413 413
                             <div class="col-12 col-sm-6">
@@ -416,15 +416,15 @@  discard block
 block discarded – undo
416 416
                                         array(
417 417
                                             'id'          => 'wpinv_template',
418 418
                                             'name'        => 'wpinv_template',
419
-                                            'label'       => __( 'Template', 'invoicing' ),
419
+                                            'label'       => __('Template', 'invoicing'),
420 420
                                             'label_type'  => 'vertical',
421
-                                            'placeholder' => __( 'Choose a template', 'invoicing' ),
421
+                                            'placeholder' => __('Choose a template', 'invoicing'),
422 422
                                             'class'       => 'form-control-sm',
423
-                                            'value'       => $invoice->get_template( 'edit' ),
423
+                                            'value'       => $invoice->get_template('edit'),
424 424
                                             'options'     => array(
425
-                                                'quantity' => __( 'Quantity', 'invoicing' ),
426
-                                                'hours'    => __( 'Hours', 'invoicing' ),
427
-                                                'amount'   => __( 'Amount Only', 'invoicing' ),
425
+                                                'quantity' => __('Quantity', 'invoicing'),
426
+                                                'hours'    => __('Hours', 'invoicing'),
427
+                                                'amount'   => __('Amount Only', 'invoicing'),
428 428
                                             ),
429 429
                                             'data-allow-clear' => 'false',
430 430
                                             'select2'          => true,
@@ -441,11 +441,11 @@  discard block
 block discarded – undo
441 441
                                         array(
442 442
                                             'id'          => 'wpinv_currency',
443 443
                                             'name'        => 'wpinv_currency',
444
-                                            'label'       => __( 'Currency', 'invoicing' ),
444
+                                            'label'       => __('Currency', 'invoicing'),
445 445
                                             'label_type'  => 'vertical',
446
-                                            'placeholder' => __( 'Select Invoice Currency', 'invoicing' ),
446
+                                            'placeholder' => __('Select Invoice Currency', 'invoicing'),
447 447
                                             'class'       => 'form-control-sm',
448
-                                            'value'       => $invoice->get_currency( 'edit' ),
448
+                                            'value'       => $invoice->get_currency('edit'),
449 449
                                             'required'    => false,
450 450
                                             'data-allow-clear' => 'false',
451 451
                                             'select2'          => true,
@@ -458,24 +458,24 @@  discard block
 block discarded – undo
458 458
                             </div>
459 459
                         </div>
460 460
 
461
-                        <?php do_action( 'wpinv_meta_box_invoice_template_row', $invoice->get_id() ); ?>
461
+                        <?php do_action('wpinv_meta_box_invoice_template_row', $invoice->get_id()); ?>
462 462
                     <?php endif; ?>
463 463
 
464 464
                     <table cellpadding="0" cellspacing="0" class="getpaid_invoice_items">
465 465
                         <thead>
466 466
                             <tr>
467
-                                <th class="getpaid-item" colspan="2"><?php esc_html_e( 'Item', 'invoicing' ) ?></th>
467
+                                <th class="getpaid-item" colspan="2"><?php esc_html_e('Item', 'invoicing') ?></th>
468 468
                                 <th class="getpaid-quantity hide-if-amount text-right">
469
-                                    <span class="getpaid-hide-if-hours"><?php esc_html_e( 'Quantity', 'invoicing' ) ?></span>
470
-                                    <span class="getpaid-hide-if-quantity"><?php esc_html_e( 'Hours', 'invoicing' ) ?></span>
469
+                                    <span class="getpaid-hide-if-hours"><?php esc_html_e('Quantity', 'invoicing') ?></span>
470
+                                    <span class="getpaid-hide-if-quantity"><?php esc_html_e('Hours', 'invoicing') ?></span>
471 471
                                 </th>
472 472
                                 <th class="getpaid-price hide-if-amount text-right">
473
-                                    <span class="getpaid-hide-if-hours"><?php esc_html_e( 'Price', 'invoicing' ) ?></span>
474
-                                    <span class="getpaid-hide-if-quantity"><?php esc_html_e( 'Rate', 'invoicing' ) ?></span>
473
+                                    <span class="getpaid-hide-if-hours"><?php esc_html_e('Price', 'invoicing') ?></span>
474
+                                    <span class="getpaid-hide-if-quantity"><?php esc_html_e('Rate', 'invoicing') ?></span>
475 475
                                 </th>
476 476
                                 <th class="getpaid-item-subtotal text-right">
477
-                                    <span class="getpaid-hide-if-hours getpaid-hide-if-quantity"><?php esc_html_e( 'Amount', 'invoicing' ) ?></span>
478
-                                    <span class="hide-if-amount"><?php esc_html_e( 'Total', 'invoicing' ) ?></span>
477
+                                    <span class="getpaid-hide-if-hours getpaid-hide-if-quantity"><?php esc_html_e('Amount', 'invoicing') ?></span>
478
+                                    <span class="hide-if-amount"><?php esc_html_e('Total', 'invoicing') ?></span>
479 479
                                 </th>
480 480
                                 <th class="getpaid-item-actions hide-if-not-editable" width="70px">&nbsp;</th>
481 481
                             </tr>
@@ -483,8 +483,8 @@  discard block
 block discarded – undo
483 483
 		                <tbody class="getpaid_invoice_line_items">
484 484
                             <tr class="hide-if-has-items hide-if-not-editable">
485 485
                                 <td colspan="2" class="pt-4 pb-4">
486
-                                    <button type="button" class="button button-primary add-invoice-item" data-toggle="modal" data-target="#getpaid-add-items-to-invoice"><?php esc_html_e( 'Add Existing Items', 'invoicing' ) ?></button>
487
-                                    <button type="button" class="button button-secondary create-invoice-item" data-toggle="modal" data-target="#getpaid-create-invoice-item"><?php esc_html_e( 'Create New Item', 'invoicing' ) ?></button>
486
+                                    <button type="button" class="button button-primary add-invoice-item" data-toggle="modal" data-target="#getpaid-add-items-to-invoice"><?php esc_html_e('Add Existing Items', 'invoicing') ?></button>
487
+                                    <button type="button" class="button button-secondary create-invoice-item" data-toggle="modal" data-target="#getpaid-create-invoice-item"><?php esc_html_e('Create New Item', 'invoicing') ?></button>
488 488
                                 </td>
489 489
                                 <td class="hide-if-amount">&nbsp;</th>
490 490
                                 <td class="hide-if-amount">&nbsp;</th>
@@ -516,11 +516,11 @@  discard block
 block discarded – undo
516 516
                             <div class="col-12 col-sm-6 offset-sm-6">
517 517
                                 <table class="getpaid-invoice-totals text-right w-100">
518 518
                                     <tbody>
519
-                                        <?php foreach ( apply_filters( 'getpaid_invoice_subtotal_rows', $totals, $invoice ) as $key => $data ) : ?>
520
-                                            <tr class="getpaid-totals-<?php echo esc_attr( $key ); ?>">
521
-                                                <td class="label"><?php echo esc_html( $data['label'] ) ?>:</td>
519
+                                        <?php foreach (apply_filters('getpaid_invoice_subtotal_rows', $totals, $invoice) as $key => $data) : ?>
520
+                                            <tr class="getpaid-totals-<?php echo esc_attr($key); ?>">
521
+                                                <td class="label"><?php echo esc_html($data['label']) ?>:</td>
522 522
                                                 <td width="1%"></td>
523
-                                                <td class="value"><?php echo wp_kses_post( $data['value'] ) ?></td>
523
+                                                <td class="value"><?php echo wp_kses_post($data['value']) ?></td>
524 524
                                             </tr>
525 525
                                         <?php endforeach; ?>
526 526
                                     </tbody>
@@ -533,18 +533,18 @@  discard block
 block discarded – undo
533 533
                     <div class="getpaid-invoice-item-actions hide-if-no-items hide-if-not-editable">
534 534
                         <div class="row">
535 535
                             <div class="text-left col-12 col-sm-8">
536
-                                <button type="button" class="button button-primary add-invoice-item" data-toggle="modal" data-target="#getpaid-add-items-to-invoice"><?php esc_html_e( 'Add Existing Item', 'invoicing' ) ?></button>
537
-                                <button type="button" class="button button-secondary create-invoice-item" data-toggle="modal" data-target="#getpaid-create-invoice-item"><?php esc_html_e( 'Create New Item', 'invoicing' ) ?></button>
538
-                                <?php do_action( 'getpaid-invoice-items-actions', $invoice ); ?>
536
+                                <button type="button" class="button button-primary add-invoice-item" data-toggle="modal" data-target="#getpaid-add-items-to-invoice"><?php esc_html_e('Add Existing Item', 'invoicing') ?></button>
537
+                                <button type="button" class="button button-secondary create-invoice-item" data-toggle="modal" data-target="#getpaid-create-invoice-item"><?php esc_html_e('Create New Item', 'invoicing') ?></button>
538
+                                <?php do_action('getpaid-invoice-items-actions', $invoice); ?>
539 539
                             </div>
540 540
                             <div class="text-right col-12 col-sm-4">
541
-                                <button type="button" class="button button-primary recalculate-totals-button"><?php esc_html_e( 'Recalculate Totals', 'invoicing' ) ?></button>
541
+                                <button type="button" class="button button-primary recalculate-totals-button"><?php esc_html_e('Recalculate Totals', 'invoicing') ?></button>
542 542
                             </div>
543 543
                         </div>
544 544
                     </div>
545 545
 
546 546
                     <div class="getpaid-invoice-item-actions hide-if-editable">
547
-                        <p class="description m-2 text-right text-muted"><?php esc_html_e( 'This invoice is no longer editable', 'invoicing' ); ?></p>
547
+                        <p class="description m-2 text-right text-muted"><?php esc_html_e('This invoice is no longer editable', 'invoicing'); ?></p>
548 548
                     </div>
549 549
 
550 550
                     <!-- Add items to an invoice -->
@@ -552,9 +552,9 @@  discard block
 block discarded – undo
552 552
                         <div class="modal-dialog modal-dialog-centered" role="document">
553 553
                             <div class="modal-content">
554 554
                                 <div class="modal-header">
555
-                                    <h5 class="modal-title" id="getpaid-add-item-to-invoice-label"><?php esc_html_e( "Add Item(s)", 'invoicing' ); ?></h5>
556
-                                    <button type="button" class="close btn-close" data-dismiss="modal" aria-label="<?php esc_html_e( "Close", 'invoicing' ); ?>">
557
-                                        <?php if ( empty( $GLOBALS['aui_bs5'] ) ) : ?>
555
+                                    <h5 class="modal-title" id="getpaid-add-item-to-invoice-label"><?php esc_html_e("Add Item(s)", 'invoicing'); ?></h5>
556
+                                    <button type="button" class="close btn-close" data-dismiss="modal" aria-label="<?php esc_html_e("Close", 'invoicing'); ?>">
557
+                                        <?php if (empty($GLOBALS['aui_bs5'])) : ?>
558 558
                                             <span aria-hidden="true">×</span>
559 559
                                         <?php endif; ?>
560 560
                                     </button>
@@ -563,10 +563,10 @@  discard block
 block discarded – undo
563 563
                                     <table class="widefat">
564 564
                                         <thead>
565 565
                                             <tr>
566
-                                                <th class="pl-0 text-left"><?php esc_html_e( 'Item', 'invoicing' ) ?></th>
566
+                                                <th class="pl-0 text-left"><?php esc_html_e('Item', 'invoicing') ?></th>
567 567
                                                 <th class="pr-0 text-right hide-if-amount">
568
-                                                    <span class="getpaid-hide-if-hours"><?php esc_html_e( 'Quantity', 'invoicing' ) ?></span>
569
-                                                    <span class="getpaid-hide-if-quantity"><?php esc_html_e( 'Hours', 'invoicing' ) ?></span>
568
+                                                    <span class="getpaid-hide-if-hours"><?php esc_html_e('Quantity', 'invoicing') ?></span>
569
+                                                    <span class="getpaid-hide-if-quantity"><?php esc_html_e('Hours', 'invoicing') ?></span>
570 570
                                                 </th>
571 571
                                             </tr>
572 572
                                         </thead>
@@ -574,9 +574,9 @@  discard block
 block discarded – undo
574 574
 								            <tr>
575 575
 									            <td class="pl-0 text-left">
576 576
                                                     <select class="regular-text getpaid-add-invoice-item-select">
577
-                                                        <option value="" selected="selected" disabled><?php esc_html_e( 'Select an item…', 'invoicing' ); ?></option>
578
-                                                        <?php foreach ( get_posts( $item_args ) as $item ) : ?>
579
-                                                        <option value="<?php echo (int) $item->ID; ?>"><?php echo esc_html( $item->post_title ); ?></option>
577
+                                                        <option value="" selected="selected" disabled><?php esc_html_e('Select an item…', 'invoicing'); ?></option>
578
+                                                        <?php foreach (get_posts($item_args) as $item) : ?>
579
+                                                        <option value="<?php echo (int) $item->ID; ?>"><?php echo esc_html($item->post_title); ?></option>
580 580
                                                         <?php endforeach; ?>
581 581
                                                     </select>
582 582
                                                 </td>
@@ -588,8 +588,8 @@  discard block
 block discarded – undo
588 588
 						            </table>
589 589
                                 </div>
590 590
                                 <div class="modal-footer">
591
-                                    <button type="button" class="btn btn-secondary getpaid-cancel" data-dismiss="modal"><?php esc_html_e( 'Cancel', 'invoicing' ); ?></button>
592
-                                    <button type="button" class="btn btn-primary getpaid-add" data-dismiss="modal"><?php esc_html_e( 'Add', 'invoicing' ); ?></button>
591
+                                    <button type="button" class="btn btn-secondary getpaid-cancel" data-dismiss="modal"><?php esc_html_e('Cancel', 'invoicing'); ?></button>
592
+                                    <button type="button" class="btn btn-primary getpaid-add" data-dismiss="modal"><?php esc_html_e('Add', 'invoicing'); ?></button>
593 593
                                 </div>
594 594
                             </div>
595 595
                         </div>
@@ -600,9 +600,9 @@  discard block
 block discarded – undo
600 600
                         <div class="modal-dialog modal-dialog-centered" role="document">
601 601
                             <div class="modal-content">
602 602
                                 <div class="modal-header">
603
-                                    <h5 class="modal-title" id="getpaid-create-invoice-item-label"><?php esc_html_e( "Create Item", 'invoicing' ); ?></h5>
604
-                                    <button type="button" class="close btn-close" data-dismiss="modal" aria-label="<?php esc_html_e( "Close", 'invoicing' ); ?>">
605
-                                        <?php if ( empty( $GLOBALS['aui_bs5'] ) ) : ?>
603
+                                    <h5 class="modal-title" id="getpaid-create-invoice-item-label"><?php esc_html_e("Create Item", 'invoicing'); ?></h5>
604
+                                    <button type="button" class="close btn-close" data-dismiss="modal" aria-label="<?php esc_html_e("Close", 'invoicing'); ?>">
605
+                                        <?php if (empty($GLOBALS['aui_bs5'])) : ?>
606 606
                                             <span aria-hidden="true">×</span>
607 607
                                         <?php endif; ?>
608 608
                                     </button>
@@ -611,27 +611,27 @@  discard block
 block discarded – undo
611 611
                                     <div class="getpaid-create-item-div">
612 612
                                         <input type="hidden" name="id" value="new" class="form-control form-control-sm item-id">
613 613
                                         <label class="form-group mb-3 w-100">
614
-                                            <span><?php esc_html_e( 'Name', 'invoicing' ); ?></span>
615
-                                            <input type="text" name="name" placeholder="<?php esc_attr_e( 'Item Name', 'invoicing' ); ?>" class="form-control form-control-sm item-name">
614
+                                            <span><?php esc_html_e('Name', 'invoicing'); ?></span>
615
+                                            <input type="text" name="name" placeholder="<?php esc_attr_e('Item Name', 'invoicing'); ?>" class="form-control form-control-sm item-name">
616 616
                                         </label>
617 617
                                         <label class="form-group mb-3 w-100">
618
-                                            <span class="getpaid-hide-if-hours getpaid-hide-if-quantity item-price"><?php esc_html_e( 'Amount', 'invoicing' ); ?></span>
619
-                                            <span class="hide-if-amount"><?php esc_html_e( 'Price', 'invoicing' ); ?></span>
620
-                                            <input type="text" name="price" placeholder="<?php echo esc_attr( wpinv_sanitize_amount( 0 ) ); ?>" class="form-control form-control-sm item-price">
618
+                                            <span class="getpaid-hide-if-hours getpaid-hide-if-quantity item-price"><?php esc_html_e('Amount', 'invoicing'); ?></span>
619
+                                            <span class="hide-if-amount"><?php esc_html_e('Price', 'invoicing'); ?></span>
620
+                                            <input type="text" name="price" placeholder="<?php echo esc_attr(wpinv_sanitize_amount(0)); ?>" class="form-control form-control-sm item-price">
621 621
                                         </label>
622 622
                                         <label class="form-group mb-3 w-100 hide-if-amount">
623
-                                            <span><?php esc_html_e( 'Quantity', 'invoicing' ); ?></span>
623
+                                            <span><?php esc_html_e('Quantity', 'invoicing'); ?></span>
624 624
                                             <input type="text" name="quantity" placeholder="1" class="form-control form-control-sm item-quantity">
625 625
                                         </label>
626 626
                                         <label class="form-group mb-3 w-100">
627
-                                            <span><?php esc_html_e( 'Item Description', 'invoicing' ); ?></span>
628
-                                            <textarea name="description" placeholder="<?php esc_attr_e( 'Enter a description for this item', 'invoicing' ); ?>" class="form-control item-description"></textarea>
627
+                                            <span><?php esc_html_e('Item Description', 'invoicing'); ?></span>
628
+                                            <textarea name="description" placeholder="<?php esc_attr_e('Enter a description for this item', 'invoicing'); ?>" class="form-control item-description"></textarea>
629 629
                                         </label>
630 630
                                     </div>
631 631
                                 </div>
632 632
                                 <div class="modal-footer">
633
-                                    <button type="button" class="btn btn-secondary getpaid-cancel" data-dismiss="modal"><?php esc_html_e( 'Cancel', 'invoicing' ); ?></button>
634
-                                    <button type="button" class="btn btn-primary getpaid-save" data-dismiss="modal"><?php esc_html_e( 'Create', 'invoicing' ); ?></button>
633
+                                    <button type="button" class="btn btn-secondary getpaid-cancel" data-dismiss="modal"><?php esc_html_e('Cancel', 'invoicing'); ?></button>
634
+                                    <button type="button" class="btn btn-primary getpaid-save" data-dismiss="modal"><?php esc_html_e('Create', 'invoicing'); ?></button>
635 635
                                 </div>
636 636
                             </div>
637 637
                         </div>
@@ -642,9 +642,9 @@  discard block
 block discarded – undo
642 642
                         <div class="modal-dialog modal-dialog-centered" role="document">
643 643
                             <div class="modal-content">
644 644
                                 <div class="modal-header">
645
-                                    <h5 class="modal-title" id="getpaid-edit-invoice-item-label"><?php esc_html_e( "Edit Item", 'invoicing' ); ?></h5>
646
-                                    <button type="button" class="close close" data-dismiss="modal" aria-label="<?php esc_html_e( "Close", 'invoicing' ); ?>">
647
-                                        <?php if ( empty( $GLOBALS['aui_bs5'] ) ) : ?>
645
+                                    <h5 class="modal-title" id="getpaid-edit-invoice-item-label"><?php esc_html_e("Edit Item", 'invoicing'); ?></h5>
646
+                                    <button type="button" class="close close" data-dismiss="modal" aria-label="<?php esc_html_e("Close", 'invoicing'); ?>">
647
+                                        <?php if (empty($GLOBALS['aui_bs5'])) : ?>
648 648
                                             <span aria-hidden="true">×</span>
649 649
                                         <?php endif; ?>
650 650
                                     </button>
@@ -653,27 +653,27 @@  discard block
 block discarded – undo
653 653
                                     <div class="getpaid-edit-item-div">
654 654
                                         <input type="hidden" name="id" class="form-control form-control-sm item-id">
655 655
                                         <label class="form-group mb-3 w-100">
656
-                                            <span><?php esc_html_e( 'Name', 'invoicing' ); ?></span>
657
-                                            <input type="text" name="name" placeholder="<?php esc_attr_e( 'Item Name', 'invoicing' ); ?>" class="form-control form-control-sm item-name">
656
+                                            <span><?php esc_html_e('Name', 'invoicing'); ?></span>
657
+                                            <input type="text" name="name" placeholder="<?php esc_attr_e('Item Name', 'invoicing'); ?>" class="form-control form-control-sm item-name">
658 658
                                         </label>
659 659
                                         <label class="form-group mb-3 w-100">
660
-                                            <span class="getpaid-hide-if-hours getpaid-hide-if-quantity item-price"><?php esc_html_e( 'Amount', 'invoicing' ); ?></span>
661
-                                            <span class="hide-if-amount"><?php esc_html_e( 'Price', 'invoicing' ); ?></span>
662
-                                            <input type="text" name="price" placeholder="<?php wpinv_sanitize_amount( 0 ); ?>" class="form-control form-control-sm item-price">
660
+                                            <span class="getpaid-hide-if-hours getpaid-hide-if-quantity item-price"><?php esc_html_e('Amount', 'invoicing'); ?></span>
661
+                                            <span class="hide-if-amount"><?php esc_html_e('Price', 'invoicing'); ?></span>
662
+                                            <input type="text" name="price" placeholder="<?php wpinv_sanitize_amount(0); ?>" class="form-control form-control-sm item-price">
663 663
                                         </label>
664 664
                                         <label class="form-group mb-3 w-100 hide-if-amount">
665
-                                            <span><?php esc_html_e( 'Quantity', 'invoicing' ); ?></span>
665
+                                            <span><?php esc_html_e('Quantity', 'invoicing'); ?></span>
666 666
                                             <input type="text" name="quantity" placeholder="1" class="form-control form-control-sm item-quantity">
667 667
                                         </label>
668 668
                                         <label class="form-group mb-3 w-100">
669
-                                            <span><?php esc_html_e( 'Item Description', 'invoicing' ); ?></span>
670
-                                            <textarea name="description" placeholder="<?php esc_attr_e( 'Enter a description for this item', 'invoicing' ); ?>" class="form-control item-description"></textarea>
669
+                                            <span><?php esc_html_e('Item Description', 'invoicing'); ?></span>
670
+                                            <textarea name="description" placeholder="<?php esc_attr_e('Enter a description for this item', 'invoicing'); ?>" class="form-control item-description"></textarea>
671 671
                                         </label>
672 672
                                     </div>
673 673
                                 </div>
674 674
                                 <div class="modal-footer">
675
-                                    <button type="button" class="btn btn-secondary getpaid-cancel" data-dismiss="modal"><?php esc_html_e( 'Cancel', 'invoicing' ); ?></button>
676
-                                    <button type="button" class="btn btn-primary getpaid-save" data-dismiss="modal"><?php esc_html_e( 'Save', 'invoicing' ); ?></button>
675
+                                    <button type="button" class="btn btn-secondary getpaid-cancel" data-dismiss="modal"><?php esc_html_e('Cancel', 'invoicing'); ?></button>
676
+                                    <button type="button" class="btn btn-primary getpaid-save" data-dismiss="modal"><?php esc_html_e('Save', 'invoicing'); ?></button>
677 677
                                 </div>
678 678
                             </div>
679 679
                         </div>
Please login to merge, or discard this patch.
includes/admin/views/html-tax-rule-edit.php 1 patch
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -5,38 +5,38 @@
 block discarded – undo
5 5
  * @var array $tax_rule
6 6
  */
7 7
 
8
-defined( 'ABSPATH' ) || exit;
8
+defined('ABSPATH') || exit;
9 9
 
10 10
 ?>
11 11
 
12 12
 <tr>
13 13
 
14 14
     <td class="wpinv-tax-rule-key">
15
-        <input type="text" name="tax_rules[<?php echo esc_attr( $tax_rule['key'] ); ?>][key]" value="<?php echo esc_attr( $tax_rule['key'] ); ?>" required/>
15
+        <input type="text" name="tax_rules[<?php echo esc_attr($tax_rule['key']); ?>][key]" value="<?php echo esc_attr($tax_rule['key']); ?>" required/>
16 16
     </td>
17 17
 
18 18
     <td class="wpinv-tax-rule-label">
19
-        <input type="text" name="tax_rules[<?php echo esc_attr( $tax_rule['key'] ); ?>][label]" value="<?php echo esc_attr( $tax_rule['label'] ); ?>" required/>
19
+        <input type="text" name="tax_rules[<?php echo esc_attr($tax_rule['key']); ?>][label]" value="<?php echo esc_attr($tax_rule['label']); ?>" required/>
20 20
     </td>
21 21
 
22 22
     <td class="wpinv-tax-rule-base-address">
23
-        <select name="tax_rules[<?php echo esc_attr( $tax_rule['key'] ); ?>][tax_base]" class="getpaid-tax-rule-base-address" required>
24
-            <option value="billing" <?php selected( $tax_rule['tax_base'], 'billing' ); ?>><?php esc_html_e( 'Customer billing address', 'invoicing' ); ?></option>
25
-            <option value="base" <?php selected( $tax_rule['tax_base'], 'base' ); ?>><?php esc_html_e( 'Shop base address', 'invoicing' ); ?></option>
23
+        <select name="tax_rules[<?php echo esc_attr($tax_rule['key']); ?>][tax_base]" class="getpaid-tax-rule-base-address" required>
24
+            <option value="billing" <?php selected($tax_rule['tax_base'], 'billing'); ?>><?php esc_html_e('Customer billing address', 'invoicing'); ?></option>
25
+            <option value="base" <?php selected($tax_rule['tax_base'], 'base'); ?>><?php esc_html_e('Shop base address', 'invoicing'); ?></option>
26 26
         </select>
27 27
     </td>
28 28
 
29 29
     <!-- <td class="wpinv-tax-rule-same-country">
30
-        <select name="tax_rules[<?php echo esc_attr( $tax_rule['key'] ); ?>][same_country_rule]" class="getpaid-tax-rule-same-country" required>
31
-            <option value="no" <?php selected( $tax_rule['same_country_rule'], 'no' ); ?>><?php esc_html_e( 'Do not charge tax', 'invoicing' ); ?></option>
32
-            <option value="always" <?php selected( $tax_rule['same_country_rule'], 'always' ); ?>><?php esc_html_e( 'Charge tax unless vat number is validated', 'invoicing' ); ?></option>
33
-            <option value="vat_too" <?php selected( $tax_rule['same_country_rule'], 'vat_too' ); ?>><?php esc_html_e( 'Charge tax even if vat number is validated', 'invoicing' ); ?></option>
30
+        <select name="tax_rules[<?php echo esc_attr($tax_rule['key']); ?>][same_country_rule]" class="getpaid-tax-rule-same-country" required>
31
+            <option value="no" <?php selected($tax_rule['same_country_rule'], 'no'); ?>><?php esc_html_e('Do not charge tax', 'invoicing'); ?></option>
32
+            <option value="always" <?php selected($tax_rule['same_country_rule'], 'always'); ?>><?php esc_html_e('Charge tax unless vat number is validated', 'invoicing'); ?></option>
33
+            <option value="vat_too" <?php selected($tax_rule['same_country_rule'], 'vat_too'); ?>><?php esc_html_e('Charge tax even if vat number is validated', 'invoicing'); ?></option>
34 34
         </select>
35 35
     </td> -->
36 36
 
37 37
     <td class="wpinv_tax_remove">
38
-        <button type="button" class="close btn-close wpinv_remove_tax_rule" aria-label="<?php esc_attr_e( 'Delete', 'invoicing' ); ?>" title="<?php esc_attr_e( 'Delete', 'invoicing' ); ?>">
39
-            <?php if ( empty( $GLOBALS['aui_bs5'] ) ) : ?>
38
+        <button type="button" class="close btn-close wpinv_remove_tax_rule" aria-label="<?php esc_attr_e('Delete', 'invoicing'); ?>" title="<?php esc_attr_e('Delete', 'invoicing'); ?>">
39
+            <?php if (empty($GLOBALS['aui_bs5'])) : ?>
40 40
                 <span aria-hidden="true">×</span>
41 41
             <?php endif; ?>
42 42
         </button>
Please login to merge, or discard this patch.
includes/admin/views/html-tax-rate-edit.php 1 patch
Spacing   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -6,7 +6,7 @@  discard block
 block discarded – undo
6 6
  * @var array $tax_rate
7 7
  */
8 8
 
9
-defined( 'ABSPATH' ) || exit;
9
+defined('ABSPATH') || exit;
10 10
 
11 11
 ?>
12 12
 
@@ -18,13 +18,13 @@  discard block
 block discarded – undo
18 18
             aui()->select(
19 19
                 array(
20 20
                     'options' => array_merge(
21
-                        array( '' => __( 'All Countries', 'invoicing' ) ),
21
+                        array('' => __('All Countries', 'invoicing')),
22 22
                         wpinv_get_country_list()
23 23
                     ),
24 24
                     'name'    => "tax_rates[$key][country]",
25
-                    'id'      => uniqid( 'tax_rate_country' ),
26
-                    'value'   => esc_html( $tax_rate['country'] ),
27
-                    'label'   => __( 'Country', 'invoicing' ),
25
+                    'id'      => uniqid('tax_rate_country'),
26
+                    'value'   => esc_html($tax_rate['country']),
27
+                    'label'   => __('Country', 'invoicing'),
28 28
                     'class'   => 'wpinv_country',
29 29
                     'no_wrap' => true,
30 30
                 ),
@@ -37,36 +37,36 @@  discard block
 block discarded – undo
37 37
     <td class="wpinv_tax_state">
38 38
 
39 39
         <label class="w-100">
40
-            <span class="screen-reader-text"><?php esc_html_e( 'States', 'invoicing' ); ?></span>
41
-            <input type="text" placeholder="<?php esc_attr_e( 'Apply to whole country', 'invoicing' ); ?>" name="tax_rates[<?php echo esc_attr( $key ); ?>][state]" value="<?php echo empty( $tax_rate['global'] ) ? esc_attr( $tax_rate['state'] ) : ''; ?>"/>
40
+            <span class="screen-reader-text"><?php esc_html_e('States', 'invoicing'); ?></span>
41
+            <input type="text" placeholder="<?php esc_attr_e('Apply to whole country', 'invoicing'); ?>" name="tax_rates[<?php echo esc_attr($key); ?>][state]" value="<?php echo empty($tax_rate['global']) ? esc_attr($tax_rate['state']) : ''; ?>"/>
42 42
         </label>
43 43
 
44 44
     </td>
45 45
 
46 46
     <td class="wpinv_standard_rate">
47 47
         <label class="w-100">
48
-            <span class="screen-reader-text"><?php esc_html_e( 'Standard Rate', 'invoicing' ); ?></span>
49
-            <input type="number" step="any" min="0" max="99" name="tax_rates[<?php echo esc_attr( $key ); ?>][rate]" value="<?php echo esc_attr( $tax_rate['rate'] ); ?>"/>
48
+            <span class="screen-reader-text"><?php esc_html_e('Standard Rate', 'invoicing'); ?></span>
49
+            <input type="number" step="any" min="0" max="99" name="tax_rates[<?php echo esc_attr($key); ?>][rate]" value="<?php echo esc_attr($tax_rate['rate']); ?>"/>
50 50
         </label>
51 51
     </td>
52 52
 
53 53
     <td class="wpinv_reduced_rate">
54 54
         <label class="w-100">
55
-            <span class="screen-reader-text"><?php esc_html_e( 'Reduced Rate', 'invoicing' ); ?></span>
56
-            <input type="number" step="any" min="0" max="99" name="tax_rates[<?php echo esc_attr( $key ); ?>][reduced_rate]" value="<?php echo esc_attr( $tax_rate['reduced_rate'] ); ?>"/>
55
+            <span class="screen-reader-text"><?php esc_html_e('Reduced Rate', 'invoicing'); ?></span>
56
+            <input type="number" step="any" min="0" max="99" name="tax_rates[<?php echo esc_attr($key); ?>][reduced_rate]" value="<?php echo esc_attr($tax_rate['reduced_rate']); ?>"/>
57 57
         </label>
58 58
     </td>
59 59
 
60 60
     <td class="wpinv_tax_name">
61 61
         <label class="w-100">
62
-            <span class="screen-reader-text"><?php esc_html_e( 'Tax Name', 'invoicing' ); ?></span>
63
-            <input type="text" name="tax_rates[<?php echo esc_attr( $key ); ?>][name]" value="<?php echo esc_attr( $tax_rate['name'] ); ?>"/>
62
+            <span class="screen-reader-text"><?php esc_html_e('Tax Name', 'invoicing'); ?></span>
63
+            <input type="text" name="tax_rates[<?php echo esc_attr($key); ?>][name]" value="<?php echo esc_attr($tax_rate['name']); ?>"/>
64 64
         </label>
65 65
     </td>
66 66
 
67 67
     <td class="wpinv_tax_remove">
68
-        <button type="button" class="close btn-close wpinv_remove_tax_rate" aria-label="<?php esc_attr_e( 'Delete', 'invoicing' ); ?>" title="<?php esc_attr_e( 'Delete', 'invoicing' ); ?>">
69
-            <?php if ( empty( $GLOBALS['aui_bs5'] ) ) : ?>
68
+        <button type="button" class="close btn-close wpinv_remove_tax_rate" aria-label="<?php esc_attr_e('Delete', 'invoicing'); ?>" title="<?php esc_attr_e('Delete', 'invoicing'); ?>">
69
+            <?php if (empty($GLOBALS['aui_bs5'])) : ?>
70 70
                 <span aria-hidden="true">×</span>
71 71
             <?php endif; ?>
72 72
         </button>
Please login to merge, or discard this patch.