|
|
@ -1,6 +1,8 @@
|
|
|
|
<?php
|
|
|
|
<?php
|
|
|
|
defined('BASEPATH') OR exit('No direct script access allowed');
|
|
|
|
defined('BASEPATH') OR exit('No direct script access allowed');
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
define('PAY_OTHER','15017,15008,15006');
|
|
|
|
|
|
|
|
|
|
|
|
class Vendor_money_model extends CI_Model {
|
|
|
|
class Vendor_money_model extends CI_Model {
|
|
|
|
|
|
|
|
|
|
|
|
function __construct() {
|
|
|
|
function __construct() {
|
|
|
@ -44,11 +46,11 @@ class Vendor_money_model extends CI_Model {
|
|
|
|
) as 总收款,
|
|
|
|
) as 总收款,
|
|
|
|
(select isnull(SUM(GAI_SSJE),0) from BIZ_GroupAccountInfo
|
|
|
|
(select isnull(SUM(GAI_SSJE),0) from BIZ_GroupAccountInfo
|
|
|
|
where DeleteFlag=0 and GAI_COLI_SN=COLI_SN
|
|
|
|
where DeleteFlag=0 and GAI_COLI_SN=COLI_SN
|
|
|
|
and GAI_Type not in (15017,15008,15006)
|
|
|
|
and GAI_Type not in (" . PAY_OTHER . ")
|
|
|
|
) as 海纳收款,
|
|
|
|
) as 海纳收款,
|
|
|
|
(select isnull(SUM(GAI_SSJE),0) from BIZ_GroupAccountInfo
|
|
|
|
(select isnull(SUM(GAI_SSJE),0) from BIZ_GroupAccountInfo
|
|
|
|
where DeleteFlag=0 and GAI_COLI_SN=COLI_SN
|
|
|
|
where DeleteFlag=0 and GAI_COLI_SN=COLI_SN
|
|
|
|
and GAI_Type in (15017,15008,15006)
|
|
|
|
and GAI_Type in (" . PAY_OTHER . ")
|
|
|
|
) as 地接社收款
|
|
|
|
) as 地接社收款
|
|
|
|
,coli.COLI_OPI_ID
|
|
|
|
,coli.COLI_OPI_ID
|
|
|
|
|
|
|
|
|
|
|
@ -83,9 +85,7 @@ class Vendor_money_model extends CI_Model {
|
|
|
|
FROM BIZ_GroupAccountInfo
|
|
|
|
FROM BIZ_GroupAccountInfo
|
|
|
|
WHERE DeleteFlag=0
|
|
|
|
WHERE DeleteFlag=0
|
|
|
|
AND GAI_COLI_SN=COLI_SN
|
|
|
|
AND GAI_COLI_SN=COLI_SN
|
|
|
|
AND GAI_Type IN (15017,
|
|
|
|
AND GAI_Type IN (" . PAY_OTHER . ")) AS vendor_sum ,
|
|
|
|
15008,
|
|
|
|
|
|
|
|
15006)) AS vendor_sum ,
|
|
|
|
|
|
|
|
coli.COLI_OPI_ID
|
|
|
|
coli.COLI_OPI_ID
|
|
|
|
FROM CK_GroupInfo cgi
|
|
|
|
FROM CK_GroupInfo cgi
|
|
|
|
INNER JOIN GRoupInfo gri ON CGI_GRI_SN=GRI_SN
|
|
|
|
INNER JOIN GRoupInfo gri ON CGI_GRI_SN=GRI_SN
|
|
|
@ -110,9 +110,7 @@ class Vendor_money_model extends CI_Model {
|
|
|
|
WHERE DeleteFlag=0
|
|
|
|
WHERE DeleteFlag=0
|
|
|
|
AND GAI_COLI_SN=COLI_SN
|
|
|
|
AND GAI_COLI_SN=COLI_SN
|
|
|
|
AND GAI_SSJE>0
|
|
|
|
AND GAI_SSJE>0
|
|
|
|
AND GAI_Type IN (15017,
|
|
|
|
AND GAI_Type IN (" . PAY_OTHER . ")
|
|
|
|
15008,
|
|
|
|
|
|
|
|
15006)
|
|
|
|
|
|
|
|
)
|
|
|
|
)
|
|
|
|
ORDER BY cgi.CGI_ArriveDate ";
|
|
|
|
ORDER BY cgi.CGI_ArriveDate ";
|
|
|
|
$query = $this->HT->query($sql);
|
|
|
|
$query = $this->HT->query($sql);
|
|
|
|