|
|
|
@ -370,11 +370,13 @@ class Vendor_money_model extends CI_Model {
|
|
|
|
|
then TLD_total_price-HT_agency_receipt
|
|
|
|
|
else TLD_total_price-TLD_agency_receipt-HT_haina_receipt
|
|
|
|
|
end as 'HT_receipt_err' --海纳收差额 (账单减HT)'
|
|
|
|
|
,data_tmp.total_income-(round(HT_haina_receipt,1)+ ROUND(HT_agency_receipt,1)) as 'total_income_err' --'海纳收入差额'
|
|
|
|
|
,(select top 1 GCI_combineNo from groupcombineinfo where gci_gri_sn=data_tmp.GRI_SN) as combineNo
|
|
|
|
|
,* from
|
|
|
|
|
(
|
|
|
|
|
select
|
|
|
|
|
gri.GRI_Name,
|
|
|
|
|
ro.money total_income,
|
|
|
|
|
(select isnull(SUM(cast(GCI_priceCNY as decimal(10,2))),0) from GroupCombineInfo where GCI_GRI_SN=COLI_GRI_SN) as TLD_total_price,
|
|
|
|
|
(select isnull(SUM(cast(GCI_agencyReceipt as decimal(10,2))),0) from GroupCombineInfo where GCI_GRI_SN=COLI_GRI_SN) as TLD_agency_receipt,
|
|
|
|
|
(select isnull(SUM(cast(GAI_SSJE as decimal(10,2))),0) from BIZ_GroupAccountInfo where GAI_COLI_SN=COLI_SN
|
|
|
|
@ -401,7 +403,7 @@ class Vendor_money_model extends CI_Model {
|
|
|
|
|
where 1=1
|
|
|
|
|
--and CGI_ArriveDate BETWEEN '$start_date' and '$end_date'
|
|
|
|
|
and exists (
|
|
|
|
|
select 1 from OperatorInfo where OPI_DEI_SN=30 and OPI_SN=COLI_OPI_ID
|
|
|
|
|
select 1 from OperatorInfo where OPI_SN=COLI_OPI_ID and (OPI_DEI_SN=30 or OPI_SN=435)
|
|
|
|
|
)
|
|
|
|
|
and ro.orderstats=1
|
|
|
|
|
and GRI_OrderType=227002
|
|
|
|
@ -415,6 +417,8 @@ class Vendor_money_model extends CI_Model {
|
|
|
|
|
where 1=1
|
|
|
|
|
-- 总团款不相等
|
|
|
|
|
and data_tmp.TLD_total_price-(HT_haina_receipt+HT_agency_receipt)<>0
|
|
|
|
|
-- 总收入和实收不相等
|
|
|
|
|
OR data_tmp.total_income-(round(HT_haina_receipt,1)+ ROUND(HT_agency_receipt,1))<>0
|
|
|
|
|
-- 地接代收不相等:同步
|
|
|
|
|
OR (
|
|
|
|
|
data_tmp.COLI_OPI_ID=435 and HT_haina_receipt<>0 and TLD_agency_receipt<>0
|
|
|
|
|