opensteam 0.9.2 → 0.9.3

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 (213) hide show
  1. data/CHANGELOG +53 -0
  2. data/README.rdoc +19 -10
  3. data/generators/opensteam/opensteam_generator.rb +27 -3
  4. data/generators/opensteam/templates/app/controllers/admin/configurations_controller.rb +85 -0
  5. data/generators/opensteam/templates/app/controllers/admin/inventories_controller.rb +1 -1
  6. data/generators/opensteam/templates/app/controllers/admin/invoices_controller.rb +35 -4
  7. data/generators/opensteam/templates/app/controllers/admin/orders_controller.rb +5 -4
  8. data/generators/opensteam/templates/app/controllers/admin/shipments_controller.rb +6 -3
  9. data/generators/opensteam/templates/app/controllers/admin/shipping_rate_groups_controller.rb +76 -0
  10. data/generators/opensteam/templates/app/controllers/admin/tax_groups_controller.rb +124 -0
  11. data/generators/opensteam/templates/app/controllers/admin/tax_rules_controller.rb +19 -0
  12. data/generators/opensteam/templates/app/controllers/admin/tax_zones_controller.rb +118 -0
  13. data/generators/opensteam/templates/app/controllers/admin/users_controller.rb +1 -1
  14. data/generators/opensteam/templates/app/controllers/admin_controller.rb +20 -0
  15. data/generators/opensteam/templates/app/controllers/carts_controller.rb +118 -0
  16. data/generators/opensteam/templates/app/controllers/checkout_controller.rb +119 -79
  17. data/generators/opensteam/templates/app/controllers/profile_controller.rb +2 -4
  18. data/generators/opensteam/templates/app/controllers/searches_controller.rb +1 -1
  19. data/generators/opensteam/templates/app/controllers/user_sessions_controller.rb +2 -1
  20. data/generators/opensteam/templates/app/controllers/users_controller.rb +10 -3
  21. data/generators/opensteam/templates/app/helpers/admin_helper.rb +15 -1
  22. data/generators/opensteam/templates/app/helpers/checkout_helper.rb +38 -0
  23. data/generators/opensteam/templates/app/helpers/webshop_helper.rb +6 -1
  24. data/generators/opensteam/templates/app/models/zone.rb +18 -0
  25. data/generators/opensteam/templates/app/views/admin/_menu.html.erb +18 -0
  26. data/generators/opensteam/templates/app/views/admin/catalog.html.erb +2 -3
  27. data/generators/opensteam/templates/app/views/admin/configurations/edit.html.erb +20 -0
  28. data/generators/opensteam/templates/app/views/admin/configurations/index.html.erb +22 -0
  29. data/generators/opensteam/templates/app/views/admin/configurations/new.html.erb +19 -0
  30. data/generators/opensteam/templates/app/views/admin/configurations/show.html.erb +13 -0
  31. data/generators/opensteam/templates/app/views/admin/filters/_filter.html.erb +1 -1
  32. data/generators/opensteam/templates/app/views/admin/index.html.erb +0 -19
  33. data/generators/opensteam/templates/app/views/admin/inventories/edit.html.erb +10 -6
  34. data/generators/opensteam/templates/app/views/admin/inventories/new.html.erb +5 -0
  35. data/generators/opensteam/templates/app/views/admin/inventories/show.html.erb +10 -6
  36. data/generators/opensteam/templates/app/views/admin/invoices/_invoice.html.erb +1 -0
  37. data/generators/opensteam/templates/app/views/admin/invoices/_invoice_fields.html.erb +52 -0
  38. data/generators/opensteam/templates/app/views/admin/invoices/new.html.erb +9 -37
  39. data/generators/opensteam/templates/app/views/admin/invoices/show.html.erb +10 -36
  40. data/generators/opensteam/templates/app/views/admin/invoices/show.pdf.prawn +59 -0
  41. data/generators/opensteam/templates/app/views/admin/order_config.html.erb +5 -0
  42. data/generators/opensteam/templates/app/views/admin/order_items/_item_entry.html.erb +9 -0
  43. data/generators/opensteam/templates/app/views/admin/order_items/_items_table.html.erb +16 -0
  44. data/generators/opensteam/templates/app/views/admin/orders/_order.html.erb +9 -9
  45. data/generators/opensteam/templates/app/views/admin/orders/_orders.html.erb +1 -1
  46. data/generators/opensteam/templates/app/views/admin/orders/show.html.erb +25 -9
  47. data/generators/opensteam/templates/app/views/admin/payment_types.html.erb +27 -0
  48. data/generators/opensteam/templates/app/views/admin/payments/_credit_card_payment.html.erb +26 -0
  49. data/generators/opensteam/templates/app/views/admin/payments/_credit_card_payment_info.html.erb +15 -0
  50. data/generators/opensteam/templates/app/views/admin/payments/_direct_debit_payment.html.erb +5 -0
  51. data/generators/opensteam/templates/app/views/admin/shipments/new.html.erb +45 -30
  52. data/generators/opensteam/templates/app/views/admin/shipments/show.html.erb +3 -3
  53. data/generators/opensteam/templates/app/views/admin/shipping_rate_groups/_payment_addition.html.erb +12 -0
  54. data/generators/opensteam/templates/app/views/admin/shipping_rate_groups/_rate.html.erb +16 -0
  55. data/generators/opensteam/templates/app/views/admin/shipping_rate_groups/edit.html.erb +63 -0
  56. data/generators/opensteam/templates/app/views/admin/shipping_rate_groups/index.html.erb +28 -0
  57. data/generators/opensteam/templates/app/views/admin/shipping_rate_groups/new.html.erb +60 -0
  58. data/generators/opensteam/templates/app/views/admin/shipping_rate_groups/show.html.erb +13 -0
  59. data/generators/opensteam/templates/app/views/admin/system.html.erb +5 -0
  60. data/generators/opensteam/templates/app/views/admin/tax_groups/_attributes.html.erb +11 -0
  61. data/generators/opensteam/templates/app/views/admin/tax_groups/_tax_groups.html.erb +17 -0
  62. data/generators/opensteam/templates/app/views/admin/tax_groups/_tax_groups_row.html.erb +12 -0
  63. data/generators/opensteam/templates/app/views/admin/tax_groups/_tax_rule.html.erb +14 -0
  64. data/generators/opensteam/templates/app/views/admin/tax_groups/edit.html.erb +26 -0
  65. data/generators/opensteam/templates/app/views/admin/tax_groups/index.html.erb +8 -0
  66. data/generators/opensteam/templates/app/views/admin/tax_groups/new.html.erb +27 -0
  67. data/generators/opensteam/templates/app/views/admin/tax_groups/show.html.erb +28 -0
  68. data/generators/opensteam/templates/app/views/admin/tax_zones/_attributes.html.erb +18 -0
  69. data/generators/opensteam/templates/app/views/admin/tax_zones/_tax_zone_row.html.erb +13 -0
  70. data/generators/opensteam/templates/app/views/admin/tax_zones/_tax_zones.html.erb +11 -0
  71. data/generators/opensteam/templates/app/views/admin/tax_zones/edit.html.erb +16 -0
  72. data/generators/opensteam/templates/app/views/admin/tax_zones/index.html.erb +16 -0
  73. data/generators/opensteam/templates/app/views/admin/tax_zones/new.html.erb +14 -0
  74. data/generators/opensteam/templates/app/views/admin/tax_zones/show.html.erb +15 -0
  75. data/generators/opensteam/templates/app/views/admin/users.html.erb +0 -1
  76. data/generators/opensteam/templates/app/views/admin/users/show.html.erb +10 -0
  77. data/generators/opensteam/templates/app/views/administration_mailer/order_customer.erb +1 -1
  78. data/generators/opensteam/templates/app/views/carts/_cart.html.erb +7 -0
  79. data/generators/opensteam/templates/app/views/carts/_cart_content.html.erb +45 -0
  80. data/generators/opensteam/templates/app/views/carts/create.rjs +3 -0
  81. data/generators/opensteam/templates/app/views/{cart → carts}/index.html.erb +0 -0
  82. data/generators/opensteam/templates/app/views/carts/update.rjs +11 -0
  83. data/generators/opensteam/templates/app/views/checkout/_address.html.erb +42 -0
  84. data/generators/opensteam/templates/app/views/checkout/_customer.html.erb +31 -0
  85. data/generators/opensteam/templates/app/views/checkout/_edit_checkout.html.erb +42 -0
  86. data/generators/opensteam/templates/app/views/checkout/_new_checkout.html.erb +44 -0
  87. data/generators/opensteam/templates/app/views/checkout/_shipping_buttons.html.erb +8 -0
  88. data/generators/opensteam/templates/app/views/checkout/edit.html.erb +7 -0
  89. data/generators/opensteam/templates/app/views/checkout/new.html.erb +11 -0
  90. data/generators/opensteam/templates/app/views/checkout/outro.html.erb +1 -4
  91. data/generators/opensteam/templates/app/views/checkout/show.html.erb +63 -0
  92. data/generators/opensteam/templates/app/views/common/_header_admin.html.erb +5 -0
  93. data/generators/opensteam/templates/app/views/layouts/admin.html.erb +28 -12
  94. data/generators/opensteam/templates/app/views/layouts/profile.html.erb +2 -2
  95. data/generators/opensteam/templates/app/views/layouts/webshop.html.erb +5 -4
  96. data/generators/opensteam/templates/app/views/payment/_advance_payment_payment.html.erb +1 -0
  97. data/generators/opensteam/templates/app/views/payment/_credit_card_payment.html.erb +37 -0
  98. data/generators/opensteam/templates/app/views/payment/_credit_card_payment_confirmation.html.erb +20 -0
  99. data/generators/opensteam/templates/app/views/payment/_direct_debit_payment.html.erb +5 -0
  100. data/generators/opensteam/templates/app/views/payment/_direct_debit_payment_confirmation.html.erb +5 -0
  101. data/generators/opensteam/templates/app/views/profile/index.html.erb +1 -1
  102. data/generators/opensteam/templates/app/views/profile/infos/edit.html.erb +20 -12
  103. data/generators/opensteam/templates/app/views/profile/infos/edit_password.html.erb +16 -12
  104. data/generators/opensteam/templates/app/views/profile/orders/_order.html.erb +1 -1
  105. data/generators/opensteam/templates/app/views/profile/orders/show.html.erb +10 -7
  106. data/generators/opensteam/templates/app/views/webshop/_inventory_content.html.erb +1 -0
  107. data/generators/opensteam/templates/app/views/webshop/show.html.erb +3 -1
  108. data/generators/opensteam/templates/config/initializers/init_states.rb +13 -24
  109. data/generators/opensteam/templates/config/initializers/opensteam.rb +41 -0
  110. data/generators/opensteam/templates/config/initializers/opensteam_model_tables.rb +49 -10
  111. data/generators/opensteam/templates/config/initializers/opensteam_security.rb +8 -0
  112. data/generators/opensteam/templates/config/initializers/payment_process.rb +37 -0
  113. data/generators/opensteam/templates/db/migrate/20080609095723_create_addresses.rb +8 -2
  114. data/generators/opensteam/templates/db/migrate/20080609095726_create_inventories.rb +6 -3
  115. data/generators/opensteam/templates/db/migrate/20080609095728_create_order_items.rb +12 -1
  116. data/generators/opensteam/templates/db/migrate/20080609095729_create_orders.rb +8 -12
  117. data/generators/opensteam/templates/db/migrate/20080609095730_create_payment_types.rb +2 -0
  118. data/generators/opensteam/templates/db/migrate/20080714131513_create_invoices.rb +2 -1
  119. data/generators/opensteam/templates/db/migrate/20080714131650_create_shipments.rb +3 -1
  120. data/generators/opensteam/templates/db/migrate/20080808075247_create_containers.rb +30 -0
  121. data/generators/opensteam/templates/db/migrate/20080808083011_create_container_items.rb +25 -0
  122. data/generators/opensteam/templates/db/migrate/20080812102727_create_tax_zones.rb +16 -0
  123. data/generators/opensteam/templates/db/migrate/20080812102858_create_tax_rules.rb +15 -0
  124. data/generators/opensteam/templates/db/migrate/20080812102956_create_tax_groups.rb +14 -0
  125. data/generators/opensteam/templates/db/migrate/20080831181436_create_configurations.rb +15 -0
  126. data/generators/opensteam/templates/db/migrate/20080903131506_create_payments.rb +22 -0
  127. data/generators/opensteam/templates/db/migrate/20080904133625_create_payment_transactions.rb +24 -0
  128. data/generators/opensteam/templates/db/migrate/20080916102341_create_zones.rb +19 -0
  129. data/generators/opensteam/templates/db/migrate/20080916134340_create_region_shipping_rates.rb +18 -0
  130. data/generators/opensteam/templates/db/migrate/20080916134523_create_shipping_rate_groups.rb +18 -0
  131. data/generators/opensteam/templates/db/migrate/20080916135226_create_shipping_payment_additions.rb +20 -0
  132. data/generators/opensteam/templates/db/migrate/20080916135228_init_opensteam_config.rb +60 -0
  133. data/generators/opensteam/templates/public/images/opensteam_black.jpg +0 -0
  134. data/generators/opensteam/templates/public/images/pdf.png +0 -0
  135. data/generators/opensteam/templates/public/images/shader.png +0 -0
  136. data/generators/opensteam/templates/public/index.html +1 -0
  137. data/generators/opensteam/templates/public/javascripts/opensteam.js +21 -21
  138. data/generators/opensteam/templates/public/stylesheets/opensteam_admin.css +291 -0
  139. data/generators/opensteam/templates/public/stylesheets/opensteam_white.css +47 -11
  140. data/generators/opensteam/templates/tasks/opensteam.rake +2 -12
  141. data/generators/opensteam/templates/test/fixtures/addresses.yml +26 -0
  142. data/generators/opensteam/templates/test/fixtures/configurations.yml +29 -0
  143. data/generators/opensteam/templates/test/fixtures/inventories.yml +32 -15
  144. data/generators/opensteam/templates/test/fixtures/profiles.yml +21 -0
  145. data/generators/opensteam/templates/test/fixtures/region_shipping_rates.yml +33 -0
  146. data/generators/opensteam/templates/test/fixtures/shipping_payment_additions.yml +91 -0
  147. data/generators/opensteam/templates/test/fixtures/shipping_rate_groups.yml +25 -0
  148. data/generators/opensteam/templates/test/fixtures/tax_groups.yml +13 -0
  149. data/generators/opensteam/templates/test/fixtures/tax_rules.yml +29 -0
  150. data/generators/opensteam/templates/test/fixtures/tax_zones.yml +33 -0
  151. data/generators/opensteam/templates/test/fixtures/users.yml +26 -0
  152. data/generators/opensteam/templates/test/fixtures/zones.yml +2707 -0
  153. data/generators/opensteam/templates/test/functional/carts_controller_test.rb +103 -0
  154. data/generators/opensteam/templates/test/test_helper.rb +38 -0
  155. data/generators/opensteam/templates/test/unit/container_test.rb +71 -0
  156. data/generators/opensteam/templates/test/unit/order_test.rb +93 -0
  157. data/generators/opensteam/templates/test/unit/payment_test.rb +220 -0
  158. data/generators/opensteam/templates/test/unit/product_test.rb +158 -0
  159. data/generators/opensteam/templates/vendor/plugins/prawnto/.gitignore +3 -0
  160. data/generators/opensteam/templates/vendor/plugins/prawnto/MIT-LICENSE +20 -0
  161. data/generators/opensteam/templates/vendor/plugins/prawnto/README +12 -0
  162. data/generators/opensteam/templates/vendor/plugins/prawnto/Rakefile +22 -0
  163. data/generators/opensteam/templates/vendor/plugins/prawnto/init.rb +6 -0
  164. data/generators/opensteam/templates/vendor/plugins/prawnto/lib/prawnto.rb +13 -0
  165. data/generators/opensteam/templates/vendor/plugins/prawnto/lib/prawnto/action_controller.rb +47 -0
  166. data/generators/opensteam/templates/vendor/plugins/prawnto/lib/prawnto/template_handler/base.rb +75 -0
  167. data/generators/opensteam/templates/vendor/plugins/prawnto/lib/prawnto/template_handler/raw.rb +54 -0
  168. data/generators/opensteam/templates/vendor/plugins/prawnto/tasks/prawnto_tasks.rake +4 -0
  169. data/generators/opensteam/templates/vendor/plugins/prawnto/test/action_controller_test.rb +36 -0
  170. data/generators/opensteam/templates/vendor/plugins/prawnto/test/base_template_handler_test.rb +58 -0
  171. data/generators/opensteam/templates/vendor/plugins/prawnto/test/raw_template_handler_test.rb +163 -0
  172. data/generators/opensteam/templates/vendor/plugins/prawnto/test/template_handler_test_mocks.rb +83 -0
  173. data/generators/opensteam_product/templates/views/admin/_attributes.html.erb +8 -3
  174. data/generators/opensteam_product/templates/views/admin/_inventories.html.erb +2 -0
  175. data/lib/opensteam.rb +0 -1
  176. data/lib/opensteam/base.rb +2 -1
  177. data/lib/opensteam/checkout.rb +3 -12
  178. data/lib/opensteam/config.rb +50 -2
  179. data/lib/opensteam/container.rb +196 -0
  180. data/lib/opensteam/extension_base.rb +19 -1
  181. data/lib/opensteam/finder.rb +1 -1
  182. data/lib/opensteam/helpers/config_table_helper.rb +18 -6
  183. data/lib/opensteam/initializer.rb +24 -4
  184. data/lib/opensteam/inventory_base.rb +6 -1
  185. data/lib/opensteam/invoice_base.rb +12 -13
  186. data/lib/opensteam/money.rb +230 -0
  187. data/lib/opensteam/order_base.rb +122 -48
  188. data/lib/opensteam/payment.rb +225 -0
  189. data/lib/opensteam/payment/advance_payment.rb +34 -0
  190. data/lib/opensteam/payment/credit_card_payment.rb +217 -0
  191. data/lib/opensteam/payment/direct_debit_payment.rb +53 -0
  192. data/lib/opensteam/product_base.rb +48 -12
  193. data/lib/opensteam/security.rb +54 -0
  194. data/lib/opensteam/shipment_base.rb +214 -6
  195. data/lib/opensteam/shopping_cart.rb +20 -300
  196. data/lib/opensteam/state_logic.rb +5 -3
  197. data/lib/opensteam/state_machine.rb +8 -3
  198. data/lib/opensteam/user_base.rb +48 -6
  199. data/lib/opensteam/version.rb +1 -1
  200. metadata +122 -16
  201. data/generators/opensteam/templates/app/controllers/cart_controller.rb +0 -94
  202. data/generators/opensteam/templates/app/views/admin/orders/_event.html.erb +0 -5
  203. data/generators/opensteam/templates/app/views/admin/orders/_order_item.html.erb +0 -10
  204. data/generators/opensteam/templates/app/views/cart/_cart.html.erb +0 -8
  205. data/generators/opensteam/templates/app/views/cart/_cart_content.html.erb +0 -20
  206. data/generators/opensteam/templates/app/views/cart/update.rjs +0 -1
  207. data/generators/opensteam/templates/app/views/checkout/payment.html.erb +0 -8
  208. data/generators/opensteam/templates/app/views/checkout/shipping.html.erb +0 -45
  209. data/generators/opensteam/templates/app/views/checkout/show_cart.html.erb +0 -13
  210. data/generators/opensteam/templates/app/views/checkout/update_cart_content.rjs +0 -2
  211. data/generators/opensteam/templates/app/views/profile/orders/_order_item.html.erb +0 -10
  212. data/generators/opensteam/templates/db/migrate/20080609095725_create_dummy_users.rb +0 -21
  213. data/lib/opensteam/cart_base.rb +0 -227
