Passed
Push — master ( e53b80...bdf164 )
by Brian
04:19
created
includes/admin/meta-boxes/class-getpaid-meta-box-invoice-address.php 2 patches
Indentation   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -8,7 +8,7 @@  discard block
 block discarded – undo
8 8
  */
9 9
 
10 10
 if ( ! defined( 'ABSPATH' ) ) {
11
-	exit; // Exit if accessed directly
11
+    exit; // Exit if accessed directly
12 12
 }
13 13
 
14 14
 /**
@@ -17,10 +17,10 @@  discard block
 block discarded – undo
17 17
 class GetPaid_Meta_Box_Invoice_Address {
18 18
 
19 19
     /**
20
-	 * Output the metabox.
21
-	 *
22
-	 * @param WP_Post $post
23
-	 */
20
+     * Output the metabox.
21
+     *
22
+     * @param WP_Post $post
23
+     */
24 24
     public static function output( $post ) {
25 25
 
26 26
         // Prepare the invoice.
@@ -300,18 +300,18 @@  discard block
 block discarded – undo
300 300
     }
301 301
 
302 302
     /**
303
-	 * Save meta box data.
304
-	 *
305
-	 * @param int $post_id
306
-	 */
307
-	public static function save( $post_id ) {
303
+     * Save meta box data.
304
+     *
305
+     * @param int $post_id
306
+     */
307
+    public static function save( $post_id ) {
308 308
 
309 309
         // Prepare the invoice.
310 310
         $invoice = new WPInv_Invoice( $post_id );
311 311
 
312 312
         // Load new data.
313 313
         $invoice->set_props(
314
-			array(
314
+            array(
315 315
                 'template'             => isset( $_POST['wpinv_template'] ) ? wpinv_clean( $_POST['wpinv_template'] ) : null,
316 316
                 'email_cc'             => isset( $_POST['wpinv_cc'] ) ? wpinv_clean( $_POST['wpinv_cc'] ) : null,
317 317
                 'disable_taxes'        => isset( $_POST['disable_taxes'] ),
@@ -332,7 +332,7 @@  discard block
 block discarded – undo
332 332
                 'due_date'             => isset( $_POST['wpinv_due_date'] ) ? wpinv_clean( $_POST['wpinv_due_date'] ) : null,
333 333
                 'number'               => isset( $_POST['wpinv_number'] ) ? wpinv_clean( $_POST['wpinv_number'] ) : null,
334 334
                 'status'               => isset( $_POST['wpinv_status'] ) ? wpinv_clean( $_POST['wpinv_status'] ) : null,
335
-			)
335
+            )
336 336
         );
337 337
 
338 338
         // Recalculate totals.
@@ -362,6 +362,6 @@  discard block
 block discarded – undo
362 362
         }
363 363
 
364 364
         // Fires after an invoice is saved.
365
-		do_action( 'wpinv_invoice_metabox_saved', $invoice );
366
-	}
365
+        do_action( 'wpinv_invoice_metabox_saved', $invoice );
366
+    }
367 367
 }
Please login to merge, or discard this patch.
Spacing   +67 added lines, -67 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,12 +21,12 @@  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
-        wp_nonce_field( 'getpaid_meta_nonce', 'getpaid_meta_nonce' );
29
+        wp_nonce_field('getpaid_meta_nonce', 'getpaid_meta_nonce');
30 30
 
31 31
         ?>
32 32
 
@@ -42,13 +42,13 @@  discard block
 block discarded – undo
42 42
                         <div class="col-12 col-sm-6">
43 43
                             <div id="getpaid-invoice-user-id-wrapper" class="form-group">
44 44
                                 <div>
45
-                                    <label for="post_author_override"><?php _e( 'Customer', 'invoicing' );?></label>
45
+                                    <label for="post_author_override"><?php _e('Customer', 'invoicing'); ?></label>
46 46
                                 </div>
47 47
                                 <?php 
