mercator_mesonic 0.0.1 → 0.1

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.
@@ -0,0 +1,144 @@
1
+ <page title="Home">
2
+
3
+ <body: class="front-page"/>
4
+
5
+ <content:>
6
+ <section class="content-body">
7
+
8
+ <ul class="nav nav-tabs">
9
+ <li class="active">
10
+ <a href="#invoices" data-toggle="tab">
11
+ <t key='mercator.invoice.other'/>
12
+ </a>
13
+ </li>
14
+ <li>
15
+ <a href="#open_shipments" data-toggle="tab">
16
+ <t key='mercator.open_deliveries'/>
17
+ </a>
18
+ </li>
19
+ <li>
20
+ <a href="#open_payments" data-toggle="tab">
21
+ <t key='mercator.open_payments'/>
22
+ </a>
23
+ </li>
24
+ </ul>
25
+
26
+ <div id="myTabContent" class="tab-content">
27
+ <div class="tab-pane fade in active" id="invoices">
28
+ <repeat with="&@invoices">
29
+ <h3><t key='mercator.invoice.one'/> <view with="&this[0]"/></h3>
30
+
31
+ <p>
32
+ <strong><t key='mercator.customer_number'/>:</strong>
33
+ <view with="&this[1][0].Konto"/>,
34
+ <strong><t key='mercator.invoice.date'/>:</strong>
35
+ <view with="&this[1][0].Rechnungsdatum.to_date"/>
36
+ </p>
37
+
38
+ <table class="table table-striped table-condensed">
39
+ <tr>
40
+ <th><t key='mercator.ordering_text'/></th>
41
+ <th><t key='attributes.product_number'/></th>
42
+ <th><t key='mercator.identifier'/></th>
43
+ <th><t key='attributes.amount'/></th>
44
+ <th><t key='activerecord.attributes.lineitem.product_price'/></th>
45
+ <th><t key='activerecord.attributes.lineitem.value'/></th>
46
+ </tr>
47
+ <repeat with="&this[1]">
48
+ <tr>
49
+ <td><view:Bestelltext/></td>
50
+ <td><view:ArtNr/></td>
51
+ <td><view:Bezeichnung/></td>
52
+ <td><view:Menge/></td>
53
+ <td><view with="&number_to_currency(this.Einzelpreis)"/></td>
54
+ <td><view with="&number_to_currency(this.Gesamtpreis)"/></td>
55
+ </tr>
56
+ </repeat>
57
+ </table>
58
+ </repeat>
59
+ <else>
60
+ <t key='mercator.no_invoices'/>
61
+ </else>
62
+ </div>
63
+
64
+ <div class="tab-pane fade" id="open_shipments">
65
+ <repeat with="&@open_shipments">
66
+ <h3><t key='mercator.packing_slip_number'/> <view with="&this[0]"/></h3>
67
+
68
+ <p>
69
+ <strong><t key='mercator.customer_number'/>:</strong>
70
+ <view with="&this[1][0].Konto"/>,
71
+ <strong><t key='mercator.delivery_slip_date'/>:</strong>
72
+ <view with="&this[1][0].Lieferscheindatum.to_date"/><br/>
73
+ <strong><t key='mercator.invoice.number'/>:</strong>
74
+ <view with="&this[1][0].Rechnungsnummer.to_date"/><br/>
75
+ <strong><t key='mercator.invoice.date'/>:</strong>
76
+ <view with="&this[1][0].Rechnungsdatum.to_date"/>
77
+ </p>
78
+
79
+ <table class="table table-striped table-condensed">
80
+ <tr>
81
+ <th><t key='mercator.ordering_text'/></th>
82
+ <th><t key='attributes.product_number'/></th>
83
+ <th><t key='mercator.identifier'/></th>
84
+ <th><t key='attributes.amount'/></th>
85
+ <th><t key='activerecord.attributes.lineitem.product_price'/></th>
86
+ <th><t key='activerecord.attributes.lineitem.value'/></th>
87
+ </tr>
88
+ <repeat with="&this[1]">
89
+ <tr>
90
+ <td><view:Bestelltext/></td>
91
+ <td><view:ArtNr/></td>
92
+ <td><view:Bezeichnung/></td>
93
+ <td><view:Menge/></td>
94
+ <td><view with="&number_to_currency(this.Einzelpreis)"/></td>
95
+ <td><view with="&number_to_currency(this.Gesamtpreis)"/></td>
96
+ </tr>
97
+ </repeat>
98
+ </table>
99
+ </repeat>
100
+ <else><t key='mercator.no_deliveries'/>n</else>
101
+ </div>
102
+
103
+ <div class="tab-pane fade" id="open_payments">
104
+ <repeat with="&@open_payments">
105
+ <h3><t key='mercator.delivery_number'/> <view with="&this[0]"/></h3>
106
+
107
+ <p>
108
+ <strong><t key='mercator.customer_number'/>:</strong>
109
+ <view with="&this[1][0].Konto"/>,
110
+ <strong><t key='mercator.order.date'/>:</strong>
111
+ <view with="&this[1][0].Auftragsdatum.to_date"/><br/>
112
+ <strong><t key='mercator.order.number'/>:</strong>
113
+ <view with="&this[1][0].Auftragsnummer.to_date"/><br/>
114
+ <strong><t key='mercator.invoice.date'/>:</strong>
115
+ <view with="&this[1][0].Rechnungsdatum.to_date"/>
116
+ </p>
117
+
118
+ <table class="table table-striped table-condensed">
119
+ <tr>
120
+ <th><t key='mercator.order.text'/></th>
121
+ <th><t key='attributes.product_number'/></th>
122
+ <th><t key='mercator.identifier'/></th>
123
+ <th><t key='attributes.amount'/></th>
124
+ <th><t key='activerecord.attributes.lineitem.product_price'/></th>
125
+ <th><t key='activerecord.attributes.lineitem.value'/></th>
126
+ </tr>
127
+ <repeat with="&this[1]">
128
+ <tr>
129
+ <td><view:Bestelltext/></td>
130
+ <td><view:ArtNr/></td>
131
+ <td><view:Bezeichnung/></td>
132
+ <td><view:Menge/></td>
133
+ <td><view with="&number_to_currency(this.Einzelpreis)"/></td>
134
+ <td><view with="&number_to_currency(this.Gesamtpreis)"/></td>
135
+ </tr>
136
+ </repeat>
137
+ </table>
138
+ </repeat>
139
+ <else><t key='mercator.no_open_payments'/></else>
140
+ </div>
141
+ </div>
142
+ </section>
143
+ </content:>
144
+ </page>
@@ -0,0 +1,15 @@
1
+ class AddVatlineArticlegroupProvisioncodeCharacteristicToInventories < ActiveRecord::Migration
2
+ def self.up
3
+ add_column :inventories, :erp_vatline, :integer
4
+ add_column :inventories, :erp_article_group, :integer
5
+ add_column :inventories, :erp_provision_code, :integer
6
+ add_column :inventories, :erp_characteristic_flag, :integer
7
+ end
8
+
9
+ def self.down
10
+ remove_column :inventories, :erp_vatline
11
+ remove_column :inventories, :erp_article_group
12
+ remove_column :inventories, :erp_provision_code
13
+ remove_column :inventories, :erp_characteristic_flag
14
+ end
15
+ end
@@ -1,5 +1,7 @@
1
1
  module MercatorMesonic