@@ -26,11 +26,11 @@
26
26
 
27
27
  <div id="content_box">
28
28
 
29
- <div id="sidebar">
29
+ <div class="sub_content" id="sidebar">
30
30
  <%%= yield(:admin_sidebar) || "" %>
31
31
  </div>
32
32
 
33
- <div id="content">
33
+ <div class="sub_content" id="content">
34
34
  <%%= yield %>
35
35
  </div>
36
36
  </div>
@@ -25,16 +25,16 @@
25
25
 
26
26
  <div id="content_box">
27
27
 
28
- <div id="sidebar">
28
+ <div class="sub_content" id="sidebar">
29
29
  <%%= yield(:store_sidebar) || "" %>
30
30
  </div>
31
31
 
32
- <div id="content">
32
+ <div class="sub_content" id="content">
33
33
  <%%= yield %>
34
34
  </div>
35
35
 
36
- <div id="cart" style="float:right;">
37
- <%%= controller.controller_name.include?("<%= file_name %>") ? render( :partial => "common/cart" ) : "" %>
36
+ <div class="sub_content" id="cart" style="float:right;">
37
+ <%%= render :partial => "carts/cart" unless controller.controller_name.match(/checkout|search/) %>
38
38
  </div>
39
39
 
40
40
 
@@ -46,6 +46,7 @@
46
46
  </div>
