|
@@ -2225,7 +2225,7 @@ class ReceiptController extends DooController {
|
|
|
$receiptTraining = new receiptTraining ();
|
|
|
|
|
|
$receiptDetail = $receipt->getReceiptByRid ( $rid );
|
|
|
- if ($receiptDetail ['status'] != 5)
|
|
|
+ if (! ($receiptDetail ['status'] == 5 || $receiptDetail ['status'] == 4))
|
|
|
die ();
|
|
|
|
|
|
$receiptTrainingDetail = $receiptTraining->getReceiptTrainingByRtid ( $receiptDetail ['trainId'] );
|
|
@@ -2234,17 +2234,23 @@ class ReceiptController extends DooController {
|
|
|
// 收入合计
|
|
|
Doo::loadModel ( 'invoiceTraining' );
|
|
|
$invoiceTraining = new invoiceTraining ();
|
|
|
- $invoiceTrainingDetail=array('invoiceArriveAmount'=>0,'RIAmount'=>0,'invoiceTotalAmount'=>0);
|
|
|
- if ($receiptDetail ['invoiceTrainId']!=0){
|
|
|
- $invoiceTrainingDetail = $invoiceTraining->getInvoiceTrainingByItid ( $receiptDetail ['invoiceTrainId'] );
|
|
|
+ $invoiceTrainingDetail = array (
|
|
|
+ 'invoiceArriveAmount' => 0,
|
|
|
+ 'RIAmount' => 0,
|
|
|
+ 'invoiceTotalAmount' => 0 ,
|
|
|
+ 'invoiceCompanyAmount'=>0
|
|
|
+ );
|
|
|
+ if ($receiptDetail ['invoiceTrainId'] != 0) {
|
|
|
+ $invoiceTrainingDetail = $invoiceTraining->getInvoiceTrainingByItid ( $receiptDetail ['invoiceTrainId'] );
|
|
|
}
|
|
|
// print_r($invoiceTrainingDetail);
|
|
|
- $invoiceArriveAmount=$RIAmount=0;
|
|
|
- if(!empty($invoiceTrainingDetail)){
|
|
|
- $invoiceArriveAmount=$invoiceTrainingDetail ['invoiceArriveAmount'];
|
|
|
- $RIAmount=$invoiceTrainingDetail ['RIAmount'];
|
|
|
+ $invoiceArriveAmount = $RIAmount = 0;
|
|
|
+ if (! empty ( $invoiceTrainingDetail )) {
|
|
|
+ $invoiceArriveAmount = $invoiceTrainingDetail ['invoiceArriveAmount'];
|
|
|
+ $RIAmount = $invoiceTrainingDetail ['RIAmount'];
|
|
|
}
|
|
|
$data ['invoiceTrainingDetail'] = $invoiceTrainingDetail;
|
|
|
+ //print_r($invoiceTrainingDetail);
|
|
|
// 支出项目
|
|
|
Doo::loadModel ( 'accountItem' );
|
|
|
$accountItem = new accountItem ();
|
|
@@ -2259,7 +2265,7 @@ class ReceiptController extends DooController {
|
|
|
$RILecturerList = $RILecturer->getRILecturerByRid ( $rid );
|
|
|
// 支出项金额详情
|
|
|
$aiData = $accountItem->getTrainingDetail ( $RItemList, $RILecturerList, $invoiceArriveAmount );
|
|
|
- //print_r($aiData);
|
|
|
+ // print_r($aiData);
|
|
|
|
|
|
// 利润
|
|
|
$data ['profit'] = $invoiceArriveAmount - $aiData ['total'];
|
|
@@ -2268,10 +2274,13 @@ class ReceiptController extends DooController {
|
|
|
// print_r($aiData['dataList']);
|
|
|
$data ['categoryActualExpenditure'] = $aiData ['total'] - $aiData ['categoryActualExpenditure'];
|
|
|
// 备用金
|
|
|
- $sum=0;$data ['receiptLoanDetail']=array('sum'=>0);
|
|
|
- if (!empty($receiptDetail ['trainLoanRid'])){
|
|
|
- $data ['receiptLoanDetail'] = $receipt->getReceiptByRid ( $receiptDetail ['trainLoanRid'] );
|
|
|
- $sum=$data ['receiptLoanDetail'] ['sum'];
|
|
|
+ $sum = 0;
|
|
|
+ $data ['receiptLoanDetail'] = array (
|
|
|
+ 'sum' => 0
|
|
|
+ );
|
|
|
+ if (! empty ( $receiptDetail ['trainLoanRid'] )) {
|
|
|
+ $data ['receiptLoanDetail'] = $receipt->getReceiptByRid ( $receiptDetail ['trainLoanRid'] );
|
|
|
+ $sum = $data ['receiptLoanDetail'] ['sum'];
|
|
|
}
|
|
|
$data ['payment'] = $sum + $RIAmount - $data ['categoryActualExpenditure'];
|
|
|
|
|
@@ -2280,22 +2289,20 @@ class ReceiptController extends DooController {
|
|
|
$data ['aiList'] = $aiData ['dataList'];
|
|
|
|
|
|
// 占比计算
|
|
|
- if($invoiceArriveAmount!=0){
|
|
|
- $data ['totalProportion'] = number_format ( $aiData ['total'] / $invoiceArriveAmount, 2, '.', '' ) * 100;
|
|
|
- $data ['profitProportion'] = number_format ( $data ['profit'] / $invoiceArriveAmount, 2, '.', '' ) * 100;
|
|
|
- $data ['sumProportion'] = number_format ( $sum / $invoiceArriveAmount, 2, '.', '' ) * 100;
|
|
|
- $data ['invoiceTotalAmountProportion'] = number_format ( $data ['invoiceTrainingDetail'] ['invoiceTotalAmount'] / $invoiceArriveAmount, 2, '.', '' ) * 100;
|
|
|
- $data ['RIAmountProportion'] = number_format ( $data ['invoiceTrainingDetail'] ['RIAmount'] / $invoiceArriveAmount, 2, '.', '' ) * 100;
|
|
|
- $data ['companyProfitProportion'] = number_format ( $data ['companyProfit'] / $invoiceArriveAmount, 2, '.', '' ) * 100;
|
|
|
- $data ['categoryProportion'] = number_format ( $data ['categoryProfit'] / $invoiceArriveAmount, 2, '.', '' ) * 100;
|
|
|
- $data ['categoryActualExpenditureProportion'] = number_format ( $data ['categoryActualExpenditure'] / $invoiceArriveAmount, 2, '.', '' ) * 100;
|
|
|
- $data ['paymentProportion'] = number_format ( $data ['payment'] / $invoiceArriveAmount, 2, '.', '' ) * 100;
|
|
|
- }else{
|
|
|
- $data ['totalProportion'] =$data ['profitProportion'] = $data ['sumProportion'] = $data ['invoiceTotalAmountProportion'] = $data ['RIAmountProportion']
|
|
|
- = $data ['companyProfitProportion'] = $data ['categoryActualExpenditureProportion'] = $data ['paymentProportion']=$data ['categoryProportion'] = 0;
|
|
|
+ if ($invoiceArriveAmount != 0) {
|
|
|
+ $data ['totalProportion'] = number_format ( $aiData ['total'] / $invoiceArriveAmount, 4, '.', '' ) * 100;
|
|
|
+ $data ['profitProportion'] = number_format ( $data ['profit'] / $invoiceArriveAmount, 4, '.', '' ) * 100;
|
|
|
+ $data ['sumProportion'] = number_format ( $sum / $invoiceArriveAmount, 4, '.', '' ) * 100;
|
|
|
+ $data ['invoiceTotalAmountProportion'] = number_format ( $data ['invoiceTrainingDetail'] ['invoiceCompanyAmount'] / $invoiceArriveAmount, 4, '.', '' ) * 100;
|
|
|
+ $data ['RIAmountProportion'] = number_format ( $data ['invoiceTrainingDetail'] ['RIAmount'] / $invoiceArriveAmount, 4, '.', '' ) * 100;
|
|
|
+ $data ['companyProfitProportion'] = number_format ( $data ['companyProfit'] / $invoiceArriveAmount, 4, '.', '' ) * 100;
|
|
|
+ $data ['categoryProportion'] = number_format ( $data ['categoryProfit'] / $invoiceArriveAmount, 4, '.', '' ) * 100;
|
|
|
+ $data ['categoryActualExpenditureProportion'] = number_format ( $data ['categoryActualExpenditure'] / $invoiceArriveAmount, 4, '.', '' ) * 100;
|
|
|
+ $data ['paymentProportion'] = number_format ( $data ['payment'] / $invoiceArriveAmount, 4, '.', '' ) * 100;
|
|
|
+ } else {
|
|
|
+ $data ['totalProportion'] = $data ['profitProportion'] = $data ['sumProportion'] = $data ['invoiceTotalAmountProportion'] = $data ['RIAmountProportion'] = $data ['companyProfitProportion'] = $data ['categoryActualExpenditureProportion'] = $data ['paymentProportion'] = $data ['categoryProportion'] = 0;
|
|
|
}
|
|
|
|
|
|
-
|
|
|
// 审批组
|
|
|
Doo::loadModel ( 'verify' );
|
|
|
$verify = new verify ();
|
|
@@ -2343,7 +2350,7 @@ class ReceiptController extends DooController {
|
|
|
$verify = new verify ();
|
|
|
|
|
|
$receiptDetail = $receipt->getReceiptByRid ( $rid );
|
|
|
- if ($receiptDetail ['status'] != 5)
|
|
|
+ if (! ($receiptDetail ['status'] == 5 || $receiptDetail ['status'] == 4))
|
|
|
die ();
|
|
|
|
|
|
$receiptTrainingDetail = $receiptTraining->getReceiptTrainingByRtid ( $receiptDetail ['trainId'] );
|
|
@@ -2469,8 +2476,8 @@ class ReceiptController extends DooController {
|
|
|
|
|
|
$receiptDetail = $receipt->getReceiptByRid ( $rid );
|
|
|
$receiptLoanDetail = $receipt->getReceiptByRid ( $ridLoan );
|
|
|
- // 不合法的数据
|
|
|
- if ($receiptDetail ['status'] != 5 || $receiptDetail ['Rtype'] != 3) {
|
|
|
+ // 不合法的数据if (!($receiptDetail ['status'] == 5||$receiptDetail ['status'] == 4))
|
|
|
+ if ((! ($receiptDetail ['status'] == 5 || $receiptDetail ['status'] == 4)) || $receiptDetail ['Rtype'] != 3) {
|
|
|
die ( 'illegal request-receiptError' );
|
|
|
}
|
|
|
if ($receiptLoanDetail ['status'] != 8 || $receiptLoanDetail ['Rtype'] != 1) {
|
|
@@ -2519,8 +2526,8 @@ class ReceiptController extends DooController {
|
|
|
|
|
|
$receiptDetail = $receipt->getReceiptByRid ( $rid );
|
|
|
$receiptLoanDetail = $receipt->getReceiptByRid ( $ridLoan );
|
|
|
- // 不合法的数据
|
|
|
- if ($receiptDetail ['status'] != 5 || $receiptDetail ['Rtype'] != 3) {
|
|
|
+ // 不合法的数据 !($receiptDetail ['status'] == 5||$receiptDetail ['status'] == 4)
|
|
|
+ if ((! ($receiptDetail ['status'] == 5 || $receiptDetail ['status'] == 4)) || $receiptDetail ['Rtype'] != 3) {
|
|
|
die ( 'illegal request-receiptError' );
|
|
|
}
|
|
|
if ($receiptLoanDetail ['status'] != 10 || $receiptLoanDetail ['Rtype'] != 1) {
|
|
@@ -2570,7 +2577,7 @@ class ReceiptController extends DooController {
|
|
|
$invoiceTraining = new invoiceTraining ();
|
|
|
|
|
|
$receiptDetail = $receipt->getReceiptByRid ( $rid );
|
|
|
- if ($receiptDetail ['status'] != 5)
|
|
|
+ if (! ($receiptDetail ['status'] == 5 || $receiptDetail ['status'] == 4))
|
|
|
die ();
|
|
|
$receiptTrainingDetail = $receiptTraining->getReceiptTrainingByRtid ( $receiptDetail ['trainId'] );
|
|
|
|
|
@@ -2619,10 +2626,10 @@ class ReceiptController extends DooController {
|
|
|
$receiptDetail = $receipt->getReceiptByRid ( $rid );
|
|
|
$invoiceTrainDetail = $invoiceTraining->getInvoiceTrainingByItid ( $itid );
|
|
|
// 不合法的数据
|
|
|
- if ($receiptDetail ['status'] != 5 || $receiptDetail ['Rtype'] != 3) {
|
|
|
+ if ((! ($receiptDetail ['status'] == 5 || $receiptDetail ['status'] == 4)) || $receiptDetail ['Rtype'] != 3) {
|
|
|
die ( 'illegal request-receiptError' );
|
|
|
}
|
|
|
- if (empty ( $invoiceTrainDetail )) {
|
|
|
+ if (empty ( $invoiceTrainDetail ) || $invoiceTrainDetail ['bindReceipt'] == 1) {
|
|
|
die ( 'illegal request-receipLoantError' );
|
|
|
}
|
|
|
// 培训班结算挂钩借款
|
|
@@ -2633,6 +2640,17 @@ class ReceiptController extends DooController {
|
|
|
);
|
|
|
$receipt->setReceiptByCondition ( $item );
|
|
|
|
|
|
+ $invoiceTraining = new invoiceTraining ();
|
|
|
+ $item = array (
|
|
|
+ 'bindReceipt' => 1,
|
|
|
+ 'itid' => $itid
|
|
|
+ );
|
|
|
+ $invoiceTraining->setInvoiceTrainByCondition ( $item );
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
$XDeode = new XDeode ( 7 );
|
|
|
return "/receiptTrainInvoiceEdi/" . $XDeode->encode ( $rid ) . ".html";
|
|
|
} else
|
|
@@ -2695,14 +2713,23 @@ class ReceiptController extends DooController {
|
|
|
|
|
|
if (is_numeric ( $rid ) && is_numeric ( $itid )) {
|
|
|
$receiptDetail = $receipt->getReceiptByRid ( $rid );
|
|
|
- if ($receiptDetail ['status'] != 5)
|
|
|
+ if (!($receiptDetail ['status'] == 5||$receiptDetail ['status'] == 4)){
|
|
|
die ( 'illegal request-status' );
|
|
|
+ }
|
|
|
|
|
|
$receipt = new receipt ();
|
|
|
$receipt->rid = $rid;
|
|
|
$receipt->invoiceTrainId = 0;
|
|
|
$receipt->update ();
|
|
|
|
|
|
+ Doo::loadModel ( 'invoiceTraining' );
|
|
|
+ $invoiceTraining = new invoiceTraining ();
|
|
|
+ $item = array (
|
|
|
+ 'bindReceipt' => 0,
|
|
|
+ 'itid' => $itid
|
|
|
+ );
|
|
|
+ $invoiceTraining->setInvoiceTrainByCondition ( $item );
|
|
|
+
|
|
|
$RIExtend->delete ( array (
|
|
|
'where' => 'rid=' . $rid
|
|
|
) );
|
|
@@ -2735,14 +2762,19 @@ class ReceiptController extends DooController {
|
|
|
$accountItem = new accountItem ();
|
|
|
|
|
|
$receiptDetail = $receipt->getReceiptByRid ( $rid );
|
|
|
- if ($receiptDetail ['status'] != 5)
|
|
|
+ if (!($receiptDetail ['status'] == 5||$receiptDetail ['status'] == 4))
|
|
|
die ();
|
|
|
$receiptTrainingDetail = $receiptTraining->getReceiptTrainingByRtid ( $receiptDetail ['trainId'] );
|
|
|
|
|
|
$RItemList = $RItem->getRItemByRid ( $rid );
|
|
|
$aiList = $accountItem->getAccountBookByCategory ( '培训班费用' );
|
|
|
+// foreach ($aiList as $key=>$value){//不需要添加税款,在添加收入时自动添加
|
|
|
+// if($value['name']=='税款'){
|
|
|
+// unset($aiList[$key]);break;
|
|
|
+// }
|
|
|
+// }
|
|
|
|
|
|
- // print_r($RItemList);
|
|
|
+ //print_r($aiList);
|
|
|
$data ['RItemList'] = $RItemList;
|
|
|
$data ['aiList'] = $aiList;
|
|
|
|
|
@@ -2761,7 +2793,7 @@ class ReceiptController extends DooController {
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * 添加支出项
|
|
|
+ * 添加支出项 需要修改 费用金额合计
|
|
|
*/
|
|
|
function receiptTrainItemAddDo() {
|
|
|
$ridKey = $this->get_args ( 'ridKey' ) ? $this->get_args ( 'ridKey' ) : "";
|
|
@@ -2773,6 +2805,8 @@ class ReceiptController extends DooController {
|
|
|
$inputer = $this->get_args ( 'inputer' ) ? $this->get_args ( 'inputer' ) : "";
|
|
|
$describe = $this->get_args ( 'describe' ) ? $this->get_args ( 'describe' ) : "";
|
|
|
|
|
|
+ $payType = isset ( $this->params ['payType'] ) ? $this->params ['payType'] : '';
|
|
|
+
|
|
|
if (! empty ( $ridKey ) && ! empty ( $item ) && ! empty ( $price ) && ! empty ( $date ) && ! empty ( $inputer )) {
|
|
|
Doo::loadClass ( 'XDeode' );
|
|
|
$XDeode = new XDeode ( 5 );
|
|
@@ -2783,6 +2817,9 @@ class ReceiptController extends DooController {
|
|
|
if (! is_numeric ( $rid ))
|
|
|
die ( 'illegal request' );
|
|
|
|
|
|
+ if($payType=='company'){
|
|
|
+ $RItem->payType = 1;
|
|
|
+ }
|
|
|
$RItem->rid = $rid;
|
|
|
$RItem->item = $item;
|
|
|
|
|
@@ -2821,9 +2858,19 @@ class ReceiptController extends DooController {
|
|
|
'where' => 'rid=' . $rid . ' and item like "' . $item . '" and itemCategory like "培训班费用"'
|
|
|
) );
|
|
|
}
|
|
|
+ //更新费用合计金额
|
|
|
+ $receipt = new receipt ();
|
|
|
+ $receipt->sum=$rInfo['sum']+number_format ( $price, 2, '.', '' );
|
|
|
+ $receipt->update ( array (
|
|
|
+ 'where' => 'rid=' . $rid
|
|
|
+ ) );
|
|
|
|
|
|
$XDeode = new XDeode ( 7 );
|
|
|
- return '/receiptTrainItemEdi/' . $XDeode->encode ( $rid ) . '.html';
|
|
|
+ if($payType=='company'){
|
|
|
+ return '/receiptTrainItem/approval/' . $XDeode->encode ( $rid ) . '.html';
|
|
|
+ }else{
|
|
|
+ return '/receiptTrainItemEdi/' . $XDeode->encode ( $rid ) . '.html';
|
|
|
+ }
|
|
|
} else
|
|
|
die ( 'illegal request' );
|
|
|
}
|
|
@@ -2852,7 +2899,7 @@ class ReceiptController extends DooController {
|
|
|
$lecturer = new lecturer ();
|
|
|
|
|
|
$receiptDetail = $receipt->getReceiptByRid ( $rid );
|
|
|
- if ($receiptDetail ['status'] != 5)
|
|
|
+ if (!($receiptDetail ['status'] == 5||$receiptDetail ['status'] == 4))
|
|
|
die ();
|
|
|
$receiptTrainingDetail = $receiptTraining->getReceiptTrainingByRtid ( $receiptDetail ['trainId'] );
|
|
|
|
|
@@ -2983,7 +3030,7 @@ class ReceiptController extends DooController {
|
|
|
|
|
|
if (is_numeric ( $rid ) && is_numeric ( $rlid )) {
|
|
|
$receiptDetail = $receipt->getReceiptByRid ( $rid );
|
|
|
- if ($receiptDetail ['status'] != 5)
|
|
|
+ if (!($receiptDetail ['status'] == 5||$receiptDetail ['status'] == 4))
|
|
|
die ( 'illegal request-status' );
|
|
|
|
|
|
$RILecturer->delete ( array (
|
|
@@ -2998,8 +3045,8 @@ class ReceiptController extends DooController {
|
|
|
/**
|
|
|
* 培训班提交审批
|
|
|
*/
|
|
|
- function receiptTrainApprovalDo() {
|
|
|
- $ridKey = $this->get_args ( 'ridKey' ) ? $this->get_args ( 'ridKey' ) : "";;
|
|
|
+ function receiptTrainDo() {
|
|
|
+ $ridKey = $this->get_args ( 'ridKey' ) ? $this->get_args ( 'ridKey' ) : "";
|
|
|
|
|
|
Doo::loadClass ( 'XDeode' );
|
|
|
$XDeode = new XDeode ( 7 );
|
|
@@ -3012,7 +3059,6 @@ class ReceiptController extends DooController {
|
|
|
Doo::loadModel ( 'statistics' );
|
|
|
$statistics = new statistics ();
|
|
|
|
|
|
-
|
|
|
Doo::loadModel ( "verify" );
|
|
|
$verify = new verify ();
|
|
|
|
|
@@ -3104,7 +3150,7 @@ class ReceiptController extends DooController {
|
|
|
$receiptLog->rid = $rid;
|
|
|
$receiptLog->insert ();
|
|
|
|
|
|
- //写入列表项
|
|
|
+ // 写入列表项
|
|
|
Doo::loadModel ( 'accountItem' );
|
|
|
$accountItem = new accountItem ();
|
|
|
$aItem = $accountItem->getAccountBookByCategory ( '培训班费用' );
|
|
@@ -3119,52 +3165,51 @@ class ReceiptController extends DooController {
|
|
|
$RILecturerList = $RILecturer->getRILecturerByRid ( $rid );
|
|
|
// 支出项金额详情
|
|
|
$aiData = $accountItem->getTrainingDetail ( $RItemList, $RILecturerList, 0 );
|
|
|
- //print_r($aItem);
|
|
|
- //print_r($aiData);
|
|
|
-
|
|
|
+ // print_r($aItem);
|
|
|
+ // print_r($aiData);
|
|
|
+
|
|
|
$accountJson [$this->AGENCY] = $accountJson [$this->TRAVEL] = $accountJson [$this->TRAIN] = $accountJson [$this->OTHER] = array ();
|
|
|
$ag = $tr = $ta = $ot = 0;
|
|
|
$sum = $agencySum = $travelSum = $trainSum = $otherSum = 0;
|
|
|
-
|
|
|
+
|
|
|
foreach ( $aItem as $key => $value ) {
|
|
|
if ($value ['category'] == $this->TRAIN) {
|
|
|
|
|
|
- foreach ($aiData['dataList'] as $k=>$v){
|
|
|
- if ($value ['name'] == $v['name']) {
|
|
|
+ foreach ( $aiData ['dataList'] as $k => $v ) {
|
|
|
+ if ($value ['name'] == $v ['name']) {
|
|
|
array_push ( $accountJson [$this->TRAIN], array (
|
|
|
'aid' => $value ['aid'],
|
|
|
'name' => $value ['name'],
|
|
|
- 'price' => number_format ( $v['price'], 2, '.', '' )
|
|
|
+ 'price' => number_format ( $v ['price'], 2, '.', '' )
|
|
|
) );
|
|
|
- $sum += $v['price'];
|
|
|
- $trainSum += $v['price'];
|
|
|
- unset($aiData['dataList'][$k]);
|
|
|
+ $sum += $v ['price'];
|
|
|
+ $trainSum += $v ['price'];
|
|
|
+ unset ( $aiData ['dataList'] [$k] );
|
|
|
break;
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
}
|
|
|
}
|
|
|
$accountJson ['cSum'] = array (
|
|
|
'agencySum' => number_format ( $agencySum, 2, '.', '' ),
|
|
|
'travelSum' => number_format ( $travelSum, 2, '.', '' ),
|
|
|
'trainSum' => number_format ( $trainSum, 2, '.', '' ),
|
|
|
- 'otherSum' => number_format ( $otherSum, 2, '.', '' )
|
|
|
+ 'otherSum' => number_format ( $otherSum, 2, '.', '' )
|
|
|
);
|
|
|
-
|
|
|
+
|
|
|
// 报销单
|
|
|
$receipt = new receipt ();
|
|
|
- $receipt->accountItem = json_encode ( $accountJson );
|
|
|
- $receipt->sum = number_format ( $sum, 2, '.', '' );
|
|
|
- $receipt->update ( array (
|
|
|
- 'where' => 'rid=' . $rid
|
|
|
- ) );
|
|
|
- //print_r($accountJson);
|
|
|
+ $receipt->accountItem = json_encode ( $accountJson );
|
|
|
+ $receipt->sum = number_format ( $sum, 2, '.', '' );
|
|
|
+ $receipt->update ( array (
|
|
|
+ 'where' => 'rid=' . $rid
|
|
|
+ ) );
|
|
|
+ // print_r($accountJson);
|
|
|
// statistics item 统计写入
|
|
|
$dateArray = explode ( "-", $receiptDetailList ['date'] );
|
|
|
$dateCondition = " and Year(date) =" . $dateArray [0] . " and Month(date) = " . $dateArray [1];
|
|
|
|
|
|
- $accountItem = $accountJson ;
|
|
|
+ $accountItem = $accountJson;
|
|
|
|
|
|
$stat = $statistics->getOne ( array (
|
|
|
'where' => 'staff=' . $this->staff [0] ['sid'] . $dateCondition,
|
|
@@ -3297,6 +3342,8 @@ class ReceiptController extends DooController {
|
|
|
$year = $this->get_args ( 'year' ) ? $this->get_args ( 'year' ) : date ( "Y" );
|
|
|
$moth = $this->get_args ( 'moth' ) ? $this->get_args ( 'moth' ) : "";
|
|
|
|
|
|
+ Doo::loadClass ( 'XDeode' );
|
|
|
+ $XDeode = new XDeode ( 7 );
|
|
|
Doo::loadModel ( 'receipt' );
|
|
|
$receipt = new receipt ();
|
|
|
|
|
@@ -3316,6 +3363,8 @@ class ReceiptController extends DooController {
|
|
|
$condition = " and Rtype=0 ";
|
|
|
elseif ($item == "remits")
|
|
|
$condition = " and Rtype=2 ";
|
|
|
+ elseif ($item == "train")
|
|
|
+ $condition = " and Rtype=3 ";
|
|
|
|
|
|
$dateCondition = " and Year(date) =" . $year;
|
|
|
if (! empty ( $moth )) {
|
|
@@ -3520,6 +3569,9 @@ class ReceiptController extends DooController {
|
|
|
'asArray' => true
|
|
|
) );
|
|
|
$receiptList [$key] ['button'] = $button;
|
|
|
+
|
|
|
+ $receiptList [$key] ['ridKey'] =$XDeode->encode( $value ['rid'] );
|
|
|
+
|
|
|
}
|
|
|
|
|
|
// print_r($receiptList);die;
|
|
@@ -3576,7 +3628,7 @@ class ReceiptController extends DooController {
|
|
|
Doo::loadModel ( 'loanReceipt' );
|
|
|
$loanReceipt = new loanReceipt ();
|
|
|
|
|
|
- $receiptList = $receipt->find ( array (
|
|
|
+ $receiptList = $receipt->find ( array (//去掉
|
|
|
'where' => 'staff=' . $this->staff [0] ['sid'] . ' and rid=' . $rid,
|
|
|
'desc' => 'rid',
|
|
|
'asArray' => true
|
|
@@ -3830,7 +3882,7 @@ class ReceiptController extends DooController {
|
|
|
$cid = $this->get_args ( 'cid' ) ? $this->get_args ( 'cid' ) : 0;
|
|
|
$sid = $this->get_args ( 'sid' ) ? $this->get_args ( 'sid' ) : 0;
|
|
|
|
|
|
- // $this->get_args ( 'date' ) ? $this->get_args ( 'date' ) :"";
|
|
|
+ $receiptOrder=$this->get_args ( 'receiptOrder' ) ? $this->get_args ( 'receiptOrder' ) :"";
|
|
|
|
|
|
// echo $rdate;
|
|
|
|
|
@@ -3931,23 +3983,35 @@ class ReceiptController extends DooController {
|
|
|
'previous' => ''
|
|
|
);
|
|
|
|
|
|
- if ($status == 'done' || $status == 'termination' || $status == 'finish') { // $dateCondition .
|
|
|
- $pageinfo = $this->get_page ( "CLD_receipt", $cateCondition . $staffCondition . $approvalCondition . $dateCondition . ' and verify in (' . $vid . ') and status!=5', $page, $page_size, "approvalExpenses/" . $status, $get, "" );
|
|
|
-
|
|
|
- $receiptList = $receipt->find ( array ( // $dateCondition.
|
|
|
- 'where' => 'status!=5 ' . $cateCondition . $staffCondition . $approvalCondition . $dateCondition . ' and verify in (' . $vid . ')',
|
|
|
- 'limit' => $pageinfo ['lower'] . ',' . $page_size,
|
|
|
- 'desc' => 'rid',
|
|
|
- 'asArray' => true
|
|
|
- ) );
|
|
|
- } else {
|
|
|
+ if(!empty($receiptOrder)){
|
|
|
+ $pageinfo = $this->get_page ( "CLD_receipt", ' and receiptOrder like "%' . $receiptOrder . '%"', $page, $page_size, "approvalExpenses/" . $status, $get, "" );
|
|
|
$receiptList = $receipt->find ( array ( // $dateCondition
|
|
|
- 'where' => 'status!=5 ' . $cateCondition . $staffCondition . $approvalCondition . $dateCondition . ' and verify in (' . $vid . ')',
|
|
|
+ 'where' => 'receiptOrder like "%' . $receiptOrder . '%"',
|
|
|
'desc' => 'rid',
|
|
|
- 'asArray' => true
|
|
|
+ 'asArray' => true
|
|
|
) );
|
|
|
- // echo 'status!=5 ' . $cateCondition . $staffCondition . $approvalCondition . ' and verify in (' . $vid . ')';
|
|
|
+ }else{
|
|
|
+ if ($status == 'done' || $status == 'termination' || $status == 'finish') { // $dateCondition .
|
|
|
+ $pageinfo = $this->get_page ( "CLD_receipt", $cateCondition . $staffCondition . $approvalCondition . $dateCondition . ' and verify in (' . $vid . ') and status!=5', $page, $page_size, "approvalExpenses/" . $status, $get, "" );
|
|
|
+
|
|
|
+ $receiptList = $receipt->find ( array ( // $dateCondition.
|
|
|
+ 'where' => 'status!=5 ' . $cateCondition . $staffCondition . $approvalCondition . $dateCondition . ' and verify in (' . $vid . ')',
|
|
|
+ 'limit' => $pageinfo ['lower'] . ',' . $page_size,
|
|
|
+ 'desc' => 'rid',
|
|
|
+ 'asArray' => true
|
|
|
+ ) );
|
|
|
+ } else {
|
|
|
+ $receiptList = $receipt->find ( array ( // $dateCondition
|
|
|
+ 'where' => 'status!=5 ' . $cateCondition . $staffCondition . $approvalCondition . $dateCondition . ' and verify in (' . $vid . ')',
|
|
|
+ 'desc' => 'rid',
|
|
|
+ 'asArray' => true
|
|
|
+ ) );
|
|
|
+ // echo 'status!=5 ' . $cateCondition . $staffCondition . $approvalCondition . ' and verify in (' . $vid . ')';
|
|
|
+ }
|
|
|
}
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
$rLRes = $receipt->find ( array (
|
|
|
'where' => 'status=2 and (nowStaff like "%,' . $this->staff [0] ['sid'] . '%" or nowStaff like "%' . $this->staff [0] ['sid'] . ',%" or nowStaff=' . $this->staff [0] ['sid'] . ' )' . $cateCondition . $staffCondition . ' and verify in (' . $vid . ')',
|
|
|
'desc' => 'rid',
|
|
@@ -3960,14 +4024,12 @@ class ReceiptController extends DooController {
|
|
|
Doo::loadClass ( 'XDeode' );
|
|
|
$XDeode = new XDeode ( 7 );
|
|
|
|
|
|
-
|
|
|
-
|
|
|
$Locate = 0;
|
|
|
|
|
|
$reportList = $reportCateList = array ();
|
|
|
foreach ( $receiptList as $key => $value ) {
|
|
|
|
|
|
- $receiptList [$key] ['ridKey'] = $XDeode->encode( $value['rid'] );
|
|
|
+ $receiptList [$key] ['ridKey'] = $XDeode->encode ( $value ['rid'] );
|
|
|
|
|
|
$receiptList [$key] ['Locate'] = $Locate;
|
|
|
$Locate ++;
|
|
@@ -4091,6 +4153,7 @@ class ReceiptController extends DooController {
|
|
|
|
|
|
// print_r($receiptList);
|
|
|
|
|
|
+ $data['receiptOrder']=$receiptOrder;
|
|
|
$data ['memu'] = "receipt";
|
|
|
$data ['staff'] = $this->staff;
|
|
|
$data ['receiptMemu'] = 'approvalExpenses';
|
|
@@ -5602,7 +5665,13 @@ class ReceiptController extends DooController {
|
|
|
$Locate = 0;
|
|
|
$roleId = 0;
|
|
|
$button = 0;
|
|
|
+ Doo::loadClass ( 'XDeode' );
|
|
|
+ $XDeode = new XDeode ( 5 );
|
|
|
+
|
|
|
foreach ( $receiptList as $key => $value ) {
|
|
|
+
|
|
|
+ $receiptList[$key]['ridKey']=$XDeode->encode ( $value['rid'] );
|
|
|
+
|
|
|
$button2 = 0;
|
|
|
$receiptList [$key] ['Locate'] = $Locate;
|
|
|
$Locate ++;
|
|
@@ -5818,7 +5887,29 @@ class ReceiptController extends DooController {
|
|
|
$receiptList [$key] ['relustCN'] = $this->num_to_rmb ( $relust );
|
|
|
}
|
|
|
|
|
|
- // print_r($receiptList[$key]['executeList']);
|
|
|
+
|
|
|
+ // 是否写入过流水
|
|
|
+ $accountType = 0;
|
|
|
+ if ($receiptList [0] ['Rtype'] == 0) {
|
|
|
+ $accountType = 3;
|
|
|
+ } elseif ($receiptList [0] ['Rtype'] == 1) {
|
|
|
+ if ($receiptList [0] ['Rtype'] == 0) {
|
|
|
+ $accountType = 1;
|
|
|
+ } elseif ($receiptList [0] ['Rtype'] == 1) {
|
|
|
+ $accountType = 2;
|
|
|
+ }
|
|
|
+ } elseif ($receiptList [0] ['Rtype'] == 2) {
|
|
|
+ $accountType = 4;
|
|
|
+ } elseif ($receiptList [0] ['Rtype'] == 3) {
|
|
|
+ $accountType = 12;
|
|
|
+ }
|
|
|
+ Doo::loadModel ( 'wasteBook' );
|
|
|
+ $wasteBook = new wasteBook ();
|
|
|
+ $wbDetail = $wasteBook->getWateBookByAD ( $accountType, $receiptList [0] ['rid'] );
|
|
|
+ $data ['wbDetail'] = $wbDetail;
|
|
|
+
|
|
|
+
|
|
|
+ //print_r($receiptList);
|
|
|
|
|
|
$data ['receiptList'] = $receiptList;
|
|
|
$data ['memu'] = "receipt";
|
|
@@ -5831,29 +5922,28 @@ class ReceiptController extends DooController {
|
|
|
function implementDo() {
|
|
|
$rid = $this->get_args ( 'rid' ) && is_numeric ( $this->get_args ( 'rid' ) ) ? $this->get_args ( 'rid' ) : 0;
|
|
|
$implementOpinions = $this->get_args ( 'opinion' ) ? $this->get_args ( 'opinion' ) : "";
|
|
|
- $amount = $this->get_args ( 'amount' ) && is_numeric ( $this->get_args ( 'amount' ) ) ? $this->get_args ( 'amount' ) : '';
|
|
|
|
|
|
- $accountBank = $this->get_args ( 'accountBank' ) ? $this->get_args ( 'accountBank' ) : "";
|
|
|
+// $amount = $this->get_args ( 'amount' ) && is_numeric ( $this->get_args ( 'amount' ) ) ? $this->get_args ( 'amount' ) : '';
|
|
|
+// $accountBank = $this->get_args ( 'accountBank' ) ? $this->get_args ( 'accountBank' ) : "";
|
|
|
+
|
|
|
+// $ab = '';
|
|
|
+// if ($accountBank == 'CGBDeposit')
|
|
|
+// $ab = '纵横广发';
|
|
|
+// elseif ($accountBank == 'ICBCDeposit')
|
|
|
+// $ab = '纵横工行';
|
|
|
+// elseif ($accountBank == 'HUADeposit')
|
|
|
+// $ab = '华润银行';
|
|
|
+// elseif ($accountBank == 'PersonalDeposit')
|
|
|
+// $ab = '个人广发';
|
|
|
+// if (empty ( $ab ))
|
|
|
+// die ( 'illegal request--22' );
|
|
|
|
|
|
- $ab = '';
|
|
|
- if ($accountBank == 'CGBDeposit')
|
|
|
- $ab = '纵横广发';
|
|
|
- elseif ($accountBank == 'ICBCDeposit')
|
|
|
- $ab = '纵横工行';
|
|
|
- elseif ($accountBank == 'HUADeposit')
|
|
|
- $ab = '华润银行';
|
|
|
- elseif ($accountBank == 'PersonalDeposit')
|
|
|
- $ab = '个人广发';
|
|
|
-
|
|
|
- if (empty ( $ab ))
|
|
|
- die ( 'illegal request' );
|
|
|
-
|
|
|
- if (! empty ( $rid ) && $amount != '') {
|
|
|
+ if (! empty ( $rid )) {
|
|
|
Doo::loadModel ( 'receipt' );
|
|
|
$receipt = new receipt ();
|
|
|
|
|
|
- Doo::loadClass ( 'XDeode' );
|
|
|
- $XDeode = new XDeode ( 5 );
|
|
|
+// Doo::loadClass ( 'XDeode' );
|
|
|
+// $XDeode = new XDeode ( 5 );
|
|
|
|
|
|
// $rinfo = $receipt->getOne ( array (
|
|
|
// 'where' => 'rid=' . $rid,
|
|
@@ -5918,31 +6008,31 @@ class ReceiptController extends DooController {
|
|
|
) );
|
|
|
|
|
|
// 公司流水记录
|
|
|
- Doo::loadModel ( 'wasteBook' );
|
|
|
- $wasteBook = new wasteBook ();
|
|
|
-
|
|
|
- $abDetail = $wasteBook->getAccountBookByAid ( 2, $accountType, $rid );
|
|
|
- // 银行
|
|
|
- if (empty ( $abDetail ) && ! empty ( $amount )) {
|
|
|
- $item = array (
|
|
|
- 'dataID' => $rid,
|
|
|
- 'expensesType' => 2,
|
|
|
- 'accountType' => $accountType,
|
|
|
+// Doo::loadModel ( 'wasteBook' );
|
|
|
+// $wasteBook = new wasteBook ();
|
|
|
+
|
|
|
+// $abDetail = $wasteBook->getAccountBookByAid ( 2, $accountType, $rid );
|
|
|
+// // 银行
|
|
|
+// if (empty ( $abDetail ) && ! empty ( $amount )) {
|
|
|
+// $item = array (
|
|
|
+// 'dataID' => $rid,
|
|
|
+// 'expensesType' => 2,
|
|
|
+// 'accountType' => $accountType,
|
|
|
|
|
|
- 'accountPriceShow' => $amount,
|
|
|
+// 'accountPriceShow' => $amount,
|
|
|
|
|
|
- 'accountPrice' => - $amount,
|
|
|
- 'accountBank' => $accountBank,
|
|
|
- 'category' => $rinfo ['category'] [0] ['title'],
|
|
|
- 'cid' => $rinfo ['category'] [0] ['cid'],
|
|
|
- 'name' => $rinfo ['staffDetail'] ['username'],
|
|
|
- 'sid' => $rinfo ['staffDetail'] ['sid'],
|
|
|
- 'inputDate' => date ( "Y-m-d H:i:s" )
|
|
|
- );
|
|
|
- $wasteBook->setAccountBookStatistics ( $item );
|
|
|
- }
|
|
|
- }
|
|
|
- $ridKey = $XDeode->encode ( $rid );
|
|
|
+// 'accountPrice' => - $amount,
|
|
|
+// 'accountBank' => $accountBank,
|
|
|
+// 'category' => $rinfo ['category'] [0] ['title'],
|
|
|
+// 'cid' => $rinfo ['category'] [0] ['cid'],
|
|
|
+// 'name' => $rinfo ['staffDetail'] ['username'],
|
|
|
+// 'sid' => $rinfo ['staffDetail'] ['sid'],
|
|
|
+// 'inputDate' => date ( "Y-m-d H:i:s" )
|
|
|
+// );
|
|
|
+// $wasteBook->setAccountBookStatistics ( $item );
|
|
|
+// }
|
|
|
+ }
|
|
|
+ //$ridKey = $XDeode->encode ( $rid );
|
|
|
|
|
|
return "/hisImplement";
|
|
|
|
|
@@ -6494,9 +6584,10 @@ class ReceiptController extends DooController {
|
|
|
$sop = $this->get_args ( 'sop' ) ? $this->get_args ( 'sop' ) : 'SOP';
|
|
|
|
|
|
$status = $this->get_args ( 'status' ) ? $this->get_args ( 'status' ) : 'pendImplement';
|
|
|
-
|
|
|
$cidKey = $this->get_args ( 'cidKey' ) ? $this->get_args ( 'cidKey' ) : 'ALL';
|
|
|
|
|
|
+ $receiptOrder=$this->get_args ( 'receiptOrder' ) ? $this->get_args ( 'receiptOrder' ) :"";
|
|
|
+
|
|
|
Doo::loadClass ( 'XDeode' );
|
|
|
$XDeode = new XDeode ( 5 );
|
|
|
Doo::loadModel ( 'receipt' );
|
|
@@ -6511,7 +6602,7 @@ class ReceiptController extends DooController {
|
|
|
$staff = new staff ();
|
|
|
Doo::loadClass ( 'XDeode' );
|
|
|
$XDeode = new XDeode ( 5 );
|
|
|
-
|
|
|
+ $XDeode7 = new XDeode ( 7 );
|
|
|
$cid = $XDeode->decode ( $cidKey );
|
|
|
|
|
|
$condition = "";
|
|
@@ -6522,6 +6613,8 @@ class ReceiptController extends DooController {
|
|
|
$condition = " and Rtype=0 ";
|
|
|
elseif ($item == "remits")
|
|
|
$condition = " and Rtype=2 ";
|
|
|
+ elseif($item == "train")
|
|
|
+ $condition = " and Rtype=3 ";
|
|
|
|
|
|
$statusCon = '(status=8 or status=9 or status=1 or status=6 )';
|
|
|
$sopString = $cidString = "";
|
|
@@ -6548,18 +6641,34 @@ class ReceiptController extends DooController {
|
|
|
if ($cidKey != 'ALL')
|
|
|
$cidString = " and cid=" . $cid;
|
|
|
|
|
|
- $receiptList = $receipt->find ( array (
|
|
|
- 'where' => $statusCon . $condition . $dateCondition . $sopString . $cidString,
|
|
|
- 'desc' => 'rid',
|
|
|
- 'asArray' => true
|
|
|
- ) );
|
|
|
+ if(!empty($receiptOrder)){
|
|
|
+ $receiptList = $receipt->find ( array (
|
|
|
+ 'where' => $statusCon.' and receiptOrder like "%' . $receiptOrder . '%"',
|
|
|
+ 'desc' => 'rid',
|
|
|
+ 'asArray' => true
|
|
|
+ ) );
|
|
|
+
|
|
|
+ // 员工筛选
|
|
|
+ $receiptList2 = $receipt->find ( array (
|
|
|
+ 'where' => $statusCon.' and receiptOrder like "%' . $receiptOrder . '%"',
|
|
|
+ 'desc' => 'rid',
|
|
|
+ 'asArray' => true
|
|
|
+ ) );
|
|
|
+ }else{
|
|
|
+ $receiptList = $receipt->find ( array (
|
|
|
+ 'where' => $statusCon . $condition . $dateCondition . $sopString . $cidString,
|
|
|
+ 'desc' => 'rid',
|
|
|
+ 'asArray' => true
|
|
|
+ ) );
|
|
|
+
|
|
|
+ // 员工筛选
|
|
|
+ $receiptList2 = $receipt->find ( array (
|
|
|
+ 'where' => $statusCon . $condition . $dateCondition,
|
|
|
+ 'desc' => 'rid',
|
|
|
+ 'asArray' => true
|
|
|
+ ) );
|
|
|
+ }
|
|
|
|
|
|
- // 员工筛选
|
|
|
- $receiptList2 = $receipt->find ( array (
|
|
|
- 'where' => $statusCon . $condition . $dateCondition,
|
|
|
- 'desc' => 'rid',
|
|
|
- 'asArray' => true
|
|
|
- ) );
|
|
|
$sopStaff = array ();
|
|
|
foreach ( $receiptList2 as $key => $value ) {
|
|
|
$staffDetail = $staff->getOne ( array (
|
|
@@ -6596,6 +6705,7 @@ class ReceiptController extends DooController {
|
|
|
$staffBatchNumber = 100001;
|
|
|
$remittanceList = array ();
|
|
|
foreach ( $receiptList as $key => $value ) {
|
|
|
+ $receiptList [$key] ['ridKey7'] = $XDeode7->encode ( $value ['rid'] );
|
|
|
$receiptList [$key] ['ridKey'] = $XDeode->encode ( $value ['rid'] );
|
|
|
$receiptList [$key] ['Texe'] = 'false';
|
|
|
if (strstr ( $value ['executeCopy'], '["' . $this->staff [0] ['sid'] . '"' ) != false) {
|
|
@@ -6821,6 +6931,7 @@ class ReceiptController extends DooController {
|
|
|
$data ['item'] = $item;
|
|
|
$data ['year'] = $year;
|
|
|
$data ['moth'] = $moth;
|
|
|
+ $data['receiptOrder']=$receiptOrder;
|
|
|
$data ['day'] = $day;
|
|
|
$data ['sop'] = $sop;
|
|
|
$this->render ( "/admin/hisImplement", $data );
|
|
@@ -7329,6 +7440,7 @@ class ReceiptController extends DooController {
|
|
|
$ot ++;
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
$accountJson ['cSum'] = array (
|
|
|
'agencySum' => number_format ( $agencySum, 2, '.', '' ),
|
|
|
'travelSum' => number_format ( $travelSum, 2, '.', '' ),
|
|
@@ -9377,7 +9489,7 @@ class ReceiptController extends DooController {
|
|
|
}
|
|
|
|
|
|
if (empty ( $receiptDetail ) || $nsflag)
|
|
|
- return "/approval";
|
|
|
+ return "/approvalExpenses/pendApproval";
|
|
|
|
|
|
$verifyDetail = $verify->getOne ( array (
|
|
|
'where' => ' vid =' . $receiptDetail ['verify'],
|
|
@@ -10740,6 +10852,7 @@ class ReceiptController extends DooController {
|
|
|
}
|
|
|
function staffCollect() {
|
|
|
$year = $this->get_args ( 'year' ) ? $this->get_args ( 'year' ) : date ( "Y" );
|
|
|
+ $nature = $this->get_args ( 'nature' ) ? $this->get_args ( 'nature' ) : 'ONJOB';//
|
|
|
|
|
|
$path = SITE_PATH . $this->STAFFCOLLECTPATH . "staffCollect_" . $year . "_.htmls";
|
|
|
// $this->showCache($path);
|
|
@@ -10767,6 +10880,16 @@ class ReceiptController extends DooController {
|
|
|
}
|
|
|
$cidString = implode ( ',', $cidList );
|
|
|
|
|
|
+ $naturecon='';
|
|
|
+ if ($nature=='ONJOB'){
|
|
|
+ $naturecon=' and (nature!=4 )';
|
|
|
+ }elseif($nature=='LEAVEJOB'){
|
|
|
+ $naturecon=' and (nature=4 )';
|
|
|
+ }else{
|
|
|
+ die ( 'illegal request--nature' );
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
// statistics html
|
|
|
$stList = $statistics->statisticsByComPanyYear ( $year, $this->staff [0] ['sid'], $cidString );
|
|
|
if (empty ( $stList ))
|
|
@@ -10782,7 +10905,7 @@ class ReceiptController extends DooController {
|
|
|
|
|
|
// ---
|
|
|
$staffList = $staff->find ( array (
|
|
|
- 'where' => 'username !="admin"',
|
|
|
+ 'where' => 'username !="admin" '.$naturecon,
|
|
|
'asArray' => true
|
|
|
) );
|
|
|
$LcategoryList = $Lcategory->find ( array (
|
|
@@ -10797,7 +10920,7 @@ class ReceiptController extends DooController {
|
|
|
|
|
|
$categoryList = $staff->find ( array (
|
|
|
'select' => 'COUNT(*) as count,cid,category',
|
|
|
- 'where' => 'username !="admin" and cid in (' . $cidString . ')',
|
|
|
+ 'where' => 'username !="admin" and cid in (' . $cidString . ') '.$naturecon,
|
|
|
'groupby' => 'cid',
|
|
|
'asArray' => true
|
|
|
) );
|
|
@@ -10900,6 +11023,7 @@ class ReceiptController extends DooController {
|
|
|
$data ['companyTotalHtml'] = $collectHtml;
|
|
|
$data ['total'] = $total;
|
|
|
|
|
|
+ $data ['nature'] =$nature;
|
|
|
$data ['year'] = $year;
|
|
|
|
|
|
$data ['memu'] = "receipt";
|
|
@@ -12749,18 +12873,6 @@ class ReceiptController extends DooController {
|
|
|
$data ['executeId'] = $this->executeId;
|
|
|
$this->render ( "/expenses/paymentsCollectDay", $data );
|
|
|
}
|
|
|
- function ajaxGetPaymentsByAid() {
|
|
|
- $serial = $this->get_args ( 'serial' ) ? $this->get_args ( 'serial' ) : "";
|
|
|
- Doo::loadModel ( "accountBook" );
|
|
|
- $accountBook = new accountBook ();
|
|
|
-
|
|
|
- $detail = $accountBook->getAccountBookByAid ( $serial );
|
|
|
-
|
|
|
- echo json_encode ( array (
|
|
|
- 'status' => 1,
|
|
|
- 'detail' => $detail
|
|
|
- ) );
|
|
|
- }
|
|
|
|
|
|
// 公司流水
|
|
|
function wasteBook() {
|
|
@@ -13022,6 +13134,18 @@ class ReceiptController extends DooController {
|
|
|
'detail' => $detail
|
|
|
) );
|
|
|
}
|
|
|
+ function ajaxGetPaymentsByAid() {
|
|
|
+ $serial = $this->get_args ( 'serial' ) ? $this->get_args ( 'serial' ) : "";
|
|
|
+ Doo::loadModel ( "accountBook" );
|
|
|
+ $accountBook = new accountBook ();
|
|
|
+
|
|
|
+ $detail = $accountBook->getAccountBookByAid ( $serial );
|
|
|
+
|
|
|
+ echo json_encode ( array (
|
|
|
+ 'status' => 1,
|
|
|
+ 'detail' => $detail
|
|
|
+ ) );
|
|
|
+ }
|
|
|
function ajaxGetWasteInvoice() {
|
|
|
$serial = $this->get_args ( 'serial' ) ? $this->get_args ( 'serial' ) : "";
|
|
|
|
|
@@ -13703,6 +13827,11 @@ class ReceiptController extends DooController {
|
|
|
if (! $month)
|
|
|
$month = isset ( $this->params ['month'] ) ? $this->params ['month'] : 1;
|
|
|
|
|
|
+ $nature = $this->get_args ( 'nature' ) ? $this->get_args ( 'nature' ) : "";
|
|
|
+ if (! $nature){
|
|
|
+ $nature = isset ( $this->params ['nature'] ) ? $this->params ['nature'] : 'ONJOB';
|
|
|
+ }
|
|
|
+
|
|
|
Doo::loadModel ( 'staff' );
|
|
|
$staff = new staff ();
|
|
|
Doo::loadModel ( "receiptDetail" );
|
|
@@ -13724,13 +13853,22 @@ class ReceiptController extends DooController {
|
|
|
}
|
|
|
$cidString = implode ( ',', $cidList );
|
|
|
|
|
|
+ $naturecon='';
|
|
|
+ if ($nature=='ONJOB'){
|
|
|
+ $naturecon=' and (nature!=4 )';
|
|
|
+ }elseif($nature=='LEAVEJOB'){
|
|
|
+ $naturecon=' and (nature=4 )';
|
|
|
+ }else{
|
|
|
+ die ( 'illegal request--nature' );
|
|
|
+ }
|
|
|
+
|
|
|
$staffList = $staff->find ( array (
|
|
|
- 'where' => 'username!="admin" and cid in (' . $cidString . ')',
|
|
|
+ 'where' => 'username!="admin" and cid in (' . $cidString . ')'.$naturecon,
|
|
|
'asArray' => true
|
|
|
) );
|
|
|
$categoryList = $staff->find ( array (
|
|
|
'select' => 'COUNT(*) as count,cid,category',
|
|
|
- 'where' => 'username !="admin" and cid in (' . $cidString . ')',
|
|
|
+ 'where' => 'username !="admin" and cid in (' . $cidString . ')'.$naturecon,
|
|
|
'groupby' => 'cid',
|
|
|
'asArray' => true
|
|
|
) );
|
|
@@ -14138,6 +14276,8 @@ class ReceiptController extends DooController {
|
|
|
$data ['monthHtml'] = $monthHtml;
|
|
|
$data ['year'] = $year;
|
|
|
$data ['month'] = $month;
|
|
|
+ $data ['nature'] = $nature;
|
|
|
+
|
|
|
|
|
|
$data ['memu'] = "receipt";
|
|
|
$data ['staff'] = $this->staff;
|
|
@@ -14613,7 +14753,7 @@ class ReceiptController extends DooController {
|
|
|
// 金额调整和费用查看
|
|
|
$revisePrice += $value ['revisePrice'];
|
|
|
$receiptItemHtml .= '<td class="taR">' . $value ['revisePrice'] . '</td>';
|
|
|
- $receiptItemHtml .= '<td class="taR"><a href="#detail" data-toggle="modal" onclick=showExplanation("' . $value ['explanation'] . '")>查看</a></td>';
|
|
|
+ $receiptItemHtml .= '<td class="taR"><a href="#detail" data-toggle="modal" id="sen'.$key.'" data="' . htmlspecialchars($value ['explanation']) . '" onclick=showExplanation() >查看</a></td>';
|
|
|
$list [$key] ['receiptItemHtml'] = $receiptItemHtml;
|
|
|
}
|
|
|
|
|
@@ -14627,12 +14767,16 @@ class ReceiptController extends DooController {
|
|
|
$count = count ( $itemList [$value] ) + 1;
|
|
|
$itemHtml .= '<th class="taC" colspan="' . $count . '">' . $value . '</th>';
|
|
|
$categoryHtml .= '<th class="taC">合计</th>';
|
|
|
+ $sumfalg=true;
|
|
|
foreach ( $rtl as $rtlValue ) {
|
|
|
if ($rtlValue ['itemCategory'] == $value) {
|
|
|
$receiptTotalHtml .= '<th>' . $rtlValue ['price'] . '</th>';
|
|
|
+ $sumfalg=false;
|
|
|
break;
|
|
|
}
|
|
|
}
|
|
|
+ if ($sumfalg)
|
|
|
+ $receiptTotalHtml .= '<th></th>';
|
|
|
|
|
|
foreach ( $itemList [$value] as $k => $v ) {
|
|
|
$categoryHtml .= '<th class="taC">' . $v ['name'] . '</th>';
|