From 481c1ce40be7f2b1af5564012439962f9e489dd5 Mon Sep 17 00:00:00 2001
From: lccsw <805383944@qq.com>
Date: Wed, 17 Aug 2022 13:40:59 +0800
Subject: [PATCH] edit-plan-settle_brand
---
admin/controllers/biz/Seprice.php | 2 +-
admin/controllers/biz/Settle.php | 5 ++-
admin/controllers/biz/Srv.php | 2 ++
admin/views/biz/seprice/get.php | 2 +-
admin/views/biz/settle/lists_brand.php | 34 +++++++++------------
api/controllers/plan/Biz.php | 42 ++++++++++++--------------
6 files changed, 42 insertions(+), 45 deletions(-)
diff --git a/admin/controllers/biz/Seprice.php b/admin/controllers/biz/Seprice.php
index 799a9bd3..7b0f9c3f 100644
--- a/admin/controllers/biz/Seprice.php
+++ b/admin/controllers/biz/Seprice.php
@@ -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();
diff --git a/admin/controllers/biz/Settle.php b/admin/controllers/biz/Settle.php
index 63d6852c..5b1ef377 100644
--- a/admin/controllers/biz/Settle.php
+++ b/admin/controllers/biz/Settle.php
@@ -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'],
diff --git a/admin/controllers/biz/Srv.php b/admin/controllers/biz/Srv.php
index 6f7509ca..38bf5bbb 100644
--- a/admin/controllers/biz/Srv.php
+++ b/admin/controllers/biz/Srv.php
@@ -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
];
diff --git a/admin/views/biz/seprice/get.php b/admin/views/biz/seprice/get.php
index 225f14d6..558f8c6e 100644
--- a/admin/views/biz/seprice/get.php
+++ b/admin/views/biz/seprice/get.php
@@ -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 (){
diff --git a/admin/views/biz/settle/lists_brand.php b/admin/views/biz/settle/lists_brand.php
index 9e8a4142..d1395d12 100644
--- a/admin/views/biz/settle/lists_brand.php
+++ b/admin/views/biz/settle/lists_brand.php
@@ -57,10 +57,13 @@
门店 |
订单信息 |
- 单车总毛利 |
- 服务费 |
- 佣金 |
- 精品 |
+ 单车毛利税后 |
+ 保险利润 |
+ 贷款利润 |
+ 挂牌利润 |
+ 精品利润 |
+ 水平业务总毛利 |
+ 水平业务税后毛利 |
时间 |
@@ -77,22 +80,13 @@
{{v.title}} {{v.vin}}
- {{v.profix_car}} |
-
-
- {{v.money_json.in.srv_price}}
-
- |
-
-
- {{v.money_json.in.commission}}
-
- |
-
-
- {{v.money_json.out.fine_price}}
-
- |
+ {{v.profix_car_after}} |
+ {{v.profix_insure}} |
+ {{v.profix_loan}} |
+ {{v.profix_carno}} |
+ {{v.profix_fine}} |
+ {{v.sum_srv}} |
+ {{v.sum_srv_after}} |
{{v.month}} |
diff --git a/api/controllers/plan/Biz.php b/api/controllers/plan/Biz.php
index 809c1553..4c623c16 100644
--- a/api/controllers/plan/Biz.php
+++ b/api/controllers/plan/Biz.php
@@ -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']))),