From 07e223045475268dfab35d289da144b2ce78d4ee Mon Sep 17 00:00:00 2001 From: lyt Date: Fri, 10 Apr 2020 10:09:25 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E8=B4=A6=E5=8D=95=E9=A2=84=E5=AE=A1?= =?UTF-8?q?=E6=A0=B8=E5=A2=9E=E5=8A=A0=E6=98=BE=E7=A4=BA=E7=BB=93=E7=AE=97?= =?UTF-8?q?=E5=8D=8F=E8=AE=AE=E5=BC=82=E5=B8=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controllers/vendor_money.php | 2 + .../models/vendor_money_model.php | 64 ++++++++++++++++++- .../views/order_report_precheck.php | 46 +++++++++++++ 3 files changed, 110 insertions(+), 2 deletions(-) diff --git a/webht/third_party/trippestOrderSync/controllers/vendor_money.php b/webht/third_party/trippestOrderSync/controllers/vendor_money.php index af0258fc..77ee9898 100644 --- a/webht/third_party/trippestOrderSync/controllers/vendor_money.php +++ b/webht/third_party/trippestOrderSync/controllers/vendor_money.php @@ -297,6 +297,8 @@ class Vendor_money extends CI_Controller { $ret['default_vendor'] = $vendors; $vendor_sourcetype = $this->trippest->vendor_sourcetype(); $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] $ret['price_error'] = $this->money_model->get_precheck_price_error($start_date, $end_date, implode(',' ,$vendors)); // 仅更新成本数据, 后重新获取 diff --git a/webht/third_party/trippestOrderSync/models/vendor_money_model.php b/webht/third_party/trippestOrderSync/models/vendor_money_model.php index 85041a45..7f6b08fa 100644 --- a/webht/third_party/trippestOrderSync/models/vendor_money_model.php +++ b/webht/third_party/trippestOrderSync/models/vendor_money_model.php @@ -392,8 +392,11 @@ class Vendor_money_model extends CI_Model { -- AND CGI_ArriveDate BETWEEN '$start_date' AND '$end_date') and exists ( select 1 from BIZ_ConfirmLineInfo - inner join BIZ_ConfirmLineDetail on COLI_SN=COLD_COLI_SN - where COLI_GRI_SN=GCI_GRI_SN + inner join BIZ_ConfirmLineDetail d on COLI_SN=COLD_COLI_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' ) ) AS group_cost @@ -768,6 +771,63 @@ ORDER BY to_be_diff.GCI_VEI_SN 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 */ diff --git a/webht/third_party/trippestOrderSync/views/order_report_precheck.php b/webht/third_party/trippestOrderSync/views/order_report_precheck.php index 7ca7b208..2c376c99 100644 --- a/webht/third_party/trippestOrderSync/views/order_report_precheck.php +++ b/webht/third_party/trippestOrderSync/views/order_report_precheck.php @@ -177,6 +177,51 @@ + +

+ + + + + + + + + + + + + + + $vad) { ?> + + + + + + + + + +
+ [ 第〇步 ] 解决结算协议异常 + 订单在HT中设置为综费协议结算, 不应在excel账单中, 请核实后重新设置结算协议 或 更新excel账单 +
HT团号报价: 综费协议报价: 目的地协议地接账单: 总团款(从同步数据)HT总收款
+   + + + (≈ CNY ) + + +   + + + (≈ CNY ) + +
+ +

@@ -364,6 +409,7 @@
  • 其他值