dorsale 3.14.9 → 3.14.10

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.
Files changed (26) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +4 -0
  3. data/app/controllers/dorsale/customer_vault/events_controller.rb +0 -2
  4. data/app/models/dorsale/billing_machine/invoice.rb +2 -4
  5. data/app/models/dorsale/billing_machine/quotation.rb +1 -2
  6. data/app/models/dorsale/customer_vault/person.rb +7 -7
  7. data/app/pdfs/dorsale/billing_machine/invoice_single_vat_pdf.rb +2 -2
  8. data/app/policies/dorsale/application_policy.rb +1 -0
  9. data/app/services/dorsale/billing_machine/invoice/copy.rb +1 -0
  10. data/app/services/dorsale/billing_machine/pdf_file_generator.rb +1 -0
  11. data/app/services/dorsale/billing_machine/quotation/copy.rb +1 -0
  12. data/app/services/dorsale/billing_machine/quotation/to_invoice.rb +1 -0
  13. data/app/services/dorsale/expense_gun/expense/copy.rb +1 -0
  14. data/app/services/dorsale/flyboy/task/copy.rb +1 -0
  15. data/app/services/dorsale/flyboy/task/snoozer.rb +1 -0
  16. data/app/services/dorsale/tag_list_for_model.rb +1 -0
  17. data/app/views/dorsale/billing_machine/invoices/show.pdf.ruby +1 -1
  18. data/app/views/dorsale/billing_machine/quotations/show.pdf.ruby +1 -1
  19. data/features/step_definitions/billing_machine_payment_terms_steps.rb +1 -1
  20. data/features/step_definitions/billing_machine_quotations_steps.rb +1 -1
  21. data/features/step_definitions/customer_vault_activity_types_steps.rb +1 -1
  22. data/features/step_definitions/customer_vault_origins_steps.rb +1 -1
  23. data/features/step_definitions/customer_vault_search_steps.rb +10 -10
  24. data/features/step_definitions/expense_gun_categories_steps.rb +1 -1
  25. data/lib/dorsale/version.rb +1 -1
  26. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c02356f6d8c0cf4484b3c5bbf8ae14b4afb5807b79a836c3ac3def7fe4f0d795
4
- data.tar.gz: 10e1416b942207884fc2a84665285e6a5ebb9d73fe5d65a69057f89d05ac75fa
3
+ metadata.gz: bed10bfd8955fa8dec1e5c01787b450201bfb08941099fbe6d2e413f8b679dd1
4
+ data.tar.gz: 7bdab067a557c8d7ceb4d660462be2452bb429cf6bdbd540c84b6b3dc5972446
5
5
  SHA512:
6
- metadata.gz: ad1c5adb07688951372ec42e57c85f9487c06257827dcf0e712ab3a87794c9c9ac5e6fe6ba09115fe3813e55ceba36b56dc871729e5aead840b3815af4a8b3a8
7
- data.tar.gz: 90da6df14ad83c78ea0abe031686ea1f9cbbdb3750005c669c19f89875b7ea77a9fce70c4bfbdc9dd7f28e28f95b954ef85395c8422b86148c9bbeefffeeed1d
6
+ metadata.gz: 83a3b664703cae40e41a194157e4369474d461b29042e48e13b4d259dd02f3db99e2835c885b73d83e1bc254e1d1a3c51ef7b4a025db86d45ab3653bb7da4fb0
7
+ data.tar.gz: '03826fb01f8843a16685a23d319611d393f988376b59418d37cbfa60fcc7e0f3baf44f518ed9a581d682615cce7061e5c35e805087eacf7dac3803edb19506ca'
@@ -2,6 +2,10 @@
2
2
 
3
3
  ## Next version
4
4
 
5
+ ## 3.14.10
6
+ - Change BillingMachine PDF filenames
7
+ - Fix CustomerVault layout
8
+
5
9
  ## 3.14.9
6
10
  - Create corporation from individual form
7
11
  - Quotations: add draft state
@@ -1,8 +1,6 @@
1
1
  class Dorsale::CustomerVault::EventsController < ::Dorsale::CustomerVault::ApplicationController
2
2
  before_action :set_objects
3
3
 
4
- layout -> { action_name == "index" ? nil : false }
5
-
6
4
  def index
7
5
  authorize model, :list?
8
6
 
