|
@@ -3376,30 +3376,6 @@ $verifyDetail=$verify->find(array('where'=>' (staff not like "%\"'.$this->staff[
|
|
|
$receipt->verifyBreakup=$verifyString;
|
|
|
$receiptDetailObj->status=3;
|
|
|
$receiptDetailObj->update(array('where'=>'rid='.$rid));
|
|
|
-
|
|
|
- //微信企业号通知
|
|
|
- $receipt2 = new receipt();
|
|
|
- $receiptDetail = $receipt2->getOne(array('where'=>'rid='.$rid,'asArray'=>true));
|
|
|
- if(!empty($receiptDetail)){
|
|
|
- Doo::loadModel('staff');
|
|
|
- $staff = new staff();
|
|
|
- $staffmsg = $staff->getStaffBySid($receiptDetail['staff']);
|
|
|
- if(!empty($staffmsg['wxid'])){
|
|
|
- require_once (SITE_PATH . '/protected/class/client.php');
|
|
|
- $client = new client ('http://m.cld.smartcost.com.cn/');
|
|
|
- $user = $staffmsg['wxid'];
|
|
|
- $receiptName = '';
|
|
|
- switch($receiptDetail['Rtype']){
|
|
|
- case 0:$receiptName = '报销';break;
|
|
|
- case 1:$receiptName = '借款';break;
|
|
|
- case 2:$receiptName = '对公汇款';break;
|
|
|
- }
|
|
|
-
|
|
|
- $msg = '很遗憾,您的'.$receiptName.' '.$receiptDetail['receiptOrder'].',¥'.$receiptDetail['sum'].',已被终止。';
|
|
|
- $result = $client->SendMsg($user,$msg,'text');
|
|
|
- }
|
|
|
-
|
|
|
- }
|
|
|
}elseif(count($verifyStaff)==count($verifyDetail)){//要修改 角色的数量
|
|
|
$receipt->status=6;
|
|
|
|
|
@@ -3413,36 +3389,10 @@ $verifyDetail=$verify->find(array('where'=>' (staff not like "%\"'.$this->staff[
|
|
|
$loanReceipt->pastDate=date("Y-m-d");
|
|
|
|
|
|
$loanReceipt->update(array('where'=>' rid = '.$receiptDetail['loanRid']));
|
|
|
-
|
|
|
- //微信企业号通知
|
|
|
- $receipt2 = new receipt();
|
|
|
- $receiptDetail = $receipt2->getOne(array('where'=>'rid='.$rid,'asArray'=>true));
|
|
|
- if(!empty($receiptDetail)){
|
|
|
- Doo::loadModel('staff');
|
|
|
- $staff = new staff();
|
|
|
- $staffmsg = $staff->getStaffBySid($receiptDetail['staff']);
|
|
|
- if(!empty($staffmsg['wxid'])){
|
|
|
- require_once (SITE_PATH . '/protected/class/client.php');
|
|
|
- $client = new client ('http://m.cld.smartcost.com.cn/');
|
|
|
- $user = $staffmsg['wxid'];
|
|
|
- $receiptName = '';
|
|
|
- switch($receiptDetail['Rtype']){
|
|
|
- case 0:$receiptName = '报销';break;
|
|
|
- case 1:$receiptName = '借款';break;
|
|
|
- case 2:$receiptName = '对公汇款';break;
|
|
|
- }
|
|
|
-
|
|
|
- $msg = '太好了,您的'.$receiptName.' '.$receiptDetail['receiptOrder'].',¥'.$receiptDetail['sum'].',已同意支付。';
|
|
|
- $result = $client->SendMsg($user,$msg,'text');
|
|
|
- }
|
|
|
-
|
|
|
- }
|
|
|
|
|
|
}
|
|
|
|
|
|
$receipt->update(array('where'=>' rid = '.$rid));
|
|
|
-
|
|
|
-
|
|
|
return "/approvalExpenses/2";
|
|
|
}
|
|
|
}
|
|
@@ -6596,30 +6546,6 @@ $receiptList[$key]['verifyList']=$verifyList;
|
|
|
$receiptLog->status=3;
|
|
|
$receiptLog->rid=$rid;
|
|
|
$receiptLog->insert();
|
|
|
-
|
|
|
- //微信企业号通知
|
|
|
- $receipt2 = new receipt();
|
|
|
- $receiptDetail2 = $receipt2->getOne(array('where'=>'rid="'.$rid.'"','asArray'=>true));
|
|
|
- if(!empty($receiptDetail2)){
|
|
|
- Doo::loadModel('staff');
|
|
|
- $staff = new staff();
|
|
|
- $staffmsg = $staff->getStaffBySid($receiptDetail2['staff']);
|
|
|
- if(!empty($staffmsg['wxid'])){
|
|
|
- require_once (SITE_PATH . '/protected/class/client.php');
|
|
|
- $client = new client ('http://m.cld.smartcost.com.cn/');
|
|
|
- $user = $staffmsg['wxid'];
|
|
|
- $receiptName = '';
|
|
|
- switch($receiptDetail['Rtype']){
|
|
|
- case 0:$receiptName = '报销';break;
|
|
|
- case 1:$receiptName = '借款';break;
|
|
|
- case 2:$receiptName = '对公汇款';break;
|
|
|
- }
|
|
|
-
|
|
|
- $msg = '很遗憾,您的'.$receiptName.' '.$receiptDetail2['receiptOrder'].',¥'.$receiptDetail2['sum'].',已被终止。';
|
|
|
- $result = $client->SendMsg($user,$msg,'text');
|
|
|
- }
|
|
|
-
|
|
|
- }
|
|
|
|
|
|
|
|
|
}elseif(count($verifyStaff)==count($verifyDetail)){//要修改 角色的数量
|
|
@@ -6675,94 +6601,71 @@ $receiptList[$key]['verifyList']=$verifyList;
|
|
|
$dateCondition=" and Year(date) =".$dateArray[0]." and Month(date) = ".$dateArray[1];
|
|
|
$accountItem=json_decode($receiptDetail['accountItem'],true);
|
|
|
foreach ($accountItem['cSum'] as $key=>$value){
|
|
|
- if($key=="agencySum"){
|
|
|
- $iStatistics=$itemStatistics->getOne(array('where'=>'staff='.$receiptDetail['staff'].' and itemCategory="'.$this->AGENCY.'"'.$dateCondition,'asArray'=>true));
|
|
|
- if(empty($iStatistics)){
|
|
|
- $itemStatistics->cid=$receiptDetail['cid'];;
|
|
|
- $itemStatistics->staff=$receiptDetail['staff'];
|
|
|
- $itemStatistics->price=$value;
|
|
|
- $itemStatistics->itemCategory=$this->AGENCY;
|
|
|
- $itemStatistics->date=$receiptDetail['date'];
|
|
|
- $itemStatistics->insert();
|
|
|
- }else{
|
|
|
- if (!empty($value)){
|
|
|
- $itemStatistics->price=$value+$iStatistics['price'];
|
|
|
- $itemStatistics->update(array('where'=>'sid='.$iStatistics['sid']));
|
|
|
- }
|
|
|
- }
|
|
|
- }elseif($key=="travelSum"){
|
|
|
- $iStatistics=$itemStatistics->getOne(array('where'=>'staff='.$receiptDetail['staff'].' and itemCategory="'.$this->TRAVEL.'"'.$dateCondition,'asArray'=>true));
|
|
|
- if(empty($iStatistics)){
|
|
|
- $itemStatistics->cid=$receiptDetail['cid'];
|
|
|
- $itemStatistics->staff=$receiptDetail['staff'];
|
|
|
- $itemStatistics->price=$value;
|
|
|
- $itemStatistics->itemCategory=$this->TRAVEL;
|
|
|
- $itemStatistics->date=$receiptDetail['date'];
|
|
|
- $itemStatistics->insert();
|
|
|
- }else{
|
|
|
- if (!empty($value)){
|
|
|
- $itemStatistics->price=$value+$iStatistics['price'];
|
|
|
- $itemStatistics->update(array('where'=>'sid='.$iStatistics['sid']));
|
|
|
- }
|
|
|
- }
|
|
|
- }elseif($key=="trainSum"){
|
|
|
- $iStatistics=$itemStatistics->getOne(array('where'=>'staff='.$receiptDetail['staff'].' and itemCategory="'.$this->TRAIN.'"'.$dateCondition,'asArray'=>true));
|
|
|
- if(empty($iStatistics)){
|
|
|
- $itemStatistics->cid=$receiptDetail['cid'];
|
|
|
- $itemStatistics->staff=$receiptDetail['staff'];
|
|
|
- $itemStatistics->price=$value;
|
|
|
- $itemStatistics->itemCategory=$this->TRAIN;
|
|
|
- $itemStatistics->date=$receiptDetail['date'];
|
|
|
- $itemStatistics->insert();
|
|
|
- }else{
|
|
|
- if (!empty($value)){
|
|
|
- $itemStatistics->price=$value+$iStatistics['price'];
|
|
|
- $itemStatistics->update(array('where'=>'sid='.$iStatistics['sid']));
|
|
|
- }
|
|
|
- }
|
|
|
- }elseif($key=="otherSum"){
|
|
|
- $iStatistics=$itemStatistics->getOne(array('where'=>'staff='.$receiptDetail['staff'].' and itemCategory="'.$this->OTHER.'"'.$dateCondition,'asArray'=>true));
|
|
|
- if(empty($iStatistics)){
|
|
|
- $itemStatistics->cid=$receiptDetail['cid'];
|
|
|
- $itemStatistics->staff=$receiptDetail['staff'];
|
|
|
- $itemStatistics->price=$value;
|
|
|
- $itemStatistics->itemCategory=$this->OTHER;
|
|
|
- $itemStatistics->date=$receiptDetail['date'];
|
|
|
- $itemStatistics->insert();
|
|
|
- }else{
|
|
|
- if (!empty($value)){
|
|
|
- $itemStatistics->price=$value+$iStatistics['price'];
|
|
|
- $itemStatistics->update(array('where'=>'sid='.$iStatistics['sid']));
|
|
|
- }
|
|
|
+ if($key=="agencySum"){
|
|
|
+ $iStatistics=$itemStatistics->getOne(array('where'=>'staff='.$receiptDetail['staff'].' and itemCategory="'.$this->AGENCY.'"'.$dateCondition,'asArray'=>true));
|
|
|
+ if(empty($iStatistics)){
|
|
|
+ $itemStatistics->cid=$receiptDetail['cid'];;
|
|
|
+ $itemStatistics->staff=$receiptDetail['staff'];
|
|
|
+ $itemStatistics->price=$value;
|
|
|
+ $itemStatistics->itemCategory=$this->AGENCY;
|
|
|
+ $itemStatistics->date=$receiptDetail['date'];
|
|
|
+ $itemStatistics->insert();
|
|
|
+ }else{
|
|
|
+ if (!empty($value)){
|
|
|
+ $itemStatistics->price=$value+$iStatistics['price'];
|
|
|
+ $itemStatistics->update(array('where'=>'sid='.$iStatistics['sid']));
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }elseif($key=="travelSum"){
|
|
|
+ $iStatistics=$itemStatistics->getOne(array('where'=>'staff='.$receiptDetail['staff'].' and itemCategory="'.$this->TRAVEL.'"'.$dateCondition,'asArray'=>true));
|
|
|
+ if(empty($iStatistics)){
|
|
|
+ $itemStatistics->cid=$receiptDetail['cid'];
|
|
|
+ $itemStatistics->staff=$receiptDetail['staff'];
|
|
|
+ $itemStatistics->price=$value;
|
|
|
+ $itemStatistics->itemCategory=$this->TRAVEL;
|
|
|
+ $itemStatistics->date=$receiptDetail['date'];
|
|
|
+ $itemStatistics->insert();
|
|
|
+ }else{
|
|
|
+ if (!empty($value)){
|
|
|
+ $itemStatistics->price=$value+$iStatistics['price'];
|
|
|
+ $itemStatistics->update(array('where'=>'sid='.$iStatistics['sid']));
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }elseif($key=="trainSum"){
|
|
|
+ $iStatistics=$itemStatistics->getOne(array('where'=>'staff='.$receiptDetail['staff'].' and itemCategory="'.$this->TRAIN.'"'.$dateCondition,'asArray'=>true));
|
|
|
+ if(empty($iStatistics)){
|
|
|
+ $itemStatistics->cid=$receiptDetail['cid'];
|
|
|
+ $itemStatistics->staff=$receiptDetail['staff'];
|
|
|
+ $itemStatistics->price=$value;
|
|
|
+ $itemStatistics->itemCategory=$this->TRAIN;
|
|
|
+ $itemStatistics->date=$receiptDetail['date'];
|
|
|
+ $itemStatistics->insert();
|
|
|
+ }else{
|
|
|
+ if (!empty($value)){
|
|
|
+ $itemStatistics->price=$value+$iStatistics['price'];
|
|
|
+ $itemStatistics->update(array('where'=>'sid='.$iStatistics['sid']));
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }elseif($key=="otherSum"){
|
|
|
+ $iStatistics=$itemStatistics->getOne(array('where'=>'staff='.$receiptDetail['staff'].' and itemCategory="'.$this->OTHER.'"'.$dateCondition,'asArray'=>true));
|
|
|
+ if(empty($iStatistics)){
|
|
|
+ $itemStatistics->cid=$receiptDetail['cid'];
|
|
|
+ $itemStatistics->staff=$receiptDetail['staff'];
|
|
|
+ $itemStatistics->price=$value;
|
|
|
+ $itemStatistics->itemCategory=$this->OTHER;
|
|
|
+ $itemStatistics->date=$receiptDetail['date'];
|
|
|
+ $itemStatistics->insert();
|
|
|
+ }else{
|
|
|
+ if (!empty($value)){
|
|
|
+ $itemStatistics->price=$value+$iStatistics['price'];
|
|
|
+ $itemStatistics->update(array('where'=>'sid='.$iStatistics['sid']));
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+ }
|
|
|
$receipt->pastDate=date("Y-m-d");
|
|
|
-
|
|
|
- //微信企业号通知
|
|
|
- $receipt3 = new receipt();
|
|
|
- $receiptDetail = $receipt3->getOne(array('where'=>'rid='.$rid,'asArray'=>true));
|
|
|
- if(!empty($receiptDetail)){
|
|
|
- Doo::loadModel('staff');
|
|
|
- $staff = new staff();
|
|
|
- $staffmsg = $staff->getStaffBySid($receiptDetail['staff']);
|
|
|
- if(!empty($staffmsg['wxid'])){
|
|
|
- require_once (SITE_PATH . '/protected/class/client.php');
|
|
|
- $client = new client ('http://m.cld.smartcost.com.cn/');
|
|
|
- $user = $staffmsg['wxid'];
|
|
|
- $receiptName = '';
|
|
|
- switch($receiptDetail['Rtype']){
|
|
|
- case 0:$receiptName = '报销';break;
|
|
|
- case 1:$receiptName = '借款';break;
|
|
|
- case 2:$receiptName = '对公汇款';break;
|
|
|
- }
|
|
|
-
|
|
|
- $msg = '太好了,您的'.$receiptName.' '.$receiptDetail['receiptOrder'].',¥'.$receiptDetail['sum'].',已同意支付。';
|
|
|
- $result = $client->SendMsg($user,$msg,'text');
|
|
|
- }
|
|
|
-
|
|
|
- }
|
|
|
}
|
|
|
+
|
|
|
$receipt->update(array('where'=>' rid = '.$rid));
|
|
|
return "/approvalExpenses/2";
|
|
|
}
|
|
@@ -6821,29 +6724,6 @@ $receiptList[$key]['verifyList']=$verifyList;
|
|
|
|
|
|
$receipt->status=4;
|
|
|
$receipt->update(array('where'=>'rid='.$rid));
|
|
|
-
|
|
|
- //微信企业号通知
|
|
|
- $receiptDetail = $receipt->getOne(array('where'=>'rid='.$rid,'asArray'=>true));
|
|
|
- if(!empty($receiptDetail)){
|
|
|
- Doo::loadModel('staff');
|
|
|
- $staff = new staff();
|
|
|
- $staffmsg = $staff->getStaffBySid($receiptDetail['staff']);
|
|
|
- if(!empty($staffmsg['wxid'])){
|
|
|
- require_once (SITE_PATH . '/protected/class/client.php');
|
|
|
- $client = new client ('http://m.cld.smartcost.com.cn/');
|
|
|
- $user = $staffmsg['wxid'];
|
|
|
- $receiptName = '';
|
|
|
- switch($receiptDetail['Rtype']){
|
|
|
- case 0:$receiptName = '报销';break;
|
|
|
- case 1:$receiptName = '借款';break;
|
|
|
- case 2:$receiptName = '对公汇款';break;
|
|
|
- }
|
|
|
-
|
|
|
- $msg = '注意,您的'.$receiptName.' '.$receiptDetail['receiptOrder'].',¥'.$receiptDetail['sum'].',已被撤回,请及时处理。';
|
|
|
- $result = $client->SendMsg($user,$msg,'text');
|
|
|
- }
|
|
|
-
|
|
|
- }
|
|
|
}
|
|
|
|
|
|
//echo "ddd";
|
|
@@ -6901,29 +6781,6 @@ $receiptList[$key]['verifyList']=$verifyList;
|
|
|
|
|
|
$receipt->status=4;
|
|
|
$receipt->update(array('where'=>'rid='.$rid));
|
|
|
-
|
|
|
- //微信企业号通知
|
|
|
- $receiptDetail = $receipt->getOne(array('where'=>'rid='.$rid,'asArray'=>true));
|
|
|
- if(!empty($receiptDetail)){
|
|
|
- Doo::loadModel('staff');
|
|
|
- $staff = new staff();
|
|
|
- $staffmsg = $staff->getStaffBySid($receiptDetail['staff']);
|
|
|
- if(!empty($staffmsg['wxid'])){
|
|
|
- require_once (SITE_PATH . '/protected/class/client.php');
|
|
|
- $client = new client ('http://m.cld.smartcost.com.cn/');
|
|
|
- $user = $staffmsg['wxid'];
|
|
|
- $receiptName = '';
|
|
|
- switch($receiptDetail['Rtype']){
|
|
|
- case 0:$receiptName = '报销';break;
|
|
|
- case 1:$receiptName = '借款';break;
|
|
|
- case 2:$receiptName = '对公汇款';break;
|
|
|
- }
|
|
|
-
|
|
|
- $msg = '注意,您的'.$receiptName.' '.$receiptDetail['receiptOrder'].',¥'.$receiptDetail['sum'].',已被撤回,请及时处理。';
|
|
|
- $result = $client->SendMsg($user,$msg,'text');
|
|
|
- }
|
|
|
-
|
|
|
- }
|
|
|
}
|
|
|
|
|
|
//echo "ddd";
|