|
@@ -65,8 +65,8 @@ class InvoiceController extends DooController {
|
|
|
* Doo::acl()->isAllowed($uGroups['groups'], $resource, $action);
|
|
|
*/
|
|
|
// var_dump($flag) ;
|
|
|
- // 单独判断办事处汇总的访问权限 invoiceAggregateCategoryDetail
|
|
|
- if ($action == 'invoiceAggregateCategoryDetail') {
|
|
|
+ // 单独判断办事处汇总的访问权限 invoiceAggregateCategoryDetail,invoiceAggregateStaffDetail
|
|
|
+ if ($action == 'invoiceAggregateCategoryDetail' || $action == 'invoiceAggregateStaffDetail') {
|
|
|
Doo::loadModel ( "invoiceCategoryManage" );
|
|
|
$invoiceCategoryManage = new invoiceCategoryManage ();
|
|
|
|
|
@@ -2201,13 +2201,17 @@ class InvoiceController extends DooController {
|
|
|
$invoice = new invoice ();
|
|
|
Doo::loadModel ( 'invoiceOperationLog' );
|
|
|
$invoiceOperationLog = new invoiceOperationLog ();
|
|
|
+ Doo::loadModel ( 'invoicePaper' );
|
|
|
+ $invoicePaper = new invoicePaper ();
|
|
|
|
|
|
$invoiceDetail = $invoice->getPrintInvoiceByManage ( $this->staff [0] ['sid'], 0, $iid );
|
|
|
if (empty ( $invoiceDetail ))
|
|
|
die ( 'illegal request' );
|
|
|
|
|
|
+ $invoicePaperList = $invoicePaper->getInvoicePaperByInvoiceType ( $invoiceDetail ['invoiceType'] );
|
|
|
$invoiceOperationLogList = $invoiceOperationLog->getInvoiceOperationLogByIid ( $iid );
|
|
|
|
|
|
+ $this->data ['invoicePaperList'] = $invoicePaperList;
|
|
|
$this->data ['invoiceDetail'] = $invoiceDetail;
|
|
|
$this->data ['invoiceOperationLogList'] = $invoiceOperationLogList;
|
|
|
$this->data ['INVOICEKEY'] = $invoice->authcode ( $invoiceDetail ['iid'], '' );
|
|
@@ -2322,11 +2326,25 @@ class InvoiceController extends DooController {
|
|
|
$invoiceOperationLog = new invoiceOperationLog ();
|
|
|
Doo::loadModel ( 'invoiceStatistics' );
|
|
|
$invoiceStatistics = new invoiceStatistics ();
|
|
|
- // $info=$invoice->getOne(array('where'=>"invoiceNo = '".$invoiceNo."'",'asArray' => TRUE));
|
|
|
+ $XDeode = new XDeode ( 5 );
|
|
|
+ Doo::loadModel ( 'invoicePaper' );
|
|
|
+ $invoicePaper = new invoicePaper ();
|
|
|
|
|
|
$invoicePrintDetail = $invoice->getInvoiceByPrint ( $iid );
|
|
|
if (empty ( $invoicePrintDetail ))
|
|
|
die ( 'illegal request' );
|
|
|
+
|
|
|
+ //
|
|
|
+ $ipid = $XDeode->decode ( $invoiceNo );
|
|
|
+ $paperDetail = $invoicePaper->getInvoicePaperByIpid ( $ipid );
|
|
|
+ if (empty ( $paperDetail ))
|
|
|
+ die ( 'illegal request' );
|
|
|
+ $invoicePaper = new invoicePaper ();
|
|
|
+ $item = array (
|
|
|
+ 'iid' => $iid,
|
|
|
+ 'ipid' => $ipid
|
|
|
+ );
|
|
|
+ $invoicePaper->setInvoicePaperByCondition ( $item );
|
|
|
|
|
|
$item = array (
|
|
|
'iid' => $iid,
|
|
@@ -2334,12 +2352,12 @@ class InvoiceController extends DooController {
|
|
|
'updateTime' => date ( "Y-m-d H:i:s" ),
|
|
|
'printer' => $this->staff [0] ['username'],
|
|
|
'printTime' => date ( "Y-m-d H:i:s" ),
|
|
|
- 'invoiceNo' => $invoiceNo
|
|
|
+ 'invoiceNo' => $paperDetail ['invoiceNo']
|
|
|
);
|
|
|
$invoice->setInvoiceByCondition ( $item );
|
|
|
$item = array (
|
|
|
'date' => date ( "Y-m-d H:i:s" ),
|
|
|
- 'operation' => '打印发票号:' . $invoiceNo,
|
|
|
+ 'operation' => '打印发票号:' . $paperDetail ['invoiceNo'],
|
|
|
'status' => 5,
|
|
|
'img' => $this->staff [0] ['avatar'],
|
|
|
'username' => $this->staff [0] ['username'],
|
|
@@ -2802,15 +2820,16 @@ class InvoiceController extends DooController {
|
|
|
|
|
|
Doo::db ()->beginTransaction ();
|
|
|
// 批量存储收款--由于必须获得收款ID,
|
|
|
- $sql = 'INSERT INTO CLD_invoiceReceivables (receivablesPrice, receivablesMessage,receivablesSerial,receivablesBank,receivablesDate,inputStaff,date,receivablesCategory,receivablesStaff,bankBatchNumber)
|
|
|
+ $sql = 'INSERT INTO CLD_invoiceReceivables (receivablesPrice, receivablesMessage,receivablesSerial,receivablesBank,receivablesDate,inputStaff,date,receivablesCategory,receivablesStaff,bankBatchNumber,recepitTitleMark)
|
|
|
VALUES ';
|
|
|
$date = date ( "Y-m-d" );
|
|
|
$receivablesList = array ();
|
|
|
foreach ( $exlArray as $key => $value ) {
|
|
|
- $receivablesSql = '(' . $value ["receivablesPrice"] . ',"' . $value ["receivablesMessage"] . '",' . '"#SK' . date ( "Ymd" ) . mt_rand ( 1000, 9999 ) . '","' . $value ["receivablesBank"] . '","' . $value ["receivablesDate"] . '","' . $this->staff [0] ['username'] . '","' . $date . '","PUBLIC","PUBLIC","' . $bankBatchNumber . '")';
|
|
|
+ $receivablesSql = '(' . $value ["receivablesPrice"] . ',"' . $value ["receivablesMessage"] . '",' . '"#SK' . date ( "Ymd" ) . mt_rand ( 1000, 9999 ) . '","' . $value ["receivablesBank"] . '","' . $value ["receivablesDate"] . '","' . $this->staff [0] ['username'] . '","' . $date . '","PUBLIC","PUBLIC","' . $bankBatchNumber . '","' . $value ["receivablesMessage"] . '")';
|
|
|
array_push ( $receivablesList, $receivablesSql );
|
|
|
}
|
|
|
$sql = $sql . implode ( ',', $receivablesList );
|
|
|
+ //echo $sql;
|
|
|
Doo::db ()->query ( $sql );
|
|
|
|
|
|
// 批量存储收款统计
|
|
@@ -2827,7 +2846,7 @@ class InvoiceController extends DooController {
|
|
|
VALUES ';
|
|
|
$statisticsList = array ();
|
|
|
foreach ( $iridList as $value ) {
|
|
|
- $statisticsSql = '("' . $value ['receivablesDate'] . '",2,' . $value ['irid'] . ',' . $value ["receivablesPrice"] . ')';
|
|
|
+ $statisticsSql = '("' . $date . '",2,' . $value ['irid'] . ',' . $value ["receivablesPrice"] . ')';
|
|
|
array_push ( $statisticsList, $statisticsSql );
|
|
|
}
|
|
|
$sql = $sql . implode ( ',', $statisticsList );
|
|
@@ -3511,7 +3530,7 @@ class InvoiceController extends DooController {
|
|
|
$con .= ' and a.invoiceType=0 ';
|
|
|
elseif ($invoiceType == 'SPECIAL')
|
|
|
$con .= ' and a.invoiceType=1 ';
|
|
|
-
|
|
|
+
|
|
|
$dateArr = explode ( ':', $date );
|
|
|
$D1 = $dateString = '';
|
|
|
$D2 = '';
|
|
@@ -3530,7 +3549,7 @@ class InvoiceController extends DooController {
|
|
|
|
|
|
if (! empty ( $MebSea ))
|
|
|
$con .= ' and ( b.invoiceTitle like "%' . $MebSea . '%" or b.invoiceCompany like "%' . $MebSea . '%" or a.invoiceNo like "%' . $MebSea . '%" )';
|
|
|
-
|
|
|
+
|
|
|
$invoiceTotal = $invoicePaper->getInvoicePaperCount ();
|
|
|
|
|
|
$sql = ' ' . $con;
|
|
@@ -3540,9 +3559,9 @@ class InvoiceController extends DooController {
|
|
|
$paperList = array ();
|
|
|
foreach ( $list as $key => $value ) {
|
|
|
$irDetail = array ();
|
|
|
- if($value ['iid']==0)
|
|
|
+ if ($value ['iid'] == 0)
|
|
|
array_push ( $irDetail, '<a href="javascript:if(window.confirm(\'确认删除?\'))window.location=\'/invoicePaperDel/' . $value ['ipidKey'] . '\'" >删除</a>' );
|
|
|
- else
|
|
|
+ else
|
|
|
array_push ( $irDetail, '' );
|
|
|
array_push ( $irDetail, $value ['invoiceCode'] );
|
|
|
array_push ( $irDetail, $value ['invoiceNo'] );
|
|
@@ -3559,8 +3578,6 @@ class InvoiceController extends DooController {
|
|
|
array_push ( $irDetail, $value ['categoryName'] . '-' . $value ['userName'] );
|
|
|
array_push ( $irDetail, $value ['printTime'] );
|
|
|
|
|
|
-
|
|
|
-
|
|
|
array_push ( $paperList, $irDetail );
|
|
|
}
|
|
|
// $approvalListJson = json_encode ( $approvalList );
|
|
@@ -3574,8 +3591,7 @@ class InvoiceController extends DooController {
|
|
|
"data" => $paperList
|
|
|
), JSON_UNESCAPED_UNICODE );
|
|
|
}
|
|
|
-
|
|
|
- function invoicePaperDel(){
|
|
|
+ function invoicePaperDel() {
|
|
|
$ipidKey = isset ( $this->params ['ipidKey'] ) ? $this->params ['ipidKey'] : "";
|
|
|
|
|
|
$XDeode = new XDeode ( 5 );
|
|
@@ -3587,8 +3603,8 @@ class InvoiceController extends DooController {
|
|
|
Doo::loadModel ( 'invoicePaper' );
|
|
|
$invoicePaper = new invoicePaper ();
|
|
|
$invoicePaper->delete ( array (
|
|
|
- 'where' => 'ipid=' . $ipid.' and iid!=0',
|
|
|
- 'limit' => 1
|
|
|
+ 'where' => 'ipid=' . $ipid . ' and iid=0',
|
|
|
+ 'limit' => 1
|
|
|
) );
|
|
|
|
|
|
return '/invoicePaper';
|
|
@@ -3615,7 +3631,7 @@ class InvoiceController extends DooController {
|
|
|
$sql = 'INSERT INTO CLD_invoicePaper (invoiceType, invoiceCode,invoiceNo,date)
|
|
|
VALUES ';
|
|
|
$paperList = array ();
|
|
|
- for($invoiceNoStart; $invoiceNoStart <= $sum; $invoiceNoStart ++) {
|
|
|
+ for($invoiceNoStart; $invoiceNoStart <= $sum - 1; $invoiceNoStart ++) {
|
|
|
$paperSql = '(' . $invoiceType . ',"' . $invoiceCode . '","' . $invoiceNoStart . '","' . $date . '")';
|
|
|
array_push ( $paperList, $paperSql );
|
|
|
}
|
|
@@ -4081,6 +4097,10 @@ class InvoiceController extends DooController {
|
|
|
$this->data ['receiptMemu'] = 'invoiceAggregate';
|
|
|
$this->render ( "/admin/invoiceAggregateCategory", $this->data );
|
|
|
}
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 办事处汇总信息
|
|
|
+ */
|
|
|
function invoiceAggregateCategoryDetail() {
|
|
|
$cidKey = $this->get_args ( 'cidKey' ) ? $this->get_args ( 'cidKey' ) : '';
|
|
|
|
|
@@ -4192,6 +4212,230 @@ class InvoiceController extends DooController {
|
|
|
$this->data ['receiptMemu'] = 'invoiceAggregateCategoryDetail';
|
|
|
$this->render ( "/admin/invoiceAggregateCategoryDetail", $this->data );
|
|
|
}
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 办事处人员汇总详情
|
|
|
+ */
|
|
|
+ function invoiceAggregateStaffDetail() {
|
|
|
+ $sidKey = $this->get_args ( 'sidKey' ) ? $this->get_args ( 'sidKey' ) : '';
|
|
|
+ // $sidKey = isset ( $this->params ['sidKey'] ) ? $this->params ['sidKey'] : '';
|
|
|
+
|
|
|
+ Doo::loadClass ( 'XDeode' );
|
|
|
+ $XDeode = new XDeode ( 5 );
|
|
|
+ Doo::loadModel ( 'invoice' );
|
|
|
+ $invoice = new invoice ();
|
|
|
+ Doo::loadModel ( 'staff' );
|
|
|
+ $staff = new staff ();
|
|
|
+ Doo::loadModel ( "invoiceCategoryManage" );
|
|
|
+ $invoiceCategoryManage = new invoiceCategoryManage ();
|
|
|
+
|
|
|
+ $sid = $XDeode->decode ( $sidKey );
|
|
|
+
|
|
|
+ $imcStaff = $invoiceCategoryManage->getInvoiceCMByStaff ( $this->staff [0] ['sid'] );
|
|
|
+ $cidList = array ();
|
|
|
+ foreach ( $imcStaff as $key => $value ) {
|
|
|
+ array_push ( $cidList, $value ['cid'] );
|
|
|
+ if (empty ( $cidKey ))
|
|
|
+ $cidKey = $XDeode->encode ( $value ['cid'] );
|
|
|
+ }
|
|
|
+
|
|
|
+ $cidString = implode ( ',', $cidList );
|
|
|
+ $staffList = $staff->getStaffInCid ( $cidString );
|
|
|
+ $staffDetail = $staff->getStaffBySid ( $sid );
|
|
|
+
|
|
|
+ $MebSea = $this->get_args ( 'MebSea' ) ? $this->get_args ( 'MebSea' ) : "";
|
|
|
+
|
|
|
+ $page_size = 18;
|
|
|
+ $page = isset ( $this->params ['page'] ) && is_numeric ( $this->params ['page'] ) ? $this->params ['page'] : 1;
|
|
|
+ $status = isset ( $this->params ['status'] ) ? $this->params ['status'] : 'All';
|
|
|
+
|
|
|
+ $BeginDate = date ( 'Y-m-01', strtotime ( date ( "Y-m-d" ) ) );
|
|
|
+ $endDate = date ( 'Y-m-d', strtotime ( "$BeginDate +1 month -1 day" ) );
|
|
|
+
|
|
|
+ $date = $this->get_args ( 'date' ) ? $this->get_args ( 'date' ) : $BeginDate . " : " . $endDate;
|
|
|
+ $dateArr = explode ( ':', $date );
|
|
|
+ $D1 = '';
|
|
|
+ $D2 = '';
|
|
|
+ if (! empty ( $date )) {
|
|
|
+ $D1 = $dateArr [0] . " 00:00:00 ";
|
|
|
+ if (isset ( $dateArr [1] ))
|
|
|
+ $D2 = $dateArr [1] . " 23:59:59 ";
|
|
|
+ else
|
|
|
+ $D2 = $dateArr [0] . " 23:59:59 "; // date ( "Y-m-d" );
|
|
|
+ // $D2 = $dateArr [1];
|
|
|
+ }
|
|
|
+
|
|
|
+ $con = ' status=2 ';
|
|
|
+ if (! empty ( $D1 ) && ! empty ( $D2 ))
|
|
|
+ $con .= ' and printTime BETWEEN "' . $D1 . '" AND "' . $D2 . '" ';
|
|
|
+
|
|
|
+ if ($status == 'UNRECORD')
|
|
|
+ $con .= ' and printStatus=1 and untreadStatus=0';
|
|
|
+ elseif ($status == 'RECORD')
|
|
|
+ $con .= ' and printStatus=1 and untreadStatus=3';
|
|
|
+ elseif ($status == 'BOUNCED')
|
|
|
+ $con .= ' and untreadStatus=2';
|
|
|
+ elseif ($status == 'PARTRECORD')
|
|
|
+ $con .= ' and untreadStatus=0 and printStatus=1 and irid!=""';
|
|
|
+ elseif ($status == 'All') {
|
|
|
+ $con .= ' and ( untreadStatus=2 or untreadStatus=0 or untreadStatus=3 )';
|
|
|
+ }
|
|
|
+
|
|
|
+ $con.=' and sid='.$sid;
|
|
|
+
|
|
|
+ $get = "/" . $status . "?date=" . urlencode ( $date ) . "&MebSea=" . urlencode ( $MebSea ) . "&sidKey=" . urlencode ( $sidKey );
|
|
|
+
|
|
|
+ if (! empty ( $MebSea )) {
|
|
|
+ $con .= ' and ( invoiceTitle like "%' . $MebSea . '%" or invoiceCompany like "%' . $MebSea . '%" )';
|
|
|
+ }
|
|
|
+ $pageinfo ['page'] = array (
|
|
|
+ 'previous' => ''
|
|
|
+ );
|
|
|
+ $pageinfo = $this->get_page ( "CLD_invoice", $con, $page, $page_size, "invoiceAS", $get, "" );
|
|
|
+ $limit = $pageinfo ['lower'] . ',' . $page_size;
|
|
|
+
|
|
|
+ $list = $invoice->getInvoiceByUntreadStatusPage ( $limit, $con );
|
|
|
+
|
|
|
+ $this->data ['staffDetail'] = $staffDetail;
|
|
|
+ $this->data ['staffList'] = $staffList;
|
|
|
+ $this->data ['MebSeaEn'] = $MebSea;
|
|
|
+ $this->data ['MebSea'] = urlencode ( $MebSea );
|
|
|
+ $this->data ['date'] = $date;
|
|
|
+ $this->data ['page'] = $pageinfo;
|
|
|
+ $this->data ['get'] = $get;
|
|
|
+ $this->data ['list'] = $list;
|
|
|
+ $this->data ['status'] = $status;
|
|
|
+ $this->data ['sidKey'] = $sidKey;
|
|
|
+
|
|
|
+ $this->data ['memu'] = "invoice";
|
|
|
+ $this->data ['staff'] = $this->staff;
|
|
|
+ $this->data ['receiptMemu'] = 'invoiceAggregateCategoryDetail';
|
|
|
+
|
|
|
+ $this->render ( "/admin/invoiceAggregateStaffDetail", $this->data );
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 办事处人员汇总收款情
|
|
|
+ */
|
|
|
+ function invoiceAggregateStaffReceivablesDetail() {
|
|
|
+ $sidKey = $this->get_args ( 'sidKey' ) ? $this->get_args ( 'sidKey' ) : '';
|
|
|
+ //include Doo::conf ()->BASE_PATH . 'diagnostic/debug.php';
|
|
|
+ Doo::loadModel ( 'invoiceReceivables' );
|
|
|
+ $invoiceReceivables = new invoiceReceivables ();
|
|
|
+ Doo::loadModel ( 'staff' );
|
|
|
+ $staff = new staff ();
|
|
|
+ Doo::loadModel ( "invoiceCategoryManage" );
|
|
|
+ $invoiceCategoryManage = new invoiceCategoryManage ();
|
|
|
+
|
|
|
+ Doo::loadClass ( 'XDeode' );
|
|
|
+ $XDeode = new XDeode ( 5 );
|
|
|
+
|
|
|
+ $sid = $XDeode->decode ( $sidKey );
|
|
|
+ $staffDetail = $staff->getStaffBySid ( $sid );
|
|
|
+
|
|
|
+ $imcStaff = $invoiceCategoryManage->getInvoiceCMByStaff ( $this->staff [0] ['sid'] );
|
|
|
+ $cidList = array ();
|
|
|
+ foreach ( $imcStaff as $key => $value ) {
|
|
|
+ array_push ( $cidList, $value ['cid'] );
|
|
|
+ if (empty ( $cidKey ))
|
|
|
+ $cidKey = $XDeode->encode ( $value ['cid'] );
|
|
|
+ }
|
|
|
+
|
|
|
+ $cidString = implode ( ',', $cidList );
|
|
|
+ $staffList = $staff->getStaffInCid ( $cidString );
|
|
|
+
|
|
|
+ $MebSea = $this->get_args ( 'MebSea' ) ? $this->get_args ( 'MebSea' ) : "";
|
|
|
+
|
|
|
+ $timeType = $this->get_args ( 'timeType' ) ? $this->get_args ( 'timeType' ) : "CREATE";
|
|
|
+
|
|
|
+ $page_size = 10;
|
|
|
+ $page = isset ( $this->params ['page'] ) && is_numeric ( $this->params ['page'] ) ? $this->params ['page'] : 1;
|
|
|
+ $status = isset ( $this->params ['status'] ) ? $this->params ['status'] : 'All';
|
|
|
+
|
|
|
+
|
|
|
+ if($timeType=="BINDOTP"){
|
|
|
+ $status='Credited';
|
|
|
+ }
|
|
|
+
|
|
|
+ $BeginDate = date ( 'Y-m-01', strtotime ( date ( "Y-m-d" ) ) );
|
|
|
+ $endDate = date ( 'Y-m-d', strtotime ( "$BeginDate +1 month -1 day" ) );
|
|
|
+
|
|
|
+ $date = $this->get_args ( 'date' ) ? $this->get_args ( 'date' ) : $BeginDate . " : " . $endDate;
|
|
|
+ $dateArr = explode ( ':', $date );
|
|
|
+ $D1 = '';
|
|
|
+ $D2 = '';
|
|
|
+ if (! empty ( $date )) {
|
|
|
+ $D1 = $dateArr [0] ." 00:00:00 ";
|
|
|
+ if (isset ( $dateArr [1] ))
|
|
|
+ $D2 = $dateArr [1] ." 23:59:59 ";
|
|
|
+ else
|
|
|
+ $D2 = $dateArr [0] ." 23:59:59 ";//date ( "Y-m-d" );
|
|
|
+ }
|
|
|
+
|
|
|
+ $con = ' a.receivablesStaff like "%'.$staffDetail['username'].'%" ';
|
|
|
+
|
|
|
+ $descField = 'a.bindDate';
|
|
|
+ if ($timeType == 'CREATE')
|
|
|
+ $descField = 'a.date';
|
|
|
+
|
|
|
+ if (! empty ( $D1 ) && ! empty ( $D2 ))
|
|
|
+ $con .= ' and '.$descField.' BETWEEN "' . $D1 . '" AND "' . $D2 . '" ';
|
|
|
+ elseif (! empty ( $D1 ) && empty ( $D2 ))
|
|
|
+ $con .= ' and '.$descField.' like "%' . $D1 . '%" ';
|
|
|
+
|
|
|
+ if ($status == 'Unclaimed')
|
|
|
+ $con .= ' and a.bindStatus=0';
|
|
|
+ elseif ($status == 'Credited')
|
|
|
+ $con .= ' and a.bindStatus=1';
|
|
|
+ elseif ($status == 'Claim')
|
|
|
+ $con .= ' and a.bindStatus=0 and a.receivablesStaff="PUBLIC"';
|
|
|
+ elseif ($status == 'BBN')
|
|
|
+ $con .= ' and a.bindPrice>a.receivablesPrice';
|
|
|
+
|
|
|
+ $get = "/" . $status . "?date=" . urlencode ( $date ) . "&MebSea=" . urlencode ( $MebSea ). "&sidKey=" . urlencode ( $sidKey );
|
|
|
+
|
|
|
+ if (! empty ( $MebSea )) {
|
|
|
+ $con .= ' and ( a.receivablesMessage like "%' . $MebSea . '%" or a.receivablesPrice like "%' . $MebSea . '%" )';
|
|
|
+ }
|
|
|
+ $pageinfo ['page'] = array (
|
|
|
+ 'previous' => ''
|
|
|
+ );
|
|
|
+
|
|
|
+ $sql = 'select group_concat(b.invoiceSerial) as invoiceSerial ,group_concat(b.iid) as invoiceId
|
|
|
+ from CLD_invoiceReceivables as a left join CLD_invoice as b on
|
|
|
+ find_in_set(b.iid,a.iidExtend) or a.iid=b.iid
|
|
|
+ where ' . $con . ' group by a.irid ';
|
|
|
+
|
|
|
+ $pageinfo = $this->getPageBySql ( $sql, $page, $page_size, "invoiceAggregateStaffReceivablesDetail", $get, "" );
|
|
|
+ $limit = $pageinfo ['lower'] . ',' . $page_size;
|
|
|
+ $list = $invoiceReceivables->getInvoiceReceivablesByConditionPage ( $limit, $con, 'desc', 'printTime' );
|
|
|
+ foreach ( $list as $key => $value ) {
|
|
|
+ $list [$key] ['category'] = '';
|
|
|
+ if ($value ['receivablesCategory'] != 'PUBLIC') {
|
|
|
+ $receivablesCategory = explode ( ":", $value ['receivablesCategory'] );
|
|
|
+ $list [$key] ['category'] = $receivablesCategory [1];
|
|
|
+ }
|
|
|
+ }
|
|
|
+ // print_r($list);
|
|
|
+
|
|
|
+ $this->data ['staffDetail'] = $staffDetail;
|
|
|
+ $this->data ['sidKey'] = $sidKey;
|
|
|
+ $this->data ['staffList'] = $staffList;
|
|
|
+
|
|
|
+ $this->data ['timeType'] = $timeType;
|
|
|
+
|
|
|
+ $this->data ['MebSeaEn'] = $MebSea;
|
|
|
+ $this->data ['MebSea'] = urlencode ( $MebSea );
|
|
|
+ $this->data ['date'] = $date;
|
|
|
+ $this->data ['page'] = $pageinfo;
|
|
|
+ $this->data ['get'] = $get;
|
|
|
+ $this->data ['list'] = $list;
|
|
|
+ $this->data ['status'] = $status;
|
|
|
+ $this->data ['memu'] = "invoice";
|
|
|
+ $this->data ['staff'] = $this->staff;
|
|
|
+ $this->data ['receiptMemu'] = 'invoiceAggregateCategoryDetail';
|
|
|
+ $this->render ( "/admin/invoiceAggregateStaffReceivablesDetail", $this->data );
|
|
|
+ }
|
|
|
function invoiceAchieve() {
|
|
|
Doo::loadModel ( 'invoice' );
|
|
|
$invoice = new invoice ();
|
|
@@ -5934,8 +6178,17 @@ class InvoiceController extends DooController {
|
|
|
$invoice = new invoice ();
|
|
|
|
|
|
if (! empty ( $invoiceNo )) {
|
|
|
+
|
|
|
+ Doo::loadModel ( 'invoicePaper' );
|
|
|
+ $invoicePaper = new invoicePaper ();
|
|
|
+ Doo::loadClass ( 'XDeode' );
|
|
|
+ $XDeode = new XDeode ( 5 );
|
|
|
+
|
|
|
+ $ipid = $XDeode->decode ( $invoiceNo );
|
|
|
+ $paperDetail = $invoicePaper->getInvoicePaperByIpid ( $ipid );
|
|
|
+
|
|
|
$info = $invoice->getOne ( array (
|
|
|
- 'where' => "invoiceNo = '" . $invoiceNo . "'",
|
|
|
+ 'where' => "invoiceNo = '" . $paperDetail['invoiceNo'] . "'",
|
|
|
'asArray' => TRUE
|
|
|
) );
|
|
|
if (! empty ( $info )) {
|