dorsale 1.2.6 → 2.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/assets/javascripts/accounting.js +413 -0
- data/app/assets/javascripts/dorsale/billing_machine/all.coffee +20 -0
- data/app/assets/javascripts/dorsale/billing_machine/invoices.coffee +39 -0
- data/app/assets/javascripts/dorsale/billing_machine/quotations.coffee +38 -0
- data/app/assets/javascripts/dorsale/comments.coffee +4 -0
- data/app/assets/javascripts/dorsale/customer_vault/all.coffee +9 -0
- data/app/assets/javascripts/dorsale/datepicker.coffee +1 -1
- data/app/assets/javascripts/dorsale/flyboy/all.coffee +0 -0
- data/app/assets/javascripts/dorsale/forms.coffee +20 -6
- data/app/assets/stylesheets/dorsale/billing_machine/all.sass +15 -0
- data/app/assets/stylesheets/dorsale/bootstrap_nav_left.sass +34 -0
- data/app/assets/stylesheets/dorsale/comments.sass +25 -3
- data/app/assets/stylesheets/dorsale/customer_vault/all.sass +89 -0
- data/app/assets/stylesheets/dorsale/filters.sass +4 -1
- data/app/assets/stylesheets/dorsale/flyboy/all.sass +52 -0
- data/app/assets/stylesheets/dorsale/forms.sass +19 -0
- data/app/controllers/dorsale/alexandrie/attachments_controller.rb +52 -0
- data/app/controllers/dorsale/billing_machine/application_controller.rb +15 -0
- data/app/controllers/dorsale/billing_machine/invoices_controller.rb +180 -0
- data/app/controllers/dorsale/billing_machine/quotations_controller.rb +151 -0
- data/app/controllers/dorsale/comments_controller.rb +64 -17
- data/app/controllers/dorsale/customer_vault/application_controller.rb +26 -0
- data/app/controllers/dorsale/customer_vault/corporations_controller.rb +100 -0
- data/app/controllers/dorsale/customer_vault/individuals_controller.rb +104 -0
- data/app/controllers/dorsale/customer_vault/links_controller.rb +92 -0
- data/app/controllers/dorsale/customer_vault/people_controller.rb +42 -0
- data/app/controllers/dorsale/flyboy/application_controller.rb +9 -0
- data/app/controllers/dorsale/flyboy/folders_controller.rb +124 -0
- data/app/controllers/dorsale/flyboy/task_comments_controller.rb +29 -0
- data/app/controllers/dorsale/flyboy/tasks_controller.rb +171 -0
- data/app/controllers/dorsale/small_data/filters_controller.rb +7 -0
- data/app/helpers/dorsale/alexandrie/attachments_helper.rb +17 -0
- data/app/helpers/dorsale/all_helpers.rb +12 -9
- data/app/helpers/dorsale/button_helper.rb +23 -3
- data/app/helpers/dorsale/comments_helper.rb +4 -0
- data/app/helpers/dorsale/customer_vault/application_helper.rb +98 -0
- data/app/helpers/dorsale/flyboy/application_helper.rb +44 -0
- data/app/helpers/dorsale/form_helper.rb +7 -0
- data/app/helpers/dorsale/link_helper.rb +3 -2
- data/app/helpers/dorsale/routes_helper.rb +5 -3
- data/app/helpers/dorsale/text_helper.rb +28 -1
- data/app/models/dorsale/ability_helper.rb +7 -0
- data/app/models/dorsale/alexandrie/ability_helper.rb +9 -0
- data/app/models/dorsale/alexandrie/attachment.rb +18 -0
- data/app/models/dorsale/billing_machine/ability_helper.rb +10 -0
- data/app/models/dorsale/billing_machine/id_card.rb +18 -0
- data/app/models/dorsale/billing_machine/invoice.rb +126 -0
- data/app/models/dorsale/billing_machine/invoice_line.rb +27 -0
- data/app/models/dorsale/billing_machine/payment_term.rb +12 -0
- data/app/models/dorsale/billing_machine/quotation.rb +66 -0
- data/app/models/dorsale/billing_machine/quotation_line.rb +25 -0
- data/app/models/dorsale/billing_machine/small_data/filter_for_invoices.rb +21 -0
- data/app/models/dorsale/billing_machine/small_data/filter_for_quotations.rb +20 -0
- data/app/models/dorsale/billing_machine/small_data/filter_strategy_by_customer.rb +12 -0
- data/app/models/dorsale/billing_machine/small_data/filter_strategy_by_payment_status.rb +23 -0
- data/app/models/dorsale/billing_machine/small_data/filter_strategy_by_time_period.rb +27 -0
- data/app/models/dorsale/comment.rb +6 -2
- data/app/models/dorsale/customer_vault/ability_helper.rb +9 -0
- data/app/models/dorsale/customer_vault/corporation.rb +12 -0
- data/app/models/dorsale/customer_vault/individual.rb +17 -0
- data/app/models/dorsale/customer_vault/link.rb +10 -0
- data/app/models/dorsale/customer_vault/person.rb +35 -0
- data/app/models/dorsale/customer_vault/small_data/filter_for_people.rb +19 -0
- data/app/models/dorsale/customer_vault/small_data/filter_strategy_by_tags.rb +18 -0
- data/app/models/dorsale/flyboy/ability_helper.rb +41 -0
- data/app/models/dorsale/flyboy/folder.rb +77 -0
- data/app/models/dorsale/flyboy/small_data/filter_for_folders.rb +19 -0
- data/app/models/dorsale/flyboy/small_data/filter_for_tasks.rb +19 -0
- data/app/models/dorsale/flyboy/small_data/filter_strategy_by_done.rb +12 -0
- data/app/models/dorsale/flyboy/small_data/filter_strategy_by_nothing.rb +11 -0
- data/app/models/dorsale/flyboy/small_data/filter_strategy_by_status.rb +15 -0
- data/app/models/dorsale/flyboy/task.rb +97 -0
- data/app/models/dorsale/flyboy/task_comment.rb +35 -0
- data/app/pdfs/dorsale/billing_machine/invoice_pdf.rb +209 -0
- data/app/pdfs/dorsale/billing_machine/quotation_pdf.rb +53 -0
- data/app/pdfs/dorsale/flyboy/roadmap.rb +51 -0
- data/app/uploaders/dorsale/alexandrie/file_uploader.rb +6 -0
- data/app/uploaders/dorsale/file_uploader.rb +9 -0
- data/app/uploaders/dorsale/image_uploader.rb +7 -0
- data/app/views/dorsale/_contextual.html.slim +3 -0
- data/app/views/dorsale/alexandrie/attachments/_form.html.slim +13 -0
- data/app/views/dorsale/alexandrie/attachments/_form_and_list.html.slim +2 -0
- data/app/views/dorsale/alexandrie/attachments/_list.html.slim +7 -0
- data/app/views/dorsale/billing_machine/invoices/_data_context.html.slim +10 -0
- data/app/views/dorsale/billing_machine/invoices/_filters.html.slim +16 -0
- data/app/views/dorsale/billing_machine/invoices/_form.html.slim +62 -0
- data/app/views/dorsale/billing_machine/invoices/_line_fields.html.slim +23 -0
- data/app/views/dorsale/billing_machine/invoices/_list.html.slim +30 -0
- data/app/views/dorsale/billing_machine/invoices/edit.html.slim +2 -0
- data/app/views/dorsale/billing_machine/invoices/index.html.slim +15 -0
- data/app/views/dorsale/billing_machine/invoices/new.html.slim +2 -0
- data/app/views/dorsale/billing_machine/invoices/show.html.slim +53 -0
- data/app/views/dorsale/billing_machine/quotations/_data_context.html.slim +10 -0
- data/app/views/dorsale/billing_machine/quotations/_filters.html.slim +13 -0
- data/app/views/dorsale/billing_machine/quotations/_form.html.slim +55 -0
- data/app/views/dorsale/billing_machine/quotations/_line_fields.html.slim +23 -0
- data/app/views/dorsale/billing_machine/quotations/_list.html.slim +30 -0
- data/app/views/dorsale/billing_machine/quotations/edit.html.slim +2 -0
- data/app/views/dorsale/billing_machine/quotations/index.html.slim +14 -0
- data/app/views/dorsale/billing_machine/quotations/new.html.slim +2 -0
- data/app/views/dorsale/billing_machine/quotations/show.html.slim +61 -0
- data/app/views/dorsale/comments/_comment.html.slim +23 -9
- data/app/views/dorsale/comments/_comments.html.slim +2 -2
- data/app/views/dorsale/comments/_form.html.slim +1 -1
- data/app/views/dorsale/comments/_list.html.slim +2 -0
- data/app/views/dorsale/comments/edit.html.slim +5 -0
- data/app/views/dorsale/customer_vault/_breadcrumb.html.slim +4 -0
- data/app/views/dorsale/customer_vault/corporations/_context.html.slim +20 -0
- data/app/views/dorsale/customer_vault/corporations/_form.html.slim +21 -0
- data/app/views/dorsale/customer_vault/corporations/_list_details.html.slim +20 -0
- data/app/views/dorsale/customer_vault/corporations/edit.html.slim +14 -0
- data/app/views/dorsale/customer_vault/corporations/new.html.slim +14 -0
- data/app/views/dorsale/customer_vault/corporations/show.html.slim +1 -0
- data/app/views/dorsale/customer_vault/individuals/_context.html.slim +15 -0
- data/app/views/dorsale/customer_vault/individuals/_form.html.slim +22 -0
- data/app/views/dorsale/customer_vault/individuals/_list_details.html.slim +20 -0
- data/app/views/dorsale/customer_vault/individuals/edit.html.slim +14 -0
- data/app/views/dorsale/customer_vault/individuals/new.html.slim +14 -0
- data/app/views/dorsale/customer_vault/individuals/show.html.slim +1 -0
- data/app/views/dorsale/customer_vault/links/_title.html.slim +7 -0
- data/app/views/dorsale/customer_vault/links/edit.html.slim +19 -0
- data/app/views/dorsale/customer_vault/links/new.html.slim +15 -0
- data/app/views/dorsale/customer_vault/people/_activity_tab.html.slim +5 -0
- data/app/views/dorsale/customer_vault/people/_comment.html.slim +1 -0
- data/app/views/dorsale/customer_vault/people/_context.html.slim +4 -0
- data/app/views/dorsale/customer_vault/people/_data_context.html.slim +32 -0
- data/app/views/dorsale/customer_vault/people/_filters.html.slim +15 -0
- data/app/views/dorsale/customer_vault/people/_index_tabs.html.slim +7 -0
- data/app/views/dorsale/customer_vault/people/_links_tab.html.slim +16 -0
- data/app/views/dorsale/customer_vault/people/_new_people_contexts.html.slim +7 -0
- data/app/views/dorsale/customer_vault/people/_show.html.slim +31 -0
- data/app/views/dorsale/customer_vault/people/_tasks_tab.html.slim +1 -0
- data/app/views/dorsale/customer_vault/people/activity.slim +20 -0
- data/app/views/dorsale/customer_vault/people/list.html.slim +27 -0
- data/app/views/dorsale/flyboy/_filters.html.slim +12 -0
- data/app/views/dorsale/flyboy/folders/_actions.html.slim +15 -0
- data/app/views/dorsale/flyboy/folders/_context.html.slim +18 -0
- data/app/views/dorsale/flyboy/folders/_form.html.slim +22 -0
- data/app/views/dorsale/flyboy/folders/_list.html.slim +30 -0
- data/app/views/dorsale/flyboy/folders/edit.html.slim +2 -0
- data/app/views/dorsale/flyboy/folders/index.html.slim +8 -0
- data/app/views/dorsale/flyboy/folders/new.html.slim +2 -0
- data/app/views/dorsale/flyboy/folders/show.html.slim +9 -0
- data/app/views/dorsale/flyboy/task_comments/_list.html.slim +31 -0
- data/app/views/dorsale/flyboy/tasks/_actions.html.slim +9 -0
- data/app/views/dorsale/flyboy/tasks/_context.html.slim +15 -0
- data/app/views/dorsale/flyboy/tasks/_form.html.slim +29 -0
- data/app/views/dorsale/flyboy/tasks/_list.html.slim +43 -0
- data/app/views/dorsale/flyboy/tasks/_tasks_for_taskable.html.slim +6 -0
- data/app/views/dorsale/flyboy/tasks/edit.html.slim +2 -0
- data/app/views/dorsale/flyboy/tasks/index.html.slim +10 -0
- data/app/views/dorsale/flyboy/tasks/index.xls.erb +29 -0
- data/app/views/dorsale/flyboy/tasks/new.html.slim +2 -0
- data/app/views/dorsale/flyboy/tasks/show.html.slim +14 -0
- data/app/views/dorsale/search/_form.html.slim +6 -0
- data/config/locales/alexandrie.fr.yml +8 -0
- data/config/locales/billing_machine.fr.yml +50 -0
- data/config/locales/common.fr.yml +142 -0
- data/config/locales/customer_vault.fr.yml +69 -0
- data/config/locales/flyboy.fr.yml +66 -0
- data/config/locales/fr.yml +8 -87
- data/config/routes.rb +50 -1
- data/db/migrate/20141010140200_create_dorsale_addresses.rb +1 -1
- data/db/migrate/20150312083147_create_dorsale_comments.rb +3 -3
- data/db/migrate/20150616074852_create_dorsale_alexandrie_attachments.rb +9 -0
- data/db/migrate/20150622075000_create_flyboy.rb +50 -0
- data/db/migrate/20150622075038_create_billing_machine.rb +121 -0
- data/db/migrate/20150622105217_create_customer_vault.rb +49 -0
- data/db/migrate/20150623093218_dorsale_v2_changes.rb +68 -0
- data/db/migrate/20150625093326_billing_machine_quotations_add_expires_at.rb +5 -0
- data/db/migrate/20150625131155_billing_machine_add_tracking_ids.rb +6 -0
- data/lib/active_record_comma_type_cast.rb +12 -0
- data/lib/dorsale/alexandrie/prawn.rb +17 -0
- data/lib/dorsale/engine.rb +19 -0
- data/lib/dorsale/file_loader.rb +10 -0
- data/lib/dorsale/model_i18n.rb +21 -0
- data/lib/dorsale/model_to_s.rb +13 -0
- data/lib/dorsale/polymorphic_id.rb +2 -0
- data/lib/dorsale/version.rb +1 -1
- data/spec/controllers/dorsale/alexandrie/attachments_controller_spec.rb +47 -0
- data/spec/controllers/dorsale/comments_controller_spec.rb +45 -0
- data/spec/controllers/dorsale/customer_vault/corporations_controller_spec.rb +132 -0
- data/spec/controllers/dorsale/customer_vault/individuals_controller_spec.rb +130 -0
- data/spec/controllers/dorsale/customer_vault/people_controller_spec.rb +59 -0
- data/spec/controllers/dorsale/flyboy/folders_controller_spec.rb +111 -0
- data/spec/controllers/dorsale/flyboy/task_comments_controller_spec.rb +16 -0
- data/spec/controllers/dorsale/flyboy/tasks_controller_spec.rb +234 -0
- data/spec/dummy/app/assets/javascripts/application.coffee +10 -0
- data/spec/dummy/app/assets/stylesheets/application.sass +9 -0
- data/spec/dummy/app/controllers/application_controller.rb +4 -0
- data/spec/dummy/app/models/ability.rb +16 -0
- data/spec/dummy/app/models/dummy_model.rb +2 -0
- data/spec/dummy/app/views/layouts/application.html.erb +10 -3
- data/spec/dummy/config/application.rb +4 -2
- data/spec/dummy/db/development.sqlite3 +0 -0
- data/spec/dummy/db/migrate/20150616082916_create_dorsale_dummy_models.rb +8 -0
- data/spec/dummy/db/migrate/20150624081204_acts_as_taggable_on_migration.acts_as_taggable_on_engine.rb +31 -0
- data/spec/dummy/db/migrate/20150624081205_add_missing_unique_indices.acts_as_taggable_on_engine.rb +20 -0
- data/spec/dummy/db/migrate/20150624081206_add_taggings_counter_cache_to_tags.acts_as_taggable_on_engine.rb +15 -0
- data/spec/dummy/db/migrate/20150624081207_add_missing_taggable_index.acts_as_taggable_on_engine.rb +10 -0
- data/spec/dummy/db/migrate/20150624081208_change_collation_for_tag_names.acts_as_taggable_on_engine.rb +10 -0
- data/spec/dummy/db/schema.rb +243 -5
- data/spec/dummy/db/seed.rb +1 -0
- data/spec/dummy/db/test.sqlite3 +0 -0
- data/spec/dummy/log/development.log +227 -0
- data/spec/dummy/log/test.log +2740 -25
- data/spec/dummy/{app/assets/stylesheets/application.css → tmp/cache/assets/development/sprockets/13fe41fee1fe35b49d145bcc06610705} +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/2f5173deea6c795b8fdde723bb4b63af +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/357970feca3ac29060c1e3861e2c0953 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/cffd775d018f68ce5dba1ee0d951a994 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/d771ace226fc8215a3572e0aa35bb0d6 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/f7cbd26ba1d28d48de824f0e94586655 +0 -0
- data/spec/factories/alexandrie_attachments.rb +12 -0
- data/spec/factories/billing_machine_id_cards.rb +26 -0
- data/spec/factories/billing_machine_invoice_lines.rb +11 -0
- data/spec/factories/billing_machine_invoices.rb +12 -0
- data/spec/factories/billing_machine_payment_terms.rb +5 -0
- data/spec/factories/billing_machine_quotation_lines.rb +12 -0
- data/spec/factories/billing_machine_quotations.rb +12 -0
- data/spec/factories/customer_vault_corporations.rb +14 -0
- data/spec/factories/customer_vault_individuals.rb +19 -0
- data/spec/factories/customer_vault_links.rb +7 -0
- data/spec/factories/dorsale_addresses.rb +6 -8
- data/spec/factories/dorsale_comments.rb +8 -0
- data/spec/factories/flyboy_folders.rb +7 -0
- data/spec/factories/flyboy_task_comments.rb +8 -0
- data/spec/factories/flyboy_tasks.rb +12 -0
- data/spec/files/pdf.pdf +0 -0
- data/spec/helpers/dorsale/flyboy/application_helper_spec.rb +91 -0
- data/spec/helpers/dorsale/link_helper_spec.rb +1 -0
- data/spec/helpers/dorsale/text_helper_spec.rb +33 -9
- data/spec/models/dorsale/ability_helper_spec.rb +11 -0
- data/spec/models/dorsale/alexandrie/ability_helper_spec.rb +10 -0
- data/spec/models/dorsale/alexandrie/attachment_spec.rb +12 -0
- data/spec/models/dorsale/billing_machine/id_card_spec.rb +12 -0
- data/spec/models/dorsale/billing_machine/invoice_line_spec.rb +50 -0
- data/spec/models/dorsale/billing_machine/invoice_spec.rb +156 -0
- data/spec/models/dorsale/billing_machine/quotation_line_spec.rb +36 -0
- data/spec/models/dorsale/billing_machine/quotation_spec.rb +91 -0
- data/spec/models/dorsale/comment_spec.rb +11 -0
- data/spec/models/dorsale/customer_vault/corporation_spec.rb +17 -0
- data/spec/models/dorsale/customer_vault/individual_spec.rb +17 -0
- data/spec/models/dorsale/customer_vault/link_spec.rb +12 -0
- data/spec/models/dorsale/customer_vault/person_spec.rb +44 -0
- data/spec/models/dorsale/flyboy/ability_spec.rb +148 -0
- data/spec/models/dorsale/flyboy/folder_spec.rb +103 -0
- data/spec/models/dorsale/flyboy/task_comment_spec.rb +52 -0
- data/spec/models/dorsale/flyboy/task_spec.rb +83 -0
- data/spec/pdfs/dorsale/billing_machine/invoice_pdf_spec.rb +252 -0
- data/spec/pdfs/dorsale/billing_machine/quotation_pdf_spec.rb +255 -0
- data/spec/rails_helper.rb +11 -11
- data/spec/routing/dorsale/alexandrie/attachments_routing_spec.rb +19 -0
- data/spec/routing/dorsale/billing_machine/invoices_routing_spec.rb +53 -0
- data/spec/routing/dorsale/billing_machine/quotations_routing_spec.rb +43 -0
- data/spec/routing/dorsale/comments_routing_spec.rb +25 -0
- data/spec/routing/dorsale/customer_vault/corporations_routing_spec.rb +66 -0
- data/spec/routing/dorsale/customer_vault/individual_routing_spec.rb +66 -0
- data/spec/routing/dorsale/customer_vault/people_routing_spec.rb +22 -0
- data/spec/routing/dorsale/flyboy/folders_routing_spec.rb +44 -0
- data/spec/routing/dorsale/flyboy/task_comments_routing_spec.rb +12 -0
- data/spec/routing/dorsale/flyboy/tasks_routing_spec.rb +44 -0
- data/spec/spec_helper.rb +0 -6
- metadata +439 -10
- data/MIT-LICENSE +0 -20
- data/README.rdoc +0 -3
- data/spec/dummy/app/assets/javascripts/application.js +0 -13
data/config/routes.rb
CHANGED
@@ -1,7 +1,56 @@
|
|
1
1
|
Dorsale::Engine.routes.draw do
|
2
|
-
resources :comments, only: [:create]
|
2
|
+
resources :comments, only: [:create, :edit, :update, :destroy]
|
3
3
|
|
4
4
|
namespace :small_data do
|
5
5
|
resources :filters, only: [:create]
|
6
6
|
end
|
7
|
+
|
8
|
+
namespace :alexandrie do
|
9
|
+
resources :attachments, only: [:create, :destroy]
|
10
|
+
end
|
11
|
+
|
12
|
+
namespace :flyboy do
|
13
|
+
resources :folders do
|
14
|
+
member do
|
15
|
+
patch :open
|
16
|
+
patch :close
|
17
|
+
end
|
18
|
+
end
|
19
|
+
|
20
|
+
resources :tasks do
|
21
|
+
member do
|
22
|
+
patch :complete
|
23
|
+
patch :snooze
|
24
|
+
end
|
25
|
+
end
|
26
|
+
|
27
|
+
resources :task_comments, only: [:create]
|
28
|
+
end
|
29
|
+
|
30
|
+
namespace :billing_machine do
|
31
|
+
resources :invoices, except: [:destroy] do
|
32
|
+
member do
|
33
|
+
get :copy
|
34
|
+
patch :pay
|
35
|
+
end
|
36
|
+
end
|
37
|
+
|
38
|
+
resources :quotations
|
39
|
+
end
|
40
|
+
|
41
|
+
namespace :customer_vault do
|
42
|
+
resources :corporations, except: [:index] do
|
43
|
+
resources :links, except: [:index]
|
44
|
+
end
|
45
|
+
|
46
|
+
resources :individuals, :except => [:index] do
|
47
|
+
resources :links, except: [:index]
|
48
|
+
end
|
49
|
+
|
50
|
+
namespace :people do
|
51
|
+
get "/", action: "index"
|
52
|
+
get :activity
|
53
|
+
get :list
|
54
|
+
end
|
55
|
+
end
|
7
56
|
end
|
@@ -3,12 +3,12 @@ class CreateDorsaleComments < ActiveRecord::Migration
|
|
3
3
|
create_table :dorsale_comments do |t|
|
4
4
|
t.integer :user_id
|
5
5
|
t.string :user_type
|
6
|
-
|
6
|
+
|
7
7
|
t.integer :commentable_id
|
8
8
|
t.string :commentable_type
|
9
|
-
|
9
|
+
|
10
10
|
t.text :text
|
11
|
-
|
11
|
+
|
12
12
|
t.timestamps null: false
|
13
13
|
end
|
14
14
|
end
|
@@ -0,0 +1,50 @@
|
|
1
|
+
class CreateFlyboy < ActiveRecord::Migration
|
2
|
+
def change
|
3
|
+
create_table :dorsale_flyboy_folders do |t|
|
4
|
+
t.integer :folderable_id
|
5
|
+
t.string :folderable_type
|
6
|
+
|
7
|
+
t.string :name
|
8
|
+
t.text :description
|
9
|
+
t.integer :progress
|
10
|
+
t.string :status
|
11
|
+
t.string :tracking
|
12
|
+
t.integer :version
|
13
|
+
|
14
|
+
t.timestamps null: false
|
15
|
+
end
|
16
|
+
|
17
|
+
add_index :dorsale_flyboy_folders, :folderable_id
|
18
|
+
add_index :dorsale_flyboy_folders, :folderable_type
|
19
|
+
|
20
|
+
create_table :dorsale_flyboy_task_comments do |t|
|
21
|
+
t.integer :task_id
|
22
|
+
|
23
|
+
t.datetime :date
|
24
|
+
t.text :description
|
25
|
+
t.integer :progress
|
26
|
+
|
27
|
+
t.timestamps null: false
|
28
|
+
end
|
29
|
+
|
30
|
+
add_index :dorsale_flyboy_task_comments, :task_id
|
31
|
+
|
32
|
+
create_table :dorsale_flyboy_tasks do |t|
|
33
|
+
t.integer :taskable_id
|
34
|
+
t.string :taskable_type
|
35
|
+
|
36
|
+
t.string :name
|
37
|
+
t.text :description
|
38
|
+
t.integer :progress
|
39
|
+
t.boolean :done
|
40
|
+
t.date :term
|
41
|
+
t.date :reminder
|
42
|
+
|
43
|
+
t.timestamps null: false
|
44
|
+
end
|
45
|
+
|
46
|
+
add_index :dorsale_flyboy_tasks, :taskable_id
|
47
|
+
add_index :dorsale_flyboy_tasks, :taskable_type
|
48
|
+
|
49
|
+
end
|
50
|
+
end
|
@@ -0,0 +1,121 @@
|
|
1
|
+
class CreateBillingMachine < ActiveRecord::Migration
|
2
|
+
def change
|
3
|
+
create_table :dorsale_billing_machine_id_cards do |t|
|
4
|
+
t.string :id_card_name
|
5
|
+
t.string :entity_name
|
6
|
+
t.string :siret
|
7
|
+
t.string :legal_form
|
8
|
+
t.integer :capital
|
9
|
+
t.string :registration_number
|
10
|
+
t.string :intracommunity_vat
|
11
|
+
t.string :address1
|
12
|
+
t.string :address2
|
13
|
+
t.string :zip
|
14
|
+
t.string :city
|
15
|
+
t.string :phone
|
16
|
+
t.string :contact_full_name
|
17
|
+
t.string :contact_phone
|
18
|
+
t.string :contact_address_1
|
19
|
+
t.string :contact_address_2
|
20
|
+
t.string :contact_zip
|
21
|
+
t.string :contact_city
|
22
|
+
t.string :iban
|
23
|
+
t.string :bic_swift
|
24
|
+
t.string :bank_name
|
25
|
+
t.string :bank_address
|
26
|
+
t.string :ape_naf
|
27
|
+
t.text :custom_info_1
|
28
|
+
t.text :custom_info_2
|
29
|
+
t.text :custom_info_3
|
30
|
+
t.string :contact_fax
|
31
|
+
t.string :contact_email
|
32
|
+
t.string :logo
|
33
|
+
t.string :registration_city
|
34
|
+
|
35
|
+
t.timestamps null: false
|
36
|
+
end
|
37
|
+
|
38
|
+
create_table :dorsale_billing_machine_payment_terms do |t|
|
39
|
+
t.string :label
|
40
|
+
t.timestamps null: false
|
41
|
+
end
|
42
|
+
|
43
|
+
create_table :dorsale_billing_machine_invoices do |t|
|
44
|
+
t.integer :customer_id
|
45
|
+
t.string :customer_type
|
46
|
+
t.integer :payment_term_id
|
47
|
+
t.integer :id_card_id
|
48
|
+
|
49
|
+
t.date :date
|
50
|
+
t.string :label
|
51
|
+
t.decimal :total_duty
|
52
|
+
t.decimal :vat_amount
|
53
|
+
t.decimal :total_all_taxes
|
54
|
+
t.decimal :advance
|
55
|
+
t.decimal :balance
|
56
|
+
t.integer :unique_index
|
57
|
+
t.decimal :vat_rate
|
58
|
+
t.boolean :paid
|
59
|
+
t.date :due_date
|
60
|
+
|
61
|
+
t.timestamps null: false
|
62
|
+
end
|
63
|
+
|
64
|
+
add_index :dorsale_billing_machine_invoices, :customer_id
|
65
|
+
add_index :dorsale_billing_machine_invoices, :customer_type
|
66
|
+
add_index :dorsale_billing_machine_invoices, :id_card_id
|
67
|
+
add_index :dorsale_billing_machine_invoices, :payment_term_id
|
68
|
+
|
69
|
+
create_table :dorsale_billing_machine_invoice_lines do |t|
|
70
|
+
t.integer :invoice_id
|
71
|
+
|
72
|
+
t.text :label
|
73
|
+
t.decimal :quantity
|
74
|
+
t.string :unit
|
75
|
+
t.decimal :unit_price
|
76
|
+
t.decimal :total
|
77
|
+
|
78
|
+
t.timestamps null: false
|
79
|
+
end
|
80
|
+
|
81
|
+
add_index :dorsale_billing_machine_invoice_lines, :invoice_id
|
82
|
+
|
83
|
+
create_table :dorsale_billing_machine_quotations do |t|
|
84
|
+
t.integer :customer_id
|
85
|
+
t.string :customer_type
|
86
|
+
t.integer :id_card_id
|
87
|
+
t.integer :payment_term_id
|
88
|
+
|
89
|
+
t.date :date
|
90
|
+
t.string :label
|
91
|
+
t.decimal :total_duty
|
92
|
+
t.decimal :vat_amount
|
93
|
+
t.decimal :total_all_taxes
|
94
|
+
t.integer :unique_index
|
95
|
+
t.decimal :vat_rate
|
96
|
+
t.text :comments
|
97
|
+
|
98
|
+
t.timestamps null: false
|
99
|
+
end
|
100
|
+
|
101
|
+
add_index :dorsale_billing_machine_quotations, :customer_id
|
102
|
+
add_index :dorsale_billing_machine_quotations, :customer_type
|
103
|
+
add_index :dorsale_billing_machine_quotations, :id_card_id
|
104
|
+
add_index :dorsale_billing_machine_quotations, :payment_term_id
|
105
|
+
|
106
|
+
create_table :dorsale_billing_machine_quotation_lines do |t|
|
107
|
+
t.integer :quotation_id
|
108
|
+
|
109
|
+
t.text :label
|
110
|
+
t.decimal :quantity
|
111
|
+
t.string :unit
|
112
|
+
t.decimal :unit_price
|
113
|
+
t.decimal :total
|
114
|
+
|
115
|
+
t.timestamps null: false
|
116
|
+
end
|
117
|
+
|
118
|
+
add_index :dorsale_billing_machine_quotation_lines, :quotation_id
|
119
|
+
|
120
|
+
end
|
121
|
+
end
|
@@ -0,0 +1,49 @@
|
|
1
|
+
class CreateCustomerVault < ActiveRecord::Migration
|
2
|
+
def change
|
3
|
+
create_table :dorsale_customer_vault_corporations do |t|
|
4
|
+
t.string :name
|
5
|
+
t.string :short_name
|
6
|
+
t.string :email
|
7
|
+
t.string :phone
|
8
|
+
t.string :fax
|
9
|
+
t.string :www
|
10
|
+
t.string :legal_form
|
11
|
+
t.integer :capital
|
12
|
+
t.string :immatriculation_number_1
|
13
|
+
t.string :immatriculation_number_2
|
14
|
+
|
15
|
+
t.timestamps null: false
|
16
|
+
end
|
17
|
+
|
18
|
+
create_table :dorsale_customer_vault_individuals do |t|
|
19
|
+
t.string :first_name
|
20
|
+
t.string :last_name
|
21
|
+
t.string :short_name
|
22
|
+
t.string :email
|
23
|
+
t.string :title
|
24
|
+
t.string :twitter
|
25
|
+
t.string :www
|
26
|
+
t.text :context
|
27
|
+
t.string :phone
|
28
|
+
t.string :fax
|
29
|
+
t.string :mobile
|
30
|
+
|
31
|
+
t.timestamps null: false
|
32
|
+
end
|
33
|
+
|
34
|
+
create_table :dorsale_customer_vault_links do |t|
|
35
|
+
t.string :title
|
36
|
+
t.integer :alice_id
|
37
|
+
t.string :alice_type
|
38
|
+
t.integer :bob_id
|
39
|
+
t.string :bob_type
|
40
|
+
|
41
|
+
t.timestamps null: false
|
42
|
+
end
|
43
|
+
|
44
|
+
add_index :dorsale_customer_vault_links, :alice_id
|
45
|
+
add_index :dorsale_customer_vault_links, :alice_type
|
46
|
+
add_index :dorsale_customer_vault_links, :bob_id
|
47
|
+
add_index :dorsale_customer_vault_links, :bob_type
|
48
|
+
end
|
49
|
+
end
|
@@ -0,0 +1,68 @@
|
|
1
|
+
class DorsaleV2Changes < ActiveRecord::Migration
|
2
|
+
def change
|
3
|
+
return # Remove return and comment inutile migrations
|
4
|
+
|
5
|
+
rename_table :customer_vault_corporations, :dorsale_customer_vault_corporations
|
6
|
+
rename_table :customer_vault_individuals, :dorsale_customer_vault_individuals
|
7
|
+
rename_table :customer_vault_links, :dorsale_customer_vault_links
|
8
|
+
|
9
|
+
# Short name needed by billing machine
|
10
|
+
add_column :dorsale_customer_vault_individuals, :short_name, :string
|
11
|
+
add_column :dorsale_customer_vault_corporations, :short_name, :string
|
12
|
+
|
13
|
+
# Rename Flyboy tables
|
14
|
+
rename_table :flyboy_goals, :dorsale_flyboy_folders
|
15
|
+
rename_table :flyboy_tasks, :dorsale_flyboy_tasks
|
16
|
+
rename_table :flyboy_task_comments, :dorsale_flyboy_task_comments
|
17
|
+
|
18
|
+
# Add Flyboy folderable
|
19
|
+
add_column :dorsale_flyboy_folders, :folderable_id, :integer
|
20
|
+
add_column :dorsale_flyboy_folders, :folderable_type, :string
|
21
|
+
|
22
|
+
Dorsale::Flyboy::Task
|
23
|
+
.where(taskable_type: "Flyboy::Goal")
|
24
|
+
.update_all(taskable_type: "Dorsale::Flyboy::Folder")
|
25
|
+
|
26
|
+
Dorsale::Comment
|
27
|
+
.where(commentable_type: "CustomerVault::Corporation")
|
28
|
+
.update_all(commentable_type: "Dorsale::CustomerVault::Corporation")
|
29
|
+
Dorsale::Comment
|
30
|
+
.where(commentable_type: "CustomerVault::Individual")
|
31
|
+
.update_all(commentable_type: "Dorsale::CustomerVault::Individual")
|
32
|
+
|
33
|
+
Dorsale::Address
|
34
|
+
.where(addressable_type: "CustomerVault::Corporation")
|
35
|
+
.update_all(addressable_type: "Dorsale::CustomerVault::Corporation")
|
36
|
+
Dorsale::Address
|
37
|
+
.where(addressable_type: "CustomerVault::Individual")
|
38
|
+
.update_all(addressable_type: "Dorsale::CustomerVault::Individual")
|
39
|
+
|
40
|
+
ActsAsTaggableOn::Tagging
|
41
|
+
.where(taggable_type: "CustomerVault::Corporation")
|
42
|
+
.update_all(taggable_type: "Dorsale::CustomerVault::Corporation")
|
43
|
+
ActsAsTaggableOn::Tagging
|
44
|
+
.where(taggable_type: "CustomerVault::Individual")
|
45
|
+
.update_all(taggable_type: "Dorsale::CustomerVault::Individual")
|
46
|
+
|
47
|
+
Dorsale::CustomerVault::Link
|
48
|
+
.where(alice_type: "CustomerVault::Corporation")
|
49
|
+
.update_all(alice_type: "Dorsale::CustomerVault::Corporation")
|
50
|
+
Dorsale::CustomerVault::Link
|
51
|
+
.where(alice_type: "CustomerVault::Individual")
|
52
|
+
.update_all(alice_type: "Dorsale::CustomerVault::Individual")
|
53
|
+
Dorsale::CustomerVault::Link
|
54
|
+
.where(bob_type: "CustomerVault::Corporation")
|
55
|
+
.update_all(bob_type: "Dorsale::CustomerVault::Corporation")
|
56
|
+
Dorsale::CustomerVault::Link
|
57
|
+
.where(bob_type: "CustomerVault::Individual")
|
58
|
+
.update_all(bob_type: "Dorsale::CustomerVault::Individual")
|
59
|
+
|
60
|
+
Dorsale::Flyboy::Task
|
61
|
+
.where(taskable_type: "CustomerVault::Corporation")
|
62
|
+
.update_all(taskable_type: "Dorsale::CustomerVault::Corporation")
|
63
|
+
Dorsale::Flyboy::Task
|
64
|
+
.where(taskable_type: "CustomerVault::Individual")
|
65
|
+
.update_all(taskable_type: "Dorsale::CustomerVault::Individual")
|
66
|
+
|
67
|
+
end
|
68
|
+
end
|
@@ -0,0 +1,12 @@
|
|
1
|
+
module ActiveRecordCommaTypeCast
|
2
|
+
def cast_value(value)
|
3
|
+
if value.is_a?(String)
|
4
|
+
super value.gsub(",", ".").gsub(" ", "")
|
5
|
+
else
|
6
|
+
super value
|
7
|
+
end
|
8
|
+
end
|
9
|
+
end
|
10
|
+
|
11
|
+
ActiveRecord::Type::Decimal.send(:prepend, ::ActiveRecordCommaTypeCast)
|
12
|
+
ActiveRecord::Type::Float.send(:prepend, ::ActiveRecordCommaTypeCast)
|
@@ -0,0 +1,17 @@
|
|
1
|
+
module Dorsale
|
2
|
+
module Alexandrie
|
3
|
+
module Prawn
|
4
|
+
def render_with_attachments
|
5
|
+
final_pdf = ::CombinePDF.parse(self.render)
|
6
|
+
|
7
|
+
@main_document.attachments.each do |attachment|
|
8
|
+
next unless File.extname(attachment.file.path) == ".pdf"
|
9
|
+
|
10
|
+
final_pdf << ::CombinePDF.load(attachment.file.path)
|
11
|
+
end
|
12
|
+
|
13
|
+
final_pdf.to_pdf
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
data/lib/dorsale/engine.rb
CHANGED
@@ -10,14 +10,32 @@ require "kaminari"
|
|
10
10
|
require "turbolinks"
|
11
11
|
require "bootstrap-kaminari-views"
|
12
12
|
require "bootstrap-datepicker-rails"
|
13
|
+
require "cocoon"
|
14
|
+
require "selectize-rails"
|
13
15
|
|
14
16
|
require "rails-i18n"
|
15
17
|
require "cancan"
|
16
18
|
require "awesome_print"
|
17
19
|
require "kaminari-i18n"
|
20
|
+
require "carrierwave"
|
21
|
+
require "aasm"
|
22
|
+
require "handles_sortable_columns"
|
23
|
+
require "csv"
|
24
|
+
require "pdf/reader"
|
25
|
+
require "prawn"
|
26
|
+
require "prawn/table"
|
27
|
+
require "combine_pdf"
|
18
28
|
|
29
|
+
require "dorsale/file_loader"
|
30
|
+
require "dorsale/polymorphic_id"
|
19
31
|
require "dorsale/simple_form"
|
20
32
|
require "dorsale/simple_form_bootstrap"
|
33
|
+
require "dorsale/model_i18n"
|
34
|
+
require "dorsale/model_to_s"
|
35
|
+
require "dorsale/alexandrie/prawn"
|
36
|
+
|
37
|
+
require "acts-as-taggable-on"
|
38
|
+
require "active_record_comma_type_cast"
|
21
39
|
|
22
40
|
module Dorsale
|
23
41
|
class Engine < ::Rails::Engine
|
@@ -29,5 +47,6 @@ module Dorsale
|
|
29
47
|
g.template_engine :slim
|
30
48
|
end
|
31
49
|
|
50
|
+
Mime::Type.register "application/vnd.ms-excel", :xls
|
32
51
|
end
|
33
52
|
end
|