@@ -103,7 +103,10 @@ discard block  | 
                                                    ||
| 103 | 103 | <?php } ?>  | 
                                                        
| 104 | 104 | |
| 105 | 105 |          <?php if ( $use_taxes && !wpinv_prices_include_tax() ) { ?> | 
                                                        
| 106 | - <tr class="wpinv_cart_footer_row wpinv_cart_subtotal_row"<?php if ( !wpinv_is_cart_taxed() ) echo ' style="display:none;"'; ?>>  | 
                                                        |
| 106 | +            <tr class="wpinv_cart_footer_row wpinv_cart_subtotal_row"<?php if ( !wpinv_is_cart_taxed() ) { | 
                                                        |
| 107 | + echo ' style="display:none;"';  | 
                                                        |
| 108 | +}  | 
                                                        |
| 109 | +?>>  | 
                                                        |
| 107 | 110 | <?php do_action( 'wpinv_checkout_table_subtotal_first', $cart_items ); ?>  | 
                                                        
| 108 | 111 | <td colspan="<?php echo ( $cart_columns - 1 ); ?>" class="wpinv_cart_subtotal_label text-right">  | 
                                                        
| 109 | 112 | <strong><?php _e( 'Sub-Total', 'invoicing' ); ?>:</strong>  | 
                                                        
@@ -118,7 +121,10 @@ discard block  | 
                                                    ||
| 118 | 121 | <?php $wpi_cart_columns = $cart_columns - 1; wpinv_cart_discounts_html( $cart_items ); ?>  | 
                                                        
| 119 | 122 | |
| 120 | 123 |          <?php if ( $use_taxes ) { ?> | 
                                                        
| 121 | - <tr class="wpinv_cart_footer_row wpinv_cart_tax_row"<?php if( !wpinv_is_cart_taxed() ) echo ' style="display:none;"'; ?>>  | 
                                                        |
| 124 | +            <tr class="wpinv_cart_footer_row wpinv_cart_tax_row"<?php if( !wpinv_is_cart_taxed() ) { | 
                                                        |
| 125 | + echo ' style="display:none;"';  | 
                                                        |
| 126 | +}  | 
                                                        |
| 127 | +?>>  | 
                                                        |
| 122 | 128 | <?php do_action( 'wpinv_checkout_table_tax_first' ); ?>  | 
                                                        
| 123 | 129 | <td colspan="<?php echo ( $cart_columns - 1 ); ?>" class="wpinv_cart_tax_label text-right">  | 
                                                        
| 124 | 130 | <strong><?php echo $tax_label; ?>:</strong>  | 
                                                        
@@ -6,138 +6,138 @@  | 
                                                    ||
| 6 | 6 | global $wpinv_euvat, $post, $ajax_cart_details, $wpi_cart_columns;  | 
                                                        
| 7 | 7 | $invoice = wpinv_get_invoice_cart();  | 
                                                        
| 8 | 8 | $currency = $invoice->get_currency();  | 
                                                        
| 9 | -$cart_items = !empty( $ajax_cart_details ) ? $ajax_cart_details : wpinv_get_cart_content_details();  | 
                                                        |
| 9 | +$cart_items = !empty($ajax_cart_details) ? $ajax_cart_details : wpinv_get_cart_content_details();  | 
                                                        |
| 10 | 10 | $quantities_enabled = wpinv_item_quantities_enabled();  | 
                                                        
| 11 | 11 | $use_taxes = wpinv_use_taxes();  | 
                                                        
| 12 | 12 | $tax_label = $wpinv_euvat->tax_label();  | 
                                                        
| 13 | -$tax_title = $use_taxes ? ( wpinv_prices_include_tax() ? wp_sprintf( __( '(%s Incl.)', 'invoicing' ), $tax_label ) : wp_sprintf( __( '(%s Excl.)', 'invoicing' ), $tax_label ) ) : '';  | 
                                                        |
| 13 | +$tax_title          = $use_taxes ? (wpinv_prices_include_tax() ? wp_sprintf(__('(%s Incl.)', 'invoicing'), $tax_label) : wp_sprintf(__('(%s Excl.)', 'invoicing'), $tax_label)) : ''; | 
                                                        |
| 14 | 14 | ?>  | 
                                                        
| 15 | 15 | <table id="wpinv_checkout_cart" class="table table-bordered table-hover">  | 
                                                        
| 16 | 16 | <thead>  | 
                                                        
| 17 | 17 | <tr class="wpinv_cart_header_row">  | 
                                                        
| 18 | - <?php do_action( 'wpinv_checkout_table_header_first' ); ?>  | 
                                                        |
| 19 | - <th class="wpinv_cart_item_name text-left"><?php _e( 'Item Name', 'invoicing' ); ?></th>  | 
                                                        |
| 20 | - <th class="wpinv_cart_item_price text-right"><?php _e( 'Item Price', 'invoicing' ); ?></th>  | 
                                                        |
| 21 | -            <?php if ( $quantities_enabled ) { ?> | 
                                                        |
| 22 | - <th class="wpinv_cart_item_qty text-right"><?php _e( 'Qty', 'invoicing' ); ?></th>  | 
                                                        |
| 18 | +            <?php do_action('wpinv_checkout_table_header_first'); ?> | 
                                                        |
| 19 | +            <th class="wpinv_cart_item_name text-left"><?php _e('Item Name', 'invoicing'); ?></th> | 
                                                        |
| 20 | +            <th class="wpinv_cart_item_price text-right"><?php _e('Item Price', 'invoicing'); ?></th> | 
                                                        |
| 21 | +            <?php if ($quantities_enabled) { ?> | 
                                                        |
| 22 | +            <th class="wpinv_cart_item_qty text-right"><?php _e('Qty', 'invoicing'); ?></th> | 
                                                        |
| 23 | 23 | <?php } ?>  | 
                                                        
| 24 | -            <?php if ( $use_taxes ) { ?> | 
                                                        |
| 24 | +            <?php if ($use_taxes) { ?> | 
                                                        |
| 25 | 25 | <th class="wpinv_cart_item_tax text-right"><?php echo $tax_label . ' <span class="normal small">(%)</span>'; ?></th>  | 
                                                        
| 26 | 26 | <?php } ?>  | 
                                                        
| 27 | - <th class="wpinv_cart_item_subtotal text-right"><?php echo __( 'Item Total', 'invoicing' ) . ' <span class="normal small">' . $tax_title . '<span>'; ?></th>  | 
                                                        |
| 28 | - <?php do_action( 'wpinv_checkout_table_header_last' ); ?>  | 
                                                        |
| 27 | +            <th class="wpinv_cart_item_subtotal text-right"><?php echo __('Item Total', 'invoicing') . ' <span class="normal small">' . $tax_title . '<span>'; ?></th> | 
                                                        |
| 28 | +            <?php do_action('wpinv_checkout_table_header_last'); ?> | 
                                                        |
| 29 | 29 | </tr>  | 
                                                        
| 30 | 30 | </thead>  | 
                                                        
| 31 | 31 | <tbody>  | 
                                                        
| 32 | 32 | <?php  | 
                                                        
| 33 | - do_action( 'wpinv_cart_items_before' );  | 
                                                        |
| 33 | +            do_action('wpinv_cart_items_before'); | 
                                                        |
| 34 | 34 | |
| 35 | -            if ( $cart_items ) { | 
                                                        |
| 36 | -                foreach ( $cart_items as $key => $item ) { | 
                                                        |
| 37 | - $wpi_item = !empty( $item['id'] ) ? new WPInv_Item( $item['id'] ) : NULL;  | 
                                                        |
| 35 | +            if ($cart_items) { | 
                                                        |
| 36 | +                foreach ($cart_items as $key => $item) { | 
                                                        |
| 37 | + $wpi_item = !empty($item['id']) ? new WPInv_Item($item['id']) : NULL;  | 
                                                        |
| 38 | 38 | ?>  | 
                                                        
| 39 | - <tr class="wpinv_cart_item" id="wpinv_cart_item_<?php echo esc_attr( $key ) . '_' . esc_attr( $item['id'] ); ?>" data-item-id="<?php echo esc_attr( $item['id'] ); ?>">  | 
                                                        |
| 40 | - <?php do_action( 'wpinv_checkout_table_body_first', $item ); ?>  | 
                                                        |
| 39 | + <tr class="wpinv_cart_item" id="wpinv_cart_item_<?php echo esc_attr($key) . '_' . esc_attr($item['id']); ?>" data-item-id="<?php echo esc_attr($item['id']); ?>">  | 
                                                        |
| 40 | +                    <?php do_action('wpinv_checkout_table_body_first', $item); ?> | 
                                                        |
| 41 | 41 | <td class="wpinv_cart_item_name text-left">  | 
                                                        
| 42 | 42 | <?php  | 
                                                        
| 43 | -                            if ( current_theme_supports( 'post-thumbnails' ) && has_post_thumbnail( $item['id'] ) ) { | 
                                                        |
| 43 | +                            if (current_theme_supports('post-thumbnails') && has_post_thumbnail($item['id'])) { | 
                                                        |
| 44 | 44 | echo '<div class="wpinv_cart_item_image">';  | 
                                                        
| 45 | - echo get_the_post_thumbnail( $item['id'], apply_filters( 'wpinv_checkout_image_size', array( 25,25 ) ) );  | 
                                                        |
| 45 | +                                    echo get_the_post_thumbnail($item['id'], apply_filters('wpinv_checkout_image_size', array(25, 25))); | 
                                                        |
| 46 | 46 | echo '</div>';  | 
                                                        
| 47 | 47 | }  | 
                                                        
| 48 | - $item_title = esc_html( wpinv_get_cart_item_name( $item ) ) . wpinv_get_item_suffix( $wpi_item );  | 
                                                        |
| 48 | + $item_title = esc_html(wpinv_get_cart_item_name($item)) . wpinv_get_item_suffix($wpi_item);  | 
                                                        |
| 49 | 49 | echo '<span class="wpinv_checkout_cart_item_title">' . $item_title . '</span>';  | 
                                                        
| 50 | - $summary = apply_filters( 'wpinv_checkout_cart_line_item_summary', '', $item, $wpi_item, $invoice );  | 
                                                        |
| 51 | -                            if ( !empty( $summary ) ) { | 
                                                        |
| 50 | +                            $summary = apply_filters('wpinv_checkout_cart_line_item_summary', '', $item, $wpi_item, $invoice); | 
                                                        |
| 51 | +                            if (!empty($summary)) { | 
                                                        |
| 52 | 52 | echo $summary;  | 
                                                        
| 53 | 53 | }  | 
                                                        
| 54 | 54 | ?>  | 
                                                        
| 55 | 55 | </td>  | 
                                                        
| 56 | 56 | <td class="wpinv_cart_item_price text-right">  | 
                                                        
| 57 | 57 | <?php  | 
                                                        
| 58 | - echo wpinv_cart_item_price( $item, $currency );  | 
                                                        |
| 59 | - do_action( 'wpinv_checkout_cart_item_price_after', $item, $key );  | 
                                                        |
| 58 | + echo wpinv_cart_item_price($item, $currency);  | 
                                                        |
| 59 | +                        do_action('wpinv_checkout_cart_item_price_after', $item, $key); | 
                                                        |
| 60 | 60 | ?>  | 
                                                        
| 61 | 61 | </td>  | 
                                                        
| 62 | -                    <?php if ( $quantities_enabled ) { ?> | 
                                                        |
| 62 | +                    <?php if ($quantities_enabled) { ?> | 
                                                        |
| 63 | 63 | <td class="wpinv_cart_item_qty text-right">  | 
                                                        
| 64 | 64 | <?php  | 
                                                        
| 65 | - echo wpinv_get_cart_item_quantity( $item );  | 
                                                        |
| 66 | - do_action( 'wpinv_cart_item_quantitiy', $item, $key );  | 
                                                        |
| 65 | + echo wpinv_get_cart_item_quantity($item);  | 
                                                        |
| 66 | +                        do_action('wpinv_cart_item_quantitiy', $item, $key); | 
                                                        |
| 67 | 67 | ?>  | 
                                                        
| 68 | 68 | </td>  | 
                                                        
| 69 | 69 | <?php } ?>  | 
                                                        
| 70 | -                    <?php if ( $use_taxes ) { ?> | 
                                                        |
| 70 | +                    <?php if ($use_taxes) { ?> | 
                                                        |
| 71 | 71 | <td class="wpinv_cart_item_tax text-right">  | 
                                                        
| 72 | 72 | <?php  | 
                                                        
| 73 | - echo wpinv_cart_item_tax( $item, $currency );  | 
                                                        |
| 73 | + echo wpinv_cart_item_tax($item, $currency);  | 
                                                        |
| 74 | 74 | //echo wpinv_get_cart_item_tax( $wpi_item->ID, $subtotal = '', $options = array() );  | 
                                                        
| 75 | - do_action( 'wpinv_cart_item_tax', $item, $key );  | 
                                                        |
| 75 | +                        do_action('wpinv_cart_item_tax', $item, $key); | 
                                                        |
| 76 | 76 | ?>  | 
                                                        
| 77 | 77 | </td>  | 
                                                        
| 78 | 78 | <?php } ?>  | 
                                                        
| 79 | 79 | <td class="wpinv_cart_item_subtotal text-right">  | 
                                                        
| 80 | 80 | <?php  | 
                                                        
| 81 | - echo wpinv_cart_item_subtotal( $item, $currency );  | 
                                                        |
| 82 | - do_action( 'wpinv_cart_item_subtotal', $item, $key );  | 
                                                        |
| 81 | + echo wpinv_cart_item_subtotal($item, $currency);  | 
                                                        |
| 82 | +                        do_action('wpinv_cart_item_subtotal', $item, $key); | 
                                                        |
| 83 | 83 | ?>  | 
                                                        
| 84 | 84 | </td>  | 
                                                        
| 85 | - <?php do_action( 'wpinv_checkout_table_body_last', $item, $key ); ?>  | 
                                                        |
| 85 | +                    <?php do_action('wpinv_checkout_table_body_last', $item, $key); ?> | 
                                                        |
| 86 | 86 | </tr>  | 
                                                        
| 87 | 87 | <?php } ?>  | 
                                                        
| 88 | 88 | <?php } ?>  | 
                                                        
| 89 | - <?php do_action( 'wpinv_cart_items_middle' ); ?>  | 
                                                        |
| 90 | - <?php do_action( 'wpinv_cart_items_after' ); ?>  | 
                                                        |
| 89 | +        <?php do_action('wpinv_cart_items_middle'); ?> | 
                                                        |
| 90 | +        <?php do_action('wpinv_cart_items_after'); ?> | 
                                                        |
| 91 | 91 | </tbody>  | 
                                                        
| 92 | 92 | <tfoot>  | 
                                                        
| 93 | 93 | <?php $cart_columns = wpinv_checkout_cart_columns(); ?>  | 
                                                        
| 94 | -        <?php if ( has_action( 'wpinv_cart_footer_buttons' ) ) { ?> | 
                                                        |
| 94 | +        <?php if (has_action('wpinv_cart_footer_buttons')) { ?> | 
                                                        |
| 95 | 95 | <tr class="wpinv_cart_footer_row">  | 
                                                        
| 96 | - <?php do_action( 'wpinv_checkout_table_buttons_first', $cart_items ); ?>  | 
                                                        |
| 97 | - <td colspan="<?php echo ( $cart_columns ); ?>">  | 
                                                        |
| 98 | - <?php do_action( 'wpinv_cart_footer_buttons' ); ?>  | 
                                                        |
| 96 | +                <?php do_action('wpinv_checkout_table_buttons_first', $cart_items); ?> | 
                                                        |
| 97 | + <td colspan="<?php echo ($cart_columns); ?>">  | 
                                                        |
| 98 | +                    <?php do_action('wpinv_cart_footer_buttons'); ?> | 
                                                        |
| 99 | 99 | </td>  | 
                                                        
| 100 | - <?php do_action( 'wpinv_checkout_table_buttons_first', $cart_items ); ?>  | 
                                                        |
| 100 | +                <?php do_action('wpinv_checkout_table_buttons_first', $cart_items); ?> | 
                                                        |
| 101 | 101 | </tr>  | 
                                                        
| 102 | 102 | <?php } ?>  | 
                                                        
| 103 | 103 | |
| 104 | -        <?php if ( $use_taxes && !wpinv_prices_include_tax() ) { ?> | 
                                                        |
| 105 | - <tr class="wpinv_cart_footer_row wpinv_cart_subtotal_row"<?php if ( !wpinv_is_cart_taxed() ) echo ' style="display:none;"'; ?>>  | 
                                                        |
| 106 | - <?php do_action( 'wpinv_checkout_table_subtotal_first', $cart_items ); ?>  | 
                                                        |
| 107 | - <td colspan="<?php echo ( $cart_columns - 1 ); ?>" class="wpinv_cart_subtotal_label text-right">  | 
                                                        |
| 108 | - <strong><?php _e( 'Sub-Total', 'invoicing' ); ?>:</strong>  | 
                                                        |
| 104 | +        <?php if ($use_taxes && !wpinv_prices_include_tax()) { ?> | 
                                                        |
| 105 | + <tr class="wpinv_cart_footer_row wpinv_cart_subtotal_row"<?php if (!wpinv_is_cart_taxed()) echo ' style="display:none;"'; ?>>  | 
                                                        |
| 106 | +                <?php do_action('wpinv_checkout_table_subtotal_first', $cart_items); ?> | 
                                                        |
| 107 | + <td colspan="<?php echo ($cart_columns - 1); ?>" class="wpinv_cart_subtotal_label text-right">  | 
                                                        |
| 108 | +                    <strong><?php _e('Sub-Total', 'invoicing'); ?>:</strong> | 
                                                        |
| 109 | 109 | </td>  | 
                                                        
| 110 | 110 | <td class="wpinv_cart_subtotal text-right">  | 
                                                        
| 111 | - <span class="wpinv_cart_subtotal_amount bold"><?php echo wpinv_cart_subtotal( $cart_items, $currency ); ?></span>  | 
                                                        |
| 111 | + <span class="wpinv_cart_subtotal_amount bold"><?php echo wpinv_cart_subtotal($cart_items, $currency); ?></span>  | 
                                                        |
| 112 | 112 | </td>  | 
                                                        
| 113 | - <?php do_action( 'wpinv_checkout_table_subtotal_last', $cart_items ); ?>  | 
                                                        |
| 113 | +                <?php do_action('wpinv_checkout_table_subtotal_last', $cart_items); ?> | 
                                                        |
| 114 | 114 | </tr>  | 
                                                        
| 115 | 115 | <?php } ?>  | 
                                                        
| 116 | 116 | |
| 117 | - <?php $wpi_cart_columns = $cart_columns - 1; wpinv_cart_discounts_html( $cart_items ); ?>  | 
                                                        |
| 117 | + <?php $wpi_cart_columns = $cart_columns - 1; wpinv_cart_discounts_html($cart_items); ?>  | 
                                                        |
| 118 | 118 | |
| 119 | -        <?php if ( $use_taxes ) { ?> | 
                                                        |
| 120 | - <tr class="wpinv_cart_footer_row wpinv_cart_tax_row"<?php if( !wpinv_is_cart_taxed() ) echo ' style="display:none;"'; ?>>  | 
                                                        |
| 121 | - <?php do_action( 'wpinv_checkout_table_tax_first' ); ?>  | 
                                                        |
| 122 | - <td colspan="<?php echo ( $cart_columns - 1 ); ?>" class="wpinv_cart_tax_label text-right">  | 
                                                        |
| 119 | +        <?php if ($use_taxes) { ?> | 
                                                        |
| 120 | + <tr class="wpinv_cart_footer_row wpinv_cart_tax_row"<?php if (!wpinv_is_cart_taxed()) echo ' style="display:none;"'; ?>>  | 
                                                        |
| 121 | +                <?php do_action('wpinv_checkout_table_tax_first'); ?> | 
                                                        |
| 122 | + <td colspan="<?php echo ($cart_columns - 1); ?>" class="wpinv_cart_tax_label text-right">  | 
                                                        |
| 123 | 123 | <strong><?php echo $tax_label; ?>:</strong>  | 
                                                        
| 124 | 124 | </td>  | 
                                                        
| 125 | 125 | <td class="wpinv_cart_tax text-right">  | 
                                                        
| 126 | - <span class="wpinv_cart_tax_amount" data-tax="<?php echo wpinv_get_cart_tax( $cart_items ); ?>"><?php echo esc_html( wpinv_cart_tax( $cart_items, false, $currency ) ); ?></span>  | 
                                                        |
| 126 | + <span class="wpinv_cart_tax_amount" data-tax="<?php echo wpinv_get_cart_tax($cart_items); ?>"><?php echo esc_html(wpinv_cart_tax($cart_items, false, $currency)); ?></span>  | 
                                                        |
| 127 | 127 | </td>  | 
                                                        
| 128 | - <?php do_action( 'wpinv_checkout_table_tax_last' ); ?>  | 
                                                        |
| 128 | +                <?php do_action('wpinv_checkout_table_tax_last'); ?> | 
                                                        |
| 129 | 129 | </tr>  | 
                                                        
| 130 | 130 | <?php } ?>  | 
                                                        
| 131 | 131 | |
| 132 | 132 | <tr class="wpinv_cart_footer_row wpinv_cart_total_row">  | 
                                                        
| 133 | - <?php do_action( 'wpinv_checkout_table_footer_first' ); ?>  | 
                                                        |
| 134 | - <td colspan="<?php echo ( $cart_columns - 1 ); ?>" class="wpinv_cart_total_label text-right">  | 
                                                        |
| 135 | - <?php echo apply_filters( 'wpinv_cart_total_label', '<strong>' . __( 'Total', 'invoicing' ) . ':</strong>', $invoice ); ?>  | 
                                                        |
| 133 | +            <?php do_action('wpinv_checkout_table_footer_first'); ?> | 
                                                        |
| 134 | + <td colspan="<?php echo ($cart_columns - 1); ?>" class="wpinv_cart_total_label text-right">  | 
                                                        |
| 135 | +                <?php echo apply_filters('wpinv_cart_total_label', '<strong>' . __('Total', 'invoicing') . ':</strong>', $invoice); ?> | 
                                                        |
| 136 | 136 | </td>  | 
                                                        
| 137 | 137 | <td class="wpinv_cart_total text-right">  | 
                                                        
| 138 | - <span class="wpinv_cart_amount bold" data-subtotal="<?php echo wpinv_get_cart_total( $cart_items ); ?>" data-total="<?php echo wpinv_get_cart_total( NULL, NULL, $invoice ); ?>"><?php wpinv_cart_total( $cart_items, true, $invoice ); ?></span>  | 
                                                        |
| 138 | + <span class="wpinv_cart_amount bold" data-subtotal="<?php echo wpinv_get_cart_total($cart_items); ?>" data-total="<?php echo wpinv_get_cart_total(NULL, NULL, $invoice); ?>"><?php wpinv_cart_total($cart_items, true, $invoice); ?></span>  | 
                                                        |
| 139 | 139 | </td>  | 
                                                        
| 140 | - <?php do_action( 'wpinv_checkout_table_footer_last' ); ?>  | 
                                                        |
| 140 | +            <?php do_action('wpinv_checkout_table_footer_last'); ?> | 
                                                        |
| 141 | 141 | </tr>  | 
                                                        
| 142 | 142 | </tfoot>  | 
                                                        
| 143 | 143 | </table>  | 
                                                        
@@ -1,10 +1,10 @@  | 
                                                    ||
| 1 | 1 | <?php  | 
                                                        
| 2 | 2 | // don't load directly  | 
                                                        
| 3 | -if ( !defined('ABSPATH') ) | 
                                                        |
| 3 | +if (!defined('ABSPATH')) | 
                                                        |
| 4 | 4 |      die('-1'); | 
                                                        
| 5 | 5 | |
| 6 | -$email_footer = apply_filters( 'wpinv_email_footer_text', wpinv_get_option( 'email_footer_text' ) );  | 
                                                        |
| 7 | -$email_footer = $email_footer ? wpautop( wp_kses_post( wptexturize( $email_footer ) ) ) : '';  | 
                                                        |
| 6 | +$email_footer = apply_filters('wpinv_email_footer_text', wpinv_get_option('email_footer_text')); | 
                                                        |
| 7 | +$email_footer = $email_footer ? wpautop(wp_kses_post(wptexturize($email_footer))) : '';  | 
                                                        |
| 8 | 8 | ?>  | 
                                                        
| 9 | 9 | </div>  | 
                                                        
| 10 | 10 | </td>  | 
                                                        
@@ -1,7 +1,8 @@  | 
                                                    ||
| 1 | 1 | <?php  | 
                                                        
| 2 | 2 | // don't load directly  | 
                                                        
| 3 | -if ( !defined('ABSPATH') ) | 
                                                        |
| 3 | +if ( !defined('ABSPATH') ) { | 
                                                        |
| 4 | 4 |      die('-1'); | 
                                                        
| 5 | +}  | 
                                                        |
| 5 | 6 | |
| 6 | 7 | $email_footer = apply_filters( 'wpinv_email_footer_text', wpinv_get_option( 'email_footer_text' ) );  | 
                                                        
| 7 | 8 | $email_footer = $email_footer ? wpautop( wp_kses_post( wptexturize( $email_footer ) ) ) : '';  | 
                                                        
@@ -1,16 +1,16 @@ discard block  | 
                                                    ||
| 1 | 1 | <?php  | 
                                                        
| 2 | 2 | // don't load directly  | 
                                                        
| 3 | -if ( !defined('ABSPATH') ) | 
                                                        |
| 3 | +if (!defined('ABSPATH')) | 
                                                        |
| 4 | 4 |      die('-1'); | 
                                                        
| 5 | 5 | |
| 6 | -if ( !isset( $email_heading ) ) { | 
                                                        |
| 6 | +if (!isset($email_heading)) { | 
                                                        |
| 7 | 7 | global $email_heading;  | 
                                                        
| 8 | 8 | }  | 
                                                        
| 9 | 9 | ?>  | 
                                                        
| 10 | 10 | <!DOCTYPE html>  | 
                                                        
| 11 | 11 | <html dir="<?php echo is_rtl() ? 'rtl' : 'ltr'?>">  | 
                                                        
| 12 | 12 | <head>  | 
                                                        
| 13 | - <meta http-equiv="Content-Type" content="text/html; charset=<?php bloginfo( 'charset' ); ?>" />  | 
                                                        |
| 13 | +        <meta http-equiv="Content-Type" content="text/html; charset=<?php bloginfo('charset'); ?>" /> | 
                                                        |
| 14 | 14 | <meta name="viewport" content="width=device-width, initial-scale=1">  | 
                                                        
| 15 | 15 | <meta name="robots" content="noindex,nofollow">  | 
                                                        
| 16 | 16 | <title><?php echo wpinv_get_blogname(); ?></title>  | 
                                                        
@@ -22,13 +22,13 @@ discard block  | 
                                                    ||
| 22 | 22 | <td align="center" valign="top">  | 
                                                        
| 23 | 23 | <div id="template_header_image">  | 
                                                        
| 24 | 24 | <?php  | 
                                                        
| 25 | -                            if ( $img = wpinv_get_option( 'email_header_image' ) ) { | 
                                                        |
| 26 | - echo '<p style="margin-top:0;"><img style="max-width:100%" src="' . esc_url( $img ) . '" alt="' . esc_attr( wpinv_get_blogname() ) . '" /></p>';  | 
                                                        |
| 25 | +                            if ($img = wpinv_get_option('email_header_image')) { | 
                                                        |
| 26 | + echo '<p style="margin-top:0;"><img style="max-width:100%" src="' . esc_url($img) . '" alt="' . esc_attr(wpinv_get_blogname()) . '" /></p>';  | 
                                                        |
| 27 | 27 | }  | 
                                                        
| 28 | 28 | ?>  | 
                                                        
| 29 | 29 | </div>  | 
                                                        
| 30 | 30 | <table border="0" cellpadding="0" cellspacing="0" width="100%" id="template_container">  | 
                                                        
| 31 | -                            <?php if ( !empty( $email_heading ) ) { ?> | 
                                                        |
| 31 | +                            <?php if (!empty($email_heading)) { ?> | 
                                                        |
| 32 | 32 | <tr>  | 
                                                        
| 33 | 33 | <td align="center" valign="top">  | 
                                                        
| 34 | 34 | <!-- Header -->  | 
                                                        
@@ -1,7 +1,8 @@  | 
                                                    ||
| 1 | 1 | <?php  | 
                                                        
| 2 | 2 | // don't load directly  | 
                                                        
| 3 | -if ( !defined('ABSPATH') ) | 
                                                        |
| 3 | +if ( !defined('ABSPATH') ) { | 
                                                        |
| 4 | 4 |      die('-1'); | 
                                                        
| 5 | +}  | 
                                                        |
| 5 | 6 | |
| 6 | 7 |  if ( !isset( $email_heading ) ) { | 
                                                        
| 7 | 8 | global $email_heading;  | 
                                                        
@@ -1,7 +1,8 @@  | 
                                                    ||
| 1 | 1 | <?php  | 
                                                        
| 2 | 2 | // don't load directly  | 
                                                        
| 3 | -if ( !defined('ABSPATH') ) | 
                                                        |
| 3 | +if ( !defined('ABSPATH') ) { | 
                                                        |
| 4 | 4 |      die('-1'); | 
                                                        
| 5 | +}  | 
                                                        |
| 5 | 6 | |
| 6 | 7 | do_action( 'wpinv_email_header', $email_heading, $invoice, $email_type, $sent_to_admin );  | 
                                                        
| 7 | 8 | |
@@ -1,18 +1,18 @@  | 
                                                    ||
| 1 | 1 | <?php  | 
                                                        
| 2 | 2 | // don't load directly  | 
                                                        
| 3 | -if ( !defined('ABSPATH') ) | 
                                                        |
| 3 | +if (!defined('ABSPATH')) | 
                                                        |
| 4 | 4 |      die('-1'); | 
                                                        
| 5 | 5 | |
| 6 | -do_action( 'wpinv_email_header', $email_heading, $invoice, $email_type, $sent_to_admin );  | 
                                                        |
| 6 | +do_action('wpinv_email_header', $email_heading, $invoice, $email_type, $sent_to_admin); | 
                                                        |
| 7 | 7 | |
| 8 | -if ( ! empty( $message_body ) ) { | 
                                                        |
| 9 | - echo wpautop( wptexturize( $message_body ) );  | 
                                                        |
| 8 | +if (!empty($message_body)) { | 
                                                        |
| 9 | + echo wpautop(wptexturize($message_body));  | 
                                                        |
| 10 | 10 | }  | 
                                                        
| 11 | 11 | |
| 12 | -do_action( 'wpinv_email_invoice_details', $invoice, $email_type, $sent_to_admin );  | 
                                                        |
| 12 | +do_action('wpinv_email_invoice_details', $invoice, $email_type, $sent_to_admin); | 
                                                        |
| 13 | 13 | |
| 14 | -do_action( 'wpinv_email_invoice_items', $invoice, $email_type, $sent_to_admin );  | 
                                                        |
| 14 | +do_action('wpinv_email_invoice_items', $invoice, $email_type, $sent_to_admin); | 
                                                        |
| 15 | 15 | |
| 16 | -do_action( 'wpinv_email_billing_details', $invoice, $email_type, $sent_to_admin );  | 
                                                        |
| 16 | +do_action('wpinv_email_billing_details', $invoice, $email_type, $sent_to_admin); | 
                                                        |
| 17 | 17 | |
| 18 | -do_action( 'wpinv_email_footer', $invoice, $email_type, $sent_to_admin );  | 
                                                        |
| 19 | 18 | \ No newline at end of file  | 
                                                        
| 19 | +do_action('wpinv_email_footer', $invoice, $email_type, $sent_to_admin); | 
                                                        |
| 20 | 20 | \ No newline at end of file  | 
                                                        
@@ -1,7 +1,8 @@  | 
                                                    ||
| 1 | 1 | <?php  | 
                                                        
| 2 | 2 | // don't load directly  | 
                                                        
| 3 | -if ( !defined('ABSPATH') ) | 
                                                        |
| 3 | +if ( !defined('ABSPATH') ) { | 
                                                        |
| 4 | 4 |      die('-1'); | 
                                                        
| 5 | +}  | 
                                                        |
| 5 | 6 | |
| 6 | 7 | // Load colours  | 
                                                        
| 7 | 8 | $bg = wpinv_get_option( 'email_background_color', '#f5f5f5' );  | 
                                                        
@@ -1,25 +1,25 @@ discard block  | 
                                                    ||
| 1 | 1 | <?php  | 
                                                        
| 2 | 2 | // don't load directly  | 
                                                        
| 3 | -if ( !defined('ABSPATH') ) | 
                                                        |
| 3 | +if (!defined('ABSPATH')) | 
                                                        |
| 4 | 4 |      die('-1'); | 
                                                        
| 5 | 5 | |
| 6 | 6 | // Load colours  | 
                                                        
| 7 | -$bg = wpinv_get_option( 'email_background_color', '#f5f5f5' );  | 
                                                        |
| 8 | -$body = wpinv_get_option( 'email_body_background_color', '#fdfdfd' );  | 
                                                        |
| 9 | -$base = wpinv_get_option( 'email_base_color', '#557da2' );  | 
                                                        |
| 10 | -$base_text = wpinv_light_or_dark( $base, '#202020', '#ffffff' );  | 
                                                        |
| 11 | -$text = wpinv_get_option( 'email_text_color', '#505050' );  | 
                                                        |
| 7 | +$bg              = wpinv_get_option('email_background_color', '#f5f5f5'); | 
                                                        |
| 8 | +$body            = wpinv_get_option('email_body_background_color', '#fdfdfd'); | 
                                                        |
| 9 | +$base            = wpinv_get_option('email_base_color', '#557da2'); | 
                                                        |
| 10 | +$base_text = wpinv_light_or_dark($base, '#202020', '#ffffff');  | 
                                                        |
| 11 | +$text            = wpinv_get_option('email_text_color', '#505050'); | 
                                                        |
| 12 | 12 | |
| 13 | -$bg_darker_10 = wpinv_hex_darker( $bg, 10 );  | 
                                                        |
| 14 | -$body_darker_10 = wpinv_hex_darker( $body, 10 );  | 
                                                        |
| 15 | -$base_lighter_20 = wpinv_hex_lighter( $base, 20 );  | 
                                                        |
| 16 | -$base_lighter_40 = wpinv_hex_lighter( $base, 40 );  | 
                                                        |
| 17 | -$text_lighter_20 = wpinv_hex_lighter( $text, 20 );  | 
                                                        |
| 13 | +$bg_darker_10 = wpinv_hex_darker($bg, 10);  | 
                                                        |
| 14 | +$body_darker_10 = wpinv_hex_darker($body, 10);  | 
                                                        |
| 15 | +$base_lighter_20 = wpinv_hex_lighter($base, 20);  | 
                                                        |
| 16 | +$base_lighter_40 = wpinv_hex_lighter($base, 40);  | 
                                                        |
| 17 | +$text_lighter_20 = wpinv_hex_lighter($text, 20);  | 
                                                        |
| 18 | 18 | |
| 19 | 19 | // !important; is a gmail hack to prevent styles being stripped if it doesn't like something.  | 
                                                        
| 20 | 20 | ?>  | 
                                                        
| 21 | 21 |  #wrapper { | 
                                                        
| 22 | - background-color: <?php echo esc_attr( $bg ); ?>;  | 
                                                        |
| 22 | + background-color: <?php echo esc_attr($bg); ?>;  | 
                                                        |
| 23 | 23 | margin: 0;  | 
                                                        
| 24 | 24 | -webkit-text-size-adjust: none !important;  | 
                                                        
| 25 | 25 | padding: 3%;  | 
                                                        
@@ -40,15 +40,15 @@ discard block  | 
                                                    ||
| 40 | 40 | |
| 41 | 41 |  #template_container { | 
                                                        
| 42 | 42 | box-shadow: 0 1px 4px rgba(0,0,0,0.1) !important;  | 
                                                        
| 43 | - background-color: <?php echo esc_attr( $body ); ?>;  | 
                                                        |
| 44 | - border: 1px solid <?php echo esc_attr( $bg_darker_10 ); ?>;  | 
                                                        |
| 43 | + background-color: <?php echo esc_attr($body); ?>;  | 
                                                        |
| 44 | + border: 1px solid <?php echo esc_attr($bg_darker_10); ?>;  | 
                                                        |
| 45 | 45 | border-radius: 3px !important;  | 
                                                        
| 46 | 46 | }  | 
                                                        
| 47 | 47 | |
| 48 | 48 |  #template_header { | 
                                                        
| 49 | - background-color: <?php echo esc_attr( $base ); ?>;  | 
                                                        |
| 49 | + background-color: <?php echo esc_attr($base); ?>;  | 
                                                        |
| 50 | 50 | border-radius: 3px 3px 0 0 !important;  | 
                                                        
| 51 | - color: <?php echo esc_attr( $base_text ); ?>;  | 
                                                        |
| 51 | + color: <?php echo esc_attr($base_text); ?>;  | 
                                                        |
| 52 | 52 | border-bottom: 0;  | 
                                                        
| 53 | 53 | font-weight: bold;  | 
                                                        
| 54 | 54 | line-height: 100%;  | 
                                                        
@@ -61,7 +61,7 @@ discard block  | 
                                                    ||
| 61 | 61 | }  | 
                                                        
| 62 | 62 | |
| 63 | 63 |  #template_header h1 { | 
                                                        
| 64 | - color: <?php echo esc_attr( $base_text ); ?>;  | 
                                                        |
| 64 | + color: <?php echo esc_attr($base_text); ?>;  | 
                                                        |
| 65 | 65 | }  | 
                                                        
| 66 | 66 | |
| 67 | 67 |  #template_footer td { | 
                                                        
@@ -72,7 +72,7 @@ discard block  | 
                                                    ||
| 72 | 72 | |
| 73 | 73 |  #template_footer #credit { | 
                                                        
| 74 | 74 | border:0;  | 
                                                        
| 75 | - color: <?php echo esc_attr( $base_lighter_40 ); ?>;  | 
                                                        |
| 75 | + color: <?php echo esc_attr($base_lighter_40); ?>;  | 
                                                        |
| 76 | 76 | font-family: Arial;  | 
                                                        
| 77 | 77 | font-size:12px;  | 
                                                        
| 78 | 78 | line-height:125%;  | 
                                                        
@@ -81,7 +81,7 @@ discard block  | 
                                                    ||
| 81 | 81 | }  | 
                                                        
| 82 | 82 | |
| 83 | 83 |  #body_content { | 
                                                        
| 84 | - background-color: <?php echo esc_attr( $body ); ?>;  | 
                                                        |
| 84 | + background-color: <?php echo esc_attr($body); ?>;  | 
                                                        |
| 85 | 85 | }  | 
                                                        
| 86 | 86 | |
| 87 | 87 |  #body_content table td { | 
                                                        
@@ -101,7 +101,7 @@ discard block  | 
                                                    ||
| 101 | 101 | }  | 
                                                        
| 102 | 102 | |
| 103 | 103 |  #body_content_inner { | 
                                                        
| 104 | - color: <?php echo esc_attr( $text_lighter_20 ); ?>;  | 
                                                        |
| 104 | + color: <?php echo esc_attr($text_lighter_20); ?>;  | 
                                                        |
| 105 | 105 | font-family: Arial,Helvetica,sans-serif;  | 
                                                        
| 106 | 106 | font-size: 14px;  | 
                                                        
| 107 | 107 | line-height: 150%;  | 
                                                        
@@ -109,17 +109,17 @@ discard block  | 
                                                    ||
| 109 | 109 | }  | 
                                                        
| 110 | 110 | |
| 111 | 111 |  .td { | 
                                                        
| 112 | - color: <?php echo esc_attr( $text_lighter_20 ); ?>;  | 
                                                        |
| 113 | - border: 1px solid <?php echo esc_attr( $body_darker_10 ); ?>;  | 
                                                        |
| 112 | + color: <?php echo esc_attr($text_lighter_20); ?>;  | 
                                                        |
| 113 | + border: 1px solid <?php echo esc_attr($body_darker_10); ?>;  | 
                                                        |
| 114 | 114 | }  | 
                                                        
| 115 | 115 | |
| 116 | 116 |  .text { | 
                                                        
| 117 | - color: <?php echo esc_attr( $text ); ?>;  | 
                                                        |
| 117 | + color: <?php echo esc_attr($text); ?>;  | 
                                                        |
| 118 | 118 | font-family: Arial,Helvetica,sans-serif;  | 
                                                        
| 119 | 119 | }  | 
                                                        
| 120 | 120 | |
| 121 | 121 |  .link { | 
                                                        
| 122 | - color: <?php echo esc_attr( $base ); ?>;  | 
                                                        |
| 122 | + color: <?php echo esc_attr($base); ?>;  | 
                                                        |
| 123 | 123 | }  | 
                                                        
| 124 | 124 | |
| 125 | 125 |  #header_wrapper { | 
                                                        
@@ -128,19 +128,19 @@ discard block  | 
                                                    ||
| 128 | 128 | }  | 
                                                        
| 129 | 129 | |
| 130 | 130 |  h1 { | 
                                                        
| 131 | - color: <?php echo esc_attr( $base ); ?>;  | 
                                                        |
| 131 | + color: <?php echo esc_attr($base); ?>;  | 
                                                        |
| 132 | 132 | font-family: Arial,Helvetica,sans-serif;  | 
                                                        
| 133 | 133 | font-size: 30px;  | 
                                                        
| 134 | 134 | font-weight: 300;  | 
                                                        
| 135 | 135 | line-height: 150%;  | 
                                                        
| 136 | 136 | margin: 0;  | 
                                                        
| 137 | 137 | text-align: <?php echo is_rtl() ? 'right' : 'left'; ?>;  | 
                                                        
| 138 | - text-shadow: 0 1px 0 <?php echo esc_attr( $base_lighter_20 ); ?>;  | 
                                                        |
| 138 | + text-shadow: 0 1px 0 <?php echo esc_attr($base_lighter_20); ?>;  | 
                                                        |
| 139 | 139 | -webkit-font-smoothing: antialiased;  | 
                                                        
| 140 | 140 | }  | 
                                                        
| 141 | 141 | |
| 142 | 142 |  h2 { | 
                                                        
| 143 | - color: <?php echo esc_attr( $base ); ?>;  | 
                                                        |
| 143 | + color: <?php echo esc_attr($base); ?>;  | 
                                                        |
| 144 | 144 | display: block;  | 
                                                        
| 145 | 145 | font-family: Arial,Helvetica,sans-serif;  | 
                                                        
| 146 | 146 | font-size: 18px;  | 
                                                        
@@ -151,7 +151,7 @@ discard block  | 
                                                    ||
| 151 | 151 | }  | 
                                                        
| 152 | 152 | |
| 153 | 153 |  h3 { | 
                                                        
| 154 | - color: <?php echo esc_attr( $base ); ?>;  | 
                                                        |
| 154 | + color: <?php echo esc_attr($base); ?>;  | 
                                                        |
| 155 | 155 | display: block;  | 
                                                        
| 156 | 156 | font-family: Arial,Helvetica,sans-serif;  | 
                                                        
| 157 | 157 | font-size: 16px;  | 
                                                        
@@ -162,7 +162,7 @@ discard block  | 
                                                    ||
| 162 | 162 | }  | 
                                                        
| 163 | 163 | |
| 164 | 164 |  a { | 
                                                        
| 165 | - color: <?php echo esc_attr( $base ); ?>;  | 
                                                        |
| 165 | + color: <?php echo esc_attr($base); ?>;  | 
                                                        |
| 166 | 166 | font-weight: normal;  | 
                                                        
| 167 | 167 | text-decoration: underline;  | 
                                                        
| 168 | 168 | }  | 
                                                        
@@ -180,7 +180,7 @@ discard block  | 
                                                    ||
| 180 | 180 | }  | 
                                                        
| 181 | 181 | |
| 182 | 182 |  .table-bordered { | 
                                                        
| 183 | - border: 1px solid <?php echo esc_attr( $body_darker_10 ); ?>;  | 
                                                        |
| 183 | + border: 1px solid <?php echo esc_attr($body_darker_10); ?>;  | 
                                                        |
| 184 | 184 | border-collapse: collapse;  | 
                                                        
| 185 | 185 | border-spacing: 0;  | 
                                                        
| 186 | 186 | width: 100%;  | 
                                                        
@@ -188,8 +188,8 @@ discard block  | 
                                                    ||
| 188 | 188 | |
| 189 | 189 | .table-bordered th,  | 
                                                        
| 190 | 190 |  .table-bordered td { | 
                                                        
| 191 | - border: 1px solid <?php echo esc_attr( $body_darker_10 ); ?>;  | 
                                                        |
| 192 | - color: <?php echo esc_attr( $text_lighter_20 ); ?>;  | 
                                                        |
| 191 | + border: 1px solid <?php echo esc_attr($body_darker_10); ?>;  | 
                                                        |
| 192 | + color: <?php echo esc_attr($text_lighter_20); ?>;  | 
                                                        |
| 193 | 193 | font-size: 14px;  | 
                                                        
| 194 | 194 | }  | 
                                                        
| 195 | 195 |  .small { | 
                                                        
@@ -288,9 +288,9 @@ discard block  | 
                                                    ||
| 288 | 288 | text-decoration: none;  | 
                                                        
| 289 | 289 | }  | 
                                                        
| 290 | 290 |  .btn-default { | 
                                                        
| 291 | - color: <?php echo esc_attr( $base_text ); ?>;  | 
                                                        |
| 292 | - background-color: <?php echo esc_attr( $base ); ?>;  | 
                                                        |
| 293 | - border-color: <?php echo esc_attr( $base ); ?>;  | 
                                                        |
| 291 | + color: <?php echo esc_attr($base_text); ?>;  | 
                                                        |
| 292 | + background-color: <?php echo esc_attr($base); ?>;  | 
                                                        |
| 293 | + border-color: <?php echo esc_attr($base); ?>;  | 
                                                        |
| 294 | 294 | }  | 
                                                        
| 295 | 295 |  .btn-primary { | 
                                                        
| 296 | 296 | color: #fff;  | 
                                                        
@@ -1,7 +1,8 @@  | 
                                                    ||
| 1 | 1 | <?php  | 
                                                        
| 2 | 2 | // don't load directly  | 
                                                        
| 3 | -if ( !defined('ABSPATH') ) | 
                                                        |
| 3 | +if ( !defined('ABSPATH') ) { | 
                                                        |
| 4 | 4 |      die('-1'); | 
                                                        
| 5 | +}  | 
                                                        |
| 5 | 6 | |
| 6 | 7 | do_action( 'wpinv_email_before_billing_details', $invoice ); ?>  | 
                                                        
| 7 | 8 | <div id="wpinv-email-billing">  | 
                                                        
@@ -1,41 +1,41 @@  | 
                                                    ||
| 1 | 1 | <?php  | 
                                                        
| 2 | 2 | // don't load directly  | 
                                                        
| 3 | -if ( !defined('ABSPATH') ) | 
                                                        |
| 3 | +if (!defined('ABSPATH')) | 
                                                        |
| 4 | 4 |      die('-1'); | 
                                                        
| 5 | 5 | |
| 6 | -do_action( 'wpinv_email_before_billing_details', $invoice ); ?>  | 
                                                        |
| 6 | +do_action('wpinv_email_before_billing_details', $invoice); ?> | 
                                                        |
| 7 | 7 | <div id="wpinv-email-billing">  | 
                                                        
| 8 | - <h3 class="wpinv-address-t"><?php echo apply_filters( 'wpinv_email_billing_title', __( 'Billing Details', 'invoicing' ) ); ?></h3>  | 
                                                        |
| 8 | +    <h3 class="wpinv-address-t"><?php echo apply_filters('wpinv_email_billing_title', __('Billing Details', 'invoicing')); ?></h3> | 
                                                        |
| 9 | 9 | |
| 10 | 10 | <table class="table table-bordered table-sm wpi-billing-details">  | 
                                                        
| 11 | 11 | <tbody>  | 
                                                        
| 12 | - <?php do_action( 'wpinv_email_billing_fields_first', $invoice ); ?>  | 
                                                        |
| 12 | +            <?php do_action('wpinv_email_billing_fields_first', $invoice); ?> | 
                                                        |
| 13 | 13 | <tr class="wpi-receipt-name">  | 
                                                        
| 14 | - <th class="text-left"><?php _e( 'Name', 'invoicing' ); ?></th>  | 
                                                        |
| 15 | -                <td><?php if ( $sent_to_admin && $invoice->user_id ) { ?><a href="<?php echo esc_url( add_query_arg( 'user_id', $invoice->get_user_id(), self_admin_url( 'user-edit.php' ) ) ) ;?>"><?php echo esc_html( $invoice->get_user_full_name() ); ?></a><?php } else { echo esc_html( $invoice->get_user_full_name() ); } ?></td> | 
                                                        |
| 14 | +                <th class="text-left"><?php _e('Name', 'invoicing'); ?></th> | 
                                                        |
| 15 | +                <td><?php if ($sent_to_admin && $invoice->user_id) { ?><a href="<?php echo esc_url(add_query_arg('user_id', $invoice->get_user_id(), self_admin_url('user-edit.php'))); ?>"><?php echo esc_html($invoice->get_user_full_name()); ?></a><?php } else { echo esc_html($invoice->get_user_full_name()); } ?></td> | 
                                                        |
| 16 | 16 | </tr>  | 
                                                        
| 17 | 17 | <tr class="wpi-receipt-email">  | 
                                                        
| 18 | - <th class="text-left"><?php _e( 'Email', 'invoicing' ); ?></th>  | 
                                                        |
| 19 | - <td><?php echo $invoice->get_email() ;?></td>  | 
                                                        |
| 18 | +                <th class="text-left"><?php _e('Email', 'invoicing'); ?></th> | 
                                                        |
| 19 | + <td><?php echo $invoice->get_email(); ?></td>  | 
                                                        |
| 20 | 20 | </tr>  | 
                                                        
| 21 | -            <?php if ( $invoice->company ) { ?> | 
                                                        |
| 21 | +            <?php if ($invoice->company) { ?> | 
                                                        |
| 22 | 22 | <tr class="wpi-receipt-company">  | 
                                                        
| 23 | - <th class="text-left"><?php _e( 'Company', 'invoicing' ); ?></th>  | 
                                                        |
| 24 | - <td><?php echo esc_html( $invoice->company ) ;?></td>  | 
                                                        |
| 23 | +                <th class="text-left"><?php _e('Company', 'invoicing'); ?></th> | 
                                                        |
| 24 | + <td><?php echo esc_html($invoice->company); ?></td>  | 
                                                        |
| 25 | 25 | </tr>  | 
                                                        
| 26 | 26 | <?php } ?>  | 
                                                        
| 27 | 27 | <tr class="wpi-receipt-address">  | 
                                                        
| 28 | - <th class="text-left"><?php _e( 'Address', 'invoicing' ); ?></th>  | 
                                                        |
| 29 | - <td><?php echo wpinv_get_invoice_address_markup( $invoice->get_user_info() ) ;?></td>  | 
                                                        |
| 28 | +                <th class="text-left"><?php _e('Address', 'invoicing'); ?></th> | 
                                                        |
| 29 | + <td><?php echo wpinv_get_invoice_address_markup($invoice->get_user_info()); ?></td>  | 
                                                        |
| 30 | 30 | </tr>  | 
                                                        
| 31 | -            <?php if ( $invoice->phone ) { ?> | 
                                                        |
| 31 | +            <?php if ($invoice->phone) { ?> | 
                                                        |
| 32 | 32 | <tr class="wpi-receipt-phone">  | 
                                                        
| 33 | - <th class="text-left"><?php _e( 'Phone', 'invoicing' ); ?></th>  | 
                                                        |
| 34 | - <td><?php echo esc_html( $invoice->phone ) ;?></td>  | 
                                                        |
| 33 | +                <th class="text-left"><?php _e('Phone', 'invoicing'); ?></th> | 
                                                        |
| 34 | + <td><?php echo esc_html($invoice->phone); ?></td>  | 
                                                        |
| 35 | 35 | </tr>  | 
                                                        
| 36 | 36 | <?php } ?>  | 
                                                        
| 37 | - <?php do_action( 'wpinv_email_billing_fields_last', $invoice ); ?>  | 
                                                        |
| 37 | +            <?php do_action('wpinv_email_billing_fields_last', $invoice); ?> | 
                                                        |
| 38 | 38 | </tbody>  | 
                                                        
| 39 | 39 | </table>  | 
                                                        
| 40 | 40 | </div>  | 
                                                        
| 41 | -<?php do_action( 'wpinv_email_after_billing_details', $invoice ); ?>  | 
                                                        |
| 42 | 41 | \ No newline at end of file  | 
                                                        
| 42 | +<?php do_action('wpinv_email_after_billing_details', $invoice); ?> | 
                                                        |
| 43 | 43 | \ No newline at end of file  | 
                                                        
@@ -1,7 +1,8 @@  | 
                                                    ||
| 1 | 1 | <?php  | 
                                                        
| 2 | 2 | // don't load directly  | 
                                                        
| 3 | -if ( !defined('ABSPATH') ) | 
                                                        |
| 3 | +if ( !defined('ABSPATH') ) { | 
                                                        |
| 4 | 4 |      die('-1'); | 
                                                        
| 5 | +}  | 
                                                        |
| 5 | 6 | |
| 6 | 7 | global $wpinv_euvat, $ajax_cart_details;  | 
                                                        
| 7 | 8 | $ajax_cart_details = $invoice->get_cart_details();  | 
                                                        
@@ -1,6 +1,6 @@ discard block  | 
                                                    ||
| 1 | 1 | <?php  | 
                                                        
| 2 | 2 | // don't load directly  | 
                                                        
| 3 | -if ( !defined('ABSPATH') ) | 
                                                        |
| 3 | +if (!defined('ABSPATH')) | 
                                                        |
| 4 | 4 |      die('-1'); | 
                                                        
| 5 | 5 | |
| 6 | 6 | global $wpinv_euvat, $ajax_cart_details;  | 
                                                        
@@ -10,153 +10,153 @@ discard block  | 
                                                    ||
| 10 | 10 | $invoice_id = $invoice->ID;  | 
                                                        
| 11 | 11 | $quantities_enabled = wpinv_item_quantities_enabled();  | 
                                                        
| 12 | 12 | $use_taxes = wpinv_use_taxes();  | 
                                                        
| 13 | -$zero_tax = !(float)$invoice->get_tax() > 0 ? true : false;  | 
                                                        |
| 14 | -$tax_label = $use_taxes && $invoice->has_vat() ? $wpinv_euvat->get_vat_name() : __( 'Tax', 'invoicing' );  | 
                                                        |
| 15 | -$tax_title = !$zero_tax && $use_taxes ? ( wpinv_prices_include_tax() ? wp_sprintf( __( '(%s Incl.)', 'invoicing' ), $tax_label ) : wp_sprintf( __( '(%s Excl.)', 'invoicing' ), $tax_label ) ) : '';  | 
                                                        |
| 13 | +$zero_tax = !(float) $invoice->get_tax() > 0 ? true : false;  | 
                                                        |
| 14 | +$tax_label          = $use_taxes && $invoice->has_vat() ? $wpinv_euvat->get_vat_name() : __('Tax', 'invoicing'); | 
                                                        |
| 15 | +$tax_title          = !$zero_tax && $use_taxes ? (wpinv_prices_include_tax() ? wp_sprintf(__('(%s Incl.)', 'invoicing'), $tax_label) : wp_sprintf(__('(%s Excl.)', 'invoicing'), $tax_label)) : ''; | 
                                                        |
| 16 | 16 | |
| 17 | -do_action( 'wpinv_before_email_items', $invoice ); ?>  | 
                                                        |
| 17 | +do_action('wpinv_before_email_items', $invoice); ?> | 
                                                        |
| 18 | 18 | <div id="wpinv-email-items">  | 
                                                        
| 19 | - <h3 class="wpinv-items-t"><?php echo apply_filters( 'wpinv_email_items_title', __( 'Items', 'invoicing' ) ); ?></h3>  | 
                                                        |
| 19 | +    <h3 class="wpinv-items-t"><?php echo apply_filters('wpinv_email_items_title', __('Items', 'invoicing')); ?></h3> | 
                                                        |
| 20 | 20 | <table id="wpinv_checkout_cart" class="table table-bordered table-hover">  | 
                                                        
| 21 | 21 | <thead>  | 
                                                        
| 22 | 22 | <tr class="wpinv_cart_header_row">  | 
                                                        
| 23 | - <?php do_action( 'wpinv_email_items_table_header_first' ); ?>  | 
                                                        |
| 24 | - <th class="wpinv_cart_item_name text-left"><?php _e( 'Item Name', 'invoicing' ); ?></th>  | 
                                                        |
| 25 | - <th class="wpinv_cart_item_price text-right"><?php _e( 'Item Price', 'invoicing' ); ?></th>  | 
                                                        |
| 26 | -                <?php if ( $quantities_enabled ) { ?> | 
                                                        |
| 27 | - <th class="wpinv_cart_item_qty text-right"><?php _e( 'Qty', 'invoicing' ); ?></th>  | 
                                                        |
| 23 | +                <?php do_action('wpinv_email_items_table_header_first'); ?> | 
                                                        |
| 24 | +                <th class="wpinv_cart_item_name text-left"><?php _e('Item Name', 'invoicing'); ?></th> | 
                                                        |
| 25 | +                <th class="wpinv_cart_item_price text-right"><?php _e('Item Price', 'invoicing'); ?></th> | 
                                                        |
| 26 | +                <?php if ($quantities_enabled) { ?> | 
                                                        |
| 27 | +                <th class="wpinv_cart_item_qty text-right"><?php _e('Qty', 'invoicing'); ?></th> | 
                                                        |
| 28 | 28 | <?php } ?>  | 
                                                        
| 29 | -                <?php if ( !$zero_tax && $use_taxes ) { ?> | 
                                                        |
| 29 | +                <?php if (!$zero_tax && $use_taxes) { ?> | 
                                                        |
| 30 | 30 | <th class="wpinv_cart_item_tax text-right"><?php echo $tax_label . ' <span class="normal small">(%)</span>'; ?></th>  | 
                                                        
| 31 | 31 | <?php } ?>  | 
                                                        
| 32 | - <th class="wpinv_cart_item_subtotal text-right"><?php echo __( 'Item Total', 'invoicing' ) . ' <span class="normal small">' . $tax_title . '<span>'; ?></th>  | 
                                                        |
| 33 | - <?php do_action( 'wpinv_email_items_table_header_last' ); ?>  | 
                                                        |
| 32 | +                <th class="wpinv_cart_item_subtotal text-right"><?php echo __('Item Total', 'invoicing') . ' <span class="normal small">' . $tax_title . '<span>'; ?></th> | 
                                                        |
| 33 | +                <?php do_action('wpinv_email_items_table_header_last'); ?> | 
                                                        |
| 34 | 34 | </tr>  | 
                                                        
| 35 | 35 | </thead>  | 
                                                        
| 36 | 36 | <tbody>  | 
                                                        
| 37 | 37 | <?php  | 
                                                        
| 38 | - do_action( 'wpinv_email_items_before' );  | 
                                                        |
| 39 | -                if ( $cart_items ) { | 
                                                        |
| 40 | -                    foreach ( $cart_items as $key => $item ) { | 
                                                        |
| 41 | - $wpi_item = $item['id'] ? new WPInv_Item( $item['id'] ) : NULL;  | 
                                                        |
| 38 | +                do_action('wpinv_email_items_before'); | 
                                                        |
| 39 | +                if ($cart_items) { | 
                                                        |
| 40 | +                    foreach ($cart_items as $key => $item) { | 
                                                        |
| 41 | + $wpi_item = $item['id'] ? new WPInv_Item($item['id']) : NULL;  | 
                                                        |
| 42 | 42 | ?>  | 
                                                        
| 43 | - <tr class="wpinv_cart_item" id="wpinv_cart_item_<?php echo esc_attr( $key ) . '_' . esc_attr( $item['id'] ); ?>" data-item-id="<?php echo esc_attr( $item['id'] ); ?>">  | 
                                                        |
| 44 | - <?php do_action( 'wpinv_email_items_table_body_first', $item ); ?>  | 
                                                        |
| 43 | + <tr class="wpinv_cart_item" id="wpinv_cart_item_<?php echo esc_attr($key) . '_' . esc_attr($item['id']); ?>" data-item-id="<?php echo esc_attr($item['id']); ?>">  | 
                                                        |
| 44 | +                        <?php do_action('wpinv_email_items_table_body_first', $item); ?> | 
                                                        |
| 45 | 45 | <td class="wpinv_cart_item_name text-left">  | 
                                                        
| 46 | 46 | <?php  | 
                                                        
| 47 | -                                if ( current_theme_supports( 'post-thumbnails' ) && has_post_thumbnail( $item['id'] ) ) { | 
                                                        |
| 47 | +                                if (current_theme_supports('post-thumbnails') && has_post_thumbnail($item['id'])) { | 
                                                        |
| 48 | 48 | echo '<div class="wpinv_cart_item_image">';  | 
                                                        
| 49 | - echo get_the_post_thumbnail( $item['id'], apply_filters( 'wpinv_checkout_image_size', array( 25,25 ) ) );  | 
                                                        |
| 49 | +                                        echo get_the_post_thumbnail($item['id'], apply_filters('wpinv_checkout_image_size', array(25, 25))); | 
                                                        |
| 50 | 50 | echo '</div>';  | 
                                                        
| 51 | 51 | }  | 
                                                        
| 52 | - $item_title = esc_html( wpinv_get_cart_item_name( $item ) ) . wpinv_get_item_suffix( $wpi_item );  | 
                                                        |
| 52 | + $item_title = esc_html(wpinv_get_cart_item_name($item)) . wpinv_get_item_suffix($wpi_item);  | 
                                                        |
| 53 | 53 | echo '<span class="wpinv_email_cart_item_title">' . $item_title . '</span>';  | 
                                                        
| 54 | 54 | |
| 55 | - $summary = apply_filters( 'wpinv_email_invoice_line_item_summary', '', $item, $wpi_item, $invoice );  | 
                                                        |
| 56 | -                                if ( !empty( $summary ) ) { | 
                                                        |
| 55 | +                                $summary = apply_filters('wpinv_email_invoice_line_item_summary', '', $item, $wpi_item, $invoice); | 
                                                        |
| 56 | +                                if (!empty($summary)) { | 
                                                        |
| 57 | 57 | echo '<p class="small">' . $summary . '</p>';  | 
                                                        
| 58 | 58 | }  | 
                                                        
| 59 | 59 | |
| 60 | - do_action( 'wpinv_email_cart_item_title_after', $item, $key );  | 
                                                        |
| 60 | +                                do_action('wpinv_email_cart_item_title_after', $item, $key); | 
                                                        |
| 61 | 61 | ?>  | 
                                                        
| 62 | 62 | </td>  | 
                                                        
| 63 | 63 | <td class="wpinv_cart_item_price text-right">  | 
                                                        
| 64 | 64 | <?php  | 
                                                        
| 65 | - echo wpinv_cart_item_price( $item );  | 
                                                        |
| 66 | - do_action( 'wpinv_email_cart_item_price_after', $item, $key );  | 
                                                        |
| 65 | + echo wpinv_cart_item_price($item);  | 
                                                        |
| 66 | +                            do_action('wpinv_email_cart_item_price_after', $item, $key); | 
                                                        |
| 67 | 67 | ?>  | 
                                                        
| 68 | 68 | </td>  | 
                                                        
| 69 | -                        <?php if ( $quantities_enabled ) { ?> | 
                                                        |
| 69 | +                        <?php if ($quantities_enabled) { ?> | 
                                                        |
| 70 | 70 | <td class="wpinv_cart_item_qty text-right">  | 
                                                        
| 71 | 71 | <?php  | 
                                                        
| 72 | - echo wpinv_get_cart_item_quantity( $item );  | 
                                                        |
| 73 | - do_action( 'wpinv_email_item_quantitiy', $item, $key );  | 
                                                        |
| 72 | + echo wpinv_get_cart_item_quantity($item);  | 
                                                        |
| 73 | +                            do_action('wpinv_email_item_quantitiy', $item, $key); | 
                                                        |
| 74 | 74 | ?>  | 
                                                        
| 75 | 75 | </td>  | 
                                                        
| 76 | 76 | <?php } ?>  | 
                                                        
| 77 | -                        <?php if ( !$zero_tax && $use_taxes ) { ?> | 
                                                        |
| 77 | +                        <?php if (!$zero_tax && $use_taxes) { ?> | 
                                                        |
| 78 | 78 | <td class="wpinv_cart_item_tax text-right">  | 
                                                        
| 79 | 79 | <?php  | 
                                                        
| 80 | - echo wpinv_cart_item_tax( $item );  | 
                                                        |
| 81 | - do_action( 'wpinv_email_item_tax', $item, $key );  | 
                                                        |
| 80 | + echo wpinv_cart_item_tax($item);  | 
                                                        |
| 81 | +                            do_action('wpinv_email_item_tax', $item, $key); | 
                                                        |
| 82 | 82 | ?>  | 
                                                        
| 83 | 83 | </td>  | 
                                                        
| 84 | 84 | <?php } ?>  | 
                                                        
| 85 | 85 | <td class="wpinv_cart_item_subtotal text-right">  | 
                                                        
| 86 | 86 | <?php  | 
                                                        
| 87 | - echo wpinv_cart_item_subtotal( $item );  | 
                                                        |
| 88 | - do_action( 'wpinv_email_item_subtotal', $item, $key );  | 
                                                        |
| 87 | + echo wpinv_cart_item_subtotal($item);  | 
                                                        |
| 88 | +                            do_action('wpinv_email_item_subtotal', $item, $key); | 
                                                        |
| 89 | 89 | ?>  | 
                                                        
| 90 | 90 | </td>  | 
                                                        
| 91 | - <?php do_action( 'wpinv_email_items_table_body_last', $item, $key ); ?>  | 
                                                        |
| 91 | +                        <?php do_action('wpinv_email_items_table_body_last', $item, $key); ?> | 
                                                        |
| 92 | 92 | </tr>  | 
                                                        
| 93 | 93 | <?php } ?>  | 
                                                        
| 94 | 94 | <?php } ?>  | 
                                                        
| 95 | - <?php do_action( 'wpinv_email_items_middle' ); ?>  | 
                                                        |
| 96 | - <?php do_action( 'wpinv_email_items_after' ); ?>  | 
                                                        |
| 95 | +            <?php do_action('wpinv_email_items_middle'); ?> | 
                                                        |
| 96 | +            <?php do_action('wpinv_email_items_after'); ?> | 
                                                        |
| 97 | 97 | </tbody>  | 
                                                        
| 98 | 98 | <tfoot>  | 
                                                        
| 99 | -            <?php $cart_columns = wpinv_checkout_cart_columns(); if ( $zero_tax && $use_taxes ) { $cart_columns--; } ?> | 
                                                        |
| 100 | -            <?php if ( has_action( 'wpinv_email_footer_buttons' ) ) { ?> | 
                                                        |
| 99 | +            <?php $cart_columns = wpinv_checkout_cart_columns(); if ($zero_tax && $use_taxes) { $cart_columns--; } ?> | 
                                                        |
| 100 | +            <?php if (has_action('wpinv_email_footer_buttons')) { ?> | 
                                                        |
| 101 | 101 | <tr class="wpinv_cart_footer_row">  | 
                                                        
| 102 | - <?php do_action( 'wpinv_email_items_table_buttons_first', $cart_items ); ?>  | 
                                                        |
| 103 | - <td colspan="<?php echo ( $cart_columns ); ?>">  | 
                                                        |
| 104 | - <?php do_action( 'wpinv_email_footer_buttons' ); ?>  | 
                                                        |
| 102 | +                    <?php do_action('wpinv_email_items_table_buttons_first', $cart_items); ?> | 
                                                        |
| 103 | + <td colspan="<?php echo ($cart_columns); ?>">  | 
                                                        |
| 104 | +                        <?php do_action('wpinv_email_footer_buttons'); ?> | 
                                                        |
| 105 | 105 | </td>  | 
                                                        
| 106 | - <?php do_action( 'wpinv_email_items_table_buttons_first', $cart_items ); ?>  | 
                                                        |
| 106 | +                    <?php do_action('wpinv_email_items_table_buttons_first', $cart_items); ?> | 
                                                        |
| 107 | 107 | </tr>  | 
                                                        
| 108 | 108 | <?php } ?>  | 
                                                        
| 109 | 109 | |
| 110 | -            <?php if ( !$zero_tax && $use_taxes && !wpinv_prices_include_tax() && wpinv_is_cart_taxed() ) { ?> | 
                                                        |
| 110 | +            <?php if (!$zero_tax && $use_taxes && !wpinv_prices_include_tax() && wpinv_is_cart_taxed()) { ?> | 
                                                        |
| 111 | 111 | <tr class="wpinv_cart_footer_row wpinv_cart_subtotal_row">  | 
                                                        
| 112 | - <?php do_action( 'wpinv_email_items_table_subtotal_first', $cart_items ); ?>  | 
                                                        |
| 113 | - <td colspan="<?php echo ( $cart_columns - 1 ); ?>" class="wpinv_cart_subtotal_label text-right">  | 
                                                        |
| 114 | - <strong><?php _e( 'Sub-Total', 'invoicing' ); ?>:</strong>  | 
                                                        |
| 112 | +                    <?php do_action('wpinv_email_items_table_subtotal_first', $cart_items); ?> | 
                                                        |
| 113 | + <td colspan="<?php echo ($cart_columns - 1); ?>" class="wpinv_cart_subtotal_label text-right">  | 
                                                        |
| 114 | +                        <strong><?php _e('Sub-Total', 'invoicing'); ?>:</strong> | 
                                                        |
| 115 | 115 | </td>  | 
                                                        
| 116 | 116 | <td class="wpinv_cart_subtotal text-right">  | 
                                                        
| 117 | - <span class="wpinv_cart_subtotal_amount bold"><?php echo $invoice->get_subtotal( true ); ?></span>  | 
                                                        |
| 117 | + <span class="wpinv_cart_subtotal_amount bold"><?php echo $invoice->get_subtotal(true); ?></span>  | 
                                                        |
| 118 | 118 | </td>  | 
                                                        
| 119 | - <?php do_action( 'wpinv_email_items_table_subtotal_last', $cart_items, $invoice ); ?>  | 
                                                        |
| 119 | +                    <?php do_action('wpinv_email_items_table_subtotal_last', $cart_items, $invoice); ?> | 
                                                        |
| 120 | 120 | </tr>  | 
                                                        
| 121 | 121 | <?php } ?>  | 
                                                        
| 122 | 122 | |
| 123 | -            <?php if ( wpinv_discount( $invoice_id, false ) > 0 ) { ?> | 
                                                        |
| 123 | +            <?php if (wpinv_discount($invoice_id, false) > 0) { ?> | 
                                                        |
| 124 | 124 | <tr class="wpinv_cart_footer_row wpinv_cart_discount_row">  | 
                                                        
| 125 | - <?php do_action( 'wpinv_receipt_items_table_discount_first', $cart_items, $invoice ); ?>  | 
                                                        |
| 126 | - <td colspan="<?php echo ( $cart_columns - 1 ); ?>" class="wpinv_cart_discount_label text-right">  | 
                                                        |
| 127 | - <strong><?php wpinv_get_discount_label( wpinv_discount_code( $invoice_id ) ); ?>:</strong>  | 
                                                        |
| 125 | +                    <?php do_action('wpinv_receipt_items_table_discount_first', $cart_items, $invoice); ?> | 
                                                        |
| 126 | + <td colspan="<?php echo ($cart_columns - 1); ?>" class="wpinv_cart_discount_label text-right">  | 
                                                        |
| 127 | + <strong><?php wpinv_get_discount_label(wpinv_discount_code($invoice_id)); ?>:</strong>  | 
                                                        |
| 128 | 128 | </td>  | 
                                                        
| 129 | 129 | <td class="wpinv_cart_discount text-right">  | 
                                                        
| 130 | - <span class="wpinv_cart_discount_amount"><?php echo wpinv_discount( $invoice_id, true, true ); ?></span>  | 
                                                        |
| 130 | + <span class="wpinv_cart_discount_amount"><?php echo wpinv_discount($invoice_id, true, true); ?></span>  | 
                                                        |
| 131 | 131 | </td>  | 
                                                        
| 132 | - <?php do_action( 'wpinv_receipt_items_table_discount_last', $cart_items, $invoice ); ?>  | 
                                                        |
| 132 | +                    <?php do_action('wpinv_receipt_items_table_discount_last', $cart_items, $invoice); ?> | 
                                                        |
| 133 | 133 | </tr>  | 
                                                        
| 134 | 134 | <?php } ?>  | 
                                                        
| 135 | 135 | |
| 136 | -            <?php if ( !$zero_tax && $use_taxes && wpinv_is_cart_taxed() ) { ?> | 
                                                        |
| 136 | +            <?php if (!$zero_tax && $use_taxes && wpinv_is_cart_taxed()) { ?> | 
                                                        |
| 137 | 137 | <tr class="wpinv_cart_footer_row wpinv_cart_tax_row">  | 
                                                        
| 138 | - <?php do_action( 'wpinv_email_items_table_tax_first', $cart_items, $invoice ); ?>  | 
                                                        |
| 139 | - <td colspan="<?php echo ( $cart_columns - 1 ); ?>" class="wpinv_cart_tax_label text-right">  | 
                                                        |
| 138 | +                    <?php do_action('wpinv_email_items_table_tax_first', $cart_items, $invoice); ?> | 
                                                        |
| 139 | + <td colspan="<?php echo ($cart_columns - 1); ?>" class="wpinv_cart_tax_label text-right">  | 
                                                        |
| 140 | 140 | <strong><?php echo $tax_label; ?>:</strong>  | 
                                                        
| 141 | 141 | </td>  | 
                                                        
| 142 | 142 | <td class="wpinv_cart_tax text-right">  | 
                                                        
| 143 | - <span class="wpinv_cart_tax_amount"><?php echo $invoice->get_tax( true ); ?></span>  | 
                                                        |
| 143 | + <span class="wpinv_cart_tax_amount"><?php echo $invoice->get_tax(true); ?></span>  | 
                                                        |
| 144 | 144 | </td>  | 
                                                        
| 145 | - <?php do_action( 'wpinv_email_items_table_tax_last', $cart_items, $invoice ); ?>  | 
                                                        |
| 145 | +                    <?php do_action('wpinv_email_items_table_tax_last', $cart_items, $invoice); ?> | 
                                                        |
| 146 | 146 | </tr>  | 
                                                        
| 147 | 147 | <?php } ?>  | 
                                                        
| 148 | 148 | |
| 149 | 149 | <tr class="wpinv_cart_footer_row">  | 
                                                        
| 150 | - <?php do_action( 'wpinv_email_items_table_footer_first', $cart_items, $invoice ); ?>  | 
                                                        |
| 151 | - <td colspan="<?php echo ( $cart_columns - 1 ); ?>" class="wpinv_cart_total_label text-right">  | 
                                                        |
| 152 | - <?php echo apply_filters( 'wpinv_email_cart_total_label', '<strong>' . __( 'Total', 'invoicing' ) . ':</strong>', $invoice ); ?>  | 
                                                        |
| 150 | +                <?php do_action('wpinv_email_items_table_footer_first', $cart_items, $invoice); ?> | 
                                                        |
| 151 | + <td colspan="<?php echo ($cart_columns - 1); ?>" class="wpinv_cart_total_label text-right">  | 
                                                        |
| 152 | +                    <?php echo apply_filters('wpinv_email_cart_total_label', '<strong>' . __('Total', 'invoicing') . ':</strong>', $invoice); ?> | 
                                                        |
| 153 | 153 | </td>  | 
                                                        
| 154 | 154 | <td class="wpinv_cart_total text-right">  | 
                                                        
| 155 | - <span class="wpinv_cart_amount bold"><?php echo $invoice->get_total( true ); ?></span>  | 
                                                        |
| 155 | + <span class="wpinv_cart_amount bold"><?php echo $invoice->get_total(true); ?></span>  | 
                                                        |
| 156 | 156 | </td>  | 
                                                        
| 157 | - <?php do_action( 'wpinv_email_items_table_footer_last', $cart_items, $invoice ); ?>  | 
                                                        |
| 157 | +                <?php do_action('wpinv_email_items_table_footer_last', $cart_items, $invoice); ?> | 
                                                        |
| 158 | 158 | </tr>  | 
                                                        
| 159 | 159 | </tfoot>  | 
                                                        
| 160 | 160 | </table>  | 
                                                        
| 161 | 161 | </div>  | 
                                                        
| 162 | -<?php do_action( 'wpinv_after_email_items', $invoice ); ?>  | 
                                                        |
| 163 | 162 | \ No newline at end of file  | 
                                                        
| 163 | +<?php do_action('wpinv_after_email_items', $invoice); ?> | 
                                                        |
| 164 | 164 | \ No newline at end of file  | 
                                                        
@@ -1,7 +1,8 @@  | 
                                                    ||
| 1 | 1 | <?php  | 
                                                        
| 2 | 2 | // don't load directly  | 
                                                        
| 3 | -if ( !defined('ABSPATH') ) | 
                                                        |
| 3 | +if ( !defined('ABSPATH') ) { | 
                                                        |
| 4 | 4 |      die('-1'); | 
                                                        
| 5 | +}  | 
                                                        |
| 5 | 6 | |
| 6 | 7 | global $wpinv_euvat;  | 
                                                        
| 7 | 8 | |
@@ -1,68 +1,68 @@  | 
                                                    ||
| 1 | 1 | <?php  | 
                                                        
| 2 | 2 | // don't load directly  | 
                                                        
| 3 | -if ( !defined('ABSPATH') ) | 
                                                        |
| 3 | +if (!defined('ABSPATH')) | 
                                                        |
| 4 | 4 |      die('-1'); | 
                                                        
| 5 | 5 | |
| 6 | 6 | global $wpinv_euvat;  | 
                                                        
| 7 | 7 | |
| 8 | -$sent_to_admin = !empty( $sent_to_admin ) ? true : false;  | 
                                                        |
| 9 | -$invoice_url = $invoice->get_view_url( true );  | 
                                                        |
| 8 | +$sent_to_admin = !empty($sent_to_admin) ? true : false;  | 
                                                        |
| 9 | +$invoice_url = $invoice->get_view_url(true);  | 
                                                        |
| 10 | 10 | $use_taxes = wpinv_use_taxes();  | 
                                                        
| 11 | 11 | $vat_name = $wpinv_euvat->get_vat_name();  | 
                                                        
| 12 | 12 | |
| 13 | -do_action( 'wpinv_email_before_invoice_details', $invoice, $sent_to_admin ); ?>  | 
                                                        |
| 13 | +do_action('wpinv_email_before_invoice_details', $invoice, $sent_to_admin); ?> | 
                                                        |
| 14 | 14 | <div id="wpinv-email-details">  | 
                                                        
| 15 | - <h3 class="wpinv-details-t"><?php echo apply_filters( 'wpinv_email_details_title', __( 'Invoice Details', 'invoicing' ), $invoice ); ?></h3>  | 
                                                        |
| 15 | +    <h3 class="wpinv-details-t"><?php echo apply_filters('wpinv_email_details_title', __('Invoice Details', 'invoicing'), $invoice); ?></h3> | 
                                                        |
| 16 | 16 | <table class="table table-bordered table-sm">  | 
                                                        
| 17 | -        <?php if ( $invoice_number = $invoice->get_number() ) { ?> | 
                                                        |
| 17 | +        <?php if ($invoice_number = $invoice->get_number()) { ?> | 
                                                        |
| 18 | 18 | <tr>  | 
                                                        
| 19 | - <td><?php echo apply_filters( 'wpinv_invoice_number_label', __( 'Invoice Number', 'invoicing' ), $invoice ); ?></td>  | 
                                                        |
| 20 | - <td><a href="<?php echo esc_url( $invoice_url ) ;?>"><?php echo $invoice_number; ?></a></td>  | 
                                                        |
| 19 | +                <td><?php echo apply_filters('wpinv_invoice_number_label', __('Invoice Number', 'invoicing'), $invoice); ?></td> | 
                                                        |
| 20 | + <td><a href="<?php echo esc_url($invoice_url); ?>"><?php echo $invoice_number; ?></a></td>  | 
                                                        |
| 21 | 21 | </tr>  | 
                                                        
| 22 | 22 | <?php } ?>  | 
                                                        
| 23 | 23 | <tr>  | 
                                                        
| 24 | - <td><?php echo apply_filters( 'wpinv_invoice_status_label', __( 'Invoice Status', 'invoicing' ), $invoice ); ?></td>  | 
                                                        |
| 25 | - <td><?php echo $invoice->get_status( true ); ?></td>  | 
                                                        |
| 24 | +            <td><?php echo apply_filters('wpinv_invoice_status_label', __('Invoice Status', 'invoicing'), $invoice); ?></td> | 
                                                        |
| 25 | + <td><?php echo $invoice->get_status(true); ?></td>  | 
                                                        |
| 26 | 26 | </tr>  | 
                                                        
| 27 | -        <?php if ( $invoice->is_renewal() ) { ?> | 
                                                        |
| 27 | +        <?php if ($invoice->is_renewal()) { ?> | 
                                                        |
| 28 | 28 | <tr>  | 
                                                        
| 29 | - <td><?php echo apply_filters( 'wpinv_invoice_parent_invoice_label', __( 'Parent Invoice', 'invoicing' ), $invoice ); ?></td>  | 
                                                        |
| 30 | - <td><?php echo wpinv_invoice_link( $invoice->parent_invoice ); ?></td>  | 
                                                        |
| 29 | +            <td><?php echo apply_filters('wpinv_invoice_parent_invoice_label', __('Parent Invoice', 'invoicing'), $invoice); ?></td> | 
                                                        |
| 30 | + <td><?php echo wpinv_invoice_link($invoice->parent_invoice); ?></td>  | 
                                                        |
| 31 | 31 | </tr>  | 
                                                        
| 32 | 32 | <?php } ?>  | 
                                                        
| 33 | -        <?php if ( ( $gateway_title = $invoice->get_gateway_title() ) && ( $invoice->is_paid() || $invoice->is_refunded() ) ) { ?> | 
                                                        |
| 34 | - <td><?php echo apply_filters( 'wpinv_invoice_payment_method_label', __( 'Payment Method', 'invoicing' ), $invoice ); ?></td>  | 
                                                        |
| 33 | +        <?php if (($gateway_title = $invoice->get_gateway_title()) && ($invoice->is_paid() || $invoice->is_refunded())) { ?> | 
                                                        |
| 34 | +            <td><?php echo apply_filters('wpinv_invoice_payment_method_label', __('Payment Method', 'invoicing'), $invoice); ?></td> | 
                                                        |
| 35 | 35 | <td><?php echo $gateway_title; ?></td>  | 
                                                        
| 36 | 36 | <?php } ?>  | 
                                                        
| 37 | -        <?php if ( $invoice_date = $invoice->get_invoice_date( false ) ) { ?> | 
                                                        |
| 37 | +        <?php if ($invoice_date = $invoice->get_invoice_date(false)) { ?> | 
                                                        |
| 38 | 38 | <tr>  | 
                                                        
| 39 | - <td><?php echo apply_filters( 'wpinv_invoice_date_label', __( 'Invoice Date', 'invoicing' ), $invoice ); ?></td>  | 
                                                        |
| 40 | - <td><?php echo wp_sprintf( '<time datetime="%s">%s</time>', date_i18n( 'c', strtotime( $invoice_date ) ), $invoice->get_invoice_date() ); ?></td>  | 
                                                        |
| 39 | +                <td><?php echo apply_filters('wpinv_invoice_date_label', __('Invoice Date', 'invoicing'), $invoice); ?></td> | 
                                                        |
| 40 | +                <td><?php echo wp_sprintf('<time datetime="%s">%s</time>', date_i18n('c', strtotime($invoice_date)), $invoice->get_invoice_date()); ?></td> | 
                                                        |
| 41 | 41 | </tr>  | 
                                                        
| 42 | 42 | <?php } ?>  | 
                                                        
| 43 | -        <?php if ( wpinv_get_option( 'overdue_active' ) && $invoice->needs_payment() && ( $due_date = $invoice->get_due_date() ) ) { ?> | 
                                                        |
| 43 | +        <?php if (wpinv_get_option('overdue_active') && $invoice->needs_payment() && ($due_date = $invoice->get_due_date())) { ?> | 
                                                        |
| 44 | 44 | <tr>  | 
                                                        
| 45 | - <td><?php echo apply_filters( 'wpinv_invoice_due_date_label', __( 'Due Date', 'invoicing' ), $invoice ); ?></td>  | 
                                                        |
| 46 | - <td><?php echo wp_sprintf( '<time datetime="%s">%s</time>', date_i18n( 'c', strtotime( $due_date ) ), $invoice->get_due_date( true ) ); ?></td>  | 
                                                        |
| 45 | +                <td><?php echo apply_filters('wpinv_invoice_due_date_label', __('Due Date', 'invoicing'), $invoice); ?></td> | 
                                                        |
| 46 | +                <td><?php echo wp_sprintf('<time datetime="%s">%s</time>', date_i18n('c', strtotime($due_date)), $invoice->get_due_date(true)); ?></td> | 
                                                        |
| 47 | 47 | </tr>  | 
                                                        
| 48 | 48 | <?php } ?>  | 
                                                        
| 49 | - <?php do_action( 'wpinv_email_invoice_details_after_due_date', $invoice->ID ); ?>  | 
                                                        |
| 50 | -        <?php if ( empty( $sent_to_admin ) && ( $owner_vat_number = $wpinv_euvat->get_vat_number() ) ) { ?> | 
                                                        |
| 49 | +        <?php do_action('wpinv_email_invoice_details_after_due_date', $invoice->ID); ?> | 
                                                        |
| 50 | +        <?php if (empty($sent_to_admin) && ($owner_vat_number = $wpinv_euvat->get_vat_number())) { ?> | 
                                                        |
| 51 | 51 | <tr>  | 
                                                        
| 52 | - <td><?php echo apply_filters( 'wpinv_invoice_owner_vat_number_label', wp_sprintf( __( 'Owner %s Number', 'invoicing' ), $vat_name ), $invoice, $vat_name ); ?></td>  | 
                                                        |
| 52 | +                <td><?php echo apply_filters('wpinv_invoice_owner_vat_number_label', wp_sprintf(__('Owner %s Number', 'invoicing'), $vat_name), $invoice, $vat_name); ?></td> | 
                                                        |
| 53 | 53 | <td><?php echo $owner_vat_number; ?></td>  | 
                                                        
| 54 | 54 | </tr>  | 
                                                        
| 55 | 55 | <?php } ?>  | 
                                                        
| 56 | -        <?php if ( $use_taxes && ( $user_vat_number = $invoice->vat_number ) ) { ?> | 
                                                        |
| 56 | +        <?php if ($use_taxes && ($user_vat_number = $invoice->vat_number)) { ?> | 
                                                        |
| 57 | 57 | <tr>  | 
                                                        
| 58 | - <td><?php echo apply_filters( 'wpinv_invoice_user_vat_number_label', wp_sprintf( __( 'Invoice %s Number', 'invoicing' ), $vat_name ), $invoice, $vat_name ); ?></td>  | 
                                                        |
| 58 | +                <td><?php echo apply_filters('wpinv_invoice_user_vat_number_label', wp_sprintf(__('Invoice %s Number', 'invoicing'), $vat_name), $invoice, $vat_name); ?></td> | 
                                                        |
| 59 | 59 | <td><?php echo $user_vat_number; ?></td>  | 
                                                        
| 60 | 60 | </tr>  | 
                                                        
| 61 | 61 | <?php } ?>  | 
                                                        
| 62 | 62 | <tr class="table-active">  | 
                                                        
| 63 | - <td><strong><?php _e( 'Total Amount', 'invoicing' ) ?></strong></td>  | 
                                                        |
| 64 | - <td><strong><?php echo $invoice->get_total( true ); ?></strong></td>  | 
                                                        |
| 63 | +            <td><strong><?php _e('Total Amount', 'invoicing') ?></strong></td> | 
                                                        |
| 64 | + <td><strong><?php echo $invoice->get_total(true); ?></strong></td>  | 
                                                        |
| 65 | 65 | </tr>  | 
                                                        
| 66 | 66 | </table>  | 
                                                        
| 67 | 67 | </div>  | 
                                                        
| 68 | -<?php do_action( 'wpinv_email_after_invoice_details', $invoice, $sent_to_admin ); ?>  | 
                                                        |
| 69 | 68 | \ No newline at end of file  | 
                                                        
| 69 | +<?php do_action('wpinv_email_after_invoice_details', $invoice, $sent_to_admin); ?> | 
                                                        |
| 70 | 70 | \ No newline at end of file  | 
                                                        
@@ -2,11 +2,11 @@  | 
                                                    ||
| 2 | 2 | global $wpi_invoice;  | 
                                                        
| 3 | 3 | |
| 4 | 4 | $success_page_uri = wpinv_get_success_page_uri();  | 
                                                        
| 5 | -if ( !empty( $wpi_invoice ) ) { | 
                                                        |
| 6 | - $success_page_uri = add_query_arg( 'invoice_key', $wpi_invoice->get_key(), $success_page_uri );  | 
                                                        |
| 5 | +if (!empty($wpi_invoice)) { | 
                                                        |
| 6 | +    $success_page_uri = add_query_arg('invoice_key', $wpi_invoice->get_key(), $success_page_uri); | 
                                                        |
| 7 | 7 | }  | 
                                                        
| 8 | 8 | ?>  | 
                                                        
| 9 | 9 | <div id="wpinv-payment-processing">  | 
                                                        
| 10 | - <p><?php echo wp_sprintf( __( 'Your payment is processing. This page will reload automatically in 10 seconds. If it does not, click <a href="%s">here</a>.', 'invoicing' ), $success_page_uri ); ?> <i class="fa fa-spin fa-refresh"></i></p>  | 
                                                        |
| 10 | +    <p><?php echo wp_sprintf(__('Your payment is processing. This page will reload automatically in 10 seconds. If it does not, click <a href="%s">here</a>.', 'invoicing'), $success_page_uri); ?> <i class="fa fa-spin fa-refresh"></i></p> | 
                                                        |
| 11 | 11 |      <script type="text/javascript">setTimeout(function(){ window.location = '<?php echo $success_page_uri; ?>'; }, 10000);</script> | 
                                                        
| 12 | 12 | </div>  | 
                                                        
| 13 | 13 | \ No newline at end of file  |