|
@@ -128,6 +128,9 @@ class InvoiceController extends DooController {
|
|
|
Doo::loadModel ( 'invoiceOperationLog' );
|
|
|
$invoiceOperationLog = new invoiceOperationLog ();
|
|
|
|
|
|
+ Doo::loadModel ( 'invoiceStatistics' );
|
|
|
+ $invoiceStatistics = new invoiceStatistics ();
|
|
|
+
|
|
|
$categoryDetil = $lCategory->getOne ( array (
|
|
|
'SELECT' => 'title',
|
|
|
'where' => 'cid=' . $cid,
|
|
@@ -212,6 +215,15 @@ class InvoiceController extends DooController {
|
|
|
'iid' => $iid
|
|
|
);
|
|
|
$invoiceOperationLog->setInvoiceOperationLog ( $item );
|
|
|
+
|
|
|
+ $item = array (
|
|
|
+ 'date' => date ( "Y-m-d H:i:s" ),
|
|
|
+ 'priceClass' => 1,
|
|
|
+ 'cid' => $this->staff [0] ['cid'],
|
|
|
+ 'staff' => $this->staff [0] ['sid'],
|
|
|
+ 'invoicePrice' => $invoicePrice
|
|
|
+ );
|
|
|
+ $invoiceStatistics->setInvoiceStatisticsByCondition ( $item );
|
|
|
}
|
|
|
|
|
|
return "/invoice";
|
|
@@ -891,10 +903,10 @@ class InvoiceController extends DooController {
|
|
|
$category = $lCategory->getCategory ();
|
|
|
$staffList = $staff->getStaffByCid ( $this->staff [0] ['cid'] );
|
|
|
|
|
|
- $receivablesList=$invoiceReceivables->getInvoiceReceivablesByNew();
|
|
|
- //print_r($receivablesList);
|
|
|
+ $receivablesList = $invoiceReceivables->getInvoiceReceivablesByNew ();
|
|
|
+ // print_r($receivablesList);
|
|
|
|
|
|
- $data ['receivablesList'] =$receivablesList;
|
|
|
+ $data ['receivablesList'] = $receivablesList;
|
|
|
$data ['staffList'] = $staffList;
|
|
|
$data ['category'] = $category;
|
|
|
|
|
@@ -914,12 +926,14 @@ class InvoiceController extends DooController {
|
|
|
$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' ) : "";
|
|
|
+ $receivablesStaff =$receivablesStaff2 = $this->get_args ( 'receivablesStaff' ) ? $this->get_args ( 'receivablesStaff' ) : "";
|
|
|
|
|
|
Doo::loadModel ( 'invoiceReceivables' );
|
|
|
$invoiceReceivables = new invoiceReceivables ();
|
|
|
Doo::loadModel ( 'invoiceROLog' );
|
|
|
$invoiceROLog = new invoiceROLog ();
|
|
|
+ Doo::loadModel ( 'invoiceStatistics' );
|
|
|
+ $invoiceStatistics = new invoiceStatistics ();
|
|
|
|
|
|
if (! empty ( $receivablesPrice ) && ! empty ( $receivablesMessage ) && ! empty ( $receivablesBank ) && ! empty ( $receivablesDate ) && ! empty ( $receivablesCategory ) && ! empty ( $receivablesStaff )) {
|
|
|
|
|
@@ -962,6 +976,27 @@ class InvoiceController extends DooController {
|
|
|
'irid' => $irid
|
|
|
);
|
|
|
$invoiceROLog->setInvoiceROLog ( $item );
|
|
|
+
|
|
|
+ $item = array (
|
|
|
+ 'date' => date ( "Y-m-d H:i:s" ),
|
|
|
+ 'priceClass' => 2,
|
|
|
+ 'irid'=>$irid,
|
|
|
+ 'receivablesPrice' => $receivablesPrice
|
|
|
+ );
|
|
|
+ if ($receivablesCategory != 'PUBLIC') {
|
|
|
+ $receivablesCategory=explode(":", $receivablesCategory);
|
|
|
+ $item += array (
|
|
|
+ 'cid' => $receivablesCategory[0]
|
|
|
+ );
|
|
|
+ }
|
|
|
+
|
|
|
+ if ($receivablesStaff2 != 'PUBLIC'){
|
|
|
+ $receivablesStaff=explode("-", $receivablesStaff2);
|
|
|
+ $item += array (
|
|
|
+ 'staff' => $receivablesStaff[0]
|
|
|
+ );
|
|
|
+ }
|
|
|
+ $invoiceStatistics->setInvoiceStatisticsByCondition ( $item );
|
|
|
}
|
|
|
|
|
|
return "/invoiceReceivables";
|
|
@@ -984,7 +1019,7 @@ class InvoiceController extends DooController {
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * 管理员录入的收款 ,确认认领到谁的名下
|
|
|
+ * 管理员录入的收款 ,确认认领到谁的名下.统计收款金额
|
|
|
*/
|
|
|
function invoiceReceivablesAscription() {
|
|
|
$irid = $this->get_args ( 'key' ) ? $this->get_args ( 'key' ) : "";
|
|
@@ -992,6 +1027,8 @@ class InvoiceController extends DooController {
|
|
|
$invoiceReceivables = new invoiceReceivables ();
|
|
|
Doo::loadModel ( 'invoiceROLog' );
|
|
|
$invoiceROLog = new invoiceROLog ();
|
|
|
+ Doo::loadModel ( 'invoiceStatistics' );
|
|
|
+ $invoiceStatistics = new invoiceStatistics ();
|
|
|
|
|
|
$detail = $invoiceReceivables->getInvoiceReceivablesByIrid ( $irid );
|
|
|
|
|
@@ -1016,6 +1053,13 @@ class InvoiceController extends DooController {
|
|
|
'irid' => $irid
|
|
|
);
|
|
|
$invoiceROLog->setInvoiceROLog ( $item );
|
|
|
+
|
|
|
+ $item = array (
|
|
|
+ 'cid'=>$this->staff [0] ['cid'],
|
|
|
+ 'staff' => $this->staff [0] ['sid']
|
|
|
+ );
|
|
|
+ $invoiceStatistics->updateInvoiceStatisticsByIrid ( $item, $detail ['irid']);
|
|
|
+
|
|
|
}
|
|
|
|
|
|
return "/invoiceReceivablesClaim";
|
|
@@ -1142,8 +1186,7 @@ class InvoiceController extends DooController {
|
|
|
*/
|
|
|
return "/invoice";
|
|
|
}
|
|
|
-
|
|
|
- function invoiceAggregate(){
|
|
|
+ function invoiceAggregate() {
|
|
|
$data ['memu'] = "invoice";
|
|
|
$data ['staff'] = $this->staff;
|
|
|
$data ['receiptMemu'] = 'invoiceAggregate';
|
|
@@ -1346,8 +1389,7 @@ class InvoiceController extends DooController {
|
|
|
'irid' => $detailM ['irid'],
|
|
|
'bindDate' => date ( "Y-m-d H:i:s" ),
|
|
|
'bindStatus' => 1
|
|
|
- )
|
|
|
- ;
|
|
|
+ );
|
|
|
$invoiceReceivables->setInvoiceReceivablesByCondition ( $item );
|
|
|
|
|
|
$price = 0;
|
|
@@ -1450,8 +1492,7 @@ class InvoiceController extends DooController {
|
|
|
'irid' => $detailM ['irid'],
|
|
|
'bindDate' => '',
|
|
|
'bindStatus' => 0
|
|
|
- )
|
|
|
- ;
|
|
|
+ );
|
|
|
$invoiceReceivables->setInvoiceReceivablesByCondition ( $item );
|
|
|
|
|
|
// 操作日志
|