47
47
 
48
48
  </div>
49
+ <div style="display:none;" id="indicator_center_big"><%%= image_tag('indicator_big.gif') %></div>
49
50
  </body>
50
51
 
51
52
  </html>
@@ -0,0 +1,37 @@
1
+ <% fields_for :payment_fields, credit_card_payment do |ccp| %>
2
+ <h2>CreditCard</h2>
3
+ <% ccp.fields_for :set_credit_card, credit_card_payment.credit_card do |cc| %>
4
+ <%= error_messages_for :set_credit_card, :object => credit_card_payment.credit_card %>
5
+ <% field_set_tag do %>
6
+ <p>
7
+ <%= cc.label :type %>
8
+ <%= cc.select :type, [ [""], ["visa"], ["bogus"] ] %>
9
+ </p>
10
+ <p>
11
+ <%= cc.label :number %>
12
+ <%= cc.text_field :number %>
13
+ </p>
14
+ <p>
15
+ <%= cc.label :verification_value %>
16
+ <%= cc.text_field :verification_value, :size => 3 %>
17
+ </p>
18
+ <p>
19
+ <%= cc.label :year %>
20
+ <%= cc.text_field :year %>
21
+ </p>
22
+ <p>
23
+ <%= cc.label :month %>
24
+ <%= cc.text_field :month %>
25
+ </p>
26
+ <p>
27
+ <%= cc.label :first_name %>
28
+ <%= cc.text_field :first_name %>
29
+ </p>
30
+ <p>
31
+ <%= cc.label :last_name %>
32
+ <%= cc.text_field :last_name %>
33
+ </p>
34
+ <% end %>
35
+ <% end %>
36
+
37
+ <% end %>
@@ -0,0 +1,20 @@
1
+ <% credit_card = credit_card_payment_confirmation.credit_card %>
2
+
3
+ <% f.fields_for :set_credit_card, credit_card do |cc| %>
4
+
5
+ <h4>CreditCard:</h4>
6
+ <b>Brand:</b> <%= credit_card.type %><br />
7
+ <b>Number:</b> <%= credit_card.number %><br />
8
+ <b>Year:</b> <%= credit_card.year %> <b>Month:</b> <%= credit_card.month %><br />
9
+ <b>Firstname:</b> <%= credit_card.first_name %> <b>Lastname:</b> <%= credit_card.last_name %><br />
10
+ <br />
11
+
12
+ <%= cc.hidden_field :type %>
13
+ <%= cc.hidden_field :number %>
14
+ <%= cc.hidden_field :verification_value %>
15
+ <%= cc.hidden_field :year %>
16
+ <%= cc.hidden_field :month %>
17
+ <%= cc.hidden_field :first_name %>
18
+ <%= cc.hidden_field :last_name %>
19
+
20
+ <% end %>
@@ -0,0 +1,5 @@
1
+ .... Direct Debit....
2
+ <br />
3
+ <br />
4
+ <br />
5
+ not yet implemented....
@@ -0,0 +1,5 @@
1
+ .... Direct Debit....
2
+ <br />
3
+ <br />
4
+ <br />
5
+ not yet implemented....
@@ -5,7 +5,7 @@
5
5
 
