Display bank balance in payment forms.
[fa-stable.git] / includes / ui / ui_input.inc
index 1889962d28b56e30ee65f724de901a523e3a73c0..1e966a1a72758135e2bd5a06d434e2c0a41b660d 100644 (file)
@@ -931,4 +931,18 @@ function supplier_credit_row($supplier, $credit, $parms='')
                ."</a>", $parms);
 }
 
+function bank_balance_row($bank_acc, $parms='')
+{
+       global $path_to_root;
+       
+       $to = add_days(Today(), 1);
+       $bal = get_balance_before_for_bank_account($bank_acc, $to);
+       label_row( _("Bank Balance:"),
+               "<a target='_blank' " . ($bal<0 ? 'class="redfg"' : '')
+               ."href='$path_to_root/gl/inquiry/bank_inquiry.php?bank_account=".$bank_acc."'"
+               ." onclick=\"javascript:openWindow(this.href,this.target); return false;\" >&nbsp;"
+               . price_format($bal)
+               ."</a>", $parms);
+}
+
 ?>
\ No newline at end of file