Passed
Push — master ( 5c4f2a...9d88bf )
by Brian
13:27
created
templates/payment-forms-admin/edit/text.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -7,49 +7,49 @@
 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='form-group mb-3'>
15 15
     <label class="form-label d-block">
16
-        <span><?php esc_html_e( 'Field Label', 'invoicing' ); ?></span>
16
+        <span><?php esc_html_e('Field Label', 'invoicing'); ?></span>
17 17
         <input v-model='active_form_element.label' class='form-control' type="text"/>
18 18
     </label>
19 19
 </div>
20 20
 
21 21
 <div class='form-group mb-3'>
22 22
     <label class="form-label d-block">
23
-        <span><?php esc_html_e( 'Placeholder text', 'invoicing' ); ?></span>
23
+        <span><?php esc_html_e('Placeholder text', 'invoicing'); ?></span>
24 24
         <input v-model='active_form_element.placeholder' class='form-control' type="text"/>
25 25
     </label>
26 26
 </div>
27 27
 
28 28
 <div class='form-group mb-3'>
29 29
     <label class="form-label d-block">
30
-        <span><?php esc_html_e( 'Help Text', 'invoicing' ); ?></span>
31
-        <textarea placeholder='<?php esc_attr_e( 'Add some help text for this field', 'invoicing' ); ?>' v-model='active_form_element.description' class='form-control' rows='3'></textarea>
32
-        <small class="form-text text-muted"><?php esc_html_e( 'HTML is allowed', 'invoicing' ); ?></small>
30
+        <span><?php esc_html_e('Help Text', 'invoicing'); ?></span>
31
+        <textarea placeholder='<?php esc_attr_e('Add some help text for this field', 'invoicing'); ?>' v-model='active_form_element.description' class='form-control' rows='3'></textarea>
32
+        <small class="form-text text-muted"><?php esc_html_e('HTML is allowed', 'invoicing'); ?></small>
33 33
     </label>
34 34
 </div>
35 35
 
36 36
 <div class='form-group mb-3 form-check'>
37 37
     <input :id="active_form_element.id + '_edit'" v-model='active_form_element.required' type='checkbox' class='form-check-input' />
38
-    <label class='form-check-label' :for="active_form_element.id + '_edit'"><?php esc_html_e( 'Is this field required?', 'invoicing' ); ?></label>
38
+    <label class='form-check-label' :for="active_form_element.id + '_edit'"><?php esc_html_e('Is this field required?', 'invoicing'); ?></label>
39 39
 </div>
40 40
 
41 41
 <div class='form-group mb-3 form-check'>
42 42
     <input :id="active_form_element.id + '_add_meta'" v-model='active_form_element.add_meta' type='checkbox' class='form-check-input' />
43
-    <label class='form-check-label' :for="active_form_element.id + '_add_meta'"><?php esc_html_e( 'Show this field in receipts and emails?', 'invoicing' ); ?></label>
43
+    <label class='form-check-label' :for="active_form_element.id + '_add_meta'"><?php esc_html_e('Show this field in receipts and emails?', 'invoicing'); ?></label>
44 44
 </div>
45 45
 
46 46
 <hr class='featurette-divider mt-4'>
47 47
 
48 48
 <div class='form-group mb-3'>
49 49
     <label class="form-label d-block">
50
-        <span><?php esc_html_e( 'Email Merge Tag', 'invoicing' ); ?></span>
50
+        <span><?php esc_html_e('Email Merge Tag', 'invoicing'); ?></span>
51 51
         <input :value='active_form_element.label | formatMergeTag' class='form-control bg-white' type="text" readonly onclick="this.select()" />
52
-        <span class="form-text text-muted"><?php esc_html_e( 'You can use this merge tag in notification emails', 'invoicing' ); ?></span>
52
+        <span class="form-text text-muted"><?php esc_html_e('You can use this merge tag in notification emails', 'invoicing'); ?></span>
53 53
     </label>
54 54
 </div>
55 55
 
Please login to merge, or discard this patch.
templates/payment-forms-admin/edit/email.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -7,49 +7,49 @@
 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='form-group mb-3'>
