From d8625c2356f0efe171e4dfe3a10d1e3139263dbc Mon Sep 17 00:00:00 2001 From: zengchaoxin Date: Fri, 11 Oct 2019 10:15:31 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=8C=E6=88=90=E7=AD=96=E7=95=A5=E7=AE=A1?= =?UTF-8?q?=E7=90=86=E5=8A=9F=E8=83=BD=E5=BC=80=E5=8F=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- common/models/PayT.php | 24 + common/models/UserT.php | 18 + common/models/ZhongjiFanxianT.php | 62 + common/models/ZhongjiGiftT.php | 62 + common/models/ZhongjiUserT.php | 54 + frontend/controllers/FinanceController.php | 1113 +++++++++++++++++ .../MarketingStrategyController.php | 362 +++++- frontend/controllers/PersonnelController.php | 167 ++- frontend/views/finance/budian-list.php | 184 +++ frontend/views/finance/chuna-gongzi-info.php | 769 ++++++++++++ frontend/views/finance/chuna-gongzi-list.php | 155 +++ frontend/views/finance/gongzi-all-info.php | 724 +++++++++++ frontend/views/finance/gongzi-all-list.php | 159 +++ frontend/views/finance/pay2-info.php | 604 +++++---- frontend/views/finance/pay2-list.php | 66 +- frontend/views/finance/receipt-lirun.php | 289 +++++ frontend/views/finance/ticheng-jisuan.php | 369 ++++++ frontend/views/layouts/blue-main.php | 1 + frontend/views/marketing-strategy/add.php | 28 +- frontend/views/marketing-strategy/edit.php | 193 ++- frontend/views/marketing-strategy/fanxian.php | 153 +++ frontend/views/marketing-strategy/gifts.php | 83 ++ frontend/views/marketing-strategy/users.php | 70 ++ frontend/views/personnel/pay-info.php | 182 ++- frontend/views/personnel/pay-list.php | 318 +++-- frontend/web/assets/css/custom.css | 15 + 26 files changed, 5621 insertions(+), 603 deletions(-) create mode 100644 common/models/ZhongjiFanxianT.php create mode 100644 common/models/ZhongjiGiftT.php create mode 100644 common/models/ZhongjiUserT.php create mode 100644 frontend/views/finance/budian-list.php create mode 100644 frontend/views/finance/chuna-gongzi-info.php create mode 100644 frontend/views/finance/chuna-gongzi-list.php create mode 100644 frontend/views/finance/gongzi-all-info.php create mode 100644 frontend/views/finance/gongzi-all-list.php create mode 100644 frontend/views/finance/receipt-lirun.php create mode 100644 frontend/views/finance/ticheng-jisuan.php create mode 100644 frontend/views/marketing-strategy/fanxian.php create mode 100644 frontend/views/marketing-strategy/gifts.php create mode 100644 frontend/views/marketing-strategy/users.php create mode 100644 frontend/web/assets/css/custom.css diff --git a/common/models/PayT.php b/common/models/PayT.php index 782f0e1..5602672 100644 --- a/common/models/PayT.php +++ b/common/models/PayT.php @@ -338,4 +338,28 @@ class PayT extends \common\models\Base $bmbaofei = $query->sum('total1_clear'); return round($bmbaofei,2); } + + public function getStatus($status_id){ + $res = ''; + if($status_id == 1){ + $res = '人事✔'; + }elseif ($status_id == 2){ + $res = '出纳✔'; + }elseif ($status_id == 3){ + $res = '人事✔,出纳✔'; + }elseif ($status_id == 4){ + $res = '财务✔'; + }elseif ($status_id == 5){ + $res = '老板✔'; + }elseif ($status_id == 6){ + $res = '已发放'; + }elseif ($status_id == 7){ + $res = '退回人事'; + }elseif ($status_id == 8){ + $res = '退回出纳'; + }elseif ($status_id == 10){ + $res = '退回财务'; + } + return $res; + } } diff --git a/common/models/UserT.php b/common/models/UserT.php index 3330e70..27e1896 100644 --- a/common/models/UserT.php +++ b/common/models/UserT.php @@ -270,4 +270,22 @@ class UserT extends \common\models\Base return $items; } } + + public function getChunaShouldPay($pay_date){ + $user_id = $this->id; + $pay_chexian = PayOrderUserT::find() + ->where('pay_date="' . $pay_date . '" and type<>7 and type<>8 and type<>10 and user_id=' . $user_id) + ->sum('real_pay'); + + $pay_nochexian = PayOrderUserT::find() + ->where('pay_date="' . $pay_date . '" and type=7 and user_id=' . $user_id) + ->orWhere('pay_date="' . $pay_date . '" and type=8 and user_id=' . $user_id) + ->sum('real_pay'); + + $pay_dz = PayOrderUserT::find() + ->where('pay_date="' . $pay_date . '" and type=10 and user_id=' . $user_id) + ->sum('real_pay'); + + return $pay_chexian + $pay_nochexian + $pay_dz; + } } diff --git a/common/models/ZhongjiFanxianT.php b/common/models/ZhongjiFanxianT.php new file mode 100644 index 0000000..32b9668 --- /dev/null +++ b/common/models/ZhongjiFanxianT.php @@ -0,0 +1,62 @@ + 'ID', + 'celuo_id' => 'Celuo ID', + 'fanxian_rate' => 'Fanxian Rate', + 'created_at' => 'Created At', + 'updated_at' => 'Updated At', + ]; + } + + public function getTiaojian() { + return $this->hasOne(ZhongjiTiaojian::className(),['id'=>'tiaojian_id']); + } + + public function getCeluo() { + return $this->hasOne(ZhongjiYingxiao::className(), ['id'=>'celuo_id']); + } +} diff --git a/common/models/ZhongjiGiftT.php b/common/models/ZhongjiGiftT.php new file mode 100644 index 0000000..3f442fa --- /dev/null +++ b/common/models/ZhongjiGiftT.php @@ -0,0 +1,62 @@ + 'ID', + 'celuo_id' => 'Celuo ID', + 'fanxian_id' => 'Fanxian ID', + 'n' => 'n', + 'gift_type' => 'Gift Type', + 'free_type' => 'Free Type', + 'gift_ids' => 'Gift Ids', + 'created_at' => 'Created At', + 'updated_at' => 'Updated At', + ]; + } +} diff --git a/common/models/ZhongjiUserT.php b/common/models/ZhongjiUserT.php new file mode 100644 index 0000000..13ec794 --- /dev/null +++ b/common/models/ZhongjiUserT.php @@ -0,0 +1,54 @@ + 'ID', + 'celuo_id' => 'Celuo ID', + 'user_id' => 'User ID', + 'created_at' => 'Created At', + 'updated_at' => 'Updated At', + ]; + } + + public function getUser() { + return $this->hasOne(UserT::className(),['id'=>'user_id']); + } +} diff --git a/frontend/controllers/FinanceController.php b/frontend/controllers/FinanceController.php index ab505fe..4a1673e 100644 --- a/frontend/controllers/FinanceController.php +++ b/frontend/controllers/FinanceController.php @@ -21,6 +21,7 @@ use common\models\CarCT; use common\models\CarDT; use common\models\CarET; use common\models\CarInvalidT; +use common\models\GiftT; use common\models\ImportLogT; use common\models\CompanyT; use common\models\EmsT; @@ -6570,4 +6571,1116 @@ class FinanceController extends \frontend\controllers\UserBaseController return $result; } + + public function actionBudianList() + { + $request = Yii::$app->request; + $begin_date = $request->get('begin_date',date('Y-m-d')); + $end_date = $request->get('end_date',date('Y-m-d')); + $begin_totalclear = $request->get('begin_totalclear'); + $end_totalclear = $request->get('end_totalclear'); + $car_no_type = $request->get('car_no_type'); + $company_id = $request->get('company_id'); + $insurer_type = $request->get('insurer_type'); + + + $budian_rate = $request->get('budian_rate'); + + $page = $request->get('page',1); + + + + + $query = CaiwuT::find() + ->leftJoin(OrderT::tableName(), "order_t.id=caiwu_t.order_id") +// ->where('caiwu_t.insurer_type=1') + ->orderBy('order_t.print_date DESC'); + + + if( $insurer_type > 0) { + $query = $query->andWhere('caiwu_t.insurer_type='.$insurer_type); + } + + + if( $company_id > 0) { + $query = $query->andWhere('order_t.company_id='.$company_id); + } + + if($car_no_type == 1){ + $query = $query->andWhere('caiwu_t.car_no like "' . '京' . '%"'); + }elseif($car_no_type == 2){ + $query = $query->andWhere('caiwu_t.car_no not like "' . '京' . '%"'); + } + + if($begin_totalclear != ''){ + $query = $query->andWhere('caiwu_t.total_clear >=' . $begin_totalclear); + } + if($end_totalclear != ''){ + $query = $query->andWhere('caiwu_t.total_clear <=' . $end_totalclear); + } + + + if ($begin_date != "") { + $query = $query->andWhere('order_t.print_date>="' . $begin_date . '"'); + } + if ($end_date != "") { + $query = $query->andWhere('order_t.print_date<="' . $end_date . '"'); + } + + $total1_clear_all = $query->sum('total_clear'); + $total_money_all = $query->sum('budian_money'); + + $total = $query->count(); + + $pagination = new Pagination(['totalCount' => $total,'pageSize'=>20]); + $pagination->setPage($page-1); + + $query = $query->offset($pagination->offset)->limit($pagination->limit); + $items = $query->all(); + + $page_info = MyLib::getPageInfo($pagination); + + $company_items = InsurerCompanyT::find()->all(); + + +// $insurer_ticheng_items = InsurerTichengT::find()->orderBy('id')->all(); +// $gift_ticheng_items = InsurerTichengGiftT::find()->orderBy('id')->all(); + + return $this->render('budian-list', [ + 'total1_clear_all'=>$total1_clear_all, + 'total_money_all'=>$total_money_all, + 'items' => $items, + 'page' => $page, + 'page_info' => $page_info, + 'begin_date' => $begin_date, + 'end_date' => $end_date, + 'company_items' => $company_items, + 'begin_totalclear' => $begin_totalclear, + 'end_totalclear' => $end_totalclear, + 'car_no_type' => $car_no_type, + 'company_id' => $company_id, + 'budian_rate' => $budian_rate, + 'insurer_type' => $insurer_type +// 'insurer_ticheng_items' => $insurer_ticheng_items, +// 'gift_ticheng_items' => $gift_ticheng_items + ]); + } + + public function actionBudianSave() + + { + Yii::$app->response->format = Response::FORMAT_JSON; + $request = Yii::$app->request; + $result = array(); + $result['success'] = false; + $result['msg'] = '操作失败'; + + + $begin_date = $request->get('begin_date'); + $end_date = $request->get('end_date'); + $user_names = $request->get('user_names'); + $begin_totalclear = $request->get('begin_totalclear'); + $end_totalclear = $request->get('end_totalclear'); + $car_no_type = $request->get('car_no_type'); + $company_id = $request->get('company_id'); + $insurer_type = $request->get('insurer_type'); + + + + + $budian_rate = $request->get('budian_rate'); + + + $query = CaiwuT::find() + ->leftJoin(OrderT::tableName(), "order_t.id=caiwu_t.order_id") +// ->where('caiwu_t.insurer_type=1') + ->orderBy('order_t.print_date DESC'); + + if( $insurer_type > 0) { + $query = $query->andWhere('caiwu_t.insurer_type='.$insurer_type); + } + + if( $company_id > 0) { + $query = $query->andWhere('order_t.company_id='.$company_id); + } + + if($car_no_type == 1){ + $query = $query->andWhere('caiwu_t.car_no like "' . '京' . '%"'); + }elseif($car_no_type == 2){ + $query = $query->andWhere('caiwu_t.car_no not like "' . '京' . '%"'); + } + + if($begin_totalclear != ''){ + $query = $query->andWhere('caiwu_t.total_clear >=' . $begin_totalclear); + } + if($end_totalclear != ''){ + $query = $query->andWhere('caiwu_t.total_clear <=' . $end_totalclear); + } + + + if ($begin_date != "") { + $query = $query->andWhere('order_t.print_date>="' . $begin_date . '"'); + } + if ($end_date != "") { + $query = $query->andWhere('order_t.print_date<="' . $end_date . '"'); + } + + + $items = $query->all(); + + + + $tran = OrderCaiwuT::getDb()->beginTransaction(); + try { + foreach ($items as $item){ +// $order_caiwu_info = $item->orderCaiwu; +// $order_info = $item->order; + + if($budian_rate != '') { + $item->budian_rate = $budian_rate; + $item->budian_money = $item->total_clear * $budian_rate / 100; + } + $item->save(); + + } + + $result['success'] = true; + $result['msg'] = '保存成功'; + $tran->commit(); + + } catch(\Exception $e) { + $tran->rollBack(); + throw $e; + } + + return $result; + } + + public function actionTichengJisuan() + { + $request = Yii::$app->request; + $begin_date = $request->get('begin_date',date('Y-m-d')); + $end_date = $request->get('end_date',date('Y-m-d')); + $begin_totalclear = $request->get('begin_totalclear'); + $end_totalclear = $request->get('end_totalclear'); + $car_no_type = $request->get('car_no_type'); + $company_id = $request->get('company_id'); + $user_names = $request->get('user_names'); + $car_no = $request->get('car_no'); + $insurer_type = $request->get('insurer_type',1); + + $dz_group = $request->get('dz_group'); + $dz_rate = $request->get('dz_rate'); + $dz_names = $request->get('dz_names'); + + $base_rate = $request->get('base_rate'); + $xiaoyi_rate1 = $request->get('xiaoyi_rate1'); + $xiaoyi_rate2 = $request->get('xiaoyi_rate2'); + $online_rate = $request->get('online_rate'); + $yeji_rate = $request->get('yeji_rate'); + $gift1 = $request->get('gift1'); + $gift2 = $request->get('gift2'); + $gift3 = $request->get('gift3'); + $gift4 = $request->get('gift4'); + $gift5 = $request->get('gift5'); + $ticket1 = $request->get('ticket1'); + $ticket2 = $request->get('ticket2'); + $ticket3 = $request->get('ticket3'); + $zhengben_ticheng = $request->get('zhengben_ticheng'); + $hebao_ticheng = $request->get('hebao_ticheng'); + $songdan_ticheng = $request->get('songdan_ticheng'); + $genzong_ticheng = $request->get('genzong_ticheng'); + $first_xinbao_rate = $request->get('first_xinbao_rate'); + $xianzhong_rate = $request->get('xianzhong_rate'); + + + $is_fan= $request->get('is_fan',0); + + + + $page = $request->get('page',1); + if($page < 1) $page = 1; + + + $group_id = $request->get('group_id'); + $group_items = GroupT::getTree((int)$this->my->group_id); + if($this->my->id == 1 || $this->my->username=='6002' || $this->my->username=='7053') + $group_items = GroupT::getTree(); + $group_ids[] = $group_id; + + if($group_id > 0) { + $items = GroupT::getTree($group_id); + + foreach($items as $group_info) { + $group_ids[] = $group_info->id; + } + } + + + $query = CaiwuT::find() + ->leftJoin(OrderT::tableName(), "order_t.id=caiwu_t.order_id") + ->where('order_t.status_id>1') + ->orderBy('order_t.print_date DESC'); + + if($user_names != '' && $user_names != 'null'){ + $user_arr = explode(',',$user_names); + $user_ids = []; + foreach ($user_arr as $user){ + $username = substr($user,0,strpos($user, '(')); + $user = UserT::find()->where('is_delete=0')->andWhere('username="'.$username.'"')->one(); + if($user) + $user_ids[] = $user->id; + } + + if($is_fan == 1){ + $query = $query->andWhere(['not in','caiwu_t.user_id',$user_ids]); + }else{ + $query = $query->andWhere(['in','caiwu_t.user_id',$user_ids]); + } + + } + + if( $company_id > 0) { + $query = $query->andWhere('order_t.company_id='.$company_id); + } + if( $car_no != '') { + $query = $query->andWhere('order_t.car_no="'.$car_no.'"'); + } + + if($car_no_type == 1){ + $query = $query->andWhere('caiwu_t.car_no like "' . '京' . '%"'); + }elseif($car_no_type == 2){ + $query = $query->andWhere('caiwu_t.car_no not like "' . '京' . '%"'); + } + + if($begin_totalclear != ''){ + $query = $query->andWhere('caiwu_t.total_clear >=' . $begin_totalclear); + } + if($end_totalclear != ''){ + $query = $query->andWhere('caiwu_t.total_clear <=' . $end_totalclear); + } + + + if ($begin_date != "") { + $query = $query->andWhere('order_t.print_date>="' . $begin_date . '"'); + } + if ($end_date != "") { + $query = $query->andWhere('order_t.print_date<="' . $end_date . '"'); + } + + + $user_items = $this->my->getChildren(''); + if($this->my->username == '6002' || $this->my->username == '7053') + $user_items = $this->my->getChildren('',1); + $user_items[] = $this->my; + + $row = array(); + foreach($user_items as $user_info) { +// if ($user_info->is_leave == 1) continue; +// var_dump($user_info); + if ($group_id > 0) { + if (!in_array($user_info->group_id, $group_ids)) { + continue; + } + } + + $row[] = $user_info->id; + + } + +// var_dump($row); + //加上级别筛选 + if($group_id > 0){ + if($is_fan == 1){ + $query = $query->andWhere(['not in','caiwu_t.user_id',$row]); + }else{ + $query = $query->andWhere(['in','caiwu_t.user_id',$row]); + } + + } + + + + $query1 = clone $query; + if($insurer_type ==1){ + $query = $query->andWhere('caiwu_t.insurer_type=1'); + } + + + $items = $query->all(); + +//echo $query->createCommand()->rawSql; + + $total2_clear_all = $query1->andWhere('caiwu_t.insurer_type=2')->sum('total_clear'); + + $yewu_ticheng_all = 0; + $total1_clear_all = 0; + $yeji_ticheng_all = 0; + $ticheng_money_all = 0; + $lipin_all = 0; + $liquan_all = 0; + $yuangong_money_all = 0; + foreach($items as $index => $item) { + + $order_caiwu_info = $item->orderCaiwu; + $order_info = $item->order; + + $total1_clear_all += $item->total_clear; + $yewu_ticheng_all += $order_caiwu_info ? $order_caiwu_info->yewu_ticheng : 0; + $yeji_ticheng_all += $order_caiwu_info ? $order_caiwu_info->yeji_ticheng : 0; + $ticheng_money_all += $order_info ? $order_info->ticheng_money : 0; + $lipin_all += $order_info ? $order_info->getGiftPrice(1,1) : 0; + $liquan_all += $order_info ? $order_info->getGiftPrice(1,2) : 0; + $yuangong_money = 0; + if($order_info){ + $yuangong_money = $order_info->yuangong_money>0?$order_info->yuangong_money:0; + } + $yuangong_money_all += $yuangong_money; + + } +// $sum_r_total = $query->sum('r_total'); +// //商业净保费综合 +// $sum_total_clear = $query->sum('total_clear'); //是错误的 +// +// //商业总保费 +// $sum_total = $query->sum('total'); +// +// $sum_total_dis = $query->sum('total_dis'); + + + $total = $query->count(); + + $pagination = new Pagination(['totalCount' => $total,'pageSize'=>20]); + $pagination->setPage($page-1); + + $query = $query->offset($pagination->offset)->limit($pagination->limit); + $items = $query->all(); + + $page_info = MyLib::getPageInfo($pagination); + + + + + $company_items = InsurerCompanyT::find()->all(); + + $user_items = UserT::find() + ->where('is_delete=0') + ->orderBy('username ASC') + ->all(); +// +// $insurer_ticheng_items = InsurerTichengT::find()->orderBy('id')->all(); +// $gift_ticheng_items = InsurerTichengGiftT::find()->orderBy('id')->all(); + $gift_items = GiftT::find()->where('type_id=1')->orderBy('id')->all(); + $ticket_items = GiftT::find()->where('type_id=2')->orderBy('id')->all(); + + return $this->render('ticheng-jisuan', [ + 'items' => $items, + 'page_info' => $page_info, + 'begin_date' => $begin_date, + 'end_date' => $end_date, +// 'sum_r_total' => $sum_r_total, +// 'sum_total_clear' => $sum_total_clear, +// 'sum_total' => $sum_total, +// 'sum_total_dis' => $sum_total_dis, + 'company_items' => $company_items, + 'begin_totalclear' => $begin_totalclear, + 'end_totalclear' => $end_totalclear, + 'car_no_type' => $car_no_type, + 'company_id' => $company_id, + 'car_no' =>$car_no, + 'is_fan' =>$is_fan, + 'insurer_type' =>$insurer_type, + 'user_names' =>$user_names, + 'dz_group'=>$dz_group, + 'dz_rate' =>$dz_rate, + 'dz_names' =>$dz_names, + 'group_id'=>$group_id, + 'group_items'=>$group_items, + + 'base_rate' => $base_rate, + 'xiaoyi_rate1' => $xiaoyi_rate1, + 'xiaoyi_rate2' => $xiaoyi_rate2, + 'online_rate' => $online_rate, + 'yeji_rate' => $yeji_rate, + 'gift1' => $gift1, + 'gift2' => $gift2, + 'gift3' => $gift3, + 'gift4' => $gift4, + 'gift5' => $gift5, + 'ticket1' => $ticket1, + 'ticket2' => $ticket2, + 'ticket3' => $ticket3, + 'zhengben_ticheng' => $zhengben_ticheng, + 'hebao_ticheng' => $hebao_ticheng, + 'songdan_ticheng' => $songdan_ticheng, + 'genzong_ticheng' => $genzong_ticheng, + 'first_xinbao_rate' => $first_xinbao_rate, + 'xianzhong_rate' => $xianzhong_rate, + 'user_items' => $user_items, + 'gift_items'=>$gift_items, + 'ticket_items'=>$ticket_items, + 'ticheng_money_all'=>$ticheng_money_all, + 'total1_clear_all'=>$total1_clear_all, + 'total2_clear_all'=>$total2_clear_all, + 'yewu_ticheng_all'=>$yewu_ticheng_all, + 'yeji_ticheng_all'=>$yeji_ticheng_all, + 'ticheng_money_all'=>$ticheng_money_all, + 'lipin_all'=>$lipin_all, + 'liquan_all'=>$liquan_all, + 'yuangong_money_all'=>$yuangong_money_all, + +// 'insurer_ticheng_items' => $insurer_ticheng_items, +// 'gift_ticheng_items' => $gift_ticheng_items + ]); + } + /** + * 出纳工资列表 + * @return string + */ + public function actionChunaGongziList() + { + $request = Yii::$app->request; + $username = $request->get('username'); + $name = $request->get('name'); + $pay_date = $request->get('pay_date', date('Y-m')); + $group_id = $request->get('group_id', 0); + $page = $request->get('page', 1); + + $status_id = $request->get('status_id',0); + + $user_id = $this->my->id; +// var_dump($user_id); + $query = UserT::find() + ->leftJoin('pay_t','pay_t.user_id=user_t.id') + ->where('group_id>0 and is_delete=0'); + if ($username != '') { + $query = $query->andWhere('username like "' . $username . '"'); + } + if ($name != '') { + $query = $query->andWhere('name like "' . $name . '"'); + } + if ($group_id > 0) { + $query = $query->andWhere('group_id=' . $group_id); + } + if($status_id > 0) { + $query = $query->andWhere('pay_t.status_id='.$status_id); + } + $query = $query->orderBy('username ASC,id ASC'); + $total = $query->count(); + $total_real_pay = 0; + foreach ($query->each() as $item) { + $pay_info = $item->getPay($pay_date); + if ($pay_info) + $total_real_pay += $pay_info->real_pay; + } + + $pagination = new Pagination(['totalCount' => $total, 'pageSize' => 20]); + $pagination->setPage($page - 1); + + $query = $query->offset($pagination->offset)->limit($pagination->limit); + $items = $query->all(); + + $page_info = MyLib::getPageInfo($pagination); + + $group_items = GroupT::getTree(); + + $return_count = UserT::find() + ->leftJoin('pay_t','pay_t.user_id=user_t.id') + ->where('user_t.group_id>0 and is_delete=0') + ->andWhere('pay_t.pay_date="'.$pay_date.'"') + ->andWhere('pay_t.status_id=8') + ->count(); + + return $this->render('chuna-gongzi-list', [ + 'group_items' => $group_items, + 'items' => $items, + 'page_info' => $page_info, + 'page' => $page, + 'username' => $username, + 'name' => $name, + 'pay_date' => $pay_date, + 'group_id' => $group_id, + 'total_real_pay' => $total_real_pay, + 'status_id'=>$status_id, + 'return_count' => $return_count + ]); + } + /** + * 出纳工资-详情 + * @return string + */ + public function actionChunaGongziInfo() + { + $request = Yii::$app->request; + $user_id = $request->get('id', 0); + $pay_date = $request->get('pay_date', date('Y-m')); + $back_params = $request->get('back_params'); + + $user_info = UserT::findOne(['id' => $user_id]); + $group_info = $user_info->group; + +// $work_day = WorkDayT::findOne(['date' => $pay_date]); + +// if (!$work_day) { +// echo $pay_date . '还没有开始统计'; +// echo "[返回]"; +// die; +// } + + $pay_info = PayT::findOne(['user_id' => $user_id, 'pay_date' => $pay_date]); + if (!$pay_info) { + $pay_info = new PayT(); + $pay_info->user_id = $user_id; + $pay_info->pay_date = $pay_date; + if ($group_info) { + $pay_info->should_pay = $group_info->base_pay + $group_info->job_pay + $group_info->station_pay + $user_info->ext_pay; + } else { + $pay_info->should_pay = $user_info->ext_pay; + } + if (!$pay_info->save()) { + var_dump($pay_info->errors); + exit; + } + $pay_info = PayT::findOne(['user_id' => $user_id, 'pay_date' => $pay_date]); + } + //内勤 + //核保 + $my_type5_query = PayOrderUserT::find() + ->where('pay_date="' . $pay_date . '" and is_own=0 and type=5 and user_id=' . $user_id) + ->orderBy('created_at asc'); +// echo $my_type5_query->createCommand()->rawSql; + //正本 + $my_type6_query = PayOrderUserT::find() + ->where('pay_date="' . $pay_date . '" and is_own=0 and type=6 and user_id=' . $user_id) + ->orderBy('created_at asc'); + + //新保 + $my_type1_query = PayOrderUserT::find() + ->where('pay_date="' . $pay_date . '" and type=1 and user_id=' . $user_id .' and is_own =1') + ->orderBy('created_at asc'); + //原新保 + $my_type0_query = PayOrderUserT::find() + ->where('pay_date="' . $pay_date . '" and type=1 and user_id=' . $user_id.' and is_own =0') + ->orderBy('created_at asc'); + //非车险 + $my_type1_query_non = PayOrderUserT::find() + ->where('pay_date="' . $pay_date . '" and is_own=0 and type=7 and user_id=' . $user_id) + ->orderBy('created_at asc'); + //非车险核保 + $my_type1_query_hebao = PayOrderUserT::find() + ->where('pay_date="' . $pay_date . '" and is_own=0 and type=8 and user_id=' . $user_id) + ->orderBy('created_at asc'); + + //外区 + $my_out_query = PayOrderUserT::find() + ->where('pay_date="' . $pay_date . '" and type=1 and user_id=' . $user_id .' and (is_own=4 or is_own=5)') + ->orderBy('created_at asc'); + + + +// echo $my_type1_query->createCommand()->rawSql; + //续保 + $my_type3_query = PayOrderUserT::find() + ->where('pay_date="' . $pay_date . '" and is_own=1 and type=3 and user_id=' . $user_id) + ->orderBy('created_at asc'); +// echo $my_type3_query->createCommand()->rawSql; + //不是核保 正本 送单 + $type_query = PayOrderUserT::find() + ->where('pay_date="' . $pay_date . '" and type<>4 and type<>5 and type<>6 and is_own=0 and user_id=' . $user_id) + ->andWhere('should_pay>0') + ->orderBy('created_at asc'); +// echo $type_query->createCommand()->rawSql; + //送单 + $type3_query = PayOrderUserT::find() + ->where('pay_date="' . $pay_date . '" and type=4 and user_id=' . $user_id) + ->orderBy('created_at asc'); + $pay_order_users = OrderT::find() + ->where('print_date like "' . $pay_date . '-%"') + ->andWhere('user_id=' . $this->my->id) + ->orderBy('updated_at ASC'); + + + $pay_chexian = PayOrderUserT::find() + ->where('pay_date="' . $pay_date . '" and type<>7 and type<>8 and type<>10 and user_id=' . $user_id) + ->sum('real_pay'); + + $pay_nochexian = PayOrderUserT::find() + ->where('pay_date="' . $pay_date . '" and type=7 and user_id=' . $user_id) + ->orWhere('pay_date="' . $pay_date . '" and type=8 and user_id=' . $user_id) + ->sum('real_pay'); + + $pay_dz = PayOrderUserT::find() + ->where('pay_date="' . $pay_date . '" and type=10 and user_id=' . $user_id) + ->sum('real_pay'); + + return $this->render('chuna-gongzi-info', [ + 'pay_date' => $pay_date, + 'user_info' => $user_info, + 'group_info' => $group_info, + 'pay_info' => $pay_info, + 'my_type0_query' => $my_type0_query, + 'my_type1_query' => $my_type1_query, + 'my_type3_query' => $my_type3_query, + 'my_type5_query' => $my_type5_query, + 'my_type6_query' => $my_type6_query, + 'my_out_query' => $my_out_query, + 'my_type1_query_non' => $my_type1_query_non, + 'my_type1_query_hebao' => $my_type1_query_hebao, + 'type_query' => $type_query, + 'type3_query' => $type3_query, + 'back_params' => $back_params, + 'pay_order_users' => $pay_order_users, + 'pay_chexian' => $pay_chexian, + 'pay_nochexian' => $pay_nochexian, + 'pay_dz' => $pay_dz + ]); + } + /** + * 财务工资列表 + * @return string + */ + public function actionGongziAllList() + { + $request = Yii::$app->request; + $username = $request->get('username'); + $name = $request->get('name'); + $pay_date = $request->get('pay_date', date('Y-m')); + $group_id = $request->get('group_id', 0); + $page = $request->get('page', 1); + + $status_id = $request->get('status_id',0); + + $user_id = $this->my->id; +// var_dump($user_id); + $query = UserT::find() + ->leftJoin('pay_t','pay_t.user_id=user_t.id') + ->where('group_id>0 and is_delete=0'); + if ($username != '') { + $query = $query->andWhere('username like "' . $username . '"'); + } + if ($name != '') { + $query = $query->andWhere('name like "' . $name . '"'); + } + if ($group_id > 0) { + $query = $query->andWhere('group_id=' . $group_id); + } + + if($status_id > 0) { + $query = $query->andWhere(['IN','pay_t.status_id',[7,8,9]]); + } + $query = $query->orderBy('username ASC,id ASC'); + $total = $query->count(); + $total_real_pay = 0; + foreach ($query->each() as $item) { + $pay_info = $item->getPay($pay_date); + if ($pay_info) + $total_real_pay += $pay_info->real_pay; + } + + $pagination = new Pagination(['totalCount' => $total, 'pageSize' => 20]); + $pagination->setPage($page - 1); + + $query = $query->offset($pagination->offset)->limit($pagination->limit); + $items = $query->all(); + + $page_info = MyLib::getPageInfo($pagination); + + $group_items = GroupT::getTree(); + + return $this->render('gongzi-all-list', [ + 'group_items' => $group_items, + 'items' => $items, + 'page_info' => $page_info, + 'page' => $page, + 'username' => $username, + 'name' => $name, + 'pay_date' => $pay_date, + 'group_id' => $group_id, + 'total_real_pay' => $total_real_pay, + 'status_id' => $status_id + ]); + } + /** + * 出纳工资-详情 + * @return string + */ + public function actionGongziAllInfo() + { + $request = Yii::$app->request; + $user_id = $request->get('id', 0); + $pay_date = $request->get('pay_date', date('Y-m')); + $back_params = $request->get('back_params'); + + $user_info = UserT::findOne(['id' => $user_id]); + $group_info = $user_info->group; + + $work_day = WorkDayT::findOne(['date' => $pay_date]); + + if (!$work_day) { + echo $pay_date . '还没有开始统计'; + echo "[返回]"; + die; + } + + $pay_info = PayT::findOne(['user_id' => $user_id, 'pay_date' => $pay_date]); + if (!$pay_info) { + $pay_info = new PayT(); + $pay_info->user_id = $user_id; + $pay_info->pay_date = $pay_date; + if ($group_info) { + $pay_info->should_pay = $group_info->base_pay + $group_info->job_pay + $group_info->station_pay + $user_info->ext_pay; + } else { + $pay_info->should_pay = $user_info->ext_pay; + } + if (!$pay_info->save()) { + var_dump($pay_info->errors); + exit; + } + $pay_info = PayT::findOne(['user_id' => $user_id, 'pay_date' => $pay_date]); + } + //内勤 + //核保 + $my_type5_query = PayOrderUserT::find() + ->where('pay_date="' . $pay_date . '" and is_own=0 and type=5 and user_id=' . $user_id) + ->orderBy('created_at asc'); +// echo $my_type5_query->createCommand()->rawSql; + //正本 + $my_type6_query = PayOrderUserT::find() + ->where('pay_date="' . $pay_date . '" and is_own=0 and type=6 and user_id=' . $user_id) + ->orderBy('created_at asc'); + + //新保 + $my_type1_query = PayOrderUserT::find() + ->where('pay_date="' . $pay_date . '" and type=1 and user_id=' . $user_id) + ->orderBy('created_at asc'); + //非车险 + $my_type1_query_non = PayOrderUserT::find() + ->where('pay_date="' . $pay_date . '" and is_own=0 and type=7 and user_id=' . $user_id) + ->orderBy('created_at asc'); + //非车险核保 + $my_type1_query_hebao = PayOrderUserT::find() + ->where('pay_date="' . $pay_date . '" and is_own=0 and type=8 and user_id=' . $user_id) + ->orderBy('created_at asc'); + + + + + +// echo $my_type1_query->createCommand()->rawSql; + //续保 + $my_type3_query = PayOrderUserT::find() + ->where('pay_date="' . $pay_date . '" and is_own=1 and type=3 and user_id=' . $user_id) + ->orderBy('created_at asc'); +// echo $my_type3_query->createCommand()->rawSql; + //不是核保 正本 送单 + $type_query = PayOrderUserT::find() + ->where('pay_date="' . $pay_date . '" and type<>4 and type<>5 and type<>6 and is_own=0 and user_id=' . $user_id) + ->andWhere('should_pay>0') + ->orderBy('created_at asc'); +// echo $type_query->createCommand()->rawSql; + //送单 + $type3_query = PayOrderUserT::find() + ->where('pay_date="' . $pay_date . '" and type=4 and user_id=' . $user_id) + ->orderBy('created_at asc'); + $pay_order_users = OrderT::find() + ->where('print_date like "' . $pay_date . '-%"') + ->andWhere('user_id=' . $this->my->id) + ->orderBy('updated_at ASC'); + + + $pay_chexian = PayOrderUserT::find() + ->where('pay_date="' . $pay_date . '" and type<>7 and type<>8 and type<>10 and user_id=' . $user_id) + ->sum('real_pay'); + + $pay_nochexian = PayOrderUserT::find() + ->where('pay_date="' . $pay_date . '" and type=7 and type=8 and user_id=' . $user_id) + ->sum('real_pay'); + + $pay_dz = PayOrderUserT::find() + ->where('pay_date="' . $pay_date . '" and type=10 and user_id=' . $user_id) + ->sum('real_pay'); + + return $this->render('gongzi-all-info', [ + 'pay_date' => $pay_date, + 'user_info' => $user_info, + 'group_info' => $group_info, + 'pay_info' => $pay_info, + 'my_type1_query' => $my_type1_query, + 'my_type3_query' => $my_type3_query, + 'my_type5_query' => $my_type5_query, + 'my_type6_query' => $my_type6_query, + 'my_type1_query_non' => $my_type1_query_non, + 'my_type1_query_hebao' => $my_type1_query_hebao, + 'type_query' => $type_query, + 'type3_query' => $type3_query, + 'back_params' => $back_params, + 'pay_order_users' => $pay_order_users, + 'pay_chexian' => $pay_chexian, + 'pay_nochexian' => $pay_nochexian, + 'pay_dz' => $pay_dz + ]); + } + + public function actionReceiptLirun() + { + set_time_limit(0); + ini_set('memory_limit', '3072M'); + $request = Yii::$app->request; + $page = $request->get('page', 1); + $insurer_type = $request->get('insurer_type', 0); + $begin_date = $request->get('begin_date',date('Y-m-d')); + $end_date = $request->get('end_date',date('Y-m-d')); + $r_begin_date = $request->get('r_begin_date'); + $r_end_date = $request->get('r_end_date'); + $car_no = trim($request->get('car_no')); + $insurer_no = trim($request->get('insurer_no')); + $status = $request->get('status',0); + $sort_key = $request->get('sort_key'); + $sort_value = $request->get('sort_value'); + $company_id = $request->get('company_id'); + $username = $request->get('username'); + $hebaoname = $request->get('hebaoname'); + $zbname = $request->get('zbname'); + //级别 + $group_id = $request->get('group_id'); + $group_items = GroupT::getTree((int)$this->my->group_id); + if($this->my->id == 1 || $this->my->username=='6002' || $this->my->username=='7053') + $group_items = GroupT::getTree(); + $group_ids[] = $group_id; + + if($group_id > 0) { + $items = GroupT::getTree($group_id); + + foreach($items as $group_info) { + $group_ids[] = $group_info->id; + } + } +// var_dump($group_ids); + + if ($page < 1) $page = 1; + + $query = CaiwuT::find() + ->leftJoin(OrderT::tableName(), "order_t.id=caiwu_t.order_id") + ->where('order_t.status_id>1'); +// ->orderBy('order_t.print_date DESC'); + + switch ($sort_key) { + case 'total': + $sort = 'caiwu_t.total '; + break; + case 'total_clear': + $sort = 'caiwu_t.total_clear '; + break; + case 'total_rate': + $sort = 'caiwu_t.total_rate '; + break; + case 'print_date'://默认按照print_date排序 + default: + $sort = 'order_t.print_date '; + break; + } + + switch ($sort_value) { + case 'ASC': + $sort .= 'ASC'; + break; + case 'DESC': + default: + $sort .= 'DESC'; + break; + } + + $query = $query->orderBy($sort); + + if( $insurer_type != 0) { + $query = $query->andWhere('caiwu_t.insurer_type='.$insurer_type); + } + + if( $company_id > 0) { + $query = $query->andWhere('order_t.company_id='.$company_id); + } + if ($username != "") { +// $userdata = UserT::findOne(['username'=>$username]); + $userdata = UserT::find()->where('username="'.$username.'"')->andwhere('is_leave=0')->one(); + if($userdata){ + $query = $query->andWhere('caiwu_t.user_id = ' . $userdata->id . ''); + } + } + + if ($hebaoname != "") { +// $userdata = UserT::findOne(['username'=>$username]); + $userdata = UserT::find()->where('username="'.$hebaoname.'"')->andwhere('is_leave=0')->one(); + if($userdata){ + $query = $query->andWhere('order_t.op1_id = ' . $userdata->id . ''); + } + } + + if ($zbname != "") { +// $userdata = UserT::findOne(['username'=>$username]); + $userdata = UserT::find()->where('username="'.$zbname.'"')->andwhere('is_leave=0')->one(); + if($userdata){ + $query = $query->andWhere('order_t.op2_id = ' . $userdata->id . ''); + } + } + + if ($car_no != "") { + $query = $query->andWhere('caiwu_t.car_no like "%' . $car_no . '%"'); + } + + if ($insurer_no != "") { + $query = $query->andWhere('caiwu_t.insurer_no like "' . $insurer_no . '%"'); + } + if ($status > 0) { + if ($status == 1) { + $query = $query->andWhere('r_date="" or r_date is null'); + } + if ($status == 2) { + $query = $query->andWhere('r_date<>"" and total_dis=0'); + } + if($status == 3) { + $query = $query->andWhere('r_date<>"" and total_dis<>0'); + } + } + if ($begin_date != "") { + $query = $query->andWhere('order_t.print_date>="' . $begin_date . '"'); + } + if ($end_date != "") { + $query = $query->andWhere('order_t.print_date<="' . $end_date . '"'); + } + if ($r_begin_date != "") { + $query = $query->andWhere('caiwu_t.r_date>="' . $r_begin_date . '"'); + } + if ($r_end_date != "") { + $query = $query->andWhere('caiwu_t.r_date<="' . $r_end_date . '"'); + } + //找出$group_id 有多少在职的user_ids + // 现在的搜索条件 + $userSql = ''; +// if($username != '') { +// $userSql = ' username like "'.$username.'" and '; +// } + //$userSql .= 'is_locked=0 and is_login=1'; + + $user_items = $this->my->getChildren($userSql); + if($this->my->username == '6002' || $this->my->username == '7053') + $user_items = $this->my->getChildren($userSql,1); + $user_items[] = $this->my; + + $row = array(); + foreach($user_items as $user_info) { +// if ($user_info->is_leave == 1) continue; +// var_dump($user_info); + if ($group_id > 0) { + if (!in_array($user_info->group_id, $group_ids)) { + continue; + } + } + + $row[] = $user_info->id; + + } + +// var_dump($row); + //加上级别筛选 + if($group_id > 0){ +// $query = $query->andWhere('order_t.company_id='.$company_id); + $query = $query->andWhere(['in','caiwu_t.user_id',$row]); +// $query = $query->andWhere('caiwu_t.user_id ="' . $group_id . '"'); + } + + $query1 = clone $query; + + + $item1s = $query1->all(); + +// echo $query->createCommand()->rawSql; + $total = $query->count(); + + $sum_r_total = $query->sum('r_total'); + //商业净保费综合 + $sum_total_clear = $query->sum('total_clear'); //是错误的 + + //商业总保费 + $sum_total = $query->sum('total'); + + $sum_total_dis = $query->sum('total_dis'); + + $pagination = new Pagination(['totalCount' => $total, 'pageSize' => 20]); + $pagination->setPage($page - 1); + + $query = $query->offset($pagination->offset)->limit($pagination->limit); + $items = $query->all(); + + $lirun_all = 0; + $gongzi_all = 0; + $liwu_all = 0; + $total1_dis_all = 0; + $bu_dian_all = 0; + $r_bu_dian_all = 0; + foreach($item1s as $item){ + + + $order_info = $item->order; + + $total_clear_real = $item->total_clear * $item->total_rate/100; + $total1_dis = $item->insurer_type == 1?($order_info->total1_dis + $order_info->yuangong_money):0; + + $gongzi = $item->insurer_type == 1?$item->getPayOrderUser()->sum('real_pay'):0; + + $ticket = $item->insurer_type == 1?$order_info->getGiftPrice(1,1):0; + $gift = $item->insurer_type == 1?$order_info->getGiftPrice(1,2):0; + + $r_bu_dian = $item->insurer_type == 1?($item->b1_total+$item->b2_total+$item->b3_total):0; + $bu_dian = $item->budian_rate?$item->budian_rate * $item->total_clear / 100:0; + $liwu = $ticket + $gift; + + $lirun_all += $total_clear_real + $bu_dian - $total1_dis - $gongzi - $liwu; + + $gongzi_all += $gongzi; + $liwu_all += $liwu; + $total1_dis_all += $total1_dis; + $bu_dian_all += $bu_dian; + $r_bu_dian_all += $r_bu_dian; + + } + +// var_dump($items); + + $page_info = MyLib::getPageInfo($pagination); + + $company_items = InsurerCompanyT::find()->all(); + + return $this->render('receipt-lirun', [ + 'items' => $items, + 'username' => $username, + 'hebaoname' => $hebaoname, + 'zbname' => $zbname, + 'page' => $page, + 'car_no' => $car_no, + 'insurer_no' => $insurer_no, + 'status' => $status, + 'begin_date' => $begin_date, + 'end_date' => $end_date, + 'r_begin_date' => $r_begin_date, + 'r_end_date' => $r_end_date, + 'page_info' => $page_info, + 'sort_key' => $sort_key, + 'sort_value' => $sort_value, + 'sum_r_total' => $sum_r_total, + 'sum_total_clear' => $sum_total_clear, + 'sum_total' => $sum_total, + 'sum_total_dis' => $sum_total_dis, + 'company_items' => $company_items, + 'group_id' => $group_id, + 'group_items' => $group_items, + 'company_id' => $company_id, + 'insurer_type' => $insurer_type, + 'lirun_all'=>$lirun_all, + 'gongzi_all'=>$gongzi_all, + 'liwu_all'=>$liwu_all, + 'total1_dis_all'=>$total1_dis_all, + 'bu_dian_all'=>$bu_dian_all, + 'r_bu_dian_all'=>$r_bu_dian_all + ]); + } } diff --git a/frontend/controllers/MarketingStrategyController.php b/frontend/controllers/MarketingStrategyController.php index d3b6d8c..308b60a 100644 --- a/frontend/controllers/MarketingStrategyController.php +++ b/frontend/controllers/MarketingStrategyController.php @@ -4,6 +4,12 @@ namespace frontend\controllers; +use common\models\GiftT; +use common\models\UserT; +use common\models\ZhongjiFanxianT; +use common\models\ZhongjiGiftT; +use common\models\ZhongjiTiaojian; +use common\models\ZhongjiUserT; use common\models\ZhongjiYingxiao; use yii\web\Response; use Yii; @@ -68,16 +74,14 @@ class MarketingStrategyController extends UserBaseController $op = $request->post('op', 'add'); $name = $request->post('name'); $begin_date = $request->post('begin_date'); - $begin_time = $request->post('begin_time'); $end_date = $request->post('end_date'); - $end_time = $request->post('end_time'); $remark = $request->post('remark'); if($op == 'add') { $item = new ZhongjiYingxiao(); $item->celuo_name = $name; - $item->begin_date = $begin_date.' '.$begin_time.':00'; - $item->end_date = $end_date.' '.$end_time.':00'; + $item->begin_date = $begin_date; + $item->end_date = $end_date; $item->is_delete = 0; $item->remark = $remark; $item->save(); @@ -90,8 +94,8 @@ class MarketingStrategyController extends UserBaseController $item = ZhongjiYingxiao::findOne(['id'=>$id]); if($item) { $item->celuo_name = $name; - $item->begin_date = $begin_date.' '.$begin_time.':00'; - $item->end_date = $end_date.' '.$end_time.':00'; + $item->begin_date = $begin_date; + $item->end_date = $end_date; $item->remark = $remark; $item->save(); @@ -102,6 +106,352 @@ class MarketingStrategyController extends UserBaseController } } return $result; + } + + public function actionUsers() { + $request = Yii::$app->request; + $id = $request->get('id'); + + return $this->render('users',['id'=>$id]); + } + + public function actionSearchUser() { + Yii::$app->response->format = Response::FORMAT_JSON; + $request = Yii::$app->request; + $result['success'] = false; + $result['msg'] = '没有记录'; + + $key = $request->get('key'); + + $data = []; + if($key != '') { + $items = UserT::find()->where('username like "'.$key.'%"')->all(); + foreach($items as $item) { + $row = []; + $row['id'] = $item->id; + $row['name'] = $item->getShowName(); + $data[] = $row; + } + } + $result['success'] = true; + $result['users'] = $data; + $result['msg'] = '共有'.count($items).'条记录'; + return $result; + } + + public function actionUsersAdd() { + Yii::$app->response->format = Response::FORMAT_JSON; + $request = Yii::$app->request; + $result['success'] = false; + $result['msg'] = '保存失败'; + + $id = $request->post('id',0); + $ids = $request->post('ids'); + + foreach($ids as $user_id) { + $item = ZhongjiUserT::findOne(['celuo_id'=>$id,'user_id'=>$user_id]); + if(!$item) { + $item = new ZhongjiUserT(); + $item->celuo_id = $id; + $item->user_id = $user_id; + $item->save(); + } + } + $result['success'] = true; + $result['msg'] = '保存成功'; + return $result; + } + + public function actionUsersRead() { + Yii::$app->response->format = Response::FORMAT_JSON; + $request = Yii::$app->request; + $result['success'] = false; + $result['msg'] = '没有记录'; + + $id = $request->get('id'); + + $data = []; + if($id > 0) { + $items = ZhongjiUserT::find()->where('celuo_id='.$id)->all(); + foreach($items as $item) { + if(!$item->user) continue; + $row = []; + $row['id'] = $item->user->id; + $row['name'] = $item->user->getShowName(); + $data[] = $row; + } + } + $result['success'] = true; + $result['users'] = $data; + $result['msg'] = '共有'.count($items).'条记录'; + return $result; + } + + public function actionUsersDelete() { + Yii::$app->response->format = Response::FORMAT_JSON; + $request = Yii::$app->request; + $result['success'] = false; + $result['msg'] = '删除失败'; + + $id = $request->post('id'); + $user_id = $request->post('user_id'); + + $info = ZhongjiUserT::find() + ->where(['celuo_id'=>$id,'user_id'=>$user_id]) + ->one(); + if($info) $info->delete(); + $result['success'] = true; + $result['msg'] = '删除成功'; + return $result; + } + + public function actionFanxian() { + $request = Yii::$app->request; + $celuo_id = $request->get('celuo_id'); + + return $this->render('fanxian',['celuo_id'=>$celuo_id]); + } + + public function actionFanxianSave() { + Yii::$app->response->format = Response::FORMAT_JSON; + $request = Yii::$app->request; + $result['success'] = false; + $result['msg'] = '保存失败'; + + $celuo_id = $request->post('celuo_id',0); + $baofei = $request->post('baofei', 0); + $car_type_id = $request->post('car_type_id',[]); + $company_id = $request->post('company_id', []); + $car_use_id = $request->post('car_use_id', []); + $type_id = $request->post('type_id', []); + $rate = $request->post('rate', 0); + $max_cashback = $request->post('max_cashback', 0); + + $tran = ZhongjiTiaojian::getDb()->beginTransaction(); + try { + $tiaojian = new ZhongjiTiaojian(); + $tiaojian->baofei = floatval($baofei); + $tiaojian->fanxian = 0; + $tiaojian->xianzhong_one = ''; + $tiaojian->xianzhong_two = ''; + $tiaojian->car_type_id = join(',',$car_type_id); + $tiaojian->car_use_id = join(',',$car_use_id); + $tiaojian->company_ids = join(',',$company_id); + $tiaojian->type_ids = join(',',$type_id); + $tiaojian->type = 1; + $tiaojian->celuo_id = $celuo_id; + if(!$tiaojian->save()) { + throw new \Exception(print_r($tiaojian->getErrors(), true)); + } + $fanxian = new ZhongjiFanxianT(); + $fanxian->celuo_id = $celuo_id; + $fanxian->tiaojian_id = $tiaojian->id; + $fanxian->fanxian_rate = $rate; + $fanxian->max_cashback = $max_cashback; + $fanxian->save(); + $tran->commit(); + } catch (\Exception $e) { + $tran->rollBack(); + $result['msg'] = $e->getMessage(); + return $result; + } + + $result['success'] = true; + $result['msg'] = '保存成功'; + return $result; + } + + public function actionFanxianRead() { + Yii::$app->response->format = Response::FORMAT_JSON; + $request = Yii::$app->request; + $result['success'] = false; + $result['msg'] = '没有记录'; + + $celuo_id = $request->get('celuo_id'); + + $data = []; + if($celuo_id > 0) { + $items = ZhongjiFanxianT::find()->where('celuo_id='.$celuo_id)->all(); + foreach($items as $item) { + if(!$item->tiaojian) continue; + $row = $item->toArray(); + $row['tiaojian']['baofei'] = $item->tiaojian->baofei; + + $car_type_ids = explode(',',$item->tiaojian->car_type_id); + $car_type_names = []; + foreach($car_type_ids as $car_type_id) { + if($car_type_id == 1) $car_type_names[] = '京牌'; + if($car_type_id == 2) $car_type_names[] = '非京牌'; + } + $row['tiaojian']['car_type'] = join(',', $car_type_names); + + $car_use_ids = explode(',',$item->tiaojian->car_use_id); + $car_use_names = []; + foreach($car_use_ids as $car_use_id) { + if($car_use_id == 1) $car_use_names[] = '家庭自用车'; + if($car_use_id == 2) $car_use_names[] = '党政机关、事业团体'; + if($car_use_id == 3) $car_use_names[] = '非营业企业客车'; + if($car_use_id == 4) $car_use_names[] = '不区分营业非营业'; + if($car_use_id == 5) $car_use_names[] = '出租租赁'; + if($car_use_id == 6) $car_use_names[] = '营业货车'; + if($car_use_id == 7) $car_use_names[] = '非营业货车'; + if($car_use_id == 8) $car_use_names[] = '城市公交'; + } + $row['tiaojian']['car_use'] = join(',', $car_use_names); + + $company_ids = explode(',',$item->tiaojian->company_ids); + $company_names = []; + foreach($company_ids as $company_id) { + if($company_id == 1) $company_names[] = '人保'; + if($company_id == 4) $company_names[] = '太平洋'; + if($company_id == 7) $company_names[] = '人寿'; + if($company_id == 8) $company_names[] = '平安'; + } + $row['tiaojian']['company_name'] = join(',', $company_names); + + $type_ids = explode(',',$item->tiaojian->type_ids); + $type_names = []; + foreach($type_ids as $type_id) { + if($type_id == 1) $type_names[] = '新保'; + if($type_id == 2) $type_names[] = '续保'; + } + //条件 + $row['tiaojian']['type_name'] = join(',', $type_names); + //礼品 + $row['gifts'] = []; + $gifts = ZhongjiGiftT::find() + ->where(['fanxian_id'=>$item->id,'gift_type'=>1]) + ->all(); + foreach($gifts as $gift) { + $tmp_row = []; + $tmp_row['id'] = $gift->id; + if($gift->free_type == 1) $tmp_row['free_type'] = '免费模式'; + if($gift->free_type == 2) $tmp_row['free_type'] = '收费模式'; + if($gift->free_type == 3) $tmp_row['free_type'] = 'M选'.$gift->n.'模式'; + $tmp_row['gifts'] = json_decode($gift->gift_ids,true); + $row['gifts'][] = $tmp_row; + } + //礼券 + $row['quans'] = []; + $gifts = ZhongjiGiftT::find() + ->where(['fanxian_id'=>$item->id,'gift_type'=>2]) + ->all(); + foreach($gifts as $gift) { + $tmp_row = []; + $tmp_row['id'] = $gift->id; + if($gift->free_type == 1) $tmp_row['free_type'] = '免费模式'; + if($gift->free_type == 2) $tmp_row['free_type'] = '收费模式'; + if($gift->free_type == 3) $tmp_row['free_type'] = 'M选'.$gift->n.'模式'; + $tmp_row['gifts'] = json_decode($gift->gift_ids,true); + $row['quans'][] = $tmp_row; + } + $data[] = $row; + } + } + $result['success'] = true; + $result['fanxians'] = $data; + $result['msg'] = '共有'.count($items).'条记录'; + return $result; + } + + public function actionFanxianDelete() { + Yii::$app->response->format = Response::FORMAT_JSON; + $request = Yii::$app->request; + $result['success'] = false; + $result['msg'] = '删除失败'; + + $fanxin_id = $request->post('fanxin_id'); + $user_id = $request->post('user_id'); + + $info = ZhongjiFanxianT::find() + ->where('id='.$fanxin_id) + ->one(); + if($info) { + $info->tiaojian->delete(); + $items = ZhongjiGiftT::find() + ->where(['fanxian_id'=>$info->id]) + ->all(); + foreach($items as $item) { + $item->delete(); + } + $info->delete(); + } + $result['success'] = true; + $result['msg'] = '删除成功'; + return $result; + } + + public function actionGifts() { + $request = Yii::$app->request; + $celuo_id = $request->get('celuo_id'); + $fanxian_id = $request->get('fanxian_id'); + + $items = GiftT::find() + ->where(['type_id'=>1]) + ->all(); + + return $this->render('gifts',[ + 'celuo_id'=>$celuo_id, + 'fanxian_id'=>$fanxian_id, + 'items'=>$items + ]); + } + + public function actionGiftSave() { + Yii::$app->response->format = Response::FORMAT_JSON; + $request = Yii::$app->request; + $result['success'] = false; + $result['msg'] = '保存失败'; + + $celuo_id = $request->post('celuo_id',0); + $fanxian_id = $request->post('fanxian_id',0); + $gift_type = $request->post('gift_type', 1); + $free_type = $request->post('free_type', 0); + $n = $request->post('n', 0); + $gift_ids = $request->post('gift_ids', []); + $gift_prices = $request->post('gift_prices', []); + + $gifts = []; + foreach($gift_ids as $gift_id) { + $tmp_gift = GiftT::find()->where(['id'=>$gift_id])->one(); + $row = $tmp_gift->toArray(); + $row['price'] = $gift_prices[$gift_id]; + $gifts[] = $row; + } + $item = new ZhongjiGiftT(); + $item->celuo_id = $celuo_id; + $item->fanxian_id = $fanxian_id; + $item->gift_type = $gift_type; + $item->free_type = $free_type; + $item->n = intval($n); + $item->gift_ids = json_encode($gifts); + if(!$item->save()) { + $result['msg'] = print_r($item->getErrors(), true); + return $result; + } + + $result['success'] = true; + $result['msg'] = '保存成功'; + return $result; + } + public function actionGiftDelete() { + Yii::$app->response->format = Response::FORMAT_JSON; + $request = Yii::$app->request; + $result['success'] = false; + $result['msg'] = '删除失败'; + + $id = $request->post('id'); + $celuo_id = $request->post('celuo_id'); + + $info = ZhongjiGiftT::find() + ->where(['id'=>$id,'celuo_id'=>$celuo_id]) + ->one(); + if($info) { + $info->delete(); + } + $result['success'] = true; + $result['msg'] = '删除成功'; + return $result; } } \ No newline at end of file diff --git a/frontend/controllers/PersonnelController.php b/frontend/controllers/PersonnelController.php index aa99a4e..e7294be 100644 --- a/frontend/controllers/PersonnelController.php +++ b/frontend/controllers/PersonnelController.php @@ -7,16 +7,16 @@ use common\models\GroupT; use common\models\PayT; use common\models\UserT; use common\models\WorkDayT; +use common\models\UserLogT; use Yii; use yii\data\Pagination; use yii\web\Response; use yii\web\UploadedFile; +use common\models\CompanyT; class PersonnelController extends \frontend\controllers\UserBaseController { public $my = null; - public $enableCsrfValidation = false; - public $layout = 'blue-main'; public function init() { @@ -40,60 +40,77 @@ class PersonnelController extends \frontend\controllers\UserBaseController */ public function actionPayList() { - $pay_date = date('Y-m'); - $group_items = GroupT::getTree(); - return $this->render('pay-list',[ - 'group_items' => $group_items, - 'pay_date' => $pay_date - ]); - } - - public function actionPayListJson() - { - Yii::$app->response->format = Response::FORMAT_JSON; $request = Yii::$app->request; $username = $request->get('username'); $name = $request->get('name'); $pay_date = $request->get('pay_date',date('Y-m')); $group_id = $request->get('group_id',0); - $is_leave = $request->get('is_leave'); - $offset = $request->get('offset',0); - $limit = $request->get('limit', 10); + $company_id = $request->get('company_id'); + $page = $request->get('page',1); + $is_leave = $request->get('is_leave',0); + + $status_id = $request->get('status_id',0); $query = UserT::find() - ->where('group_id>0 and is_delete=0'); + ->leftJoin('pay_t','pay_t.user_id=user_t.id') + ->where('user_t.group_id>0 and is_delete=0'); if($username != '') { - $query->andWhere('username like "'.$username.'"'); + $query = $query->andWhere('user_t.username like "'.$username.'"'); } if($name != '') { - $query->andWhere('name like "'.$name.'"'); + $query = $query->andWhere('user_t.name like "'.$name.'"'); + } + if($is_leave != ''){ + $query = $query->andWhere(['user_t.is_leave' => $is_leave]); } - if($is_leave == 'true'){ - $query->andWhere(['is_leave' => 1]); + if($company_id > 0) { + $query = $query->andWhere('user_t.company_id='.$company_id); } if($group_id > 0) { - $query->andWhere('group_id='.$group_id); + $query = $query->andWhere('user_t.group_id='.$group_id); } - $query->orderBy('username ASC,id ASC'); + if($status_id > 0) { + $query = $query->andWhere('pay_t.status_id='.$status_id); + } + $query = $query->orderBy('user_t.username ASC,user_t.id ASC'); $total = $query->count(); - $query = $query->offset($offset)->limit($limit); + $pagination = new Pagination(['totalCount' => $total,'pageSize'=>20]); + $pagination->setPage($page-1); + + $query = $query->offset($pagination->offset)->limit($pagination->limit); $items = $query->all(); - $data = []; - $data['total'] = $total; - $data['rows'] = []; - foreach($items as $item) { - $row = $item->toArray(); - $row['pay_date'] = $pay_date; - $row['group_path'] = $item->group ? $item->group->getPath():''; - $pay = $item->getPay($pay_date); - $row['real_pay'] = $pay ? $pay->real_pay : '0.00'; - $row['is_leave'] = $item->is_leave == 1 ? '已离职':''; - $data['rows'][] = $row; - } + $page_info = MyLib::getPageInfo($pagination); - return $data; + $group_items = GroupT::getTree(); + + $return_count = UserT::find() + ->leftJoin('pay_t','pay_t.user_id=user_t.id') + ->where('user_t.group_id>0 and is_delete=0') + ->andWhere('pay_t.pay_date="'.$pay_date.'"') + ->andWhere('pay_t.status_id=7') + ->count(); + + + $company_items = CompanyT::find()->all(); + + return $this->render('pay-list',[ + 'group_items' => $group_items, + 'items' => $items, + 'page_info' => $page_info, + 'page' => $page, + 'username' => $username, + 'name' => $name, + 'pay_date' => $pay_date, + 'group_id' => $group_id, + 'company_id' => $company_id, + 'status_id' => $status_id, + 'is_leave' => $is_leave, + 'company_items' => $company_items, + + 'return_count' => $return_count + ]); } /** @@ -116,7 +133,7 @@ class PersonnelController extends \frontend\controllers\UserBaseController if($user_info->is_double == 1) { $day_num = $work_day ? $work_day->double_break : '0'; }else{ - $day_num = $work_day ? $work_day->single_break : '0'; + $day_num = $work_day ? $work_day->single_break : '0'; } if($day_num == '0'){ @@ -131,8 +148,8 @@ class PersonnelController extends \frontend\controllers\UserBaseController $try_pay = $user_info->worktype?round(($pay_info->try_pay) / $day_num, 2):'0'; $true_pay = $user_info->worktype?round(($pay_info->formal_pay) / $day_num, 2):'0'; }else{ - $try_pay = $user_info->worktype?round(($user_info->try_pay) / $day_num, 2):'0'; - $true_pay = $user_info->worktype?round(($group_info?($group_info->base_pay + $group_info->job_pay + $group_info->station_pay + $user_info->ext_pay):$user_info->ext_pay) / $day_num, 2):'0'; + $try_pay = $user_info->worktype?round(($user_info->try_pay) / $day_num, 2):'0'; + $true_pay = $user_info->worktype?round(($group_info?($group_info->base_pay + $group_info->job_pay + $group_info->station_pay + $user_info->ext_pay):$user_info->ext_pay) / $day_num, 2):'0'; } @@ -158,10 +175,13 @@ class PersonnelController extends \frontend\controllers\UserBaseController } else { $pay_info->should_pay = floatval($user_info->ext_pay); } + if(!$pay_info->save()) { var_dump($pay_info->errors); exit; } + $pay_info = PayT::findOne(['user_id'=>$user_id,'pay_date'=>$pay_date]); +// die; } return $this->render('pay-info',[ @@ -205,18 +225,28 @@ class PersonnelController extends \frontend\controllers\UserBaseController $electricity_pay = $request->post('electricity_pay',0); $deposit = $request->post('deposit',0); $public_pay = $request->post('public_pay',0); + $extjob_days = $request->post('extjob_days',0); $attendance_days = $request->post('attendance_days'); $try_attendance_days = $request->post('try_attendance_days'); $try_extjob_pay = $request->post('try_extjob_pay'); $give_social_pay = $request->post('give_social_pay'); $full_attendance_pay = $request->post('full_attendance_pay'); $pass_time_pay = $request->post('pass_time_pay'); - $formulae = $request->post('formulae'); +// $formulae = $request->post('formulae'); $get_full_attendance_pay = $request->post('get_full_attendance_pay', 0); $get_pass_time_pay = $request->post('get_pass_time_pay', 0); $try_pay = $request->post('try_pay', 0); $formal_pay = $request->post('formal_pay', 0); + + + $calls = $request->post('calls', 0); + $bus = $request->post('bus', 0); + $bonus = $request->post('bonus', 0); + $turnover = $request->post('turnover', 0); + $tax = $request->post('tax', 0); + + $pay_info = PayT::findOne(['id'=>$id]); if($pay_info) { $pay_info->assessment_pay = $assessment_pay; @@ -235,22 +265,33 @@ class PersonnelController extends \frontend\controllers\UserBaseController $pay_info->electricity_pay = $electricity_pay; $pay_info->deposit = $deposit; $pay_info->public_pay = $public_pay; + $pay_info->extjob_days = $extjob_days; $pay_info->attendance_days = $attendance_days; $pay_info->try_attendance_days = $try_attendance_days; $pay_info->try_extjob_pay = $try_extjob_pay; $pay_info->give_social_pay = $give_social_pay; $pay_info->full_attendance_pay = $full_attendance_pay; $pay_info->pass_time_pay = $pass_time_pay; - $pay_info->formulae = $formulae; +// $pay_info->formulae = $formulae; $pay_info->get_full_attendance_pay = $get_full_attendance_pay; $pay_info->get_pass_time_pay = $get_pass_time_pay; $pay_info->try_pay = $try_pay; $pay_info->formal_pay = $formal_pay; + + + $pay_info->calls = $calls; + $pay_info->bus = $bus; + $pay_info->bonus = $bonus; + $pay_info->turnover = $turnover; + $pay_info->tax = $tax; + $pay_info->renshi_status_id = 1; + $pay_info->status_id = $pay_info->chuna_status_id + 1; + $pay_info->save(); $pay_info->calPay(); - $content = $this->my->showName.'修改了本条记录'.$pay_info->pay_date.'工资'; - $this->addUserLog($pay_info->user_id, $content); + $content = '人事:'.$this->my->showName.'提交'.$pay_info->pay_date.'工资'; + $this->addUserLog($pay_info->id, $content); $result['success'] = true; $result['msg'] = '保存成功'; @@ -413,4 +454,42 @@ class PersonnelController extends \frontend\controllers\UserBaseController $result['files'][0]['error'] = '上传文件失败'; return json_encode($result); } + + + public function actionAjaxHistoryIndex() + { + Yii::$app->response->format = Response::FORMAT_JSON; + $request = Yii::$app->request; + $pay_id = $request->get('pay_id'); + $page = $request->get('page',1); + + $result = array(); + $result['success'] = false; + $result['msg'] = '读取失败'; + + $query = UserLogT::find() + ->where(['pay_id'=>$pay_id]) +// ->andWhere('op_time>='.strtotime("-6 months")) + ->orderBy('id DESC'); + + $total = $query->count(); + + $pagination = new Pagination(['totalCount' => $total,'pageSize'=>20]); + $pagination->setPage($page-1); + + $query = $query->offset($pagination->offset)->limit($pagination->limit); + $items = $query->all(); + + $page_info = MyLib::getAjaxPageInfo($pagination,'car_history_list'); + $html = $this->renderPartial('ajax-history-index',[ + 'pay_id' => $pay_id, + 'items' => $items, + 'page' => $page, + 'page_info' => $page_info + ]); + $result['success'] = true; + $result['msg'] = '读取成功'; + $result['html'] = $html; + return $result; + } } \ No newline at end of file diff --git a/frontend/views/finance/budian-list.php b/frontend/views/finance/budian-list.php new file mode 100644 index 0000000..84e432c --- /dev/null +++ b/frontend/views/finance/budian-list.php @@ -0,0 +1,184 @@ + + + + + + + + +
+ + + 保险类型: + 车牌类型: + 保险公司: + + + 出单日期: + + -- + +   商业净保费: + + -- + + + + +
+ + + + + + + + + + +
+ + + + 补点比例: + + + +
+ + + + + + + + + + + + + + + $item) { + $start_index = $index; + + + $total_real = $item->total * $item->total_rate/100; + $total_clear_real = $item->total_clear * $item->total_rate/100; + $total_dis = round($total_clear_real - $item->r_total,2); + + $order_caiwu_info = $item->orderCaiwu; + $order_info = $item->order; + $car_info = $order_info->car; + + ?> + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
序号车牌号被保险人保险公司保单号出单日期商业净保费保险类型补点比例补点金额
car_no?>id_man?>company ? $order_info->company->name:''?>insurer_no?>print_date : ''?>total_clear?>insurer_type == 1?'商业':'交强'?>budian_rate?>budian_money?>
合计
+ + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/frontend/views/finance/chuna-gongzi-info.php b/frontend/views/finance/chuna-gongzi-info.php new file mode 100644 index 0000000..91007ab --- /dev/null +++ b/frontend/views/finance/chuna-gongzi-info.php @@ -0,0 +1,769 @@ + + +
+ + + + + + +

 

+

提成工资部分

+

应提成工资:ticheng_should_pay,2)?>实提成工资:ticheng_real_pay,2)?>