2
2
  class Engine < ::Rails::Engine
3
+
3
4
  isolate_namespace MercatorMesonic
5
+ config.erp = "mesonic"
4
6
  end
5
7
  end
@@ -1,3 +1,3 @@
1
1
  module MercatorMesonic
2
- VERSION = "0.0.1"
3
- end
2
+ VERSION = "0.1"
3
+ end
@@ -0,0 +1,75 @@
1
+ # encoding: utf-8
2
+ require "squeel"
3
+
4
+ namespace :mesonic do
5
+ namespace :users do
6
+ # starten als: 'bundle exec rake mesonic:users:update_erp_account_nrs'
7
+ # in Produktivumgebungen: 'bundle exec rake mesonic:users:update_erp_account_nrs RAILS_ENV=production'
8
+ desc 'Update erp account nrs via erp contact numbers from Mesonic '
9
+ task :update_erp_account_nrs => :environment do
10
+ ::JobLogger.info("=" * 50)
11
+ ::JobLogger.info("Started Job: mesonic:users:update_erp_account_nrs")
12
+ User.update_erp_account_nrs
13
+ ::JobLogger.info("Finished Job: mesonic:users:update_erp_account_nrs")
14
+ ::JobLogger.info("=" * 50)
15
+ end
16
+ end
17
+
18
+ namespace :addresses do
19
+
20
+ # starten als: 'bundle exec rake mesonic:addresses:import'
21
+ # in Produktivumgebungen: 'bundle exec rake mesonic:addresses:import RAILS_ENV=production'
22
+ desc 'Import addresses from Mesonic '
23
+ task :import => :environment do
24
+
25
+ ::JobLogger.info("=" * 50)
26
+ ::JobLogger.info("Started Job: mesonic:addresses:import")
27
+
28
+ if MercatorMesonic::Webartikel.test_connection
29
+ User.where{erp_contact_nr != nil}.all.each do |user|
30
+ user.update(erp_account_nr: user.erp_account_nr[0..-3]+"68",
31
+ erp_contact_nr: user.erp_contact_nr[0..-3]+"68")
32
+ @mesonic_address = MercatorMesonic::KontenstammAdresse.where(mesoprim: user.erp_account_nr).first
33
+ if @mesonic_address
34
+
35
+ name = @mesonic_address.firstname ? @mesonic_address.firstname + " " + @mesonic_address.lastname : @mesonic_address.lastname
36
+ name = name ? name : "Bitte Name aktualisieren!"
37
+ land = @mesonic_address.land ? @mesonic_address.land : "Österreich"
38
+
39
+ @billing_address = BillingAddress.new(user_id: user.id,
40
+ name: name,
41
+ c_o: @mesonic_address.to_hand,
42
+ street: @mesonic_address.street,
43
+ postalcode: @mesonic_address.postal,
44
+ city: @mesonic_address.city,
45
+ country: land,
46
+ email_address: @mesonic_address.email)
47
+ if @billing_address.save
48
+ ::JobLogger.info("Saved BillingAddress " + @billing_address.id.to_s)
49
+ else
50
+ ::JobLogger.error("Saving BillingAddress " + @billing_address.name + "failed.")
51
+ end
52
+
53
+ @address = Address.new(user_id: user.id,
54
+ name: name,
55
+ c_o: @mesonic_address.to_hand,
56
+ street: @mesonic_address.street,
57
+ postalcode: @mesonic_address.postal,
58
+ city: @mesonic_address.city,
59
+ country: land)
60
+ if @address.save
61
+ ::JobLogger.info("Saved Address " + @address.id.to_s)
62
+ else
63
+ ::JobLogger.error("Saving Address " + @address.name + "failed.")
64
+ end
65
+ else
66
+ ::JobLogger.warn("Contact " + user.erp_account_nr.to_s + " not found.")
67
+ end
68
+ end
69
+ end
70
+
71
+ ::JobLogger.info("Finished Job: mesonic:addresses:import")
72
+ ::JobLogger.info("=" * 50)
73
+ end
74
+ end
75
+ end
@@ -0,0 +1,49 @@
1
+ # encoding: utf-8
2
+
3
+ namespace :webartikel do
4
+
5
+ # starten als: 'bundle exec rake webartikel:import'
6
+ # in Produktivumgebungen: 'bundle exec rake webartikel:import RAILS_ENV=production'
7
+ desc 'Import from Mesonic Webartikel view into inventories'
8
+ task :import => :environment do
9
+ ::JobLogger.info("=" * 50)
10
+ ::JobLogger.info("Started Job: webartikel:import")
11
+
12
+ if MercatorMesonic::Webartikel.test_connection
13
+ MercatorMesonic::Webartikel.import(update: "all")
14
+ end
15
+
16
+ ::JobLogger.info("Finished Job: webartikel:import")
17
+ ::JobLogger.info("=" * 50)
18
+ end
19
+
20
+ # starten als: 'bundle exec rake webartikel:update'
21
+ # in Produktivumgebungen: 'bundle exec rake webartikel:update RAILS_ENV=production'
22
+ desc 'Update from Mesonic Webartikel view into inventories'
23
+ task :update => :environment do
24
+ ::JobLogger.info("=" * 50)
25
+ ::JobLogger.info("Started Job: webartikel:update")
26
+
27
+ if MercatorMesonic::Webartikel.test_connection
28
+ MercatorMesonic::Webartikel.import(update: "changed")
29
+ end
30
+
31
+ ::JobLogger.info("Finished Job: webartikel:update")
32
+ ::JobLogger.info("=" * 50)
33
+ end
34
+
35
+ # starten als: 'bundle exec rake webartikel:remove_orphans'
36
+ # in Produktivumgebungen: 'bundle exec rake webartikel:remove_orphans RAILS_ENV=production'
37
+ desc 'Remove ophaned inventories'
38
+ task :remove_orphans => :environment do
39
+ ::JobLogger.info("=" * 50)
40
+ ::JobLogger.info("Started Job: webartikel:remove_orphans")
41
+
42
+ if MercatorMesonic::Webartikel.test_connection
43
+ MercatorMesonic::Webartikel.remove_orphans
44
+ end
45
+
46
+ ::JobLogger.info("Finished Job: webartikel:remove_orphans")
47
+ ::JobLogger.info("=" * 50)
48
+ end
49
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mercator_mesonic
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: '0.1'
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stefan Haslinger
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-03-26 00:00:00.000000000 Z
11
+ date: 2014-08-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: 4.0.3
19
+ version: '4.0'
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: 4.0.3
26
+ version: '4.0'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: activerecord-sqlserver-adapter
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -38,10 +38,24 @@ dependencies:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
40
  version: 4.0.0
