Passed
Push — master ( 69e6d2...8b22fd )
by Brian
04:39
created
templates/payment-forms/cart-totals.php 2 patches
Indentation   +17 added lines, -17 removed lines patch added patch discarded remove patch
@@ -11,26 +11,26 @@  discard block
 block discarded – undo
11 11
 
12 12
 // Totals rows.
13 13
 $totals = apply_filters(
14
-	'getpaid_payment_form_cart_table_totals',
15
-	array(
16
-		'subtotal' => __( 'Subtotal', 'invoicing' ),
17
-		'tax'      => __( 'Tax', 'invoicing' ),
18
-		'fees'     => __( 'Fee', 'invoicing' ),
19
-		'discount' => __( 'Discount', 'invoicing' ),
20
-		'total'    => __( 'Total', 'invoicing' ),
21
-	),
22
-	$form
14
+    'getpaid_payment_form_cart_table_totals',
15
+    array(
16
+        'subtotal' => __( 'Subtotal', 'invoicing' ),
17
+        'tax'      => __( 'Tax', 'invoicing' ),
18
+        'fees'     => __( 'Fee', 'invoicing' ),
19
+        'discount' => __( 'Discount', 'invoicing' ),
20
+        'total'    => __( 'Total', 'invoicing' ),
21
+    ),
22
+    $form
23 23
 );
24 24
 
25 25
 $currency = $form->get_currency();
26 26
 $country  = wpinv_get_default_country();
27 27
 
28 28
 if ( ! empty( $form->invoice ) ) {
29
-	$country  = $form->invoice->get_country();
29
+    $country  = $form->invoice->get_country();
30 30
 }
31 31
 
32 32
 if ( ! wpinv_use_taxes() && isset( $totals['tax'] ) ) {
33
-	unset( $totals['tax'] );
33
+    unset( $totals['tax'] );
34 34
 }
35 35
 
36 36
 do_action( 'getpaid_before_payment_form_cart_totals', $form, $totals );
@@ -61,13 +61,13 @@  discard block
 block discarded – undo
61 61
 
62 62
 							<?php
63 63
 
64
-								// Total tax.
65
-								if ( in_array( $key, array( 'tax', 'discount', 'subtotal', 'total', 'fees' ) ) ) {
66
-								wpinv_the_price( 0, $currency );
67
-								}
64
+                                // Total tax.
65
+                                if ( in_array( $key, array( 'tax', 'discount', 'subtotal', 'total', 'fees' ) ) ) {
66
+                                wpinv_the_price( 0, $currency );
67
+                                }
68 68
 
69
-								do_action( "getpaid_payment_form_cart_totals_$key", $form );
70
-							?>
69
+                                do_action( "getpaid_payment_form_cart_totals_$key", $form );
70
+                            ?>
71 71
 
72 72
 						</div>
73 73
 
Please login to merge, or discard this patch.
Spacing   +19 added lines, -19 removed lines patch added patch discarded remove patch
@@ -7,17 +7,17 @@  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
 // Totals rows.
13 13
 $totals = apply_filters(
14 14
 	'getpaid_payment_form_cart_table_totals',
15 15
 	array(
16
-		'subtotal' => __( 'Subtotal', 'invoicing' ),
17
-		'tax'      => __( 'Tax', 'invoicing' ),
18
-		'fees'     => __( 'Fee', 'invoicing' ),
19
-		'discount' => __( 'Discount', 'invoicing' ),
20
-		'total'    => __( 'Total', 'invoicing' ),
16
+		'subtotal' => __('Subtotal', 'invoicing'),
17
+		'tax'      => __('Tax', 'invoicing'),
18
+		'fees'     => __('Fee', 'invoicing'),
19
+		'discount' => __('Discount', 'invoicing'),
20
+		'total'    => __('Total', 'invoicing'),
21 21
 	),
22 22
 	$form
23 23
 );
@@ -25,15 +25,15 @@  discard block
 block discarded – undo
25 25
 $currency = $form->get_currency();
26 26
 $country  = wpinv_get_default_country();
27 27
 