@@ -22,6 +22,8 @@ class Dorsale::BillingMachine::Invoice < ::Dorsale::ApplicationRecord
22
22
  :invoice
23
23
  end
24
24
 
25
+ after_initialize :assign_default_dates
26
+ before_save :update_totals
25
27
  before_create :assign_unique_index
26
28
  before_create :assign_tracking_id
27
29
 
@@ -43,15 +45,11 @@ class Dorsale::BillingMachine::Invoice < ::Dorsale::ApplicationRecord
43
45
  assign_default :paid, false
44
46
  end
45
47
 
46
- after_initialize :assign_default_dates
47
-
48
48
  def assign_default_dates
49
49
  assign_default :date, Date.current
50
50
  assign_default :due_date, Date.current + 30.days
51
51
  end
52
52
 
53
- before_save :update_totals
54
-
55
53
  def update_totals
56
54
  assign_default_values
57
55
  lines.each(&:update_total)
@@ -33,6 +33,7 @@ class Dorsale::BillingMachine::Quotation < ::Dorsale::ApplicationRecord
33
33
  :quotation
34
34
  end
35
35
 
36
+ before_save :update_totals
36
37
  before_create :assign_unique_index
37
38
  before_create :assign_tracking_id
38
39
 
@@ -55,8 +56,6 @@ class Dorsale::BillingMachine::Quotation < ::Dorsale::ApplicationRecord
55
56
  assign_default :total_excluding_taxes, 0
56
57
  end
57
58
 
58
- before_save :update_totals
59
-
60
59
  def update_totals
61
60
  assign_default_values
62
61
  lines.each(&:update_total)
@@ -9,8 +9,6 @@ class Dorsale::CustomerVault::Person < ::Dorsale::ApplicationRecord
9
9
  Dorsale::CustomerVault::PersonPolicy
10
10
  end
11
11
 
12
- after_initialize :verify_class
13
-
14
12
  def verify_class
15
13
  if self.class == ::Dorsale::CustomerVault::Person
16
14
  # self.abstract_class does not work with STI
@@ -30,6 +28,13 @@ class Dorsale::CustomerVault::Person < ::Dorsale::ApplicationRecord
30
28
  belongs_to :activity_type, class_name: "Dorsale::CustomerVault::ActivityType"
31
29
  belongs_to :origin, class_name: "Dorsale::CustomerVault::Origin"
32
30
 
31
+ validate :validate_taken_emails
32
+
33
+ after_initialize :verify_class
34
+ after_initialize :build_address, if: proc { new_record? && address.nil? }
35
+
36
+ before_validation :build_address, if: proc { address.nil? }
37
+
33
38
  after_destroy :destroy_links
34
39
 
