From d8611c29e861ced8eab3defb787c955ade428c1c Mon Sep 17 00:00:00 2001 From: cho Date: Fri, 15 Jan 2010 10:07:32 +0000 Subject: [PATCH] =?utf8?q?=E4=BB=95=E5=85=A5=E5=85=88=E3=83=9E=E3=82=B9?= =?utf8?q?=E3=82=BF=E7=AE=A1=E7=90=86=E6=A9=9F=E8=83=BD=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit git-svn-id: svn+ssh://svn.sourceforge.jp/svnroot/elecoma/trunk@31 06daa6dd-5c14-464e-8a85-0d68c524be32 --- app/controllers/admin/product_styles_controller.rb | 5 +- app/controllers/admin/shops_controller.rb | 34 ++++ app/controllers/admin/suppliers_controller.rb | 74 +++++++++ app/controllers/application_controller.rb | 1 + app/helpers/admin/suppliers_helper.rb | 2 + app/models/product.rb | 27 +++- app/models/product_style.rb | 1 + app/models/supplier.rb | 80 ++++++++++ app/models/supplier_search_form.rb | 58 +++++++ app/views/admin/base/_depot_submenu.html.erb | 16 ++ app/views/admin/base/_shop_submenu.html.erb | 1 + app/views/admin/home/index.html.erb | 6 +- app/views/admin/product_styles/_form.html.erb | 4 + app/views/admin/product_styles/confirm.html.erb | 5 + app/views/admin/product_styles/new.html.erb | 2 + app/views/admin/products/_form.html.erb | 8 + app/views/admin/products/_search.html.erb | 8 + app/views/admin/shops/_settings_form.html.erb | 17 ++ app/views/admin/shops/settings.html.erb | 10 ++ app/views/admin/suppliers/_form.html.erb | 80 ++++++++++ app/views/admin/suppliers/_search.html.erb | 34 ++++ app/views/admin/suppliers/_submenu.html.erb | 1 + app/views/admin/suppliers/confirm.html.erb | 31 ++++ app/views/admin/suppliers/edit.html.erb | 21 +++ app/views/admin/suppliers/index.html.erb | 13 ++ app/views/admin/suppliers/new.html.erb | 19 +++ app/views/admin/suppliers/search.html.erb | 55 +++++++ app/views/layouts/admin/base.html.erb | 5 + config/locales/translation_ja.yml | 17 ++ db/migrate/20100108051429_create_suppliers.rb | 32 ++++ db/migrate/20100108060000_add_data_suppliers.rb | 11 ++ ...2020_add_column_supplier_use_flag_to_systems.rb | 9 ++ .../20100112054539_add_data_functions_ver2.rb | 19 +++ ...114122020_add_column_supplier_id_to_products.rb | 10 ++ ...142020_add_manufacturer_id_to_product_styles.rb | 9 ++ db/migrate/fixed_data/functions.yml | 5 + db/migrate/fixed_data/suppliers.yml | 12 ++ spec/controllers/admin/products_controller_spec.rb | 6 +- .../controllers/admin/suppliers_controller_spec.rb | 171 ++++++++++++++++++++ spec/fixtures/products.yml | 1 + spec/fixtures/suppliers.yml | 42 +++++ spec/helpers/admin/suppliers_helper_spec.rb | 11 ++ spec/models/category_spec.rb | 2 +- spec/models/product_spec.rb | 37 ++--- spec/models/product_style_spec.rb | 11 +- spec/models/supplier_search_form_spec.rb | 39 +++++ spec/models/supplier_spec.rb | 176 +++++++++++++++++++++ spec/product_csv_upload_for_spec.csv | 6 +- spec/product_csv_upload_image_for_spec.csv | 6 +- spec/product_sample.csv | 6 +- 50 files changed, 1216 insertions(+), 40 deletions(-) create mode 100644 app/controllers/admin/suppliers_controller.rb create mode 100644 app/helpers/admin/suppliers_helper.rb create mode 100644 app/models/supplier.rb create mode 100644 app/models/supplier_search_form.rb create mode 100644 app/views/admin/base/_depot_submenu.html.erb create mode 100644 app/views/admin/shops/_settings_form.html.erb create mode 100644 app/views/admin/shops/settings.html.erb create mode 100644 app/views/admin/suppliers/_form.html.erb create mode 100644 app/views/admin/suppliers/_search.html.erb create mode 100644 app/views/admin/suppliers/_submenu.html.erb create mode 100644 app/views/admin/suppliers/confirm.html.erb create mode 100644 app/views/admin/suppliers/edit.html.erb create mode 100644 app/views/admin/suppliers/index.html.erb create mode 100644 app/views/admin/suppliers/new.html.erb create mode 100644 app/views/admin/suppliers/search.html.erb create mode 100644 db/migrate/20100108051429_create_suppliers.rb create mode 100644 db/migrate/20100108060000_add_data_suppliers.rb create mode 100644 db/migrate/20100108122020_add_column_supplier_use_flag_to_systems.rb create mode 100644 db/migrate/20100112054539_add_data_functions_ver2.rb create mode 100644 db/migrate/20100114122020_add_column_supplier_id_to_products.rb create mode 100644 db/migrate/20100114142020_add_manufacturer_id_to_product_styles.rb create mode 100644 db/migrate/fixed_data/suppliers.yml create mode 100644 spec/controllers/admin/suppliers_controller_spec.rb create mode 100644 spec/fixtures/suppliers.yml create mode 100644 spec/helpers/admin/suppliers_helper_spec.rb create mode 100644 spec/models/supplier_search_form_spec.rb create mode 100644 spec/models/supplier_spec.rb diff --git a/app/controllers/admin/product_styles_controller.rb b/app/controllers/admin/product_styles_controller.rb index 88c6277..e6262ad 100644 --- a/app/controllers/admin/product_styles_controller.rb +++ b/app/controllers/admin/product_styles_controller.rb @@ -94,9 +94,10 @@ class Admin::ProductStylesController < Admin::BaseController if product_style[:id] product_style.update_attributes({:sell_price=>value[:sell_price], :actual_count=>value[:actual_count], - :code=>value[:code]}) + :code=>value[:code], + :manufacturer_id=>value[:manufacturer_id]}) else - [:sell_price, :actual_count, :code].each do |column| + [:sell_price, :actual_count, :code ,:manufacturer_id].each do |column| product_style[column] = value[column] end product_style[:position] = idx.to_i + 1 diff --git a/app/controllers/admin/shops_controller.rb b/app/controllers/admin/shops_controller.rb index 180c1f1..b03d1f0 100644 --- a/app/controllers/admin/shops_controller.rb +++ b/app/controllers/admin/shops_controller.rb @@ -442,6 +442,23 @@ class Admin::ShopsController < Admin::BaseController redirect_to :action => params[:return_act] end + #使用機能一覧 + def settings + + end + #使用機能設定 + def settings_update + type = params[:set_id] + case type.to_i + #set_id_id = 1の場合、仕入先使用か使用しないかの設定 + when 1 + supplier_update + else + #将来何か追加したい場合、ここで追加してください + render :action => "settings" + return + end + end private @@ -468,5 +485,22 @@ class Admin::ShopsController < Admin::BaseController @kiyakus = Kiyaku.find(:all, :order=>"position") end + #仕入先を使用するかどうか設定 + def supplier_update + @system.attributes = params[:system] + if @system.save + if @system.supplier_use_flag + #使用する->使用しない変更する時、既存の仕入先をそのまま + #supplier_use_flagの変更のみ + redirect_to :controller => "suppliers",:action => "" + else + flash.now[:notice] = "仕入先を使用しないように設定しました" + render :action => "settings" + end + else + flash.now[:error] = "設定に失敗しました" + render :action => "settings" + end + end end diff --git a/app/controllers/admin/suppliers_controller.rb b/app/controllers/admin/suppliers_controller.rb new file mode 100644 index 0000000..d8e702b --- /dev/null +++ b/app/controllers/admin/suppliers_controller.rb @@ -0,0 +1,74 @@ +class Admin::SuppliersController < Admin::BaseController + #共通 + resource_controller + before_filter :admin_permission_check_supplier + before_filter :check_supplier_use + before_filter :check_default,:only => [:edit,:confirm] + + def search + @condition = SupplierSearchForm.new(params[:condition]) + unless @condition.valid? + render :action => "index" + return + end + + sql_condition, conditions = SupplierSearchForm.get_sql_condition(@condition) + sql = SupplierSearchForm.get_sql_select + sql_condition + sqls = [sql] + conditions.each do |c| + sqls << c + end + @suppliers = Supplier.paginate_by_sql(sqls, + :page => params[:page], + :per_page => @condition.per_page ||10, + :order => "id") + end + + edit.before do + get_supplier + end + + #確認画面 + def confirm + if !params[:id].blank? + get_supplier + else + @supplier = Supplier.new(params[:supplier]) + end + #入力チェック + unless @supplier.valid? + if !params[:id].blank? + render :action => :edit + else + render :action => :new + end + return + end + end + #遷移先指定 + [create, update,destroy].each do |action| + action.wants.html do + redirect_to :action => "index" + end + end + #仕入先を使用しているかしないと判断のフィルタ + def check_supplier_use + unless @system.supplier_use_flag + redirect_to :controller=>"/admin/home" + return + end + end + #編集・削除の時、ID=1かどうかチェック + #ID=1のデータは編集不可、削除不可にさせる + def check_default + if params[:id].to_i == Supplier::DEFAULT_SUPPLIER_ID + redirect_to :controller=>"/admin/suppliers" + return + end + end + private + def get_supplier + @supplier = Supplier.find_by_id(params[:id]) + @supplier.attributes = params[:supplier] + end +end diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 4378c3b..4a1d8b6 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -20,6 +20,7 @@ class ApplicationController < ActionController::Base def load_system @system = System.find(:first) + @system.supplier_use_flag ||= false end #郵便番号から住所を取得 diff --git a/app/helpers/admin/suppliers_helper.rb b/app/helpers/admin/suppliers_helper.rb new file mode 100644 index 0000000..a94befb --- /dev/null +++ b/app/helpers/admin/suppliers_helper.rb @@ -0,0 +1,2 @@ +module Admin::SuppliersHelper +end diff --git a/app/models/product.rb b/app/models/product.rb index 9d6893c..d42070b 100644 --- a/app/models/product.rb +++ b/app/models/product.rb @@ -23,6 +23,7 @@ class Product < ActiveRecord::Base has_many :product_styles, :dependent => :destroy, :order => 'position' has_many :order_details has_one :campaign + belongs_to :supplier validates_length_of :name , :maximum => 50 validates_length_of :name , :minimum => 1 @@ -33,6 +34,7 @@ class Product < ActiveRecord::Base validates_presence_of :medium_resource validates_presence_of :description validates_presence_of :introduction + validates_presence_of :supplier validates_associated :sub_products attr_accessor :small_resource_path @@ -122,7 +124,9 @@ class Product < ActiveRecord::Base def category_name self.category && self.category.name end - + def supplier_name + self.supplier && self.supplier.name + end # 送料無料? def free_delivery? statuses.exists?(['name=?', '送料無料']) @@ -200,6 +204,9 @@ class Product < ActiveRecord::Base unless search.name.blank? search_list << ["products.name like ?", "%#{search.name}%"] end + unless search.supplier.blank? + search_list << ["products.supplier_id = ?", search.supplier.to_i] + end unless search.category.blank? search.category = search.category.to_i category = Category.find_by_id search.category @@ -272,7 +279,7 @@ class Product < ActiveRecord::Base end elsif column.to_s == "delivery_dates_label" product.delivery_dates_label - elsif ![:small_resource_path,:medium_resource_path,:large_resource_path,:category_name,:delivery_dates_label].include?(column)&& Product.columns_hash[column.to_s].type == :datetime + elsif ![:small_resource_path,:medium_resource_path,:large_resource_path,:category_name,:delivery_dates_label,:supplier_name].include?(column)&& Product.columns_hash[column.to_s].type == :datetime (product[column] + (60*60*9)).strftime("%Y-%m-%d %H:%M") if product[column] else product[column] || product.send(column) @@ -365,6 +372,7 @@ class Product < ActiveRecord::Base product.other = arr[28] product.free_comment = arr[29] setDelivery_dates(product,arr[30]) + setSupplierId(product,arr[31]) end def setPermit(product, permit) @@ -378,7 +386,18 @@ class Product < ActiveRecord::Base def setDelivery_dates(product, delivery_dates_label) product.delivery_dates = DELIVERY_DATE[delivery_dates_label] unless delivery_dates_label.blank? end - + def setSupplierId(product, s_name) + if s_name.blank? + product.supplier_id = Supplier::DEFAULT_SUPPLIER_ID + else + s = Supplier.find_by_name(s_name) + if !s.blank? + product.supplier_id = s.id + else + raise ActiveRecord::RecordNotFound + end + end + end #画像データセット def setImageId(product,arr) #画像IDと画像パスの項目を別々に設定して画像パスがあった場合は、その先にある画像を登録し、なかった場合は画像IDを登録する @@ -497,6 +516,7 @@ class Product < ActiveRecord::Base :other, :free_comment, :delivery_dates_label, + :supplier_name, :created_at, :updated_at ] @@ -535,6 +555,7 @@ class Product < ActiveRecord::Base :other => "その他仕様", :free_comment => "フリー入力", :delivery_dates_label => "配送日", + :supplier_name => "仕入先名", :created_at => "登録日", :updated_at => "更新日" } diff --git a/app/models/product_style.rb b/app/models/product_style.rb index 69349eb..877e766 100644 --- a/app/models/product_style.rb +++ b/app/models/product_style.rb @@ -20,6 +20,7 @@ class ProductStyle < ActiveRecord::Base :foreign_key => "style_id2" validates_format_of :code, :with => /^[a-zA-Z0-9]*$/ + validates_format_of :manufacturer_id, :with => /^[a-zA-Z0-9]*$/, :allow_blank=>true DEFAULT_DATA = {:actual_count => 0} alias initialize_old initialize diff --git a/app/models/supplier.rb b/app/models/supplier.rb new file mode 100644 index 0000000..5bc9a81 --- /dev/null +++ b/app/models/supplier.rb @@ -0,0 +1,80 @@ +class Supplier < ActiveRecord::Base + acts_as_paranoid + belongs_to :prefecture + has_many :products + #DEFAULT_IDは仕入先不使用時のIDとして定義 + #id=1のデータは編集不可、削除不可 + DEFAULT_SUPPLIER_ID = 1 + SHISYAGONYU, KIRISUTE, KIRIAGE = 0, 1, 2 + TAX_RULE_NAMES = { SHISYAGONYU => "四捨五入", KIRISUTE => "切り捨て", KIRIAGE => "切り上げ"} + + validates_presence_of :name + validates_uniqueness_of :name + validates_length_of :name, :maximum => 50 + + validates_presence_of :zipcode01, :zipcode02 + validates_numericality_of :zipcode01, :zipcode02, :allow_blank=>true + validates_length_of :zipcode01, :is => 3, :allow_blank=>true + validates_length_of :zipcode02, :is => 4, :allow_blank=>true + validates_associated :prefecture + validates_presence_of :prefecture_id,:address_city, :address_detail + validates_length_of :address_city, :address_detail, :maximum => 100 + + validates_presence_of :contact_name + validates_length_of :contact_name, :maximum => 50 + + validates_presence_of :tel01, :tel02, :tel03 + validates_numericality_of :tel01, :tel02, :tel03, :allow_blank => true + validates_length_of :tel01, :tel02, :tel03, :maximum => 6, :allow_blank => true + + validates_numericality_of :fax01, :fax02, :fax03, :allow_blank => true + validates_length_of :fax01, :fax02, :fax03, :maximum => 6, :allow_blank => true + + validates_format_of :email, :with => /\A([^@\s]+)@((?:[-a-z0-9]+\.)+[a-z]{2,})\Z/i, :allow_blank => true + + validates_inclusion_of :percentage, :in => (0..100), :allow_blank => true + + validates_length_of :free_comment, :maximum => 10000 , :allow_blank => true + validates_inclusion_of :tax_rule, :in => [SHISYAGONYU, KIRISUTE, KIRIAGE] , :allow_blank => true + + before_update :check_default + before_destroy :check_default_and_products + + def validate + super + # FAX どれかが入力されている時だけ検証 + if not [fax01, fax02, fax03].all?(&:blank?) + fax_items = %w(fax01 fax02 fax03) + errors.add_on_blank fax_items, "が入力されていません" + end + end + + def tel + "#{tel01}-#{tel02}-#{tel03}" unless tel01.blank? or tel02.blank? or tel03.blank? + end + + def fax + "#{fax01}-#{fax02}-#{fax03}" unless fax01.blank? or fax02.blank? or fax03.blank? + end + + def prefecture_name + prefecture && prefecture.name + end + + def tax_rule_label + TAX_RULE_NAMES[tax_rule] unless tax_rule.blank? + end + def check_default_and_products + check_default + #直接URL入力で商品を持っている仕入先を削除防止するため + unless self.products.blank? + raise ActiveRecord::ReadOnlyRecord + end + end + def check_default + #id=1のデータはデフォルトの状態のみで、編集不可、削除不可 + if self.id == DEFAULT_SUPPLIER_ID + raise ActiveRecord::ReadOnlyRecord + end + end +end diff --git a/app/models/supplier_search_form.rb b/app/models/supplier_search_form.rb new file mode 100644 index 0000000..d9ceca1 --- /dev/null +++ b/app/models/supplier_search_form.rb @@ -0,0 +1,58 @@ +# -*- coding: utf-8 -*- +# 仕入先マスタ管理で検索条件を格納するフォーム +class SupplierSearchForm < SearchForm + set_field_names :supplier_id => '仕入先ID' + set_field_names :email => 'メールアドレス' + set_field_names :tel_no => '電話番号' + set_field_names :fax_no => 'ファックス' + set_field_names :name => '仕入先名' + set_field_names :contact_name => '担当者名' + + validates_numericality_of :supplier_id, :allow_blank=>true, :message => 'は半角数字のみを入力してください。' + validates_format_of :email, :with => /[\x1-\x7f]/, :allow_blank => true, :message => 'は半角英数字のみを入力してください。' + validates_numericality_of :tel_no, :only_integer => true, :allow_blank => true, :message => 'は半角数字のみを入力してください。' + validates_numericality_of :fax_no, :only_integer => true, :allow_blank => true, :message => 'は半角数字のみを入力してください。' + + def self.get_sql_select + <<-EOS + select s.* + EOS + end + + def self.get_sql_condition(condition) + conditions = [] + sql_condition = <<-EOS +from +suppliers s +where +(s.deleted_at IS NULL OR s.deleted_at > '#{Time.now.gmtime.strftime("%Y-%m-%d %H:%M:%S")}') +#{unless condition.supplier_id.blank? + conditions << condition.supplier_id.to_i + "and s.id = ?" + end} +#{unless condition.name.blank? + conditions << "%#{condition.name}%" + "and s.name like ?" + end} +#{unless condition.contact_name.blank? + conditions << "%#{condition.contact_name}%" + "and s.contact_name like ?" + end} +#{unless condition.tel_no.blank? + conditions << "%#{condition.tel_no}%" + "and (s.tel01 || s.tel02 || s.tel03) like ? " + end} +#{unless condition.fax_no.blank? + conditions << "%#{condition.fax_no}%" + "and (s.fax01 || s.fax02 || s.fax03) like ? " + end} +#{unless condition.email.blank? + conditions << "%#{condition.email}%" + "and s.email like ? " + end} +order by s.id +EOS + return [sql_condition, conditions] + end + +end diff --git a/app/views/admin/base/_depot_submenu.html.erb b/app/views/admin/base/_depot_submenu.html.erb new file mode 100644 index 0000000..628d681 --- /dev/null +++ b/app/views/admin/base/_depot_submenu.html.erb @@ -0,0 +1,16 @@ + +
+ +
diff --git a/app/views/admin/base/_shop_submenu.html.erb b/app/views/admin/base/_shop_submenu.html.erb index fa8a183..6958306 100644 --- a/app/views/admin/base/_shop_submenu.html.erb +++ b/app/views/admin/base/_shop_submenu.html.erb @@ -37,6 +37,7 @@ diff --git a/app/views/admin/home/index.html.erb b/app/views/admin/home/index.html.erb index e78c2a6..9b32f54 100644 --- a/app/views/admin/home/index.html.erb +++ b/app/views/admin/home/index.html.erb @@ -5,7 +5,11 @@