+ + +
+

提成工资

+ + + + + + + + + + + + + + + + + + +
保单提成团队长提成非车险提成维修提成合计
+
+
+ status_id < 4 || $pay_info->status_id == 8): ?> + +    + + +
+ +
+ + + + + + +
+ + + + +
+

保单提成

+ count() > 0) { ?> + + + + + + + + + + + + + + + + + + + + + each() as $index=>$pay_order) { + $order_info = $pay_order->order; + $caiwu_info = $order_info->caiwu;//carwuordert + $money = $caiwu_info->money1; + $ticket = $order_info->getGiftPrice(1,1); + $gift = $order_info->getGiftPrice(1,0); + $should_pay += $pay_order->should_pay; + $real_pay += $pay_order->real_pay; + $total1_clear += $order_info->total1_clear; + $total1_dis += $order_info->total1_dis; + $ticket_all += $ticket; + $gift_all += $gift; + if($order_info->yuangong_money > 0){ + $zifu_all += $order_info->yuangong_money; + } + ?> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
我的新保
序号车牌号正本日期商业净保费加点比例基本比例应提金额减免金额自费礼品自费礼券业务自付实提金额详情
+ + + car_no?>print_date?>total1_clear?>ticheng_zong_rate?>yeji_rate?>should_pay?>total1_dis?>yuangong_money?>real_pay?>[详情]
+ + count() > 0) { ?> + + + + + + + + + + + + + + + + + + + + each() as $index=>$pay_order) { + $order_info = $pay_order->order; + $caiwu_info = $order_info->caiwu;//carwuordert + $money = $caiwu_info->money1; + $ticket = $order_info->getGiftPrice(1,1); + $gift = $order_info->getGiftPrice(1,0); + $should_pay += $pay_order->should_pay; + $real_pay += $pay_order->real_pay; + $total1_clear += $order_info->total1_clear; + $total1_dis += $order_info->total1_dis; + $ticket_all += $ticket; + $gift_all += $gift; + if($order_info->yuangong_money > 0){ + $zifu_all += $order_info->yuangong_money; + } + + ?> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
我的续保
序号车牌号正本日期商业净保费加点比例基本比例应提金额优惠金额自费礼品自费礼券自付减免实提金额详情
+ + + car_no?>print_date?>total1_clear?>ticheng_zong_rate?>yeji_rate?>should_pay?>total1_dis?>getGiftPrice(1,1)?>getGiftPrice(1,0)?>yuangong_money?>real_pay?>[详情]
+ + count() > 0) { ?> + + + + + + + + + + + + + + + + each() as $index=>$pay_order) { + $order_info = $pay_order->order; + $caiwu_info = $order_info->caiwu;//carwuordert +// $money = $caiwu_info->money1; + $should_pay += $pay_order->should_pay; + $real_pay += $pay_order->real_pay; + $total1_clear += $order_info->total1_clear; +// $total1_dis += $order_info->total1_dis; + ?> + + + + + + + + + + + + + + + + + + + + + + + + +
我的原新保
序号车牌号正本日期商业净保费基本比例应提金额原新保提成实提金额详情
+ + + car_no?>print_date?>total1_clear?>first_xinbao_rate?>should_pay?>first_xinbao_ticheng?>real_pay?>[详情]
+ + + count() > 0) { ?> + + + + + + + + + + + + + + + + each() as $index=>$pay_order) { + $order_info = $pay_order->order; + $caiwu_info = $order_info->caiwu; + $send_info = $order_info->sendLog; + $real_pay += $pay_order->real_pay; + ?> + + + + + + + + + + + + + + + + + + + +
送单统计
序号车牌号被保险人送单地址时间送单提成详情
+ + + car_no?>id_man,15)?> + direction1?$order_info->direction1->name:''?> + range1?$order_info->range1->name:''?> + city1?$order_info->city1->name:''?> + district1?$order_info->district1->name:''?> + send_address1?> + send_time)?>[详情]
+ + + + count() > 0) { ?> + + + + + + + + + + + + + + + + + each() as $index=>$pay_order) { + $order_info = $pay_order->order; + $caiwu_info = $order_info->caiwu; + $rate = $caiwu_info->hebao_ticheng; +// $money = $caiwu_info->money4; + $send_info = $order_info->sendLog; + $real_pay += $pay_order->real_pay; + ?> + + + + + + + + + + + + + + + + + + + +
核保统计
序号车牌号正本日期被保险人核保比例核保提成详情
+ + + car_no?>print_date?>id_man,15)?>real_pay?>元[详情]
+ + + + + + count() > 0) { ?> + + + + + + + + + + + + + + each() as $index=>$pay_order) { + $order_info = $pay_order->order; + $caiwu_info = $order_info->caiwu; + $rate = $caiwu_info->zhengben_ticheng; + $send_info = $order_info->sendLog; + $real_pay += $pay_order->real_pay; + ?> + + + + + + + + + + + + + + + + + + + +
正本统计
序号车牌号正本时间被保险人正本比例正本提成详情
+ + + car_no?>print_date?>id_man,15)?>real_pay?>[详情]
+ +
+

