Passed
Push — master ( 763170...0f9edb )
by Kiran
07:19 queued 16s
created
templates/invoice/line-items.php 1 patch
Switch Indentation   +18 added lines, -18 removed lines patch added patch discarded remove patch
@@ -1,4 +1,4 @@  discard block
 block discarded – undo
1
-<?php
1
+    <?php
2 2
 /**
3 3
  * Displays a line items in an invoice.
4 4
  *
@@ -8,11 +8,11 @@  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
-?>
14
-
15
-<?php do_action( 'getpaid_invoice_before_line_items', $invoice ); ?>
13
+    ?>
14
+    
15
+    <?php do_action( 'getpaid_invoice_before_line_items', $invoice ); ?>
16 16
 
17 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">
@@ -21,9 +21,9 @@  discard block
 block discarded – undo
21 21
         <div class="getpaid-invoice-items-header <?php echo esc_attr( $invoice->get_template() ); ?>">
22 22
             <div class="form-row row">
23 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 ); ?>">
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 25
                         <?php echo esc_html( $label ); ?>
26
-                    </div>
26
+                        </div>
27 27
                 <?php endforeach; ?>
28 28
             </div>
29 29
         </div>
@@ -31,20 +31,20 @@  discard block
 block discarded – undo
31 31
 
32 32
         <?php
33 33
 
34
-            // Display the item totals.
35
-            foreach ( $invoice->get_items() as $item ) {
36
-			wpinv_get_template( 'invoice/line-item.php', compact( 'invoice', 'item', 'columns' ) );
37
-            }
34
+                // Display the item totals.
35
+                foreach ( $invoice->get_items() as $item ) {
36
+			    wpinv_get_template( 'invoice/line-item.php', compact( 'invoice', 'item', 'columns' ) );
37
+                }
38 38
 
39
-            // Display the fee totals.
40
-            foreach ( $invoice->get_fees() as $fee ) {
41
-			wpinv_get_template( 'invoice/fee-item.php', compact( 'invoice', 'fee', 'columns' ) );
42
-            }
39
+                // Display the fee totals.
40
+                foreach ( $invoice->get_fees() as $fee ) {
41
+			    wpinv_get_template( 'invoice/fee-item.php', compact( 'invoice', 'fee', 'columns' ) );
42
+                }
43 43
 
44
-            // Display the cart totals.
45
-            wpinv_get_template( 'invoice/line-totals.php', compact( 'invoice' ) );
44
+                // Display the cart totals.
45
+                wpinv_get_template( 'invoice/line-totals.php', compact( 'invoice' ) );
46 46
 
47
-        ?>
47
+            ?>
48 48
 
49 49
     </div>
50 50
 
Please login to merge, or discard this patch.
templates/invoice/header-left-actions.php 1 patch
Switch Indentation   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -1,4 +1,4 @@  discard block
 block discarded – undo
1
-<?php
1
+    <?php
2 2
 /**
3 3
  * Displays actions on the left side of the invoice header.
4 4
  *
@@ -8,24 +8,24 @@  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 15
         <div class="getpaid-header-left-actions">
16 16
 
17 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() ); ?>">
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 19
                     <?php esc_html_e( 'Pay For Invoice', 'invoicing' ); ?>
20
-                </a>
20
+                    </a>
21 21
             <?php endif; ?>
22
-
22
+    
23 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() ); ?>">
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 25
                     <?php esc_html_e( 'View Receipt', 'invoicing' ); ?>
26
-                </a>
26
+                    </a>
27 27
             <?php endif; ?>
28
-
28
+    
29 29
             <?php do_action( 'wpinv_invoice_display_left_actions', $invoice ); ?>
30 30
 
31 31
         </div>
Please login to merge, or discard this patch.
templates/invoice/index.php 1 patch
Switch Indentation   +1 added lines patch added patch discarded remove patch
@@ -0,0 +1,1 @@
 block discarded – undo
1
+    
0 2
\ No newline at end of file
Please login to merge, or discard this patch.
templates/invoice/line-item.php 1 patch
Switch Indentation   +66 added lines, -66 removed lines patch added patch discarded remove patch
@@ -1,4 +1,4 @@  discard block
 block discarded – undo
1
-<?php
1
+    <?php
2 2
 /**
3 3
  * Displays a single line item in an invoice.
4 4
  *
@@ -10,11 +10,11 @@  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
-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 19
 <div class='getpaid-invoice-item item-<?php echo (int) $item->get_id(); ?> item-type-<?php echo esc_attr( $item->get_type() ); ?> border-bottom'>
20 20
 
@@ -26,90 +26,90 @@  discard block
 block discarded – undo
26 26
 
27 27
 				<?php
28 28
 
29
-					// Fires before printing a line item column.
30
-					do_action( "getpaid_invoice_line_item_before_$column", $item, $invoice );
29
+					    // Fires before printing a line item column.
30
+					    do_action( "getpaid_invoice_line_item_before_$column", $item, $invoice );
31 31
 
32
-					// Item name.
33
-					if ( 'name' === $column ) {
32
+					    // Item name.
33
+					    if ( 'name' === $column ) {
34 34
 
35
-						$has_featured_image = has_post_thumbnail( $item->get_id() );
35
+						    $has_featured_image = has_post_thumbnail( $item->get_id() );
36 36
 
37
-						if ( $has_featured_image ) {
38
-							echo '<div class="d-flex align-items-center getpaid-form-item-has-featured-image">';
39
-							echo '<div class="getpaid-form-item-image-container mr-2">';
40
-							echo get_the_post_thumbnail( $item->get_id(), 'thumbnail', array( 'class' => 'getpaid-form-item-image mb-0' ) );
41
-							echo '</div>';
42
-							echo '<div class="getpaid-form-item-name-container">';
43
-						}
37
+						    if ( $has_featured_image ) {
38
+							    echo '<div class="d-flex align-items-center getpaid-form-item-has-featured-image">';
39
+							    echo '<div class="getpaid-form-item-image-container mr-2">';
40
+							    echo get_the_post_thumbnail( $item->get_id(), 'thumbnail', array( 'class' => 'getpaid-form-item-image mb-0' ) );
41
+							    echo '</div>';
42
+							    echo '<div class="getpaid-form-item-name-container">';
43
+						    }
44 44
 
45
-						// Display the name.
46
-						echo '<div class="mb-1">' . esc_html( $item->get_name() ) . '</div>';
45
+						    // Display the name.
46
+						    echo '<div class="mb-1">' . esc_html( $item->get_name() ) . '</div>';
47 47
 
48
-						// And an optional description.
49
-						$description = $item->get_description();
48
+						    // And an optional description.
49
+						    $description = $item->get_description();
50 50
 
51
-						if ( ! empty( $description ) ) {
52
-							echo "<small class='form-text text-muted pr-2 m-0'>" . wp_kses_post( $description ) . '</small>';
53
-						}
51
+						    if ( ! empty( $description ) ) {
52
+							    echo "<small class='form-text text-muted pr-2 m-0'>" . wp_kses_post( $description ) . '</small>';
53
+						    }
54 54
 
55
-						// Fires before printing the line item actions.
56
-						do_action( 'getpaid_before_invoice_line_item_actions', $item, $invoice );
55
+						    // Fires before printing the line item actions.
56
+						    do_action( 'getpaid_before_invoice_line_item_actions', $item, $invoice );
57 57
 
58
-						$actions = apply_filters( 'getpaid-invoice-page-line-item-actions', array(), $item, $invoice );
58
+						    $actions = apply_filters( 'getpaid-invoice-page-line-item-actions', array(), $item, $invoice );
59 59
 
60
-						if ( ! empty( $actions ) ) {
60
+						    if ( ! empty( $actions ) ) {
61 61
 
62
-							$sanitized  = array();
63
-							foreach ( $actions as $key => $item_action ) {
64
-								$key         = sanitize_html_class( $key );
65
-								$item_action = wp_kses_post( $item_action );
66
-								$sanitized[] = "<span class='$key'>$item_action</span>";
67
-							}
62
+							    $sanitized  = array();
63
+							    foreach ( $actions as $key => $item_action ) {
64
+								    $key         = sanitize_html_class( $key );
65
+								    $item_action = wp_kses_post( $item_action );
66
+								    $sanitized[] = "<span class='$key'>$item_action</span>";
67
+							    }
68 68
 
69
-							echo "<small class='form-text getpaid-line-item-actions'>";
70
-							echo wp_kses_post( implode( ' | ', $sanitized ) );
71
-							echo '</small>';
69
+							    echo "<small class='form-text getpaid-line-item-actions'>";
70
+							    echo wp_kses_post( implode( ' | ', $sanitized ) );
71
+							    echo '</small>';
72 72
 
73
-						}
73
+						    }
74 74
 
75
-						if ( $has_featured_image ) {
76
-							echo '</div>';
77
-							echo '</div>';
78
-						}
79
-					}
75
+						    if ( $has_featured_image ) {
76
+							    echo '</div>';
77
+							    echo '</div>';
78
+						    }
79
+					    }
80 80
 
81
-					// Item price.
82
-					if ( 'price' === $column ) {
81
+					    // Item price.
82
+					    if ( 'price' === $column ) {
83 83
 
84
-					// Display the item price (or recurring price if this is a renewal invoice)
85
-					$price = $invoice->is_renewal() ? $item->get_price() : $item->get_initial_price();
86
-					wpinv_the_price( $price, $invoice->get_currency() );
84
+					    // Display the item price (or recurring price if this is a renewal invoice)
85
+					    $price = $invoice->is_renewal() ? $item->get_price() : $item->get_initial_price();
86
+					    wpinv_the_price( $price, $invoice->get_currency() );
87 87
 
88
-					}
88
+					    }
89 89
 
90
-					// Tax rate.
91
-					if ( 'tax_rate' === $column ) {
92
-					echo floatval( round( getpaid_get_invoice_tax_rate( $invoice, $item ), 2 ) ) . '%';
93
-					}
90
+					    // Tax rate.
91
+					    if ( 'tax_rate' === $column ) {
92
+					    echo floatval( round( getpaid_get_invoice_tax_rate( $invoice, $item ), 2 ) ) . '%';
93
+					    }
94 94
 
95
-					// Item quantity.
96
-					if ( 'quantity' === $column ) {
97
-					echo (float) $item->get_quantity();
98
-					}
95
+					    // Item quantity.
96
+					    if ( 'quantity' === $column ) {
97
+					    echo (float) $item->get_quantity();
98
+					    }
99 99
 
100
-					// Item sub total.
101
-					if ( 'subtotal' === $column ) {
102
-					$subtotal = $invoice->is_renewal() ? $item->get_recurring_sub_total() : $item->get_sub_total();
103
-					wpinv_the_price( $subtotal, $invoice->get_currency() );
104
-					}
100
+					    // Item sub total.
101
+					    if ( 'subtotal' === $column ) {
102
+					    $subtotal = $invoice->is_renewal() ? $item->get_recurring_sub_total() : $item->get_sub_total();
103
+					    wpinv_the_price( $subtotal, $invoice->get_currency() );
104
+					    }
105 105
 
106
-					// Fires when printing a line item column.
107
-					do_action( "getpaid_invoice_line_item_$column", $item, $invoice );
106
+					    // Fires when printing a line item column.
107
+					    do_action( "getpaid_invoice_line_item_$column", $item, $invoice );
108 108
 
109
-					// Fires after printing a line item column.
110
-					do_action( "getpaid_invoice_line_item_after_$column", $item, $invoice );
109
+					    // Fires after printing a line item column.
110
+					    do_action( "getpaid_invoice_line_item_after_$column", $item, $invoice );
111 111
 
112
-				?>
112
+				    ?>
113 113
 
114 114
 			</div>
115 115
 
Please login to merge, or discard this patch.
templates/invoice/invoice-logo.php 1 patch
Switch Indentation   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -1,4 +1,4 @@  discard block
 block discarded – undo
1
-<?php
1
+    <?php
2 2
 /**
3 3
  * Displays left side of the invoice title.
4 4
  *
@@ -7,24 +7,24 @@  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
-$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
-?>
16
-<a target="_blank" class="logo-link text-dark" href="<?php echo esc_url( wpinv_get_business_website() ); ?>">
15
+    ?>
16
+    <a target="_blank" class="logo-link text-dark" href="<?php echo esc_url( wpinv_get_business_website() ); ?>">
17 17
 
18 18
     <?php if ( $logo = wpinv_get_business_logo() ) : ?>
19
-
19
+    
20 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 ); ?>">
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.
templates/invoice/details.php 1 patch
Switch Indentation   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -1,4 +1,4 @@  discard block
 block discarded – undo
1
-<?php
1
+    <?php
2 2
 /**
3 3
  * Displays the invoice details.
4 4
  *
@@ -7,10 +7,10 @@  discard block
 block discarded – undo
7 7
  * @version 1.0.19
8 8
  */
