@@ -508,39 +508,39 @@ discard block |
||
| 508 | 508 | |
| 509 | 509 | switch ( $key ) { |
| 510 | 510 | |
| 511 | - case 'total': |
|
| 512 | - echo '<strong>'; |
|
| 513 | - wpinv_the_price( $payment->get_total(), $payment->get_currency() ); |
|
| 514 | - echo '</strong>'; |
|
| 515 | - break; |
|
| 516 | - |
|
| 517 | - case 'relationship': |
|
| 518 | - echo $payment->is_renewal() ? esc_html__( 'Renewal Invoice', 'invoicing' ) : esc_html__( 'Initial Invoice', 'invoicing' ); |
|
| 519 | - break; |
|
| 520 | - |
|
| 521 | - case 'date': |
|
| 522 | - echo esc_html( getpaid_format_date_value( $payment->get_date_created() ) ); |
|
| 523 | - break; |
|
| 524 | - |
|
| 525 | - case 'status': |
|
| 526 | - $status = $payment->get_status_nicename(); |
|
| 527 | - if ( is_admin() ) { |
|
| 528 | - $status = $payment->get_status_label_html(); |
|
| 529 | - } |
|
| 530 | - |
|
| 531 | - echo wp_kses_post( $status ); |
|
| 532 | - break; |
|
| 533 | - |
|
| 534 | - case 'invoice': |
|
| 535 | - $link = esc_url( get_edit_post_link( $payment->get_id() ) ); |
|
| 536 | - |
|
| 537 | - if ( ! is_admin() ) { |
|
| 538 | - $link = esc_url( $payment->get_view_url() ); |
|
| 539 | - } |
|
| 540 | - |
|
| 541 | - $invoice = esc_html( $payment->get_number() ); |
|
| 542 | - echo wp_kses_post( "<a href='$link'>$invoice</a>" ); |
|
| 543 | - break; |
|
| 511 | + case 'total': |
|
| 512 | + echo '<strong>'; |
|
| 513 | + wpinv_the_price( $payment->get_total(), $payment->get_currency() ); |
|
| 514 | + echo '</strong>'; |
|
| 515 | + break; |
|
| 516 | + |
|
| 517 | + case 'relationship': |
|
| 518 | + echo $payment->is_renewal() ? esc_html__( 'Renewal Invoice', 'invoicing' ) : esc_html__( 'Initial Invoice', 'invoicing' ); |
|
| 519 | + break; |
|
| 520 | + |
|
| 521 | + case 'date': |
|
| 522 | + echo esc_html( getpaid_format_date_value( $payment->get_date_created() ) ); |
|
| 523 | + break; |
|
| 524 | + |
|
| 525 | + case 'status': |
|
| 526 | + $status = $payment->get_status_nicename(); |
|
| 527 | + if ( is_admin() ) { |
|
| 528 | + $status = $payment->get_status_label_html(); |
|
| 529 | + } |
|
| 530 | + |
|
| 531 | + echo wp_kses_post( $status ); |
|
| 532 | + break; |
|
| 533 | + |
|
| 534 | + case 'invoice': |
|
| 535 | + $link = esc_url( get_edit_post_link( $payment->get_id() ) ); |
|
| 536 | + |
|
| 537 | + if ( ! is_admin() ) { |
|
| 538 | + $link = esc_url( $payment->get_view_url() ); |
|
| 539 | + } |
|
| 540 | + |
|
| 541 | + $invoice = esc_html( $payment->get_number() ); |
|
| 542 | + echo wp_kses_post( "<a href='$link'>$invoice</a>" ); |
|
| 543 | + break; |
|
| 544 | 544 | } |
| 545 | 545 | |
| 546 | 546 | echo '</td>'; |
@@ -635,37 +635,37 @@ discard block |
||
| 635 | 635 | |
| 636 | 636 | switch ( $key ) { |
| 637 | 637 | |
| 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; |
|
| 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; |
|
| 641 | 641 | |
| 642 | - if ( $invoice->get_template() == 'amount' || 1 == (float) $subscription_group_item['quantity'] ) { |
|
| 643 | - echo esc_html( $item_name ); |
|
| 644 | - } else { |
|
| 645 | - printf( '%1$s x %2$d', esc_html( $item_name ), (float) $subscription_group_item['quantity'] ); |
|
| 646 | - } |
|
| 642 | + if ( $invoice->get_template() == 'amount' || 1 == (float) $subscription_group_item['quantity'] ) { |
|
| 643 | + echo esc_html( $item_name ); |
|
| 644 | + } else { |
|
| 645 | + printf( '%1$s x %2$d', esc_html( $item_name ), (float) $subscription_group_item['quantity'] ); |
|
| 646 | + } |
|
| 647 | 647 | |
| 648 | - break; |
|
| 648 | + break; |
|
| 649 | 649 | |
| 650 | - case 'price': |
|
| 651 | - wpinv_the_price( $subscription_group_item['item_price'], $invoice->get_currency() ); |
|
| 652 | - break; |
|
| 650 | + case 'price': |
|
| 651 | + wpinv_the_price( $subscription_group_item['item_price'], $invoice->get_currency() ); |
|
| 652 | + break; |
|
| 653 | 653 | |
| 654 | - case 'tax': |
|
| 655 | - wpinv_the_price( $subscription_group_item['tax'], $invoice->get_currency() ); |
|
| 656 | - break; |
|
| 654 | + case 'tax': |
|
| 655 | + wpinv_the_price( $subscription_group_item['tax'], $invoice->get_currency() ); |
|
| 656 | + break; |
|
| 657 | 657 | |
| 658 | - case 'discount': |
|
| 659 | - wpinv_the_price( $subscription_group_item['discount'], $invoice->get_currency() ); |
|
| 660 | - break; |
|
| 658 | + case 'discount': |
|
| 659 | + wpinv_the_price( $subscription_group_item['discount'], $invoice->get_currency() ); |
|
| 660 | + break; |
|
| 661 | 661 | |
| 662 | - case 'initial': |
|
| 663 | - wpinv_the_price( $subscription_group_item['price'] * $subscription_group_item['quantity'], $invoice->get_currency() ); |
|
| 664 | - break; |
|
| 662 | + case 'initial': |
|
| 663 | + wpinv_the_price( $subscription_group_item['price'] * $subscription_group_item['quantity'], $invoice->get_currency() ); |
|
| 664 | + break; |
|
| 665 | 665 | |
| 666 | - case 'recurring': |
|
| 667 | - echo wp_kses_post( '<strong>' . wpinv_price( $subscription_group_item['price'] * $subscription_group_item['quantity'], $invoice->get_currency() ) . '</strong>' ); |
|
| 668 | - break; |
|
| 666 | + case 'recurring': |
|
| 667 | + echo wp_kses_post( '<strong>' . wpinv_price( $subscription_group_item['price'] * $subscription_group_item['quantity'], $invoice->get_currency() ) . '</strong>' ); |
|
| 668 | + break; |
|
| 669 | 669 | |
| 670 | 670 | } |
| 671 | 671 | |
@@ -689,29 +689,29 @@ discard block |
||
| 689 | 689 | |
| 690 | 690 | switch ( $key ) { |
| 691 | 691 | |
| 692 | - case 'item_name': |
|
| 693 | - echo esc_html( $subscription_group_fee['name'] ); |
|
| 694 | - break; |
|
| 692 | + case 'item_name': |
|
| 693 | + echo esc_html( $subscription_group_fee['name'] ); |
|
| 694 | + break; |
|
| 695 | 695 | |
| 696 | - case 'price': |
|
| 697 | - wpinv_the_price( $subscription_group_fee['initial_fee'], $invoice->get_currency() ); |
|
| 698 | - break; |
|
| 696 | + case 'price': |
|
| 697 | + wpinv_the_price( $subscription_group_fee['initial_fee'], $invoice->get_currency() ); |
|
| 698 | + break; |
|
| 699 | 699 | |
| 700 | - case 'tax': |
|
| 701 | - echo '—'; |
|
| 702 | - break; |
|
| 700 | + case 'tax': |
|
| 701 | + echo '—'; |
|
| 702 | + break; |
|
| 703 | 703 | |
| 704 | - case 'discount': |
|
| 705 | - echo '—'; |
|
| 706 | - break; |
|
| 704 | + case 'discount': |
|
| 705 | + echo '—'; |
|
| 706 | + break; |
|
| 707 | 707 | |
| 708 | - case 'initial': |
|
| 709 | - wpinv_the_price( $subscription_group_fee['initial_fee'], $invoice->get_currency() ); |
|
| 710 | - break; |
|
| 708 | + case 'initial': |
|
| 709 | + wpinv_the_price( $subscription_group_fee['initial_fee'], $invoice->get_currency() ); |
|
| 710 | + break; |
|
| 711 | 711 | |
| 712 | - case 'recurring': |
|
| 713 | - echo wp_kses_post( '<strong>' . wpinv_price( $subscription_group_fee['recurring_fee'], $invoice->get_currency() ) . '</strong>' ); |
|
| 714 | - break; |
|
| 712 | + case 'recurring': |
|
| 713 | + echo wp_kses_post( '<strong>' . wpinv_price( $subscription_group_fee['recurring_fee'], $invoice->get_currency() ) . '</strong>' ); |
|
| 714 | + break; |
|
| 715 | 715 | |
| 716 | 716 | } |
| 717 | 717 | |
@@ -816,39 +816,39 @@ discard block |
||
| 816 | 816 | |
| 817 | 817 | switch ( $key ) { |
| 818 | 818 | |
| 819 | - case 'status': |
|
| 820 | - echo wp_kses_post( $_suscription->get_status_label_html() ); |
|
| 821 | - break; |
|
| 822 | - |
|
| 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 ) ); |
|
| 826 | - break; |
|
| 827 | - |
|
| 828 | - case 'renewals': |
|
| 829 | - $max_bills = $_suscription->get_bill_times(); |
|
| 830 | - echo ( (int) $_suscription->get_times_billed() ) . ' / ' . ( empty( $max_bills ) ? '∞' : (int) $max_bills ); |
|
| 831 | - break; |
|
| 832 | - |
|
| 833 | - case 'renewal_date': |
|
| 834 | - echo $_suscription->is_active() ? esc_html( getpaid_format_date_value( $_suscription->get_expiration() ) ) : '—'; |
|
| 835 | - break; |
|
| 836 | - |
|
| 837 | - case 'start_date': |
|
| 838 | - echo 'pending' == $_suscription->get_status() ? '—' : esc_html( getpaid_format_date_value( $_suscription->get_date_created() ) ); |
|
| 839 | - break; |
|
| 840 | - |
|
| 841 | - case 'subscription': |
|
| 842 | - $url = is_admin() ? admin_url( 'admin.php?page=wpinv-subscriptions&id=' . absint( $_suscription->get_id() ) ) : $_suscription->get_view_url(); |
|
| 843 | - printf( |
|
| 844 | - '%1$s#%2$s%3$s', |
|
| 845 | - '<a href="' . esc_url( $url ) . '">', |
|
| 846 | - '<strong>' . intval( $_suscription->get_id() ) . '</strong>', |
|
| 847 | - '</a>' |
|
| 848 | - ); |
|
| 849 | - |
|
| 850 | - echo wp_kses_post( WPInv_Subscriptions_List_Table::column_amount( $_suscription ) ); |
|
| 851 | - break; |
|
| 819 | + case 'status': |
|
| 820 | + echo wp_kses_post( $_suscription->get_status_label_html() ); |
|
| 821 | + break; |
|
| 822 | + |
|
| 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 ) ); |
|
| 826 | + break; |
|
| 827 | + |
|
| 828 | + case 'renewals': |
|
| 829 | + $max_bills = $_suscription->get_bill_times(); |
|
| 830 | + echo ( (int) $_suscription->get_times_billed() ) . ' / ' . ( empty( $max_bills ) ? '∞' : (int) $max_bills ); |
|
| 831 | + break; |
|
| 832 | + |
|
| 833 | + case 'renewal_date': |
|
| 834 | + echo $_suscription->is_active() ? esc_html( getpaid_format_date_value( $_suscription->get_expiration() ) ) : '—'; |
|
| 835 | + break; |
|
| 836 | + |
|
| 837 | + case 'start_date': |
|
| 838 | + echo 'pending' == $_suscription->get_status() ? '—' : esc_html( getpaid_format_date_value( $_suscription->get_date_created() ) ); |
|
| 839 | + break; |
|
| 840 | + |
|
| 841 | + case 'subscription': |
|
| 842 | + $url = is_admin() ? admin_url( 'admin.php?page=wpinv-subscriptions&id=' . absint( $_suscription->get_id() ) ) : $_suscription->get_view_url(); |
|
| 843 | + printf( |
|
| 844 | + '%1$s#%2$s%3$s', |
|
| 845 | + '<a href="' . esc_url( $url ) . '">', |
|
| 846 | + '<strong>' . intval( $_suscription->get_id() ) . '</strong>', |
|
| 847 | + '</a>' |
|
| 848 | + ); |
|
| 849 | + |
|
| 850 | + echo wp_kses_post( WPInv_Subscriptions_List_Table::column_amount( $_suscription ) ); |
|
| 851 | + break; |
|
| 852 | 852 | |
| 853 | 853 | } |
| 854 | 854 | |