Passed
Push — master ( 0a2cdb...97ebee )
by Brian
04:41
created
templates/invoice/invoice-meta.php 1 patch
Spacing   +17 added lines, -17 removed lines patch added patch discarded remove patch
@@ -7,50 +7,50 @@
 block discarded – undo
7 7
  * @version 1.0.19
8 8
  */
9 9
 
10
-defined( 'ABSPATH' ) || exit;
10
+defined('ABSPATH') || exit;
11 11
 
12
-$class = ! is_singular( 'page' ) ? 'px-1' : '';
12
+$class = !is_singular('page') ? 'px-1' : '';
13 13
 ?>
14 14
 
15
-        <?php do_action( 'getpaid_before_invoice_meta', $invoice ); ?>
15
+        <?php do_action('getpaid_before_invoice_meta', $invoice); ?>
16 16
         <div class="getpaid-invoice-meta-data">
17 17
 
18
-            <?php do_action( 'getpaid_before_invoice_meta_table', $invoice ); ?>
18
+            <?php do_action('getpaid_before_invoice_meta_table', $invoice); ?>
19 19
             <table class="table table-bordered">
20 20
                 <tbody>
21 21
 
22
-                    <?php do_action( 'getpaid_before_invoice_meta_rows', $invoice ); ?>
23
-                    <?php foreach ( $meta as $key => $data ) : ?>
22
+                    <?php do_action('getpaid_before_invoice_meta_rows', $invoice); ?>
23
+                    <?php foreach ($meta as $key => $data) : ?>
24 24
 
25
-                        <?php if ( ! empty( $data['value'] ) ) : ?>
25
+                        <?php if (!empty($data['value'])) : ?>
26 26
 
27
-                            <?php do_action( "getpaid_before_invoice_meta_$key", $invoice, $data ); ?>
27
+                            <?php do_action("getpaid_before_invoice_meta_$key", $invoice, $data); ?>
28 28
 
29
-                            <tr class="getpaid-invoice-meta-<?php echo sanitize_html_class( $key ); ?>">
29
+                            <tr class="getpaid-invoice-meta-<?php echo sanitize_html_class($key); ?>">
30 30
 
31
-                                <th class="<?php echo esc_attr( $class ); ?> font-weight-bold" style="width: 40%">
32
-                                    <?php echo esc_html( $data['label'] ); ?>
31
+                                <th class="<?php echo esc_attr($class); ?> font-weight-bold" style="width: 40%">
32
+                                    <?php echo esc_html($data['label']); ?>
33 33
                                 </th>
34 34
 
35
-                                <td class="<?php echo esc_attr( $class ); ?> <?php echo $key == 'invoice_total' ? 'font-weight-bold' : 'font-weight-normal'; ?> text-break" style="width: 60%">
36
-                                    <span class="getpaid-invoice-meta-<?php echo sanitize_html_class( $key ); ?>-value"><?php echo wp_kses_post( $data['value'] ); ?></span>
35
+                                <td class="<?php echo esc_attr($class); ?> <?php echo $key == 'invoice_total' ? 'font-weight-bold' : 'font-weight-normal'; ?> text-break" style="width: 60%">
36
+                                    <span class="getpaid-invoice-meta-<?php echo sanitize_html_class($key); ?>-value"><?php echo wp_kses_post($data['value']); ?></span>
37 37
                                 </td>
38 38
 
39 39
                             </tr>
40 40
 
41
-                            <?php do_action( "getpaid_after_invoice_meta_$key", $invoice, $data ); ?>
41
+                            <?php do_action("getpaid_after_invoice_meta_$key", $invoice, $data); ?>
42 42
 
43 43
                         <?php endif; ?>
44 44
                     
45 45
                     <?php endforeach; ?>
46
-                    <?php do_action( 'getpaid_after_invoice_meta_rows', $invoice ); ?>
46
+                    <?php do_action('getpaid_after_invoice_meta_rows', $invoice); ?>
47 47
 
48 48
                 </tbody>
49 49
             </table>
50
-            <?php do_action( 'getpaid_after_invoice_meta_table', $invoice ); ?>
50
+            <?php do_action('getpaid_after_invoice_meta_table', $invoice); ?>
51 51
 
52 52
 
53 53
         </div>
54
-        <?php do_action( 'getpaid_after_invoice_meta', $invoice ); ?>
54
+        <?php do_action('getpaid_after_invoice_meta', $invoice); ?>
55 55
 
56 56
 <?php
Please login to merge, or discard this patch.
templates/invoice/line-item.php 2 patches
Indentation   +26 added lines, -26 removed lines patch added patch discarded remove patch
@@ -32,34 +32,34 @@  discard block
 block discarded – undo
32 32
                     // Item name.