非车险提成

+ + count() > 0) { ?> + + + + + + + + + + + + + + + + + each() as $index=>$pay_order) { + $order_info = $pay_order->nonOrder; + $non_info = $order_info->nonInsurance; + $caiwu_info = $order_info->caiwu1;//ordercarwut + + $real_pay += $pay_order->real_pay; + ?> + + + + + + + + + + + + + + + + + + + + + + + + + +
非车险销售统计
序号车牌号正本时间被保险人险种保费提成比例提成详情
+ + + car_no?>print_date?>insurant_name,15)?>sche->name?>payer1_money?>jiben_rate?>real_pay?>[详情]
+ + + count() > 0) { ?> + + + + + + + + + + + + + + + + each() as $index=>$pay_order) { + $order_info = $pay_order->nonOrder; + $non_info = $order_info->nonInsurance; + $caiwu_info = $order_info->caiwu1;//ordercarwut + $rate = $caiwu_info->rate4; + + $real_pay += $pay_order->real_pay; + ?> + + + + + + + + + + + + + + + + + + + + + + + + + + +
非车险核保统计
序号车牌号正本时间被保险人险种保费提成比例提成详情
+ + + car_no?>print_date?>insurant_name,15)?>sche->name?>payer1_money?>hebao_ticheng?>hebao_ticheng?>[详情]
+ +
+

