Merge branch 'feature/trippest'

mobile-first
lyt 6 years ago
commit 6cd93e65fa

@ -95,6 +95,9 @@ class TulanduoApi extends CI_Controller
if ( ! empty($order_number)) {
$this->tld_order->setAgcOrderNo($order_number);
} else {
if (date('i') == '00') {
return;
}
$get_type = rand(0, 1); // 需要按预定时间和出发时间, 避免有漏的
if ($get_type === 0) {
log_message('error','Got order list From TuLanDuo By travel Date' );

@ -65,9 +65,22 @@ class Vendor_money extends CI_Controller {
,"sum_payout" => 0
,"sum_other" => 0
),
"vendor" => array(
// "vendor" => array(
// "sum_trippest_cost" => 0
// ,"sum_vendor_cost" => 0
// ,"sum_trippest_sum" => 0
// ,"sum_vendor_sum" => 0
// ,"sum_profit" => 0
// ,"sum_trippest_profit" => 0
// ,"sum_vendor_profit" => 0
// ,"sum_payout" => 0
// ,"sum_other" => 0
// ),
"sync" => array(
"sum_trippest_cost" => 0
,"sum_vendor_cost" => 0
,"sum_cost_sum" => 0
,"sum_price_sum" => 0
,"sum_trippest_sum" => 0
,"sum_vendor_sum" => 0
,"sum_profit" => 0
@ -80,6 +93,12 @@ class Vendor_money extends CI_Controller {
);
$result['trippest_order_multi_city'] = array_merge($result['trippest_order_multi_city'], $this->money_model->trippest_order_multi_city($start_date, $end_date, implode(',', $vendors)));
$result['trippest_order_cost_debug'] = $this->money_model->cost_debug_detail($start_date, $end_date, implode(',', $vendors));
/**
* 计算同步回来的数据
*/
$all_price_cost = $this->money_model->get_sync_price_cost($start_date, $end_date, implode(',', $vendors));
$unique_sync_groupno = array();
$dumplicate_groupno = array();
/** 团款 */
foreach ($vendors as $key => $vendor) {
$sourcetype = $vendor_sourcetype[strval($vendor)]["sourcetype"];
@ -93,8 +112,19 @@ class Vendor_money extends CI_Controller {
"other_sum" => 0,
"other_vendor_sum" => 0
),
"vendor" =>
// "vendor" =>
// array(
// "trippest_sum" => 0,
// "vendor_sum" => 0,
// "transfer_sum" => 0,
// "other_sum_cost" => 0,
// "other_sum" => 0,
// "other_vendor_sum" => 0
// ),
"sync" =>
array(
"price_sum" => 0,
"cost_sum" => 0,
"trippest_sum" => 0,
"vendor_sum" => 0,
"transfer_sum" => 0,
@ -116,24 +146,35 @@ class Vendor_money extends CI_Controller {
$ret["trippest"]['trippest_sum'] = bcsub($ret["trippest"]['trippest_sum'], $opi_money['other_price_sum']);
$ret['trippest']['other_vendor_sum'] = bcadd($ret['trippest']['other_vendor_sum'], $opi_money['other_vendorprice_RMB_sum']);
}
// 按照图兰朵算法: Trippest自营订单的代收算在海纳收款
foreach ($opi_summoney as $kv => $opi_money_v) {
if (strval($opi_money_v['COLI_OPI_ID']) === '435') {
$ret["vendor"]['vendor_sum'] = bcadd(floatval($ret["vendor"]['vendor_sum']), floatval($opi_money_v['vendor_sum'])) ;
} else {
$ret["vendor"]['trippest_sum'] = bcadd(floatval($ret["vendor"]['trippest_sum']), floatval($opi_money_v['trippest_sum'])) ;
$ret["vendor"]['trippest_sum'] = bcadd(floatval($ret["vendor"]['trippest_sum']), floatval($opi_money_v['vendor_sum'])) ;
foreach ($all_price_cost as $ks => $sync) {
if ($sync['vendor_code'] != $vendor || in_array($sync['GCI_combineNo'],$unique_sync_groupno)) {
$dumplicate_groupno[] = $sync;
continue;
}
$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']['other_vendor_sum'] = bcadd($ret['vendor']['other_vendor_sum'], $opi_money['other_vendorprice_RMB_sum']);
}
$ret["vendor"]["transfer_sum"] = bcsub($ret["vendor"]['vendor_sum'], $ret["trippest"]['vendor_sum']);
if ($ret["vendor"]["transfer_sum"] != 0) {
$result['transfer_sum'] = bcadd($result['transfer_sum'], $ret["vendor"]["transfer_sum"]);
$result['trippest_order_vendor_money'] = array_merge($result['trippest_order_vendor_money'], $this->money_model->trippest_order_with_vendormoney($vendor, $sourcetype, $start_date, $end_date));
$unique_sync_groupno[] = $sync['GCI_combineNo'];
$ret['sync']['price_sum'] = bcadd($ret['sync']['price_sum'], $sync['receive_price']);
$ret['sync']['cost_sum'] = bcadd($ret['sync']['cost_sum'], $sync['cost']);
// $ret['sync']['vendor_sum'] = bcadd(floatval($ret["sync"]['vendor_sum']), floatval($sync['agency_receive_price'])) ;
// $ret["sync"]['trippest_sum'] = bcadd(floatval($ret["sync"]['trippest_sum']), bcsub(floatval($sync['receive_price']),floatval($sync['agency_receive_price']))) ;
}
// 按照图兰朵算法: Trippest自营订单的代收算在海纳收款
// foreach ($opi_summoney as $kv => $opi_money_v) {
// if (strval($opi_money_v['COLI_OPI_ID']) === '435') {
// $ret["vendor"]['vendor_sum'] = bcadd(floatval($ret["vendor"]['vendor_sum']), floatval($opi_money_v['vendor_sum'])) ;
// } else {
// $ret["vendor"]['trippest_sum'] = bcadd(floatval($ret["vendor"]['trippest_sum']), floatval($opi_money_v['trippest_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_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']['other_vendor_sum'] = bcadd($ret['vendor']['other_vendor_sum'], $opi_money['other_vendorprice_RMB_sum']);
// }
// $ret["vendor"]["transfer_sum"] = bcsub($ret["vendor"]['vendor_sum'], $ret["trippest"]['vendor_sum']);
// if ($ret["vendor"]["transfer_sum"] != 0) {
// $result['transfer_sum'] = bcadd($result['transfer_sum'], $ret["vendor"]["transfer_sum"]);
// $result['trippest_order_vendor_money'] = array_merge($result['trippest_order_vendor_money'], $this->money_model->trippest_order_with_vendormoney($vendor, $sourcetype, $start_date, $end_date));
// }
$result["money"][strval($vendor)] = $ret;
$result["money"][strval($vendor)]["vendor_code"] = $vendor;
@ -145,11 +186,16 @@ class Vendor_money extends CI_Controller {
$result['col_sum']['trippest']['sum_vendor_sum'] = bcadd($result['col_sum']['trippest']['sum_vendor_sum'], $ret["trippest"]['vendor_sum']);
$result['col_sum']['trippest']['sum_other'] = bcadd($result['col_sum']['trippest']['sum_other'], $ret['trippest']['other_sum']);
$result['col_sum']['vendor']['sum_trippest_sum'] = bcadd(
bcadd($result['col_sum']['vendor']['sum_trippest_sum'], $ret["vendor"]['trippest_sum'])
,$ret['vendor']['other_sum']);
$result['col_sum']['vendor']['sum_vendor_sum'] = bcadd($result['col_sum']['vendor']['sum_vendor_sum'], $ret["vendor"]['vendor_sum']);
$result['col_sum']['vendor']['sum_other'] = bcadd($result['col_sum']['vendor']['sum_other'], $ret['vendor']['other_sum']);
$result['col_sum']['sync']['sum_price_sum'] = bcadd($result['col_sum']['sync']['sum_price_sum'], $ret["sync"]['price_sum']);
$result['col_sum']['sync']['sum_cost_sum'] = bcadd($result['col_sum']['sync']['sum_cost_sum'], $ret["sync"]['cost_sum']);
// $result['col_sum']['sync']['sum_trippest_sum'] = bcadd($result['col_sum']['sync']['sum_trippest_sum'], $ret["sync"]['trippest_sum']);
// $result['col_sum']['sync']['sum_vendor_sum'] = bcadd($result['col_sum']['sync']['sum_vendor_sum'],$ret['sync']['vendor_sum']);
// $result['col_sum']['vendor']['sum_trippest_sum'] = bcadd(
// bcadd($result['col_sum']['vendor']['sum_trippest_sum'], $ret["vendor"]['trippest_sum'])
// ,$ret['vendor']['other_sum']);
// $result['col_sum']['vendor']['sum_vendor_sum'] = bcadd($result['col_sum']['vendor']['sum_vendor_sum'], $ret["vendor"]['vendor_sum']);
// $result['col_sum']['vendor']['sum_other'] = bcadd($result['col_sum']['vendor']['sum_other'], $ret['vendor']['other_sum']);
}
/** 成本 */
$vendors_cost = $this->money_model->vendor_cost(implode(',', $vendors), $start_date, $end_date);
@ -171,29 +217,29 @@ class Vendor_money extends CI_Controller {
$vmi['trippest']['total_profit'] = bcsub(
bcadd(bcadd($vmi['trippest']['trippest_sum'], $vmi['trippest']['vendor_sum']),$vmi['trippest']['other_sum']),
bcadd(bcadd($vmi['trippest_cost'], $vmi['vendor_cost']),$vmi['trippest']['other_sum_cost']));
$vmi['vendor']['total_profit'] = bcsub(
bcadd(bcadd($vmi['vendor']['trippest_sum'], $vmi['vendor']['vendor_sum']),$vmi['vendor']['other_sum']),
bcadd(bcadd($vmi['trippest_cost'], $vmi['vendor_cost']),$vmi['vendor']['other_sum_cost']));
// $vmi['vendor']['total_profit'] = bcsub(
// bcadd(bcadd($vmi['vendor']['trippest_sum'], $vmi['vendor']['vendor_sum']),$vmi['vendor']['other_sum']),
// bcadd(bcadd($vmi['trippest_cost'], $vmi['vendor_cost']),$vmi['vendor']['other_sum_cost']));
/** 利润分成 */
$vmi['trippest']['vendor_profit'] = bcmul($vmi['trippest']['total_profit'], $vendor_sourcetype[strval($vmi['vendor_code'])]["profit_rate"]);
$vmi['trippest']['trippest_profit'] = bcmul($vmi['trippest']['total_profit'], bcsub(1, $vendor_sourcetype[strval($vmi['vendor_code'])]["profit_rate"]) );
$vmi['vendor']['vendor_profit'] = bcmul($vmi['vendor']['total_profit'], $vendor_sourcetype[strval($vmi['vendor_code'])]["profit_rate"]);
$vmi['vendor']['trippest_profit'] = bcmul($vmi['vendor']['total_profit'], bcsub(1, $vendor_sourcetype[strval($vmi['vendor_code'])]["profit_rate"]) );
// $vmi['vendor']['vendor_profit'] = bcmul($vmi['vendor']['total_profit'], $vendor_sourcetype[strval($vmi['vendor_code'])]["profit_rate"]);
// $vmi['vendor']['trippest_profit'] = bcmul($vmi['vendor']['total_profit'], bcsub(1, $vendor_sourcetype[strval($vmi['vendor_code'])]["profit_rate"]) );
/** Trippest应付地接 */
$vmi['trippest']['payout'] = bcsub(bcadd($vmi['vendor_cost'], $vmi['trippest']['vendor_profit'] ), $vmi['trippest']['vendor_sum']);
$vmi['vendor']['payout'] = bcsub(bcadd($vmi['vendor_cost'], $vmi['vendor']['vendor_profit'] ), $vmi['vendor']['vendor_sum']);
// $vmi['vendor']['payout'] = bcsub(bcadd($vmi['vendor_cost'], $vmi['vendor']['vendor_profit'] ), $vmi['vendor']['vendor_sum']);
/** 利润总计 */
$result['col_sum']['trippest']['sum_profit'] = bcadd($result['col_sum']['trippest']['sum_profit'], $vmi['trippest']['total_profit']);
$result['col_sum']['trippest']['sum_trippest_profit'] = bcadd($result['col_sum']['trippest']['sum_trippest_profit'], $vmi['trippest']['trippest_profit']);
$result['col_sum']['trippest']['sum_vendor_profit'] = bcadd($result['col_sum']['trippest']['sum_vendor_profit'], $vmi['trippest']['vendor_profit']);
$result['col_sum']['vendor']['sum_profit'] = bcadd($result['col_sum']['vendor']['sum_profit'], $vmi['vendor']['total_profit']);
$result['col_sum']['vendor']['sum_trippest_profit'] = bcadd($result['col_sum']['vendor']['sum_trippest_profit'], $vmi['vendor']['trippest_profit']);
$result['col_sum']['vendor']['sum_vendor_profit'] = bcadd($result['col_sum']['vendor']['sum_vendor_profit'], $vmi['vendor']['vendor_profit']);
// $result['col_sum']['vendor']['sum_profit'] = bcadd($result['col_sum']['vendor']['sum_profit'], $vmi['vendor']['total_profit']);
// $result['col_sum']['vendor']['sum_trippest_profit'] = bcadd($result['col_sum']['vendor']['sum_trippest_profit'], $vmi['vendor']['trippest_profit']);
// $result['col_sum']['vendor']['sum_vendor_profit'] = bcadd($result['col_sum']['vendor']['sum_vendor_profit'], $vmi['vendor']['vendor_profit']);
/** 应付总计 */
$result['col_sum']['trippest']['sum_payout'] = bcadd($result['col_sum']['trippest']['sum_payout'], $vmi['trippest']['payout']);
$result['col_sum']['vendor']['sum_payout'] = bcadd($result['col_sum']['vendor']['sum_payout'], $vmi['vendor']['payout']);
// $result['col_sum']['vendor']['sum_payout'] = bcadd($result['col_sum']['vendor']['sum_payout'], $vmi['vendor']['payout']);
}
$this->load->view('vendor_money_sum', $result);
return ;
@ -272,9 +318,9 @@ class Vendor_money extends CI_Controller {
return $this->settlement();
}
$start_date = $date_range_arr[0][0];
$end_date =$date_range_arr[0][1] . " 23:59:59";
$end_date =$date_range_arr[0][1] . " 23:59";
if ($end_date == null) {
$end_date = date("Y-m-d H:i:s", strtotime("+1 month", strtotime($start_date))-1);
$end_date = date("Y-m-d H:i", strtotime("+1 month", strtotime($start_date))-1);
}
$ret['default_date1'] = $start_date;
$ret['default_date2'] = $end_date;
@ -283,6 +329,8 @@ class Vendor_money extends CI_Controller {
$vendor_sourcetype = $this->trippest->vendor_sourcetype();
// price [Trippest receipts & agency receipts]
$ret['price_error'] = $this->money_model->get_precheck_price_error($start_date, $end_date, implode(',' ,$vendors));
// not found in GroupCombineInfo
$ret['not_found'] = $this->money_model->get_order_not_found_gci($start_date, $end_date, implode(',' ,$vendors));
// cost
$HT_combine_cost = $this->money_model->get_combine_cost($start_date, $end_date, implode(',' ,$vendors));
$cost_error = array();

@ -381,7 +381,7 @@ class Vendor_money_model extends CI_Model {
(select isnull(SUM(cast(GCI_agencyReceipt as decimal(10,2))),0) from GroupCombineInfo where GCI_GRI_SN=COLI_GRI_SN) as TLD_agency_receipt,
(select isnull(SUM(cast(GAI_SSJE as decimal(10,2))),0) from BIZ_GroupAccountInfo where GAI_COLI_SN=COLI_SN
and GAI_Type in (" . PAY_OTHER . ")
and GAI_VEI_SN in ($all_vendor)
AND GAI_VEI_SN in ($all_vendor,1343) -- 图兰朵的代收
and DeleteFlag=0
) as HT_agency_receipt,
(select isnull(SUM(cast(GAI_SSJE as decimal(10,2))),0) from BIZ_GroupAccountInfo where GAI_COLI_SN=COLI_SN
@ -399,6 +399,7 @@ class Vendor_money_model extends CI_Model {
--CK_GroupInfo cgi inner join
GRoupInfo gri --on CGI_GRI_SN=GRI_SN
inner join BIZ_ConfirmLineInfo coli on COLI_GRI_SN=GRI_SN
and COLI_State not in (50)
inner join report_order ro on ro.ordernumber=COLI_ID
where 1=1
--and CGI_ArriveDate BETWEEN '$start_date' and '$end_date'
@ -443,6 +444,60 @@ class Vendor_money_model extends CI_Model {
return $query->result_array();
}
public function get_order_not_found_gci($start_date, $end_date, $all_vendor)
{
$sql = "SELECT *
from BIZ_ConfirmLineInfo coli
inner join GRoupInfo gri on gri.GRI_SN=COLI_GRI_SN
where COLI_OPI_ID=435 and ISNULL(COLI_SenderIP,'')=''
and not exists (
select 1 from GroupCombineInfo where GCI_GRI_SN=GRI_SN
)
and exists (
select 1 from BIZ_ConfirmLineDetail where COLD_COLI_SN=COLI_SN
and COLD_PlanVEI_SN in ($all_vendor)
and COLD_StartDate between '$start_date' and '$end_date'
)
and isnull(coli.DeleteFlag,0)=0
and COLI_IsSuccess=1
order by COLI_ApplyDate desc";
$query = $this->HT->query($sql);
return $query->result_array();
}
public function get_sync_price_cost($start_date, $end_date, $all_vendor)
{
$sql = "SELECT group_cost.GCI_VEI_SN vendor_code,
GCI_combineNo,
(SELECT isnull(SUM(CONVERT(float, isnull(gcod.GCOD_sumMoney,0))),0)
FROM GroupCombineOperationDetail gcod
WHERE gcod.GCOD_GCI_combineNo=GCI_combineNo
AND gcod.GCOD_operationType<> 'otherReceives'
) AS cost
,(select SUM(CONVERT(float, GCI_priceCNY)) from GroupCombineInfo where GCI_combineNo=group_cost.GCI_combineNo
) as receive_price
,(select SUM(CONVERT(float, GCI_agencyReceipt)) from GroupCombineInfo where GCI_combineNo=group_cost.GCI_combineNo
) as agency_receive_price
FROM
(SELECT isnull(gci.GCI_combineNo,'1') GCI_combineNo
,GCI_VEI_SN
FROM GroupCombineInfo gci
WHERE 1=1
AND GCI_VEI_SN IN ($all_vendor)
AND EXISTS
( SELECT 1
FROM CK_GroupInfo
WHERE CGI_Checked=1
AND CGI_GRI_SN=GCI_GRI_SN
AND CGI_ArriveDate BETWEEN '$start_date' AND '$end_date')
group by isnull(gci.GCI_combineNo,'1')
,GCI_VEI_SN
) AS group_cost
order by GCI_combineNo desc";
$query = $this->HT->query($sql);
return $query->result_array();
}
}
/* End of file vendor_money.php */

@ -78,11 +78,10 @@
</div>
</form>
<p></p>
<table class="table table-bordered table-hover">
<thead>
<tr>
<th colspan="9" class="text-left">团款异常:</th>
<th colspan="10" class="text-left">团款异常:</th>
</tr>
<tr>
<th>HT团号</th>
@ -111,7 +110,18 @@
</thead>
<tbody>
<?php if ( ! empty($price_error)) {
foreach ($price_error as $ko => $ep) { ?>
$col_sum = array(
"sum_total_income" => 0
,"sum_total_price" => 0
,"sum_agency_receipt" => 0
,"sum_HT_receipt" => 0
);
foreach ($price_error as $ko => $ep) {
$col_sum['sum_total_income'] = bcadd($col_sum['sum_total_income'], $ep['total_income_err']);
$col_sum['sum_total_price'] = bcadd($col_sum['sum_total_price'], $ep['total_price_err']);
$col_sum['sum_agency_receipt'] = bcadd($col_sum['sum_agency_receipt'], $ep['agency_receipt_err']);
$col_sum['sum_HT_receipt'] = bcadd($col_sum['sum_HT_receipt'], $ep['HT_receipt_err']);
?>
<tr>
<td class="text-left"><?php echo $ep['GRI_Name']; ?></td>
<td class="text-left"><?php echo $ep['combineNo']; ?></td>
@ -127,10 +137,33 @@
<td><?php echo $ep['HT_haina_receipt']; ?></td>
<td><?php echo $ep['HT_agency_receipt']; ?></td>
</tr>
<?php }
} ?>
<?php } ?>
<tr class="text-bold">
<td colspan="2">合计</td>
<td ><?php echo $col_sum['sum_total_income']; ?></td>
<td ><?php echo $col_sum['sum_total_price']; ?></td>
<td ><?php echo $col_sum['sum_agency_receipt']; ?></td>
<td ><?php echo $col_sum['sum_HT_receipt']; ?></td>
</tr>
<?php } ?>
</tbody>
</table>
<p></p>
<?php if ( ! empty($not_found)) { ?>
<table class="table table-bordered table-hover">
<thead>
<tr>
<th colspan="2" class="text-left">未找到同步的数据,需检查是否在账单中存在</th>
</tr>
</thead>
<tbody>
<?php foreach ($not_found as $kn => $vn) { ?>
<tr><?php echo $vn['COLI_ID']; ?></tr>
<tr><?php echo $vn['COLI_GroupCode']; ?></tr>
<?php } ?>
</tbody>
</table>
<?php } ?>
<?php if ( ! empty($error_msg)) { ?>
<p><?php echo $error_msg; ?></p>
@ -158,7 +191,11 @@
<?php }
} ?>
<?php if ( ! empty($ht_no_match)) {
foreach ($ht_no_match as $ko => $ht) { ?>
foreach ($ht_no_match as $ko => $ht) {
if ($ht['cost'] == 0) {
continue;
}
?>
<tr>
<td><?php echo $ht['GCI_combineNo']; ?></td>
<td><?php echo $ht['cost']; ?></td>
@ -167,7 +204,8 @@
<?php }
} ?>
<?php if ( ! empty($xls_no_match)) {
foreach ($xls_no_match as $ko => $xls) { ?>
foreach ($xls_no_match as $ko => $xls) {
?>
<tr>
<td><?php echo $xls['group_name']; ?></td>
<td>未找到</td>

@ -79,7 +79,7 @@
<thead>
<tr>
<th rowspan="2">目的地</th>
<th colspan="2">总营收</th>
<th colspan="3">总营收</th>
<th colspan="2">总成本</th>
<th rowspan="2">⑤利润</th>
<th rowspan="2">⑥海纳利润</th>
@ -89,8 +89,9 @@
<tr>
<th >①海纳代收</th>
<th >②地接代收</th>
<th rowspan="2">③海纳成本</th>
<th rowspan="2">④地接成本</th>
<th >①+②</th>
<th >③海纳成本</th>
<th >④地接成本</th>
</tr>
</thead>
<tbody>
@ -103,6 +104,7 @@
</td>
<td><?php echo $trippest['trippest']['trippest_sum'] ?></td>
<td><?php echo $trippest['trippest']['vendor_sum'] ?></td>
<td><?php echo bcadd($trippest['trippest']['trippest_sum'],$trippest['trippest']['vendor_sum']) ?></td>
<td><?php echo $trippest['trippest_cost'] ?></td>
<td><?php echo $trippest['vendor_cost'] ?></td>
<td><?php echo $trippest['trippest']['total_profit'] ?></td>
@ -146,9 +148,10 @@
<?php if ( ! empty($col_sum)) {
?>
<tr class="text-bold">
<td class="text-left">合计(仅包价产品)</td>
<td class="text-left" rowspan="2">合计(仅包价产品)</td>
<td><?php echo $col_sum['trippest']['sum_trippest_sum'] ?></td>
<td><?php echo $col_sum['trippest']['sum_vendor_sum'] ?></td>
<td><?php echo bcadd($col_sum['trippest']['sum_trippest_sum'],$col_sum['trippest']['sum_vendor_sum']); ?></td>
<td><?php echo $col_sum['trippest']['sum_trippest_cost'] ?></td>
<td><?php echo $col_sum['trippest']['sum_vendor_cost'] ?></td>
<td><?php echo $col_sum['trippest']['sum_profit'] ?></td>
@ -206,6 +209,53 @@
<?php } } ?>
</tbody>
</table>
<p>同步数据:</p>
<table class="table table-bordered table-hover">
<thead>
<tr>
<th >目的地</th>
<th >总营收:①海纳代收+②地接代收</th>
<th >总成本:③海纳成本+④地接成本</th>
<th >⑤利润</th>
<th >⑥海纳利润</th>
<th >⑦地接利润</th>
<th >⑧海纳应付地接</th>
</tr>
<!-- <tr>
<th >①海纳代收</th>
<th >②地接代收</th>
<th rowspan="2">③海纳成本</th>
<th rowspan="2">④地接成本</th>
</tr> -->
</thead>
<tbody>
<?php if ( ! empty($money)) {
foreach ($money as $kv => $sync) {
?>
<tr>
<td class="text-left"><?php echo $sync['vendor_name'] ?></td>
<!-- <td><?php //echo $sync['sync']['trippest_sum'] ?></td> -->
<td><?php echo $sync['sync']['price_sum'] ?></td>
<td><?php echo $sync['sync']['cost_sum'] ?></td>
<td><?php // echo $sync['vendor_cost'] ?></td>
<td><?php // echo $sync['sync']['total_profit'] ?></td>
<td><?php // echo $sync['sync']['trippest_profit'] ?></td>
<td><?php // echo $sync['sync']['vendor_profit'] ?></td>
</tr>
<?php } }?>
<tr class="text-bold">
<td class="text-left">合计</td>
<!-- <td><?php //echo $col_sum['sync']['sum_trippest_sum'] ?></td> -->
<td><?php echo $col_sum['sync']['sum_price_sum'] ?></td>
<td><?php echo $col_sum['sync']['sum_cost_sum'] ?></td>
<td><?php // echo $col_sum['sync']['sum_vendor_cost'] ?></td>
<td><?php // echo $col_sum['sync']['sum_profit'] ?></td>
<td><?php // echo $col_sum['sync']['sum_trippest_profit'] ?></td>
<td><?php // echo $col_sum['sync']['sum_vendor_profit'] ?></td>
</tr>
</tbody>
</table>
<!--
<p>旧的算法, 需扣除Trippest自营订单的地接代收款项:</p>
<table class="table table-bordered table-hover">
@ -227,64 +277,64 @@
</tr>
</thead>
<tbody>
<?php if ( ! empty($money)) {
foreach ($money as $kv => $vendor) {
<?php // if ( ! empty($money)) {
// foreach ($money as $kv => $vendor) {
?>
<tr>
<td class="text-left"><?php echo $vendor['vendor_name'] ?></td>
<td><?php echo $vendor['vendor']['trippest_sum'] ?></td>
<td><?php echo $vendor['vendor']['vendor_sum'] ?></td>
<td><?php echo $vendor['trippest_cost'] ?></td>
<td><?php echo $vendor['vendor_cost'] ?></td>
<td><?php echo $vendor['vendor']['total_profit'] ?></td>
<td><?php echo $vendor['vendor']['trippest_profit'] ?></td>
<td><?php echo $vendor['vendor']['vendor_profit'] ?></td>
<td><?php echo $vendor['vendor']['payout'] ?></td>
<td class="text-left"><?php // echo $vendor['vendor_name'] ?></td>
<td><?php // echo $vendor['vendor']['trippest_sum'] ?></td>
<td><?php // echo $vendor['vendor']['vendor_sum'] ?></td>
<td><?php // echo $vendor['trippest_cost'] ?></td>
<td><?php // echo $vendor['vendor_cost'] ?></td>
<td><?php // echo $vendor['vendor']['total_profit'] ?></td>
<td><?php // echo $vendor['vendor']['trippest_profit'] ?></td>
<td><?php // echo $vendor['vendor']['vendor_profit'] ?></td>
<td><?php // echo $vendor['vendor']['payout'] ?></td>
</tr>
<?php
if ($vendor['vendor']['other_sum'] > 0) {
// if ($vendor['vendor']['other_sum'] > 0) {
?>
<tr class="bg-grey">
<td >非包价产品的收款 <br></td>
<td ><?php echo $vendor['vendor']['other_sum'] ?></td>
<td ><?php // echo $vendor['vendor']['other_sum'] ?></td>
<td ></td>
<td ></td>
<td ><?php echo $vendor['vendor']['other_sum_cost'] ?></td>
<td ><?php // echo $vendor['vendor']['other_sum_cost'] ?></td>
<td ></td>
<td colspan="4"></td>
</tr>
<?php
}
// }
?>
<?php }
} ?>
<?php if ( ! empty($col_sum)) {
<?php // }
//} ?>
<?php //if ( ! empty($col_sum)) {
?>
<tr class="text-bold">
<td class="text-left">合计(仅包价产品)</td>
<td><?php echo $col_sum['vendor']['sum_trippest_sum'] ?></td>
<td><?php echo $col_sum['vendor']['sum_vendor_sum'] ?></td>
<td><?php echo $col_sum['vendor']['sum_trippest_cost'] ?></td>
<td><?php echo $col_sum['vendor']['sum_vendor_cost'] ?></td>
<td><?php echo $col_sum['vendor']['sum_profit'] ?></td>
<td><?php echo $col_sum['vendor']['sum_trippest_profit'] ?></td>
<td><?php echo $col_sum['vendor']['sum_vendor_profit'] ?></td>
<td><?php echo $col_sum['vendor']['sum_payout'] ?></td>
<td><?php // echo $col_sum['vendor']['sum_trippest_sum'] ?></td>
<td><?php // echo $col_sum['vendor']['sum_vendor_sum'] ?></td>
<td><?php // echo $col_sum['vendor']['sum_trippest_cost'] ?></td>
<td><?php // echo $col_sum['vendor']['sum_vendor_cost'] ?></td>
<td><?php // echo $col_sum['vendor']['sum_profit'] ?></td>
<td><?php // echo $col_sum['vendor']['sum_trippest_profit'] ?></td>
<td><?php // echo $col_sum['vendor']['sum_vendor_profit'] ?></td>
<td><?php // echo $col_sum['vendor']['sum_payout'] ?></td>
</tr>
<?php } ?>
<?php if ( ! empty($trippest_order_vendor_money)) {
<?php // } ?>
<?php // if ( ! empty($trippest_order_vendor_money)) {
?>
<tr class="text-bold">
<th colspan="2">团号</th>
<th colspan="7">应扣除地接收款: 总计 <?php echo $transfer_sum ?></th>
<th colspan="7">应扣除地接收款: 总计 <?php // echo $transfer_sum ?></th>
</tr>
<?php foreach ($trippest_order_vendor_money as $ko => $order) {
<?php // foreach ($trippest_order_vendor_money as $ko => $order) {
?>
<tr>
<td colspan="2" class="text-left"><?php echo $order['COLI_GroupCode'] ?></td>
<td colspan="7" class="text-left"><?php echo $order["vendor_sum"] ?></td>
<td colspan="2" class="text-left"><?php // echo $order['COLI_GroupCode'] ?></td>
<td colspan="7" class="text-left"><?php // echo $order["vendor_sum"] ?></td>
</tr>
<?php } } ?>
<?php // } } ?>
</tbody>
</table>
-->

Loading…
Cancel
Save