educode_sales 0.9.28 → 0.9.30
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 -2
- data/app/controllers/educode_sales/sale_trends_controller.rb +9 -7
- data/app/models/educode_sales/business.rb +1 -1
- data/app/views/educode_sales/businesses/edit_follow_record.html.erb +4 -4
- data/app/views/educode_sales/businesses/index.json.jbuilder +3 -3
- data/app/views/educode_sales/businesses/new_follow_record.html.erb +4 -4
- data/app/views/educode_sales/businesses/show_follow_record.html.erb +12 -5
- data/app/views/educode_sales/follow_ups/money_plans.json.jbuilder +2 -1
- data/app/views/educode_sales/sale_trends/_business_followup_analysis.html.erb +3 -2
- 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: 51800df7e8c3e444188f0353c66757741c5a99e710426b47da2e9593c65f819f
|
4
|
+
data.tar.gz: 89735f6378821ee46fc806198a24559015440a0047ee6fc4ca27f8d364b69755
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6f967ae4f53c7819b02f3f006a9309434b41b5d22474504464b6e22f3a5469c810a24e221e82468b642240dd81e320b019cd45f0a018e9d94fda99fa646245c5
|
7
|
+
data.tar.gz: 65c325fc5d46fcfdb7ec964881ab0fb832857d428a10241fced792709871c9092ce907c5f74cc23581e2f8776a972a7f3f32d17343a2d377a4b2597610d4f65c
|
@@ -264,11 +264,11 @@ module EducodeSales
|
|
264
264
|
(last_follow.total_amount - last_follow.actual_amount) as divide_money,
|
265
265
|
(last_follow.actual_amount - educode_sales_businesses.return_money) as wait_return_money,
|
266
266
|
last_follow.total_amount,
|
267
|
-
total_follow_ups.
|
267
|
+
total_follow_ups.follow_ups_counts
|
268
268
|
").joins("
|
269
269
|
LEFT JOIN educode_sales_follow_ups AS last_follow ON educode_sales_businesses.last_follow_up_id = last_follow.id AND last_follow.deleted_at IS NULL
|
270
270
|
LEFT JOIN (
|
271
|
-
SELECT COUNT(*) AS
|
271
|
+
SELECT COUNT(*) AS follow_ups_counts, educode_sales_follow_ups.business_id
|
272
272
|
FROM educode_sales_follow_ups
|
273
273
|
WHERE educode_sales_follow_ups.deleted_at IS NULL
|
274
274
|
GROUP BY educode_sales_follow_ups.business_id
|
@@ -117,7 +117,8 @@ module EducodeSales
|
|
117
117
|
when "week" #按周
|
118
118
|
if params[:date_week].present?
|
119
119
|
date = params[:date_week].split(" - ")
|
120
|
-
|
120
|
+
# 年初第一天周数是0会导致周数重复计算
|
121
|
+
dates = (date[0].to_date..date[1].to_date).map { |d| d.strftime("%Y-%W") }.uniq.select { |d| d.split("-")[1] != '00' }
|
121
122
|
@follow_count_data = business_followup_charts(dates, names, x_business_ids, SaleTrend::COLORS, date, "%Y%u") do |dates|
|
122
123
|
dates.map { |date|
|
123
124
|
d = date.split("-")
|
@@ -190,6 +191,9 @@ module EducodeSales
|
|
190
191
|
when "month" #按月
|
191
192
|
if params[:goal_date_month].present?
|
192
193
|
date = params[:goal_date_month].split(" - ")
|
194
|
+
date[0] = (date[0] + "-01").to_date.to_s
|
195
|
+
date[1] = (date[1] + "-01").to_date.end_of_month.to_s
|
196
|
+
|
193
197
|
dates = ((date[0] + "-01").to_date..(date[1] + "-01").to_date).map { |d| d.strftime("%Y-%m") }.uniq
|
194
198
|
@goal_count_data = month_sale_chart(dates, sale_names, SaleTrend::COLORS, x, stage_ids, s_stage_ids, count_type, date)
|
195
199
|
else
|
@@ -414,11 +418,9 @@ module EducodeSales
|
|
414
418
|
|
415
419
|
|
416
420
|
def month_sale_chart(dates, names, colors, x, stage_ids, s_stage_ids, count_type, range)
|
417
|
-
begin_at = range[0]
|
418
|
-
end_at = range[1]
|
421
|
+
begin_at = range[0]
|
422
|
+
end_at = range[1]
|
419
423
|
|
420
|
-
begin_at = DateTime.new begin_at[0].to_i, begin_at[1].to_i
|
421
|
-
end_at = DateTime.new end_at[0].to_i, end_at[1].to_i
|
422
424
|
data_1 = EducodeSales::Business.joins(:last_follow_up).
|
423
425
|
where("educode_sales_follow_ups.clazz_id != ?", x).
|
424
426
|
where("educode_sales_follow_ups.stage_id IN (?)", stage_ids).
|
@@ -531,8 +533,8 @@ module EducodeSales
|
|
531
533
|
def year_sale_chart(dates, names, colors, x, stage_ids, s_stage_ids, count_type, range)
|
532
534
|
begin_at = range[0].split("-")
|
533
535
|
end_at = range[1].split("-")
|
534
|
-
begin_at = DateTime.new(begin_at[0].to_i).beginning_of_year
|
535
|
-
end_at = DateTime.new(end_at[0].to_i).end_of_year
|
536
|
+
begin_at = DateTime.new(begin_at[0].to_i).beginning_of_year.to_date.to_s
|
537
|
+
end_at = DateTime.new(end_at[0].to_i).end_of_year.to_date.to_s
|
536
538
|
|
537
539
|
data_1 = EducodeSales::Business.joins(:last_follow_up).
|
538
540
|
where("educode_sales_follow_ups.clazz_id != ?", x).
|
@@ -80,7 +80,7 @@
|
|
80
80
|
<div class="layui-inline">
|
81
81
|
<label class="layui-form-label">中标额(万)</label>
|
82
82
|
<div class="layui-input-inline">
|
83
|
-
<input name="total_amount" type="number" class="layui-input" value="<%= @follow_up.total_amount
|
83
|
+
<input name="total_amount" type="number" class="layui-input" value="<%= @follow_up.total_amount.to_f.round(6) %>">
|
84
84
|
</div>
|
85
85
|
客户采购支出的费用。中标额的生命历程:1.在最初阶段,是商机的预算总额;2.在挂网阶段,是项目的挂网预算总额;3.在中标阶段,是项目的中标总额。
|
86
86
|
</div>
|
@@ -88,7 +88,7 @@
|
|
88
88
|
<div class="layui-inline">
|
89
89
|
<label class="layui-form-label">合同额(万)</label>
|
90
90
|
<div class="layui-input-inline">
|
91
|
-
<input name="actual_amount" type="number" class="layui-input" placeholder="本单位的签单金额" value="<%= @follow_up.actual_amount
|
91
|
+
<input name="actual_amount" type="number" class="layui-input" placeholder="本单位的签单金额" value="<%= @follow_up.actual_amount.to_f.round(6) %>">
|
92
92
|
</div>
|
93
93
|
客户签给头歌的费用。合同额的生命历程:1.在中标之前,合同额都是0;2.在中标之后,实际与头歌签合同的金额。
|
94
94
|
</div>
|
@@ -103,7 +103,7 @@
|
|
103
103
|
<div class="layui-inline">
|
104
104
|
<label class="layui-form-label">渠道分成(万)</label>
|
105
105
|
<div class="layui-input-inline">
|
106
|
-
<input name="divide_amount" class="layui-input" value="<%= @follow_up.divide_amount%>">
|
106
|
+
<input name="divide_amount" class="layui-input" value="<%= @follow_up.divide_amount.to_f.round(6) %>">
|
107
107
|
</div>
|
108
108
|
中标额里,渠道拿到的部分。
|
109
109
|
</div>
|
@@ -111,7 +111,7 @@
|
|
111
111
|
<div class="layui-inline">
|
112
112
|
<label class="layui-form-label">预算金额(万)</label>
|
113
113
|
<div class="layui-input-inline">
|
114
|
-
<input name="budget_amount" class="layui-input" value="<%= @last_follow_up&.budget_amount.to_f.round(
|
114
|
+
<input name="budget_amount" class="layui-input" value="<%= @last_follow_up&.budget_amount.to_f.round(6) %>">
|
115
115
|
</div>
|
116
116
|
</div>
|
117
117
|
<div class="layui-form-item">
|
@@ -8,7 +8,7 @@ json.data do
|
|
8
8
|
json.department d.department.name
|
9
9
|
json.school d.department.school.name
|
10
10
|
json.school_id d.department.school.id
|
11
|
-
follow_ups_count = d['
|
11
|
+
follow_ups_count = d['follow_ups_counts'] || 0
|
12
12
|
json.follow_ups_count follow_ups_count
|
13
13
|
follow_count += follow_ups_count
|
14
14
|
json.follow_up_id d.last_follow_up_id
|
@@ -23,8 +23,8 @@ json.data do
|
|
23
23
|
json.service_end_time d.last_follow_up&.service_start_time.to_s + "-" + d.last_follow_up&.service_end_time.to_s
|
24
24
|
|
25
25
|
json.divide_rate d.divide_rate
|
26
|
-
json.divide_money d.divide_amount
|
27
|
-
json.budget_amount d.budget_amount
|
26
|
+
json.divide_money d.divide_amount.to_f.round(2)
|
27
|
+
json.budget_amount d.budget_amount.to_f.round(2) #d.follow_ups.where(stage_id: @budget_stage_ids).order("created_at desc").first&.total_amount&.round(2) || 0
|
28
28
|
json.area d.department.school.province
|
29
29
|
school_property = d.department.school.school_property
|
30
30
|
property = []
|
@@ -87,7 +87,7 @@
|
|
87
87
|
<label class="layui-form-label">中标额(万)</label>
|
88
88
|
<div class="layui-input-inline">
|
89
89
|
<input name="total_amount" type="number" class="layui-input" autocomplete="off"
|
90
|
-
value="<%= @last_follow_up&.total_amount.to_f.round(
|
90
|
+
value="<%= @last_follow_up&.total_amount.to_f.round(6) %>">
|
91
91
|
</div>
|
92
92
|
客户采购支出的费用。中标额的生命历程:1.在最初阶段,是商机的预算总额;2.在挂网阶段,是项目的挂网预算总额;3.在中标阶段,是项目的中标总额。
|
93
93
|
</div>
|
@@ -96,7 +96,7 @@
|
|
96
96
|
<label class="layui-form-label">合同额(万)</label>
|
97
97
|
<div class="layui-input-inline">
|
98
98
|
<input name="actual_amount" type="number" class="layui-input" autocomplete="off" placeholder="本单位的签单金额"
|
99
|
-
value="<%= @last_follow_up&.actual_amount.to_f.round(
|
99
|
+
value="<%= @last_follow_up&.actual_amount.to_f.round(6) %>">
|
100
100
|
</div>
|
101
101
|
客户签给头歌的费用。合同额的生命历程:1.在中标之前,合同额都是0;2.在中标之后,实际与头歌签合同的金额。
|
102
102
|
</div>
|
@@ -111,7 +111,7 @@
|
|
111
111
|
<div class="layui-inline">
|
112
112
|
<label class="layui-form-label">渠道分成(万)</label>
|
113
113
|
<div class="layui-input-inline">
|
114
|
-
<input name="divide_amount" class="layui-input" value="<%= @last_follow_up&.divide_amount.to_f.round(
|
114
|
+
<input name="divide_amount" class="layui-input" value="<%= @last_follow_up&.divide_amount.to_f.round(6) %>">
|
115
115
|
</div>
|
116
116
|
中标额里,渠道拿到的部分。
|
117
117
|
</div>
|
@@ -119,7 +119,7 @@
|
|
119
119
|
<div class="layui-inline">
|
120
120
|
<label class="layui-form-label">预算金额(万)</label>
|
121
121
|
<div class="layui-input-inline">
|
122
|
-
<input name="budget_amount" class="layui-input" value="<%= @last_follow_up&.budget_amount.to_f.round(
|
122
|
+
<input name="budget_amount" class="layui-input" value="<%= @last_follow_up&.budget_amount.to_f.round(6) %>">
|
123
123
|
</div>
|
124
124
|
</div>
|
125
125
|
<div class="layui-form-item">
|
@@ -83,13 +83,13 @@
|
|
83
83
|
<div class="layui-inline">
|
84
84
|
<label class="layui-form-label">中标额:</label>
|
85
85
|
<div class="layui-input-inline">
|
86
|
-
<%= @follow_up.total_amount.to_f.round(
|
86
|
+
<%= @follow_up.total_amount.to_f.round(6) %>万
|
87
87
|
</div>
|
88
88
|
</div>
|
89
89
|
<div class="layui-inline">
|
90
90
|
<label class="layui-form-label">合同额:</label>
|
91
91
|
<div class="layui-input-inline">
|
92
|
-
<%= @follow_up.actual_amount.to_f.round(
|
92
|
+
<%= @follow_up.actual_amount.to_f.round(6) %>万
|
93
93
|
</div>
|
94
94
|
</div>
|
95
95
|
<br>
|
@@ -99,12 +99,19 @@
|
|
99
99
|
<%= @follow_up.place&.name %>
|
100
100
|
</div>
|
101
101
|
</div>
|
102
|
-
|
102
|
+
<div class="layui-inline">
|
103
103
|
<label class="layui-form-label">渠道分成:</label>
|
104
104
|
<div class="layui-input-inline">
|
105
|
-
<%= @follow_up.divide_amount.to_f.round(
|
105
|
+
<%= @follow_up.divide_amount.to_f.round(6) %>万
|
106
|
+
</div>
|
107
|
+
</div>
|
108
|
+
<br/>
|
109
|
+
<div class="layui-inline">
|
110
|
+
<label class="layui-form-label">预算金额:</label>
|
111
|
+
<div class="layui-input-inline">
|
112
|
+
<%= @follow_up.budget_amount.to_f.round(6) %>万
|
106
113
|
</div>
|
107
|
-
</div>
|
114
|
+
</div>
|
108
115
|
<div class="layui-inline">
|
109
116
|
<label class="layui-form-label">分成比例:</label>
|
110
117
|
<div class="layui-input-inline">
|
@@ -54,11 +54,11 @@
|
|
54
54
|
function renderTable(chart_data) {
|
55
55
|
var labels = [];
|
56
56
|
fields = [
|
57
|
-
{field: 'col0', title: '姓名', width:100}
|
57
|
+
{field: 'col0', title: '姓名', width:100, totalRowText: '合计:'}
|
58
58
|
];
|
59
59
|
chart_data.labels.forEach(function(d, i) {
|
60
60
|
labels.push(d);
|
61
|
-
fields.push({title: d.split("(").join("<br/>").replace(")", ""), field: 'col' + (i + 1), width:
|
61
|
+
fields.push({title: d.split("(").join("<br/>").replace(")", ""), field: 'col' + (i + 1), width:180, align: 'center', sort: true, totalRow: '{{ parseInt(d.TOTAL_NUMS) }}'})
|
62
62
|
})
|
63
63
|
var table_data = [];
|
64
64
|
chart_data.datasets.forEach(function(d, i) {
|
@@ -78,6 +78,7 @@
|
|
78
78
|
url: '',
|
79
79
|
limit: 1000,
|
80
80
|
page: false,
|
81
|
+
totalRow: true,
|
81
82
|
data: table_data,
|
82
83
|
cols: [fields]
|
83
84
|
});
|
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.9.
|
4
|
+
version: 0.9.30
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- anke1460
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-01-
|
11
|
+
date: 2023-01-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|