+/**
+* Check bank transfer, deposit or customer deposit before voiding.
+**/
+function check_void_bank_trans($type, $type_no)
+{
+ $moves = get_bank_trans($type, $type_no);
+ while ($trans = db_fetch($moves)) {
+ if ($trans['amount'] > 0) { // skip transfer input part
+ return check_bank_account_history(-$trans['amount'], $trans['bank_act'], sql2date($trans['trans_date'])) == null;
+ }
+ }
+ return true;
+}