6
6
  <h3>Customer Information</h3>
7
7
 
8
- <div id="customer_information">
8
+ <div class="sub_content" id="customer_information">
9
9
  <%= render :template => 'admin/users/show', :object => @customer %>
10
10
  </div>
11
11
 
@@ -9,17 +9,25 @@
9
9
 
10
10
  <div id="edit_customer_information">
11
11
 
12
- <% form_for :customer, @customer, :url => { :controller => 'profile/infos', :action => 'update' }, :html => { :method => :put } do |f| %>
13
- <p>
14
- <b>Email:</b> <%= f.text_field :email %>
15
- </p>
16
- <p>
17
- <b>Firstname</b> <%= f.text_field :firstname %>
18
- </p>
19
- <p>
20
- <b>Lastname</b> <%= f.text_field :lastname %>
21
- </p>
22
- <%= submit_tag "Update" %>
23
- <% end %>
12
+ <% form_for :customer, @customer, :url => { :controller => 'profile/infos', :action => 'update' }, :html => { :method => :put } do |f| %>
13
+ <% field_set_tag do %>
14
+ <p>
15
+ <%= f.label :email %>
16
+ <%= f.text_field :email %>
17
+ </p>
18
+
19
+ <p>
20
+ <%= f.label :firstname %>
21
+ <%= f.text_field :firstname %>
22
+ </p>
23
+
24
+ <p>
25
+ <%= f.label :lastname %>
26
+ <%= f.text_field :lastname %>
27
+ </p>
24
28
 
