You are here

function uc_payment_balance in Ubercart 5

Same name and namespace in other branches
  1. 8.4 payment/uc_payment/uc_payment.module \uc_payment_balance()
  2. 6.2 payment/uc_payment/uc_payment.module \uc_payment_balance()
  3. 7.3 payment/uc_payment/uc_payment.module \uc_payment_balance()

Return the balance of payments on an order.

7 calls to uc_payment_balance()
uc_credit_terminal in payment/uc_credit/uc_credit.module
uc_credit_terminal_form in payment/uc_credit/uc_credit.module
uc_order_pane_payment in payment/uc_payment/uc_payment_order_pane.inc
Handle the Payment order pane.
uc_payment_condition_balance in payment/uc_payment/uc_payment_workflow.inc
uc_payment_pack_receive_check_form in payment/uc_payment_pack/uc_payment_pack.module
Receive a check for an order and put in a clear date.

... See full list

File

payment/uc_payment/uc_payment.module, line 1018

Code

function uc_payment_balance($order) {
  $total = $order->order_total;
  $payments = uc_payment_load_payments($order->order_id);
  if ($payments === FALSE) {
    return $total;
  }
  foreach ($payments as $payment) {
    $total -= $payment->amount;
  }
  return $total;
}