feat: 账单预审核增加显示结算协议异常

feature/trippest
lyt 5 years ago
parent 733012678c
commit 07e2230454

@ -297,6 +297,8 @@ class Vendor_money extends CI_Controller {
$ret['default_vendor'] = $vendors; $ret['default_vendor'] = $vendors;
$vendor_sourcetype = $this->trippest->vendor_sourcetype(); $vendor_sourcetype = $this->trippest->vendor_sourcetype();
$ret['no_check_cancel'] = $this->money_model->get_cancel_not_check($start_date, $end_date, implode(',' ,$vendors)); $ret['no_check_cancel'] = $this->money_model->get_cancel_not_check($start_date, $end_date, implode(',' ,$vendors));
// 综费协议 但是却同步到成本
$ret['agreement_diff'] = $this->money_model->agreement_diff($start_date, $end_date, implode(',' ,$vendors));
// price [Trippest receipts & agency receipts] // price [Trippest receipts & agency receipts]
$ret['price_error'] = $this->money_model->get_precheck_price_error($start_date, $end_date, implode(',' ,$vendors)); $ret['price_error'] = $this->money_model->get_precheck_price_error($start_date, $end_date, implode(',' ,$vendors));
// 仅更新成本数据, 后重新获取 // 仅更新成本数据, 后重新获取

@ -392,8 +392,11 @@ class Vendor_money_model extends CI_Model {
-- AND CGI_ArriveDate BETWEEN '$start_date' AND '$end_date') -- AND CGI_ArriveDate BETWEEN '$start_date' AND '$end_date')
and exists ( and exists (
select 1 from BIZ_ConfirmLineInfo select 1 from BIZ_ConfirmLineInfo
inner join BIZ_ConfirmLineDetail on COLI_SN=COLD_COLI_SN inner join BIZ_ConfirmLineDetail d on COLI_SN=COLD_COLI_SN
where COLI_GRI_SN=GCI_GRI_SN left join BIZ_PackageOrderInfo poi on poi.POI_COLD_SN=d.COLD_SN
where COLI_GRI_SN=GCI_GRI_SN and d.DeleteFlag=0
and isnull(poi_quotationType,0)<>4
and d.COLD_PlanVEI_SN in ($all_vendor)
and COLD_StartDate BETWEEN '$start_date' AND '$end_date' and COLD_StartDate BETWEEN '$start_date' AND '$end_date'
) )
) AS group_cost ) AS group_cost
@ -768,6 +771,63 @@ ORDER BY to_be_diff.GCI_VEI_SN
return $query->result_array(); return $query->result_array();
} }
public function agreement_diff($start_date, $end_date, $all_vendor)
{
$sql = "SELECT *
,ROUND( dbo.GetSSJEFromSQJE(
(select top 1 GAI_Type from BIZ_GroupAccountInfo b where gai_coli_sn=coli_sn and b.DeleteFlag=0)
,COLI_Currency,com_sum_price),2) as com_Currency_CNY_price
,ROUND( dbo.GetSSJEFromSQJE(
(select top 1 GAI_Type from BIZ_GroupAccountInfo b where gai_coli_sn=coli_sn and b.DeleteFlag=0)
,COLI_Currency,not_com_sum_price),2) as not_com_Currency_CNY_price
--,ROUND( dbo.GetSSJEFromSQJE(
-- (select top 1 GAI_Type from BIZ_GroupAccountInfo b where gai_coli_sn=coli_sn and b.DeleteFlag=0)
-- ,'USD',com_sum_price),2) as USD_CNY_price
,(select SUM(GAI_SSJE) from BIZ_GroupAccountInfo gai where gai.GAI_COLI_SN=COLI_SN and gai.DeleteFlag=0) as total_income
from (
select
COLI_ID,COLI_GroupCode,COLI_SN,COLI_Currency,COLI_GRI_SN
,(
select SUM(cold.COLD_TotalPrice) from BIZ_ConfirmLineDetail cold
left join BIZ_PackageOrderInfo poi on poi.POI_COLD_SN=cold.COLD_SN
where cold.COLD_COLI_SN=coli.COLI_SN
and COLD_StartDate between '$start_date' and '$end_date'
and cold.DeleteFlag=0
and poi_quotationType=4
and COLD_PlanVEI_SN in ($all_vendor)
) as com_sum_price
,isnull((
select SUM(cold.COLD_TotalPrice) from BIZ_ConfirmLineDetail cold
left join BIZ_PackageOrderInfo poi on poi.POI_COLD_SN=cold.COLD_SN
where cold.COLD_COLI_SN=coli.COLI_SN
and COLD_StartDate between '$start_date' and '$end_date'
and cold.DeleteFlag=0
and isnull(poi_quotationType,0)<>4
and COLD_PlanVEI_SN in ($all_vendor)
),0) as not_com_sum_price
,isnull((
select SUM(CONVERT(decimal(10,2), isnull(GCI_priceCNY,0))) from GroupCombineInfo where GCI_GRI_SN=coli.COLI_GRI_SN
and isnull(GCI_combineNo,'') not in ('','cancel','forbidden')
),0) as in_gci
from
BIZ_ConfirmLineInfo coli
where exists (
select 1 from OperatorInfo where OPI_DEI_SN=30 and OPI_SN=COLI_OPI_ID
)
and exists (
select 1 from BIZ_ConfirmLineDetail cold
left join BIZ_PackageOrderInfo poi on poi.POI_COLD_SN=cold.COLD_SN
where cold.COLD_COLI_SN=coli.COLI_SN
and COLD_StartDate between '$start_date' and '$end_date'
and cold.DeleteFlag=0
and poi_quotationType=4
and COLD_PlanVEI_SN in ($all_vendor)
)
) as all_comprehensive";
$query = $this->HT->query($sql);
return $query->result_array();
}
} }
/* End of file vendor_money.php */ /* End of file vendor_money.php */

