PluginProbe ʕ •ᴥ•ʔ
LatePoint – Calendar Booking Plugin for Appointments and Events / 5.5.2
LatePoint – Calendar Booking Plugin for Appointments and Events v5.5.2
5.6.6 5.6.5 5.6.4 5.6.3 5.6.2 5.6.1 5.6.0 5.5.2 5.5.1 5.5.0 5.4.2 trunk 5.1.0 5.1.1 5.1.2 5.1.3 5.1.4 5.1.5 5.1.6 5.1.7 5.1.8 5.1.9 5.1.91 5.1.92 5.1.93 5.1.94 5.2.0 5.2.1 5.2.10 5.2.11 5.2.2 5.2.3 5.2.4 5.2.5 5.2.6 5.2.7 5.2.8 5.2.9 5.3.0 5.3.1 5.3.2 5.4.0 5.4.1
latepoint / lib / views / orders / _balance_and_payments.php
latepoint / lib / views / orders Last commit date
_balance_and_payments.php 1 year ago _full_summary.php 1 year ago _price_breakdown.php 1 year ago _table_body.php 3 months ago _transaction_box.php 1 year ago index.php 1 year ago quick_edit.php 9 months ago reload_balance_and_payments.php 1 year ago reload_price_breakdown.php 1 year ago view_order_log.php 1 year ago
_balance_and_payments.php
82 lines
1 <?php
2 /*
3 * Copyright (c) 2024 LatePoint LLC. All rights reserved.
4 */
5
6 /* @var $order OsOrderModel */
7
8
9 if ( ! defined( 'ABSPATH' ) ) {
10 exit; // Exit if accessed directly
11 }
12
13
14 ?>
15
16 <div class="os-form-sub-header">
17 <h3><?php esc_html_e( 'Balance & Payments', 'latepoint' ); ?></h3>
18 <div class="os-form-sub-header-actions">
19 <?php echo OsFormHelper::select_field( 'order[payment_status]', false, OsOrdersHelper::get_order_payment_statuses_list(), $order->payment_status, [ 'class' => 'size-small' ] ) ?>
20 </div>
21 </div>
22 <div class="balance-payment-info" data-route="<?php echo esc_attr( OsRouterHelper::build_route_name( 'orders', 'reload_balance_and_payments' ) ); ?>">
23 <div class="payment-info-values">
24 <?php
25 $total_paid = $order->get_total_amount_paid_from_transactions();
26 $total_balance = $order->get_total_balance_due();
27 $deposit_amount = $order->get_deposit_amount_to_charge();
28
29 ?>
30 <div class="pi-smaller">
31 <?php echo esc_html( OsMoneyHelper::format_price( $total_paid, true, false ) ); ?>
32 </div>
33 <div class="pi-balance-due <?php if ( $total_balance > 0 ) {
34 echo 'pi-red';
35 } ?>">
36 <?php echo esc_html( OsMoneyHelper::format_price( $total_balance, true, false ) ); ?>
37 </div>
38 </div>
39 <div class="payment-info-labels">
40 <div><?php esc_html_e( 'Total Payments', 'latepoint' ) ?></div>
41 <div><?php esc_html_e( 'Total Balance Due', 'latepoint' ) ?></div>
42 </div>
43 </div>
44
45 <?php if ( $order->is_new_record() ) { ?>
46 <div class="initial-payment-data-wrapper">
47 <div class="initial-payment-data-toggler-wrapper">
48 <?php echo OsFormHelper::toggler_field('create_payment_request', esc_html__( 'Create a Payment Request', 'latepoint' ), false, 'payNowPortionInfo'); ?>
49 <a href="#"
50 data-os-params="<?php echo esc_attr(OsUtilHelper::build_os_params( [ 'topic' => 'payment_request' ] )); ?>"
51 data-os-action="<?php echo esc_attr(OsRouterHelper::build_route_name( 'support_topics', 'view' )); ?>"
52 data-os-output-target="lightbox"
53 class="latepoint-element-info-trigger"><i class="latepoint-icon latepoint-icon-info"></i></a>
54 </div>
55 <div class="payment-request-settings-wrapper" id="payNowPortionInfo" style="display: none;">
56 <div class="payment-request-row">
57 <?php
58 $payment_portions = [];
59 if($total_balance > 0) $payment_portions[LATEPOINT_PAYMENT_PORTION_FULL] = sprintf( __( 'Full Price [%s]' ), OsMoneyHelper::format_price( $total_balance, true, false ) );
60 if($deposit_amount > 0) $payment_portions[LATEPOINT_PAYMENT_PORTION_DEPOSIT] = sprintf( __( 'Deposit Only [%s]', 'latepoint' ), OsMoneyHelper::format_price( $deposit_amount, true, false ) );
61 $payment_portions[LATEPOINT_PAYMENT_PORTION_CUSTOM] = __( 'Custom', 'latepoint' );
62
63 $selected_portion = array_key_first($payment_portions);
64 echo '<div class="label-for-select">'.esc_html__('Amount:', 'latepoint').'</div>';
65 echo OsFormHelper::select_field( 'payment_request[portion]', false, $payment_portions, $selected_portion, [ 'class' => 'size-small', 'theme' => 'simple' ] );
66 echo '<div class="custom-charge-amount-wrapper" style="'.(($selected_portion != LATEPOINT_PAYMENT_PORTION_CUSTOM) ? 'display: none;' : '').'">';
67 echo OsFormHelper::money_field( 'payment_request[charge_amount_custom]', false, $total_balance, [ 'class' => 'size-small', 'theme' => 'simple' ] );
68 echo OsFormHelper::hidden_field('payment_request[charge_amount_full]', $total_balance);
69 echo OsFormHelper::hidden_field('payment_request[charge_amount_deposit]', $deposit_amount);
70 echo '</div>';
71 ?>
72 </div>
73 <div class="payment-request-row">
74 <?php
75 echo '<div class="label-for-select">'.esc_html__('Due Date:', 'latepoint').'</div>';
76 echo OsFormHelper::date_picker_field( 'payment_request[due_at]', OsTimeHelper::get_readable_date_from_string(OsTimeHelper::today_date('Y-m-d')), OsTimeHelper::today_date('Y-m-d'), [ 'class' => 'size-small', 'theme' => 'simple' ] );
77 ?>
78 </div>
79 </div>
80
81 </div>
82 <?php } ?>