|
@@ -2086,6 +2086,407 @@ class ReceiptController extends DooController {
|
|
|
|
|
|
$this->render ( "/admin/saeaLoanEdiReceipt", $data );
|
|
|
}
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 培训班结算
|
|
|
+ */
|
|
|
+ function receiptTrainAdd() {
|
|
|
+ Doo::loadModel ( 'accountItem' );
|
|
|
+ $accountItem = new accountItem ();
|
|
|
+
|
|
|
+ $acItem = $accountItem->find ( array (
|
|
|
+ 'asArray' => true
|
|
|
+ ) );
|
|
|
+
|
|
|
+ // 审批组
|
|
|
+ Doo::loadModel ( 'verify' );
|
|
|
+ $verify = new verify ();
|
|
|
+ $veList = $verify->getVerifyByAll ();
|
|
|
+ // 办事处
|
|
|
+ Doo::loadModel ( 'L_category' );
|
|
|
+ $lCategory = new L_category ();
|
|
|
+ $data ['category'] = $lCategory->getCategory ();
|
|
|
+ $data ['veList'] = $veList;
|
|
|
+ $data ['memu'] = "receipt";
|
|
|
+ $data ['staff'] = $this->staff;
|
|
|
+
|
|
|
+ $data ['acItem'] = $acItem;
|
|
|
+
|
|
|
+ $data ['receiptMemu'] = 'saeaBorad';
|
|
|
+ $data ['verifyId'] = $this->verifyId;
|
|
|
+ $data ['executeId'] = $this->executeId;
|
|
|
+
|
|
|
+ $this->render ( "/receipt/receiptTrainAdd", $data );
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 添加培训班结算
|
|
|
+ */
|
|
|
+ function receiptTrainAddDo() {
|
|
|
+ // 培训班信息
|
|
|
+ $trainName = $this->get_args ( 'trainName' ) ? $this->get_args ( 'trainName' ) : "";
|
|
|
+ $trainStartDate = $this->get_args ( 'trainStartDate' ) ? $this->get_args ( 'trainStartDate' ) : "";
|
|
|
+ $trainEndDate = $this->get_args ( 'trainEndDate' ) ? $this->get_args ( 'trainEndDate' ) : "";
|
|
|
+ $participants = $this->get_args ( 'participants' ) && is_numeric ( $this->get_args ( 'participants' ) ) ? $this->get_args ( 'participants' ) : 0;
|
|
|
+ $trainAddress = $this->get_args ( 'trainAddress' ) ? $this->get_args ( 'trainAddress' ) : "";
|
|
|
+ $trainRemarks = $this->get_args ( 'trainRemarks' ) ? $this->get_args ( 'trainRemarks' ) : "";
|
|
|
+ // 发票信息
|
|
|
+ $verify = $this->get_args ( 'verify' ) && is_numeric ( $this->get_args ( 'verify' ) ) ? $this->get_args ( 'verify' ) : 0;
|
|
|
+ $cid = $this->get_args ( 'cid' ) ? $this->get_args ( 'cid' ) : 0;
|
|
|
+ $remittanceName = $this->get_args ( 'remittanceName' ) ? $this->get_args ( 'remittanceName' ) : "";
|
|
|
+ $bankName = $this->get_args ( 'bankName' ) ? $this->get_args ( 'bankName' ) : "";
|
|
|
+ $bankNumber = $this->get_args ( 'bankNumber' ) ? $this->get_args ( 'bankNumber' ) : "";
|
|
|
+ $coupletNumber = $this->get_args ( 'coupletNumber' ) ? $this->get_args ( 'coupletNumber' ) : "";
|
|
|
+ $remittanceBankType = $this->get_args ( 'remittanceBankType' ) && is_numeric ( $this->get_args ( 'remittanceBankType' ) ) ? $this->get_args ( 'remittanceBankType' ) : 0;
|
|
|
+
|
|
|
+ if (! empty ( $verify ) && ! empty ( $cid ) && ! empty ( $remittanceName ) && ! empty ( $bankName ) && ! empty ( $bankNumber ) && ! empty ( $trainName ) && ! empty ( $trainStartDate ) && ! empty ( $trainEndDate ) && ! empty ( $participants ) && ! empty ( $trainAddress )) {
|
|
|
+
|
|
|
+ if ($remittanceBankType == 1 && empty ( $coupletNumber )) {
|
|
|
+ header ( 'Content-Type:text/html;charset=utf-8' );
|
|
|
+ die ( '请填写联行号' );
|
|
|
+ }
|
|
|
+ Doo::loadModel ( 'execute' );
|
|
|
+ $execute = new execute ();
|
|
|
+ $executeDetail = $execute->getOne ( array (
|
|
|
+ 'where' => 'mold="培训班结算"',
|
|
|
+ 'asArray' => true
|
|
|
+ ) );
|
|
|
+ if (empty ( $executeDetail )) {
|
|
|
+ header ( 'Content-Type:text/html;charset=utf-8' );
|
|
|
+ die ( '未设置执行人' );
|
|
|
+ }
|
|
|
+ Doo::loadClass ( 'XDeode' );
|
|
|
+ $XDeode = new XDeode ( 5 );
|
|
|
+ $cid = $XDeode->decode ( $cid );
|
|
|
+
|
|
|
+ Doo::loadModel ( 'receipt' );
|
|
|
+ $receipt = new receipt ();
|
|
|
+ Doo::loadModel ( 'receiptTraining' );
|
|
|
+ $receiptTraining = new receiptTraining ();
|
|
|
+
|
|
|
+ // 创建费用培训班
|
|
|
+ $item = array (
|
|
|
+ 'cid' => $this->staff [0] ['cid'],
|
|
|
+ 'categoryName' => $this->staff [0] ['category'],
|
|
|
+ 'trainName' => $trainName,
|
|
|
+ 'trainStartDate' => $trainStartDate,
|
|
|
+ 'trainEndDate' => $trainEndDate,
|
|
|
+ 'participants' => $participants,
|
|
|
+ 'trainAddress' => $trainAddress,
|
|
|
+ 'trainRemarks' => $trainRemarks,
|
|
|
+ 'creator' => $this->staff [0] ['sid'],
|
|
|
+ 'creatorDate' => date ( "Y-m-d H:i:s" )
|
|
|
+ );
|
|
|
+ $irid = $receiptTraining->addReceiptTraining ( $item );
|
|
|
+
|
|
|
+ // 报销单
|
|
|
+ $receipt->status = 5;
|
|
|
+ $receipt->trainId = $irid;
|
|
|
+ $receipt->Rtype = 3;
|
|
|
+ $receipt->staff = $this->staff [0] ['sid'];
|
|
|
+ $receipt->cid = $cid;
|
|
|
+ $receipt->verify = $verify;
|
|
|
+ $receipt->date = date ( "Y-m-d" );
|
|
|
+
|
|
|
+ $receipt->executeCopy = $executeDetail ['staff'];
|
|
|
+ $receipt->receiptOrder = "#P" . date ( "Ymd" ) . mt_rand ( 1000, 9999 );
|
|
|
+
|
|
|
+ $receipt->remittanceName = $remittanceName;
|
|
|
+ $receipt->bankName = $bankName;
|
|
|
+ $receipt->bankNumber = $bankNumber;
|
|
|
+ $receipt->remittanceBankType = $remittanceBankType;
|
|
|
+ if ($remittanceBankType == 1)
|
|
|
+ $receipt->coupletNumber = $coupletNumber;
|
|
|
+
|
|
|
+ $rid = $receipt->insert ();
|
|
|
+ $XDeode = new XDeode ( 7 );
|
|
|
+ return "/receiptTrainEdi/" . $XDeode->encode ( $rid ) . ".html";
|
|
|
+ } else
|
|
|
+ die ( 'illegal request' );
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 培训班编辑
|
|
|
+ */
|
|
|
+ function receiptTrainEdi() {
|
|
|
+ $ridKey = isset ( $this->params ['rid'] ) ? $this->params ['rid'] : '';
|
|
|
+ $trainEdiType = $this->get_args ( 'trainEdiType' ) ? $this->get_args ( 'trainEdiType' ) : "INFO";
|
|
|
+
|
|
|
+ Doo::loadClass ( 'XDeode' );
|
|
|
+ $XDeode = new XDeode ( 7 );
|
|
|
+ $rid = $XDeode->decode ( $ridKey );
|
|
|
+
|
|
|
+ if (! is_numeric ( $rid ))
|
|
|
+ die ( 'illegal request' );
|
|
|
+
|
|
|
+ Doo::loadModel ( 'receipt' );
|
|
|
+ $receipt = new receipt ();
|
|
|
+ Doo::loadModel ( 'receiptTraining' );
|
|
|
+ $receiptTraining = new receiptTraining ();
|
|
|
+
|
|
|
+ $receiptDetail = $receipt->getReceiptByRid ( $rid );
|
|
|
+ if ($receiptDetail ['status'] != 5)
|
|
|
+ die ();
|
|
|
+
|
|
|
+ $receiptTrainingDetail = $receiptTraining->getReceiptTrainingByRtid ( $receiptDetail ['trainId'] );
|
|
|
+
|
|
|
+ // 审批组
|
|
|
+ Doo::loadModel ( 'verify' );
|
|
|
+ $verify = new verify ();
|
|
|
+ $veList = $verify->getVerifyByAll ();
|
|
|
+
|
|
|
+ // 办事处
|
|
|
+ Doo::loadModel ( 'L_category' );
|
|
|
+ $lCategory = new L_category ();
|
|
|
+ $data ['category'] = $lCategory->getCategory ();
|
|
|
+
|
|
|
+ $data ['receiptTrainingDetail'] = $receiptTrainingDetail;
|
|
|
+ $data ['receiptDetail'] = $receiptDetail;
|
|
|
+ $data ['veList'] = $veList;
|
|
|
+ $data ['trainEdiType'] = $trainEdiType;
|
|
|
+ $data ['ridKey'] = $ridKey;
|
|
|
+
|
|
|
+ $data ['memu'] = "receipt";
|
|
|
+ $data ['staff'] = $this->staff;
|
|
|
+
|
|
|
+ $data ['receiptMemu'] = 'saeaBorad';
|
|
|
+ $data ['verifyId'] = $this->verifyId;
|
|
|
+ $data ['executeId'] = $this->executeId;
|
|
|
+
|
|
|
+ $this->render ( "/receipt/receiptTrainEdi", $data );
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 培训班借款编辑
|
|
|
+ */
|
|
|
+ function receiptTrainLoanEdi() {
|
|
|
+ $ridKey = isset ( $this->params ['rid'] ) ? $this->params ['rid'] : '';
|
|
|
+
|
|
|
+ Doo::loadClass ( 'XDeode' );
|
|
|
+ $XDeode = new XDeode ( 7 );
|
|
|
+ $rid = $XDeode->decode ( $ridKey );
|
|
|
+
|
|
|
+ if (! is_numeric ( $rid ))
|
|
|
+ die ( 'illegal request' );
|
|
|
+
|
|
|
+ Doo::loadModel ( 'receipt' );
|
|
|
+ $receipt = new receipt ();
|
|
|
+ Doo::loadModel ( 'receiptTraining' );
|
|
|
+ $receiptTraining = new receiptTraining ();
|
|
|
+ Doo::loadModel ( 'verify' );
|
|
|
+ $verify = new verify ();
|
|
|
+
|
|
|
+ $receiptDetail = $receipt->getReceiptByRid ( $rid );
|
|
|
+ if ($receiptDetail ['status'] != 5)
|
|
|
+ die ();
|
|
|
+
|
|
|
+ $receiptTrainingDetail = $receiptTraining->getReceiptTrainingByRtid ( $receiptDetail ['trainId'] );
|
|
|
+
|
|
|
+ //借款详情HTML
|
|
|
+ //获得借款信息
|
|
|
+ $receiptLoanDetail = $receipt->getReceiptByRid ( $receiptDetail['trainLoanRid'] );
|
|
|
+ //获得某费用单审批信息
|
|
|
+ $verifylist=$verify->getVerifyByRid($receiptDetail['trainLoanRid']);
|
|
|
+ Doo::loadClass ( 'receipt.func' );
|
|
|
+ $extendHtml='<p><a class="button" href="javascript:if(window.confirm(\'确认移除?\'))window.location=\'/receiptTrainLoanRemoveDo/' . $receiptDetail ['ridKey'] . '/' . $receiptDetail['trainLoanRidKey'] . '.html\'" data-toggle="modal">移除借款</a></p>';
|
|
|
+ $receiptLoanHtml=_getReceiptLoanHtml($receiptLoanDetail,$verifylist,$extendHtml);
|
|
|
+
|
|
|
+ $data ['receiptLoanHtml'] = $receiptLoanHtml;
|
|
|
+ $data ['receiptTrainingDetail'] = $receiptTrainingDetail;
|
|
|
+ $data ['receiptDetail'] = $receiptDetail;
|
|
|
+ $data ['trainEdiType'] = "LOAN";
|
|
|
+ $data ['ridKey'] = $ridKey;
|
|
|
+ $data ['memu'] = "receipt";
|
|
|
+ $data ['staff'] = $this->staff;
|
|
|
+
|
|
|
+ $data ['receiptMemu'] = 'saeaBorad';
|
|
|
+ $data ['verifyId'] = $this->verifyId;
|
|
|
+ $data ['executeId'] = $this->executeId;
|
|
|
+
|
|
|
+ $this->render ( "/receipt/receiptTrainLoanEdi", $data );
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 更新培训班结算基本信息
|
|
|
+ */
|
|
|
+ function receiptTrainInfoEdiDo() {
|
|
|
+ $rid = $this->get_args ( 'rid' ) ? $this->get_args ( 'rid' ) : "";
|
|
|
+ $rtid = $this->get_args ( 'rtid' ) ? $this->get_args ( 'rtid' ) : "";
|
|
|
+
|
|
|
+ // 培训班信息
|
|
|
+ $trainName = $this->get_args ( 'trainName' ) ? $this->get_args ( 'trainName' ) : "";
|
|
|
+ $trainStartDate = $this->get_args ( 'trainStartDate' ) ? $this->get_args ( 'trainStartDate' ) : "";
|
|
|
+ $trainEndDate = $this->get_args ( 'trainEndDate' ) ? $this->get_args ( 'trainEndDate' ) : "";
|
|
|
+ $participants = $this->get_args ( 'participants' ) && is_numeric ( $this->get_args ( 'participants' ) ) ? $this->get_args ( 'participants' ) : 0;
|
|
|
+ $trainAddress = $this->get_args ( 'trainAddress' ) ? $this->get_args ( 'trainAddress' ) : "";
|
|
|
+ $trainRemarks = $this->get_args ( 'trainRemarks' ) ? $this->get_args ( 'trainRemarks' ) : "";
|
|
|
+ // 发票信息
|
|
|
+ $verify = $this->get_args ( 'verify' ) && is_numeric ( $this->get_args ( 'verify' ) ) ? $this->get_args ( 'verify' ) : 0;
|
|
|
+ $cid = $this->get_args ( 'cid' ) ? $this->get_args ( 'cid' ) : 0;
|
|
|
+ $remittanceName = $this->get_args ( 'remittanceName' ) ? $this->get_args ( 'remittanceName' ) : "";
|
|
|
+ $bankName = $this->get_args ( 'bankName' ) ? $this->get_args ( 'bankName' ) : "";
|
|
|
+ $bankNumber = $this->get_args ( 'bankNumber' ) ? $this->get_args ( 'bankNumber' ) : "";
|
|
|
+ $coupletNumber = $this->get_args ( 'coupletNumber' ) ? $this->get_args ( 'coupletNumber' ) : "";
|
|
|
+ $remittanceBankType = $this->get_args ( 'remittanceBankType' ) && is_numeric ( $this->get_args ( 'remittanceBankType' ) ) ? $this->get_args ( 'remittanceBankType' ) : 0;
|
|
|
+
|
|
|
+ if (! empty ( $verify ) && ! empty ( $cid ) && ! empty ( $remittanceName ) && ! empty ( $bankName ) && ! empty ( $bankNumber ) && ! empty ( $trainName ) && ! empty ( $trainStartDate ) && ! empty ( $trainEndDate ) && ! empty ( $participants ) && ! empty ( $trainAddress )) {
|
|
|
+
|
|
|
+ if ($remittanceBankType == 1 && empty ( $coupletNumber )) {
|
|
|
+ header ( 'Content-Type:text/html;charset=utf-8' );
|
|
|
+ die ( '请填写联行号' );
|
|
|
+ }
|
|
|
+
|
|
|
+ Doo::loadClass ( 'XDeode' );
|
|
|
+ $XDeode = new XDeode ( 5 );
|
|
|
+ $cid = $XDeode->decode ( $cid );
|
|
|
+ $rtid = $XDeode->decode ( $rtid );
|
|
|
+ $rid = $XDeode->decode ( $rid );
|
|
|
+
|
|
|
+ if (! is_numeric ( $rtid ) || ! is_numeric ( $rid )) {
|
|
|
+ die ( 'illegal request-IdError' );
|
|
|
+ }
|
|
|
+
|
|
|
+ Doo::loadModel ( 'receipt' );
|
|
|
+ $receipt = new receipt ();
|
|
|
+ Doo::loadModel ( 'receiptTraining' );
|
|
|
+ $receiptTraining = new receiptTraining ();
|
|
|
+
|
|
|
+ // 更新费用培训班
|
|
|
+ $item = array (
|
|
|
+ 'rtid' => $rtid,
|
|
|
+ 'trainName' => $trainName,
|
|
|
+ 'trainStartDate' => $trainStartDate,
|
|
|
+ 'trainEndDate' => $trainEndDate,
|
|
|
+ 'participants' => $participants,
|
|
|
+ 'trainAddress' => $trainAddress,
|
|
|
+ 'trainRemarks' => $trainRemarks
|
|
|
+ );
|
|
|
+ $irid = $receiptTraining->setReceiptTrainByCondition ( $item );
|
|
|
+
|
|
|
+ // 报销单
|
|
|
+ $receipt->rid = $rid;
|
|
|
+ $receipt->cid = $cid;
|
|
|
+ $receipt->verify = $verify;
|
|
|
+
|
|
|
+ $receipt->remittanceName = $remittanceName;
|
|
|
+ $receipt->bankName = $bankName;
|
|
|
+ $receipt->bankNumber = $bankNumber;
|
|
|
+ $receipt->remittanceBankType = $remittanceBankType;
|
|
|
+ if ($remittanceBankType == 1)
|
|
|
+ $receipt->coupletNumber = $coupletNumber;
|
|
|
+
|
|
|
+ $receipt->update ();
|
|
|
+ $XDeode = new XDeode ( 7 );
|
|
|
+ return "/receiptTrainEdi/" . $XDeode->encode ( $rid ) . ".html?trainEdiType=INFO";
|
|
|
+ } else
|
|
|
+ die ( 'illegal request' );
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 编辑培训班结算借款
|
|
|
+ */
|
|
|
+ function receiptTrainLoanEdiDo() {
|
|
|
+ $ridKey = $this->get_args ( 'ridKey' ) ? $this->get_args ( 'ridKey' ) : "";
|
|
|
+ $ridLoanKey = $this->get_args ( 'ridLoanKey' ) ? $this->get_args ( 'ridLoanKey' ) : "";
|
|
|
+ if(!empty($ridKey)&&!empty($ridLoanKey)){
|
|
|
+ Doo::loadModel ( 'receipt' );
|
|
|
+ $receipt = new receipt ();
|
|
|
+ Doo::loadClass ( 'XDeode' );
|
|
|
+ $XDeode = new XDeode ( 5 );
|
|
|
+
|
|
|
+ $rid=$XDeode->decode ( $ridKey );
|
|
|
+ $ridLoan=$XDeode->decode ( $ridLoanKey );
|
|
|
+ if (!is_numeric($rid)||!is_numeric($ridLoan))
|
|
|
+ die ( 'illegal request-ridError' );
|
|
|
+
|
|
|
+ $receiptDetail=$receipt->getReceiptByRid($rid);
|
|
|
+ $receiptLoanDetail=$receipt->getReceiptByRid($ridLoan);
|
|
|
+ //不合法的数据
|
|
|
+ if ($receiptDetail['status']!=3&&$receiptDetail['Rtype']!=3){
|
|
|
+ die ( 'illegal request-receiptError' );
|
|
|
+ }
|
|
|
+ if ($receiptLoanDetail['status']!=8&&$receiptLoanDetail['Rtype']!=1){
|
|
|
+ die ( 'illegal request-receipLoantError' );
|
|
|
+ }
|
|
|
+ //培训班结算挂钩借款
|
|
|
+ $receipt = new receipt ();
|
|
|
+ $item=array(
|
|
|
+ 'rid'=>$rid,
|
|
|
+ 'trainLoanRid'=>$ridLoan,
|
|
|
+ );
|
|
|
+ $receipt->setReceiptByCondition($item);
|
|
|
+ //更新借款状态变成已挂钩
|
|
|
+ $receipt = new receipt ();
|
|
|
+ $item=array(
|
|
|
+ 'rid'=>$ridLoan,
|
|
|
+ 'status'=>10,
|
|
|
+ 'statusTrain'=>1
|
|
|
+ );
|
|
|
+ $receipt->setReceiptByCondition($item);
|
|
|
+
|
|
|
+ $XDeode = new XDeode ( 7 );
|
|
|
+ return "/receiptTrainLoanEdi/" . $XDeode->encode ( $rid ) . ".html";
|
|
|
+ }else
|
|
|
+ die ( 'illegal request' );
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 移除挂钩的费用借款
|
|
|
+ */
|
|
|
+ function receiptTrainLoanRemoveDo(){
|
|
|
+ $ridKey = isset ( $this->params ['ridKey'] ) ? $this->params ['ridKey'] : 0;
|
|
|
+ $ridLoanKey = isset ( $this->params ['ridLoanKey'] ) ? $this->params ['ridLoanKey'] : 0;
|
|
|
+
|
|
|
+ if (!empty($ridKey)||!empty($ridLoanKey)){
|
|
|
+ Doo::loadClass ( 'XDeode' );
|
|
|
+ $XDeode = new XDeode ( 5 );
|
|
|
+
|
|
|
+ $rid=$XDeode->decode ( $ridKey );
|
|
|
+ $ridLoan=$XDeode->decode ( $ridLoanKey );
|
|
|
+ echo $rid;
|
|
|
+ echo $ridLoan;
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 培训班结算挂钩发票
|
|
|
+ */
|
|
|
+ function receiptTrainInvoiceEdi(){
|
|
|
+ $ridKey = isset ( $this->params ['rid'] ) ? $this->params ['rid'] : '';
|
|
|
+
|
|
|
+ Doo::loadClass ( 'XDeode' );
|
|
|
+ $XDeode = new XDeode ( 7 );
|
|
|
+ $rid = $XDeode->decode ( $ridKey );
|
|
|
+
|
|
|
+ if (! is_numeric ( $rid ))
|
|
|
+ die ( 'illegal request' );
|
|
|
+
|
|
|
+ Doo::loadModel ( 'receipt' );
|
|
|
+ $receipt = new receipt ();
|
|
|
+ Doo::loadModel ( 'receiptTraining' );
|
|
|
+ $receiptTraining = new receiptTraining ();
|
|
|
+
|
|
|
+
|
|
|
+ $receiptDetail = $receipt->getReceiptByRid ( $rid );
|
|
|
+ if ($receiptDetail ['status'] != 5)
|
|
|
+ die ();
|
|
|
+
|
|
|
+ $receiptTrainingDetail = $receiptTraining->getReceiptTrainingByRtid ( $receiptDetail ['trainId'] );
|
|
|
+
|
|
|
+ $data ['receiptDetail'] = $receiptDetail;
|
|
|
+ $data ['trainEdiType'] = "INVOICE";
|
|
|
+ $data ['ridKey'] = $ridKey;
|
|
|
+ $data ['memu'] = "receipt";
|
|
|
+ $data ['staff'] = $this->staff;
|
|
|
+
|
|
|
+ $data ['receiptMemu'] = 'saeaBorad';
|
|
|
+ $data ['verifyId'] = $this->verifyId;
|
|
|
+ $data ['executeId'] = $this->executeId;
|
|
|
+
|
|
|
+ $this->render ( "/receipt/receiptTrainInvoiceEdi", $data );
|
|
|
+ }
|
|
|
+
|
|
|
function confirmation() {
|
|
|
$rid = isset ( $this->params ['rid'] ) ? $this->params ['rid'] : 0;
|
|
|
|
|
@@ -2737,7 +3138,7 @@ class ReceiptController extends DooController {
|
|
|
if (empty ( $status ))
|
|
|
$status = $this->get_args ( 'status' ) && is_numeric ( $this->get_args ( 'status' ) ) ? $this->get_args ( 'status' ) : 0;
|
|
|
|
|
|
- $page_size = 12;
|
|
|
+ $page_size = 2;
|
|
|
$page = isset ( $this->params ['page'] ) && is_numeric ( $this->params ['page'] ) ? $this->params ['page'] : 1;
|
|
|
|
|
|
$vidList = array ();
|
|
@@ -2950,9 +3351,9 @@ class ReceiptController extends DooController {
|
|
|
$mothHtml = "";
|
|
|
for($i = 1; $i <= 12; $i ++) {
|
|
|
if ($month == $i)
|
|
|
- $mothHtml .= '<option selected value="' . $i . '">' . $i . '月</option>';
|
|
|
+ $mothHtml .= '<option selected value="0' . $i . '">' . $i . '月</option>';
|
|
|
else
|
|
|
- $mothHtml .= '<option value="' . $i . '">' . $i . '月</option>';
|
|
|
+ $mothHtml .= '<option value="0' . $i . '">' . $i . '月</option>';
|
|
|
}
|
|
|
$data ['mothHtml'] = $mothHtml;
|
|
|
|
|
@@ -2976,6 +3377,7 @@ class ReceiptController extends DooController {
|
|
|
$data ['receiptApprovalCount'] = count ( $rLRes );
|
|
|
$data ['status'] = $status;
|
|
|
$data ['year'] = $year;
|
|
|
+ $data ['month'] = $month;
|
|
|
$data ['categoryList'] = $categoryList;
|
|
|
$data ['staffList'] = $staffList;
|
|
|
$data ['cid'] = $cid;
|
|
@@ -4815,7 +5217,7 @@ class ReceiptController extends DooController {
|
|
|
|
|
|
$abDetail = $wasteBook->getAccountBookByAid ( 2, $accountType, $rid );
|
|
|
// 银行
|
|
|
- if (empty ( $abDetail )&&!empty($amount)) {
|
|
|
+ if (empty ( $abDetail ) && ! empty ( $amount )) {
|
|
|
$item = array (
|
|
|
'dataID' => $rid,
|
|
|
'expensesType' => 2,
|
|
@@ -10137,11 +10539,10 @@ class ReceiptController extends DooController {
|
|
|
* 日常收支
|
|
|
*/
|
|
|
function payments() {
|
|
|
- //include Doo::conf ()->BASE_PATH . 'diagnostic/debug.php';
|
|
|
-
|
|
|
+ // include Doo::conf ()->BASE_PATH . 'diagnostic/debug.php';
|
|
|
Doo::loadModel ( "execute" );
|
|
|
$execute = new execute ();
|
|
|
- if(!$execute->isPaymentsShow($this->staff [0] ['sid'])){
|
|
|
+ if (! $execute->isPaymentsShow ( $this->staff [0] ['sid'] )) {
|
|
|
die ( 'illegal request' );
|
|
|
}
|
|
|
|
|
@@ -10301,13 +10702,12 @@ class ReceiptController extends DooController {
|
|
|
'name' => $this->staff [0] ['username'],
|
|
|
'sid' => $this->staff [0] ['sid'],
|
|
|
'inputDate' => date ( "Y-m-d H:i:s" )
|
|
|
- )
|
|
|
- ;
|
|
|
+ );
|
|
|
$wasteBook->setAccountBookStatistics ( $itemWaste );
|
|
|
- }elseif($accountType == 1){
|
|
|
+ } elseif ($accountType == 1) {
|
|
|
if ($receivedBank == '个人广发')
|
|
|
die ( 'illegal request' );
|
|
|
- // 添加一条收入
|
|
|
+ // 添加一条收入
|
|
|
$accountBook = new accountBook ();
|
|
|
$accountBook->accountType = $accountType;
|
|
|
$accountBook->accountMsg = $accountMsg;
|
|
@@ -10330,30 +10730,31 @@ class ReceiptController extends DooController {
|
|
|
'accountType' => $abDetail ['accountType'],
|
|
|
'accountMsg' => $abDetail ['accountMsg'],
|
|
|
'aid' => $abDetail ['aid'],
|
|
|
- 'expensesType' => $abDetail ['expensesType']
|
|
|
+ 'expensesType' => $abDetail ['expensesType']
|
|
|
);
|
|
|
if ($abDetail ['accountType'] == 8) {
|
|
|
$item += array (
|
|
|
- 'inComePrice' => $abDetail ['receivedPrice']
|
|
|
+ 'inComePrice' => $abDetail ['receivedPrice']
|
|
|
);
|
|
|
} else {
|
|
|
$item += array (
|
|
|
- 'inComePrice' => $abDetail ['receivedPrice']
|
|
|
+ 'inComePrice' => $abDetail ['receivedPrice']
|
|
|
);
|
|
|
}
|
|
|
$accountBookStatistics->setAccountBookStatistics ( $item );
|
|
|
|
|
|
- //流水存储方向
|
|
|
+ // 流水存储方向
|
|
|
$itemWaste = array (
|
|
|
- 'accountType' => 6, // 流水类型
|
|
|
- );
|
|
|
-// if($accountMsg=='银行存款'||$accountMsg=='固定理财收益'){
|
|
|
-
|
|
|
-// }else
|
|
|
- if($accountMsg=='活期理财收益'){
|
|
|
+ 'accountType' => 6
|
|
|
+ ); // 流水类型
|
|
|
+
|
|
|
+ // if($accountMsg=='银行存款'||$accountMsg=='固定理财收益'){
|
|
|
+
|
|
|
+ // }else
|
|
|
+ if ($accountMsg == '活期理财收益') {
|
|
|
$itemWaste = array (
|
|
|
- 'accountType' => 10, // 流水类型
|
|
|
- );
|
|
|
+ 'accountType' => 10
|
|
|
+ ); // 流水类型
|
|
|
}
|
|
|
// 添加收入流水
|
|
|
|
|
@@ -10370,13 +10771,11 @@ class ReceiptController extends DooController {
|
|
|
'cid' => $this->staff [0] ['cid'],
|
|
|
'name' => $this->staff [0] ['username'],
|
|
|
'sid' => $this->staff [0] ['sid'],
|
|
|
- 'inputDate' => date ( "Y-m-d H:i:s" )
|
|
|
+ 'inputDate' => date ( "Y-m-d H:i:s" )
|
|
|
);
|
|
|
$wasteBook->setAccountBookStatistics ( $itemWaste );
|
|
|
-
|
|
|
-
|
|
|
} else { // 普通日常收入处理
|
|
|
- // 添加一条收入
|
|
|
+ // 添加一条收入
|
|
|
$accountBook = new accountBook ();
|
|
|
$accountBook->accountType = $accountType;
|
|
|
$accountBook->accountMsg = $accountMsg;
|
|
@@ -10633,8 +11032,7 @@ class ReceiptController extends DooController {
|
|
|
'name' => $this->staff [0] ['username'],
|
|
|
'sid' => $this->staff [0] ['sid'],
|
|
|
'inputDate' => date ( "Y-m-d H:i:s" )
|
|
|
- )
|
|
|
- ;
|
|
|
+ );
|
|
|
$wasteBook->setAccountBookStatistics ( $itemWaste );
|
|
|
}
|
|
|
}
|
|
@@ -11280,11 +11678,10 @@ class ReceiptController extends DooController {
|
|
|
|
|
|
$abDetail = $accountBook->getAccountBookByAid ( $aid );
|
|
|
|
|
|
- if(empty($abDetail))
|
|
|
+ if (empty ( $abDetail ))
|
|
|
die ( 'illegal request' );
|
|
|
-
|
|
|
-
|
|
|
- // 删除收支
|
|
|
+
|
|
|
+ // 删除收支
|
|
|
Doo::loadModel ( "accountBookStatistics" );
|
|
|
$accountBookStatistics = new accountBookStatistics ();
|
|
|
$item = array (
|
|
@@ -11292,10 +11689,9 @@ class ReceiptController extends DooController {
|
|
|
'aid' => $abDetail ['aid']
|
|
|
);
|
|
|
|
|
|
-
|
|
|
- $accountType='';
|
|
|
+ $accountType = '';
|
|
|
if ($abDetail ['expensesType'] == 1) {
|
|
|
- $accountType=6;
|
|
|
+ $accountType = 6;
|
|
|
|
|
|
if ($abDetail ['accountType'] != 7) {
|
|
|
$item += array (
|
|
@@ -11309,7 +11705,7 @@ class ReceiptController extends DooController {
|
|
|
);
|
|
|
}
|
|
|
} elseif ($abDetail ['expensesType'] == 2) {
|
|
|
- $accountType=5;
|
|
|
+ $accountType = 5;
|
|
|
if ($abDetail ['accountType'] != 7) {
|
|
|
$item += array (
|
|
|
'expensesType' => $abDetail ['expensesType'],
|
|
@@ -11323,22 +11719,21 @@ class ReceiptController extends DooController {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-
|
|
|
- if (($abDetail ['expenditureType'] == 4||$abDetail ['expenditureType'] == 6)&&$abDetail ['expensesType'] == 2) {
|
|
|
- if ($abDetail ['expenditureMsg']=='公司固定')
|
|
|
- $accountType=9;
|
|
|
- elseif($abDetail ['expenditureMsg']=='公司活期')
|
|
|
- $accountType=10;
|
|
|
+ if (($abDetail ['expenditureType'] == 4 || $abDetail ['expenditureType'] == 6) && $abDetail ['expensesType'] == 2) {
|
|
|
+ if ($abDetail ['expenditureMsg'] == '公司固定')
|
|
|
+ $accountType = 9;
|
|
|
+ elseif ($abDetail ['expenditureMsg'] == '公司活期')
|
|
|
+ $accountType = 10;
|
|
|
}
|
|
|
- if (($abDetail ['accountType'] == 7||$abDetail ['accountType'] == 9)&&$abDetail ['expensesType'] == 1) {
|
|
|
- if ($abDetail ['accountMsg']=='公司固定')
|
|
|
- $accountType=9;
|
|
|
- elseif($abDetail ['accountMsg']=='公司活期')
|
|
|
- $accountType=10;
|
|
|
+ if (($abDetail ['accountType'] == 7 || $abDetail ['accountType'] == 9) && $abDetail ['expensesType'] == 1) {
|
|
|
+ if ($abDetail ['accountMsg'] == '公司固定')
|
|
|
+ $accountType = 9;
|
|
|
+ elseif ($abDetail ['accountMsg'] == '公司活期')
|
|
|
+ $accountType = 10;
|
|
|
}
|
|
|
|
|
|
- if($abDetail['accountMsg']=='活期理财收益'){
|
|
|
- $accountType=10;
|
|
|
+ if ($abDetail ['accountMsg'] == '活期理财收益') {
|
|
|
+ $accountType = 10;
|
|
|
}
|
|
|
|
|
|
$accountBookStatistics->setAccountBookStatistics ( $item );
|
|
@@ -11348,23 +11743,22 @@ class ReceiptController extends DooController {
|
|
|
'limit' => 1
|
|
|
) );
|
|
|
|
|
|
- //删除收入流水
|
|
|
- if(!empty($accountType)){
|
|
|
- Doo::loadModel ( 'wasteBook' );
|
|
|
- $wasteBook = new wasteBook ();
|
|
|
- $wasteBook->delete ( array (
|
|
|
- 'where' => 'dataID=' . $aid . ' and accountType='.$accountType,
|
|
|
- 'limit' => 1
|
|
|
- ) );
|
|
|
+ // 删除收入流水
|
|
|
+ if (! empty ( $accountType )) {
|
|
|
+ Doo::loadModel ( 'wasteBook' );
|
|
|
+ $wasteBook = new wasteBook ();
|
|
|
+ $wasteBook->delete ( array (
|
|
|
+ 'where' => 'dataID=' . $aid . ' and accountType=' . $accountType,
|
|
|
+ 'limit' => 1
|
|
|
+ ) );
|
|
|
}
|
|
|
}
|
|
|
return '/paymentsAchieve';
|
|
|
}
|
|
|
function paymentsCollect() {
|
|
|
-
|
|
|
Doo::loadModel ( "execute" );
|
|
|
$execute = new execute ();
|
|
|
- if(!$execute->isPaymentsShow($this->staff [0] ['sid'])){
|
|
|
+ if (! $execute->isPaymentsShow ( $this->staff [0] ['sid'] )) {
|
|
|
die ( 'illegal request' );
|
|
|
}
|
|
|
|
|
@@ -11666,7 +12060,7 @@ class ReceiptController extends DooController {
|
|
|
function wasteBook() {
|
|
|
Doo::loadModel ( "execute" );
|
|
|
$execute = new execute ();
|
|
|
- if(!$execute->isPaymentsShow($this->staff [0] ['sid'])){
|
|
|
+ if (! $execute->isPaymentsShow ( $this->staff [0] ['sid'] )) {
|
|
|
die ( 'illegal request' );
|
|
|
}
|
|
|
|
|
@@ -11750,16 +12144,16 @@ class ReceiptController extends DooController {
|
|
|
Doo::loadClass ( 'XDeode' );
|
|
|
$XDeode = new XDeode ( 5 );
|
|
|
|
|
|
-// echo $XDeode->encode(1).'<br>';
|
|
|
-// echo $XDeode->encode(2).'<br>';
|
|
|
-// echo $XDeode->encode(3).'<br>';
|
|
|
-// echo $XDeode->encode(4).'<br>';
|
|
|
-// echo $XDeode->encode(5).'<br>';
|
|
|
-// echo $XDeode->encode(6).'<br>';
|
|
|
-// echo $XDeode->encode(7).'<br>';
|
|
|
-// echo $XDeode->encode(8).'<br>';
|
|
|
-// echo $XDeode->encode(9).'<br>';
|
|
|
-// echo $XDeode->encode(10).'<br>';
|
|
|
+ // echo $XDeode->encode(1).'<br>';
|
|
|
+ // echo $XDeode->encode(2).'<br>';
|
|
|
+ // echo $XDeode->encode(3).'<br>';
|
|
|
+ // echo $XDeode->encode(4).'<br>';
|
|
|
+ // echo $XDeode->encode(5).'<br>';
|
|
|
+ // echo $XDeode->encode(6).'<br>';
|
|
|
+ // echo $XDeode->encode(7).'<br>';
|
|
|
+ // echo $XDeode->encode(8).'<br>';
|
|
|
+ // echo $XDeode->encode(9).'<br>';
|
|
|
+ // echo $XDeode->encode(10).'<br>';
|
|
|
|
|
|
$dateArr = explode ( ':', $date );
|
|
|
$D1 = '';
|
|
@@ -11784,11 +12178,10 @@ class ReceiptController extends DooController {
|
|
|
$con .= ' and (accountType = 7 or accountType = 8)';
|
|
|
} elseif ($accountType == 'PAYMENTS') {
|
|
|
$con .= ' and (accountType = 6 or accountType = 9 or accountType = 10)';
|
|
|
- if($dailyIncomeType!='ALL'){
|
|
|
+ if ($dailyIncomeType != 'ALL') {
|
|
|
$dailyIncomeType = $XDeode->decode ( $dailyIncomeType );
|
|
|
- $con .= ' and dailyIncomeType = '.$dailyIncomeType;
|
|
|
+ $con .= ' and dailyIncomeType = ' . $dailyIncomeType;
|
|
|
}
|
|
|
-
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -11798,7 +12191,7 @@ class ReceiptController extends DooController {
|
|
|
foreach ( $incomeList as $key => $value ) {
|
|
|
$sum += $value ['accountPrice'];
|
|
|
}
|
|
|
- //print_r($incomeList);
|
|
|
+ // print_r($incomeList);
|
|
|
|
|
|
// 获得办事和部门
|
|
|
$categoryList = $L_category->getCategory ();
|
|
@@ -11861,23 +12254,22 @@ class ReceiptController extends DooController {
|
|
|
$con .= ' and accountType = 11';
|
|
|
} elseif ($accountType == 'PAYMENTS') {
|
|
|
$con .= ' and (accountType = 5 or accountType = 9 or accountType = 10)';
|
|
|
- if($dailyExpenditureType!='ALL'){
|
|
|
+ if ($dailyExpenditureType != 'ALL') {
|
|
|
$dailyExpenditureType = $XDeode->decode ( $dailyExpenditureType );
|
|
|
- $con .= ' and dailyExpenditureType = '.$dailyExpenditureType;
|
|
|
+ $con .= ' and dailyExpenditureType = ' . $dailyExpenditureType;
|
|
|
}
|
|
|
- }elseif($accountType == 'RECEIPT'){
|
|
|
- if ($receiptType=='ALL'){
|
|
|
- $con .= ' and (accountType = 1 or accountType = 2 or accountType = 3 or accountType = 4)';
|
|
|
- }else{
|
|
|
+ } elseif ($accountType == 'RECEIPT') {
|
|
|
+ if ($receiptType == 'ALL') {
|
|
|
+ $con .= ' and (accountType = 1 or accountType = 2 or accountType = 3 or accountType = 4)';
|
|
|
+ } else {
|
|
|
$receiptType = $XDeode->decode ( $receiptType );
|
|
|
echo $receiptType;
|
|
|
- if ($receiptType==1){
|
|
|
+ if ($receiptType == 1) {
|
|
|
$con .= ' and (accountType = 1 or accountType=2)';
|
|
|
- }else{
|
|
|
- $con .= ' and accountType = '.$receiptType;
|
|
|
+ } else {
|
|
|
+ $con .= ' and accountType = ' . $receiptType;
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -12493,8 +12885,7 @@ class ReceiptController extends DooController {
|
|
|
'CGBDeposit' => 0,
|
|
|
'ICBCDeposit' => 0
|
|
|
)
|
|
|
- )
|
|
|
- ;
|
|
|
+ );
|
|
|
|
|
|
// 存款
|
|
|
foreach ( $waste ['bank'] as $key => $value ) {
|