educode_sales 0.9.90 → 0.9.91

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e9351b319e5233520bc0142f08f640e76f0a7e6bd4130d22d51dacf1c8f9ffd3
4
- data.tar.gz: 2d1746cb8a15868876e610067193f3a4dd3bd6ae3bdf1cb23d8b686494ac5c82
3
+ metadata.gz: cb711cb66d6db0b32c6c7a79c5bc38e1fb277b6b0b1b0dcb82e656d13de8b182
4
+ data.tar.gz: c22d6b9965826d1464f59316f9f1f50edb75b86ecb5cbe60636f06293b9a3a6d
5
5
  SHA512:
6
- metadata.gz: 12b2e73029794f3e8553b56c7813cb6d44a0b58cbcbae4fddf851f2d527722f6485cfca6666e24c410210c60730653dc80efa7f26617dd53bc3b315eb38e40ad
7
- data.tar.gz: 481c5795832e343e411d1ede2c13ebe47b1e135a0d14425d2e4a0a1e6a8f88c9e16a80440210b4029291fd6fe749df9e7e467aa9a6f9dfcc41f651ad293bfdee
6
+ metadata.gz: 13102675d29578ec7dfdd1f410744079b543db7a39e0406d936ff27f962f56826d06e7b9c506dfce137e0a3a875351b319a811a227d05012f2fe4725b7510adf
7
+ data.tar.gz: 026bc860c82d11b845947de3be099b6dbc248b777a94ef479022da16018d55e763d2c060f54b91f6baa8028ab2564f4af5616134d304339654ab78f79322a204
@@ -11,7 +11,7 @@ module EducodeSales
11
11
  x = Common.find_by(extras: EducodeSales::Common::XTYPE)&.id
12
12
  o = Common.find_by(extras: EducodeSales::Common::OTYPE)&.id
13
13
  if (@year == '全部')
14
- @business_amount = Business.joins(:last_follow_up).where("educode_sales_follow_ups.clazz_id != ? AND educode_sales_follow_ups.clazz_id != ?", x, o).sum(:total_amount).round(2)
14
+ @business_amount = Business.joins(:last_follow_up).where("educode_sales_follow_ups.clazz_id != ? AND educode_sales_follow_ups.clazz_id != ?", x, o).sum(:budget_amount).round(2)
15
15
  stage_ids = Common.where(clazz: '商机阶段', name: ['已中标', '已签单', '已验收', '回款中', '服务中', '已结束']).pluck(:id)
16
16
  # 中标总金额, 已回款总金额
17
17
  total_return = Business.joins(:last_follow_up).where("educode_sales_follow_ups.clazz_id != ?", x).where("educode_sales_follow_ups.stage_id IN (?)", stage_ids).select("sum(total_amount) AS total, sum(educode_sales_businesses.return_money) AS return_money")
@@ -30,15 +30,15 @@ module EducodeSales
30
30
  @receivable_amount = @receivable_amount.present? && @receivable_amount[0]['num'] ? @receivable_amount[0]['num'].round(2) : 0
31
31
 
32
32
  a = Common.where(clazz: '商机类型', name: Common.find_by(extras: EducodeSales::Common::ATYPE)&.name).pluck(:id)
33
- @a_amount = Business.joins(:last_follow_up).where("educode_sales_follow_ups.clazz_id IN (?)", a).sum(:total_amount).round(2)
33
+ @a_amount = Business.joins(:last_follow_up).where("educode_sales_follow_ups.clazz_id IN (?)", a).sum(:budget_amount).round(2)
34
34
  b = Common.where(clazz: '商机类型', name: Common.find_by(extras: EducodeSales::Common::BTYPE)&.name).pluck(:id)
35
- @b_amount = Business.joins(:last_follow_up).where("educode_sales_follow_ups.clazz_id IN (?)", b).sum(:total_amount).round(2)
35
+ @b_amount = Business.joins(:last_follow_up).where("educode_sales_follow_ups.clazz_id IN (?)", b).sum(:budget_amount).round(2)
36
36
  else
37
37
  year_time = "#{@year}-01-01 00:00:00"
38
38
  year_over_time = "#{@year}-12-31 23:59:59"
39
39
 
40
40
  @sale_trend = SaleTrend.find_or_create_by(year: @year)
41
- @business_amount = Business.joins(:last_follow_up).where("educode_sales_follow_ups.clazz_id != ? AND educode_sales_follow_ups.clazz_id != ?", x, o).where("educode_sales_follow_ups.year <= ?", @year).sum(:total_amount).round(2)
41
+ @business_amount = Business.joins(:last_follow_up).where("educode_sales_follow_ups.clazz_id != ? AND educode_sales_follow_ups.clazz_id != ?", x, o).where("educode_sales_follow_ups.year <= ?", @year).sum(:budget_amount).round(2)
42
42
  stage_ids = Common.where(clazz: '商机阶段', name: ['已中标', '已签单', '已验收', '回款中', '服务中', '已结束']).pluck(:id)
43
43
 
44
44
  # 中标总金额, 已回款总金额
@@ -61,9 +61,9 @@ module EducodeSales
61
61
  @receivable_amount = @receivable_amount.present? && @receivable_amount[0]['num'] ? @receivable_amount[0]['num'].round(2) : 0
62
62
 
63
63
  a = Common.where(clazz: '商机类型', name: Common.find_by(extras: EducodeSales::Common::ATYPE)&.name).pluck(:id)
64
- @a_amount = Business.joins(:last_follow_up).where("educode_sales_follow_ups.clazz_id IN (?)", a).where("educode_sales_follow_ups.year <= ?", @year).sum(:total_amount).round(2)
64
+ @a_amount = Business.joins(:last_follow_up).where("educode_sales_follow_ups.clazz_id IN (?)", a).where("educode_sales_follow_ups.year <= ?", @year).sum(:budget_amount).round(2)
65
65
  b = Common.where(clazz: '商机类型', name: Common.find_by(extras: EducodeSales::Common::BTYPE)&.name).pluck(:id)
66
- @b_amount = Business.joins(:last_follow_up).where("educode_sales_follow_ups.clazz_id IN (?)", b).where("educode_sales_follow_ups.year <= ?", @year).sum(:total_amount).round(2)
66
+ @b_amount = Business.joins(:last_follow_up).where("educode_sales_follow_ups.clazz_id IN (?)", b).where("educode_sales_follow_ups.year <= ?", @year).sum(:budget_amount).round(2)
67
67
  end
68
68
 
69
69
  end
@@ -1,3 +1,3 @@
1
1
  module EducodeSales
2
- VERSION = '0.9.90'
2
+ VERSION = '0.9.91'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: educode_sales
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.90
4
+ version: 0.9.91
5
5
  platform: ruby
6
6
  authors:
7
7
  - anke1460