編集したいカテゴリをクリックして下さい。

店舗管理 商品管理 - 発注・出荷管理 + <% if @system.supplier_use_flag %> + 発注・出荷管理 + <%else%> + 発注・出荷管理 + <%end%> <%= flash[:notice] %>

ショップの状況

diff --git a/app/views/admin/product_styles/_form.html.erb b/app/views/admin/product_styles/_form.html.erb index 50384ab..e41bcb1 100644 --- a/app/views/admin/product_styles/_form.html.erb +++ b/app/views/admin/product_styles/_form.html.erb @@ -13,6 +13,7 @@ 商品コード 在庫 価格(円) + 型番 <% idx = 0 %> <% @style_category1.each do | style_category1 | %> @@ -44,6 +45,9 @@ <%= text_field_tag "product_styles[#{idx}][sell_price]", product_style && product_style.sell_price %> + + <%= text_field_tag "product_styles[#{idx}][manufacturer_id]", product_style && product_style.manufacturer_id %> + <% idx += 1 %> <% end %> diff --git a/app/views/admin/product_styles/confirm.html.erb b/app/views/admin/product_styles/confirm.html.erb index fa4abcd..fd5e43e 100644 --- a/app/views/admin/product_styles/confirm.html.erb +++ b/app/views/admin/product_styles/confirm.html.erb @@ -23,6 +23,7 @@ 商品コード 在庫 価格(円) + 型番 <% idx = 0 %> <% @style_category1.each do | style_category1 | %> @@ -54,6 +55,10 @@ <%= h params["product_styles"][idx.to_s] && params["product_styles"][idx.to_s]["sell_price"] %> <%= hidden_field_tag "product_styles[#{idx.to_s}][sell_price]", params["product_styles"][idx.to_s] && params["product_styles"][idx.to_s]["sell_price"] %> + + <%= h params["product_styles"][idx.to_s] && params["product_styles"][idx.to_s]["manufacturer_id"] %> + <%= hidden_field_tag "product_styles[#{idx.to_s}][manufacturer_id]", params["product_styles"][idx.to_s] && params["product_styles"][idx.to_s]["manufacturer_id"] %> + <% idx += 1 %> <% end %> diff --git a/app/views/admin/product_styles/new.html.erb b/app/views/admin/product_styles/new.html.erb index b870e97..95caa9f 100644 --- a/app/views/admin/product_styles/new.html.erb +++ b/app/views/admin/product_styles/new.html.erb @@ -5,6 +5,8 @@
+<%= @error_messages %> + <% if @product.valid? %>

