accountant_clerk 0.5 → 0.6

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 (68) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +67 -11
  3. data/.travis.yml +10 -0
  4. data/Gemfile +33 -0
  5. data/Gemfile.lock +306 -0
  6. data/README.md +13 -3
  7. data/Rakefile +6 -0
  8. data/accountant_clerk.gemspec +5 -3
  9. data/app/assets/javascripts/accountant_office.js.coffee +2 -0
  10. data/app/controllers/manage_controller_decorator.rb +4 -4
  11. data/app/views/manage/report.html.haml +20 -28
  12. data/config/locales/en.yml +7 -1
  13. data/lib/accountant_clerk/engine.rb +8 -2
  14. data/spec/controllers/orders_controller_spec.rb +88 -0
  15. data/spec/features/edit_spec.rb +28 -0
  16. data/spec/features/orders_spec.rb +32 -0
  17. data/spec/routing/orders_routing_spec.rb +36 -0
  18. data/spec/spec_helper.rb +31 -24
  19. data/spec/support/admin.rb +4 -0
  20. data/spec/support/capybara.rb +14 -0
  21. data/spec/support/cleaner.rb +22 -0
  22. data/spec/support/email.rb +6 -0
  23. data/spec/support/factory_girl.rb +3 -0
  24. data/spec/support/request_helper.rb +31 -0
  25. data/test_app/README.rdoc +28 -0
  26. data/test_app/app/assets/javascripts/application.js +15 -0
  27. data/test_app/app/assets/stylesheets/application.css +13 -0
  28. data/test_app/app/controllers/application_controller.rb +5 -0
  29. data/test_app/app/helpers/application_helper.rb +2 -0
  30. data/test_app/app/views/layouts/sales_clerk.haml +9 -0
  31. data/test_app/bin/bundle +3 -0
  32. data/test_app/bin/rails +4 -0
  33. data/test_app/bin/rake +4 -0
  34. data/test_app/config/application.rb +28 -0
  35. data/test_app/config/boot.rb +4 -0
  36. data/test_app/config/database.yml +25 -0
  37. data/test_app/config/environment.rb +5 -0
  38. data/test_app/config/environments/development.rb +32 -0
  39. data/test_app/config/environments/production.rb +80 -0
  40. data/test_app/config/environments/test.rb +39 -0
  41. data/test_app/config/initializers/backtrace_silencers.rb +7 -0
  42. data/test_app/config/initializers/filter_parameter_logging.rb +4 -0
  43. data/test_app/config/initializers/inflections.rb +16 -0
  44. data/test_app/config/initializers/mime_types.rb +5 -0
  45. data/test_app/config/initializers/secret_token.rb +12 -0
  46. data/test_app/config/initializers/session_store.rb +3 -0
  47. data/test_app/config/initializers/wrap_parameters.rb +14 -0
  48. data/test_app/config/locales/en.yml +23 -0
  49. data/test_app/config/routes.rb +4 -0
  50. data/test_app/config.ru +4 -0
  51. data/test_app/db/migrate/20141114205525_clerks.office.rb +16 -0
  52. data/test_app/db/migrate/20141114205526_suppliers.office.rb +10 -0
  53. data/test_app/db/migrate/20141114205527_categories.office.rb +19 -0
  54. data/test_app/db/migrate/20141114205528_items.office.rb +15 -0
  55. data/test_app/db/migrate/20141114205529_orders.office.rb +23 -0
  56. data/test_app/db/migrate/20141114205530_baskets.office.rb +13 -0
  57. data/test_app/db/migrate/20141114205531_purchases.office.rb +12 -0
  58. data/test_app/db/migrate/20141114205532_products.office.rb +28 -0
  59. data/test_app/db/schema.rb +141 -0
  60. data/test_app/db/seeds.rb +7 -0
  61. data/test_app/public/404.html +58 -0
  62. data/test_app/public/422.html +58 -0
  63. data/test_app/public/500.html +57 -0
  64. data/test_app/public/favicon.ico +0 -0
  65. data/test_app/public/robots.txt +5 -0
  66. metadata +74 -9
  67. data/app/assets/javascripts/accountant_office.js.rb +0 -4
  68. data/app/assets/javascripts/flotomatic.js +0 -177
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: accountant_clerk
3
3
  version: !ruby/object:Gem::Version
4
- version: '0.5'
4
+ version: '0.6'
5
5
  platform: ruby
6
6
  authors:
7
7
  - Torsten Ruger
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-11-19 00:00:00.000000000 Z
11
+ date: 2014-12-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: office_clerk
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '0.4'
19
+ version: '0.8'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: '0.4'
26
+ version: '0.8'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: flot-rails
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -38,18 +38,22 @@ dependencies:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
40
  version: 0.0.6
41
- description:
41
+ description: Simple reports that are not so simple anymore and let you analyse your
42
+ shops performance
42
43
  email: torsten@villataika.fi
43
44
  executables: []
44
45
  extensions: []
45
46
  extra_rdoc_files: []
46
47
  files:
47
48
  - ".gitignore"
