diff --git a/webht/third_party/trippestOrderSync/controllers/vendor_money.php b/webht/third_party/trippestOrderSync/controllers/vendor_money.php index c3ef370a..94140a6d 100644 --- a/webht/third_party/trippestOrderSync/controllers/vendor_money.php +++ b/webht/third_party/trippestOrderSync/controllers/vendor_money.php @@ -123,7 +123,7 @@ class Vendor_money extends CI_Controller { ); foreach ($final_table as $line => $row) { if ($row['vendor'] == $vendor) { - $ret['trippest']['trippest_sum'] = bcadd($ret['trippest']['trippest_sum'], $row['haina_receipt']); + $ret['trippest']['trippest_sum'] = bcadd($ret['trippest']['trippest_sum'], $row['sync_haina_receipt']); $ret['trippest']['vendor_sum'] = bcadd($ret['trippest']['vendor_sum'], $row['vendor_receipt']); $ret['trippest']['vendor_cost'] = bcadd($ret['trippest']['vendor_cost'], $row['group_vendor_cost']); $ret['trippest']['other_sum'] = bcadd($ret['trippest']['other_sum'], $row['other_price_RMB']); @@ -250,11 +250,11 @@ class Vendor_money extends CI_Controller { ->SetCellValue('A'.$rowCount, ($rowCount-1)) // ->SetCellValue('A'.$rowCount, $row->pn_sn) ->setCellValueExplicit('B'.$rowCount, $row['GRI_No'],PHPExcel_Cell_DataType::TYPE_STRING) - ->setCellValue('C'.$rowCount, number_format($row['haina_receipt'], 2, ".", "")) + ->setCellValue('C'.$rowCount, number_format($row['sync_haina_receipt'], 2, ".", "")) ->setCellValue('D'.$rowCount, number_format($row['vendor_receipt'], 2, ".", "")) ->SetCellValue('E'.$rowCount, 0) ->SetCellValue('F'.$rowCount, $row['group_vendor_cost']) - ->setCellValue('G'.$rowCount, bcsub(bcadd($row['vendor_receipt'],$row['haina_receipt']),$row['group_vendor_cost'])) + ->setCellValue('G'.$rowCount, bcsub(bcadd($row['vendor_receipt'],$row['sync_haina_receipt']),$row['group_vendor_cost'])) ; $rowCount++; } diff --git a/webht/third_party/trippestOrderSync/models/vendor_money_model.php b/webht/third_party/trippestOrderSync/models/vendor_money_model.php index 1a9ce60f..48b1bef3 100644 --- a/webht/third_party/trippestOrderSync/models/vendor_money_model.php +++ b/webht/third_party/trippestOrderSync/models/vendor_money_model.php @@ -42,6 +42,10 @@ class Vendor_money_model extends CI_Model { (order_total_receipt-dbo.ConvertToRMB('USD',other_vendor_price)) else ht_origin end as haina_receipt, + case when other_vendor_price > 0 then + (isnull(sync_total_receipt_sum,0)-vendor_receipt) + else ht_origin end + as sync_haina_receipt, * ,(select ROUND(SUM(isnull(tourcost,0)),4) from report_tour where ordernumber=COLI_ID @@ -83,8 +87,13 @@ class Vendor_money_model extends CI_Model { (select isnull(SUM(GAI_SSJE),0) from BIZ_GroupAccountInfo where DeleteFlag=0 and GAI_COLI_SN=COLI_SN and GAI_VEI_SN in ($all_vendor) - and GAI_Type in (" . PAY_OTHER . ") + --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') + ) as sync_total_receipt_sum ,coli.COLI_OPI_ID ,( select top 1 v.COLD_PlanVEI_SN from BIZ_ConfirmLineDetail v where COLD_COLI_SN=COLI_SN @@ -218,6 +227,11 @@ class Vendor_money_model extends CI_Model { and DeleteFlag=0 and COLD_PlanVEI_SN in ($all_vendor) ) as vendor_name + ,(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') + ) as sync_price_sum FROM CK_GroupInfo cgi INNER JOIN GRoupInfo gri ON CGI_GRI_SN=GRI_SN INNER JOIN BIZ_ConfirmLineInfo coli ON COLI_GRI_SN=GRI_SN diff --git a/webht/third_party/trippestOrderSync/views/vendor_money_sum.php b/webht/third_party/trippestOrderSync/views/vendor_money_sum.php index a896ac50..3439ce64 100644 --- a/webht/third_party/trippestOrderSync/views/vendor_money_sum.php +++ b/webht/third_party/trippestOrderSync/views/vendor_money_sum.php @@ -188,19 +188,19 @@ } ?> 0) { + //if ($trippest['trippest']['other_vendor_sum'] > 0) { ?> - + 拼团号 总报价/USD 总收款/RMB - 计入上表海纳收团款 - 应扣除的其他地接收款: (实时计算, 存在汇率误差) + 上表地接社接待部分的总团款 + $order) { ?> @@ -237,10 +237,10 @@ - +
- + @@ -343,8 +343,8 @@

实际总成本

-

财务表读取总成本

-

读取相同拼团号下的订单的财务表, 列出存在财务表数据未根据实际成本计算的.

+

自动生成的财务表所使用的成本金额

+

对含有多个地接社的订单,由于审核状态不一致,不会自动生成或更新财务表,避免覆盖数据导致错误, 请手动处理。检查金额正确之后, 此处可忽略该团.

  1. 数据为空: 虚拟订单没有团号, 无法计算. 如:
- + @@ -384,7 +384,7 @@ - +