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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/app/controllers/dorsale/customer_vault/events_controller.rb +0 -2
- data/app/models/dorsale/billing_machine/invoice.rb +2 -4
- data/app/models/dorsale/billing_machine/quotation.rb +1 -2
- data/app/models/dorsale/customer_vault/person.rb +7 -7
- data/app/pdfs/dorsale/billing_machine/invoice_single_vat_pdf.rb +2 -2
- data/app/policies/dorsale/application_policy.rb +1 -0
- data/app/services/dorsale/billing_machine/invoice/copy.rb +1 -0
- data/app/services/dorsale/billing_machine/pdf_file_generator.rb +1 -0
- data/app/services/dorsale/billing_machine/quotation/copy.rb +1 -0
- data/app/services/dorsale/billing_machine/quotation/to_invoice.rb +1 -0
- data/app/services/dorsale/expense_gun/expense/copy.rb +1 -0
- data/app/services/dorsale/flyboy/task/copy.rb +1 -0
- data/app/services/dorsale/flyboy/task/snoozer.rb +1 -0
- data/app/services/dorsale/tag_list_for_model.rb +1 -0
- data/app/views/dorsale/billing_machine/invoices/show.pdf.ruby +1 -1
- data/app/views/dorsale/billing_machine/quotations/show.pdf.ruby +1 -1
- data/features/step_definitions/billing_machine_payment_terms_steps.rb +1 -1
- data/features/step_definitions/billing_machine_quotations_steps.rb +1 -1
- data/features/step_definitions/customer_vault_activity_types_steps.rb +1 -1
- data/features/step_definitions/customer_vault_origins_steps.rb +1 -1
- data/features/step_definitions/customer_vault_search_steps.rb +10 -10
- data/features/step_definitions/expense_gun_categories_steps.rb +1 -1
- data/lib/dorsale/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: bed10bfd8955fa8dec1e5c01787b450201bfb08941099fbe6d2e413f8b679dd1
|
|
4
|
+
data.tar.gz: 7bdab067a557c8d7ceb4d660462be2452bb429cf6bdbd540c84b6b3dc5972446
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 83a3b664703cae40e41a194157e4369474d461b29042e48e13b4d259dd02f3db99e2835c885b73d83e1bc254e1d1a3c51ef7b4a025db86d45ab3653bb7da4fb0
|
|
7
|
+
data.tar.gz: '03826fb01f8843a16685a23d319611d393f988376b59418d37cbfa60fcc7e0f3baf44f518ed9a581d682615cce7061e5c35e805087eacf7dac3803edb19506ca'
|
data/CHANGELOG.md
CHANGED
|
@@ -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
|
|
@@ -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
|
|
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
|
|
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
|
|
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
|
|
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
|
-
|
|
1
|
+
When(/^he go to the people list$/) do
|
|
2
2
|
visit dorsale.customer_vault_people_path
|
|
3
3
|
end
|
|
4
4
|
|
|
5
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
|
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
|
|
data/lib/dorsale/version.rb
CHANGED
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.
|
|
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-
|
|
11
|
+
date: 2020-09-21 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: rails
|