@ -177,6 +177,51 @@
</table> </table>
<?php } ?> <?php } ?>
<?php if (!empty($agreement_diff)) { ?>
<p></p>
<table class="table table-bordered table-hover">
<thead>
<tr>
<th class="text-left" colspan="5">
<span class="info-red"> [&nbsp;第〇步&nbsp;]&nbsp;解决结算协议异常</span>
订单在HT中设置为综费协议结算, 不应在excel账单中, 请核实后重新设置结算协议 或 更新excel账单
</th>
</tr>
<tr>
<th >HT团号</th>
<th >报价: 综费协议</th>
<th >报价: 目的地协议</th>
<th >地接账单: 总团款(从同步数据)</th>
<th >HT总收款</th>
</tr>
</thead>
<tbody>
<?php
foreach ($agreement_diff as $kad => $vad) { ?>
<tr>
<td class="text-left"><?php echo $vad['COLI_GroupCode']; ?></td>
<td >
<?php echo $vad['COLI_Currency']; ?>&nbsp;
<?php echo $vad['com_sum_price']; ?>
<?php if ($vad['COLI_Currency'] !== 'RMB' && $vad['com_sum_price'] != 0) {?>
(&asymp;&nbsp;CNY&nbsp;<?php echo $vad['com_Currency_CNY_price']; ?>)
<?php } ?>
</td>
<td >
<?php echo $vad['COLI_Currency']; ?>&nbsp;
<?php echo $vad['not_com_sum_price']; ?>
<?php if ($vad['COLI_Currency'] !== 'RMB' && $vad['not_com_sum_price'] != 0) {?>
(&asymp;&nbsp;CNY&nbsp;<?php echo $vad['not_com_Currency_CNY_price']; ?>)
<?php } ?>
</td>
<td ><?php echo $vad['in_gci']; ?></td>
<td ><?php echo $vad['total_income']; ?></td>
</tr>
<?php } ?>
</tbody>
</table>
<?php } ?>
<p></p> <p></p>
<table class="table table-bordered table-hover"> <table class="table table-bordered table-hover">
<thead> <thead>
@ -364,6 +409,7 @@
<ul> <ul>
<li> 未同步: 在HT&nbsp;&raquo;&nbsp;单团财务表&nbsp;&raquo;&nbsp;输入团号, 点击`同步图兰朵订单` </li> <li> 未同步: 在HT&nbsp;&raquo;&nbsp;单团财务表&nbsp;&raquo;&nbsp;输入团号, 点击`同步图兰朵订单` </li>
<li> 团号被修改后无法匹配 </li> <li> 团号被修改后无法匹配 </li>
<li> 拼团中有订单的预订信息在HT中设置为综费结算 </li>
</ul> </ul>
</li> </li>
<li> 其他值 <li> 其他值

Loading…
Cancel
Save