|
@@ -13,8 +13,7 @@ class InvoiceController extends DooController {
|
|
|
public $data;
|
|
|
private $INVOICEKEY = "APPROVAL";
|
|
|
private $INVOICECOLLECTPATH = "protected/cache/invoiceCollect/";
|
|
|
- private $ACTION='';
|
|
|
-
|
|
|
+ private $ACTION = '';
|
|
|
public function beforeRun($resource, $action) {
|
|
|
Doo::loadModel ( "invoiceManage" );
|
|
|
$invoiceManage = new invoiceManage ();
|
|
@@ -56,8 +55,8 @@ class InvoiceController extends DooController {
|
|
|
Doo::loadModel ( 'staff' );
|
|
|
$staff = new staff ();
|
|
|
|
|
|
- $uriPartsOrig = explode('/', $_SERVER['REQUEST_URI']);
|
|
|
- $this->ACTION=$uriPartsOrig[1];
|
|
|
+ $uriPartsOrig = explode ( '/', $_SERVER ['REQUEST_URI'] );
|
|
|
+ $this->ACTION = $uriPartsOrig [1];
|
|
|
|
|
|
$this->data ['new'] = $this->isInvoiceNew ();
|
|
|
$this->staff = $staff->getUserByIdList ( $_COOKIE ["staff"] );
|
|
@@ -911,6 +910,34 @@ class InvoiceController extends DooController {
|
|
|
$invoice->setInvoiceByCondition ( $item );
|
|
|
return '/invoicePost';
|
|
|
}
|
|
|
+ function invoiceExpressUpdateDo() {
|
|
|
+ Doo::loadModel ( 'invoice' );
|
|
|
+ $invoice = new invoice ();
|
|
|
+
|
|
|
+ $action = $this->get_args ( 'action' ) ? $this->get_args ( 'action' ) : "";
|
|
|
+
|
|
|
+ $iid = $this->get_args ( 'iidKey' ) ? $this->get_args ( 'iidKey' ) : "";
|
|
|
+ $expressCompany = $this->get_args ( 'express' ) ? $this->get_args ( 'express' ) : "";
|
|
|
+ $expressNumber = $this->get_args ( 'nu' ) ? $this->get_args ( 'nu' ) : "";
|
|
|
+ $actualItems = $this->get_args ( 'actualItems' ) ? $this->get_args ( 'actualItems' ) : "";
|
|
|
+ $iid = $invoice->authcode ( $iid );
|
|
|
+ if (! is_numeric ( $iid ) && empty ( $expressCompany ) && empty ( $expressNumber ) && empty ( $actualItems ))
|
|
|
+ die ( 'illegal request' );
|
|
|
+
|
|
|
+ $item = array (
|
|
|
+ 'iid' => $iid,
|
|
|
+ 'updateTime' => date ( "Y-m-d H:i:s" ),
|
|
|
+
|
|
|
+ 'expressCompany' => $expressCompany,
|
|
|
+ 'expressNumber' => $expressNumber,
|
|
|
+ 'actualItems' => $actualItems,
|
|
|
+ 'poster' => $this->staff [0] ['username']
|
|
|
+ );
|
|
|
+
|
|
|
+ $invoice->setInvoiceByCondition ( $item );
|
|
|
+ return $action;
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* 退票处理页面
|
|
|
*/
|
|
@@ -1883,7 +1910,6 @@ class InvoiceController extends DooController {
|
|
|
Doo::loadModel ( 'invoice' );
|
|
|
$invoice = new invoice ();
|
|
|
|
|
|
-
|
|
|
$MebSea = isset ( $this->params ['MebSea'] ) ? urldecode ( $this->params ['MebSea'] ) : '';
|
|
|
|
|
|
$page_size = 2;
|
|
@@ -1907,13 +1933,13 @@ class InvoiceController extends DooController {
|
|
|
$pageinfo ['page'] = array (
|
|
|
'previous' => ''
|
|
|
);
|
|
|
- $sql = '(status=1 or status=3 or status=4) and processApprovals!=""'. $con;
|
|
|
+ $sql = '(status=1 or status=3 or status=4) and processApprovals!=""' . $con;
|
|
|
$pageinfo = $this->get_page ( "CLD_invoice", $sql, $page, $page_size, "invoiceApprovalAchieve", $get, "" );
|
|
|
|
|
|
$limit = $pageinfo ['lower'] . ',' . $page_size;
|
|
|
|
|
|
$list = $invoice->getInvoiceByUntreadStatusPage ( $limit, $sql );
|
|
|
- //print_r($list);
|
|
|
+ // print_r($list);
|
|
|
$this->data ['MebSeaEn'] = $MebSea;
|
|
|
$this->data ['MebSea'] = urlencode ( $MebSea );
|
|
|
$this->data ['get'] = $get;
|
|
@@ -1926,7 +1952,6 @@ class InvoiceController extends DooController {
|
|
|
$this->data ['receiptMemu'] = 'invoiceApproval';
|
|
|
$this->render ( "/admin/invoiceApprovalAchieve", $this->data );
|
|
|
}
|
|
|
-
|
|
|
function invoiceTAchieve() {
|
|
|
Doo::loadModel ( 'invoice' );
|
|
|
$invoice = new invoice ();
|
|
@@ -1936,81 +1961,93 @@ class InvoiceController extends DooController {
|
|
|
$staff = new staff ();
|
|
|
|
|
|
$MebSea = isset ( $this->params ['MebSea'] ) ? urldecode ( $this->params ['MebSea'] ) : '';
|
|
|
-
|
|
|
+
|
|
|
$page_size = 2;
|
|
|
$page = isset ( $this->params ['page'] ) && is_numeric ( $this->params ['page'] ) ? $this->params ['page'] : 1;
|
|
|
$date = isset ( $this->params ['date'] ) ? $this->params ['date'] : 'MONTHO';
|
|
|
-
|
|
|
+
|
|
|
$get = "/" . $date;
|
|
|
-
|
|
|
+
|
|
|
$con = '';
|
|
|
if ($date == 'MONTHO')
|
|
|
$con = ' and updateTime>DATE_SUB(CURDATE(), INTERVAL 1 MONTH)';
|
|
|
- elseif ($date == 'MONTHT')
|
|
|
+ elseif ($date == 'MONTHT')
|
|
|
$con = ' and updateTime>DATE_SUB(CURDATE(), INTERVAL 3 MONTH)';
|
|
|
- elseif ($date == 'MONTHY')
|
|
|
+ elseif ($date == 'MONTHY')
|
|
|
$con = ' and updateTime>DATE_SUB(CURDATE(), INTERVAL 1 YEAR)';
|
|
|
-
|
|
|
- if (! empty ( $MebSea )) {
|
|
|
- $con .= ' and ( invoiceTitle like "%' . $MebSea . '%" or invoiceCompany like "%' . $MebSea . '%" or invoicePrice like "%' . $MebSea . '%" )';
|
|
|
- $get .= "/" . $MebSea;
|
|
|
- }
|
|
|
- $pageinfo ['page'] = array (
|
|
|
- 'previous' => ''
|
|
|
- );
|
|
|
-
|
|
|
- $sql="";$action="";
|
|
|
- if ($this->ACTION=='invoicePrintAchieve'){
|
|
|
- $sql = "status=2 and printStatus=1 and moldManage like '%[\"" . $this->staff [0] ['sid'] . "\",%'". $con;
|
|
|
- $action="invoicePrintAchieve";
|
|
|
- }elseif ($this->ACTION=='invoicePostAchieve'){
|
|
|
- // and untreadStatus=0
|
|
|
- $sql = "postStatus=1 and doPost=1 and status=2 and isDelete=0". $con;
|
|
|
- $action="invoicePostAchieve";
|
|
|
- }
|
|
|
-
|
|
|
- $pageinfo = $this->get_page ( "CLD_invoice", $sql, $page, $page_size, $action, $get, "" );
|
|
|
- $limit = $pageinfo ['lower'] . ',' . $page_size;
|
|
|
- $list = $invoice->getInvoiceByUntreadStatusPage ( $limit, $sql );
|
|
|
-
|
|
|
- $this->data ['MebSeaEn'] = $MebSea;
|
|
|
- $this->data ['MebSea'] = urlencode ( $MebSea );
|
|
|
- $this->data ['get'] = $get;
|
|
|
- $this->data ['page'] = $pageinfo;
|
|
|
-
|
|
|
- $this->data ['date'] = $date;
|
|
|
-
|
|
|
- $this->data ['memu'] = "invoice";
|
|
|
- $this->data ['staff'] = $this->staff;
|
|
|
-
|
|
|
- if ($this->ACTION=='invoicePrintAchieve'){
|
|
|
- foreach ( $list as $key => $value ) {
|
|
|
- $list [$key] ['iidKey'] = $XDeode->encode ( $value ['iid'] );
|
|
|
-
|
|
|
- $lastApprover = json_decode ( $value ['processApprovals'], true );
|
|
|
- if (! empty ( $lastApprover )) {
|
|
|
- $lastApproverKey = array_keys ( $lastApprover );
|
|
|
- $lastApprover = end ( $lastApprover );
|
|
|
-
|
|
|
- $staffDetail = $staff->getOne ( array (
|
|
|
- 'where' => 'sid=' . end ( $lastApproverKey ),
|
|
|
- 'asArray' => true
|
|
|
- ) );
|
|
|
- $lastApprover ['username'] = $staffDetail ['username'];
|
|
|
- }
|
|
|
- $list [$key] ['lastApprover'] = $lastApprover;
|
|
|
+
|
|
|
+ if (! empty ( $MebSea )) {
|
|
|
+ $con .= ' and ( invoiceTitle like "%' . $MebSea . '%" or invoiceCompany like "%' . $MebSea . '%" or invoicePrice like "%' . $MebSea . '%" )';
|
|
|
+ $get .= "/" . $MebSea;
|
|
|
+ }
|
|
|
+ $pageinfo ['page'] = array (
|
|
|
+ 'previous' => ''
|
|
|
+ );
|
|
|
+
|
|
|
+ $sql = "";
|
|
|
+ $action = "";
|
|
|
+ if ($this->ACTION == 'invoicePrintAchieve') {
|
|
|
+ $sql = "status=2 and printStatus=1 and moldManage like '%[\"" . $this->staff [0] ['sid'] . "\",%'" . $con;
|
|
|
+ $action = "invoicePrintAchieve";
|
|
|
+ } elseif ($this->ACTION == 'invoicePostAchieve') {
|
|
|
+ // and untreadStatus=0
|
|
|
+ $sql = "postStatus=1 and doPost=1 and status=2 and isDelete=0" . $con;
|
|
|
+ $action = "invoicePostAchieve";
|
|
|
+ } elseif ($this->ACTION == 'invoiceUntreadAchieve') {
|
|
|
+ $sql = " printStatus=1 and untreadStatus=2 and status=2 " . $con;
|
|
|
+ $action = "invoiceUntreadAchieve";
|
|
|
+ }
|
|
|
+
|
|
|
+ $pageinfo = $this->get_page ( "CLD_invoice", $sql, $page, $page_size, $action, $get, "" );
|
|
|
+ $limit = $pageinfo ['lower'] . ',' . $page_size;
|
|
|
+ $list = $invoice->getInvoiceByUntreadStatusPage ( $limit, $sql );
|
|
|
+
|
|
|
+ $this->data ['MebSeaEn'] = $MebSea;
|
|
|
+ $this->data ['MebSea'] = urlencode ( $MebSea );
|
|
|
+ $this->data ['get'] = $get;
|
|
|
+ $this->data ['page'] = $pageinfo;
|
|
|
+
|
|
|
+ $this->data ['date'] = $date;
|
|
|
+
|
|
|
+ $this->data ['memu'] = "invoice";
|
|
|
+ $this->data ['staff'] = $this->staff;
|
|
|
+
|
|
|
+ if ($this->ACTION == 'invoicePrintAchieve') {
|
|
|
+ foreach ( $list as $key => $value ) {
|
|
|
+ $list [$key] ['iidKey'] = $XDeode->encode ( $value ['iid'] );
|
|
|
+
|
|
|
+ $lastApprover = json_decode ( $value ['processApprovals'], true );
|
|
|
+ if (! empty ( $lastApprover )) {
|
|
|
+ $lastApproverKey = array_keys ( $lastApprover );
|
|
|
+ $lastApprover = end ( $lastApprover );
|
|
|
+
|
|
|
+ $staffDetail = $staff->getOne ( array (
|
|
|
+ 'where' => 'sid=' . end ( $lastApproverKey ),
|
|
|
+ 'asArray' => true
|
|
|
+ ) );
|
|
|
+ $lastApprover ['username'] = $staffDetail ['username'];
|
|
|
}
|
|
|
- $this->data ['receiptMemu'] = 'invoicePrint';
|
|
|
- $this->data ['list'] = $list;
|
|
|
- $this->render ( "/admin/invoicePrintAchieve", $this->data );
|
|
|
- }elseif ($this->ACTION=='invoicePostAchieve'){
|
|
|
-
|
|
|
- $this->data ['receiptMemu'] = 'invoicePost';
|
|
|
- $this->data ['list'] = $list;
|
|
|
- $this->render ( "/admin/invoicePostAchieve", $this->data );
|
|
|
+ $list [$key] ['lastApprover'] = $lastApprover;
|
|
|
}
|
|
|
+ $this->data ['receiptMemu'] = 'invoicePrint';
|
|
|
+ $this->data ['list'] = $list;
|
|
|
+ $this->render ( "/admin/invoicePrintAchieve", $this->data );
|
|
|
+ } elseif ($this->ACTION == 'invoicePostAchieve') {
|
|
|
|
|
|
+ Doo::loadModel ( 'express' );
|
|
|
+ $express = new express ();
|
|
|
+ $expressList = $express->getExpressByAll ();
|
|
|
|
|
|
+ $this->data ['expressList'] = $expressList;
|
|
|
+ $this->data ['receiptMemu'] = 'invoicePost';
|
|
|
+ $this->data ['list'] = $list;
|
|
|
+ $this->render ( "/admin/invoicePostAchieve", $this->data );
|
|
|
+ } elseif ($this->ACTION == 'invoiceUntreadAchieve') {
|
|
|
+
|
|
|
+ $this->data ['receiptMemu'] = 'invoiceUntread';
|
|
|
+ $this->data ['list'] = $list;
|
|
|
+ $this->render ( "/admin/invoiceUntreadAchieve", $this->data );
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -2140,6 +2177,9 @@ class InvoiceController extends DooController {
|
|
|
Doo::loadModel ( 'invoice' );
|
|
|
$invoice = new invoice ();
|
|
|
$iid = $invoice->authcode ( $iid );
|
|
|
+ Doo::loadModel ( 'express' );
|
|
|
+ $express = new express ();
|
|
|
+ $expressList = $express->getExpressByAll ();
|
|
|
|
|
|
if (! is_numeric ( $iid )) {
|
|
|
echo json_encode ( array (
|
|
@@ -2152,6 +2192,16 @@ class InvoiceController extends DooController {
|
|
|
$select = "iid,recipients,recipientsPhone,recipientsAddress,mailItems,expressCompany,expressNumber,actualItems";
|
|
|
$invoiceDetail = $invoice->getInvoiceByIid ( $iid, $select );
|
|
|
|
|
|
+ $html = "";
|
|
|
+ foreach ( $expressList as $key => $value ) {
|
|
|
+ if ($value ['company'] == $invoiceDetail ['expressCompany'])
|
|
|
+ $html .= '<option selected value="' . $value ['company'] . ':' . $value ['com'] . '">' . $value ['company'] . '</option>';
|
|
|
+ else
|
|
|
+ $html .= '<option value="' . $value ['company'] . ':' . $value ['com'] . '">' . $value ['company'] . '</option>';
|
|
|
+ }
|
|
|
+
|
|
|
+ $invoiceDetail ['eaHtml'] = $html;
|
|
|
+
|
|
|
echo json_encode ( array (
|
|
|
'status' => 1,
|
|
|
'invoiceDetail' => $invoiceDetail
|
|
@@ -2626,7 +2676,7 @@ class InvoiceController extends DooController {
|
|
|
$invoiceOperationLog = new invoiceOperationLog ();
|
|
|
|
|
|
$detail = $invoice->getInvoiceByIsid ( $serial, $this->staff [0] ['sid'] );
|
|
|
- $invoiceOperationLogList = $invoiceOperationLog->getInvoiceOperationLogByIid ( $detail['iid'] );
|
|
|
+ $invoiceOperationLogList = $invoiceOperationLog->getInvoiceOperationLogByIid ( $detail ['iid'] );
|
|
|
|
|
|
if (empty ( $detail ))
|
|
|
$html = '';
|
|
@@ -2670,21 +2720,21 @@ class InvoiceController extends DooController {
|
|
|
</tr><tr>
|
|
|
<th class="taC" width="150">邮寄物品</th><td colspan="3">' . $detail ['mailItems'] . '</td>
|
|
|
</tr></tbody></table>';
|
|
|
- if(!empty($invoiceOperationLogList)){
|
|
|
- $html.='<table class="table table-bordered table-condensed"><tbody><tr><th width="60%" class="taC">审批流程</th></tr><tr><td>';
|
|
|
- foreach($invoiceOperationLogList as $key=>$value){
|
|
|
- $html.='<blockquote><p><span class="colGray">'.$value['date'].'</span>
|
|
|
- '.$value['category'].'-'.$value['username'].' ';
|
|
|
- if($value['status']==2){
|
|
|
- $html.='<span class="colGreen">同意</span>';
|
|
|
- }elseif($value['status']==3){
|
|
|
- $html.='<span class="colOrange">退回</span>';
|
|
|
- }elseif($value['status']==5){
|
|
|
- $html.='<span class="colGreen">打印</span>';
|
|
|
+ if (! empty ( $invoiceOperationLogList )) {
|
|
|
+ $html .= '<table class="table table-bordered table-condensed"><tbody><tr><th width="60%" class="taC">审批流程</th></tr><tr><td>';
|
|
|
+ foreach ( $invoiceOperationLogList as $key => $value ) {
|
|
|
+ $html .= '<blockquote><p><span class="colGray">' . $value ['date'] . '</span>
|
|
|
+ ' . $value ['category'] . '-' . $value ['username'] . ' ';
|
|
|
+ if ($value ['status'] == 2) {
|
|
|
+ $html .= '<span class="colGreen">同意</span>';
|
|
|
+ } elseif ($value ['status'] == 3) {
|
|
|
+ $html .= '<span class="colOrange">退回</span>';
|
|
|
+ } elseif ($value ['status'] == 5) {
|
|
|
+ $html .= '<span class="colGreen">打印</span>';
|
|
|
}
|
|
|
- $html.=$value['operation'].'</p></blockquote>';
|
|
|
+ $html .= $value ['operation'] . '</p></blockquote>';
|
|
|
}
|
|
|
- $html.='</td></tr></tbody></table>';
|
|
|
+ $html .= '</td></tr></tbody></table>';
|
|
|
}
|
|
|
$html .= '</div><div class="modal-footer"><a href="#" class="button btn-gray" data-dismiss="modal" aria-hidden="true">关闭</a></div></div></div>';
|
|
|
}
|