office_clerk 0.4 → 0.5
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/Gemfile.lock +11 -36
- data/LICENSE +22 -0
- data/app/assets/javascripts/office_clerk.js +0 -7
- data/app/assets/stylesheets/{office_clerk.scss → office_clerk.css.scss} +0 -0
- data/app/controllers/orders_controller.rb +10 -1
- data/app/controllers/products_controller.rb +2 -32
- data/app/controllers/shop_controller.rb +1 -0
- data/app/helpers/orders_helper.rb +6 -5
- data/app/helpers/shop_helper.rb +8 -7
- data/app/mailers/order_mailer.rb +19 -0
- data/app/views/addresses/_form_fields.html.haml +4 -4
- data/app/views/baskets/edit.html.haml +1 -1
- data/app/views/categories/edit.html.haml +22 -18
- data/app/views/clerks/edit.html.haml +6 -9
- data/app/views/layouts/office_clerk.haml +1 -0
- data/app/views/layouts/sales_clerk.haml +10 -0
- data/app/views/order_mailer/cancel.html.haml +6 -0
- data/app/views/order_mailer/confirm.html.haml +7 -0
- data/app/views/order_mailer/paid.html.haml +6 -0
- data/app/views/order_mailer/shipped.html.haml +6 -0
- data/app/views/orders/edit.html.haml +1 -1
- data/app/views/orders/show.html.haml +48 -44
- data/app/views/products/_head.haml +4 -2
- data/app/views/products/edit.html.haml +35 -24
- data/app/views/products/show.html.haml +32 -41
- data/app/views/purchases/edit.html.haml +4 -4
- data/app/views/sessions/sign_up.haml +1 -1
- data/app/views/shop/_product_box.haml +13 -0
- data/app/views/suppliers/edit.html.haml +2 -2
- data/bin/rails +3 -15
- data/config/environments/production.rb +2 -77
- data/config/locales/config.yml +1 -1
- data/config/locales/en.yml +75 -45
- data/config/locales/fi.yml +60 -67
- data/config/routes.rb +1 -1
- data/db/migrate/20131226143612_categories.rb +2 -1
- data/db/migrate/20131226151332_products.rb +2 -1
- data/lib/office_clerk.rb +2 -7
- data/lib/office_clerk/version.rb +1 -1
- data/lib/templates/haml/scaffold/_form.html.haml +1 -1
- data/office_clerk.gemspec +6 -12
- data/spec/features/products/edit_spec.rb +0 -4
- data/spec/mailers/order_mailer_spec.rb +24 -0
- data/spec/models/baskets/items_spec.rb +3 -3
- data/spec/models/locale_spec.rb +4 -0
- data/test_app/db/migrate/20141114205527_categories.office.rb +2 -2
- data/test_app/db/migrate/20141114205532_products.office.rb +2 -2
- data/test_app/db/schema.rb +4 -2
- data/todo +0 -4
- metadata +68 -111
- data/config/initializers/migrate.rb +0 -6
- data/config/initializers/simple_form.rb +0 -149
- data/config/initializers/simple_form_bootstrap.rb +0 -48
- data/db/seeds.rb +0 -4
- data/test/fixtures/baskets.yml +0 -41993
- data/test/fixtures/categories.yml +0 -638
- data/test/fixtures/clerks.yml +0 -694
- data/test/fixtures/items.yml +0 -83651
- data/test/fixtures/orders.yml +0 -58918
- data/test/fixtures/products.yml +0 -110904
- data/test/fixtures/purchases.yml +0 -1755
- data/test/fixtures/suppliers.yml +0 -341
data/config/locales/config.yml
CHANGED
data/config/locales/en.yml
CHANGED
@@ -3,50 +3,6 @@ en:
|
|
3
3
|
empty: Empty
|
4
4
|
online_eq: Online?
|
5
5
|
actions: Actions
|
6
|
-
activerecord:
|
7
|
-
attributes:
|
8
|
-
basket:
|
9
|
-
created_at: Created
|
10
|
-
total_price: Price
|
11
|
-
clerk:
|
12
|
-
city: City
|
13
|
-
email: Email
|
14
|
-
name: Name
|
15
|
-
password: Passord
|
16
|
-
password_confirmation: Password confirmation
|
17
|
-
phone: Phone
|
18
|
-
street: Street
|
19
|
-
order:
|
20
|
-
email: Email
|
21
|
-
ordered_on: Ordered on
|
22
|
-
product:
|
23
|
-
description: Description
|
24
|
-
ean: Ean
|
25
|
-
inventory: Inventory
|
26
|
-
name: Name
|
27
|
-
online: online
|
28
|
-
price: Price
|
29
|
-
scode: Supplier code
|
30
|
-
tax: Tax rate
|
31
|
-
weight: Weight
|
32
|
-
purchase:
|
33
|
-
name: Name
|
34
|
-
ordered_on: Ordered on
|
35
|
-
received_on: Received on
|
36
|
-
supplier:
|
37
|
-
city: City
|
38
|
-
name: Name
|
39
|
-
phone: Phone
|
40
|
-
street: Street
|
41
|
-
supplier_name: Supplier
|
42
|
-
models:
|
43
|
-
basket: Cart
|
44
|
-
category: Product group
|
45
|
-
clerk: User
|
46
|
-
order: Order
|
47
|
-
product: Product
|
48
|
-
purchase: Purchase
|
49
|
-
supplier: Supplier
|
50
6
|
add: Add
|
51
7
|
add_inventory: Add Inventory
|
52
8
|
add_to_basket: Add to basket
|
@@ -56,7 +12,6 @@ en:
|
|
56
12
|
are_you_sure: Are you sure?
|
57
13
|
as_inventory: As Inventory
|
58
14
|
back: Back
|
59
|
-
barcode: Barcode
|
60
15
|
basket: Basket
|
61
16
|
basket_empty: Basket is empty
|
62
17
|
basket_locked: Basket is locked, unlock to change
|
@@ -64,12 +19,15 @@ en:
|
|
64
19
|
between: ' between'
|
65
20
|
cancel: Cancel
|
66
21
|
canceled_on: Canceled on
|
22
|
+
cancel_order_button: Cancel email
|
67
23
|
categories: Product Categories
|
68
24
|
category: Product Category
|
69
25
|
choose_product_for_basket: Choose product for basket
|
26
|
+
checkout: Checkout
|
70
27
|
city: City
|
71
28
|
clerk: User
|
72
29
|
clerks: Users
|
30
|
+
confirm_order_button: Send Confirmation Email
|
73
31
|
contact: Contact
|
74
32
|
cost: Cost
|
75
33
|
count: Count
|
@@ -91,6 +49,7 @@ en:
|
|
91
49
|
filter: Filter
|
92
50
|
first_name: First Name
|
93
51
|
history: Order history
|
52
|
+
home: Home
|
94
53
|
info: Info
|
95
54
|
inventorized: Inventorized
|
96
55
|
inventory: Inventory
|
@@ -101,6 +60,7 @@ en:
|
|
101
60
|
link: Link
|
102
61
|
made_offline: taken offline
|
103
62
|
made_online: made online
|
63
|
+
manage: Manage
|
104
64
|
main_picture: Main Picture
|
105
65
|
make_order: Make Order
|
106
66
|
make_purchase: Make Purchase
|
@@ -111,27 +71,38 @@ en:
|
|
111
71
|
new_item: New product item
|
112
72
|
next: Next
|
113
73
|
not_online: not online
|
74
|
+
notice: Notice
|
114
75
|
online: Online
|
115
76
|
order: Order
|
116
77
|
order_number: Number
|
78
|
+
order_more_for_free_shipping: "Order %{more} € for free shipping"
|
117
79
|
order_total: Order total
|
118
80
|
ordered: Ordered
|
119
81
|
ordered_on: Ordered On
|
120
82
|
orders: Orders
|
121
83
|
our_shop: Our shop
|
84
|
+
paid: Paid
|
122
85
|
paid_on: Paid on
|
86
|
+
paid_order_button: Paid Mail
|
123
87
|
parent: Parent
|
88
|
+
password: Password
|
124
89
|
phone: Phone
|
125
90
|
picture: Picture
|
126
91
|
picture2: Picture 2
|
127
92
|
position: Position
|
128
93
|
prev: Previous
|
94
|
+
preview: Preview
|
129
95
|
price: Price
|
130
96
|
price_between: Price between
|
131
97
|
print: Print
|
98
|
+
print_invoice: Print Invoice
|
132
99
|
print_order: Print Order
|
100
|
+
print_reminder: Print Reminder
|
101
|
+
print_slip: Print Package Slip
|
102
|
+
print_receipt: Print Receipt
|
133
103
|
product: Product
|
134
104
|
product_added: Product added
|
105
|
+
product_item: Product Item
|
135
106
|
product_line: Product Line
|
136
107
|
product_line_has_inventory: Product Line has inventori
|
137
108
|
products: Products
|
@@ -142,10 +113,13 @@ en:
|
|
142
113
|
received: Received
|
143
114
|
received_on: Received On
|
144
115
|
scode: Supplier code
|
116
|
+
select: Select
|
145
117
|
search: Search
|
118
|
+
ship: Ship
|
146
119
|
shipment_price: Shipment price
|
147
120
|
shipment_type: Shipment type
|
148
121
|
shipped_on: Shipped on
|
122
|
+
shipped_order_button: Ship Order Email
|
149
123
|
shop: Shop
|
150
124
|
show: Show
|
151
125
|
sign_in: Log in
|
@@ -160,6 +134,7 @@ en:
|
|
160
134
|
street2: Street2
|
161
135
|
supplier: Supplier
|
162
136
|
suppliers: Suppliers
|
137
|
+
summary: Summary
|
163
138
|
tax: Vat
|
164
139
|
tax_percent: Tax percent
|
165
140
|
tax_rate: Vat rate
|
@@ -180,3 +155,58 @@ en:
|
|
180
155
|
next_label: Next →
|
181
156
|
page_gap: '…'
|
182
157
|
previous_label: '← Previous'
|
158
|
+
activerecord:
|
159
|
+
attributes:
|
160
|
+
basket:
|
161
|
+
created_at: Created
|
162
|
+
total_price: Price
|
163
|
+
clerk:
|
164
|
+
city: City
|
165
|
+
email: Email
|
166
|
+
name: Name
|
167
|
+
password: Passord
|
168
|
+
password_confirmation: Password confirmation
|
169
|
+
phone: Phone
|
170
|
+
street: Street
|
171
|
+
category:
|
172
|
+
name: Name
|
173
|
+
online: Online
|
174
|
+
category: Parent
|
175
|
+
link: Link
|
176
|
+
position: Position
|
177
|
+
description: Description
|
178
|
+
order:
|
179
|
+
email: Email
|
180
|
+
ordered_on: Ordered on
|
181
|
+
purchase:
|
182
|
+
name: Name
|
183
|
+
ordered_on: Ordered on
|
184
|
+
received_on: Received on
|
185
|
+
product:
|
186
|
+
description: Description
|
187
|
+
ean: Ean
|
188
|
+
inventory: Inventory
|
189
|
+
name: Name
|
190
|
+
online: online
|
191
|
+
price: Price
|
192
|
+
scode: Supplier code
|
193
|
+
tax: Tax rate
|
194
|
+
weight: Weight
|
195
|
+
cost: Cost
|
196
|
+
supplier: Suppier
|
197
|
+
category: Category
|
198
|
+
name: Name
|
199
|
+
supplier:
|
200
|
+
city: City
|
201
|
+
name: Name
|
202
|
+
phone: Phone
|
203
|
+
street: Street
|
204
|
+
supplier_name: Supplier
|
205
|
+
models:
|
206
|
+
basket: Cart
|
207
|
+
category: Product group
|
208
|
+
clerk: User
|
209
|
+
order: Order
|
210
|
+
product: Product
|
211
|
+
purchase: Purchase
|
212
|
+
supplier: Supplier
|
data/config/locales/fi.yml
CHANGED
@@ -1,60 +1,6 @@
|
|
1
1
|
---
|
2
2
|
fi:
|
3
3
|
actions: Toimenpiteet
|
4
|
-
activerecord:
|
5
|
-
attributes:
|
6
|
-
basket:
|
7
|
-
created_at: Luotu
|
8
|
-
total_price: Hinta
|
9
|
-
clerk:
|
10
|
-
city: Kaupunki
|
11
|
-
email: S-posti
|
12
|
-
name: Nimi
|
13
|
-
password: Salasana
|
14
|
-
password_confirmation: Vahvista salasana
|
15
|
-
phone: Puhelin
|
16
|
-
street: Osoite
|
17
|
-
category:
|
18
|
-
name: Nimi
|
19
|
-
online: Netissä
|
20
|
-
category: Pääryhmä
|
21
|
-
link: Linkki
|
22
|
-
position: Järjetysnummero
|
23
|
-
description: Kuvaus
|
24
|
-
order:
|
25
|
-
email: S-posti
|
26
|
-
ordered_on: Tilattu
|
27
|
-
product:
|
28
|
-
description: Kuvaus
|
29
|
-
ean: Ean
|
30
|
-
inventory: Inventaario
|
31
|
-
name: Nimi
|
32
|
-
online: Netissä
|
33
|
-
price: Hinta
|
34
|
-
cost: Kustannus
|
35
|
-
scode: Tuottajatunnus
|
36
|
-
tax: Veroprosentti
|
37
|
-
weight: Paino
|
38
|
-
supplier: Tuottaja
|
39
|
-
category: Tuoteryhmä
|
40
|
-
purchase:
|
41
|
-
name: Nimi
|
42
|
-
ordered_on: Tilattu
|
43
|
-
received_on: Vastaanotettu
|
44
|
-
supplier:
|
45
|
-
city: Kaupunki
|
46
|
-
name: Nimi
|
47
|
-
phone: Puhelin
|
48
|
-
street: Osoite
|
49
|
-
supplier_name: Tuottaja
|
50
|
-
models:
|
51
|
-
basket: Ostoskori
|
52
|
-
category: Tuoteryhmä
|
53
|
-
clerk: Käyttäjä
|
54
|
-
order: Tilaus
|
55
|
-
product: Tuote
|
56
|
-
purchase: Sisäänosto
|
57
|
-
supplier: Tuottaja
|
58
4
|
add: Lisää
|
59
5
|
add_inventory: Lisää inventaarioon
|
60
6
|
add_to_basket: Lisää ostoskoriin
|
@@ -64,13 +10,13 @@ fi:
|
|
64
10
|
are_you_sure: Oletko varma
|
65
11
|
as_inventory: Inventaarioon
|
66
12
|
back: Listalle
|
67
|
-
barcode: Viivakoodi
|
68
13
|
basket: Ostoskori
|
69
14
|
basket_empty: Ostoskori on tyhjä
|
70
15
|
basket_locked: Ostoskoria ei voi muuttaa
|
71
16
|
baskets: Ostoskorit
|
72
17
|
between: haarukka
|
73
18
|
cancel: Peruuta
|
19
|
+
cancel_order_button: Peruta s-post
|
74
20
|
canceled_on: Peruutettu
|
75
21
|
categories: Tuoteryhmät
|
76
22
|
category: Tuoteryhmä
|
@@ -79,6 +25,7 @@ fi:
|
|
79
25
|
city: Kaupunki
|
80
26
|
clerk: Käyttäjä
|
81
27
|
clerks: Käyttäjät
|
28
|
+
confirm_order_button: Vahvistus s-post
|
82
29
|
contact: Kontaktihenkilö
|
83
30
|
cost: Kustannus
|
84
31
|
count: Määrä
|
@@ -110,8 +57,6 @@ fi:
|
|
110
57
|
items: Tuotteet
|
111
58
|
last_name: Sukunimi
|
112
59
|
link: linkki
|
113
|
-
login: Kirjaudu sisään
|
114
|
-
logout: Kirjaudu ulos
|
115
60
|
made_offline: poistettu netistä
|
116
61
|
made_online: laitettu nettiin
|
117
62
|
main_picture: Kuva
|
@@ -138,6 +83,7 @@ fi:
|
|
138
83
|
our_shop: Liikkeemme
|
139
84
|
paid: Maksa
|
140
85
|
paid_on: Maksettu
|
86
|
+
paid_order_button: Maksettu s-post
|
141
87
|
parent: Tuoteryhmä
|
142
88
|
password: Salasana
|
143
89
|
phone: Puhelin
|
@@ -145,6 +91,7 @@ fi:
|
|
145
91
|
picture2: Toinen kuva
|
146
92
|
position: Paikka
|
147
93
|
prev: edellinen
|
94
|
+
preview: Esikatselu
|
148
95
|
price: Hinta
|
149
96
|
price_between: Hinta haarukka
|
150
97
|
print: Tulosta
|
@@ -172,6 +119,7 @@ fi:
|
|
172
119
|
shipment_price: Lähetyksen hinta
|
173
120
|
shipment_type: Lähetyksen tapa
|
174
121
|
shipped_on: Lähetetty
|
122
|
+
shipped_order_button: Lähetetty S-Posti
|
175
123
|
shop: Kauppa
|
176
124
|
show: Näytä
|
177
125
|
sign_in: Kirjaudu sisään
|
@@ -180,22 +128,13 @@ fi:
|
|
180
128
|
sign_up: Luo tili
|
181
129
|
signed_in: Sisäänkirjautunut
|
182
130
|
signed_out: Uloskirjautunut
|
183
|
-
simple_form:
|
184
|
-
error_notification:
|
185
|
-
default_message: 'Tarkista uudelleen:'
|
186
|
-
'false': Ei
|
187
|
-
"no": Ei
|
188
|
-
required:
|
189
|
-
mark: '*'
|
190
|
-
text: required
|
191
|
-
'true': Kyllä
|
192
|
-
"yes": Kyllä
|
193
131
|
state: Tila
|
194
132
|
street: Osoite
|
195
133
|
street1: Osoite1
|
196
134
|
street2: Osoite2
|
197
135
|
supplier: Tuottaja
|
198
136
|
suppliers: Tuottajat
|
137
|
+
summary: Yhteenveto
|
199
138
|
tax: Alv
|
200
139
|
tax_percent: Veroprosentti
|
201
140
|
tax_rate: Veroprosentti
|
@@ -216,3 +155,57 @@ fi:
|
|
216
155
|
next_label: seuraava
|
217
156
|
page_gap: '…'
|
218
157
|
previous_label: edellinen
|
158
|
+
activerecord:
|
159
|
+
attributes:
|
160
|
+
basket:
|
161
|
+
created_at: Luotu
|
162
|
+
total_price: Hinta
|
163
|
+
clerk:
|
164
|
+
city: Kaupunki
|
165
|
+
email: S-posti
|
166
|
+
name: Nimi
|
167
|
+
password: Salasana
|
168
|
+
password_confirmation: Vahvista salasana
|
169
|
+
phone: Puhelin
|
170
|
+
street: Osoite
|
171
|
+
category:
|
172
|
+
name: Nimi
|
173
|
+
online: Netissä
|
174
|
+
category: Pääryhmä
|
175
|
+
link: Linkki
|
176
|
+
position: Järjetysnummero
|
177
|
+
description: Kuvaus
|
178
|
+
order:
|
179
|
+
email: S-posti
|
180
|
+
ordered_on: Tilattu
|
181
|
+
product:
|
182
|
+
description: Kuvaus
|
183
|
+
ean: Ean
|
184
|
+
inventory: Inventaario
|
185
|
+
name: Nimi
|
186
|
+
online: Netissä
|
187
|
+
price: Hinta
|
188
|
+
cost: Kustannus
|
189
|
+
scode: Tuottajatunnus
|
190
|
+
tax: Veroprosentti
|
191
|
+
weight: Paino
|
192
|
+
supplier: Tuottaja
|
193
|
+
category: Tuoteryhmä
|
194
|
+
purchase:
|
195
|
+
name: Nimi
|
196
|
+
ordered_on: Tilattu
|
197
|
+
received_on: Vastaanotettu
|
198
|
+
supplier:
|
199
|
+
city: Kaupunki
|
200
|
+
name: Nimi
|
201
|
+
phone: Puhelin
|
202
|
+
street: Osoite
|
203
|
+
supplier_name: Tuottaja
|
204
|
+
models:
|
205
|
+
basket: Ostoskori
|
206
|
+
category: Tuoteryhmä
|
207
|
+
clerk: Käyttäjä
|
208
|
+
order: Tilaus
|
209
|
+
product: Tuote
|
210
|
+
purchase: Sisäänosto
|
211
|
+
supplier: Tuottaja
|
data/config/routes.rb
CHANGED
@@ -36,6 +36,7 @@ OfficeClerk::Engine.routes.draw do
|
|
36
36
|
match "search" => "orders#index", :via => [:get, :post]
|
37
37
|
end
|
38
38
|
member do
|
39
|
+
get "mail/:act" , :action => :mail , :as => :mail
|
39
40
|
get :pay
|
40
41
|
get :ship
|
41
42
|
patch :ship
|
@@ -64,7 +65,6 @@ OfficeClerk::Engine.routes.draw do
|
|
64
65
|
end
|
65
66
|
member do
|
66
67
|
get :delete
|
67
|
-
get :barcode #print the barcode and price on a 50x25 mm area
|
68
68
|
end
|
69
69
|
end
|
70
70
|
|
@@ -4,7 +4,8 @@ class Categories < ActiveRecord::Migration
|
|
4
4
|
t.references :category
|
5
5
|
t.boolean :online, :default => false
|
6
6
|
t.string :name
|
7
|
-
t.
|
7
|
+
t.text :description , :default => ""
|
8
|
+
t.text :summary , :default => ""
|
8
9
|
t.integer :position , :default => 1
|
9
10
|
t.string :link
|
10
11
|
t.attachment :main_picture
|
@@ -4,7 +4,8 @@ class Products < ActiveRecord::Migration
|
|
4
4
|
t.float :price , :null => false
|
5
5
|
t.string :name , :null => false
|
6
6
|
t.string :link
|
7
|
-
t.text :description
|
7
|
+
t.text :description , :default => ""
|
8
|
+
t.text :summary , :default => ""
|
8
9
|
t.attachment :main_picture
|
9
10
|
t.attachment :extra_picture
|
10
11
|
t.boolean :online , :default => false
|
data/lib/office_clerk.rb
CHANGED
@@ -5,19 +5,14 @@ require "jquery-ui-rails"
|
|
5
5
|
require "kramdown"
|
6
6
|
require "will_paginate"
|
7
7
|
|
8
|
-
require 'simple_form'
|
9
|
-
require "prawn"
|
10
8
|
require 'will_paginate-bootstrap'
|
11
9
|
require 'bootstrap-sass'
|
12
10
|
require 'bootstrap_form'
|
13
11
|
require "paperclip"
|
14
12
|
require 'rails-i18n'
|
15
|
-
|
16
|
-
require "
|
17
|
-
require "chunky_png"
|
13
|
+
require "jquery-rails"
|
14
|
+
require "gon"
|
18
15
|
require "bcrypt"
|
19
|
-
require "opal"
|
20
|
-
require "opal/rails"
|
21
16
|
|
22
17
|
require "office_clerk/shipping_method"
|
23
18
|
|