@@ -9,49 +9,49 @@ discard block |
||
| 9 | 9 | * @var GetPaid_Form_Item $item |
| 10 | 10 | */ |
| 11 | 11 | |
| 12 | -defined( 'ABSPATH' ) || exit; |
|
| 12 | +defined('ABSPATH') || exit; |
|
| 13 | 13 | |
| 14 | -do_action( 'getpaid_before_payment_form_cart_item', $form, $item ); |
|
| 14 | +do_action('getpaid_before_payment_form_cart_item', $form, $item); |
|
| 15 | 15 | |
| 16 | 16 | $currency = $form->get_currency(); |
| 17 | -$max_qty = wpinv_item_max_buyable_quantity( $item->get_id() ); |
|
| 17 | +$max_qty = wpinv_item_max_buyable_quantity($item->get_id()); |
|
| 18 | 18 | ?> |
| 19 | 19 | <div class='getpaid-payment-form-items-cart-item getpaid-<?php echo $item->is_required() ? 'required' : 'selectable'; ?> item-<?php echo (int) $item->get_id(); ?> border-bottom py-2 px-3'> |
| 20 | 20 | |
| 21 | 21 | <div class="form-row needs-validation"> |
| 22 | 22 | |
| 23 | - <?php foreach ( array_keys( $columns ) as $key ) : ?> |
|
| 23 | + <?php foreach (array_keys($columns) as $key) : ?> |
|
| 24 | 24 | |
| 25 | - <div class="<?php echo 'name' == $key ? 'col-6' : 'col'; ?> <?php echo ( in_array( $key, array( 'subtotal', 'quantity', 'tax_rate' ) ) ) ? 'd-none d-sm-block' : ''; ?> position-relative getpaid-form-cart-item-<?php echo esc_attr( $key ); ?> getpaid-form-cart-item-<?php echo esc_attr( $key ); ?>-<?php echo (int) $item->get_id(); ?>"> |
|
| 25 | + <div class="<?php echo 'name' == $key ? 'col-6' : 'col'; ?> <?php echo (in_array($key, array('subtotal', 'quantity', 'tax_rate'))) ? 'd-none d-sm-block' : ''; ?> position-relative getpaid-form-cart-item-<?php echo esc_attr($key); ?> getpaid-form-cart-item-<?php echo esc_attr($key); ?>-<?php echo (int) $item->get_id(); ?>"> |
|
| 26 | 26 | |
| 27 | 27 | <?php |
| 28 | 28 | |
| 29 | 29 | // Fires before printing a line item column. |
| 30 | - do_action( "getpaid_form_cart_item_before_$key", $item, $form ); |
|
| 30 | + do_action("getpaid_form_cart_item_before_$key", $item, $form); |
|
| 31 | 31 | |
| 32 | 32 | // Item name. |
| 33 | - if ( 'name' == $key ) { |
|
| 33 | + if ('name' == $key) { |
|
| 34 | 34 | |
| 35 | 35 | ob_start(); |
| 36 | 36 | // And an optional description. |
| 37 | 37 | $description = $item->get_description(); |
| 38 | 38 | |
| 39 | - if ( ! empty( $description ) ) { |
|
| 40 | - echo "<small class='form-text text-muted pr-2 m-0'>" . wp_kses_post( $description ) . "</small>"; |
|
| 39 | + if (!empty($description)) { |
|
| 40 | + echo "<small class='form-text text-muted pr-2 m-0'>" . wp_kses_post($description) . "</small>"; |
|
| 41 | 41 | } |
| 42 | 42 | |
| 43 | 43 | // Price help text. |
| 44 | - $description = getpaid_item_recurring_price_help_text( $item, $currency ); |
|
| 45 | - if ( $description ) { |
|
| 46 | - echo "<small class='getpaid-form-item-price-desc form-text text-muted pr-2 m-0'>" . wp_kses_post( $description ) . "</small>"; |
|
| 44 | + $description = getpaid_item_recurring_price_help_text($item, $currency); |
|
| 45 | + if ($description) { |
|
| 46 | + echo "<small class='getpaid-form-item-price-desc form-text text-muted pr-2 m-0'>" . wp_kses_post($description) . "</small>"; |
|
| 47 | 47 | } |
| 48 | 48 | |
| 49 | - do_action( 'getpaid_payment_form_cart_item_description', $item, $form ); |
|
| 49 | + do_action('getpaid_payment_form_cart_item_description', $item, $form); |
|
| 50 | 50 | |
| 51 | - if ( wpinv_current_user_can_manage_invoicing() ) { |
|
| 51 | + if (wpinv_current_user_can_manage_invoicing()) { |
|
| 52 | 52 | |
| 53 | 53 | edit_post_link( |
| 54 | - __( 'Edit this item.', 'invoicing' ), |
|
| 54 | + __('Edit this item.', 'invoicing'), |
|
| 55 | 55 | '<small class="form-text text-muted">', |
| 56 | 56 | '</small>', |
| 57 | 57 | $item->get_id(), |
@@ -63,18 +63,18 @@ discard block |
||
| 63 | 63 | $description = ob_get_clean(); |
| 64 | 64 | |
| 65 | 65 | // Display the name. |
| 66 | - $tootip = empty( $description ) ? '' : ' ' . '<i class="fas fa-xs fa-info gp-tooltip d-sm-none text-muted"></i>'; |
|
| 67 | - echo '<div class="mb-1">' . esc_html( $item->get_name() ) . wp_kses_post( $tootip ) . '</div>'; |
|
| 66 | + $tootip = empty($description) ? '' : ' ' . '<i class="fas fa-xs fa-info gp-tooltip d-sm-none text-muted"></i>'; |
|
| 67 | + echo '<div class="mb-1">' . esc_html($item->get_name()) . wp_kses_post($tootip) . '</div>'; |
|
| 68 | 68 | |
| 69 | - if ( ! empty( $description ) ) { |
|
| 70 | - printf( '<span class="d-none d-sm-block getpaid-item-desc">%s</span>', wp_kses_post( $description ) ); |
|
| 69 | + if (!empty($description)) { |
|
| 70 | + printf('<span class="d-none d-sm-block getpaid-item-desc">%s</span>', wp_kses_post($description)); |
|
| 71 | 71 | } |
| 72 | 72 | |
| 73 | - if ( $item->allows_quantities() ) { |
|
| 73 | + if ($item->allows_quantities()) { |
|
| 74 | 74 | printf( |
| 75 | 75 | '<small class="d-sm-none text-muted form-text">%s</small>', |
| 76 | 76 | sprintf( |
| 77 | - esc_html__( 'Qty %s', 'invoicing' ), |
|
| 77 | + esc_html__('Qty %s', 'invoicing'), |
|
| 78 | 78 | sprintf( |
| 79 | 79 | '<input |
| 80 | 80 | type="number" |
@@ -86,7 +86,7 @@ discard block |
||
| 86 | 86 | max="%s" |
| 87 | 87 | >', |
| 88 | 88 | (float) $item->get_quantity() == 0 ? 1 : (float) $item->get_quantity(), |
| 89 | - floatval( null !== $max_qty ? $max_qty : 1000000000000 ) |
|
| 89 | + floatval(null !== $max_qty ? $max_qty : 1000000000000) |
|
| 90 | 90 | ) |
| 91 | 91 | ) |
| 92 | 92 | ); |
@@ -94,7 +94,7 @@ discard block |
||
| 94 | 94 | printf( |
| 95 | 95 | '<small class="d-sm-none text-muted form-text">%s</small>', |
| 96 | 96 | sprintf( |
| 97 | - esc_html__( 'Qty %s', 'invoicing' ), |
|
| 97 | + esc_html__('Qty %s', 'invoicing'), |
|
| 98 | 98 | (float) $item->get_quantity() |
| 99 | 99 | ) |
| 100 | 100 | ); |
@@ -102,56 +102,56 @@ discard block |
||
| 102 | 102 | } |
| 103 | 103 | |
| 104 | 104 | // Item price. |
| 105 | - if ( 'price' == $key ) { |
|
| 105 | + if ('price' == $key) { |
|
| 106 | 106 | |
| 107 | 107 | // Set the currency position. |
| 108 | 108 | $position = wpinv_currency_position(); |
| 109 | 109 | |
| 110 | - if ( $position == 'left_space' ) { |
|
| 110 | + if ($position == 'left_space') { |
|
| 111 | 111 | $position = 'left'; |
| 112 | 112 | } |
| 113 | 113 | |
| 114 | - if ( $position == 'right_space' ) { |
|
| 114 | + if ($position == 'right_space') { |
|
| 115 | 115 | $position = 'right'; |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | - if ( $item->user_can_set_their_price() ) { |
|
| 119 | - $price = max( (float) $item->get_price(), (float) $item->get_minimum_price() ); |
|
| 118 | + if ($item->user_can_set_their_price()) { |
|
| 119 | + $price = max((float) $item->get_price(), (float) $item->get_minimum_price()); |
|
| 120 | 120 | $minimum = (float) $item->get_minimum_price(); |
| 121 | 121 | $validate_minimum = ''; |
| 122 | 122 | $class = ''; |
| 123 | 123 | $data_minimum = ''; |
| 124 | 124 | |
| 125 | - if ( $minimum > 0 ) { |
|
| 125 | + if ($minimum > 0) { |
|
| 126 | 126 | $validate_minimum = sprintf( |
| 127 | - esc_attr__( 'The minimum allowed amount is %s', 'invoicing' ), |
|
| 128 | - strip_tags( wpinv_price( $minimum, $currency ) ) |
|
| 127 | + esc_attr__('The minimum allowed amount is %s', 'invoicing'), |
|
| 128 | + strip_tags(wpinv_price($minimum, $currency)) |
|
| 129 | 129 | ); |
| 130 | 130 | |
| 131 | 131 | $class = 'getpaid-validate-minimum-amount'; |
| 132 | 132 | |
| 133 | - $data_minimum = "data-minimum-amount='" . esc_attr( getpaid_unstandardize_amount( $minimum ) ) . "'"; |
|
| 133 | + $data_minimum = "data-minimum-amount='" . esc_attr(getpaid_unstandardize_amount($minimum)) . "'"; |
|
| 134 | 134 | } |
| 135 | 135 | |
| 136 | 136 | ?> |
| 137 | 137 | <div class="input-group input-group-sm"> |
| 138 | - <?php if ( 'left' == $position ) : ?> |
|
| 138 | + <?php if ('left' == $position) : ?> |
|
| 139 | 139 | <div class="input-group-prepend"> |
| 140 | - <span class="input-group-text"><?php echo wp_kses_post( wpinv_currency_symbol( $currency ) ); ?></span> |
|
| 140 | + <span class="input-group-text"><?php echo wp_kses_post(wpinv_currency_symbol($currency)); ?></span> |
|
| 141 | 141 | </div> |
| 142 | 142 | <?php endif; ?> |
| 143 | 143 | |
| 144 | - <input type="text" <?php echo wp_kses_post( $data_minimum ); ?> name="getpaid-items[<?php echo (int) $item->get_id(); ?>][price]" value="<?php echo esc_attr( getpaid_unstandardize_amount( $price ) ); ?>" placeholder="<?php echo esc_attr( getpaid_unstandardize_amount( $item->get_minimum_price() ) ); ?>" class="getpaid-item-price-input p-1 align-middle font-weight-normal shadow-none m-0 rounded-0 text-center border <?php echo esc_attr( $class ); ?>" style="width: 64px; line-height: 1; min-height: 35px;"> |
|
| 144 | + <input type="text" <?php echo wp_kses_post($data_minimum); ?> name="getpaid-items[<?php echo (int) $item->get_id(); ?>][price]" value="<?php echo esc_attr(getpaid_unstandardize_amount($price)); ?>" placeholder="<?php echo esc_attr(getpaid_unstandardize_amount($item->get_minimum_price())); ?>" class="getpaid-item-price-input p-1 align-middle font-weight-normal shadow-none m-0 rounded-0 text-center border <?php echo esc_attr($class); ?>" style="width: 64px; line-height: 1; min-height: 35px;"> |
|
| 145 | 145 | |
| 146 | - <?php if ( ! empty( $validate_minimum ) ) : ?> |
|
| 146 | + <?php if (!empty($validate_minimum)) : ?> |
|
| 147 | 147 | <div class="invalid-tooltip"> |
| 148 | - <?php echo wp_kses_post( $validate_minimum ); ?> |
|
| 148 | + <?php echo wp_kses_post($validate_minimum); ?> |
|
| 149 | 149 | </div> |
| 150 | 150 | <?php endif; ?> |
| 151 | 151 | |
| 152 | - <?php if ( 'left' != $position ) : ?> |
|
| 152 | + <?php if ('left' != $position) : ?> |
|
| 153 | 153 | <div class="input-group-append"> |
| 154 | - <span class="input-group-text"><?php echo wp_kses_post( wpinv_currency_symbol( $currency ) ); ?></span> |
|
| 154 | + <span class="input-group-text"><?php echo wp_kses_post(wpinv_currency_symbol($currency)); ?></span> |
|
| 155 | 155 | </div> |
| 156 | 156 | <?php endif; ?> |
| 157 | 157 | </div> |
@@ -159,23 +159,23 @@ discard block |
||
| 159 | 159 | <?php |
| 160 | 160 | |
| 161 | 161 | } else { |
| 162 | - echo wp_kses_post( wpinv_price( $item->get_price(), $currency ) ); |
|
| 162 | + echo wp_kses_post(wpinv_price($item->get_price(), $currency)); |
|
| 163 | 163 | |
| 164 | 164 | ?> |
| 165 | - <input name='getpaid-items[<?php echo (int) $item->get_id(); ?>][price]' type='hidden' class='getpaid-item-price-input' value='<?php echo esc_attr( $item->get_price() ); ?>'> |
|
| 165 | + <input name='getpaid-items[<?php echo (int) $item->get_id(); ?>][price]' type='hidden' class='getpaid-item-price-input' value='<?php echo esc_attr($item->get_price()); ?>'> |
|
| 166 | 166 | <?php |
| 167 | 167 | } |
| 168 | 168 | |
| 169 | 169 | printf( |
| 170 | 170 | '<small class="d-sm-none text-muted form-text getpaid-mobile-item-subtotal">%s</small>', |
| 171 | - sprintf( esc_html__( 'Subtotal: %s', 'invoicing' ), wp_kses_post( wpinv_price( $item->get_sub_total(), $currency ) ) ) |
|
| 171 | + sprintf(esc_html__('Subtotal: %s', 'invoicing'), wp_kses_post(wpinv_price($item->get_sub_total(), $currency))) |
|
| 172 | 172 | ); |
| 173 | 173 | } |
| 174 | 174 | |
| 175 | 175 | // Item quantity. |
| 176 | - if ( 'quantity' == $key ) { |
|
| 176 | + if ('quantity' == $key) { |
|
| 177 | 177 | |
| 178 | - if ( $item->allows_quantities() ) { |
|
| 178 | + if ($item->allows_quantities()) { |
|
| 179 | 179 | ?> |
| 180 | 180 | <input name='getpaid-items[<?php echo (int) $item->get_id(); ?>][quantity]' type="number" step="0.01" style='width: 64px; line-height: 1; min-height: 35px;' class='getpaid-item-quantity-input p-1 align-middle font-weight-normal shadow-none m-0 rounded-0 text-center border' value='<?php echo (float) $item->get_quantity() == 0 ? 1 : (float) $item->get_quantity(); ?>' min='1' <?php echo null !== $max_qty ? 'max="' . (float) $max_qty . '"' : ''; ?> required> |
| 181 | 181 | <?php |
@@ -189,11 +189,11 @@ discard block |
||
| 189 | 189 | } |
| 190 | 190 | |
| 191 | 191 | // Item sub total. |
| 192 | - if ( 'subtotal' == $key ) { |
|
| 193 | - echo wp_kses_post( wpinv_price( $item->get_sub_total(), $currency ) ); |
|
| 192 | + if ('subtotal' == $key) { |
|
| 193 | + echo wp_kses_post(wpinv_price($item->get_sub_total(), $currency)); |
|
| 194 | 194 | } |
| 195 | 195 | |
| 196 | - do_action( "getpaid_payment_form_cart_item_$key", $item, $form ); |
|
| 196 | + do_action("getpaid_payment_form_cart_item_$key", $item, $form); |
|
| 197 | 197 | ?> |
| 198 | 198 | |
| 199 | 199 | </div> |
@@ -204,4 +204,4 @@ discard block |
||
| 204 | 204 | |
| 205 | 205 | </div> |
| 206 | 206 | <?php |
| 207 | -do_action( 'getpaid_payment_form_cart_item', $form, $item ); |
|
| 207 | +do_action('getpaid_payment_form_cart_item', $form, $item); |
|
@@ -7,34 +7,34 @@ discard block |
||
| 7 | 7 | * @version 1.0.19 |
| 8 | 8 | */ |
| 9 | 9 | |
| 10 | -defined( 'ABSPATH' ) || exit; |
|
| 10 | +defined('ABSPATH') || exit; |
|
| 11 | 11 | |
| 12 | 12 | // Cart table columns. |
| 13 | 13 | $columns = array( |
| 14 | - 'name' => __( 'Item', 'invoicing' ), |
|
| 15 | - 'price' => __( 'Price', 'invoicing' ), |
|
| 16 | - 'quantity' => __( 'Qty', 'invoicing' ), |
|
| 17 | - 'subtotal' => __( 'Subtotal', 'invoicing' ), |
|
| 14 | + 'name' => __('Item', 'invoicing'), |
|
| 15 | + 'price' => __('Price', 'invoicing'), |
|
| 16 | + 'quantity' => __('Qty', 'invoicing'), |
|
| 17 | + 'subtotal' => __('Subtotal', 'invoicing'), |
|
| 18 | 18 | ); |
| 19 | 19 | |
| 20 | -if ( ! empty( $form->invoice ) ) { |
|
| 21 | - $columns = getpaid_invoice_item_columns( $form->invoice ); |
|
| 20 | +if (!empty($form->invoice)) { |
|
| 21 | + $columns = getpaid_invoice_item_columns($form->invoice); |
|
| 22 | 22 | } |
| 23 | 23 | |
| 24 | -if ( isset( $columns['tax_rate'] ) ) { |
|
| 25 | - unset( $columns['tax_rate'] ); |
|
| 24 | +if (isset($columns['tax_rate'])) { |
|
| 25 | + unset($columns['tax_rate']); |
|
| 26 | 26 | } |
| 27 | 27 | |
| 28 | -$columns = apply_filters( 'getpaid_payment_form_cart_table_columns', $columns, $form ); |
|
| 28 | +$columns = apply_filters('getpaid_payment_form_cart_table_columns', $columns, $form); |
|
| 29 | 29 | |
| 30 | 30 | ?> |
| 31 | 31 | <div class="getpaid-payment-form-items-cart border form-group"> |
| 32 | 32 | |
| 33 | 33 | <div class="getpaid-payment-form-items-cart-header font-weight-bold bg-light border-bottom py-2 px-3"> |
| 34 | 34 | <div class="form-row"> |
| 35 | - <?php foreach ( $columns as $key => $label ) : ?> |
|
| 36 | - <div class="<?php echo 'name' == $key ? 'col-6' : 'col'; ?> <?php echo ( in_array( $key, array( 'subtotal', 'quantity', 'tax_rate' ) ) ) ? 'd-none d-sm-block' : ''; ?> getpaid-form-cart-item-<?php echo esc_attr( $key ); ?>"> |
|
| 37 | - <span><?php echo esc_html( $label ); ?></span> |
|
| 35 | + <?php foreach ($columns as $key => $label) : ?> |
|
| 36 | + <div class="<?php echo 'name' == $key ? 'col-6' : 'col'; ?> <?php echo (in_array($key, array('subtotal', 'quantity', 'tax_rate'))) ? 'd-none d-sm-block' : ''; ?> getpaid-form-cart-item-<?php echo esc_attr($key); ?>"> |
|
| 37 | + <span><?php echo esc_html($label); ?></span> |
|
| 38 | 38 | </div> |
| 39 | 39 | <?php endforeach; ?> |
| 40 | 40 | </div> |
@@ -43,16 +43,16 @@ discard block |
||
| 43 | 43 | <?php |
| 44 | 44 | |
| 45 | 45 | // Display the item totals. |
| 46 | - foreach ( $form->get_items() as $item ) { |
|
| 47 | - wpinv_get_template( 'payment-forms/cart-item.php', compact( 'form', 'item', 'columns' ) ); |
|
| 46 | + foreach ($form->get_items() as $item) { |
|
| 47 | + wpinv_get_template('payment-forms/cart-item.php', compact('form', 'item', 'columns')); |
|
| 48 | 48 | } |
| 49 | 49 | |
| 50 | 50 | // Display the cart totals. |
| 51 | - wpinv_get_template( 'payment-forms/cart-totals.php', compact( 'form' ) ); |
|
| 51 | + wpinv_get_template('payment-forms/cart-totals.php', compact('form')); |
|
| 52 | 52 | |
| 53 | 53 | ?> |
| 54 | 54 | </div> |
| 55 | 55 | |
| 56 | 56 | <?php |
| 57 | 57 | |
| 58 | -do_action( 'getpaid_after_payment_form_cart', $form ); |
|
| 58 | +do_action('getpaid_after_payment_form_cart', $form); |
|
@@ -8,18 +8,18 @@ discard block |
||
| 8 | 8 | * @var WPInv_Invoice $invoice |
| 9 | 9 | */ |
| 10 | 10 | |
| 11 | -defined( 'ABSPATH' ) || exit; |
|
| 11 | +defined('ABSPATH') || exit; |
|
| 12 | 12 | |
| 13 | -$column_count = count( $columns ); |
|
| 13 | +$column_count = count($columns); |
|
| 14 | 14 | ?> |
| 15 | 15 | |
| 16 | -<?php do_action( 'wpinv_before_email_items', $invoice ); ?> |
|
| 16 | +<?php do_action('wpinv_before_email_items', $invoice); ?> |
|
| 17 | 17 | |
| 18 | 18 | |
| 19 | 19 | <div id="wpinv-email-items"> |
| 20 | 20 | |
| 21 | 21 | <h3 class="invoice-items-title"> |
| 22 | - <?php echo sprintf( esc_html__( '%s Items', 'invoicing' ), esc_html( ucfirst( $invoice->get_invoice_quote_type() ) ) ); ?> |
|
| 22 | + <?php echo sprintf(esc_html__('%s Items', 'invoicing'), esc_html(ucfirst($invoice->get_invoice_quote_type()))); ?> |
|
| 23 | 23 | </h3> |
| 24 | 24 | |
| 25 | 25 | <table class="table table-bordered table-hover"> |
@@ -28,9 +28,9 @@ discard block |
||
| 28 | 28 | |
| 29 | 29 | <tr class="wpinv_cart_header_row"> |
| 30 | 30 | |
| 31 | - <?php foreach ( $columns as $key => $label ) : ?> |
|
| 32 | - <th class="<?php echo 'name' == $key ? 'text-left' : 'text-right'; ?> wpinv_cart_item_<?php echo esc_attr( $key ); ?>"> |
|
| 33 | - <?php echo esc_html( $label ); ?> |
|
| 31 | + <?php foreach ($columns as $key => $label) : ?> |
|
| 32 | + <th class="<?php echo 'name' == $key ? 'text-left' : 'text-right'; ?> wpinv_cart_item_<?php echo esc_attr($key); ?>"> |
|
| 33 | + <?php echo esc_html($label); ?> |
|
| 34 | 34 | </th> |
| 35 | 35 | <?php endforeach; ?> |
| 36 | 36 | |
@@ -43,13 +43,13 @@ discard block |
||
| 43 | 43 | <?php |
| 44 | 44 | |
| 45 | 45 | // Display the item totals. |
| 46 | - foreach ( $invoice->get_items() as $item ) { |
|
| 47 | - wpinv_get_template( 'emails/invoice-item.php', compact( 'invoice', 'item', 'columns' ) ); |
|
| 46 | + foreach ($invoice->get_items() as $item) { |
|
| 47 | + wpinv_get_template('emails/invoice-item.php', compact('invoice', 'item', 'columns')); |
|
| 48 | 48 | } |
| 49 | 49 | |
| 50 | 50 | // Display the fee totals. |
| 51 | - foreach ( $invoice->get_fees() as $fee ) { |
|
| 52 | - wpinv_get_template( 'emails/fee-item.php', compact( 'invoice', 'fee', 'columns' ) ); |
|
| 51 | + foreach ($invoice->get_fees() as $fee) { |
|
| 52 | + wpinv_get_template('emails/fee-item.php', compact('invoice', 'fee', 'columns')); |
|
| 53 | 53 | } |
| 54 | 54 | |
| 55 | 55 | ?> |
@@ -57,7 +57,7 @@ discard block |
||
| 57 | 57 | </tbody> |
| 58 | 58 | |
| 59 | 59 | <tfoot> |
| 60 | - <?php wpinv_get_template( 'emails/invoice-totals.php', compact( 'invoice', 'column_count' ) ); ?> |
|
| 60 | + <?php wpinv_get_template('emails/invoice-totals.php', compact('invoice', 'column_count')); ?> |
|
| 61 | 61 | </tfoot> |
| 62 | 62 | |
| 63 | 63 | </table> |
@@ -10,64 +10,64 @@ discard block |
||
| 10 | 10 | * @var array $columns |
| 11 | 11 | */ |
| 12 | 12 | |
| 13 | -defined( 'ABSPATH' ) || exit; |
|
| 13 | +defined('ABSPATH') || exit; |
|
| 14 | 14 | |
| 15 | 15 | ?> |
| 16 | 16 | |
| 17 | -<?php do_action( 'getpaid_before_email_line_item', $invoice, $item ); ?> |
|
| 17 | +<?php do_action('getpaid_before_email_line_item', $invoice, $item); ?> |
|
| 18 | 18 | |
| 19 | -<tr class="wpinv_cart_item item-type-<?php echo esc_attr( $item->get_type() ); ?>"> |
|
| 19 | +<tr class="wpinv_cart_item item-type-<?php echo esc_attr($item->get_type()); ?>"> |
|
| 20 | 20 | |
| 21 | - <?php foreach ( array_keys( $columns ) as $column ) : ?> |
|
| 21 | + <?php foreach (array_keys($columns) as $column) : ?> |
|
| 22 | 22 | |
| 23 | - <td class="<?php echo 'name' == $column ? 'text-left' : 'text-right'; ?> wpinv_cart_item_<?php echo esc_attr( $column ); ?>"> |
|
| 23 | + <td class="<?php echo 'name' == $column ? 'text-left' : 'text-right'; ?> wpinv_cart_item_<?php echo esc_attr($column); ?>"> |
|
| 24 | 24 | |
| 25 | 25 | <?php |
| 26 | 26 | |
| 27 | 27 | // Fires before printing a line item column. |
| 28 | - do_action( "getpaid_email_line_item_before_$column", $item, $invoice ); |
|
| 28 | + do_action("getpaid_email_line_item_before_$column", $item, $invoice); |
|
| 29 | 29 | |
| 30 | 30 | // Item name. |
| 31 | - if ( 'name' == $column ) { |
|
| 31 | + if ('name' == $column) { |
|
| 32 | 32 | |
| 33 | 33 | // Display the name. |
| 34 | - echo '<div class="wpinv_email_cart_item_title">' . esc_html( $item->get_name() ) . '</div>'; |
|
| 34 | + echo '<div class="wpinv_email_cart_item_title">' . esc_html($item->get_name()) . '</div>'; |
|
| 35 | 35 | |
| 36 | 36 | // And an optional description. |
| 37 | 37 | $description = $item->get_description(); |
| 38 | 38 | |
| 39 | - if ( ! empty( $description ) ) { |
|
| 40 | - echo "<p class='small'>" . wp_kses_post( $description ) . "</p>"; |
|
| 39 | + if (!empty($description)) { |
|
| 40 | + echo "<p class='small'>" . wp_kses_post($description) . "</p>"; |
|
| 41 | 41 | } |
| 42 | 42 | } |
| 43 | 43 | |
| 44 | 44 | // Item price. |
| 45 | - if ( 'price' == $column ) { |
|
| 45 | + if ('price' == $column) { |
|
| 46 | 46 | |
| 47 | 47 | // Display the item price (or recurring price if this is a renewal invoice) |
| 48 | 48 | $price = $invoice->is_renewal() ? $item->get_price() : $item->get_initial_price(); |
| 49 | - wpinv_the_price( $price, $invoice->get_currency() ); |
|
| 49 | + wpinv_the_price($price, $invoice->get_currency()); |
|
| 50 | 50 | |
| 51 | 51 | } |
| 52 | 52 | |
| 53 | 53 | // Item quantity. |
| 54 | - if ( 'quantity' == $column ) { |
|
| 54 | + if ('quantity' == $column) { |
|
| 55 | 55 | echo (float) $item->get_quantity(); |
| 56 | 56 | } |
| 57 | 57 | |
| 58 | 58 | // Tax rate. |
| 59 | - if ( 'tax_rate' == $column ) { |
|
| 60 | - echo floatval( round( getpaid_get_invoice_tax_rate( $invoice, $item ), 2 ) ) . '%'; |
|
| 59 | + if ('tax_rate' == $column) { |
|
| 60 | + echo floatval(round(getpaid_get_invoice_tax_rate($invoice, $item), 2)) . '%'; |
|
| 61 | 61 | } |
| 62 | 62 | |
| 63 | 63 | // Item sub total. |
| 64 | - if ( 'subtotal' == $column ) { |
|
| 64 | + if ('subtotal' == $column) { |
|
| 65 | 65 | $subtotal = $invoice->is_renewal() ? $item->get_recurring_sub_total() : $item->get_sub_total(); |
| 66 | - wpinv_the_price( $subtotal, $invoice->get_currency() ); |
|
| 66 | + wpinv_the_price($subtotal, $invoice->get_currency()); |
|
| 67 | 67 | } |
| 68 | 68 | |
| 69 | 69 | // Fires when printing a line item column. |
| 70 | - do_action( "getpaid_email_line_item_$column", $item, $invoice ); |
|
| 70 | + do_action("getpaid_email_line_item_$column", $item, $invoice); |
|
| 71 | 71 | |
| 72 | 72 | ?> |
| 73 | 73 | |
@@ -77,4 +77,4 @@ discard block |
||
| 77 | 77 | |
| 78 | 78 | </tr> |
| 79 | 79 | |
| 80 | -<?php do_action( 'getpaid_after_email_line_item', $invoice, $item ); ?> |
|
| 80 | +<?php do_action('getpaid_after_email_line_item', $invoice, $item); ?> |
|
@@ -8,45 +8,45 @@ discard block |
||
| 8 | 8 | * @var WPInv_Invoice $invoice |
| 9 | 9 | * @var array $columns |
| 10 | 10 | */ |
| 11 | -defined( 'ABSPATH' ) || exit; |
|
| 11 | +defined('ABSPATH') || exit; |
|
| 12 | 12 | |
| 13 | -$meta_data = getpaid_get_invoice_meta( $invoice ); |
|
| 13 | +$meta_data = getpaid_get_invoice_meta($invoice); |
|
| 14 | 14 | |
| 15 | -if ( isset( $meta_data['status'] ) ) { |
|
| 15 | +if (isset($meta_data['status'])) { |
|
| 16 | 16 | $meta_data['status']['value'] = $invoice->get_status_nicename(); |
| 17 | 17 | } |
| 18 | 18 | |
| 19 | -do_action( 'wpinv_email_before_invoice_details', $invoice, $sent_to_admin ); |
|
| 19 | +do_action('wpinv_email_before_invoice_details', $invoice, $sent_to_admin); |
|
| 20 | 20 | |
| 21 | 21 | ?> |
| 22 | 22 | |
| 23 | 23 | <div id="wpinv-email-details"> |
| 24 | 24 | |
| 25 | 25 | <h3 class="invoice-details-title"> |
| 26 | - <?php echo sprintf( esc_html__( '%s Details', 'invoicing' ), esc_html( ucfirst( $invoice->get_invoice_quote_type() ) ) ); ?> |
|
| 26 | + <?php echo sprintf(esc_html__('%s Details', 'invoicing'), esc_html(ucfirst($invoice->get_invoice_quote_type()))); ?> |
|
| 27 | 27 | </h3> |
| 28 | 28 | |
| 29 | 29 | <table class="table table-bordered table-sm"> |
| 30 | 30 | |
| 31 | - <?php foreach ( $meta_data as $key => $data ) : ?> |
|
| 31 | + <?php foreach ($meta_data as $key => $data) : ?> |
|
| 32 | 32 | |
| 33 | - <?php if ( ! empty( $data['value'] ) ) : ?> |
|
| 33 | + <?php if (!empty($data['value'])) : ?> |
|
| 34 | 34 | |
| 35 | - <?php do_action( "getpaid_before_email_details_$key", $invoice, $data ); ?> |
|
| 35 | + <?php do_action("getpaid_before_email_details_$key", $invoice, $data); ?> |
|
| 36 | 36 | |
| 37 | - <tr class="getpaid-email-details-<?php echo esc_attr( $key ); ?>"> |
|
| 37 | + <tr class="getpaid-email-details-<?php echo esc_attr($key); ?>"> |
|
| 38 | 38 | |
| 39 | 39 | <td class="getpaid-lable-td"> |
| 40 | - <?php echo esc_html( $data['label'] ); ?> |
|
| 40 | + <?php echo esc_html($data['label']); ?> |
|
| 41 | 41 | </td> |
| 42 | 42 | |
| 43 | 43 | <td class="getpaid-value-td"> |
| 44 | - <span class="getpaid-invoice-meta-<?php echo esc_attr( $key ); ?>-value"><?php echo wp_kses_post( $data['value'] ); ?></span> |
|
| 44 | + <span class="getpaid-invoice-meta-<?php echo esc_attr($key); ?>-value"><?php echo wp_kses_post($data['value']); ?></span> |
|
| 45 | 45 | </td> |
| 46 | 46 | |
| 47 | 47 | </tr> |
| 48 | 48 | |
| 49 | - <?php do_action( "getpaid_after_email_details_$key", $invoice, $data ); ?> |
|
| 49 | + <?php do_action("getpaid_after_email_details_$key", $invoice, $data); ?> |
|
| 50 | 50 | |
| 51 | 51 | <?php endif; ?> |
| 52 | 52 | |
@@ -56,4 +56,4 @@ discard block |
||
| 56 | 56 | |
| 57 | 57 | </div> |
| 58 | 58 | |
| 59 | -<?php do_action( 'wpinv_email_after_invoice_details', $invoice, $sent_to_admin ); ?> |
|
| 59 | +<?php do_action('wpinv_email_after_invoice_details', $invoice, $sent_to_admin); ?> |
|
@@ -10,67 +10,67 @@ discard block |
||
| 10 | 10 | * @var array $columns |
| 11 | 11 | */ |
| 12 | 12 | |
| 13 | -defined( 'ABSPATH' ) || exit; |
|
| 13 | +defined('ABSPATH') || exit; |
|
| 14 | 14 | |
| 15 | 15 | ?> |
| 16 | 16 | |
| 17 | -<?php do_action( 'getpaid_before_email_fee_item', $invoice, $fee ); ?> |
|
| 17 | +<?php do_action('getpaid_before_email_fee_item', $invoice, $fee); ?> |
|
| 18 | 18 | |
| 19 | 19 | <tr class="wpinv_cart_item item-fee"> |
| 20 | 20 | |
| 21 | - <?php foreach ( array_keys( $columns ) as $column ) : ?> |
|
| 21 | + <?php foreach (array_keys($columns) as $column) : ?> |
|
| 22 | 22 | |
| 23 | - <td class="<?php echo 'name' == $column ? 'text-left' : 'text-right'; ?> wpinv_cart_item_<?php echo esc_attr( $column ); ?>"> |
|
| 23 | + <td class="<?php echo 'name' == $column ? 'text-left' : 'text-right'; ?> wpinv_cart_item_<?php echo esc_attr($column); ?>"> |
|
| 24 | 24 | |
| 25 | 25 | <?php |
| 26 | 26 | |
| 27 | 27 | // Fires before printing a fee item column. |
| 28 | - do_action( "getpaid_email_fee_item_before_$column", $fee, $invoice ); |
|
| 28 | + do_action("getpaid_email_fee_item_before_$column", $fee, $invoice); |
|
| 29 | 29 | |
| 30 | 30 | // Item name. |
| 31 | - if ( 'name' == $column ) { |
|
| 31 | + if ('name' == $column) { |
|
| 32 | 32 | |
| 33 | 33 | // Display the name. |
| 34 | - echo '<div class="wpinv_email_cart_item_title">' . esc_html( $fee['name'] ) . '</div>'; |
|
| 34 | + echo '<div class="wpinv_email_cart_item_title">' . esc_html($fee['name']) . '</div>'; |
|
| 35 | 35 | |
| 36 | 36 | // And an optional description. |
| 37 | - $description = empty( $fee['description'] ) ? esc_html__( 'Fee', 'invoicing' ) : esc_html( $fee['description'] ); |
|
| 38 | - echo wp_kses_post( "<p class='small'>$description</p>" ); |
|
| 37 | + $description = empty($fee['description']) ? esc_html__('Fee', 'invoicing') : esc_html($fee['description']); |
|
| 38 | + echo wp_kses_post("<p class='small'>$description</p>"); |
|
| 39 | 39 | |
| 40 | 40 | } |
| 41 | 41 | |
| 42 | 42 | // Item price. |
| 43 | - if ( 'price' == $column ) { |
|
| 43 | + if ('price' == $column) { |
|
| 44 | 44 | |
| 45 | 45 | // Display the item price (or recurring price if this is a renewal invoice) |
| 46 | - if ( $invoice->is_recurring() && $invoice->is_renewal() ) { |
|
| 47 | - wpinv_the_price( $fee['recurring_fee'], $invoice->get_currency() ); |
|
| 46 | + if ($invoice->is_recurring() && $invoice->is_renewal()) { |
|
| 47 | + wpinv_the_price($fee['recurring_fee'], $invoice->get_currency()); |
|
| 48 | 48 | } else { |
| 49 | - wpinv_the_price( $fee['initial_fee'], $invoice->get_currency() ); |
|
| 49 | + wpinv_the_price($fee['initial_fee'], $invoice->get_currency()); |
|
| 50 | 50 | } |
| 51 | 51 | } |
| 52 | 52 | |
| 53 | 53 | // Item quantity. |
| 54 | - if ( 'quantity' == $column ) { |
|
| 54 | + if ('quantity' == $column) { |
|
| 55 | 55 | echo '—'; |
| 56 | 56 | } |
| 57 | 57 | |
| 58 | 58 | // Item tax. |
| 59 | - if ( 'tax_rate' == $column ) { |
|
| 59 | + if ('tax_rate' == $column) { |
|
| 60 | 60 | echo '—'; |
| 61 | 61 | } |
| 62 | 62 | |
| 63 | 63 | // Item sub total. |
| 64 | - if ( 'subtotal' == $column ) { |
|
| 65 | - if ( $invoice->is_recurring() && $invoice->is_renewal() ) { |
|
| 66 | - wpinv_the_price( $fee['recurring_fee'], $invoice->get_currency() ); |
|
| 64 | + if ('subtotal' == $column) { |
|
| 65 | + if ($invoice->is_recurring() && $invoice->is_renewal()) { |
|
| 66 | + wpinv_the_price($fee['recurring_fee'], $invoice->get_currency()); |
|
| 67 | 67 | } else { |
| 68 | - wpinv_the_price( $fee['initial_fee'], $invoice->get_currency() ); |
|
| 68 | + wpinv_the_price($fee['initial_fee'], $invoice->get_currency()); |
|
| 69 | 69 | } |
| 70 | 70 | } |
| 71 | 71 | |
| 72 | 72 | // Fires when printing a line item column. |
| 73 | - do_action( "getpaid_email_fee_item_$column", $fee, $invoice ); |
|
| 73 | + do_action("getpaid_email_fee_item_$column", $fee, $invoice); |
|
| 74 | 74 | |
| 75 | 75 | ?> |
| 76 | 76 | |
@@ -80,4 +80,4 @@ discard block |
||
| 80 | 80 | |
| 81 | 81 | </tr> |
| 82 | 82 | |
| 83 | -<?php do_action( 'getpaid_after_email_fee_item', $invoice, $fee ); ?> |
|
| 83 | +<?php do_action('getpaid_after_email_fee_item', $invoice, $fee); ?> |
|
@@ -3,7 +3,7 @@ discard block |
||
| 3 | 3 | * Contains functions that display the subscriptions admin page. |
| 4 | 4 | */ |
| 5 | 5 | |
| 6 | -defined( 'ABSPATH' ) || exit; |
|
| 6 | +defined('ABSPATH') || exit; |
|
| 7 | 7 | |
| 8 | 8 | /** |
| 9 | 9 | * Render the Subscriptions page |
@@ -17,23 +17,23 @@ discard block |
||
| 17 | 17 | ?> |
| 18 | 18 | |
| 19 | 19 | <div class="wrap"> |
| 20 | - <h1><?php echo esc_html( get_admin_page_title() ); ?></h1> |
|
| 20 | + <h1><?php echo esc_html(get_admin_page_title()); ?></h1> |
|
| 21 | 21 | <div class="bsui"> |
| 22 | 22 | |
| 23 | 23 | <?php |
| 24 | 24 | |
| 25 | 25 | // Verify user permissions. |
| 26 | - if ( ! wpinv_current_user_can_manage_invoicing() ) { |
|
| 26 | + if (!wpinv_current_user_can_manage_invoicing()) { |
|
| 27 | 27 | |
| 28 | 28 | aui()->alert( |
| 29 | 29 | array( |
| 30 | 30 | 'type' => 'danger', |
| 31 | - 'content' => __( 'You are not permitted to view this page.', 'invoicing' ), |
|
| 31 | + 'content' => __('You are not permitted to view this page.', 'invoicing'), |
|
| 32 | 32 | ), |
| 33 | 33 | true |
| 34 | 34 | ); |
| 35 | 35 | |
| 36 | - } elseif ( ! empty( $_GET['id'] ) && is_numeric( $_GET['id'] ) ) { |
|
| 36 | + } elseif (!empty($_GET['id']) && is_numeric($_GET['id'])) { |
|
| 37 | 37 | |
| 38 | 38 | // Display a single subscription. |
| 39 | 39 | wpinv_recurring_subscription_details(); |
@@ -67,7 +67,7 @@ discard block |
||
| 67 | 67 | <?php $subscribers_table->views(); ?> |
| 68 | 68 | <form id="subscribers-filter" class="bsui" method="get"> |
| 69 | 69 | <input type="hidden" name="page" value="wpinv-subscriptions" /> |
| 70 | - <?php $subscribers_table->search_box( __( 'Search Subscriptions', 'invoicing' ), 'getpaid-search-subscriptions' ); ?> |
|
| 70 | + <?php $subscribers_table->search_box(__('Search Subscriptions', 'invoicing'), 'getpaid-search-subscriptions'); ?> |
|
| 71 | 71 | <?php $subscribers_table->display(); ?> |
| 72 | 72 | </form> |
| 73 | 73 | <?php |
@@ -83,13 +83,13 @@ discard block |
||
| 83 | 83 | function wpinv_recurring_subscription_details() { |
| 84 | 84 | |
| 85 | 85 | // Fetch the subscription. |
| 86 | - $sub = new WPInv_Subscription( (int) $_GET['id'] ); |
|
| 87 | - if ( ! $sub->exists() ) { |
|
| 86 | + $sub = new WPInv_Subscription((int) $_GET['id']); |
|
| 87 | + if (!$sub->exists()) { |
|
| 88 | 88 | |
| 89 | 89 | aui()->alert( |
| 90 | 90 | array( |
| 91 | 91 | 'type' => 'danger', |
| 92 | - 'content' => __( 'Subscription not found.', 'invoicing' ), |
|
| 92 | + 'content' => __('Subscription not found.', 'invoicing'), |
|
| 93 | 93 | ), |
| 94 | 94 | true |
| 95 | 95 | ); |
@@ -98,32 +98,32 @@ discard block |
||
| 98 | 98 | } |
| 99 | 99 | |
| 100 | 100 | // Use metaboxes to display the subscription details. |
| 101 | - add_meta_box( 'getpaid_admin_subscription_details_metabox', __( 'Subscription Details', 'invoicing' ), 'getpaid_admin_subscription_details_metabox', get_current_screen(), 'normal', 'high' ); |
|
| 102 | - add_meta_box( 'getpaid_admin_subscription_update_metabox', __( 'Change Status', 'invoicing' ), 'getpaid_admin_subscription_update_metabox', get_current_screen(), 'side' ); |
|
| 101 | + add_meta_box('getpaid_admin_subscription_details_metabox', __('Subscription Details', 'invoicing'), 'getpaid_admin_subscription_details_metabox', get_current_screen(), 'normal', 'high'); |
|
| 102 | + add_meta_box('getpaid_admin_subscription_update_metabox', __('Change Status', 'invoicing'), 'getpaid_admin_subscription_update_metabox', get_current_screen(), 'side'); |
|
| 103 | 103 | |
| 104 | 104 | $subscription_id = $sub->get_id(); |
| 105 | - $subscription_groups = getpaid_get_invoice_subscription_groups( $sub->get_parent_invoice_id() ); |
|
| 106 | - $subscription_group = wp_list_filter( $subscription_groups, compact( 'subscription_id' ) ); |
|
| 105 | + $subscription_groups = getpaid_get_invoice_subscription_groups($sub->get_parent_invoice_id()); |
|
| 106 | + $subscription_group = wp_list_filter($subscription_groups, compact('subscription_id')); |
|
| 107 | 107 | |
| 108 | - if ( 1 < count( $subscription_groups ) ) { |
|
| 109 | - add_meta_box( 'getpaid_admin_subscription_related_subscriptions_metabox', __( 'Related Subscriptions', 'invoicing' ), 'getpaid_admin_subscription_related_subscriptions_metabox', get_current_screen(), 'advanced' ); |
|
| 108 | + if (1 < count($subscription_groups)) { |
|
| 109 | + add_meta_box('getpaid_admin_subscription_related_subscriptions_metabox', __('Related Subscriptions', 'invoicing'), 'getpaid_admin_subscription_related_subscriptions_metabox', get_current_screen(), 'advanced'); |
|
| 110 | 110 | } |
| 111 | 111 | |
| 112 | - if ( ! empty( $subscription_group ) ) { |
|
| 113 | - add_meta_box( 'getpaid_admin_subscription_item_details_metabox', __( 'Subscription Items', 'invoicing' ), 'getpaid_admin_subscription_item_details_metabox', get_current_screen(), 'normal', 'low' ); |
|
| 112 | + if (!empty($subscription_group)) { |
|
| 113 | + add_meta_box('getpaid_admin_subscription_item_details_metabox', __('Subscription Items', 'invoicing'), 'getpaid_admin_subscription_item_details_metabox', get_current_screen(), 'normal', 'low'); |
|
| 114 | 114 | } |
| 115 | 115 | |
| 116 | - add_meta_box( 'getpaid_admin_subscription_invoice_details_metabox', __( 'Related Invoices', 'invoicing' ), 'getpaid_admin_subscription_invoice_details_metabox', get_current_screen(), 'advanced' ); |
|
| 116 | + add_meta_box('getpaid_admin_subscription_invoice_details_metabox', __('Related Invoices', 'invoicing'), 'getpaid_admin_subscription_invoice_details_metabox', get_current_screen(), 'advanced'); |
|
| 117 | 117 | |
| 118 | - do_action( 'getpaid_admin_single_subscription_register_metabox', $sub ); |
|
| 118 | + do_action('getpaid_admin_single_subscription_register_metabox', $sub); |
|
| 119 | 119 | |
| 120 | 120 | ?> |
| 121 | 121 | |
| 122 | - <form method="post" action="<?php echo esc_url( admin_url( 'admin.php?page=wpinv-subscriptions&id=' . absint( $sub->get_id() ) ) ); ?>"> |
|
| 122 | + <form method="post" action="<?php echo esc_url(admin_url('admin.php?page=wpinv-subscriptions&id=' . absint($sub->get_id()))); ?>"> |
|
| 123 | 123 | |
| 124 | - <?php wp_nonce_field( 'getpaid-nonce', 'getpaid-nonce' ); ?> |
|
| 125 | - <?php wp_nonce_field( 'meta-box-order', 'meta-box-order-nonce', false ); ?> |
|
| 126 | - <?php wp_nonce_field( 'closedpostboxes', 'closedpostboxesnonce', false ); ?> |
|
| 124 | + <?php wp_nonce_field('getpaid-nonce', 'getpaid-nonce'); ?> |
|
| 125 | + <?php wp_nonce_field('meta-box-order', 'meta-box-order-nonce', false); ?> |
|
| 126 | + <?php wp_nonce_field('closedpostboxes', 'closedpostboxesnonce', false); ?> |
|
| 127 | 127 | <input type="hidden" name="getpaid-admin-action" value="update_single_subscription" /> |
| 128 | 128 | <input type="hidden" name="subscription_id" value="<?php echo (int) $sub->get_id(); ?>" /> |
| 129 | 129 | |
@@ -131,12 +131,12 @@ discard block |
||
| 131 | 131 | <div id="post-body" class="metabox-holder columns-<?php echo 1 == get_current_screen()->get_columns() ? '1' : '2'; ?>"> |
| 132 | 132 | |
| 133 | 133 | <div id="postbox-container-1" class="postbox-container"> |
| 134 | - <?php do_meta_boxes( get_current_screen(), 'side', $sub ); ?> |
|
| 134 | + <?php do_meta_boxes(get_current_screen(), 'side', $sub); ?> |
|
| 135 | 135 | </div> |
| 136 | 136 | |
| 137 | 137 | <div id="postbox-container-2" class="postbox-container"> |
| 138 | - <?php do_meta_boxes( get_current_screen(), 'normal', $sub ); ?> |
|
| 139 | - <?php do_meta_boxes( get_current_screen(), 'advanced', $sub ); ?> |
|
| 138 | + <?php do_meta_boxes(get_current_screen(), 'normal', $sub); ?> |
|
| 139 | + <?php do_meta_boxes(get_current_screen(), 'advanced', $sub); ?> |
|
| 140 | 140 | </div> |
| 141 | 141 | |
| 142 | 142 | </div> |
@@ -155,43 +155,43 @@ discard block |
||
| 155 | 155 | * |
| 156 | 156 | * @param WPInv_Subscription $sub |
| 157 | 157 | */ |
| 158 | -function getpaid_admin_subscription_details_metabox( $sub ) { |
|
| 158 | +function getpaid_admin_subscription_details_metabox($sub) { |
|
| 159 | 159 | |
| 160 | 160 | // Subscription items. |
| 161 | - $subscription_group = getpaid_get_invoice_subscription_group( $sub->get_parent_invoice_id(), $sub->get_id() ); |
|
| 162 | - $items_count = empty( $subscription_group ) ? 1 : count( $subscription_group['items'] ); |
|
| 161 | + $subscription_group = getpaid_get_invoice_subscription_group($sub->get_parent_invoice_id(), $sub->get_id()); |
|
| 162 | + $items_count = empty($subscription_group) ? 1 : count($subscription_group['items']); |
|
| 163 | 163 | |
| 164 | 164 | // Prepare subscription detail columns. |
| 165 | 165 | $fields = apply_filters( |
| 166 | 166 | 'getpaid_subscription_admin_page_fields', |
| 167 | 167 | array( |
| 168 | - 'subscription' => __( 'Subscription', 'invoicing' ), |
|
| 169 | - 'customer' => __( 'Customer', 'invoicing' ), |
|
| 170 | - 'amount' => __( 'Amount', 'invoicing' ), |
|
| 171 | - 'start_date' => __( 'Start Date', 'invoicing' ), |
|
| 172 | - 'renews_on' => __( 'Next Payment', 'invoicing' ), |
|
| 173 | - 'renewals' => __( 'Payments', 'invoicing' ), |
|
| 174 | - 'item' => _n( 'Item', 'Items', $items_count, 'invoicing' ), |
|
| 175 | - 'gateway' => __( 'Payment Method', 'invoicing' ), |
|
| 176 | - 'profile_id' => __( 'Profile ID', 'invoicing' ), |
|
| 177 | - 'status' => __( 'Status', 'invoicing' ), |
|
| 168 | + 'subscription' => __('Subscription', 'invoicing'), |
|
| 169 | + 'customer' => __('Customer', 'invoicing'), |
|
| 170 | + 'amount' => __('Amount', 'invoicing'), |
|
| 171 | + 'start_date' => __('Start Date', 'invoicing'), |
|
| 172 | + 'renews_on' => __('Next Payment', 'invoicing'), |
|
| 173 | + 'renewals' => __('Payments', 'invoicing'), |
|
| 174 | + 'item' => _n('Item', 'Items', $items_count, 'invoicing'), |
|
| 175 | + 'gateway' => __('Payment Method', 'invoicing'), |
|
| 176 | + 'profile_id' => __('Profile ID', 'invoicing'), |
|
| 177 | + 'status' => __('Status', 'invoicing'), |
|
| 178 | 178 | ) |
| 179 | 179 | ); |
| 180 | 180 | |
| 181 | - if ( ! $sub->is_active() ) { |
|
| 181 | + if (!$sub->is_active()) { |
|
| 182 | 182 | |
| 183 | - if ( isset( $fields['renews_on'] ) ) { |
|
| 184 | - unset( $fields['renews_on'] ); |
|
| 183 | + if (isset($fields['renews_on'])) { |
|
| 184 | + unset($fields['renews_on']); |
|
| 185 | 185 | } |
| 186 | 186 | |
| 187 | - if ( isset( $fields['gateway'] ) ) { |
|
| 188 | - unset( $fields['gateway'] ); |
|
| 187 | + if (isset($fields['gateway'])) { |
|
| 188 | + unset($fields['gateway']); |
|
| 189 | 189 | } |
| 190 | 190 | } |
| 191 | 191 | |
| 192 | 192 | $profile_id = $sub->get_profile_id(); |
| 193 | - if ( empty( $profile_id ) && isset( $fields['profile_id'] ) ) { |
|
| 194 | - unset( $fields['profile_id'] ); |
|
| 193 | + if (empty($profile_id) && isset($fields['profile_id'])) { |
|
| 194 | + unset($fields['profile_id']); |
|
| 195 | 195 | } |
| 196 | 196 | |
| 197 | 197 | ?> |
@@ -199,16 +199,16 @@ discard block |
||
| 199 | 199 | <table class="table table-borderless" style="font-size: 14px;"> |
| 200 | 200 | <tbody> |
| 201 | 201 | |
| 202 | - <?php foreach ( $fields as $key => $label ) : ?> |
|
| 202 | + <?php foreach ($fields as $key => $label) : ?> |
|
| 203 | 203 | |
| 204 | - <tr class="getpaid-subscription-meta-<?php echo esc_attr( $key ); ?>"> |
|
| 204 | + <tr class="getpaid-subscription-meta-<?php echo esc_attr($key); ?>"> |
|
| 205 | 205 | |
| 206 | 206 | <th class="w-25" style="font-weight: 500;"> |
| 207 | - <?php echo esc_html( $label ); ?> |
|
| 207 | + <?php echo esc_html($label); ?> |
|
| 208 | 208 | </th> |
| 209 | 209 | |
| 210 | 210 | <td class="w-75 text-muted"> |
| 211 | - <?php do_action( 'getpaid_subscription_admin_display_' . sanitize_key( $key ), $sub, $subscription_group ); ?> |
|
| 211 | + <?php do_action('getpaid_subscription_admin_display_' . sanitize_key($key), $sub, $subscription_group); ?> |
|
| 212 | 212 | </td> |
| 213 | 213 | |
| 214 | 214 | </tr> |
@@ -226,135 +226,135 @@ discard block |
||
| 226 | 226 | * |
| 227 | 227 | * @param WPInv_Subscription $subscription |
| 228 | 228 | */ |
| 229 | -function getpaid_admin_subscription_metabox_display_customer( $subscription ) { |
|
| 229 | +function getpaid_admin_subscription_metabox_display_customer($subscription) { |
|
| 230 | 230 | |
| 231 | - $username = __( '(Missing User)', 'invoicing' ); |
|
| 231 | + $username = __('(Missing User)', 'invoicing'); |
|
| 232 | 232 | |
| 233 | - $user = get_userdata( $subscription->get_customer_id() ); |
|
| 234 | - if ( $user ) { |
|
| 233 | + $user = get_userdata($subscription->get_customer_id()); |
|
| 234 | + if ($user) { |
|
| 235 | 235 | |
| 236 | 236 | $username = sprintf( |
| 237 | 237 | '<a href="user-edit.php?user_id=%s">%s</a>', |
| 238 | - absint( $user->ID ), |
|
| 239 | - ! empty( $user->display_name ) ? esc_html( $user->display_name ) : sanitize_email( $user->user_email ) |
|
| 238 | + absint($user->ID), |
|
| 239 | + !empty($user->display_name) ? esc_html($user->display_name) : sanitize_email($user->user_email) |
|
| 240 | 240 | ); |
| 241 | 241 | |
| 242 | 242 | } |
| 243 | 243 | |
| 244 | - echo wp_kses_post( $username ); |
|
| 244 | + echo wp_kses_post($username); |
|
| 245 | 245 | } |
| 246 | -add_action( 'getpaid_subscription_admin_display_customer', 'getpaid_admin_subscription_metabox_display_customer' ); |
|
| 246 | +add_action('getpaid_subscription_admin_display_customer', 'getpaid_admin_subscription_metabox_display_customer'); |
|
| 247 | 247 | |
| 248 | 248 | /** |
| 249 | 249 | * Displays the subscription amount. |
| 250 | 250 | * |
| 251 | 251 | * @param WPInv_Subscription $subscription |
| 252 | 252 | */ |
| 253 | -function getpaid_admin_subscription_metabox_display_amount( $subscription ) { |
|
| 254 | - $amount = getpaid_get_formatted_subscription_amount( $subscription ); |
|
| 255 | - echo wp_kses_post( "<span>$amount</span>" ); |
|
| 253 | +function getpaid_admin_subscription_metabox_display_amount($subscription) { |
|
| 254 | + $amount = getpaid_get_formatted_subscription_amount($subscription); |
|
| 255 | + echo wp_kses_post("<span>$amount</span>"); |
|
| 256 | 256 | } |
| 257 | -add_action( 'getpaid_subscription_admin_display_amount', 'getpaid_admin_subscription_metabox_display_amount' ); |
|
| 257 | +add_action('getpaid_subscription_admin_display_amount', 'getpaid_admin_subscription_metabox_display_amount'); |
|
| 258 | 258 | |
| 259 | 259 | /** |
| 260 | 260 | * Displays the subscription id. |
| 261 | 261 | * |
| 262 | 262 | * @param WPInv_Subscription $subscription |
| 263 | 263 | */ |
| 264 | -function getpaid_admin_subscription_metabox_display_id( $subscription ) { |
|
| 264 | +function getpaid_admin_subscription_metabox_display_id($subscription) { |
|
| 265 | 265 | |
| 266 | 266 | printf( |
| 267 | 267 | '<a href="%s">#%s</a>', |
| 268 | - esc_url( admin_url( 'admin.php?page=wpinv-subscriptions&id=' . absint( $subscription->get_id() ) ) ), |
|
| 269 | - absint( $subscription->get_id() ) |
|
| 268 | + esc_url(admin_url('admin.php?page=wpinv-subscriptions&id=' . absint($subscription->get_id()))), |
|
| 269 | + absint($subscription->get_id()) |
|
| 270 | 270 | ); |
| 271 | 271 | |
| 272 | 272 | } |
| 273 | -add_action( 'getpaid_subscription_admin_display_subscription', 'getpaid_admin_subscription_metabox_display_id' ); |
|
| 273 | +add_action('getpaid_subscription_admin_display_subscription', 'getpaid_admin_subscription_metabox_display_id'); |
|
| 274 | 274 | |
| 275 | 275 | /** |
| 276 | 276 | * Displays the subscription renewal date. |
| 277 | 277 | * |
| 278 | 278 | * @param WPInv_Subscription $subscription |
| 279 | 279 | */ |
| 280 | -function getpaid_admin_subscription_metabox_display_start_date( $subscription ) { |
|
| 281 | - echo esc_html( getpaid_format_date_value( $subscription->get_date_created() ) ); |
|
| 280 | +function getpaid_admin_subscription_metabox_display_start_date($subscription) { |
|
| 281 | + echo esc_html(getpaid_format_date_value($subscription->get_date_created())); |
|
| 282 | 282 | } |
| 283 | -add_action( 'getpaid_subscription_admin_display_start_date', 'getpaid_admin_subscription_metabox_display_start_date' ); |
|
| 283 | +add_action('getpaid_subscription_admin_display_start_date', 'getpaid_admin_subscription_metabox_display_start_date'); |
|
| 284 | 284 | |
| 285 | 285 | /** |
| 286 | 286 | * Displays the subscription renewal date. |
| 287 | 287 | * |
| 288 | 288 | * @param WPInv_Subscription $subscription |
| 289 | 289 | */ |
| 290 | -function getpaid_admin_subscription_metabox_display_renews_on( $subscription ) { |
|
| 291 | - echo esc_html( getpaid_format_date_value( $subscription->get_expiration() ) ); |
|
| 290 | +function getpaid_admin_subscription_metabox_display_renews_on($subscription) { |
|
| 291 | + echo esc_html(getpaid_format_date_value($subscription->get_expiration())); |
|
| 292 | 292 | } |
| 293 | -add_action( 'getpaid_subscription_admin_display_renews_on', 'getpaid_admin_subscription_metabox_display_renews_on' ); |
|
| 293 | +add_action('getpaid_subscription_admin_display_renews_on', 'getpaid_admin_subscription_metabox_display_renews_on'); |
|
| 294 | 294 | |
| 295 | 295 | /** |
| 296 | 296 | * Displays the subscription renewal count. |
| 297 | 297 | * |
| 298 | 298 | * @param WPInv_Subscription $subscription |
| 299 | 299 | */ |
| 300 | -function getpaid_admin_subscription_metabox_display_renewals( $subscription ) { |
|
| 300 | +function getpaid_admin_subscription_metabox_display_renewals($subscription) { |
|
| 301 | 301 | $max_bills = $subscription->get_bill_times(); |
| 302 | - echo ( (int) $subscription->get_times_billed() ) . ' / ' . ( empty( $max_bills ) ? '∞' : (int) $max_bills ); |
|
| 302 | + echo ((int) $subscription->get_times_billed()) . ' / ' . (empty($max_bills) ? '∞' : (int) $max_bills); |
|
| 303 | 303 | } |
| 304 | -add_action( 'getpaid_subscription_admin_display_renewals', 'getpaid_admin_subscription_metabox_display_renewals' ); |
|
| 304 | +add_action('getpaid_subscription_admin_display_renewals', 'getpaid_admin_subscription_metabox_display_renewals'); |
|
| 305 | 305 | /** |
| 306 | 306 | * Displays the subscription item. |
| 307 | 307 | * |
| 308 | 308 | * @param WPInv_Subscription $subscription |
| 309 | 309 | * @param false|array $subscription_group |
| 310 | 310 | */ |
| 311 | -function getpaid_admin_subscription_metabox_display_item( $subscription, $subscription_group = false ) { |
|
| 311 | +function getpaid_admin_subscription_metabox_display_item($subscription, $subscription_group = false) { |
|
| 312 | 312 | |
| 313 | - if ( empty( $subscription_group ) ) { |
|
| 314 | - echo wp_kses_post( WPInv_Subscriptions_List_Table::generate_item_markup( $subscription->get_product_id() ) ); |
|
| 313 | + if (empty($subscription_group)) { |
|
| 314 | + echo wp_kses_post(WPInv_Subscriptions_List_Table::generate_item_markup($subscription->get_product_id())); |
|
| 315 | 315 | return; |
| 316 | 316 | } |
| 317 | 317 | |
| 318 | - $markup = array_map( array( 'WPInv_Subscriptions_List_Table', 'generate_item_markup' ), array_keys( $subscription_group['items'] ) ); |
|
| 319 | - echo wp_kses_post( implode( ' | ', $markup ) ); |
|
| 318 | + $markup = array_map(array('WPInv_Subscriptions_List_Table', 'generate_item_markup'), array_keys($subscription_group['items'])); |
|
| 319 | + echo wp_kses_post(implode(' | ', $markup)); |
|
| 320 | 320 | |
| 321 | 321 | } |
| 322 | -add_action( 'getpaid_subscription_admin_display_item', 'getpaid_admin_subscription_metabox_display_item', 10, 2 ); |
|
| 322 | +add_action('getpaid_subscription_admin_display_item', 'getpaid_admin_subscription_metabox_display_item', 10, 2); |
|
| 323 | 323 | |
| 324 | 324 | /** |
| 325 | 325 | * Displays the subscription gateway. |
| 326 | 326 | * |
| 327 | 327 | * @param WPInv_Subscription $subscription |
| 328 | 328 | */ |
| 329 | -function getpaid_admin_subscription_metabox_display_gateway( $subscription ) { |
|
| 329 | +function getpaid_admin_subscription_metabox_display_gateway($subscription) { |
|
| 330 | 330 | |
| 331 | 331 | $gateway = $subscription->get_gateway(); |
| 332 | 332 | |
| 333 | - if ( ! empty( $gateway ) ) { |
|
| 334 | - echo esc_html( wpinv_get_gateway_admin_label( $gateway ) ); |
|
| 333 | + if (!empty($gateway)) { |
|
| 334 | + echo esc_html(wpinv_get_gateway_admin_label($gateway)); |
|
| 335 | 335 | } else { |
| 336 | 336 | echo '—'; |
| 337 | 337 | } |
| 338 | 338 | |
| 339 | 339 | } |
| 340 | -add_action( 'getpaid_subscription_admin_display_gateway', 'getpaid_admin_subscription_metabox_display_gateway' ); |
|
| 340 | +add_action('getpaid_subscription_admin_display_gateway', 'getpaid_admin_subscription_metabox_display_gateway'); |
|
| 341 | 341 | |
| 342 | 342 | /** |
| 343 | 343 | * Displays the subscription status. |
| 344 | 344 | * |
| 345 | 345 | * @param WPInv_Subscription $subscription |
| 346 | 346 | */ |
| 347 | -function getpaid_admin_subscription_metabox_display_status( $subscription ) { |
|
| 348 | - echo wp_kses_post( $subscription->get_status_label_html() ); |
|
| 347 | +function getpaid_admin_subscription_metabox_display_status($subscription) { |
|
| 348 | + echo wp_kses_post($subscription->get_status_label_html()); |
|
| 349 | 349 | } |
| 350 | -add_action( 'getpaid_subscription_admin_display_status', 'getpaid_admin_subscription_metabox_display_status' ); |
|
| 350 | +add_action('getpaid_subscription_admin_display_status', 'getpaid_admin_subscription_metabox_display_status'); |
|
| 351 | 351 | |
| 352 | 352 | /** |
| 353 | 353 | * Displays the subscription profile id. |
| 354 | 354 | * |
| 355 | 355 | * @param WPInv_Subscription $subscription |
| 356 | 356 | */ |
| 357 | -function getpaid_admin_subscription_metabox_display_profile_id( $subscription ) { |
|
| 357 | +function getpaid_admin_subscription_metabox_display_profile_id($subscription) { |
|
| 358 | 358 | |
| 359 | 359 | $profile_id = $subscription->get_profile_id(); |
| 360 | 360 | |
@@ -363,30 +363,30 @@ discard block |
||
| 363 | 363 | 'type' => 'text', |
| 364 | 364 | 'id' => 'wpinv_subscription_profile_id', |
| 365 | 365 | 'name' => 'wpinv_subscription_profile_id', |
| 366 | - 'label' => __( 'Profile Id', 'invoicing' ), |
|
| 366 | + 'label' => __('Profile Id', 'invoicing'), |
|
| 367 | 367 | 'label_type' => 'hidden', |
| 368 | - 'placeholder' => __( 'Profile Id', 'invoicing' ), |
|
| 369 | - 'value' => esc_attr( $profile_id ), |
|
| 368 | + 'placeholder' => __('Profile Id', 'invoicing'), |
|
| 369 | + 'value' => esc_attr($profile_id), |
|
| 370 | 370 | 'input_group_right' => '', |
| 371 | 371 | 'no_wrap' => true, |
| 372 | 372 | ), |
| 373 | 373 | true |
| 374 | 374 | ); |
| 375 | 375 | |
| 376 | - $url = apply_filters( 'getpaid_remote_subscription_profile_url', '', $subscription ); |
|
| 377 | - if ( ! empty( $url ) ) { |
|
| 378 | - echo ' <a href="' . esc_url_raw( $url ) . '" title="' . esc_attr__( 'View in Gateway', 'invoicing' ) . '" target="_blank"><i class="fas fa-external-link-alt fa-xs fa-fw align-top"></i></a>'; |
|
| 376 | + $url = apply_filters('getpaid_remote_subscription_profile_url', '', $subscription); |
|
| 377 | + if (!empty($url)) { |
|
| 378 | + echo ' <a href="' . esc_url_raw($url) . '" title="' . esc_attr__('View in Gateway', 'invoicing') . '" target="_blank"><i class="fas fa-external-link-alt fa-xs fa-fw align-top"></i></a>'; |
|
| 379 | 379 | } |
| 380 | 380 | |
| 381 | 381 | } |
| 382 | -add_action( 'getpaid_subscription_admin_display_profile_id', 'getpaid_admin_subscription_metabox_display_profile_id' ); |
|
| 382 | +add_action('getpaid_subscription_admin_display_profile_id', 'getpaid_admin_subscription_metabox_display_profile_id'); |
|
| 383 | 383 | |
| 384 | 384 | /** |
| 385 | 385 | * Displays the subscriptions update metabox. |
| 386 | 386 | * |
| 387 | 387 | * @param WPInv_Subscription $subscription |
| 388 | 388 | */ |
| 389 | -function getpaid_admin_subscription_update_metabox( $subscription ) { |
|
| 389 | +function getpaid_admin_subscription_update_metabox($subscription) { |
|
| 390 | 390 | |
| 391 | 391 | ?> |
| 392 | 392 | <div class="mt-3"> |
@@ -399,10 +399,10 @@ discard block |
||
| 399 | 399 | 'id' => 'subscription_status_update_select', |
| 400 | 400 | 'required' => true, |
| 401 | 401 | 'no_wrap' => false, |
| 402 | - 'label' => __( 'Subscription Status', 'invoicing' ), |
|
| 403 | - 'help_text' => __( 'Updating the status will trigger related actions and hooks', 'invoicing' ), |
|
| 402 | + 'label' => __('Subscription Status', 'invoicing'), |
|
| 403 | + 'help_text' => __('Updating the status will trigger related actions and hooks', 'invoicing'), |
|
| 404 | 404 | 'select2' => true, |
| 405 | - 'value' => $subscription->get_status( 'edit' ), |
|
| 405 | + 'value' => $subscription->get_status('edit'), |
|
| 406 | 406 | ), |
| 407 | 407 | true |
| 408 | 408 | ); |
@@ -411,14 +411,14 @@ discard block |
||
| 411 | 411 | <div class="mt-2 px-3 py-2 bg-light border-top" style="margin: -12px;"> |
| 412 | 412 | |
| 413 | 413 | <?php |
| 414 | - submit_button( __( 'Update', 'invoicing' ), 'primary', 'submit', false ); |
|
| 414 | + submit_button(__('Update', 'invoicing'), 'primary', 'submit', false); |
|
| 415 | 415 | |
| 416 | - $url = wp_nonce_url( add_query_arg( 'getpaid-admin-action', 'subscription_manual_renew' ), 'getpaid-nonce', 'getpaid-nonce' ); |
|
| 417 | - $anchor = __( 'Renew Subscription', 'invoicing' ); |
|
| 418 | - $title = esc_attr__( 'Are you sure you want to extend the subscription and generate a new invoice that will be automatically marked as paid?', 'invoicing' ); |
|
| 416 | + $url = wp_nonce_url(add_query_arg('getpaid-admin-action', 'subscription_manual_renew'), 'getpaid-nonce', 'getpaid-nonce'); |
|
| 417 | + $anchor = __('Renew Subscription', 'invoicing'); |
|
| 418 | + $title = esc_attr__('Are you sure you want to extend the subscription and generate a new invoice that will be automatically marked as paid?', 'invoicing'); |
|
| 419 | 419 | |
| 420 | - if ( $subscription->is_active() ) { |
|
| 421 | - echo "<a href='" . esc_url( $url ) . "' class='float-right text-muted' onclick='return confirm(\"" . esc_attr( $title ) . "\")'>" . esc_html( $anchor ) . "</a>"; |
|
| 420 | + if ($subscription->is_active()) { |
|
| 421 | + echo "<a href='" . esc_url($url) . "' class='float-right text-muted' onclick='return confirm(\"" . esc_attr($title) . "\")'>" . esc_html($anchor) . "</a>"; |
|
| 422 | 422 | } |
| 423 | 423 | |
| 424 | 424 | echo '</div></div>'; |
@@ -430,44 +430,44 @@ discard block |
||
| 430 | 430 | * @param WPInv_Subscription $subscription |
| 431 | 431 | * @param bool $strict Whether or not to skip invoices of sibling subscriptions |
| 432 | 432 | */ |
| 433 | -function getpaid_admin_subscription_invoice_details_metabox( $subscription, $strict = true ) { |
|
| 433 | +function getpaid_admin_subscription_invoice_details_metabox($subscription, $strict = true) { |
|
| 434 | 434 | |
| 435 | 435 | $columns = apply_filters( |
| 436 | 436 | 'getpaid_subscription_related_invoices_columns', |
| 437 | 437 | array( |
| 438 | - 'invoice' => __( 'Invoice', 'invoicing' ), |
|
| 439 | - 'relationship' => __( 'Relationship', 'invoicing' ), |
|
| 440 | - 'date' => __( 'Date', 'invoicing' ), |
|
| 441 | - 'status' => __( 'Status', 'invoicing' ), |
|
| 442 | - 'total' => __( 'Total', 'invoicing' ), |
|
| 438 | + 'invoice' => __('Invoice', 'invoicing'), |
|
| 439 | + 'relationship' => __('Relationship', 'invoicing'), |
|
| 440 | + 'date' => __('Date', 'invoicing'), |
|
| 441 | + 'status' => __('Status', 'invoicing'), |
|
| 442 | + 'total' => __('Total', 'invoicing'), |
|
| 443 | 443 | ), |
| 444 | 444 | $subscription |
| 445 | 445 | ); |
| 446 | 446 | |
| 447 | 447 | // Prepare the invoices. |
| 448 | - $payments = $subscription->get_child_payments( ! is_admin() ); |
|
| 448 | + $payments = $subscription->get_child_payments(!is_admin()); |
|
| 449 | 449 | $parent = $subscription->get_parent_invoice(); |
| 450 | 450 | |
| 451 | - if ( $parent->exists() ) { |
|
| 452 | - $payments = array_merge( array( $parent ), $payments ); |
|
| 451 | + if ($parent->exists()) { |
|
| 452 | + $payments = array_merge(array($parent), $payments); |
|
| 453 | 453 | } |
| 454 | 454 | |
| 455 | 455 | $table_class = 'w-100 bg-white'; |
| 456 | 456 | |
| 457 | - if ( ! is_admin() ) { |
|
| 457 | + if (!is_admin()) { |
|
| 458 | 458 | $table_class = 'table table-bordered'; |
| 459 | 459 | } |
| 460 | 460 | |
| 461 | 461 | ?> |
| 462 | 462 | <div class="m-0" style="overflow: auto;"> |
| 463 | 463 | |
| 464 | - <table class="<?php echo esc_attr( $table_class ); ?>"> |
|
| 464 | + <table class="<?php echo esc_attr($table_class); ?>"> |
|
| 465 | 465 | |
| 466 | 466 | <thead> |
| 467 | 467 | <tr> |
| 468 | 468 | <?php |
| 469 | - foreach ( $columns as $key => $label ) { |
|
| 470 | - echo "<th class='subscription-invoice-field-" . esc_attr( $key ) . " bg-light p-2 text-left color-dark font-weight-bold'>" . esc_html( $label ) . "</th>"; |
|
| 469 | + foreach ($columns as $key => $label) { |
|
| 470 | + echo "<th class='subscription-invoice-field-" . esc_attr($key) . " bg-light p-2 text-left color-dark font-weight-bold'>" . esc_html($label) . "</th>"; |
|
| 471 | 471 | } |
| 472 | 472 | ?> |
| 473 | 473 | </tr> |
@@ -475,71 +475,71 @@ discard block |
||
| 475 | 475 | |
| 476 | 476 | <tbody> |
| 477 | 477 | |
| 478 | - <?php if ( empty( $payments ) ) : ?> |
|
| 478 | + <?php if (empty($payments)) : ?> |
|
| 479 | 479 | <tr> |
| 480 | - <td colspan="<?php echo count( $columns ); ?>" class="p-2 text-left text-muted"> |
|
| 481 | - <?php esc_html_e( 'This subscription has no invoices.', 'invoicing' ); ?> |
|
| 480 | + <td colspan="<?php echo count($columns); ?>" class="p-2 text-left text-muted"> |
|
| 481 | + <?php esc_html_e('This subscription has no invoices.', 'invoicing'); ?> |
|
| 482 | 482 | </td> |
| 483 | 483 | </tr> |
| 484 | 484 | <?php endif; ?> |
| 485 | 485 | |
| 486 | 486 | <?php |
| 487 | 487 | |
| 488 | - foreach ( $payments as $payment ) : |
|
| 488 | + foreach ($payments as $payment) : |
|
| 489 | 489 | |
| 490 | 490 | // Ensure that we have an invoice. |
| 491 | - $payment = new WPInv_Invoice( $payment ); |
|
| 491 | + $payment = new WPInv_Invoice($payment); |
|
| 492 | 492 | |
| 493 | 493 | // Abort if the invoice is invalid... |
| 494 | - if ( ! $payment->exists() ) { |
|
| 494 | + if (!$payment->exists()) { |
|
| 495 | 495 | continue; |
| 496 | 496 | } |
| 497 | 497 | |
| 498 | 498 | // ... or belongs to a different subscription. |
| 499 | - if ( $strict && $payment->is_renewal() && $payment->get_subscription_id() && $payment->get_subscription_id() != $subscription->get_id() ) { |
|
| 499 | + if ($strict && $payment->is_renewal() && $payment->get_subscription_id() && $payment->get_subscription_id() != $subscription->get_id()) { |
|
| 500 | 500 | continue; |
| 501 | 501 | } |
| 502 | 502 | |
| 503 | 503 | echo '<tr>'; |
| 504 | 504 | |
| 505 | - foreach ( array_keys( $columns ) as $key ) { |
|
| 505 | + foreach (array_keys($columns) as $key) { |
|
| 506 | 506 | |
| 507 | 507 | echo "<td class='p-2 text-left'>"; |
| 508 | 508 | |
| 509 | - switch ( $key ) { |
|
| 509 | + switch ($key) { |
|
| 510 | 510 | |
| 511 | 511 | case 'total': |
| 512 | 512 | echo '<strong>'; |
| 513 | - wpinv_the_price( $payment->get_total(), $payment->get_currency() ); |
|
| 513 | + wpinv_the_price($payment->get_total(), $payment->get_currency()); |
|
| 514 | 514 | echo '</strong>'; |
| 515 | 515 | break; |
| 516 | 516 | |
| 517 | 517 | case 'relationship': |
| 518 | - echo $payment->is_renewal() ? esc_html__( 'Renewal Invoice', 'invoicing' ) : esc_html__( 'Initial Invoice', 'invoicing' ); |
|
| 518 | + echo $payment->is_renewal() ? esc_html__('Renewal Invoice', 'invoicing') : esc_html__('Initial Invoice', 'invoicing'); |
|
| 519 | 519 | break; |
| 520 | 520 | |
| 521 | 521 | case 'date': |
| 522 | - echo esc_html( getpaid_format_date_value( $payment->get_date_created() ) ); |
|
| 522 | + echo esc_html(getpaid_format_date_value($payment->get_date_created())); |
|
| 523 | 523 | break; |
| 524 | 524 | |
| 525 | 525 | case 'status': |
| 526 | 526 | $status = $payment->get_status_nicename(); |
| 527 | - if ( is_admin() ) { |
|
| 527 | + if (is_admin()) { |
|
| 528 | 528 | $status = $payment->get_status_label_html(); |
| 529 | 529 | } |
| 530 | 530 | |
| 531 | - echo wp_kses_post( $status ); |
|
| 531 | + echo wp_kses_post($status); |
|
| 532 | 532 | break; |
| 533 | 533 | |
| 534 | 534 | case 'invoice': |
| 535 | - $link = esc_url( get_edit_post_link( $payment->get_id() ) ); |
|
| 535 | + $link = esc_url(get_edit_post_link($payment->get_id())); |
|
| 536 | 536 | |
| 537 | - if ( ! is_admin() ) { |
|
| 538 | - $link = esc_url( $payment->get_view_url() ); |
|
| 537 | + if (!is_admin()) { |
|
| 538 | + $link = esc_url($payment->get_view_url()); |
|
| 539 | 539 | } |
| 540 | 540 | |
| 541 | - $invoice = esc_html( $payment->get_number() ); |
|
| 542 | - echo wp_kses_post( "<a href='$link'>$invoice</a>" ); |
|
| 541 | + $invoice = esc_html($payment->get_number()); |
|
| 542 | + echo wp_kses_post("<a href='$link'>$invoice</a>"); |
|
| 543 | 543 | break; |
| 544 | 544 | } |
| 545 | 545 | |
@@ -566,12 +566,12 @@ discard block |
||
| 566 | 566 | * |
| 567 | 567 | * @param WPInv_Subscription $subscription |
| 568 | 568 | */ |
| 569 | -function getpaid_admin_subscription_item_details_metabox( $subscription ) { |
|
| 569 | +function getpaid_admin_subscription_item_details_metabox($subscription) { |
|
| 570 | 570 | |
| 571 | 571 | // Fetch the subscription group. |
| 572 | - $subscription_group = getpaid_get_invoice_subscription_group( $subscription->get_parent_payment_id(), $subscription->get_id() ); |
|
| 572 | + $subscription_group = getpaid_get_invoice_subscription_group($subscription->get_parent_payment_id(), $subscription->get_id()); |
|
| 573 | 573 | |
| 574 | - if ( empty( $subscription_group ) || empty( $subscription_group['items'] ) ) { |
|
| 574 | + if (empty($subscription_group) || empty($subscription_group['items'])) { |
|
| 575 | 575 | return; |
| 576 | 576 | } |
| 577 | 577 | |
@@ -579,12 +579,12 @@ discard block |
||
| 579 | 579 | $columns = apply_filters( |
| 580 | 580 | 'getpaid_subscription_item_details_columns', |
| 581 | 581 | array( |
| 582 | - 'item_name' => __( 'Item', 'invoicing' ), |
|
| 583 | - 'price' => __( 'Price', 'invoicing' ), |
|
| 584 | - 'tax' => __( 'Tax', 'invoicing' ), |
|
| 585 | - 'discount' => __( 'Discount', 'invoicing' ), |
|
| 582 | + 'item_name' => __('Item', 'invoicing'), |
|
| 583 | + 'price' => __('Price', 'invoicing'), |
|
| 584 | + 'tax' => __('Tax', 'invoicing'), |
|
| 585 | + 'discount' => __('Discount', 'invoicing'), |
|
| 586 | 586 | //'initial' => __( 'Initial Amount', 'invoicing' ), |
| 587 | - 'recurring' => __( 'Subtotal', 'invoicing' ), |
|
| 587 | + 'recurring' => __('Subtotal', 'invoicing'), |
|
| 588 | 588 | ), |
| 589 | 589 | $subscription |
| 590 | 590 | ); |
@@ -593,27 +593,27 @@ discard block |
||
| 593 | 593 | |
| 594 | 594 | $invoice = $subscription->get_parent_invoice(); |
| 595 | 595 | |
| 596 | - if ( ( ! wpinv_use_taxes() || ! $invoice->is_taxable() ) && isset( $columns['tax'] ) ) { |
|
| 597 | - unset( $columns['tax'] ); |
|
| 596 | + if ((!wpinv_use_taxes() || !$invoice->is_taxable()) && isset($columns['tax'])) { |
|
| 597 | + unset($columns['tax']); |
|
| 598 | 598 | } |
| 599 | 599 | |
| 600 | 600 | $table_class = 'w-100 bg-white'; |
| 601 | 601 | |
| 602 | - if ( ! is_admin() ) { |
|
| 602 | + if (!is_admin()) { |
|
| 603 | 603 | $table_class = 'table table-bordered'; |
| 604 | 604 | } |
| 605 | 605 | |
| 606 | 606 | ?> |
| 607 | 607 | <div class="m-0" style="overflow: auto;"> |
| 608 | 608 | |
| 609 | - <table class="<?php echo esc_attr( $table_class ); ?>"> |
|
| 609 | + <table class="<?php echo esc_attr($table_class); ?>"> |
|
| 610 | 610 | |
| 611 | 611 | <thead> |
| 612 | 612 | <tr> |
| 613 | 613 | <?php |
| 614 | 614 | |
| 615 | - foreach ( $columns as $key => $label ) { |
|
| 616 | - echo "<th class='subscription-item-field-" . esc_attr( $key ) . " bg-light p-2 text-left color-dark font-weight-bold'>" . esc_html( $label ) . "</th>"; |
|
| 615 | + foreach ($columns as $key => $label) { |
|
| 616 | + echo "<th class='subscription-item-field-" . esc_attr($key) . " bg-light p-2 text-left color-dark font-weight-bold'>" . esc_html($label) . "</th>"; |
|
| 617 | 617 | } |
| 618 | 618 | ?> |
| 619 | 619 | </tr> |
@@ -623,48 +623,48 @@ discard block |
||
| 623 | 623 | |
| 624 | 624 | <?php |
| 625 | 625 | |
| 626 | - foreach ( $subscription_group['items'] as $subscription_group_item ) : |
|
| 626 | + foreach ($subscription_group['items'] as $subscription_group_item) : |
|
| 627 | 627 | |
| 628 | 628 | echo '<tr>'; |
| 629 | 629 | |
| 630 | - foreach ( array_keys( $columns ) as $key ) { |
|
| 630 | + foreach (array_keys($columns) as $key) { |
|
| 631 | 631 | |
| 632 | 632 | $class = 'text-left'; |
| 633 | 633 | |
| 634 | 634 | echo "<td class='p-2 text-left'>"; |
| 635 | 635 | |
| 636 | - switch ( $key ) { |
|
| 636 | + switch ($key) { |
|
| 637 | 637 | |
| 638 | 638 | case 'item_name': |
| 639 | - $item_name = get_the_title( $subscription_group_item['item_id'] ); |
|
| 640 | - $item_name = empty( $item_name ) ? $subscription_group_item['item_name'] : $item_name; |
|
| 639 | + $item_name = get_the_title($subscription_group_item['item_id']); |
|
| 640 | + $item_name = empty($item_name) ? $subscription_group_item['item_name'] : $item_name; |
|
| 641 | 641 | |
| 642 | - if ( $invoice->get_template() == 'amount' || 1 == (float) $subscription_group_item['quantity'] ) { |
|
| 643 | - echo esc_html( $item_name ); |
|
| 642 | + if ($invoice->get_template() == 'amount' || 1 == (float) $subscription_group_item['quantity']) { |
|
| 643 | + echo esc_html($item_name); |
|
| 644 | 644 | } else { |
| 645 | - printf( '%1$s x %2$d', esc_html( $item_name ), (float) $subscription_group_item['quantity'] ); |
|
| 645 | + printf('%1$s x %2$d', esc_html($item_name), (float) $subscription_group_item['quantity']); |
|
| 646 | 646 | } |
| 647 | 647 | |
| 648 | 648 | break; |
| 649 | 649 | |
| 650 | 650 | case 'price': |
| 651 | - wpinv_the_price( $subscription_group_item['item_price'], $invoice->get_currency() ); |
|
| 651 | + wpinv_the_price($subscription_group_item['item_price'], $invoice->get_currency()); |
|
| 652 | 652 | break; |
| 653 | 653 | |
| 654 | 654 | case 'tax': |
| 655 | - wpinv_the_price( $subscription_group_item['tax'], $invoice->get_currency() ); |
|
| 655 | + wpinv_the_price($subscription_group_item['tax'], $invoice->get_currency()); |
|
| 656 | 656 | break; |
| 657 | 657 | |
| 658 | 658 | case 'discount': |
| 659 | - wpinv_the_price( $subscription_group_item['discount'], $invoice->get_currency() ); |
|
| 659 | + wpinv_the_price($subscription_group_item['discount'], $invoice->get_currency()); |
|
| 660 | 660 | break; |
| 661 | 661 | |
| 662 | 662 | case 'initial': |
| 663 | - wpinv_the_price( $subscription_group_item['price'] * $subscription_group_item['quantity'], $invoice->get_currency() ); |
|
| 663 | + wpinv_the_price($subscription_group_item['price'] * $subscription_group_item['quantity'], $invoice->get_currency()); |
|
| 664 | 664 | break; |
| 665 | 665 | |
| 666 | 666 | case 'recurring': |
| 667 | - echo wp_kses_post( '<strong>' . wpinv_price( $subscription_group_item['price'] * $subscription_group_item['quantity'], $invoice->get_currency() ) . '</strong>' ); |
|
| 667 | + echo wp_kses_post('<strong>' . wpinv_price($subscription_group_item['price'] * $subscription_group_item['quantity'], $invoice->get_currency()) . '</strong>'); |
|
| 668 | 668 | break; |
| 669 | 669 | |
| 670 | 670 | } |
@@ -677,24 +677,24 @@ discard block |
||
| 677 | 677 | |
| 678 | 678 | endforeach; |
| 679 | 679 | |
| 680 | - foreach ( $subscription_group['fees'] as $subscription_group_fee ) : |
|
| 680 | + foreach ($subscription_group['fees'] as $subscription_group_fee) : |
|
| 681 | 681 | |
| 682 | 682 | echo '<tr>'; |
| 683 | 683 | |
| 684 | - foreach ( array_keys( $columns ) as $key ) { |
|
| 684 | + foreach (array_keys($columns) as $key) { |
|
| 685 | 685 | |
| 686 | 686 | $class = 'text-left'; |
| 687 | 687 | |
| 688 | 688 | echo "<td class='p-2 text-left'>"; |
| 689 | 689 | |
| 690 | - switch ( $key ) { |
|
| 690 | + switch ($key) { |
|
| 691 | 691 | |
| 692 | 692 | case 'item_name': |
| 693 | - echo esc_html( $subscription_group_fee['name'] ); |
|
| 693 | + echo esc_html($subscription_group_fee['name']); |
|
| 694 | 694 | break; |
| 695 | 695 | |
| 696 | 696 | case 'price': |
| 697 | - wpinv_the_price( $subscription_group_fee['initial_fee'], $invoice->get_currency() ); |
|
| 697 | + wpinv_the_price($subscription_group_fee['initial_fee'], $invoice->get_currency()); |
|
| 698 | 698 | break; |
| 699 | 699 | |
| 700 | 700 | case 'tax': |
@@ -706,11 +706,11 @@ discard block |
||
| 706 | 706 | break; |
| 707 | 707 | |
| 708 | 708 | case 'initial': |
| 709 | - wpinv_the_price( $subscription_group_fee['initial_fee'], $invoice->get_currency() ); |
|
| 709 | + wpinv_the_price($subscription_group_fee['initial_fee'], $invoice->get_currency()); |
|
| 710 | 710 | break; |
| 711 | 711 | |
| 712 | 712 | case 'recurring': |
| 713 | - echo wp_kses_post( '<strong>' . wpinv_price( $subscription_group_fee['recurring_fee'], $invoice->get_currency() ) . '</strong>' ); |
|
| 713 | + echo wp_kses_post('<strong>' . wpinv_price($subscription_group_fee['recurring_fee'], $invoice->get_currency()) . '</strong>'); |
|
| 714 | 714 | break; |
| 715 | 715 | |
| 716 | 716 | } |
@@ -739,12 +739,12 @@ discard block |
||
| 739 | 739 | * @param WPInv_Subscription $subscription |
| 740 | 740 | * @param bool $skip_current |
| 741 | 741 | */ |
| 742 | -function getpaid_admin_subscription_related_subscriptions_metabox( $subscription, $skip_current = true ) { |
|
| 742 | +function getpaid_admin_subscription_related_subscriptions_metabox($subscription, $skip_current = true) { |
|
| 743 | 743 | |
| 744 | 744 | // Fetch the subscription groups. |
| 745 | - $subscription_groups = getpaid_get_invoice_subscription_groups( $subscription->get_parent_payment_id() ); |
|
| 745 | + $subscription_groups = getpaid_get_invoice_subscription_groups($subscription->get_parent_payment_id()); |
|
| 746 | 746 | |
| 747 | - if ( empty( $subscription_groups ) ) { |
|
| 747 | + if (empty($subscription_groups)) { |
|
| 748 | 748 | return; |
| 749 | 749 | } |
| 750 | 750 | |
@@ -752,37 +752,37 @@ discard block |
||
| 752 | 752 | $columns = apply_filters( |
| 753 | 753 | 'getpaid_subscription_related_subscriptions_columns', |
| 754 | 754 | array( |
| 755 | - 'subscription' => __( 'Subscription', 'invoicing' ), |
|
| 756 | - 'start_date' => __( 'Start Date', 'invoicing' ), |
|
| 757 | - 'renewal_date' => __( 'Next Payment', 'invoicing' ), |
|
| 758 | - 'renewals' => __( 'Payments', 'invoicing' ), |
|
| 759 | - 'item' => __( 'Items', 'invoicing' ), |
|
| 760 | - 'status' => __( 'Status', 'invoicing' ), |
|
| 755 | + 'subscription' => __('Subscription', 'invoicing'), |
|
| 756 | + 'start_date' => __('Start Date', 'invoicing'), |
|
| 757 | + 'renewal_date' => __('Next Payment', 'invoicing'), |
|
| 758 | + 'renewals' => __('Payments', 'invoicing'), |
|
| 759 | + 'item' => __('Items', 'invoicing'), |
|
| 760 | + 'status' => __('Status', 'invoicing'), |
|
| 761 | 761 | ), |
| 762 | 762 | $subscription |
| 763 | 763 | ); |
| 764 | 764 | |
| 765 | - if ( $subscription->get_status() == 'pending' ) { |
|
| 766 | - unset( $columns['start_date'], $columns['renewal_date'] ); |
|
| 765 | + if ($subscription->get_status() == 'pending') { |
|
| 766 | + unset($columns['start_date'], $columns['renewal_date']); |
|
| 767 | 767 | } |
| 768 | 768 | |
| 769 | 769 | $table_class = 'w-100 bg-white'; |
| 770 | 770 | |
| 771 | - if ( ! is_admin() ) { |
|
| 771 | + if (!is_admin()) { |
|
| 772 | 772 | $table_class = 'table table-bordered'; |
| 773 | 773 | } |
| 774 | 774 | |
| 775 | 775 | ?> |
| 776 | 776 | <div class="m-0" style="overflow: auto;"> |
| 777 | 777 | |
| 778 | - <table class="<?php echo esc_attr( $table_class ); ?>"> |
|
| 778 | + <table class="<?php echo esc_attr($table_class); ?>"> |
|
| 779 | 779 | |
| 780 | 780 | <thead> |
| 781 | 781 | <tr> |
| 782 | 782 | <?php |
| 783 | 783 | |
| 784 | - foreach ( $columns as $key => $label ) { |
|
| 785 | - echo "<th class='related-subscription-field-" . esc_attr( $key ) . " bg-light p-2 text-left color-dark font-weight-bold'>" . esc_html( $label ) . "</th>"; |
|
| 784 | + foreach ($columns as $key => $label) { |
|
| 785 | + echo "<th class='related-subscription-field-" . esc_attr($key) . " bg-light p-2 text-left color-dark font-weight-bold'>" . esc_html($label) . "</th>"; |
|
| 786 | 786 | } |
| 787 | 787 | ?> |
| 788 | 788 | </tr> |
@@ -792,62 +792,62 @@ discard block |
||
| 792 | 792 | |
| 793 | 793 | <?php |
| 794 | 794 | |
| 795 | - foreach ( $subscription_groups as $subscription_group ) : |
|
| 795 | + foreach ($subscription_groups as $subscription_group) : |
|
| 796 | 796 | |
| 797 | 797 | // Do not list current subscription. |
| 798 | - if ( $skip_current && (int) $subscription_group['subscription_id'] === $subscription->get_id() ) { |
|
| 798 | + if ($skip_current && (int) $subscription_group['subscription_id'] === $subscription->get_id()) { |
|
| 799 | 799 | continue; |
| 800 | 800 | } |
| 801 | 801 | |
| 802 | 802 | // Ensure the subscription exists. |
| 803 | - $_suscription = new WPInv_Subscription( $subscription_group['subscription_id'] ); |
|
| 803 | + $_suscription = new WPInv_Subscription($subscription_group['subscription_id']); |
|
| 804 | 804 | |
| 805 | - if ( ! $_suscription->exists() ) { |
|
| 805 | + if (!$_suscription->exists()) { |
|
| 806 | 806 | continue; |
| 807 | 807 | } |
| 808 | 808 | |
| 809 | 809 | echo '<tr>'; |
| 810 | 810 | |
| 811 | - foreach ( array_keys( $columns ) as $key ) { |
|
| 811 | + foreach (array_keys($columns) as $key) { |
|
| 812 | 812 | |
| 813 | 813 | $class = 'text-left'; |
| 814 | 814 | |
| 815 | 815 | echo "<td class='p-2 text-left'>"; |
| 816 | 816 | |
| 817 | - switch ( $key ) { |
|
| 817 | + switch ($key) { |
|
| 818 | 818 | |
| 819 | 819 | case 'status': |
| 820 | - echo wp_kses_post( $_suscription->get_status_label_html() ); |
|
| 820 | + echo wp_kses_post($_suscription->get_status_label_html()); |
|
| 821 | 821 | break; |
| 822 | 822 | |
| 823 | 823 | case 'item': |
| 824 | - $markup = array_map( array( 'WPInv_Subscriptions_List_Table', 'generate_item_markup' ), array_keys( $subscription_group['items'] ) ); |
|
| 825 | - echo wp_kses_post( implode( ' | ', $markup ) ); |
|
| 824 | + $markup = array_map(array('WPInv_Subscriptions_List_Table', 'generate_item_markup'), array_keys($subscription_group['items'])); |
|
| 825 | + echo wp_kses_post(implode(' | ', $markup)); |
|
| 826 | 826 | break; |
| 827 | 827 | |
| 828 | 828 | case 'renewals': |
| 829 | 829 | $max_bills = $_suscription->get_bill_times(); |
| 830 | - echo ( (int) $_suscription->get_times_billed() ) . ' / ' . ( empty( $max_bills ) ? '∞' : (int) $max_bills ); |
|
| 830 | + echo ((int) $_suscription->get_times_billed()) . ' / ' . (empty($max_bills) ? '∞' : (int) $max_bills); |
|
| 831 | 831 | break; |
| 832 | 832 | |
| 833 | 833 | case 'renewal_date': |
| 834 | - echo $_suscription->is_active() ? esc_html( getpaid_format_date_value( $_suscription->get_expiration() ) ) : '—'; |
|
| 834 | + echo $_suscription->is_active() ? esc_html(getpaid_format_date_value($_suscription->get_expiration())) : '—'; |
|
| 835 | 835 | break; |
| 836 | 836 | |
| 837 | 837 | case 'start_date': |
| 838 | - echo 'pending' == $_suscription->get_status() ? '—' : esc_html( getpaid_format_date_value( $_suscription->get_date_created() ) ); |
|
| 838 | + echo 'pending' == $_suscription->get_status() ? '—' : esc_html(getpaid_format_date_value($_suscription->get_date_created())); |
|
| 839 | 839 | break; |
| 840 | 840 | |
| 841 | 841 | case 'subscription': |
| 842 | - $url = is_admin() ? admin_url( 'admin.php?page=wpinv-subscriptions&id=' . absint( $_suscription->get_id() ) ) : $_suscription->get_view_url(); |
|
| 842 | + $url = is_admin() ? admin_url('admin.php?page=wpinv-subscriptions&id=' . absint($_suscription->get_id())) : $_suscription->get_view_url(); |
|
| 843 | 843 | printf( |
| 844 | 844 | '%1$s#%2$s%3$s', |
| 845 | - '<a href="' . esc_url( $url ) . '">', |
|
| 846 | - '<strong>' . intval( $_suscription->get_id() ) . '</strong>', |
|
| 845 | + '<a href="' . esc_url($url) . '">', |
|
| 846 | + '<strong>' . intval($_suscription->get_id()) . '</strong>', |
|
| 847 | 847 | '</a>' |
| 848 | 848 | ); |
| 849 | 849 | |
| 850 | - echo wp_kses_post( WPInv_Subscriptions_List_Table::column_amount( $_suscription ) ); |
|
| 850 | + echo wp_kses_post(WPInv_Subscriptions_List_Table::column_amount($_suscription)); |
|
| 851 | 851 | break; |
| 852 | 852 | |
| 853 | 853 | } |
@@ -7,7 +7,7 @@ discard block |
||
| 7 | 7 | * |
| 8 | 8 | */ |
| 9 | 9 | |
| 10 | -if ( ! defined( 'ABSPATH' ) ) { |
|
| 10 | +if (!defined('ABSPATH')) { |
|
| 11 | 11 | exit; // Exit if accessed directly |
| 12 | 12 | } |
| 13 | 13 | |
@@ -16,82 +16,82 @@ discard block |
||
| 16 | 16 | */ |
| 17 | 17 | class GetPaid_Meta_Box_Invoice_Items { |
| 18 | 18 | |
| 19 | - public static function get_columns( $invoice ) { |
|
| 19 | + public static function get_columns($invoice) { |
|
| 20 | 20 | $use_taxes = $invoice->is_taxable() && wpinv_use_taxes(); |
| 21 | 21 | $columns = array( |
| 22 | - 'id' => __( 'ID', 'invoicing' ), |
|
| 23 | - 'title' => __( 'Item', 'invoicing' ), |
|
| 22 | + 'id' => __('ID', 'invoicing'), |
|
| 23 | + 'title' => __('Item', 'invoicing'), |
|
| 24 | 24 | 'price' => sprintf( |
| 25 | 25 | '<span class="getpaid-hide-if-hours getpaid-hide-if-quantity">%s</span> |
| 26 | 26 | <span class="getpaid-hide-if-hours hide-if-amount">%s</span> |
| 27 | 27 | <span class="getpaid-hide-if-quantity hide-if-amount">%s</span>', |
| 28 | - __( 'Amount', 'invoicing' ), |
|
| 29 | - __( 'Price', 'invoicing' ), |
|
| 30 | - __( 'Rate', 'invoicing' ) |
|
| 28 | + __('Amount', 'invoicing'), |
|
| 29 | + __('Price', 'invoicing'), |
|
| 30 | + __('Rate', 'invoicing') |
|
| 31 | 31 | ), |
| 32 | 32 | 'qty' => sprintf( |
| 33 | 33 | '<span class="getpaid-hide-if-hours">%s</span><span class="getpaid-hide-if-quantity">%s</span>', |
| 34 | - __( 'Quantity', 'invoicing' ), |
|
| 35 | - __( 'Hours', 'invoicing' ) |
|
| 34 | + __('Quantity', 'invoicing'), |
|
| 35 | + __('Hours', 'invoicing') |
|
| 36 | 36 | ), |
| 37 | - 'total' => __( 'Total', 'invoicing' ), |
|
| 38 | - 'tax' => __( 'Tax (%)', 'invoicing' ), |
|
| 37 | + 'total' => __('Total', 'invoicing'), |
|
| 38 | + 'tax' => __('Tax (%)', 'invoicing'), |
|
| 39 | 39 | 'action' => '', |
| 40 | 40 | ); |
| 41 | 41 | |
| 42 | - if ( ! $use_taxes ) { |
|
| 43 | - unset( $columns['tax'] ); |
|
| 42 | + if (!$use_taxes) { |
|
| 43 | + unset($columns['tax']); |
|
| 44 | 44 | } |
| 45 | 45 | |
| 46 | 46 | return $columns; |
| 47 | 47 | } |
| 48 | 48 | |
| 49 | - public static function output( $post, $invoice = false ) { |
|
| 49 | + public static function output($post, $invoice = false) { |
|
| 50 | 50 | |
| 51 | - if ( apply_filters( 'getpaid_use_new_invoice_items_metabox', false ) ) { |
|
| 52 | - return self::output2( $post ); |
|
| 51 | + if (apply_filters('getpaid_use_new_invoice_items_metabox', false)) { |
|
| 52 | + return self::output2($post); |
|
| 53 | 53 | } |
| 54 | 54 | |
| 55 | - $post_id = !empty( $post->ID ) ? $post->ID : 0; |
|
| 56 | - $invoice = $invoice instanceof WPInv_Invoice ? $invoice : new WPInv_Invoice( $post_id ); |
|
| 55 | + $post_id = !empty($post->ID) ? $post->ID : 0; |
|
| 56 | + $invoice = $invoice instanceof WPInv_Invoice ? $invoice : new WPInv_Invoice($post_id); |
|
| 57 | 57 | $use_taxes = $invoice->is_taxable() && wpinv_use_taxes(); |
| 58 | - $item_types = apply_filters( 'wpinv_item_types_for_quick_add_item', wpinv_get_item_types(), $post ); |
|
| 59 | - $columns = self::get_columns( $invoice ); |
|
| 60 | - $cols = count( $columns ); |
|
| 58 | + $item_types = apply_filters('wpinv_item_types_for_quick_add_item', wpinv_get_item_types(), $post); |
|
| 59 | + $columns = self::get_columns($invoice); |
|
| 60 | + $cols = count($columns); |
|
| 61 | 61 | $class = ''; |
| 62 | 62 | |
| 63 | - unset( $item_types['adv'] ); |
|
| 64 | - unset( $item_types['package'] ); |
|
| 63 | + unset($item_types['adv']); |
|
| 64 | + unset($item_types['package']); |
|
| 65 | 65 | |
| 66 | - if ( $invoice->is_paid() ) { |
|
| 66 | + if ($invoice->is_paid()) { |
|
| 67 | 67 | $class .= ' wpinv-paid'; |
| 68 | 68 | } |
| 69 | 69 | |
| 70 | - if ( $invoice->is_refunded() ) { |
|
| 70 | + if ($invoice->is_refunded()) { |
|
| 71 | 71 | $class .= ' wpinv-refunded'; |
| 72 | 72 | } |
| 73 | 73 | |
| 74 | - if ( $invoice->is_recurring() ) { |
|
| 74 | + if ($invoice->is_recurring()) { |
|
| 75 | 75 | $class .= ' wpi-recurring'; |
| 76 | 76 | } |
| 77 | 77 | |
| 78 | 78 | ?> |
| 79 | 79 | |
| 80 | - <div class="wpinv-items-wrap<?php echo esc_attr( $class ); ?>" id="wpinv_items_wrap" data-status="<?php echo esc_attr( $invoice->get_status() ); ?>"> |
|
| 80 | + <div class="wpinv-items-wrap<?php echo esc_attr($class); ?>" id="wpinv_items_wrap" data-status="<?php echo esc_attr($invoice->get_status()); ?>"> |
|
| 81 | 81 | <table id="wpinv_items" class="wpinv-items" cellspacing="0" cellpadding="0"> |
| 82 | 82 | |
| 83 | 83 | <thead> |
| 84 | 84 | <tr> |
| 85 | - <?php foreach ( $columns as $key => $label ) : ?> |
|
| 86 | - <th class="<?php echo esc_attr( $key ); echo 'total' == $key || 'qty' == $key ? ' hide-if-amount' : '' ?>"><?php echo wp_kses_post( $label ); ?></th> |
|
| 85 | + <?php foreach ($columns as $key => $label) : ?> |
|
| 86 | + <th class="<?php echo esc_attr($key); echo 'total' == $key || 'qty' == $key ? ' hide-if-amount' : '' ?>"><?php echo wp_kses_post($label); ?></th> |
|
| 87 | 87 | <?php endforeach; ?> |
| 88 | 88 | </tr> |
| 89 | 89 | </thead> |
| 90 | 90 | |
| 91 | 91 | <tbody class="wpinv-line-items"> |
| 92 | 92 | <?php |
| 93 | - foreach ( $invoice->get_items() as $int => $item ) { |
|
| 94 | - self::output_row( $columns, $item, $invoice, $int % 2 == 0 ? 'even' : 'odd' ); |
|
| 93 | + foreach ($invoice->get_items() as $int => $item) { |
|
| 94 | + self::output_row($columns, $item, $invoice, $int % 2 == 0 ? 'even' : 'odd'); |
|
| 95 | 95 | } |
| 96 | 96 | ?> |
| 97 | 97 | </tbody> |
@@ -108,7 +108,7 @@ discard block |
||
| 108 | 108 | <div class="wp-clearfix"> |
| 109 | 109 | <label class="wpi-item-name"> |
| 110 | 110 | <span class="input-text-wrap"> |
| 111 | - <input type="text" style="width: 100%" placeholder="<?php esc_attr_e( 'Item Name', 'invoicing' );?>" class="wpinv-quick-item-name" name="_wpinv_quick[name]"> |
|
| 111 | + <input type="text" style="width: 100%" placeholder="<?php esc_attr_e('Item Name', 'invoicing'); ?>" class="wpinv-quick-item-name" name="_wpinv_quick[name]"> |
|
| 112 | 112 | </span> |
| 113 | 113 | </label> |
| 114 | 114 | </div> |
@@ -116,8 +116,8 @@ discard block |
||
| 116 | 116 | <div class="wp-clearfix"> |
| 117 | 117 | <label class="wpi-item-price"> |
| 118 | 118 | <span class="input-text-wrap"> |
| 119 | - <input type="text" style="width: 200px" placeholder="<?php esc_attr_e( 'Item Price', 'invoicing' );?>" class="wpinv-quick-item-price" name="_wpinv_quick[price]"> |
|
| 120 | - × <input type="text" style="width: 140px" placeholder="<?php esc_attr_e( 'Item Quantity', 'invoicing' );?>" class="wpinv-quick-item-qty" name="_wpinv_quick[qty]"> |
|
| 119 | + <input type="text" style="width: 200px" placeholder="<?php esc_attr_e('Item Price', 'invoicing'); ?>" class="wpinv-quick-item-price" name="_wpinv_quick[price]"> |
|
| 120 | + × <input type="text" style="width: 140px" placeholder="<?php esc_attr_e('Item Quantity', 'invoicing'); ?>" class="wpinv-quick-item-qty" name="_wpinv_quick[qty]"> |
|
| 121 | 121 | </span> |
| 122 | 122 | </label> |
| 123 | 123 | </div> |
@@ -125,7 +125,7 @@ discard block |
||
| 125 | 125 | <div class="wp-clearfix"> |
| 126 | 126 | <label class="wpi-item-name"> |
| 127 | 127 | <span class="input-text-wrap"> |
| 128 | - <textarea rows="4" style="width: 100%" placeholder="<?php esc_attr_e( 'Item Description', 'invoicing' );?>" class="wpinv-quick-item-description" name="_wpinv_quick[description]"></textarea> |
|
| 128 | + <textarea rows="4" style="width: 100%" placeholder="<?php esc_attr_e('Item Description', 'invoicing'); ?>" class="wpinv-quick-item-description" name="_wpinv_quick[description]"></textarea> |
|
| 129 | 129 | </span> |
| 130 | 130 | </label> |
| 131 | 131 | </div> |
@@ -133,7 +133,7 @@ discard block |
||
| 133 | 133 | <div class="wp-clearfix"> |
| 134 | 134 | <label class="wpi-item-type"> |
| 135 | 135 | <span class="input-text-wrap"> |
| 136 | - <?php wpinv_html_select( array( |
|
| 136 | + <?php wpinv_html_select(array( |
|
| 137 | 137 | 'options' => $item_types, |
| 138 | 138 | 'name' => '_wpinv_quick[type]', |
| 139 | 139 | 'id' => '_wpinv_quick_type', |
@@ -141,19 +141,19 @@ discard block |
||
| 141 | 141 | 'show_option_all' => false, |
| 142 | 142 | 'show_option_none' => false, |
| 143 | 143 | 'class' => 'gdmbx2-text-medium wpinv-quick-type', |
| 144 | - ) ); ?> |
|
| 144 | + )); ?> |
|
| 145 | 145 | </span> |
| 146 | 146 | </label> |
| 147 | 147 | </div> |
| 148 | 148 | |
| 149 | - <?php if ( $use_taxes ) : ?> |
|
| 149 | + <?php if ($use_taxes) : ?> |
|
| 150 | 150 | <div class="wp-clearfix"> |
| 151 | 151 | <label class="wpi-vat-rule"> |
| 152 | 152 | <span class="input-text-wrap"> |
| 153 | 153 | <?php |
| 154 | - wpinv_html_select( array( |
|
| 154 | + wpinv_html_select(array( |
|
| 155 | 155 | 'options' => array_merge( |
| 156 | - array( '' => __( 'Select VAT Rule', 'invoicing' ) ), |
|
| 156 | + array('' => __('Select VAT Rule', 'invoicing')), |
|
| 157 | 157 | getpaid_get_tax_rules() |
| 158 | 158 | ), |
| 159 | 159 | 'name' => '_wpinv_quick[vat_rule]', |
@@ -161,7 +161,7 @@ discard block |
||
| 161 | 161 | 'show_option_all' => false, |
| 162 | 162 | 'show_option_none' => false, |
| 163 | 163 | 'class' => 'gdmbx2-text-medium wpinv-quick-vat-rule', |
| 164 | - ) ); |
|
| 164 | + )); |
|
| 165 | 165 | ?> |
| 166 | 166 | </span> |
| 167 | 167 | </label> |
@@ -170,9 +170,9 @@ discard block |
||
| 170 | 170 | <label class="wpi-vat-class"> |
| 171 | 171 | <span class="input-text-wrap"> |
| 172 | 172 | <?php |
| 173 | - wpinv_html_select( array( |
|
| 173 | + wpinv_html_select(array( |
|
| 174 | 174 | 'options' => array_merge( |
| 175 | - array( '' => __( 'Select VAT Class', 'invoicing' ) ), |
|
| 175 | + array('' => __('Select VAT Class', 'invoicing')), |
|
| 176 | 176 | getpaid_get_tax_classes() |
| 177 | 177 | ), |
| 178 | 178 | 'name' => '_wpinv_quick[vat_class]', |
@@ -180,7 +180,7 @@ discard block |
||
| 180 | 180 | 'show_option_all' => false, |
| 181 | 181 | 'show_option_none' => false, |
| 182 | 182 | 'class' => 'gdmbx2-text-medium wpinv-quick-vat-class', |
| 183 | - ) ); |
|
| 183 | + )); |
|
| 184 | 184 | ?> |
| 185 | 185 | </span> |
| 186 | 186 | </label> |
@@ -201,29 +201,29 @@ discard block |
||
| 201 | 201 | </td> |
| 202 | 202 | </tr> |
| 203 | 203 | <tr class="totals"> |
| 204 | - <td colspan="<?php echo ( (int) $cols - 4 ); ?>"></td> |
|
| 204 | + <td colspan="<?php echo ((int) $cols - 4); ?>"></td> |
|
| 205 | 205 | <td colspan="4"> |
| 206 | 206 | <table cellspacing="0" cellpadding="0"> |
| 207 | 207 | <tr class="subtotal"> |
| 208 | - <td class="name"><?php esc_html_e( 'Sub Total:', 'invoicing' );?></td> |
|
| 209 | - <td class="total"><?php wpinv_the_price( $invoice->get_subtotal(), $invoice->get_currency() );?></td> |
|
| 208 | + <td class="name"><?php esc_html_e('Sub Total:', 'invoicing'); ?></td> |
|
| 209 | + <td class="total"><?php wpinv_the_price($invoice->get_subtotal(), $invoice->get_currency()); ?></td> |
|
| 210 | 210 | <td class="action"></td> |
| 211 | 211 | </tr> |
| 212 | 212 | <tr class="discount"> |
| 213 | - <td class="name"><?php esc_html_e( 'Discount:', 'invoicing' ) ; ?></td> |
|
| 214 | - <td class="total"><?php wpinv_the_price( $invoice->get_total_discount(), $invoice->get_currency() );?></td> |
|
| 213 | + <td class="name"><?php esc_html_e('Discount:', 'invoicing'); ?></td> |
|
| 214 | + <td class="total"><?php wpinv_the_price($invoice->get_total_discount(), $invoice->get_currency()); ?></td> |
|
| 215 | 215 | <td class="action"></td> |
| 216 | 216 | </tr> |
| 217 | - <?php if ( $use_taxes ) : ?> |
|
| 217 | + <?php if ($use_taxes) : ?> |
|
| 218 | 218 | <tr class="tax"> |
| 219 | - <td class="name"><?php esc_html_e( 'Tax:', 'invoicing' );?></td> |
|
| 220 | - <td class="total"><?php wpinv_the_price( $invoice->get_total_tax(), $invoice->get_currency() );?></td> |
|
| 219 | + <td class="name"><?php esc_html_e('Tax:', 'invoicing'); ?></td> |
|
| 220 | + <td class="total"><?php wpinv_the_price($invoice->get_total_tax(), $invoice->get_currency()); ?></td> |
|
| 221 | 221 | <td class="action"></td> |
| 222 | 222 | </tr> |
| 223 | 223 | <?php endif; ?> |
| 224 | 224 | <tr class="total"> |
| 225 | - <td class="name"><?php esc_html_e( 'Total:', 'invoicing' );?></td> |
|
| 226 | - <td class="total"><?php wpinv_the_price( $invoice->get_total(), $invoice->get_currency() );?></td> |
|
| 225 | + <td class="name"><?php esc_html_e('Total:', 'invoicing'); ?></td> |
|
| 226 | + <td class="total"><?php wpinv_the_price($invoice->get_total(), $invoice->get_currency()); ?></td> |
|
| 227 | 227 | <td class="action"></td> |
| 228 | 228 | </tr> |
| 229 | 229 | </table> |
@@ -234,7 +234,7 @@ discard block |
||
| 234 | 234 | </table> |
| 235 | 235 | <div class="wpinv-actions"> |
| 236 | 236 | <?php |
| 237 | - if ( ! $invoice->is_paid() && ! $invoice->is_refunded() ) { |
|
| 237 | + if (!$invoice->is_paid() && !$invoice->is_refunded()) { |
|
| 238 | 238 | wpinv_item_dropdown( |
| 239 | 239 | array( |
| 240 | 240 | 'name' => 'wpinv_invoice_item', |
@@ -244,61 +244,61 @@ discard block |
||
| 244 | 244 | ) |
| 245 | 245 | ); |
| 246 | 246 | |
| 247 | - echo " " . '<button class="button button-primary" id="wpinv-add-item">' . sprintf( esc_html__( 'Add item to %s', 'invoicing' ), esc_html( $invoice->get_label() ) ) . '</button>'; |
|
| 248 | - echo " " . '<button class="button button-primary" id="wpinv-new-item">' . esc_html__( 'Create new item', 'invoicing' ) . '</button>'; |
|
| 249 | - echo " " . '<button class="button button-primary wpinv-flr" id="wpinv-recalc-totals">' . esc_html__( 'Recalculate Totals', 'invoicing' ) . '</button>'; |
|
| 247 | + echo " " . '<button class="button button-primary" id="wpinv-add-item">' . sprintf(esc_html__('Add item to %s', 'invoicing'), esc_html($invoice->get_label())) . '</button>'; |
|
| 248 | + echo " " . '<button class="button button-primary" id="wpinv-new-item">' . esc_html__('Create new item', 'invoicing') . '</button>'; |
|
| 249 | + echo " " . '<button class="button button-primary wpinv-flr" id="wpinv-recalc-totals">' . esc_html__('Recalculate Totals', 'invoicing') . '</button>'; |
|
| 250 | 250 | |
| 251 | 251 | } |
| 252 | 252 | ?> |
| 253 | - <?php do_action( 'wpinv_invoice_items_actions', $invoice ); ?> |
|
| 253 | + <?php do_action('wpinv_invoice_items_actions', $invoice); ?> |
|
| 254 | 254 | </div> |
| 255 | 255 | </div> |
| 256 | 256 | <?php |
| 257 | 257 | } |
| 258 | 258 | |
| 259 | - public static function output_row( $columns, $item, $invoice, $class='even' ) { |
|
| 259 | + public static function output_row($columns, $item, $invoice, $class = 'even') { |
|
| 260 | 260 | |
| 261 | 261 | ?> |
| 262 | - <tr class="item item-<?php echo esc_attr( $class ); ?>" data-item-id="<?php echo esc_attr( $item->get_id() ); ?>"> |
|
| 263 | - <?php foreach ( array_keys( $columns ) as $column ) : ?> |
|
| 264 | - <td class="<?php echo esc_attr( $column ); echo 'total' == $column || 'qty' == $column ? ' hide-if-amount' : '' ?>"> |
|
| 262 | + <tr class="item item-<?php echo esc_attr($class); ?>" data-item-id="<?php echo esc_attr($item->get_id()); ?>"> |
|
| 263 | + <?php foreach (array_keys($columns) as $column) : ?> |
|
| 264 | + <td class="<?php echo esc_attr($column); echo 'total' == $column || 'qty' == $column ? ' hide-if-amount' : '' ?>"> |
|
| 265 | 265 | <?php |
| 266 | - switch ( $column ) { |
|
| 266 | + switch ($column) { |
|
| 267 | 267 | case 'id': |
| 268 | 268 | echo (int) $item->get_id(); |
| 269 | 269 | break; |
| 270 | 270 | case 'title': |
| 271 | 271 | printf( |
| 272 | 272 | '<a href="%s" target="_blank">%s</a>', |
| 273 | - esc_url( get_edit_post_link( $item->get_id() ) ), |
|
| 274 | - esc_html( $item->get_raw_name() ) |
|
| 273 | + esc_url(get_edit_post_link($item->get_id())), |
|
| 274 | + esc_html($item->get_raw_name()) |
|
| 275 | 275 | ); |
| 276 | 276 | |
| 277 | - $summary = apply_filters( 'getpaid_admin_invoice_line_item_summary', $item->get_description(), $item, $invoice ); |
|
| 278 | - if ( $summary !== '' ) { |
|
| 277 | + $summary = apply_filters('getpaid_admin_invoice_line_item_summary', $item->get_description(), $item, $invoice); |
|
| 278 | + if ($summary !== '') { |
|
| 279 | 279 | printf( |
| 280 | 280 | '<span class="meta">%s</span>', |
| 281 | - wp_kses_post( wpautop( $summary ) ) |
|
| 281 | + wp_kses_post(wpautop($summary)) |
|
| 282 | 282 | ); |
| 283 | 283 | } |
| 284 | 284 | |
| 285 | 285 | printf( |
| 286 | 286 | '<input type="hidden" value="%s" name="getpaid_items[%s][name]" class="getpaid-recalculate-prices-on-change" />', |
| 287 | - esc_attr( $item->get_raw_name() ), |
|
| 287 | + esc_attr($item->get_raw_name()), |
|
| 288 | 288 | (int) $item->get_id() |
| 289 | 289 | ); |
| 290 | 290 | |
| 291 | 291 | printf( |
| 292 | 292 | '<textarea style="display: none;" name="getpaid_items[%s][description]" class="getpaid-recalculate-prices-on-change">%s</textarea>', |
| 293 | 293 | (int) $item->get_id(), |
| 294 | - esc_attr( $item->get_description() ) |
|
| 294 | + esc_attr($item->get_description()) |
|
| 295 | 295 | ); |
| 296 | 296 | |
| 297 | 297 | break; |
| 298 | 298 | case 'price': |
| 299 | 299 | printf( |
| 300 | 300 | '<input type="text" value="%s" name="getpaid_items[%s][price]" style="width: 100px;" class="getpaid-admin-invoice-item-price getpaid-recalculate-prices-on-change" />', |
| 301 | - esc_attr( getpaid_unstandardize_amount( $item->get_price() ) ), |
|
| 301 | + esc_attr(getpaid_unstandardize_amount($item->get_price())), |
|
| 302 | 302 | (int) $item->get_id() |
| 303 | 303 | ); |
| 304 | 304 | |
@@ -306,26 +306,26 @@ discard block |
||
| 306 | 306 | case 'qty': |
| 307 | 307 | printf( |
| 308 | 308 | '<input type="text" style="width: 100px;" value="%s" name="getpaid_items[%s][quantity]" class="getpaid-admin-invoice-item-quantity getpaid-recalculate-prices-on-change" />', |
| 309 | - floatval( $item->get_quantity() ), |
|
| 309 | + floatval($item->get_quantity()), |
|
| 310 | 310 | (int) $item->get_id() |
| 311 | 311 | ); |
| 312 | 312 | |
| 313 | 313 | break; |
| 314 | 314 | case 'total': |
| 315 | - wpinv_the_price( $item->get_sub_total(), $invoice->get_currency() ); |
|
| 315 | + wpinv_the_price($item->get_sub_total(), $invoice->get_currency()); |
|
| 316 | 316 | |
| 317 | 317 | break; |
| 318 | 318 | case 'tax': |
| 319 | - echo floatval( wpinv_round_amount( getpaid_get_invoice_tax_rate( $invoice, $item ), 2 ) ) . '%'; |
|
| 319 | + echo floatval(wpinv_round_amount(getpaid_get_invoice_tax_rate($invoice, $item), 2)) . '%'; |
|
| 320 | 320 | |
| 321 | 321 | break; |
| 322 | 322 | case 'action': |
| 323 | - if ( ! $invoice->is_paid() && ! $invoice->is_refunded() ) { |
|
| 323 | + if (!$invoice->is_paid() && !$invoice->is_refunded()) { |
|
| 324 | 324 | echo '<i class="fa fa-trash wpinv-item-remove"></i>'; |
| 325 | 325 | } |
| 326 | 326 | break; |
| 327 | 327 | } |
| 328 | - do_action( 'getpaid_admin_edit_invoice_item_' . $column, $item, $invoice ); |
|
| 328 | + do_action('getpaid_admin_edit_invoice_item_' . $column, $item, $invoice); |
|
| 329 | 329 | ?> |
| 330 | 330 | </td> |
| 331 | 331 | <?php endforeach; ?> |
@@ -338,10 +338,10 @@ discard block |
||
| 338 | 338 | * |
| 339 | 339 | * @param WP_Post $post |
| 340 | 340 | */ |
| 341 | - public static function output2( $post ) { |
|
| 341 | + public static function output2($post) { |
|
| 342 | 342 | |
| 343 | 343 | // Prepare the invoice. |
| 344 | - $invoice = new WPInv_Invoice( $post ); |
|
| 344 | + $invoice = new WPInv_Invoice($post); |
|
| 345 | 345 | |
| 346 | 346 | // Invoice items. |
| 347 | 347 | $items = $invoice->get_items(); |
@@ -349,28 +349,28 @@ discard block |
||
| 349 | 349 | $totals = array( |
| 350 | 350 | |
| 351 | 351 | 'subtotal' => array( |
| 352 | - 'label' => __( 'Items Subtotal', 'invoicing' ), |
|
| 353 | - 'value' => wpinv_price( $invoice->get_subtotal(), $invoice->get_currency() ), |
|
| 352 | + 'label' => __('Items Subtotal', 'invoicing'), |
|
| 353 | + 'value' => wpinv_price($invoice->get_subtotal(), $invoice->get_currency()), |
|
| 354 | 354 | ), |
| 355 | 355 | |
| 356 | 356 | 'discount' => array( |
| 357 | - 'label' => __( 'Total Discount', 'invoicing' ), |
|
| 358 | - 'value' => wpinv_price( $invoice->get_total_discount(), $invoice->get_currency() ), |
|
| 357 | + 'label' => __('Total Discount', 'invoicing'), |
|
| 358 | + 'value' => wpinv_price($invoice->get_total_discount(), $invoice->get_currency()), |
|
| 359 | 359 | ), |
| 360 | 360 | |
| 361 | 361 | 'tax' => array( |
| 362 | - 'label' => __( 'Total Tax', 'invoicing' ), |
|
| 363 | - 'value' => wpinv_price( $invoice->get_total_tax(), $invoice->get_currency() ), |
|
| 362 | + 'label' => __('Total Tax', 'invoicing'), |
|
| 363 | + 'value' => wpinv_price($invoice->get_total_tax(), $invoice->get_currency()), |
|
| 364 | 364 | ), |
| 365 | 365 | |
| 366 | 366 | 'total' => array( |
| 367 | - 'label' => __( 'Invoice Total', 'invoicing' ), |
|
| 368 | - 'value' => wpinv_price( $invoice->get_total(), $invoice->get_currency() ), |
|
| 367 | + 'label' => __('Invoice Total', 'invoicing'), |
|
| 368 | + 'value' => wpinv_price($invoice->get_total(), $invoice->get_currency()), |
|
| 369 | 369 | ) |
| 370 | 370 | ); |
| 371 | 371 | |
| 372 | - if ( ! wpinv_use_taxes() ) { |
|
| 373 | - unset( $totals['tax'] ); |
|
| 372 | + if (!wpinv_use_taxes()) { |
|
| 373 | + unset($totals['tax']); |
|
| 374 | 374 | } |
| 375 | 375 | |
| 376 | 376 | $item_args = array( |
@@ -378,7 +378,7 @@ discard block |
||
| 378 | 378 | 'orderby' => 'title', |
| 379 | 379 | 'order' => 'ASC', |
| 380 | 380 | 'posts_per_page' => -1, |
| 381 | - 'post_status' => array( 'publish' ), |
|
| 381 | + 'post_status' => array('publish'), |
|
| 382 | 382 | 'meta_query' => array( |
| 383 | 383 | array( |
| 384 | 384 | 'key' => '_wpinv_type', |
@@ -402,10 +402,10 @@ discard block |
||
| 402 | 402 | } |
| 403 | 403 | </style> |
| 404 | 404 | |
| 405 | - <div class="bsui getpaid-invoice-items-inner <?php echo empty( $items ) ? 'no-items' : 'has-items'; ?> <?php echo $invoice->is_paid() || $invoice->is_refunded() ? 'not-editable' : 'editable'; ?>" style="margin-top: 1.5rem; padding: 0 12px 12px;"> |
|
| 405 | + <div class="bsui getpaid-invoice-items-inner <?php echo empty($items) ? 'no-items' : 'has-items'; ?> <?php echo $invoice->is_paid() || $invoice->is_refunded() ? 'not-editable' : 'editable'; ?>" style="margin-top: 1.5rem; padding: 0 12px 12px;"> |
|
| 406 | 406 | |
| 407 | - <?php if ( ! $invoice->is_paid() && ! $invoice->is_refunded() ) : ?> |
|
| 408 | - <?php do_action( 'wpinv_meta_box_before_invoice_template_row', $invoice->get_id() ); ?> |
|
| 407 | + <?php if (!$invoice->is_paid() && !$invoice->is_refunded()) : ?> |
|
| 408 | + <?php do_action('wpinv_meta_box_before_invoice_template_row', $invoice->get_id()); ?> |
|
| 409 | 409 | |
| 410 | 410 | <div class="row"> |
| 411 | 411 | <div class="col-12 col-sm-6"> |
@@ -414,15 +414,15 @@ discard block |
||
| 414 | 414 | array( |
| 415 | 415 | 'id' => 'wpinv_template', |
| 416 | 416 | 'name' => 'wpinv_template', |
| 417 | - 'label' => __( 'Template', 'invoicing' ), |
|
| 417 | + 'label' => __('Template', 'invoicing'), |
|
| 418 | 418 | 'label_type' => 'vertical', |
| 419 | - 'placeholder' => __( 'Choose a template', 'invoicing' ), |
|
| 419 | + 'placeholder' => __('Choose a template', 'invoicing'), |
|
| 420 | 420 | 'class' => 'form-control-sm', |
| 421 | - 'value' => $invoice->get_template( 'edit' ), |
|
| 421 | + 'value' => $invoice->get_template('edit'), |
|
| 422 | 422 | 'options' => array( |
| 423 | - 'quantity' => __( 'Quantity', 'invoicing' ), |
|
| 424 | - 'hours' => __( 'Hours', 'invoicing' ), |
|
| 425 | - 'amount' => __( 'Amount Only', 'invoicing' ), |
|
| 423 | + 'quantity' => __('Quantity', 'invoicing'), |
|
| 424 | + 'hours' => __('Hours', 'invoicing'), |
|
| 425 | + 'amount' => __('Amount Only', 'invoicing'), |
|
| 426 | 426 | ), |
| 427 | 427 | 'data-allow-clear' => 'false', |
| 428 | 428 | 'select2' => true, |
@@ -439,11 +439,11 @@ discard block |
||
| 439 | 439 | array( |
| 440 | 440 | 'id' => 'wpinv_currency', |
| 441 | 441 | 'name' => 'wpinv_currency', |
| 442 | - 'label' => __( 'Currency', 'invoicing' ), |
|
| 442 | + 'label' => __('Currency', 'invoicing'), |
|
| 443 | 443 | 'label_type' => 'vertical', |
| 444 | - 'placeholder' => __( 'Select Invoice Currency', 'invoicing' ), |
|
| 444 | + 'placeholder' => __('Select Invoice Currency', 'invoicing'), |
|
| 445 | 445 | 'class' => 'form-control-sm', |
| 446 | - 'value' => $invoice->get_currency( 'edit' ), |
|
| 446 | + 'value' => $invoice->get_currency('edit'), |
|
| 447 | 447 | 'required' => false, |
| 448 | 448 | 'data-allow-clear' => 'false', |
| 449 | 449 | 'select2' => true, |
@@ -456,24 +456,24 @@ discard block |
||
| 456 | 456 | </div> |
| 457 | 457 | </div> |
| 458 | 458 | |
| 459 | - <?php do_action( 'wpinv_meta_box_invoice_template_row', $invoice->get_id() ); ?> |
|
| 459 | + <?php do_action('wpinv_meta_box_invoice_template_row', $invoice->get_id()); ?> |
|
| 460 | 460 | <?php endif; ?> |
| 461 | 461 | |
| 462 | 462 | <table cellpadding="0" cellspacing="0" class="getpaid_invoice_items"> |
| 463 | 463 | <thead> |
| 464 | 464 | <tr> |
| 465 | - <th class="getpaid-item" colspan="2"><?php esc_html_e( 'Item', 'invoicing' ) ?></th> |
|
| 465 | + <th class="getpaid-item" colspan="2"><?php esc_html_e('Item', 'invoicing') ?></th> |
|
| 466 | 466 | <th class="getpaid-quantity hide-if-amount text-right"> |
| 467 | - <span class="getpaid-hide-if-hours"><?php esc_html_e( 'Quantity', 'invoicing' ) ?></span> |
|
| 468 | - <span class="getpaid-hide-if-quantity"><?php esc_html_e( 'Hours', 'invoicing' ) ?></span> |
|
| 467 | + <span class="getpaid-hide-if-hours"><?php esc_html_e('Quantity', 'invoicing') ?></span> |
|
| 468 | + <span class="getpaid-hide-if-quantity"><?php esc_html_e('Hours', 'invoicing') ?></span> |
|
| 469 | 469 | </th> |
| 470 | 470 | <th class="getpaid-price hide-if-amount text-right"> |
| 471 | - <span class="getpaid-hide-if-hours"><?php esc_html_e( 'Price', 'invoicing' ) ?></span> |
|
| 472 | - <span class="getpaid-hide-if-quantity"><?php esc_html_e( 'Rate', 'invoicing' ) ?></span> |
|
| 471 | + <span class="getpaid-hide-if-hours"><?php esc_html_e('Price', 'invoicing') ?></span> |
|
| 472 | + <span class="getpaid-hide-if-quantity"><?php esc_html_e('Rate', 'invoicing') ?></span> |
|
| 473 | 473 | </th> |
| 474 | 474 | <th class="getpaid-item-subtotal text-right"> |
| 475 | - <span class="getpaid-hide-if-hours getpaid-hide-if-quantity"><?php esc_html_e( 'Amount', 'invoicing' ) ?></span> |
|
| 476 | - <span class="hide-if-amount"><?php esc_html_e( 'Total', 'invoicing' ) ?></span> |
|
| 475 | + <span class="getpaid-hide-if-hours getpaid-hide-if-quantity"><?php esc_html_e('Amount', 'invoicing') ?></span> |
|
| 476 | + <span class="hide-if-amount"><?php esc_html_e('Total', 'invoicing') ?></span> |
|
| 477 | 477 | </th> |
| 478 | 478 | <th class="getpaid-item-actions hide-if-not-editable" width="70px"> </th> |
| 479 | 479 | </tr> |
@@ -481,8 +481,8 @@ discard block |
||
| 481 | 481 | <tbody class="getpaid_invoice_line_items"> |
| 482 | 482 | <tr class="hide-if-has-items hide-if-not-editable"> |
| 483 | 483 | <td colspan="2" class="pt-4 pb-4"> |
| 484 | - <button type="button" class="button button-primary add-invoice-item" data-toggle="modal" data-target="#getpaid-add-items-to-invoice"><?php esc_html_e( 'Add Existing Items', 'invoicing' ) ?></button> |
|
| 485 | - <button type="button" class="button button-secondary create-invoice-item" data-toggle="modal" data-target="#getpaid-create-invoice-item"><?php esc_html_e( 'Create New Item', 'invoicing' ) ?></button> |
|
| 484 | + <button type="button" class="button button-primary add-invoice-item" data-toggle="modal" data-target="#getpaid-add-items-to-invoice"><?php esc_html_e('Add Existing Items', 'invoicing') ?></button> |
|
| 485 | + <button type="button" class="button button-secondary create-invoice-item" data-toggle="modal" data-target="#getpaid-create-invoice-item"><?php esc_html_e('Create New Item', 'invoicing') ?></button> |
|
| 486 | 486 | </td> |
| 487 | 487 | <td class="hide-if-amount"> </th> |
| 488 | 488 | <td class="hide-if-amount"> </th> |
@@ -514,11 +514,11 @@ discard block |
||
| 514 | 514 | <div class="col-12 col-sm-6 offset-sm-6"> |
| 515 | 515 | <table class="getpaid-invoice-totals text-right w-100"> |
| 516 | 516 | <tbody> |
| 517 | - <?php foreach ( apply_filters( 'getpaid_invoice_subtotal_rows', $totals, $invoice ) as $key => $data ) : ?> |
|
| 518 | - <tr class="getpaid-totals-<?php echo esc_attr( $key ); ?>"> |
|
| 519 | - <td class="label"><?php echo esc_html( $data['label'] ) ?>:</td> |
|
| 517 | + <?php foreach (apply_filters('getpaid_invoice_subtotal_rows', $totals, $invoice) as $key => $data) : ?> |
|
| 518 | + <tr class="getpaid-totals-<?php echo esc_attr($key); ?>"> |
|
| 519 | + <td class="label"><?php echo esc_html($data['label']) ?>:</td> |
|
| 520 | 520 | <td width="1%"></td> |
| 521 | - <td class="value"><?php echo wp_kses_post( $data['value'] ) ?></td> |
|
| 521 | + <td class="value"><?php echo wp_kses_post($data['value']) ?></td> |
|
| 522 | 522 | </tr> |
| 523 | 523 | <?php endforeach; ?> |
| 524 | 524 | </tbody> |
@@ -531,18 +531,18 @@ discard block |
||
| 531 | 531 | <div class="getpaid-invoice-item-actions hide-if-no-items hide-if-not-editable"> |
| 532 | 532 | <div class="row"> |
| 533 | 533 | <div class="text-left col-12 col-sm-8"> |
| 534 | - <button type="button" class="button button-primary add-invoice-item" data-toggle="modal" data-target="#getpaid-add-items-to-invoice"><?php esc_html_e( 'Add Existing Item', 'invoicing' ) ?></button> |
|
| 535 | - <button type="button" class="button button-secondary create-invoice-item" data-toggle="modal" data-target="#getpaid-create-invoice-item"><?php esc_html_e( 'Create New Item', 'invoicing' ) ?></button> |
|
| 536 | - <?php do_action( 'getpaid-invoice-items-actions', $invoice ); ?> |
|
| 534 | + <button type="button" class="button button-primary add-invoice-item" data-toggle="modal" data-target="#getpaid-add-items-to-invoice"><?php esc_html_e('Add Existing Item', 'invoicing') ?></button> |
|
| 535 | + <button type="button" class="button button-secondary create-invoice-item" data-toggle="modal" data-target="#getpaid-create-invoice-item"><?php esc_html_e('Create New Item', 'invoicing') ?></button> |
|
| 536 | + <?php do_action('getpaid-invoice-items-actions', $invoice); ?> |
|
| 537 | 537 | </div> |
| 538 | 538 | <div class="text-right col-12 col-sm-4"> |
| 539 | - <button type="button" class="button button-primary recalculate-totals-button"><?php esc_html_e( 'Recalculate Totals', 'invoicing' ) ?></button> |
|
| 539 | + <button type="button" class="button button-primary recalculate-totals-button"><?php esc_html_e('Recalculate Totals', 'invoicing') ?></button> |
|
| 540 | 540 | </div> |
| 541 | 541 | </div> |
| 542 | 542 | </div> |
| 543 | 543 | |
| 544 | 544 | <div class="getpaid-invoice-item-actions hide-if-editable"> |
| 545 | - <p class="description m-2 text-right text-muted"><?php esc_html_e( 'This invoice is no longer editable', 'invoicing' ); ?></p> |
|
| 545 | + <p class="description m-2 text-right text-muted"><?php esc_html_e('This invoice is no longer editable', 'invoicing'); ?></p> |
|
| 546 | 546 | </div> |
| 547 | 547 | |
| 548 | 548 | <!-- Add items to an invoice --> |
@@ -550,8 +550,8 @@ discard block |
||
| 550 | 550 | <div class="modal-dialog modal-dialog-centered" role="document"> |
| 551 | 551 | <div class="modal-content"> |
| 552 | 552 | <div class="modal-header"> |
| 553 | - <h5 class="modal-title" id="getpaid-add-item-to-invoice-label"><?php esc_html_e( "Add Item(s)", 'invoicing' ); ?></h5> |
|
| 554 | - <button type="button" class="close" data-dismiss="modal" aria-label="<?php esc_html_e( "Close", 'invoicing' ); ?>"> |
|
| 553 | + <h5 class="modal-title" id="getpaid-add-item-to-invoice-label"><?php esc_html_e("Add Item(s)", 'invoicing'); ?></h5> |
|
| 554 | + <button type="button" class="close" data-dismiss="modal" aria-label="<?php esc_html_e("Close", 'invoicing'); ?>"> |
|
| 555 | 555 | <span aria-hidden="true">×</span> |
| 556 | 556 | </button> |
| 557 | 557 | </div> |
@@ -559,10 +559,10 @@ discard block |
||
| 559 | 559 | <table class="widefat"> |
| 560 | 560 | <thead> |
| 561 | 561 | <tr> |
| 562 | - <th class="pl-0 text-left"><?php esc_html_e( 'Item', 'invoicing' ) ?></th> |
|
| 562 | + <th class="pl-0 text-left"><?php esc_html_e('Item', 'invoicing') ?></th> |
|
| 563 | 563 | <th class="pr-0 text-right hide-if-amount"> |
| 564 | - <span class="getpaid-hide-if-hours"><?php esc_html_e( 'Quantity', 'invoicing' ) ?></span> |
|
| 565 | - <span class="getpaid-hide-if-quantity"><?php esc_html_e( 'Hours', 'invoicing' ) ?></span> |
|
| 564 | + <span class="getpaid-hide-if-hours"><?php esc_html_e('Quantity', 'invoicing') ?></span> |
|
| 565 | + <span class="getpaid-hide-if-quantity"><?php esc_html_e('Hours', 'invoicing') ?></span> |
|
| 566 | 566 | </th> |
| 567 | 567 | </tr> |
| 568 | 568 | </thead> |
@@ -570,9 +570,9 @@ discard block |
||
| 570 | 570 | <tr> |
| 571 | 571 | <td class="pl-0 text-left"> |
| 572 | 572 | <select class="regular-text getpaid-add-invoice-item-select"> |
| 573 | - <option value="" selected="selected" disabled><?php esc_html_e( 'Select an item…', 'invoicing' ); ?></option> |
|
| 574 | - <?php foreach ( get_posts( $item_args ) as $item ) : ?> |
|
| 575 | - <option value="<?php echo (int) $item->ID; ?>"><?php echo esc_html( $item->post_title ); ?></option> |
|
| 573 | + <option value="" selected="selected" disabled><?php esc_html_e('Select an item…', 'invoicing'); ?></option> |
|
| 574 | + <?php foreach (get_posts($item_args) as $item) : ?> |
|
| 575 | + <option value="<?php echo (int) $item->ID; ?>"><?php echo esc_html($item->post_title); ?></option> |
|
| 576 | 576 | <?php endforeach; ?> |
| 577 | 577 | </select> |
| 578 | 578 | </td> |
@@ -584,8 +584,8 @@ discard block |
||
| 584 | 584 | </table> |
| 585 | 585 | </div> |
| 586 | 586 | <div class="modal-footer"> |
| 587 | - <button type="button" class="btn btn-secondary getpaid-cancel" data-dismiss="modal"><?php esc_html_e( 'Cancel', 'invoicing' ); ?></button> |
|
| 588 | - <button type="button" class="btn btn-primary getpaid-add" data-dismiss="modal"><?php esc_html_e( 'Add', 'invoicing' ); ?></button> |
|
| 587 | + <button type="button" class="btn btn-secondary getpaid-cancel" data-dismiss="modal"><?php esc_html_e('Cancel', 'invoicing'); ?></button> |
|
| 588 | + <button type="button" class="btn btn-primary getpaid-add" data-dismiss="modal"><?php esc_html_e('Add', 'invoicing'); ?></button> |
|
| 589 | 589 | </div> |
| 590 | 590 | </div> |
| 591 | 591 | </div> |
@@ -596,8 +596,8 @@ discard block |
||
| 596 | 596 | <div class="modal-dialog modal-dialog-centered" role="document"> |
| 597 | 597 | <div class="modal-content"> |
| 598 | 598 | <div class="modal-header"> |
| 599 | - <h5 class="modal-title" id="getpaid-create-invoice-item-label"><?php esc_html_e( "Create Item", 'invoicing' ); ?></h5> |
|
| 600 | - <button type="button" class="close" data-dismiss="modal" aria-label="<?php esc_html_e( "Close", 'invoicing' ); ?>"> |
|
| 599 | + <h5 class="modal-title" id="getpaid-create-invoice-item-label"><?php esc_html_e("Create Item", 'invoicing'); ?></h5> |
|
| 600 | + <button type="button" class="close" data-dismiss="modal" aria-label="<?php esc_html_e("Close", 'invoicing'); ?>"> |
|
| 601 | 601 | <span aria-hidden="true">×</span> |
| 602 | 602 | </button> |
| 603 | 603 | </div> |
@@ -605,27 +605,27 @@ discard block |
||
| 605 | 605 | <div class="getpaid-create-item-div"> |
| 606 | 606 | <input type="hidden" name="id" value="new" class="form-control form-control-sm item-id"> |
| 607 | 607 | <label class="form-group w-100"> |
| 608 | - <span><?php esc_html_e( 'Name', 'invoicing' ); ?></span> |
|
| 609 | - <input type="text" name="name" placeholder="<?php esc_attr_e( 'Item Name', 'invoicing' ); ?>" class="form-control form-control-sm item-name"> |
|
| 608 | + <span><?php esc_html_e('Name', 'invoicing'); ?></span> |
|
| 609 | + <input type="text" name="name" placeholder="<?php esc_attr_e('Item Name', 'invoicing'); ?>" class="form-control form-control-sm item-name"> |
|
| 610 | 610 | </label> |
| 611 | 611 | <label class="form-group w-100"> |
| 612 | - <span class="getpaid-hide-if-hours getpaid-hide-if-quantity item-price"><?php esc_html_e( 'Amount', 'invoicing' ); ?></span> |
|
| 613 | - <span class="hide-if-amount"><?php esc_html_e( 'Price', 'invoicing' ); ?></span> |
|
| 614 | - <input type="text" name="price" placeholder="<?php echo esc_attr( wpinv_sanitize_amount( 0 ) ); ?>" class="form-control form-control-sm item-price"> |
|
| 612 | + <span class="getpaid-hide-if-hours getpaid-hide-if-quantity item-price"><?php esc_html_e('Amount', 'invoicing'); ?></span> |
|
| 613 | + <span class="hide-if-amount"><?php esc_html_e('Price', 'invoicing'); ?></span> |
|
| 614 | + <input type="text" name="price" placeholder="<?php echo esc_attr(wpinv_sanitize_amount(0)); ?>" class="form-control form-control-sm item-price"> |
|
| 615 | 615 | </label> |
| 616 | 616 | <label class="form-group w-100 hide-if-amount"> |
| 617 | - <span><?php esc_html_e( 'Quantity', 'invoicing' ); ?></span> |
|
| 617 | + <span><?php esc_html_e('Quantity', 'invoicing'); ?></span> |
|
| 618 | 618 | <input type="text" name="quantity" placeholder="1" class="form-control form-control-sm item-quantity"> |
| 619 | 619 | </label> |
| 620 | 620 | <label class="form-group w-100"> |
| 621 | - <span><?php esc_html_e( 'Item Description', 'invoicing' ); ?></span> |
|
| 622 | - <textarea name="description" placeholder="<?php esc_attr_e( 'Enter a description for this item', 'invoicing' ); ?>" class="form-control item-description"></textarea> |
|
| 621 | + <span><?php esc_html_e('Item Description', 'invoicing'); ?></span> |
|
| 622 | + <textarea name="description" placeholder="<?php esc_attr_e('Enter a description for this item', 'invoicing'); ?>" class="form-control item-description"></textarea> |
|
| 623 | 623 | </label> |
| 624 | 624 | </div> |
| 625 | 625 | </div> |
| 626 | 626 | <div class="modal-footer"> |
| 627 | - <button type="button" class="btn btn-secondary getpaid-cancel" data-dismiss="modal"><?php esc_html_e( 'Cancel', 'invoicing' ); ?></button> |
|
| 628 | - <button type="button" class="btn btn-primary getpaid-save" data-dismiss="modal"><?php esc_html_e( 'Create', 'invoicing' ); ?></button> |
|
| 627 | + <button type="button" class="btn btn-secondary getpaid-cancel" data-dismiss="modal"><?php esc_html_e('Cancel', 'invoicing'); ?></button> |
|
| 628 | + <button type="button" class="btn btn-primary getpaid-save" data-dismiss="modal"><?php esc_html_e('Create', 'invoicing'); ?></button> |
|
| 629 | 629 | </div> |
| 630 | 630 | </div> |
| 631 | 631 | </div> |
@@ -636,8 +636,8 @@ discard block |
||
| 636 | 636 | <div class="modal-dialog modal-dialog-centered" role="document"> |
| 637 | 637 | <div class="modal-content"> |
| 638 | 638 | <div class="modal-header"> |
| 639 | - <h5 class="modal-title" id="getpaid-edit-invoice-item-label"><?php esc_html_e( "Edit Item", 'invoicing' ); ?></h5> |
|
| 640 | - <button type="button" class="close" data-dismiss="modal" aria-label="<?php esc_html_e( "Close", 'invoicing' ); ?>"> |
|
| 639 | + <h5 class="modal-title" id="getpaid-edit-invoice-item-label"><?php esc_html_e("Edit Item", 'invoicing'); ?></h5> |
|
| 640 | + <button type="button" class="close" data-dismiss="modal" aria-label="<?php esc_html_e("Close", 'invoicing'); ?>"> |
|
| 641 | 641 | <span aria-hidden="true">×</span> |
| 642 | 642 | </button> |
| 643 | 643 | </div> |
@@ -645,27 +645,27 @@ discard block |
||
| 645 | 645 | <div class="getpaid-edit-item-div"> |
| 646 | 646 | <input type="hidden" name="id" class="form-control form-control-sm item-id"> |
| 647 | 647 | <label class="form-group w-100"> |
| 648 | - <span><?php esc_html_e( 'Name', 'invoicing' ); ?></span> |
|
| 649 | - <input type="text" name="name" placeholder="<?php esc_attr_e( 'Item Name', 'invoicing' ); ?>" class="form-control form-control-sm item-name"> |
|
| 648 | + <span><?php esc_html_e('Name', 'invoicing'); ?></span> |
|
| 649 | + <input type="text" name="name" placeholder="<?php esc_attr_e('Item Name', 'invoicing'); ?>" class="form-control form-control-sm item-name"> |
|
| 650 | 650 | </label> |
| 651 | 651 | <label class="form-group w-100"> |
| 652 | - <span class="getpaid-hide-if-hours getpaid-hide-if-quantity item-price"><?php esc_html_e( 'Amount', 'invoicing' ); ?></span> |
|
| 653 | - <span class="hide-if-amount"><?php esc_html_e( 'Price', 'invoicing' ); ?></span> |
|
| 654 | - <input type="text" name="price" placeholder="<?php wpinv_sanitize_amount( 0 ); ?>" class="form-control form-control-sm item-price"> |
|
| 652 | + <span class="getpaid-hide-if-hours getpaid-hide-if-quantity item-price"><?php esc_html_e('Amount', 'invoicing'); ?></span> |
|
| 653 | + <span class="hide-if-amount"><?php esc_html_e('Price', 'invoicing'); ?></span> |
|
| 654 | + <input type="text" name="price" placeholder="<?php wpinv_sanitize_amount(0); ?>" class="form-control form-control-sm item-price"> |
|
| 655 | 655 | </label> |
| 656 | 656 | <label class="form-group w-100 hide-if-amount"> |
| 657 | - <span><?php esc_html_e( 'Quantity', 'invoicing' ); ?></span> |
|
| 657 | + <span><?php esc_html_e('Quantity', 'invoicing'); ?></span> |
|
| 658 | 658 | <input type="text" name="quantity" placeholder="1" class="form-control form-control-sm item-quantity"> |
| 659 | 659 | </label> |
| 660 | 660 | <label class="form-group w-100"> |
| 661 | - <span><?php esc_html_e( 'Item Description', 'invoicing' ); ?></span> |
|
| 662 | - <textarea name="description" placeholder="<?php esc_attr_e( 'Enter a description for this item', 'invoicing' ); ?>" class="form-control item-description"></textarea> |
|
| 661 | + <span><?php esc_html_e('Item Description', 'invoicing'); ?></span> |
|
| 662 | + <textarea name="description" placeholder="<?php esc_attr_e('Enter a description for this item', 'invoicing'); ?>" class="form-control item-description"></textarea> |
|
| 663 | 663 | </label> |
| 664 | 664 | </div> |
| 665 | 665 | </div> |
| 666 | 666 | <div class="modal-footer"> |
| 667 | - <button type="button" class="btn btn-secondary getpaid-cancel" data-dismiss="modal"><?php esc_html_e( 'Cancel', 'invoicing' ); ?></button> |
|
| 668 | - <button type="button" class="btn btn-primary getpaid-save" data-dismiss="modal"><?php esc_html_e( 'Save', 'invoicing' ); ?></button> |
|
| 667 | + <button type="button" class="btn btn-secondary getpaid-cancel" data-dismiss="modal"><?php esc_html_e('Cancel', 'invoicing'); ?></button> |
|
| 668 | + <button type="button" class="btn btn-primary getpaid-save" data-dismiss="modal"><?php esc_html_e('Save', 'invoicing'); ?></button> |
|
| 669 | 669 | </div> |
| 670 | 670 | </div> |
| 671 | 671 | </div> |
@@ -5,7 +5,7 @@ discard block |
||
| 5 | 5 | * |
| 6 | 6 | */ |
| 7 | 7 | |
| 8 | -defined( 'ABSPATH' ) || exit; |
|
| 8 | +defined('ABSPATH') || exit; |
|
| 9 | 9 | |
| 10 | 10 | /** |
| 11 | 11 | * GetPaid_Reports_Report Class. |
@@ -23,26 +23,26 @@ discard block |
||
| 23 | 23 | */ |
| 24 | 24 | public function __construct() { |
| 25 | 25 | |
| 26 | - $this->views = array( |
|
| 26 | + $this->views = array( |
|
| 27 | 27 | |
| 28 | 28 | 'items' => array( |
| 29 | - 'label' => __( 'Items', 'invoicing' ), |
|
| 29 | + 'label' => __('Items', 'invoicing'), |
|
| 30 | 30 | 'class' => 'GetPaid_Reports_Report_Items', |
| 31 | 31 | ), |
| 32 | 32 | |
| 33 | 33 | 'gateways' => array( |
| 34 | - 'label' => __( 'Payment Methods', 'invoicing' ), |
|
| 34 | + 'label' => __('Payment Methods', 'invoicing'), |
|
| 35 | 35 | 'class' => 'GetPaid_Reports_Report_Gateways', |
| 36 | 36 | ), |
| 37 | 37 | |
| 38 | 38 | 'discounts' => array( |
| 39 | - 'label' => __( 'Discount Codes', 'invoicing' ), |
|
| 39 | + 'label' => __('Discount Codes', 'invoicing'), |
|
| 40 | 40 | 'class' => 'GetPaid_Reports_Report_Discounts', |
| 41 | 41 | ), |
| 42 | 42 | |
| 43 | 43 | ); |
| 44 | 44 | |
| 45 | - $this->views = apply_filters( 'wpinv_report_views', $this->views ); |
|
| 45 | + $this->views = apply_filters('wpinv_report_views', $this->views); |
|
| 46 | 46 | |
| 47 | 47 | } |
| 48 | 48 | |
@@ -53,8 +53,8 @@ discard block |
||
| 53 | 53 | public function get_range() { |
| 54 | 54 | $valid_ranges = $this->get_periods(); |
| 55 | 55 | |
| 56 | - if ( isset( $_GET['date_range'] ) && array_key_exists( $_GET['date_range'], $valid_ranges ) ) { |
|
| 57 | - return sanitize_key( $_GET['date_range'] ); |
|
| 56 | + if (isset($_GET['date_range']) && array_key_exists($_GET['date_range'], $valid_ranges)) { |
|
| 57 | + return sanitize_key($_GET['date_range']); |
|
| 58 | 58 | } |
| 59 | 59 | |
| 60 | 60 | return '7_days'; |
@@ -68,22 +68,22 @@ discard block |
||
| 68 | 68 | public function get_periods() { |
| 69 | 69 | |
| 70 | 70 | $periods = array( |
| 71 | - 'today' => __( 'Today', 'invoicing' ), |
|
| 72 | - 'yesterday' => __( 'Yesterday', 'invoicing' ), |
|
| 73 | - 'week' => __( 'This week', 'invoicing' ), |
|
| 74 | - 'last_week' => __( 'Last week', 'invoicing' ), |
|
| 75 | - '7_days' => __( 'Last 7 days', 'invoicing' ), |
|
| 76 | - 'month' => __( 'This month', 'invoicing' ), |
|
| 77 | - 'last_month' => __( 'Last month', 'invoicing' ), |
|
| 78 | - '30_days' => __( 'Last 30 days', 'invoicing' ), |
|
| 79 | - 'quarter' => __( 'This Quarter', 'invoicing' ), |
|
| 80 | - 'last_quarter' => __( 'Last Quarter', 'invoicing' ), |
|
| 81 | - 'year' => __( 'This year', 'invoicing' ), |
|
| 82 | - 'last_year' => __( 'Last Year', 'invoicing' ), |
|
| 83 | - 'custom' => __( 'Custom Date Range', 'invoicing' ), |
|
| 71 | + 'today' => __('Today', 'invoicing'), |
|
| 72 | + 'yesterday' => __('Yesterday', 'invoicing'), |
|
| 73 | + 'week' => __('This week', 'invoicing'), |
|
| 74 | + 'last_week' => __('Last week', 'invoicing'), |
|
| 75 | + '7_days' => __('Last 7 days', 'invoicing'), |
|
| 76 | + 'month' => __('This month', 'invoicing'), |
|
| 77 | + 'last_month' => __('Last month', 'invoicing'), |
|
| 78 | + '30_days' => __('Last 30 days', 'invoicing'), |
|
| 79 | + 'quarter' => __('This Quarter', 'invoicing'), |
|
| 80 | + 'last_quarter' => __('Last Quarter', 'invoicing'), |
|
| 81 | + 'year' => __('This year', 'invoicing'), |
|
| 82 | + 'last_year' => __('Last Year', 'invoicing'), |
|
| 83 | + 'custom' => __('Custom Date Range', 'invoicing'), |
|
| 84 | 84 | ); |
| 85 | 85 | |
| 86 | - return apply_filters( 'getpaid_earning_periods', $periods ); |
|
| 86 | + return apply_filters('getpaid_earning_periods', $periods); |
|
| 87 | 87 | } |
| 88 | 88 | |
| 89 | 89 | /** |
@@ -96,21 +96,21 @@ discard block |
||
| 96 | 96 | ?> |
| 97 | 97 | |
| 98 | 98 | <form method="get" class="getpaid-filter-earnings float-right"> |
| 99 | - <?php getpaid_hidden_field( 'page', isset( $_GET['page'] ) ? sanitize_text_field( $_GET['page'] ) : 'wpinv-reports' ); ?> |
|
| 100 | - <?php getpaid_hidden_field( 'tab', 'reports' ); ?> |
|
| 99 | + <?php getpaid_hidden_field('page', isset($_GET['page']) ? sanitize_text_field($_GET['page']) : 'wpinv-reports'); ?> |
|
| 100 | + <?php getpaid_hidden_field('tab', 'reports'); ?> |
|
| 101 | 101 | <select name='date_range'> |
| 102 | - <?php foreach ( $this->get_periods() as $key => $label ) : ?> |
|
| 103 | - <option value="<?php echo esc_attr( $key ); ?>" <?php selected( $key, $range ); ?>><?php echo esc_html( $label ); ?></option> |
|
| 102 | + <?php foreach ($this->get_periods() as $key => $label) : ?> |
|
| 103 | + <option value="<?php echo esc_attr($key); ?>" <?php selected($key, $range); ?>><?php echo esc_html($label); ?></option> |
|
| 104 | 104 | <?php endforeach; ?> |
| 105 | 105 | </select> |
| 106 | 106 | <span class="getpaid-date-range-picker <?php echo 'custom' == $range ? '' : 'd-none'; ?>"> |
| 107 | 107 | <input type="text" name="from" class="getpaid-from align-middle" /> |
| 108 | - <?php esc_html_e( 'to', 'invoicing' ); ?> |
|
| 108 | + <?php esc_html_e('to', 'invoicing'); ?> |
|
| 109 | 109 | <input type="text" name="to" class="getpaid-to align-middle" /> |
| 110 | 110 | </span> |
| 111 | 111 | <button type="submit" class="button button-primary"> |
| 112 | 112 | <i class="fa fa-chevron-right fa-lg"></i> |
| 113 | - <span class="screen-reader-text"><?php esc_html_e( 'View Reports', 'invoicing' ); ?></span> |
|
| 113 | + <span class="screen-reader-text"><?php esc_html_e('View Reports', 'invoicing'); ?></span> |
|
| 114 | 114 | </button> |
| 115 | 115 | </form> |
| 116 | 116 | |
@@ -159,17 +159,17 @@ discard block |
||
| 159 | 159 | |
| 160 | 160 | <div class="col-12 col-md-4"> |
| 161 | 161 | <div class="row getpaid-report-cards"> |
| 162 | - <?php foreach ( $this->get_cards() as $key => $card ) : ?> |
|
| 162 | + <?php foreach ($this->get_cards() as $key => $card) : ?> |
|
| 163 | 163 | <div class="col-12 mb-4"> |
| 164 | 164 | |
| 165 | - <!-- <?php echo esc_html( $card['label'] ); ?> Card --> |
|
| 166 | - <div class="card p-0 m-0 shadow-none <?php echo esc_attr( $key ); ?>"> |
|
| 165 | + <!-- <?php echo esc_html($card['label']); ?> Card --> |
|
| 166 | + <div class="card p-0 m-0 shadow-none <?php echo esc_attr($key); ?>"> |
|
| 167 | 167 | |
| 168 | 168 | <div class="card-body"> |
| 169 | 169 | |
| 170 | 170 | <p class="getpaid-current text-uppercase small mb-2"> |
| 171 | - <strong><?php echo esc_html( $card['label'] ); ?></strong> |
|
| 172 | - <span title="<?php echo esc_attr( $card['description'] ); ?>" class="wpi-help-tip dashicons dashicons-editor-help text-muted" style="margin-top: -2px;"></span> |
|
| 171 | + <strong><?php echo esc_html($card['label']); ?></strong> |
|
| 172 | + <span title="<?php echo esc_attr($card['description']); ?>" class="wpi-help-tip dashicons dashicons-editor-help text-muted" style="margin-top: -2px;"></span> |
|
| 173 | 173 | </p> |
| 174 | 174 | <h5 class="font-weight-bold mb-0"> |
| 175 | 175 | <span class="getpaid-report-card-value"> |
@@ -180,7 +180,7 @@ discard block |
||
| 180 | 180 | |
| 181 | 181 | <hr> |
| 182 | 182 | |
| 183 | - <p class="getpaid-previous text-uppercase text-muted small mb-2"><strong><?php esc_html_e( 'Previous Period', 'invoicing' ); ?></strong></p> |
|
| 183 | + <p class="getpaid-previous text-uppercase text-muted small mb-2"><strong><?php esc_html_e('Previous Period', 'invoicing'); ?></strong></p> |
|
| 184 | 184 | <h5 class="getpaid-report-card-previous-value font-weight-bold text-muted mb-0"> |
| 185 | 185 | <span class="spinner is-active float-none"></span> |
| 186 | 186 | </h5> |
@@ -188,7 +188,7 @@ discard block |
||
| 188 | 188 | </div> |
| 189 | 189 | |
| 190 | 190 | </div> |
| 191 | - <!-- <?php echo esc_html( $card['label'] ); ?> Card --> |
|
| 191 | + <!-- <?php echo esc_html($card['label']); ?> Card --> |
|
| 192 | 192 | |
| 193 | 193 | </div> |
| 194 | 194 | <?php endforeach; ?> |
@@ -213,15 +213,15 @@ discard block |
||
| 213 | 213 | |
| 214 | 214 | ?> |
| 215 | 215 | |
| 216 | - <?php foreach ( $graphs as $key => $graph ) : ?> |
|
| 216 | + <?php foreach ($graphs as $key => $graph) : ?> |
|
| 217 | 217 | <div class="row mb-4"> |
| 218 | 218 | <div class="col-12"> |
| 219 | 219 | <div class="card m-0 p-0 single-report-card" style="max-width:100%"> |
| 220 | 220 | <div class="card-header"> |
| 221 | - <strong><?php echo esc_html( $graph ); ?></strong> |
|
| 221 | + <strong><?php echo esc_html($graph); ?></strong> |
|
| 222 | 222 | </div> |
| 223 | 223 | <div class="card-body"> |
| 224 | - <canvas id="getpaid-chartjs-<?php echo esc_attr( $key ); ?>"></canvas> |
|
| 224 | + <canvas id="getpaid-chartjs-<?php echo esc_attr($key); ?>"></canvas> |
|
| 225 | 225 | </div> |
| 226 | 226 | </div> |
| 227 | 227 | </div> |
@@ -236,14 +236,14 @@ discard block |
||
| 236 | 236 | * Retrieves the download url. |
| 237 | 237 | * |
| 238 | 238 | */ |
| 239 | - public function get_download_url( $graph, $file_type ) { |
|
| 239 | + public function get_download_url($graph, $file_type) { |
|
| 240 | 240 | |
| 241 | 241 | return wp_nonce_url( |
| 242 | 242 | add_query_arg( |
| 243 | 243 | array( |
| 244 | 244 | 'getpaid-admin-action' => 'download_graph', |
| 245 | - 'file_type' => urlencode( $file_type ), |
|
| 246 | - 'graph' => urlencode( $graph ), |
|
| 245 | + 'file_type' => urlencode($file_type), |
|
| 246 | + 'graph' => urlencode($graph), |
|
| 247 | 247 | ) |
| 248 | 248 | ), |
| 249 | 249 | 'getpaid-nonce', |
@@ -260,27 +260,27 @@ discard block |
||
| 260 | 260 | |
| 261 | 261 | ?> |
| 262 | 262 | |
| 263 | - <?php foreach ( $this->views as $key => $view ) : ?> |
|
| 263 | + <?php foreach ($this->views as $key => $view) : ?> |
|
| 264 | 264 | <div class="row mb-4"> |
| 265 | 265 | <div class="col-12"> |
| 266 | 266 | <div class="card m-0 p-0" style="max-width:100%"> |
| 267 | 267 | <div class="card-header"> |
| 268 | 268 | <div class="row"> |
| 269 | - <div class="<?php echo empty( $view['disable-downloads'] ) ? 'col-9' : 'col-12'; ?>"> |
|
| 270 | - <strong><?php echo esc_html( $view['label'] ); ?></strong> |
|
| 269 | + <div class="<?php echo empty($view['disable-downloads']) ? 'col-9' : 'col-12'; ?>"> |
|
| 270 | + <strong><?php echo esc_html($view['label']); ?></strong> |
|
| 271 | 271 | </div> |
| 272 | - <div class="<?php echo empty( $view['disable-downloads'] ) ? 'col-3' : 'd-none'; ?>"> |
|
| 273 | - <a title="<?php esc_attr_e( 'Download JSON', 'invoicing' ); ?>" href="<?php echo esc_url( $this->get_download_url( $key, 'json' ) ); ?>"> |
|
| 272 | + <div class="<?php echo empty($view['disable-downloads']) ? 'col-3' : 'd-none'; ?>"> |
|
| 273 | + <a title="<?php esc_attr_e('Download JSON', 'invoicing'); ?>" href="<?php echo esc_url($this->get_download_url($key, 'json')); ?>"> |
|
| 274 | 274 | <i class="fa fa-download text-dark" style="font-size: 16px" aria-hidden="true"></i> |
| 275 | - <span class="screen-reader-text"><?php esc_html_e( 'Download JSON', 'invoicing' ); ?></span> |
|
| 275 | + <span class="screen-reader-text"><?php esc_html_e('Download JSON', 'invoicing'); ?></span> |
|
| 276 | 276 | </a> |
| 277 | - <a title="<?php esc_attr_e( 'Download CSV', 'invoicing' ); ?>" href="<?php echo esc_url( $this->get_download_url( $key, 'csv' ) ); ?>"> |
|
| 277 | + <a title="<?php esc_attr_e('Download CSV', 'invoicing'); ?>" href="<?php echo esc_url($this->get_download_url($key, 'csv')); ?>"> |
|
| 278 | 278 | <i class="fa fa-file-csv text-dark" style="font-size: 16px" aria-hidden="true"></i> |
| 279 | - <span class="screen-reader-text"><?php esc_html_e( 'Download CSV', 'invoicing' ); ?></span> |
|
| 279 | + <span class="screen-reader-text"><?php esc_html_e('Download CSV', 'invoicing'); ?></span> |
|
| 280 | 280 | </a> |
| 281 | - <a title="<?php esc_attr_e( 'Download XML', 'invoicing' ); ?>" href="<?php echo esc_url( $this->get_download_url( $key, 'xml' ) ); ?>"> |
|
| 281 | + <a title="<?php esc_attr_e('Download XML', 'invoicing'); ?>" href="<?php echo esc_url($this->get_download_url($key, 'xml')); ?>"> |
|
| 282 | 282 | <i class="fa fa-file-code text-dark" style="font-size: 16px" aria-hidden="true"></i> |
| 283 | - <span class="screen-reader-text"><?php esc_html_e( 'Download XML', 'invoicing' ); ?></span> |
|
| 283 | + <span class="screen-reader-text"><?php esc_html_e('Download XML', 'invoicing'); ?></span> |
|
| 284 | 284 | </a> |
| 285 | 285 | </div> |
| 286 | 286 | </div> |
@@ -299,7 +299,7 @@ discard block |
||
| 299 | 299 | |
| 300 | 300 | <?php |
| 301 | 301 | |
| 302 | - do_action( 'getpaid_reports_display_right', $this ); |
|
| 302 | + do_action('getpaid_reports_display_right', $this); |
|
| 303 | 303 | } |
| 304 | 304 | |
| 305 | 305 | /** |
@@ -310,56 +310,56 @@ discard block |
||
| 310 | 310 | |
| 311 | 311 | $cards = array( |
| 312 | 312 | 'total_sales' => array( |
| 313 | - 'description' => __( 'Gross sales in the period.', 'invoicing' ), |
|
| 314 | - 'label' => __( 'Gross Revenue', 'invoicing' ), |
|
| 313 | + 'description' => __('Gross sales in the period.', 'invoicing'), |
|
| 314 | + 'label' => __('Gross Revenue', 'invoicing'), |
|
| 315 | 315 | ), |
| 316 | 316 | 'net_sales' => array( |
| 317 | - 'description' => __( 'Net sales in the period.', 'invoicing' ), |
|
| 318 | - 'label' => __( 'Net Revenue', 'invoicing' ), |
|
| 317 | + 'description' => __('Net sales in the period.', 'invoicing'), |
|
| 318 | + 'label' => __('Net Revenue', 'invoicing'), |
|
| 319 | 319 | ), |
| 320 | 320 | 'average_sales' => array( |
| 321 | - 'description' => __( 'Average net daily/monthly sales.', 'invoicing' ), |
|
| 322 | - 'label' => __( 'Avg. Net Sales', 'invoicing' ), |
|
| 321 | + 'description' => __('Average net daily/monthly sales.', 'invoicing'), |
|
| 322 | + 'label' => __('Avg. Net Sales', 'invoicing'), |
|
| 323 | 323 | ), |
| 324 | 324 | 'average_total_sales' => array( |
| 325 | - 'description' => __( 'Average gross daily/monthly sales.', 'invoicing' ), |
|
| 326 | - 'label' => __( 'Avg. Gross Sales', 'invoicing' ), |
|
| 325 | + 'description' => __('Average gross daily/monthly sales.', 'invoicing'), |
|
| 326 | + 'label' => __('Avg. Gross Sales', 'invoicing'), |
|
| 327 | 327 | ), |
| 328 | 328 | 'total_invoices' => array( |
| 329 | - 'description' => __( 'Number of paid invoices.', 'invoicing' ), |
|
| 330 | - 'label' => __( 'Paid Invoices', 'invoicing' ), |
|
| 329 | + 'description' => __('Number of paid invoices.', 'invoicing'), |
|
| 330 | + 'label' => __('Paid Invoices', 'invoicing'), |
|
| 331 | 331 | ), |
| 332 | 332 | 'total_items' => array( |
| 333 | - 'description' => __( 'Number of items purchased.', 'invoicing' ), |
|
| 334 | - 'label' => __( 'Purchased Items', 'invoicing' ), |
|
| 333 | + 'description' => __('Number of items purchased.', 'invoicing'), |
|
| 334 | + 'label' => __('Purchased Items', 'invoicing'), |
|
| 335 | 335 | ), |
| 336 | 336 | 'refunded_items' => array( |
| 337 | - 'description' => __( 'Number of items refunded.', 'invoicing' ), |
|
| 338 | - 'label' => __( 'Refunded Items', 'invoicing' ), |
|
| 337 | + 'description' => __('Number of items refunded.', 'invoicing'), |
|
| 338 | + 'label' => __('Refunded Items', 'invoicing'), |
|
| 339 | 339 | ), |
| 340 | 340 | 'total_tax' => array( |
| 341 | - 'description' => __( 'Total charged for taxes.', 'invoicing' ), |
|
| 342 | - 'label' => __( 'Tax', 'invoicing' ), |
|
| 341 | + 'description' => __('Total charged for taxes.', 'invoicing'), |
|
| 342 | + 'label' => __('Tax', 'invoicing'), |
|
| 343 | 343 | ), |
| 344 | 344 | 'total_refunded_tax' => array( |
| 345 | - 'description' => __( 'Total refunded for taxes.', 'invoicing' ), |
|
| 346 | - 'label' => __( 'Refunded Tax', 'invoicing' ), |
|
| 345 | + 'description' => __('Total refunded for taxes.', 'invoicing'), |
|
| 346 | + 'label' => __('Refunded Tax', 'invoicing'), |
|
| 347 | 347 | ), |
| 348 | 348 | 'total_fees' => array( |
| 349 | - 'description' => __( 'Total fees charged.', 'invoicing' ), |
|
| 350 | - 'label' => __( 'Fees', 'invoicing' ), |
|
| 349 | + 'description' => __('Total fees charged.', 'invoicing'), |
|
| 350 | + 'label' => __('Fees', 'invoicing'), |
|
| 351 | 351 | ), |
| 352 | 352 | 'total_refunds' => array( |
| 353 | - 'description' => __( 'Total of refunded invoices.', 'invoicing' ), |
|
| 354 | - 'label' => __( 'Refunded', 'invoicing' ), |
|
| 353 | + 'description' => __('Total of refunded invoices.', 'invoicing'), |
|
| 354 | + 'label' => __('Refunded', 'invoicing'), |
|
| 355 | 355 | ), |
| 356 | 356 | 'total_discount' => array( |
| 357 | - 'description' => __( 'Total of discounts used.', 'invoicing' ), |
|
| 358 | - 'label' => __( 'Discounted', 'invoicing' ), |
|
| 357 | + 'description' => __('Total of discounts used.', 'invoicing'), |
|
| 358 | + 'label' => __('Discounted', 'invoicing'), |
|
| 359 | 359 | ), |
| 360 | 360 | ); |
| 361 | 361 | |
| 362 | - return apply_filters( 'wpinv_report_cards', $cards ); |
|
| 362 | + return apply_filters('wpinv_report_cards', $cards); |
|
| 363 | 363 | } |
| 364 | 364 | |
| 365 | 365 | |