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.
- data/CHANGELOG +53 -0
- data/README.rdoc +19 -10
- data/generators/opensteam/opensteam_generator.rb +27 -3
- data/generators/opensteam/templates/app/controllers/admin/configurations_controller.rb +85 -0
- data/generators/opensteam/templates/app/controllers/admin/inventories_controller.rb +1 -1
- data/generators/opensteam/templates/app/controllers/admin/invoices_controller.rb +35 -4
- data/generators/opensteam/templates/app/controllers/admin/orders_controller.rb +5 -4
- data/generators/opensteam/templates/app/controllers/admin/shipments_controller.rb +6 -3
- data/generators/opensteam/templates/app/controllers/admin/shipping_rate_groups_controller.rb +76 -0
- data/generators/opensteam/templates/app/controllers/admin/tax_groups_controller.rb +124 -0
- data/generators/opensteam/templates/app/controllers/admin/tax_rules_controller.rb +19 -0
- data/generators/opensteam/templates/app/controllers/admin/tax_zones_controller.rb +118 -0
- data/generators/opensteam/templates/app/controllers/admin/users_controller.rb +1 -1
- data/generators/opensteam/templates/app/controllers/admin_controller.rb +20 -0
- data/generators/opensteam/templates/app/controllers/carts_controller.rb +118 -0
- data/generators/opensteam/templates/app/controllers/checkout_controller.rb +119 -79
- data/generators/opensteam/templates/app/controllers/profile_controller.rb +2 -4
- data/generators/opensteam/templates/app/controllers/searches_controller.rb +1 -1
- data/generators/opensteam/templates/app/controllers/user_sessions_controller.rb +2 -1
- data/generators/opensteam/templates/app/controllers/users_controller.rb +10 -3
- data/generators/opensteam/templates/app/helpers/admin_helper.rb +15 -1
- data/generators/opensteam/templates/app/helpers/checkout_helper.rb +38 -0
- data/generators/opensteam/templates/app/helpers/webshop_helper.rb +6 -1
- data/generators/opensteam/templates/app/models/zone.rb +18 -0
- data/generators/opensteam/templates/app/views/admin/_menu.html.erb +18 -0
- data/generators/opensteam/templates/app/views/admin/catalog.html.erb +2 -3
- data/generators/opensteam/templates/app/views/admin/configurations/edit.html.erb +20 -0
- data/generators/opensteam/templates/app/views/admin/configurations/index.html.erb +22 -0
- data/generators/opensteam/templates/app/views/admin/configurations/new.html.erb +19 -0
- data/generators/opensteam/templates/app/views/admin/configurations/show.html.erb +13 -0
- data/generators/opensteam/templates/app/views/admin/filters/_filter.html.erb +1 -1
- data/generators/opensteam/templates/app/views/admin/index.html.erb +0 -19
- data/generators/opensteam/templates/app/views/admin/inventories/edit.html.erb +10 -6
- data/generators/opensteam/templates/app/views/admin/inventories/new.html.erb +5 -0
- data/generators/opensteam/templates/app/views/admin/inventories/show.html.erb +10 -6
- data/generators/opensteam/templates/app/views/admin/invoices/_invoice.html.erb +1 -0
- data/generators/opensteam/templates/app/views/admin/invoices/_invoice_fields.html.erb +52 -0
- data/generators/opensteam/templates/app/views/admin/invoices/new.html.erb +9 -37
- data/generators/opensteam/templates/app/views/admin/invoices/show.html.erb +10 -36
- data/generators/opensteam/templates/app/views/admin/invoices/show.pdf.prawn +59 -0
- data/generators/opensteam/templates/app/views/admin/order_config.html.erb +5 -0
- data/generators/opensteam/templates/app/views/admin/order_items/_item_entry.html.erb +9 -0
- data/generators/opensteam/templates/app/views/admin/order_items/_items_table.html.erb +16 -0
- data/generators/opensteam/templates/app/views/admin/orders/_order.html.erb +9 -9
- data/generators/opensteam/templates/app/views/admin/orders/_orders.html.erb +1 -1
- data/generators/opensteam/templates/app/views/admin/orders/show.html.erb +25 -9
- data/generators/opensteam/templates/app/views/admin/payment_types.html.erb +27 -0
- data/generators/opensteam/templates/app/views/admin/payments/_credit_card_payment.html.erb +26 -0
- data/generators/opensteam/templates/app/views/admin/payments/_credit_card_payment_info.html.erb +15 -0
- data/generators/opensteam/templates/app/views/admin/payments/_direct_debit_payment.html.erb +5 -0
- data/generators/opensteam/templates/app/views/admin/shipments/new.html.erb +45 -30
- data/generators/opensteam/templates/app/views/admin/shipments/show.html.erb +3 -3
- data/generators/opensteam/templates/app/views/admin/shipping_rate_groups/_payment_addition.html.erb +12 -0
- data/generators/opensteam/templates/app/views/admin/shipping_rate_groups/_rate.html.erb +16 -0
- data/generators/opensteam/templates/app/views/admin/shipping_rate_groups/edit.html.erb +63 -0
- data/generators/opensteam/templates/app/views/admin/shipping_rate_groups/index.html.erb +28 -0
- data/generators/opensteam/templates/app/views/admin/shipping_rate_groups/new.html.erb +60 -0
- data/generators/opensteam/templates/app/views/admin/shipping_rate_groups/show.html.erb +13 -0
- data/generators/opensteam/templates/app/views/admin/system.html.erb +5 -0
- data/generators/opensteam/templates/app/views/admin/tax_groups/_attributes.html.erb +11 -0
- data/generators/opensteam/templates/app/views/admin/tax_groups/_tax_groups.html.erb +17 -0
- data/generators/opensteam/templates/app/views/admin/tax_groups/_tax_groups_row.html.erb +12 -0
- data/generators/opensteam/templates/app/views/admin/tax_groups/_tax_rule.html.erb +14 -0
- data/generators/opensteam/templates/app/views/admin/tax_groups/edit.html.erb +26 -0
- data/generators/opensteam/templates/app/views/admin/tax_groups/index.html.erb +8 -0
- data/generators/opensteam/templates/app/views/admin/tax_groups/new.html.erb +27 -0
- data/generators/opensteam/templates/app/views/admin/tax_groups/show.html.erb +28 -0
- data/generators/opensteam/templates/app/views/admin/tax_zones/_attributes.html.erb +18 -0
- data/generators/opensteam/templates/app/views/admin/tax_zones/_tax_zone_row.html.erb +13 -0
- data/generators/opensteam/templates/app/views/admin/tax_zones/_tax_zones.html.erb +11 -0
- data/generators/opensteam/templates/app/views/admin/tax_zones/edit.html.erb +16 -0
- data/generators/opensteam/templates/app/views/admin/tax_zones/index.html.erb +16 -0
- data/generators/opensteam/templates/app/views/admin/tax_zones/new.html.erb +14 -0
- data/generators/opensteam/templates/app/views/admin/tax_zones/show.html.erb +15 -0
- data/generators/opensteam/templates/app/views/admin/users.html.erb +0 -1
- data/generators/opensteam/templates/app/views/admin/users/show.html.erb +10 -0
- data/generators/opensteam/templates/app/views/administration_mailer/order_customer.erb +1 -1
- data/generators/opensteam/templates/app/views/carts/_cart.html.erb +7 -0
- data/generators/opensteam/templates/app/views/carts/_cart_content.html.erb +45 -0
- data/generators/opensteam/templates/app/views/carts/create.rjs +3 -0
- data/generators/opensteam/templates/app/views/{cart → carts}/index.html.erb +0 -0
- data/generators/opensteam/templates/app/views/carts/update.rjs +11 -0
- data/generators/opensteam/templates/app/views/checkout/_address.html.erb +42 -0
- data/generators/opensteam/templates/app/views/checkout/_customer.html.erb +31 -0
- data/generators/opensteam/templates/app/views/checkout/_edit_checkout.html.erb +42 -0
- data/generators/opensteam/templates/app/views/checkout/_new_checkout.html.erb +44 -0
- data/generators/opensteam/templates/app/views/checkout/_shipping_buttons.html.erb +8 -0
- data/generators/opensteam/templates/app/views/checkout/edit.html.erb +7 -0
- data/generators/opensteam/templates/app/views/checkout/new.html.erb +11 -0
- data/generators/opensteam/templates/app/views/checkout/outro.html.erb +1 -4
- data/generators/opensteam/templates/app/views/checkout/show.html.erb +63 -0
- data/generators/opensteam/templates/app/views/common/_header_admin.html.erb +5 -0
- data/generators/opensteam/templates/app/views/layouts/admin.html.erb +28 -12
- data/generators/opensteam/templates/app/views/layouts/profile.html.erb +2 -2
- data/generators/opensteam/templates/app/views/layouts/webshop.html.erb +5 -4
- data/generators/opensteam/templates/app/views/payment/_advance_payment_payment.html.erb +1 -0
- data/generators/opensteam/templates/app/views/payment/_credit_card_payment.html.erb +37 -0
- data/generators/opensteam/templates/app/views/payment/_credit_card_payment_confirmation.html.erb +20 -0
- data/generators/opensteam/templates/app/views/payment/_direct_debit_payment.html.erb +5 -0
- data/generators/opensteam/templates/app/views/payment/_direct_debit_payment_confirmation.html.erb +5 -0
- data/generators/opensteam/templates/app/views/profile/index.html.erb +1 -1
- data/generators/opensteam/templates/app/views/profile/infos/edit.html.erb +20 -12
- data/generators/opensteam/templates/app/views/profile/infos/edit_password.html.erb +16 -12
- data/generators/opensteam/templates/app/views/profile/orders/_order.html.erb +1 -1
- data/generators/opensteam/templates/app/views/profile/orders/show.html.erb +10 -7
- data/generators/opensteam/templates/app/views/webshop/_inventory_content.html.erb +1 -0
- data/generators/opensteam/templates/app/views/webshop/show.html.erb +3 -1
- data/generators/opensteam/templates/config/initializers/init_states.rb +13 -24
- data/generators/opensteam/templates/config/initializers/opensteam.rb +41 -0
- data/generators/opensteam/templates/config/initializers/opensteam_model_tables.rb +49 -10
- data/generators/opensteam/templates/config/initializers/opensteam_security.rb +8 -0
- data/generators/opensteam/templates/config/initializers/payment_process.rb +37 -0
- data/generators/opensteam/templates/db/migrate/20080609095723_create_addresses.rb +8 -2
- data/generators/opensteam/templates/db/migrate/20080609095726_create_inventories.rb +6 -3
- data/generators/opensteam/templates/db/migrate/20080609095728_create_order_items.rb +12 -1
- data/generators/opensteam/templates/db/migrate/20080609095729_create_orders.rb +8 -12
- data/generators/opensteam/templates/db/migrate/20080609095730_create_payment_types.rb +2 -0
- data/generators/opensteam/templates/db/migrate/20080714131513_create_invoices.rb +2 -1
- data/generators/opensteam/templates/db/migrate/20080714131650_create_shipments.rb +3 -1
- data/generators/opensteam/templates/db/migrate/20080808075247_create_containers.rb +30 -0
- data/generators/opensteam/templates/db/migrate/20080808083011_create_container_items.rb +25 -0
- data/generators/opensteam/templates/db/migrate/20080812102727_create_tax_zones.rb +16 -0
- data/generators/opensteam/templates/db/migrate/20080812102858_create_tax_rules.rb +15 -0
- data/generators/opensteam/templates/db/migrate/20080812102956_create_tax_groups.rb +14 -0
- data/generators/opensteam/templates/db/migrate/20080831181436_create_configurations.rb +15 -0
- data/generators/opensteam/templates/db/migrate/20080903131506_create_payments.rb +22 -0
- data/generators/opensteam/templates/db/migrate/20080904133625_create_payment_transactions.rb +24 -0
- data/generators/opensteam/templates/db/migrate/20080916102341_create_zones.rb +19 -0
- data/generators/opensteam/templates/db/migrate/20080916134340_create_region_shipping_rates.rb +18 -0
- data/generators/opensteam/templates/db/migrate/20080916134523_create_shipping_rate_groups.rb +18 -0
- data/generators/opensteam/templates/db/migrate/20080916135226_create_shipping_payment_additions.rb +20 -0
- data/generators/opensteam/templates/db/migrate/20080916135228_init_opensteam_config.rb +60 -0
- data/generators/opensteam/templates/public/images/opensteam_black.jpg +0 -0
- data/generators/opensteam/templates/public/images/pdf.png +0 -0
- data/generators/opensteam/templates/public/images/shader.png +0 -0
- data/generators/opensteam/templates/public/index.html +1 -0
- data/generators/opensteam/templates/public/javascripts/opensteam.js +21 -21
- data/generators/opensteam/templates/public/stylesheets/opensteam_admin.css +291 -0
- data/generators/opensteam/templates/public/stylesheets/opensteam_white.css +47 -11
- data/generators/opensteam/templates/tasks/opensteam.rake +2 -12
- data/generators/opensteam/templates/test/fixtures/addresses.yml +26 -0
- data/generators/opensteam/templates/test/fixtures/configurations.yml +29 -0
- data/generators/opensteam/templates/test/fixtures/inventories.yml +32 -15
- data/generators/opensteam/templates/test/fixtures/profiles.yml +21 -0
- data/generators/opensteam/templates/test/fixtures/region_shipping_rates.yml +33 -0
- data/generators/opensteam/templates/test/fixtures/shipping_payment_additions.yml +91 -0
- data/generators/opensteam/templates/test/fixtures/shipping_rate_groups.yml +25 -0
- data/generators/opensteam/templates/test/fixtures/tax_groups.yml +13 -0
- data/generators/opensteam/templates/test/fixtures/tax_rules.yml +29 -0
- data/generators/opensteam/templates/test/fixtures/tax_zones.yml +33 -0
- data/generators/opensteam/templates/test/fixtures/users.yml +26 -0
- data/generators/opensteam/templates/test/fixtures/zones.yml +2707 -0
- data/generators/opensteam/templates/test/functional/carts_controller_test.rb +103 -0
- data/generators/opensteam/templates/test/test_helper.rb +38 -0
- data/generators/opensteam/templates/test/unit/container_test.rb +71 -0
- data/generators/opensteam/templates/test/unit/order_test.rb +93 -0
- data/generators/opensteam/templates/test/unit/payment_test.rb +220 -0
- data/generators/opensteam/templates/test/unit/product_test.rb +158 -0
- data/generators/opensteam/templates/vendor/plugins/prawnto/.gitignore +3 -0
- data/generators/opensteam/templates/vendor/plugins/prawnto/MIT-LICENSE +20 -0
- data/generators/opensteam/templates/vendor/plugins/prawnto/README +12 -0
- data/generators/opensteam/templates/vendor/plugins/prawnto/Rakefile +22 -0
- data/generators/opensteam/templates/vendor/plugins/prawnto/init.rb +6 -0
- data/generators/opensteam/templates/vendor/plugins/prawnto/lib/prawnto.rb +13 -0
- data/generators/opensteam/templates/vendor/plugins/prawnto/lib/prawnto/action_controller.rb +47 -0
- data/generators/opensteam/templates/vendor/plugins/prawnto/lib/prawnto/template_handler/base.rb +75 -0
- data/generators/opensteam/templates/vendor/plugins/prawnto/lib/prawnto/template_handler/raw.rb +54 -0
- data/generators/opensteam/templates/vendor/plugins/prawnto/tasks/prawnto_tasks.rake +4 -0
- data/generators/opensteam/templates/vendor/plugins/prawnto/test/action_controller_test.rb +36 -0
- data/generators/opensteam/templates/vendor/plugins/prawnto/test/base_template_handler_test.rb +58 -0
- data/generators/opensteam/templates/vendor/plugins/prawnto/test/raw_template_handler_test.rb +163 -0
- data/generators/opensteam/templates/vendor/plugins/prawnto/test/template_handler_test_mocks.rb +83 -0
- data/generators/opensteam_product/templates/views/admin/_attributes.html.erb +8 -3
- data/generators/opensteam_product/templates/views/admin/_inventories.html.erb +2 -0
- data/lib/opensteam.rb +0 -1
- data/lib/opensteam/base.rb +2 -1
- data/lib/opensteam/checkout.rb +3 -12
- data/lib/opensteam/config.rb +50 -2
- data/lib/opensteam/container.rb +196 -0
- data/lib/opensteam/extension_base.rb +19 -1
- data/lib/opensteam/finder.rb +1 -1
- data/lib/opensteam/helpers/config_table_helper.rb +18 -6
- data/lib/opensteam/initializer.rb +24 -4
- data/lib/opensteam/inventory_base.rb +6 -1
- data/lib/opensteam/invoice_base.rb +12 -13
- data/lib/opensteam/money.rb +230 -0
- data/lib/opensteam/order_base.rb +122 -48
- data/lib/opensteam/payment.rb +225 -0
- data/lib/opensteam/payment/advance_payment.rb +34 -0
- data/lib/opensteam/payment/credit_card_payment.rb +217 -0
- data/lib/opensteam/payment/direct_debit_payment.rb +53 -0
- data/lib/opensteam/product_base.rb +48 -12
- data/lib/opensteam/security.rb +54 -0
- data/lib/opensteam/shipment_base.rb +214 -6
- data/lib/opensteam/shopping_cart.rb +20 -300
- data/lib/opensteam/state_logic.rb +5 -3
- data/lib/opensteam/state_machine.rb +8 -3
- data/lib/opensteam/user_base.rb +48 -6
- data/lib/opensteam/version.rb +1 -1
- metadata +122 -16
- data/generators/opensteam/templates/app/controllers/cart_controller.rb +0 -94
- data/generators/opensteam/templates/app/views/admin/orders/_event.html.erb +0 -5
- data/generators/opensteam/templates/app/views/admin/orders/_order_item.html.erb +0 -10
- data/generators/opensteam/templates/app/views/cart/_cart.html.erb +0 -8
- data/generators/opensteam/templates/app/views/cart/_cart_content.html.erb +0 -20
- data/generators/opensteam/templates/app/views/cart/update.rjs +0 -1
- data/generators/opensteam/templates/app/views/checkout/payment.html.erb +0 -8
- data/generators/opensteam/templates/app/views/checkout/shipping.html.erb +0 -45
- data/generators/opensteam/templates/app/views/checkout/show_cart.html.erb +0 -13
- data/generators/opensteam/templates/app/views/checkout/update_cart_content.rjs +0 -2
- data/generators/opensteam/templates/app/views/profile/orders/_order_item.html.erb +0 -10
- data/generators/opensteam/templates/db/migrate/20080609095725_create_dummy_users.rb +0 -21
- data/lib/opensteam/cart_base.rb +0 -227
|
@@ -36,9 +36,9 @@
|
|
|
36
36
|
<br />
|
|
37
37
|
<ul>
|
|
38
38
|
<% for oi in @shipment.order_items %>
|
|
39
|
-
<li> <%=h oi.
|
|
40
|
-
| <%- unless oi.
|
|
41
|
-
| <%=h oi.quantity %> | <%=h oi.quantity * oi.
|
|
39
|
+
<li> <%=h oi.product.name %> (<%=h oi.product.class %>)
|
|
40
|
+
| <%- unless oi.properties.empty? -%><b>Configuration:</b> <%=h oi.properties.collect(&:name) * "," %><%- end -%>
|
|
41
|
+
| <%=h oi.quantity %> | <%=h oi.quantity * oi.price %></li>
|
|
42
42
|
<% end %>
|
|
43
43
|
</ul>
|
|
44
44
|
</p>
|
data/generators/opensteam/templates/app/views/admin/shipping_rate_groups/_payment_addition.html.erb
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
<% prefix = payment_addition.new_record? ? "new_payment_additions" : "existing_payment_additions" %>
|
|
2
|
+
|
|
3
|
+
<div class="payment_addition">
|
|
4
|
+
<% fields_for "group[#{prefix}][]", payment_addition do |p| %>
|
|
5
|
+
<% field_set_tag do %>
|
|
6
|
+
<%= p.select :payment_type, Opensteam::Payment::Types.active.collect(&:name) %>
|
|
7
|
+
<%= p.text_field :amount, :size => 4 %>
|
|
8
|
+
Fix Rate: <%= p.check_box :fix_value %>
|
|
9
|
+
<%= link_to_function "remove", "$(this).up('.payment_addition').remove()" %>
|
|
10
|
+
<% end %>
|
|
11
|
+
<% end %>
|
|
12
|
+
</div>
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
<% prefix = rate.new_record? ? "new_rates" : "existing_rates" %>
|
|
2
|
+
<tr class="rate">
|
|
3
|
+
<% fields_for "group[#{prefix}][]", rate do |r| %>
|
|
4
|
+
<td>
|
|
5
|
+
<%= r.select :zone_id, Zone.for_select( :country_name, :id ) %>
|
|
6
|
+
</td>
|
|
7
|
+
<td>
|
|
8
|
+
<%= r.text_field :shipping_method %>
|
|
9
|
+
</td>
|
|
10
|
+
<td>
|
|
11
|
+
<%= r.text_field :rate, :size => 3 %>
|
|
12
|
+
</td>
|
|
13
|
+
<td>
|
|
14
|
+
<%= link_to_function "del", "$(this).up('.rate').remove()" %>
|
|
15
|
+
</td>
|
|
16
|
+
<% end %>
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
<h1>Edit Group of ShippingRates #<%=h @group.id %> </h1>
|
|
2
|
+
|
|
3
|
+
<%= error_messages_for :group %>
|
|
4
|
+
|
|
5
|
+
<% form_for :group, @group, :url => { :action => :update }, :html => { :method => :put } do |f| %>
|
|
6
|
+
|
|
7
|
+
<% field_set_tag do %>
|
|
8
|
+
<%= f.label :name, "Group Name" %>
|
|
9
|
+
<%= f.text_field :name %>
|
|
10
|
+
<% end %>
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
<h2>Shipping Rates</h2>
|
|
14
|
+
<% border_style = !@group.errors.on( :shipping_rates) ? "border:1px solid #AAA" : "border: 2px solid red" %>
|
|
15
|
+
<div style="<%=h border_style %>;">
|
|
16
|
+
<% field_set_tag do %>
|
|
17
|
+
<%= link_to_function "Add Rate" do |page|
|
|
18
|
+
page.insert_html :bottom, :rates, :partial => "rate", :object => Opensteam::ShipmentBase::RegionShippingRate.new, :locals => { :f => f }
|
|
19
|
+
end %>
|
|
20
|
+
<table>
|
|
21
|
+
<thead><tr><th>Region</th><th>ShippingMethod</th><th>Rate</th></tr></thead>
|
|
22
|
+
<tbody id="rates">
|
|
23
|
+
<% for rate in @group.shipping_rates %>
|
|
24
|
+
<%= render :partial => "rate", :object => rate, :locals => { :f => f } %>
|
|
25
|
+
<% end %>
|
|
26
|
+
</tbody>
|
|
27
|
+
</table>
|
|
28
|
+
<% end %>
|
|
29
|
+
</div>
|
|
30
|
+
|
|
31
|
+
<h2>Options</h2>
|
|
32
|
+
Used if no ShoppingRate Rule (above) applies.
|
|
33
|
+
<div>
|
|
34
|
+
<% field_set_tag do %>
|
|
35
|
+
<p>
|
|
36
|
+
<%= f.label :master_rate %>
|
|
37
|
+
<%= f.text_field :master_rate, :size => 3 %>
|
|
38
|
+
</p>
|
|
39
|
+
<p>
|
|
40
|
+
<%= f.label :shipping_disabled %>
|
|
41
|
+
<%= f.check_box :shipping_disabled %>
|
|
42
|
+
</p>
|
|
43
|
+
<% end %>
|
|
44
|
+
</div>
|
|
45
|
+
|
|
46
|
+
<h2>PaymentType Additions</h2>
|
|
47
|
+
<div style="border: 1px solid #AAA;">
|
|
48
|
+
<%= link_to_function "Add Payment Addition" do |page|
|
|
49
|
+
page.insert_html :bottom, :payment_additions, :partial => "payment_addition", :object => Opensteam::ShipmentBase::ShippingPaymentAddition.new
|
|
50
|
+
end %>
|
|
51
|
+
<div id="payment_additions">
|
|
52
|
+
<% for pa in @group.payment_additions %>
|
|
53
|
+
<%= render :partial => "payment_addition", :object => pa %>
|
|
54
|
+
<% end %>
|
|
55
|
+
</div>
|
|
56
|
+
</div>
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
<%= submit_tag "Save" %>
|
|
62
|
+
|
|
63
|
+
<% end %>
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
<% content_for :admin_sidebar do %>
|
|
2
|
+
<%= link_to "New Group", new_admin_shipping_rate_group_path %>
|
|
3
|
+
<% end %>
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
<% for group in @groups %>
|
|
7
|
+
<div style="padding-left: 10px;border-left: 1px solid #AAA;" class="shipping_group">
|
|
8
|
+
<b><u>Name</u></b>: <%=h group.name %> <%= link_to "edit", edit_admin_shipping_rate_group_path( group ) %> |
|
|
9
|
+
<%= link_to "del", admin_shipping_rate_group_path( group ), :method => :delete, :confirm => "Are you sure?" %><br />
|
|
10
|
+
<b>Default Rate</b>: <%=h group.master_rate %><br />
|
|
11
|
+
<b>ShippingRate Disabled</b>: <%=h group.shipping_disabled %><br />
|
|
12
|
+
<br />
|
|
13
|
+
<b>Shipping Rates</b>
|
|
14
|
+
<ul>
|
|
15
|
+
<% for rate in group.shipping_rates %>
|
|
16
|
+
<li><%=h rate.zone.country_name %> - <%=h rate.shipping_method %> - <%=h rate.rate %></li>
|
|
17
|
+
<% end %>
|
|
18
|
+
</ul>
|
|
19
|
+
<b>Payment Additions</b>
|
|
20
|
+
<ul>
|
|
21
|
+
<% for a in group.payment_additions %>
|
|
22
|
+
<li><%=h a.payment_type %> - <%=h a.amount %></li>
|
|
23
|
+
<% end %>
|
|
24
|
+
</ul>
|
|
25
|
+
</div>
|
|
26
|
+
<br />
|
|
27
|
+
<% end %>
|
|
28
|
+
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
<h1>New Group of ShippingRates</h1>
|
|
2
|
+
|
|
3
|
+
<%= error_messages_for :group %>
|
|
4
|
+
|
|
5
|
+
<% form_for :group, @group, :url => { :action => :create }, :html => { :method => :post } do |f| %>
|
|
6
|
+
|
|
7
|
+
<% field_set_tag do %>
|
|
8
|
+
<%= f.label :name, "Group Name" %>
|
|
9
|
+
<%= f.text_field :name %>
|
|
10
|
+
<% end %>
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
<h2>Shipping Rates</h2>
|
|
14
|
+
<% border_style = !@group.errors.on( :shipping_rates) ? "border:1px solid #AAA" : "border: 2px solid red" %>
|
|
15
|
+
<div style="<%=h border_style %>;">
|
|
16
|
+
<% field_set_tag do %>
|
|
17
|
+
<%= link_to_function "Add Rate" do |page|
|
|
18
|
+
page.insert_html :bottom, :rates, :partial => "rate", :object => Opensteam::ShipmentBase::RegionShippingRate.new, :locals => { :f => f }
|
|
19
|
+
end %>
|
|
20
|
+
<table>
|
|
21
|
+
<thead><tr><th>Region</th><th>ShippingMethod</th><th>Rate</th></tr></thead>
|
|
22
|
+
<tbody id="rates">
|
|
23
|
+
<% for rate in @group.shipping_rates %>
|
|
24
|
+
<%= render :partial => "rate", :object => rate, :locals => { :f => f } %>
|
|
25
|
+
<% end %>
|
|
26
|
+
</tbody>
|
|
27
|
+
</table>
|
|
28
|
+
<% end %>
|
|
29
|
+
</div>
|
|
30
|
+
|
|
31
|
+
<h2>Options</h2>
|
|
32
|
+
Used if no ShoppingRate Rule (above) applies.
|
|
33
|
+
<div>
|
|
34
|
+
<% field_set_tag do %>
|
|
35
|
+
<p>
|
|
36
|
+
<%= f.label :master_rate %>
|
|
37
|
+
<%= f.text_field :master_rate, :size => 3 %>
|
|
38
|
+
</p>
|
|
39
|
+
<p>
|
|
40
|
+
<%= f.label :shipping_disabled %>
|
|
41
|
+
<%= f.check_box :shipping_disabled %>
|
|
42
|
+
</p>
|
|
43
|
+
<% end %>
|
|
44
|
+
</div>
|
|
45
|
+
|
|
46
|
+
<h2>PaymentType Additions</h2>
|
|
47
|
+
<div style="border: 1px solid #AAA;">
|
|
48
|
+
<%= link_to_function "Add Payment Addition" do |page|
|
|
49
|
+
page.insert_html :bottom, :payment_additions, :partial => "payment_addition", :object => @group.payment_additions.build
|
|
50
|
+
end %>
|
|
51
|
+
<div id="payment_additions">
|
|
52
|
+
</div>
|
|
53
|
+
</div>
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
<%= submit_tag "Save" %>
|
|
59
|
+
|
|
60
|
+
<% end %>
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
<table>
|
|
2
|
+
<thead>
|
|
3
|
+
<tr>
|
|
4
|
+
<th>#</th>
|
|
5
|
+
<th>Name</th>
|
|
6
|
+
<th>Products</th>
|
|
7
|
+
<th>Zones</th>
|
|
8
|
+
<th>CreatedAt</th>
|
|
9
|
+
<th>UpdatedAt</th>
|
|
10
|
+
</tr>
|
|
11
|
+
</thead>
|
|
12
|
+
|
|
13
|
+
<tbody id="<%= id %>">
|
|
14
|
+
<%= render :partial => "admin/tax_groups/tax_groups_row", :collection => tax_groups, :id => id %>
|
|
15
|
+
</tbody>
|
|
16
|
+
|
|
17
|
+
</table>
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
|
|
2
|
+
<tr class="<%= cycle('odd','even') %>">
|
|
3
|
+
<td><%=h tax_groups_row.id %></td>
|
|
4
|
+
<td><%=h tax_groups_row.name %></td>
|
|
5
|
+
<td><%=h tax_groups_row.inventories.size %></td>
|
|
6
|
+
<td><%=h tax_groups_row.tax_zones.size %></td>
|
|
7
|
+
<td><%=h ordinalized_time( tax_groups_row.created_at) %></td>
|
|
8
|
+
<td><%=h ordinalized_time( tax_groups_row.updated_at ) %></td>
|
|
9
|
+
<td><%= link_to "show", admin_tax_group_path( tax_groups_row ) %></td>
|
|
10
|
+
<td><%= link_to "edit", edit_admin_tax_group_path( tax_groups_row) %></td>
|
|
11
|
+
<td><%= link_to "del", admin_tax_group_path( tax_groups_row), :method => :delete, :confirm => "Are your sure?" %>
|
|
12
|
+
</tr>
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
<div class="rule">
|
|
2
|
+
<% new = tax_rule.new_record? ? 'new' : 'existing' %>
|
|
3
|
+
<% prefix = "tax_group[#{new}_tax_rule_attributes][]" %>
|
|
4
|
+
|
|
5
|
+
<% fields_for prefix, tax_rule do |tax_rule_form| %>
|
|
6
|
+
<% field_set_tag do %>
|
|
7
|
+
<p>
|
|
8
|
+
TaxRule:
|
|
9
|
+
<%= tax_rule_form.select :tax_zone_id, @tax_zones.collect { |z| ["#{z.country} - #{z.rate}", z.id] } %>
|
|
10
|
+
<%= link_to_function "remove", "$(this).up('.rule').remove()" %>
|
|
11
|
+
</p>
|
|
12
|
+
<% end %>
|
|
13
|
+
<% end %>
|
|
14
|
+
</div>
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
<% content_for :admin_sidebar do %>
|
|
2
|
+
<%= link_to "Tax Groups", admin_tax_groups_path %>
|
|
3
|
+
<% end %>
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
<h2>Edit Tax Group</h2>
|
|
7
|
+
|
|
8
|
+
<%= error_messages_for :tax_group %>
|
|
9
|
+
|
|
10
|
+
<% form_for :tax_group, @tax_group, :url => { :controller => "admin/tax_groups", :action => 'update' }, :html => { :method => :put } do |f| %>
|
|
11
|
+
|
|
12
|
+
<%= render :partial => "attributes", :locals => { :f => f, :button => "Update" } %>
|
|
13
|
+
|
|
14
|
+
<div id="tax_rules">
|
|
15
|
+
<%= render :partial => "tax_rule", :collection => @tax_group.tax_rules %>
|
|
16
|
+
</div>
|
|
17
|
+
|
|
18
|
+
<p>
|
|
19
|
+
<%= add_tax_rule_link "Add Zone to Group" %>
|
|
20
|
+
</p>
|
|
21
|
+
|
|
22
|
+
<p>
|
|
23
|
+
<%= submit_tag "Update" %>
|
|
24
|
+
</p>
|
|
25
|
+
|
|
26
|
+
<% end %>
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
<% content_for :admin_sidebar do %>
|
|
2
|
+
<%= link_to "Tax Groups", admin_tax_groups_path %>
|
|
3
|
+
<% end %>
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
<h2>Create Tax Group</h2>
|
|
7
|
+
|
|
8
|
+
<%= error_messages_for :tax_group %>
|
|
9
|
+
|
|
10
|
+
<% form_for :tax_group, @tax_group, :url => { :controller => "admin/tax_groups", :action => 'create' } do |f| %>
|
|
11
|
+
|
|
12
|
+
<%= render :partial => "attributes", :locals => { :f => f, :button => "Create" } %>
|
|
13
|
+
|
|
14
|
+
<div id="tax_rules">
|
|
15
|
+
<%= render :partial => "tax_rule", :collection => @tax_group.tax_rules %>
|
|
16
|
+
</div>
|
|
17
|
+
<p>
|
|
18
|
+
<%= add_tax_rule_link "Add Zone to Group" %>
|
|
19
|
+
</p>
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
<p>
|
|
24
|
+
<%= submit_tag "Create" %>
|
|
25
|
+
</p>
|
|
26
|
+
|
|
27
|
+
<% end %>
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
<% content_for :admin_sidebar do %>
|
|
2
|
+
<%= link_to "Tax Groups", admin_tax_groups_path %>
|
|
3
|
+
<% end %>
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
<h2>Tax Group #<%= @tax_group.id %></h2>
|
|
7
|
+
<p>
|
|
8
|
+
<b>Group Name:</b> <%= @tax_group.name %>
|
|
9
|
+
</p>
|
|
10
|
+
<%= link_to "edit", edit_admin_tax_group_path( @tax_group ) %>
|
|
11
|
+
|
|
12
|
+
<div id="tax_zones">
|
|
13
|
+
<% for tax_zone in @tax_group.tax_zones %>
|
|
14
|
+
<p>
|
|
15
|
+
<b>Country:</b> <%= tax_zone.country %>
|
|
16
|
+
</p>
|
|
17
|
+
<p>
|
|
18
|
+
<b>State</b> <%= tax_zone.state %>
|
|
19
|
+
</p>
|
|
20
|
+
<p>
|
|
21
|
+
<b>Rate</b> <%= tax_zone.rate %>
|
|
22
|
+
</p>
|
|
23
|
+
<br />
|
|
24
|
+
<% end %>
|
|
25
|
+
</div>
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
<% field_set_tag do %>
|
|
2
|
+
<p>
|
|
3
|
+
<%= f.label :country %>
|
|
4
|
+
<%= f.select :country, @countries.sort, :include_blank => "choose a country" %>
|
|
5
|
+
</p>
|
|
6
|
+
|
|
7
|
+
<p>
|
|
8
|
+
<%= f.label :state %>
|
|
9
|
+
<%= f.text_field :state %>
|
|
10
|
+
</p>
|
|
11
|
+
|
|
12
|
+
<p>
|
|
13
|
+
<%= f.label :rate %>
|
|
14
|
+
<%= f.text_field :rate %>
|
|
15
|
+
</p>
|
|
16
|
+
<% end %>
|
|
17
|
+
|
|
18
|
+
<%= submit_tag button %>
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
|
|
2
|
+
<tr class="<%= cycle('odd','even') %>">
|
|
3
|
+
<td><%=h tax_zone_row.id %></td>
|
|
4
|
+
<td><%=h tax_zone_row.country %></td>
|
|
5
|
+
<td><%=h tax_zone_row.state %></td>
|
|
6
|
+
<td><%=h tax_zone_row.rate %></td>
|
|
7
|
+
<td><%=h ordinalized_time( tax_zone_row.created_at) %></td>
|
|
8
|
+
<td><%=h ordinalized_time( tax_zone_row.updated_at ) %></td>
|
|
9
|
+
<td><%= link_to "show", admin_tax_zone_path( tax_zone_row ) %></td>
|
|
10
|
+
<td><%= link_to "edit", edit_admin_tax_zone_path( tax_zone_row ) %></td>
|
|
11
|
+
|
|
12
|
+
<td><%= link_to "del", admin_tax_zone_path( tax_zone_row ), :method => :delete, :confirm => "Are your sure?" %>
|
|
13
|
+
</tr>
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
<% osteam_sort_table TaxZone do |t| %>
|
|
2
|
+
<%= t.table_header do |column|
|
|
3
|
+
url = { :controller => "tax_zones", :action => 'index', :sort => column.id }
|
|
4
|
+
link_to_remote( column.name, :url => url, :update => id, :method => 'get' )
|
|
5
|
+
|
|
6
|
+
end %>
|
|
7
|
+
<tbody id="<%= id %>">
|
|
8
|
+
<%= render :partial => "admin/tax_zones/tax_zone_row", :collection => tax_zones, :id => id %>
|
|
9
|
+
</tbody>
|
|
10
|
+
|
|
11
|
+
<% end %>
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
<% content_for :admin_sidebar do %>
|
|
2
|
+
<%= link_to "Tax Zones", admin_tax_zones_path %>
|
|
3
|
+
<% end %>
|
|
4
|
+
|
|
5
|
+
<h2>Edit Tax Zone #<%= @tax_zone.id %></h2>
|
|
6
|
+
|
|
7
|
+
<%= error_messages_for :tax_zone %>
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
<% form_for :tax_zone, @tax_zone, :url => { :controller => "admin/tax_zones", :action => 'update' }, :html => { :method => :put } do |f| %>
|
|
11
|
+
|
|
12
|
+
<%= render :partial => "attributes", :locals => { :f => f, :button => "update", :countries => @countries} %>
|
|
13
|
+
|
|
14
|
+
<% end %>
|
|
15
|
+
|
|
16
|
+
<%= link_to "Back", admin_tax_zone_path( @tax_zone ) %>
|