educode_sales 1.10.9 → 1.10.10

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 73d98a4d83213078f656abfeb070db43d2a6a594e8a273a8ace4bad8165dc541
4
- data.tar.gz: 52b10fb147e17a25bd4f3d5b155676cbbb76d61cf6f799b2249edc6428b1ca1e
3
+ metadata.gz: 8b14ccbfcb9a5061855ca86be07cacb97c60b4775dcfa2a5df9e43ffdef76d7a
4
+ data.tar.gz: 586ddfdcefed79700eb15c20ccba6b73dbe6ecee3fd12f808d614d843959f536
5
5
  SHA512:
6
- metadata.gz: 9808f3c65fd410beaf59ef94d4be34b7ba5f25c6377975eead142d6943f5c20007c70b6cd297150473c3e569a29142e17edf89671788e77173389711b2124684
7
- data.tar.gz: 5b2c468c9b57723d26804fd589637a5f4f877da54be8a88d180b5aec8adca7b69d08bbd28a901b9c6c0cde03e78755e3cc4750a4c700f62f9c02041456d58b73
6
+ metadata.gz: fd7f2559d5a6ea7a69482dc0d4cae776e338bcaa99a30b0c303248d5f69abccfbeaf051dc3cbfcfa5b608cf718b7cef989b211f6eef52d4f3b98433b267112fb
7
+ data.tar.gz: 4c04378292d11f37b2e9c29061470fcec8920c4245bdf7b3c77839e309a20f22b7d6c4ae767a2cf4d4bc37b4d693379464edfbda526b562410a5befb3837a340
@@ -344,6 +344,10 @@ module EducodeSales
344
344
  if i == 1 && last_follow_up
345
345
  # 验收时间
346
346
  last_follow_up.reception_at = v
347
+ elsif i == 0 && last_follow_up
348
+ # 合同部署时间
349
+ last_follow_up.deploy_time = v
350
+ @business.p_deploy_time = v
347
351
  end
348
352
  end
349
353
 
@@ -523,7 +527,7 @@ module EducodeSales
523
527
 
524
528
  private
525
529
  def follow_up_params
526
- params.permit(:o_business_deployment, :plan_signed_date, :bidded_days, :signed_date, :signed_department_id, :service_years, :service_start_time, :service_end_time, :funding_source, :signed_clazz)
530
+ params.permit(:o_business_deployment, :plan_signed_date, :actual_amount, :bidded_days, :signed_date, :signed_department_id, :service_years, :service_start_time, :service_end_time, :funding_source, :signed_clazz)
527
531
  end
528
532
 
529
533
  def product_up_params
@@ -221,11 +221,17 @@ module EducodeSales
221
221
  s.major_count,
222
222
  s.department_id,
223
223
  departments.name AS department_name,
224
- (SELECT COUNT(user_extensions.id) FROM user_extensions WHERE user_extensions.department_id = s.department_id AND user_extensions.identity = 0) AS teacher_count,
225
- (SELECT COUNT(user_extensions.id) FROM user_extensions WHERE user_extensions.department_id = s.department_id AND user_extensions.identity = 1) AS student_count
224
+ t.teacher_count,
225
+ t.student_count
226
226
  ").joins("
227
227
  JOIN schools ON s.id = schools.id
228
228
  LEFT JOIN departments ON s.department_id = departments.id
229
+ LEFT JOIN (
230
+ SELECT COUNT(IF(user_extensions.identity = 0, user_extensions.id, 0)) AS teacher_count,
231
+ COUNT(IF(user_extensions.identity = 1, user_extensions.id, 1)) AS student_count, user_extensions.department_id
232
+ FROM user_extensions
233
+ GROUP BY user_extensions.department_id
234
+ ) AS t ON t.department_id = s.department_id
229
235
  ")
230
236
 
231
237
  # part_a_ids = CustomerFollow.all.pluck(:school_id)
@@ -271,6 +277,8 @@ module EducodeSales
271
277
  @customers = @customers.where(id: school_ids)
272
278
  end
273
279
 
280
+ @count = School.joins("LEFT JOIN departments ON schools.id = departments.school_id").count
281
+
274
282
  if params[:page].present?
275
283
  @customers = @customers.order(id: :desc).page(params[:page]).per(params[:limit])
276
284
  else
@@ -136,6 +136,36 @@ module EducodeSales
136
136
  if business
137
137
  money_plan_record.update(business_id: business.id)
138
138
  business.update(return_money: claim.money_plan.money_plan_claims.sum(:amount))
139
+
140
+
141
+ # # 生成跟进信息
142
+ # last_follow_up = business.last_follow_up
143
+ # if last_follow_up.present?
144
+ # follow_up = last_follow_up.dup
145
+
146
+ # follow_up.description = "认领了回款记录"
147
+
148
+ # follow_up.staff = @current_admin
149
+
150
+ # last_follow_up.assign_follow_ups.each do |d|
151
+ # follow_up.assign_follow_ups.build(staff_id: d.staff_id)
152
+ # end
153
+
154
+ # if follow_up.save!
155
+ # last_follow_up.key_person.each do |d|
156
+ # key_person = d.dup
157
+ # key_person.follow_up_id = follow_up.id
158
+ # key_person.save
159
+ # end
160
+ # last_follow_up.money_plans.each do |d|
161
+ # d.follow_up_id = follow_up.id
162
+ # d.save
163
+ # end
164
+ # business.update(last_follow_up_id: follow_up.id)
165
+ # end
166
+ # end
167
+
168
+
139
169
  end
140
170
  end
141
171
  render_success
@@ -97,6 +97,13 @@
97
97
  <%= select_tag "funding_source", options_for_select([''] + EducodeSales::FollowUp::funding_sources.keys, @last_follow_up&.funding_source), class: 'required' %>
98
98
  </div>
99
99
  </div>
100
+ <div class="layui-inline">
101
+ <label class="layui-form-label">合同额(万)</label>
102
+ <div class="layui-input-inline">
103
+ <input name="actual_amount" type="number" class="layui-input" autocomplete="off" placeholder="本单位的签单金额"
104
+ value="<%= @last_follow_up&.actual_amount.to_f.round(6) %>">
105
+ </div>
106
+ </div>
100
107
  <br>
101
108
  <h2 style="padding-left:20px;margin-top: 25px;">签单</h2>
102
109
  <hr>
@@ -48,12 +48,12 @@ json.data do
48
48
  json.department d['department_name'] || ''
49
49
  json.major_count d['major_count']
50
50
  json.department_id d['department_id'] || ''
51
- json.teacher_counts d['teacher_count']
52
- json.student_counts d['student_count']
51
+ json.teacher_counts d['teacher_count'] || 0
52
+ json.student_counts d['student_count'] || 0
53
53
  end
54
54
  end
55
55
 
56
56
  json.code 0
57
57
  if params[:page].present?
58
- json.count @customers.total_count
58
+ json.count @count
59
59
  end
@@ -1,3 +1,3 @@
1
1
  module EducodeSales
2
- VERSION = '1.10.9'
2
+ VERSION = '1.10.10'
3
3
  end
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: 1.10.9
4
+ version: 1.10.10
5
5
  platform: ruby
6
6
  authors:
7
7
  - anke1460
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-06-16 00:00:00.000000000 Z
11
+ date: 2023-06-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -759,7 +759,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
759
759
  - !ruby/object:Gem::Version
760
760
  version: '0'
761
761
  requirements: []
762
- rubygems_version: 3.0.0
762
+ rubygems_version: 3.0.9
763
763
  signing_key:
764
764
  specification_version: 4
765
765
  summary: Summary of EducodeSales.