48 48
                                     wpinv_dropdown_users(
49 49
                                         array(
50 50
                                             'name'             => 'post_author_override',
51
-                                            'selected'         => $invoice->get_id() ? $invoice->get_user_id( 'edit' ) : get_current_user_id(),
51
+                                            'selected'         => $invoice->get_id() ? $invoice->get_user_id('edit') : get_current_user_id(),
52 52
                                             'include_selected' => true,
53 53
                                             'show'             => 'display_name_with_email',
54 54
                                             'orderby'          => 'user_email',
@@ -66,7 +66,7 @@  discard block
 block discarded – undo
66 66
                                             'type'        => 'text',
67 67
                                             'id'          => 'getpaid-invoice-new-user-email',
68 68
                                             'name'        => 'wpinv_email',
69
-                                            'label'       => __( 'Email', 'invoicing' ) . '<span class="required">*</span>',
69
+                                            'label'       => __('Email', 'invoicing') . '<span class="required">*</span>',
70 70
                                             'label_type'  => 'vertical',
71 71
                                             'placeholder' => '[email protected]',
72 72
                                             'class'       => 'form-control-sm',
@@ -76,18 +76,18 @@  discard block
 block discarded – undo
76 76
                             </div>
77 77
                         </div>
78 78
                         <div class="col-12 col-sm-6 form-group mt-sm-4">
79
-                            <?php if ( ! $invoice->is_paid() && ! $invoice->is_refunded() ) : ?>
79
+                            <?php if (!$invoice->is_paid() && !$invoice->is_refunded()) : ?>
80 80
                                 <a id="getpaid-invoice-fill-user-details" class="button button-small button-secondary" href="javascript:void(0)">
81 81
                                     <i aria-hidden="true" class="fa fa-refresh"></i>
82
-                                    <?php _e( 'Fill User Details', 'invoicing' );?>
82
+                                    <?php _e('Fill User Details', 'invoicing'); ?>
83 83
                                 </a>
84 84
                                 <a id="getpaid-invoice-create-new-user-button" class="button button-small button-secondary" href="javascript:void(0)">
85 85
                                     <i aria-hidden="true" class="fa fa-plus"></i>
86
-                                    <?php _e( 'Add New User', 'invoicing' );?>
86
+                                    <?php _e('Add New User', 'invoicing'); ?>
87 87
                                 </a>
88 88
                                 <a id="getpaid-invoice-cancel-create-new-user" class="button button-small button-secondary d-none" href="javascript:void(0)">
89 89
                                     <i aria-hidden="true" class="fa fa-close"></i>
90
-                                    <?php _e( 'Cancel', 'invoicing' );?>
90
+                                    <?php _e('Cancel', 'invoicing'); ?>
91 91
                                 </a>
92 92
                             <?php endif; ?>
93 93
                         </div>
@@ -100,11 +100,11 @@  discard block
 block discarded – undo
100 100
                                         'type'        => 'text',
101 101
                                         'id'          => 'wpinv_first_name',
102 102
                                         'name'        => 'wpinv_first_name',
103
-                                        'label'       => __( 'First Name', 'invoicing' ),
103
+                                        'label'       => __('First Name', 'invoicing'),
104 104
                                         'label_type'  => 'vertical',
105 105
                                         'placeholder' => 'Jane',
106 106
                                         'class'       => 'form-control-sm',
107
-                                        'value'       => $invoice->get_first_name( 'edit' ),
107
+                                        'value'       => $invoice->get_first_name('edit'),
108 108
                                     )
109 109
                                 );
110 110
                             ?>
@@ -116,11 +116,11 @@  discard block
 block discarded – undo
116 116
                                         'type'        => 'text',
117 117
                                         'id'          => 'wpinv_last_name',
118 118
                                         'name'        => 'wpinv_last_name',
119
-                                        'label'       => __( 'Last Name', 'invoicing' ),
119
+                                        'label'       => __('Last Name', 'invoicing'),
120 120
                                         'label_type'  => 'vertical',
121 121
                                         'placeholder' => 'Doe',
122 122
                                         'class'       => 'form-control-sm',
123
-                                        'value'       => $invoice->get_last_name( 'edit' ),
123
+                                        'value'       => $invoice->get_last_name('edit'),
124 124
                                     )
125 125
                                 );
126 126
                             ?>
@@ -135,11 +135,11 @@  discard block
 block discarded – undo
135 135
                                         'type'        => 'text',
136 136
                                         'id'          => 'wpinv_company',
137 137
                                         'name'        => 'wpinv_company',
138
-                                        'label'       => __( 'Company', 'invoicing' ),
138
+                                        'label'       => __('Company', 'invoicing'),
139 139
                                         'label_type'  => 'vertical',
140 140
                                         'placeholder' => 'Acme Corporation',
141 141
                                         'class'       => 'form-control-sm',
142
-                                        'value'       => $invoice->get_company( 'edit' ),
142
+                                        'value'       => $invoice->get_company('edit'),
143 143
                                     )
144 144
                                 );
145 145
                             ?>
@@ -151,11 +151,11 @@  discard block
 block discarded – undo
151 151
                                         'type'        => 'text',
152 152
                                         'id'          => 'wpinv_vat_number',
153 153
                                         'name'        => 'wpinv_vat_number',
154
-                                        'label'       => __( 'Vat Number', 'invoicing' ),
154
+                                        'label'       => __('Vat Number', 'invoicing'),
155 155
                                         'label_type'  => 'vertical',