49
+ - ".travis.yml"
50
+ - Gemfile
51
+ - Gemfile.lock
48
52
  - LICENSE
49
53
  - README.md
54
+ - Rakefile
50
55
  - accountant_clerk.gemspec
51
- - app/assets/javascripts/accountant_office.js.rb
52
- - app/assets/javascripts/flotomatic.js
56
+ - app/assets/javascripts/accountant_office.js.coffee
53
57
  - app/assets/stylesheets/accountant_office.css
54
58
  - app/assets/stylesheets/flotomatic.css
55
59
  - app/controllers/manage_controller_decorator.rb
@@ -60,8 +64,59 @@ files:
60
64
  - lib/accountant_clerk.rb
61
65
  - lib/accountant_clerk/engine.rb
62
66
  - lib/time_flot.rb
67
+ - spec/controllers/orders_controller_spec.rb
68
+ - spec/features/edit_spec.rb
69
+ - spec/features/orders_spec.rb
70
+ - spec/routing/orders_routing_spec.rb
63
71
  - spec/spec_helper.rb
64
- homepage:
72
+ - spec/support/admin.rb
73
+ - spec/support/capybara.rb
74
+ - spec/support/cleaner.rb
75
+ - spec/support/email.rb
76
+ - spec/support/factory_girl.rb
77
+ - spec/support/request_helper.rb
78
+ - test_app/README.rdoc
79
+ - test_app/app/assets/javascripts/application.js
80
+ - test_app/app/assets/stylesheets/application.css
81
+ - test_app/app/controllers/application_controller.rb
82
+ - test_app/app/helpers/application_helper.rb
83
+ - test_app/app/views/layouts/sales_clerk.haml
84
+ - test_app/bin/bundle
85
+ - test_app/bin/rails
86
+ - test_app/bin/rake
87
+ - test_app/config.ru
88
+ - test_app/config/application.rb
89
+ - test_app/config/boot.rb
90
+ - test_app/config/database.yml
91
+ - test_app/config/environment.rb
92
+ - test_app/config/environments/development.rb
93
+ - test_app/config/environments/production.rb
94
+ - test_app/config/environments/test.rb
95
+ - test_app/config/initializers/backtrace_silencers.rb
96
+ - test_app/config/initializers/filter_parameter_logging.rb
97
+ - test_app/config/initializers/inflections.rb
98
+ - test_app/config/initializers/mime_types.rb
99
+ - test_app/config/initializers/secret_token.rb
100
+ - test_app/config/initializers/session_store.rb
101
+ - test_app/config/initializers/wrap_parameters.rb
102
+ - test_app/config/locales/en.yml
103
+ - test_app/config/routes.rb
104
+ - test_app/db/migrate/20141114205525_clerks.office.rb
105
+ - test_app/db/migrate/20141114205526_suppliers.office.rb
106
+ - test_app/db/migrate/20141114205527_categories.office.rb
107
+ - test_app/db/migrate/20141114205528_items.office.rb
108
+ - test_app/db/migrate/20141114205529_orders.office.rb
109
+ - test_app/db/migrate/20141114205530_baskets.office.rb
110
+ - test_app/db/migrate/20141114205531_purchases.office.rb
111
+ - test_app/db/migrate/20141114205532_products.office.rb
112
+ - test_app/db/schema.rb
113
+ - test_app/db/seeds.rb
114
+ - test_app/public/404.html
115
+ - test_app/public/422.html
116
+ - test_app/public/500.html
117
+ - test_app/public/favicon.ico
118
+ - test_app/public/robots.txt
119
+ homepage: https://github.com/rubyclerks/accountant_clerk
65
120
  licenses: []
66
121
  metadata: {}
67
122
  post_install_message:
@@ -84,6 +139,16 @@ rubyforge_project:
84
139
  rubygems_version: 2.2.2
85
140
  signing_key:
86
141
  specification_version: 4
87
- summary: Simple reports that are not so simple anymore
142
+ summary: Simple reports for rubyclerks
88
143
  test_files:
144
+ - spec/controllers/orders_controller_spec.rb
145
+ - spec/features/edit_spec.rb
146
+ - spec/features/orders_spec.rb
147
+ - spec/routing/orders_routing_spec.rb
89
148
  - spec/spec_helper.rb