28
-if ( ! empty( $form->invoice ) ) {
29
-	$country  = $form->invoice->get_country();
28
+if (!empty($form->invoice)) {
29
+	$country = $form->invoice->get_country();
30 30
 }
31 31
 
32
-if ( ! wpinv_use_taxes() && isset( $totals['tax'] ) ) {
33
-	unset( $totals['tax'] );
32
+if (!wpinv_use_taxes() && isset($totals['tax'])) {
33
+	unset($totals['tax']);
34 34
 }
35 35
 
36
-do_action( 'getpaid_before_payment_form_cart_totals', $form, $totals );
36
+do_action('getpaid_before_payment_form_cart_totals', $form, $totals);
37 37
 
38 38
 ?>
39 39
 <style>
@@ -47,26 +47,26 @@  discard block
 block discarded – undo
47 47
 	<div class="row">
48 48
 		<div class="col-12 offset-sm-6 col-sm-6 border-sm-left pl-sm-0">
49 49
 
50
-			<?php foreach ( $totals as $key => $label ) : ?>
50
+			<?php foreach ($totals as $key => $label) : ?>
51 51
 
52
-				<div class="getpaid-form-cart-totals-col getpaid-form-cart-totals-<?php echo esc_attr( $key ); ?> font-weight-bold py-2 px-3 <?php echo 'total' == $key ? 'bg-light' : 'border-bottom'; ?>">
52
+				<div class="getpaid-form-cart-totals-col getpaid-form-cart-totals-<?php echo esc_attr($key); ?> font-weight-bold py-2 px-3 <?php echo 'total' == $key ? 'bg-light' : 'border-bottom'; ?>">
53 53
 
54 54
 					<div class="form-row">
55 55
 
56 56
 						<div class="col-8 pl-sm-0 getpaid-payment-form-line-totals-label">
57
-							<?php echo esc_html( $label ); ?>
57
+							<?php echo esc_html($label); ?>
58 58
 						</div>
59 59
 
60
-						<div class="col-4 getpaid-payment-form-line-totals-value getpaid-form-cart-totals-total-<?php echo esc_attr( $key ); ?>">
60
+						<div class="col-4 getpaid-payment-form-line-totals-value getpaid-form-cart-totals-total-<?php echo esc_attr($key); ?>">
61 61
 
62 62
 							<?php
63 63
 
64 64
 								// Total tax.
65
-								if ( in_array( $key, array( 'tax', 'discount', 'subtotal', 'total', 'fees' ) ) ) {
66
-								wpinv_the_price( 0, $currency );
65
+								if (in_array($key, array('tax', 'discount', 'subtotal', 'total', 'fees'))) {
66
+								wpinv_the_price(0, $currency);
67 67
 								}
68 68
 
69
-								do_action( "getpaid_payment_form_cart_totals_$key", $form );
69
+								do_action("getpaid_payment_form_cart_totals_$key", $form);
70 70
 							?>
71 71
 
72 72
 						</div>
@@ -82,4 +82,4 @@  discard block
 block discarded – undo
82 82
 </div>
83 83
 
84 84
 <?php
85
-do_action( 'getpaid_payment_form_cart_totals', $form, $totals );
85
+do_action('getpaid_payment_form_cart_totals', $form, $totals);
Please login to merge, or discard this patch.
templates/emails/wpinv-email-footer.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -1,11 +1,11 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 // don't load directly
3
-if ( ! defined( 'ABSPATH' ) ) {
4
-    die( '-1' );
3
+if (!defined('ABSPATH')) {
4
+    die('-1');
5 5
 }
6 6
 
7
-$email_footer = apply_filters( 'wpinv_email_footer_text', wpinv_get_option( 'email_footer_text', get_bloginfo( 'name', 'display' ) . ' - ' . __( 'Powered by GetPaid', 'invoicing' ) ) );
8
-$email_footer = $email_footer ? wp_kses_post( wpautop( wptexturize( $email_footer ) ) ) : '';
7
+$email_footer = apply_filters('wpinv_email_footer_text', wpinv_get_option('email_footer_text', get_bloginfo('name', 'display') . ' - ' . __('Powered by GetPaid', 'invoicing')));
8
+$email_footer = $email_footer ? wp_kses_post(wpautop(wptexturize($email_footer))) : '';
9 9
 ?>
10 10
                                                             </div>
11 11
                                                         </td>
@@ -27,7 +27,7 @@  discard block
 block discarded – undo
27 27
                                                 <table border="0" cellpadding="10" cellspacing="0" width="100%">
28 28
                                                     <tr>
29 29
                                                         <td colspan="2" valign="middle" id="credit">
30
-                                                            <?php echo wp_kses_post( $email_footer ); ?>
30
+                                                            <?php echo wp_kses_post($email_footer); ?>
31 31
                                                         </td>
32 32
                                                     </tr>
33 33
                                                 </table>
Please login to merge, or discard this patch.
templates/emails/invoice-totals.php 1 patch
Spacing   +23 added lines, -23 removed lines patch added patch discarded remove patch
@@ -8,22 +8,22 @@  discard block
 block discarded – undo
8 8
  * @var WPInv_Invoice $invoice
9 9
  */
10 10
 
11
-defined( 'ABSPATH' ) || exit;
11
+defined('ABSPATH') || exit;
12 12
 
13 13
 // Totals rows.
14
-$totals = getpaid_invoice_totals_rows( $invoice );
14
+$totals = getpaid_invoice_totals_rows($invoice);
15 15
 
16
-do_action( 'getpaid_before_email_line_totals', $invoice, $totals );
16
+do_action('getpaid_before_email_line_totals', $invoice, $totals);
17 17
 
18 18
 ?>
19 19
 
20 20
 
21
-<?php if ( has_action( 'wpinv_email_footer_buttons' ) ) : ?>
21
+<?php if (has_action('wpinv_email_footer_buttons')) : ?>
22 22
 
23 23
     <tr class="wpinv_cart_footer_row">
24 24
 
25
-        <td colspan="<?php echo ( (int) $column_count ); ?>">
26
-            <?php do_action( 'wpinv_email_footer_buttons' ); ?>
25
+        <td colspan="<?php echo ((int) $column_count); ?>">
26
+            <?php do_action('wpinv_email_footer_buttons'); ?>
27 27
         </td>
28 28
 
29 29
     </tr>
@@ -31,44 +31,44 @@  discard block
 block discarded – undo
31 31
 <?php endif; ?>
32 32
 
33 33
 
34
-<?php foreach ( $totals as $key => $label ) : ?>
34
+<?php foreach ($totals as $key => $label) : ?>
35 35
 
36
-    <tr class="wpinv_cart_footer_row wpinv_cart_<?php echo esc_html( $key ); ?>_row">
36
+    <tr class="wpinv_cart_footer_row wpinv_cart_<?php echo esc_html($key); ?>_row">
37 37
 
38
-        <td colspan="<?php echo absint( ( $column_count - 1 ) ); ?>" class="wpinv_cart_<?php echo esc_html( $key ); ?>_label text-right">
39
-            <strong><?php echo esc_html( $label ); ?>:</strong>
38
+        <td colspan="<?php echo absint(($column_count - 1)); ?>" class="wpinv_cart_<?php echo esc_html($key); ?>_label text-right">
39
+            <strong><?php echo esc_html($label); ?>:</strong>
40 40
         </td>
41 41
 
42
-        <td class="wpinv_cart_<?php echo esc_html( $key ); ?> text-right">
42
+        <td class="wpinv_cart_<?php echo esc_html($key); ?> text-right">
43 43
 
44 44
             <?php
45 45
 
46 46
                 // Total tax.
47
-                if ( 'tax' == $key ) {
48
-                    wpinv_the_price( $invoice->get_total_tax(), $invoice->get_currency() );
47
+                if ('tax' == $key) {
48
+                    wpinv_the_price($invoice->get_total_tax(), $invoice->get_currency());
49 49
                 }
50 50
 
51
-                if ( 'fee' == $key ) {
52
-                    wpinv_the_price( $invoice->get_total_fees(), $invoice->get_currency() );
51
+                if ('fee' == $key) {
52
+                    wpinv_the_price($invoice->get_total_fees(), $invoice->get_currency());
53 53
                 }
54 54
 
55 55
                 // Total discount.
56
-                if ( 'discount' == $key ) {
57
-                    wpinv_the_price( $invoice->get_total_discount(), $invoice->get_currency() );
56
+                if ('discount' == $key) {
57
+                    wpinv_the_price($invoice->get_total_discount(), $invoice->get_currency());
58 58
                 }
59 59
 
60 60
                 // Sub total.
61
-                if ( 'subtotal' == $key ) {
62
-                    wpinv_the_price( $invoice->get_subtotal(), $invoice->get_currency() );
61
+                if ('subtotal' == $key) {
62
+                    wpinv_the_price($invoice->get_subtotal(), $invoice->get_currency());
63 63
                 }
64 64
 
65 65
                 // Total.
66
-                if ( 'total' == $key ) {
67
-                    wpinv_the_price( $invoice->get_total(), $invoice->get_currency() );
66
+                if ('total' == $key) {
67
+                    wpinv_the_price($invoice->get_total(), $invoice->get_currency());
68 68
                 }
69 69
 
70 70
                 // Fires when printing a cart total in an email.
71
-                do_action( "getpaid_email_cart_totals_$key", $invoice );
71
+                do_action("getpaid_email_cart_totals_$key", $invoice);
72 72
 
73 73
             ?>
74 74
 
@@ -80,4 +80,4 @@  discard block
 block discarded – undo
80 80
 
81 81
 <?php
82 82
 
83
-    do_action( 'getpaid_after_email_line_totals', $invoice, $totals );
83
+    do_action('getpaid_after_email_line_totals', $invoice, $totals);
Please login to merge, or discard this patch.
templates/emails/invoice-item.php 2 patches
Indentation   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -30,40 +30,40 @@
 block discarded – undo
30 30
                 // Item name.
31 31
                 if ( 'name' == $column ) {
32 32
 
33
-				// Display the name.
34
-				echo '<div class="wpinv_email_cart_item_title">' . esc_html( $item->get_name() ) . '</div>';
33
+                // Display the name.
34
+                echo '<div class="wpinv_email_cart_item_title">' . esc_html( $item->get_name() ) . '</div>';
35 35
 
36
-				// And an optional description.
37
-				$description = $item->get_description();
36
+                // And an optional description.
37
+                $description = $item->get_description();
38 38
 
39
-				if ( ! empty( $description ) ) {
40
-					echo "<p class='small'>" . wp_kses_post( $description ) . "</p>";
39
+                if ( ! empty( $description ) ) {
40
+                    echo "<p class='small'>" . wp_kses_post( $description ) . "</p>";
41 41
                     }
42 42
 }
43 43
 
44 44
                 // Item price.
45 45
                 if ( 'price' == $column ) {
46 46
 
47
-				// Display the item price (or recurring price if this is a renewal invoice)
48
-				$price = $invoice->is_renewal() ? $item->get_price() : $item->get_initial_price();
49
-				wpinv_the_price( $price, $invoice->get_currency() );
47
+                // Display the item price (or recurring price if this is a renewal invoice)
48
+                $price = $invoice->is_renewal() ? $item->get_price() : $item->get_initial_price();
49
+                wpinv_the_price( $price, $invoice->get_currency() );
50 50
 
51 51
                 }
52 52
 
53 53
                 // Item quantity.
54 54
                 if ( 'quantity' == $column ) {
55
-				echo (float) $item->get_quantity();
55
+                echo (float) $item->get_quantity();
56 56
                 }
57 57
 
58 58
                 // Tax rate.
59 59
                 if ( 'tax_rate' == $column ) {
60
-				echo floatval( round( getpaid_get_invoice_tax_rate( $invoice, $item ), 2 ) ) . '%';
60
+                echo floatval( round( getpaid_get_invoice_tax_rate( $invoice, $item ), 2 ) ) . '%';
61 61
                 }
62 62
 
63 63
                 // Item sub total.
64 64
                 if ( 'subtotal' == $column ) {
65
-				$subtotal = $invoice->is_renewal() ? $item->get_recurring_sub_total() : $item->get_sub_total();
66
-				wpinv_the_price( $subtotal, $invoice->get_currency() );
65
+                $subtotal = $invoice->is_renewal() ? $item->get_recurring_sub_total() : $item->get_sub_total();
66
+                wpinv_the_price( $subtotal, $invoice->get_currency() );
67 67
                 }
68 68
 
69 69
                 // Fires when printing a line item column.
Please login to merge, or discard this patch.
Spacing   +19 added lines, -19 removed lines patch added patch discarded remove patch
@@ -10,64 +10,64 @@  discard block
 block discarded – undo
10 10
  * @var array $columns
11 11
  */
12 12
 
13
-defined( 'ABSPATH' ) || exit;
13
+defined('ABSPATH') || exit;
14 14
 
15 15
 ?>
16 16
 
17
-<?php do_action( 'getpaid_before_email_line_item', $invoice, $item ); ?>
17
+<?php do_action('getpaid_before_email_line_item', $invoice, $item); ?>
18 18
 
19
-<tr class="wpinv_cart_item item-type-<?php echo esc_attr( $item->get_type() ); ?>">
19
+<tr class="wpinv_cart_item item-type-<?php echo esc_attr($item->get_type()); ?>">
20 20
 
21
-    <?php foreach ( array_keys( $columns ) as $column ) : ?>
21
+    <?php foreach (array_keys($columns) as $column) : ?>
22 22
 
23
-        <td class="<?php echo 'name' == $column ? 'text-left' : 'text-right'; ?> wpinv_cart_item_<?php echo esc_attr( $column ); ?>">
23
+        <td class="<?php echo 'name' == $column ? 'text-left' : 'text-right'; ?> wpinv_cart_item_<?php echo esc_attr($column); ?>">
24 24
             
25 25
             <?php
26 26
 
27 27
                 // Fires before printing a line item column.
28
-                do_action( "getpaid_email_line_item_before_$column", $item, $invoice );
28
+                do_action("getpaid_email_line_item_before_$column", $item, $invoice);
29 29
 
30 30
                 // Item name.
31
-                if ( 'name' == $column ) {
31
+                if ('name' == $column) {
32 32
 
33 33
 				// Display the name.
34
-				echo '<div class="wpinv_email_cart_item_title">' . esc_html( $item->get_name() ) . '</div>';
34
+				echo '<div class="wpinv_email_cart_item_title">' . esc_html($item->get_name()) . '</div>';
35 35
 
36 36
 				// And an optional description.
37 37
 				$description = $item->get_description();
38 38
 
39
-				if ( ! empty( $description ) ) {
40
-					echo "<p class='small'>" . wp_kses_post( $description ) . "</p>";
39
+				if (!empty($description)) {
40
+					echo "<p class='small'>" . wp_kses_post($description) . "</p>";
41 41
                     }
42 42
 }
43 43
 
44 44
                 // Item price.
45
-                if ( 'price' == $column ) {
45
+                if ('price' == $column) {
46 46
 
47 47
 				// Display the item price (or recurring price if this is a renewal invoice)
48 48
 				$price = $invoice->is_renewal() ? $item->get_price() : $item->get_initial_price();
49
-				wpinv_the_price( $price, $invoice->get_currency() );
49
+				wpinv_the_price($price, $invoice->get_currency());
50 50
 
51 51
                 }
52 52
 
53 53
                 // Item quantity.
54
-                if ( 'quantity' == $column ) {
54
+                if ('quantity' == $column) {
55 55
 				echo (float) $item->get_quantity();
56 56
                 }
57 57
 
58 58
                 // Tax rate.
59
-                if ( 'tax_rate' == $column ) {
60
-				echo floatval( round( getpaid_get_invoice_tax_rate( $invoice, $item ), 2 ) ) . '%';
59
+                if ('tax_rate' == $column) {
60
+				echo floatval(round(getpaid_get_invoice_tax_rate($invoice, $item), 2)) . '%';
61 61
                 }
62 62
 
63 63
                 // Item sub total.
64
-                if ( 'subtotal' == $column ) {
64
+                if ('subtotal' == $column) {
65 65
 				$subtotal = $invoice->is_renewal() ? $item->get_recurring_sub_total() : $item->get_sub_total();
66
-				wpinv_the_price( $subtotal, $invoice->get_currency() );
66
+				wpinv_the_price($subtotal, $invoice->get_currency());
67 67
                 }
68 68
 
69 69
                 // Fires when printing a line item column.
70
-                do_action( "getpaid_email_line_item_$column", $item, $invoice );
70
+                do_action("getpaid_email_line_item_$column", $item, $invoice);
71 71
 
72 72
             ?>
73 73
 
@@ -77,4 +77,4 @@  discard block
 block discarded – undo
77 77
 
78 78
 </tr>
79 79
 
80
-<?php do_action( 'getpaid_after_email_line_item', $invoice, $item ); ?>
80
+<?php do_action('getpaid_after_email_line_item', $invoice, $item); ?>
Please login to merge, or discard this patch.
templates/emails/wpinv-email-user_note.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -7,21 +7,21 @@
 block discarded – undo
7 7
  * @version 1.0.19
8 8
  */
9 9
 
10
-defined( 'ABSPATH' ) || exit;
10
+defined('ABSPATH') || exit;
11 11
 
12
-do_action( 'wpinv_email_header', $email_heading, $invoice, $email_type, $sent_to_admin );
12
+do_action('wpinv_email_header', $email_heading, $invoice, $email_type, $sent_to_admin);
13 13
 
14
-do_action( 'wpinv_email_before_note_details', $invoice, $email_type, $sent_to_admin, $customer_note );
14
+do_action('wpinv_email_before_note_details', $invoice, $email_type, $sent_to_admin, $customer_note);
15 15
 
16 16
 // Generate the custom message body.
17
-echo wp_kses_post( wptexturize( str_replace( '{customer_note}', $customer_note, $message_body ) ) );
17
+echo wp_kses_post(wptexturize(str_replace('{customer_note}', $customer_note, $message_body)));
18 18
 
19
-do_action( 'wpinv_email_invoice_details', $invoice, $email_type, $sent_to_admin );
19
+do_action('wpinv_email_invoice_details', $invoice, $email_type, $sent_to_admin);
20 20
 
21
-do_action( 'wpinv_email_invoice_items', $invoice, $email_type, $sent_to_admin );
21
+do_action('wpinv_email_invoice_items', $invoice, $email_type, $sent_to_admin);
22 22
 
23
-do_action( 'wpinv_email_billing_details', $invoice, $email_type, $sent_to_admin );
23
+do_action('wpinv_email_billing_details', $invoice, $email_type, $sent_to_admin);
24 24
 
25
-do_action( 'wpinv_email_after_note_details', $invoice, $email_type, $sent_to_admin, $customer_note );
25
+do_action('wpinv_email_after_note_details', $invoice, $email_type, $sent_to_admin, $customer_note);
26 26
 
27
-do_action( 'wpinv_email_footer', $invoice, $email_type, $sent_to_admin );
27
+do_action('wpinv_email_footer', $invoice, $email_type, $sent_to_admin);
Please login to merge, or discard this patch.
templates/emails/fee-item.php 2 patches
Indentation   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -30,21 +30,21 @@  discard block
 block discarded – undo
30 30
                 // Item name.
31 31
                 if ( 'name' == $column ) {
32 32
 
33
-				// Display the name.
34
-				echo '<div class="wpinv_email_cart_item_title">' . esc_html( $fee['name'] ) . '</div>';
33
+                // Display the name.
34
+                echo '<div class="wpinv_email_cart_item_title">' . esc_html( $fee['name'] ) . '</div>';
35 35
 
36
-				// And an optional description.
37
-				$description = empty( $fee['description'] ) ? esc_html__( 'Fee', 'invoicing' ) : esc_html( $fee['description'] );
38
-				echo wp_kses_post( "<p class='small'>$description</p>" );
36
+                // And an optional description.
37
+                $description = empty( $fee['description'] ) ? esc_html__( 'Fee', 'invoicing' ) : esc_html( $fee['description'] );
38
+                echo wp_kses_post( "<p class='small'>$description</p>" );
39 39
 
40 40
                 }
41 41
 
42 42
                 // Item price.
43 43
                 if ( 'price' == $column ) {
44 44
 
45
-				// Display the item price (or recurring price if this is a renewal invoice)
46
-				if ( $invoice->is_recurring() && $invoice->is_renewal() ) {
47
-					wpinv_the_price( $fee['recurring_fee'], $invoice->get_currency() );
45
+                // Display the item price (or recurring price if this is a renewal invoice)
46
+                if ( $invoice->is_recurring() && $invoice->is_renewal() ) {
47
+                    wpinv_the_price( $fee['recurring_fee'], $invoice->get_currency() );
48 48
                     } else {
49 49
                         wpinv_the_price( $fee['initial_fee'], $invoice->get_currency() );
50 50
                     }
@@ -52,18 +52,18 @@  discard block
 block discarded – undo
52 52
 
53 53
                 // Item quantity.
54 54
                 if ( 'quantity' == $column ) {
55
-				echo '&mdash;';
55
+                echo '&mdash;';
56 56
                 }
57 57
 
58 58
                 // Item tax.
59 59
                 if ( 'tax_rate' == $column ) {
60
-				echo '&mdash;';
60
+                echo '&mdash;';
61 61
                 }
62 62
 
63 63
                 // Item sub total.
64 64
                 if ( 'subtotal' == $column ) {
65
-				if ( $invoice->is_recurring() && $invoice->is_renewal() ) {
66
-					wpinv_the_price( $fee['recurring_fee'], $invoice->get_currency() );
65
+                if ( $invoice->is_recurring() && $invoice->is_renewal() ) {
66
+                    wpinv_the_price( $fee['recurring_fee'], $invoice->get_currency() );
67 67
                 } else {
68 68
                     wpinv_the_price( $fee['initial_fee'], $invoice->get_currency() );
69 69
                 }
Please login to merge, or discard this patch.
Spacing   +21 added lines, -21 removed lines patch added patch discarded remove patch
@@ -10,67 +10,67 @@  discard block
 block discarded – undo
10 10
  * @var array $columns
11 11
  */
12 12
 
13
-defined( 'ABSPATH' ) || exit;
13
+defined('ABSPATH') || exit;
14 14
 
15 15
 ?>
16 16
 
17
-<?php do_action( 'getpaid_before_email_fee_item', $invoice, $fee ); ?>
17
+<?php do_action('getpaid_before_email_fee_item', $invoice, $fee); ?>
18 18
 
19 19
 <tr class="wpinv_cart_item item-fee">
20 20
 
21
-    <?php foreach ( array_keys( $columns ) as $column ) : ?>
21
+    <?php foreach (array_keys($columns) as $column) : ?>
22 22
 
23
-        <td class="<?php echo 'name' == $column ? 'text-left' : 'text-right'; ?> wpinv_cart_item_<?php echo esc_attr( $column ); ?>">
23
+        <td class="<?php echo 'name' == $column ? 'text-left' : 'text-right'; ?> wpinv_cart_item_<?php echo esc_attr($column); ?>">
24 24
             
25 25
             <?php
26 26
 
27 27
                 // Fires before printing a fee item column.
28
-                do_action( "getpaid_email_fee_item_before_$column", $fee, $invoice );
28
+                do_action("getpaid_email_fee_item_before_$column", $fee, $invoice);
29 29
 
30 30
                 // Item name.
31
-                if ( 'name' == $column ) {
31
+                if ('name' == $column) {
32 32
 
33 33
 				// Display the name.
34
-				echo '<div class="wpinv_email_cart_item_title">' . esc_html( $fee['name'] ) . '</div>';
34
+				echo '<div class="wpinv_email_cart_item_title">' . esc_html($fee['name']) . '</div>';
35 35
 
36 36
 				// And an optional description.
37
-				$description = empty( $fee['description'] ) ? esc_html__( 'Fee', 'invoicing' ) : esc_html( $fee['description'] );
38
-				echo wp_kses_post( "<p class='small'>$description</p>" );
37
+				$description = empty($fee['description']) ? esc_html__('Fee', 'invoicing') : esc_html($fee['description']);
38
+				echo wp_kses_post("<p class='small'>$description</p>");
39 39
 
40 40
                 }
41 41
 
42 42
                 // Item price.
43
-                if ( 'price' == $column ) {
43
+                if ('price' == $column) {
44 44
 
45 45
 				// Display the item price (or recurring price if this is a renewal invoice)
46
-				if ( $invoice->is_recurring() && $invoice->is_renewal() ) {
47
-					wpinv_the_price( $fee['recurring_fee'], $invoice->get_currency() );
46
+				if ($invoice->is_recurring() && $invoice->is_renewal()) {
47
+					wpinv_the_price($fee['recurring_fee'], $invoice->get_currency());
48 48
                     } else {
49
-                        wpinv_the_price( $fee['initial_fee'], $invoice->get_currency() );
49
+                        wpinv_the_price($fee['initial_fee'], $invoice->get_currency());
50 50
                     }
51 51
 }
52 52
 
53 53
                 // Item quantity.
54
-                if ( 'quantity' == $column ) {
54
+                if ('quantity' == $column) {
55 55
 				echo '&mdash;';
56 56
                 }
57 57
 
58 58
                 // Item tax.
59
-                if ( 'tax_rate' == $column ) {
59
+                if ('tax_rate' == $column) {
60 60
 				echo '&mdash;';
61 61
                 }
62 62
 
63 63
                 // Item sub total.
64
-                if ( 'subtotal' == $column ) {
65
-				if ( $invoice->is_recurring() && $invoice->is_renewal() ) {
66
-					wpinv_the_price( $fee['recurring_fee'], $invoice->get_currency() );
64
+                if ('subtotal' == $column) {
65
+				if ($invoice->is_recurring() && $invoice->is_renewal()) {
66
+					wpinv_the_price($fee['recurring_fee'], $invoice->get_currency());
67 67
                 } else {
68
-                    wpinv_the_price( $fee['initial_fee'], $invoice->get_currency() );
68
+                    wpinv_the_price($fee['initial_fee'], $invoice->get_currency());
69 69
                 }
70 70
                 }
71 71
 
72 72
                 // Fires when printing a line item column.
73
-                do_action( "getpaid_email_fee_item_$column", $fee, $invoice );
73
+                do_action("getpaid_email_fee_item_$column", $fee, $invoice);
74 74
 
75 75
             ?>
76 76
 
@@ -80,4 +80,4 @@  discard block
 block discarded – undo
80 80
 
81 81
 </tr>
82 82
 
83
-<?php do_action( 'getpaid_after_email_fee_item', $invoice, $fee ); ?>
83
+<?php do_action('getpaid_after_email_fee_item', $invoice, $fee); ?>
Please login to merge, or discard this patch.
templates/invoice-receipt.php 2 patches
Indentation   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -126,25 +126,25 @@
 block discarded – undo
126 126
 
127 127
             if ( ! empty( $invoice_actions ) ) {
128 128
 
129
-			echo '<div class="wpinv-receipt-actions text-right mt-1 mb-4">';
129
+            echo '<div class="wpinv-receipt-actions text-right mt-1 mb-4">';
130 130
 
131
-			foreach ( $invoice_actions as $key => $invoice_action ) {
131
+            foreach ( $invoice_actions as $key => $invoice_action ) {
132 132
 
133
-				$key    = sanitize_html_class( $key );
134
-				$class  = empty( $invoice_action['class'] ) ? 'btn-dark' : sanitize_html_class( $invoice_action['class'] );
135
-				$url    = empty( $invoice_action['url'] ) ? '#' : esc_url( $invoice_action['url'] );
136
-				$attrs  = empty( $invoice_action['attrs'] ) ? '' : $invoice_action['attrs'];
137
-				$anchor = esc_html( $invoice_action['name'] );
133
+                $key    = sanitize_html_class( $key );
134
+                $class  = empty( $invoice_action['class'] ) ? 'btn-dark' : sanitize_html_class( $invoice_action['class'] );
135
+                $url    = empty( $invoice_action['url'] ) ? '#' : esc_url( $invoice_action['url'] );
136
+                $attrs  = empty( $invoice_action['attrs'] ) ? '' : $invoice_action['attrs'];
137
+                $anchor = esc_html( $invoice_action['name'] );
138 138
 
139
-				echo wp_kses_post( "<a href='$url' class='btn btn-sm ml-1 $class $key' $attrs>$anchor</a>" );
139
+                echo wp_kses_post( "<a href='$url' class='btn btn-sm ml-1 $class $key' $attrs>$anchor</a>" );
140 140
                 }
141 141
 
142
-			echo '</div>';
142
+            echo '</div>';
143 143
 
144 144
             }
145 145
 
146 146
             if ( ! empty( $alert ) ) {
147
-			echo wp_kses_post( $alert );
147
+            echo wp_kses_post( $alert );
148 148
             }
149 149
 
150 150
         ?>
Please login to merge, or discard this patch.
Spacing   +40 added lines, -40 removed lines patch added patch discarded remove patch
@@ -7,64 +7,64 @@  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( $invoice );
13
+$invoice = new WPInv_Invoice($invoice);
14 14
 
15 15
 // @deprecated
16
-do_action( 'wpinv_success_content_before', $invoice );
17
-do_action( 'wpinv_before_receipt', $invoice );
16
+do_action('wpinv_success_content_before', $invoice);
17
+do_action('wpinv_before_receipt', $invoice);
18 18
 
19 19
 wpinv_print_errors();
20 20
 
21 21
 // Prepare header text.
22
-if ( $invoice->is_paid() ) {
22
+if ($invoice->is_paid()) {
23 23
 
24 24
     $alert = aui()->alert(
25 25
         array(
26 26
             'type'    => 'success',
27
-            'content' => __( 'Thank you for your payment!', 'invoicing' ),
27
+            'content' => __('Thank you for your payment!', 'invoicing'),
28 28
         )
29 29
     );
30 30
 
31
-} elseif ( $invoice->is_refunded() ) {
31
+} elseif ($invoice->is_refunded()) {
32 32
 
33 33
     $alert = aui()->alert(
34 34
         array(
35 35
             'type'    => 'info',
36
-            'content' => __( 'This invoice was refunded.', 'invoicing' ),
36
+            'content' => __('This invoice was refunded.', 'invoicing'),
37 37
         )
38 38
     );
39 39
 
40
-} elseif ( $invoice->is_held() ) {
40
+} elseif ($invoice->is_held()) {
41 41
 
42 42
     $alert = aui()->alert(
43 43
         array(
44 44
             'type'    => 'info',
45
-            'content' => __( 'This invoice will be processed as soon we verify your payment.', 'invoicing' ),
45
+            'content' => __('This invoice will be processed as soon we verify your payment.', 'invoicing'),
46 46
         )
47 47
     );
48 48
 
49
-} elseif ( $invoice->needs_payment() ) {
49
+} elseif ($invoice->needs_payment()) {
50 50
 
51
-    if ( ! empty( $_GET['token'] ) ) {
51
+    if (!empty($_GET['token'])) {
52 52
 
53 53
         $alert = aui()->alert(
54 54
             array(
55 55
                 'type'    => 'info',
56
-                'content' => __( "Sometimes it takes a few minutes for us to verify your payment. We'll notify you as soon as we've verified the payment.", 'invoicing' ),
56
+                'content' => __("Sometimes it takes a few minutes for us to verify your payment. We'll notify you as soon as we've verified the payment.", 'invoicing'),
57 57
             )
58 58
         );
59 59
 
60
-    } elseif ( $invoice->is_due() ) {
60
+    } elseif ($invoice->is_due()) {
61 61
 
62 62
         $alert = aui()->alert(
63 63
             array(
64 64
                 'type'    => 'danger',
65 65
                 'content' => sprintf(
66
-                    __( 'This invoice was due on %.', 'invoicing' ),
67
-                    getpaid_format_date_value( $invoice->get_due_date() )
66
+                    __('This invoice was due on %.', 'invoicing'),
67
+                    getpaid_format_date_value($invoice->get_due_date())
68 68
                 ),
69 69
             )
70 70
         );
@@ -74,7 +74,7 @@  discard block
 block discarded – undo
74 74
         $alert = aui()->alert(
75 75
             array(
76 76
                 'type'    => 'warning',
77
-                'content' => __( 'This invoice needs payment.', 'invoicing' ),
77
+                'content' => __('This invoice needs payment.', 'invoicing'),
78 78
             )
79 79
         );
80 80
 
@@ -88,19 +88,19 @@  discard block
 block discarded – undo
88 88
 
89 89
         'pay'     => array(
90 90
             'url'   => $invoice->get_checkout_payment_url(),
91
-            'name'  => __( 'Pay For Invoice', 'invoicing' ),
91
+            'name'  => __('Pay For Invoice', 'invoicing'),
92 92
             'class' => 'btn-success',
93 93
         ),
94 94
 
95 95
         'view'    => array(
96 96
             'url'   => $invoice->get_view_url(),
97
-            'name'  => __( 'View Invoice', 'invoicing' ),
97
+            'name'  => __('View Invoice', 'invoicing'),
98 98
             'class' => 'btn-primary',
99 99
         ),
100 100
 
101 101
         'history' => array(
102 102
             'url'   => wpinv_get_history_page_uri(),
103
-            'name'  => __( 'Invoice History', 'invoicing' ),
103
+            'name'  => __('Invoice History', 'invoicing'),
104 104
             'class' => 'btn-warning',
105 105
         ),
106 106
 
@@ -108,12 +108,12 @@  discard block
 block discarded – undo
108 108
     $invoice
109 109
 );
110 110
 
111
-if ( ( ! $invoice->needs_payment() || $invoice->is_held() ) && isset( $invoice_actions['pay'] ) ) {
112
-    unset( $invoice_actions['pay'] );
111
+if ((!$invoice->needs_payment() || $invoice->is_held()) && isset($invoice_actions['pay'])) {
112
+    unset($invoice_actions['pay']);
113 113
 }
114 114
 
115
-if ( ! is_user_logged_in() && isset( $invoice_actions['history'] ) ) {
116
-    unset( $invoice_actions['history'] );
115
+if (!is_user_logged_in() && isset($invoice_actions['history'])) {
116
+    unset($invoice_actions['history']);
117 117
 }
118 118
 
119 119
 ?>
@@ -122,29 +122,29 @@  discard block
 block discarded – undo
122 122
 
123 123
         <?php
124 124
 
125
-            do_action( 'wpinv_receipt_start', $invoice );
125
+            do_action('wpinv_receipt_start', $invoice);
126 126
 
127
-            if ( ! empty( $invoice_actions ) ) {
127
+            if (!empty($invoice_actions)) {
128 128
 
129 129
 			echo '<div class="wpinv-receipt-actions text-right mt-1 mb-4">';
130 130
 
131
-			foreach ( $invoice_actions as $key => $invoice_action ) {
131
+			foreach ($invoice_actions as $key => $invoice_action) {
132 132
 
133
-				$key    = sanitize_html_class( $key );
134
-				$class  = empty( $invoice_action['class'] ) ? 'btn-dark' : sanitize_html_class( $invoice_action['class'] );
135
-				$url    = empty( $invoice_action['url'] ) ? '#' : esc_url( $invoice_action['url'] );
136
-				$attrs  = empty( $invoice_action['attrs'] ) ? '' : $invoice_action['attrs'];
137
-				$anchor = esc_html( $invoice_action['name'] );
133
+				$key    = sanitize_html_class($key);
134
+				$class  = empty($invoice_action['class']) ? 'btn-dark' : sanitize_html_class($invoice_action['class']);
135
+				$url    = empty($invoice_action['url']) ? '#' : esc_url($invoice_action['url']);
136
+				$attrs  = empty($invoice_action['attrs']) ? '' : $invoice_action['attrs'];
137
+				$anchor = esc_html($invoice_action['name']);
138 138
 
139
-				echo wp_kses_post( "<a href='$url' class='btn btn-sm ml-1 $class $key' $attrs>$anchor</a>" );
139
+				echo wp_kses_post("<a href='$url' class='btn btn-sm ml-1 $class $key' $attrs>$anchor</a>");
140 140
                 }
141 141
 
142 142
 			echo '</div>';
143 143
 
144 144
             }
145 145
 
146
-            if ( ! empty( $alert ) ) {
147
-			echo wp_kses_post( $alert );
146
+            if (!empty($alert)) {
147
+			echo wp_kses_post($alert);
148 148
             }
149 149
 
150 150
         ?>
@@ -152,19 +152,19 @@  discard block
 block discarded – undo
152 152
         <div class="wpinv-receipt-details">
153 153
 
154 154
             <h4 class="wpinv-details-t mb-3 mt-3">
155
-                <?php echo esc_html( apply_filters( 'wpinv_receipt_details_title', __( 'Invoice Details', 'invoicing' ), $invoice ) ); ?>
155
+                <?php echo esc_html(apply_filters('wpinv_receipt_details_title', __('Invoice Details', 'invoicing'), $invoice)); ?>
156 156
             </h4>
157 157
 
158
-            <?php getpaid_invoice_meta( $invoice ); ?>
158
+            <?php getpaid_invoice_meta($invoice); ?>
159 159
 
160 160
         </div>
161 161
 
162
-        <?php do_action( 'wpinv_receipt_end', $invoice ); ?>
162
+        <?php do_action('wpinv_receipt_end', $invoice); ?>
163 163
 
164 164
     </div>
165 165
 
166 166
 <?php
167 167
 
168 168
 // @deprecated
169
-do_action( 'wpinv_success_content_after', $invoice );
170
-do_action( 'wpinv_after_receipt', $invoice );
169
+do_action('wpinv_success_content_after', $invoice);
170
+do_action('wpinv_after_receipt', $invoice);
Please login to merge, or discard this patch.
includes/admin/class-wpinv-users.php 1 patch
Spacing   +19 added lines, -19 removed lines patch added patch discarded remove patch
@@ -7,7 +7,7 @@  discard block
 block discarded – undo
7 7
  */
8 8
 
9 9
 // MUST have WordPress.
10
-if ( ! defined( 'WPINC' ) ) {
10
+if (!defined('WPINC')) {
11 11
     exit;
12 12
 }
13 13
 
@@ -15,7 +15,7 @@  discard block
 block discarded – undo
15 15
     private static $instance;
16 16
 
17 17
     public static function run() {
18
-        if ( ! isset( self::$instance ) && ! ( self::$instance instanceof WPInv_Admin_Users ) ) {
18
+        if (!isset(self::$instance) && !(self::$instance instanceof WPInv_Admin_Users)) {
19 19
             self::$instance = new WPInv_Admin_Users();
20 20
         }
21 21
 
@@ -23,8 +23,8 @@  discard block
 block discarded – undo
23 23
     }
24 24
 
25 25
     public function __construct() {
26
-        add_filter( 'manage_users_columns', array( $this, 'wpinv_add_user_column' ) );
27
-        add_filter( 'manage_users_custom_column', array( $this, 'wpinv_user_column_content' ), 10, 3 );
26
+        add_filter('manage_users_columns', array($this, 'wpinv_add_user_column'));
27
+        add_filter('manage_users_custom_column', array($this, 'wpinv_user_column_content'), 10, 3);
28 28
     }
29 29
 
30 30
     /**
@@ -34,8 +34,8 @@  discard block
 block discarded – undo
34 34
      *
35 35
      * @return mixed
36 36
      */
37
-    public function wpinv_add_user_column( $column ) {
38
-        $column['wpinvoicing'] = __( 'Invoicing', 'invoicing' );
37
+    public function wpinv_add_user_column($column) {
38
+        $column['wpinvoicing'] = __('Invoicing', 'invoicing');
39 39
         return $column;
40 40
     }
41 41
 
@@ -48,10 +48,10 @@  discard block
 block discarded – undo
48 48
      *
49 49
      * @return string
50 50
      */
51
-    public function wpinv_user_column_content( $val, $column_name, $user_id ) {
52
-        switch ( $column_name ) {
51
+    public function wpinv_user_column_content($val, $column_name, $user_id) {
52
+        switch ($column_name) {
53 53
             case 'wpinvoicing':
54
-                return $this->get_user_invoices( $user_id );
54
+                return $this->get_user_invoices($user_id);
55 55
                 break;
56 56
             default:
57 57
         }
@@ -65,30 +65,30 @@  discard block
 block discarded – undo
65 65
      *
66 66
      * @return string
67 67
      */
68
-    public function get_user_invoices( $user_id ) {
68
+    public function get_user_invoices($user_id) {
69 69
         $output = '';
70 70
         $wp_query_args = array(
71 71
             'post_type'      => 'wpi_invoice',
72
-            'post_status'    => array( 'wpi-pending', 'publish', 'wpi-processing', 'wpi-onhold', 'wpi-refunded', 'wpi-cancelled', 'wpi-failed', 'wpi-renewal' ),
72
+            'post_status'    => array('wpi-pending', 'publish', 'wpi-processing', 'wpi-onhold', 'wpi-refunded', 'wpi-cancelled', 'wpi-failed', 'wpi-renewal'),
73 73
             'posts_per_page' => -1,
74 74
             'fields'         => 'ids',
75 75
             'author'         => $user_id,
76 76
         );
77 77
 
78
-        $wp_query_args = apply_filters( 'wpinv_get_user_invoices_args', $wp_query_args, $user_id );
78
+        $wp_query_args = apply_filters('wpinv_get_user_invoices_args', $wp_query_args, $user_id);
79 79
 
80
-        $invoices = new WP_Query( $wp_query_args );
81
-        $count = absint( $invoices->found_posts );
80
+        $invoices = new WP_Query($wp_query_args);
81
+        $count = absint($invoices->found_posts);
82 82
 
83
-        if ( empty( $count ) ) {
84
-            $output .= __( 'No Invoice(s)', 'invoicing' );
83
+        if (empty($count)) {
84
+            $output .= __('No Invoice(s)', 'invoicing');
85 85
         } else {
86
-            $link_url = admin_url( 'edit.php?post_type=wpi_invoice&author=' . absint( $user_id ) );
87
-            $link_text = sprintf( __( 'Invoices ( %d )', 'invoicing' ), $count );
86
+            $link_url = admin_url('edit.php?post_type=wpi_invoice&author=' . absint($user_id));
87
+            $link_text = sprintf(__('Invoices ( %d )', 'invoicing'), $count);
88 88
             $output .= "<a href='$link_url' >$link_text</a>";
89 89
         }
90 90
 
91
-        return apply_filters( 'wpinv_user_invoice_content', $output, $user_id );
91
+        return apply_filters('wpinv_user_invoice_content', $output, $user_id);
92 92
     }
93 93
 
94 94
 }
Please login to merge, or discard this patch.
includes/admin/meta-boxes/class-getpaid-meta-box-invoice-address.php 2 patches
Indentation   +42 added lines, -42 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.
@@ -225,37 +225,37 @@  discard block
 block discarded – undo
225 225
 
226 226
                                 if ( empty( $states ) ) {
227 227
 
228
-								aui()->input(
229
-								array(
230
-								'type'        => 'text',
231
-								'id'          => 'wpinv_state',
232
-								'name'        => 'wpinv_state',
233
-								'label'       => __( 'State', 'invoicing' ),
234
-								'label_type'  => 'vertical',
235
-								'placeholder' => '',
236
-								'class'       => 'form-control-sm',
237
-								'value'       => $invoice->get_state( 'edit' ),
238
-								),
239
-								true
240
-							);
228
+                                aui()->input(
229
+                                array(
230
+                                'type'        => 'text',
231
+                                'id'          => 'wpinv_state',
232
+                                'name'        => 'wpinv_state',
233
+                                'label'       => __( 'State', 'invoicing' ),
234
+                                'label_type'  => 'vertical',
235
+                                'placeholder' => '',
236
+                                'class'       => 'form-control-sm',
237
+                                'value'       => $invoice->get_state( 'edit' ),
238
+                                ),
239
+                                true
240
+                            );
241 241
 
242 242
                                 } else {
243 243
 
244
-								aui()->select(
245
-								array(
246
-								'id'               => 'wpinv_state',
247
-								'name'             => 'wpinv_state',
248
-								'label'            => __( 'State', 'invoicing' ),
249
-								'label_type'       => 'vertical',
250
-								'placeholder'      => __( 'Select a state', 'invoicing' ),
251
-								'class'            => 'form-control-sm',
252
-								'value'            => $invoice->get_state( 'edit' ),
253
-								'options'          => $states,
254
-								'data-allow-clear' => 'false',
255
-								'select2'          => true,
256
-								),
257
-								true
258
-								);
244
+                                aui()->select(
245
+                                array(
246
+                                'id'               => 'wpinv_state',
247
+                                'name'             => 'wpinv_state',
248
+                                'label'            => __( 'State', 'invoicing' ),
249
+                                'label_type'       => 'vertical',
250
+                                'placeholder'      => __( 'Select a state', 'invoicing' ),
251
+                                'class'            => 'form-control-sm',
252
+                                'value'            => $invoice->get_state( 'edit' ),
253
+                                'options'          => $states,
254
+                                'data-allow-clear' => 'false',
255
+                                'select2'          => true,
256
+                                ),
257
+                                true
258
+                                );
259 259
 
260 260
                                 }
261 261
 
@@ -381,18 +381,18 @@  discard block
 block discarded – undo
381 381
     }
382 382
 
383 383
     /**
384
-	 * Save meta box data.
385
-	 *
386
-	 * @param int $post_id
387
-	 */
388
-	public static function save( $post_id ) {
384
+     * Save meta box data.
385
+     *
386
+     * @param int $post_id
387
+     */
388
+    public static function save( $post_id ) {
389 389
 
390 390
         // Prepare the invoice.
391 391
         $invoice = new WPInv_Invoice( $post_id );
392 392
 
393 393
         // Load new data.
394 394
         $invoice->set_props(
395
-			array(
395
+            array(
396 396
                 'template'       => isset( $_POST['wpinv_template'] ) ? wpinv_clean( $_POST['wpinv_template'] ) : null,
397 397
                 'email_cc'       => isset( $_POST['wpinv_cc'] ) ? wpinv_clean( $_POST['wpinv_cc'] ) : null,
398 398
                 'disable_taxes'  => ! empty( $_POST['disable_taxes'] ),
@@ -415,7 +415,7 @@  discard block
 block discarded – undo
415 415
                 'due_date'       => isset( $_POST['wpinv_due_date'] ) ? wpinv_clean( $_POST['wpinv_due_date'] ) : null,
416 416
                 'number'         => isset( $_POST['wpinv_number'] ) ? wpinv_clean( $_POST['wpinv_number'] ) : null,
417 417
                 'status'         => isset( $_POST['wpinv_status'] ) ? wpinv_clean( $_POST['wpinv_status'] ) : null,
418
-			)
418
+            )
419 419
         );
420 420
 
421 421
         // Discount code.
@@ -471,6 +471,6 @@  discard block
 block discarded – undo
471 471
         }
472 472
 
473 473
         // Fires after an invoice is saved.
474
-		do_action( 'wpinv_invoice_metabox_saved', $invoice );
475
-	}
474
+        do_action( 'wpinv_invoice_metabox_saved', $invoice );
475
+    }
476 476
 }
Please login to merge, or discard this patch.
Spacing   +97 added lines, -97 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,14 +21,14 @@  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 );
28
-        $customer = $invoice->exists() ? $invoice->get_user_id( 'edit' ) : get_current_user_id();
29
-        $customer = new WP_User( $customer );
30
-        $display  = sprintf( _x( '%1$s (%2$s)', 'user dropdown', 'invoicing' ), $customer->display_name, $customer->user_email );
31
-        wp_nonce_field( 'getpaid_meta_nonce', 'getpaid_meta_nonce' );
27
+        $invoice  = new WPInv_Invoice($post);
28
+        $customer = $invoice->exists() ? $invoice->get_user_id('edit') : get_current_user_id();
29
+        $customer = new WP_User($customer);
30
+        $display  = sprintf(_x('%1$s (%2$s)', 'user dropdown', 'invoicing'), $customer->display_name, $customer->user_email);
31
+        wp_nonce_field('getpaid_meta_nonce', 'getpaid_meta_nonce');
32 32
 
33 33
         ?>
34 34
 
@@ -43,11 +43,11 @@  discard block
 block discarded – undo
43 43
                         <div class="col-12 col-sm-6">
44 44
                             <div id="getpaid-invoice-user-id-wrapper" class="form-group">
45 45
                                 <div>
46
-                                    <label for="post_author_override"><?php esc_html_e( 'Customer', 'invoicing' ); ?></label>
46
+                                    <label for="post_author_override"><?php esc_html_e('Customer', 'invoicing'); ?></label>
47 47
                                 </div>
48 48
                                 <div>
49
-                                    <select name="post_author_override" id="wpinv_post_author_override" class="getpaid-customer-search form-control regular-text" data-placeholder="<?php esc_attr_e( 'Search for a customer by email or name', 'invoicing' ); ?>">
50
-                                        <option selected="selected" value="<?php echo (int) $customer->ID; ?>"><?php echo esc_html( $display ); ?> </option>)
49
+                                    <select name="post_author_override" id="wpinv_post_author_override" class="getpaid-customer-search form-control regular-text" data-placeholder="<?php esc_attr_e('Search for a customer by email or name', 'invoicing'); ?>">
50
+                                        <option selected="selected" value="<?php echo (int) $customer->ID; ?>"><?php echo esc_html($display); ?> </option>)
51 51
                                     </select>
52 52
                                 </div>
53 53
                             </div>
@@ -60,7 +60,7 @@  discard block
 block discarded – undo
60 60
                                             'type'        => 'text',
61 61
                                             'id'          => 'getpaid-invoice-new-user-email',
62 62
                                             'name'        => 'wpinv_email',
63
-                                            'label'       => __( 'Email', 'invoicing' ) . '<span class="required">*</span>',
63
+                                            'label'       => __('Email', 'invoicing') . '<span class="required">*</span>',
64 64
                                             'label_type'  => 'vertical',
65 65
                                             'placeholder' => '[email protected]',
66 66
                                             'class'       => 'form-control-sm',
@@ -71,18 +71,18 @@  discard block
 block discarded – undo
71 71
                             </div>
72 72
                         </div>
73 73
                         <div class="col-12 col-sm-6 form-group mt-sm-4">
74
-                            <?php if ( ! $invoice->is_paid() && ! $invoice->is_refunded() ) : ?>
74
+                            <?php if (!$invoice->is_paid() && !$invoice->is_refunded()) : ?>
75 75
                                 <a id="getpaid-invoice-fill-user-details" class="button button-small button-secondary" href="javascript:void(0)">
76 76
                                     <i aria-hidden="true" class="fa fa-refresh"></i>
77
-                                    <?php esc_html_e( 'Fill User Details', 'invoicing' ); ?>
77
+                                    <?php esc_html_e('Fill User Details', 'invoicing'); ?>
78 78
                                 </a>
79 79
                                 <a id="getpaid-invoice-create-new-user-button" class="button button-small button-secondary" href="javascript:void(0)">
80 80
                                     <i aria-hidden="true" class="fa fa-plus"></i>
81
-                                    <?php esc_html_e( 'Add New User', 'invoicing' ); ?>
81
+                                    <?php esc_html_e('Add New User', 'invoicing'); ?>
82 82
                                 </a>
83 83
                                 <a id="getpaid-invoice-cancel-create-new-user" class="button button-small button-secondary d-none" href="javascript:void(0)">
84 84
                                     <i aria-hidden="true" class="fa fa-close"></i>
85
-                                    <?php esc_html_e( 'Cancel', 'invoicing' ); ?>
85
+                                    <?php esc_html_e('Cancel', 'invoicing'); ?>
86 86
                                 </a>
87 87
                             <?php endif; ?>
88 88
                         </div>
@@ -95,11 +95,11 @@  discard block
 block discarded – undo
95 95
                                         'type'        => 'text',
96 96
                                         'id'          => 'wpinv_first_name',
97 97
                                         'name'        => 'wpinv_first_name',
98
-                                        'label'       => __( 'First Name', 'invoicing' ),
98
+                                        'label'       => __('First Name', 'invoicing'),
99 99
                                         'label_type'  => 'vertical',
100 100
                                         'placeholder' => '',
101 101
                                         'class'       => 'form-control-sm',
102
-                                        'value'       => $invoice->get_first_name( 'edit' ),
102
+                                        'value'       => $invoice->get_first_name('edit'),
103 103
                                     ),
104 104
                                     true
105 105
                                 );
@@ -112,11 +112,11 @@  discard block
 block discarded – undo
112 112
                                         'type'        => 'text',
113 113
                                         'id'          => 'wpinv_last_name',
114 114
                                         'name'        => 'wpinv_last_name',
115
-                                        'label'       => __( 'Last Name', 'invoicing' ),
115
+                                        'label'       => __('Last Name', 'invoicing'),
116 116
                                         'label_type'  => 'vertical',
117 117
                                         'placeholder' => '',
118 118
                                         'class'       => 'form-control-sm',
119
-                                        'value'       => $invoice->get_last_name( 'edit' ),
119
+                                        'value'       => $invoice->get_last_name('edit'),
120 120
                                     ),
121 121
                                     true
122 122
                                 );
@@ -132,11 +132,11 @@  discard block
 block discarded – undo
132 132
                                         'type'        => 'text',
133 133
                                         'id'          => 'wpinv_company',
134 134
                                         'name'        => 'wpinv_company',
135
-                                        'label'       => __( 'Company', 'invoicing' ),
135
+                                        'label'       => __('Company', 'invoicing'),
136 136
                                         'label_type'  => 'vertical',
137 137
                                         'placeholder' => '',
138 138
                                         'class'       => 'form-control-sm',
139
-                                        'value'       => $invoice->get_company( 'edit' ),
139
+                                        'value'       => $invoice->get_company('edit'),
140 140
                                     ),
141 141
                                     true
142 142
                                 );
@@ -149,11 +149,11 @@  discard block
 block discarded – undo
149 149
                                         'type'        => 'text',
150 150
                                         'id'          => 'wpinv_vat_number',
151 151
                                         'name'        => 'wpinv_vat_number',
152
-                                        'label'       => __( 'Vat Number', 'invoicing' ),
152
+                                        'label'       => __('Vat Number', 'invoicing'),
153 153
                                         'label_type'  => 'vertical',
154 154
                                         'placeholder' => '',
155 155
                                         'class'       => 'form-control-sm getpaid-recalculate-prices-on-change',
156
-                                        'value'       => $invoice->get_vat_number( 'edit' ),
156
+                                        'value'       => $invoice->get_vat_number('edit'),
157 157
                                     ),
158 158
                                     true
159 159
                                 );
@@ -169,11 +169,11 @@  discard block
 block discarded – undo
169 169
                                         'type'        => 'text',
170 170
                                         'id'          => 'wpinv_address',
171 171
                                         'name'        => 'wpinv_address',
172
-                                        'label'       => __( 'Address', 'invoicing' ),
172
+                                        'label'       => __('Address', 'invoicing'),
173 173
                                         'label_type'  => 'vertical',
174 174
                                         'placeholder' => '',
175 175
                                         'class'       => 'form-control-sm',
176
-                                        'value'       => $invoice->get_address( 'edit' ),
176
+                                        'value'       => $invoice->get_address('edit'),
177 177
                                     ),
178 178
                                     true
179 179
                                 );
@@ -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' => '',
192 192
                                         'class'       => 'form-control-sm',
193
-                                        'value'       => $invoice->get_city( 'edit' ),
193
+                                        'value'       => $invoice->get_city('edit'),
194 194
                                     ),
195 195
                                     true
196 196
                                 );
@@ -205,11 +205,11 @@  discard block
 block discarded – undo
205 205
                                     array(
206 206
                                         'id'               => 'wpinv_country',
207 207
                                         'name'             => 'wpinv_country',
208
-                                        'label'            => __( 'Country', 'invoicing' ),
208
+                                        'label'            => __('Country', 'invoicing'),
209 209
                                         'label_type'       => 'vertical',
210
-                                        'placeholder'      => __( 'Choose a country', 'invoicing' ),
210
+                                        'placeholder'      => __('Choose a country', 'invoicing'),
211 211
                                         'class'            => 'form-control-sm getpaid-recalculate-prices-on-change',
212
-                                        'value'            => $invoice->get_country( 'edit' ),
212
+                                        'value'            => $invoice->get_country('edit'),
213 213
                                         'options'          => wpinv_get_country_list(),
214 214
                                         'data-allow-clear' => 'false',
215 215
                                         'select2'          => true,
@@ -221,20 +221,20 @@  discard block
 block discarded – undo
221 221
                         <div class="col-12 col-sm-6">
222 222
                             <?php
223 223
 
224
-                                $states = wpinv_get_country_states( $invoice->get_country( 'edit' ) );
224
+                                $states = wpinv_get_country_states($invoice->get_country('edit'));
225 225
 
226
-                                if ( empty( $states ) ) {
226
+                                if (empty($states)) {
227 227
 
228 228
 								aui()->input(
229 229
 								array(
230 230
 								'type'        => 'text',
231 231
 								'id'          => 'wpinv_state',
232 232
 								'name'        => 'wpinv_state',
233
-								'label'       => __( 'State', 'invoicing' ),
233
+								'label'       => __('State', 'invoicing'),
234 234
 								'label_type'  => 'vertical',
235 235
 								'placeholder' => '',
236 236
 								'class'       => 'form-control-sm',
237
-								'value'       => $invoice->get_state( 'edit' ),
237
+								'value'       => $invoice->get_state('edit'),
238 238
 								),
239 239
 								true
240 240
 							);
@@ -245,11 +245,11 @@  discard block
 block discarded – undo
245 245
 								array(
246 246
 								'id'               => 'wpinv_state',
247 247
 								'name'             => 'wpinv_state',
248
-								'label'            => __( 'State', 'invoicing' ),
248
+								'label'            => __('State', 'invoicing'),
249 249
 								'label_type'       => 'vertical',
250
-								'placeholder'      => __( 'Select a state', 'invoicing' ),
250
+								'placeholder'      => __('Select a state', 'invoicing'),
251 251
 								'class'            => 'form-control-sm',
252
-								'value'            => $invoice->get_state( 'edit' ),
252
+								'value'            => $invoice->get_state('edit'),
253 253
 								'options'          => $states,
254 254
 								'data-allow-clear' => 'false',
255 255
 								'select2'          => true,
@@ -271,11 +271,11 @@  discard block
 block discarded – undo
271 271
                                         'type'        => 'text',
272 272
                                         'id'          => 'wpinv_zip',
273 273
                                         'name'        => 'wpinv_zip',
274
-                                        'label'       => __( 'Zip / Postal Code', 'invoicing' ),
274
+                                        'label'       => __('Zip / Postal Code', 'invoicing'),
275 275
                                         'label_type'  => 'vertical',
276 276
                                         'placeholder' => '',
277 277
                                         'class'       => 'form-control-sm',
278
-                                        'value'       => $invoice->get_zip( 'edit' ),
278
+                                        'value'       => $invoice->get_zip('edit'),
279 279
                                     ),
280 280
                                     true
281 281
                                 );
@@ -288,11 +288,11 @@  discard block
 block discarded – undo
288 288
                                         'type'        => 'text',
289 289
                                         'id'          => 'wpinv_phone',
290 290
                                         'name'        => 'wpinv_phone',
291
-                                        'label'       => __( 'Phone', 'invoicing' ),
291
+                                        'label'       => __('Phone', 'invoicing'),
292 292
                                         'label_type'  => 'vertical',
293 293
                                         'placeholder' => '',
294 294
                                         'class'       => 'form-control-sm',
295
-                                        'value'       => $invoice->get_phone( 'edit' ),
295
+                                        'value'       => $invoice->get_phone('edit'),
296 296
                                     ),
297 297
                                     true
298 298
                                 );
@@ -300,8 +300,8 @@  discard block
 block discarded – undo
300 300
                         </div>
301 301
                     </div>
302 302
 
303
-                    <?php if ( ! apply_filters( 'getpaid_use_new_invoice_items_metabox', false ) ) : ?>
304
-                        <?php do_action( 'wpinv_meta_box_before_invoice_template_row', $invoice->get_id() ); ?>
303
+                    <?php if (!apply_filters('getpaid_use_new_invoice_items_metabox', false)) : ?>
304
+                        <?php do_action('wpinv_meta_box_before_invoice_template_row', $invoice->get_id()); ?>
305 305
 
306 306
                         <div class="row">
307 307
                             <div class="col-12 col-sm-6">
@@ -310,14 +310,14 @@  discard block
 block discarded – undo
310 310
                                         array(
311 311
                                             'id'          => 'wpinv_template',
312 312
                                             'name'        => 'wpinv_template',
313
-                                            'label'       => __( 'Template', 'invoicing' ),
313
+                                            'label'       => __('Template', 'invoicing'),
314 314
                                             'label_type'  => 'vertical',
315
-                                            'placeholder' => __( 'Choose a template', 'invoicing' ),
315
+                                            'placeholder' => __('Choose a template', 'invoicing'),
316 316
                                             'class'       => 'form-control-sm',
317
-                                            'value'       => $invoice->get_template( 'edit' ),
317
+                                            'value'       => $invoice->get_template('edit'),
318 318
                                             'options'     => array(
319
-                                                'quantity' => __( 'Quantity', 'invoicing' ),
320
-                                                'hours'    => __( 'Hours', 'invoicing' ),
319
+                                                'quantity' => __('Quantity', 'invoicing'),
320
+                                                'hours'    => __('Hours', 'invoicing'),
321 321
                                                 //'amount'   => __( 'Amount Only', 'invoicing' ),
322 322
                                             ),
323 323
                                             'data-allow-clear' => 'false',
@@ -335,11 +335,11 @@  discard block
 block discarded – undo
335 335
                                         array(
336 336
                                             'id'          => 'wpinv_currency',
337 337
                                             'name'        => 'wpinv_currency',
338
-                                            'label'       => __( 'Currency', 'invoicing' ),
338
+                                            'label'       => __('Currency', 'invoicing'),
339 339
                                             'label_type'  => 'vertical',
340
-                                            'placeholder' => __( 'Select Invoice Currency', 'invoicing' ),
340
+                                            'placeholder' => __('Select Invoice Currency', 'invoicing'),
341 341
                                             'class'       => 'form-control-sm getpaid-recalculate-prices-on-change',
342
-                                            'value'       => $invoice->get_currency( 'edit' ),
342
+                                            'value'       => $invoice->get_currency('edit'),
343 343
                                             'required'    => false,
344 344
                                             'data-allow-clear' => 'false',
345 345
                                             'select2'     => true,
@@ -352,7 +352,7 @@  discard block
 block discarded – undo
352 352
                             </div>
353 353
                         </div>
354 354
 
355
-                        <?php do_action( 'wpinv_meta_box_invoice_template_row', $invoice->get_id() ); ?>
355
+                        <?php do_action('wpinv_meta_box_invoice_template_row', $invoice->get_id()); ?>
356 356
                     <?php endif; ?>
357 357
 
358 358
                     <div class="row">
@@ -363,11 +363,11 @@  discard block
 block discarded – undo
363 363
                                         'type'        => 'text',
364 364
                                         'id'          => 'wpinv_company_id',
365 365
                                         'name'        => 'wpinv_company_id',
366
-                                        'label'       => __( 'Company ID', 'invoicing' ),
366
+                                        'label'       => __('Company ID', 'invoicing'),
367 367
                                         'label_type'  => 'vertical',
368 368
                                         'placeholder' => '',
369 369
                                         'class'       => 'form-control-sm',
370
-                                        'value'       => $invoice->get_company_id( 'edit' ),
370
+                                        'value'       => $invoice->get_company_id('edit'),
371 371
                                     ),
372 372
                                     true
373 373
                                 );
@@ -375,7 +375,7 @@  discard block
 block discarded – undo
375 375
                         </div>
376 376
                     </div>
377 377
 
378
-                    <?php do_action( 'getpaid_after_metabox_invoice_address', $invoice ); ?>
378
+                    <?php do_action('getpaid_after_metabox_invoice_address', $invoice); ?>
379 379
             </div>
380 380
         <?php
381 381
     }
@@ -385,51 +385,51 @@  discard block
 block discarded – undo
385 385
 	 *
386 386
 	 * @param int $post_id
387 387
 	 */
388
-	public static function save( $post_id ) {
388
+	public static function save($post_id) {
389 389
 
390 390
         // Prepare the invoice.
391
-        $invoice = new WPInv_Invoice( $post_id );
391
+        $invoice = new WPInv_Invoice($post_id);
392 392
 
393 393
         // Load new data.
394 394
         $invoice->set_props(
395 395
 			array(
396
-                'template'       => isset( $_POST['wpinv_template'] ) ? wpinv_clean( $_POST['wpinv_template'] ) : null,
397
-                'email_cc'       => isset( $_POST['wpinv_cc'] ) ? wpinv_clean( $_POST['wpinv_cc'] ) : null,
398
-                'disable_taxes'  => ! empty( $_POST['disable_taxes'] ),
399
-                'currency'       => isset( $_POST['wpinv_currency'] ) ? wpinv_clean( $_POST['wpinv_currency'] ) : null,
400
-                'gateway'        => ( $invoice->needs_payment() && isset( $_POST['wpinv_gateway'] ) ) ? wpinv_clean( $_POST['wpinv_gateway'] ) : null,
401
-                'address'        => isset( $_POST['wpinv_address'] ) ? wpinv_clean( $_POST['wpinv_address'] ) : null,
402
-                'vat_number'     => isset( $_POST['wpinv_vat_number'] ) ? wpinv_clean( $_POST['wpinv_vat_number'] ) : null,
403
-                'company'        => isset( $_POST['wpinv_company'] ) ? wpinv_clean( $_POST['wpinv_company'] ) : null,
404
-                'company_id'     => isset( $_POST['wpinv_company_id'] ) ? wpinv_clean( $_POST['wpinv_company_id'] ) : null,
405
-                'zip'            => isset( $_POST['wpinv_zip'] ) ? wpinv_clean( $_POST['wpinv_zip'] ) : null,
406
-                'state'          => isset( $_POST['wpinv_state'] ) ? wpinv_clean( $_POST['wpinv_state'] ) : null,
407
-                'city'           => isset( $_POST['wpinv_city'] ) ? wpinv_clean( $_POST['wpinv_city'] ) : null,
408
-                'country'        => isset( $_POST['wpinv_country'] ) ? wpinv_clean( $_POST['wpinv_country'] ) : null,
409
-                'phone'          => isset( $_POST['wpinv_phone'] ) ? wpinv_clean( $_POST['wpinv_phone'] ) : null,
410
-                'first_name'     => isset( $_POST['wpinv_first_name'] ) ? wpinv_clean( $_POST['wpinv_first_name'] ) : null,
411
-                'last_name'      => isset( $_POST['wpinv_last_name'] ) ? wpinv_clean( $_POST['wpinv_last_name'] ) : null,
412
-                'author'         => isset( $_POST['post_author_override'] ) ? wpinv_clean( $_POST['post_author_override'] ) : null,
413
-                'date_created'   => isset( $_POST['date_created'] ) ? wpinv_clean( $_POST['date_created'] ) : null,
414
-                'date_completed' => isset( $_POST['wpinv_date_completed'] ) ? wpinv_clean( $_POST['wpinv_date_completed'] ) : null,
415
-                'due_date'       => isset( $_POST['wpinv_due_date'] ) ? wpinv_clean( $_POST['wpinv_due_date'] ) : null,
416
-                'number'         => isset( $_POST['wpinv_number'] ) ? wpinv_clean( $_POST['wpinv_number'] ) : null,
417
-                'status'         => isset( $_POST['wpinv_status'] ) ? wpinv_clean( $_POST['wpinv_status'] ) : null,
396
+                'template'       => isset($_POST['wpinv_template']) ? wpinv_clean($_POST['wpinv_template']) : null,
397
+                'email_cc'       => isset($_POST['wpinv_cc']) ? wpinv_clean($_POST['wpinv_cc']) : null,
398
+                'disable_taxes'  => !empty($_POST['disable_taxes']),
399
+                'currency'       => isset($_POST['wpinv_currency']) ? wpinv_clean($_POST['wpinv_currency']) : null,
400
+                'gateway'        => ($invoice->needs_payment() && isset($_POST['wpinv_gateway'])) ? wpinv_clean($_POST['wpinv_gateway']) : null,
401
+                'address'        => isset($_POST['wpinv_address']) ? wpinv_clean($_POST['wpinv_address']) : null,
402
+                'vat_number'     => isset($_POST['wpinv_vat_number']) ? wpinv_clean($_POST['wpinv_vat_number']) : null,
403
+                'company'        => isset($_POST['wpinv_company']) ? wpinv_clean($_POST['wpinv_company']) : null,
404
+                'company_id'     => isset($_POST['wpinv_company_id']) ? wpinv_clean($_POST['wpinv_company_id']) : null,
405
+                'zip'            => isset($_POST['wpinv_zip']) ? wpinv_clean($_POST['wpinv_zip']) : null,
406
+                'state'          => isset($_POST['wpinv_state']) ? wpinv_clean($_POST['wpinv_state']) : null,
407
+                'city'           => isset($_POST['wpinv_city']) ? wpinv_clean($_POST['wpinv_city']) : null,
408
+                'country'        => isset($_POST['wpinv_country']) ? wpinv_clean($_POST['wpinv_country']) : null,
409
+                'phone'          => isset($_POST['wpinv_phone']) ? wpinv_clean($_POST['wpinv_phone']) : null,
410
+                'first_name'     => isset($_POST['wpinv_first_name']) ? wpinv_clean($_POST['wpinv_first_name']) : null,
411
+                'last_name'      => isset($_POST['wpinv_last_name']) ? wpinv_clean($_POST['wpinv_last_name']) : null,
412
+                'author'         => isset($_POST['post_author_override']) ? wpinv_clean($_POST['post_author_override']) : null,
413
+                'date_created'   => isset($_POST['date_created']) ? wpinv_clean($_POST['date_created']) : null,
414
+                'date_completed' => isset($_POST['wpinv_date_completed']) ? wpinv_clean($_POST['wpinv_date_completed']) : null,
415
+                'due_date'       => isset($_POST['wpinv_due_date']) ? wpinv_clean($_POST['wpinv_due_date']) : null,
416
+                'number'         => isset($_POST['wpinv_number']) ? wpinv_clean($_POST['wpinv_number']) : null,
417
+                'status'         => isset($_POST['wpinv_status']) ? wpinv_clean($_POST['wpinv_status']) : null,
418 418
 			)
419 419
         );
420 420
 
421 421
         // Discount code.
422
-        if ( ! $invoice->is_paid() && ! $invoice->is_refunded() ) {
422
+        if (!$invoice->is_paid() && !$invoice->is_refunded()) {
423 423
 
424
-            if ( isset( $_POST['wpinv_discount_code'] ) ) {
425
-                $invoice->set_discount_code( wpinv_clean( $_POST['wpinv_discount_code'] ) );
424
+            if (isset($_POST['wpinv_discount_code'])) {
425
+                $invoice->set_discount_code(wpinv_clean($_POST['wpinv_discount_code']));
426 426
             }
427 427
 
428
-            $discount = new WPInv_Discount( $invoice->get_discount_code() );
429
-            if ( $discount->exists() ) {
430
-                $invoice->add_discount( getpaid_calculate_invoice_discount( $invoice, $discount ) );
428
+            $discount = new WPInv_Discount($invoice->get_discount_code());
429
+            if ($discount->exists()) {
430
+                $invoice->add_discount(getpaid_calculate_invoice_discount($invoice, $discount));
431 431
             } else {
432
-                $invoice->remove_discount( 'discount_code' );
432
+                $invoice->remove_discount('discount_code');
433 433
             }
434 434
 
435 435
             // Recalculate totals.
@@ -438,16 +438,16 @@  discard block
 block discarded – undo
438 438
         }
439 439
 
440 440
         // If we're creating a new user...
441
-        if ( ! empty( $_POST['wpinv_new_user'] ) && is_email( stripslashes( $_POST['wpinv_email'] ) ) ) {
441
+        if (!empty($_POST['wpinv_new_user']) && is_email(stripslashes($_POST['wpinv_email']))) {
442 442
 
443 443
             // Attempt to create the user.
444
-            $user = wpinv_create_user( sanitize_email( stripslashes( $_POST['wpinv_email'] ) ), $invoice->get_first_name() . $invoice->get_last_name() );
444
+            $user = wpinv_create_user(sanitize_email(stripslashes($_POST['wpinv_email'])), $invoice->get_first_name() . $invoice->get_last_name());
445 445
 
446 446
             // If successful, update the invoice author.
447
-            if ( is_numeric( $user ) ) {
448
-                $invoice->set_author( $user );
447
+            if (is_numeric($user)) {
448
+                $invoice->set_author($user);
449 449
             } else {
450
-                wpinv_error_log( $user->get_error_message(), __( 'Invoice add new user', 'invoicing' ), __FILE__, __LINE__ );
450
+                wpinv_error_log($user->get_error_message(), __('Invoice add new user', 'invoicing'), __FILE__, __LINE__);
451 451
             }
452 452
         }
453 453
 
@@ -461,16 +461,16 @@  discard block
 block discarded – undo
461 461
         $GLOBALS['wpinv_skip_invoice_notification'] = false;
462 462
 
463 463
         // (Maybe) send new user notification.
464
-        $should_send_notification = wpinv_get_option( 'disable_new_user_emails' );
465
-        if ( ! empty( $user ) && is_numeric( $user ) && apply_filters( 'getpaid_send_new_user_notification', empty( $should_send_notification ) ) ) {
466
-            wp_send_new_user_notifications( $user, 'user' );
464
+        $should_send_notification = wpinv_get_option('disable_new_user_emails');
465
+        if (!empty($user) && is_numeric($user) && apply_filters('getpaid_send_new_user_notification', empty($should_send_notification))) {
466
+            wp_send_new_user_notifications($user, 'user');
467 467
         }
468 468
 
469
-        if ( ! empty( $_POST['send_to_customer'] ) && ! $invoice->is_draft() ) {
470
-            getpaid()->get( 'invoice_emails' )->user_invoice( $invoice, true );
469
+        if (!empty($_POST['send_to_customer']) && !$invoice->is_draft()) {
470
+            getpaid()->get('invoice_emails')->user_invoice($invoice, true);
471 471
         }
472 472
 
473 473
         // Fires after an invoice is saved.
474
-		do_action( 'wpinv_invoice_metabox_saved', $invoice );
474
+		do_action('wpinv_invoice_metabox_saved', $invoice);
475 475
 	}
476 476
 }
Please login to merge, or discard this patch.