15 15
     <label class="form-label d-block">
16
-        <span><?php esc_html_e( 'Field Label', 'invoicing' ); ?></span>
16
+        <span><?php esc_html_e('Field Label', 'invoicing'); ?></span>
17 17
         <input v-model='active_form_element.label' class='form-control' type="text"/>
18 18
     </label>
19 19
 </div>
20 20
 
21 21
 <div class='form-group mb-3'>
22 22
     <label class="form-label d-block">
23
-        <span><?php esc_html_e( 'Placeholder text', 'invoicing' ); ?></span>
23
+        <span><?php esc_html_e('Placeholder text', 'invoicing'); ?></span>
24 24
         <input v-model='active_form_element.placeholder' class='form-control' type="text"/>
25 25
     </label>
26 26
 </div>
27 27
 
28 28
 <div class='form-group mb-3'>
29 29
     <label class="form-label d-block">
30
-        <span><?php esc_html_e( 'Help Text', 'invoicing' ); ?></span>
31
-        <textarea placeholder='<?php esc_attr_e( 'Add some help text for this field', 'invoicing' ); ?>' v-model='active_form_element.description' class='form-control' rows='3'></textarea>
32
-        <small class="form-text text-muted"><?php esc_html_e( 'HTML is allowed', 'invoicing' ); ?></small>
30
+        <span><?php esc_html_e('Help Text', 'invoicing'); ?></span>
31
+        <textarea placeholder='<?php esc_attr_e('Add some help text for this field', 'invoicing'); ?>' v-model='active_form_element.description' class='form-control' rows='3'></textarea>
32
+        <small class="form-text text-muted"><?php esc_html_e('HTML is allowed', 'invoicing'); ?></small>
33 33
     </label>
34 34
 </div>
35 35
 
36 36
 <div class='form-group mb-3 form-check'>
37 37
     <input :id="active_form_element.id + '_edit'" v-model='active_form_element.required' type='checkbox' class='form-check-input' />
38
-    <label class='form-check-label' :for="active_form_element.id + '_edit'"><?php esc_html_e( 'Is this field required?', 'invoicing' ); ?></label>
38
+    <label class='form-check-label' :for="active_form_element.id + '_edit'"><?php esc_html_e('Is this field required?', 'invoicing'); ?></label>
39 39
 </div>
40 40
 
41 41
 <div class='form-group mb-3 form-check'>
42 42
     <input :id="active_form_element.id + '_add_meta'" v-model='active_form_element.add_meta' type='checkbox' class='form-check-input' />
43
-    <label class='form-check-label' :for="active_form_element.id + '_add_meta'"><?php esc_html_e( 'Show this field in receipts and emails?', 'invoicing' ); ?></label>
43
+    <label class='form-check-label' :for="active_form_element.id + '_add_meta'"><?php esc_html_e('Show this field in receipts and emails?', 'invoicing'); ?></label>
44 44
 </div>
45 45
 
46 46
 <hr class='featurette-divider mt-4'>
47 47
 
48 48
 <div class='form-group mb-3'>
49 49
     <label class="form-label d-block">
50
-        <span><?php esc_html_e( 'Email Merge Tag', 'invoicing' ); ?></span>
50
+        <span><?php esc_html_e('Email Merge Tag', 'invoicing'); ?></span>
51 51
         <input :value='active_form_element.label | formatMergeTag' class='form-control bg-white' type="text" readonly onclick="this.select()" />
52
-        <span class="form-text text-muted"><?php esc_html_e( 'You can use this merge tag in notification emails', 'invoicing' ); ?></span>
52
+        <span class="form-text text-muted"><?php esc_html_e('You can use this merge tag in notification emails', 'invoicing'); ?></span>
53 53
     </label>
54 54
 </div>
55 55
 
Please login to merge, or discard this patch.
templates/payment-forms-admin/edit/textarea.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -7,49 +7,49 @@
 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='form-group mb-3'>
15 15
     <label class="form-label d-block">
