|
@@ -373,7 +373,7 @@ class InvoiceController extends DooController {
|
|
|
/**
|
|
|
* 申请退票
|
|
|
*/
|
|
|
- function invoiceUntreadDo(){
|
|
|
+ function invoiceUntreadDo() {
|
|
|
$untreadIidKey = $this->get_args ( 'untreadIidKey' ) ? $this->get_args ( 'untreadIidKey' ) : '';
|
|
|
$untreadReason = $this->get_args ( 'untreadReason' ) ? $this->get_args ( 'untreadReason' ) : "";
|
|
|
$untreadPost = $this->get_args ( 'untreadPost' ) ? $this->get_args ( 'untreadPost' ) : "";
|
|
@@ -395,13 +395,13 @@ class InvoiceController extends DooController {
|
|
|
'untreadStatus' => 1,
|
|
|
'untreadReason' => $untreadReason,
|
|
|
'untreadPost' => $untreadPost,
|
|
|
- 'updateTime' => date ( "Y-m-d H:i:s" )
|
|
|
+ 'updateTime' => date ( "Y-m-d H:i:s" )
|
|
|
);
|
|
|
- if($untreadPost==1){
|
|
|
+ if ($untreadPost == 1) {
|
|
|
$item += array (
|
|
|
'untreadCompany' => $untreadCompany,
|
|
|
'untreadNumber' => $untreadNumber,
|
|
|
- 'untreadItems' => $untreadItems
|
|
|
+ 'untreadItems' => $untreadItems
|
|
|
);
|
|
|
}
|
|
|
$invoice->setInvoiceByCondition ( $item );
|
|
@@ -413,7 +413,7 @@ class InvoiceController extends DooController {
|
|
|
'username' => $this->staff [0] ['username'],
|
|
|
'uid' => $this->staff [0] ['sid'],
|
|
|
'category' => $this->staff [0] ['category'],
|
|
|
- 'iid' => $iid
|
|
|
+ 'iid' => $iid
|
|
|
);
|
|
|
$invoiceOperationLog->setInvoiceOperationLog ( $item );
|
|
|
|
|
@@ -608,7 +608,7 @@ class InvoiceController extends DooController {
|
|
|
} elseif ($status == 4) {
|
|
|
$invoice->status = $status;
|
|
|
$item = array (
|
|
|
- 'operation' => $opinion
|
|
|
+ 'operation' => $opinion
|
|
|
);
|
|
|
}
|
|
|
}
|
|
@@ -739,7 +739,6 @@ class InvoiceController extends DooController {
|
|
|
die ( 'illegal request' );
|
|
|
if (! empty ( $iid ) && ! empty ( $invoiceNo )) {
|
|
|
|
|
|
-
|
|
|
Doo::loadModel ( 'invoiceOperationLog' );
|
|
|
$invoiceOperationLog = new invoiceOperationLog ();
|
|
|
|
|
@@ -821,12 +820,12 @@ class InvoiceController extends DooController {
|
|
|
/**
|
|
|
* 退票处理页面
|
|
|
*/
|
|
|
- function invoiceUntread(){
|
|
|
+ function invoiceUntread() {
|
|
|
Doo::loadModel ( 'invoice' );
|
|
|
$invoice = new invoice ();
|
|
|
|
|
|
- $untreadInvoice=$invoice->getInvoiceByUntreadStatus(1);
|
|
|
- $establishedInvoice=$invoice->getInvoiceByUntreadStatus(2);
|
|
|
+ $untreadInvoice = $invoice->getInvoiceByUntreadStatus ( 1 );
|
|
|
+ $establishedInvoice = $invoice->getInvoiceByUntreadStatus ( 2 );
|
|
|
|
|
|
$data ['untreadInvoice'] = $untreadInvoice;
|
|
|
$data ['establishedInvoice'] = $establishedInvoice;
|
|
@@ -840,8 +839,7 @@ class InvoiceController extends DooController {
|
|
|
/**
|
|
|
* 确认收到退回的发票,开票状态为退回
|
|
|
*/
|
|
|
- function invoiceUntreadEstablishedDo(){
|
|
|
-
|
|
|
+ function invoiceUntreadEstablishedDo() {
|
|
|
$untreadIidKey = $this->get_args ( 'untreadIidKey' ) ? $this->get_args ( 'untreadIidKey' ) : '';
|
|
|
|
|
|
Doo::loadModel ( 'invoice' );
|
|
@@ -856,9 +854,9 @@ class InvoiceController extends DooController {
|
|
|
$item = array (
|
|
|
'iid' => $iid,
|
|
|
'untreadStatus' => 2,
|
|
|
- 'updateTime' => date ( "Y-m-d H:i:s" )
|
|
|
+ 'updateTime' => date ( "Y-m-d H:i:s" )
|
|
|
);
|
|
|
-
|
|
|
+
|
|
|
$invoice->setInvoiceByCondition ( $item );
|
|
|
$item = array (
|
|
|
'date' => date ( "Y-m-d H:i:s" ),
|
|
@@ -868,14 +866,23 @@ class InvoiceController extends DooController {
|
|
|
'username' => $this->staff [0] ['username'],
|
|
|
'uid' => $this->staff [0] ['sid'],
|
|
|
'category' => $this->staff [0] ['category'],
|
|
|
- 'iid' => $iid
|
|
|
+ 'iid' => $iid
|
|
|
);
|
|
|
$invoiceOperationLog->setInvoiceOperationLog ( $item );
|
|
|
|
|
|
return "/invoiceUntread";
|
|
|
}
|
|
|
-
|
|
|
- function invoiceReceivables(){
|
|
|
+ function invoiceReceivables() {
|
|
|
+ Doo::loadModel ( 'L_category' );
|
|
|
+ $lCategory = new L_category ();
|
|
|
+ Doo::loadModel('staff');
|
|
|
+ $staff=new staff();
|
|
|
+
|
|
|
+ $category = $lCategory->getCategory ();
|
|
|
+ $staffList = $staff->getStaffByCid($this->staff[0]['cid']);
|
|
|
+
|
|
|
+ $data ['staffList'] = $staffList;
|
|
|
+ $data ['category'] = $category;
|
|
|
|
|
|
$data ['memu'] = "invoice";
|
|
|
$data ['staff'] = $this->staff;
|
|
@@ -883,6 +890,129 @@ class InvoiceController extends DooController {
|
|
|
$this->render ( "/admin/invoiceReceivables", $data );
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 录入收款数据
|
|
|
+ * @return string
|
|
|
+ */
|
|
|
+ function invoiceReceivablesDo() {
|
|
|
+
|
|
|
+ $receivablesPrice = $this->get_args ( 'receivablesPrice' ) ? $this->get_args ( 'receivablesPrice' ) : "";
|
|
|
+ $receivablesMessage = $this->get_args ( 'receivablesMessage' ) ? $this->get_args ( 'receivablesMessage' ) : "";
|
|
|
+ $receivablesBank = $this->get_args ( 'receivablesBank' ) ? $this->get_args ( 'receivablesBank' ) : "";
|
|
|
+ $receivablesDate = $this->get_args ( 'receivablesDate' ) ? $this->get_args ( 'receivablesDate' ) : "";
|
|
|
+ $receivablesCategory = $this->get_args ( 'receivablesCategory' ) ? $this->get_args ( 'receivablesCategory' ) : "";
|
|
|
+ $receivablesStaff = $this->get_args ( 'receivablesStaff' ) ? $this->get_args ( 'receivablesStaff' ) : "";
|
|
|
+
|
|
|
+ Doo::loadModel ( 'invoiceReceivables' );
|
|
|
+ $invoiceReceivables = new invoiceReceivables ();
|
|
|
+
|
|
|
+ if (! empty ( $receivablesPrice ) && ! empty ( $receivablesMessage ) && ! empty ( $receivablesBank ) && ! empty ( $receivablesDate ) && ! empty ( $receivablesCategory ) && ! empty ( $receivablesStaff )) {
|
|
|
+
|
|
|
+ $item = array (
|
|
|
+ 'receivablesPrice' =>$receivablesPrice,
|
|
|
+ 'receivablesMessage' =>$receivablesMessage,
|
|
|
+ 'receivablesSerial' =>"#SK" . date ( "Ymd" ) . mt_rand ( 1000, 9999 ),
|
|
|
+ 'receivablesBank' =>$receivablesBank,
|
|
|
+ 'receivablesDate' =>$receivablesDate,
|
|
|
+ 'inputStaff' =>$this->staff[0]['username'],
|
|
|
+
|
|
|
+ 'receivablesCategory' =>$receivablesCategory,
|
|
|
+ 'receivablesStaff' => $receivablesStaff
|
|
|
+ );
|
|
|
+ $irid = $invoiceReceivables->addInvoiceReceivables( $item );
|
|
|
+ }
|
|
|
+
|
|
|
+ return "/invoiceReceivables";
|
|
|
+ }
|
|
|
+ /**
|
|
|
+ * 收款认领页面-包括公共认领 办事处认领 最近已认领数据
|
|
|
+ */
|
|
|
+ function invoiceReceivablesClaim(){
|
|
|
+ Doo::loadModel ( 'invoiceReceivables' );
|
|
|
+ $invoiceReceivables = new invoiceReceivables ();
|
|
|
+
|
|
|
+ $receivablesList=$invoiceReceivables->getInvoiceReceivablesByClaim($this->staff[0]['cid']);
|
|
|
+
|
|
|
+ $data ['receivablesList'] = $receivablesList;
|
|
|
+
|
|
|
+ $data ['memu'] = "invoice";
|
|
|
+ $data ['staff'] = $this->staff;
|
|
|
+ $data ['receiptMemu'] = 'invoiceReceivablesClaim';
|
|
|
+ $this->render ( "/admin/invoiceReceivablesClaim", $data );
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 管理员录入的收款 ,确认认领到谁的名下
|
|
|
+ */
|
|
|
+ function invoiceReceivablesAscription(){
|
|
|
+ $irid = $this->get_args ( 'key' ) ? $this->get_args ( 'key' ) : "";
|
|
|
+ Doo::loadModel ( 'invoiceReceivables' );
|
|
|
+ $invoiceReceivables = new invoiceReceivables ();
|
|
|
+
|
|
|
+ $detail=$invoiceReceivables->getInvoiceReceivablesByIrid($irid);
|
|
|
+
|
|
|
+ if (!empty($detail)&&$detail['receivablesStaff']=='PUBLIC'){
|
|
|
+ $item = array (
|
|
|
+ 'irid' =>$detail['irid'],
|
|
|
+ 'receivablesCategory' =>$this->staff[0]['cid'].":".$this->staff[0]['category'],
|
|
|
+ 'receivablesStaff' => $this->staff[0]['sid']."-".$this->staff[0]['username'],
|
|
|
+ 'confirmTime' => date ( "Y-m-d H:i:s" )
|
|
|
+ );
|
|
|
+ $invoiceReceivables->setInvoiceReceivablesByCondition( $item );
|
|
|
+ }
|
|
|
+
|
|
|
+ return "/invoiceReceivablesClaim";
|
|
|
+ }
|
|
|
+
|
|
|
+ function ajaxGetInvoiceReceivables(){
|
|
|
+ $irid = $this->get_args ( 'key' ) ? $this->get_args ( 'key' ) : "";
|
|
|
+ Doo::loadModel ( 'invoiceReceivables' );
|
|
|
+ $invoiceReceivables = new invoiceReceivables ();
|
|
|
+
|
|
|
+ $detail=$invoiceReceivables->getInvoiceReceivablesByIrid($irid);
|
|
|
+
|
|
|
+ echo json_encode ( array (
|
|
|
+ 'status' => 1,
|
|
|
+ 'detail' => $detail
|
|
|
+ ) );
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 异步获取办事处用户
|
|
|
+ */
|
|
|
+ function ajaxGetStaffByCategory() {
|
|
|
+ $cid = $this->get_args ( 'cid' ) ? $this->get_args ( 'cid' ) : "";
|
|
|
+ Doo::loadModel('staff');
|
|
|
+ $staff=new staff();
|
|
|
+
|
|
|
+ if ($cid=="PUBLIC"){
|
|
|
+ echo json_encode ( array (
|
|
|
+ 'status' => 1,
|
|
|
+ 'html' => '<option value="PUBLIC">办事处待认领款项</option>'
|
|
|
+ ) );
|
|
|
+ die ();
|
|
|
+ }
|
|
|
+
|
|
|
+ if (! is_numeric ( $cid )) {
|
|
|
+ echo json_encode ( array (
|
|
|
+ 'status' => 0,
|
|
|
+ 'msg' => 'illegal request'
|
|
|
+ ) );
|
|
|
+ die ();
|
|
|
+ }
|
|
|
+
|
|
|
+ $staffList = $staff->getStaffByCid($cid);
|
|
|
+
|
|
|
+ $html='<option value="PUBLIC">办事处待认领款项</option>';
|
|
|
+ foreach ($staffList as $key=>$value){
|
|
|
+ $html.='<option value="'.$value['sid'].'-'.$value['username'].'">'.$value['category'].'-'.$value['username'].'</option>';
|
|
|
+ }
|
|
|
+
|
|
|
+ echo json_encode ( array (
|
|
|
+ 'status' => 1,
|
|
|
+ 'html' => $html
|
|
|
+ ) );
|
|
|
+ }
|
|
|
|
|
|
/**
|
|
|
* 异步获取一条发票的邮寄信息
|