if ($_GET['action'] == "add_default_data") { global $db; $customerid = $_POST['customerid']; $linkmanid = $_POST['linkman']; $accountid = $_POST['accountid']; $beizhu = $_POST['beizhu']; $jine = floatvalue($_POST['yushoukuan']); if ($jine == 0) { print "<script language=javascript>alert('错误:预收款金额不能等于0');window.history.back(-1);</script>"; exit; } //开启事务 //$db->debug=1; $CaiWu = new CaiWu($db); $db->StartTrans(); $CaiWu->insertYuShoukuanReocord($customerid, $linkmanid, $jine, $accountid, $_SESSION['LOGIN_USER_ID'], "预收货款", $beizhu); //是否事务出现错误 if ($db->HasFailedTrans()) { print "<script language=javascript>alert('错误:" . str_replace("'", "\\'", $db->ErrorMsg()) . "');window.history.back(-1);</script>"; } else { page_css("预收款记录"); $return = $_POST['url']; $return = $return . "?" . FormPageAction("action", "init_default"); print_infor("预收款记录已生成", 'trip', "location='?{$return}'", "{$return}", 0); } $db->CompleteTrans(); exit; } //撤销付款 if ($_GET['action'] == "delete_array") { $selectid = $_GET['selectid'];