' . esc_html__( 'Payment History', 'easy-hotel' ) . '

'; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; $total_paid = 0; $total_refunded = !empty($eshb_booking_metaboxes['total_refunded']) ? $eshb_booking_metaboxes['total_refunded'] : 0; foreach ( $payment_ids as $payment_id ) { $eshb_payment_metaboxes = get_post_meta($payment_id, 'eshb_payment_metaboxes', true); $amt = !empty( $eshb_payment_metaboxes['amount'] ) ? (float) $eshb_payment_metaboxes['amount'] : 0; $curr = !empty( $eshb_payment_metaboxes['currency'] ) ? $eshb_payment_metaboxes['currency'] : $hotel_core->get_eshb_currency_symbol(); $date = get_the_date( '', $payment_id ); $gate = !empty( $eshb_payment_metaboxes['gateway'] ) ? $eshb_payment_metaboxes['gateway'] : ''; $note = !empty( $eshb_payment_metaboxes['note'] ) ? $eshb_payment_metaboxes['note'] : ''; $total_paid += $amt; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; } echo ''; echo ''; if(count($payment_ids) < 1 && in_array($booking_status, ['completed', 'processing'])) { $total_paid = $total_price; } if($total_refunded > 0) { $total_paid = !empty($eshb_booking_metaboxes['total_paid']) ? $eshb_booking_metaboxes['total_paid'] : 0; } echo ''; echo ''; if($total_paid < $total_price) { $total_due = $total_price - $total_paid; echo ''; echo ''; echo ''; echo ''; } echo '
' . esc_html__( 'Date', 'easy-hotel' ) . '' . esc_html__( 'Gateway', 'easy-hotel' ) . '' . esc_html__( 'Note', 'easy-hotel' ) . '' . esc_html__( 'Amount', 'easy-hotel' ) . '
' . esc_html( $date ) . '' . esc_html( $gate ) . '' . esc_html( $note ) . '' . wp_kses_post( $hotel_core->eshb_price($amt) ) . '
' . esc_html__( 'Total Paid', 'easy-hotel' ) . '' . wp_kses_post( $hotel_core->eshb_price($total_paid) ) . '
' . esc_html__( 'Total Due', 'easy-hotel' ) . '' . wp_kses_post( $hotel_core->eshb_price($total_due) ) . '
'; if($booking_status !== 'cancelled' && $total_paid < $total_price){ $add_new_post_url = admin_url( 'post-new.php?post_type=eshb_payment&booking=' . $booking_id ); $add_new_post_url_with_amount = admin_url( 'post-new.php?post_type=eshb_payment&booking=' . $booking_id . '&amount=' . $total_due); echo '
' . esc_html__( 'Add payment', 'easy-hotel' ) . ' ' . esc_html__( 'Add Due payment', 'easy-hotel' ) . ' '; } } }