156 156
                                         'placeholder' => '1234567890',
157 157
                                         'class'       => 'form-control-sm',
158
-                                        'value'       => $invoice->get_vat_number( 'edit' ),
158
+                                        'value'       => $invoice->get_vat_number('edit'),
159 159
                                     )
160 160
                                 );
161 161
                             ?>
@@ -170,11 +170,11 @@  discard block
 block discarded – undo
170 170
                                         'type'        => 'text',
171 171
                                         'id'          => 'wpinv_address',
172 172
                                         'name'        => 'wpinv_address',
173
-                                        'label'       => __( 'Address', 'invoicing' ),
173
+                                        'label'       => __('Address', 'invoicing'),
174 174
                                         'label_type'  => 'vertical',
175 175
                                         'placeholder' => 'Blekersdijk 295',
176 176
                                         'class'       => 'form-control-sm',
177
-                                        'value'       => $invoice->get_address( 'edit' ),
177
+                                        'value'       => $invoice->get_address('edit'),
178 178
                                     )
179 179
                                 );
180 180
                             ?>
@@ -186,11 +186,11 @@  discard block
 block discarded – undo
186 186
                                         'type'        => 'text',
187 187
                                         'id'          => 'wpinv_city',
188 188
                                         'name'        => 'wpinv_city',
189
-                                        'label'       => __( 'City', 'invoicing' ),
189
+                                        'label'       => __('City', 'invoicing'),
190 190
                                         'label_type'  => 'vertical',
191 191
                                         'placeholder' => 'Dolembreux',
192 192
                                         'class'       => 'form-control-sm',
193
-                                        'value'       => $invoice->get_vat_number( 'edit' ),
193
+                                        'value'       => $invoice->get_vat_number('edit'),
194 194
                                     )
195 195
                                 );
196 196
                             ?>
@@ -204,11 +204,11 @@  discard block
 block discarded – undo
204 204
                                     array(
205 205
                                         'id'          => 'wpinv_country',
206 206
                                         'name'        => 'wpinv_country',
207
-                                        'label'       => __( 'Country', 'invoicing' ),
207
+                                        'label'       => __('Country', 'invoicing'),
208 208
                                         'label_type'  => 'vertical',
209
-                                        'placeholder' => __( 'Choose a country', 'invoicing' ),
209
+                                        'placeholder' => __('Choose a country', 'invoicing'),
210 210
                                         'class'       => 'form-control-sm',
211
-                                        'value'       => $invoice->get_country( 'edit' ),
211
+                                        'value'       => $invoice->get_country('edit'),
212 212
                                         'options'     => wpinv_get_country_list(),
213 213
                                         'data-allow-clear' => 'false',
214 214
                                         'select2'          => true,
@@ -219,20 +219,20 @@  discard block
 block discarded – undo
219 219
                         <div class="col-12 col-sm-6">
220 220
                             <?php
221 221
 
222
-                                $states = wpinv_get_country_states( $invoice->get_country( 'edit' ) );
222
+                                $states = wpinv_get_country_states($invoice->get_country('edit'));
223 223
 
224
-                                if ( empty( $states ) ) {
224
+                                if (empty($states)) {
225 225
 
226 226
                                     echo aui()->input(
227 227
                                         array(
228 228
                                             'type'        => 'text',
229 229
                                             'id'          => 'wpinv_state',
230 230
                                             'name'        => 'wpinv_state',
231
-                                            'label'       => __( 'State', 'invoicing' ),
231
+                                            'label'       => __('State', 'invoicing'),
232 232
                                             'label_type'  => 'vertical',
233 233
                                             'placeholder' => 'Liège',
234 234
                                             'class'       => 'form-control-sm',
235
-                                            'value'       => $invoice->get_state( 'edit' ),
235
+                                            'value'       => $invoice->get_state('edit'),
236 236
                                         )
237 237
                                     );
238 238
 
@@ -242,11 +242,11 @@  discard block
 block discarded – undo
242 242
                                         array(
243 243
                                             'id'          => 'wpinv_state',
244 244
                                             'name'        => 'wpinv_state',
245
-                                            'label'       => __( 'State', 'invoicing' ),
245
+                                            'label'       => __('State', 'invoicing'),
246 246
                                             'label_type'  => 'vertical',
247
-                                            'placeholder' => __( 'Select a state', 'invoicing' ),
247
+                                            'placeholder' => __('Select a state', 'invoicing'),
248 248
                                             'class'       => 'form-control-sm',
249
-                                            'value'       => $invoice->get_state( 'edit' ),
249
+                                            'value'       => $invoice->get_state('edit'),
250 250
                                             'options'     => $states,
251 251
                                             'data-allow-clear' => 'false',
252 252
                                             'select2'          => true,
@@ -267,11 +267,11 @@  discard block
 block discarded – undo
267 267
                                         'type'        => 'text',
268 268
                                         'id'          => 'wpinv_zip',
269 269
                                         'name'        => 'wpinv_zip',
270
-                                        'label'       => __( 'Zip / Postal Code', 'invoicing' ),
270
+                                        'label'       => __('Zip / Postal Code', 'invoicing'),
271 271
                                         'label_type'  => 'vertical',
272 272
                                         'placeholder' => '4140',
273 273
                                         'class'       => 'form-control-sm',
274
-                                        'value'       => $invoice->get_zip( 'edit' ),
274
+                                        'value'       => $invoice->get_zip('edit'),
275 275
                                     )
276 276
                                 );
277 277
                             ?>
@@ -283,11 +283,11 @@  discard block
 block discarded – undo
283 283
                                         'type'        => 'text',
284 284
                                         'id'          => 'wpinv_phone',
285 285
                                         'name'        => 'wpinv_phone',
286
-                                        'label'       => __( 'Phone', 'invoicing' ),
286
+                                        'label'       => __('Phone', 'invoicing'),
287 287
                                         'label_type'  => 'vertical',
288 288
                                         'placeholder' => '0493 18 45822',
289 289
                                         'class'       => 'form-control-sm',
290
-                                        'value'       => $invoice->get_phone( 'edit' ),
290
+                                        'value'       => $invoice->get_phone('edit'),
291 291
                                     )
292 292
                                 );
