/* get the payment details intro text */
$payment_details_intro = wpminv_get_setting('payment_details_intro');
/* do we have any payment intro details */
if ($payment_details_intro != '') {
    /* output the payment details intro text */
    echo '<div class="payment-details-intro">' . wpautop($payment_details_intro) . '</div>';
}
$payment_details = '<li class="payment-details-data reference"><span class="wpminv-label">' . __('Payment Reference', 'simvoicing') . ':</span> ' . wpminv_get_invoice_reference() . '</li>';
/* get the bank sort code number */
$bank_sort_code = wpminv_get_setting('bank_sort_code');
/* if we have a bank sort code number */
if ($bank_sort_code != '0') {
    $payment_details .= '<li class="payment-details-data bank-sort-code"><span class="wpminv-label">' . __('Sort Code', 'simvoicing') . ':</span> ' . esc_html($bank_sort_code) . '</li>';
}
/* get the bank account number */
$bank_account_no = wpminv_get_setting('bank_account_number');
/* if we have a bank account number */
if ($bank_account_no != '0') {
    $payment_details .= '<li class="payment-details-data bank-account-number"><span class="wpminv-label">' . __('Account Number', 'simvoicing') . ':</span> ' . intval($bank_account_no) . '</li>';
}
/* have we got payment details output */
if ($payment_details != '') {
    ?>
			<ul class="payment-details-list"><?php 
    echo $payment_details;
    ?>
</ul>
			<?php 
}
?>
	
/**
 * function wpminv_get_payment_due_date()
 *
 * returns the date when an invoice is due for payment for the give
 * invoice id or the current invoice in the loop
 */
function wpminv_get_payment_due_date($invoice_id = 0)
{
    global $post;
    /* if not invoice post id provided - use current */
    if ($invoice_id == 0) {
        $invoice_id = $post->ID;
    }
    /* do we have a due date entered */
    $invoice_payment_due = get_post_meta($invoice_id, '_wpminv_due_date', true);
    /* no set due date */
    if ($invoice_payment_due == '') {
        /* get the payment terms from the settings */
        $payment_days = wpminv_get_setting('payment_days', '7');
        /* get the published date of the invoice */
        $invoice_date = get_the_date('d-m-Y', $invoice_id);
        /* add payments terms to invoice date */
        $invoice_payment_due = date('d-m-Y', strtotime($invoice_date . '+' . $payment_days . ' days'));
    } else {
        $invoice_payment_due = date('d-m-Y', strtotime($invoice_payment_due));
    }
    return apply_filters('wpminv_get_payment_due_date', esc_html($invoice_payment_due), $invoice_id);
}