外区车险提成

+ count() > 0) { ?> + + + + + + + + + + + + + + + + + + + each() as $index=>$pay_order) { + $order_info = $pay_order->order; + $caiwu_info = $order_info->caiwu;//carwuordert + $money = $caiwu_info->money1; + $ticket = $order_info->getGiftPrice(1,1); + $gift = $order_info->getGiftPrice(1,0); + $should_pay += $pay_order->should_pay; + $real_pay += $pay_order->real_pay; + $total1_clear += $order_info->total1_clear; + $total1_dis += $order_info->total1_dis; + $ticket_all += $ticket; + $gift_all += $gift; + if($order_info->yuangong_money > 0){ + $zifu_all += $order_info->yuangong_money; + } + + ?> + + + + + + + + + + + + + + + + + + + + + + + + + + + +
外区车险
序号车牌号正本日期商业总保费交强总保费商业净保费交强净保费总保费比例净保费比例应提金额实提金额详情
+ + + car_no?>print_date?>total1?>total2?>total1_clear?>total2_clear?>zong_bf_rate?>jing_bf_rate?>should_pay?>real_pay?>[详情]
+ + +
+ + + + + + + +
+ + + + +
+
+
+ +
+ + + + + + + + + + + + diff --git a/frontend/views/finance/chuna-gongzi-list.php b/frontend/views/finance/chuna-gongzi-list.php new file mode 100644 index 0000000..eba8793 --- /dev/null +++ b/frontend/views/finance/chuna-gongzi-list.php @@ -0,0 +1,155 @@ + + + + + + + + + + + + + + + + + + +
+ 工号: + 真实姓名: + 工资月份: + 分组: + 状态: + +   退回数量: + + + +
+ + + + + + + + + + + + $item) { + $pay_info = $item->getPay($pay_date); + $base_real_pay = 0; + $ticheng_real_pay = 0; + + $shouldPay = $item->getChunaShouldPay($pay_date); + + $is_begin = 0; + if($pay_info) { + $is_begin = 1; + $ticheng_real_pay = $pay_info->ticheng_real_pay; + } + ?> + + + + + + + + + + + + + + + + + + + + + + + + + +
工号真实姓名工资月份所属岗位提成工资状态操作
username?>name?>group?$item->group->name:''?> + 元 + + + + getStatus($pay_info->status_id)?> + + + + [详情] +
diff --git a/frontend/views/finance/gongzi-all-info.php b/frontend/views/finance/gongzi-all-info.php new file mode 100644 index 0000000..079bff4 --- /dev/null +++ b/frontend/views/finance/gongzi-all-info.php @@ -0,0 +1,724 @@ + + +
+ +

 

+

财务工资

+

应发工资:ticheng_should_pay + $pay_info->base_should_pay,2)?>实发工资:ticheng_real_pay + $pay_info->base_real_pay,2)?>