29
+ <%= submit_tag "Update" %>
30
+ <% end %>
31
+ <% end %>
32
+
25
33
  </div>
@@ -10,17 +10,21 @@
10
10
  <div id="edit_customer_password">
11
11
 
12
12
  <% form_for :customer, @customer, :url => { :controller => 'profile/infos', :action => 'change_password' }, :html => { :method => :put } do |f| %>
13
-
14
- <p>
15
- <b>Old Password: </b> <%= f.password_field :old_password %> </p>
16
- <p>
17
- <b>New Password:</b> <%= f.password_field :password %>
18
- </p>
19
- <p>
20
- <b>New Password Confirmation: </b> <%= f.password_field :password_confirmation %>
21
- </p>
22
-
23
- <%= submit_tag "Update" %>
13
+ <% field_set_tag do %>
14
+ <p>
15
+ <%= f.label :old_password %>
16
+ <%= f.password_field :old_password %> </p>
17
+ <p>
18
+ <%= f.label :password %>
19
+ <%= f.password_field :password %>
20
+ </p>
21
+ <p>
22
+ <%= f.label :password_confirmation %>
23
+ <%= f.password_field :password_confirmation %>
24
+ </p>
25
+
26
+ <%= submit_tag "Update" %>
27
+ <% end %>
24
28
  <% end %>
