next_sges 0.2.3 → 0.2.4
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/models/next_sges/collection_note.rb +8 -0
- data/app/models/next_sges/school.rb +5 -1
- data/lib/next_sges/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: f76ef9e87db3d81905ab791e4bca8b56ebb5dd63
|
|
4
|
+
data.tar.gz: 0d12af3d531db1444101ffc945cd16f8951eac87
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 017c73a922067cff90ef9bc92a45ebcccaf16cb9b01ae970831c49a78e2699e31cd0014d5156ec28ddaa610d81d0e2f7e6b91befaaa53ce057af633af58c7086
|
|
7
|
+
data.tar.gz: 4ac56e9fea706fe7fb5b2746f4a522cc4104736fb092f6855dd64496c72d080ead94ebd63ac9eb939bf48d2ee44c3bf8cac4e034def62cb772af569d9cb1f415
|
|
@@ -18,6 +18,14 @@ module NextSges
|
|
|
18
18
|
enum status: {inactive: 0, active: 1, paid: 2}
|
|
19
19
|
INITIAL_LETTER = "F"
|
|
20
20
|
|
|
21
|
+
def self.by_month
|
|
22
|
+
where('extract(month from updated_at) = ?', DateTime.now.month)
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
def self.by_year
|
|
26
|
+
where('extract(year from updated_at) = ?', DateTime.now.year)
|
|
27
|
+
end
|
|
28
|
+
|
|
21
29
|
# Initialize item for a collection note with a given type
|
|
22
30
|
def new_item(collection_type)
|
|
23
31
|
NextSges::CollectionNoteItem.new(collection_note_id: id,
|
|
@@ -26,7 +26,11 @@ module NextSges
|
|
|
26
26
|
end
|
|
27
27
|
|
|
28
28
|
def receive_value
|
|
29
|
-
collection_notes.where(status: 2).sum(:value)
|
|
29
|
+
collection_notes.by_month.by_year.where(status: 2).sum(:value)
|
|
30
|
+
end
|
|
31
|
+
|
|
32
|
+
def expected_value
|
|
33
|
+
collection_notes.by_month.by_year.sum(:value)
|
|
30
34
|
end
|
|
31
35
|
|
|
32
36
|
validates_presence_of :name, :number
|
data/lib/next_sges/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: next_sges
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.2.
|
|
4
|
+
version: 0.2.4
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- NEXTBSS
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2018-03-
|
|
11
|
+
date: 2018-03-22 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: rails
|