Trippest财务表:增加成本审核有误的明细,解决成本明细的总额和拼团成本总额的不一致

feature/trippest
lyt 6 years ago
parent 6f7bd1d59f
commit bc70c31318

@ -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"];

@ -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