293 293
                             ?>
@@ -304,34 +304,34 @@  discard block
 block discarded – undo
304 304
 	 *
305 305
 	 * @param int $post_id
306 306
 	 */
307
-	public static function save( $post_id ) {
307
+	public static function save($post_id) {
308 308
 
309 309
         // Prepare the invoice.
310
-        $invoice = new WPInv_Invoice( $post_id );
310
+        $invoice = new WPInv_Invoice($post_id);
311 311
 
312 312
         // Load new data.
313 313
         $invoice->set_props(
314 314
 			array(
315
-                'template'             => isset( $_POST['wpinv_template'] ) ? wpinv_clean( $_POST['wpinv_template'] ) : null,
316
-                'email_cc'             => isset( $_POST['wpinv_cc'] ) ? wpinv_clean( $_POST['wpinv_cc'] ) : null,
317
-                'disable_taxes'        => isset( $_POST['disable_taxes'] ),
318
-                'currency'             => isset( $_POST['wpinv_currency'] ) ? wpinv_clean( $_POST['wpinv_currency'] ) : null,
319
-                'gateway'              => isset( $_POST['wpinv_gateway'] ) ? wpinv_clean( $_POST['wpinv_gateway'] ) : null,
320
-                'address'              => isset( $_POST['wpinv_address'] ) ? wpinv_clean( $_POST['wpinv_address'] ) : null,
321
-                'vat_number'           => isset( $_POST['wpinv_vat_number'] ) ? wpinv_clean( $_POST['wpinv_vat_number'] ) : null,
322
-                'company'              => isset( $_POST['wpinv_company'] ) ? wpinv_clean( $_POST['wpinv_company'] ) : null,
323
-                'zip'                  => isset( $_POST['wpinv_zip'] ) ? wpinv_clean( $_POST['wpinv_zip'] ) : null,
324
-                'state'                => isset( $_POST['wpinv_state'] ) ? wpinv_clean( $_POST['wpinv_state'] ) : null,
325
-                'city'                 => isset( $_POST['wpinv_city'] ) ? wpinv_clean( $_POST['wpinv_city'] ) : null,
326
-                'country'              => isset( $_POST['wpinv_country'] ) ? wpinv_clean( $_POST['wpinv_country'] ) : null,
327
-                'phone'                => isset( $_POST['wpinv_phone'] ) ? wpinv_clean( $_POST['wpinv_phone'] ) : null,
328
-                'first_name'           => isset( $_POST['wpinv_first_name'] ) ? wpinv_clean( $_POST['wpinv_first_name'] ) : null,
329
-                'last_name'            => isset( $_POST['wpinv_last_name'] ) ? wpinv_clean( $_POST['wpinv_last_name'] ) : null,
330
-                'author'               => isset( $_POST['post_author_override'] ) ? wpinv_clean( $_POST['post_author_override'] ) : null,
331
-                'date_created'         => isset( $_POST['date_created'] ) ? wpinv_clean( $_POST['date_created'] ) : null,
332
-                'due_date'             => isset( $_POST['wpinv_due_date'] ) ? wpinv_clean( $_POST['wpinv_due_date'] ) : null,
333
-                'number'               => isset( $_POST['wpinv_number'] ) ? wpinv_clean( $_POST['wpinv_number'] ) : null,
334
-                'status'               => isset( $_POST['wpinv_status'] ) ? wpinv_clean( $_POST['wpinv_status'] ) : null,
315
+                'template'             => isset($_POST['wpinv_template']) ? wpinv_clean($_POST['wpinv_template']) : null,
316
+                'email_cc'             => isset($_POST['wpinv_cc']) ? wpinv_clean($_POST['wpinv_cc']) : null,
317
+                'disable_taxes'        => isset($_POST['disable_taxes']),
318
+                'currency'             => isset($_POST['wpinv_currency']) ? wpinv_clean($_POST['wpinv_currency']) : null,
319
+                'gateway'              => isset($_POST['wpinv_gateway']) ? wpinv_clean($_POST['wpinv_gateway']) : null,
320
+                'address'              => isset($_POST['wpinv_address']) ? wpinv_clean($_POST['wpinv_address']) : null,
321
+                'vat_number'           => isset($_POST['wpinv_vat_number']) ? wpinv_clean($_POST['wpinv_vat_number']) : null,
322
+                'company'              => isset($_POST['wpinv_company']) ? wpinv_clean($_POST['wpinv_company']) : null,
323
+                'zip'                  => isset($_POST['wpinv_zip']) ? wpinv_clean($_POST['wpinv_zip']) : null,
324
+                'state'                => isset($_POST['wpinv_state']) ? wpinv_clean($_POST['wpinv_state']) : null,
325
+                'city'                 => isset($_POST['wpinv_city']) ? wpinv_clean($_POST['wpinv_city']) : null,
326
+                'country'              => isset($_POST['wpinv_country']) ? wpinv_clean($_POST['wpinv_country']) : null,
327
+                'phone'                => isset($_POST['wpinv_phone']) ? wpinv_clean($_POST['wpinv_phone']) : null,
328
+                'first_name'           => isset($_POST['wpinv_first_name']) ? wpinv_clean($_POST['wpinv_first_name']) : null,
329
+                'last_name'            => isset($_POST['wpinv_last_name']) ? wpinv_clean($_POST['wpinv_last_name']) : null,
330
+                'author'               => isset($_POST['post_author_override']) ? wpinv_clean($_POST['post_author_override']) : null,
331
+                'date_created'         => isset($_POST['date_created']) ? wpinv_clean($_POST['date_created']) : null,
332
+                'due_date'             => isset($_POST['wpinv_due_date']) ? wpinv_clean($_POST['wpinv_due_date']) : null,
333
+                'number'               => isset($_POST['wpinv_number']) ? wpinv_clean($_POST['wpinv_number']) : null,
334
+                'status'               => isset($_POST['wpinv_status']) ? wpinv_clean($_POST['wpinv_status']) : null,
335 335
 			)
336 336
         );
337 337
 
@@ -339,17 +339,17 @@  discard block
 block discarded – undo
339 339
         $invoice->recalculate_total();
340 340
 
341 341
         // If we're creating a new user...
342
-        if ( ! empty( $_POST['wpinv_new_user'] ) && is_email( $_POST['wpinv_email'] ) ) {
342
+        if (!empty($_POST['wpinv_new_user']) && is_email($_POST['wpinv_email'])) {
343 343
 
344 344
             // Attempt to create the user.
345
-            $user = wpinv_create_user( sanitize_email( $_POST['wpinv_email'] ) );
345
+            $user = wpinv_create_user(sanitize_email($_POST['wpinv_email']));
346 346
 
347 347
 
348 348
             // If successful, update the invoice author.
349
-            if ( is_numeric( $user ) ) {
350
-                $invoice->set_author( $user );
349
+            if (is_numeric($user)) {
350
+                $invoice->set_author($user);
351 351
             } else {
352
-                wpinv_error_log( $user->get_error_message(), __( 'Invoice add new user', 'invoicing' ), __FILE__, __LINE__ );
352
+                wpinv_error_log($user->get_error_message(), __('Invoice add new user', 'invoicing'), __FILE__, __LINE__);
353 353
             }
354 354
         }
355 355
 
@@ -357,11 +357,11 @@  discard block
 block discarded – undo
357 357
         $invoice->save();
358 358
 
359 359
         // (Maybe) send new user notification.
360
-        if ( ! empty( $user ) && is_numeric( $user ) && apply_filters( 'getpaid_send_new_user_notification', true ) ) {
361
-            wp_send_new_user_notifications( $user, 'user' );
360
+        if (!empty($user) && is_numeric($user) && apply_filters('getpaid_send_new_user_notification', true)) {
361
+            wp_send_new_user_notifications($user, 'user');
362 362
         }
363 363
 
364 364
         // Fires after an invoice is saved.
365
-		do_action( 'wpinv_invoice_metabox_saved', $invoice );
365
+		do_action('wpinv_invoice_metabox_saved', $invoice);
366 366
 	}
367 367
 }
Please login to merge, or discard this patch.
templates/invoice/footer.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -7,16 +7,16 @@  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
 
14 14
     <div class="border-top pt-4 bg-white">
15 15
         <div class="container pr-0 pl-0">
16 16
 
17
-            <?php if ( $term_text = wpinv_get_terms_text() ) : ?>
17
+            <?php if ($term_text = wpinv_get_terms_text()) : ?>
18 18
                 <div class="terms-text">
19
-                    <?php echo wpautop( $term_text ); ?>
19
+                    <?php echo wpautop($term_text); ?>
20 20
                 </div>
21 21
             <?php endif; ?>
22 22
 
@@ -25,7 +25,7 @@  discard block
 block discarded – undo
25 25
             </div>
26 26
 
27 27
             <div class="print-only">
28
-                <?php _e( 'Page ', 'invoicing' ) ?> {PAGENO}/{nbpg}
28
+                <?php _e('Page ', 'invoicing') ?> {PAGENO}/{nbpg}
29 29
             </div>
30 30
 
31 31
         </div>
Please login to merge, or discard this patch.
templates/invoice/billing-address.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -7,10 +7,10 @@  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
-$invoice     = new WPInv_Invoice( $invoice );
13
-$address_row = wpinv_get_invoice_address_markup( $invoice->get_user_info() );
12
+$invoice     = new WPInv_Invoice($invoice);
13
+$address_row = wpinv_get_invoice_address_markup($invoice->get_user_info());
14 14
 $phone       = $invoice->get_phone();
15 15
 $email       = $invoice->get_email();
16 16
 
@@ -21,36 +21,36 @@  discard block
 block discarded – undo
21 21
 
22 22
 
23 23
             <div class="invoice-billing-address-label col-2">
24
-                <strong><?php _e( 'To:', 'invoicing' ) ?></strong>
24
+                <strong><?php _e('To:', 'invoicing') ?></strong>
25 25
             </div>
26 26
 
27 27
 
28 28
             <div class="invoice-billing-address-value col-10">
29 29
 
30
-                <?php do_action( 'getpaid_billing_address_top' ); ?>
30
+                <?php do_action('getpaid_billing_address_top'); ?>
31 31
 
32
-                <?php if ( ! empty( $address_row ) ) : ?>
32
+                <?php if (!empty($address_row)) : ?>
33 33
                     <div class="billing-address">
34 34
                         <?php echo $address_row; ?>
35 35
                     </div>
36 36
                 <?php endif; ?>
37 37
 
38 38
 
39
-                <?php if ( ! empty( $phone ) ) : ?>
39
+                <?php if (!empty($phone)) : ?>
40 40
                     <div class="billing-phone">
41
-                        <?php echo wp_sprintf( __( 'Phone: %s', 'invoicing' ), esc_html( $phone ) ); ?>
41
+                        <?php echo wp_sprintf(__('Phone: %s', 'invoicing'), esc_html($phone)); ?>
42 42
                     </div>
43 43
                 <?php endif; ?>
44 44
 
45 45
 
46
-                <?php if ( ! empty( $email ) ) : ?>
46
+                <?php if (!empty($email)) : ?>
47 47
                     <div class="billing-email">
48
-                        <?php echo wp_sprintf( __( 'Email: %s', 'invoicing' ), sanitize_email( $email ) ); ?>
48
+                        <?php echo wp_sprintf(__('Email: %s', 'invoicing'), sanitize_email($email)); ?>
49 49
                     </div>
50 50
                 <?php endif; ?>
51 51
 
52 52
 
53
-                <?php do_action( 'getpaid_billing_address_bottom' ); ?>
53
+                <?php do_action('getpaid_billing_address_bottom'); ?>
54 54
 
55 55
             </div>
56 56
 
Please login to merge, or discard this patch.
templates/invoice/header.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,11 +16,11 @@  discard block
 block discarded – undo
16 16
             <div class="row">
17 17
 
18 18
                 <div class="col-12 col-sm-6 text-left pl-0">
19
-                    <?php do_action( 'getpaid_invoice_header_left', $invoice );?>
19
+                    <?php do_action('getpaid_invoice_header_left', $invoice); ?>
20 20
                 </div>
21 21
 
22 22
                 <div class="col-12 col-sm-6 text-right pr-0">
23
-                    <?php do_action( 'getpaid_invoice_header_right', $invoice );?>
23
+                    <?php do_action('getpaid_invoice_header_right', $invoice); ?>
24 24
                 </div>
25 25
 
26 26
             </div>
Please login to merge, or discard this patch.
templates/invoice/details.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -7,26 +7,26 @@
 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
-        <?php do_action( 'getpaid_before_invoice_details_main', $invoice ); ?>
14
+        <?php do_action('getpaid_before_invoice_details_main', $invoice); ?>
15 15
 
16 16
         <div class="getpaid-invoice-details mt-3 mb-3">
17 17
             <div class="row">
18 18
 
19 19
                 <div class="col-12 col-sm-6">
20
-                    <?php do_action( 'getpaid_invoice_details_left', $invoice ); ?>
20
+                    <?php do_action('getpaid_invoice_details_left', $invoice); ?>
21 21
                 </div>
22 22
 
23 23
                 <div class="col-12 col-sm-6">
24
-                    <?php do_action( 'getpaid_invoice_details_right', $invoice ); ?>
24
+                    <?php do_action('getpaid_invoice_details_right', $invoice); ?>
25 25
                 </div>
26 26
 
27 27
             </div>
28 28
         </div>
29 29
 
30
-        <?php do_action( 'getpaid_after_invoice_details_main', $invoice ); ?>
30
+        <?php do_action('getpaid_after_invoice_details_main', $invoice); ?>
31 31
 
32 32
 <?php
Please login to merge, or discard this patch.
templates/wpinv-invoice-print.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -7,18 +7,18 @@  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
 // Fetch the invoice.
13
-$invoice = new WPInv_Invoice( $GLOBALS['post'] );
13
+$invoice = new WPInv_Invoice($GLOBALS['post']);
14 14
 
15 15
 // Abort if it does not exist.
16
-if ( $invoice->get_id() == 0 ) {
16
+if ($invoice->get_id() == 0) {
17 17
     exit;
18 18
 }
19 19
 
20 20
 // Fires before printing an invoice.
21
-do_action( 'wpinv_invoice_print_before_display', $invoice );
21
+do_action('wpinv_invoice_print_before_display', $invoice);
22 22
 
23 23
 ?><!DOCTYPE html>
24 24
 
@@ -27,7 +27,7 @@  discard block
 block discarded – undo
27 27
 
28 28
     <head>
29 29
 
30
-		<meta charset="<?php bloginfo( 'charset' ); ?>">
30
+		<meta charset="<?php bloginfo('charset'); ?>">
31 31
         <meta name="viewport" content="width=device-width, initial-scale=1.0" >
32 32
 
33 33
         <meta name="robots" content="noindex,nofollow">
@@ -36,15 +36,15 @@  discard block
 block discarded – undo
36 36
 
37 37
         <title><?php wp_title() ?></title>
38 38
 
39
-        <?php do_action( 'wpinv_invoice_print_head', $invoice ); ?>
39
+        <?php do_action('wpinv_invoice_print_head', $invoice); ?>
40 40
 
41 41
     </head>
42 42
     
43 43
 
44 44
     <body class="body wpinv wpinv-print">
45 45
 
46
-        <?php do_action( 'getpaid_invoice', $invoice ); ?>
47
-        <?php do_action( 'wpinv_invoice_print_body_end', $invoice ); ?>
46
+        <?php do_action('getpaid_invoice', $invoice); ?>
47
+        <?php do_action('wpinv_invoice_print_body_end', $invoice); ?>
48 48
 
49 49
     </body>
50 50
 
Please login to merge, or discard this patch.
templates/payment-forms/elements/total_payable.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -7,13 +7,13 @@
 block discarded – undo
7 7
  * @version 1.0.19
8 8
  */
9 9
 
10
-defined( 'ABSPATH' ) || exit;
10
+defined('ABSPATH') || exit;
11 11
 
12
-if ( empty( $text ) ) {
13
-    $text = __( 'Total to pay:', 'invoicing' );
12
+if (empty($text)) {
13
+    $text = __('Total to pay:', 'invoicing');
14 14
 }
15 15
 ?>
16 16
 <div class="form-group mt-4">
17
-    <strong><?php echo sanitize_text_field( $text ); ?></strong>
17
+    <strong><?php echo sanitize_text_field($text); ?></strong>
18 18
     <span class="getpaid-checkout-total-payable"></span>
19 19
 </div>
Please login to merge, or discard this patch.
templates/invoice/company-address.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -7,14 +7,14 @@  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
 global $wpinv_euvat;
13 13
 
14 14
 // Prepare the company name.
15 15
 $company_name = $wpinv_euvat->get_company_name();
16 16
 
17
-if ( empty( $company_name ) ) {
17
+if (empty($company_name)) {
18 18
     $company_name = wpinv_get_business_name();
19 19
 }
20 20
 
@@ -24,30 +24,30 @@  discard block
 block discarded – undo
24 24
         <div class="row">
25 25
 
26 26
             <div class="invoice-company-address-label col-2">
27
-                <strong><?php _e( 'From:', 'invoicing' ) ?></strong>
27
+                <strong><?php _e('From:', 'invoicing') ?></strong>
28 28
             </div>
29 29
 
30 30
             <div class="invoice-company-address-value col-10">
31 31
 
32
-                <?php do_action( 'getpaid_company_address_top' ); ?>
32
+                <?php do_action('getpaid_company_address_top'); ?>
33 33
 
34 34
                 <div class="name">
35
-                    <a target="_blank" class="text-dark" href="<?php echo esc_url( wpinv_get_business_website() ); ?>">
36
-                        <?php echo esc_html( wpinv_get_business_name() ); ?>
35
+                    <a target="_blank" class="text-dark" href="<?php echo esc_url(wpinv_get_business_website()); ?>">
36
+                        <?php echo esc_html(wpinv_get_business_name()); ?>
37 37
                     </a>
38 38
                 </div>
39 39
 
40
-                <?php if ( $address = wpinv_get_business_address() ) { ?>
41
-                    <?php echo $address;?>
40
+                <?php if ($address = wpinv_get_business_address()) { ?>
41
+                    <?php echo $address; ?>
42 42
                 <?php } ?>
43 43
 
44
-                <?php if ( $email_from = wpinv_mail_get_from_address() ) { ?>
44
+                <?php if ($email_from = wpinv_mail_get_from_address()) { ?>
45 45
                     <div class="email_from">
46
-                        <?php echo wp_sprintf( __( 'Email: %s', 'invoicing' ), $email_from );?>
46
+                        <?php echo wp_sprintf(__('Email: %s', 'invoicing'), $email_from); ?>
47 47
                     </div>
48 48
                 <?php } ?>
49 49
 
50
-                <?php do_action( 'getpaid_company_address_bottom' ); ?>
50
+                <?php do_action('getpaid_company_address_bottom'); ?>
51 51
 
52 52
             </div>
53 53
 
Please login to merge, or discard this patch.
includes/deprecated-functions.php 2 patches
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -246,7 +246,7 @@  discard block
 block discarded – undo
246 246
  * @deprecated
247 247
  */
248 248
 function wpinv_get_payment_key( $invoice = 0 ) {
249
-	$invoice = new WPInv_Invoice( $invoice );
249
+    $invoice = new WPInv_Invoice( $invoice );
250 250
     return $invoice->get_key();
251 251
 }
252 252
 
@@ -424,7 +424,7 @@  discard block
 block discarded – undo
424 424
  * @deprecated
425 425
  */
426 426
 function wpinv_get_checkout_session() {
427
-	return false;
427
+    return false;
428 428
 }
429 429
 
430 430
 /**
Please login to merge, or discard this patch.
Spacing   +91 added lines, -91 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( wpinv_format_amount( $subtotal ), $invoice->get_currency() );
153
+    if ($currency) {
154
+        return wpinv_price(wpinv_format_amount($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( wpinv_format_amount( $tax ), $invoice->get_currency() );
167
+    if ($currency) {
168
+        return wpinv_price(wpinv_format_amount($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, $deprecated ) {
178
-    $invoice  = new WPInv_Invoice( $invoice );
177
+function wpinv_discount($invoice = 0, $currency = false, $deprecated) {
178
+    $invoice  = new WPInv_Invoice($invoice);
179 179
     $discount = $invoice->get_total_discount();
180 180
 
181
-    if ( $currency ) {
182
-        return wpinv_price( wpinv_format_amount( $discount ), $invoice->get_currency() );
181
+    if ($currency) {
182
+        return wpinv_price(wpinv_format_amount($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( wpinv_format_amount( $total ), $invoice->get_currency() );
203
+    if ($currency) {
204
+        return wpinv_price(wpinv_format_amount($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'              => date( 'Y-m-d H:i:s', current_time( 'timestamp' ) ),
500
+        'date'              => date('Y-m-d H:i:s', current_time('timestamp')),
501 501
         'user_info'         => $invoice->get_user_info(),
502
-        'post_data'         => stripslashes_deep( $_POST ),
502
+        'post_data'         => stripslashes_deep($_POST),
503 503
         'cart_details'      => $invoice->get_cart_details(),
504 504
         'gateway'           => $gateway,
505 505
         'card_info'         => array(),
506 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( $message, $title, array( 'response' => $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($message, $title, array('response' => $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 wpinv_item_price( $item_id );
857
+    if ($echo) {
858
+        echo 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
 }
Please login to merge, or discard this patch.