|
@@ -681,7 +681,7 @@ class InvoiceController extends DooController {
|
|
|
Doo::loadModel ( 'invoiceTraining' );
|
|
|
$invoiceTraining = new invoiceTraining ();
|
|
|
|
|
|
- $itTodoList = $invoiceTraining->getInvoiceTrainingByTodo ( '', $this->staff [0] ['cid'], $this->staff [0] ['sid']);
|
|
|
+ $itTodoList = $invoiceTraining->getInvoiceTrainingByTodo ( '', $this->staff [0] ['cid'], $this->staff [0] ['sid'] );
|
|
|
$itedList = $invoiceTraining->getInvoiceTrainingByStatus ( 2, '', $this->staff [0] ['cid'], $this->staff [0] ['sid'] );
|
|
|
$category = $lCategory->getCategory ();
|
|
|
|
|
@@ -784,7 +784,7 @@ class InvoiceController extends DooController {
|
|
|
foreach ( $isList as $key => $value ) {
|
|
|
$irDetail = array ();
|
|
|
if ($value ['apStatus'] == 1) {
|
|
|
- //array_push ( $irDetail, '' );
|
|
|
+ // array_push ( $irDetail, '' );
|
|
|
array_push ( $irDetail, '<input class="hide" disabled type="checkbox" >' );
|
|
|
} else {
|
|
|
|
|
@@ -800,9 +800,9 @@ class InvoiceController extends DooController {
|
|
|
array_push ( $irDetail, $value ['invoiceTitle'] );
|
|
|
array_push ( $irDetail, $value ['TIN'] );
|
|
|
|
|
|
- if (empty ( $value ['mailItems'])&&$value ['apStatus'] != 1){
|
|
|
+ if (empty ( $value ['mailItems'] ) && $value ['apStatus'] != 1) {
|
|
|
array_push ( $irDetail, '<a href="#confirm-erro" onclick="invoiceStoreMail(\'' . $value ['storeKey'] . '\')" data-toggle="modal">设置邮寄物品</a>' );
|
|
|
- }else
|
|
|
+ } else
|
|
|
array_push ( $irDetail, $value ['mailItems'] );
|
|
|
array_push ( $irDetail, $value ['recipientsAddress'] . $value ['recipients'] . $value ['recipientsPhone'] );
|
|
|
|
|
@@ -818,7 +818,6 @@ class InvoiceController extends DooController {
|
|
|
array_push ( $irDetail, '¥' . $value ['invoicePrice'] );
|
|
|
array_push ( $irDetail, $value ['remark'] );
|
|
|
|
|
|
-
|
|
|
if ($value ['status'] == 1)
|
|
|
array_push ( $irDetail, '审批中' );
|
|
|
elseif ($value ['status'] == 2 && $value ['printStatus'] == 1)
|
|
@@ -931,7 +930,7 @@ class InvoiceController extends DooController {
|
|
|
|
|
|
$exlArray = $this->_format_excel_to_array ( DOO::conf ()->SITE_PATH . "upload/invoiceTraining/" . $path, 'invoiceTrain' );
|
|
|
|
|
|
- $userName=$this->staff [0] ['username'];
|
|
|
+ $userName = $this->staff [0] ['username'];
|
|
|
$sDetail = $staff->getStaffByName ( $userName );
|
|
|
|
|
|
// 可以优化
|
|
@@ -942,7 +941,7 @@ class InvoiceController extends DooController {
|
|
|
$invoice->trainId = $itid;
|
|
|
|
|
|
$invoice->invoiceType = 0;
|
|
|
- if ($value ['invoiceType'] == '专'||$value ['invoiceType'] == '专票')
|
|
|
+ if ($value ['invoiceType'] == '专' || $value ['invoiceType'] == '专票')
|
|
|
$invoice->invoiceType = 1;
|
|
|
|
|
|
$invoice->invoiceQuantity = $value ['invoiceQuantity'];
|
|
@@ -951,10 +950,10 @@ class InvoiceController extends DooController {
|
|
|
$invoice->invoicePrice = $value ['invoiceQuantity'] * $value ['invoiceUnitPrice'];
|
|
|
|
|
|
$invoice->invoiceTitle = $value ['invoiceTitle'];
|
|
|
- if ($value ['invoiceType'] == '专'||$value ['invoiceType'] == '专票')
|
|
|
+ if ($value ['invoiceType'] == '专' || $value ['invoiceType'] == '专票')
|
|
|
$invoice->invoiceCompany = $value ['invoiceTitle'];
|
|
|
|
|
|
- $invoice->userName =$userName;
|
|
|
+ $invoice->userName = $userName;
|
|
|
|
|
|
$invoice->sid = $sDetail ['sid'];
|
|
|
$invoice->cid = $sDetail ['cid'];
|
|
@@ -2071,7 +2070,7 @@ class InvoiceController extends DooController {
|
|
|
if (count ( $processApprovals ) == count ( $invoiceManage ) && $status != 4) {
|
|
|
$invoice->status = $status;
|
|
|
$invoice->pendingApprovals = 0;
|
|
|
- $invoice->approvalTime=date ( "Y-m-d H:i:s" );
|
|
|
+ $invoice->approvalTime = date ( "Y-m-d H:i:s" );
|
|
|
} elseif ($status == 4) {
|
|
|
$invoice->status = $status;
|
|
|
$item = array (
|
|
@@ -2245,7 +2244,7 @@ class InvoiceController extends DooController {
|
|
|
|
|
|
$pageinfo = $this->get_page ( "CLD_invoice", $sql, $page, $page_size, $action, $get, "" );
|
|
|
$limit = $pageinfo ['lower'] . ',' . $page_size;
|
|
|
- $list = $invoice->getInvoiceByUntreadStatusPage ( $limit, $sql,'desc',5 );
|
|
|
+ $list = $invoice->getInvoiceByUntreadStatusPage ( $limit, $sql, 'desc', 5 );
|
|
|
|
|
|
$this->data ['MebSeaEn'] = $MebSea;
|
|
|
$this->data ['MebSea'] = urlencode ( $MebSea );
|
|
@@ -2314,7 +2313,7 @@ class InvoiceController extends DooController {
|
|
|
$invoice->setInvoiceByCondition ( $item );
|
|
|
$item = array (
|
|
|
'date' => date ( "Y-m-d H:i:s" ),
|
|
|
- 'operation' => $invoiceNo,
|
|
|
+ 'operation' => '打印发票号:'.$invoiceNo,
|
|
|
'status' => 5,
|
|
|
'img' => $this->staff [0] ['avatar'],
|
|
|
'username' => $this->staff [0] ['username'],
|
|
@@ -2765,11 +2764,11 @@ class InvoiceController extends DooController {
|
|
|
|
|
|
$receivablesInput = $invoiceReceivables->getInvoiceReceivablesByInput ();
|
|
|
|
|
|
- $halfList=$invoiceReceivables->getInvoiceReceivablesByHalf();
|
|
|
+ $halfList = $invoiceReceivables->getInvoiceReceivablesByHalf ();
|
|
|
$this->data ['halfList'] = $halfList;
|
|
|
$this->data ['halfCount'] = count ( $halfList );
|
|
|
|
|
|
- //print_r($receivablesList);
|
|
|
+ // print_r($receivablesList);
|
|
|
$this->data ['receivablesDate'] = date ( "Y-m-d" );
|
|
|
$this->data ['ieaCount'] = count ( $invoiceExistAccount );
|
|
|
$this->data ['invoiceExistAccount'] = $invoiceExistAccount;
|
|
@@ -2822,9 +2821,15 @@ class InvoiceController extends DooController {
|
|
|
|
|
|
// 收款录入 并绑定发票
|
|
|
Doo::db ()->beginTransaction ();
|
|
|
+
|
|
|
+ $bindStatus=0;
|
|
|
+ if ($receivablesPrice<=$invoiceDetail['invoicePrice'])
|
|
|
+ $bindStatus=1;
|
|
|
+
|
|
|
$item = array (
|
|
|
- 'bindStatus' => 1,
|
|
|
+ 'bindStatus' => $bindStatus,
|
|
|
'iid' => $invoiceDetail ['iid'],
|
|
|
+ 'bindPrice'=>$invoiceDetail['invoicePrice'],
|
|
|
'bindDate' => date ( "Y-m-d H:i:s" ),
|
|
|
'receivablesPrice' => $receivablesPrice,
|
|
|
'receivablesMessage' => $receivablesMessage,
|
|
@@ -3226,13 +3231,10 @@ class InvoiceController extends DooController {
|
|
|
|
|
|
$list = $invoiceReceivables->getInvoiceReceivablesByClaim ( $this->staff [0] ['cid'], $this->staff [0] ['sid'] );
|
|
|
|
|
|
-
|
|
|
-
|
|
|
$this->data ['isMonth'] = $isMonth;
|
|
|
$this->data ['htm'] = $htm;
|
|
|
$this->data ['list'] = $list;
|
|
|
|
|
|
-
|
|
|
$this->data ['memu'] = "invoice";
|
|
|
$this->data ['staff'] = $this->staff;
|
|
|
$this->data ['receiptMemu'] = 'invoiceMyReceivables';
|
|
@@ -3264,39 +3266,39 @@ class InvoiceController extends DooController {
|
|
|
if ($detail ['untreadStatus'] == 3)
|
|
|
die ( 'illegal request' );
|
|
|
|
|
|
- //修改 绑定状态改为 金额
|
|
|
+ // 修改 绑定状态改为 金额
|
|
|
$invoiceReceivables = new invoiceReceivables ();
|
|
|
|
|
|
- $invoicePrice=$detail['invoicePrice']+$detailM['bindPrice'];
|
|
|
- if ($detailM['receivablesPrice']>$invoicePrice){
|
|
|
- $item=array(
|
|
|
- 'bindPrice'=>$invoicePrice
|
|
|
+ $invoicePrice = $detail ['invoicePrice'] + $detailM ['bindPrice'];
|
|
|
+ if ($detailM ['receivablesPrice'] > $invoicePrice) {
|
|
|
+ $item = array (
|
|
|
+ 'bindPrice' => $invoicePrice
|
|
|
);
|
|
|
- }elseif ($detailM['receivablesPrice']<=$invoicePrice){
|
|
|
- $item=array(
|
|
|
- 'bindPrice'=>$invoicePrice,
|
|
|
- 'bindStatus'=>1,
|
|
|
- 'bindDate' => date ( "Y-m-d H:i:s" )
|
|
|
+ } elseif ($detailM ['receivablesPrice'] <= $invoicePrice) {
|
|
|
+ $item = array (
|
|
|
+ 'bindPrice' => $invoicePrice,
|
|
|
+ 'bindStatus' => 1,
|
|
|
+ 'bindDate' => date ( "Y-m-d H:i:s" )
|
|
|
);
|
|
|
- }else{
|
|
|
+ } else {
|
|
|
die ( 'illegal request' );
|
|
|
}
|
|
|
|
|
|
- if($detailM['iid']==0){
|
|
|
- $item+=array(
|
|
|
- 'iid'=>$detail ['iid']
|
|
|
+ if ($detailM ['iid'] == 0) {
|
|
|
+ $item += array (
|
|
|
+ 'iid' => $detail ['iid']
|
|
|
);
|
|
|
- }else{
|
|
|
- $iidExtend=explode(',', $detailM ['iidExtend']);
|
|
|
- array_push($iidExtend, $detail ['iid']);
|
|
|
- $item+=array(
|
|
|
- 'iidExtend'=>implode(',', $iidExtend)
|
|
|
+ } else {
|
|
|
+ $iidExtend = explode ( ',', $detailM ['iidExtend'] );
|
|
|
+ array_push ( $iidExtend, $detail ['iid'] );
|
|
|
+ $item += array (
|
|
|
+ 'iidExtend' => implode ( ',', $iidExtend )
|
|
|
);
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
$item += array (
|
|
|
'irid' => $detailM ['irid'],
|
|
|
- 'accountClerk' => $this->staff [0] ['username']
|
|
|
+ 'accountClerk' => $this->staff [0] ['username']
|
|
|
);
|
|
|
$invoiceReceivables->setInvoiceReceivablesByCondition ( $item );
|
|
|
|
|
@@ -3845,6 +3847,7 @@ class InvoiceController extends DooController {
|
|
|
*/
|
|
|
function invoiceUnBundLing() {
|
|
|
$unBundKey = $this->get_args ( 'unBundKey' ) ? $this->get_args ( 'unBundKey' ) : '';
|
|
|
+ $iidKey = $this->get_args ( 'iidKey' ) ? $this->get_args ( 'iidKey' ) : '';
|
|
|
|
|
|
Doo::loadModel ( 'invoice' );
|
|
|
$invoice = new invoice ();
|
|
@@ -3855,22 +3858,46 @@ class InvoiceController extends DooController {
|
|
|
Doo::loadModel ( 'invoiceROLog' );
|
|
|
$invoiceROLog = new invoiceROLog ();
|
|
|
Doo::loadModel ( 'invoiceStatistics' );
|
|
|
+ Doo::loadClass ( 'XDeode' );
|
|
|
+ $XDeode = new XDeode ( 5 );
|
|
|
|
|
|
+ if (empty ( $iidKey ) )
|
|
|
+ die ( 'illegal request' );
|
|
|
+
|
|
|
+ $iid = $XDeode->decode ( $iidKey );
|
|
|
$irid = $invoice->authcode ( $unBundKey );
|
|
|
- if (! empty ( $irid ) && ! is_numeric ( $irid ))
|
|
|
+ if ((! empty ( $irid ) && ! is_numeric ( $irid ))|| (! empty ( $iid ) && ! is_numeric ( $iid )))
|
|
|
die ( 'illegal request' );
|
|
|
|
|
|
$irDetails = $invoiceReceivables->getInvoiceReceivablesByIrid ( $irid );
|
|
|
- $invoiceDetails = $invoice->getInvoiceByIid ( $irDetails ['iid'] );
|
|
|
+ $invoiceDetails = $invoice->getInvoiceByIid ( $iid );
|
|
|
|
|
|
- if (empty ( $irDetails ) || $irDetails ['bindStatus'] == 0 || $invoiceDetails ['untreadStatus'] == 2)
|
|
|
+ if (empty ( $irDetails ) || empty ( $invoiceDetails ) || (empty ( $irDetails['iid'] )&& empty ( $irDetails['iidExtend'] )) || $invoiceDetails ['untreadStatus'] == 2)
|
|
|
die ( 'illegal request' );
|
|
|
- // 收款
|
|
|
+
|
|
|
+
|
|
|
+ //收款
|
|
|
$item = array (
|
|
|
'irid' => $irDetails ['irid'],
|
|
|
- 'bindStatus' => 0,
|
|
|
- 'iid' => 0
|
|
|
+ 'bindPrice'=>$irDetails['bindPrice']-$invoiceDetails['invoicePrice'],
|
|
|
+ 'bindStatus' => 0
|
|
|
);
|
|
|
+ if ($irDetails['iid']==$iid)
|
|
|
+ $item += array (
|
|
|
+ 'iid' => 0
|
|
|
+ );
|
|
|
+ else{
|
|
|
+ $iidExtend=explode(',', $irDetails['iidExtend']);
|
|
|
+ foreach ($iidExtend as $key=>$value){
|
|
|
+ if ($value==$iid)
|
|
|
+ unset($iidExtend[$key]);
|
|
|
+ }
|
|
|
+ $iidExtend=implode(',', $iidExtend);
|
|
|
+ $item += array (
|
|
|
+ 'iidExtend' => $iidExtend
|
|
|
+ );
|
|
|
+ }
|
|
|
+
|
|
|
$invoiceReceivables->setInvoiceReceivablesByCondition ( $item );
|
|
|
|
|
|
// 收款操作日志
|
|
@@ -3948,6 +3975,45 @@ class InvoiceController extends DooController {
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
+ * 或者该收款下的所以发票
|
|
|
+ */
|
|
|
+ function ajaxGetInvoiceReceivablesByInvoice() {
|
|
|
+ $irid = $this->get_args ( 'postData' ) ? $this->get_args ( 'postData' ) : '';
|
|
|
+
|
|
|
+ Doo::loadModel ( 'invoice' );
|
|
|
+ $invoice = new invoice ();
|
|
|
+ Doo::loadModel ( 'invoiceReceivables' );
|
|
|
+ $invoiceReceivables = new invoiceReceivables ();
|
|
|
+
|
|
|
+ $irid = $invoice->authcode ( $irid );
|
|
|
+ if (! empty ( $irid ) && ! is_numeric ( $irid ))
|
|
|
+ die ( 'illegal request' );
|
|
|
+
|
|
|
+ $irDetails = $invoiceReceivables->getInvoiceReceivablesByIrid ( $irid );
|
|
|
+ $iidString = $irDetails ['iid'];
|
|
|
+
|
|
|
+ $iidExtend=array_filter(explode(',', $irDetails ['iidExtend']));
|
|
|
+ if (! empty ( $irDetails ['iidExtend'] ))
|
|
|
+ $iidString .= ',' . implode(',', $iidExtend) ;
|
|
|
+
|
|
|
+ $invoiceList = $invoice->getInvoiceInIid ( $iidString, 'iid,invoiceSerial,invoicePrice,invoiceTitle,invoiceCompany,invoiceElement' );
|
|
|
+
|
|
|
+
|
|
|
+ $html = "";
|
|
|
+ foreach ( $invoiceList as $key => $value ) {
|
|
|
+ $title=$value['invoiceTitle'];
|
|
|
+ if (!empty($value['invoiceCompany']))
|
|
|
+ $title=$value['invoiceCompany'];
|
|
|
+ $html .= '<tr><td>'.$value['invoiceSerial'].'</td><td>¥'.$value['invoicePrice'].'</td><td>'.$title.'</td><td>'.$value['invoiceElement'].'</td><td><input type="radio" name="iidKey" value="'.$value['iidKey'].'"></td></tr>';
|
|
|
+ }
|
|
|
+ echo json_encode ( array (
|
|
|
+ 'status' => 1,
|
|
|
+ 'html' => $html
|
|
|
+ ) );
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
* 发票管理
|
|
|
*/
|
|
|
function invoiceAS() {
|
|
@@ -4074,25 +4140,19 @@ class InvoiceController extends DooController {
|
|
|
'previous' => ''
|
|
|
);
|
|
|
|
|
|
-
|
|
|
$sql = 'select count(*) as count
|
|
|
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, "invoiceReceivablesAS", $get, "");
|
|
|
+ $pageinfo = $this->getPageBySql ( $sql, $page, $page_size, "invoiceReceivablesAS", $get, "" );
|
|
|
|
|
|
- //print_r($pageinfo);
|
|
|
+ // print_r($pageinfo);
|
|
|
|
|
|
- //$pageinfo = $this->get_page ( "CLD_invoiceReceivables", $con, $page, $page_size, "invoiceReceivablesAS", $get, "" );
|
|
|
+ // $pageinfo = $this->get_page ( "CLD_invoiceReceivables", $con, $page, $page_size, "invoiceReceivablesAS", $get, "" );
|
|
|
$limit = $pageinfo ['lower'] . ',' . $page_size;
|
|
|
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
$list = $invoiceReceivables->getInvoiceReceivablesByConditionPage ( $limit, $con, 'desc', $descField );
|
|
|
// print_r($list);
|
|
|
|
|
@@ -4123,11 +4183,11 @@ class InvoiceController extends DooController {
|
|
|
|
|
|
$con = '';
|
|
|
if ($date == 'MONTHO')
|
|
|
- $con = ' and updateTime>DATE_SUB(CURDATE(), INTERVAL 1 MONTH)';
|
|
|
+ $con = ' and approvalTime>DATE_SUB(CURDATE(), INTERVAL 1 MONTH)';
|
|
|
elseif ($date == 'MONTHT')
|
|
|
- $con = ' and updateTime>DATE_SUB(CURDATE(), INTERVAL 3 MONTH)';
|
|
|
+ $con = ' and approvalTime>DATE_SUB(CURDATE(), INTERVAL 3 MONTH)';
|
|
|
elseif ($date == 'MONTHY')
|
|
|
- $con = ' and updateTime>DATE_SUB(CURDATE(), INTERVAL 1 YEAR)';
|
|
|
+ $con = ' and approvalTime>DATE_SUB(CURDATE(), INTERVAL 1 YEAR)';
|
|
|
|
|
|
if (! empty ( $MebSea )) {
|
|
|
$con .= ' and ( invoiceTitle like "%' . $MebSea . '%" or invoiceCompany like "%' . $MebSea . '%" or invoicePrice like "%' . $MebSea . '%" )';
|
|
@@ -4203,7 +4263,7 @@ class InvoiceController extends DooController {
|
|
|
|
|
|
$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 );
|
|
@@ -4216,27 +4276,13 @@ class InvoiceController extends DooController {
|
|
|
$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;
|
|
|
- }
|
|
|
+ $list = $invoice->getInvoiceByUntreadStatusPage ( $limit, $sql,'desc',5 );
|
|
|
+
|
|
|
$this->data ['receiptMemu'] = 'invoicePrint';
|
|
|
$this->data ['list'] = $list;
|
|
|
$this->render ( "/admin/invoicePrintAchieve", $this->data );
|
|
|
} elseif ($this->ACTION == 'invoicePostAchieve') {
|
|
|
-
|
|
|
+ $list = $invoice->getInvoiceByUntreadStatusPage ( $limit, $sql );
|
|
|
Doo::loadModel ( 'express' );
|
|
|
$express = new express ();
|
|
|
$expressList = $express->getExpressByAll ();
|
|
@@ -4246,7 +4292,7 @@ class InvoiceController extends DooController {
|
|
|
$this->data ['list'] = $list;
|
|
|
$this->render ( "/admin/invoicePostAchieve", $this->data );
|
|
|
} elseif ($this->ACTION == 'invoiceUntreadAchieve') {
|
|
|
-
|
|
|
+ $list = $invoice->getInvoiceByUntreadStatusPage ( $limit, $sql );
|
|
|
$this->data ['receiptMemu'] = 'invoiceUntread';
|
|
|
$this->data ['list'] = $list;
|
|
|
$this->render ( "/admin/invoiceUntreadAchieve", $this->data );
|
|
@@ -4421,7 +4467,7 @@ class InvoiceController extends DooController {
|
|
|
$html = '
|
|
|
|
|
|
<form action="/invoicePrintDo" method="post" name="invoicePrint" class="nice-validator n-yellow" onSubmit="return checkPrintForm()" novalidate="novalidate">
|
|
|
- <input type="hidden" name="invoiceKey" value="'.$detail ['iidKeyXD'].'">
|
|
|
+ <input type="hidden" name="invoiceKey" value="' . $detail ['iidKeyXD'] . '">
|
|
|
|
|
|
<div class="modal-dialog modal-lg">
|
|
|
|
|
@@ -4511,14 +4557,13 @@ class InvoiceController extends DooController {
|
|
|
|
|
|
|
|
|
</tr></tbody></table>';
|
|
|
-
|
|
|
}
|
|
|
$html .= '</div><div class="modal-footer"><button type="submit" class="button btn-green" data-toggle="modal">完成打印</button><a href="#" class="button btn-gray" data-dismiss="modal" aria-hidden="true">关闭</a></div>
|
|
|
</div></div></form>
|
|
|
- <link rel=stylesheet href="'.WEB_SITE_GLOBAL.'css/jquery.validator.css">
|
|
|
- <script type="text/javascript" src="'.WEB_SITE_GLOBAL.'js/jquery.validator.min.js"></script>
|
|
|
- <script type="text/javascript" src="'.WEB_SITE_GLOBAL.'js/zh-CN.js"></script>
|
|
|
- <script src="'.WEB_SITE_GLOBAL.'js/invoice.validator.js"></script>
|
|
|
+ <link rel=stylesheet href="' . WEB_SITE_GLOBAL . 'css/jquery.validator.css">
|
|
|
+ <script type="text/javascript" src="' . WEB_SITE_GLOBAL . 'js/jquery.validator.min.js"></script>
|
|
|
+ <script type="text/javascript" src="' . WEB_SITE_GLOBAL . 'js/zh-CN.js"></script>
|
|
|
+ <script src="' . WEB_SITE_GLOBAL . 'js/invoice.validator.js"></script>
|
|
|
|
|
|
|
|
|
';
|
|
@@ -4609,7 +4654,7 @@ class InvoiceController extends DooController {
|
|
|
<th class="taC">银行账号</th><td>' . $detail ['bankAccount'] . '</td>
|
|
|
</tr></tbody></table>';
|
|
|
|
|
|
- if ($detail ['doPost'] == 1){
|
|
|
+ if ($detail ['doPost'] == 1) {
|
|
|
$html .= '<table class="table table-bordered table-condensed"><tbody><tr><th colspan="4" class="taC">邮寄信息</th></tr><tr>
|
|
|
<th class="taC" width="150">收件人</th><td>' . $detail ['recipients'] . '</td>
|
|
|
<th class="taC" width="150">收件人手机/电话</th><td>' . $detail ['recipientsPhone'] . '</td>
|
|
@@ -4619,13 +4664,12 @@ class InvoiceController extends DooController {
|
|
|
<th class="taC" width="150">邮寄物品</th><td colspan="3">' . $detail ['mailItems'] . '</td>
|
|
|
</tr>
|
|
|
';
|
|
|
-
|
|
|
- if ($detail ['expressCom']=='SF')
|
|
|
+
|
|
|
+ if ($detail ['expressCom'] == 'SF')
|
|
|
$html .= '<tr><th class="taC" width="150">快递单号</th><td colspan="3">' . $detail ['expressCompany'] . ' <a target="_blank" href="http://www.sf-express.com/cn/sc/dynamic_function/waybill/#search/bill-number/">' . $detail ['expressNumber'] . '</a> </td></tr>';
|
|
|
- else
|
|
|
- $html .= '<tr><th class="taC" width="150">快递单号</th><td colspan="3">' . $detail ['expressCompany'] . ' <a target="_blank" href="/invoiceExpress/'.$detail ['expressCom'].'/' . $detail ['expressNumber'] . '.html">' . $detail ['expressNumber'] . '</a> </td></tr>';
|
|
|
+ else
|
|
|
+ $html .= '<tr><th class="taC" width="150">快递单号</th><td colspan="3">' . $detail ['expressCompany'] . ' <a target="_blank" href="/invoiceExpress/' . $detail ['expressCom'] . '/' . $detail ['expressNumber'] . '.html">' . $detail ['expressNumber'] . '</a> </td></tr>';
|
|
|
$html .= '</tbody></table>';
|
|
|
-
|
|
|
}
|
|
|
if (! empty ( $invoiceOperationLogList )) {
|
|
|
$html .= '<table class="table table-bordered table-condensed"><tbody><tr><th width="60%" class="taC">审批流程</th></tr><tr><td>';
|
|
@@ -4991,7 +5035,7 @@ class InvoiceController extends DooController {
|
|
|
Doo::loadModel ( 'invoice' );
|
|
|
$invoice = new invoice ();
|
|
|
|
|
|
- $invoiceDetail = $invoice->getInvoiceByTitle ( $title, 'EXACTLY', " and status=2 and printStatus=1 and untreadStatus=0 " );
|
|
|
+ $invoiceDetail = $invoice->getInvoiceByTitle ( $title, 'FUZZY', " and status=2 and printStatus=1 and untreadStatus=0 and irid='' " );
|
|
|
|
|
|
$invoiceHtml = '';
|
|
|
if (! empty ( $invoiceDetail )) {
|
|
@@ -5446,7 +5490,7 @@ class InvoiceController extends DooController {
|
|
|
$excel_column ['recipients'] = $val;
|
|
|
} elseif ($currentColumn == 'N') {
|
|
|
$excel_column ['recipientsPhone'] = $val;
|
|
|
- }
|
|
|
+ }
|
|
|
} else {
|
|
|
if ($currentColumn == 'A')
|
|
|
$excel_column ['invoiceNo'] = $val;
|
|
@@ -5698,7 +5742,6 @@ class InvoiceController extends DooController {
|
|
|
return $result ['count'];
|
|
|
}
|
|
|
|
|
|
-
|
|
|
/**
|
|
|
* 获得分页数据
|
|
|
* @param unknown_type $table
|
|
@@ -5706,36 +5749,36 @@ class InvoiceController extends DooController {
|
|
|
* @param unknown_type $on_page
|
|
|
* @param unknown_type $page_size
|
|
|
*/
|
|
|
- function getPageBySql($sql= "", $on_page = 1, $page_size = 20, $action = "", $get = "", $other = "page") {
|
|
|
+ function getPageBySql($sql = "", $on_page = 1, $page_size = 20, $action = "", $get = "", $other = "page") {
|
|
|
$page_c = "";
|
|
|
$page ['previous'] = $this->get_previous ( $on_page );
|
|
|
$page ['on_page'] = $on_page;
|
|
|
$total_count = $this->getTableCountBySql ( $sql );
|
|
|
$total = intval ( $total_count / $page_size );
|
|
|
-
|
|
|
+
|
|
|
$page ['total_page'] = ($total_count % $page_size) == 0 ? $total : $total + 1;
|
|
|
$page ['total_data'] = $total_count;
|
|
|
$page ['next'] = $on_page == $page ['total_page'] ? $page ['total_page'] : $on_page + 1;
|
|
|
-
|
|
|
+
|
|
|
$i = 1;
|
|
|
$page_max = 1;
|
|
|
$page_width = 3;
|
|
|
-
|
|
|
+
|
|
|
if ($on_page >= $page_width) {
|
|
|
$page_max = intval ( $on_page / $page_width ) + 1;
|
|
|
$i = intval ( $on_page / $page_width ) * $page_width - 1;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
for(; $i <= $page ['total_page']; $i ++) {
|
|
|
if ($i == $on_page)
|
|
|
$page_c .= '<li class="active"><a href="javascript:void(0)">' . $i . '</a></li>';
|
|
|
- else
|
|
|
- $page_c .= '<li><a href="/' . $action . '/' . $i . $get . '">' . $i . '</a></li>';
|
|
|
-
|
|
|
- if ($i == ($page_width * $page_max))
|
|
|
- break;
|
|
|
+ else
|
|
|
+ $page_c .= '<li><a href="/' . $action . '/' . $i . $get . '">' . $i . '</a></li>';
|
|
|
+
|
|
|
+ if ($i == ($page_width * $page_max))
|
|
|
+ break;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
$page ['page'] = $page_c;
|
|
|
$page ['lower'] = (-- $on_page) * $page_size;
|
|
|
return $page;
|
|
@@ -5746,12 +5789,11 @@ class InvoiceController extends DooController {
|
|
|
* @param string $type
|
|
|
* @return boolean[]
|
|
|
*/
|
|
|
- public function getTableCountBySql($sql=""){
|
|
|
+ public function getTableCountBySql($sql = "") {
|
|
|
$query = Doo::db ()->query ( $sql );
|
|
|
$result = $query->fetch ();
|
|
|
return $result ['count'];
|
|
|
- }
|
|
|
-
|
|
|
+ }
|
|
|
function isInvoiceNew($type = "GLOBAL") {
|
|
|
Doo::loadModel ( 'invoice' );
|
|
|
$invoice = new invoice ();
|