next_sges 0.1.0
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 +7 -0
- data/MIT-LICENSE +20 -0
- data/README.md +28 -0
- data/Rakefile +36 -0
- data/app/assets/config/next_sges_manifest.js +2 -0
- data/app/assets/javascripts/next_sges/administrators.js +2 -0
- data/app/assets/javascripts/next_sges/application.js +13 -0
- data/app/assets/javascripts/next_sges/collection_note_items.js +2 -0
- data/app/assets/javascripts/next_sges/collection_notes.js +2 -0
- data/app/assets/javascripts/next_sges/collection_types.js +2 -0
- data/app/assets/javascripts/next_sges/deposits.js +2 -0
- data/app/assets/javascripts/next_sges/inscriptions.js +2 -0
- data/app/assets/javascripts/next_sges/parents.js +2 -0
- data/app/assets/javascripts/next_sges/responsible_others.js +2 -0
- data/app/assets/javascripts/next_sges/school_admins.js +2 -0
- data/app/assets/javascripts/next_sges/schools.js +2 -0
- data/app/assets/javascripts/next_sges/students.js +2 -0
- data/app/assets/stylesheets/next_sges/administrators.css +4 -0
- data/app/assets/stylesheets/next_sges/application.css +15 -0
- data/app/assets/stylesheets/next_sges/collection_note_items.css +4 -0
- data/app/assets/stylesheets/next_sges/collection_notes.css +4 -0
- data/app/assets/stylesheets/next_sges/collection_types.css +4 -0
- data/app/assets/stylesheets/next_sges/deposits.css +4 -0
- data/app/assets/stylesheets/next_sges/inscriptions.css +4 -0
- data/app/assets/stylesheets/next_sges/parents.css +4 -0
- data/app/assets/stylesheets/next_sges/responsible_others.css +4 -0
- data/app/assets/stylesheets/next_sges/school_admins.css +4 -0
- data/app/assets/stylesheets/next_sges/schools.css +4 -0
- data/app/assets/stylesheets/next_sges/students.css +4 -0
- data/app/assets/stylesheets/scaffold.css +80 -0
- data/app/controllers/next_sges/administrators_controller.rb +62 -0
- data/app/controllers/next_sges/application_controller.rb +5 -0
- data/app/controllers/next_sges/collection_note_items_controller.rb +62 -0
- data/app/controllers/next_sges/collection_notes_controller.rb +62 -0
- data/app/controllers/next_sges/collection_types_controller.rb +62 -0
- data/app/controllers/next_sges/deposits_controller.rb +62 -0
- data/app/controllers/next_sges/inscriptions_controller.rb +62 -0
- data/app/controllers/next_sges/parents_controller.rb +62 -0
- data/app/controllers/next_sges/responsible_others_controller.rb +62 -0
- data/app/controllers/next_sges/school_admins_controller.rb +62 -0
- data/app/controllers/next_sges/schools_controller.rb +62 -0
- data/app/controllers/next_sges/students_controller.rb +62 -0
- data/app/helpers/next_sges/administrators_helper.rb +4 -0
- data/app/helpers/next_sges/application_helper.rb +4 -0
- data/app/helpers/next_sges/collection_note_items_helper.rb +4 -0
- data/app/helpers/next_sges/collection_notes_helper.rb +4 -0
- data/app/helpers/next_sges/collection_types_helper.rb +4 -0
- data/app/helpers/next_sges/deposits_helper.rb +4 -0
- data/app/helpers/next_sges/inscriptions_helper.rb +4 -0
- data/app/helpers/next_sges/parents_helper.rb +4 -0
- data/app/helpers/next_sges/responsible_others_helper.rb +4 -0
- data/app/helpers/next_sges/school_admins_helper.rb +4 -0
- data/app/helpers/next_sges/schools_helper.rb +4 -0
- data/app/helpers/next_sges/students_helper.rb +4 -0
- data/app/jobs/next_sges/application_job.rb +4 -0
- data/app/mailers/next_sges/application_mailer.rb +6 -0
- data/app/models/next_sges/administrator.rb +19 -0
- data/app/models/next_sges/application_record.rb +33 -0
- data/app/models/next_sges/collection_note.rb +68 -0
- data/app/models/next_sges/collection_note_item.rb +173 -0
- data/app/models/next_sges/collection_type.rb +36 -0
- data/app/models/next_sges/deposit.rb +31 -0
- data/app/models/next_sges/inscription.rb +5 -0
- data/app/models/next_sges/parent.rb +37 -0
- data/app/models/next_sges/responsible_other.rb +20 -0
- data/app/models/next_sges/school.rb +21 -0
- data/app/models/next_sges/school_admin.rb +10 -0
- data/app/models/next_sges/student.rb +39 -0
- data/app/views/layouts/next_sges/application.html.erb +14 -0
- data/app/views/next_sges/administrators/_form.html.erb +27 -0
- data/app/views/next_sges/administrators/edit.html.erb +6 -0
- data/app/views/next_sges/administrators/index.html.erb +29 -0
- data/app/views/next_sges/administrators/new.html.erb +5 -0
- data/app/views/next_sges/administrators/show.html.erb +14 -0
- data/app/views/next_sges/collection_note_items/_form.html.erb +107 -0
- data/app/views/next_sges/collection_note_items/edit.html.erb +6 -0
- data/app/views/next_sges/collection_note_items/index.html.erb +61 -0
- data/app/views/next_sges/collection_note_items/new.html.erb +5 -0
- data/app/views/next_sges/collection_note_items/show.html.erb +94 -0
- data/app/views/next_sges/collection_notes/_form.html.erb +37 -0
- data/app/views/next_sges/collection_notes/edit.html.erb +6 -0
- data/app/views/next_sges/collection_notes/index.html.erb +33 -0
- data/app/views/next_sges/collection_notes/new.html.erb +5 -0
- data/app/views/next_sges/collection_notes/show.html.erb +24 -0
- data/app/views/next_sges/collection_types/_form.html.erb +37 -0
- data/app/views/next_sges/collection_types/edit.html.erb +6 -0
- data/app/views/next_sges/collection_types/index.html.erb +33 -0
- data/app/views/next_sges/collection_types/new.html.erb +5 -0
- data/app/views/next_sges/collection_types/show.html.erb +24 -0
- data/app/views/next_sges/deposits/_form.html.erb +37 -0
- data/app/views/next_sges/deposits/edit.html.erb +6 -0
- data/app/views/next_sges/deposits/index.html.erb +33 -0
- data/app/views/next_sges/deposits/new.html.erb +5 -0
- data/app/views/next_sges/deposits/show.html.erb +24 -0
- data/app/views/next_sges/inscriptions/_form.html.erb +102 -0
- data/app/views/next_sges/inscriptions/edit.html.erb +6 -0
- data/app/views/next_sges/inscriptions/index.html.erb +59 -0
- data/app/views/next_sges/inscriptions/new.html.erb +5 -0
- data/app/views/next_sges/inscriptions/show.html.erb +89 -0
- data/app/views/next_sges/parents/_form.html.erb +42 -0
- data/app/views/next_sges/parents/edit.html.erb +6 -0
- data/app/views/next_sges/parents/index.html.erb +35 -0
- data/app/views/next_sges/parents/new.html.erb +5 -0
- data/app/views/next_sges/parents/show.html.erb +29 -0
- data/app/views/next_sges/responsible_others/_form.html.erb +97 -0
- data/app/views/next_sges/responsible_others/edit.html.erb +6 -0
- data/app/views/next_sges/responsible_others/index.html.erb +57 -0
- data/app/views/next_sges/responsible_others/new.html.erb +5 -0
- data/app/views/next_sges/responsible_others/show.html.erb +84 -0
- data/app/views/next_sges/school_admins/_form.html.erb +32 -0
- data/app/views/next_sges/school_admins/edit.html.erb +6 -0
- data/app/views/next_sges/school_admins/index.html.erb +31 -0
- data/app/views/next_sges/school_admins/new.html.erb +5 -0
- data/app/views/next_sges/school_admins/show.html.erb +19 -0
- data/app/views/next_sges/schools/_form.html.erb +62 -0
- data/app/views/next_sges/schools/edit.html.erb +6 -0
- data/app/views/next_sges/schools/index.html.erb +43 -0
- data/app/views/next_sges/schools/new.html.erb +5 -0
- data/app/views/next_sges/schools/show.html.erb +49 -0
- data/app/views/next_sges/students/_form.html.erb +42 -0
- data/app/views/next_sges/students/edit.html.erb +6 -0
- data/app/views/next_sges/students/index.html.erb +35 -0
- data/app/views/next_sges/students/new.html.erb +5 -0
- data/app/views/next_sges/students/show.html.erb +29 -0
- data/config/routes.rb +13 -0
- data/db/migrate/20171209090042_create_next_sges_schools.rb +17 -0
- data/db/migrate/20171209093554_create_next_sges_parents.rb +17 -0
- data/db/migrate/20171209093716_create_next_sges_collection_types.rb +13 -0
- data/db/migrate/20171209095546_create_next_sges_students.rb +17 -0
- data/db/migrate/20171209100114_create_next_sges_collection_notes.rb +14 -0
- data/db/migrate/20171209104046_create_next_sges_deposits.rb +13 -0
- data/db/migrate/20171209110844_create_next_sges_administrators.rb +10 -0
- data/db/migrate/20171209111036_create_next_sges_school_admins.rb +12 -0
- data/db/migrate/20171209213002_create_next_sges_inscriptions.rb +25 -0
- data/db/migrate/20171209213302_create_join_table_inscription_collection_type.rb +8 -0
- data/db/migrate/20171211132659_create_join_table_student_collection_type.rb +8 -0
- data/db/migrate/20171211140033_add_value_to_collection_types.rb +5 -0
- data/db/migrate/20171213141321_create_next_sges_collection_note_items.rb +26 -0
- data/db/migrate/20171213160012_add_discount_ad_fine_to_collection_type.rb +13 -0
- data/db/migrate/20171214154917_rename_anual_payment_discount_from_next_sges_collection_types.rb +5 -0
- data/db/migrate/20171214204406_add_account_balance_to_next_sges_parents.rb +17 -0
- data/db/migrate/20171215120306_remove_student_from_deposit.rb +6 -0
- data/db/migrate/20171215133634_add_type_to_next_sges_deposits.rb +5 -0
- data/db/migrate/20171215144509_add_documents_to_next_sgad_parents.rb +6 -0
- data/db/migrate/20171215175025_add_avatar_to_next_sges_schools.rb +5 -0
- data/db/migrate/20171218082424_add_nif_to_next_sges_schools.rb +11 -0
- data/db/migrate/20171221224739_create_next_sges_responsible_others.rb +24 -0
- data/db/migrate/20171227221731_add_birthday_to_next_sgad_students.rb +7 -0
- data/db/migrate/20180216140129_add_collection_note_to_deposits.rb +5 -0
- data/lib/next_sges.rb +5 -0
- data/lib/next_sges/engine.rb +5 -0
- data/lib/next_sges/version.rb +3 -0
- data/lib/tasks/next_sges_tasks.rake +4 -0
- metadata +224 -0
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
module NextSges
|
|
2
|
+
class CollectionType < NextSges::ApplicationRecord
|
|
3
|
+
# BEGIN relations enumns and scopes do
|
|
4
|
+
belongs_to :school
|
|
5
|
+
has_and_belongs_to_many :students, association_foreign_key: :next_sges_student_id, foreign_key: :next_sges_collection_type_id
|
|
6
|
+
|
|
7
|
+
enum frequency: {no_frequency: 0, daily: 1, monthly: 30, annual: 365}
|
|
8
|
+
enum category: {others: 0, tuition: 1, food: 2, transport: 3, uniform: 4, component_support_family: 5}
|
|
9
|
+
enum status: {inactive: 0, active: 1}
|
|
10
|
+
# END
|
|
11
|
+
|
|
12
|
+
# BEGIN instance methods
|
|
13
|
+
def map_for_select(method_name = :name)
|
|
14
|
+
super(:name)
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
def map_for_filter(method_name = :name)
|
|
18
|
+
map_for_select(:name)
|
|
19
|
+
end
|
|
20
|
+
# END
|
|
21
|
+
|
|
22
|
+
# BEGIN class methods
|
|
23
|
+
# END
|
|
24
|
+
|
|
25
|
+
# BEGIN Validations
|
|
26
|
+
validates_presence_of :name, :value, :frequency, :category, :school_id, :status
|
|
27
|
+
validates_uniqueness_of :name
|
|
28
|
+
validates :value, numericality: {greater_than: 0}
|
|
29
|
+
validates :first_fine_percentage, :first_fine_after, :second_fine_percentage, :second_fine_after, :second_child_discount, :third_child_discount, :annual_payment_discount, numericality: {greater_then_or_equal: 0}
|
|
30
|
+
# END
|
|
31
|
+
|
|
32
|
+
# BEGIN Validation methods
|
|
33
|
+
# END
|
|
34
|
+
|
|
35
|
+
end
|
|
36
|
+
end
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
module NextSges
|
|
2
|
+
class Deposit < NextSges::ApplicationRecord
|
|
3
|
+
belongs_to :parent
|
|
4
|
+
belongs_to :school
|
|
5
|
+
belongs_to :collection_note, optional: true
|
|
6
|
+
|
|
7
|
+
enum status: {deposited: 0} #, deposited: 1, denied: 2}
|
|
8
|
+
enum mode: {cash: 0, bank_transfer: 1, wire_transfer: 2, atm_card: 3, atm: 4} #, deposited: 1, denied: 2}
|
|
9
|
+
|
|
10
|
+
INITIAL_LETTER = "D"
|
|
11
|
+
|
|
12
|
+
validates_presence_of :value, :school_id
|
|
13
|
+
validates_numericality_of :value, greater_than: 0
|
|
14
|
+
|
|
15
|
+
before_create :create_number
|
|
16
|
+
after_create :increase_parent_balance
|
|
17
|
+
after_destroy :decrease_parent_balance
|
|
18
|
+
|
|
19
|
+
private
|
|
20
|
+
def increase_parent_balance
|
|
21
|
+
encharged = parent
|
|
22
|
+
encharged.update_columns(account_balance: encharged.account_balance + value)
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
def decrease_parent_balance
|
|
26
|
+
encharged = parent
|
|
27
|
+
encharged.update_columns(account_balance: encharged.account_balance - value)
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
end
|
|
31
|
+
end
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
module NextSges
|
|
2
|
+
class Parent < NextSges::ApplicationRecord
|
|
3
|
+
belongs_to :school
|
|
4
|
+
has_many :students
|
|
5
|
+
has_many :deposits
|
|
6
|
+
enum identification_type: DEFAULT_IDENTIFICATION_ENUM
|
|
7
|
+
INITIAL_LETTER = "E"
|
|
8
|
+
|
|
9
|
+
def first_and_last_name
|
|
10
|
+
"#{first_name} #{last_name}"
|
|
11
|
+
end
|
|
12
|
+
|
|
13
|
+
def full_name
|
|
14
|
+
"#{first_name} #{middle_name} #{last_name}"
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
def map_for_select(method_name = :first_and_last_name)
|
|
18
|
+
super(:first_and_last_name)
|
|
19
|
+
end
|
|
20
|
+
|
|
21
|
+
def map_for_filter(method_name = :first_and_last_name)
|
|
22
|
+
super(:first_and_last_name)
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
def students_number
|
|
26
|
+
students.size
|
|
27
|
+
end
|
|
28
|
+
|
|
29
|
+
def name_and_number
|
|
30
|
+
"#{number} - #{first_and_last_name}"
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
validates_uniqueness_of :email, scope: [:school_id], if:->(f){f.email.present?}
|
|
34
|
+
validates_uniqueness_of :cellphone1, scope: [:school_id], if:->(f){f.cellphone1.present?}
|
|
35
|
+
before_create :create_number
|
|
36
|
+
end
|
|
37
|
+
end
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
module NextSges
|
|
2
|
+
class ResponsibleOther < NextSges::ApplicationRecord
|
|
3
|
+
belongs_to :parent
|
|
4
|
+
belongs_to :school
|
|
5
|
+
INITIAL_LETTER = "O"
|
|
6
|
+
enum status: DEFAULT_STATUS_ENUM
|
|
7
|
+
enum identification_type: DEFAULT_IDENTIFICATION_ENUM
|
|
8
|
+
enum relation_to_parent: {other: 0, wife: 1, husband: 2, brother: 3, sister: 4, driver: 5, security: 6, maid: 7}
|
|
9
|
+
def first_and_last_name
|
|
10
|
+
"#{first_name} #{last_name}"
|
|
11
|
+
end
|
|
12
|
+
|
|
13
|
+
def name_and_number
|
|
14
|
+
"#{number} - #{first_and_last_name}"
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
validates_presence_of :school_id, :parent_id, :status, :identification_type, :relation_to_parent
|
|
18
|
+
before_create :create_number
|
|
19
|
+
end
|
|
20
|
+
end
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
module NextSges
|
|
2
|
+
class School < NextSges::ApplicationRecord
|
|
3
|
+
has_many :parents, dependent: :destroy
|
|
4
|
+
has_many :students, dependent: :destroy
|
|
5
|
+
has_many :collection_types, dependent: :destroy
|
|
6
|
+
has_many :collection_notes, dependent: :destroy
|
|
7
|
+
has_many :collection_note_items, dependent: :destroy
|
|
8
|
+
has_many :deposits, dependent: :destroy
|
|
9
|
+
has_many :responsible_others, dependent: :destroy
|
|
10
|
+
INITIAL_LETTER = "C"
|
|
11
|
+
|
|
12
|
+
def name_and_number
|
|
13
|
+
"#{number} - #{name}"
|
|
14
|
+
end
|
|
15
|
+
|
|
16
|
+
validates_presence_of :name, :number
|
|
17
|
+
validates_uniqueness_of :name, :number
|
|
18
|
+
validates_format_of :email, :with => MAIL_REGEX
|
|
19
|
+
#validates_format_of :phone, :with => CELL_REGEX
|
|
20
|
+
end
|
|
21
|
+
end
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
module NextSges
|
|
2
|
+
class SchoolAdmin < NextSges::ApplicationRecord
|
|
3
|
+
belongs_to :user, polymorphic: true
|
|
4
|
+
belongs_to :school
|
|
5
|
+
INITIAL_LETTER = "S"
|
|
6
|
+
before_create :create_number
|
|
7
|
+
validates_presence_of :user_id, :school_id
|
|
8
|
+
validates_uniqueness_of :user_id, scope: [:user_type, :school_id]
|
|
9
|
+
end
|
|
10
|
+
end
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
module NextSges
|
|
2
|
+
class Student < NextSges::ApplicationRecord
|
|
3
|
+
belongs_to :parent, optional: true
|
|
4
|
+
belongs_to :school
|
|
5
|
+
has_and_belongs_to_many :collection_types, association_foreign_key: :next_sges_collection_type_id, foreign_key: :next_sges_student_id
|
|
6
|
+
enum relation: {son: 0, other: 1}
|
|
7
|
+
enum identification_type: DEFAULT_IDENTIFICATION_ENUM
|
|
8
|
+
|
|
9
|
+
attr_accessor :aux_types_ids
|
|
10
|
+
INITIAL_LETTER = "A"
|
|
11
|
+
|
|
12
|
+
def first_and_last_name
|
|
13
|
+
"#{first_name} #{last_name}"
|
|
14
|
+
end
|
|
15
|
+
|
|
16
|
+
def full_name
|
|
17
|
+
"#{first_name} #{middle_name} #{last_name}"
|
|
18
|
+
end
|
|
19
|
+
|
|
20
|
+
def name_and_number
|
|
21
|
+
"#{number} - #{first_and_last_name}"
|
|
22
|
+
end
|
|
23
|
+
|
|
24
|
+
# validates_presence_of :parent_id
|
|
25
|
+
validate :student_services
|
|
26
|
+
before_create :create_number
|
|
27
|
+
|
|
28
|
+
private
|
|
29
|
+
# checks if all collection_types added to the student have distinct categories
|
|
30
|
+
def student_services
|
|
31
|
+
types = collection_types
|
|
32
|
+
errors_messages = []
|
|
33
|
+
types.group_by{|c| c.category}.each{|category, services| errors_messages << "O serviço #{services.last.enum_t(:category)} tem mais de uma opção seleccionada"}
|
|
34
|
+
errors_messages.each do |err|
|
|
35
|
+
#errors.add(:aux_types_ids, err)
|
|
36
|
+
end
|
|
37
|
+
end
|
|
38
|
+
end
|
|
39
|
+
end
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html>
|
|
3
|
+
<head>
|
|
4
|
+
<title>Next sges</title>
|
|
5
|
+
<%= stylesheet_link_tag "next_sges/application", media: "all" %>
|
|
6
|
+
<%= javascript_include_tag "next_sges/application" %>
|
|
7
|
+
<%= csrf_meta_tags %>
|
|
8
|
+
</head>
|
|
9
|
+
<body>
|
|
10
|
+
|
|
11
|
+
<%= yield %>
|
|
12
|
+
|
|
13
|
+
</body>
|
|
14
|
+
</html>
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
<%= form_with(model: administrator, local: true) do |form| %>
|
|
2
|
+
<% if administrator.errors.any? %>
|
|
3
|
+
<div id="error_explanation">
|
|
4
|
+
<h2><%= pluralize(administrator.errors.count, "error") %> prohibited this administrator from being saved:</h2>
|
|
5
|
+
|
|
6
|
+
<ul>
|
|
7
|
+
<% administrator.errors.full_messages.each do |message| %>
|
|
8
|
+
<li><%= message %></li>
|
|
9
|
+
<% end %>
|
|
10
|
+
</ul>
|
|
11
|
+
</div>
|
|
12
|
+
<% end %>
|
|
13
|
+
|
|
14
|
+
<div class="field">
|
|
15
|
+
<%= form.label :number %>
|
|
16
|
+
<%= form.text_field :number, id: :administrator_number %>
|
|
17
|
+
</div>
|
|
18
|
+
|
|
19
|
+
<div class="field">
|
|
20
|
+
<%= form.label :user_id %>
|
|
21
|
+
<%= form.text_field :user_id, id: :administrator_user_id %>
|
|
22
|
+
</div>
|
|
23
|
+
|
|
24
|
+
<div class="actions">
|
|
25
|
+
<%= form.submit %>
|
|
26
|
+
</div>
|
|
27
|
+
<% end %>
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
<p id="notice"><%= notice %></p>
|
|
2
|
+
|
|
3
|
+
<h1>Administrators</h1>
|
|
4
|
+
|
|
5
|
+
<table>
|
|
6
|
+
<thead>
|
|
7
|
+
<tr>
|
|
8
|
+
<th>Number</th>
|
|
9
|
+
<th>User</th>
|
|
10
|
+
<th colspan="3"></th>
|
|
11
|
+
</tr>
|
|
12
|
+
</thead>
|
|
13
|
+
|
|
14
|
+
<tbody>
|
|
15
|
+
<% @administrators.each do |administrator| %>
|
|
16
|
+
<tr>
|
|
17
|
+
<td><%= administrator.number %></td>
|
|
18
|
+
<td><%= administrator.user %></td>
|
|
19
|
+
<td><%= link_to 'Show', administrator %></td>
|
|
20
|
+
<td><%= link_to 'Edit', edit_administrator_path(administrator) %></td>
|
|
21
|
+
<td><%= link_to 'Destroy', administrator, method: :delete, data: { confirm: 'Are you sure?' } %></td>
|
|
22
|
+
</tr>
|
|
23
|
+
<% end %>
|
|
24
|
+
</tbody>
|
|
25
|
+
</table>
|
|
26
|
+
|
|
27
|
+
<br>
|
|
28
|
+
|
|
29
|
+
<%= link_to 'New Administrator', new_administrator_path %>
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
<p id="notice"><%= notice %></p>
|
|
2
|
+
|
|
3
|
+
<p>
|
|
4
|
+
<strong>Number:</strong>
|
|
5
|
+
<%= @administrator.number %>
|
|
6
|
+
</p>
|
|
7
|
+
|
|
8
|
+
<p>
|
|
9
|
+
<strong>User:</strong>
|
|
10
|
+
<%= @administrator.user %>
|
|
11
|
+
</p>
|
|
12
|
+
|
|
13
|
+
<%= link_to 'Edit', edit_administrator_path(@administrator) %> |
|
|
14
|
+
<%= link_to 'Back', administrators_path %>
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
<%= form_with(model: collection_note_item, local: true) do |form| %>
|
|
2
|
+
<% if collection_note_item.errors.any? %>
|
|
3
|
+
<div id="error_explanation">
|
|
4
|
+
<h2><%= pluralize(collection_note_item.errors.count, "error") %> prohibited this collection_note_item from being saved:</h2>
|
|
5
|
+
|
|
6
|
+
<ul>
|
|
7
|
+
<% collection_note_item.errors.full_messages.each do |message| %>
|
|
8
|
+
<li><%= message %></li>
|
|
9
|
+
<% end %>
|
|
10
|
+
</ul>
|
|
11
|
+
</div>
|
|
12
|
+
<% end %>
|
|
13
|
+
|
|
14
|
+
<div class="field">
|
|
15
|
+
<%= form.label :name %>
|
|
16
|
+
<%= form.text_field :name, id: :collection_note_item_name %>
|
|
17
|
+
</div>
|
|
18
|
+
|
|
19
|
+
<div class="field">
|
|
20
|
+
<%= form.label :description %>
|
|
21
|
+
<%= form.text_area :description, id: :collection_note_item_description %>
|
|
22
|
+
</div>
|
|
23
|
+
|
|
24
|
+
<div class="field">
|
|
25
|
+
<%= form.label :base_value %>
|
|
26
|
+
<%= form.text_field :base_value, id: :collection_note_item_base_value %>
|
|
27
|
+
</div>
|
|
28
|
+
|
|
29
|
+
<div class="field">
|
|
30
|
+
<%= form.label :value %>
|
|
31
|
+
<%= form.text_field :value, id: :collection_note_item_value %>
|
|
32
|
+
</div>
|
|
33
|
+
|
|
34
|
+
<div class="field">
|
|
35
|
+
<%= form.label :quantity %>
|
|
36
|
+
<%= form.number_field :quantity, id: :collection_note_item_quantity %>
|
|
37
|
+
</div>
|
|
38
|
+
|
|
39
|
+
<div class="field">
|
|
40
|
+
<%= form.label :collection_note_id %>
|
|
41
|
+
<%= form.text_field :collection_note_id, id: :collection_note_item_collection_note_id %>
|
|
42
|
+
</div>
|
|
43
|
+
|
|
44
|
+
<div class="field">
|
|
45
|
+
<%= form.label :date %>
|
|
46
|
+
<%= form.datetime_select :date, id: :collection_note_item_date %>
|
|
47
|
+
</div>
|
|
48
|
+
|
|
49
|
+
<div class="field">
|
|
50
|
+
<%= form.label :collection_type_id %>
|
|
51
|
+
<%= form.text_field :collection_type_id, id: :collection_note_item_collection_type_id %>
|
|
52
|
+
</div>
|
|
53
|
+
|
|
54
|
+
<div class="field">
|
|
55
|
+
<%= form.label :discount_description %>
|
|
56
|
+
<%= form.text_field :discount_description, id: :collection_note_item_discount_description %>
|
|
57
|
+
</div>
|
|
58
|
+
|
|
59
|
+
<div class="field">
|
|
60
|
+
<%= form.label :discount_percentage %>
|
|
61
|
+
<%= form.text_field :discount_percentage, id: :collection_note_item_discount_percentage %>
|
|
62
|
+
</div>
|
|
63
|
+
|
|
64
|
+
<div class="field">
|
|
65
|
+
<%= form.label :discount_value %>
|
|
66
|
+
<%= form.text_field :discount_value, id: :collection_note_item_discount_value %>
|
|
67
|
+
</div>
|
|
68
|
+
|
|
69
|
+
<div class="field">
|
|
70
|
+
<%= form.label :student_id %>
|
|
71
|
+
<%= form.text_field :student_id, id: :collection_note_item_student_id %>
|
|
72
|
+
</div>
|
|
73
|
+
|
|
74
|
+
<div class="field">
|
|
75
|
+
<%= form.label :fine_description %>
|
|
76
|
+
<%= form.text_field :fine_description, id: :collection_note_item_fine_description %>
|
|
77
|
+
</div>
|
|
78
|
+
|
|
79
|
+
<div class="field">
|
|
80
|
+
<%= form.label :fine_percentage %>
|
|
81
|
+
<%= form.text_field :fine_percentage, id: :collection_note_item_fine_percentage %>
|
|
82
|
+
</div>
|
|
83
|
+
|
|
84
|
+
<div class="field">
|
|
85
|
+
<%= form.label :fine_value %>
|
|
86
|
+
<%= form.text_field :fine_value, id: :collection_note_item_fine_value %>
|
|
87
|
+
</div>
|
|
88
|
+
|
|
89
|
+
<div class="field">
|
|
90
|
+
<%= form.label :collection_type_frequency %>
|
|
91
|
+
<%= form.number_field :collection_type_frequency, id: :collection_note_item_collection_type_frequency %>
|
|
92
|
+
</div>
|
|
93
|
+
|
|
94
|
+
<div class="field">
|
|
95
|
+
<%= form.label :collection_type_category %>
|
|
96
|
+
<%= form.number_field :collection_type_category, id: :collection_note_item_collection_type_category %>
|
|
97
|
+
</div>
|
|
98
|
+
|
|
99
|
+
<div class="field">
|
|
100
|
+
<%= form.label :school_id %>
|
|
101
|
+
<%= form.text_field :school_id, id: :collection_note_item_school_id %>
|
|
102
|
+
</div>
|
|
103
|
+
|
|
104
|
+
<div class="actions">
|
|
105
|
+
<%= form.submit %>
|
|
106
|
+
</div>
|
|
107
|
+
<% end %>
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
<p id="notice"><%= notice %></p>
|
|
2
|
+
|
|
3
|
+
<h1>Collection Note Items</h1>
|
|
4
|
+
|
|
5
|
+
<table>
|
|
6
|
+
<thead>
|
|
7
|
+
<tr>
|
|
8
|
+
<th>Name</th>
|
|
9
|
+
<th>Description</th>
|
|
10
|
+
<th>Base value</th>
|
|
11
|
+
<th>Value</th>
|
|
12
|
+
<th>Quantity</th>
|
|
13
|
+
<th>Collection note</th>
|
|
14
|
+
<th>Date</th>
|
|
15
|
+
<th>Collection type</th>
|
|
16
|
+
<th>Discount description</th>
|
|
17
|
+
<th>Discount percentage</th>
|
|
18
|
+
<th>Discount value</th>
|
|
19
|
+
<th>Student</th>
|
|
20
|
+
<th>Fine description</th>
|
|
21
|
+
<th>Fine percentage</th>
|
|
22
|
+
<th>Fine value</th>
|
|
23
|
+
<th>Collection type frequency</th>
|
|
24
|
+
<th>Collection type category</th>
|
|
25
|
+
<th>School</th>
|
|
26
|
+
<th colspan="3"></th>
|
|
27
|
+
</tr>
|
|
28
|
+
</thead>
|
|
29
|
+
|
|
30
|
+
<tbody>
|
|
31
|
+
<% @collection_note_items.each do |collection_note_item| %>
|
|
32
|
+
<tr>
|
|
33
|
+
<td><%= collection_note_item.name %></td>
|
|
34
|
+
<td><%= collection_note_item.description %></td>
|
|
35
|
+
<td><%= collection_note_item.base_value %></td>
|
|
36
|
+
<td><%= collection_note_item.value %></td>
|
|
37
|
+
<td><%= collection_note_item.quantity %></td>
|
|
38
|
+
<td><%= collection_note_item.collection_note %></td>
|
|
39
|
+
<td><%= collection_note_item.date %></td>
|
|
40
|
+
<td><%= collection_note_item.collection_type %></td>
|
|
41
|
+
<td><%= collection_note_item.discount_description %></td>
|
|
42
|
+
<td><%= collection_note_item.discount_percentage %></td>
|
|
43
|
+
<td><%= collection_note_item.discount_value %></td>
|
|
44
|
+
<td><%= collection_note_item.student %></td>
|
|
45
|
+
<td><%= collection_note_item.fine_description %></td>
|
|
46
|
+
<td><%= collection_note_item.fine_percentage %></td>
|
|
47
|
+
<td><%= collection_note_item.fine_value %></td>
|
|
48
|
+
<td><%= collection_note_item.collection_type_frequency %></td>
|
|
49
|
+
<td><%= collection_note_item.collection_type_category %></td>
|
|
50
|
+
<td><%= collection_note_item.school %></td>
|
|
51
|
+
<td><%= link_to 'Show', collection_note_item %></td>
|
|
52
|
+
<td><%= link_to 'Edit', edit_collection_note_item_path(collection_note_item) %></td>
|
|
53
|
+
<td><%= link_to 'Destroy', collection_note_item, method: :delete, data: { confirm: 'Are you sure?' } %></td>
|
|
54
|
+
</tr>
|
|
55
|
+
<% end %>
|
|
56
|
+
</tbody>
|
|
57
|
+
</table>
|
|
58
|
+
|
|
59
|
+
<br>
|
|
60
|
+
|
|
61
|
+
<%= link_to 'New Collection Note Item', new_collection_note_item_path %>
|