edit-plan-settle_brand
This commit is contained in:
@@ -3,7 +3,7 @@ defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
|
||||
class Seprice extends HD_Controller
|
||||
{
|
||||
private $employee_price_arr = ['4000.00','6000.00','8000.00'];
|
||||
private $employee_price_arr = ['3000.00','4000.00','5000.00'];
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
|
||||
@@ -118,17 +118,20 @@ class Settle extends HD_Controller
|
||||
$title = "{$map_brand[$v['brand_id']]} {$map_sery[$v['s_id']]} {$map_attr[$v['v_id']]} {$map_attr[$v['cor_id']]}";
|
||||
$month = date('Y-m',strtotime("{$v['year']}-{$v['month']}"));
|
||||
$money_json = json_decode($v['money_json'],true);
|
||||
$sum_srv = $v['profix_insure']+$v['profix_carno']+$v['profix_loan']+$v['profix_fine'];
|
||||
$lists[] = array(
|
||||
'id' => $v['id'],
|
||||
'o_id' => $v['o_id'],
|
||||
'title' => $title,
|
||||
'biz_name' => $map_biz[$v['biz_id']],
|
||||
'profix_car' => $v['profix_car'],
|
||||
'profix_car_after' => sprintf("%.2f",$v['profix_car']/1.13),
|
||||
'profix_insure' => $v['profix_insure'],
|
||||
'profix_carno' => $v['profix_carno'],
|
||||
'profix_loan' => $v['profix_loan'],
|
||||
'profix_fine' => $v['profix_fine'],
|
||||
'sum_srv' => $v['profix_insure']+$v['profix_carno']+$v['profix_loan']+$v['profix_fine'],
|
||||
'sum_srv' => $sum_srv,
|
||||
'sum_srv_after' => sprintf("%.2f",$sum_srv/1.06),
|
||||
'price_trucking' => $v['price_trucking'],
|
||||
'name' => $v['name'],
|
||||
'mobile' => $v['mobile'],
|
||||
|
||||
@@ -132,6 +132,7 @@ class Srv extends HD_Controller{
|
||||
if($info['is_def']){
|
||||
$where = [
|
||||
'biz_id' => $info['biz_id'],
|
||||
'title' => $info['title'],
|
||||
'type' => $info['type'],
|
||||
'is_def' => 1
|
||||
];
|
||||
@@ -178,6 +179,7 @@ class Srv extends HD_Controller{
|
||||
if($info['is_def']){
|
||||
$where = [
|
||||
'biz_id' => $info['biz_id'],
|
||||
'title' => $info['title'],
|
||||
'type' => $info['type'],
|
||||
'is_def' => 1
|
||||
];
|
||||
|
||||
@@ -115,7 +115,7 @@
|
||||
this.up_employee_price()
|
||||
},
|
||||
add_employee_price:function (){
|
||||
this.employee_price_list.push('4000.00');
|
||||
this.employee_price_list.push('3000.00');
|
||||
this.up_employee_price()
|
||||
},
|
||||
up_employee_price:function (){
|
||||
|
||||
@@ -57,10 +57,13 @@
|
||||
</th>
|
||||
<th width="10%"><span>门店</span></th>
|
||||
<th width="20%"><span>订单信息</span></th>
|
||||
<th width="10%"><span>单车总毛利</span></th>
|
||||
<th width="10%"><span>服务费</span></th>
|
||||
<th width="10%"><span>佣金</span></th>
|
||||
<th width="6%"><span>精品</span></th>
|
||||
<th width="10%"><span>单车毛利税后</span></th>
|
||||
<th width="10%"><span>保险利润</span></th>
|
||||
<th width="10%"><span>贷款利润</span></th>
|
||||
<th width="10%"><span>挂牌利润</span></th>
|
||||
<th width="10%"><span>精品利润</span></th>
|
||||
<th width="10%"><span>水平业务总毛利</span></th>
|
||||
<th width="10%"><span>水平业务税后毛利</span></th>
|
||||
<th width="6%"><span>时间</span></th>
|
||||
</tr>
|
||||
</thead>
|
||||
@@ -77,22 +80,13 @@
|
||||
{{v.title}} {{v.vin}}
|
||||
</a>
|
||||
</td>
|
||||
<td>{{v.profix_car}}</td>
|
||||
<td>
|
||||
<template v-if="v.money_json && v.money_json.in">
|
||||
{{v.money_json.in.srv_price}}
|
||||
</template>
|
||||
</td>
|
||||
<td>
|
||||
<template v-if="v.money_json && v.money_json.in">
|
||||
{{v.money_json.in.commission}}
|
||||
</template>
|
||||
</td>
|
||||
<td>
|
||||
<template v-if="v.money_json && v.money_json.out">
|
||||
{{v.money_json.out.fine_price}}
|
||||
</template>
|
||||
</td>
|
||||
<td>{{v.profix_car_after}}</td>
|
||||
<td>{{v.profix_insure}}</td>
|
||||
<td>{{v.profix_loan}}</td>
|
||||
<td>{{v.profix_carno}}</td>
|
||||
<td>{{v.profix_fine}}</td>
|
||||
<td>{{v.sum_srv}}</td>
|
||||
<td>{{v.sum_srv_after}}</td>
|
||||
<td>{{v.month}}</td>
|
||||
</tr>
|
||||
</template>
|
||||
|
||||
@@ -241,25 +241,25 @@ class Biz extends HD_Controller
|
||||
'id' => $info_json['business_id'],
|
||||
];
|
||||
$b_row_one = $this->auto_business_model->get($where);
|
||||
$settle_money_json['in']['profix_car'] = $b_row_one['profix_car'] ? $b_row_one['profix_car'] : 0;
|
||||
$settle_money_json['in']['profix_car'] = $b_row_one['profix_car'] ? $b_row_one['profix_car']-$money_json['price_discount'] : 0;
|
||||
//挂牌利润 = 实收 - 成本
|
||||
// $profix_carno = 0;
|
||||
// if($money_json['fee_carno']>0){
|
||||
// $where = [
|
||||
// 'biz_id' => $val['biz_id'],
|
||||
// 'type' => 1,
|
||||
// 'status' => 1,
|
||||
// 's_effect_time>=' => date('Y-m-01',$val['c_time']),
|
||||
// 's_effect_time<=' => date('Y-m-t',$val['c_time']),
|
||||
// ];
|
||||
// $free_row = $this->biz_settle_srv_model->get($where);
|
||||
// if(!$free_row){
|
||||
// $free_row = $this->biz_settle_srv_model->get(['biz_id'=>$val['biz_id'],'is_def'=>1,'status'=>1,'type'=>1]);
|
||||
// }
|
||||
// $free_jsondata = json_decode($free_row['jsondata'],true);
|
||||
// $cb_fee_carno = $free_jsondata['price'] ? $free_jsondata['price'] : 0;
|
||||
// $profix_carno = $money_json['fee_carno'] - $cb_fee_carno;
|
||||
// }
|
||||
$profix_carno = 0;
|
||||
if($money_json['fee_carno']>0){
|
||||
$where = [
|
||||
'biz_id' => $val['biz_id'],
|
||||
'type' => 1,
|
||||
'status' => 1,
|
||||
's_effect_time>=' => date('Y-m-01',strtotime($val['bill_time'])),
|
||||
's_effect_time<=' => date('Y-m-t',strtotime($val['bill_time'])),
|
||||
];
|
||||
$free_row = $this->biz_settle_srv_model->get($where);
|
||||
if(!$free_row){
|
||||
$free_row = $this->biz_settle_srv_model->get(['biz_id'=>$val['biz_id'],'is_def'=>1,'status'=>1,'type'=>1]);
|
||||
}
|
||||
$free_jsondata = json_decode($free_row['jsondata'],true);
|
||||
$cb_fee_carno = $free_jsondata['price'] ? $free_jsondata['price'] : 0;
|
||||
$profix_carno = $money_json['fee_carno'] - $cb_fee_carno;
|
||||
}
|
||||
//保险利润 = 金额(是否含税) * 返点百分比(保险类型):保险生效日
|
||||
$data_row = $this->receiver_order_datas_model->get(['o_id'=>$val['id']]);
|
||||
$insurance_img = json_decode($data_row['insurance_img'],true);
|
||||
@@ -282,7 +282,6 @@ class Biz extends HD_Controller
|
||||
'title' => $insurance_img['product'],
|
||||
'type' => 2,
|
||||
'is_def' => 1,
|
||||
"json_extract(jsondata, '$.type') = '1'" => null,
|
||||
];
|
||||
$fd_row = $this->biz_settle_srv_model->get($where);
|
||||
}
|
||||
@@ -308,7 +307,6 @@ class Biz extends HD_Controller
|
||||
'title' => $business_img['product'],
|
||||
'type' => 2,
|
||||
'is_def' => 1,
|
||||
"json_extract(jsondata, '$.type') = '2'" => null,
|
||||
];
|
||||
$bis_fd_row = $this->biz_settle_srv_model->get($where);
|
||||
}
|
||||
@@ -361,8 +359,8 @@ class Biz extends HD_Controller
|
||||
'profix_car' => $settle_money_json['in']['profix_car'],
|
||||
'profix_insure' => $profix_insuer,
|
||||
'profix_loan' => $profix_loan,
|
||||
// 'profix_carno' => $profix_carno,
|
||||
// 'profix_fine' => $profix_fine,
|
||||
'profix_carno' => $profix_carno,
|
||||
'profix_fine' => $money_json['price_fine_select'] - $profix_fine,
|
||||
'money_json' => json_encode($settle_money_json,JSON_UNESCAPED_UNICODE),
|
||||
'year' => date('Y',strtotime($val['bill_time'])),
|
||||
'month' => intval(date('m',strtotime($val['bill_time']))),
|
||||
|
||||
Reference in New Issue
Block a user