educode_sales 0.9.8 → 0.9.10
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/follow_ups_controller.rb +8 -4
- data/app/controllers/educode_sales/sale_trends_controller.rb +4 -4
- data/app/models/educode_sales/business_number_record.rb +6 -0
- data/db/migrate/20220920080302_add_column_number_to_educode_sales_businesses.rb +6 -0
- data/db/migrate/20220923084102_create_table_to_busines_number_recoreds.rb +7 -0
- data/lib/educode_sales/version.rb +1 -1
- metadata +5 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e55869ffcc832dfac95ed169a94adac8b8fbcb634bb8aa5c3aec6b6b706f6c56
|
4
|
+
data.tar.gz: 81fa68ebe5aa56782e95ff35ae4583250259efb701cf4f65495e9ed189fd11d7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 899de281abd3f1d782caa15f6a0db901781f4a3d370f31897816b7f44f83a07d11dbb2e9ba8830bd3428acdfdf2c028dc19c03f93fd5bfd1ca0a07f1e7b81843
|
7
|
+
data.tar.gz: 7c4f9d48a48aace21df084e359843a6de29189d31c54d4e828bd0cf6c6c65c7e93713e2510303ede0cc959edf5b9dcb6d1248c5c5614778837569d9957eefbff
|
@@ -242,10 +242,14 @@ module EducodeSales
|
|
242
242
|
|
243
243
|
# o类商机增加编号
|
244
244
|
def add_business_number
|
245
|
-
if (@business.number.blank?) && params[:clazz_id] == '74'
|
246
|
-
totual_count = EducodeSales::Business.unscoped.where("number like :data",data: "#{Time.now.year}%").count
|
247
|
-
|
248
|
-
@
|
245
|
+
if ( @business.number.blank?) && params[:clazz_id] == '74'
|
246
|
+
totual_count = EducodeSales::Business.unscoped.where("number like :data",data: "#{Time.now.year}%").count + 1 + Time.now.year*1000.to_i
|
247
|
+
@business_number_record = BusinessNumberRecord.first.value
|
248
|
+
while @business_number_record.include?(totual_count)
|
249
|
+
totual_count += 1
|
250
|
+
end
|
251
|
+
@business.update(number: totual_count.to_s)
|
252
|
+
BusinessNumberRecord.first.update(value: @business_number_record | [ totual_count ])
|
249
253
|
end
|
250
254
|
end
|
251
255
|
|
@@ -21,8 +21,8 @@ module EducodeSales
|
|
21
21
|
s_stage_ids = Common.where(clazz: '商机阶段', name: ['已签单', '已验收', '回款中', '服务中', '已结束']).pluck(:id)
|
22
22
|
@service_amount = Business.joins(:last_follow_up).where("educode_sales_follow_ups.clazz_id != ?", x).where("educode_sales_follow_ups.stage_id IN (?)", s_stage_ids).sum(:total_amount).round(2)
|
23
23
|
@actual_service_amount = Business.joins(:last_follow_up).where("educode_sales_follow_ups.clazz_id != ?", x).where("educode_sales_follow_ups.stage_id IN (?)", s_stage_ids).sum(:actual_amount).round(2)
|
24
|
-
|
25
|
-
@return_amount = total_return[0]['return_money']&.round(2) || 0
|
24
|
+
@return_amount = Business.joins(last_follow_up: :money_plans).where("educode_sales_follow_ups.clazz_id != ?", x).where.not("educode_sales_money_plans.clazz!= ?", 1).sum(:amount).round(2)
|
25
|
+
# @return_amount = total_return[0]['return_money']&.round(2) || 0
|
26
26
|
@receivable_amount = @goal_amount - @return_amount
|
27
27
|
|
28
28
|
a = Common.where(clazz: '商机类型', name: Common.find_by(extras: EducodeSales::Common::ATYPE)&.name).pluck(:id)
|
@@ -45,8 +45,8 @@ module EducodeSales
|
|
45
45
|
s_stage_ids = Common.where(clazz: '商机阶段', name: ['已签单', '已验收', '回款中', '服务中', '已结束']).pluck(:id)
|
46
46
|
@service_amount = Business.joins(:last_follow_up).where("educode_sales_follow_ups.clazz_id != ?", x).where("educode_sales_follow_ups.signed_date >= ? AND educode_sales_follow_ups.signed_date <= ? AND educode_sales_follow_ups.stage_id IN (?)", "#{@year}-01-01", "#{@year}-12-31", s_stage_ids).sum(:total_amount).round(2)
|
47
47
|
@actual_service_amount = Business.joins(:last_follow_up).where("educode_sales_follow_ups.clazz_id != ?", x).where("educode_sales_follow_ups.signed_date >= ? AND educode_sales_follow_ups.signed_date <= ? AND educode_sales_follow_ups.stage_id IN (?)", "#{@year}-01-01", "#{@year}-12-31", s_stage_ids).sum(:actual_amount).round(2)
|
48
|
-
|
49
|
-
@return_amount = total_return[0]['return_money']&.round(2) || 0
|
48
|
+
@return_amount = Business.joins(last_follow_up: :money_plans).where("educode_sales_follow_ups.clazz_id != ?", x).where.not("educode_sales_money_plans.clazz!= ?", 1).where("educode_sales_money_plans.date_at >= ? AND educode_sales_money_plans.date_at <= ? ", year_time, year_over_time).sum(:amount).round(2)
|
49
|
+
# @return_amount = total_return[0]['return_money']&.round(2) || 0
|
50
50
|
@receivable_amount = @goal_amount - @return_amount
|
51
51
|
|
52
52
|
a = Common.where(clazz: '商机类型', name: Common.find_by(extras: EducodeSales::Common::ATYPE)&.name).pluck(:id)
|
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.10
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- anke1460
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-09-
|
11
|
+
date: 2022-09-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -188,6 +188,7 @@ files:
|
|
188
188
|
- app/models/educode_sales/assign_follow_up.rb
|
189
189
|
- app/models/educode_sales/business.rb
|
190
190
|
- app/models/educode_sales/business_export_record.rb
|
191
|
+
- app/models/educode_sales/business_number_record.rb
|
191
192
|
- app/models/educode_sales/business_relation_ship.rb
|
192
193
|
- app/models/educode_sales/common.rb
|
193
194
|
- app/models/educode_sales/course_subject.rb
|
@@ -474,7 +475,9 @@ files:
|
|
474
475
|
- db/migrate/20220523023609_update_assessment_month_column_to_assessment_settings.rb
|
475
476
|
- db/migrate/20220523101628_update_column_to_follow_ups.rb
|
476
477
|
- db/migrate/20220827130438_create_educode_sales_login_histories.rb
|
478
|
+
- db/migrate/20220920080302_add_column_number_to_educode_sales_businesses.rb
|
477
479
|
- db/migrate/20220921131116_add_change_clazz_to_follow_up.rb
|
480
|
+
- db/migrate/20220923084102_create_table_to_busines_number_recoreds.rb
|
478
481
|
- lib/educode_sales.rb
|
479
482
|
- lib/educode_sales/engine.rb
|
480
483
|
- lib/educode_sales/version.rb
|