+ +
+

基本工资

+ renshi_status_id == 1):?> + + + + + + + + + + + + + + + + +
基本工资补助工资扣除工资合计
day_formal_pay + $pay_info->day_try_pay?>buzhu_pay?>kouchu_pay?>base_real_pay?>
+ + + +
+

提成工资

+ chuna_status_id == 2):?> + + + + + + + + + + + + + + + + + + +
保单提成团队长提成非车险提成维修提成合计
+
+ +
+ + + + + + + + chuna_status_id == 2 && $pay_info->renshi_status_id == 1):?> +    + + +    + +
+ + + renshi_status_id == 1):?> +
+ + + + + + + +
+ + + + +
+

基本工资

+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
基本信息
职务姓名入职时间工作制试用工资转正时间转正工资试用出勤天数转正出勤天数
getPath():''?>getShowName()?>enter_date?>worktype?$user_info->worktype->name:''?>job_date?>
+
+

补助工资

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
试用加班转正加班社保话费公交奖金全勤(钱数)通时(钱数)
+
+

应扣工资

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
应扣
迟到事假病假社保罚款电费离职押金公积金个税全勤(钱数或百分比)通时(钱数或百分比)
+
+ + chuna_status_id == 2):?> +
+ + + + + + + +
+ + + + +
+

