|
@@ -18,6 +18,7 @@ class invoiceReceivables extends DooModel {
|
|
|
public $receivablesCategory;
|
|
|
public $receivablesStaff;
|
|
|
public $inputStaff;
|
|
|
+ public $source;
|
|
|
public $date;
|
|
|
public $confirmTime;
|
|
|
|
|
@@ -33,39 +34,55 @@ class invoiceReceivables extends DooModel {
|
|
|
'receivablesCategory',
|
|
|
'receivablesStaff',
|
|
|
'inputStaff',
|
|
|
+ 'source',
|
|
|
'date',
|
|
|
'confirmTime'
|
|
|
);
|
|
|
|
|
|
- public function getInvoiceReceivablesByClaim($cid){
|
|
|
- $list['csClaim'] = $this->find ( array (
|
|
|
- 'where' => "receivablesCategory='public' and receivablesStaff='public' ",
|
|
|
- 'desc' => 'irid',
|
|
|
- 'asArray' => TRUE
|
|
|
- ) );
|
|
|
- foreach ( $list ['csClaim'] as $key => $value ) {
|
|
|
- $list ['csClaim'] [$key] ['iidKey'] = $this->authcode ( $value ['irid'], '' );
|
|
|
- //$list ['csClaim'] [$key] ['iidKeyUrl'] = $XDeode->encode ( $value ['iid'] );
|
|
|
- }
|
|
|
-
|
|
|
- $list['sClaim'] = $this->find ( array (
|
|
|
- 'where' => "receivablesCategory!='public' and receivablesStaff='public' and receivablesCategory like '".$cid.":%'",
|
|
|
- 'desc' => 'irid',
|
|
|
- 'asArray' => TRUE
|
|
|
- ) );
|
|
|
- foreach ( $list ['sClaim'] as $key => $value ) {
|
|
|
- $list ['sClaim'] [$key] ['iidKey'] = $this->authcode ( $value ['irid'], '' );
|
|
|
+ public function getInvoiceReceivablesByClaim($cid=0,$sid=0){
|
|
|
+ if (empty($sid)){
|
|
|
+ $list['csClaim'] = $this->find ( array (
|
|
|
+ 'where' => "receivablesCategory='public' and receivablesStaff='public' ",
|
|
|
+ 'desc' => 'irid',
|
|
|
+ 'asArray' => TRUE
|
|
|
+ ) );
|
|
|
+ foreach ( $list ['csClaim'] as $key => $value ) {
|
|
|
+ $list ['csClaim'] [$key] ['iidKey'] = $this->authcode ( $value ['irid'], '' );
|
|
|
+ //$list ['csClaim'] [$key] ['iidKeyUrl'] = $XDeode->encode ( $value ['iid'] );
|
|
|
+ }
|
|
|
+
|
|
|
+ $list['sClaim'] = $this->find ( array (
|
|
|
+ 'where' => "receivablesCategory!='public' and receivablesStaff='public' and receivablesCategory like '".$cid.":%'",
|
|
|
+ 'desc' => 'irid',
|
|
|
+ 'asArray' => TRUE
|
|
|
+ ) );
|
|
|
+ foreach ( $list ['sClaim'] as $key => $value ) {
|
|
|
+ $list ['sClaim'] [$key] ['iidKey'] = $this->authcode ( $value ['irid'], '' );
|
|
|
+ }
|
|
|
+
|
|
|
+ $list['arClaim'] = $this->find ( array (
|
|
|
+ 'where' => "receivablesCategory!='public' and receivablesStaff!='public' and receivablesCategory like '".$cid.":%'",
|
|
|
+ 'desc' => 'irid',
|
|
|
+ 'asArray' => TRUE
|
|
|
+ ) );
|
|
|
+ foreach ( $list ['arClaim'] as $key => $value ) {
|
|
|
+ $staff = explode ( "-", $value ['receivablesStaff'] );
|
|
|
+ $list ['arClaim'] [$key] ['sid'] = $staff [0];
|
|
|
+ $list ['arClaim'] [$key] ['username'] = $staff [1];
|
|
|
+ }
|
|
|
}
|
|
|
-
|
|
|
- $list['arClaim'] = $this->find ( array (
|
|
|
- 'where' => "receivablesCategory!='public' and receivablesStaff!='public' and receivablesCategory like '".$cid.":%'",
|
|
|
- 'desc' => 'irid',
|
|
|
- 'asArray' => TRUE
|
|
|
- ) );
|
|
|
- foreach ( $list ['arClaim'] as $key => $value ) {
|
|
|
- $staff = explode ( "-", $value ['receivablesStaff'] );
|
|
|
- $list ['arClaim'] [$key] ['sid'] = $staff [0];
|
|
|
- $list ['arClaim'] [$key] ['username'] = $staff [1];
|
|
|
+ if (!empty($cid)&&!empty($sid)){
|
|
|
+ $list['myClaim'] = $this->find ( array (
|
|
|
+ 'where' => " receivablesStaff like '".$sid."-%' and receivablesCategory like '".$cid.":%'",
|
|
|
+ 'desc' => 'irid',
|
|
|
+ 'asArray' => TRUE
|
|
|
+ ) );
|
|
|
+ foreach ( $list ['myClaim'] as $key => $value ) {
|
|
|
+ $list ['myClaim'] [$key] ['iidKey'] = $this->authcode ( $value ['irid'], '' );
|
|
|
+ $staff = explode ( "-", $value ['receivablesStaff'] );
|
|
|
+ $list ['myClaim'] [$key] ['sid'] = $staff [0];
|
|
|
+ $list ['myClaim'] [$key] ['username'] = $staff [1];
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
return $list;
|