規格登録

<% if @new_flg = ( @product.product_styles.empty? || @product.product_styles.first.code.blank? ) %> diff --git a/app/views/admin/products/_form.html.erb b/app/views/admin/products/_form.html.erb index 1649dd2..6e7f10e 100644 --- a/app/views/admin/products/_form.html.erb +++ b/app/views/admin/products/_form.html.erb @@ -15,6 +15,14 @@ <%= confirm_tag :text_field, :product, :name, :class=>"data_m" %> (上限50文字) + <%if @system.supplier_use_flag%> + + 仕入先名※ + <%suppliers = Supplier.find(:all,:order=>'id')%> + <%= confirm_select(confirm_tag(:select, :product, :supplier_id, suppliers.map{|s| [s.name,s.id]}), @product.supplier.name, "product") %> + + + <% end %> カテゴリー名※ diff --git a/app/views/admin/products/_search.html.erb b/app/views/admin/products/_search.html.erb index 292a1ce..b7d79b3 100644 --- a/app/views/admin/products/_search.html.erb +++ b/app/views/admin/products/_search.html.erb @@ -18,6 +18,14 @@ 商品名 <%= f.text_field :name, :class=>"data_m" %> + <%if @system.supplier_use_flag%> + + 仕入先名 + <%suppliers = Supplier.find(:all,:order=>'id')%> + <%=f.select :supplier,suppliers.map{|s| [s.name,s.id.to_s]}, :include_blank => '全て' %> + + + <% end %> カテゴリ <%= category_select :search, :category, :include_blank => true %> diff --git a/app/views/admin/shops/_settings_form.html.erb b/app/views/admin/shops/_settings_form.html.erb new file mode 100644 index 0000000..0f0430a --- /dev/null +++ b/app/views/admin/shops/_settings_form.html.erb @@ -0,0 +1,17 @@ +<%=h flash[:notice] %> +<%=h flash[:error] %> +<%= error_messages_for :shop %> + +<% form_for :system, :url =>{:action => "settings_update"} do |f|%> + + + + + +
仕入先を使用しますか<%= f.radio_button :supplier_use_flag , false%>使用しない <%= f.radio_button :supplier_use_flag , true%>使用する
+
+ <%= hidden_field_tag "set_id","1"%> + <%= submit_tag "この内容で登録する", :onclick => "return #{confirm_javascript_function("登録しても宜しいですか")}", :class=>"btn" %> + +
+<% end %> \ No newline at end of file diff --git a/app/views/admin/shops/settings.html.erb b/app/views/admin/shops/settings.html.erb new file mode 100644 index 0000000..8a2cd45 --- /dev/null +++ b/app/views/admin/shops/settings.html.erb @@ -0,0 +1,10 @@ +<%= render :partial => "submenu" %> + +
+ +

環境設定

+

※は必須入力です

+

仕入先

+<%= render :partial => "settings_form" %> +
+ diff --git a/app/views/admin/suppliers/_form.html.erb b/app/views/admin/suppliers/_form.html.erb new file mode 100644 index 0000000..5e637eb --- /dev/null +++ b/app/views/admin/suppliers/_form.html.erb @@ -0,0 +1,80 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
仕入先ID + <%= h @supplier.id %> +
仕入先名 ※ + <%= confirm_tag :text_field, :supplier, :name, {:class=>"data_m",:style=>"ime-mode:active"} %> (上限50文字) +
郵便番号 ※ + 〒 <%= confirm_tag :text_field, :supplier, :zipcode01, {:size => 10,:style=>"ime-mode:inactive"} %>- + <%= confirm_tag :text_field, :supplier, :zipcode02, {:size => 10,:style=>"ime-mode:inactive"} %> + <% unless params[:action] =~ /confirm/ && @supplier.errors.empty? %> + + <% end %> +
ご住所 ※ + <% prefectures = Prefecture.find(:all, :order => "position").map {|p| [p.name, p.id]} %> + <%= confirm_select(confirm_tag(:select, :supplier, :prefecture_id, prefectures), @supplier.prefecture_name, "supplier") %> +