25
-
29
+
26
30
  </div>
@@ -1,6 +1,6 @@
1
1
  <tr class="<%= cycle('odd','even') %>">
2
2
  <td><%=h order.id %></td>
3
- <td><%=h order.order_items.size %></td>
3
+ <td><%=h order.items.size %></td>
4
4
  <td><%= order.customer.email %></td>
5
5
  <td><%=h order.shipping_address.to_s %></td>
6
6
  <td><%=h order.shipping_address.to_s %></td>
@@ -2,7 +2,7 @@
2
2
  <% admin_sidebar_links do %>
3
3
  <%= admin_sidebar_link "Information", "#", :function => "toggle_admin_display('order_customer');" %>
4
4
  <%= admin_sidebar_link "Shipments", "#", :function => "toggle_admin_display('order_shipments');" %>
5
- <%= admin_sidebar_link "Invoices", "#", :function => "toggle_admin_display('order_invoices');" %>
5
+ <%= admin_sidebar_link "Payment", "#", :function => "toggle_admin_display('order_invoices');" %>
6
6
  <%= admin_sidebar_link "Order Items", "#", :function => "toggle_admin_display('order_order_items');" %>
7
7
  <%= admin_sidebar_link "History", "#", :function => "toggle_admin_display('order_history');" %>
8
8
  <% end%>
@@ -18,19 +18,22 @@
18
18
 
19
19
  <div id="order_shipments" class="sub_content_box" style="display:none;">
20
20
  <h3>Shipments</h3>
21
- <%= render :partial => "admin/shipments/shipments", :object => @order.shipments,
22
- :locals => { :id => "order_shipments_table" } %>
21
+ <b>State:</b> <%= @order.shipments.collect(&:state).join(", ") %><br />
22
+ <b>Shipping Type:</b> <%= @order.shipping_type %><br />
23
+ <b>Shipping Rate:</b> <%= @order.shipping_rate %><br />
23
24
  </div>
24
25
 
25
26
  <div id="order_invoices" class="sub_content_box" style="display:none;">