16
-        <span><?php esc_html_e( 'Field Label', 'invoicing' ); ?></span>
16
+        <span><?php esc_html_e('Field Label', 'invoicing'); ?></span>
17 17
         <input v-model='active_form_element.label' class='form-control' type="text"/>
18 18
     </label>
19 19
 </div>
20 20
 
21 21
 <div class='form-group mb-3'>
22 22
     <label class="form-label d-block">
23
-        <span><?php esc_html_e( 'Placeholder text', 'invoicing' ); ?></span>
23
+        <span><?php esc_html_e('Placeholder text', 'invoicing'); ?></span>
24 24
         <input v-model='active_form_element.placeholder' class='form-control' type="text"/>
25 25
     </label>
26 26
 </div>
27 27
 
28 28
 <div class='form-group mb-3'>
29 29
     <label class="form-label d-block">
30
-        <span><?php esc_html_e( 'Help Text', 'invoicing' ); ?></span>
31
-        <textarea placeholder='<?php esc_attr_e( 'Add some help text for this field', 'invoicing' ); ?>' v-model='active_form_element.description' class='form-control' rows='3'></textarea>
32
-        <small class="form-text text-muted"><?php esc_html_e( 'HTML is allowed', 'invoicing' ); ?></small>
30
+        <span><?php esc_html_e('Help Text', 'invoicing'); ?></span>
31
+        <textarea placeholder='<?php esc_attr_e('Add some help text for this field', 'invoicing'); ?>' v-model='active_form_element.description' class='form-control' rows='3'></textarea>
32
+        <small class="form-text text-muted"><?php esc_html_e('HTML is allowed', 'invoicing'); ?></small>
33 33
     </label>
34 34
 </div>
35 35
 
36 36
 <div class='form-group mb-3 form-check'>
37 37
     <input :id="active_form_element.id + '_edit'" v-model='active_form_element.required' type='checkbox' class='form-check-input' />
38
-    <label class='form-check-label' :for="active_form_element.id + '_edit'"><?php esc_html_e( 'Is this field required?', 'invoicing' ); ?></label>
38
+    <label class='form-check-label' :for="active_form_element.id + '_edit'"><?php esc_html_e('Is this field required?', 'invoicing'); ?></label>
39 39
 </div>
40 40
 
41 41
 <div class='form-group mb-3 form-check'>
42 42
     <input :id="active_form_element.id + '_add_meta'" v-model='active_form_element.add_meta' type='checkbox' class='form-check-input' />
43
-    <label class='form-check-label' :for="active_form_element.id + '_add_meta'"><?php esc_html_e( 'Show this field in receipts and emails?', 'invoicing' ); ?></label>
43
+    <label class='form-check-label' :for="active_form_element.id + '_add_meta'"><?php esc_html_e('Show this field in receipts and emails?', 'invoicing'); ?></label>
44 44
 </div>
45 45
 
46 46
 <hr class='featurette-divider mt-4'>
47 47
 
48 48
 <div class='form-group mb-3'>
49 49
     <label class="form-label d-block">
50
-        <span><?php esc_html_e( 'Email Merge Tag', 'invoicing' ); ?></span>
50
+        <span><?php esc_html_e('Email Merge Tag', 'invoicing'); ?></span>
51 51
         <input :value='active_form_element.label | formatMergeTag' class='form-control bg-white' type="text" readonly onclick="this.select()" />
52
-        <span class="form-text text-muted"><?php esc_html_e( 'You can use this merge tag in notification emails', 'invoicing' ); ?></span>
52
+        <span class="form-text text-muted"><?php esc_html_e('You can use this merge tag in notification emails', 'invoicing'); ?></span>
53 53
     </label>
54 54
 </div>
55 55
 
Please login to merge, or discard this patch.
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.
includes/deprecated-functions.php 1 patch
Spacing   +94 added lines, -94 removed lines patch added patch discarded remove patch
@@ -6,7 +6,7 @@  discard block
 block discarded – undo
6 6
  * @package Invoicing
7 7
  */
8 8
 
9
-defined( 'ABSPATH' ) || exit;
9
+defined('ABSPATH') || exit;
10 10
 