33 33
                     if ( 'name' == $column ) {
34 34
 
35
-					// Display the name.
36
-					echo '<div class="mb-1">' . esc_html( $item->get_name() ) . '</div>';
35
+                    // Display the name.
36
+                    echo '<div class="mb-1">' . esc_html( $item->get_name() ) . '</div>';
37 37
 
38
-					// And an optional description.
39
-					$description = $item->get_description();
38
+                    // And an optional description.
39
+                    $description = $item->get_description();
40 40
 
41
-					if ( ! empty( $description ) ) {
42
-						$description = wp_kses_post( $description );
43
-						echo "<small class='form-text text-muted pr-2 m-0'>$description</small>";
41
+                    if ( ! empty( $description ) ) {
42
+                        $description = wp_kses_post( $description );
43
+                        echo "<small class='form-text text-muted pr-2 m-0'>$description</small>";
44 44
                         }
45 45
 
46
-					// Fires before printing the line item actions.
47
-					do_action( 'getpaid_before_invoice_line_item_actions', $item, $invoice );
46
+                    // Fires before printing the line item actions.
47
+                    do_action( 'getpaid_before_invoice_line_item_actions', $item, $invoice );
48 48
 
49
-					$actions = apply_filters( 'getpaid-invoice-page-line-item-actions', array(), $item, $invoice );
49
+                    $actions = apply_filters( 'getpaid-invoice-page-line-item-actions', array(), $item, $invoice );
50 50
 
51
-					if ( ! empty( $actions ) ) {
51
+                    if ( ! empty( $actions ) ) {
52 52
 
53
-						$sanitized  = array();
54
-						foreach ( $actions as $key => $action ) {
55
-							$key         = sanitize_html_class( $key );
56
-							$action      = wp_kses_post( $action );
57
-							$sanitized[] = "<span class='$key'>$action</span>";
53
+                        $sanitized  = array();
54
+                        foreach ( $actions as $key => $action ) {
55
+                            $key         = sanitize_html_class( $key );
56
+                            $action      = wp_kses_post( $action );
57
+                            $sanitized[] = "<span class='$key'>$action</span>";
58 58
                             }
59 59
 
60
-						echo "<small class='form-text getpaid-line-item-actions'>";
61
-						echo implode( ' | ', $sanitized );
62
-						echo '</small>';
60
+                        echo "<small class='form-text getpaid-line-item-actions'>";
61
+                        echo implode( ' | ', $sanitized );
62
+                        echo '</small>';
63 63
 
64 64
                         }
65 65
 }
@@ -67,26 +67,26 @@  discard block
 block discarded – undo
67 67
                     // Item price.
68 68
                     if ( 'price' == $column ) {
69 69
 
70
-					// Display the item price (or recurring price if this is a renewal invoice)
71
-					$price = $invoice->is_renewal() ? $item->get_price() : $item->get_initial_price();
72
-					echo wpinv_price( $price, $invoice->get_currency() );
70
+                    // Display the item price (or recurring price if this is a renewal invoice)
71
+                    $price = $invoice->is_renewal() ? $item->get_price() : $item->get_initial_price();
72
+                    echo wpinv_price( $price, $invoice->get_currency() );
73 73
 
74 74
                     }
75 75
 
76 76
                     // Tax rate.
77 77
                     if ( 'tax_rate' == $column ) {
78
-					echo round( getpaid_get_invoice_tax_rate( $invoice, $item ), 2 ) . '%';
78
+                    echo round( getpaid_get_invoice_tax_rate( $invoice, $item ), 2 ) . '%';
79 79
                     }
80 80
 
81 81
                     // Item quantity.
82 82
                     if ( 'quantity' == $column ) {
83
-					echo (float) $item->get_quantity();
83
+                    echo (float) $item->get_quantity();
84 84
                     }
85 85
 
86 86
                     // Item sub total.
87 87
                     if ( 'subtotal' == $column ) {
88
-					$subtotal = $invoice->is_renewal() ? $item->get_recurring_sub_total() : $item->get_sub_total();
89
-					echo wpinv_price( $subtotal, $invoice->get_currency() );
88
+                    $subtotal = $invoice->is_renewal() ? $item->get_recurring_sub_total() : $item->get_sub_total();
89
+                    echo wpinv_price( $subtotal, $invoice->get_currency() );
90 90
                     }
91 91
 
92 92
                     // Fires when printing a line item column.
Please login to merge, or discard this patch.
Spacing   +27 added lines, -27 removed lines patch added patch discarded remove patch
@@ -10,90 +10,90 @@
 block discarded – undo
10 10
  * @var array $columns
11 11
  */
12 12
 
13
-defined( 'ABSPATH' ) || exit;
13
+defined('ABSPATH') || exit;
14 14
 
15
-do_action( 'getpaid_before_invoice_line_item', $invoice, $item );
15
+do_action('getpaid_before_invoice_line_item', $invoice, $item);
16 16
 
17 17
 ?>
18 18
 
19
-<div class='getpaid-invoice-item item-<?php echo (int) $item->get_id(); ?> item-type-<?php echo sanitize_html_class( $item->get_type() ); ?> border-bottom'>
19
+<div class='getpaid-invoice-item item-<?php echo (int) $item->get_id(); ?> item-type-<?php echo sanitize_html_class($item->get_type()); ?> border-bottom'>
20 20
 
21 21
     <div class="form-row">
22 22
 
23
-        <?php foreach ( array_keys( $columns ) as $column ) : ?>
23
+        <?php foreach (array_keys($columns) as $column) : ?>
24 24
 
25
-            <div class="<?php echo 'name' == $column ? 'col-12 col-sm-6' : 'col-12 col-sm'; ?> getpaid-invoice-item-<?php echo sanitize_html_class( $column ); ?>">
25
+            <div class="<?php echo 'name' == $column ? 'col-12 col-sm-6' : 'col-12 col-sm'; ?> getpaid-invoice-item-<?php echo sanitize_html_class($column); ?>">
26 26
 
27 27
                 <?php
28 28
 
29 29
                     // Fires before printing a line item column.
30
-                    do_action( "getpaid_invoice_line_item_before_$column", $item, $invoice );
30
+                    do_action("getpaid_invoice_line_item_before_$column", $item, $invoice);
31 31
 
32 32
                     // Item name.
33
-                    if ( 'name' == $column ) {
33
+                    if ('name' == $column) {
34 34
 
35 35
 					// Display the name.
36
-					echo '<div class="mb-1">' . esc_html( $item->get_name() ) . '</div>';
36
+					echo '<div class="mb-1">' . esc_html($item->get_name()) . '</div>';
37 37
 
38 38
 					// And an optional description.
39 39
 					$description = $item->get_description();
40 40
 
41
-					if ( ! empty( $description ) ) {
42
-						$description = wp_kses_post( $description );
41
+					if (!empty($description)) {
42
+						$description = wp_kses_post($description);
43 43
 						echo "<small class='form-text text-muted pr-2 m-0'>$description</small>";
44 44
                         }
45 45
 
46 46
 					// Fires before printing the line item actions.
47
-					do_action( 'getpaid_before_invoice_line_item_actions', $item, $invoice );
47
+					do_action('getpaid_before_invoice_line_item_actions', $item, $invoice);
48 48
 
49
-					$actions = apply_filters( 'getpaid-invoice-page-line-item-actions', array(), $item, $invoice );
49
+					$actions = apply_filters('getpaid-invoice-page-line-item-actions', array(), $item, $invoice);
50 50
 
51
-					if ( ! empty( $actions ) ) {
51
+					if (!empty($actions)) {
52 52
 
53
-						$sanitized  = array();
54
-						foreach ( $actions as $key => $action ) {
55
-							$key         = sanitize_html_class( $key );
56
-							$action      = wp_kses_post( $action );
53
+						$sanitized = array();
54
+						foreach ($actions as $key => $action) {
55
+							$key         = sanitize_html_class($key);
56
+							$action      = wp_kses_post($action);
57 57
 							$sanitized[] = "<span class='$key'>$action</span>";
58 58
                             }
59 59
 
60 60
 						echo "<small class='form-text getpaid-line-item-actions'>";
61
-						echo implode( ' | ', $sanitized );
61
+						echo implode(' | ', $sanitized);
62 62
 						echo '</small>';
63 63
 
64 64
                         }
65 65
 }
66 66
 
67 67
                     // Item price.
68
-                    if ( 'price' == $column ) {
68
+                    if ('price' == $column) {
69 69
 
70 70
 					// Display the item price (or recurring price if this is a renewal invoice)
71 71
 					$price = $invoice->is_renewal() ? $item->get_price() : $item->get_initial_price();
72
-					echo wpinv_price( $price, $invoice->get_currency() );
72
+					echo wpinv_price($price, $invoice->get_currency());
73 73
 
74 74
                     }
75 75
 
76 76
                     // Tax rate.
77
-                    if ( 'tax_rate' == $column ) {
78
-					echo round( getpaid_get_invoice_tax_rate( $invoice, $item ), 2 ) . '%';
77
+                    if ('tax_rate' == $column) {
78
+					echo round(getpaid_get_invoice_tax_rate($invoice, $item), 2) . '%';
79 79
                     }
80 80
 
81 81
                     // Item quantity.
82
-                    if ( 'quantity' == $column ) {
82
+                    if ('quantity' == $column) {
83 83
 					echo (float) $item->get_quantity();
84 84
                     }
85 85
 
86 86
                     // Item sub total.
87
-                    if ( 'subtotal' == $column ) {
87
+                    if ('subtotal' == $column) {
88 88
 					$subtotal = $invoice->is_renewal() ? $item->get_recurring_sub_total() : $item->get_sub_total();
89
-					echo wpinv_price( $subtotal, $invoice->get_currency() );
89
+					echo wpinv_price($subtotal, $invoice->get_currency());
90 90
                     }
91 91
 
92 92
                     // Fires when printing a line item column.
93
-                    do_action( "getpaid_invoice_line_item_$column", $item, $invoice );
93
+                    do_action("getpaid_invoice_line_item_$column", $item, $invoice);
94 94
 
95 95
                     // Fires after printing a line item column.
96
-                    do_action( "getpaid_invoice_line_item_after_$column", $item, $invoice );
96
+                    do_action("getpaid_invoice_line_item_after_$column", $item, $invoice);
97 97
 
98 98
                 ?>
99 99
 
Please login to merge, or discard this patch.
templates/invoice/line-totals.php 2 patches
Indentation   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -37,42 +37,42 @@
 block discarded – undo
37 37
 
38 38
                                 // Total tax.
39 39
                                 if ( 'tax' == $key ) {
40
-								echo wpinv_price( $invoice->get_total_tax(), $invoice->get_currency() );
40
+                                echo wpinv_price( $invoice->get_total_tax(), $invoice->get_currency() );
41 41
 
42
-								if ( wpinv_use_taxes() && ! $invoice->get_disable_taxes() ) {
42
+                                if ( wpinv_use_taxes() && ! $invoice->get_disable_taxes() ) {
43 43
 
44
-									$taxes = $invoice->get_total_tax();
45
-									if ( empty( $taxes ) && GetPaid_Payment_Form_Submission_Taxes::is_eu_transaction( $invoice->get_country() ) ) {
46
-										echo ' <em class="text-muted small">';
47
-										_x( '(Reverse charged)', 'This is a legal term for reverse charging tax in the EU', 'invoicing' );
48
-										echo '</em>';
44
+                                    $taxes = $invoice->get_total_tax();
45
+                                    if ( empty( $taxes ) && GetPaid_Payment_Form_Submission_Taxes::is_eu_transaction( $invoice->get_country() ) ) {
46
+                                        echo ' <em class="text-muted small">';
47
+                                        _x( '(Reverse charged)', 'This is a legal term for reverse charging tax in the EU', 'invoicing' );
48
+                                        echo '</em>';
49 49
                                         }
50 50
 }
51 51
 }
52 52
 
53 53
                                 // Total Fee.
54 54
                                 if ( 'fee' == $key ) {
55
-								echo wpinv_price( $invoice->get_total_fees(), $invoice->get_currency() );
55
+                                echo wpinv_price( $invoice->get_total_fees(), $invoice->get_currency() );
56 56
                                 }
57 57
 
58 58
                                 // Total discount.
59 59
                                 if ( 'discount' == $key ) {
60
-								echo wpinv_price( $invoice->get_total_discount(), $invoice->get_currency() );
60
+                                echo wpinv_price( $invoice->get_total_discount(), $invoice->get_currency() );
61 61
                                 }
62 62
 
63 63
                                 // Shipping.
64 64
                                 if ( 'shipping' == $key ) {
65
-								echo wpinv_price( $invoice->get_shipping(), $invoice->get_currency() );
65
+                                echo wpinv_price( $invoice->get_shipping(), $invoice->get_currency() );
66 66
                                 }
67 67
 
68 68
                                 // Sub total.
69 69
                                 if ( 'subtotal' == $key ) {
70
-								echo wpinv_price( $invoice->get_subtotal(), $invoice->get_currency() );
70
+                                echo wpinv_price( $invoice->get_subtotal(), $invoice->get_currency() );
71 71
                                 }
72 72
 
73 73
                                 // Total.
74 74
                                 if ( 'total' == $key ) {
75
-								echo wpinv_price( $invoice->get_total(), $invoice->get_currency() );
75
+                                echo wpinv_price( $invoice->get_total(), $invoice->get_currency() );
76 76
                                 }
77 77
 
78 78
                                 // Fires when printing a cart total.
Please login to merge, or discard this patch.
Spacing   +23 added lines, -23 removed lines patch added patch discarded remove patch
@@ -9,26 +9,26 @@  discard block
 block discarded – undo
9 9
  * @var WPInv_Invoice $invoice
10 10
  */
11 11
 
12
-defined( 'ABSPATH' ) || exit;
12
+defined('ABSPATH') || exit;
13 13
 
14 14
 // Totals rows.
15
-$totals = getpaid_invoice_totals_rows( $invoice );
15
+$totals = getpaid_invoice_totals_rows($invoice);
16 16
 
17
-do_action( 'getpaid_before_invoice_line_totals', $invoice, $totals );
17
+do_action('getpaid_before_invoice_line_totals', $invoice, $totals);
18 18
 
19 19
 ?>
20 20
 <div class='getpaid-invoice-line-totals'>
21 21
     <div class="row">
22 22
         <div class="col-12 offset-sm-6 col-sm-6 border-sm-left pl-sm-0">
23 23
 
24
-            <?php foreach ( $totals as $key => $label ) : ?>
24
+            <?php foreach ($totals as $key => $label) : ?>
25 25
 
26
-                <div class="getpaid-invoice-line-totals-col <?php echo sanitize_html_class( $key ); ?>">
26
+                <div class="getpaid-invoice-line-totals-col <?php echo sanitize_html_class($key); ?>">
27 27
 
28 28
                     <div class="form-row">
29 29
 
30 30
                         <div class="col-8 getpaid-invoice-line-totals-label">
31
-                            <?php echo esc_html( $label ); ?>
31
+                            <?php echo esc_html($label); ?>
32 32
                         </div>
33 33
 
34 34
                         <div class="col-4 getpaid-invoice-line-totals-value pl-0">
@@ -36,47 +36,47 @@  discard block
 block discarded – undo
36 36
                             <?php
37 37
 
38 38
                                 // Total tax.
39
-                                if ( 'tax' == $key ) {
40
-								echo wpinv_price( $invoice->get_total_tax(), $invoice->get_currency() );
39
+                                if ('tax' == $key) {
40
+								echo wpinv_price($invoice->get_total_tax(), $invoice->get_currency());
41 41
 
42
-								if ( wpinv_use_taxes() && ! $invoice->get_disable_taxes() ) {
42
+								if (wpinv_use_taxes() && !$invoice->get_disable_taxes()) {
43 43
 
44 44
 									$taxes = $invoice->get_total_tax();
45
-									if ( empty( $taxes ) && GetPaid_Payment_Form_Submission_Taxes::is_eu_transaction( $invoice->get_country() ) ) {
45
+									if (empty($taxes) && GetPaid_Payment_Form_Submission_Taxes::is_eu_transaction($invoice->get_country())) {
46 46
 										echo ' <em class="text-muted small">';
47
-										_x( '(Reverse charged)', 'This is a legal term for reverse charging tax in the EU', 'invoicing' );
47
+										_x('(Reverse charged)', 'This is a legal term for reverse charging tax in the EU', 'invoicing');
48 48
 										echo '</em>';
49 49
                                         }
50 50
 }
51 51
 }
52 52
 
53 53
                                 // Total Fee.
54
-                                if ( 'fee' == $key ) {
55
-								echo wpinv_price( $invoice->get_total_fees(), $invoice->get_currency() );
54
+                                if ('fee' == $key) {
55
+								echo wpinv_price($invoice->get_total_fees(), $invoice->get_currency());
56 56
                                 }
57 57
 
58 58
                                 // Total discount.
59
-                                if ( 'discount' == $key ) {
60
-								echo wpinv_price( $invoice->get_total_discount(), $invoice->get_currency() );
59
+                                if ('discount' == $key) {
60
+								echo wpinv_price($invoice->get_total_discount(), $invoice->get_currency());
61 61
                                 }
62 62
 
63 63
                                 // Shipping.
64
-                                if ( 'shipping' == $key ) {
65
-								echo wpinv_price( $invoice->get_shipping(), $invoice->get_currency() );
64
+                                if ('shipping' == $key) {
65
+								echo wpinv_price($invoice->get_shipping(), $invoice->get_currency());
66 66
                                 }
67 67
 
68 68
                                 // Sub total.
69
-                                if ( 'subtotal' == $key ) {
70
-								echo wpinv_price( $invoice->get_subtotal(), $invoice->get_currency() );
69
+                                if ('subtotal' == $key) {
70
+								echo wpinv_price($invoice->get_subtotal(), $invoice->get_currency());
71 71
                                 }
72 72
 
73 73
                                 // Total.
74
-                                if ( 'total' == $key ) {
75
-								echo wpinv_price( $invoice->get_total(), $invoice->get_currency() );
74
+                                if ('total' == $key) {
75
+								echo wpinv_price($invoice->get_total(), $invoice->get_currency());
76 76
                                 }
77 77
 
78 78
                                 // Fires when printing a cart total.
79
-                                do_action( "getpaid_invoice_cart_totals_$key", $invoice );
79
+                                do_action("getpaid_invoice_cart_totals_$key", $invoice);
80 80
 
81 81
                             ?>
82 82
 
@@ -90,4 +90,4 @@  discard block
 block discarded – undo
90 90
     </div>
91 91
 </div> <!-- end .getpaid-invoice-line-totals -->
92 92
 
93
-<?php do_action( 'getpaid_after_invoice_line_totals', $invoice, $totals ); ?>
93
+<?php do_action('getpaid_after_invoice_line_totals', $invoice, $totals); ?>
Please login to merge, or discard this patch.
templates/invoice/fee-item.php 2 patches
Indentation   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -31,44 +31,44 @@
 block discarded – undo
31 31
                     // Item name.
32 32
                     if ( 'name' == $column ) {
33 33
 
34
-					// Display the name.
35
-					echo '<div class="mb-1">' . esc_html( $fee['name'] ) . '</div>';
34
+                    // Display the name.
35
+                    echo '<div class="mb-1">' . esc_html( $fee['name'] ) . '</div>';
36 36
 
37
-					// And an optional description.
38
-					$description = empty( $fee['description'] ) ? esc_html__( 'Fee', 'invoicing' ) : esc_html( $fee['description'] );
39
-					echo "<small class='form-text text-muted pr-2 m-0'>$description</small>";
37
+                    // And an optional description.
38
+                    $description = empty( $fee['description'] ) ? esc_html__( 'Fee', 'invoicing' ) : esc_html( $fee['description'] );
39
+                    echo "<small class='form-text text-muted pr-2 m-0'>$description</small>";
40 40
 
41 41
                     }
42 42
 
43 43
                     // Item price.
44 44
                     if ( 'price' == $column ) {
45 45
 
46
-					// Display the item price (or recurring price if this is a renewal invoice)
47
-					if ( $invoice->is_recurring() && $invoice->is_renewal() ) {
48
-						echo wpinv_price( $fee['recurring_fee'], $invoice->get_currency() );
46
+                    // Display the item price (or recurring price if this is a renewal invoice)
47
+                    if ( $invoice->is_recurring() && $invoice->is_renewal() ) {
48
+                        echo wpinv_price( $fee['recurring_fee'], $invoice->get_currency() );
49 49
                         } else {
50
-						echo wpinv_price( $fee['initial_fee'], $invoice->get_currency() );
50
+                        echo wpinv_price( $fee['initial_fee'], $invoice->get_currency() );
51 51
                         }
52 52
 }
53 53
 
54 54
                     // Item quantity.
55 55
                     if ( 'quantity' == $column ) {
56
-					echo '&mdash;';
56
+                    echo '&mdash;';
57 57
                     }
58 58
 
59 59
                     // Item tax.
60 60
                     if ( 'tax_rate' == $column ) {
61
-					echo '&mdash;';
61
+                    echo '&mdash;';
62 62
                     }
63 63
 
64 64
                     // Item sub total.
65 65
                     if ( 'subtotal' == $column ) {
66 66
 
67
-					// Display the item price (or recurring price if this is a renewal invoice)
68
-					if ( $invoice->is_recurring() && $invoice->is_renewal() ) {
69
-						echo wpinv_price( $fee['recurring_fee'], $invoice->get_currency() );
67
+                    // Display the item price (or recurring price if this is a renewal invoice)
68
+                    if ( $invoice->is_recurring() && $invoice->is_renewal() ) {
69
+                        echo wpinv_price( $fee['recurring_fee'], $invoice->get_currency() );
70 70
                         } else {
71
-						echo wpinv_price( $fee['initial_fee'], $invoice->get_currency() );
71
+                        echo wpinv_price( $fee['initial_fee'], $invoice->get_currency() );
72 72
                         }
73 73
 }
74 74
 
Please login to merge, or discard this patch.
Spacing   +20 added lines, -20 removed lines patch added patch discarded remove patch
@@ -9,9 +9,9 @@  discard block
 block discarded – undo
9 9
  * @var array $fee
10 10
  */
11 11
 
12
-defined( 'ABSPATH' ) || exit;
12
+defined('ABSPATH') || exit;
13 13
 
14
-do_action( 'getpaid_before_invoice_fee_item', $invoice, $fee );
14
+do_action('getpaid_before_invoice_fee_item', $invoice, $fee);
15 15
 
16 16
 ?>
17 17
 
@@ -19,64 +19,64 @@  discard block
 block discarded – undo
19 19
 
20 20
     <div class="form-row">
21 21
 
22
-        <?php foreach ( array_keys( $columns ) as $column ) : ?>
22
+        <?php foreach (array_keys($columns) as $column) : ?>
23 23
 
24
-            <div class="<?php echo 'name' == $column ? 'col-12 col-sm-6' : 'col-12 col-sm'; ?> getpaid-invoice-item-<?php echo sanitize_html_class( $column ); ?>">
24
+            <div class="<?php echo 'name' == $column ? 'col-12 col-sm-6' : 'col-12 col-sm'; ?> getpaid-invoice-item-<?php echo sanitize_html_class($column); ?>">
25 25
 
26 26
                 <?php
27 27
 
28 28
                     // Fires before printing a fee item column.
29
-                    do_action( "getpaid_invoice_fee_item_before_$column", $fee, $invoice );
29
+                    do_action("getpaid_invoice_fee_item_before_$column", $fee, $invoice);
30 30
 
31 31
                     // Item name.
32
-                    if ( 'name' == $column ) {
32
+                    if ('name' == $column) {
33 33
 
34 34
 					// Display the name.
35
-					echo '<div class="mb-1">' . esc_html( $fee['name'] ) . '</div>';
35
+					echo '<div class="mb-1">' . esc_html($fee['name']) . '</div>';
36 36
 
37 37
 					// And an optional description.
38
-					$description = empty( $fee['description'] ) ? esc_html__( 'Fee', 'invoicing' ) : esc_html( $fee['description'] );
38
+					$description = empty($fee['description']) ? esc_html__('Fee', 'invoicing') : esc_html($fee['description']);
39 39
 					echo "<small class='form-text text-muted pr-2 m-0'>$description</small>";
40 40
 
41 41
                     }
42 42
 
43 43
                     // Item price.
44
-                    if ( 'price' == $column ) {
44
+                    if ('price' == $column) {
45 45
 
46 46
 					// Display the item price (or recurring price if this is a renewal invoice)
47
-					if ( $invoice->is_recurring() && $invoice->is_renewal() ) {
48
-						echo wpinv_price( $fee['recurring_fee'], $invoice->get_currency() );
47
+					if ($invoice->is_recurring() && $invoice->is_renewal()) {
48
+						echo wpinv_price($fee['recurring_fee'], $invoice->get_currency());
49 49
                         } else {
50
-						echo wpinv_price( $fee['initial_fee'], $invoice->get_currency() );
50
+						echo wpinv_price($fee['initial_fee'], $invoice->get_currency());
51 51
                         }
52 52
 }
53 53
 
54 54
                     // Item quantity.
55
-                    if ( 'quantity' == $column ) {
55
+                    if ('quantity' == $column) {
56 56
 					echo '&mdash;';
57 57
                     }
58 58
 
59 59
                     // Item tax.
60
-                    if ( 'tax_rate' == $column ) {
60
+                    if ('tax_rate' == $column) {
61 61
 					echo '&mdash;';
62 62
                     }
63 63
 
64 64
                     // Item sub total.
65
-                    if ( 'subtotal' == $column ) {
65
+                    if ('subtotal' == $column) {
66 66
 
67 67
 					// Display the item price (or recurring price if this is a renewal invoice)
68
-					if ( $invoice->is_recurring() && $invoice->is_renewal() ) {
69
-						echo wpinv_price( $fee['recurring_fee'], $invoice->get_currency() );
68
+					if ($invoice->is_recurring() && $invoice->is_renewal()) {
69
+						echo wpinv_price($fee['recurring_fee'], $invoice->get_currency());
70 70
                         } else {
71
-						echo wpinv_price( $fee['initial_fee'], $invoice->get_currency() );
71
+						echo wpinv_price($fee['initial_fee'], $invoice->get_currency());
72 72
                         }
73 73
 }
74 74
 
75 75
                     // Fires when printing a fee item column.
76
-                    do_action( "getpaid_invoice_fee_item_$column", $fee, $invoice );
76
+                    do_action("getpaid_invoice_fee_item_$column", $fee, $invoice);
77 77
 
78 78
                     // Fires after printing a fee item column.
79
-                    do_action( "getpaid_invoice_fee_item_after_$column", $fee, $invoice );
79
+                    do_action("getpaid_invoice_fee_item_after_$column", $fee, $invoice);
80 80
 
81 81
                 ?>
82 82
 
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-sm-left pl-sm-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-sm-right pr-sm-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/header-left-actions.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -8,25 +8,25 @@
 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
 ?>
14 14
 
15 15
         <div class="getpaid-header-left-actions">
16 16
 
17
-            <?php if ( $invoice->is_type( 'invoice' ) && $invoice->needs_payment() && ! $invoice->is_held() ) : ?>
18
-                <a class="btn btn-sm btn-primary m-1 d-inline-block invoice-action-pay" href="<?php echo esc_url( $invoice->get_checkout_payment_url() ); ?>">
19
-                    <?php _e( 'Pay For Invoice', 'invoicing' ); ?>
17
+            <?php if ($invoice->is_type('invoice') && $invoice->needs_payment() && !$invoice->is_held()) : ?>
18
+                <a class="btn btn-sm btn-primary m-1 d-inline-block invoice-action-pay" href="<?php echo esc_url($invoice->get_checkout_payment_url()); ?>">
19
+                    <?php _e('Pay For Invoice', 'invoicing'); ?>
20 20
                 </a>
21 21
             <?php endif; ?>
22 22
 
23
-            <?php if ( $invoice->is_type( 'invoice' ) && $invoice->is_paid() ) : ?>
24
-                <a class="btn btn-sm btn-info m-1 d-inline-block invoice-action-receipt" href="<?php echo esc_url( $invoice->get_receipt_url() ); ?>">
25
-                    <?php _e( 'View Receipt', 'invoicing' ); ?>
23
+            <?php if ($invoice->is_type('invoice') && $invoice->is_paid()) : ?>
24
+                <a class="btn btn-sm btn-info m-1 d-inline-block invoice-action-receipt" href="<?php echo esc_url($invoice->get_receipt_url()); ?>">
25
+                    <?php _e('View Receipt', 'invoicing'); ?>
26 26
                 </a>
27 27
             <?php endif; ?>
28 28
 
29
-            <?php do_action( 'wpinv_invoice_display_left_actions', $invoice ); ?>
29
+            <?php do_action('wpinv_invoice_display_left_actions', $invoice); ?>
30 30
 
31 31
         </div>
32 32
 
Please login to merge, or discard this patch.
templates/invoice/company-address.php 1 patch
Spacing   +15 added lines, -15 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
 // Prepare the company name.
13
-$company_name = wpinv_get_option( 'vat_company_name' );
13
+$company_name = wpinv_get_option('vat_company_name');
14 14
 
15
-if ( empty( $company_name ) ) {
15
+if (empty($company_name)) {
16 16
     $company_name = wpinv_get_business_name();
17 17
 }
18 18
 
19 19
 // Prepare the VAT number.
20
-$vat_number = wpinv_get_option( 'vat_number' );
20
+$vat_number = wpinv_get_option('vat_number');
21 21
 
22 22
 ?>
23 23
     <div class="getpaid-company-address form-group">
@@ -25,36 +25,36 @@  discard block
 block discarded – undo
25 25
         <div class="row">
26 26
 
27 27
             <div class="invoice-company-address-label col-2">
28
-                <strong><?php _e( 'From:', 'invoicing' ); ?></strong>
28
+                <strong><?php _e('From:', 'invoicing'); ?></strong>
29 29
             </div>
30 30
 
31 31
             <div class="invoice-company-address-value col-10">
32 32
 
33
-                <?php do_action( 'getpaid_company_address_top' ); ?>
33
+                <?php do_action('getpaid_company_address_top'); ?>
34 34
 
35 35
                 <div class="name">
36
-                    <a target="_blank" class="text-dark" href="<?php echo esc_url( wpinv_get_business_website() ); ?>">
37
-                        <?php echo esc_html( $company_name ); ?>
36
+                    <a target="_blank" class="text-dark" href="<?php echo esc_url(wpinv_get_business_website()); ?>">
37
+                        <?php echo esc_html($company_name); ?>
38 38
                     </a>
39 39
                 </div>
40 40
 
41
-                <?php if ( $address = wpinv_get_business_address() ) { ?>
42
-                    <?php echo wp_kses_post( $address ); ?>
41
+                <?php if ($address = wpinv_get_business_address()) { ?>
42
+                    <?php echo wp_kses_post($address); ?>
43 43
                 <?php } ?>
44 44
 
45
-                <?php if ( $email_from = wpinv_mail_get_from_address() ) { ?>
45
+                <?php if ($email_from = wpinv_mail_get_from_address()) { ?>
46 46
                     <div class="email_from">
47
-                        <?php echo wp_sprintf( __( 'Email: %s', 'invoicing' ), sanitize_email( $email_from ) ); ?>
47
+                        <?php echo wp_sprintf(__('Email: %s', 'invoicing'), sanitize_email($email_from)); ?>
48 48
                     </div>
49 49
                 <?php } ?>
50 50
 
51
-                <?php if ( ! empty( $vat_number ) ) { ?>
51
+                <?php if (!empty($vat_number)) { ?>
52 52
                     <div class="email_from">
53
-                        <?php echo wp_sprintf( __( 'VAT Number: %s', 'invoicing' ), esc_html( $vat_number ) ); ?>
53
+                        <?php echo wp_sprintf(__('VAT Number: %s', 'invoicing'), esc_html($vat_number)); ?>
54 54
                     </div>
55 55
                 <?php } ?>
56 56
 
57
-                <?php do_action( 'getpaid_company_address_bottom' ); ?>
57
+                <?php do_action('getpaid_company_address_bottom'); ?>
58 58
 
59 59
             </div>
60 60
 
Please login to merge, or discard this patch.
templates/invoice/line-items.php 2 patches
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -33,12 +33,12 @@
 block discarded – undo
33 33
 
34 34
             // Display the item totals.
35 35
             foreach ( $invoice->get_items() as $item ) {
36
-			wpinv_get_template( 'invoice/line-item.php', compact( 'invoice', 'item', 'columns' ) );
36
+            wpinv_get_template( 'invoice/line-item.php', compact( 'invoice', 'item', 'columns' ) );
37 37
             }
38 38
 
39 39
             // Display the fee totals.
40 40
             foreach ( $invoice->get_fees() as $fee ) {
41
-			wpinv_get_template( 'invoice/fee-item.php', compact( 'invoice', 'fee', 'columns' ) );
41
+            wpinv_get_template( 'invoice/fee-item.php', compact( 'invoice', 'fee', 'columns' ) );
42 42
             }
43 43
 
44 44
             // Display the cart totals.
Please login to merge, or discard this patch.
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -8,21 +8,21 @@  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
 ?>
14 14
 
15
-<?php do_action( 'getpaid_invoice_before_line_items', $invoice ); ?>
15
+<?php do_action('getpaid_invoice_before_line_items', $invoice); ?>
16 16
 
17
-    <h2 class="mt-5 mb-1 h4"><?php echo sprintf( esc_html__( '%s Items', 'invoicing' ), esc_html( ucfirst( $invoice->get_invoice_quote_type() ) ) ); ?></h2>
17
+    <h2 class="mt-5 mb-1 h4"><?php echo sprintf(esc_html__('%s Items', 'invoicing'), esc_html(ucfirst($invoice->get_invoice_quote_type()))); ?></h2>
18 18
     <div class="getpaid-invoice-items mb-4 border">
19 19
 
20 20
 
21
-        <div class="getpaid-invoice-items-header <?php echo sanitize_html_class( $invoice->get_template() ); ?>">
21
+        <div class="getpaid-invoice-items-header <?php echo sanitize_html_class($invoice->get_template()); ?>">
22 22
             <div class="form-row">
23
-                <?php foreach ( $columns as $key => $label ) : ?>
24
-                    <div class="<?php echo 'name' == $key ? 'col-12 col-sm-6' : 'col-12 col-sm'; ?> getpaid-invoice-line-item-col-<?php echo esc_attr( $key ); ?>">
25
-                        <?php echo esc_html( $label ); ?>
23
+                <?php foreach ($columns as $key => $label) : ?>
24
+                    <div class="<?php echo 'name' == $key ? 'col-12 col-sm-6' : 'col-12 col-sm'; ?> getpaid-invoice-line-item-col-<?php echo esc_attr($key); ?>">
25
+                        <?php echo esc_html($label); ?>
26 26
                     </div>
27 27
                 <?php endforeach; ?>
28 28
             </div>
@@ -32,20 +32,20 @@  discard block
 block discarded – undo
32 32
         <?php
33 33
 
34 34
             // Display the item totals.
35
-            foreach ( $invoice->get_items() as $item ) {
36
-			wpinv_get_template( 'invoice/line-item.php', compact( 'invoice', 'item', 'columns' ) );
35
+            foreach ($invoice->get_items() as $item) {
36
+			wpinv_get_template('invoice/line-item.php', compact('invoice', 'item', 'columns'));
37 37
             }
38 38
 
39 39
             // Display the fee totals.
40
-            foreach ( $invoice->get_fees() as $fee ) {
41
-			wpinv_get_template( 'invoice/fee-item.php', compact( 'invoice', 'fee', 'columns' ) );
40
+            foreach ($invoice->get_fees() as $fee) {
41
+			wpinv_get_template('invoice/fee-item.php', compact('invoice', 'fee', 'columns'));
42 42
             }
43 43
 
44 44
             // Display the cart totals.
45
-            wpinv_get_template( 'invoice/line-totals.php', compact( 'invoice' ) );
45
+            wpinv_get_template('invoice/line-totals.php', compact('invoice'));
46 46
 
47 47
         ?>
48 48
 
49 49
     </div>
50 50
 
51
-<?php do_action( 'getpaid_invoice_after_line_items', $invoice ); ?>
51
+<?php do_action('getpaid_invoice_after_line_items', $invoice); ?>
Please login to merge, or discard this patch.
templates/invoice/invoice-logo.php 2 patches
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -7,24 +7,24 @@
 block discarded – undo
7 7
  * @version 1.0.19
8 8
  */
9 9
 
10
-defined( 'ABSPATH' ) || exit;
10
+defined('ABSPATH') || exit;
11 11
 
12
-$logo_width  = wpinv_get_option( 'logo_width' );
13
-$logo_height = wpinv_get_option( 'logo_height' );
12
+$logo_width  = wpinv_get_option('logo_width');
13
+$logo_height = wpinv_get_option('logo_height');
14 14
 
15 15
 ?>
16
-<a target="_blank" class="logo-link text-dark" href="<?php echo esc_url( wpinv_get_business_website() ); ?>">
16
+<a target="_blank" class="logo-link text-dark" href="<?php echo esc_url(wpinv_get_business_website()); ?>">
17 17
 
18
-    <?php if ( $logo = wpinv_get_business_logo() ) : ?>
18
+    <?php if ($logo = wpinv_get_business_logo()) : ?>
19 19
 
20
-        <?php if ( ! empty( $logo_width ) && ! empty( $logo_height ) ) : ?>
21
-            <img class="logo" style="max-width:100%; width:<?php echo absint( $logo_width ); ?>px; height:<?php echo absint( $logo_height ); ?>px;" src="<?php echo esc_url( $logo ); ?>">
20
+        <?php if (!empty($logo_width) && !empty($logo_height)) : ?>
21
+            <img class="logo" style="max-width:100%; width:<?php echo absint($logo_width); ?>px; height:<?php echo absint($logo_height); ?>px;" src="<?php echo esc_url($logo); ?>">
22 22
         <?php else : ?>
23
-            <img class="logo" style="max-width:100%;" src="<?php echo esc_url( $logo ); ?>">
23
+            <img class="logo" style="max-width:100%;" src="<?php echo esc_url($logo); ?>">
24 24
         <?php endif; ?>
25 25
 
26 26
     <?php else : ?>
27
-        <h1 class="h3"><?php echo esc_html( wpinv_get_business_name() ); ?></h1>
27
+        <h1 class="h3"><?php echo esc_html(wpinv_get_business_name()); ?></h1>
28 28
     <?php endif; ?>
29 29
 
30 30
 </a>
Please login to merge, or discard this patch.
Braces   +10 added lines, -4 removed lines patch added patch discarded remove patch
@@ -19,12 +19,18 @@
 block discarded – undo
19 19
 
20 20
         <?php if ( ! empty( $logo_width ) && ! empty( $logo_height ) ) : ?>
21 21
             <img class="logo" style="max-width:100%; width:<?php echo absint( $logo_width ); ?>px; height:<?php echo absint( $logo_height ); ?>px;" src="<?php echo esc_url( $logo ); ?>">
22
-        <?php else : ?>
23
-            <img class="logo" style="max-width:100%;" src="<?php echo esc_url( $logo ); ?>">
22
+        <?php else {
23
+    : ?>
24
+            <img class="logo" style="max-width:100%;" src="<?php echo esc_url( $logo );
25
+}
26
+?>">
24 27
         <?php endif; ?>
25 28
 
26
-    <?php else : ?>
27
-        <h1 class="h3"><?php echo esc_html( wpinv_get_business_name() ); ?></h1>
29
+    <?php else {
30
+    : ?>
31
+        <h1 class="h3"><?php echo esc_html( wpinv_get_business_name() );
32
+}
33
+?></h1>
28 34
     <?php endif; ?>
29 35
 
30 36
 </a>
Please login to merge, or discard this patch.