dorsale 3.15.0 → 3.16.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 +4 -4
- data/CHANGELOG.md +4 -0
- data/app/assets/javascripts/dorsale/dependencies.coffee +1 -1
- data/app/assets/javascripts/dorsale/engines/billing_machine.coffee.erb +14 -0
- data/app/assets/stylesheets/dorsale/engines/billing_machine.sass +4 -1
- data/app/controllers/dorsale/billing_machine/invoices_controller.rb +14 -9
- data/app/controllers/dorsale/billing_machine/quotations_controller.rb +14 -9
- data/app/models/dorsale/billing_machine/invoice_line.rb +1 -1
- data/app/models/dorsale/billing_machine/quotation_line.rb +1 -1
- data/app/views/dorsale/billing_machine/commons/_form.html.slim +2 -1
- data/app/views/dorsale/billing_machine/commons/_line_fields.html.slim +4 -0
- data/config/locales/billing_machine.fr.yml +1 -0
- data/db/migrate/20210202100529_billing_machine_add_positions.rb +6 -0
- data/lib/dorsale/version.rb +1 -1
- data/spec/pdfs/dorsale/billing_machine/invoice_multiple_vat_pdf_spec.rb +1 -1
- data/spec/pdfs/dorsale/billing_machine/invoice_single_vat_pdf_spec.rb +1 -1
- data/spec/pdfs/dorsale/billing_machine/quotation_multiple_vat_pdf_spec.rb +1 -1
- data/spec/pdfs/dorsale/billing_machine/quotation_single_vat_pdf_spec.rb +1 -1
- data/spec/rails_helper.rb +0 -1
- metadata +3 -3
- data/app/assets/javascripts/url.min.js +0 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 8c07aa163d58442697fc7cbbd50008cff4128218f6c28a567ec693fa028112a8
|
|
4
|
+
data.tar.gz: 137b46a639e3e82c637e001e6bcdf06e307f357fd07c4bc69fbcce69e7600bf5
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 3cc2d98f933b68bb02d421f3f8ba132fa70d54c910292db9539b3c7e2bd8027692cf4d8e30ba333a0abfe6825bd34fee362a0f5d699c91a542ff7fcf0dac59ce
|
|
7
|
+
data.tar.gz: 00cc8a3a2a6ac15cdd523871ed2b8ea3ffeb7832006c6b643fe3e0c801aa17579de20e22d525f36a273bcf93fcb13142f0257bda5dcef56b0b5758e40bdccf04
|
data/CHANGELOG.md
CHANGED
|
@@ -4,11 +4,11 @@
|
|
|
4
4
|
//= require bootstrap
|
|
5
5
|
//= require cocoon
|
|
6
6
|
//= require accounting
|
|
7
|
-
//= require url.min
|
|
8
7
|
//= require select2
|
|
9
8
|
//= require select2_locale_fr
|
|
10
9
|
//= require bootstrap-datepicker/core
|
|
11
10
|
//= require bootstrap-datepicker/locales/bootstrap-datepicker.fr
|
|
12
11
|
//= require Chart.bundle
|
|
13
12
|
//= require chartkick
|
|
13
|
+
//= require Sortable
|
|
14
14
|
//= require agilibox/all
|
|
@@ -77,6 +77,10 @@ BillingMachine.formatInputs = ->
|
|
|
77
77
|
formatted_number = BillingMachine.num2str BillingMachine.str2num $(this).val()
|
|
78
78
|
$(this).val formatted_number
|
|
79
79
|
|
|
80
|
+
BillingMachine.updatePositions = ->
|
|
81
|
+
i = 0
|
|
82
|
+
$("#billing_machine-form input[name*=position]").map -> this.value = (i = i + 1)
|
|
83
|
+
|
|
80
84
|
# Empty number inputs on focus if value is 0
|
|
81
85
|
$(document).on "focus", "#billing_machine-form input.number", ->
|
|
82
86
|
$(this).val("") if BillingMachine.str2num($(this).val()) == 0
|
|
@@ -96,6 +100,7 @@ $(document).on "click", "#billing_machine-form a.delete", (e) ->
|
|
|
96
100
|
$(document).on "turbolinks:load cocoon:after-insert", ->
|
|
97
101
|
BillingMachine.formatInputs()
|
|
98
102
|
BillingMachine.updateTotals()
|
|
103
|
+
BillingMachine.updatePositions()
|
|
99
104
|
|
|
100
105
|
# Fix Cocoon bug
|
|
101
106
|
$("#billing_machine-form .line textarea").map ->
|
|
@@ -106,3 +111,12 @@ $(document).on "keyup", "#billing_machine-form input.number", ->
|
|
|
106
111
|
|
|
107
112
|
$(document).on "blur", "#billing_machine-form input.number", ->
|
|
108
113
|
BillingMachine.formatInputs()
|
|
114
|
+
|
|
115
|
+
$(document).on "turbolinks:load", ->
|
|
116
|
+
$("#billing_machine-form tbody").map ->
|
|
117
|
+
container = this
|
|
118
|
+
|
|
119
|
+
new Sortable container,
|
|
120
|
+
handle: ".handle"
|
|
121
|
+
animation: 150
|
|
122
|
+
onSort: -> BillingMachine.updatePositions()
|
|
@@ -157,15 +157,20 @@ class Dorsale::BillingMachine::InvoicesController < ::Dorsale::BillingMachine::A
|
|
|
157
157
|
:advance,
|
|
158
158
|
:due_date,
|
|
159
159
|
:comments,
|
|
160
|
-
:lines_attributes =>
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
160
|
+
:lines_attributes => line_permitted_params,
|
|
161
|
+
]
|
|
162
|
+
end
|
|
163
|
+
|
|
164
|
+
def line_permitted_params
|
|
165
|
+
[
|
|
166
|
+
:_destroy,
|
|
167
|
+
:id,
|
|
168
|
+
:label,
|
|
169
|
+
:quantity,
|
|
170
|
+
:unit,
|
|
171
|
+
:unit_price,
|
|
172
|
+
:vat_rate,
|
|
173
|
+
:position,
|
|
169
174
|
]
|
|
170
175
|
end
|
|
171
176
|
|
|
@@ -165,15 +165,20 @@ class Dorsale::BillingMachine::QuotationsController < ::Dorsale::BillingMachine:
|
|
|
165
165
|
:comments,
|
|
166
166
|
:vat_rate,
|
|
167
167
|
:commercial_discount,
|
|
168
|
-
:lines_attributes =>
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
168
|
+
:lines_attributes => line_permitted_params,
|
|
169
|
+
]
|
|
170
|
+
end
|
|
171
|
+
|
|
172
|
+
def line_permitted_params
|
|
173
|
+
[
|
|
174
|
+
:_destroy,
|
|
175
|
+
:id,
|
|
176
|
+
:label,
|
|
177
|
+
:quantity,
|
|
178
|
+
:unit,
|
|
179
|
+
:unit_price,
|
|
180
|
+
:vat_rate,
|
|
181
|
+
:position,
|
|
177
182
|
]
|
|
178
183
|
end
|
|
179
184
|
|
|
@@ -21,6 +21,7 @@
|
|
|
21
21
|
table#lines-table
|
|
22
22
|
thead
|
|
23
23
|
tr
|
|
24
|
+
th.position
|
|
24
25
|
th.actions
|
|
25
26
|
th.line-label = Dorsale::BillingMachine::InvoiceLine.t(:label)
|
|
26
27
|
th.line-quantity = Dorsale::BillingMachine::InvoiceLine.t(:quantity)
|
|
@@ -32,7 +33,7 @@
|
|
|
32
33
|
|
|
33
34
|
tbody
|
|
34
35
|
= f.simple_fields_for :lines do |lf|
|
|
35
|
-
= render "dorsale/billing_machine/
|
|
36
|
+
= render "dorsale/billing_machine/#{document.document_type}s/line_fields", f: lf
|
|
36
37
|
|
|
37
38
|
.row
|
|
38
39
|
.col-sm-6
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
class BillingMachineAddPositions < ActiveRecord::Migration[6.0]
|
|
2
|
+
def change
|
|
3
|
+
add_column :dorsale_billing_machine_invoice_lines, :position, :integer, null: false, default: 0
|
|
4
|
+
add_column :dorsale_billing_machine_quotation_lines, :position, :integer, null: false, default: 0
|
|
5
|
+
end
|
|
6
|
+
end
|
data/lib/dorsale/version.rb
CHANGED
|
@@ -23,7 +23,7 @@ describe ::Dorsale::BillingMachine::InvoiceMultipleVatPdf, pdfs: true do
|
|
|
23
23
|
|
|
24
24
|
let(:content) {
|
|
25
25
|
generate!
|
|
26
|
-
|
|
26
|
+
PDF::Reader.new(invoice.pdf_file.path).pages.map(&:text).join("\n")
|
|
27
27
|
}
|
|
28
28
|
|
|
29
29
|
it "should not display global vat rate" do
|
|
@@ -23,7 +23,7 @@ describe ::Dorsale::BillingMachine::InvoiceSingleVatPdf, pdfs: true do
|
|
|
23
23
|
|
|
24
24
|
let(:content) {
|
|
25
25
|
generate!
|
|
26
|
-
|
|
26
|
+
PDF::Reader.new(invoice.pdf_file.path).pages.map(&:text).join("\n")
|
|
27
27
|
}
|
|
28
28
|
|
|
29
29
|
it "should display global vat rate" do
|
|
@@ -23,7 +23,7 @@ describe ::Dorsale::BillingMachine::QuotationMultipleVatPdf, pdfs: true do
|
|
|
23
23
|
|
|
24
24
|
let(:content) {
|
|
25
25
|
generate!
|
|
26
|
-
|
|
26
|
+
PDF::Reader.new(quotation.pdf_file.path).pages.map(&:text).join("\n")
|
|
27
27
|
}
|
|
28
28
|
|
|
29
29
|
it "should not display global vat rate" do
|
|
@@ -23,7 +23,7 @@ describe ::Dorsale::BillingMachine::QuotationSingleVatPdf, pdfs: true do
|
|
|
23
23
|
|
|
24
24
|
let(:content) {
|
|
25
25
|
generate!
|
|
26
|
-
|
|
26
|
+
PDF::Reader.new(quotation.pdf_file.path).pages.map(&:text).join("\n")
|
|
27
27
|
}
|
|
28
28
|
|
|
29
29
|
it "should display global vat rate" do
|
data/spec/rails_helper.rb
CHANGED
|
@@ -4,7 +4,6 @@ require 'spec_helper'
|
|
|
4
4
|
require File.expand_path("../dummy/config/environment", __FILE__)
|
|
5
5
|
require 'rspec/rails'
|
|
6
6
|
require "agilibox/rspec"
|
|
7
|
-
require "yomu"
|
|
8
7
|
# Add additional requires below this line. Rails is not loaded until this point!
|
|
9
8
|
# Requires supporting ruby files with custom matchers and macros, etc,
|
|
10
9
|
# in spec/support/ and its subdirectories.
|
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.
|
|
4
|
+
version: 3.16.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- agilidée
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date:
|
|
11
|
+
date: 2021-02-02 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: rails
|
|
@@ -468,7 +468,6 @@ files:
|
|
|
468
468
|
- app/assets/javascripts/dorsale/engines/billing_machine.coffee.erb
|
|
469
469
|
- app/assets/javascripts/dorsale/engines/customer_vault.coffee
|
|
470
470
|
- app/assets/javascripts/dorsale/engines/flyboy.coffee
|
|
471
|
-
- app/assets/javascripts/url.min.js
|
|
472
471
|
- app/assets/stylesheets/dorsale/all.sass
|
|
473
472
|
- app/assets/stylesheets/dorsale/common.sass
|
|
474
473
|
- app/assets/stylesheets/dorsale/common/comments.sass
|
|
@@ -835,6 +834,7 @@ files:
|
|
|
835
834
|
- db/migrate/20171023133219_customer_vault_events_add_contact_type.rb
|
|
836
835
|
- db/migrate/20171024075514_customer_vault_contact_type_default_value.rb
|
|
837
836
|
- db/migrate/20171115171425_dorsale_customer_vault_people_add_secondary_emails.rb
|
|
837
|
+
- db/migrate/20210202100529_billing_machine_add_positions.rb
|
|
838
838
|
- features/access.feature
|
|
839
839
|
- features/billing_machine_invoices.feature
|
|
840
840
|
- features/billing_machine_multiple_vat.feature
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
/*! js-url - v2.3.0 - 2016-03-10 */window.url=function(){function a(){}function b(a){return decodeURIComponent(a.replace(/\+/g," "))}function c(a,b){var c=a.charAt(0),d=b.split(c);return c===a?d:(a=parseInt(a.substring(1),10),d[0>a?d.length+a:a-1])}function d(a,c){for(var d=a.charAt(0),e=c.split("&"),f=[],g={},h=[],i=a.substring(1),j=0,k=e.length;k>j;j++)if(f=e[j].match(/(.*?)=(.*)/),f||(f=[e[j],e[j],""]),""!==f[1].replace(/\s/g,"")){if(f[2]=b(f[2]||""),i===f[1])return f[2];h=f[1].match(/(.*)\[([0-9]+)\]/),h?(g[h[1]]=g[h[1]]||[],g[h[1]][h[2]]=f[2]):g[f[1]]=f[2]}return d===a?g:g[i]}return function(b,e){var f,g={};if("tld?"===b)return a();if(e=e||window.location.toString(),!b)return e;if(b=b.toString(),f=e.match(/^mailto:([^\/].+)/))g.protocol="mailto",g.email=f[1];else{if((f=e.match(/(.*?)\/#\!(.*)/))&&(e=f[1]+f[2]),(f=e.match(/(.*?)#(.*)/))&&(g.hash=f[2],e=f[1]),g.hash&&b.match(/^#/))return d(b,g.hash);if((f=e.match(/(.*?)\?(.*)/))&&(g.query=f[2],e=f[1]),g.query&&b.match(/^\?/))return d(b,g.query);if((f=e.match(/(.*?)\:?\/\/(.*)/))&&(g.protocol=f[1].toLowerCase(),e=f[2]),(f=e.match(/(.*?)(\/.*)/))&&(g.path=f[2],e=f[1]),g.path=(g.path||"").replace(/^([^\/])/,"/$1").replace(/\/$/,""),b.match(/^[\-0-9]+$/)&&(b=b.replace(/^([^\/])/,"/$1")),b.match(/^\//))return c(b,g.path.substring(1));if(f=c("/-1",g.path.substring(1)),f&&(f=f.match(/(.*?)\.(.*)/))&&(g.file=f[0],g.filename=f[1],g.fileext=f[2]),(f=e.match(/(.*)\:([0-9]+)$/))&&(g.port=f[2],e=f[1]),(f=e.match(/(.*?)@(.*)/))&&(g.auth=f[1],e=f[2]),g.auth&&(f=g.auth.match(/(.*)\:(.*)/),g.user=f?f[1]:g.auth,g.pass=f?f[2]:void 0),g.hostname=e.toLowerCase(),"."===b.charAt(0))return c(b,g.hostname);a()&&(f=g.hostname.match(a()),f&&(g.tld=f[3],g.domain=f[2]?f[2]+"."+f[3]:void 0,g.sub=f[1]||void 0)),g.port=g.port||("https"===g.protocol?"443":"80"),g.protocol=g.protocol||("443"===g.port?"https":"http")}return b in g?g[b]:"{}"===b?g:void 0}}(),"undefined"!=typeof jQuery&&jQuery.extend({url:function(a,b){return window.url(a,b)}});
|