41
+ - !ruby/object:Gem::Dependency
42
+ name: nokogiri
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ">="
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
48
+ type: :runtime
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ">="
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
41
55
  description: MercatorMesonic interfaces between Mercator and Mesonic in the realm
42
56
  of customers, addresses, articles, inventories, orders, and orderitems.
43
57
  email:
44
- - stefan.haslinger@mittenin.at
58
+ - stefan.haslinger@informatom.com
45
59
  executables: []
46
60
  extensions: []
47
61
  extra_rdoc_files: []
@@ -52,8 +66,10 @@ files:
52
66
  - app/assets/javascripts/mercator_mesonic/application.js
53
67
  - app/assets/stylesheets/mercator_mesonic/application.css
54
68
  - app/controllers/mercator_mesonic/application_controller.rb
55
- - app/helpers/mercator_mesonic/application_helper.rb
69
+ - app/controllers/users_controller_extensions.rb
70
+ - app/models/inventory_extensions.rb
56
71
  - app/models/mercator_mesonic/akt_mandant.rb
72
+ - app/models/mercator_mesonic/artikelstamm.rb
57
73
  - app/models/mercator_mesonic/base.rb
58
74
  - app/models/mercator_mesonic/belegart.rb
59
75
  - app/models/mercator_mesonic/kontakte_stamm.rb