11 11
 /**
12 12
  * @deprecated
@@ -19,48 +19,48 @@  discard block
 block discarded – undo
19 19
  * @deprecated
20 20
  */
21 21
 function wpinv_get_invoice_cart() {
22
-    return wpinv_get_invoice( getpaid_get_current_invoice_id() );
22
+    return wpinv_get_invoice(getpaid_get_current_invoice_id());
23 23
 }
24 24
 
25 25
 /**
26 26
  * @deprecated
27 27
  */
28
-function wpinv_get_invoice_description( $invoice ) {
29
-    $invoice = new WPInv_Invoice( $invoice );
28
+function wpinv_get_invoice_description($invoice) {
29
+    $invoice = new WPInv_Invoice($invoice);
30 30
     return $invoice->get_description();
31 31
 }
32 32
 
33 33
 /**
34 34
  * @deprecated
35 35
  */
36
-function wpinv_get_invoice_currency_code( $invoice ) {
37
-    $invoice = new WPInv_Invoice( $invoice );
36
+function wpinv_get_invoice_currency_code($invoice) {
37
+    $invoice = new WPInv_Invoice($invoice);
38 38
     return $invoice->get_currency();
39 39
 }
40 40
 
41 41
 /**
42 42
  * @deprecated
43 43
  */
44
-function wpinv_get_payment_user_email( $invoice ) {
45
-    $invoice = new WPInv_Invoice( $invoice );
44
+function wpinv_get_payment_user_email($invoice) {
45
+    $invoice = new WPInv_Invoice($invoice);
46 46
     return $invoice->get_email();
47 47
 }
48 48
 
49 49
 /**
50 50
  * @deprecated
51 51
  */
52
-function wpinv_get_user_id( $invoice ) {
53
-    $invoice = new WPInv_Invoice( $invoice );
52
+function wpinv_get_user_id($invoice) {
53
+    $invoice = new WPInv_Invoice($invoice);
54 54
     return $invoice->get_user_id();
55 55
 }
56 56
 
57 57
 /**
58 58
  * @deprecated
59 59
  */
60
-function wpinv_get_invoice_status( $invoice, $return_label = false ) {
61
-    $invoice = new WPInv_Invoice( $invoice );
60
+function wpinv_get_invoice_status($invoice, $return_label = false) {
61
+    $invoice = new WPInv_Invoice($invoice);
62 62
 
63
-    if ( $return_label ) {
63
+    if ($return_label) {
64 64
         return $invoice->get_status_nicename();
65 65
     }
66 66
 
@@ -70,10 +70,10 @@  discard block
 block discarded – undo
70 70
 /**
71 71
  * @deprecated
72 72
  */
73
-function wpinv_get_payment_gateway( $invoice, $return_label = false ) {
74
-    $invoice = new WPInv_Invoice( $invoice );
73
+function wpinv_get_payment_gateway($invoice, $return_label = false) {
74
+    $invoice = new WPInv_Invoice($invoice);
75 75
 
76
-    if ( $return_label ) {
76
+    if ($return_label) {
77 77
         return $invoice->get_gateway_title();
78 78
     }
79 79
 
@@ -83,75 +83,75 @@  discard block
 block discarded – undo
83 83
 /**
84 84
  * @deprecated
85 85
  */
86
-function wpinv_get_payment_gateway_name( $invoice ) {
87
-    return wpinv_get_payment_gateway( $invoice, true );
86
+function wpinv_get_payment_gateway_name($invoice) {
87
+    return wpinv_get_payment_gateway($invoice, true);
88 88
 }
89 89
 
90 90
 /**
91 91
  * @deprecated
92 92
  */
93
-function wpinv_get_payment_transaction_id( $invoice ) {
94
-    $invoice = new WPInv_Invoice( $invoice );
93
+function wpinv_get_payment_transaction_id($invoice) {
94
+    $invoice = new WPInv_Invoice($invoice);
95 95
     return $invoice->get_transaction_id();
96 96
 }
97 97
 
98 98
 /**
99 99
  * @deprecated
100 100
  */
101
-function wpinv_get_invoice_meta( $invoice_id = 0, $meta_key = '_wpinv_payment_meta', $single = true ) {
102
-    $invoice = new WPInv_Invoice( $invoice_id );
103
-    return $invoice->get_meta( $meta_key, $single );
101
+function wpinv_get_invoice_meta($invoice_id = 0, $meta_key = '_wpinv_payment_meta', $single = true) {
102
+    $invoice = new WPInv_Invoice($invoice_id);
103
+    return $invoice->get_meta($meta_key, $single);
104 104
 }
105 105
 
106 106
 /**
107 107
  * @deprecated
108 108
  */
109
-function wpinv_update_invoice_meta( $invoice_id = 0, $meta_key = '', $meta_value = '' ) {
110
-    $invoice = new WPInv_Invoice( $invoice_id );
111
-    return $invoice->update_meta_data( $meta_key, $meta_value );
109
+function wpinv_update_invoice_meta($invoice_id = 0, $meta_key = '', $meta_value = '') {
110
+    $invoice = new WPInv_Invoice($invoice_id);
111
+    return $invoice->update_meta_data($meta_key, $meta_value);
112 112
 }
113 113
 
114 114
 /**
115 115
  * @deprecated
116 116
  */
117
-function wpinv_get_items( $invoice = 0 ) {
118
-    $invoice = new WPInv_Invoice( $invoice );
117
+function wpinv_get_items($invoice = 0) {
118
+    $invoice = new WPInv_Invoice($invoice);
119 119
     return $invoice->get_items();
120 120
 }
121 121
 
122 122
 /**
123 123
  * @deprecated
124 124
  */
125
-function wpinv_get_fees( $invoice = 0 ) {
126
-    $invoice = new WPInv_Invoice( $invoice );
125
+function wpinv_get_fees($invoice = 0) {
126
+    $invoice = new WPInv_Invoice($invoice);
127 127
     return $invoice->get_fees();
128 128
 }
129 129
 
130 130
 /**
131 131
  * @deprecated
132 132
  */
133
-function wpinv_get_invoice_ip( $invoice ) {
134
-    $invoice = new WPInv_Invoice( $invoice );
133
+function wpinv_get_invoice_ip($invoice) {
134
+    $invoice = new WPInv_Invoice($invoice);
135 135
     return $invoice->get_ip();
136 136
 }
137 137
 
138 138
 /**
139 139
  * @deprecated
140 140
  */
141
-function wpinv_get_invoice_user_info( $invoice ) {
142
-    $invoice = new WPInv_Invoice( $invoice );
141
+function wpinv_get_invoice_user_info($invoice) {
142
+    $invoice = new WPInv_Invoice($invoice);
143 143
     return $invoice->get_user_info();
144 144
 }
145 145
 
146 146
 /**
147 147
  * @deprecated
148 148
  */
149
-function wpinv_subtotal( $invoice = 0, $currency = false ) {
150
-    $invoice  = new WPInv_Invoice( $invoice );
149
+function wpinv_subtotal($invoice = 0, $currency = false) {
150
+    $invoice  = new WPInv_Invoice($invoice);
151 151
     $subtotal = $invoice->get_subtotal();
152 152
 
153
-    if ( $currency ) {
154
-        return wpinv_price( $subtotal, $invoice->get_currency() );
153
+    if ($currency) {
154
+        return wpinv_price($subtotal, $invoice->get_currency());
155 155
     }
156 156
 
157 157
     return $subtotal;
@@ -160,12 +160,12 @@  discard block
 block discarded – undo
160 160
 /**
161 161
  * @deprecated
162 162
  */
163
-function wpinv_tax( $invoice = 0, $currency = false ) {
164
-    $invoice  = new WPInv_Invoice( $invoice );
163
+function wpinv_tax($invoice = 0, $currency = false) {
164
+    $invoice  = new WPInv_Invoice($invoice);
165 165
     $tax      = $invoice->get_total_tax();
166 166
 
167
-    if ( $currency ) {
168
-        return wpinv_price( $tax, $invoice->get_currency() );
167
+    if ($currency) {
168
+        return wpinv_price($tax, $invoice->get_currency());
169 169
     }
170 170
 
171 171
     return $tax;
@@ -174,12 +174,12 @@  discard block
 block discarded – undo
174 174
 /**
175 175
  * @deprecated
176 176
  */
177
-function wpinv_discount( $invoice = 0, $currency = false ) {
178
-    $invoice  = new WPInv_Invoice( $invoice );
177
+function wpinv_discount($invoice = 0, $currency = false) {
178
+    $invoice  = new WPInv_Invoice($invoice);
179 179
     $discount = $invoice->get_total_discount();
180 180
 
181
-    if ( $currency ) {
182
-        return wpinv_price( $discount, $invoice->get_currency() );
181
+    if ($currency) {
182
+        return wpinv_price($discount, $invoice->get_currency());
183 183
     }
184 184
 
185 185
     return $discount;
@@ -188,20 +188,20 @@  discard block
 block discarded – undo
188 188
 /**
189 189
  * @deprecated
190 190
  */
191
-function wpinv_discount_code( $invoice = 0 ) {
192
-    $invoice = new WPInv_Invoice( $invoice );
191
+function wpinv_discount_code($invoice = 0) {
192
+    $invoice = new WPInv_Invoice($invoice);
193 193
     return $invoice->get_discount_code();
194 194
 }
195 195
 
196 196
 /**
197 197
  * @deprecated
198 198
  */
199
-function wpinv_payment_total( $invoice = 0, $currency = false ) {
200
-    $invoice  = new WPInv_Invoice( $invoice );
199
+function wpinv_payment_total($invoice = 0, $currency = false) {
200
+    $invoice = new WPInv_Invoice($invoice);
201 201
     $total = $invoice->get_total();
202 202
 
203
-    if ( $currency ) {
204
-        return wpinv_price( $total, $invoice->get_currency() );
203
+    if ($currency) {
204
+        return wpinv_price($total, $invoice->get_currency());
205 205
     }
206 206
 
207 207
     return $total;
@@ -210,51 +210,51 @@  discard block
 block discarded – undo
210 210
 /**
211 211
  * @deprecated
212 212
  */
213
-function wpinv_get_date_created( $invoice = 0, $format = '' ) {
214
-    $invoice = new WPInv_Invoice( $invoice );
213
+function wpinv_get_date_created($invoice = 0, $format = '') {
214
+    $invoice = new WPInv_Invoice($invoice);
215 215
 
216
-    $format         = ! empty( $format ) ? $format : get_option( 'date_format' );
216
+    $format         = !empty($format) ? $format : get_option('date_format');
217 217
     $date_created   = $invoice->get_created_date();
218 218
 
219
-    return empty( $date_created ) ? date_i18n( $format, strtotime( $date_created ) ) : '';
219
+    return empty($date_created) ? date_i18n($format, strtotime($date_created)) : '';
220 220
 }
221 221
 
222 222
 /**
223 223
  * @deprecated
224 224
  */
225
-function wpinv_get_invoice_date( $invoice = 0, $format = '' ) {
226
-    wpinv_get_date_created( $invoice, $format );
225
+function wpinv_get_invoice_date($invoice = 0, $format = '') {
226
+    wpinv_get_date_created($invoice, $format);
227 227
 }
228 228
 
229 229
 /**
230 230
  * @deprecated
231 231
  */
232
-function wpinv_get_invoice_vat_number( $invoice = 0 ) {
233
-    $invoice = new WPInv_Invoice( $invoice );
232
+function wpinv_get_invoice_vat_number($invoice = 0) {
233
+    $invoice = new WPInv_Invoice($invoice);
234 234
     return $invoice->get_vat_number();
235 235
 }
236 236
 
237 237
 /**
238 238
  * @deprecated
239 239
  */
240
-function wpinv_insert_payment_note( $invoice = 0, $note = '', $user_type = false, $added_by_user = false, $system = false ) {
241
-    $invoice = new WPInv_Invoice( $invoice );
242
-    return $invoice->add_note( $note, $user_type, $added_by_user, $system );
240
+function wpinv_insert_payment_note($invoice = 0, $note = '', $user_type = false, $added_by_user = false, $system = false) {
241
+    $invoice = new WPInv_Invoice($invoice);
242
+    return $invoice->add_note($note, $user_type, $added_by_user, $system);
243 243
 }
244 244
 
245 245
 /**
246 246
  * @deprecated
247 247
  */
248
-function wpinv_get_payment_key( $invoice = 0 ) {
249
-	$invoice = new WPInv_Invoice( $invoice );
248
+function wpinv_get_payment_key($invoice = 0) {
249
+	$invoice = new WPInv_Invoice($invoice);
250 250
     return $invoice->get_key();
251 251
 }
252 252
 
253 253
 /**
254 254
  * @deprecated
255 255
  */
256
-function wpinv_get_invoice_number( $invoice = 0 ) {
257
-    $invoice = new WPInv_Invoice( $invoice );
256
+function wpinv_get_invoice_number($invoice = 0) {
257
+    $invoice = new WPInv_Invoice($invoice);
258 258
     return $invoice->get_number();
259 259
 }
260 260
 
@@ -401,9 +401,9 @@  discard block
 block discarded – undo
401 401
 /**
402 402
  * @deprecated
403 403
  */
404
-function wpinv_update_payment_status( $invoice, $new_status = 'publish' ) {
405
-    $invoice = new WPInv_Invoice( $invoice );
406
-    return $invoice->update_status( $new_status );
404
+function wpinv_update_payment_status($invoice, $new_status = 'publish') {
405
+    $invoice = new WPInv_Invoice($invoice);
406
+    return $invoice->update_status($new_status);
407 407
 }
408 408
 
409 409
 /**
@@ -456,22 +456,22 @@  discard block
 block discarded – undo
456 456
 /**
457 457
  * @deprecated
458 458
  */
459
-function wpinv_set_payment_transaction_id( $invoice_id = 0, $transaction_id = '' ) {
459
+function wpinv_set_payment_transaction_id($invoice_id = 0, $transaction_id = '') {
460 460
 
461 461
     // Fetch the invoice.
462
-    $invoice = new WPInv_Invoice( $invoice_id );
462
+    $invoice = new WPInv_Invoice($invoice_id);
463 463
 
464
-    if ( 0 == $invoice->get_id() ) {
464
+    if (0 == $invoice->get_id()) {
465 465
         return false;
466 466
     }
467 467
 
468 468
     // Prepare the transaction id.
469
-    if ( empty( $transaction_id ) ) {
469
+    if (empty($transaction_id)) {
470 470
         $transaction_id = $invoice_id;
471 471
     }
472 472
 
473 473
     // Set the transaction id;
474
-    $invoice->set_transaction_id( apply_filters( 'wpinv_set_payment_transaction_id', $transaction_id, $invoice ) );
474
+    $invoice->set_transaction_id(apply_filters('wpinv_set_payment_transaction_id', $transaction_id, $invoice));
475 475
 
476 476
     // Save the invoice.
477 477
     return $invoice->save();
@@ -484,12 +484,12 @@  discard block
 block discarded – undo
484 484
  * @param WPInv_Invoice $invoice
485 485
  * @param string $gateway
486 486
  */
487
-function wpinv_send_to_gateway( $gateway, $invoice ) {
487
+function wpinv_send_to_gateway($gateway, $invoice) {
488 488
 
489 489
     $payment_data = array(
490 490
         'invoice_id'     => $invoice->get_id(),
491 491
         'items'          => $invoice->get_cart_details(),
492
-        'cart_discounts' => array( $invoice->get_discount_code() ),
492
+        'cart_discounts' => array($invoice->get_discount_code()),
493 493
         'fees'           => $invoice->get_total_fees(),
494 494
         'subtotal'       => $invoice->get_subtotal(),
495 495
         'discount'       => $invoice->get_total_discount(),
@@ -497,16 +497,16 @@  discard block
 block discarded – undo
497 497
         'price'          => $invoice->get_total(),
498 498
         'invoice_key'    => $invoice->get_key(),
499 499
         'user_email'     => $invoice->get_email(),
500
-        'date'           => gmdate( 'Y-m-d H:i:s', time() ),
500
+        'date'           => gmdate('Y-m-d H:i:s', time()),
501 501
         'user_info'      => $invoice->get_user_info(),
502
-        'post_data'      => wp_kses_post_deep( wp_unslash( $_POST ) ),
502
+        'post_data'      => wp_kses_post_deep(wp_unslash($_POST)),
503 503
         'cart_details'   => $invoice->get_cart_details(),
504 504
         'gateway'        => $gateway,
505 505
         'card_info'      => array(),
506
-        'gateway_nonce'  => wp_create_nonce( 'wpi-gateway' ),
506
+        'gateway_nonce'  => wp_create_nonce('wpi-gateway'),
507 507
     );
508 508
 
509
-    do_action( 'wpinv_gateway_' . $gateway, $payment_data );
509
+    do_action('wpinv_gateway_' . $gateway, $payment_data);
510 510
 }
511 511
 
512 512
 /**
@@ -519,10 +519,10 @@  discard block
 block discarded – undo
519 519
 /**
520 520
  * @deprecated
521 521
  */
522
-function wpinv_die( $message = '', $title = '', $status = 400 ) {
523
-    add_filter( 'wp_die_ajax_handler', 'wpinv_die_handler', 10, 3 );
524
-    add_filter( 'wp_die_handler', 'wpinv_die_handler', 10, 3 );
525
-    wp_die( esc_html( $message ), esc_html( $title ), array( 'response' => (int) $status ) );
522
+function wpinv_die($message = '', $title = '', $status = 400) {
523
+    add_filter('wp_die_ajax_handler', 'wpinv_die_handler', 10, 3);
524
+    add_filter('wp_die_handler', 'wpinv_die_handler', 10, 3);
525
+    wp_die(esc_html($message), esc_html($title), array('response' => (int) $status));
526 526
 }
527 527
 
528 528
 /**
@@ -640,14 +640,14 @@  discard block
 block discarded – undo
640 640
 /**
641 641
  * @deprecated
642 642
  */
643
-function wpinv_invoice_status_label( $status, $status_display = '' ) {
644
-    return empty( $status_display ) ? sanitize_text_field( $status ) : sanitize_text_field( $status_display );
643
+function wpinv_invoice_status_label($status, $status_display = '') {
644
+    return empty($status_display) ? sanitize_text_field($status) : sanitize_text_field($status_display);
645 645
 }
646 646
 
647 647
 /**
648 648
  * @deprecated
649 649
  */
650
-function wpinv_clean_invoice_number( $number ) {
650
+function wpinv_clean_invoice_number($number) {
651 651
     return $number;
652 652
 }
653 653
 
@@ -852,12 +852,12 @@  discard block
 block discarded – undo
852 852
 /**
853 853
  * @deprecated
854 854
  */
855
-function wpinv_item_show_price( $item_id = 0, $echo = true ) {
855
+function wpinv_item_show_price($item_id = 0, $echo = true) {
856 856
 
857
-    if ( $echo ) {
858
-        echo wp_kses_post( wpinv_item_price( $item_id ) );
857
+    if ($echo) {
858
+        echo wp_kses_post(wpinv_item_price($item_id));
859 859
     } else {
860
-        return wpinv_item_price( $item_id );
860
+        return wpinv_item_price($item_id);
861 861
     }
862 862
 
863 863
 }
@@ -1272,6 +1272,6 @@  discard block
 block discarded – undo
1272 1272
  * @return WPInv_Subscription|bool
1273 1273
  * @deprecated
1274 1274
  */
1275
-function wpinv_get_subscription( $invoice ) {
1276
-	return wpinv_get_invoice_subscription( $invoice );
1275
+function wpinv_get_subscription($invoice) {
1276
+	return wpinv_get_invoice_subscription($invoice);
1277 1277
 }
Please login to merge, or discard this patch.