9 9
 
10
-defined( 'ABSPATH' ) || exit;
11
-
12
-?>
10
+    defined( 'ABSPATH' ) || exit;
13 11
 
12
+    ?>
13
+    
14 14
         <?php do_action( 'getpaid_before_invoice_details_main', $invoice ); ?>
15 15
 
16 16
         <div class="getpaid-invoice-details mt-3 mb-3">
@@ -28,5 +28,5 @@  discard block
 block discarded – undo
28 28
         </div>
29 29
 
30 30
         <?php do_action( 'getpaid_after_invoice_details_main', $invoice ); ?>
31
-
32
-<?php
31
+    
32
+    <?php
Please login to merge, or discard this patch.
uninstall.php 1 patch
Switch Indentation   +42 added lines, -42 removed lines patch added patch discarded remove patch
@@ -1,69 +1,69 @@
 block discarded – undo
1
-<?php
1
+    <?php
2 2
 
3
-if ( ! defined( 'WP_UNINSTALL_PLUGIN' ) ) {
4
-	exit;
3
+    if ( ! defined( 'WP_UNINSTALL_PLUGIN' ) ) {
4
+	    exit;
5 5
 }
6 6
 
7
-global $wpdb;
7
+    global $wpdb;
8 8
 
9
-if ( get_option( 'wpinv_remove_data_on_invoice_unistall' ) ) {
9
+    if ( get_option( 'wpinv_remove_data_on_invoice_unistall' ) ) {
10 10
 
11
-    // Fetch settings.
12
-    $settings = get_option( 'wpinv_settings' );
11
+        // Fetch settings.
12
+        $settings = get_option( 'wpinv_settings' );
13 13
 
14
-    // Delete pages.
15
-    $pages = array( 'checkout_page', 'success_page', 'failure_page', 'invoice_history_page', 'quote_history_page', 'invoice_subscription_page' );
16
-    foreach ( $pages as $page ) {
17
-        if ( is_array( $settings ) && ! empty( $settings[ $page ] ) ) {
18
-            wp_delete_post( $settings[ $page ], true );
14
+        // Delete pages.
15
+        $pages = array( 'checkout_page', 'success_page', 'failure_page', 'invoice_history_page', 'quote_history_page', 'invoice_subscription_page' );
16
+        foreach ( $pages as $page ) {
17
+            if ( is_array( $settings ) && ! empty( $settings[ $page ] ) ) {
18
+                wp_delete_post( $settings[ $page ], true );
19
+            }
19 20
         }
20
-    }
21 21
 
22
-    // Delete options.
23
-    $wpdb->query( "DELETE FROM {$wpdb->options} WHERE option_name LIKE 'wpinv\_%';" );
22
+        // Delete options.
23
+        $wpdb->query( "DELETE FROM {$wpdb->options} WHERE option_name LIKE 'wpinv\_%';" );
24 24
 
25
-    // Delete posts.
26
-    $wpdb->query(
27
-        "DELETE a,b
25
+        // Delete posts.
26
+        $wpdb->query(
27
+            "DELETE a,b
28 28
         FROM {$wpdb->posts} a
29 29
         LEFT JOIN {$wpdb->postmeta} b
30 30
             ON (a.ID = b.post_id)
31 31
         WHERE a.post_type 
32 32
             IN ( 'wpi_invoice', 'wpi_item', 'wpi_discount', 'wpi_quote' );"
33
-    );
33
+        );
34 34
 
35
-    // Delete invoice notes.
36
-    $wpdb->query(
37
-        "DELETE a,b
35
+        // Delete invoice notes.
36
+        $wpdb->query(
37
+            "DELETE a,b
38 38
         FROM {$wpdb->comments} a
39 39
         LEFT JOIN {$wpdb->commentmeta} b
40 40
             ON (a.comment_ID = b.comment_id)
41 41
         WHERE a.comment_type = 'wpinv_note'"
42
-    );
42
+        );
43 43
 
44
-    // Delete user meta.
45
-    $wpdb->query(
46
-        "DELETE
44
+        // Delete user meta.
45
+        $wpdb->query(
46
+            "DELETE
47 47
         FROM {$wpdb->usermeta}
48 48
         WHERE meta_key LIKE '%_wpinv_%' OR meta_key LIKE '%_wpi_%';"
49
-    );
49
+        );
50 50
 
51
-    // Cleanup Cron Schedule
52
-    wp_clear_scheduled_hook( 'wp_session_garbage_collection' );
53
-    wp_clear_scheduled_hook( 'wpinv_register_schedule_event_twicedaily' );
54
-    wp_clear_scheduled_hook( 'wpinv_register_schedule_event_daily' );
51
+        // Cleanup Cron Schedule
52
+        wp_clear_scheduled_hook( 'wp_session_garbage_collection' );
53
+        wp_clear_scheduled_hook( 'wpinv_register_schedule_event_twicedaily' );
54
+        wp_clear_scheduled_hook( 'wpinv_register_schedule_event_daily' );
55 55
 
56
-    // Clear any cached data that has been removed
57
-    wp_cache_flush();
56
+        // Clear any cached data that has been removed
57
+        wp_cache_flush();
58 58
 
59
-    // Delete tables.
60
-    $tables = array(
61
-        "{$wpdb->prefix}wpinv_subscriptions",
62
-        "{$wpdb->prefix}getpaid_invoices",
63
-        "{$wpdb->prefix}getpaid_invoice_items",
64
-    );
59
+        // Delete tables.
60
+        $tables = array(
61
+            "{$wpdb->prefix}wpinv_subscriptions",
62
+            "{$wpdb->prefix}getpaid_invoices",
63
+            "{$wpdb->prefix}getpaid_invoice_items",
64
+        );
65 65
 
66
-    foreach ( $tables as $table ) {
67
-        $wpdb->query( "DROP TABLE IF EXISTS {$table}" );
68
-    }
66
+        foreach ( $tables as $table ) {
67
+            $wpdb->query( "DROP TABLE IF EXISTS {$table}" );
68
+        }
69 69
 }
Please login to merge, or discard this patch.
index.php 1 patch
Switch Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,2 +1,2 @@
 block discarded – undo
1
-<?php
1
+    <?php
2 2
 # Silence is golden.
3 3
\ No newline at end of file
Please login to merge, or discard this patch.
templates/invoice/header-right-actions.php 1 patch
Switch Indentation   +34 added lines, -34 removed lines patch added patch discarded remove patch
@@ -1,4 +1,4 @@  discard block
 block discarded – undo
1
-<?php
1
+    <?php
2 2
 /**
3 3
  * Displays right side of the invoice header.
4 4
  *
@@ -8,56 +8,56 @@  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 15
     <div class="getpaid-header-right-actions">
16 16
 
17 17
         <?php
18 18
 
19
-            $actions   = array();
19
+                $actions   = array();
20 20
 
21
-            echo sprintf(
22
-                '<a href="javascript:void(0)" class="btn btn-sm m-1 d-inline-block btn-secondary text-white invoice-action-print d-none d-lg-inline-block" onclick="window.print();">%s</a>',
23
-                sprintf(
24
-                    esc_html__( 'Print %s', 'invoicing' ),
25
-                    esc_html( ucfirst( $invoice->get_invoice_quote_type() ) )
26
-                )
27
-            );
28
-
29
-            if ( is_user_logged_in() ) {
30
-
31
-                $actions[] = sprintf(
32
-                    '<a href="%s" class="btn btn-sm btn-secondary text-white m-1 d-inline-block invoice-action-history">%s</a>',
33
-                    esc_url( wpinv_get_history_page_uri( $invoice->get_post_type() ) ),
21
+                echo sprintf(
22
+                    '<a href="javascript:void(0)" class="btn btn-sm m-1 d-inline-block btn-secondary text-white invoice-action-print d-none d-lg-inline-block" onclick="window.print();">%s</a>',
34 23
                     sprintf(
35
-                        __( '%s History', 'invoicing' ),
24
+                        esc_html__( 'Print %s', 'invoicing' ),
36 25
                         esc_html( ucfirst( $invoice->get_invoice_quote_type() ) )
37 26
                     )
38 27
                 );
39 28
 
40
-            }
29
+                if ( is_user_logged_in() ) {
41 30
 
42
-            if ( wpinv_current_user_can_manage_invoicing() ) {
31
+                    $actions[] = sprintf(
32
+                        '<a href="%s" class="btn btn-sm btn-secondary text-white m-1 d-inline-block invoice-action-history">%s</a>',
33
+                        esc_url( wpinv_get_history_page_uri( $invoice->get_post_type() ) ),
34
+                        sprintf(
35
+                            __( '%s History', 'invoicing' ),
36
+                            esc_html( ucfirst( $invoice->get_invoice_quote_type() ) )
37
+                        )
38
+                    );
43 39
 
44
-                $actions[] = sprintf(
45
-                    '<a href="%s" class="btn btn-sm btn-secondary text-white m-1 d-inline-block invoice-action-edit">%s</a>',
46
-                    esc_url( get_edit_post_link( $invoice->get_id() ) ),
47
-                    sprintf(
48
-                        __( 'Edit %s', 'invoicing' ),
49
-                        esc_html( ucfirst( $invoice->get_invoice_quote_type() ) )
50
-                    )
51
-                );
40
+                }
41
+
42
+                if ( wpinv_current_user_can_manage_invoicing() ) {
52 43
 
53
-            }
44
+                    $actions[] = sprintf(
45
+                        '<a href="%s" class="btn btn-sm btn-secondary text-white m-1 d-inline-block invoice-action-edit">%s</a>',
46
+                        esc_url( get_edit_post_link( $invoice->get_id() ) ),
47
+                        sprintf(
48
+                            __( 'Edit %s', 'invoicing' ),
49
+                            esc_html( ucfirst( $invoice->get_invoice_quote_type() ) )
50
+                        )
51
+                    );
54 52
 
55
-            $actions = apply_filters( 'getpaid_invoice_header_right_actions_array', $actions, $invoice );
56
-            echo wp_kses_post( implode( '', $actions ) );
53
+                }
57 54
 
58
-        ?>
55
+                $actions = apply_filters( 'getpaid_invoice_header_right_actions_array', $actions, $invoice );
56
+                echo wp_kses_post( implode( '', $actions ) );
59 57
 
58
+            ?>
59
+    
60 60
         <?php do_action( 'wpinv_invoice_display_right_actions', $invoice ); ?>
61
-    </div>
61
+        </div>
62 62
 
63
-<?php
63
+    <?php
Please login to merge, or discard this patch.