+ <%= confirm_tag :text_field, :supplier, :address_city, {:class=>"data_m",:style=>"ime-mode:active"} %> (上限100文字)
+ ※市区町村を入力(例:東京都渋谷区恵比寿西)
+
+ <%= confirm_tag :text_field, :supplier, :address_detail, {:class=>"data_m",:style=>"ime-mode:active"} %> (上限100文字)
+ ※番地、建物、マンション名などを入力(例:0-0-0)
+
担当者名 ※ + <%= confirm_tag :text_field, :supplier, :contact_name, {:class=>"data_m",:style=>"ime-mode:active"} %> (上限50文字) +
TEL ※ + <%= confirm_tag :text_field, :supplier, :tel01, {:class=>"data_s",:style=>"ime-mode:inactive"} %>- + <%= confirm_tag :text_field, :supplier, :tel02, {:class=>"data_s",:style=>"ime-mode:inactive"} %>- + <%= confirm_tag :text_field, :supplier, :tel03, {:class=>"data_s",:style=>"ime-mode:inactive"} %> +
FAX + <%= confirm_tag :text_field, :supplier, :fax01, {:class => "data_s",:style=>"ime-mode:inactive"} %>- + <%= confirm_tag :text_field, :supplier, :fax02, {:class => "data_s",:style=>"ime-mode:inactive"} %>- + <%= confirm_tag :text_field, :supplier, :fax03, {:class => "data_s",:style=>"ime-mode:inactive"} %> +
メールアドレス<%= confirm_tag :text_field, :supplier, :email, {:class=>"data_m",:style=>"ime-mode:inactive"} %>
商品掛け率 + <%= confirm_tag :text_field, :supplier, :percentage, {:class=>"data_s",:style=>"ime-mode:inactive"} %> %(100分率) +
税額端数処理<%= confirm_select(confirm_tag(:select, :supplier, :tax_rule, Supplier::TAX_RULE_NAMES.map{|a,b|[b,a]}), @supplier.tax_rule_label, "supplier") %>
備考 + <%= confirm_tag :text_area, :supplier ,:free_comment, {:size=>"60x10",:style=>"ime-mode:active"} %> +
+<%= hidden_field_tag "id", params[:id] %> diff --git a/app/views/admin/suppliers/_search.html.erb b/app/views/admin/suppliers/_search.html.erb new file mode 100644 index 0000000..871aeb7 --- /dev/null +++ b/app/views/admin/suppliers/_search.html.erb @@ -0,0 +1,34 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
仕入先ID<%= f.text_field :supplier_id,{:class=>"data_m",:style=>"ime-mode:inactive"}%>
仕入先名<%= f.text_field :name,{:class=>"data_m",:style=>"ime-mode:active"}%>
担当者名<%= f.text_field :contact_name, {:class=>"data_m",:style=>"ime-mode:active"}%>
電話番号<%= f.text_field :tel_no, {:class=>"data_m",:style=>"ime-mode:inactive"} %>
ファックス<%= f.text_field :fax_no, {:class=>"data_m",:style=>"ime-mode:inactive"} %>
メールアドレス<%= f.text_field :email, {:class=>"data_m",:style=>"ime-mode:inactive"} %>
+ 検索結果表示件数 + <%= select_tag "condition[per_page]", options_for_select((10..100).step(10).map(&:to_s)) %> + 件 + <%= submit_tag "この条件で検索する", :class=>"btn_s" %>
diff --git a/app/views/admin/suppliers/_submenu.html.erb b/app/views/admin/suppliers/_submenu.html.erb new file mode 100644 index 0000000..fa2ec27 --- /dev/null +++ b/app/views/admin/suppliers/_submenu.html.erb @@ -0,0 +1 @@ +<%= render :partial => '/admin/base/depot_submenu' %> diff --git a/app/views/admin/suppliers/confirm.html.erb b/app/views/admin/suppliers/confirm.html.erb new file mode 100644 index 0000000..1eefee3 --- /dev/null +++ b/app/views/admin/suppliers/confirm.html.erb @@ -0,0 +1,31 @@ +<%= render :partial => "submenu" %> + +
+ +

仕入先入力確認

+<%= flash[:notice] %> +<%= flash[:errors] %> +<%= error_messages_for :supplier %> + +

※は必須入力です

+ +<% form_for :supplier do |f| %> + <%= render :partial => "form", :locals => {:f => f} %> +<% end %> +
+<% form_for([:admin, @supplier],:url=>{:action => ( !params[:id].blank? ? "update" : "create" ), :id => @supplier}, :html=>{:method => ( !params[:id].blank? ? "put" : "post" )}) do%> + <% @supplier.attribute_names.each do | column | %> + <%= hidden_field "supplier", column.to_s %> + <% end %> + <%= submit_tag 'この内容で登録する', :class => "btn"%> +<% end %> + +<% form_for([:admin, @supplier],:url=>{:action => ( !params[:id].blank? ? "edit" : "new" ), :id => @supplier}, :html=>{:method => "get"}) do%> + <% @supplier.attribute_names.each do | column | %> + <%= hidden_field "supplier", column.to_s %> + <% end %> + <%= submit_tag '戻る', :class => "btn"%> +<% end %> +
+ +
diff --git a/app/views/admin/suppliers/edit.html.erb b/app/views/admin/suppliers/edit.html.erb new file mode 100644 index 0000000..7cf29a3 --- /dev/null +++ b/app/views/admin/suppliers/edit.html.erb @@ -0,0 +1,21 @@ +<%= stylesheet_link_tag "admin" %> + +<%= render :partial => "submenu" %> + +
+ +

仕入先編集

+ +<%= flash[:notice] %> +<%= flash[:error] %> +<%= error_messages_for :supplier %> + +

※は必須入力です

+<% form_for [:admin, @supplier], :url => {:action => 'confirm',:id =>@supplier} do |f| %> +<%= render :partial => "form", :locals => {:f => f} %> +
+ <%= submit_tag '確認する', :class => "btn"%> +
+<% end %> +
+ diff --git a/app/views/admin/suppliers/index.html.erb b/app/views/admin/suppliers/index.html.erb new file mode 100644 index 0000000..0325422 --- /dev/null +++ b/app/views/admin/suppliers/index.html.erb @@ -0,0 +1,13 @@ +<%= render :partial => "submenu" %> + +
+ +

仕入先マスタ管理

+<%=h flash[:notice] %> +<%=h flash[:error] %> +<%= error_messages_for :condition %> + +<% form_for :condition, :url => {:action => 'search'}, :html => {:method => :get} do |f| %> + <%= render :partial => "search", :locals=>{:f => f}%> +<% end %> +
diff --git a/app/views/admin/suppliers/new.html.erb b/app/views/admin/suppliers/new.html.erb new file mode 100644 index 0000000..1653266 --- /dev/null +++ b/app/views/admin/suppliers/new.html.erb @@ -0,0 +1,19 @@ +<%= render :partial => "submenu" %> + +
+ +

仕入先登録

+<%=h flash[:notice] %> +<%=h flash[:error] %> +<%= error_messages_for :supplier %> + +

※は必須入力です

+<% form_for :product, :url => {:action => "confirm"} do |f| %> + <%= render :partial => "form", :locals => {:f => f} %> +
+ <%= submit_tag "確認する", :class=>"btn" %> + +
+<% end %> + +
diff --git a/app/views/admin/suppliers/search.html.erb b/app/views/admin/suppliers/search.html.erb new file mode 100644 index 0000000..5d6f27c --- /dev/null +++ b/app/views/admin/suppliers/search.html.erb @@ -0,0 +1,55 @@ +<%= render :partial => "submenu" %> + +
+ +

仕入先マスタ管理

+<%=h flash[:notice] %> +<%=h flash[:error] %> +<% form_for :condition, :url => {:action => 'search'}, :html => {:method => :get} do |f| %> + <%= render :partial => "search", :locals=>{:f => f}%> +<% end %> +
+ +

>>検索結果一覧 <%=@suppliers.total_entries %>件 ãŒè©²å½“しました。


