@@ -515,37 +515,37 @@ discard block |
||
| 515 | 515 | |
| 516 | 516 | switch ( $key ) { |
| 517 | 517 | |
| 518 | - case 'total': |
|
| 519 | - echo '<strong>' . wpinv_price( $payment->get_total(), $payment->get_currency() ) . '</strong>'; |
|
| 520 | - break; |
|
| 521 | - |
|
| 522 | - case 'relationship': |
|
| 523 | - echo $payment->is_renewal() ? esc_html__( 'Renewal Invoice', 'invoicing' ) : esc_html__( 'Initial Invoice', 'invoicing' ); |
|
| 524 | - break; |
|
| 525 | - |
|
| 526 | - case 'date': |
|
| 527 | - echo esc_html( getpaid_format_date_value( $payment->get_date_created() ) ); |
|
| 528 | - break; |
|
| 529 | - |
|
| 530 | - case 'status': |
|
| 531 | - $status = $payment->get_status_nicename(); |
|
| 532 | - if ( is_admin() ) { |
|
| 533 | - $status = $payment->get_status_label_html(); |
|
| 534 | - } |
|
| 518 | + case 'total': |
|
| 519 | + echo '<strong>' . wpinv_price( $payment->get_total(), $payment->get_currency() ) . '</strong>'; |
|
| 520 | + break; |
|
| 535 | 521 | |
| 536 | - echo wp_kses_post( $status ); |
|
| 537 | - break; |
|
| 522 | + case 'relationship': |
|
| 523 | + echo $payment->is_renewal() ? esc_html__( 'Renewal Invoice', 'invoicing' ) : esc_html__( 'Initial Invoice', 'invoicing' ); |
|
| 524 | + break; |
|
| 538 | 525 | |
| 539 | - case 'invoice': |
|
| 540 | - $link = esc_url( get_edit_post_link( $payment->get_id() ) ); |
|
| 526 | + case 'date': |
|
| 527 | + echo esc_html( getpaid_format_date_value( $payment->get_date_created() ) ); |
|
| 528 | + break; |
|
| 541 | 529 | |
| 542 | - if ( ! is_admin() ) { |
|
| 543 | - $link = esc_url( $payment->get_view_url() ); |
|
| 544 | - } |
|
| 530 | + case 'status': |
|
| 531 | + $status = $payment->get_status_nicename(); |
|
| 532 | + if ( is_admin() ) { |
|
| 533 | + $status = $payment->get_status_label_html(); |
|
| 534 | + } |
|
| 535 | + |
|
| 536 | + echo wp_kses_post( $status ); |
|
| 537 | + break; |
|
| 538 | + |
|
| 539 | + case 'invoice': |
|
| 540 | + $link = esc_url( get_edit_post_link( $payment->get_id() ) ); |
|
| 541 | + |
|
| 542 | + if ( ! is_admin() ) { |
|
| 543 | + $link = esc_url( $payment->get_view_url() ); |
|
| 544 | + } |
|
| 545 | 545 | |
| 546 | - $invoice = esc_html( $payment->get_number() ); |
|
| 547 | - echo "<a href='$link'>$invoice</a>"; |
|
| 548 | - break; |
|
| 546 | + $invoice = esc_html( $payment->get_number() ); |
|
| 547 | + echo "<a href='$link'>$invoice</a>"; |
|
| 548 | + break; |
|
| 549 | 549 | } |
| 550 | 550 | |
| 551 | 551 | echo '</td>'; |
@@ -644,37 +644,37 @@ discard block |
||
| 644 | 644 | |
| 645 | 645 | switch ( $key ) { |
| 646 | 646 | |
| 647 | - case 'item_name': |
|
| 648 | - $item_name = get_the_title( $subscription_group_item['item_id'] ); |
|
| 649 | - $item_name = empty( $item_name ) ? $subscription_group_item['item_name'] : $item_name; |
|
| 647 | + case 'item_name': |
|
| 648 | + $item_name = get_the_title( $subscription_group_item['item_id'] ); |
|
| 649 | + $item_name = empty( $item_name ) ? $subscription_group_item['item_name'] : $item_name; |
|
| 650 | 650 | |
| 651 | - if ( $invoice->get_template() == 'amount' || 1 == (float) $subscription_group_item['quantity'] ) { |
|
| 652 | - echo esc_html( $item_name ); |
|
| 653 | - } else { |
|
| 654 | - printf( '%1$s x %2$d', esc_html( $item_name ), (float) $subscription_group_item['quantity'] ); |
|
| 655 | - } |
|
| 651 | + if ( $invoice->get_template() == 'amount' || 1 == (float) $subscription_group_item['quantity'] ) { |
|
| 652 | + echo esc_html( $item_name ); |
|
| 653 | + } else { |
|
| 654 | + printf( '%1$s x %2$d', esc_html( $item_name ), (float) $subscription_group_item['quantity'] ); |
|
| 655 | + } |
|
| 656 | 656 | |
| 657 | - break; |
|
| 657 | + break; |
|
| 658 | 658 | |
| 659 | - case 'price': |
|
| 660 | - wpinv_the_price( $subscription_group_item['item_price'], $invoice->get_currency() ); |
|
| 661 | - break; |
|
| 659 | + case 'price': |
|
| 660 | + wpinv_the_price( $subscription_group_item['item_price'], $invoice->get_currency() ); |
|
| 661 | + break; |
|
| 662 | 662 | |
| 663 | - case 'tax': |
|
| 664 | - wpinv_the_price( $subscription_group_item['tax'], $invoice->get_currency() ); |
|
| 665 | - break; |
|
| 663 | + case 'tax': |
|
| 664 | + wpinv_the_price( $subscription_group_item['tax'], $invoice->get_currency() ); |
|
| 665 | + break; |
|
| 666 | 666 | |
| 667 | - case 'discount': |
|
| 668 | - wpinv_the_price( $subscription_group_item['discount'], $invoice->get_currency() ); |
|
| 669 | - break; |
|
| 667 | + case 'discount': |
|
| 668 | + wpinv_the_price( $subscription_group_item['discount'], $invoice->get_currency() ); |
|
| 669 | + break; |
|
| 670 | 670 | |
| 671 | - case 'initial': |
|
| 672 | - wpinv_the_price( $subscription_group_item['price'] * $subscription_group_item['quantity'], $invoice->get_currency() ); |
|
| 673 | - break; |
|
| 671 | + case 'initial': |
|
| 672 | + wpinv_the_price( $subscription_group_item['price'] * $subscription_group_item['quantity'], $invoice->get_currency() ); |
|
| 673 | + break; |
|
| 674 | 674 | |
| 675 | - case 'recurring': |
|
| 676 | - echo '<strong>' . wpinv_price( $subscription_group_item['price'] * $subscription_group_item['quantity'], $invoice->get_currency() ) . '</strong>'; |
|
| 677 | - break; |
|
| 675 | + case 'recurring': |
|
| 676 | + echo '<strong>' . wpinv_price( $subscription_group_item['price'] * $subscription_group_item['quantity'], $invoice->get_currency() ) . '</strong>'; |
|
| 677 | + break; |
|
| 678 | 678 | |
| 679 | 679 | } |
| 680 | 680 | |
@@ -698,29 +698,29 @@ discard block |
||
| 698 | 698 | |
| 699 | 699 | switch ( $key ) { |
| 700 | 700 | |
| 701 | - case 'item_name': |
|
| 702 | - echo esc_html( $subscription_group_fee['name'] ); |
|
| 703 | - break; |
|
| 701 | + case 'item_name': |
|
| 702 | + echo esc_html( $subscription_group_fee['name'] ); |
|
| 703 | + break; |
|
| 704 | 704 | |
| 705 | - case 'price': |
|
| 706 | - wpinv_the_price( $subscription_group_fee['initial_fee'], $invoice->get_currency() ); |
|
| 707 | - break; |
|
| 705 | + case 'price': |
|
| 706 | + wpinv_the_price( $subscription_group_fee['initial_fee'], $invoice->get_currency() ); |
|
| 707 | + break; |
|
| 708 | 708 | |
| 709 | - case 'tax': |
|
| 710 | - echo '—'; |
|
| 711 | - break; |
|
| 709 | + case 'tax': |
|
| 710 | + echo '—'; |
|
| 711 | + break; |
|
| 712 | 712 | |
| 713 | - case 'discount': |
|
| 714 | - echo '—'; |
|
| 715 | - break; |
|
| 713 | + case 'discount': |
|
| 714 | + echo '—'; |
|
| 715 | + break; |
|
| 716 | 716 | |
| 717 | - case 'initial': |
|
| 718 | - wpinv_the_price( $subscription_group_fee['initial_fee'], $invoice->get_currency() ); |
|
| 719 | - break; |
|
| 717 | + case 'initial': |
|
| 718 | + wpinv_the_price( $subscription_group_fee['initial_fee'], $invoice->get_currency() ); |
|
| 719 | + break; |
|
| 720 | 720 | |
| 721 | - case 'recurring': |
|
| 722 | - echo '<strong>' . wpinv_price( $subscription_group_fee['recurring_fee'], $invoice->get_currency() ) . '</strong>'; |
|
| 723 | - break; |
|
| 721 | + case 'recurring': |
|
| 722 | + echo '<strong>' . wpinv_price( $subscription_group_fee['recurring_fee'], $invoice->get_currency() ) . '</strong>'; |
|
| 723 | + break; |
|
| 724 | 724 | |
| 725 | 725 | } |
| 726 | 726 | |
@@ -829,39 +829,39 @@ discard block |
||
| 829 | 829 | |
| 830 | 830 | switch ( $key ) { |
| 831 | 831 | |
| 832 | - case 'status': |
|
| 833 | - echo wp_kses_post( $_suscription->get_status_label_html() ); |
|
| 834 | - break; |
|
| 835 | - |
|
| 836 | - case 'item': |
|
| 837 | - $markup = array_map( array( 'WPInv_Subscriptions_List_Table', 'generate_item_markup' ), array_keys( $subscription_group['items'] ) ); |
|
| 838 | - echo implode( ' | ', $markup ); |
|
| 839 | - break; |
|
| 840 | - |
|
| 841 | - case 'renewals': |
|
| 842 | - $max_bills = $_suscription->get_bill_times(); |
|
| 843 | - echo ( (int) $_suscription->get_times_billed() ) . ' / ' . ( empty( $max_bills ) ? '∞' : (int) $max_bills ); |
|
| 844 | - break; |
|
| 845 | - |
|
| 846 | - case 'renewal_date': |
|
| 847 | - echo $_suscription->is_active() ? getpaid_format_date_value( $_suscription->get_expiration() ) : '—'; |
|
| 848 | - break; |
|
| 849 | - |
|
| 850 | - case 'start_date': |
|
| 851 | - echo 'pending' == $_suscription->get_status() ? '—' : getpaid_format_date_value( $_suscription->get_date_created() ); |
|
| 852 | - break; |
|
| 853 | - |
|
| 854 | - case 'subscription': |
|
| 855 | - $url = is_admin() ? admin_url( 'admin.php?page=wpinv-subscriptions&id=' . absint( $_suscription->get_id() ) ) : $_suscription->get_view_url(); |
|
| 856 | - printf( |
|
| 857 | - '%1$s#%2$s%3$s', |
|
| 858 | - '<a href="' . esc_url( $url ) . '">', |
|
| 859 | - '<strong>' . intval( $_suscription->get_id() ) . '</strong>', |
|
| 860 | - '</a>' |
|
| 861 | - ); |
|
| 862 | - |
|
| 863 | - echo WPInv_Subscriptions_List_Table::column_amount( $_suscription ); |
|
| 864 | - break; |
|
| 832 | + case 'status': |
|
| 833 | + echo wp_kses_post( $_suscription->get_status_label_html() ); |
|
| 834 | + break; |
|
| 835 | + |
|
| 836 | + case 'item': |
|
| 837 | + $markup = array_map( array( 'WPInv_Subscriptions_List_Table', 'generate_item_markup' ), array_keys( $subscription_group['items'] ) ); |
|
| 838 | + echo implode( ' | ', $markup ); |
|
| 839 | + break; |
|
| 840 | + |
|
| 841 | + case 'renewals': |
|
| 842 | + $max_bills = $_suscription->get_bill_times(); |
|
| 843 | + echo ( (int) $_suscription->get_times_billed() ) . ' / ' . ( empty( $max_bills ) ? '∞' : (int) $max_bills ); |
|
| 844 | + break; |
|
| 845 | + |
|
| 846 | + case 'renewal_date': |
|
| 847 | + echo $_suscription->is_active() ? getpaid_format_date_value( $_suscription->get_expiration() ) : '—'; |
|
| 848 | + break; |
|
| 849 | + |
|
| 850 | + case 'start_date': |
|
| 851 | + echo 'pending' == $_suscription->get_status() ? '—' : getpaid_format_date_value( $_suscription->get_date_created() ); |
|
| 852 | + break; |
|
| 853 | + |
|
| 854 | + case 'subscription': |
|
| 855 | + $url = is_admin() ? admin_url( 'admin.php?page=wpinv-subscriptions&id=' . absint( $_suscription->get_id() ) ) : $_suscription->get_view_url(); |
|
| 856 | + printf( |
|
| 857 | + '%1$s#%2$s%3$s', |
|
| 858 | + '<a href="' . esc_url( $url ) . '">', |
|
| 859 | + '<strong>' . intval( $_suscription->get_id() ) . '</strong>', |
|
| 860 | + '</a>' |
|
| 861 | + ); |
|
| 862 | + |
|
| 863 | + echo WPInv_Subscriptions_List_Table::column_amount( $_suscription ); |
|
| 864 | + break; |
|
| 865 | 865 | |
| 866 | 866 | } |
| 867 | 867 | |