|
@@ -159,7 +159,8 @@ class ReceiptController extends DooController {
|
|
$eidList = array_filter ( explode ( ",", $eidList ) );
|
|
$eidList = array_filter ( explode ( ",", $eidList ) );
|
|
|
|
|
|
$this->executeId = array_merge ( $list2, $eidList );
|
|
$this->executeId = array_merge ( $list2, $eidList );
|
|
- //print_r($this->executeId);
|
|
|
|
|
|
+
|
|
|
|
+
|
|
$this->verifyId = $list;
|
|
$this->verifyId = $list;
|
|
$this->staff = $staff->getUserByIdList ( $_COOKIE ["staff"] );
|
|
$this->staff = $staff->getUserByIdList ( $_COOKIE ["staff"] );
|
|
|
|
|
|
@@ -211,7 +212,7 @@ class ReceiptController extends DooController {
|
|
$receiptLogList = $receiptLog->getReceiptLogByUid ( $this->staff [0] ['sid'] );
|
|
$receiptLogList = $receiptLog->getReceiptLogByUid ( $this->staff [0] ['sid'] );
|
|
|
|
|
|
$receiptDetail = $receipt->find ( array (
|
|
$receiptDetail = $receipt->find ( array (
|
|
- 'where' => 'staff=' . $this->staff [0] ['sid'] . ' and (status=7 or status=5 or status=4 or status=8 and Rtype=1)',
|
|
|
|
|
|
+ 'where' => 'staff=' . $this->staff [0] ['sid'] . ' and (status=7 or status=5 or status=4 or status=8 and Rtype=1)',
|
|
'desc' => 'rid',
|
|
'desc' => 'rid',
|
|
'asArray' => true
|
|
'asArray' => true
|
|
) );
|
|
) );
|
|
@@ -249,6 +250,7 @@ class ReceiptController extends DooController {
|
|
}
|
|
}
|
|
// print_r($receiptLogList);
|
|
// print_r($receiptLogList);
|
|
|
|
|
|
|
|
+ // 协助修改TODO,只显示未完成的
|
|
Doo::loadModel ( 'RAssist' );
|
|
Doo::loadModel ( 'RAssist' );
|
|
$RAssist = new RAssist ();
|
|
$RAssist = new RAssist ();
|
|
$receiptExtendList=$RAssist->getRAssistBySid($this->staff[0]['sid']);
|
|
$receiptExtendList=$RAssist->getRAssistBySid($this->staff[0]['sid']);
|
|
@@ -5385,6 +5387,13 @@ class ReceiptController extends DooController {
|
|
$trainRD=$receipt->getReceiptByTrainLoanRid($value['rid']);
|
|
$trainRD=$receipt->getReceiptByTrainLoanRid($value['rid']);
|
|
$receiptList [$key]['trainRidKey7']=$trainRD['ridKey7'];
|
|
$receiptList [$key]['trainRidKey7']=$trainRD['ridKey7'];
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ if($value['version']==1){
|
|
|
|
+
|
|
|
|
+ $receiptList[$key]['version_1_explanation']=$this->getReceiptVerson1Explanation($value);
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+
|
|
}
|
|
}
|
|
|
|
|
|
$reportList = array_unique ( $reportList );
|
|
$reportList = array_unique ( $reportList );
|
|
@@ -7243,10 +7252,19 @@ class ReceiptController extends DooController {
|
|
if ($receiptList [0] ['Rtype'] == 0) {
|
|
if ($receiptList [0] ['Rtype'] == 0) {
|
|
$accountType = 3;
|
|
$accountType = 3;
|
|
} elseif ($receiptList [0] ['Rtype'] == 1) {
|
|
} elseif ($receiptList [0] ['Rtype'] == 1) {
|
|
- if (!empty($receiptList [0]['accountItem']) )
|
|
|
|
|
|
+ if($receiptList [0]['version']==1){
|
|
|
|
+ $accountType = 2;
|
|
|
|
+ }else{
|
|
|
|
+
|
|
|
|
+ if (!empty($receiptList [0]['accountItem']) ){
|
|
|
|
+// if (!empty($receiptList [0]['loanRid']) ){
|
|
$accountType = 2;
|
|
$accountType = 2;
|
|
- else
|
|
|
|
|
|
+ }else{
|
|
$accountType = 1;
|
|
$accountType = 1;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
} elseif ($receiptList [0] ['Rtype'] == 2) {
|
|
} elseif ($receiptList [0] ['Rtype'] == 2) {
|
|
$accountType = 4;
|
|
$accountType = 4;
|
|
} elseif ($receiptList [0] ['Rtype'] == 3) {
|
|
} elseif ($receiptList [0] ['Rtype'] == 3) {
|
|
@@ -7258,8 +7276,11 @@ class ReceiptController extends DooController {
|
|
$data ['wbDetail'] = $wbDetail;
|
|
$data ['wbDetail'] = $wbDetail;
|
|
|
|
|
|
$wbDetailLoan=array();
|
|
$wbDetailLoan=array();
|
|
|
|
+
|
|
if ($accountType==2){
|
|
if ($accountType==2){
|
|
$wbDetailLoan = $wasteBook->getWateBookByAD ( 1, $receiptList [0] ['rid'] );
|
|
$wbDetailLoan = $wasteBook->getWateBookByAD ( 1, $receiptList [0] ['rid'] );
|
|
|
|
+
|
|
|
|
+
|
|
}
|
|
}
|
|
$data ['wbDetailLoan'] = $wbDetailLoan;
|
|
$data ['wbDetailLoan'] = $wbDetailLoan;
|
|
|
|
|
|
@@ -8390,6 +8411,13 @@ class ReceiptController extends DooController {
|
|
array_push ( $remittanceList, $remittanceDetail );
|
|
array_push ( $remittanceList, $remittanceDetail );
|
|
$staffBatchNumber ++;
|
|
$staffBatchNumber ++;
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ if($value['version']==1){
|
|
|
|
+ $receiptList[$key]['version_1_explanation']=$this->getReceiptVerson1Explanation($value);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
}
|
|
}
|
|
|
|
|
|
$data ['remittanceList'] = json_encode ( $remittanceList );
|
|
$data ['remittanceList'] = json_encode ( $remittanceList );
|
|
@@ -8823,8 +8851,26 @@ class ReceiptController extends DooController {
|
|
'where' => 'staff=' . $this->staff [0] ['sid'] . ' and rid=' . $rid . ' and (status=4 or status=5 or status=7)',
|
|
'where' => 'staff=' . $this->staff [0] ['sid'] . ' and rid=' . $rid . ' and (status=4 or status=5 or status=7)',
|
|
'asArray' => true
|
|
'asArray' => true
|
|
) );
|
|
) );
|
|
- if (empty ( $receiptDetailList ))
|
|
|
|
|
|
+ if (empty ( $receiptDetailList )){
|
|
return "/saeaBorad";
|
|
return "/saeaBorad";
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ // 如果是新报销单,有差旅的情况下写入日期
|
|
|
|
+ if($receiptDetailList['version']==1){
|
|
|
|
+ if(!empty($receiptDetailList['traveJson'])){
|
|
|
|
+ $traveJson=json_decode($receiptDetailList['traveJson'],true)['traveList'];
|
|
|
|
+ foreach ($traveJson as $key=>$value){
|
|
|
|
+ Doo::loadModel ( 'cld/traveDate_cld' );
|
|
|
|
+ $traveDate = new traveDate_cld ();
|
|
|
|
+ $traveDate->sid=$this->staff [0] ['sid'];
|
|
|
|
+ $traveDate->rid=$receiptDetailList['rid'];
|
|
|
|
+ $tripTime = explode(" - ", $value['tripTime']);
|
|
|
|
+ $traveDate->start=$tripTime[0];
|
|
|
|
+ $traveDate->end=$tripTime[1];
|
|
|
|
+ $traveDate->insert ();
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
|
|
$verifyDetail = $verify->getOne ( array (
|
|
$verifyDetail = $verify->getOne ( array (
|
|
'where' => ' vid =' . $receiptDetailList ['verify'],
|
|
'where' => ' vid =' . $receiptDetailList ['verify'],
|
|
@@ -14458,13 +14504,146 @@ class ReceiptController extends DooController {
|
|
$detail ['verifyList'] = $verifyList;
|
|
$detail ['verifyList'] = $verifyList;
|
|
return $detail;
|
|
return $detail;
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ //获得新版报销单费用说明
|
|
|
|
+ private function getReceiptVerson1Explanation($value){
|
|
|
|
+ if($value['version']==1){
|
|
|
|
+
|
|
|
|
+ $version_1_explanation="";
|
|
|
|
+ if(!empty($value['officeJson'])){
|
|
|
|
+ $officeJson=json_decode($value['officeJson'],true);
|
|
|
|
+ $version_1_explanation.=$officeJson['officeExplain'][0]['officeExplain']."\n";
|
|
|
|
+ }
|
|
|
|
+ if(!empty($value['traveJson'])){
|
|
|
|
+ $traveJson=json_decode($value['traveJson'],true);
|
|
|
|
+ $version_1_explanation.=$traveJson['traveExplain'][0]['traveExplain']."\n";
|
|
|
|
+ }
|
|
|
|
+ if(!empty($value['trainJson'])){
|
|
|
|
+ $trainJson=json_decode($value['trainJson'],true);
|
|
|
|
+ $version_1_explanation.=$trainJson['trainExplain'][0]['trainExplain']."\n";
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ return $version_1_explanation;
|
|
|
|
+ }
|
|
|
|
+ //获得新版报销单 详情HTML
|
|
|
|
+ private function getReceiptVerson1Html($detail){
|
|
|
|
+ $html='<table class="table table-bordered table-condensed">
|
|
|
|
+ <tbody>';
|
|
|
|
+ if($detail['version']==1){
|
|
|
|
+
|
|
|
|
+ if(!empty($detail['officeJson'])){
|
|
|
|
+ $officeJson=json_decode($detail['officeJson'],true);
|
|
|
|
+ $html .= '
|
|
|
|
+ <tr>
|
|
|
|
+ <th colspan="2" class="taC">日常相关费用</th>
|
|
|
|
+ </tr>';
|
|
|
|
+ // 日常相关费用
|
|
|
|
+ $total=0;
|
|
|
|
+ foreach ( $officeJson['daily'] as $key => $value ) {
|
|
|
|
+ if(!empty($value['price'])){
|
|
|
|
+ $html .= '
|
|
|
|
+ <tr>
|
|
|
|
+ <th>' . $value ['name'] . '</th>
|
|
|
|
+ <td width="140" class="taR">¥' . $value ['price'] . '</td>
|
|
|
|
+ </tr>';
|
|
|
|
+ $total=bcadd($total,$value ['price'],2);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ $html .= '
|
|
|
|
+ <tr>
|
|
|
|
+ <th class="taR">合计</th>
|
|
|
|
+ <td class="colGreen taR">¥' .$total . '</td>
|
|
|
|
+ </tr>';
|
|
|
|
+ // 其他
|
|
|
|
+ $html .= '<tr>
|
|
|
|
+ <th colspan="2" class="taC">其他</th>
|
|
|
|
+ </tr>';
|
|
|
|
+ $total=0;
|
|
|
|
+ foreach ( $officeJson['other'] as $key => $value ) {
|
|
|
|
+ if(!empty($value['price'])){
|
|
|
|
+ $html .= '
|
|
|
|
+ <tr>
|
|
|
|
+ <th>' . $value ['name'] . '</th>
|
|
|
|
+ <td width="140" class="taR">¥' . $value ['price'] . '</td>
|
|
|
|
+ </tr>';
|
|
|
|
+ $total=bcadd($total,$value ['price'],2);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ $html .= '
|
|
|
|
+ <tr>
|
|
|
|
+ <th class="taR">合计</th>
|
|
|
|
+ <td class="colGreen taR">¥' . $total . '</td>
|
|
|
|
+ </tr>';
|
|
|
|
+ }
|
|
|
|
+ if(!empty($detail['traveJson'])){
|
|
|
|
+ $traveJson=json_decode($detail['traveJson'],true);
|
|
|
|
+ // 差旅
|
|
|
|
+ $html .= '<tr>
|
|
|
|
+ <th colspan="2" class="taC">差旅相关费用</th>
|
|
|
|
+ </tr>';
|
|
|
|
+ $total=0;
|
|
|
|
+ foreach ( $traveJson['trave'] as $key => $value ) {
|
|
|
|
+ if(!empty($value['price'])){
|
|
|
|
+ $html .= '
|
|
|
|
+ <tr>
|
|
|
|
+ <th>' . $value ['name'] . '</th>
|
|
|
|
+ <td width="140" class="taR">¥' . $value ['price'] . '</td>
|
|
|
|
+ </tr>';
|
|
|
|
+ $total=bcadd($total,$value ['price'],2);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ $html .= '
|
|
|
|
+ <tr>
|
|
|
|
+ <th class="taR">合计</th>
|
|
|
|
+ <td class="colGreen taR">¥' . $total . '</td>
|
|
|
|
+ </tr>';
|
|
|
|
+ }
|
|
|
|
+ if(!empty($detail['trainJson'])){
|
|
|
|
+ $trainJson=json_decode($detail['trainJson'],true);
|
|
|
|
+ // 内部培训费用
|
|
|
|
+ $html .= '<tr>
|
|
|
|
+ <th colspan="2" class="taC">内部培训费用</th>
|
|
|
|
+ </tr>';
|
|
|
|
+ $total=0;
|
|
|
|
+ foreach ( $trainJson['train'] as $key => $value ) {
|
|
|
|
+ if(!empty($value['price'])){
|
|
|
|
+ $html .= '
|
|
|
|
+ <tr>
|
|
|
|
+ <th>' . $value ['name'] . '</th>
|
|
|
|
+ <td width="140" class="taR">¥' . $value ['price'] . '</td>
|
|
|
|
+ </tr>';
|
|
|
|
+ $total=bcadd($total,$value ['price'],2);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ $html .= '
|
|
|
|
+ <tr>
|
|
|
|
+ <th class="taR">合计</th>
|
|
|
|
+ <td class="colGreen taR">¥' . $total . '</td>
|
|
|
|
+ </tr>';
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+ return $html;
|
|
|
|
+ }
|
|
|
|
+
|
|
function getWasteReceiptHtml($detail = array(),$accountType=1) {
|
|
function getWasteReceiptHtml($detail = array(),$accountType=1) {
|
|
if (empty ( $detail ))
|
|
if (empty ( $detail ))
|
|
return '';
|
|
return '';
|
|
|
|
|
|
$html = '';
|
|
$html = '';
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+// die;
|
|
if ($detail ['Rtype'] == 0) { // 报销单
|
|
if ($detail ['Rtype'] == 0) { // 报销单
|
|
|
|
|
|
|
|
+ if($detail ['version']==1){
|
|
|
|
+ $html .= $this->getReceiptVerson1Html($detail);
|
|
|
|
+ }else{
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
$html .= '<table class="table table-bordered table-condensed">
|
|
$html .= '<table class="table table-bordered table-condensed">
|
|
<tbody>
|
|
<tbody>
|
|
<tr>
|
|
<tr>
|
|
@@ -14536,6 +14715,9 @@ class ReceiptController extends DooController {
|
|
<td class="colGreen taR">¥' . $detail ['accountItem'] ['cSum'] ['otherSum'] . '</td>
|
|
<td class="colGreen taR">¥' . $detail ['accountItem'] ['cSum'] ['otherSum'] . '</td>
|
|
</tr>';
|
|
</tr>';
|
|
|
|
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
$html .= '<tr>
|
|
$html .= '<tr>
|
|
<th colspan="2" class="taC">报销金额调整</th>
|
|
<th colspan="2" class="taC">报销金额调整</th>
|
|
</tr>';
|
|
</tr>';
|
|
@@ -14646,6 +14828,12 @@ class ReceiptController extends DooController {
|
|
|
|
|
|
$balance=$detail ['sum']-$loanList ['sum'];
|
|
$balance=$detail ['sum']-$loanList ['sum'];
|
|
$balanceCN=$this->num_to_rmb($balance);
|
|
$balanceCN=$this->num_to_rmb($balance);
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ if($detail ['version']==1){
|
|
|
|
+ $html .= $this->getReceiptVerson1Html($detail);
|
|
|
|
+ }else{
|
|
|
|
+
|
|
$html .= '<table class="table table-bordered table-condensed">
|
|
$html .= '<table class="table table-bordered table-condensed">
|
|
<tbody>
|
|
<tbody>
|
|
<tr>
|
|
<tr>
|
|
@@ -14717,6 +14905,9 @@ class ReceiptController extends DooController {
|
|
<td class="colGreen taR">¥' . $detail ['accountItem'] ['cSum'] ['otherSum'] . '</td>
|
|
<td class="colGreen taR">¥' . $detail ['accountItem'] ['cSum'] ['otherSum'] . '</td>
|
|
</tr>';
|
|
</tr>';
|
|
|
|
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
$html .= '<tr>
|
|
$html .= '<tr>
|
|
<th colspan="2" class="taC">报销金额调整</th>
|
|
<th colspan="2" class="taC">报销金额调整</th>
|
|
</tr>';
|
|
</tr>';
|