Merge branch 'feature/trippest'

hotfix/远程访问多媒体中心
lyt 6 years ago
commit 76f6f5c743

@ -50,6 +50,7 @@ class Vendor_money extends CI_Controller {
,"default_vendor" => $vendors
,"trippest_order_vendor_money" => array()
,"trippest_order_multi_city" => array()
,"trippest_order_cost_debug" => array()
,"transfer_sum" => 0
/** 列总计 */
,"col_sum" => array(
@ -78,6 +79,7 @@ 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));
/** 团款 */
foreach ($vendors as $key => $vendor) {
$sourcetype = $vendor_sourcetype[strval($vendor)]["sourcetype"];
@ -197,30 +199,6 @@ class Vendor_money extends CI_Controller {
return ;
}
public function detail($download_vendor=null)
{
// $this->permission->is_admin(true); // test:
$date_range = $this->input->post("date_range");
preg_match_all('/\d{4}\-\d{2}\-\d{2}/', $date_range, $date_range_arr);
if (empty($date_range_arr[0])) {
return $this->settlement();
}
$start_date = $date_range_arr[0][0];
$end_date =$date_range_arr[0][1] . " 23:59:59";
if ($end_date == null) {
$end_date = date("Y-m-d H:i:s", strtotime("+1 month", strtotime($start_date))-1);
}
$vendors = $this->input->post("vendors");
if ($download_vendor !== null) {
$vendors = array($download_vendor);
}
$vendor_sourcetype = $this->trippest->vendor_sourcetype();
$sourcetype = $vendor_sourcetype[strval($download_vendor)]["sourcetype"];
$vendor_data = $this->money_model->group_detail_list($download_vendor, $sourcetype, $start_date, $end_date, implode(',', $vendors));
return $this->output->set_content_type('application/json')->set_output(json_encode($vendor_data));
}
public function download_output($export_list, $file_name)
{
if (empty($export_list)) {

@ -301,6 +301,30 @@ class Vendor_money_model extends CI_Model {
return $query->result_array();
}
public function cost_debug_detail($start_date, $end_date, $all_vendor)
{
$sql = "SELECT
ordernumber,RPT_Total
,round(tourCost/case isnull(tourRSd,0)+ISNULL(tourRSx,0) when 0 then 1 else isnull(tourRSd,0)+ISNULL(tourRSx,0) end *case isnull(RPT_PersonGrade,1) when 0 then 1 else isnull(RPT_PersonGrade,1) end,2) as cal_total
,tourRSd,isnull(tourRSx,0) tourRSx,tourcost,RPT_PersonGrade,tourBZ,tourCode
from report_tour rt
inner join BIZ_ConfirmLineDetail cold on RPT_COLD_SN=COLD_SN
where COLD_StartDate between '$start_date' and '$end_date'
and COLD_PlanVEI_SN in ($all_vendor)
and ISNULL(RPT_Total,0)<>case when SUBSTRING(tourBZ,1,3)='PVT' then tourcost
else round(
(tourCost/case isnull(tourRSd,0)+ISNULL(tourRSx,0) when 0 then 1 else isnull(tourRSd,0)+ISNULL(tourRSx,0) end
*case isnull(RPT_PersonGrade,1) when 0 then 1 else isnull(RPT_PersonGrade,1) end),2)
end
and exists (
select 1 from OperatorInfo
inner join BIZ_ConfirmLineInfo on COLI_ID=ordernumber
where OPI_SN=COLI_OPI_ID and OPI_DEI_SN=30
)
order by tourBZ desc";
$query = $this->HT->query($sql);
return $query->result_array();
}
}

@ -28,6 +28,7 @@
.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;}
</style>
@ -157,7 +158,7 @@
<?php } ?>
<?php if ( ! empty($trippest_order_multi_city)) {
?>
<tr class="text-bold">
<tr class="text-bold bg-grey">
<th >多地预订的团号</th>
<th >拼团号</th>
<th >总报价/USD</th>
@ -178,6 +179,30 @@
<td colspan="4" 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="9"></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="4">财务表备注</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="4" class="text-left"> <?php echo ($order["tourBZ"]) ?></td>
</tr>
<?php } } ?>
</tbody>
</table>
<!--

Loading…
Cancel
Save