diff --git a/web/Application/SLN0002/DAO/VoucherDAO.class.php b/web/Application/SLN0002/DAO/VoucherDAO.class.php index ed4e3d40..797da2dd 100644 --- a/web/Application/SLN0002/DAO/VoucherDAO.class.php +++ b/web/Application/SLN0002/DAO/VoucherDAO.class.php @@ -211,6 +211,7 @@ class VoucherDAO extends PSIBaseExDAO $db = $this->db; $loginUserId = $bill["loginUserId"]; + $dataOrg = $bill["dataOrg"]; $orgId = $bill["orgId"]; $wordId = $bill["wordId"]; @@ -224,14 +225,14 @@ class VoucherDAO extends PSIBaseExDAO } // 检查orgId - $sql = "select count(*) as cnt + $sql = "select name from t_org where id = '%s' and parent_id is null"; $data = $db->query($sql, $orgId); - $cnt = $data[0]["cnt"]; - if ($cnt != 1) { + if (!$data) { return $this->badParam("orgId"); } + $orgName = $data[0]["name"]; // 检查凭证字 $word = ""; @@ -341,13 +342,15 @@ class VoucherDAO extends PSIBaseExDAO id, v_status, v_year, v_month, v_dt, v_word, v_ref, ref, input_user_id, input_user_name, input_dt, charge_user_id, charge_user_name, cash_user_id, cash_user_name, - bill_number, company_id, biz_user_id, biz_user_name + bill_number, company_id, biz_user_id, biz_user_name, company_name, + data_org ) values ( '%s', 0, %d, %d, '%s', '%s', %d, '%s', '%s', '%s', now(), '%s', '%s', '%s', '%s', - %d, '%s', '%s', '%s' + %d, '%s', '%s', '%s', '%s', + '%s' )"; $rc = $db->execute( $sql, @@ -371,7 +374,10 @@ class VoucherDAO extends PSIBaseExDAO $billNumber, $orgId, $bizUserId, - $bizUserName + $bizUserName, + $orgName, + // ---- + $dataOrg ); if ($rc === false) { return $this->sqlError(__METHOD__, __LINE__); diff --git a/web/Application/SLN0002/Service/VoucherService.class.php b/web/Application/SLN0002/Service/VoucherService.class.php index a1cb8ad5..d20b5b6b 100644 --- a/web/Application/SLN0002/Service/VoucherService.class.php +++ b/web/Application/SLN0002/Service/VoucherService.class.php @@ -102,7 +102,6 @@ class VoucherService extends PSIBaseExService $dao = new VoucherDAO($db); $us = new UserService(); - $bill["companyId"] = $us->getCompanyId(); $bill["loginUserId"] = $us->getLoginUserId(); $bill["dataOrg"] = $us->getLoginUserDataOrg();