保单提成

+ count() > 0) { ?> + + + + + + + + + + + + + + + + + + + + each() as $index=>$pay_order) { + $order_info = $pay_order->order; + $caiwu_info = $order_info->caiwu;//carwuordert + $money = $caiwu_info->money1; + $should_pay += $pay_order->should_pay; + $real_pay += $pay_order->real_pay; + $total1_clear += $order_info->total1_clear; + $total1_dis += $order_info->total1_dis; + ?> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
我的新保
序号车牌号正本日期商业净保费提奖应提金额原新保提成优惠金额自费礼券自费礼品自付减免实提金额详情
+ + + car_no?>print_date?>total1_clear?>ticheng_zong_rate?>should_pay?>first_xinbao_ticheng?>total1_dis?>getGiftPrice(1,1)?>getGiftPrice(1,0)?>yuangong_money?>real_pay?>[详情]
+ + count() > 0) { ?> + + + + + + + + + + + + + + + + + + + each() as $index=>$pay_order) { + $order_info = $pay_order->order; + $caiwu_info = $order_info->caiwu;//carwuordert + $money = $caiwu_info->money1; + $should_pay += $pay_order->should_pay; + $real_pay += $pay_order->real_pay; + $total1_clear += $order_info->total1_clear; + $total1_dis += $order_info->total1_dis; + ?> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
我的续保
序号车牌号正本日期商业净保费提奖应提金额优惠金额自费礼券自费礼品自付减免实提金额详情
+ + + car_no?>print_date?>total1_clear?>ticheng_zong_rate?>should_pay?>total1_dis?>getGiftPrice(1,1)?>getGiftPrice(1,0)?>yuangong_money?>real_pay?>[详情]
+ + + count() > 0) { ?> + + + + + + + + + + + + + + each() as $index=>$pay_order) { + $order_info = $pay_order->order; + $caiwu_info = $order_info->caiwu; + $send_info = $order_info->sendLog; + $real_pay += $pay_order->real_pay; + ?> + + + + + + + + + + + + + + + + + + + +
送单统计
序号车牌号被保险人送单地址时间送单提成详情
+ + + car_no?>id_man,15)?> + direction1?$order_info->direction1->name:''?> + range1?$order_info->range1->name:''?> + city1?$order_info->city1->name:''?> + district1?$order_info->district1->name:''?> + send_address1?> + send_time)?>[详情]
+ + + + count() > 0) { ?> + + + + + + + + + + + + + + + each() as $index=>$pay_order) { + $order_info = $pay_order->order; + $caiwu_info = $order_info->caiwu; + $rate = $caiwu_info->hebao_ticheng; +// $money = $caiwu_info->money4; + $send_info = $order_info->sendLog; + $real_pay += $pay_order->real_pay; + ?> + + + + + + + + + + + + + + + + + + + +
核保统计
序号车牌号被保险人核保比例正本日期核保提成详情
+ + + car_no?>id_man,15)?>send_time):''?>real_pay?>元[详情]
+ + + + + + count() > 0) { ?> + + + + + + + + + + + + + + each() as $index=>$pay_order) { + $order_info = $pay_order->order; + $caiwu_info = $order_info->caiwu; + $rate = $caiwu_info->zhengben_ticheng; + $send_info = $order_info->sendLog; + $real_pay += $pay_order->real_pay; + ?> + + + + + + + + + + + + + + + + + + + +
正本统计
序号车牌号被保险人正本比例时间正本提成详情
+ + + car_no?>id_man,15)?>send_time):''?>real_pay?>[详情]
+ +
+

