- db_query($sql, "The existing allocations could not be updated");
-
- // referesh allocation summaries
- $sql = "UPDATE ".TB_PREF.$transactions." trans,
- (SELECT SUM(amt) amt FROM ".TB_PREF.$allocations." WHERE trans_type_to=".db_escape($type_to)." AND trans_no_to=".db_escape($no_to).") paym
- SET alloc = paym.amt
- WHERE $where";
- db_query($sql, "The transaction allocations could not be updated");
-
- $sql = "UPDATE ".TB_PREF.$payments." trans,
- (SELECT SUM(amt) amt FROM ".TB_PREF.$allocations." WHERE trans_type_from=".db_escape($type_from)." AND trans_no_from=".db_escape($no_from).") paym
- SET alloc = paym.amt
- WHERE type=".db_escape($type_from)." AND trans_no=".db_escape($no_from);
-
- return db_query($sql, "The payment allocations could not be updated");