educode_sales 0.7.0 → 0.7.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/app/controllers/educode_sales/businesses_controller.rb +2 -1
- data/app/controllers/educode_sales/follow_ups_controller.rb +1 -1
- data/app/controllers/educode_sales/money_plans_controller.rb +2 -2
- data/app/controllers/educode_sales/operation_plans_controller.rb +5 -2
- data/app/controllers/educode_sales/plans_controller.rb +3 -2
- data/app/controllers/educode_sales/staffs_controller.rb +2 -0
- data/app/views/educode_sales/businesses/index.html.erb +1 -0
- data/app/views/educode_sales/businesses/show_follow.html.erb +7 -1
- data/app/views/educode_sales/businesses/show_follow.json.jbuilder +1 -0
- data/app/views/educode_sales/customers/index.html.erb +1 -2
- data/app/views/educode_sales/roles/edit.html.erb +1 -1
- data/lib/educode_sales/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fd1dede8ec609b98a19dcd71c21bac7b6024098a7cdb8bad5c600784bd9a649e
|
4
|
+
data.tar.gz: 34bdddc9c368c11588d2d9dc0a3307f8cfbc4568489f539e344b13f32bf41702
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 372e451790e777e0c9df20e7bdd9bc133e4d15351c6ae5b541c53a9761b14c2cbd5645c7517d0ae20ea4301872592fd43de82013ae90166546b5ae647b59db32
|
7
|
+
data.tar.gz: f9a5c5518474de3e1aa03e2fe1fae7bbede839df9649227e1c0c0ddba1f4aaaf62e3e903c813c3115dd7d792d56e48e9c6659226cf0ed4b29169ac1198dda8a4
|
@@ -206,6 +206,7 @@ module EducodeSales
|
|
206
206
|
last_follow.reception_at,
|
207
207
|
last_follow.bidded_date,
|
208
208
|
last_follow.signed_date,
|
209
|
+
last_follow.year,
|
209
210
|
last_follow.created_at as latest_time,
|
210
211
|
last_follow.actual_amount,
|
211
212
|
(last_follow.actual_amount - educode_sales_businesses.return_money) as wait_return_money,
|
@@ -370,7 +371,7 @@ module EducodeSales
|
|
370
371
|
render layout: false
|
371
372
|
end
|
372
373
|
format.json do
|
373
|
-
@records = BusinessExportRecord.all.page(params[:page]).per(params[:limit])
|
374
|
+
@records = BusinessExportRecord.all.order(id: :desc).page(params[:page]).per(params[:limit])
|
374
375
|
end
|
375
376
|
end
|
376
377
|
end
|
@@ -20,7 +20,7 @@ module EducodeSales
|
|
20
20
|
business_ids = @businesses.pluck(:id)
|
21
21
|
@follow_ups = FollowUp.where(business_id: business_ids)
|
22
22
|
when '区域'
|
23
|
-
school_ids = School.where(province: @current_admin.areas.pluck(:name)).pluck(:id)
|
23
|
+
school_ids = School.where(province: @current_admin.areas.pluck(:name)).pluck(:id) + StaffSchool.where(staff_id: @current_admin.id).pluck(:school_id)
|
24
24
|
business_ids = Business.joins(last_follow_up: :assign_follow_ups).where("educode_sales_assign_follow_ups.staff_id = ?", @current_admin.id).pluck(:id)
|
25
25
|
@businesses = Business.joins("JOIN departments ON educode_sales_businesses.department_id = departments.id").where("departments.school_id in (?) OR educode_sales_businesses.staff_id = #{@current_admin.id} OR educode_sales_businesses.id in (?)", school_ids, business_ids)
|
26
26
|
business_ids = @businesses.pluck(:id)
|
@@ -21,11 +21,11 @@ module EducodeSales
|
|
21
21
|
when '自己'
|
22
22
|
@money_plans = MoneyPlan.joins(:follow_up).where("educode_sales_follow_ups.clazz_id != ?", x_id).where(follow_up_id: follow_up_ids).where(staff_id: @current_admin.id)
|
23
23
|
when '区域'
|
24
|
-
a_ids = MoneyPlan.where(follow_up_id: follow_up_ids).where(staff_id: @current_admin.id).
|
24
|
+
a_ids = MoneyPlan.where(follow_up_id: follow_up_ids).where(staff_id: @current_admin.id).pluck(:follow_up_id)
|
25
25
|
school_ids = School.where(province: @current_admin.areas.pluck(:name)).pluck(:id) + StaffSchool.where(staff_id: @current_admin.id).pluck(:school_id)
|
26
26
|
b_ids = Business.where(school_id: school_ids).pluck(:last_follow_up_id)
|
27
27
|
ids = a_ids + b_ids
|
28
|
-
@money_plans = MoneyPlan.joins(:follow_up).where("educode_sales_follow_ups.clazz_id != ?", x_id).where(
|
28
|
+
@money_plans = MoneyPlan.joins(:follow_up).where("educode_sales_follow_ups.clazz_id != ?", x_id).where(follow_up_id: ids)
|
29
29
|
else
|
30
30
|
@money_plans = MoneyPlan.joins(:follow_up).where("educode_sales_follow_ups.clazz_id != ?", x_id).where(follow_up_id: follow_up_ids)
|
31
31
|
end
|
@@ -20,8 +20,11 @@ module EducodeSales
|
|
20
20
|
when '自己'
|
21
21
|
@sale_plans = OperationPlan.where(staff_id: @current_admin.id)
|
22
22
|
when '区域'
|
23
|
-
staff_ids = Staff.joins(user: [user_extension: [department: :school]]).where("schools.province in (?)
|
24
|
-
|
23
|
+
staff_ids = Staff.joins(user: [user_extension: [department: :school]]).where("schools.province in (?)", @current_admin.areas.pluck(:name)).pluck(:id)
|
24
|
+
school_ids = StaffSchool.where(staff_id: @current_admin.id).pluck(:school_id)
|
25
|
+
department_ids = Department.where(school_id: school_ids).pluck(:id)
|
26
|
+
teacher_ids = Teacher.where(department_id: department_ids).pluck(:id)
|
27
|
+
@sale_plans = OperationPlan.where("staff_id in (?) OR educode_sales_operation_plans.staff_id = ? OR educode_sales_operation_plans.teacher_id in (?)", staff_ids, @current_admin.id,teacher_ids)
|
25
28
|
else
|
26
29
|
@sale_plans = OperationPlan
|
27
30
|
end
|
@@ -21,8 +21,9 @@ module EducodeSales
|
|
21
21
|
when '自己'
|
22
22
|
@sale_plans = SalePlan.where(staff_id: @current_admin.id)
|
23
23
|
when '区域'
|
24
|
-
staff_ids = Staff.joins(user: [user_extension: [department: :school]]).where("schools.province in (?)
|
25
|
-
|
24
|
+
staff_ids = Staff.joins(user: [user_extension: [department: :school]]).where("schools.province in (?)", @current_admin.areas.pluck(:name)).pluck(:id)
|
25
|
+
business_ids = Business.where(school_id: StaffSchool.where(staff_id: @current_admin.id).pluck(:school_id)).pluck(:id)
|
26
|
+
@sale_plans = SalePlan.where("staff_id in (?) OR educode_sales_sale_plans.staff_id = ? OR educode_sales_sale_plans.business_id in (?)", staff_ids, @current_admin.id,business_ids)
|
26
27
|
else
|
27
28
|
@sale_plans = SalePlan
|
28
29
|
end
|
@@ -37,7 +37,7 @@
|
|
37
37
|
</div>
|
38
38
|
</div>
|
39
39
|
<div class="layui-form-item" style="border-top: 1px solid #ddd;">
|
40
|
-
<label class="layui-form-label"
|
40
|
+
<label class="layui-form-label">回款计划</label>
|
41
41
|
<div class="layui-input-block">
|
42
42
|
<%= radio_button_tag("money_plan", "自己", @areas.include?("回款管理-自己"), {title: '本人负责列表', id: 16}) %>
|
43
43
|
<%= radio_button_tag("money_plan", "区域", @areas.include?("回款管理-区域"), {title: '本人负责区域及监管院校列表', id: 17}) %>
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: educode_sales
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.7.
|
4
|
+
version: 0.7.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- anke1460
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-01-
|
11
|
+
date: 2022-01-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|