Trippest结算:非包价产品总额改为计算当前指定供应商,并增加成本计算; 渠道订单改为地接社收款15020;

feature/trippest
lyt 6 years ago
parent 6798355886
commit 0e8277b136

@ -491,7 +491,7 @@ class TulanduoApi extends CI_Controller
$latest_order_detail = $this->Orders_model->get_orderinfo_detail($coli_id); $latest_order_detail = $this->Orders_model->get_orderinfo_detail($coli_id);
/** BIZ_GroupAccountInfo */ /** BIZ_GroupAccountInfo */
// 团款, 只有其他社的订单, 目的地项目组的团款已经直接收入海纳账户 // 团款, 只有其他社的订单, 目的地项目组的团款已经直接收入海纳账户
$paytype = 15006; // 地接代收 $paytype = 15020; // 地接代收
$pay_currency = 'RMB'; $pay_currency = 'RMB';
$auto_text = "dataAutoEnter "; $auto_text = "dataAutoEnter ";
// 删除旧的录入 // 删除旧的录入

@ -77,6 +77,7 @@ class Vendor_money extends CI_Controller {
array( array(
"trippest_sum" => 0, "trippest_sum" => 0,
"vendor_sum" => 0, "vendor_sum" => 0,
"other_sum_cost" => 0,
"other_sum" => 0 "other_sum" => 0
), ),
"vendor" => "vendor" =>
@ -84,6 +85,7 @@ class Vendor_money extends CI_Controller {
"trippest_sum" => 0, "trippest_sum" => 0,
"vendor_sum" => 0, "vendor_sum" => 0,
"transfer_sum" => 0, "transfer_sum" => 0,
"other_sum_cost" => 0,
"other_sum" => 0 "other_sum" => 0
) )
); );
@ -96,6 +98,7 @@ class Vendor_money extends CI_Controller {
$ret["trippest"]['trippest_sum'] = bcadd(floatval($ret["trippest"]['trippest_sum']), floatval($opi_money['trippest_sum'])) ; $ret["trippest"]['trippest_sum'] = bcadd(floatval($ret["trippest"]['trippest_sum']), floatval($opi_money['trippest_sum'])) ;
} }
$ret['trippest']['other_sum'] = bcadd($ret['trippest']['other_sum'], $opi_money['other_price_sum']); $ret['trippest']['other_sum'] = bcadd($ret['trippest']['other_sum'], $opi_money['other_price_sum']);
$ret['trippest']['other_sum_cost'] = bcadd($ret['trippest']['other_sum_cost'], $opi_money['other_cost_sum']);
$ret["trippest"]['trippest_sum'] = bcsub($ret["trippest"]['trippest_sum'], $opi_money['other_price_sum']); $ret["trippest"]['trippest_sum'] = bcsub($ret["trippest"]['trippest_sum'], $opi_money['other_price_sum']);
} }
// 按照图兰朵算法: Trippest自营订单的代收算在海纳收款 // 按照图兰朵算法: Trippest自营订单的代收算在海纳收款
@ -107,6 +110,7 @@ class Vendor_money extends CI_Controller {
$ret["vendor"]['trippest_sum'] = bcadd(floatval($ret["vendor"]['trippest_sum']), floatval($opi_money_v['vendor_sum'])) ; $ret["vendor"]['trippest_sum'] = bcadd(floatval($ret["vendor"]['trippest_sum']), floatval($opi_money_v['vendor_sum'])) ;
} }
$ret['vendor']['other_sum'] = bcadd($ret['vendor']['other_sum'], $opi_money_v['other_price_sum']); $ret['vendor']['other_sum'] = bcadd($ret['vendor']['other_sum'], $opi_money_v['other_price_sum']);
$ret['vendor']['other_sum_cost'] = bcadd($ret['vendor']['other_sum_cost'], $opi_money_v['other_cost_sum']);
$ret["vendor"]['trippest_sum'] = bcsub($ret["vendor"]['trippest_sum'], $opi_money_v['other_price_sum']); $ret["vendor"]['trippest_sum'] = bcsub($ret["vendor"]['trippest_sum'], $opi_money_v['other_price_sum']);
} }
$ret["vendor"]["transfer_sum"] = bcsub($ret["vendor"]['vendor_sum'], $ret["trippest"]['vendor_sum']); $ret["vendor"]["transfer_sum"] = bcsub($ret["vendor"]['vendor_sum'], $ret["trippest"]['vendor_sum']);

