|
@@ -617,11 +617,15 @@ class ReceiptController extends DooController {
|
|
|
|
|
|
// get Receipt By verifyID status 2
|
|
|
$receiptList = $receipt->find ( array (
|
|
|
- 'where' => 'rid =' . $rid,
|
|
|
+ 'where' => 'rid =' . $rid.' and status=2',
|
|
|
'desc' => 'rid',
|
|
|
'asArray' => true
|
|
|
) );
|
|
|
|
|
|
+ if(empty($receiptList)){
|
|
|
+ die('illegal request');
|
|
|
+ }
|
|
|
+
|
|
|
$Locate = 0;
|
|
|
$roleId = 0;
|
|
|
if ($ap == 4)
|
|
@@ -2659,7 +2663,7 @@ class ReceiptController extends DooController {
|
|
|
$Locate = 0;
|
|
|
|
|
|
|
|
|
- $reportList=array();
|
|
|
+ $reportList=$reportCateList=array();
|
|
|
foreach ( $receiptList as $key => $value ) {
|
|
|
|
|
|
$receiptList [$key] ['Locate'] = $Locate;
|
|
@@ -2719,7 +2723,8 @@ class ReceiptController extends DooController {
|
|
|
'asArray' => true
|
|
|
) );
|
|
|
|
|
|
- array_push($reportList, $receiptList [$key] ['staffDetail']['sid'].'-'.$receiptList [$key] ['staffDetail']['username']);
|
|
|
+ array_push($reportList, $receiptList [$key] ['staffDetail']['sid'].'-'.$receiptList [$key] ['staffDetail']['username'].'-'.$receiptList [$key] ['staffDetail']['category']);
|
|
|
+ array_push($reportCateList, $receiptList [$key] ['staffDetail']['cid'].'-'.$receiptList [$key] ['staffDetail']['category']);
|
|
|
|
|
|
$receiptList [$key] ['button'] = $button;
|
|
|
$receiptList [$key] ['nowStaffArray'] = explode ( ',', $value ['nowStaff'] );
|
|
@@ -2730,15 +2735,19 @@ class ReceiptController extends DooController {
|
|
|
$reportHtml='';
|
|
|
foreach ($reportList as $key=>$value){
|
|
|
$v=explode("-", $value);
|
|
|
- $reportHtml.='<option value="'.$v[1].'">'.$v[1].'</option>';
|
|
|
+ $reportHtml.='<option node-all=\'true\' node-cate=\''.$v[2].'\' value="'.$v[1].'">'.$v[1].'</option>';
|
|
|
}
|
|
|
-
|
|
|
- //print_r($reportList);
|
|
|
-
|
|
|
+ //print_r($reportList)
|
|
|
$data['reportHtml']=$reportHtml;
|
|
|
|
|
|
+ $reportCateList=array_unique($reportCateList);
|
|
|
+ $reportCateHtml='';
|
|
|
+ foreach ($reportCateList as $key=>$value){
|
|
|
+ $v=explode("-", $value);
|
|
|
+ $reportCateHtml.='<option value="'.$v[1].'">'.$v[1].'</option>';
|
|
|
+ }
|
|
|
//$reportHtml.='<option value="ALL">'.$value[''].'</option>';
|
|
|
-
|
|
|
+ $data['reportCateHtml']=$reportCateHtml;
|
|
|
|
|
|
// print_r($receiptList);die;
|
|
|
// $data['verifyDetail']=$verifyDetail;
|
|
@@ -3295,11 +3304,15 @@ class ReceiptController extends DooController {
|
|
|
|
|
|
// get Receipt By verifyID status 2
|
|
|
$receiptList = $receipt->find ( array (
|
|
|
- 'where' => 'rid =' . $rid,
|
|
|
+ 'where' => 'rid =' . $rid.' and status=2',
|
|
|
'desc' => 'rid',
|
|
|
'asArray' => true
|
|
|
) );
|
|
|
|
|
|
+ if (empty($receiptList)){
|
|
|
+ die ( 'illegal request' );
|
|
|
+ }
|
|
|
+
|
|
|
$Locate = 0;
|
|
|
$roleId = 0;
|
|
|
if ($ap == 4)
|
|
@@ -4549,11 +4562,15 @@ class ReceiptController extends DooController {
|
|
|
|
|
|
// get Receipt By verifyID status 2
|
|
|
$receiptList = $receipt->find ( array (
|
|
|
- 'where' => 'rid =' . $rid,
|
|
|
+ 'where' => 'rid =' . $rid.' and status=2',
|
|
|
'desc' => 'rid',
|
|
|
'asArray' => true
|
|
|
) );
|
|
|
|
|
|
+ if(empty($receiptList)){
|
|
|
+ die ( 'illegal request' );
|
|
|
+ }
|
|
|
+
|
|
|
$loanList = $loanReceipt->find ( array (
|
|
|
'where' => 'rid=' . $receiptList [0] ['loanRid'],
|
|
|
'desc' => 'rid',
|
|
@@ -5002,7 +5019,10 @@ class ReceiptController extends DooController {
|
|
|
function hisImplement() {
|
|
|
$item = isset ( $this->params ['item'] ) ? $this->params ['item'] : "";
|
|
|
if (empty ( $item ))
|
|
|
- $item = $this->get_args ( 'item' ) ? $this->get_args ( 'item' ) : "";
|
|
|
+ $item = $this->get_args ( 'item' ) ? $this->get_args ( 'item' ) : "pendImplement";
|
|
|
+
|
|
|
+
|
|
|
+ $rdate = $this->get_args ( 'date' ) ? $this->get_args ( 'date' ) : "";
|
|
|
|
|
|
$year = $this->get_args ( 'year' ) ? $this->get_args ( 'year' ) : date ( "Y" );
|
|
|
$moth = $this->get_args ( 'moth' ) ? $this->get_args ( 'moth' ) : 'MONTH';
|
|
@@ -5029,13 +5049,36 @@ class ReceiptController extends DooController {
|
|
|
$condition = " and Rtype=0 ";
|
|
|
elseif ($item == "remits")
|
|
|
$condition = " and Rtype=2 ";
|
|
|
- $sopString = "";
|
|
|
+ elseif($item =="pendImplement"){
|
|
|
+ $condition = ' and (status=1 or status=6) and (executeCopy like "%[\"' . $this->staff [0] ['sid'] . '\"%" and executeStaff not like "%{\"' . $this->staff [0] ['sid'] . '\"%" ) ';
|
|
|
+ }
|
|
|
|
|
|
- $dateCondition = " and Year(date) =" . $year;
|
|
|
- if ($sop != 'SOP')
|
|
|
- $sopString = " and staff=" . $sop;
|
|
|
+
|
|
|
+ //'and (executeCopy like "%["' . $this->staff [0] ['sid'] . '"%" and executeStaff not like "%{"' . $this->staff [0] ['sid'] . '"%" )';
|
|
|
+
|
|
|
|
|
|
$statusCon = '(status=8 or status=9 or status=1 or status=6 )';
|
|
|
+ $sopString = "";
|
|
|
+
|
|
|
+ if (empty($rdate))
|
|
|
+ $dateCondition = " and Year(date) =" . $year;
|
|
|
+ else
|
|
|
+ $dateCondition=" and date_format(date,'%Y-%m-%d')='".$rdate."' ";
|
|
|
+
|
|
|
+ if ($item == 'teipts') {
|
|
|
+ $statusCon = '(status=1 or status=6 )';
|
|
|
+ $dateCondition=" and date_format(pastDate,'%Y-%m-%d')='".$rdate."' ";
|
|
|
+
|
|
|
+ } elseif ($item == 'alerpts') {
|
|
|
+ $statusCon = '(status=8 or status=9 )';
|
|
|
+ if (empty($rdate))
|
|
|
+ $dateCondition = " and Year(date) =" . $year;
|
|
|
+ else
|
|
|
+ $dateCondition=" and date_format(executeDate,'%Y-%m-%d')='".$rdate."' ";
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ /*
|
|
|
if ($item == 'teipts') {
|
|
|
$statusCon = '(status=1 or status=6 )';
|
|
|
$dateCondition = " and Year(pastDate) =" . $year;
|
|
@@ -5051,6 +5094,13 @@ class ReceiptController extends DooController {
|
|
|
if ($day != 'DAY')
|
|
|
$dateCondition = " and Year(executeDate) =" . $year . " and Month(executeDate) = " . $moth . " and day(executeDate)=" . $day;
|
|
|
}
|
|
|
+ */
|
|
|
+
|
|
|
+ if ($sop != 'SOP')
|
|
|
+ $sopString = " and staff=" . $sop;
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
// $noPassSum=$receipt->receiptByYear($year,$this->staff[0]['sid']); and (status=1 or status=6)
|
|
|
|
|
|
$receiptList = $receipt->find ( array (
|
|
@@ -5271,6 +5321,8 @@ class ReceiptController extends DooController {
|
|
|
$sopHtml .= '<option value="' . $key . '" >' . $value . '</option>';
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+ $data['rdate']=$rdate;
|
|
|
$data ['sopHtml'] = $sopHtml;
|
|
|
$data ['dayHtml'] = $dayHtml;
|
|
|
$data ['mothHtml'] = $mothHtml;
|
|
@@ -8359,9 +8411,17 @@ class ReceiptController extends DooController {
|
|
|
$verify = new verify ();
|
|
|
|
|
|
$receiptInfo = $receipt->getOne ( array (
|
|
|
- 'where' => 'rid=' . $rid,
|
|
|
+ 'where' => 'rid=' . $rid.' and status=2',
|
|
|
'asArray' => true
|
|
|
) );
|
|
|
+
|
|
|
+ if(empty($receiptInfo)){
|
|
|
+ echo json_encode ( array (
|
|
|
+ 'status' => 2
|
|
|
+ ) );
|
|
|
+ die ();
|
|
|
+ }
|
|
|
+
|
|
|
$vr = $verify->getOne ( array (
|
|
|
'where' => 'vid=' . $receiptInfo ['verify'],
|
|
|
'asArray' => true
|
|
@@ -8413,7 +8473,11 @@ class ReceiptController extends DooController {
|
|
|
echo json_encode ( array (
|
|
|
'status' => 1
|
|
|
) );
|
|
|
- die ();
|
|
|
+
|
|
|
+ //Header("HTTP/1.1 303 See Other");
|
|
|
+ //Header("Location: /approvalExpenses/pendApproval");
|
|
|
+
|
|
|
+ die;
|
|
|
}
|
|
|
|
|
|
echo json_encode ( array (
|