非车险提成

+ + count() > 0) { ?> + + + + + + + + + + + + + + each() as $index=>$pay_order) { + $order_info = $pay_order->nonOrder; + $non_info = $order_info->nonInsurance; + $caiwu_info = $order_info->caiwu1;//ordercarwut + + $real_pay += $pay_order->real_pay; + ?> + + + + + + + + + + + + + + + + + + + +
非车险销售统计
序号被保险人提成比例核保日期提成详情
+ + + insurant_name,15)?>non_rate?>print_date?>real_pay?>[详情]
+ + + count() > 0) { ?> + + + + + + + + + + + + + + each() as $index=>$pay_order) { + $order_info = $pay_order->nonOrder; + $non_info = $order_info->nonInsurance; + $caiwu_info = $order_info->caiwu1;//ordercarwut + $rate = $caiwu_info->rate4; + + $real_pay += $pay_order->real_pay; + ?> + + + + + + + + + + + + + + + + + + + + +
非车险核保统计
序号被保险人提成比例核保日期提成详情
+ + + insurant_name,15)?>non_rate?>print_date?>hebao_ticheng?>[详情]
+ + +
+ +
+ + + + + + + +
+ + + + +
+
+
+
+ + + + + + + + + + + + diff --git a/frontend/views/finance/gongzi-all-list.php b/frontend/views/finance/gongzi-all-list.php new file mode 100644 index 0000000..cca18ce --- /dev/null +++ b/frontend/views/finance/gongzi-all-list.php @@ -0,0 +1,159 @@ + + + + + + + + + + + + + + + + + + +
+ 工号: + 真实姓名: + 工资月份: + 分组: + 状态: + + + + +
+ + + + + + + + + + + + + + $item) { + $pay_info = $item->getPay($pay_date); + $base_real_pay = 0; + $ticheng_real_pay = 0; + $is_begin = 0; + if($pay_info){ + $is_begin = 1; + $base_real_pay = $pay_info->base_real_pay; + $ticheng_real_pay = $pay_info->ticheng_real_pay; + } + ?> + + + + + + + + + + + + + + + + + + + + + + + + + +
工号真实姓名工资月份所属岗位基本工资提成工资状态操作
username?>name?>group?$item->group->name:''?> + 元 + + 元 + + + + getStatus($pay_info->status_id)?> + + + + + + [详情] + +
diff --git a/frontend/views/finance/pay2-info.php b/frontend/views/finance/pay2-info.php index 37a6ae2..7852fab 100644 --- a/frontend/views/finance/pay2-info.php +++ b/frontend/views/finance/pay2-info.php @@ -1,118 +1,154 @@ +

 

财务工资

-

应发工资:should_pay,2)?>实发工资:real_pay,2)?>

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
基本信息
职务姓名入职时间工作制试用工资转正时间转正工资基本工资职务工资岗位工资工资调整
getPath():''?>getShowName()?>enter_date?>worktype?$user_info->worktype->name:''?>try_pay?>job_date?>base_pay + $group_info->job_pay + $group_info->station_pay + $user_info->ext_pay):$user_info->ext_pay?>base_pay:''?>job_pay:''?>station_pay:''?>ext_pay?>
+

应发工资:ticheng_should_pay + $pay_info->base_should_pay,2)?>实发工资:ticheng_real_pay + $pay_info->base_real_pay,2)?>

+ +
+

基本工资

+ renshi_status_id == 1):?> + - - - - - - - - - - - - - - - - - + + + + + - - - - - - - - - - + + + + +
应发
试用( worktype?round($user_info->try_pay / $user_info->worktype->days, 2):'0'; - ?> 元)转正( worktype?round(($group_info?($group_info->base_pay + $group_info->job_pay + $group_info->station_pay + $user_info->ext_pay):$user_info->ext_pay) / $user_info->worktype->days, 2):'0'; - ?> 元)
出勤天数加班出勤天数加班社保提成个人提成个人保费全司保费部门保费基本工资补助工资扣除工资合计
try_attendance_days?>try_extjob_pay?>attendance_days?>extjob_pay?>give_social_pay?>commission?>calGrticheng(),2)?>calGrbaofei(),2)?>calGsbaofei(),2)?>calBmbaofei(),2)?>day_formal_pay + $pay_info->day_try_pay?>buzhu_pay?>kouchu_pay?>base_real_pay?>
- - - - - - + + + +
+

提成工资

+ chuna_status_id == 2):?> +
财务信息司机提成客服提成
+ + + - - - - - - - - + + + + + - - - - - - - - + + + + +
话费公交奖金营业额车辆台数每台提成维修工时费提成比例保单提成团队长提成非车险提成维修提成合计
%
- - - - +
+ +
+ + + chuna_status_id == 2 && $pay_info->renshi_status_id == 1):?> +    + + +    + +
+ + renshi_status_id == 1):?> +
+ +
提成计算方式
+ - - - - + +
提成计算公式formulae?>备注个人提成:grTicheng,个人保费:grBaoFei,全司保费:gsBaoFei,部门保费:bmBaoFei,营业额:yyg。
- +
+ +
+

基本工资

+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
基本信息
职务姓名入职时间工作制试用工资转正时间转正工资试用出勤天数转正出勤天数
getPath():''?>getShowName()?>enter_date?>worktype?$user_info->worktype->name:''?>job_date?>
+
+

补助工资

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
试用加班转正加班社保话费公交奖金全勤(钱数)通时(钱数)
+
+

应扣工资

+ @@ -125,51 +161,42 @@ use \common\libs\MyLib; + - - - - - - - - - - - + + + + + + + + + +
应扣
电费 离职押金 公积金个税 全勤(钱数或百分比) 通时(钱数或百分比)个税
late_pay?>leave_pay?>sick_pay?>social_pay?>fine_pay?>electricity_pay?>deposit?>public_pay?>full_attendance_pay?>pass_time_pay?>
- - - - - - - - - - - - - - - + + +
财务统计
我的新保我的续保我的提成送单合计核保合计正本合计非车险保险非车险核保本月出单
+ + chuna_status_id == 2):?> +
+ + + - - - - - - - - - + +
count()?>count()?>count()?>count()?>count()?>count()?>count()?>count()?>count()?>
+ + + + +
+

保单提成

count() > 0) { ?> @@ -182,11 +209,11 @@ use \common\libs\MyLib; + - - + @@ -197,8 +224,7 @@ use \common\libs\MyLib; $total1_dis = 0; foreach($my_type1_query->each() as $index=>$pay_order) { $order_info = $pay_order->order; - $caiwu_info = $order_info->caiwu; - $rate = $caiwu_info->rate1; + $caiwu_info = $order_info->caiwu;//carwuordert $money = $caiwu_info->money1; $should_pay += $pay_order->should_pay; $real_pay += $pay_order->real_pay; @@ -208,19 +234,20 @@ use \common\libs\MyLib; - - - - - - - - - - - + + + + + + + + + + + + - + @@ -256,10 +283,9 @@ use \common\libs\MyLib; - - + @@ -267,31 +293,32 @@ use \common\libs\MyLib; $should_pay = 0; $real_pay = 0; $total1_clear = 0; + $total1_dis = 0; foreach($my_type3_query->each() as $index=>$pay_order) { $order_info = $pay_order->order; - $caiwu_info = $order_info->caiwu; - $rate = $caiwu_info->rate3; - $money = $caiwu_info->money3; + $caiwu_info = $order_info->caiwu;//carwuordert + $money = $caiwu_info->money1; $should_pay += $pay_order->should_pay; $real_pay += $pay_order->real_pay; $total1_clear += $order_info->total1_clear; + $total1_dis += $order_info->total1_dis; ?> - - - - - - - - - - - + + + + + + + + + + + + - - - - - -
商业净保费 提奖 应提金额原新保提成 优惠金额免费礼券免费礼品 自费礼券 自费礼品自付减免 实提金额 详情
- + order->car_no?>order->print_date?>order->total1_clear?>%order->total1_dis?>getGiftPrice(1,1)?>getGiftPrice(1,0)?>getGiftPrice(0,1)?>getGiftPrice(0,0)?>car_no?>print_date?>total1_clear?>ticheng_zong_rate?>should_pay?>first_xinbao_ticheng?>total1_dis?>getGiftPrice(1,1)?>getGiftPrice(1,0)?>yuangong_money?>real_pay?> [详情]
提奖 应提金额 优惠金额免费礼券免费礼品 自费礼券 自费礼品自付减免 实提金额 详情
- - + + order->car_no?>order->print_date?>order->total1_clear?>%order->total1_dis?>getGiftPrice(1,1)?>getGiftPrice(1,0)?>getGiftPrice(0,1)?>getGiftPrice(0,0)?>car_no?>print_date?>total1_clear?>ticheng_zong_rate?>should_pay?>total1_dis?>getGiftPrice(1,1)?>getGiftPrice(1,0)?>yuangong_money?>real_pay?> [详情]
- - count() > 0){ ?> - - - - - - - - - - - - - - each() as $index=>$pay_order) { - $order_info = $pay_order->order; - $caiwu_info = $order_info->caiwu; - $rate = $caiwu_info->rate1; - $money = $caiwu_info->money1; - if($pay_order->type == 2) { - $rate = $caiwu_info->rate2; - $money = $caiwu_info->money2; - } - $should_pay += $pay_order->should_pay; - $real_pay += $pay_order->real_pay; - ?> - - - - - - - - - - - - - - - - @@ -395,7 +366,7 @@ use \common\libs\MyLib; @@ -407,7 +378,7 @@ use \common\libs\MyLib; send_address1?> - + each() as $index=>$pay_order) { $order_info = $pay_order->order; $caiwu_info = $order_info->caiwu; - $rate = $caiwu_info->rate4; + $rate = $caiwu_info->hebao_ticheng; // $money = $caiwu_info->money4; $send_info = $order_info->sendLog; $real_pay += $pay_order->real_pay; @@ -454,16 +425,13 @@ use \common\libs\MyLib; - - - - - - + + + each() as $index=>$pay_order) { $order_info = $pay_order->order; $caiwu_info = $order_info->caiwu; - $rate = $caiwu_info->rate5; + $rate = $caiwu_info->zhengben_ticheng; $send_info = $order_info->sendLog; $real_pay += $pay_order->real_pay; ?> - - - - - + + +
我的提成
序号车牌号商业净保费提奖应提金额实提金额详情
- - - order->car_no?>order->total1_clear?>%[详情]
- + car_no?> id_man,15)?> send_time)?> [详情]
- + car_no?> id_man,15)?>%send_time)?>send_time):''?>real_pay?>元 [详情]
- + car_no?> id_man,15)?>%send_time)?>send_time):''?>real_pay?> [详情]
- +
+

