|
|
|
|
@ -63,11 +63,12 @@ class Vendor_money_model extends CI_Model {
|
|
|
|
|
and DeleteFlag=0
|
|
|
|
|
) as service_cnt,
|
|
|
|
|
(select isnull(SUM(COLD_TotalPrice),0) from BIZ_ConfirmLineDetail
|
|
|
|
|
left join biz_packageorderinfo on poi_cold_sn=cold_sn
|
|
|
|
|
where COLD_COLI_SN=COLI_SN
|
|
|
|
|
--and COLD_ServiceType='D'
|
|
|
|
|
and DeleteFlag=0
|
|
|
|
|
--and COLD_PlanVEI_SN<>$vendor
|
|
|
|
|
and COLD_PlanVEI_SN not in ($all_vendor)
|
|
|
|
|
and ( COLD_PlanVEI_SN not in ($all_vendor) or isnull(poi_quotationType,0)=4)
|
|
|
|
|
) as other_vendor_price,
|
|
|
|
|
COLI.COLI_sourcetype,
|
|
|
|
|
COLI.COLI_Price,
|
|
|
|
|
@ -91,9 +92,8 @@ class Vendor_money_model extends CI_Model {
|
|
|
|
|
--and GAI_Type in (" . PAY_OTHER . ")
|
|
|
|
|
) as vendor_receipt
|
|
|
|
|
,(select SUM(convert(decimal(10,2),isnull(GCI_priceCNY,0))) from
|
|
|
|
|
GroupCombineInfo where GCI_GRI_SN=GRI_SN and GCI_VEI_SN in ($all_vendor)
|
|
|
|
|
--and COLI_OPI_ID<>435
|
|
|
|
|
and ISNULL(GCI_combineNo,'') not in ('','cancel')
|
|
|
|
|
GroupCombineInfo where GCI_GRI_SN=GRI_SN
|
|
|
|
|
and ISNULL(GCI_combineNo,'') not in ('','cancel','forbidden')
|
|
|
|
|
) as sync_total_receipt_sum
|
|
|
|
|
,coli.COLI_OPI_ID
|
|
|
|
|
,(
|
|
|
|
|
@ -117,6 +117,10 @@ class Vendor_money_model extends CI_Model {
|
|
|
|
|
and DeleteFlag=0
|
|
|
|
|
and COLD_PlanVEI_SN in ($all_vendor)
|
|
|
|
|
)
|
|
|
|
|
and exists (
|
|
|
|
|
select 1 from GroupCombineInfo where GCI_GRI_SN=GRI_SN and GCI_VEI_SN in ($all_vendor)
|
|
|
|
|
and GCI_travelDate between '$start_date' and '$end_date'
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
) as cgi_group";
|
|
|
|
|
// -- and COLI_SN not in ($duplicate_gri)
|
|
|
|
|
@ -398,6 +402,27 @@ class Vendor_money_model extends CI_Model {
|
|
|
|
|
return $query->result_array();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function get_cancel_not_check($start_date, $end_date, $all_vendor)
|
|
|
|
|
{
|
|
|
|
|
$sql = "SELECT
|
|
|
|
|
COLI_ID, COLI_GroupCode,GCI_combineNo,
|
|
|
|
|
GCI_priceCNY
|
|
|
|
|
from GroupCombineInfo gci
|
|
|
|
|
inner join BIZ_ConfirmLineInfo coli on COLI_GRI_SN=GCI_GRI_SN
|
|
|
|
|
where
|
|
|
|
|
GCI_travelDate between '$start_date' and '$end_date'
|
|
|
|
|
and convert(decimal(10,2),isnull(GCI_priceCNY,0))<>0
|
|
|
|
|
and COLI_State in (30,40)
|
|
|
|
|
and GCI_VEI_SN in ($all_vendor)
|
|
|
|
|
and isnull(GCI_combineNo,'') not in ('','cancel','forbidden')
|
|
|
|
|
and not exists(
|
|
|
|
|
select 1 from CK_GroupInfo where CGI_GRI_SN=COLI_GRI_SN
|
|
|
|
|
and CGI_Checked=1
|
|
|
|
|
)";
|
|
|
|
|
$query = $this->HT->query($sql);
|
|
|
|
|
return $query->result_array();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function get_precheck_price_error($start_date, $end_date, $all_vendor)
|
|
|
|
|
{
|
|
|
|
|
$expire_fresh = date('Y-m-d',strtotime("+3 months", strtotime($start_date)));
|
|
|
|
|
|