dorsale 3.1.7 → 3.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +15 -0
- data/app/assets/javascripts/dorsale/common/comments.coffee +18 -20
- data/app/assets/javascripts/dorsale/common/datepicker.coffee +1 -1
- data/app/assets/javascripts/dorsale/common/forms.coffee +1 -1
- data/app/assets/javascripts/dorsale/common/modals.coffee +1 -1
- data/app/assets/javascripts/dorsale/common/tabs_loader.coffee +1 -1
- data/app/assets/javascripts/dorsale/common/tags.coffee +1 -1
- data/app/assets/javascripts/dorsale/common/tooltips.coffee +1 -1
- data/app/assets/javascripts/dorsale/dependencies.coffee +2 -0
- data/app/assets/javascripts/dorsale/engines/billing_machine.coffee +1 -1
- data/app/assets/stylesheets/dorsale/all.sass +1 -1
- data/app/assets/stylesheets/dorsale/common/comments.sass +1 -1
- data/app/assets/stylesheets/dorsale/common/filters.sass +16 -1
- data/app/assets/stylesheets/dorsale/common/styles.sass +3 -0
- data/app/assets/stylesheets/dorsale/engines/customer_vault.sass +2 -2
- data/app/assets/stylesheets/dorsale/engines/expense_gun.sass +3 -0
- data/app/assets/stylesheets/dorsale/engines/flyboy.sass +4 -0
- data/app/assets/stylesheets/dorsale/print.sass +73 -0
- data/app/controllers/dorsale/alexandrie/attachments_controller.rb +0 -4
- data/app/controllers/dorsale/application_controller.rb +12 -0
- data/app/controllers/dorsale/billing_machine/application_controller.rb +0 -5
- data/app/controllers/dorsale/billing_machine/id_cards_controller.rb +0 -4
- data/app/controllers/dorsale/billing_machine/invoices_controller.rb +0 -4
- data/app/controllers/dorsale/billing_machine/payment_terms_controller.rb +0 -4
- data/app/controllers/dorsale/billing_machine/quotations_controller.rb +0 -4
- data/app/controllers/dorsale/comments_controller.rb +30 -55
- data/app/controllers/dorsale/customer_vault/links_controller.rb +5 -5
- data/app/controllers/dorsale/customer_vault/people_controller.rb +9 -11
- data/app/controllers/dorsale/expense_gun/categories_controller.rb +0 -4
- data/app/controllers/dorsale/expense_gun/expenses_controller.rb +1 -5
- data/app/controllers/dorsale/flyboy/folders_controller.rb +0 -4
- data/app/controllers/dorsale/flyboy/tasks_controller.rb +0 -4
- data/app/controllers/dorsale/users_controller.rb +7 -11
- data/app/filters/dorsale/billing_machine/small_data/filter_strategy_by_customer.rb +1 -1
- data/app/filters/dorsale/flyboy/small_data/filter_for_tasks.rb +1 -1
- data/app/helpers/dorsale/all_helpers.rb +1 -0
- data/app/helpers/dorsale/billing_machine/application_helper.rb +23 -0
- data/app/helpers/dorsale/comments_helper.rb +14 -2
- data/app/helpers/dorsale/flyboy/application_helper.rb +4 -0
- data/app/helpers/dorsale/text_helper.rb +12 -7
- data/app/libs/dorsale/sortable_uuid_generator.rb +11 -0
- data/app/mailers/dorsale/billing_machine/invoice_mailer.rb +2 -4
- data/app/models/concerns/dorsale/active_record_uuid_concern.rb +15 -0
- data/app/models/concerns/dorsale/default_values_concern.rb +13 -0
- data/app/models/dorsale/alexandrie/attachment.rb +3 -3
- data/app/models/dorsale/application_record.rb +11 -0
- data/app/models/dorsale/billing_machine/invoice.rb +13 -13
- data/app/models/dorsale/billing_machine/invoice_line.rb +3 -9
- data/app/models/dorsale/billing_machine/quotation.rb +6 -12
- data/app/models/dorsale/billing_machine/quotation_line.rb +3 -8
- data/app/models/dorsale/customer_vault/person.rb +5 -4
- data/app/models/dorsale/expense_gun/expense.rb +3 -4
- data/app/models/dorsale/expense_gun/expense_line.rb +4 -5
- data/app/models/dorsale/flyboy/folder.rb +2 -3
- data/app/models/dorsale/flyboy/task.rb +5 -6
- data/app/models/dorsale/flyboy/task_comment.rb +3 -8
- data/app/models/dorsale/users/active.rb +1 -1
- data/app/policies/dorsale/billing_machine/invoice_policy_helper.rb +5 -0
- data/app/policies/dorsale/comment_policy_helper.rb +21 -0
- data/app/serializers/dorsale/serializers/xlsx.rb +13 -2
- data/app/views/dorsale/billing_machine/invoices/_details.html.slim +1 -1
- data/app/views/dorsale/billing_machine/invoices/_filters.html.slim +1 -1
- data/app/views/dorsale/billing_machine/invoices/_form.html.slim +1 -1
- data/app/views/dorsale/billing_machine/invoices/_header_infos.html.slim +9 -4
- data/app/views/dorsale/billing_machine/invoices/_list.html.slim +3 -2
- data/app/views/dorsale/billing_machine/invoices/email.html.slim +6 -0
- data/app/views/dorsale/billing_machine/invoices/index.html.slim +1 -1
- data/app/views/dorsale/billing_machine/invoices/index.xlsx.ruby +41 -0
- data/app/views/dorsale/billing_machine/quotations/_filters.html.slim +1 -1
- data/app/views/dorsale/billing_machine/quotations/_list.html.slim +4 -3
- data/app/views/dorsale/comments/_comment.html.slim +2 -2
- data/app/views/dorsale/comments/_comments.html.slim +5 -0
- data/app/views/dorsale/comments/_form.html.slim +5 -6
- data/app/views/dorsale/comments/_list.html.slim +1 -1
- data/app/views/dorsale/comments/edit.html.slim +1 -1
- data/app/views/dorsale/customer_vault/links/edit.html.slim +13 -17
- data/app/views/dorsale/customer_vault/links/index.html.slim +10 -0
- data/app/views/dorsale/customer_vault/links/new.html.slim +10 -14
- data/app/views/dorsale/customer_vault/people/_actions.html.slim +2 -2
- data/app/views/dorsale/customer_vault/people/_data_context.html.slim +1 -1
- data/app/views/dorsale/customer_vault/people/_index_tabs.html.slim +2 -2
- data/app/views/dorsale/customer_vault/people/_show_layout.html.slim +10 -0
- data/app/views/dorsale/customer_vault/people/_tabs.html.slim +24 -0
- data/app/views/dorsale/customer_vault/people/activity.slim +2 -3
- data/app/views/dorsale/customer_vault/people/edit.html.slim +1 -0
- data/app/views/dorsale/customer_vault/people/index.html.slim +2 -2
- data/app/views/dorsale/customer_vault/people/index.xlsx.ruby +49 -0
- data/app/views/dorsale/customer_vault/people/invoices.html.slim +5 -0
- data/app/views/dorsale/customer_vault/people/show.html.slim +5 -26
- data/app/views/dorsale/customer_vault/people/tasks.html.slim +4 -0
- data/app/views/dorsale/expense_gun/categories/_list.html.slim +4 -1
- data/app/views/dorsale/expense_gun/expenses/_list.html.slim +1 -1
- data/app/views/dorsale/expense_gun/expenses/show.html.slim +3 -3
- data/app/views/dorsale/flyboy/_filters.html.slim +3 -0
- data/app/views/dorsale/flyboy/folders/_form.html.slim +3 -1
- data/app/views/dorsale/flyboy/folders/_list.html.slim +2 -2
- data/app/views/dorsale/flyboy/task_comments/_list.html.slim +2 -2
- data/app/views/dorsale/flyboy/tasks/_form.html.slim +4 -1
- data/app/views/dorsale/flyboy/tasks/_list.html.slim +1 -1
- data/app/views/dorsale/flyboy/tasks/_summary_list.html.slim +6 -5
- data/app/views/dorsale/flyboy/tasks/index.html.slim +2 -4
- data/app/views/dorsale/flyboy/tasks/index.xlsx.ruby +23 -0
- data/app/views/dorsale/flyboy/tasks/summary.html.slim +0 -2
- data/config/locales/common.en.yml +2 -0
- data/config/locales/common.fr.yml +2 -0
- data/config/locales/customer_vault.en.yml +0 -6
- data/config/locales/customer_vault.fr.yml +0 -6
- data/config/locales/flyboy.en.yml +2 -0
- data/config/locales/flyboy.fr.yml +2 -0
- data/config/routes.rb +7 -2
- data/db/migrate/20161118071317_dorsale_add_missing_indexes.rb +25 -0
- data/features/billing_machine_invoices.feature +4 -2
- data/features/customer_vault_invoices.feature +10 -0
- data/features/customer_vault_tasks.feature +1 -1
- data/features/flyboy_tasks.feature +3 -15
- data/features/step_definitions/billing_machine_invoices_steps.rb +2 -6
- data/features/step_definitions/billing_machine_quotations_steps.rb +5 -5
- data/features/step_definitions/common_steps.rb +7 -1
- data/features/step_definitions/customer_vault_corporations_steps.rb +7 -7
- data/features/step_definitions/customer_vault_filters_steps.rb +3 -3
- data/features/step_definitions/customer_vault_individuals_steps.rb +1 -1
- data/features/step_definitions/customer_vault_invoices_steps.rb +7 -0
- data/features/step_definitions/customer_vault_links_steps.rb +5 -3
- data/features/step_definitions/customer_vault_people_steps.rb +1 -1
- data/features/step_definitions/customer_vault_search_steps.rb +4 -4
- data/features/step_definitions/customer_vault_tasks_steps.rb +6 -16
- data/features/step_definitions/expense_gun_expenses_steps.rb +2 -2
- data/features/step_definitions/flyboy_folders_steps.rb +5 -5
- data/features/step_definitions/flyboy_tasks_steps.rb +5 -29
- data/lib/dorsale/engine.rb +6 -1
- data/lib/dorsale/polymorphic_id.rb +1 -1
- data/lib/dorsale/version.rb +1 -1
- data/spec/controllers/dorsale/billing_machine/invoices_controller_spec.rb +3 -4
- data/spec/controllers/dorsale/comments_controller_spec.rb +3 -3
- data/spec/controllers/dorsale/expense_gun/expenses_controller_spec.rb +10 -0
- data/spec/controllers/dorsale/flyboy/tasks_controller_spec.rb +1 -13
- data/spec/factories/dorsale_comments.rb +3 -3
- data/spec/helpers/dorsale/text_helper_spec.rb +15 -0
- data/spec/{lib → libs}/active_record_comma_type_cast_spec.rb +0 -0
- data/spec/{lib → libs/dorsale}/polymorphic_id_spec.rb +0 -0
- data/spec/libs/dorsale/sortable_uuid_generator_spec.rb +29 -0
- data/spec/rails_helper.rb +2 -0
- data/spec/routing/dorsale/customer_vault/people_routing_spec.rb +15 -0
- metadata +54 -18
- data/app/pdfs/dorsale/flyboy/roadmap.rb +0 -47
- data/app/views/dorsale/billing_machine/invoices/index.csv.ruby +0 -46
- data/app/views/dorsale/comments/_loader.html.slim +0 -5
- data/app/views/dorsale/comments/index.html.slim +0 -11
- data/app/views/dorsale/customer_vault/people/_activity_tab.html.slim +0 -4
- data/app/views/dorsale/customer_vault/people/_comment.html.slim +0 -1
- data/app/views/dorsale/customer_vault/people/_links_tab.html.slim +0 -7
- data/app/views/dorsale/customer_vault/people/_tasks_tab.html.slim +0 -1
- data/app/views/dorsale/customer_vault/people/index.xls.slim +0 -24
- data/app/views/dorsale/flyboy/tasks/index.csv.ruby +0 -24
- data/app/views/dorsale/flyboy/tasks/index.pdf.ruby +0 -6
- data/app/views/dorsale/flyboy/tasks/index.xls.erb +0 -29
@@ -28,16 +28,8 @@ class Dorsale::BillingMachine::Quotation < ::Dorsale::ApplicationRecord
|
|
28
28
|
order(unique_index: :desc)
|
29
29
|
}
|
30
30
|
|
31
|
-
def initialize(*)
|
32
|
-
super
|
33
|
-
self.state = STATES.first if state.nil?
|
34
|
-
self.date = Time.zone.now.to_date if date.nil?
|
35
|
-
assign_default_values
|
36
|
-
end
|
37
|
-
|
38
31
|
before_create :assign_unique_index
|
39
32
|
before_create :assign_tracking_id
|
40
|
-
before_validation :assign_default_values
|
41
33
|
|
42
34
|
def assign_unique_index
|
43
35
|
if unique_index.nil?
|
@@ -50,10 +42,12 @@ class Dorsale::BillingMachine::Quotation < ::Dorsale::ApplicationRecord
|
|
50
42
|
end
|
51
43
|
|
52
44
|
def assign_default_values
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
45
|
+
assign_default :state, STATES.first
|
46
|
+
assign_default :date, Time.zone.now.to_date
|
47
|
+
assign_default :expires_at, date + 1.month
|
48
|
+
assign_default :commercial_discount, 0
|
49
|
+
assign_default :vat_amount, 0
|
50
|
+
assign_default :total_excluding_taxes, 0
|
57
51
|
end
|
58
52
|
|
59
53
|
before_save :update_totals
|
@@ -9,17 +9,12 @@ class Dorsale::BillingMachine::QuotationLine < ::Dorsale::ApplicationRecord
|
|
9
9
|
order(:created_at => :asc)
|
10
10
|
}
|
11
11
|
|
12
|
-
def initialize(*)
|
13
|
-
super
|
14
|
-
assign_default_values
|
15
|
-
end
|
16
|
-
|
17
12
|
before_validation :update_total
|
18
13
|
|
19
14
|
def assign_default_values
|
20
|
-
|
21
|
-
|
22
|
-
|
15
|
+
assign_default :quantity, 0
|
16
|
+
assign_default :unit_price, 0
|
17
|
+
assign_default :vat_rate, ::Dorsale::BillingMachine::DEFAULT_VAT_RATE
|
23
18
|
end
|
24
19
|
|
25
20
|
def update_total
|
@@ -11,20 +11,21 @@ class Dorsale::CustomerVault::Person < ::Dorsale::ApplicationRecord
|
|
11
11
|
Dorsale::CustomerVault::PersonPolicy
|
12
12
|
end
|
13
13
|
|
14
|
-
|
14
|
+
after_initialize :verify_class
|
15
|
+
|
16
|
+
def verify_class
|
15
17
|
if self.class == ::Dorsale::CustomerVault::Person
|
16
18
|
# self.abstract_class does not work with STI
|
17
19
|
raise "Cannot directly instantiate Person class"
|
18
|
-
else
|
19
|
-
super
|
20
20
|
end
|
21
21
|
end
|
22
22
|
|
23
23
|
acts_as_taggable
|
24
24
|
|
25
|
-
has_many :comments, -> { order(id: :desc) }, class_name: ::Dorsale::Comment, as: :commentable, dependent: :destroy
|
25
|
+
has_many :comments, -> { order(created_at: :desc, id: :desc) }, class_name: ::Dorsale::Comment, as: :commentable, dependent: :destroy
|
26
26
|
has_one :address, class_name: ::Dorsale::Address, as: :addressable, inverse_of: :addressable, dependent: :destroy
|
27
27
|
has_many :tasks, class_name: ::Dorsale::Flyboy::Task, as: :taskable, dependent: :destroy
|
28
|
+
has_many :invoices, class_name: ::Dorsale::BillingMachine::Invoice, as: :customer
|
28
29
|
accepts_nested_attributes_for :address, allow_destroy: true
|
29
30
|
|
30
31
|
after_destroy :destroy_links
|
@@ -20,12 +20,11 @@ class Dorsale::ExpenseGun::Expense < ::Dorsale::ApplicationRecord
|
|
20
20
|
:reject_if => proc { |attr| attr["name"].blank? }
|
21
21
|
|
22
22
|
default_scope -> {
|
23
|
-
order(id: :desc)
|
23
|
+
order(created_at: :desc, id: :desc)
|
24
24
|
}
|
25
25
|
|
26
|
-
def
|
27
|
-
|
28
|
-
self.date = Time.zone.now.to_date if self.date.nil?
|
26
|
+
def assign_default_values
|
27
|
+
assign_default :date, Time.zone.now.to_date
|
29
28
|
end
|
30
29
|
|
31
30
|
# Sum of line amounts
|
@@ -4,11 +4,6 @@ class Dorsale::ExpenseGun::ExpenseLine < ::Dorsale::ApplicationRecord
|
|
4
4
|
belongs_to :expense, class_name: ::Dorsale::ExpenseGun::Expense
|
5
5
|
belongs_to :category, class_name: ::Dorsale::ExpenseGun::Category
|
6
6
|
|
7
|
-
def initialize(*)
|
8
|
-
super
|
9
|
-
self.company_part = 100 if company_part.nil?
|
10
|
-
end
|
11
|
-
|
12
7
|
validates :expense, presence: true
|
13
8
|
validates :name, presence: true
|
14
9
|
validates :date, presence: true
|
@@ -17,6 +12,10 @@ class Dorsale::ExpenseGun::ExpenseLine < ::Dorsale::ApplicationRecord
|
|
17
12
|
validates :vat, presence: true, numericality: {greater_than_or_equal_to: 0}
|
18
13
|
validates :company_part, presence: true, numericality: {greater_than_or_equal_to: 0, less_than_or_equal_to: 100.0}
|
19
14
|
|
15
|
+
def assign_default_values
|
16
|
+
assign_default :company_part, 100
|
17
|
+
end
|
18
|
+
|
20
19
|
def employee_payback
|
21
20
|
(total_all_taxes * company_part / 100)
|
22
21
|
end
|
@@ -30,9 +30,8 @@ class Dorsale::Flyboy::Folder < ::Dorsale::ApplicationRecord
|
|
30
30
|
in: proc { ::Dorsale::Flyboy::Folder.aasm.states.map(&:to_s) }
|
31
31
|
}
|
32
32
|
|
33
|
-
def
|
34
|
-
|
35
|
-
self.progress = 0 if progress.nil?
|
33
|
+
def assign_default_values
|
34
|
+
assign_default :progress, 0
|
36
35
|
end
|
37
36
|
|
38
37
|
def no_undone_tasks?
|
@@ -51,12 +51,11 @@ class Dorsale::Flyboy::Task < ::Dorsale::ApplicationRecord
|
|
51
51
|
end
|
52
52
|
end
|
53
53
|
|
54
|
-
def
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
self.progress = 0 if progress.nil?
|
54
|
+
def assign_default_values
|
55
|
+
assign_default :progress, 0
|
56
|
+
assign_default :done, false
|
57
|
+
assign_default :reminder, Time.zone.now.to_date + snooze_default_reminder
|
58
|
+
assign_default :term, Time.zone.now.to_date + snooze_default_term
|
60
59
|
end
|
61
60
|
|
62
61
|
after_save :update_taskable_progress!
|
@@ -12,14 +12,9 @@ class Dorsale::Flyboy::TaskComment < ::Dorsale::ApplicationRecord
|
|
12
12
|
|
13
13
|
default_scope -> { order("created_at DESC") }
|
14
14
|
|
15
|
-
def
|
16
|
-
|
17
|
-
|
18
|
-
self.date = Time.zone.now if date.nil?
|
19
|
-
|
20
|
-
if progress.nil?
|
21
|
-
self.progress = task ? task.progress : 0
|
22
|
-
end
|
15
|
+
def assign_default_values
|
16
|
+
assign_default :date, Time.zone.now
|
17
|
+
assign_default :progress, (task ? task.progress : 0)
|
23
18
|
end
|
24
19
|
|
25
20
|
after_create :update_task_progress
|
@@ -4,4 +4,25 @@ module Dorsale::CommentPolicyHelper
|
|
4
4
|
:update?,
|
5
5
|
:delete?,
|
6
6
|
]
|
7
|
+
|
8
|
+
def create?
|
9
|
+
return false unless can_read_commentable?
|
10
|
+
super
|
11
|
+
end
|
12
|
+
|
13
|
+
def update?
|
14
|
+
return false unless can_read_commentable?
|
15
|
+
super
|
16
|
+
end
|
17
|
+
|
18
|
+
def delete?
|
19
|
+
return false unless can_read_commentable?
|
20
|
+
super
|
21
|
+
end
|
22
|
+
|
23
|
+
private
|
24
|
+
|
25
|
+
def can_read_commentable?
|
26
|
+
policy(comment.commentable).read?
|
27
|
+
end
|
7
28
|
end
|
@@ -13,8 +13,19 @@ class Dorsale::Serializers::XLSX < Dorsale::Serializers::Base
|
|
13
13
|
@xlsx ||= Axlsx::Package.new do |p|
|
14
14
|
p.workbook.add_worksheet do |sheet|
|
15
15
|
data.each do |line|
|
16
|
-
|
17
|
-
|
16
|
+
values = line.map do |value|
|
17
|
+
if value.is_a?(Integer)
|
18
|
+
value
|
19
|
+
elsif value.is_a?(Numeric)
|
20
|
+
value.to_f # Fix BigDecimal
|
21
|
+
elsif value == true || value == false
|
22
|
+
I18n.t(value.to_s)
|
23
|
+
else
|
24
|
+
value.to_s
|
25
|
+
end
|
26
|
+
end
|
27
|
+
|
28
|
+
sheet.add_row(values)
|
18
29
|
end
|
19
30
|
end
|
20
31
|
|
@@ -1,4 +1,9 @@
|
|
1
|
-
.well
|
2
|
-
.
|
3
|
-
|
4
|
-
|
1
|
+
.well.text-center
|
2
|
+
.row
|
3
|
+
.col-md-4 = info @statistics, :total_excluding_taxes, helper: :bm_currency
|
4
|
+
.col-md-4 = info @statistics, :vat_amount, helper: :bm_currency
|
5
|
+
.col-md-4 = info @statistics, :total_including_taxes, helper: :bm_currency
|
6
|
+
|
7
|
+
- if params[:controller].end_with?("invoices")
|
8
|
+
hr
|
9
|
+
= billing_machine_invoices_chart
|
@@ -16,7 +16,7 @@ table.default.invoices
|
|
16
16
|
th.hidden-xs
|
17
17
|
= ::Dorsale::BillingMachine::Invoice.t(:total_including_taxes)
|
18
18
|
|
19
|
-
th
|
19
|
+
th.actions
|
20
20
|
= t("actions.actions")
|
21
21
|
|
22
22
|
tbody
|
@@ -29,7 +29,8 @@ table.default.invoices
|
|
29
29
|
= invoice.tracking_id
|
30
30
|
|
31
31
|
td.customer_name
|
32
|
-
|
32
|
+
- if invoice.customer
|
33
|
+
= link_to invoice.customer, invoice.customer
|
33
34
|
|
34
35
|
td.total_excluding_taxes
|
35
36
|
= bm_currency invoice.total_excluding_taxes
|
@@ -10,6 +10,12 @@
|
|
10
10
|
:input_html => {value: @subject},
|
11
11
|
)
|
12
12
|
|
13
|
+
= f.input(:from,
|
14
|
+
:disabled => true,
|
15
|
+
:label => t("attributes.email_from"),
|
16
|
+
:input_html => {value: "#{current_user} <#{current_user.email}>"},
|
17
|
+
)
|
18
|
+
|
13
19
|
= f.input(:to,
|
14
20
|
:disabled => true,
|
15
21
|
:label => t("attributes.email_to"),
|
@@ -15,7 +15,7 @@
|
|
15
15
|
= create_button dorsale.new_billing_machine_invoice_path
|
16
16
|
|
17
17
|
- if policy(::Dorsale::BillingMachine::Invoice).export?
|
18
|
-
= download_button dorsale.billing_machine_invoices_path(format: :
|
18
|
+
= download_button dorsale.billing_machine_invoices_path(format: :xlsx), download: "#{model.ts}.xlsx"
|
19
19
|
|
20
20
|
- content_for :table
|
21
21
|
= render "dorsale/billing_machine/invoices/list", invoices: @invoices
|
@@ -0,0 +1,41 @@
|
|
1
|
+
data = [
|
2
|
+
[
|
3
|
+
Dorsale::BillingMachine::Invoice.t(:date),
|
4
|
+
Dorsale::BillingMachine::Invoice.t(:tracking_id),
|
5
|
+
Dorsale::BillingMachine::Invoice.t(:label),
|
6
|
+
Dorsale::CustomerVault::Person.t(:name),
|
7
|
+
Dorsale::CustomerVault::Person.t(:street),
|
8
|
+
Dorsale::CustomerVault::Person.t(:street_bis),
|
9
|
+
Dorsale::CustomerVault::Person.t(:zip),
|
10
|
+
Dorsale::CustomerVault::Person.t(:city),
|
11
|
+
Dorsale::CustomerVault::Person.t(:country),
|
12
|
+
Dorsale::BillingMachine::Invoice.t(:commercial_discount),
|
13
|
+
Dorsale::BillingMachine::Invoice.t(:total_excluding_taxes),
|
14
|
+
Dorsale::BillingMachine::Invoice.t(:vat_amount),
|
15
|
+
Dorsale::BillingMachine::Invoice.t(:total_including_taxes),
|
16
|
+
Dorsale::BillingMachine::Invoice.t(:advance),
|
17
|
+
Dorsale::BillingMachine::Invoice.t(:balance),
|
18
|
+
]
|
19
|
+
]
|
20
|
+
|
21
|
+
@invoices_without_pagination.each do |invoice|
|
22
|
+
data << [
|
23
|
+
invoice.date,
|
24
|
+
invoice.tracking_id,
|
25
|
+
invoice.label,
|
26
|
+
invoice.customer.try(:name),
|
27
|
+
invoice.customer.try(:address).try(:street),
|
28
|
+
invoice.customer.try(:address).try(:street_bis),
|
29
|
+
invoice.customer.try(:address).try(:zip),
|
30
|
+
invoice.customer.try(:address).try(:city),
|
31
|
+
invoice.customer.try(:address).try(:country),
|
32
|
+
invoice.commercial_discount,
|
33
|
+
invoice.total_excluding_taxes,
|
34
|
+
invoice.vat_amount,
|
35
|
+
invoice.total_including_taxes,
|
36
|
+
invoice.advance,
|
37
|
+
invoice.balance,
|
38
|
+
]
|
39
|
+
end
|
40
|
+
|
41
|
+
Dorsale::Serializers::XLSX.new(data).render_inline
|
@@ -19,7 +19,7 @@ table.default.quotations
|
|
19
19
|
th.hidden-xs
|
20
20
|
= ::Dorsale::BillingMachine::Quotation.t(:state)
|
21
21
|
|
22
|
-
th
|
22
|
+
th.actions
|
23
23
|
= t("actions.actions")
|
24
24
|
|
25
25
|
tbody
|
@@ -32,7 +32,8 @@ table.default.quotations
|
|
32
32
|
= quotation.tracking_id
|
33
33
|
|
34
34
|
td.customer_name
|
35
|
-
|
35
|
+
- if quotation.customer
|
36
|
+
= link_to quotation.customer, quotation.customer
|
36
37
|
|
37
38
|
td.total_excluding_taxes
|
38
39
|
= bm_currency quotation.total_excluding_taxes
|
@@ -40,7 +41,7 @@ table.default.quotations
|
|
40
41
|
td.hidden-xs.total_including_taxes
|
41
42
|
= bm_currency quotation.total_including_taxes
|
42
43
|
|
43
|
-
td
|
44
|
+
td.hidden-xs
|
44
45
|
= quotation.t("state.#{quotation.state}")
|
45
46
|
|
46
47
|
td.actions
|
@@ -14,13 +14,13 @@
|
|
14
14
|
p.infos
|
15
15
|
span.commentable-container
|
16
16
|
span.commentable
|
17
|
-
= link_to comment.commentable
|
17
|
+
= link_to comment.commentable, engine_polymorphic_path(comment.commentable)
|
18
18
|
|
19
19
|
span.separator
|
20
20
|
= " - "
|
21
21
|
|
22
22
|
span.date
|
23
|
-
=
|
23
|
+
= date(comment.created_at)
|
24
24
|
|
25
25
|
= " "
|
26
26
|
= ::Dorsale::Comment.t(:written_by)
|
@@ -1,11 +1,10 @@
|
|
1
|
-
= simple_form_for [dorsale,
|
2
|
-
|
3
|
-
|
4
|
-
input type="hidden" name="commentable_type" value=commentable.class
|
1
|
+
= simple_form_for [dorsale, comment], remote: true do |f|
|
2
|
+
= f.hidden_field :commentable_id
|
3
|
+
= f.hidden_field :commentable_type
|
5
4
|
|
6
5
|
.comment
|
7
|
-
- if
|
8
|
-
= image_tag
|
6
|
+
- if comment.author.try(:avatar_url).present?
|
7
|
+
= image_tag comment.author.avatar_url, class: "avatar"
|
9
8
|
- else
|
10
9
|
= image_tag "dorsale/avatar.png", class: "avatar"
|
11
10
|
|