@@ -66,13 +82,18 @@ files:
66
82
  - app/models/mercator_mesonic/price.rb
67
83
  - app/models/mercator_mesonic/webartikel.rb
68
84
  - app/models/mercator_mesonic/zahlungsart.rb
85
+ - app/models/order_extensions.rb
86
+ - app/models/user_extensions.rb
87
+ - app/views/users/invoices_shipments_payments.dryml
69
88
  - config/routes.rb
70
89
  - db/migrate/20140319161842_add_erp_updated_at_to_inventory.rb
71
90
  - db/migrate/20140325093328_add_erp_contact_nr_erp_account_nr_to_user.rb
91
+ - db/migrate/20140327130259_add_vatline_articlegroup_provisioncode_characteristic_to_inventories.rb
72
92
  - lib/mercator_mesonic.rb
73
93
  - lib/mercator_mesonic/engine.rb
74
94
  - lib/mercator_mesonic/version.rb
75
- - lib/tasks/mercator_mesonic_tasks.rake
95
+ - lib/tasks/user.rake
96
+ - lib/tasks/webartikel.rake
76
97
  - test/dummy/README.rdoc
77
98
  - test/dummy/Rakefile
78
99
  - test/dummy/app/assets/javascripts/application.js
@@ -109,7 +130,7 @@ files:
109
130
  - test/mercator_mesonic_test.rb
