|
@@ -11,6 +11,8 @@ class invoiceReceivables extends DooModel {
|
|
private $INVOICEKEY = "APPROVAL";
|
|
private $INVOICEKEY = "APPROVAL";
|
|
public $irid;
|
|
public $irid;
|
|
public $bindStatus;
|
|
public $bindStatus;
|
|
|
|
+ public $untreadStatus;
|
|
|
|
+ public $untreadStaff;
|
|
public $iid;
|
|
public $iid;
|
|
public $receivablesPrice;
|
|
public $receivablesPrice;
|
|
public $receivablesSerial;
|
|
public $receivablesSerial;
|
|
@@ -26,11 +28,15 @@ class invoiceReceivables extends DooModel {
|
|
public $date;
|
|
public $date;
|
|
public $confirmTime;
|
|
public $confirmTime;
|
|
public $bindDate;
|
|
public $bindDate;
|
|
|
|
+ public $unbundlingTime;
|
|
|
|
+ public $accountClerk;
|
|
public $_table = 'CLD_invoiceReceivables';
|
|
public $_table = 'CLD_invoiceReceivables';
|
|
public $_primarykey = 'irid';
|
|
public $_primarykey = 'irid';
|
|
public $_fields = array (
|
|
public $_fields = array (
|
|
'irid',
|
|
'irid',
|
|
'bindStatus',
|
|
'bindStatus',
|
|
|
|
+ 'untreadStatus',
|
|
|
|
+ 'untreadStaff',
|
|
'iid',
|
|
'iid',
|
|
'receivablesPrice',
|
|
'receivablesPrice',
|
|
'receivablesSerial',
|
|
'receivablesSerial',
|
|
@@ -45,15 +51,33 @@ class invoiceReceivables extends DooModel {
|
|
'source',
|
|
'source',
|
|
'date',
|
|
'date',
|
|
'confirmTime',
|
|
'confirmTime',
|
|
- 'bindDate'
|
|
|
|
|
|
+ 'bindDate',
|
|
|
|
+ 'unbundlingTime',
|
|
|
|
+ 'accountClerk'
|
|
);
|
|
);
|
|
|
|
+ public function getSumOfReceivablesPrice($iridString = "") {
|
|
|
|
+ if (empty ( $iridString ))
|
|
|
|
+ return 0;
|
|
|
|
+
|
|
|
|
+ $list = $this->getOne ( array (
|
|
|
|
+ 'select'=>' sum(receivablesPrice) as receivablesPrice ',
|
|
|
|
+ 'where' => " irid in ( " . $iridString . " )",
|
|
|
|
+ 'groupby' => 'iid',
|
|
|
|
+ 'asArray' => TRUE
|
|
|
|
+ ) );
|
|
|
|
+
|
|
|
|
+ if (empty($list))
|
|
|
|
+ return 0;
|
|
|
|
+ return $list['receivablesPrice'];
|
|
|
|
+ }
|
|
|
|
+
|
|
/**
|
|
/**
|
|
* 获取最新几条收款包括最新的一条操作日志
|
|
* 获取最新几条收款包括最新的一条操作日志
|
|
* @param number $limit
|
|
* @param number $limit
|
|
* @return unknown
|
|
* @return unknown
|
|
*/
|
|
*/
|
|
- public function getInvoiceReceivablesByNew($limit = 4,$con="") {
|
|
|
|
- if ( empty ( $con ))
|
|
|
|
|
|
+ public function getInvoiceReceivablesByNew($limit = 4, $con = "") {
|
|
|
|
+ if (empty ( $con ))
|
|
return array ();
|
|
return array ();
|
|
$list = $this->find ( array (
|
|
$list = $this->find ( array (
|
|
'where' => $con,
|
|
'where' => $con,
|
|
@@ -67,7 +91,7 @@ class invoiceReceivables extends DooModel {
|
|
$invoice = new invoice ();
|
|
$invoice = new invoice ();
|
|
foreach ( $list as $key => $value ) {
|
|
foreach ( $list as $key => $value ) {
|
|
$list [$key] ['invoiceROLog'] = $invoiceROLog->getInvoiceROLogByIrid ( $value ['irid'], 'desc' );
|
|
$list [$key] ['invoiceROLog'] = $invoiceROLog->getInvoiceROLogByIrid ( $value ['irid'], 'desc' );
|
|
- $list [$key] ['invoiceDetail'] =$invoice->getInvoiceByIid($value ['iid']);
|
|
|
|
|
|
+ $list [$key] ['invoiceDetail'] = $invoice->getInvoiceByIid ( $value ['iid'] );
|
|
}
|
|
}
|
|
return $list;
|
|
return $list;
|
|
}
|
|
}
|
|
@@ -75,25 +99,24 @@ class invoiceReceivables extends DooModel {
|
|
/**
|
|
/**
|
|
* 获得最近录入发票,不包含已经绑定的
|
|
* 获得最近录入发票,不包含已经绑定的
|
|
*/
|
|
*/
|
|
- public function getInvoiceReceivablesByInput(){
|
|
|
|
|
|
+ public function getInvoiceReceivablesByInput() {
|
|
$list = $this->find ( array (
|
|
$list = $this->find ( array (
|
|
'where' => "bindStatus=0",
|
|
'where' => "bindStatus=0",
|
|
'desc' => 'irid',
|
|
'desc' => 'irid',
|
|
- 'asArray' => TRUE
|
|
|
|
|
|
+ 'asArray' => TRUE
|
|
) );
|
|
) );
|
|
|
|
|
|
- foreach ($list as $key=>$value){
|
|
|
|
- $list[$key]['receivablesCategory']=explode(':',$value['receivablesCategory']);
|
|
|
|
|
|
+ foreach ( $list as $key => $value ) {
|
|
|
|
+ $list [$key] ['receivablesCategory'] = explode ( ':', $value ['receivablesCategory'] );
|
|
|
|
|
|
- if ($value['receivablesStaff']!='PUBLIC')
|
|
|
|
- $list[$key]['receivablesStaff']=explode('-',$value['receivablesStaff']);
|
|
|
|
|
|
+ if ($value ['receivablesStaff'] != 'PUBLIC')
|
|
|
|
+ $list [$key] ['receivablesStaff'] = explode ( '-', $value ['receivablesStaff'] );
|
|
|
|
|
|
$list [$key] ['iridKey'] = $this->authcode ( $value ['irid'], '' );
|
|
$list [$key] ['iridKey'] = $this->authcode ( $value ['irid'], '' );
|
|
}
|
|
}
|
|
|
|
|
|
return $list;
|
|
return $list;
|
|
}
|
|
}
|
|
-
|
|
|
|
public function getInvoiceReceivablesByClaim($cid = 0, $sid = 0) {
|
|
public function getInvoiceReceivablesByClaim($cid = 0, $sid = 0) {
|
|
if (! empty ( $cid )) {
|
|
if (! empty ( $cid )) {
|
|
$list ['csClaim'] = $this->find ( array (
|
|
$list ['csClaim'] = $this->find ( array (
|
|
@@ -118,10 +141,10 @@ class invoiceReceivables extends DooModel {
|
|
|
|
|
|
if (! empty ( $cid ) && ! empty ( $sid )) {
|
|
if (! empty ( $cid ) && ! empty ( $sid )) {
|
|
|
|
|
|
- $list ['arClaim'] = $this->find ( array (//and receivablesCategory like '" . $cid . ":%'
|
|
|
|
|
|
+ $list ['arClaim'] = $this->find ( array ( // and receivablesCategory like '" . $cid . ":%'
|
|
'where' => "receivablesCategory!='public' and receivablesStaff!='public' and receivablesStaff like '" . $sid . "-%' and bindStatus=0",
|
|
'where' => "receivablesCategory!='public' and receivablesStaff!='public' and receivablesStaff like '" . $sid . "-%' and bindStatus=0",
|
|
'desc' => 'irid',
|
|
'desc' => 'irid',
|
|
- 'asArray' => TRUE
|
|
|
|
|
|
+ 'asArray' => TRUE
|
|
) );
|
|
) );
|
|
foreach ( $list ['arClaim'] as $key => $value ) {
|
|
foreach ( $list ['arClaim'] as $key => $value ) {
|
|
$staff = explode ( "-", $value ['receivablesStaff'] );
|
|
$staff = explode ( "-", $value ['receivablesStaff'] );
|
|
@@ -223,7 +246,7 @@ class invoiceReceivables extends DooModel {
|
|
public function getInvoiceReceivablesByIrid($irid = "", $con = "") {
|
|
public function getInvoiceReceivablesByIrid($irid = "", $con = "") {
|
|
Doo::loadClass ( 'XDeode' );
|
|
Doo::loadClass ( 'XDeode' );
|
|
$XDeode = new XDeode ( 5 );
|
|
$XDeode = new XDeode ( 5 );
|
|
- if (!is_numeric($irid))
|
|
|
|
|
|
+ if (! is_numeric ( $irid ))
|
|
$irid = $this->authcode ( $irid );
|
|
$irid = $this->authcode ( $irid );
|
|
$detail = array ();
|
|
$detail = array ();
|
|
if (! empty ( $irid ) && is_numeric ( $irid ))
|
|
if (! empty ( $irid ) && is_numeric ( $irid ))
|
|
@@ -232,7 +255,7 @@ class invoiceReceivables extends DooModel {
|
|
'asArray' => TRUE
|
|
'asArray' => TRUE
|
|
) );
|
|
) );
|
|
|
|
|
|
- if (empty($detail))
|
|
|
|
|
|
+ if (empty ( $detail ))
|
|
return $detail;
|
|
return $detail;
|
|
$detail ['cid'] = '';
|
|
$detail ['cid'] = '';
|
|
$detail ['title'] = '';
|
|
$detail ['title'] = '';
|
|
@@ -327,14 +350,14 @@ class invoiceReceivables extends DooModel {
|
|
}
|
|
}
|
|
return $list;
|
|
return $list;
|
|
}
|
|
}
|
|
- function getReceivablesByUntreadStatusPage($limit = 0, $con = "", $desc = 'desc') {
|
|
|
|
|
|
+ function getReceivablesByUntreadStatusPage($limit = 0, $con = "", $desc = 'desc', $descField = 'irid') {
|
|
if (empty ( $limit ))
|
|
if (empty ( $limit ))
|
|
return array ();
|
|
return array ();
|
|
|
|
|
|
$list = $this->find ( array (
|
|
$list = $this->find ( array (
|
|
'where' => $con, // " bindStatus=1 and receivablesStaff like '" . $sid . "_%' ".$con,
|
|
'where' => $con, // " bindStatus=1 and receivablesStaff like '" . $sid . "_%' ".$con,
|
|
'limit' => $limit,
|
|
'limit' => $limit,
|
|
- $desc => 'irid',
|
|
|
|
|
|
+ $desc => $descField,
|
|
'asArray' => TRUE
|
|
'asArray' => TRUE
|
|
) );
|
|
) );
|
|
Doo::loadClass ( 'XDeode' );
|
|
Doo::loadClass ( 'XDeode' );
|
|
@@ -367,8 +390,10 @@ class invoiceReceivables extends DooModel {
|
|
return $list;
|
|
return $list;
|
|
}
|
|
}
|
|
function delInvoiceReceivablesByIrid($irid = 0) {
|
|
function delInvoiceReceivablesByIrid($irid = 0) {
|
|
- if (!empty($irid)&&is_numeric($irid))
|
|
|
|
- $this->delete(array('where'=>'irid='.$irid));
|
|
|
|
|
|
+ if (! empty ( $irid ) && is_numeric ( $irid ))
|
|
|
|
+ $this->delete ( array (
|
|
|
|
+ 'where' => 'irid=' . $irid
|
|
|
|
+ ) );
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|