| | |
| | | errcode=40503
|
| | | errmsg="服务单已取消"
|
| | | ElseIf Left(errcode,1)<>"4" Then
|
| | | sql="update ServiceOrder set ServiceOrdState=4,ServiceOrdPoints=0,ServiceOrd_AP_ID=0,ServiceOrd_AP_Time=getdate(),ServiceOrdCancelReason=9,ServiceOrdCancelReasonTXT='"&DELRemarks&"' where ServiceOrdID="&ServiceOrdID
|
| | | sql="update ServiceOrder set ServiceOrdState=4,ServiceOrdPoints=0,ServiceOrd_AP_ID=0,ServiceOrd_AP_Time=getdate(),ServiceOrdCancelReason=9,ServiceOrdOperationRemarks='',ServiceOrdCancelReasonTXT='"&DELRemarks&"' where ServiceOrdID="&ServiceOrdID
|
| | | objConn.Execute sql
|
| | | sql="delete from UserPoints where Points_Type=6 and ServiceOrdIDDt="&ServiceOrdID&" and ToUserID="&UserID
|
| | | objConn.Execute sql
|
| | |
| | | ,ServiceOrdTraTxnPrice as OrdSumPrice
|
| | | ,OrdSumPriceDel=(select sum(ServiceOrdTraTxnPrice) from ServiceOrder as b where ServiceOrdState=4 and a.ServiceOrdID=b.ServiceOrdID)
|
| | | from ServiceOrder as a
|
| | | where ((ServiceOrdCancelReason<>10 or ServiceOrdCancelReason is null) and (ServiceOrdCancelReasonTXT<>'自动取消' or ServiceOrdCancelReasonTXT is null)) and (ServiceOrdOperationRemarks<>'[客户未正式提交需求,可不联系]' or ServiceOrdOperationRemarks is null) and ServiceOrdUserID not in (4,53) and ServiceOrd_CC_Time ".$SqlDateType." and ServiceOrdSource=5
|
| | | where ((ServiceOrdCancelReason<>10 or ServiceOrdCancelReason is null) and (ServiceOrdCancelReasonTXT<>'自动取消' or ServiceOrdCancelReasonTXT is null)) and (ServiceOrdOperationRemarks<>'[客户未正式提交需求,可不联系]' or ServiceOrdOperationRemarks is null) and ServiceOrdUserID not in (4,53,11638,93481) and ServiceOrd_CC_Time ".$SqlDateType." and ServiceOrdSource=5
|
| | | ) as aa GROUP BY SourceName,UserSource";
|
| | | //echo $sql;//exit;
|
| | | $data = sqlsrv_query($conn,$sql);
|
| | |
| | | If ServiceOrdPtOutHospID_New="" Then ServiceOrdPtOutHospID_New=0
|
| | | If ServiceOrdPtInHospID_New="" Then ServiceOrdPtInHospID_New=0
|
| | | If ServiceOrdVIP="" Then ServiceOrdVIP=0
|
| | | If ServiceOrdOperationRemarks<>"" Then ServiceOrdOperationRemarks=replace(ServiceOrdOperationRemarks,"[客户未正式提交需求,可不联系]","")
|
| | | If ServiceOrdOperationRemarks<>"" Then ServiceOrdOperationRemarks=replace(replace(ServiceOrdOperationRemarks,"[客户未正式提交需求,可不联系]",""),"[客户未正式提交需求]","")
|
| | | If ServiceOrdVisit<>"" And ServiceOrdVisit_old<>ServiceOrdVisit Then
|
| | | RV_Point=0
|
| | | sql="select id from DispatchOrd_Entourage,DispatchOrd where EntourageState<>4 and DispatchOrdIDDt=DispatchOrdID and ServiceOrdIDDt="&ServiceOrdID
|