feat: 审核长账单提示

feature/trippest
lyt 7 years ago
parent 02b128ca2c
commit e8ec226c34

@ -195,7 +195,7 @@ class TulanduoApi extends CI_Controller
* @date 2018-05-02
* @param [type] $coli_sn HT系统的订单key
*/
public function insert_HT_order_operation($coli_sn=null,$get_vendorID=null)
public function insert_HT_order_operation($coli_sn=null,$get_vendorID=null, $output=true)
{
// log_message('error','get_order_operation From TuLanDuo ');
$this->load->model('Order_update');
@ -213,8 +213,8 @@ class TulanduoApi extends CI_Controller
$to_update_list = $this->Orders_model->get_groupCombineInfo_finance();
}
}
if (empty($to_update_list)) {
echo "empty";
if (empty($to_update_list) ) {
if ( $output===true) { echo "empty"; }
return false;
}
$unique_orderGroupCombine = array(); // 录入拼团调度时,避免重复
@ -240,7 +240,7 @@ class TulanduoApi extends CI_Controller
$this->order_cancel($order->COLI_ID);
}
}
echo "cancel";
if ( $output===true) { echo "cancel"; }
return;
}
if (mb_strstr($detail_jsonResp->orderDetail->agcOrderNo, "重复") !== false) {
@ -288,7 +288,7 @@ class TulanduoApi extends CI_Controller
}
}
if (strval($detail_jsonResp->orderDetail->orderStatus) !== '1') {
echo "not confirm";
if ( $output===true) { echo "not confirm"; }
/** groupcombineinfo */
$this->Order_update->gci_where_update = " GCI_VendorOrderId='" . $detail_jsonResp->orderDetail->orderId . "' and GCI_VEI_SN in (" . implode(',', $this->vendor_ids) . ")"; // 不明确指定供应商id,出现过不对应的情况
$gci_update_column = array(
@ -763,7 +763,7 @@ class TulanduoApi extends CI_Controller
}
$output_text = "Got order operations from TuLanDuo:" . $detail_jsonResp->orderDetail->orderId . ". " . $coli_id;
log_message('error', $output_text);
echo $output_text;
if ( $output===true) { echo $output_text; }
if (strval($order->isHistory) === '1') {
require_once('order_finance.php');
$vendor_class = new Order_finance();

@ -56,7 +56,7 @@ class Order_finance extends CI_Controller {
$controller_name = "TulanduoApi";
require_once($controller_name . '.php');
$vendor_class = new $controller_name();
$ret = $vendor_class->insert_HT_order_operation($coli_sn);
$ret = $vendor_class->insert_HT_order_operation($coli_sn, null, false);
$this->single_order_report($coli_sn, $debug);
}

@ -1,10 +1,12 @@
<?php
/**
* 账单结算
*/
?>
<!DOCTYPE html>
<html>
<head>
<title>Trippest &amp; 地接账单预审核</title>
<meta charset="utf-8">
@ -16,24 +18,92 @@
<link href="http://www.mycht.cn/css/webht/bootstrap.min.css" rel="stylesheet" type="text/css" />
<link href="http://www.mycht.cn/css/bootstrap-datetimepicker.min.css" rel="stylesheet" type="text/css" />
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/flatpickr/dist/flatpickr.min.css">
<!-- <?php // include 'flatpickr.css.php'; ?> -->
<!-- <?php // include 'flatpickr.css.php';
?> -->
<style type="text/css">
form{border-bottom: 1px solid #ccc;}
.navbar-header h1{display: inline-block;margin-left: 30px;margin-right: 30px;}
label {display: inline-block;max-width: none;margin-bottom: 5px;font-weight: bold; }
.form-check-label{font-weight: normal; margin-left: 5px;}
thead th {text-align: center;}
tbody td {text-align: right;}
.bg-grey {background-color: #f5f5f5;}
.text-left {text-align: left;}
.text-right {text-align: right;}
.text-bold {font-weight: bold;}
.text-red {color: red;}
.cell-right {float: right;}
.bgred{ background-color: lightcoral;}
td a {cursor: pointer;}
form {
border-bottom: 1px solid #ccc;
}
.navbar-header h1 {
display: inline-block;
margin-left: 30px;
margin-right: 30px;
}
label {
display: inline-block;
max-width: none;
margin-bottom: 5px;
font-weight: bold;
}
.form-check-label {
font-weight: normal;
margin-left: 5px;
}
thead th {
text-align: center;
min-width: 150px;
}
tbody td {
text-align: right;
}
.bg-grey {
background-color: #f5f5f5;
}
.text-left {
text-align: left;
}
.text-left-top {
text-align: left;
vertical-align: top !important;
}
.text-right {
text-align: right;
}
.text-bold {
font-weight: bold;
}
.text-red {
color: red;
}
.info-red {
color: lightcoral;
}
.info-primary {
color: #337ab7;
}
.cell-right {
float: right;
}
.bgred {
background-color: lightcoral;
}
td a {
cursor: pointer;
}
ol,
ul {
padding-left: 1em;
}
</style>
</head>
<body>
<div id="wrapper" class="chkVisible print-none">
<div class="navbar-header" style="float:none;border-bottom: 1px solid #ccc;">
@ -42,12 +112,13 @@
</a>
<h1>Trippest &amp; 地接账单预审核</h1>
<ul class="nav navbar-nav navbar-right pull-right" style="margin:7.5px 0;">
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false"><?php $userdata=$this->session->userdata('admin_chtcdn'); echo $userdata['OPI_Name']; ?> <span class="caret"></span></a>
<ul class="dropdown-menu" role="menu">
<li><a href="<?php echo site_url('login/logout'); ?>">退出</a></li>
</ul>
</li>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false"><?php $userdata = $this->session->userdata('admin_chtcdn');
echo $userdata['OPI_Name']; ?> <span class="caret"></span></a>
<ul class="dropdown-menu" role="menu">
<li><a href="<?php echo site_url('login/logout'); ?>">退出</a></li>
</ul>
</li>
</ul>
</div>
</div>
@ -57,9 +128,9 @@
<div class="form-group row">
<label for="" class="col-md-2">地接社</label>
<div class="">
<label class="form-check-label"><input type="checkbox" class="" name="vendors[]" id="" value="1343" <?php if(in_array(1343, $default_vendor)) { ?>checked<?php } ?> >北京图兰朵</label>
<label class="form-check-label"><input type="checkbox" class="" name="vendors[]" id="" value="29188" <?php if(in_array(29188, $default_vendor)) { ?>checked<?php } ?>>上海图兰朵</label>
<label class="form-check-label"><input type="checkbox" class="" name="vendors[]" id="" value="30548" <?php if(in_array(30548, $default_vendor)) { ?>checked<?php } ?>>西安图兰朵</label>
<label class="form-check-label"><input type="checkbox" class="" name="vendors[]" id="" value="1343" <?php if (in_array(1343, $default_vendor)) { ?>checked<?php } ?>>北京图兰朵</label>
<label class="form-check-label"><input type="checkbox" class="" name="vendors[]" id="" value="29188" <?php if (in_array(29188, $default_vendor)) { ?>checked<?php } ?>>上海图兰朵</label>
<label class="form-check-label"><input type="checkbox" class="" name="vendors[]" id="" value="30548" <?php if (in_array(30548, $default_vendor)) { ?>checked<?php } ?>>西安图兰朵</label>
<!-- <label class="form-check-label"><input type="checkbox" class="" name="vendors[]" id="" value="628">桂林地接</label> -->
</div>
</div>
@ -69,7 +140,7 @@
<input type="text" class="form-control" name="date_range" id="date_range" placeholder="选择日期范围" required>
</div>
<div class="col-md-6">
<input type="file" class="form-control" name="upload_cost" id="upload_cost" placeholder="上传成本文件" >
<input type="file" class="form-control" name="upload_cost" id="upload_cost" placeholder="上传成本文件">
</div>
<div class="">
<!-- <input type="text" class="form-control" id="end_date" placeholder="结束日期"> -->
@ -82,26 +153,67 @@
<table class="table table-bordered table-hover">
<thead>
<tr>
<th colspan="10" class="text-left">团款异常:</th>
<th colspan="10" class="text-left">
团款异常: <span class="info-red"> [&nbsp;第一步&nbsp;]&nbsp;解决下表刷红的团款异常问题</span>
</th>
</tr>
<tr>
<th>HT团号</th>
<th>拼团号</th>
<th class="text-left">
<th class="text-left-top">
总收入差额
<p>=&nbsp;财务表总收入&nbsp;-&nbsp;收款记录总额</p>
<ol class="info-primary">
<li>渠道价格不对:
<ul>
<li>产品库价格变更导致, 或渠道收客价错误(如.未使用节庆价)</li>
</ul>
</li>
</ol>
</th>
<th class="text-left">
<th class="text-left-top">
总团款差额
<p>=&nbsp;账单总团款&nbsp;-&nbsp;(&nbsp;HT收款&nbsp;+&nbsp;HT代收&nbsp;)</p>
<p class="info-primary">
数据来自右侧两列,&nbsp;地接代收&nbsp;&nbsp;海纳收&nbsp;不相等 <br>
如右侧两列均显示红色但本列正常, 则是金额正确, 但是收款方设置错误
</p>
</th>
<th class="text-left">
<th class="text-left-top">
地接代收差额
<p>=&nbsp;账单代收&nbsp;-&nbsp;HT代收</p>
<ol class="info-primary">
<li> &gt;0
<ul>
<li> HT收款记录漏记了地接代收的款项, 或收款方未设置为地接 </li>
</ul>
</li>
<li> &lt;0
<ul>
<li> 地接账单未记代收, 或 收款方错误 </li>
</ul>
</li>
</ol>
</th>
<th class="text-left">
<th class="text-left-top">
海纳收差额
<p>=&nbsp;账单收款&nbsp;-&nbsp;HT收款</p>
<ol class="info-primary">
<li> &gt;0
<ul>
<li> 地接账单的代收款记到了海纳收 </li>
<li> 地接账单的未更新退款 </li>
</ul>
</li>
<li> &lt;0
<ul>
<li> 地接账单收款方错误 </li>
<li> 地接账单收款=0: 拆分拼团, 团款已全部记在拆分后的其他团, 本团=0 </li>
<li> 地接账单未更新补充团款 </li>
<li> HT未更新退款 </li>
</ul>
</li>
</ol>
</th>
<th>账单:总团款</th>
<th>账单:地接代收</th>
@ -110,42 +222,40 @@
</tr>
</thead>
<tbody>
<?php if ( ! empty($price_error)) {
<?php if (!empty($price_error)) {
$col_sum = array(
"sum_total_income" => 0
,"sum_total_price" => 0
,"sum_agency_receipt" => 0
,"sum_HT_receipt" => 0
"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>
<td <?php echo abs($ep['total_income_err'])<=1 ? "" : 'class=bgred';?> ><?php echo $ep['total_income_err']; ?></td>
<td <?php echo abs($ep['total_price_err'])<=1 ? "" : 'class=bgred';?> >
<?php echo $ep['total_price_err']; ?>
<!-- <p><?php // echo "=" . $ep['TLD_total_price'] . "-(" . $ep['HT_haina_receipt'] . "+" . $ep['HT_agency_receipt'] . ")"; ?></p> -->
</td>
<td <?php echo abs($ep['agency_receipt_err'])<=1 ? "" : 'class=bgred';?> ><?php echo $ep['agency_receipt_err']; ?></td>
<td <?php echo abs($ep['HT_receipt_err'])<=1 ? "" : 'class=bgred';?> ><?php echo $ep['HT_receipt_err']; ?></td>
<td><?php echo $ep['TLD_total_price']; ?></td>
<td><?php echo $ep['TLD_agency_receipt']; ?></td>
<td><?php echo $ep['HT_haina_receipt']; ?></td>
<td><?php echo $ep['HT_agency_receipt']; ?></td>
</tr>
<?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>
?>
<tr>
<td class="text-left"><?php echo $ep['GRI_Name']; ?></td>
<td class="text-left"><?php echo $ep['combineNo']; ?></td>
<td <?php echo abs($ep['total_income_err']) <= 1 ? "" : 'class=bgred'; ?>><?php echo $ep['total_income_err']; ?></td>
<td <?php echo abs($ep['total_price_err']) <= 1 ? "" : 'class=bgred'; ?>>
<?php echo $ep['total_price_err']; ?>
<!-- <p><?php // echo "=" . $ep['TLD_total_price'] . "-(" . $ep['HT_haina_receipt'] . "+" . $ep['HT_agency_receipt'] . ")";
?></p> -->
</td>
<td <?php echo abs($ep['agency_receipt_err']) <= 1 ? "" : 'class=bgred'; ?>><?php echo $ep['agency_receipt_err']; ?></td>
<td <?php echo abs($ep['HT_receipt_err']) <= 1 ? "" : 'class=bgred'; ?>><?php echo $ep['HT_receipt_err']; ?></td>
<td><?php echo $ep['TLD_total_price']; ?></td>
<td><?php echo $ep['TLD_agency_receipt']; ?></td>
<td><?php echo $ep['HT_haina_receipt']; ?></td>
<td><?php echo $ep['HT_agency_receipt']; ?></td>
</tr>
<?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 } else { ?>
<tr>
<td colspan="6" class="text-left">数据正常</td>
@ -154,68 +264,100 @@
</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 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)) { ?>
<?php if (!empty($error_msg)) { ?>
<p><?php echo $error_msg; ?></p>
<?php } ?>
<table class="table table-bordered table-hover">
<thead>
<tr>
<th colspan="3" class="text-left">成本异常:</th>
<th colspan="3" class="text-left">成本异常:
<span class="info-red">
[&nbsp;第二步&nbsp;]&nbsp;解决下表列出的成本异常问题,
完成后 &xrArr; [ &nbsp; 第三步 &nbsp;]&nbsp;在HT中批量确认并保存账单&xrArr;
<a href="/webht.php/apps/trippestordersync/vendor_money/index" target="_blank" rel="noopener noreferrer">[ &nbsp; 第四步 &nbsp;]&nbsp; &raquo; </a>
</span>
</th>
</tr>
<tr>
<th>拼团号</th>
<th>HT成本</th>
<th>账单成本</th>
<th width='30%' >拼团号</th>
<th width='30%' class="text-left">
<p class="text-center"> HT成本</p>
<ol class="info-primary">
<li> 未找到: HT系统中未找到该团
<ul>
<li> 未同步: 在HT&nbsp;&raquo;&nbsp;单团财务表&nbsp;&raquo;&nbsp;输入团号, 点击`同步图兰朵订单` </li>
<li> 团号被修改后无法匹配 </li>
</ul>
</li>
<li> 其他值
<ul>
<li> 一般情况是数据未更新导致, 在单团财务表中重新生成账单即可 </li>
</ul>
</li>
</ol>
</th>
<th width='30%' class="text-left">
<p class="text-center"> 账单成本</p>
<ol class="info-primary">
<li> 未找到: 上传的excel中未找到该团
<ul>
<li>已取消: 成本应为0 </li>
<li> 不属于合作范畴: 可将该订单设为无效 </li>
<li> 已在其他月份结算: 直接忽略 </li>
</ul>
</li>
</ol>
</th>
</tr>
</thead>
<tbody>
<?php if ( ! empty($cost_error)) {
<?php if (!empty($cost_error)) {
foreach ($cost_error as $ko => $ec) { ?>
<tr>
<td><?php echo $ec['GCI_combineNo']; ?></td>
<td><?php echo $ec['cost']; ?></td>
<td><?php echo $ec['group_cost']; ?></td>
</tr>
<tr>
<td><?php echo $ec['GCI_combineNo']; ?></td>
<td><?php echo $ec['cost']; ?></td>
<td><?php echo $ec['group_cost']; ?></td>
</tr>
<?php }
} ?>
<?php if ( ! empty($ht_no_match)) {
<?php if (!empty($ht_no_match)) {
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>
<td>未找到</td>
</tr>
<tr>
<td><?php echo $ht['GCI_combineNo']; ?></td>
<td><?php echo $ht['cost']; ?></td>
<td>未找到</td>
</tr>
<?php }
} ?>
<?php if ( ! empty($xls_no_match)) {
<?php if (!empty($xls_no_match)) {
foreach ($xls_no_match as $ko => $xls) {
?>
<tr>
<td><?php echo $xls['group_name']; ?></td>
<td>未找到</td>
<td><?php echo $xls['group_cost']; ?></td>
</tr>
<tr>
<td><?php echo $xls['group_name']; ?></td>
<td>未找到</td>
<td><?php echo $xls['group_cost']; ?></td>
</tr>
<?php }
} ?>
<?php if (empty($cost_error) && empty($ht_no_match) && empty($xls_no_match)) { ?>
@ -236,17 +378,19 @@
document.getElementById("request_form").reset();
$("#date_range").flatpickr({
dateFormat: 'Y-m-d'
,mode: 'range'
,allowInput: true
,defaultDate:['<?php echo $default_date1 ?>', '<?php echo $default_date2 ?>']
dateFormat: 'Y-m-d',
mode: 'range',
allowInput: true,
defaultDate: ['<?php echo $default_date1 ?>', '<?php echo $default_date2 ?>']
});
})
function detail_download(vendor) {
document.request_form.action = "/webht.php/apps/trippestordersync/vendor_money/index" + "/" + vendor;
document.querySelector('#request_form').submit();
document.request_form.action = "/webht.php/apps/trippestordersync/vendor_money/index";
}
</script>
</html>

@ -1,10 +1,12 @@
<?php
/**
* 账单结算
*/
?>
<!DOCTYPE html>
<html>
<head>
<title>Trippest &amp; 地接账单结算</title>
<meta charset="utf-8">
@ -16,23 +18,77 @@
<link href="http://www.mycht.cn/css/webht/bootstrap.min.css" rel="stylesheet" type="text/css" />
<link href="http://www.mycht.cn/css/bootstrap-datetimepicker.min.css" rel="stylesheet" type="text/css" />
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/flatpickr/dist/flatpickr.min.css">
<!-- <?php // include 'flatpickr.css.php'; ?> -->
<!-- <?php // include 'flatpickr.css.php';
?> -->
<style type="text/css">
form{border-bottom: 1px solid #ccc;}
.navbar-header h1{display: inline-block;margin-left: 30px;margin-right: 30px;}
label {display: inline-block;max-width: none;margin-bottom: 5px;font-weight: bold; }
.form-check-label{font-weight: normal; margin-left: 5px;}
thead th {text-align: center;}
tbody td {text-align: right;}
.bg-grey {background-color: #f5f5f5;}
.text-left {text-align: left;}
.text-right {text-align: right;}
.text-bold {font-weight: bold;}
.text-red {color: red;}
.cell-right {float: right;}
td a {cursor: pointer;}
form {
border-bottom: 1px solid #ccc;
}
.navbar-header h1 {
display: inline-block;
margin-left: 30px;
margin-right: 30px;
}
label {
display: inline-block;
max-width: none;
margin-bottom: 5px;
font-weight: bold;
}
.form-check-label {
font-weight: normal;
margin-left: 5px;
}
thead th {
text-align: center;
min-width: 150px;
}
tbody td {
text-align: right;
}
.bg-grey {
background-color: #f5f5f5;
}
.text-left {
text-align: left;
}
.text-right {
text-align: right;
}
.text-bold {
font-weight: bold;
}
.text-red {
color: red;
}
.cell-right {
float: right;
}
td a {
cursor: pointer;
}
.info-red {
color: lightcoral;
}
.info-primary{
color: #337ab7;
}
</style>
</head>
<body>
<div id="wrapper" class="chkVisible print-none">
<div class="navbar-header" style="float:none;border-bottom: 1px solid #ccc;">
@ -40,14 +96,15 @@
<img width="150" style="height:40px;" src="/css/nav/img/6000.png">
</a>
<h1>Trippest &amp; 地接账单结算</h1>
<a href="/webht.php/apps/trippestordersync/vendor_money/report_precheck">预审核&raquo;</a>
<a target="_blank" href="/webht.php/apps/trippestordersync/vendor_money/report_precheck">[&nbsp;审核账单从这里开始&nbsp;]&nbsp;预审核&raquo;</a>
<ul class="nav navbar-nav navbar-right pull-right" style="margin:7.5px 0;">
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false"><?php $userdata=$this->session->userdata('admin_chtcdn'); echo $userdata['OPI_Name']; ?> <span class="caret"></span></a>
<ul class="dropdown-menu" role="menu">
<li><a href="<?php echo site_url('login/logout'); ?>">退出</a></li>
</ul>
</li>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false"><?php $userdata = $this->session->userdata('admin_chtcdn');
echo $userdata['OPI_Name']; ?> <span class="caret"></span></a>
<ul class="dropdown-menu" role="menu">
<li><a href="<?php echo site_url('login/logout'); ?>">退出</a></li>
</ul>
</li>
</ul>
</div>
</div>
@ -57,9 +114,9 @@
<div class="form-group row">
<label for="" class="col-md-2">地接社</label>
<div class="">
<label class="form-check-label"><input type="checkbox" class="" name="vendors[]" id="" value="1343" <?php if(in_array(1343, $default_vendor)) { ?>checked<?php } ?> >北京图兰朵</label>
<label class="form-check-label"><input type="checkbox" class="" name="vendors[]" id="" value="29188" <?php if(in_array(29188, $default_vendor)) { ?>checked<?php } ?>>上海图兰朵</label>
<label class="form-check-label"><input type="checkbox" class="" name="vendors[]" id="" value="30548" <?php if(in_array(30548, $default_vendor)) { ?>checked<?php } ?>>西安图兰朵</label>
<label class="form-check-label"><input type="checkbox" class="" name="vendors[]" id="" value="1343" <?php if (in_array(1343, $default_vendor)) { ?>checked<?php } ?>>北京图兰朵</label>
<label class="form-check-label"><input type="checkbox" class="" name="vendors[]" id="" value="29188" <?php if (in_array(29188, $default_vendor)) { ?>checked<?php } ?>>上海图兰朵</label>
<label class="form-check-label"><input type="checkbox" class="" name="vendors[]" id="" value="30548" <?php if (in_array(30548, $default_vendor)) { ?>checked<?php } ?>>西安图兰朵</label>
<!-- <label class="form-check-label"><input type="checkbox" class="" name="vendors[]" id="" value="628">桂林地接</label> -->
</div>
</div>
@ -87,140 +144,142 @@
<th rowspan="2">⑧海纳应付地接</th>
</tr>
<tr>
<th >①海纳代收</th>
<th >②地接代收</th>
<th >①+②</th>
<th >③海纳成本</th>
<th >④地接成本</th>
<th>①海纳代收</th>
<th>②地接代收</th>
<th>①+②</th>
<th>③海纳成本</th>
<th>④地接成本</th>
</tr>
</thead>
<tbody>
<?php if ( ! empty($money)) {
<?php if (!empty($money)) {
foreach ($money as $kt => $trippest) {
?>
<tr>
<td class="text-left"><?php echo $trippest['vendor_name'] ?>
<a onclick="detail_download(<?php echo $trippest['vendor_code'] ?>);" class="cell-right">导出账单明细&nbsp;&dArr;</a>
</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>
<td><?php echo $trippest['trippest']['trippest_profit'] ?></td>
<td><?php echo $trippest['trippest']['vendor_profit'] ?></td>
<td><?php echo $trippest['trippest']['payout'] ?></td>
</tr>
<?php
if ($trippest['trippest']['other_sum'] > 0) {
?>
<tr class="bg-grey">
<td >非包价产品的收款 <br></td>
<td ><?php echo $trippest['trippest']['other_sum'] ?></td>
<td ></td>
<td ></td>
<td ><?php echo $trippest['trippest']['other_sum_cost'] ?></td>
<td ></td>
<td colspan="4"></td>
</tr>
<?php
}
?>
<?php
if ($trippest['trippest']['other_vendor_sum'] > 0) {
?>
<tr class="bg-grey">
<td >已扣减的其他地接的团款 <br></td>
<td ><?php echo $trippest['trippest']['other_vendor_sum'] ?></td>
<td ></td>
<td ></td>
<td ></td>
<td ></td>
<td colspan="4"></td>
</tr>
<?php
}
?>
?>
<tr>
<td class="text-left"><?php echo $trippest['vendor_name'] ?>
<a onclick="detail_download(<?php echo $trippest['vendor_code'] ?>);" class="cell-right">导出账单明细&nbsp;&dArr;</a>
</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>
<td><?php echo $trippest['trippest']['trippest_profit'] ?></td>
<td><?php echo $trippest['trippest']['vendor_profit'] ?></td>
<td><?php echo $trippest['trippest']['payout'] ?></td>
</tr>
<?php
if ($trippest['trippest']['other_sum'] > 0) {
?>
<tr class="bg-grey">
<td>非包价产品的收款 <br></td>
<td><?php echo $trippest['trippest']['other_sum'] ?></td>
<td></td>
<td></td>
<td><?php echo $trippest['trippest']['other_sum_cost'] ?></td>
<td></td>
<td colspan="4"></td>
</tr>
<?php
}
?>
<?php
if ($trippest['trippest']['other_vendor_sum'] > 0) {
?>
<tr class="bg-grey">
<td>已扣减的其他地接的团款 <br></td>
<td><?php echo $trippest['trippest']['other_vendor_sum'] ?></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td colspan="4"></td>
</tr>
<?php
}
?>
<?php
}
} ?>
<?php if ( ! empty($col_sum)) {
?>
<tr class="text-bold">
<td class="text-left">合计(仅包价产品)</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>
<td><?php echo $col_sum['trippest']['sum_trippest_profit'] ?></td>
<td><?php echo $col_sum['trippest']['sum_vendor_profit'] ?></td>
<td><?php echo $col_sum['trippest']['sum_payout'] ?></td>
</tr>
<?php if (!empty($col_sum)) {
?>
<tr class="text-bold">
<td class="text-left">合计(仅包价产品)</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>
<td><?php echo $col_sum['trippest']['sum_trippest_profit'] ?></td>
<td><?php echo $col_sum['trippest']['sum_vendor_profit'] ?></td>
<td><?php echo $col_sum['trippest']['sum_payout'] ?></td>
</tr>
<?php } ?>
<?php if ( ! empty($trippest_order_multi_city)) {
?>
<tr class="text-bold bg-grey">
<th >多地预订的团号</th>
<th >拼团号</th>
<th >总报价/USD</th>
<th >总收款/RMB</th>
<th >计入上表海纳收团款</th>
<th colspan="5">应扣除的其他地接收款: (实时计算, 存在汇率误差)</th>
</tr>
<?php foreach ($trippest_order_multi_city as $ko => $order) {
?>
<tr>
<td class="text-left"><?php echo $order['COLI_GroupCode'] ?></td>
<td class="text-left"><?php echo $order['gci_no'] ?></td>
<td ><?php echo $order['COLI_Price'] ?></td>
<td ><?php echo $order['money_sum'] ?></td>
<td ><?php echo bcsub($order['money_sum'],$order["other_vendorprice_RMB"]) ?>
<br> <?php echo ($order["vendor_name"]) ?>
</td>
<td colspan="5" class="text-left"><?php echo $order["other_vendorprice_RMB"] ?></td>
</tr>
<?php } } ?>
<?php if ( ! empty($trippest_order_cost_debug)) {
?>
<tr class="text-bold">
<td colspan="10"></td>
</tr>
<tr class="text-bold bg-grey">
<th ><span class="text-red">成本异常,建议重新审核:</span> 订单号</th>
<th >拼团成本总额</th>
<th >拼团人等</th>
<th >订单: 成人数 + 儿童数</th>
<th >订单成本</th>
<th colspan="5">财务表备注</th>
</tr>
<?php foreach ($trippest_order_cost_debug as $ko => $order) {
?>
<tr>
<td class="text-left"><?php echo $order['ordernumber'] ?></td>
<td ><?php echo $order['RPT_Total'] ?></td>
<td ><?php echo $order['RPT_PersonGrade'] ?></td>
<td ><?php echo $order['tourRSd'] ?> + <?php echo $order['tourRSx'] ?></td>
<td ><?php echo $order['tourcost'] ?></td>
<td colspan="5" class="text-left"> <?php echo ($order["tourBZ"]) ?></td>
</tr>
<?php } } ?>
<?php if (!empty($trippest_order_multi_city)) {
?>
<tr class="text-bold bg-grey">
<th>多地预订的团号</th>
<th>拼团号</th>
<th>总报价/USD</th>
<th>总收款/RMB</th>
<th>计入上表海纳收团款</th>
<th colspan="5">应扣除的其他地接收款: (实时计算, 存在汇率误差)</th>
</tr>
<?php foreach ($trippest_order_multi_city as $ko => $order) {
?>
<tr>
<td class="text-left"><?php echo $order['COLI_GroupCode'] ?></td>
<td class="text-left"><?php echo $order['gci_no'] ?></td>
<td><?php echo $order['COLI_Price'] ?></td>
<td><?php echo $order['money_sum'] ?></td>
<td><?php echo bcsub($order['money_sum'], $order["other_vendorprice_RMB"]) ?>
<br> <?php echo ($order["vendor_name"]) ?>
</td>
<td colspan="5" class="text-left"><?php echo $order["other_vendorprice_RMB"] ?></td>
</tr>
<?php }
} ?>
<?php if (!empty($trippest_order_cost_debug)) {
?>
<tr class="text-bold">
<td colspan="10"></td>
</tr>
<tr class="text-bold bg-grey">
<th><span class="text-red">成本异常,建议重新审核:</span> 订单号</th>
<th>拼团成本总额</th>
<th>拼团人等</th>
<th>订单: 成人数 + 儿童数</th>
<th>订单成本</th>
<th colspan="5">财务表备注</th>
</tr>
<?php foreach ($trippest_order_cost_debug as $ko => $order) {
?>
<tr>
<td class="text-left"><?php echo $order['ordernumber'] ?></td>
<td><?php echo $order['RPT_Total'] ?></td>
<td><?php echo $order['RPT_PersonGrade'] ?></td>
<td><?php echo $order['tourRSd'] ?> + <?php echo $order['tourRSx'] ?></td>
<td><?php echo $order['tourcost'] ?></td>
<td colspan="5" class="text-left"> <?php echo ($order["tourBZ"]) ?></td>
</tr>
<?php }
} ?>
</tbody>
</table>
<p>同步数据:</p>
<p>同步数据: &nbsp; 账单批量保存后, 下表应与地接社提供的汇总表数据一致, 否则需 &nbsp;[&nbsp;第四步&nbsp;]&nbsp;&DoubleDownArrow;</p>
<table class="table table-bordered table-hover">
<thead>
<tr>
<th >目的地</th>
<th >总营收:①海纳代收+②地接代收</th>
<th >总成本:③海纳成本+④地接成本</th>
<th >⑤利润</th>
<th >⑥海纳利润</th>
<th >⑦地接利润</th>
<th >⑧海纳应付地接</th>
<th>目的地</th>
<th>总营收:①海纳代收+②地接代收</th>
<th>总成本:③海纳成本+④地接成本</th>
<th>⑤利润</th>
<th>⑥海纳利润</th>
<th>⑦地接利润</th>
<th>⑧海纳应付地接</th>
</tr>
<!-- <tr>
<th >①海纳代收</th>
@ -230,54 +289,76 @@
</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 } }?>
<?php if ( ! empty($col_sum)) {
?>
<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>
<?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 }
} ?>
<?php if (!empty($col_sum)) {
?>
<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>
<?php } ?>
</tbody>
</table>
<?php if ( ! empty($diff_cost)) { ?>
<p>财务表成本与实际成本不一致, 检查是否需要重新生成账单:</p>
<?php if (!empty($diff_cost)) { ?>
<p>财务表成本与实际成本不一致, <span class="info-red"> &nbsp;[&nbsp;第四步&nbsp;]&nbsp;</span>检查是否需要重新生成账单:</p>
<table class="table table-bordered table-hover">
<thead>
<tr>
<th >拼团号</th>
<th >实际总成本</th>
<th >财务表总成本</th>
<th>拼团号</th>
<th class="text-left">
<p class="text-center"> 实际总成本</p>
</th>
<th class="text-left">
<p class="text-center"> 财务表总成本</p>
<ol class="info-primary">
<li> 数据为空: 虚拟订单没有团号, 无法计算. 如:
<ul>
<li> TA导游奖励计入成本的虚拟订单. 人工检查金额正确之后, 此处可忽略该团. </li>
</ul>
</li>
</ol>
</th>
</tr>
</thead>
<tbody>
<?php foreach ($diff_cost as $kdc => $diff) { ?>
<tr>
<td><?php echo $diff['gci_no'] ?></td>
<td><?php echo $diff['total_cost'] ?></td>
<td><?php echo $diff['report_total_cost0'] ?></td>
</tr>
<?php } ?>
</tbody>
<?php foreach ($diff_cost as $kdc => $diff) { ?>
<tr>
<td><?php echo $diff['gci_no'] ?></td>
<td><?php echo $diff['total_cost'] ?></td>
<td><?php echo $diff['report_total_cost0'] ?></td>
</tr>
<?php } ?>
</tbody>
</table>
<?php } ?>
</div>
@ -288,17 +369,19 @@
<script type="text/javascript">
$(document).ready(function() {
$("#date_range").flatpickr({
dateFormat: 'Y-m-d'
,mode: 'range'
,allowInput: true
,defaultDate:['<?php echo $default_date1 ?>', '<?php echo $default_date2 ?>']
dateFormat: 'Y-m-d',
mode: 'range',
allowInput: true,
defaultDate: ['<?php echo $default_date1 ?>', '<?php echo $default_date2 ?>']
});
})
function detail_download(vendor) {
document.request_form.action = "/webht.php/apps/trippestordersync/vendor_money/index" + "/" + vendor;
document.querySelector('#request_form').submit();
document.request_form.action = "/webht.php/apps/trippestordersync/vendor_money/index";
}
</script>
</html>

Loading…
Cancel
Save