26
- <h3>Invoices</h3>
27
- <%= render :partial => "admin/invoices/invoices", :object => @order.invoices %>
27
+ <h3>Payment</h3>
28
+ <%- unless @order.payments.empty? -%>
29
+ <%= render :partial => "admin/payments/#{@order.payments.first.class.payment_id}_payment", :object => @order.payments.first %>
30
+ <%- end -%>
28
31
  </div>
29
32
 
30
33
  <div id="order_order_items" class="sub_content_box" style="display:none;">
31
34
  <h3>Order Items</h3>
32
- <b>Total Price</b>: <%=h @order.order_items.collect(&:inventory).collect(&:price).sum %>
33
- <%= render :partial => "order_item", :collection => @order.order_items %>
35
+ <b>Total Price</b>: <%=h @order.items.collect(&:total_price).sum %>
36
+ <%= render :partial => "admin/order_items/items_table", :object => @order %>
34
37
  </div>
35
38
 
36
39
  <div id="order_history" class="sub_content_box" style="display:none;">
@@ -1,4 +1,5 @@
1
1
  <%- if inventory_content.is_active? %>
2
+ <%= hidden_field_tag "id", inventory_content.id %>
2
3
  <b>Price</b>: <%=h inventory_content.price %><br />
3
4
  <b>Storage</b>: <%=h inventory_content.storage %><br />
4
5
  <%- if inventory_content.storage <= 0 -%>
@@ -1,5 +1,7 @@
1
1
  <div id="details">
2
- <%% form_remote_tag :url => { :action => :add_inventory_to_cart }, :html => { :id => "show"} do %>
2
+ <%% form_remote_tag :url => { :action => 'create', :controller => 'carts' }, :html => { :id => "show" } do %>
3
+
4
+
3
5
  <%% fields_for :product, @product do |f| %>
