|
@@ -844,7 +844,7 @@ class AdminController extends DooController {
|
|
'发票邮寄' => '',
|
|
'发票邮寄' => '',
|
|
'发票退票' => '',
|
|
'发票退票' => '',
|
|
'公司汇总查阅' => '',
|
|
'公司汇总查阅' => '',
|
|
- '纸票管理'=>''
|
|
|
|
|
|
+ '纸票管理' => ''
|
|
);
|
|
);
|
|
foreach ( $list as $key => $value ) {
|
|
foreach ( $list as $key => $value ) {
|
|
$name = json_decode ( $value ['staff'] );
|
|
$name = json_decode ( $value ['staff'] );
|
|
@@ -978,6 +978,168 @@ class AdminController extends DooController {
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|
|
|
|
+ * 开票应收款权限设置
|
|
|
|
+ */
|
|
|
|
+ function adminInvoiceCompany() {
|
|
|
|
+ Doo::loadClass ( 'XDeode' );
|
|
|
|
+ $XDeode = new XDeode ( 5 );
|
|
|
|
+ Doo::loadModel ( 'staff' );
|
|
|
|
+ $staff = new staff ();
|
|
|
|
+ Doo::loadModel ( "invoiceCompanyManage" );
|
|
|
|
+ $invoiceCompanyManage = new invoiceCompanyManage ();
|
|
|
|
+ Doo::loadModel ( 'L_category' );
|
|
|
|
+ $category = new L_category ();
|
|
|
|
+
|
|
|
|
+ $categoryList = $category->getCategory ();
|
|
|
|
+ $managelist = $invoiceCompanyManage->find ( array (
|
|
|
|
+ 'asArray' => true
|
|
|
|
+ ) );
|
|
|
|
+ $staffList = $staff->getStaff ();
|
|
|
|
+
|
|
|
|
+ $invoiceStaff = array ();
|
|
|
|
+ foreach ( $categoryList as $key => $value ) {
|
|
|
|
+ $invoiceStaff [$value ['cidKey']] = array ();
|
|
|
|
+ $categoryList [$key] ['html'] = '';
|
|
|
|
+ foreach ( $staffList as $k => $v ) {
|
|
|
|
+ $ul = array ();
|
|
|
|
+ if ($value ['cid'] == $v ['cid']) {
|
|
|
|
+ array_push ( $ul, $v ['sidKey'] );
|
|
|
|
+ array_push ( $ul, $v ['username'] );
|
|
|
|
+ array_push ( $invoiceStaff [$value ['cidKey']], $ul );
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ foreach ( $managelist as $e => $a ) {
|
|
|
|
+ if ($value ['cid'] == $a ['cid']) {
|
|
|
|
+ $name = json_decode ( $a ['staff'] );
|
|
|
|
+ $staffString = "";
|
|
|
|
+ foreach ( $name as $y => $l ) {
|
|
|
|
+ $sidKey = $XDeode->encode ( $l [0] );
|
|
|
|
+ $icidKey = $XDeode->encode ( $a ['icid'] );
|
|
|
|
+ $staffString .= $l [1] . '<a href="javascript:if(window.confirm(\'确认删除?\'))window.location=\'/delInvoiceCompanyManage/' . $sidKey . '/' . $icidKey . '\'" role="button" title="删除" class="icon-">k</a> ';
|
|
|
|
+ }
|
|
|
|
+ $categoryList [$key] ['html'] = $staffString;
|
|
|
|
+ break;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ $data ['categoryList'] = $categoryList;
|
|
|
|
+ $data ['invoiceStaff'] = json_encode ( $invoiceStaff );
|
|
|
|
+
|
|
|
|
+ $data ['memu'] = "invoice";
|
|
|
|
+ $data ['staff'] = $this->staff;
|
|
|
|
+ $this->render ( "/admin/adminInvoiceCompany", $data );
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 添加办事处查看权限
|
|
|
|
+ */
|
|
|
|
+ function addInvoiceCompanyManage() {
|
|
|
|
+ $cidKey = $this->get_args ( 'cidKey' ) ? $this->get_args ( 'cidKey' ) : "";
|
|
|
|
+ $sidKey = $this->get_args ( 'sidKey' ) ? $this->get_args ( 'sidKey' ) : "";
|
|
|
|
+
|
|
|
|
+ if (! empty ( $cidKey ) && ! empty ( $sidKey )) {
|
|
|
|
+ Doo::loadModel ( "invoiceCompanyManage" );
|
|
|
|
+ $invoiceCompanyManage = new invoiceCompanyManage ();
|
|
|
|
+ Doo::loadClass ( 'XDeode' );
|
|
|
|
+ $XDeode = new XDeode ( 5 );
|
|
|
|
+ Doo::loadModel ( 'staff' );
|
|
|
|
+ $staff = new staff ();
|
|
|
|
+
|
|
|
|
+ $cid = $XDeode->decode ( $cidKey );
|
|
|
|
+ $sid = $XDeode->decode ( $sidKey );
|
|
|
|
+ if (! is_numeric ( $cid ) || ! is_numeric ( $sid ))
|
|
|
|
+ die ( 'illegal request' );
|
|
|
|
+
|
|
|
|
+ $icm = $invoiceCompanyManage->getOne ( array (
|
|
|
|
+ 'where' => 'cid =' . $cid,
|
|
|
|
+ 'asArray' => true
|
|
|
|
+ ) );
|
|
|
|
+ $staffDetail = $staff->getStaffBySid ( $sid );
|
|
|
|
+
|
|
|
|
+ if (empty ( $icm )) {
|
|
|
|
+ $invoiceCompanyManage = new invoiceCompanyManage ();
|
|
|
|
+ $list = array ();
|
|
|
|
+
|
|
|
|
+ $info = array (
|
|
|
|
+ $staffDetail ['sid'],
|
|
|
|
+ $staffDetail ['username']
|
|
|
|
+ );
|
|
|
|
+ array_push ( $list, $info );
|
|
|
|
+
|
|
|
|
+ $invoiceCompanyManage->cid = $cid;
|
|
|
|
+ $invoiceCompanyManage->staff = json_encode ( $list );
|
|
|
|
+
|
|
|
|
+ $invoiceCompanyManage->insert ();
|
|
|
|
+ } else {
|
|
|
|
+ $invoiceCompanyManage = new invoiceCompanyManage ();
|
|
|
|
+ $list = json_decode ( $icm ['staff'], true );
|
|
|
|
+
|
|
|
|
+ $flag = true;
|
|
|
|
+ foreach ( $list as $key => $value ) {
|
|
|
|
+ if ($value [0] == $sid) {
|
|
|
|
+ $flag = false;
|
|
|
|
+ break;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ if ($flag) {
|
|
|
|
+ $info = array (
|
|
|
|
+ $staffDetail ['sid'],
|
|
|
|
+ $staffDetail ['username']
|
|
|
|
+ );
|
|
|
|
+ array_push ( $list, $info );
|
|
|
|
+ }
|
|
|
|
+ $invoiceCompanyManage->staff = json_encode ( $list );
|
|
|
|
+ $invoiceCompanyManage->update ( array (
|
|
|
|
+ 'where' => 'icid = ' . $icm ['icid']
|
|
|
|
+ ) );
|
|
|
|
+ }
|
|
|
|
+ return '/adminInvoiceCompany';
|
|
|
|
+ }
|
|
|
|
+ die ( 'illegal request' );
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 去除查看办事处汇总人员
|
|
|
|
+ */
|
|
|
|
+ function delInvoiceCompanyManage() {
|
|
|
|
+ $sidKey = isset ( $this->params ['sidKey'] ) ? $this->params ['sidKey'] : '';
|
|
|
|
+ $icidKey = isset ( $this->params ['icidKey'] ) ? $this->params ['icidKey'] : '';
|
|
|
|
+
|
|
|
|
+ Doo::loadClass ( 'XDeode' );
|
|
|
|
+ $XDeode = new XDeode ( 5 );
|
|
|
|
+
|
|
|
|
+ $icid = $XDeode->decode ( $icidKey );
|
|
|
|
+ $sid = $XDeode->decode ( $sidKey );
|
|
|
|
+ if (! is_numeric ( $icid ) || ! is_numeric ( $sid ))
|
|
|
|
+ die ( 'illegal request' );
|
|
|
|
+
|
|
|
|
+ Doo::loadModel ( "invoiceCompanyManage" );
|
|
|
|
+ $invoiceCompanyManage = new invoiceCompanyManage ();
|
|
|
|
+
|
|
|
|
+ $icmDetail = $invoiceCompanyManage->getInvoiceCMByIcid ( $icid );
|
|
|
|
+ if (empty ( $icmDetail ))
|
|
|
|
+ die ( 'illegal request' );
|
|
|
|
+
|
|
|
|
+ $list = json_decode ( $icmDetail ['staff'], true );
|
|
|
|
+
|
|
|
|
+ foreach ( $list as $k => $v ) {
|
|
|
|
+ if ($v [0] == $sid) {
|
|
|
|
+ unset ( $list [$k] );
|
|
|
|
+ break;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ $invoiceCompanyManage = new invoiceCompanyManage ();
|
|
|
|
+ $invoiceCompanyManage->staff = json_encode ( $list );
|
|
|
|
+ $invoiceCompanyManage->update ( array (
|
|
|
|
+ 'where' => 'icid = ' . $icmDetail ['icid']
|
|
|
|
+ ) );
|
|
|
|
+
|
|
|
|
+ return '/adminInvoiceCompany';
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /**
|
|
* 开票办事处权限设置
|
|
* 开票办事处权限设置
|
|
*/
|
|
*/
|
|
function adminInvoiceCategory() {
|
|
function adminInvoiceCategory() {
|
|
@@ -994,41 +1156,41 @@ class AdminController extends DooController {
|
|
$managelist = $invoiceCategoryManage->find ( array (
|
|
$managelist = $invoiceCategoryManage->find ( array (
|
|
'asArray' => true
|
|
'asArray' => true
|
|
) );
|
|
) );
|
|
- $staffList=$staff->getStaff();
|
|
|
|
|
|
+ $staffList = $staff->getStaff ();
|
|
|
|
|
|
- $invoiceStaff=array();
|
|
|
|
|
|
+ $invoiceStaff = array ();
|
|
foreach ( $categoryList as $key => $value ) {
|
|
foreach ( $categoryList as $key => $value ) {
|
|
- $invoiceStaff[$value['cidKey']]=array();
|
|
|
|
- $categoryList[$key]['html']='';
|
|
|
|
- foreach ($staffList as $k=>$v){
|
|
|
|
- $ul=array();
|
|
|
|
- if($value['cid']==$v['cid']){
|
|
|
|
- array_push($ul, $v['sidKey']);
|
|
|
|
- array_push($ul, $v['username']);
|
|
|
|
- array_push($invoiceStaff[$value['cidKey']], $ul);
|
|
|
|
|
|
+ $invoiceStaff [$value ['cidKey']] = array ();
|
|
|
|
+ $categoryList [$key] ['html'] = '';
|
|
|
|
+ foreach ( $staffList as $k => $v ) {
|
|
|
|
+ $ul = array ();
|
|
|
|
+ if ($value ['cid'] == $v ['cid']) {
|
|
|
|
+ array_push ( $ul, $v ['sidKey'] );
|
|
|
|
+ array_push ( $ul, $v ['username'] );
|
|
|
|
+ array_push ( $invoiceStaff [$value ['cidKey']], $ul );
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
- foreach ($managelist as $e=>$a){
|
|
|
|
- if ($value['cid']==$a['cid']){
|
|
|
|
|
|
+ foreach ( $managelist as $e => $a ) {
|
|
|
|
+ if ($value ['cid'] == $a ['cid']) {
|
|
$name = json_decode ( $a ['staff'] );
|
|
$name = json_decode ( $a ['staff'] );
|
|
$staffString = "";
|
|
$staffString = "";
|
|
foreach ( $name as $y => $l ) {
|
|
foreach ( $name as $y => $l ) {
|
|
- $sidKey=$XDeode->encode ( $l [0] );
|
|
|
|
- $icidKey=$XDeode->encode ( $a ['icid'] );
|
|
|
|
- $staffString .= $l[1].'<a href="javascript:if(window.confirm(\'确认删除?\'))window.location=\'/delInvoiceCategoryManage/' . $sidKey . '/' . $icidKey . '\'" role="button" title="删除" class="icon-">k</a> ';
|
|
|
|
|
|
+ $sidKey = $XDeode->encode ( $l [0] );
|
|
|
|
+ $icidKey = $XDeode->encode ( $a ['icid'] );
|
|
|
|
+ $staffString .= $l [1] . '<a href="javascript:if(window.confirm(\'确认删除?\'))window.location=\'/delInvoiceCategoryManage/' . $sidKey . '/' . $icidKey . '\'" role="button" title="删除" class="icon-">k</a> ';
|
|
}
|
|
}
|
|
- $categoryList[$key]['html']=$staffString;
|
|
|
|
|
|
+ $categoryList [$key] ['html'] = $staffString;
|
|
break;
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
- //print_r($invoiceStaff);
|
|
|
|
|
|
+ // print_r($invoiceStaff);
|
|
|
|
|
|
$data ['categoryList'] = $categoryList;
|
|
$data ['categoryList'] = $categoryList;
|
|
- $data['invoiceStaff']=json_encode($invoiceStaff);
|
|
|
|
-
|
|
|
|
|
|
+ $data ['invoiceStaff'] = json_encode ( $invoiceStaff );
|
|
|
|
+
|
|
$data ['memu'] = "invoice";
|
|
$data ['memu'] = "invoice";
|
|
$data ['staff'] = $this->staff;
|
|
$data ['staff'] = $this->staff;
|
|
$this->render ( "/admin/adminInvoiceCategory", $data );
|
|
$this->render ( "/admin/adminInvoiceCategory", $data );
|
|
@@ -1037,11 +1199,11 @@ class AdminController extends DooController {
|
|
/**
|
|
/**
|
|
* 添加办事处查看权限
|
|
* 添加办事处查看权限
|
|
*/
|
|
*/
|
|
- function addInvoiceCategoryManage(){
|
|
|
|
|
|
+ function addInvoiceCategoryManage() {
|
|
$cidKey = $this->get_args ( 'cidKey' ) ? $this->get_args ( 'cidKey' ) : "";
|
|
$cidKey = $this->get_args ( 'cidKey' ) ? $this->get_args ( 'cidKey' ) : "";
|
|
$sidKey = $this->get_args ( 'sidKey' ) ? $this->get_args ( 'sidKey' ) : "";
|
|
$sidKey = $this->get_args ( 'sidKey' ) ? $this->get_args ( 'sidKey' ) : "";
|
|
|
|
|
|
- if(!empty($cidKey)&&!empty($sidKey)){
|
|
|
|
|
|
+ if (! empty ( $cidKey ) && ! empty ( $sidKey )) {
|
|
Doo::loadModel ( "invoiceCategoryManage" );
|
|
Doo::loadModel ( "invoiceCategoryManage" );
|
|
$invoiceCategoryManage = new invoiceCategoryManage ();
|
|
$invoiceCategoryManage = new invoiceCategoryManage ();
|
|
Doo::loadClass ( 'XDeode' );
|
|
Doo::loadClass ( 'XDeode' );
|
|
@@ -1049,46 +1211,52 @@ class AdminController extends DooController {
|
|
Doo::loadModel ( 'staff' );
|
|
Doo::loadModel ( 'staff' );
|
|
$staff = new staff ();
|
|
$staff = new staff ();
|
|
|
|
|
|
- $cid=$XDeode->decode($cidKey);
|
|
|
|
- $sid=$XDeode->decode($sidKey);
|
|
|
|
- if (!is_numeric($cid)||!is_numeric($sid))
|
|
|
|
|
|
+ $cid = $XDeode->decode ( $cidKey );
|
|
|
|
+ $sid = $XDeode->decode ( $sidKey );
|
|
|
|
+ if (! is_numeric ( $cid ) || ! is_numeric ( $sid ))
|
|
die ( 'illegal request' );
|
|
die ( 'illegal request' );
|
|
|
|
|
|
- $icm=$invoiceCategoryManage->getOne(array (
|
|
|
|
- 'where' => 'cid ='.$cid,
|
|
|
|
- 'asArray' => true
|
|
|
|
|
|
+ $icm = $invoiceCategoryManage->getOne ( array (
|
|
|
|
+ 'where' => 'cid =' . $cid,
|
|
|
|
+ 'asArray' => true
|
|
) );
|
|
) );
|
|
- $staffDetail=$staff->getStaffBySid($sid);
|
|
|
|
|
|
+ $staffDetail = $staff->getStaffBySid ( $sid );
|
|
|
|
|
|
if (empty ( $icm )) {
|
|
if (empty ( $icm )) {
|
|
$invoiceCategoryManage = new invoiceCategoryManage ();
|
|
$invoiceCategoryManage = new invoiceCategoryManage ();
|
|
$list = array ();
|
|
$list = array ();
|
|
|
|
|
|
- $info=array($staffDetail['sid'],$staffDetail['username']);
|
|
|
|
|
|
+ $info = array (
|
|
|
|
+ $staffDetail ['sid'],
|
|
|
|
+ $staffDetail ['username']
|
|
|
|
+ );
|
|
array_push ( $list, $info );
|
|
array_push ( $list, $info );
|
|
|
|
|
|
- $invoiceCategoryManage->cid=$cid;
|
|
|
|
- $invoiceCategoryManage->staff=json_encode ( $list );
|
|
|
|
|
|
+ $invoiceCategoryManage->cid = $cid;
|
|
|
|
+ $invoiceCategoryManage->staff = json_encode ( $list );
|
|
|
|
|
|
$invoiceCategoryManage->insert ();
|
|
$invoiceCategoryManage->insert ();
|
|
- }else{
|
|
|
|
|
|
+ } else {
|
|
$invoiceCategoryManage = new invoiceCategoryManage ();
|
|
$invoiceCategoryManage = new invoiceCategoryManage ();
|
|
$list = json_decode ( $icm ['staff'], true );
|
|
$list = json_decode ( $icm ['staff'], true );
|
|
|
|
|
|
- $flag=true;
|
|
|
|
|
|
+ $flag = true;
|
|
foreach ( $list as $key => $value ) {
|
|
foreach ( $list as $key => $value ) {
|
|
if ($value [0] == $sid) {
|
|
if ($value [0] == $sid) {
|
|
- $flag=false;
|
|
|
|
|
|
+ $flag = false;
|
|
break;
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- if ($flag){
|
|
|
|
- $info=array($staffDetail['sid'],$staffDetail['username']);
|
|
|
|
|
|
+ if ($flag) {
|
|
|
|
+ $info = array (
|
|
|
|
+ $staffDetail ['sid'],
|
|
|
|
+ $staffDetail ['username']
|
|
|
|
+ );
|
|
array_push ( $list, $info );
|
|
array_push ( $list, $info );
|
|
}
|
|
}
|
|
$invoiceCategoryManage->staff = json_encode ( $list );
|
|
$invoiceCategoryManage->staff = json_encode ( $list );
|
|
$invoiceCategoryManage->update ( array (
|
|
$invoiceCategoryManage->update ( array (
|
|
- 'where' => 'icid = ' . $icm ['icid']
|
|
|
|
|
|
+ 'where' => 'icid = ' . $icm ['icid']
|
|
) );
|
|
) );
|
|
}
|
|
}
|
|
return '/adminInvoiceCategory';
|
|
return '/adminInvoiceCategory';
|
|
@@ -1099,23 +1267,22 @@ class AdminController extends DooController {
|
|
/**
|
|
/**
|
|
* 去除查看办事处汇总人员
|
|
* 去除查看办事处汇总人员
|
|
*/
|
|
*/
|
|
- function delInvoiceCategoryManage(){
|
|
|
|
-
|
|
|
|
|
|
+ function delInvoiceCategoryManage() {
|
|
$sidKey = isset ( $this->params ['sidKey'] ) ? $this->params ['sidKey'] : '';
|
|
$sidKey = isset ( $this->params ['sidKey'] ) ? $this->params ['sidKey'] : '';
|
|
$icidKey = isset ( $this->params ['icidKey'] ) ? $this->params ['icidKey'] : '';
|
|
$icidKey = isset ( $this->params ['icidKey'] ) ? $this->params ['icidKey'] : '';
|
|
|
|
|
|
Doo::loadClass ( 'XDeode' );
|
|
Doo::loadClass ( 'XDeode' );
|
|
$XDeode = new XDeode ( 5 );
|
|
$XDeode = new XDeode ( 5 );
|
|
|
|
|
|
- $icid=$XDeode->decode($icidKey);
|
|
|
|
- $sid=$XDeode->decode($sidKey);
|
|
|
|
- if (!is_numeric($icid)||!is_numeric($sid))
|
|
|
|
|
|
+ $icid = $XDeode->decode ( $icidKey );
|
|
|
|
+ $sid = $XDeode->decode ( $sidKey );
|
|
|
|
+ if (! is_numeric ( $icid ) || ! is_numeric ( $sid ))
|
|
die ( 'illegal request' );
|
|
die ( 'illegal request' );
|
|
|
|
|
|
Doo::loadModel ( "invoiceCategoryManage" );
|
|
Doo::loadModel ( "invoiceCategoryManage" );
|
|
$invoiceCategoryManage = new invoiceCategoryManage ();
|
|
$invoiceCategoryManage = new invoiceCategoryManage ();
|
|
|
|
|
|
- $icmDetail=$invoiceCategoryManage->getInvoiceCMByIcid($icid);
|
|
|
|
|
|
+ $icmDetail = $invoiceCategoryManage->getInvoiceCMByIcid ( $icid );
|
|
if (empty ( $icmDetail ))
|
|
if (empty ( $icmDetail ))
|
|
die ( 'illegal request' );
|
|
die ( 'illegal request' );
|
|
|
|
|
|
@@ -1130,12 +1297,11 @@ class AdminController extends DooController {
|
|
$invoiceCategoryManage = new invoiceCategoryManage ();
|
|
$invoiceCategoryManage = new invoiceCategoryManage ();
|
|
$invoiceCategoryManage->staff = json_encode ( $list );
|
|
$invoiceCategoryManage->staff = json_encode ( $list );
|
|
$invoiceCategoryManage->update ( array (
|
|
$invoiceCategoryManage->update ( array (
|
|
- 'where' => 'icid = ' . $icmDetail ['icid']
|
|
|
|
|
|
+ 'where' => 'icid = ' . $icmDetail ['icid']
|
|
) );
|
|
) );
|
|
|
|
|
|
return '/adminInvoiceCategory';
|
|
return '/adminInvoiceCategory';
|
|
}
|
|
}
|
|
-
|
|
|
|
function ajaxRoleStaff() {
|
|
function ajaxRoleStaff() {
|
|
$name = $this->get_args ( 'name' ) ? $this->get_args ( 'name' ) : "";
|
|
$name = $this->get_args ( 'name' ) ? $this->get_args ( 'name' ) : "";
|
|
|
|
|