110
131
  - test/models/mercator_mesonic/base_test.rb
111
132
  - test/test_helper.rb
112
- homepage: http://informatom.com
133
+ homepage: http://mercator.informatom.com
113
134
  licenses: []
114
135
  metadata: {}
115
136
  post_install_message:
@@ -134,39 +155,39 @@ specification_version: 4
134
155
  summary: MercatorMesonic provides Mercator ERP Integration for the Mesonic Guided
135
156
  Selling Application.
136
157
  test_files:
137
- - test/mercator_mesonic_test.rb
138
- - test/dummy/public/422.html
139
- - test/dummy/public/404.html
140
- - test/dummy/public/500.html
141
- - test/dummy/public/favicon.ico
142
- - test/dummy/config/environments/development.rb
143
- - test/dummy/config/environments/test.rb
144
- - test/dummy/config/environments/production.rb
145
- - test/dummy/config/boot.rb
146
- - test/dummy/config/routes.rb
147
- - test/dummy/config/database.yml
148
- - test/dummy/config/initializers/session_store.rb
158
+ - test/fixtures/mercator_mesonic/bases.yml
159
+ - test/models/mercator_mesonic/base_test.rb
160
+ - test/dummy/bin/bundle
161
+ - test/dummy/bin/rails
162
+ - test/dummy/bin/rake
149
163
  - test/dummy/config/initializers/backtrace_silencers.rb
150
- - test/dummy/config/initializers/inflections.rb
151
- - test/dummy/config/initializers/wrap_parameters.rb
164
+ - test/dummy/config/initializers/secret_token.rb
152
165
  - test/dummy/config/initializers/mime_types.rb
153
166
  - test/dummy/config/initializers/filter_parameter_logging.rb
154
- - test/dummy/config/initializers/secret_token.rb
155
- - test/dummy/config/locales/en.yml
167
+ - test/dummy/config/initializers/wrap_parameters.rb
168
+ - test/dummy/config/initializers/inflections.rb
169
+ - test/dummy/config/initializers/session_store.rb
156
170
  - test/dummy/config/application.rb
171
+ - test/dummy/config/environments/production.rb
172
+ - test/dummy/config/environments/test.rb
173
+ - test/dummy/config/environments/development.rb
174
+ - test/dummy/config/locales/en.yml
157
175
  - test/dummy/config/environment.rb
158
- - test/dummy/bin/rake
159
- - test/dummy/bin/rails
160
- - test/dummy/bin/bundle
161
- - test/dummy/app/assets/javascripts/application.js
162
- - test/dummy/app/assets/stylesheets/application.css
163
- - test/dummy/app/views/layouts/application.html.erb
176
+ - test/dummy/config/routes.rb
177
+ - test/dummy/config/boot.rb
178
+ - test/dummy/config/database.yml
179
+ - test/dummy/public/404.html
180
+ - test/dummy/public/favicon.ico
181
+ - test/dummy/public/500.html
182
+ - test/dummy/public/422.html
164
183
  - test/dummy/app/controllers/application_controller.rb
184
+ - test/dummy/app/assets/stylesheets/application.css
185
+ - test/dummy/app/assets/javascripts/application.js
165
186
  - test/dummy/app/helpers/application_helper.rb
187
+ - test/dummy/app/views/layouts/application.html.erb
188
+ - test/dummy/Rakefile
166
189
  - test/dummy/README.rdoc
167
190
  - test/dummy/config.ru
168
- - test/dummy/Rakefile
169
- - test/integration/navigation_test.rb
170
191
  - test/test_helper.rb
171
- - test/models/mercator_mesonic/base_test.rb
172
- - test/fixtures/mercator_mesonic/bases.yml
192
+ - test/integration/navigation_test.rb
193
+ - test/mercator_mesonic_test.rb