4
6
  <%%= render( :partial => existing_partial( "#{@product.class.to_s.demodulize.tableize}/details", "#{@product.class.superclass.to_s.demodulize.tableize}/details" ),
5
7
  :object => @product,
@@ -1,15 +1,11 @@
1
-
2
1
  if defined? RAILS_ROOT
3
-
4
2
  Dir.glob("#{RAILS_ROOT}/lib/states/**/*.rb").collect { |f|
5
3
  require f
6
4
  }
7
-
8
5
  end
9
6
 
10
7
 
11
8
 
12
-
13
9
  Order.class_eval do
14
10
  include OrderStates::Finished
15
11
  include OrderStates::Pending
@@ -18,15 +14,14 @@ Order.class_eval do
18
14
  named_scope :open, :conditions => ["orders.state is not ?", :finished]
19
15
 
20
16
 
21
- initial_state :pending
17
+ initial_state :created
22
18
 
23
19
  observe do |record|
24
- if record.shipments.all_finished? && record.invoices.all_finished? &&
25
- record.order_items.all_invoiced? && record.order_items.all_shipped?
26
-
20
+
21
+ if record.shipments.all_finished? && record.items.all_shipped? && record.payments.all_captured?
27
22
  record.state = :finished unless record.state.to_sym == :finished
28
-
29
23
  end
24
+
30
25
  end
31
26
 
32
27
  end
@@ -45,24 +40,18 @@ Shipment.class_eval do
45
40
 
46
41
  end
47
42
 
48
- # States for Opensteam::InvoiceBase::Invoice
49
- Invoice.class_eval do
50
-
51
-
43
+
44
+ Opensteam::Payment::CreditCardPayment.class_eval do
45
+ include Opensteam::Payment::States::PaymentAuthorized
46
+ include Opensteam::Payment::States::PaymentDeclined
47
+ include Opensteam::Payment::States::PaymentFailed
48
+ include Opensteam::Payment::States::PaymentCaptured
52
49
 
53
50
 
54
- include InvoiceStates::WaitingForPayment
55
- include InvoiceStates::PaymentReceived
56
- include InvoiceStates::Pending
57
- include InvoiceStates::Finished
58
-
59
- initial_state :pending
51
+ initial_state :payment_pending
60
52
 
61
53
  observe do |record|
62
- notify :order
54
+ notify :order if record.order
63
55
  end
64
56
 
65
-
66
- end
67
-
68
-
57
+ end
@@ -10,6 +10,7 @@ class Array
10
10
 
11
11
  end
12
12
 
13
+
13
14
  class Class
14
15
  # get all subclasses of the given klass
15
16
  def self.get_subclasses(klass)
@@ -26,6 +27,7 @@ Dir.glob("#{RAILS_ROOT}/app/models/*.rb").collect { |f| require f }
26
27
  # define property_accessors for Inventory-objects
27
28
  Inventory.define_property_accessors
28
29
 
30
+ Opensteam::Payment::Types.register_payment_types!if ActiveRecord::Base.connection.table_exists?( "payment_types" )
29
31
 
30
32
 
31
33
  ## Constants for restful_authenticated
@@ -34,3 +36,42 @@ REST_AUTH_DIGEST_STRETCHES = 10
34
36
 
35
37
 
36
38
 
39
+ #module ActionView # :nodoc:
40
+ # require 'pdf/writer'
41
+ # class PDFRender
42
+ # PAPER = 'A4'
43
+ # include ApplicationHelper
44
+ # include ActionView::Helpers::AssetTagHelper
45
+ # include ActionView::Helpers::TextHelper
46
+ # include ActionView::Helpers::TagHelper
47
+ # include ActionView::Helpers::UrlHelper
48
+ #
49
+ # def initialize(action_view)
50
+ # @action_view = action_view
51
+ # end
52
+ #
53
+ # # Render the PDF
54
+ # def render(template, local_assigns = {})
55
+ # @action_view.controller.headers["Content-Type"] ||= 'application/pdf'
56
+ #
57
+ # # Retrieve controller variables
58
+ # @action_view.controller.instance_variables.each do |v|
59
+ # instance_variable_set(v, @action_view.controller.instance_variable_get(v))
60
+ # end
61
+ #
62
+ # pdf = ::PDF::Writer.new( :paper => PAPER )
63
+ # pdf.compressed = true if RAILS_ENV != 'development'
64
+ # eval template.source, nil, "#{@action_view.base_path}/#{@action_view.first_render}.#{@action_view.finder.pick_template_extension(@action_view.first_render)}"
65
+ #
66
+ # pdf.render
67
+ # end
68
+ #
69
+ # def self.compilable?
70
+ # false
71
+ # end
72
+ #
73
+ # def compilable?
74
+ # self.class.compilable?
75
+ # end
76
+ # end
77
+ #end
@@ -7,25 +7,64 @@ Opensteam::OrderBase::Order.send( :include, Opensteam::Helpers::ConfigTableHelpe
7
7
 
8
8
  Opensteam::OrderBase::Order.class_eval do
9
9
  opensteam_filter :order do
10
- include_associations [:customer, :shipping_address, :payment_address, :order_items ]
10
+ include_associations [:customer, :shipping_address, :payment_address, :items ]
11
11
 
12
12
  default_order_column :id
13
13
 
14
- column :id, :name => "#", :order => "orders.id"
15
- column :order_items, :name => "OrderItems", :method => :size
14
+ column :id, :name => "#", :order => "containers.id"
15
+ column :items, :name => "OrderItems", :method => :size, :order => "containers.items_count"
16
16
  column :customer, :name => "Customer", :order => "users.email"
17
17
  column :shipping_address, :name => "Shipping Address", :method => :to_s, :sql => ["addresses.street", "addresses.city" ]
18
- column :payment_address, :name => "Payment Address", :method => :to_s
19
- column :state, :name => "State", :order => "orders.state"
20
- column :created_at, :name => "Created", :order => "orders.created_at"
21
- column :updated_at, :name => "Updated", :order => "orders.updated_at"
18
+ column :payment_address, :name => "Payment Address", :method => :to_s, :sql => ["addresses.street", "addresses.city" ]
19
+ column :state, :name => "State", :order => "containers.state"
20
+ column :created_at, :name => "Created", :order => "containers.created_at"
21
+ column :updated_at, :name => "Updated", :order => "containers.updated_at"
22
+
23
+ end
24
+ end
25
+
26
+
27
+ TaxZone.send( :include, Opensteam::Helpers::ConfigTableHelper )
28
+
29
+ TaxZone.class_eval do
30
+ opensteam_filter :tax_zone do
31
+
32
+ include_associations []
33
+
34
+ default_order_column :id
35
+
36
+ column :id, :name => "#", :order => "tax_zones.id"
37
+ column :country, :name => "Country", :order => "tax_zones.country"
38
+ column :state, :name => "State", :order => "tax_zones.state"
39
+ column :rate, :name => "Rate", :order => "tax_zones.rate"
40
+ column :created_at, :name => "Created", :order => "tax_zones.created_at"
41
+ column :updated_at, :name => "Updated", :order => "tax_zones.updated_at"
22
42
 
23
43
  end
24
-
25
-
26
-
27
44
  end
28
45
 
46
+
47
+
48
+ TaxGroup.send( :include, Opensteam::Helpers::ConfigTableHelper )
49
+
50
+ TaxGroup.class_eval do
51
+ opensteam_filter :tax_group do
52
+
53
+ include_associations []
54
+
55
+ default_order_column :id
56
+
57
+ column :id, :name => "#", :order => "tax_groups.id"
58
+ column :name, :name => "Name", :order => "tax_groups.name"
59
+ column :created_at, :name => "Created", :order => "tax_groups.created_at"
60
+ column :updated_at, :name => "Updated", :order => "tax_groups.updated_at"
61
+
62
+ end
63
+ end
64
+
65
+
66
+
67
+
29
68
  Opensteam::UserBase::User.send( :include, Opensteam::Helpers::ConfigTableHelper )
30
69
 
31
70