diff --git a/frontend/controllers/FinanceController.php b/frontend/controllers/FinanceController.php index b45c493..d2bd428 100644 --- a/frontend/controllers/FinanceController.php +++ b/frontend/controllers/FinanceController.php @@ -7564,66 +7564,74 @@ class FinanceController extends \frontend\controllers\UserBaseController * 财务工资列表 * @return string */ - public function actionGongziAllList() + public function actionGongziAllList() { + $group_items = GroupT::getTree(); + return $this->render('gongzi-all-list',[ + 'group_items' => $group_items + ]); + } + + public function actionGongziAllListJson() { + 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); - $page = $request->get('page', 1); - + $is_leave = $request->get('is_leave'); $status_id = $request->get('status_id',0); + $offset = $request->get('offset', 0); + $limit = $request->get('limit', 10); + $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 . '"'); + $query->andWhere('username like "' . $username . '"'); } if ($name != '') { - $query = $query->andWhere('name like "' . $name . '"'); + $query->andWhere('name like "' . $name . '"'); } if ($group_id > 0) { - $query = $query->andWhere('group_id=' . $group_id); + $query->andWhere('group_id=' . $group_id); + } + if($is_leave != '') { + $query->andWhere('is_leave='.$is_leave); } - if($status_id > 0) { - $query = $query->andWhere(['IN','pay_t.status_id',[7,8,9]]); + $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); + $query->offset($offset)->limit($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 - ]); + $data = []; + $data['total'] = $total; + $data['rows'] = []; + foreach($items as $item) { + $row = $item->toArray(); + $row['pay_date'] = $pay_date; + $row['group_name'] = $item->group ? $item->group->path : ''; + $row['is_leave'] = $item->is_leave ? '已离职':''; + $pay_info = $item->getPay($pay_date); + $row['status_name'] = $pay_info ? $pay_info->getStatus($pay_info->status_id) : ''; + $row['real_pay'] = $pay_info->base_real_pay; + $row['should_pay'] = $pay_info->ticheng_real_pay; + $row['is_show'] = ($pay_info->renshi_status_id > 0 && $pay_info->chuna_status_id > 0 && $pay_info->status_id != 7 && $pay_info->status_id != 8) ? 1 : 0; + $data['rows'][] = $row; + } + + return $data; } /** * 出纳工资-详情 @@ -7688,6 +7696,10 @@ class FinanceController extends \frontend\controllers\UserBaseController ->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'); @@ -7730,6 +7742,7 @@ class FinanceController extends \frontend\controllers\UserBaseController '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, @@ -8008,4 +8021,54 @@ class FinanceController extends \frontend\controllers\UserBaseController 'r_bu_dian_all'=>$r_bu_dian_all ]); } + + public function actionGongziAllReturnSave() + { + Yii::$app->response->format = Response::FORMAT_JSON; + $request = Yii::$app->request; + $result = array(); + $result['success'] = false; + $result['msg'] = '保存失败'; + + $id = $request->post('id',0); + $remark = $request->post('remark',''); + $status_id = 4; + + $pay_info = PayT::findOne($id); + $pay_info->status_id = $status_id + 6; + + $content = '老板:'.$this->my->showName.'退回'.$pay_info->pay_date.'工资'; + $this->addUserLog($pay_info->id, $content,$remark); + + if($pay_info->save()){ + $result['success'] = true; + $result['msg'] = '保存成功'; + } + return $result; + } + + public function actionGongziAllSave() + { + Yii::$app->response->format = Response::FORMAT_JSON; + $request = Yii::$app->request; + $result = array(); + $result['success'] = false; + $result['msg'] = '保存失败'; + + $id = $request->post('id',0); + + $pay_info = PayT::findOne($id); + $pay_info->status_id = 5; + + $content = '老板:'.$this->my->showName.'同意本条记录'.$pay_info->pay_date.'工资'; + $this->addUserLog($pay_info->id, $content); + + + if($pay_info->save()){ + $result['success'] = true; + $result['msg'] = '保存成功'; + } + return $result; + } + } diff --git a/frontend/views/finance/gongzi-all-info.php b/frontend/views/finance/gongzi-all-info.php index 079bff4..78e7d3e 100644 --- a/frontend/views/finance/gongzi-all-info.php +++ b/frontend/views/finance/gongzi-all-info.php @@ -1,724 +1,639 @@ - -
- -

 

-

财务工资

-

应发工资: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; - ?> +beginBlock('header_css'); ?> + +endBlock(); ?> + +
+ + + renshi_status_id == 1) { ?> +
+
+
基本工资
+
+
+
+
+
+ +
+ +
+ +
+ +
+ +
+ +
+
+
+ +
+ +
+ +
+ +
+ +
+ +
+
+
+
+
+
+ + chuna_status_id == 2) { ?> +
+
+
提成工资
+
+
+
+
+
+ +
+ +
+ +
+ +
+
+
+ +
+ +
+ +
+ +
+ +
+ +
+
+ status_id < 5 || $pay_info->status_id == 8) { ?> +
+
+
+ + +
+
+
+ +
+
+
+
+ + renshi_status_id == 1) {?> +
+
+
基本工资详情
+
+
+
+
+
我的新保
序号车牌号正本日期商业净保费提奖应提金额原新保提成优惠金额自费礼券自费礼品自付减免实提金额详情
+ - - - - - - - - - - - - - - + - - - - - - - - - - - - - - - - -
- - - 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)?>[详情]getPath():''?>getShowName()?>enter_date?>worktype?$user_info->worktype->name:''?>job_date?>
- - - - 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?>[详情]应扣工资
- - -
- -
- - - - - - - -
- - - - -
-
-
-
- - - - - - - - - - - + + 迟到 + 事假 + 病假 + 社保 + 罚款 + 电费 + 离职押金 + 公积金 + 个税 + 全勤(钱数或百分比) + 通时(钱数或百分比) + + + + + + + + + + + + + + + + + + + + + + + + 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; + $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; + $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?>[详情]
+ +
+
+
+
+ + + + +beginBlock('footer_js'); ?> +endBlock('footer_js'); ?> + diff --git a/frontend/views/finance/gongzi-all-list.php b/frontend/views/finance/gongzi-all-list.php index cca18ce..c7429c1 100644 --- a/frontend/views/finance/gongzi-all-list.php +++ b/frontend/views/finance/gongzi-all-list.php @@ -1,159 +1,149 @@ - - - - - - - - - - + + + - - - - - - - -
- 工号: - 真实姓名: - 工资月份: - 分组: - 状态: - - - - -
- - - - - - - - - - - - - - $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)?> - - - - - - [详情] - -
+endBlock(); ?> diff --git a/frontend/views/finance/pay2-info.php b/frontend/views/finance/pay2-info.php index 49e4262..2119530 100644 --- a/frontend/views/finance/pay2-info.php +++ b/frontend/views/finance/pay2-info.php @@ -81,7 +81,7 @@ use \common\libs\MyLib; - status_id < 4 || $pay_info->status_id == 8) { ?> + status_id < 4 || $pay_info->status_id == 8 || $pay_info->status_id == 10) { ?>