@ -1,7 +1,7 @@
<?php <?php
defined('BASEPATH') OR exit('No direct script access allowed'); defined('BASEPATH') OR exit('No direct script access allowed');
define('PAY_OTHER','15017,15008,15006'); define('PAY_OTHER','15017,15008,15006,15020');
class Vendor_money_model extends CI_Model { class Vendor_money_model extends CI_Model {
@ -16,14 +16,21 @@ class Vendor_money_model extends CI_Model {
{ {
$sql = "SELECT sum_opi.COLI_OPI_ID,sum(sum_opi.海纳收款) as trippest_sum,sum(sum_opi.地接社收款) as vendor_sum, $sql = "SELECT sum_opi.COLI_OPI_ID,sum(sum_opi.海纳收款) as trippest_sum,sum(sum_opi.地接社收款) as vendor_sum,
sum(sum_opi.other_price_RMB) as other_price_sum sum(sum_opi.other_price_RMB) as other_price_sum
, sum(sum_opi.other_cost_RMB) as other_cost_sum
from ( from (
SELECT SELECT
(select isnull(SUM(COLD_TotalPrice),0) from BIZ_ConfirmLineDetail cold (select isnull(SUM(COLD_TotalPrice),0) from BIZ_ConfirmLineDetail cold
where cold.COLD_COLI_SN=cgi_group.COLI_SN where cold.COLD_COLI_SN=cgi_group.COLI_SN
and COLD_ServiceType <> 'D' and COLD_ServiceType <> 'D'
and COLD_PlanVEI_SN NOT IN ($all_vendor) and COLD_PlanVEI_SN IN ($all_vendor)
and cold.DeleteFlag=0 and cold.DeleteFlag=0
)*cgi_group.汇率 as other_price_RMB, )*cgi_group.汇率 as other_price_RMB,
(select isnull(SUM(COLD_TotalCost),0) from BIZ_ConfirmLineDetail cold
where cold.COLD_COLI_SN=cgi_group.COLI_SN
and COLD_ServiceType <> 'D'
and COLD_PlanVEI_SN IN ($all_vendor)
and cold.DeleteFlag=0
) as other_cost_RMB,
* *
from ( from (
select select

@ -110,7 +110,11 @@
<tr class="bg-grey"> <tr class="bg-grey">
<td >非包价产品的收款 <br></td> <td >非包价产品的收款 <br></td>
<td ><?php echo $trippest['trippest']['other_sum'] ?></td> <td ><?php echo $trippest['trippest']['other_sum'] ?></td>
<td colspan="7"></td> <td ></td>
<td ></td>
<td ><?php echo $trippest['trippest']['other_sum_cost'] ?></td>
<td ></td>
<td colspan="4"></td>
</tr> </tr>
<?php <?php
} }
@ -174,7 +178,11 @@
<tr class="bg-grey"> <tr class="bg-grey">
<td >非包价产品的收款 <br></td> <td >非包价产品的收款 <br></td>
<td ><?php echo $vendor['vendor']['other_sum'] ?></td> <td ><?php echo $vendor['vendor']['other_sum'] ?></td>
<td colspan="7"></td> <td ></td>
<td ></td>
<td ><?php echo $vendor['vendor']['other_sum_cost'] ?></td>
<td ></td>
<td colspan="4"></td>
</tr> </tr>
<?php <?php
} }

Loading…
Cancel
Save