35
40
  default_scope -> {
@@ -50,9 +55,6 @@ class Dorsale::CustomerVault::Person < ::Dorsale::ApplicationRecord
50
55
 
51
56
  scope :having_email, -> (email) { where("email = :e OR :e = ANY (secondary_emails)", e: email) }
52
57
 
53
- after_initialize :build_address, if: proc { new_record? && address.nil? }
54
- before_validation :build_address, if: proc { address.nil? }
55
-
56
58
  def taken_emails
57
59
  taken_emails = {}
58
60
  ([email] + secondary_emails).select(&:present?).each do |e|
@@ -62,8 +64,6 @@ class Dorsale::CustomerVault::Person < ::Dorsale::ApplicationRecord
62
64
  taken_emails
63
65
  end
64
66
 
65
- validate :validate_taken_emails
66
-
67
67
  def validate_taken_emails
68
68
  return if taken_emails.empty?
69
69
 
@@ -177,11 +177,11 @@ class Dorsale::BillingMachine::InvoiceSingleVatPdf < Dorsale::ApplicationPdf
177
177
  end
178
178
 
179
179
  def has_advance
180
- main_document.try(:advance) && main_document.advance != 0.0
180
+ main_document.try(:advance) && main_document.advance.to_d != 0.0.to_d
181
181
  end
182
182
 
183
183
  def has_discount
184
- main_document.try(:commercial_discount) && main_document.commercial_discount != 0.0
184
+ main_document.try(:commercial_discount) && main_document.commercial_discount.to_d != 0.0.to_d
185
185
  end
186
186
 
187
187
  def build_table
@@ -19,6 +19,7 @@ class Dorsale::ApplicationPolicy
19
19
  end
20
20
 
21
21
  def self.inherited(klass)
22
+ super(klass)
22
23
  klass.define_subject_accessor!
23
24
  end
24
25
 
@@ -2,6 +2,7 @@ class Dorsale::BillingMachine::Invoice::Copy < ::Dorsale::Service
2
2
  attr_accessor :invoice, :copy
3
3
 
4
4
  def initialize(invoice)
5
+ super()
5
6
  @invoice = invoice
6
7
  end
7
8
 
@@ -2,6 +2,7 @@ class Dorsale::BillingMachine::PdfFileGenerator < Dorsale::Service
2
2
  attr_reader :document
3
3
 
4
4
  def initialize(document)
5
+ super()
5
6
  @document = document
6
7
 
7
8
  # I have no idea why I need to do that,
@@ -2,6 +2,7 @@ class Dorsale::BillingMachine::Quotation::Copy < ::Dorsale::Service
2
2
  attr_accessor :quotation, :copy
3
3
 
4
4
  def initialize(quotation)
5
+ super()
5
6
  @quotation = quotation
6
7
  end
7
8
 
@@ -2,6 +2,7 @@ class Dorsale::BillingMachine::Quotation::ToInvoice < ::Dorsale::Service
2
2
  attr_accessor :quotation, :invoice
3
3
 
4
4
  def initialize(quotation)
5
+ super()
5
6
  @quotation = quotation
6
7
  end
7
8
 
@@ -2,6 +2,7 @@ class Dorsale::ExpenseGun::Expense::Copy < ::Dorsale::Service
2
2
  attr_accessor :expense, :copy
3
3
 
4
4
  def initialize(expense)
5
+ super()
5
6
  @expense = expense
6
7
  end
7
8
 
@@ -2,6 +2,7 @@ class Dorsale::Flyboy::Task::Copy < ::Dorsale::Service
2
2
  attr_accessor :task, :copy
3
3
 
4
4
  def initialize(task)
5
+ super()
5
6
  @task = task
6
7
  end
7
8
 
@@ -2,6 +2,7 @@ class Dorsale::Flyboy::Task::Snoozer < ::Dorsale::Service
2
2
  attr_reader :task
3
3
 
4
4
  def initialize(task)
5
+ super()
5
6
  @task = task
6
7
  end
7
8
 
@@ -2,6 +2,7 @@ class Dorsale::TagListForModel < ::Dorsale::Service
2
2
  attr_reader :model
3
3
 
4
4
  def initialize(model)
5
+ super()
5
6
  @model = model
6
7
  end
7
8
 
@@ -1,7 +1,7 @@
1
1
  filename = [
2
2
  @invoice.t.capitalize,
3
3
  @invoice.tracking_id,
4
- @invoice.customer.try(:short_name),
4
+ @invoice.customer.to_s.tr(" ", "_"),
5
5
  ].join("_").concat(".pdf")
6
6
 
7
7
  response.headers["Content-Disposition"] = %(inline; filename="#{filename}")
@@ -1,7 +1,7 @@
1
1
  filename = [
2
2
  @quotation.t.capitalize,
3
3
  @quotation.tracking_id,
4
- @quotation.customer.try(:short_name),
4
+ @quotation.customer.to_s.tr(" ", "_"),
5
5
  ].join("_").concat(".pdf")
6
6
 
7
7
  response.headers["Content-Disposition"] = %(inline; filename="#{filename}")
@@ -28,7 +28,7 @@ When(/^the user edits the payment_term$/) do
28
28
  find(".link_update").click
29
29
  end
30
30
 
31
- Then(/^the current payment_term's label should be pre\-filled$/) do
31
+ Then(/^the current payment_term's label should be pre-filled$/) do
32
32
  expect(page).to have_field("billing_machine_payment_term_label", with: @payment_term.label)
33
33
  end
34
34
 
@@ -58,7 +58,7 @@ When(/^the quotation line shows the right date$/) do
58
58
  expect(page).to have_selector ".date", text: I18n.l(@quotation.date)
59
59
  end
60
60
 
61
- When(/^the quotation line shows the right traking\-id$/) do
61
+ When(/^the quotation line shows the right traking-id$/) do
62
62
  expect(page).to have_selector ".tracking_id", text: @quotation.tracking_id
63
63
  end
64
64
 
@@ -28,7 +28,7 @@ When(/^I edit the activity type$/) do
28
28
  find(".link_update").click
29
29
  end
30
30
 
31
- Then(/^the current activity type's name should be pre\-filled$/) do
31
+ Then(/^the current activity type's name should be pre-filled$/) do
32
32
  expect(page).to have_field("activity_type_name", with: @activity_type.name)
33
33
  end
34
34
 
@@ -28,7 +28,7 @@ When(/^I edit the origin$/) do
28
28
  find(".link_update").click
29
29
  end
30
30
 
31
- Then(/^the current origin's name should be pre\-filled$/) do
31
+ Then(/^the current origin's name should be pre-filled$/) do
32
32
  expect(page).to have_field("origin_name", with: @origin.name)
33
33
  end
34
34
 
@@ -1,48 +1,48 @@
1
- Lorsqu(/^he go to the people list$/) do
1
+ When(/^he go to the people list$/) do
2
2
  visit dorsale.customer_vault_people_path
3
3
  end
4
4
 
5
- Etantdonné(/^existing individuals$/) do
5
+ Given(/^existing individuals$/) do
6
6
  @individual1 = create(:customer_vault_individual, first_name: "Jean", last_name: "DUPONT")
7
7
  @individual2 = create(:customer_vault_individual, first_name: "Laurent", last_name: "DURAND")
8
8
  end
9
9
 
10
- Etantdonné(/^existing corporations$/) do
10
+ Given(/^existing corporations$/) do
11
11
  @corporation1 = create(:customer_vault_corporation, name: "aaa", email: "contact@aaa.com")
12
12
  @corporation2 = create(:customer_vault_corporation, name: "zzz", email: "contact@zzz.com")
13
13
  end
14
14
 
15
- Lorsqu(/^he search an individual by first name$/) do
15
+ When(/^he search an individual by first name$/) do
16
16
  fill_in "q", with: "Jean"
17
17
  find(".search-submit").click
18
18
  end
19
19
 
20
- Alors(/^this individual appear in search results$/) do
20
+ Then(/^this individual appear in search results$/) do
21
21
  expect(page).to have_content "Jean"
22
22
  expect(page).to have_content "DUPONT"
23
23
  end
24
24
 
25
- Alors(/^other individuals do not appear in search results$/) do
25
+ Then(/^other individuals do not appear in search results$/) do
26
26
  expect(page).to have_no_content "Laurent"
27
27
  expect(page).to have_no_content "DURAND"
28
28
  end
29
29
 
30
- Lorsqu(/^he search an individual by last name$/) do
30
+ When(/^he search an individual by last name$/) do
31
31
  fill_in "q", with: "DUPONT"
32
32
  find(".search-submit").click
33
33
  end
34
34
 
35
- Lorsqu(/^he search a corporation by name$/) do
35
+ When(/^he search a corporation by name$/) do
36
36
  fill_in "q", with: "aaa"
37
37
  find(".search-submit").click
38
38
  end
39
39
 
40
- Alors(/^this corporation appear in search results$/) do
40
+ Then(/^this corporation appear in search results$/) do
41
41
  expect(page).to have_content "aaa"
42
42
  expect(page).to have_content "contact@aaa.com"
43
43
  end
44
44
 
45
- Alors(/^other corporations do not appear in search results$/) do
45
+ Then(/^other corporations do not appear in search results$/) do
46
46
  expect(page).to have_no_content "zzz"
47
47
  expect(page).to have_no_content "contact@zzz.com"
48
48
  end
@@ -28,7 +28,7 @@ When(/^I edit the expense category$/) do
28
28
  find(".link_update").click
29
29
  end
30
30
 
31
- Then(/^the current expense category's label should be pre\-filled$/) do
31
+ Then(/^the current expense category's label should be pre-filled$/) do
32
32
  expect(page).to have_field("category_name", with: @category.name)
33
33
  end
34
34
 
@@ -1,3 +1,3 @@
1
1
  module Dorsale
2
- VERSION = "3.14.9"
2
+ VERSION = "3.14.10"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dorsale
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.14.9
4
+ version: 3.14.10
5
5
  platform: ruby
6
6
  authors:
7
7
  - agilidée
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-08-12 00:00:00.000000000 Z
11
+ date: 2020-09-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails