rails_trade 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/LICENSE +165 -0
- data/README.md +47 -0
- data/Rakefile +37 -0
- data/app/assets/config/rails_trade_manifest.js +1 -0
- data/app/assets/javascripts/controllers/rails_trade_admin/buyers/index.js +15 -0
- data/app/assets/javascripts/controllers/rails_trade_admin/buyers/overdue.js +15 -0
- data/app/assets/javascripts/controllers/rails_trade_admin/cart_items/create.js +3 -0
- data/app/assets/javascripts/controllers/rails_trade_admin/cart_items/index.js +80 -0
- data/app/assets/javascripts/controllers/rails_trade_admin/cart_items/only.js +45 -0
- data/app/assets/javascripts/controllers/rails_trade_admin/orders/new.js +29 -0
- data/app/assets/javascripts/controllers/rails_trade_admin/payment_methods/edit.js +1 -0
- data/app/assets/javascripts/controllers/rails_trade_admin/payment_methods/index.js +1 -0
- data/app/assets/javascripts/controllers/rails_trade_admin/payment_methods/new.js +1 -0
- data/app/assets/javascripts/controllers/rails_trade_admin/payment_methods/unverified.js +1 -0
- data/app/assets/javascripts/controllers/rails_trade_admin/payments/index.js +0 -0
- data/app/assets/javascripts/controllers/rails_trade_admin/payments/new.js +1 -0
- data/app/assets/javascripts/controllers/rails_trade_admin/promote_buyers/edit.js +31 -0
- data/app/assets/javascripts/controllers/rails_trade_admin/promote_buyers/new.js +31 -0
- data/app/assets/javascripts/controllers/rails_trade_admin/promote_goods/index.js +1 -0
- data/app/assets/javascripts/controllers/rails_trade_admin/promotes/edit.js +2 -0
- data/app/assets/javascripts/controllers/rails_trade_admin/promotes/index.js +1 -0
- data/app/assets/javascripts/controllers/rails_trade_admin/promotes/new.js +2 -0
- data/app/assets/javascripts/controllers/rails_trade_admin/serves/edit.js +2 -0
- data/app/assets/javascripts/controllers/rails_trade_admin/serves/index.js +1 -0
- data/app/assets/javascripts/controllers/rails_trade_admin/serves/new.js +4 -0
- data/app/assets/javascripts/controllers/rails_trade_my/cart_items/create.js +3 -0
- data/app/assets/javascripts/controllers/rails_trade_my/cart_items/index.js +65 -0
- data/app/controllers/areas_controller.rb +18 -0
- data/app/controllers/buyers_controller.rb +8 -0
- data/app/controllers/concerns/controller_order_types.rb +92 -0
- data/app/controllers/goods_controller.rb +90 -0
- data/app/controllers/payments_controller.rb +50 -0
- data/app/controllers/providers_controller.rb +8 -0
- data/app/controllers/the_trade_admin/addresses_controller.rb +75 -0
- data/app/controllers/the_trade_admin/areas_controller.rb +50 -0
- data/app/controllers/the_trade_admin/base_controller.rb +5 -0
- data/app/controllers/the_trade_admin/buyers_controller.rb +37 -0
- data/app/controllers/the_trade_admin/cart_item_serves_controller.rb +63 -0
- data/app/controllers/the_trade_admin/cart_items_controller.rb +123 -0
- data/app/controllers/the_trade_admin/order_payments_controller.rb +52 -0
- data/app/controllers/the_trade_admin/orders_controller.rb +103 -0
- data/app/controllers/the_trade_admin/payment_methods_controller.rb +111 -0
- data/app/controllers/the_trade_admin/payment_orders_controller.rb +56 -0
- data/app/controllers/the_trade_admin/payment_references_controller.rb +54 -0
- data/app/controllers/the_trade_admin/payment_strategies_controller.rb +50 -0
- data/app/controllers/the_trade_admin/payments_controller.rb +89 -0
- data/app/controllers/the_trade_admin/produces_controller.rb +66 -0
- data/app/controllers/the_trade_admin/promote_buyers_controller.rb +39 -0
- data/app/controllers/the_trade_admin/promote_charges_controller.rb +62 -0
- data/app/controllers/the_trade_admin/promote_goods_controller.rb +50 -0
- data/app/controllers/the_trade_admin/promotes_controller.rb +105 -0
- data/app/controllers/the_trade_admin/providers_controller.rb +121 -0
- data/app/controllers/the_trade_admin/refunds_controller.rb +60 -0
- data/app/controllers/the_trade_admin/serve_charges_controller.rb +67 -0
- data/app/controllers/the_trade_admin/serves_controller.rb +107 -0
- data/app/controllers/the_trade_my/addresses_controller.rb +50 -0
- data/app/controllers/the_trade_my/base_controller.rb +13 -0
- data/app/controllers/the_trade_my/buyers_controller.rb +35 -0
- data/app/controllers/the_trade_my/cart_items_controller.rb +71 -0
- data/app/controllers/the_trade_my/order_items_controller.rb +49 -0
- data/app/controllers/the_trade_my/orders_controller.rb +161 -0
- data/app/controllers/the_trade_my/payment_methods_controller.rb +76 -0
- data/app/controllers/the_trade_my/providers_controller.rb +44 -0
- data/app/models/rails_trade/address.rb +14 -0
- data/app/models/rails_trade/area.rb +65 -0
- data/app/models/rails_trade/cart_item.rb +185 -0
- data/app/models/rails_trade/cart_item_serve.rb +16 -0
- data/app/models/rails_trade/concerns/good_able.rb +63 -0
- data/app/models/rails_trade/concerns/order_able.rb +48 -0
- data/app/models/rails_trade/concerns/promote_fee.rb +54 -0
- data/app/models/rails_trade/concerns/serve_fee.rb +41 -0
- data/app/models/rails_trade/concerns/summary_service.rb +67 -0
- data/app/models/rails_trade/concerns/the_payment.rb +88 -0
- data/app/models/rails_trade/concerns/the_refund.rb +36 -0
- data/app/models/rails_trade/concerns/the_trade_buyer.rb +50 -0
- data/app/models/rails_trade/concerns/the_trade_user.rb +23 -0
- data/app/models/rails_trade/good_partner.rb +8 -0
- data/app/models/rails_trade/good_produce.rb +14 -0
- data/app/models/rails_trade/order.rb +111 -0
- data/app/models/rails_trade/order_item.rb +88 -0
- data/app/models/rails_trade/order_promote.rb +23 -0
- data/app/models/rails_trade/order_serve.rb +23 -0
- data/app/models/rails_trade/order_shipment.rb +10 -0
- data/app/models/rails_trade/payment.rb +135 -0
- data/app/models/rails_trade/payment_interface/payment_interface_base.rb +8 -0
- data/app/models/rails_trade/payment_interface/the_alipay.rb +49 -0
- data/app/models/rails_trade/payment_interface/the_paypal.rb +103 -0
- data/app/models/rails_trade/payment_interface/the_stripe.rb +73 -0
- data/app/models/rails_trade/payment_interface/the_wxpay.rb +56 -0
- data/app/models/rails_trade/payment_method.rb +57 -0
- data/app/models/rails_trade/payment_methods/alipay_method.rb +7 -0
- data/app/models/rails_trade/payment_methods/bank_method.rb +7 -0
- data/app/models/rails_trade/payment_methods/stripe_method.rb +57 -0
- data/app/models/rails_trade/payment_order.rb +75 -0
- data/app/models/rails_trade/payment_reference.rb +15 -0
- data/app/models/rails_trade/payment_strategy.rb +16 -0
- data/app/models/rails_trade/payments/alipay_payment.rb +12 -0
- data/app/models/rails_trade/payments/bank_payment.rb +15 -0
- data/app/models/rails_trade/payments/hand_payment.rb +13 -0
- data/app/models/rails_trade/payments/paypal_payment.rb +8 -0
- data/app/models/rails_trade/payments/stripe_payment.rb +7 -0
- data/app/models/rails_trade/payments/wxpay_payment.rb +14 -0
- data/app/models/rails_trade/produce.rb +18 -0
- data/app/models/rails_trade/promote.rb +40 -0
- data/app/models/rails_trade/promote_buyer.rb +9 -0
- data/app/models/rails_trade/promote_charge.rb +17 -0
- data/app/models/rails_trade/promote_charges/single_promote_charge.rb +7 -0
- data/app/models/rails_trade/promote_charges/total_promote_charge.rb +7 -0
- data/app/models/rails_trade/promote_good.rb +9 -0
- data/app/models/rails_trade/promotes/amount_promote.rb +4 -0
- data/app/models/rails_trade/promotes/number_promote.rb +4 -0
- data/app/models/rails_trade/provider.rb +25 -0
- data/app/models/rails_trade/refund.rb +63 -0
- data/app/models/rails_trade/refunds/alipay_refund.rb +33 -0
- data/app/models/rails_trade/refunds/bank_refund.rb +5 -0
- data/app/models/rails_trade/refunds/hand_refund.rb +5 -0
- data/app/models/rails_trade/refunds/paypal_refund.rb +32 -0
- data/app/models/rails_trade/refunds/stripe_refund.rb +26 -0
- data/app/models/rails_trade/refunds/wxpay_refund.rb +40 -0
- data/app/models/rails_trade/serve.rb +44 -0
- data/app/models/rails_trade/serve_charge.rb +37 -0
- data/app/models/rails_trade/serve_charges/single_serve_charge.rb +7 -0
- data/app/models/rails_trade/serve_charges/total_serve_charge.rb +7 -0
- data/app/models/rails_trade/serve_good.rb +9 -0
- data/app/models/rails_trade/serves/number_serve.rb +4 -0
- data/app/models/rails_trade/serves/quantity_serve.rb +4 -0
- data/app/models/rails_trade/shipment.rb +8 -0
- data/app/views/buyers/_show.html.erb +7 -0
- data/app/views/buyers/show.js.erb +1 -0
- data/app/views/goods/_choose.html.erb +36 -0
- data/app/views/goods/_good.html.erb +17 -0
- data/app/views/goods/_good_item.html.erb +17 -0
- data/app/views/goods/_nav.html.erb +18 -0
- data/app/views/goods/_search.html.erb +6 -0
- data/app/views/goods/index.html.erb +34 -0
- data/app/views/goods/index/_product.html.erb +14 -0
- data/app/views/goods/item.html.erb +47 -0
- data/app/views/goods/produce.html.erb +48 -0
- data/app/views/goods/show.html.erb +2 -0
- data/app/views/goods/show/_basic.html.erb +23 -0
- data/app/views/goods/show/_carousel.html.erb +35 -0
- data/app/views/goods/show/_items.html.erb +32 -0
- data/app/views/goods/show/_sales.html.erb +17 -0
- data/app/views/goods/show/_side.html.erb +19 -0
- data/app/views/goods/taxon/_breadcrumb.html.erb +8 -0
- data/app/views/goods/taxon/_nav.html.erb +19 -0
- data/app/views/goods/taxon/_nav_.html.erb +18 -0
- data/app/views/goods/taxon/_nav_last.html.erb +19 -0
- data/app/views/layouts/rails_trade_admin/base.html.erb +25 -0
- data/app/views/layouts/rails_trade_my/base.html.erb +28 -0
- data/app/views/rails_trade_admin/addresses/_address.html.erb +24 -0
- data/app/views/rails_trade_admin/addresses/_edit.html.erb +13 -0
- data/app/views/rails_trade_admin/addresses/_form.html.erb +23 -0
- data/app/views/rails_trade_admin/addresses/_new.html.erb +13 -0
- data/app/views/rails_trade_admin/addresses/create.js.erb +2 -0
- data/app/views/rails_trade_admin/addresses/destroy.js.erb +1 -0
- data/app/views/rails_trade_admin/addresses/edit.js.erb +39 -0
- data/app/views/rails_trade_admin/addresses/index.html.erb +41 -0
- data/app/views/rails_trade_admin/addresses/new.js.erb +52 -0
- data/app/views/rails_trade_admin/addresses/show.html.erb +4 -0
- data/app/views/rails_trade_admin/addresses/update.js.erb +2 -0
- data/app/views/rails_trade_admin/areas/_form.html.erb +9 -0
- data/app/views/rails_trade_admin/areas/edit.html.erb +16 -0
- data/app/views/rails_trade_admin/areas/index.html.erb +43 -0
- data/app/views/rails_trade_admin/areas/new.html.erb +11 -0
- data/app/views/rails_trade_admin/areas/show.html.erb +1 -0
- data/app/views/rails_trade_admin/base/_nav.html.erb +24 -0
- data/app/views/rails_trade_admin/base/_nav_bar.html.erb +23 -0
- data/app/views/rails_trade_admin/base/_nav_payment.html.erb +25 -0
- data/app/views/rails_trade_admin/buyers/_form.html.erb +17 -0
- data/app/views/rails_trade_admin/buyers/_menu.html.erb +5 -0
- data/app/views/rails_trade_admin/buyers/_search_form.html.erb +11 -0
- data/app/views/rails_trade_admin/buyers/edit.html.erb +6 -0
- data/app/views/rails_trade_admin/buyers/index.html.erb +46 -0
- data/app/views/rails_trade_admin/buyers/new.html.erb +5 -0
- data/app/views/rails_trade_admin/buyers/orders.html.erb +134 -0
- data/app/views/rails_trade_admin/buyers/overdue.html.erb +49 -0
- data/app/views/rails_trade_admin/buyers/show.html.erb +4 -0
- data/app/views/rails_trade_admin/cart_item_serves/_check.html.erb +12 -0
- data/app/views/rails_trade_admin/cart_item_serves/_index.html.erb +37 -0
- data/app/views/rails_trade_admin/cart_item_serves/_new.html.erb +14 -0
- data/app/views/rails_trade_admin/cart_item_serves/_serve.html.erb +16 -0
- data/app/views/rails_trade_admin/cart_item_serves/_single.html.erb +10 -0
- data/app/views/rails_trade_admin/cart_item_serves/_single_table.html.erb +29 -0
- data/app/views/rails_trade_admin/cart_item_serves/_total.html.erb +10 -0
- data/app/views/rails_trade_admin/cart_item_serves/_total_table.html.erb +26 -0
- data/app/views/rails_trade_admin/cart_item_serves/add.js.erb +47 -0
- data/app/views/rails_trade_admin/cart_item_serves/create.js.erb +3 -0
- data/app/views/rails_trade_admin/cart_item_serves/destroy.js.erb +50 -0
- data/app/views/rails_trade_admin/cart_item_serves/index.js.erb +50 -0
- data/app/views/rails_trade_admin/cart_item_serves/new.js.erb +5 -0
- data/app/views/rails_trade_admin/cart_item_serves/single.js.erb +55 -0
- data/app/views/rails_trade_admin/cart_item_serves/total.js.erb +55 -0
- data/app/views/rails_trade_admin/cart_items/_additions.html.erb +20 -0
- data/app/views/rails_trade_admin/cart_items/_filter.html.erb +15 -0
- data/app/views/rails_trade_admin/cart_items/_good_price.html.erb +10 -0
- data/app/views/rails_trade_admin/cart_items/_order_price.html.erb +27 -0
- data/app/views/rails_trade_admin/cart_items/_retail_price.html.erb +4 -0
- data/app/views/rails_trade_admin/cart_items/_single_price.html.erb +28 -0
- data/app/views/rails_trade_admin/cart_items/_total_price.html.erb +9 -0
- data/app/views/rails_trade_admin/cart_items/destroy.js.erb +1 -0
- data/app/views/rails_trade_admin/cart_items/error.html.erb +3 -0
- data/app/views/rails_trade_admin/cart_items/index.html.erb +104 -0
- data/app/views/rails_trade_admin/cart_items/only.html.erb +72 -0
- data/app/views/rails_trade_admin/cart_items/total.js.erb +11 -0
- data/app/views/rails_trade_admin/cart_items/update.js.erb +11 -0
- data/app/views/rails_trade_admin/goods/_form.html.erb +7 -0
- data/app/views/rails_trade_admin/goods/_item.html.erb +6 -0
- data/app/views/rails_trade_admin/goods/_new.html.erb +11 -0
- data/app/views/rails_trade_admin/goods/_show.html.erb +24 -0
- data/app/views/rails_trade_admin/goods/_show_tr.html.erb +24 -0
- data/app/views/rails_trade_admin/goods/create.js.erb +2 -0
- data/app/views/rails_trade_admin/goods/destroy.js.erb +1 -0
- data/app/views/rails_trade_admin/goods/edit.html.erb +16 -0
- data/app/views/rails_trade_admin/goods/edit.js.erb +8 -0
- data/app/views/rails_trade_admin/goods/edit_items.html.erb +43 -0
- data/app/views/rails_trade_admin/goods/edit_pic.html.erb +32 -0
- data/app/views/rails_trade_admin/goods/edit_promote.html.erb +64 -0
- data/app/views/rails_trade_admin/goods/index.html.erb +32 -0
- data/app/views/rails_trade_admin/goods/new.html.erb +14 -0
- data/app/views/rails_trade_admin/goods/new.js.erb +8 -0
- data/app/views/rails_trade_admin/goods/show.js.erb +5 -0
- data/app/views/rails_trade_admin/goods/update.js.erb +2 -0
- data/app/views/rails_trade_admin/order_payments/_index.html.erb +44 -0
- data/app/views/rails_trade_admin/order_payments/_new.html.erb +44 -0
- data/app/views/rails_trade_admin/order_payments/_payment_orders.html.erb +17 -0
- data/app/views/rails_trade_admin/order_payments/_payments.html.erb +19 -0
- data/app/views/rails_trade_admin/order_payments/create.js.erb +2 -0
- data/app/views/rails_trade_admin/order_payments/create_fail.js.erb +1 -0
- data/app/views/rails_trade_admin/order_payments/destroy.js.erb +2 -0
- data/app/views/rails_trade_admin/order_payments/index.js.erb +8 -0
- data/app/views/rails_trade_admin/order_payments/new.js.erb +8 -0
- data/app/views/rails_trade_admin/orders/_addresses.html.erb +36 -0
- data/app/views/rails_trade_admin/orders/_filter.html.erb +20 -0
- data/app/views/rails_trade_admin/orders/_form.html.erb +17 -0
- data/app/views/rails_trade_admin/orders/_invoice_addresses.html.erb +36 -0
- data/app/views/rails_trade_admin/orders/_item.html.erb +10 -0
- data/app/views/rails_trade_admin/orders/_new_items.html.erb +70 -0
- data/app/views/rails_trade_admin/orders/_search_form.html.erb +7 -0
- data/app/views/rails_trade_admin/orders/edit.html.erb +1 -0
- data/app/views/rails_trade_admin/orders/index.html.erb +61 -0
- data/app/views/rails_trade_admin/orders/new.html.erb +23 -0
- data/app/views/rails_trade_admin/orders/payments.html.erb +50 -0
- data/app/views/rails_trade_admin/orders/refresh.js.erb +7 -0
- data/app/views/rails_trade_admin/orders/show.html.erb +89 -0
- data/app/views/rails_trade_admin/payment_methods/_edit.html.erb +6 -0
- data/app/views/rails_trade_admin/payment_methods/_form.html.erb +5 -0
- data/app/views/rails_trade_admin/payment_methods/_index_layout.html.erb +15 -0
- data/app/views/rails_trade_admin/payment_methods/_new.html.erb +13 -0
- data/app/views/rails_trade_admin/payment_methods/_payment_method.html.erb +25 -0
- data/app/views/rails_trade_admin/payment_methods/_search_form.html.erb +22 -0
- data/app/views/rails_trade_admin/payment_methods/create.js.erb +2 -0
- data/app/views/rails_trade_admin/payment_methods/destroy.js.erb +1 -0
- data/app/views/rails_trade_admin/payment_methods/edit.html.erb +15 -0
- data/app/views/rails_trade_admin/payment_methods/edit.js.erb +8 -0
- data/app/views/rails_trade_admin/payment_methods/index.html.erb +23 -0
- data/app/views/rails_trade_admin/payment_methods/mine.html.erb +23 -0
- data/app/views/rails_trade_admin/payment_methods/new.html.erb +15 -0
- data/app/views/rails_trade_admin/payment_methods/new.js.erb +7 -0
- data/app/views/rails_trade_admin/payment_methods/unverified.html.erb +60 -0
- data/app/views/rails_trade_admin/payment_methods/update.js.erb +2 -0
- data/app/views/rails_trade_admin/payment_orders/_index.html.erb +31 -0
- data/app/views/rails_trade_admin/payment_orders/_new.html.erb +24 -0
- data/app/views/rails_trade_admin/payment_orders/_orders.html.erb +27 -0
- data/app/views/rails_trade_admin/payment_orders/cancel.js.erb +2 -0
- data/app/views/rails_trade_admin/payment_orders/create.js.erb +2 -0
- data/app/views/rails_trade_admin/payment_orders/create_fail.js.erb +1 -0
- data/app/views/rails_trade_admin/payment_orders/new.js.erb +6 -0
- data/app/views/rails_trade_admin/payment_orders/raise_fail.js.erb +1 -0
- data/app/views/rails_trade_admin/payment_orders/update.js.erb +2 -0
- data/app/views/rails_trade_admin/payment_orders/update_fail.js.erb +2 -0
- data/app/views/rails_trade_admin/payment_references/_form.html.erb +20 -0
- data/app/views/rails_trade_admin/payment_references/_new.html.erb +11 -0
- data/app/views/rails_trade_admin/payment_references/destroy.js.erb +1 -0
- data/app/views/rails_trade_admin/payment_references/edit.html.erb +6 -0
- data/app/views/rails_trade_admin/payment_references/index.html.erb +25 -0
- data/app/views/rails_trade_admin/payment_references/new.js.erb +8 -0
- data/app/views/rails_trade_admin/payment_references/show.html.erb +4 -0
- data/app/views/rails_trade_admin/payment_strategies/_form.html.erb +5 -0
- data/app/views/rails_trade_admin/payment_strategies/edit.html.erb +13 -0
- data/app/views/rails_trade_admin/payment_strategies/index.html.erb +37 -0
- data/app/views/rails_trade_admin/payment_strategies/new.html.erb +13 -0
- data/app/views/rails_trade_admin/payments/_form.html.erb +12 -0
- data/app/views/rails_trade_admin/payments/_item.html.erb +49 -0
- data/app/views/rails_trade_admin/payments/_search_form.html.erb +15 -0
- data/app/views/rails_trade_admin/payments/analyze.js.erb +12 -0
- data/app/views/rails_trade_admin/payments/dashboard.html.erb +4 -0
- data/app/views/rails_trade_admin/payments/edit.html.erb +15 -0
- data/app/views/rails_trade_admin/payments/index.html.erb +60 -0
- data/app/views/rails_trade_admin/payments/new.html.erb +17 -0
- data/app/views/rails_trade_admin/payments/show.html.erb +4 -0
- data/app/views/rails_trade_admin/promote_buyers/_form.html.erb +6 -0
- data/app/views/rails_trade_admin/promote_buyers/_promote_buyer.json.jbuilder +2 -0
- data/app/views/rails_trade_admin/promote_buyers/edit.html.erb +14 -0
- data/app/views/rails_trade_admin/promote_buyers/index.html.erb +42 -0
- data/app/views/rails_trade_admin/promote_buyers/index.json.jbuilder +1 -0
- data/app/views/rails_trade_admin/promote_buyers/new.html.erb +13 -0
- data/app/views/rails_trade_admin/promote_buyers/show.html.erb +0 -0
- data/app/views/rails_trade_admin/promote_buyers/show.json.jbuilder +1 -0
- data/app/views/rails_trade_admin/promote_charges/_edit.html.erb +13 -0
- data/app/views/rails_trade_admin/promote_charges/_form.html.erb +6 -0
- data/app/views/rails_trade_admin/promote_charges/_new.html.erb +13 -0
- data/app/views/rails_trade_admin/promote_charges/_search_form.html.erb +9 -0
- data/app/views/rails_trade_admin/promote_charges/edit.js.erb +8 -0
- data/app/views/rails_trade_admin/promote_charges/index.html.erb +49 -0
- data/app/views/rails_trade_admin/promote_charges/new.js.erb +8 -0
- data/app/views/rails_trade_admin/promote_goods/_form.html.erb +4 -0
- data/app/views/rails_trade_admin/promote_goods/_promote_good.json.jbuilder +2 -0
- data/app/views/rails_trade_admin/promote_goods/edit.html.erb +14 -0
- data/app/views/rails_trade_admin/promote_goods/index.html.erb +37 -0
- data/app/views/rails_trade_admin/promote_goods/index.json.jbuilder +1 -0
- data/app/views/rails_trade_admin/promote_goods/new.html.erb +13 -0
- data/app/views/rails_trade_admin/promote_goods/show.html.erb +0 -0
- data/app/views/rails_trade_admin/promote_goods/show.json.jbuilder +1 -0
- data/app/views/rails_trade_admin/promotes/_form.html.erb +9 -0
- data/app/views/rails_trade_admin/promotes/edit.html.erb +9 -0
- data/app/views/rails_trade_admin/promotes/index.html.erb +65 -0
- data/app/views/rails_trade_admin/promotes/new.html.erb +9 -0
- data/app/views/rails_trade_admin/promotes/show.html.erb +4 -0
- data/app/views/rails_trade_admin/providers/_form.html.erb +6 -0
- data/app/views/rails_trade_admin/providers/_product.html.erb +12 -0
- data/app/views/rails_trade_admin/providers/_side.html.erb +8 -0
- data/app/views/rails_trade_admin/providers/area.html.erb +1 -0
- data/app/views/rails_trade_admin/providers/channel.html.erb +46 -0
- data/app/views/rails_trade_admin/providers/edit.html.erb +16 -0
- data/app/views/rails_trade_admin/providers/index.html.erb +27 -0
- data/app/views/rails_trade_admin/providers/new.html.erb +21 -0
- data/app/views/rails_trade_admin/providers/posts.html.erb +41 -0
- data/app/views/rails_trade_admin/providers/products.html.erb +23 -0
- data/app/views/rails_trade_admin/providers/show.html.erb +60 -0
- data/app/views/rails_trade_admin/refunds/_form.html.erb +17 -0
- data/app/views/rails_trade_admin/refunds/_logs_table.html.erb +33 -0
- data/app/views/rails_trade_admin/refunds/_new.html.erb +18 -0
- data/app/views/rails_trade_admin/refunds/_search_form.html.erb +13 -0
- data/app/views/rails_trade_admin/refunds/edit.html.erb +6 -0
- data/app/views/rails_trade_admin/refunds/index.html.erb +57 -0
- data/app/views/rails_trade_admin/refunds/logs.js.erb +8 -0
- data/app/views/rails_trade_admin/refunds/new.html.erb +5 -0
- data/app/views/rails_trade_admin/refunds/new.js.erb +8 -0
- data/app/views/rails_trade_admin/refunds/show.html.erb +4 -0
- data/app/views/rails_trade_admin/serve_charges/_edit.html.erb +13 -0
- data/app/views/rails_trade_admin/serve_charges/_form.html.erb +10 -0
- data/app/views/rails_trade_admin/serve_charges/_new.html.erb +13 -0
- data/app/views/rails_trade_admin/serve_charges/_search_form.html.erb +10 -0
- data/app/views/rails_trade_admin/serve_charges/edit.js.erb +7 -0
- data/app/views/rails_trade_admin/serve_charges/index.html.erb +56 -0
- data/app/views/rails_trade_admin/serve_charges/new.js.erb +8 -0
- data/app/views/rails_trade_admin/serves/_form.html.erb +9 -0
- data/app/views/rails_trade_admin/serves/edit.html.erb +9 -0
- data/app/views/rails_trade_admin/serves/index.html.erb +80 -0
- data/app/views/rails_trade_admin/serves/new.html.erb +9 -0
- data/app/views/rails_trade_my/addresses/_edit.html.erb +31 -0
- data/app/views/rails_trade_my/addresses/_form.html.erb +23 -0
- data/app/views/rails_trade_my/addresses/_new.html.erb +11 -0
- data/app/views/rails_trade_my/addresses/create.js.erb +2 -0
- data/app/views/rails_trade_my/addresses/destroy.js.erb +1 -0
- data/app/views/rails_trade_my/addresses/edit.js.erb +39 -0
- data/app/views/rails_trade_my/addresses/index.html.erb +44 -0
- data/app/views/rails_trade_my/addresses/new.js.erb +39 -0
- data/app/views/rails_trade_my/addresses/show.html.erb +4 -0
- data/app/views/rails_trade_my/addresses/update.js.erb +2 -0
- data/app/views/rails_trade_my/base/_nav.html.erb +22 -0
- data/app/views/rails_trade_my/buyers/_form.html.erb +5 -0
- data/app/views/rails_trade_my/buyers/edit.html.erb +2 -0
- data/app/views/rails_trade_my/buyers/show.html.erb +21 -0
- data/app/views/rails_trade_my/cart_items/_additions.html.erb +22 -0
- data/app/views/rails_trade_my/cart_items/_single_price.html.erb +6 -0
- data/app/views/rails_trade_my/cart_items/_total_price.html.erb +8 -0
- data/app/views/rails_trade_my/cart_items/destroy.js.erb +1 -0
- data/app/views/rails_trade_my/cart_items/index.html.erb +69 -0
- data/app/views/rails_trade_my/cart_items/total.js.erb +11 -0
- data/app/views/rails_trade_my/cart_items/update.js.erb +8 -0
- data/app/views/rails_trade_my/my/index.html.erb +17 -0
- data/app/views/rails_trade_my/order_items/_form.html.erb +17 -0
- data/app/views/rails_trade_my/order_items/edit.html.erb +6 -0
- data/app/views/rails_trade_my/order_items/index.html.erb +25 -0
- data/app/views/rails_trade_my/order_items/new.html.erb +5 -0
- data/app/views/rails_trade_my/order_items/show.html.erb +8 -0
- data/app/views/rails_trade_my/orders/_date_form.html.erb +23 -0
- data/app/views/rails_trade_my/orders/_edit.html.erb +10 -0
- data/app/views/rails_trade_my/orders/_edit_payment_type.html.erb +13 -0
- data/app/views/rails_trade_my/orders/_form.html.erb +4 -0
- data/app/views/rails_trade_my/orders/destroy.js.erb +1 -0
- data/app/views/rails_trade_my/orders/edit.js.erb +4 -0
- data/app/views/rails_trade_my/orders/edit_payment_type.js.erb +6 -0
- data/app/views/rails_trade_my/orders/fail.html.erb +11 -0
- data/app/views/rails_trade_my/orders/index.html.erb +55 -0
- data/app/views/rails_trade_my/orders/index.json.jbuilder +9 -0
- data/app/views/rails_trade_my/orders/new.html.erb +41 -0
- data/app/views/rails_trade_my/orders/refresh.js.erb +7 -0
- data/app/views/rails_trade_my/orders/show.html.erb +103 -0
- data/app/views/rails_trade_my/orders/success.html.erb +12 -0
- data/app/views/rails_trade_my/orders/update.js.erb +3 -0
- data/app/views/rails_trade_my/orders/update_payment_type.js.erb +3 -0
- data/app/views/rails_trade_my/orders/wxpay_pay.js.erb +16 -0
- data/app/views/rails_trade_my/orders/wxpay_pay_err.js.erb +5 -0
- data/app/views/rails_trade_my/payment_methods/_edit.html.erb +13 -0
- data/app/views/rails_trade_my/payment_methods/_form.html.erb +5 -0
- data/app/views/rails_trade_my/payment_methods/_index.html.erb +25 -0
- data/app/views/rails_trade_my/payment_methods/_item.html.erb +10 -0
- data/app/views/rails_trade_my/payment_methods/_new.html.erb +13 -0
- data/app/views/rails_trade_my/payment_methods/create.js.erb +3 -0
- data/app/views/rails_trade_my/payment_methods/destroy.js.erb +1 -0
- data/app/views/rails_trade_my/payment_methods/edit.js.erb +8 -0
- data/app/views/rails_trade_my/payment_methods/index.html.erb +1 -0
- data/app/views/rails_trade_my/payment_methods/index.js.erb +1 -0
- data/app/views/rails_trade_my/payment_methods/new.js.erb +8 -0
- data/app/views/rails_trade_my/payment_methods/show.html.erb +4 -0
- data/app/views/rails_trade_my/payment_methods/update.js.erb +2 -0
- data/app/views/rails_trade_my/providers/_form.html.erb +5 -0
- data/app/views/rails_trade_my/providers/_provider.html.erb +20 -0
- data/app/views/rails_trade_my/providers/edit.html.erb +2 -0
- data/app/views/rails_trade_my/providers/index.html.erb +12 -0
- data/app/views/rails_trade_my/providers/new.html.erb +10 -0
- data/app/views/rails_trade_my/providers/show.html.erb +13 -0
- data/app/views/rails_trade_my/users/_form.html.erb +17 -0
- data/app/views/rails_trade_my/users/edit.html.erb +44 -0
- data/app/views/rails_trade_my/users/show.html.erb +18 -0
- data/config/locales/en.yml +85 -0
- data/config/locales/zh.yml +75 -0
- data/config/routes.rb +118 -0
- data/db/migrate/20150514135720_create_providers.rb +59 -0
- data/db/migrate/20170601014520_create_payments.rb +52 -0
- data/db/migrate/20170602061859_create_payment_references.rb +12 -0
- data/db/migrate/20170702234123_create_orders.rb +56 -0
- data/db/migrate/20170714080032_create_payment_strategies.rb +77 -0
- data/db/migrate/20171115063702_create_promote_buyers.rb +31 -0
- data/db/schema.rb +94 -0
- data/lib/rails_trade.rb +22 -0
- data/lib/rails_trade/config.rb +12 -0
- data/lib/rails_trade/engine.rb +30 -0
- data/lib/rails_trade/version.rb +3 -0
- data/lib/tasks/the_trade_tasks.rake +4 -0
- metadata +491 -0
@@ -0,0 +1,24 @@
|
|
1
|
+
<div class="ui fluid icon vertical menu">
|
2
|
+
<div class="header center link item" id="close_side">
|
3
|
+
<i class="content icon"></i>
|
4
|
+
</div>
|
5
|
+
<div class="ui dropdown item">
|
6
|
+
<span>商品管理</span>
|
7
|
+
<div class="menu">
|
8
|
+
<%= link_to '供应商', admin_providers_path, class: active_helper(controller: 'providers') %>
|
9
|
+
</div>
|
10
|
+
</div>
|
11
|
+
<div class="ui dropdown item">
|
12
|
+
<span>Orders Admin</span>
|
13
|
+
<div class="menu">
|
14
|
+
<%= link_to 'orders', admin_orders_path, class: active_helper(controller: 'orders') %>
|
15
|
+
<%= link_to 'Payment methods', admin_payment_methods_path, class: active_helper(controllers: 'payment_methods') %>
|
16
|
+
</div>
|
17
|
+
</div>
|
18
|
+
<div class="ui dropdown item">
|
19
|
+
<span>促销管理</span>
|
20
|
+
<div class="menu">
|
21
|
+
<%= link_to '促销管理', admin_promotes_path, class: active_helper(controller: 'promotes') %>
|
22
|
+
</div>
|
23
|
+
</div>
|
24
|
+
</div>
|
@@ -0,0 +1,23 @@
|
|
1
|
+
<div class="ui borderless menu">
|
2
|
+
<div class="ui container">
|
3
|
+
|
4
|
+
<div class="item">
|
5
|
+
<strong>管理后台</strong>
|
6
|
+
</div>
|
7
|
+
<% if the_role_user.has_role?('admin/users', 'admin') %>
|
8
|
+
<%= link_to '用户管理', admin_users_path, class: 'item' %>
|
9
|
+
<%= link_to '角色管理', admin_whos_path, class: 'item' %>
|
10
|
+
<%= link_to '化学品管理', admin_chemicals_path, class: 'item' %>
|
11
|
+
<%= link_to '队列任务', '/sidekiq', class: 'item', target: '_blank' %>
|
12
|
+
<% end %>
|
13
|
+
<% if the_role_user.has_role?('admin/payments', 'admin') %>
|
14
|
+
<%= link_to '财务管理', admin_payments_path, class: 'item' %>
|
15
|
+
<% end %>
|
16
|
+
<% if the_role_user.has_role?('the_data/data_lists', 'admin') %>
|
17
|
+
<%= link_to '报表', data_lists_path, class: 'item' %>
|
18
|
+
<% end %>
|
19
|
+
<div class="right menu">
|
20
|
+
|
21
|
+
</div>
|
22
|
+
</div>
|
23
|
+
</div>
|
@@ -0,0 +1,25 @@
|
|
1
|
+
<div class="ui inverted vertical fluid icon menu">
|
2
|
+
<div class="header center link item" id="close_side">
|
3
|
+
<i class="content icon"></i>
|
4
|
+
</div>
|
5
|
+
<div class="item ui dropdown">
|
6
|
+
<a class="title">
|
7
|
+
<i class="money icon"></i>
|
8
|
+
<span>财务</span>
|
9
|
+
</a>
|
10
|
+
<div class="menu content">
|
11
|
+
<%= link_to '订单流水', payments_admin_orders_path, class: active_helper('admin/orders': ['payments']) %>
|
12
|
+
<%= link_to '支付流水', admin_payments_path, class: active_helper(controller: 'payments', action: 'index') %>
|
13
|
+
<%= link_to '支付方式', admin_payment_methods_path, class: active_helper(controller: 'payment_methods') %>
|
14
|
+
</div>
|
15
|
+
</div>
|
16
|
+
<div class="item ui dropdown">
|
17
|
+
<a class="title">
|
18
|
+
<i class="settings icon"></i>
|
19
|
+
<span>订单</span>
|
20
|
+
</a>
|
21
|
+
<div class="menu content">
|
22
|
+
<%= link_to '手续费率', admin_charges_path, class: active_helper(controller: 'admin/charges') %>
|
23
|
+
</div>
|
24
|
+
</div>
|
25
|
+
</div>
|
@@ -0,0 +1,17 @@
|
|
1
|
+
<%= form_with(model: order, local: true) do |form| %>
|
2
|
+
<% if order.errors.any? %>
|
3
|
+
<div id="error_explanation">
|
4
|
+
<h2><%= pluralize(order.errors.count, "error") %> prohibited this order from being saved:</h2>
|
5
|
+
|
6
|
+
<ul>
|
7
|
+
<% order.errors.full_messages.each do |message| %>
|
8
|
+
<li><%= message %></li>
|
9
|
+
<% end %>
|
10
|
+
</ul>
|
11
|
+
</div>
|
12
|
+
<% end %>
|
13
|
+
|
14
|
+
<div class="actions">
|
15
|
+
<%= form.submit %>
|
16
|
+
</div>
|
17
|
+
<% end %>
|
@@ -0,0 +1,11 @@
|
|
1
|
+
<%= search_form_with scope: :q do |f| %>
|
2
|
+
<div class="fields">
|
3
|
+
<%= f.text_field :'name-like' %>
|
4
|
+
<%= f.collection_select :payment_strategy_id, PaymentStrategy.all, :id, :name, { prompt: 'Credit Terms' }, { class: 'ui dropdown' } %>
|
5
|
+
<%= f.collection_select :'crm_permits.manager_id', @managers, :id, :name, { prompt: 'AR' }, { class: 'ui dropdown' } %>
|
6
|
+
<%= f.date_field :'overdue_date-lte' %>
|
7
|
+
<%= f.submit 'Search' %>
|
8
|
+
<%= link_to 'Clear All Filters', filter_params(only: [:buyer_id]), class: 'ui white button' %>
|
9
|
+
</div>
|
10
|
+
<% end %>
|
11
|
+
|
@@ -0,0 +1,46 @@
|
|
1
|
+
<div>
|
2
|
+
|
3
|
+
<%= render 'menu' %>
|
4
|
+
|
5
|
+
<div class="ui segment bottom attached">
|
6
|
+
<%= render 'search_form' %>
|
7
|
+
</div>
|
8
|
+
|
9
|
+
<div class="ui segment top attached">
|
10
|
+
<p>
|
11
|
+
<span>State:</span>
|
12
|
+
<%= link_to 'All', filter_params(except: [:payment_status]), class: active_params(payment_status: '', active_class: 'ui basic blue button', item_class: 'ui basic white button') %>
|
13
|
+
</p>
|
14
|
+
</div>
|
15
|
+
|
16
|
+
<table class="ui bottom attached table">
|
17
|
+
<thead>
|
18
|
+
<tr>
|
19
|
+
<th>ID</th>
|
20
|
+
<th>名称</th>
|
21
|
+
<th>Credit Terms(Period)</th>
|
22
|
+
<th>负责人</th>
|
23
|
+
<th></th>
|
24
|
+
<th></th>
|
25
|
+
</tr>
|
26
|
+
</thead>
|
27
|
+
|
28
|
+
<tbody>
|
29
|
+
<% @buyers.each do |buyer| %>
|
30
|
+
<tr>
|
31
|
+
<td><%= buyer.id %></td>
|
32
|
+
<td><%= buyer.name %></td>
|
33
|
+
<td><%= buyer.payment_strategy&.name %></td>
|
34
|
+
<td><%# buyer.charger&.name %></td>
|
35
|
+
<td><%# buyer.sum_amount %></td>
|
36
|
+
<td>
|
37
|
+
<%= link_to 'Orders', orders_admin_buyer_path(buyer.id), class: 'ui mini blue button' %>
|
38
|
+
<%= link_to 'Promotes', admin_promote_buyers_path(buyer_id: buyer.id), class: 'ui mini green button' %>
|
39
|
+
</td>
|
40
|
+
</tr>
|
41
|
+
<% end %>
|
42
|
+
</tbody>
|
43
|
+
</table>
|
44
|
+
|
45
|
+
<%= paginate @buyers %>
|
46
|
+
</div>
|
@@ -0,0 +1,134 @@
|
|
1
|
+
<div>
|
2
|
+
|
3
|
+
<div class="ui top attached menu borderless">
|
4
|
+
<div class="item"><strong>Client Credit Sales Reconciliation</strong></div>
|
5
|
+
<div class="item"><%= @buyer.name %></div>
|
6
|
+
</div>
|
7
|
+
|
8
|
+
<table class="ui bottom attached table">
|
9
|
+
<thead>
|
10
|
+
<tr>
|
11
|
+
<th>UUID</th>
|
12
|
+
<th><%= Payment.human_attribute_name(:buyer_name) %></th>
|
13
|
+
<th><%= Payment.human_attribute_name(:buyer_identifier) %></th>
|
14
|
+
<th><%= Payment.human_attribute_name(:total_amount) %></th>
|
15
|
+
<th><%= Payment.human_attribute_name(:unchecked_amount) %></th>
|
16
|
+
<th><%= Payment.human_attribute_name(:notified_at) %></th>
|
17
|
+
</tr>
|
18
|
+
</thead>
|
19
|
+
|
20
|
+
<tbody>
|
21
|
+
<% @payments.each do |payment| %>
|
22
|
+
<tr>
|
23
|
+
<td><%= payment.payment_uuid %></td>
|
24
|
+
<td><%= payment.buyer_name %></td>
|
25
|
+
<td><%= payment.buyer_identifier %></td>
|
26
|
+
<td><%= payment.total_amount %></td>
|
27
|
+
<td><%= payment.unchecked_amount %></td>
|
28
|
+
<td><%= payment.notified_at.to_s %></td>
|
29
|
+
</tr>
|
30
|
+
<% end %>
|
31
|
+
</tbody>
|
32
|
+
</table>
|
33
|
+
|
34
|
+
<div class="ui segment top attached">
|
35
|
+
<p>
|
36
|
+
<%= link_to 'Send Payment Reminder', remind_admin_buyers_path, method: :put, class: 'ui green button', id: 'remind_link' %>
|
37
|
+
</p>
|
38
|
+
</div>
|
39
|
+
|
40
|
+
<table class="ui bottom attached table">
|
41
|
+
<thead>
|
42
|
+
<tr>
|
43
|
+
<th></th>
|
44
|
+
<th class="two wide"><%= Order.human_attribute_name(:uuid) %></th>
|
45
|
+
<th>AR</th>
|
46
|
+
<th><%= Order.human_attribute_name(:created_at) %></th>
|
47
|
+
<th class="four wide">Item Info</th>
|
48
|
+
<th><%= Order.human_attribute_name(:overdue_date) %></th>
|
49
|
+
<th><%= Order.human_attribute_name(:amount) %> / <%= Order.human_attribute_name(:unreceived_amount) %></th>
|
50
|
+
<th>No. of Reminder</th>
|
51
|
+
<th></th>
|
52
|
+
</tr>
|
53
|
+
</thead>
|
54
|
+
|
55
|
+
<tbody>
|
56
|
+
<% @orders.each do |order| %>
|
57
|
+
<tr>
|
58
|
+
<td>
|
59
|
+
<% unless order.cancel? || order.init_received_amount >= order.amount %>
|
60
|
+
<%= check_box_tag(:order_id, order.id) %>
|
61
|
+
<% end %>
|
62
|
+
</td>
|
63
|
+
<td>
|
64
|
+
<%= order.uuid %>
|
65
|
+
<% if order.cancel? %>
|
66
|
+
<label class="ui red label">Canceled</label>
|
67
|
+
<% end %>
|
68
|
+
</td>
|
69
|
+
<td><%# order.charger&.name %></td>
|
70
|
+
<td><%= order.created_at %></td>
|
71
|
+
<td>
|
72
|
+
<% order.order_items.each do |order_item| %>
|
73
|
+
<p><%= order_item.chemical.name.truncate(50) %></p>
|
74
|
+
<p><%= order_item.chemical.cas %></p>
|
75
|
+
<% end %>
|
76
|
+
</td>
|
77
|
+
<td class="<%= active_assert(order.overdue_date && order.overdue_date < Date.today, expected: 'error', unexpected: '') %>">
|
78
|
+
<%= order.overdue_date %>
|
79
|
+
</td>
|
80
|
+
<td><%= order.amount %> / <%= order.unreceived_amount %></td>
|
81
|
+
<td><%= order.remind_counter %></td>
|
82
|
+
<td>
|
83
|
+
<% if order.exists_payments && !order.cancel? %>
|
84
|
+
<%= link_to new_admin_order_order_payment_path(order.id), remote: true, class: 'ui icon green button' do %>
|
85
|
+
<i class="payment icon"></i>
|
86
|
+
<% end %>
|
87
|
+
<% elsif !order.cancel? %>
|
88
|
+
<%= link_to new_admin_order_order_payment_path(order.id), remote: true, class: 'ui icon grey button' do %>
|
89
|
+
<i class="payment icon"></i>
|
90
|
+
<% end %>
|
91
|
+
<% end %>
|
92
|
+
</td>
|
93
|
+
</tr>
|
94
|
+
<% end %>
|
95
|
+
</tbody>
|
96
|
+
</table>
|
97
|
+
|
98
|
+
<%= paginate @orders %>
|
99
|
+
</div>
|
100
|
+
|
101
|
+
<div class="ui modal" id="alert_modal">
|
102
|
+
<i class="close icon"></i>
|
103
|
+
<div class="header">
|
104
|
+
Alert
|
105
|
+
</div>
|
106
|
+
<div class="image content">
|
107
|
+
<div class="description">
|
108
|
+
<div class="ui header">Please choose one item at least.</div>
|
109
|
+
</div>
|
110
|
+
</div>
|
111
|
+
<div class="actions">
|
112
|
+
<div class="ui black deny button">
|
113
|
+
OK
|
114
|
+
</div>
|
115
|
+
</div>
|
116
|
+
</div>
|
117
|
+
|
118
|
+
<script>
|
119
|
+
function getCheckedIds() {
|
120
|
+
var ids = [];
|
121
|
+
$('input[name="order_id"]:checked').each(function(){
|
122
|
+
ids.push($(this).val())
|
123
|
+
});
|
124
|
+
ids = ids.join(',');
|
125
|
+
return ids
|
126
|
+
}
|
127
|
+
|
128
|
+
$('input[name="order_id"]').change(function(){
|
129
|
+
var remind_link = new URL($('#remind_link')[0].href);
|
130
|
+
//var batch_link = new URL($('#batch_reconcile')[0].attr('href'));
|
131
|
+
|
132
|
+
$('#remind_link').attr('href', remind_link.pathname + '?order_ids=' + getCheckedIds());
|
133
|
+
});
|
134
|
+
</script>
|
@@ -0,0 +1,49 @@
|
|
1
|
+
<div>
|
2
|
+
|
3
|
+
<%= render 'menu' %>
|
4
|
+
|
5
|
+
<div class="ui segment bottom attached">
|
6
|
+
<%= render 'search_form' %>
|
7
|
+
</div>
|
8
|
+
|
9
|
+
<div class="ui segment top attached">
|
10
|
+
<p>
|
11
|
+
<span>State:</span>
|
12
|
+
<%= link_to 'All', filter_params(except: [:payment_status]), class: active_params(payment_status: '', active_class: 'ui basic blue button', item_class: 'ui basic white button') %>
|
13
|
+
</p>
|
14
|
+
</div>
|
15
|
+
|
16
|
+
<table class="ui bottom attached table">
|
17
|
+
<thead>
|
18
|
+
<tr>
|
19
|
+
<th>ID</th>
|
20
|
+
<th>名称</th>
|
21
|
+
<th>Credit Terms(Period)</th>
|
22
|
+
<th>负责人</th>
|
23
|
+
<th>逾期数量</th>
|
24
|
+
<th>应收数量</th>
|
25
|
+
<th>逾期日期</th>
|
26
|
+
<th>逾期金额</th>
|
27
|
+
<th></th>
|
28
|
+
</tr>
|
29
|
+
</thead>
|
30
|
+
|
31
|
+
<tbody>
|
32
|
+
<% @buyers.each do |buyer| %>
|
33
|
+
<tr>
|
34
|
+
<td><%= buyer.id %></td>
|
35
|
+
<td><%= buyer.name %></td>
|
36
|
+
<td><%= buyer.payment_strategy&.name %></td>
|
37
|
+
<td><%# buyer.charger&.name %></td>
|
38
|
+
<td class="error"><%= Order.to_pay.default_where(buyer_id: buyer.id, 'overdue_date-lte': @overdue_date).count %></td>
|
39
|
+
<td><%= Order.to_pay.where(buyer_id: buyer.id).count %></td>
|
40
|
+
<td><%= buyer.last_overdue_date %></td>
|
41
|
+
<td><%# buyer.sum_amount %></td>
|
42
|
+
<td><%= link_to 'View', orders_admin_buyer_path(buyer.id) %></td>
|
43
|
+
</tr>
|
44
|
+
<% end %>
|
45
|
+
</tbody>
|
46
|
+
</table>
|
47
|
+
|
48
|
+
<%= paginate @buyers %>
|
49
|
+
</div>
|
@@ -0,0 +1,12 @@
|
|
1
|
+
<tr id="serve_<%= serve_charge.serve_id %>">
|
2
|
+
<td class="disabled"><%= serve_charge.item.name %></td>
|
3
|
+
<td class="disabled"><%= serve_charge.subtotal %></td>
|
4
|
+
<td>
|
5
|
+
<div class="ui slider checkbox" id="checkbox_<%= serve_charge.serve_id %>">
|
6
|
+
<%= check_box_tag :serve_charge, serve_charge.id, false, data: { url: add_admin_cart_item_cart_item_serves_path(@cart_item, serve_id: serve_charge.serve_id) } %>
|
7
|
+
<label></label>
|
8
|
+
</div>
|
9
|
+
</td>
|
10
|
+
</tr>
|
11
|
+
|
12
|
+
|
@@ -0,0 +1,37 @@
|
|
1
|
+
<div class="ui modal" id="good_serves_index">
|
2
|
+
<i class="close icon"></i>
|
3
|
+
<div class="ui header blue">
|
4
|
+
Cart Item Servers
|
5
|
+
</div>
|
6
|
+
<div class="content">
|
7
|
+
<table class="ui table">
|
8
|
+
<thead>
|
9
|
+
<tr>
|
10
|
+
<th></th>
|
11
|
+
<th>Price</th>
|
12
|
+
<th></th>
|
13
|
+
</tr>
|
14
|
+
</thead>
|
15
|
+
|
16
|
+
<tbody id="serve_tbody">
|
17
|
+
<% @cart_item.serve_charges.each do |serve_charge| %>
|
18
|
+
<%= render partial: 'rails_trade_admin/cart_item_serves/serve', locals: { serve_charge: serve_charge } %>
|
19
|
+
<% end %>
|
20
|
+
<% @cart_item.for_select_serves.each do |serve_charge| %>
|
21
|
+
<%= render partial: 'rails_trade_admin/cart_item_serves/check', locals: { serve_charge: serve_charge } %>
|
22
|
+
<% end %>
|
23
|
+
<% @cart_item.total_serve_charges.each do |serve_charge| %>
|
24
|
+
<%= render partial: 'rails_trade_admin/cart_item_serves/serve', locals: { serve_charge: serve_charge } %>
|
25
|
+
<% end %>
|
26
|
+
</tbody>
|
27
|
+
<tfoot>
|
28
|
+
<tr>
|
29
|
+
<th>合计</th>
|
30
|
+
<th id="serve_price"><%= @cart_item.serve_price %></th>
|
31
|
+
<th></th>
|
32
|
+
</tr>
|
33
|
+
</tfoot>
|
34
|
+
</table>
|
35
|
+
</div>
|
36
|
+
</div>
|
37
|
+
|
@@ -0,0 +1,14 @@
|
|
1
|
+
<tr id="serve_<%= @cart_item_serve.serve_id %>">
|
2
|
+
<td>
|
3
|
+
<%= form_with model: @cart_item_serve, url: admin_cart_item_cart_item_serves_path(@cart_item), method: :post, id: "cart_item_serve_new_#{@cart_item_serve.serve_id}" %>
|
4
|
+
<%= @cart_item_serve.serve.name %>
|
5
|
+
</td>
|
6
|
+
<td>
|
7
|
+
<%= text_field_tag 'cart_item_serve[price]', @cart_item_serve.price, class: 'three wide field', placeholder: @serve_charge.default_subtotal, form: "cart_item_serve_new_#{@cart_item_serve.serve_id}" %>
|
8
|
+
<%= hidden_field_tag 'cart_item_serve[serve_id]', @cart_item_serve.serve_id, form: "cart_item_serve_new_#{@cart_item_serve.serve_id}" %>
|
9
|
+
</td>
|
10
|
+
<td>
|
11
|
+
<%= submit_tag 'Save', class: 'ui mini green button', form: "cart_item_serve_new_#{@cart_item_serve.serve_id}" %>
|
12
|
+
<a class="ui mini grey button" onclick="removeForm()">取消</a>
|
13
|
+
</td>
|
14
|
+
</tr>
|
@@ -0,0 +1,16 @@
|
|
1
|
+
<tr id="serve_<%= serve_charge.serve_id %>">
|
2
|
+
<td><%= serve_charge.item.name %></td>
|
3
|
+
<td>
|
4
|
+
<%= link_to new_admin_cart_item_cart_item_serve_path(@cart_item, serve_id: serve_charge.serve_id), remote: true do %>
|
5
|
+
<div class="ui label" style="cursor: text"><%= serve_charge.subtotal %></div>
|
6
|
+
<% end %>
|
7
|
+
</td>
|
8
|
+
<td>
|
9
|
+
<% unless serve_charge.item.default %>
|
10
|
+
<div class="ui slider checkbox" id="checkbox_<%= serve_charge.serve_id %>">
|
11
|
+
<%= check_box_tag :serve_charge, serve_charge.id, true, data: { url: admin_cart_item_cart_item_serve_path(@cart_item, serve_charge.cart_item_serve&.id || @cart_item_serve.id) } %>
|
12
|
+
<label></label>
|
13
|
+
</div>
|
14
|
+
<% end %>
|
15
|
+
</td>
|
16
|
+
</tr>
|