Passed
Push — master ( 961926...d42717 )
by Brian
04:55
created
includes/admin/meta-boxes/class-getpaid-meta-box-invoice-details.php 1 patch
Spacing   +45 added lines, -45 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
 
@@ -21,13 +21,13 @@  discard block
 block discarded – undo
21 21
 	 *
22 22
 	 * @param WP_Post $post
23 23
 	 */
24
-    public static function output( $post ) {
24
+    public static function output($post) {
25 25
 
26 26
         // Prepare the invoice.
27
-        $invoice = new WPInv_Invoice( $post );
27
+        $invoice = new WPInv_Invoice($post);
28 28
 
29 29
         // Nonce field.
30
-        wp_nonce_field( 'wpinv_details', 'wpinv_details_nonce' ) ;
30
+        wp_nonce_field('wpinv_details', 'wpinv_details_nonce');
31 31
 
32 32
 
33 33
         ?>
@@ -46,11 +46,11 @@  discard block
 block discarded – undo
46 46
 
47 47
                 <div class="bsui" style="margin-top: 1.5rem">
48 48
 
49
-                    <?php do_action( 'getpaid_invoice_edit_before_viewed_by_customer', $invoice ); ?>
50
-                    <?php if ( ! $invoice->is_draft() ) : ?>
49
+                    <?php do_action('getpaid_invoice_edit_before_viewed_by_customer', $invoice); ?>
50
+                    <?php if (!$invoice->is_draft()) : ?>
51 51
                         <div class="form-group">
52
-                            <strong><?php _e( 'Viewed by Customer:', 'invoicing' );?></strong>
53
-                            <?php ( $invoice->get_is_viewed() ) ? _e( 'Yes', 'invoicing' ) : _e( 'No', 'invoicing' ); ?>
52
+                            <strong><?php _e('Viewed by Customer:', 'invoicing'); ?></strong>
53
+                            <?php ($invoice->get_is_viewed()) ? _e('Yes', 'invoicing') : _e('No', 'invoicing'); ?>
54 54
                         </div>
55 55
                     <?php endif; ?>
56 56
 
@@ -58,13 +58,13 @@  discard block
 block discarded – undo
58 58
 
59 59
                         // Date created.
60 60
                         $label = sprintf(
61
-                            __( '%s Date:', 'invoicing' ),
62
-                            ucfirst( $invoice->get_invoice_quote_type() )
61
+                            __('%s Date:', 'invoicing'),
62
+                            ucfirst($invoice->get_invoice_quote_type())
63 63
                         );
64 64
 
65
-                        $info  = sprintf(
66
-                            __( 'The date this %s was created.', 'invoicing' ),
67
-                            strtolower( $invoice->get_invoice_quote_type() )
65
+                        $info = sprintf(
66
+                            __('The date this %s was created.', 'invoicing'),
67
+                            strtolower($invoice->get_invoice_quote_type())
68 68
                         );
69 69
 
70 70
                         echo aui()->input(
@@ -72,11 +72,11 @@  discard block
 block discarded – undo
72 72
                                 'type'        => 'datepicker',
73 73
                                 'id'          => 'wpinv_date_created',
74 74
                                 'name'        => 'date_created',
75
-                                'label'       => $label . getpaid_get_help_tip( $info ),
75
+                                'label'       => $label . getpaid_get_help_tip($info),
76 76
                                 'label_type'  => 'vertical',
77 77
                                 'placeholder' => 'YYYY-MM-DD 00:00',
78 78
                                 'class'       => 'form-control-sm',
79
-                                'value'       => $invoice->get_date_created( 'edit' ),
79
+                                'value'       => $invoice->get_date_created('edit'),
80 80
                                 'extra_attributes' => array(
81 81
                                     'data-enable-time' => 'true',
82 82
                                     'data-time_24hr'   => 'true',
@@ -87,56 +87,56 @@  discard block
 block discarded – undo
87 87
                         );
88 88
 
89 89
                         // Due date.
90
-                        if ( $invoice->is_type( 'invoice' ) && wpinv_get_option( 'overdue_active' ) && ( $invoice->needs_payment() || $invoice->is_draft() ) ) {
90
+                        if ($invoice->is_type('invoice') && wpinv_get_option('overdue_active') && ($invoice->needs_payment() || $invoice->is_draft())) {
91 91
 
92 92
                             echo aui()->input(
93 93
                                 array(
94 94
                                     'type'        => 'text',
95 95
                                     'id'          => 'wpinv_due_date',
96 96
                                     'name'        => 'wpinv_due_date',
97
-                                    'label'       => __( 'Due Date:', 'invoicing' ) . getpaid_get_help_tip( __( 'Leave blank to disable automated reminder emails for this invoice.', 'invoicing' ) ),
97
+                                    'label'       => __('Due Date:', 'invoicing') . getpaid_get_help_tip(__('Leave blank to disable automated reminder emails for this invoice.', 'invoicing')),
98 98
                                     'label_type'  => 'vertical',
99
-                                    'placeholder' => __( 'No due date', 'invoicing' ),
99
+                                    'placeholder' => __('No due date', 'invoicing'),
100 100
                                     'class'       => 'form-control-sm',
101
-                                    'value'       => $invoice->get_due_date( 'edit' ),
101
+                                    'value'       => $invoice->get_due_date('edit'),
102 102
                                 )
103 103
                             );
104 104
 
105 105
                         }
106 106
 
107
-                        do_action( 'wpinv_meta_box_details_after_due_date', $invoice->get_id() );
108
-                        do_action( 'getpaid_metabox_after_due_date', $invoice );
107
+                        do_action('wpinv_meta_box_details_after_due_date', $invoice->get_id());
108
+                        do_action('getpaid_metabox_after_due_date', $invoice);
109 109
 
110 110
                         // Status.
111 111
                         $label = sprintf(
112
-                            __( '%s Status:', 'invoicing' ),
113
-                            ucfirst( $invoice->get_invoice_quote_type() )
112
+                            __('%s Status:', 'invoicing'),
113
+                            ucfirst($invoice->get_invoice_quote_type())
114 114
                         );
115 115
 
116
-                        $status = $invoice->get_status( 'edit' );
116
+                        $status = $invoice->get_status('edit');
117 117
                         echo aui()->select(
118 118
                             array(
119 119
                                 'id'               => 'wpinv_status',
120 120
                                 'name'             => 'wpinv_status',
121 121
                                 'label'            => $label,
122 122
                                 'label_type'       => 'vertical',
123
-                                'placeholder'      => __( 'Select Status', 'invoicing' ),
124
-                                'value'            => array_key_exists( $status, $invoice->get_all_statuses() ) ? $status : $invoice->get_default_status(),
123
+                                'placeholder'      => __('Select Status', 'invoicing'),
124
+                                'value'            => array_key_exists($status, $invoice->get_all_statuses()) ? $status : $invoice->get_default_status(),
125 125
                                 'select2'          => true,
126 126
                                 'data-allow-clear' => 'false',
127
-                                'options'          => wpinv_get_invoice_statuses( true, false, $invoice )
127
+                                'options'          => wpinv_get_invoice_statuses(true, false, $invoice)
128 128
                             )
129 129
                         );
130 130
 
131 131
                         // Invoice number.
132 132
                         $label = sprintf(
133
-                            __( '%s Number:', 'invoicing' ),
134
-                            ucfirst( $invoice->get_invoice_quote_type() )
133
+                            __('%s Number:', 'invoicing'),
134
+                            ucfirst($invoice->get_invoice_quote_type())
135 135
                         );
136 136
 
137
-                        $info  = sprintf(
138
-                            __( 'Each %s number must be unique.', 'invoicing' ),
139
-                            strtolower( $invoice->get_invoice_quote_type() )
137
+                        $info = sprintf(
138
+                            __('Each %s number must be unique.', 'invoicing'),
139
+                            strtolower($invoice->get_invoice_quote_type())
140 140
                         );
141 141
 
142 142
                         echo aui()->input(
@@ -144,11 +144,11 @@  discard block
 block discarded – undo
144 144
                                 'type'        => 'text',
145 145
                                 'id'          => 'wpinv_number',
146 146
                                 'name'        => 'wpinv_number',
147
-                                'label'       => $label . getpaid_get_help_tip( $info ),
147
+                                'label'       => $label . getpaid_get_help_tip($info),
148 148
                                 'label_type'  => 'vertical',
149
-                                'placeholder' => __( 'Autogenerate', 'invoicing' ),
149
+                                'placeholder' => __('Autogenerate', 'invoicing'),
150 150
                                 'class'       => 'form-control-sm',
151
-                                'value'       => $invoice->get_number( 'edit' ),
151
+                                'value'       => $invoice->get_number('edit'),
152 152
                             )
153 153
                         );
154 154
 
@@ -158,25 +158,25 @@  discard block
 block discarded – undo
158 158
                                 'type'        => 'text',
159 159
                                 'id'          => 'wpinv_cc',
160 160
                                 'name'        => 'wpinv_cc',
161
-                                'label'       => __( 'Email CC:', 'invoicing' ) . getpaid_get_help_tip( __( 'Enter a comma separated list of other emails that should be notified about the invoice.', 'invoicing' ) ),
161
+                                'label'       => __('Email CC:', 'invoicing') . getpaid_get_help_tip(__('Enter a comma separated list of other emails that should be notified about the invoice.', 'invoicing')),
162 162
                                 'label_type'  => 'vertical',
163
-                                'placeholder' => __( '[email protected], [email protected]', 'invoicing' ),
163
+                                'placeholder' => __('[email protected], [email protected]', 'invoicing'),
164 164
                                 'class'       => 'form-control-sm',
165
-                                'value'       => $invoice->get_email_cc( 'edit' ),
165
+                                'value'       => $invoice->get_email_cc('edit'),
166 166
                             )
167 167
                         );
168 168
 
169
-                        do_action( 'wpinv_meta_box_details_inner', $invoice->get_id() );
169
+                        do_action('wpinv_meta_box_details_inner', $invoice->get_id());
170 170
 
171 171
                         // Disable taxes.
172
-                        if ( wpinv_use_taxes() && ! ( $invoice->is_paid() || $invoice->is_refunded() ) ) {
172
+                        if (wpinv_use_taxes() && !($invoice->is_paid() || $invoice->is_refunded())) {
173 173
 
174 174
                             echo aui()->input(
175 175
                                 array(
176 176
                                     'id'          => 'wpinv_taxable',
177 177
                                     'name'        => 'disable_taxes',
178 178
                                     'type'        => 'checkbox',
179
-                                    'label'       => __( 'Disable taxes', 'invoicing' ),
179
+                                    'label'       => __('Disable taxes', 'invoicing'),
180 180
                                     'value'       => '1',
181 181
                                     'checked'     => (bool) $invoice->get_disable_taxes(),
182 182
                                 )
@@ -185,17 +185,17 @@  discard block
 block discarded – undo
185 185
                         }
186 186
 
187 187
                         // Apply a discount.
188
-                        if ( $invoice->get_discount_code( 'edit' ) ) {
188
+                        if ($invoice->get_discount_code('edit')) {
189 189
 
190 190
                             echo aui()->input(
191 191
                                 array(
192 192
                                     'type'        => 'text',
193 193
                                     'id'          => 'wpinv_discount_code',
194 194
                                     'name'        => 'wpinv_discount_code',
195
-                                    'label'       => __( 'Discount Code:', 'invoicing' ),
195
+                                    'label'       => __('Discount Code:', 'invoicing'),
196 196
                                     'label_type'  => 'vertical',
197 197
                                     'class'       => 'form-control-sm',
198
-                                    'value'       => $invoice->get_discount_code( 'edit' ),
198
+                                    'value'       => $invoice->get_discount_code('edit'),
199 199
                                     'extra_attributes' => array(
200 200
                                         'onclick'  => 'this.select();',
201 201
                                         'readonly' => 'true',
@@ -205,7 +205,7 @@  discard block
 block discarded – undo
205 205
 
206 206
                         }
207 207
 
208
-                        do_action( 'getpaid_metabox_after_invoice_details', $invoice );
208
+                        do_action('getpaid_metabox_after_invoice_details', $invoice);
209 209
 
210 210
                     ?>
211 211
 
Please login to merge, or discard this patch.