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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cb711cb66d6db0b32c6c7a79c5bc38e1fb277b6b0b1b0dcb82e656d13de8b182
|
4
|
+
data.tar.gz: c22d6b9965826d1464f59316f9f1f50edb75b86ecb5cbe60636f06293b9a3a6d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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(:
|
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(:
|
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(:
|
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(:
|
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(:
|
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(:
|
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
|