+※ID=1のデータはデフォルトデータとして編集、削除不可です。
+※商品を持っている仕入先は削除できません。
+ + + + + + + + + + + +<%unless @suppliers.blank?%> + <% @suppliers.each do | supplier | %> + + + + + + + + + + + <% end %> +<%end%> +
仕入先ID仕入先名担当者名電話番号ファックスe-mail編集削除
<%= h supplier.id %><%= h supplier.name %><%= h supplier.contact_name %><%= h supplier.tel %><%= h supplier.fax %><%= h supplier.email %> + <% if supplier.id != Supplier::DEFAULT_SUPPLIER_ID%> + <%= link_to "編集", :action=>"edit" ,:id=>supplier.id %> + <% end%> + + <% if supplier.id != Supplier::DEFAULT_SUPPLIER_ID && supplier.products.blank?%> + <%= link_to "削除", :action=>"destroy" ,:id=>supplier.id %> + <% end%> +
+<%= will_paginate @suppliers %> +
+
+ +
+
diff --git a/app/views/layouts/admin/base.html.erb b/app/views/layouts/admin/base.html.erb index 4090c6d..85d6c07 100644 --- a/app/views/layouts/admin/base.html.erb +++ b/app/views/layouts/admin/base.html.erb @@ -21,6 +21,11 @@
diff --git a/config/locales/translation_ja.yml b/config/locales/translation_ja.yml index fa1adcc..f4f1cb0 100644 --- a/config/locales/translation_ja.yml +++ b/config/locales/translation_ja.yml @@ -74,6 +74,7 @@ ja: stock_table_entry: "在庫テーブルのエントリ" style: "規格" style_category: "規格分類" + supplier: "仕入先" sub_product: "商品情報(サブ)" system: "システム" target_column: "ターゲット列" @@ -767,6 +768,22 @@ ja: updated_at: "で更新" deleted_at: "で削除" no: "番号" + supplier: + name: "仕入先名" + zipcode01: "郵便番号(前半)" + zipcode02: "郵便番号(後半)" + tel01: "電話番号1" + tel02: "電話番号2" + tel03: "電話番号3" + fax01: "FAX番号1" + fax02: "FAX番号2" + fax03: "FAX番号3" + address_city: "住所(市町村)" + address_detail: "住所(番地・ビル名)" + email: "メールアドレス" + contact_name: "担当者" + percentage: "商品かけ率" + free_comment: "備考" system: tax: "消費税率" tax_rule: "消費税規則" diff --git a/db/migrate/20100108051429_create_suppliers.rb b/db/migrate/20100108051429_create_suppliers.rb new file mode 100644 index 0000000..2dfa118 --- /dev/null +++ b/db/migrate/20100108051429_create_suppliers.rb @@ -0,0 +1,32 @@ +class CreateSuppliers < ActiveRecord::Migration + def self.up + create_table :suppliers do |t| + t.column :name, :string, :comment => '仕入先名' + t.column :zipcode01, :string, :comment => "郵便番号(前半)" + t.column :zipcode02, :string, :comment => "郵便番号(後半)" + t.column :prefecture_id, :integer, :comment => "都道府県ID" + t.column :address_city, :string, :comment => "住所(市町村)" + t.column :address_detail, :string, :comment => "住所(詳細)" + t.column :tel01, :string, :comment => "電話番号1" + t.column :tel02, :string, :comment => "電話番号2" + t.column :tel03, :string, :comment => "電話番号3" + t.column :fax01, :string, :comment => "FAX番号1" + t.column :fax02, :string, :comment => "FAX番号2" + t.column :fax03, :string, :comment => "FAX番号3" + t.column :contact_name, :string, :comment => '仕入先担当者名' + t.column :email, :string, :comment => "メールアドレス" + t.column :percentage, :integer, :comment => "商品掛け率" + t.column :tax_rule, :integer, :comment => "税額端数処理" + t.column :free_comment, :text, :comment => "備考" + t.column :deleted_at, :datetime, :comment => "削除日" + end + add_index :suppliers, :deleted_at + add_index :suppliers, :name + end + + def self.down + remove_index :suppliers, :deleted_at + remove_index :suppliers, :name + drop_table :suppliers + end +end diff --git a/db/migrate/20100108060000_add_data_suppliers.rb b/db/migrate/20100108060000_add_data_suppliers.rb new file mode 100644 index 0000000..27d127c --- /dev/null +++ b/db/migrate/20100108060000_add_data_suppliers.rb @@ -0,0 +1,11 @@ +class AddDataSuppliers < ActiveRecord::Migration + def self.up + Supplier.delete_all + directory = File.join(File.dirname(__FILE__), "fixed_data") + Fixtures.create_fixtures(directory, "suppliers") + end + + def self.down + Supplier.delete_all + end +end diff --git a/db/migrate/20100108122020_add_column_supplier_use_flag_to_systems.rb b/db/migrate/20100108122020_add_column_supplier_use_flag_to_systems.rb new file mode 100644 index 0000000..e433380 --- /dev/null +++ b/db/migrate/20100108122020_add_column_supplier_use_flag_to_systems.rb @@ -0,0 +1,9 @@ +class AddColumnSupplierUseFlagToSystems < ActiveRecord::Migration + def self.up + add_column :systems, :supplier_use_flag, :boolean,:default => false, :comment => "仕入先使用可否" + end + + def self.down + remove_columns :systems, :supplier_use_flag + end +end diff --git a/db/migrate/20100112054539_add_data_functions_ver2.rb b/db/migrate/20100112054539_add_data_functions_ver2.rb new file mode 100644 index 0000000..1a1aa98 --- /dev/null +++ b/db/migrate/20100112054539_add_data_functions_ver2.rb @@ -0,0 +1,19 @@ +class AddDataFunctionsVer2 < ActiveRecord::Migration + def self.up + Function.delete_all + Authority.delete_all + execute("delete from authorities_functions") + + + directory = File.join(File.dirname(__FILE__), "fixed_data") + Fixtures.create_fixtures(directory, "authorities") + Fixtures.create_fixtures(directory, "functions") + Fixtures.create_fixtures(directory, "authorities_functions") + end + + def self.down + Function.delete_all + execute("delete from authorities_functions") + Authority.delete_all + end +end diff --git a/db/migrate/20100114122020_add_column_supplier_id_to_products.rb b/db/migrate/20100114122020_add_column_supplier_id_to_products.rb new file mode 100644 index 0000000..04b1497 --- /dev/null +++ b/db/migrate/20100114122020_add_column_supplier_id_to_products.rb @@ -0,0 +1,10 @@ +class AddColumnSupplierIdToProducts < ActiveRecord::Migration + def self.up + add_column :products, :supplier_id, :integer,:default => 1, :comment => "仕入先ID" + Product.update_all("supplier_id = 1") + end + + def self.down + remove_columns :products, :supplier_id + end +end diff --git a/db/migrate/20100114142020_add_manufacturer_id_to_product_styles.rb b/db/migrate/20100114142020_add_manufacturer_id_to_product_styles.rb new file mode 100644 index 0000000..18a4fa3 --- /dev/null +++ b/db/migrate/20100114142020_add_manufacturer_id_to_product_styles.rb @@ -0,0 +1,9 @@ +class AddManufacturerIdToProductStyles < ActiveRecord::Migration + def self.up + add_column :product_styles, :manufacturer_id, :string, :comment => "型番" + end + + def self.down + remove_columns :product_styles, :manufacturer_id + end +end diff --git a/db/migrate/fixed_data/functions.yml b/db/migrate/fixed_data/functions.yml index 6013585..7cb1b15 100644 --- a/db/migrate/fixed_data/functions.yml +++ b/db/migrate/fixed_data/functions.yml @@ -197,3 +197,8 @@ F900: name: メンバー管理 code: "member" position: 900 +F901: + id: 41 + name: 仕入先マスタ + code: "supplier" + position: 901 \ No newline at end of file diff --git a/db/migrate/fixed_data/suppliers.yml b/db/migrate/fixed_data/suppliers.yml new file mode 100644 index 0000000..de7610b --- /dev/null +++ b/db/migrate/fixed_data/suppliers.yml @@ -0,0 +1,12 @@ +default_supplier: + id: 1 + name: 'DEFAULT' + zipcode01: '000' + zipcode02: '0000' + prefecture_id: '13' + address_city: '-' + address_detail: '-' + tel01: '000' + tel02: '0000' + tel03: '0000' + contact_name: 'DEFAULT' \ No newline at end of file diff --git a/spec/controllers/admin/products_controller_spec.rb b/spec/controllers/admin/products_controller_spec.rb index 1b7b17a..fd27ee9 100644 --- a/spec/controllers/admin/products_controller_spec.rb +++ b/spec/controllers/admin/products_controller_spec.rb @@ -2,7 +2,7 @@ require File.dirname(__FILE__) + '/../../spec_helper' describe Admin::ProductsController do fixtures :products, :admin_users, :authorities, :functions, :authorities_functions, :admin_users, :categories, :resource_datas, :image_resources - fixtures :styles, :product_styles, :style_categories + fixtures :styles, :product_styles, :style_categories,:suppliers before do session[:admin_user] = admin_users(:admin10) @@ -68,7 +68,9 @@ describe Admin::ProductsController do it "code" do get "search", :search => {:code => "AC001"} end - + it "code" do + get "search", :search => {:supplier => 2} + end it "category" do get "search", :search => {:category => @valid_product.category_id} end diff --git a/spec/controllers/admin/suppliers_controller_spec.rb b/spec/controllers/admin/suppliers_controller_spec.rb new file mode 100644 index 0000000..cd0553f --- /dev/null +++ b/spec/controllers/admin/suppliers_controller_spec.rb @@ -0,0 +1,171 @@ +require 'spec_helper' + +describe Admin::SuppliersController do + fixtures :admin_users,:suppliers,:prefectures + before do + session[:admin_user] = admin_users(:admin10) + @controller.class.skip_before_filter @controller.class.before_filter + @controller.class.skip_after_filter @controller.class.after_filter + @supplier = suppliers(:one) + end + + describe "GET 'index'" do + it "成功する" do + get 'index' + assigns[:suppliers].should_not be_nil + end + end + + describe "GET 'search'" do + before do + end + + it "should be successful" do + get 'search' + response.should be_success + end + + it "仕入先ID" do + get 'search', :condition => {:supplier_id => '2'} + response.should be_success + # 結果の中に含まれているか見る + assigns[:suppliers].size.should == 1 + assigns[:suppliers][0].attributes.should == @supplier.attributes + end + + it "仕入先名" do + get 'search', :condition => {:name => 'てすと'} + response.should be_success + # 結果の中に含まれているか見る + assigns[:suppliers].size.should == 2 + assigns[:suppliers][0].attributes.should == @supplier.attributes + assigns[:suppliers][1].attributes.should == suppliers(:two).attributes + end + + it "担当者名" do + get 'search', :condition => {:contact_name => "test"} + response.should be_success + # 結果の中に含まれているか見る + assigns[:suppliers].size.should == 1 + assigns[:suppliers][0].attributes.should == suppliers(:three).attributes + end + + it "メールアドレス" do + get 'search', :condition => {:email => "test@kbmj.com"} + response.should be_success + # 結果の中に含まれているか見る + assigns[:suppliers].size.should == 0 + end + + it "電話番号" do + get 'search', :condition => {:tel_no => "0311111111"} + response.should be_success + # 結果の中に含まれているか見る + assigns[:suppliers].size.should == 2 + assigns[:suppliers][0].attributes.should == @supplier.attributes + assigns[:suppliers][1].attributes.should == suppliers(:three).attributes + end + it "電話番号" do + get 'search', :condition => {:fax_no => "0399999999"} + response.should be_success + # 結果の中に含まれているか見る + assigns[:suppliers].size.should == 1 + assigns[:suppliers][0].attributes.should == suppliers(:three).attributes + end + end + describe "GET 'new'" do + it "成功" do + get 'new' + assigns[:supplier].should_not be_nil + assigns[:supplier].id.should be_nil + end + end + describe "POST 'confirm'" do + it "confirm" do + post 'confirm', :supplier =>@supplier.attributes.merge({:name=>"テスト(æ ª)"}) + assigns[:supplier].name.should == "テスト(æ ª)" + assigns[:supplier].contact_name.should == @supplier.contact_name + assigns[:supplier].tel01.should == @supplier.tel01 + assigns[:supplier].tel02.should == @supplier.tel02 + assigns[:supplier].tel03.should == @supplier.tel03 + assigns[:supplier].fax01.should == @supplier.fax01 + assigns[:supplier].fax02.should == @supplier.fax02 + assigns[:supplier].fax03.should == @supplier.fax03 + assigns[:supplier].zipcode01.should == @supplier.zipcode01 + assigns[:supplier].zipcode02.should == @supplier.zipcode02 + assigns[:supplier].prefecture_id.should == @supplier.prefecture_id + assigns[:supplier].address_city.should == @supplier.address_city + assigns[:supplier].address_detail.should == @supplier.address_detail + assigns[:supplier].email.should == @supplier.email + assigns[:supplier].percentage.should == @supplier.percentage + assigns[:supplier].free_comment.should == @supplier.free_comment + + response.should render_template("admin/suppliers/confirm.html.erb") + #validateエラーがある場合 + post 'confirm', :supplier => {:name => ""} + response.should render_template("admin/suppliers/new.html.erb") + end + end + describe "GET 'edit'" do + it "成功するパターン" do + get 'edit', :id => @supplier.id + assigns[:supplier].should_not be_nil + assigns[:supplier].attributes.should == @supplier.attributes + end + + it "失敗するパターン" do + lambda { get 'edit', :id => 1000 }.should raise_error(ActiveRecord::RecordNotFound) + end + end + describe "POST 'create'" do + it "正常に追加できるパターン" do + max_id = Supplier.maximum(:id) + post 'create', :supplier => @supplier.attributes.merge({:name=>"テスト(æ ª)"}) + assigns[:supplier].should_not be_nil + assigns[:supplier].id.should > max_id + flash[:notice].should == "データを保存しました" + response.should redirect_to(:action => :index) + end + + it "supplierが不正なパターン" do + max_id = Supplier.maximum(:id) + post 'create', :supplier => {:name => ""} + assigns[:supplier].should_not be_nil + assigns[:supplier].id.should be_nil + response.should_not be_redirect + response.should render_template("admin/suppliers/new.html.erb") + end + end + + describe "POST 'update'" do + it "正常に更新できるパターン" do + post 'update', :id => @supplier.id, :supplier => @supplier.attributes.merge(:name=>"(æ ª)テスト") + flash[:notice].should == "データを保存しました" + #更新後 + check = Supplier.find_by_id(@supplier.id) + check.name.should == "(æ ª)テスト" + response.should redirect_to(:action => :index) + end + + it "supplierが不正なパターン" do + post 'update', :id => @supplier.id, :supplier => {:name => ""} + check = Supplier.find_by_id(@supplier.id) + check.attributes.should == @supplier.attributes + response.should_not be_redirect + response.should render_template("admin/suppliers/edit.html.erb") + end + end + describe "POST 'destroy'" do + it "成功に削除" do + Supplier.find_by_id(3).should_not be_nil + post 'destroy', :id => 3 + Supplier.find_by_id(3).should be_nil + end + it "ID=2のデータは商品を持っているので削除不可" do + lambda { post 'destroy', :id => @supplier.id }.should raise_error(ActiveRecord::ReadOnlyRecord) + end + it "ID=1のデータが削除不可" do + lambda { post 'destroy', :id => 1 }.should raise_error(ActiveRecord::ReadOnlyRecord) + end + end +end diff --git a/spec/fixtures/products.yml b/spec/fixtures/products.yml index 528a872..8a42019 100644 --- a/spec/fixtures/products.yml +++ b/spec/fixtures/products.yml @@ -196,6 +196,7 @@ valid_product: style_id: 7 created_at: 2009-10-01 00:00:00 updated_at: 2009-10-01 00:00:00 + supplier_id: 2 #未公開商品 +CSVアップロード元データとして使用 not_permit_product: id: 17 diff --git a/spec/fixtures/suppliers.yml b/spec/fixtures/suppliers.yml new file mode 100644 index 0000000..3b6fe2e --- /dev/null +++ b/spec/fixtures/suppliers.yml @@ -0,0 +1,42 @@ +# Read about fixtures at http://ar.rubyonrails.org/classes/Fixtures.html +default: + id: 1 +one: + id: 2 + name: 'てすと(株)' + contact_name: 'てすと太郎' + zipcode01: '103' + zipcode02: '0003' + prefecture_id: 13 + address_city: '東京都テスト区テスト町' + address_detail: '2-2-2' + tel01: '03' + tel02: '1111' + tel03: '1111' +two: + id: 3 + name: 'てすと' + contact_name: 'てすとてすと' + zipcode01: '103' + zipcode02: '0003' + prefecture_id: 13 + address_city: '東京都テスト区テスト町' + address_detail: '2-2-2' + tel01: '03' + tel02: '1111' + tel03: '2222' +three: + id: 4 + name: 'test' + contact_name: 'testtest' + zipcode01: '103' + zipcode02: '0003' + prefecture_id: 13 + address_city: '東京都テスト区テスト町' + address_detail: '2-2-2' + tel01: '03' + tel02: '1111' + tel03: '1111' + fax01: '03' + fax02: '9999' + fax03: '9999' \ No newline at end of file diff --git a/spec/helpers/admin/suppliers_helper_spec.rb b/spec/helpers/admin/suppliers_helper_spec.rb new file mode 100644 index 0000000..2692a13 --- /dev/null +++ b/spec/helpers/admin/suppliers_helper_spec.rb @@ -0,0 +1,11 @@ +require 'spec_helper' + +describe Admin::SuppliersHelper do + + #Delete this example and add some real ones or delete this file + it "should be included in the object returned by #helper" do + included_modules = (class << helper; self; end).send :included_modules + included_modules.should include(Admin::SuppliersHelper) + end + +end diff --git a/spec/models/category_spec.rb b/spec/models/category_spec.rb index f0314e0..579c232 100644 --- a/spec/models/category_spec.rb +++ b/spec/models/category_spec.rb @@ -1,7 +1,7 @@ require File.dirname(__FILE__) + '/../spec_helper' describe Category do - fixtures :categories, :products, :image_resources + fixtures :categories, :products, :image_resources,:suppliers before(:each) do @category = categories(:dai_category) diff --git a/spec/models/product_spec.rb b/spec/models/product_spec.rb index b1e5166..7e7166b 100644 --- a/spec/models/product_spec.rb +++ b/spec/models/product_spec.rb @@ -1,7 +1,7 @@ require File.expand_path(File.dirname(__FILE__) + '/../spec_helper') describe Product do - fixtures :products, :image_resources, :product_statuses,:categories,:product_styles,:statuses + fixtures :products, :image_resources, :product_statuses,:categories,:product_styles,:statuses,:suppliers include ActionView::Helpers::NumberHelper @@ -109,6 +109,10 @@ describe Product do product = Product.new(:category_id =>categories(:dai_category).id) product.category_name.should == categories(:dai_category).name end + it "仕入先名" do + product = Product.new(:supplier_id =>suppliers(:one).id) + product.supplier_name.should == suppliers(:one).name + end end describe "その他" do it "送料無料判断" do @@ -184,8 +188,6 @@ describe Product do #画像IDがすべて18 #元データ - #products.ymlの最後ID:23 - #image_resoures.ymlの最後ID:70 cnt_image_b = ImageResource.count cnt_image_data_b = ResourceData.count cnt_product_b = Product.count @@ -193,31 +195,24 @@ describe Product do Product.add_by_csv(File.read("#{RAILS_ROOT}/spec/product_csv_upload_image_for_spec.csv")) #期待結果 - #商品データが2件増加 - #1件:小画像ID=18、中画像IDが新規作成(72)、大画像ID=18 - #1件:小画像IDが新規作成(71)、中画像ID=18、大画像ID=nil + #商品データが1件更新、1件増加、 + #1件:小画像ID=18、中画像IDが新規作成、大画像ID=18 + #1件:小画像IDが新規作成、中画像ID=18、大画像ID=nil #image_resourceのデータ数が2件増やす #resource_dataのデータ数が2件増やす cnt_image_a = ImageResource.count cnt_image_data_a = ResourceData.count cnt_product_a = Product.count - (cnt_product_a - cnt_product_b).should == 2 - #1件目 - max_id += 1 - product = Product.find_by_id(max_id) - product.should_not be_nil - + (cnt_product_a - cnt_product_b).should == 1 + #1件目更新 + product = Product.find_by_id(17) + product.small_resource_id.should == 18 + product.large_resource_id.should == 18 + #2件目追加 + product2 = Product.find(:last) product.medium_resource_id.should == 18 - product.large_resource_id.should be_nil - - #2件目 - max_id += 1 - product2 = Product.find_by_id(max_id) - product2.should_not be_nil - product2.small_resource_id.should_not be_nil - product2.small_resource_id.should == 18 - product2.large_resource_id.should == 18 + product2.large_resource_id.should be_nil #CSV画像アップテストは環境により結果が異なるので、ここでテストコードをコメントアウトする pending("CSV画像アップテストは環境により結果が異なるので、ここで関連テストコードをコメントアウトする") do # (cnt_image_a - cnt_image_b).should == 2 diff --git a/spec/models/product_style_spec.rb b/spec/models/product_style_spec.rb index 4a10724..037d698 100644 --- a/spec/models/product_style_spec.rb +++ b/spec/models/product_style_spec.rb @@ -38,7 +38,16 @@ describe ProductStyle do @product_style.style_category1 = nil @product_style.should_not be_valid end - + it "型番" do + #非必須 + @product_style.manufacturer_id = nil ; + @product_style.should be_valid + #フォーマット + @product_style.manufacturer_id = "aあ" ; + @product_style.should_not be_valid + @product_style.manufacturer_id = "abc123" ; + @product_style.should be_valid + end end describe "金額計算系" do it "税込販売額" do diff --git a/spec/models/supplier_search_form_spec.rb b/spec/models/supplier_search_form_spec.rb new file mode 100644 index 0000000..e1ecdc2 --- /dev/null +++ b/spec/models/supplier_search_form_spec.rb @@ -0,0 +1,39 @@ +require File.expand_path(File.dirname(__FILE__) + '/../spec_helper') + +describe SupplierSearchForm do + fixtures :suppliers + before(:each) do + @search_form = SupplierSearchForm.new + end + describe "validateチェック" do + it "データがただしい" do + @search_form.should be_valid + end + it "仕入先ID(数字)" do + @search_form.supplier_id = 123456 + @search_form.should be_valid + @search_form.supplier_id = "abc" + @search_form.should_not be_valid + end + it "メールアドレス(英数字)" do + @search_form.email = "abc" + @search_form.should be_valid + @search_form.email = "a_bc@email.com" + @search_form.should be_valid + @search_form.email = "あ" + @search_form.should_not be_valid + end + it "電話番号(数字)" do + @search_form.tel_no = "abc" + @search_form.should_not be_valid + @search_form.tel_no = 123 + @search_form.should be_valid + end + it "ファックス番号(数字)" do + @search_form.fax_no = "abc" + @search_form.should_not be_valid + @search_form.fax_no = "0311110001" + @search_form.should be_valid + end + end +end diff --git a/spec/models/supplier_spec.rb b/spec/models/supplier_spec.rb new file mode 100644 index 0000000..5f6f34e --- /dev/null +++ b/spec/models/supplier_spec.rb @@ -0,0 +1,176 @@ +require 'spec_helper' + +describe Supplier do + fixtures :suppliers + before(:each) do + @supplier = suppliers(:one) + end + + describe "validateチェック" do + it "データが正しい" do + @supplier.should be_valid + end + it "仕入先名" do + #必須 + @supplier.name = "" + @supplier.should_not be_valid + #文字数 + @supplier.name = "あ" * 50 + @supplier.should be_valid + @supplier.name = "あ" * 51 + @supplier.should_not be_valid + end + it "担当者名" do + #必須 + @supplier.contact_name = "" + @supplier.should_not be_valid + #文字数 + @supplier.contact_name = "あ" * 50 + @supplier.should be_valid + @supplier.contact_name = "あ" * 51 + @supplier.should_not be_valid + end + it "住所" do + @supplier.address_city = "" + @supplier.should_not be_valid + + @supplier.address_city = "あ" * 101 + @supplier.should_not be_valid + + @supplier.address_city = "あ" * 100 + @supplier.should be_valid + + @supplier.address_detail = "" + @supplier.should_not be_valid + + @supplier.address_detail = "a" * 101 + @supplier.should_not be_valid + + @supplier.address_detail = "a" * 100 + @supplier.should be_valid + end + it "電話番号1" do + #必須 + @supplier.tel01 = nil + @supplier.should_not be_valid + #数字 + @supplier.tel01 = "aaa" + @supplier.should_not be_valid + #桁数 + @supplier.tel01 = "1" * 7 + @supplier.should_not be_valid + @supplier.tel01 = "1" * 6 + @supplier.should be_valid + end + it "電話番号2" do + #必須 + @supplier.tel02 = nil + @supplier.should_not be_valid + #数字 + @supplier.tel02 = "aaa" + @supplier.should_not be_valid + #桁数 + @supplier.tel02 = "1" * 7 + @supplier.should_not be_valid + @supplier.tel02 = "1" * 6 + @supplier.should be_valid + end + it "電話番号3" do + #必須 + @supplier.tel03 = nil + @supplier.should_not be_valid + #数字 + @supplier.tel03 = "aaa" + @supplier.should_not be_valid + #桁数 + @supplier.tel03 = "1" * 7 + @supplier.should_not be_valid + @supplier.tel03 = "1" * 6 + @supplier.should be_valid + end + it "郵便番号(前半)" do + #必須 + @supplier.zipcode01 = nil + @supplier.should_not be_valid + #数字 + @supplier.zipcode01 = "aaa" + @supplier.should_not be_valid + #桁数 + @supplier.zipcode01 = "1034" + @supplier.should_not be_valid + @supplier.zipcode01 = "103" + @supplier.should be_valid + end + it "郵便番号(後半)" do + #必須 + @supplier.zipcode02 = nil + @supplier.should_not be_valid + #数字 + @supplier.zipcode02 = "aaa" + @supplier.should_not be_valid + #桁数 + @supplier.zipcode02 = "001" + @supplier.should_not be_valid + @supplier.zipcode02 = "0001" + @supplier.should be_valid + end + it "FAX番号" do + #数字 + @supplier.fax01 = 'abc' + @supplier.fax02 = 'defg' + @supplier.fax03 = 'hijk' + @supplier.should have(1).errors_on(:fax01) + @supplier.should have(1).errors_on(:fax02) + @supplier.should have(1).errors_on(:fax03) + #入力の場合、3か所とも + @supplier.fax01 = nil + @supplier.fax02 = '1111' + @supplier.fax03 = '2222' + @supplier.should_not be_valid + end + it "メールアドレス" do + #フォーマット + @supplier.email = "aaa" + @supplier.should_not be_valid + end + it "備考" do + #桁数 + @supplier.free_comment = "a" * 10000 + @supplier.should be_valid + @supplier.free_comment = "a" * 10001 + @supplier.should_not be_valid + end + it "商品かけ率" do + @supplier.percentage = 101 + @supplier.should_not be_valid + @supplier.percentage = "aaa" + @supplier.should_not be_valid + @supplier.percentage = -1 + @supplier.should_not be_valid + @supplier.percentage = 0 + @supplier.should be_valid + @supplier.percentage = 100 + @supplier.should be_valid + end + it "税額端数処理" do + @supplier.tax_rule = 3 + @supplier.should_not be_valid + @supplier.tax_rule = "aaa" + @supplier.should_not be_valid + @supplier.tax_rule = -1 + @supplier.should_not be_valid + @supplier.tax_rule = 0 + @supplier.should be_valid + @supplier.tax_rule = 2 + @supplier.should be_valid + end + end + describe "その他" do + fixtures :prefectures + it "都道県府名" do + supplier = Supplier.new(:prefecture_id =>11) + supplier.prefecture_name.should == prefectures(:prefecture_00011).name + end + end + +end diff --git a/spec/product_csv_upload_for_spec.csv b/spec/product_csv_upload_for_spec.csv index c79affd..2d6f3f9 100644 --- a/spec/product_csv_upload_for_spec.csv +++ b/spec/product_csv_upload_for_spec.csv @@ -1,3 +1,3 @@ -¤•iID,ŒöŠJÝ’è,–¼‘O,ŽQÆURL,ˆê——ƒRƒƒ“ƒg,Ú×ƒRƒƒ“ƒg,ƒL[ƒ[ƒh,ŽsêŽQl‰¿Ši,ˆê——EƒƒCƒ“‰æ‘œID,ˆê——EƒƒCƒ“‰æ‘œƒRƒƒ“ƒg,ˆê——EƒƒCƒ“‰æ‘œƒpƒX,Ú×EƒƒCƒ“‰æ‘œID,Ú×EƒƒCƒ“‰æ‘œƒRƒƒ“ƒg,Ú×EƒƒCƒ“‰æ‘œƒpƒX,Ú×EƒƒCƒ“Šg‘å‰æ‘œID,Ú×EƒƒCƒ“Šg‘å‰æ‘œƒRƒƒ“ƒg,Ú×EƒƒCƒ“Šg‘å‰æ‘œƒpƒX,w“ü§ŒÀ,ƒ|ƒCƒ“ƒg•t—^—¦,”Ì”„ŠJŽn“ú,”Ì”„I—¹“ú,¤•iƒJƒeƒSƒŠ,“ü‰×—\’è“ú,ƒTƒCƒY,‘fÞ,Œ´ŽY’n,d‚³,“ü‰×“ú,‚»‚Ì‘¼Žd—l,ƒtƒŠ[“ü—Í,”z‘—“ú,“o˜^“ú,XV“ú -17,”ñŒöŠJ,‰º’…,,ƒeƒXƒg01,ƒeƒXƒg01,ƒtƒ@ƒbƒVƒ‡ƒ“,5000,18,,,18,,,,,,,,,,‘åƒJƒeƒSƒŠ,2009/10/1,,,japan,,,,,3“úŒã,, -,ŒöŠJ,ƒƒ“ƒOƒR[ƒg,,ƒeƒXƒg02,ƒeƒXƒg02,ƒtƒ@ƒbƒVƒ‡ƒ“,15000,18,,,18,,,,,,,,,,‘åƒJƒeƒSƒŠ,2009/10/1,,,english,,,,,,, +¤•iID,ŒöŠJÝ’è,–¼‘O,ŽQÆURL,ˆê——ƒRƒƒ“ƒg,Ú×ƒRƒƒ“ƒg,ƒL[ƒ[ƒh,ŽsêŽQl‰¿Ši,ˆê——EƒƒCƒ“‰æ‘œID,ˆê——EƒƒCƒ“‰æ‘œƒRƒƒ“ƒg,ˆê——EƒƒCƒ“‰æ‘œƒpƒX,Ú×EƒƒCƒ“‰æ‘œID,Ú×EƒƒCƒ“‰æ‘œƒRƒƒ“ƒg,Ú×EƒƒCƒ“‰æ‘œƒpƒX,Ú×EƒƒCƒ“Šg‘å‰æ‘œID,Ú×EƒƒCƒ“Šg‘å‰æ‘œƒRƒƒ“ƒg,Ú×EƒƒCƒ“Šg‘å‰æ‘œƒpƒX,w“ü§ŒÀ,ƒ|ƒCƒ“ƒg•t—^—¦,”Ì”„ŠJŽn“ú,”Ì”„I—¹“ú,¤•iƒJƒeƒSƒŠ,“ü‰×—\’è“ú,ƒTƒCƒY,‘fÞ,Œ´ŽY’n,d‚³,“ü‰×“ú,‚»‚Ì‘¼Žd—l,ƒtƒŠ[“ü—Í,”z‘—“ú,Žd“üæ–¼,“o˜^“ú,XV“ú +17,”ñŒöŠJ,‰º’…,,ƒeƒXƒg01,ƒeƒXƒg01,ƒtƒ@ƒbƒVƒ‡ƒ“,5000,18,,,18,,,,,,,,,,‘åƒJƒeƒSƒŠ,2009/10/1,,,japan,,,,,3“úŒã,,, +,ŒöŠJ,ƒƒ“ƒOƒR[ƒg,,ƒeƒXƒg02,ƒeƒXƒg02,ƒtƒ@ƒbƒVƒ‡ƒ“,15000,18,,,18,,,,,,,,,,‘åƒJƒeƒSƒŠ,2009/10/1,,,english,,,,,,‚Ä‚·‚ƁiŠ”j,, diff --git a/spec/product_csv_upload_image_for_spec.csv b/spec/product_csv_upload_image_for_spec.csv index 855f3e3..9dda230 100644 --- a/spec/product_csv_upload_image_for_spec.csv +++ b/spec/product_csv_upload_image_for_spec.csv @@ -1,3 +1,3 @@ -¤•iID,ŒöŠJÝ’è,–¼‘O,ŽQÆURL,ˆê——ƒRƒƒ“ƒg,Ú×ƒRƒƒ“ƒg,ƒL[ƒ[ƒh,ŽsêŽQl‰¿Ši,ˆê——EƒƒCƒ“‰æ‘œID,ˆê——EƒƒCƒ“‰æ‘œƒRƒƒ“ƒg,ˆê——EƒƒCƒ“‰æ‘œƒpƒX,Ú×EƒƒCƒ“‰æ‘œID,Ú×EƒƒCƒ“‰æ‘œƒRƒƒ“ƒg,Ú×EƒƒCƒ“‰æ‘œƒpƒX,Ú×EƒƒCƒ“Šg‘å‰æ‘œID,Ú×EƒƒCƒ“Šg‘å‰æ‘œƒRƒƒ“ƒg,Ú×EƒƒCƒ“Šg‘å‰æ‘œƒpƒX,w“ü§ŒÀ,ƒ|ƒCƒ“ƒg•t—^—¦,”Ì”„ŠJŽn“ú,”Ì”„I—¹“ú,¤•iƒJƒeƒSƒŠ,“ü‰×—\’è“ú,ƒTƒCƒY,‘fÞ,Œ´ŽY’n,d‚³,“ü‰×“ú,‚»‚Ì‘¼Žd—l,ƒtƒŠ[“ü—Í,”z‘—“ú,“o˜^“ú,XV“ú -,”ñŒöŠJ,‰º’…,,ƒeƒXƒg01,ƒeƒXƒg01,ƒtƒ@ƒbƒVƒ‡ƒ“,5000,18,,,18,,sea1.PNG,18,,,,,,,‘åƒJƒeƒSƒŠ,2009/10/1,,,japan,,,,,,,,,,2012/10/30 0:00,2009/10/1 0:00,2012/10/30 0:00,2009/10/1 0:00 -,ŒöŠJ,ƒƒ“ƒOƒR[ƒg,,ƒeƒXƒg02,ƒeƒXƒg02,ƒtƒ@ƒbƒVƒ‡ƒ“,15000,18,,sea1.PNG,18,,,,,,,,,,‘åƒJƒeƒSƒŠ,2009/10/1,,,english,,,,,,,,,2012/10/30 0:00,2009/10/1 0:00,2012/10/30 0:00,2009/10/1 0:00 +¤•iID,ŒöŠJÝ’è,–¼‘O,ŽQÆURL,ˆê——ƒRƒƒ“ƒg,Ú×ƒRƒƒ“ƒg,ƒL[ƒ[ƒh,ŽsêŽQl‰¿Ši,ˆê——EƒƒCƒ“‰æ‘œID,ˆê——EƒƒCƒ“‰æ‘œƒRƒƒ“ƒg,ˆê——EƒƒCƒ“‰æ‘œƒpƒX,Ú×EƒƒCƒ“‰æ‘œID,Ú×EƒƒCƒ“‰æ‘œƒRƒƒ“ƒg,Ú×EƒƒCƒ“‰æ‘œƒpƒX,Ú×EƒƒCƒ“Šg‘å‰æ‘œID,Ú×EƒƒCƒ“Šg‘å‰æ‘œƒRƒƒ“ƒg,Ú×EƒƒCƒ“Šg‘å‰æ‘œƒpƒX,w“ü§ŒÀ,ƒ|ƒCƒ“ƒg•t—^—¦,”Ì”„ŠJŽn“ú,”Ì”„I—¹“ú,¤•iƒJƒeƒSƒŠ,“ü‰×—\’è“ú,ƒTƒCƒY,‘fÞ,Œ´ŽY’n,d‚³,“ü‰×“ú,‚»‚Ì‘¼Žd—l,ƒtƒŠ[“ü—Í,”z‘—“ú,Žd“üæ–¼,“o˜^“ú,XV“ú +17,”ñŒöŠJ,‰º’…,,ƒeƒXƒg01,ƒeƒXƒg01,ƒtƒ@ƒbƒVƒ‡ƒ“,5000,18,,,18,,sea1.PNG,18,,,,,,,‘åƒJƒeƒSƒŠ,2009/10/1,,,japan,,,,,,,, +,ŒöŠJ,ƒƒ“ƒOƒR[ƒg,,ƒeƒXƒg02,ƒeƒXƒg02,ƒtƒ@ƒbƒVƒ‡ƒ“,15000,18,,sea1.PNG,18,,,,,,,,,,‘åƒJƒeƒSƒŠ,2009/10/1,,,english,,,,,,,, diff --git a/spec/product_sample.csv b/spec/product_sample.csv index d3cd5f2..5ffb35e 100644 --- a/spec/product_sample.csv +++ b/spec/product_sample.csv @@ -1,3 +1,3 @@ -¤•iID,ŒöŠJÝ’è,–¼‘O,ŽQÆURL,ˆê——ƒRƒƒ“ƒg,Ú×ƒRƒƒ“ƒg,ƒL[ƒ[ƒh,ŽQlŽsê‰¿Ši,ˆê——EƒƒCƒ“‰æ‘œID,ˆê——EƒƒCƒ“‰æ‘œƒRƒƒ“ƒg,ˆê——EƒƒCƒ“‰æ‘œƒpƒX,Ú×EƒƒCƒ“‰æ‘œID,Ú×EƒƒCƒ“‰æ‘œƒRƒƒ“ƒg,Ú×EƒƒCƒ“‰æ‘œƒpƒX,Ú×EƒƒCƒ“Šg‘å‰æ‘œID,Ú×EƒƒCƒ“Šg‘å‰æ‘œƒRƒƒ“ƒg,Ú×EƒƒCƒ“Šg‘å‰æ‘œƒpƒX,w“ü§ŒÀ,ƒ|ƒCƒ“ƒg•t—^—¦,”Ì”„ŠJŽn“ú,”Ì”„I—¹“ú,¤•iƒJƒeƒSƒŠ,“ü‰×—\’è“ú,ƒTƒCƒY,‘fÞ,Œ´ŽY‘,d‚³,“ü‰×“ú,‚»‚Ì‘¼Žd—l,ƒtƒŠ[“ü—Í,”z‘—“ú,“o˜^“ú,XV“ú -18,ŒöŠJ,ƒXƒJ[ƒg,,ƒeƒXƒg,ƒeƒXƒg,,1000,70,,,69,,,,,,,,2009/10/1 9:00,2012/10/1 9:00,‘åƒJƒeƒSƒŠ,2009/10/1 9:00,,,,,,,,,2009/12/8 19:01,2009/12/8 19:01 -,ŒöŠJ,ƒXƒJ[ƒg,,ƒeƒXƒg,ƒeƒXƒg,,1000,70,,,69,,,,,,,,2009/10/1 9:00,2012/10/1 9:00,‘åƒJƒeƒSƒŠ,2009/10/1 9:00,,,,,,,,,2009/12/8 19:01,2009/12/8 19:01 +¤•iID,ŒöŠJÝ’è,–¼‘O,ŽQÆURL,ˆê——ƒRƒƒ“ƒg,Ú×ƒRƒƒ“ƒg,ƒL[ƒ[ƒh,ŽQlŽsê‰¿Ši,ˆê——EƒƒCƒ“‰æ‘œID,ˆê——EƒƒCƒ“‰æ‘œƒRƒƒ“ƒg,ˆê——EƒƒCƒ“‰æ‘œƒpƒX,Ú×EƒƒCƒ“‰æ‘œID,Ú×EƒƒCƒ“‰æ‘œƒRƒƒ“ƒg,Ú×EƒƒCƒ“‰æ‘œƒpƒX,Ú×EƒƒCƒ“Šg‘å‰æ‘œID,Ú×EƒƒCƒ“Šg‘å‰æ‘œƒRƒƒ“ƒg,Ú×EƒƒCƒ“Šg‘å‰æ‘œƒpƒX,w“ü§ŒÀ,ƒ|ƒCƒ“ƒg•t—^—¦,”Ì”„ŠJŽn“ú,”Ì”„I—¹“ú,¤•iƒJƒeƒSƒŠ,“ü‰×—\’è“ú,ƒTƒCƒY,‘fÞ,Œ´ŽY‘,d‚³,“ü‰×“ú,‚»‚Ì‘¼Žd—l,ƒtƒŠ[“ü—Í,”z‘—“ú,Žd“üæ–¼,“o˜^“ú,XV“ú +18,ŒöŠJ,ƒXƒJ[ƒg,,ƒeƒXƒg,ƒeƒXƒg,,1000,70,,,69,,,,,,,,2009/10/1 9:00,2012/10/1 9:00,‘åƒJƒeƒSƒŠ,2009/10/1 9:00,,,,,,,,,,2009/12/8 19:01,2009/12/8 19:01 +,ŒöŠJ,ƒXƒJ[ƒg,,ƒeƒXƒg,ƒeƒXƒg,,1000,70,,,69,,,,,,,,2009/10/1 9:00,2012/10/1 9:00,‘åƒJƒeƒSƒŠ,2009/10/1 9:00,,,,,,,,,,2009/12/8 19:01,2009/12/8 19:01 -- 2.11.0