非车险提成

count() > 0) { ?> @@ -554,24 +521,23 @@ use \common\libs\MyLib; each() as $index=>$pay_order) { - $order_info = $pay_order->order; - $caiwu_info = $order_info->caiwu1; - $rate = $caiwu_info->rate1; + $order_info = $pay_order->nonOrder; + $non_info = $order_info->nonInsurance; + $caiwu_info = $order_info->caiwu1;//ordercarwut $real_pay += $pay_order->real_pay; ?> - - - - - + + + + each() as $index=>$pay_order) { - $order_info = $pay_order->order; - $caiwu_info = $order_info->caiwu1; + $order_info = $pay_order->nonOrder; + $non_info = $order_info->nonInsurance; + $caiwu_info = $order_info->caiwu1;//ordercarwut $rate = $caiwu_info->rate4; $real_pay += $pay_order->real_pay; @@ -614,14 +581,14 @@ use \common\libs\MyLib; - - + + - - + + @@ -639,19 +606,39 @@ use \common\libs\MyLib;
- - + + id_man,15)?>%order->print_date?>insurant_name,15)?>non_rate?>print_date?>real_pay?> [详情]
- + id_man,15)?>%insurant_name,15)?>non_rate?>order->print_date?>print_date?>hebao_ticheng?> [详情]
+
+ +
+ + + + + + +
+ + + + +
+
+
-
- -    - -
- - + + + + + + + + diff --git a/frontend/views/finance/pay2-list.php b/frontend/views/finance/pay2-list.php index 286fb8e..55bbfbc 100644 --- a/frontend/views/finance/pay2-list.php +++ b/frontend/views/finance/pay2-list.php @@ -3,8 +3,13 @@ use \common\libs\MyLib; ?> - - + + + + + + + + + + + + + + + + + +
+ + 保险类型 + + 保单号: + 车牌: + 工号:   + + 出单日期: + + -- + +
+
+ 回单日期: + + -- + +
保险公司: + 级别: + 排序: + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + $item) { + $start_index = ($page-1)*20+$index; + $order = $item->order; + $users=$item->user->group; + $username=$item->user; + $uname=$username['name']; + $nams=$users['name']; + + $total_real = $item->total * $item->total_rate/100; + $total_clear_real = $item->total_clear * $item->total_rate/100; + $total_dis = round($total_clear_real - $item->r_total,2); + + $order_info = $item->order; + + $total1_dis = $item->insurer_type == 1?($order_info->total1_dis + $order_info->yuangong_money):0; + + $gongzi = $item->insurer_type == 1?$item->getPayOrderUser()->sum('real_pay'):0; + + $ticket = $item->insurer_type == 1?$order_info->getGiftPrice(1,1):0; + $gift = $item->insurer_type == 1?$order_info->getGiftPrice(1,2):0; + +// $bu_dian = $item->insurer_type == 1?($item->b1_total+$item->b2_total+$item->b3_total):0; + $bu_dian = $item->budian_rate?$item->budian_rate * $item->total_clear / 100:0; + + $r_bu_dian = $item->insurer_type == 1?($item->b1_total+$item->b2_total+$item->b3_total):0; + + $liwu = $ticket + $gift; + + $lirun = $total_clear_real + $bu_dian - $total1_dis - $gongzi - $liwu; + + + + + ?> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
序号车牌号保险公司工号级别保单号提单日期出单日期保险类型商业总保费商业净保费手续费比例补点比例应得金额实得金额回款金额补点金额回款补点减免金额礼品礼券工资利润
car_no?>company ? $order->company->name:''?>user->username?>-insurer_no?>submit_date : ''?>print_date : ''?>insurer_type==1?'商业':'交强'?>total?>total_clear?>total_rate?>budian_rate?>r_total?>
+ + + + + + + +
+ + + + + + + + + + + + + + + \ No newline at end of file diff --git a/frontend/views/finance/ticheng-jisuan.php b/frontend/views/finance/ticheng-jisuan.php new file mode 100644 index 0000000..0e925fa --- /dev/null +++ b/frontend/views/finance/ticheng-jisuan.php @@ -0,0 +1,369 @@ + + + + + + + + +
+ + +业务员: +
模糊 + 全选   + 非数字   + + >取反   + +
+ + 车牌类型: + + 险种类型: + + 保险公司: + 车牌号: + + 出单日期: + + -- + +   
商业净保费: + + -- + + 级别: + + + + +
+ + + + + + + + + + + +
+ 基本提成比例:% +      + 团队长组: + + 团队长提成比例:% +    + 团队长: + + +
+ + + + 核保提成:元   + 正本提成:元   + 送单提成:元   + 原新保提成比例:% + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + $item) { + $start_index = $index; + +// $users=$item->user->group; +// $username=$item->user; +// $uname=$username['name']; +// $nams=$users['name']; + + $total_real = $item->total * $item->total_rate/100; + $total_clear_real = $item->total_clear * $item->total_rate/100; + $total_dis = round($total_clear_real - $item->r_total,2); + + $order_caiwu_info = $item->orderCaiwu; + $order_info = $item->order; + $car_info = $order_info->car; + + $is_xinbao = $car_info->op_user3 == ''?1:0; + + ?> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
序号车牌号被保险人保险公司保单号出单日期商业净保费手续费比例基本提成比例基本提成加点提成比例加点提成自费礼品自费礼券自费减免金额提成业务员原新保提成原新保业务员核保提成核保业务员正本提成正本业务员送单提成送单人团队长组1提成团队长组1团队长组2提成团队长组2团队长组3提成团队长组3团队长组4提成团队长组4团队长组5提成团队长组5
car_no?>id_man?>company ? $order_info->company->name:''?>insurer_no?>print_date : ''?>total_clear?>total_rate?>yeji_rate:''?>yeji_ticheng:''?>ticheng_zong_rate:''?>ticheng_money:''?>getGiftPrice(1,1):''?>getGiftPrice(1,2):''?>yuangong_money:''?>yewu_ticheng:''?>op_user1:''?>first_xinbao_ticheng:''?>op_user3:''?>first_xinbao_ticheng:''?>op_user1:''?>hebao_ticheng:''?>op1?$order_info->op1->getShowName():''?>zhengben_ticheng:''?>op2?$order_info->op2->getShowName():''?>songdan_ticheng:''?>sendLog?$order_info->sendLog->user->getShowName():''?>dz_ticheng1:''?>dz_names1:''?>dz_ticheng2:''?>dz_names2:''?>dz_ticheng3:''?>dz_names3:''?>dz_ticheng4:''?>dz_names4:''?>dz_ticheng5:''?>dz_names5:''?>
合计总合计保费
+ + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/frontend/views/layouts/blue-main.php b/frontend/views/layouts/blue-main.php index e2763a6..0eb875c 100644 --- a/frontend/views/layouts/blue-main.php +++ b/frontend/views/layouts/blue-main.php @@ -23,6 +23,7 @@ use yii\helpers\Html; + beginBody() ?> diff --git a/frontend/views/marketing-strategy/add.php b/frontend/views/marketing-strategy/add.php index 4dc12d4..6513994 100644 --- a/frontend/views/marketing-strategy/add.php +++ b/frontend/views/marketing-strategy/add.php @@ -14,27 +14,21 @@ use \common\libs\MyLib;
-
+
-
-
-
+
日期 - 时间 -
-
+
日期 - 时间 -
@@ -61,15 +55,19 @@ use \common\libs\MyLib;
beginBlock('footer_js'); ?> - + + +endBlock('footer_js'); ?> diff --git a/frontend/views/marketing-strategy/gifts.php b/frontend/views/marketing-strategy/gifts.php new file mode 100644 index 0000000..d51a05a --- /dev/null +++ b/frontend/views/marketing-strategy/gifts.php @@ -0,0 +1,83 @@ + +beginBlock('header_css'); ?> +endBlock(); ?> + +
+
+
+
+ + + +
+ +
+ +
+
+
+
N=
+ +
+
+
+
+
+ +
+
+ +
+
+ + +
+
+
+
+ +
+
+
+ +
+
+
+ +
+
+
+
+ +beginBlock('footer_js'); ?> + +endBlock('footer_js'); ?> diff --git a/frontend/views/marketing-strategy/users.php b/frontend/views/marketing-strategy/users.php new file mode 100644 index 0000000..0258eb2 --- /dev/null +++ b/frontend/views/marketing-strategy/users.php @@ -0,0 +1,70 @@ + +beginBlock('header_css'); ?> +endBlock(); ?> + +
+
+
+
+ +
+ +
+ +
+
+
+ +
+
+ +
+
+
+
+ +beginBlock('footer_js'); ?> + +endBlock('footer_js'); ?> diff --git a/frontend/views/personnel/pay-info.php b/frontend/views/personnel/pay-info.php index b7e5704..81b1280 100644 --- a/frontend/views/personnel/pay-info.php +++ b/frontend/views/personnel/pay-info.php @@ -1,8 +1,11 @@ + +

 

人事工资

-

应发工资:should_pay,2)?>实发工资:real_pay,2)?>

+

应发工资:base_should_pay,2)?>实发工资:base_real_pay,2)?>

+

基本工资

@@ -15,9 +18,9 @@ - - - + + + @@ -27,90 +30,51 @@ - - - + + + +
基本信息试用工资 转正时间 转正工资基本工资职务工资工资调整加班天数试用出勤天数转正出勤天数
getPath():''?> job_date?> try_pay?>job_pay:''?>ext_pay?>
+
+

补助工资

+ + + + + + + + - - - - - - - - - - - - + + + + - - - - - - + + + - - - - - - - + + + +
应发
试用( 元)转正( 元)应发全勤/通时
出勤天数加班出勤天数加班试用加班转正加班 社保提成个人提成个人保费全司保费部门保费全勤(钱数)话费公交奖金全勤(钱数) 通时(钱数)
calGrticheng(),2)?>calGrbaofei(),2)?>calGsbaofei(),2)?>calBmbaofei(),2)?>
+
+

应扣工资

- - - - - - - - - - - - - - - - - - - - - - - - -
财务信息司机提成客服提成
话费公交奖金营业额车辆台数每台提成维修工时费提成比例
calls?>bus?>bonus?>turnover?>driver_num?>driver_price?>fix_total?>fix_rate?>%
- - - - - - - - - - -
提成计算方式
提成计算公式备注个人提成:grTicheng,个人保费:grBaoFei,全司保费:gsBaoFei,部门保费:bmBaoFei,营业额:yyg。
- - - + @@ -121,6 +85,7 @@ + @@ -133,20 +98,51 @@ +
应扣应扣
迟到电费 离职押金 公积金个税 全勤(钱数或百分比) 通时(钱数或百分比)
- -    + status_id < 4 || $pay_info->status_id == 7): ?> + +    + +
+ + + + + + + +
+ + + + +
+
+
+ + + + + + + - - + + + + diff --git a/frontend/views/personnel/pay-list.php b/frontend/views/personnel/pay-list.php index 7308248..68b0f69 100644 --- a/frontend/views/personnel/pay-list.php +++ b/frontend/views/personnel/pay-list.php @@ -1,139 +1,203 @@ -beginBlock('header_css'); ?> - -endBlock(); ?> + + + + + + + + + + - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ 工号: + 真实姓名: + 工资月份: + 是否离职: + 公司: + 分组: + 状态: + +   退回数量: +
+ + + + + + + + + + + + + + + $item) { + $pay_info = $item->getPay($pay_date); + $real_pay = 0; + $is_begin = 0; + if($pay_info) { + $is_begin = 1; + $real_pay = $pay_info->base_real_pay; - function search() { - $('.input-group.date').datepicker({ - minViewMode: 1, - keyboardNavigation: false, - forceParse: false, - autoclose: true, - todayHighlight: true, - format: "yyyy-mm" - }); - $('#listTable').bootstrapTable('destroy'); - $('#listTable').bootstrapTable({ - url: "/personnel/pay-list-json", - pagination: true, - sidePagination: 'server', - multipleSelectRow: true, - queryParams: function(params) { - o['username'] = $('#username').val(); - o['name'] = $('#name').val(); - o['pay_date'] = $('#pay_date').val(); - o['is_leave'] = $('#is_leave').prop("checked"); - o['group_id'] = $('#group_id').val(); - o['limit'] = params['limit']; - o['offset'] = params['offset']; - return o; } - }); - return false; - } + ?> + + + + + + + + + + + + + + + + +
工号真实姓名工资月份所属岗位工资是否离职状态操作
username?>name?>group?$item->group->name:''?> + 元 + is_leave?'是':''?> + + + getStatus($pay_info->status_id)?> + - $(function() { - search(); + + [详情] +
+ + + + + -endBlock(); ?> diff --git a/frontend/web/assets/css/custom.css b/frontend/web/assets/css/custom.css new file mode 100644 index 0000000..d42cf4c --- /dev/null +++ b/frontend/web/assets/css/custom.css @@ -0,0 +1,15 @@ +.mb-8 { + margin-bottom: 8px; +} +.mr-8 { + margin-right: 8px; +} +.mt-8 { + margin-top: 8px; +} +.ml-8 { + margin-left: 8px; +} +.m-8 { + margin: 8px; +} \ No newline at end of file