149
+ - spec/support/admin.rb
150
+ - spec/support/capybara.rb
151
+ - spec/support/cleaner.rb
152
+ - spec/support/email.rb
153
+ - spec/support/factory_girl.rb
154
+ - spec/support/request_helper.rb
@@ -1,4 +0,0 @@
1
-
2
- Document.ready? do
3
- Element.find('.manage_first').html = '<div class="col-md-12"><a href="/manage/report"> Reports </a></div>'
4
- end
@@ -1,177 +0,0 @@
1
- function Flotomatic(placeholder, data, options) {
2
- this.placeholder = '#' + placeholder;
3
- this.tooltip = '#flot_tooltip';
4
- this.overview = '#flot_overview';
5
- this.choices = '#flot_choices';
6
- this.data = data;
7
- this.options = options;
8
- this.plot = null;
9
- this.overviewPlot = null;
10
- }
11
-
12
- Flotomatic.prototype = {
13
- createLink: function() {
14
- var placeholder = jQuery(this.placeholder);
15
-
16
- placeholder.bind("plotclick", function(event, pos, item) {
17
- var series = item.series,
18
- dataIndex = item.dataIndex;
19
-
20
- window.open(series.data[dataIndex][3]);
21
- });
22
- },
23
-
24
- createTooltip: function() {
25
- var placeholder = jQuery(this.placeholder),
26
- tooltip = jQuery(this.tooltip),
27
- previousPoint = null;
28
-
29
-
30
- function showTooltip(x, y, contents) {
31
- jQuery('<div id="flot_tooltip" class="flotomatic_tooltip">' + contents + '</div>').css(
32
- {
33
- top: y + 5,
34
- left: x + 5
35
- }).appendTo("body").fadeIn(200);
36
- }
37
-
38
- function tooltipFormatter(item) {
39
- var date = new Date(item.datapoint[0]),
40
- label = item.series.label,
41
- series = item.series,
42
- dataIndex = item.dataIndex,
43
- content = "";
44
-
45
- if (series.data[dataIndex][2] == null){
46
- content = label + ": " + item.datapoint[1] + " on " + (date.getMonth() + 1) + "/" + date.getDate() + "</a>";
47
- }
48
- else {
49
- content = series.data[dataIndex][2];
50
- }
51
-
52
-
53
- return content;
54
- }
55
-
56
- placeholder.bind("plothover", this.tooltip, function(event, pos, item) {
57
- var tooltip = jQuery(event.data);
58
-
59
- if (item) {
60
- if (previousPoint != item.datapoint) {
61
- previousPoint = item.datapoint;
62
-
63
- tooltip.remove();
64
- var x = item.datapoint[0],//.toFixed(2),
65
- y = item.datapoint[1]
66
-
67
- showTooltip(item.pageX, item.pageY, tooltipFormatter(item));
68
- }
69
- }
70
- else {
71
- tooltip.remove();
72
- previousPoint = null;
73
- }
74
- });
75
- },
76
-
77
- draw: function(placeholder, data, initialOptions, ranges, dynamic, zoom) {
78
- var options = initialOptions;
79
-
80
- if (zoom)
81
- options = jQuery.extend(true, {}, options, {
82
- selection: {
83
- mode: "x"
84
- },
85
- xaxis: {
86
- min: ranges.xaxis.from,
87
- max: ranges.xaxis.to
88
- }
89
- });
90
-
91
- return jQuery.plot(placeholder, data, options);
92
- },
93
-
94
- graph: function(overview, dynamic) {
95
- var placeholder = jQuery(this.placeholder);
96
-
97
- this.plot = this.draw(placeholder, this.data, this.options);
98
- },
99
-
100
- graphDynamic: function() {
101
- var placeholder = jQuery(this.placeholder),
102
- choices = jQuery(this.choices),
103
- options = this.options,
104
- data = this.data,
105
- i = 0;
106
-
107
- jQuery.each(data, function(key, val) {
108
- if (val.color == null) {
109
- val.color = i;
110
- }
111
- ++i;
112
- });
113
-
114
- jQuery.each(data, function(key, val) {
115
- choices.append(choiceFormatter(key, val));
116
- });
117
-
118
- choices.find("input").click(graphChoices);
119
-
120
- function graphChoices() {
121
- var set = [];
122
-
123
- choices.find("input:checked").each(function () {
124
- var key = jQuery(this).attr("name");
125
-
126
- if (key && data[key])
127
- set.push(data[key]);
128
- });
129
-
130
- if (set.length > 0)
131
- this.plot = jQuery.plot(placeholder, set, options);
132
- }
133
-
134
- function choiceFormatter(key, val) {
135
- return '<input type="checkbox" name="' + key + '" checked="checked" > <span class="flot_choice_label">' + val.label + '</span></input> ';
136
- }
137
-
138
- graphChoices();
139
- },
140
-
141
- graphOverview: function() {
142
- var overview = jQuery(this.overview),
143
- placeholder = jQuery(this.placeholder),
144
- plot = this.plot;
145
-
146
- this.overviewPlot = jQuery.plot(overview, this.data, {
147
- legend: false,
148
- shadowSize: 0,
149
- xaxis: {
150
- ticks: [],
151
- mode: "time"
152
- },
153
- yaxis: {
154
- ticks: []
155
- },
156
- selection: {
157
- mode: "x"
158
- }
159
- });
160
-
161
- placeholder.bind("plotselected", {
162
- that:this
163
- }, function (event, ranges) {
164
- var that = event.data.that,
165
- placeholder = jQuery(that.placeholder);
166
-
167
- that.plot = that.draw(placeholder, that.data, that.options, ranges, false, true);
168
- that.overviewPlot.setSelection(ranges, true);
169
- });
170
-
171
- overview.bind("plotselected", {
172
- that:this
173
- }, function (event, ranges) {
174
- event.data.that.plot.setSelection(ranges);
175
- });
176
- }
177
- }