OSDN Git Service

仕入先マスタ管理機能追加
authorcho <cho@06daa6dd-5c14-464e-8a85-0d68c524be32>
Fri, 15 Jan 2010 10:07:32 +0000 (10:07 +0000)
committercho <cho@06daa6dd-5c14-464e-8a85-0d68c524be32>
Fri, 15 Jan 2010 10:07:32 +0000 (10:07 +0000)
git-svn-id: svn+ssh://svn.sourceforge.jp/svnroot/elecoma/trunk@31 06daa6dd-5c14-464e-8a85-0d68c524be32

50 files changed:
app/controllers/admin/product_styles_controller.rb
app/controllers/admin/shops_controller.rb
app/controllers/admin/suppliers_controller.rb [new file with mode: 0644]
app/controllers/application_controller.rb
app/helpers/admin/suppliers_helper.rb [new file with mode: 0644]
app/models/product.rb
app/models/product_style.rb
app/models/supplier.rb [new file with mode: 0644]
app/models/supplier_search_form.rb [new file with mode: 0644]
app/views/admin/base/_depot_submenu.html.erb [new file with mode: 0644]
app/views/admin/base/_shop_submenu.html.erb
app/views/admin/home/index.html.erb
app/views/admin/product_styles/_form.html.erb
app/views/admin/product_styles/confirm.html.erb
app/views/admin/product_styles/new.html.erb
app/views/admin/products/_form.html.erb
app/views/admin/products/_search.html.erb
app/views/admin/shops/_settings_form.html.erb [new file with mode: 0644]
app/views/admin/shops/settings.html.erb [new file with mode: 0644]
app/views/admin/suppliers/_form.html.erb [new file with mode: 0644]
app/views/admin/suppliers/_search.html.erb [new file with mode: 0644]
app/views/admin/suppliers/_submenu.html.erb [new file with mode: 0644]
app/views/admin/suppliers/confirm.html.erb [new file with mode: 0644]
app/views/admin/suppliers/edit.html.erb [new file with mode: 0644]
app/views/admin/suppliers/index.html.erb [new file with mode: 0644]
app/views/admin/suppliers/new.html.erb [new file with mode: 0644]
app/views/admin/suppliers/search.html.erb [new file with mode: 0644]
app/views/layouts/admin/base.html.erb
config/locales/translation_ja.yml
db/migrate/20100108051429_create_suppliers.rb [new file with mode: 0644]
db/migrate/20100108060000_add_data_suppliers.rb [new file with mode: 0644]
db/migrate/20100108122020_add_column_supplier_use_flag_to_systems.rb [new file with mode: 0644]
db/migrate/20100112054539_add_data_functions_ver2.rb [new file with mode: 0644]
db/migrate/20100114122020_add_column_supplier_id_to_products.rb [new file with mode: 0644]
db/migrate/20100114142020_add_manufacturer_id_to_product_styles.rb [new file with mode: 0644]
db/migrate/fixed_data/functions.yml
db/migrate/fixed_data/suppliers.yml [new file with mode: 0644]
spec/controllers/admin/products_controller_spec.rb
spec/controllers/admin/suppliers_controller_spec.rb [new file with mode: 0644]
spec/fixtures/products.yml
spec/fixtures/suppliers.yml [new file with mode: 0644]
spec/helpers/admin/suppliers_helper_spec.rb [new file with mode: 0644]
spec/models/category_spec.rb
spec/models/product_spec.rb
spec/models/product_style_spec.rb
spec/models/supplier_search_form_spec.rb [new file with mode: 0644]
spec/models/supplier_spec.rb [new file with mode: 0644]
spec/product_csv_upload_for_spec.csv
spec/product_csv_upload_image_for_spec.csv
spec/product_sample.csv

index 88c6277..e6262ad 100644 (file)
@@ -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
index 180c1f1..b03d1f0 100644 (file)
@@ -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 (file)
index 0000000..d8e702b
--- /dev/null
@@ -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
index 4378c3b..4a1d8b6 100644 (file)
@@ -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 (file)
index 0000000..a94befb
--- /dev/null
@@ -0,0 +1,2 @@
+module Admin::SuppliersHelper
+end
index 9d6893c..d42070b 100644 (file)
@@ -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 => "更新日"
     }
index 69349eb..877e766 100644 (file)
@@ -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 (file)
index 0000000..5bc9a81
--- /dev/null
@@ -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 (file)
index 0000000..d9ceca1
--- /dev/null
@@ -0,0 +1,58 @@
+# -*- coding: utf-8 -*-\r
+# 仕入先マスタ管理で検索条件を格納するフォーム\r
+class SupplierSearchForm < SearchForm\r
+  set_field_names :supplier_id => '仕入先ID'\r
+  set_field_names :email => 'メールアドレス'\r
+  set_field_names :tel_no => '電話番号'\r
+  set_field_names :fax_no => 'ファックス'\r
+  set_field_names :name => '仕入先名'\r
+  set_field_names :contact_name => '担当者名'\r
+\r
+  validates_numericality_of :supplier_id, :allow_blank=>true, :message => 'は半角数字のみを入力してください。'\r
+  validates_format_of :email, :with => /[\x1-\x7f]/, :allow_blank => true, :message => 'は半角英数字のみを入力してください。'\r
+  validates_numericality_of :tel_no, :only_integer => true, :allow_blank => true, :message => 'は半角数字のみを入力してください。'\r
+  validates_numericality_of :fax_no, :only_integer => true, :allow_blank => true, :message => 'は半角数字のみを入力してください。'\r
+\r
+  def self.get_sql_select\r
+  <<-EOS\r
+  select s.*\r
+  EOS\r
+  end\r
+\r
+  def self.get_sql_condition(condition)\r
+    conditions = []\r
+    sql_condition = <<-EOS\r
+from\r
+suppliers s\r
+where\r
+(s.deleted_at IS NULL OR s.deleted_at > '#{Time.now.gmtime.strftime("%Y-%m-%d %H:%M:%S")}')\r
+#{unless condition.supplier_id.blank?\r
+    conditions << condition.supplier_id.to_i\r
+    "and s.id = ?"\r
+  end}\r
+#{unless condition.name.blank?\r
+    conditions << "%#{condition.name}%"\r
+    "and s.name like ?"\r
+  end}\r
+#{unless condition.contact_name.blank?\r
+    conditions << "%#{condition.contact_name}%"\r
+    "and s.contact_name like ?"\r
+  end}\r
+#{unless condition.tel_no.blank?\r
+    conditions << "%#{condition.tel_no}%"\r
+    "and (s.tel01 || s.tel02 || s.tel03) like ? "\r
+  end}\r
+#{unless condition.fax_no.blank?\r
+    conditions << "%#{condition.fax_no}%"\r
+    "and (s.fax01 || s.fax02 || s.fax03) like ? "\r
+  end}  \r
+#{unless condition.email.blank?\r
+    conditions << "%#{condition.email}%"\r
+    "and s.email like ? "\r
+  end}\r
+order by s.id\r
+EOS\r
+  return [sql_condition, conditions] \r
+  end\r
+\r
+end\r
diff --git a/app/views/admin/base/_depot_submenu.html.erb b/app/views/admin/base/_depot_submenu.html.erb
new file mode 100644 (file)
index 0000000..628d681
--- /dev/null
@@ -0,0 +1,16 @@
+<script>\r
+       window.onload = function init() {\r
+               document.getElementById("depot").style.display = 'none';\r
+       }\r
+</script>\r
+<div id="sub"><!-- サブメニュー -->\r
+  <div id="menu" class="clearfix"><!-- g_menu -->\r
+    <% if @system.supplier_use_flag %>\r
+       <p><a href="JavaScript:onClick=Tree('display1');ImgC('img1');"><img src="/images/menu_icon.gif" width="36" height="36" alt="" id="img1" /><span>仕入先管理</span></a></p>\r
+    <ul id="display1" style="display:block">\r
+      <li><%= link_to '仕入先マスタ管理', {:controller => 'suppliers', :action => 'index'} %></li>\r
+      <li><%= link_to '仕入先登録', {:controller => 'suppliers', :action => 'new'} %></li>\r
+    </ul>\r
+       <%end%>\r
+  </div><!-- /g_menu -->\r
+</div><!-- /サブメニュー -->\r
index fa8a183..6958306 100644 (file)
@@ -37,6 +37,7 @@
     <ul id="display4" style="display:block">
       <li><%= link_to 'メンバー管理', {:controller => 'admin_users', :action => 'index'} %></li>
       <li><%= link_to '管理者権限管理', {:controller => 'authorities', :action => 'index'} %></li>
+      <li><%= link_to '環境設定', {:controller => 'shops', :action => 'settings'} %></li>
     </ul>
   </div><!-- /g_menu -->
 </div><!-- /sサブメニュー -->
index e78c2a6..9b32f54 100644 (file)
@@ -5,7 +5,11 @@
     <p id="category_info">編集したいカテゴリをクリックして下さい。</p>
     <a href="/admin/shops"><img src="/images/store_btn_l.gif" width="222" height="138" alt="店舗管理" /></a>
     <a href="/admin/products"><img src="/images/goods_btn_l.gif" width="222" height="138" alt="商品管理" id="category_img" /></a>
-    <a href="#"><img src="/images/order_btn_l.gif" width="222" height="138" alt="発注・出荷管理" /></a>
+    <% if @system.supplier_use_flag %>
+       <a href="/admin/suppliers"><img src="/images/order_btn_l.gif" width="222" height="138" alt="発注・出荷管理" /></a>
+       <%else%>
+       <a href="#"><img src="/images/order_btn_l.gif" width="222" height="138" alt="発注・出荷管理" /></a>
+       <%end%>
   </div><!-- /カテゴリ選択 -->
   <%= flash[:notice] %>
   <h2>ショップの状況</h2>
index 50384ab..e41bcb1 100644 (file)
@@ -13,6 +13,7 @@
       <th>商品コード</th>
       <th>在庫</th>
       <th>価格(円)</th>
+         <th>型番</th>
     </tr>
     <% idx = 0 %>
     <% @style_category1.each do | style_category1 | %>
@@ -44,6 +45,9 @@
           <td>
             <%= text_field_tag "product_styles[#{idx}][sell_price]", product_style && product_style.sell_price %>
           </td>
+          <td>
+            <%= text_field_tag "product_styles[#{idx}][manufacturer_id]", product_style && product_style.manufacturer_id %>
+          </td>
         </tr>
         <% idx += 1 %>
       <% end %>
index fa4abcd..fd5e43e 100644 (file)
@@ -23,6 +23,7 @@
         <th>商品コード</th>
         <th>在庫</th>
         <th>価格(円)</th>
+        <th>型番</th>
       </tr>
       <% idx = 0 %>
       <% @style_category1.each do | style_category1 | %>
               <%= 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"] %>
             </td>
+            <td>
+              <%= 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"] %>
+            </td>                      
           </tr>
           <% idx += 1 %>
         <% end %>
index b870e97..95caa9f 100644 (file)
@@ -5,6 +5,8 @@
 
 <div id="main"><!-- メイン -->
 
+<%= @error_messages %>
+
 <% if @product.valid? %>
   <h2>規格登録</h2>
   <% if @new_flg = ( @product.product_styles.empty? || @product.product_styles.first.code.blank? ) %>
index 1649dd2..6e7f10e 100644 (file)
       <%= confirm_tag :text_field, :product, :name, :class=>"data_m" %> (上限50文字)
     </td>
   </tr>
+ <%if @system.supplier_use_flag%>
+  <tr>
+    <th>仕入先名<span class="pnt">※</span></th>
+    <td><%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") %>
+    </td>
+  </tr>  
+ <% end %>
   <tr>
     <th>カテゴリー名<span class="pnt">※</span></th>
     <td>
index 292a1ce..b7d79b3 100644 (file)
         <th>商品名</th>
         <td><%= f.text_field :name, :class=>"data_m" %></td>
       </tr>
+        <%if @system.supplier_use_flag%>
+         <tr>
+           <th>仕入先名</th>
+           <td><%suppliers = Supplier.find(:all,:order=>'id')%>
+                 <%=f.select :supplier,suppliers.map{|s| [s.name,s.id.to_s]}, :include_blank => '全て' %>
+           </td>
+         </tr>  
+        <% end %>        
       <tr>
         <th>カテゴリ</th>
         <td><%= category_select :search, :category, :include_blank => true %></td>
diff --git a/app/views/admin/shops/_settings_form.html.erb b/app/views/admin/shops/_settings_form.html.erb
new file mode 100644 (file)
index 0000000..0f0430a
--- /dev/null
@@ -0,0 +1,17 @@
+<%=h flash[:notice] %>
+<%=h flash[:error] %>
+<%= error_messages_for :shop %>
+<!--仕入先-->
+<% form_for :system, :url =>{:action => "settings_update"} do |f|%>
+<table cellspacing="1" cellpadding="0" class="data" >
+  <tr>
+    <th>仕入先を使用しますか</th>
+    <td><%= f.radio_button :supplier_use_flag , false%>使用しない <%= f.radio_button :supplier_use_flag , true%>使用する</td>
+  </tr>
+</table>
+<div class="btn_box">
+  <%= hidden_field_tag "set_id","1"%>  
+  <%= submit_tag "この内容で登録する", :onclick => "return #{confirm_javascript_function("登録しても宜しいですか")}", :class=>"btn" %>
+  <img class="btn_side" width="6" height="34" src="/images/btn_side.gif">
+</div>
+<% 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 (file)
index 0000000..8a2cd45
--- /dev/null
@@ -0,0 +1,10 @@
+<%= render :partial => "submenu" %>
+
+<div id="main"><!-- メイン -->
+
+<h2>環境設定</h2>
+<p class="req"><span class="pnt">※</span>は必須入力です</p>
+<h3>仕入先</h3>
+<%= render :partial => "settings_form" %>
+</div><!-- /メイン -->
+
diff --git a/app/views/admin/suppliers/_form.html.erb b/app/views/admin/suppliers/_form.html.erb
new file mode 100644 (file)
index 0000000..5e637eb
--- /dev/null
@@ -0,0 +1,80 @@
+<table class="data" cellspacing="1">
+  <tr>
+    <th>仕入先ID</th>
+    <td>
+      <%= h @supplier.id %>
+    </td>
+  </tr>  
+  <tr>
+    <th>仕入先名 <span class="pnt">※</span></th>
+    <td>
+      <%= confirm_tag :text_field, :supplier, :name, {:class=>"data_m",:style=>"ime-mode:active"} %> (上限50文字)
+    </td>
+  </tr> 
+  <tr>
+    <th>郵便番号 <span class="pnt">※</span></th>
+    <td>
+      〒 <%= 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? %>
+        <input name="zipcode_input" value="住所入力" onclick="address_by_zip('supplier_zipcode01','supplier_zipcode02', 'supplier_prefecture_name', 'supplier_address_city', 'supplier_address_detail', 'supplier_prefecture_id', 'admin/suppliers');" type="button" class="btn_s">
+      <% end %>
+    </td>
+  </tr>
+  <tr>
+    <th>ご住所 <span class="pnt">※</span></th>
+    <td>
+      <% 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") %>
+      <br/><br/>
+      <%= confirm_tag :text_field, :supplier, :address_city, {:class=>"data_m",:style=>"ime-mode:active"} %><span> (上限100文字)</span><br/>
+             ※市区町村を入力(例:東京都渋谷区恵比寿西)<br />
+      <br/>
+      <%= confirm_tag :text_field, :supplier, :address_detail, {:class=>"data_m",:style=>"ime-mode:active"} %><span> (上限100文字)</span><br/>
+             ※番地、建物、マンション名などを入力(例:0-0-0)<br/>
+    </td>
+  </tr>
+  <tr>
+    <th>担当者名 <span class="pnt">※</span></th>
+    <td>
+      <%= confirm_tag :text_field, :supplier, :contact_name, {:class=>"data_m",:style=>"ime-mode:active"} %> (上限50文字)
+    </td>
+  </tr>
+  <tr>
+    <th>TEL <span class="pnt">※</span></th>
+    <td>
+      <%= 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"} %>
+    </td>
+  </tr>
+  <tr>
+    <th>FAX</th>
+    <td>
+      <%= 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"} %>
+    </td>
+  </tr>
+  <tr>
+    <th>メールアドレス</th>
+    <td><%= confirm_tag :text_field, :supplier, :email, {:class=>"data_m",:style=>"ime-mode:inactive"} %></td>
+  </tr>
+  <tr>
+    <th>商品掛け率</th>
+    <td>
+      <%= confirm_tag :text_field, :supplier, :percentage, {:class=>"data_s",:style=>"ime-mode:inactive"} %> %(100分率)
+    </td>
+  </tr>
+  <tr>
+   <th>税額端数処理</th>
+   <td><%= confirm_select(confirm_tag(:select, :supplier, :tax_rule, Supplier::TAX_RULE_NAMES.map{|a,b|[b,a]}), @supplier.tax_rule_label, "supplier") %></td>
+  </tr>  
+  <tr>
+    <th>備考</th>
+    <td>
+      <%= confirm_tag :text_area, :supplier ,:free_comment, {:size=>"60x10",:style=>"ime-mode:active"} %>
+    </td>
+  </tr>  
+</table>
+<%= 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 (file)
index 0000000..871aeb7
--- /dev/null
@@ -0,0 +1,34 @@
+
+    <table class="data" cellspacing="1">
+      <tr>
+        <th>仕入先ID</th>
+        <td><%= f.text_field :supplier_id,{:class=>"data_m",:style=>"ime-mode:inactive"}%></td>
+      </tr>      
+         <tr>
+        <th>仕入先名</th>
+        <td><%= f.text_field :name,{:class=>"data_m",:style=>"ime-mode:active"}%></td>
+      </tr>
+      <tr>
+        <th>担当者名</th>
+        <td><%= f.text_field :contact_name, {:class=>"data_m",:style=>"ime-mode:active"}%></td>
+      </tr>
+      <tr>
+        <th>電話番号</th>
+        <td><%= f.text_field :tel_no, {:class=>"data_m",:style=>"ime-mode:inactive"} %></td>
+      </tr>
+      <tr>
+        <th>ファックス</th>
+        <td><%= f.text_field :fax_no, {:class=>"data_m",:style=>"ime-mode:inactive"} %></td>
+      </tr>
+      <tr>
+        <th>メールアドレス</th>
+        <td><%= f.text_field :email, {:class=>"data_m",:style=>"ime-mode:inactive"} %></td>
+      </tr>
+      <tr>
+       <td class="submit" colspan="4">
+      検索結果表示件数
+        <%= select_tag "condition[per_page]", options_for_select((10..100).step(10).map(&:to_s)) %>
+        件
+        <%= submit_tag "この条件で検索する", :class=>"btn_s" %></td>
+      </tr>
+    </table>
diff --git a/app/views/admin/suppliers/_submenu.html.erb b/app/views/admin/suppliers/_submenu.html.erb
new file mode 100644 (file)
index 0000000..fa2ec27
--- /dev/null
@@ -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 (file)
index 0000000..1eefee3
--- /dev/null
@@ -0,0 +1,31 @@
+<%= render :partial => "submenu" %>
+
+<div id="main"><!-- メイン -->
+
+<h2>仕入先入力確認</h2>
+<%= flash[:notice] %>
+<%= flash[:errors] %>
+<%= error_messages_for :supplier %>
+
+<p class="req"><span class="pnt">※</span>は必須入力です</p>
+
+<% form_for :supplier do |f| %>
+  <%= render :partial => "form", :locals => {:f => f} %>
+<% end %>
+<div class="btn_box">
+<% 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"%><img width="6" height="34" class="btn_side" alt="" src="/images/btn_side.gif"/>
+<% 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"%><img width="6" height="34" class="btn_side" alt="" src="/images/btn_side.gif"/>
+<% end %>
+</div>
+
+</div><!-- /メイン -->
diff --git a/app/views/admin/suppliers/edit.html.erb b/app/views/admin/suppliers/edit.html.erb
new file mode 100644 (file)
index 0000000..7cf29a3
--- /dev/null
@@ -0,0 +1,21 @@
+<%= stylesheet_link_tag "admin" %>
+
+<%= render :partial => "submenu" %>
+
+<div id="main"><!-- メイン -->
+
+<h2>仕入先編集</h2>
+
+<%= flash[:notice] %>
+<%= flash[:error] %>
+<%= error_messages_for :supplier %>
+
+<p class="req"><span class="pnt">※</span>は必須入力です</p>
+<% form_for [:admin, @supplier], :url => {:action => 'confirm',:id =>@supplier} do |f| %>
+<%= render :partial => "form", :locals => {:f => f} %>
+<div class="btn_box">
+  <%= submit_tag '確認する', :class => "btn"%><img width="6" height="34" class="btn_side" alt="" src="/images/btn_side.gif"/>
+</div>
+<% end %>
+</div><!-- /メイン -->
+
diff --git a/app/views/admin/suppliers/index.html.erb b/app/views/admin/suppliers/index.html.erb
new file mode 100644 (file)
index 0000000..0325422
--- /dev/null
@@ -0,0 +1,13 @@
+<%= render :partial => "submenu" %>
+
+<div id="main"><!-- メイン -->
+
+<h2>仕入先マスタ管理</h2>
+<%=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 %>
+</div><!-- /メイン -->
diff --git a/app/views/admin/suppliers/new.html.erb b/app/views/admin/suppliers/new.html.erb
new file mode 100644 (file)
index 0000000..1653266
--- /dev/null
@@ -0,0 +1,19 @@
+<%= render :partial => "submenu" %>\r
+\r
+<div id="main"><!-- メイン -->\r
+\r
+<h2>仕入先登録</h2>\r
+<%=h flash[:notice] %>\r
+<%=h flash[:error] %>\r
+<%= error_messages_for :supplier %>\r
+\r
+<p class="req"><span class="pnt">※</span>は必須入力です</p>\r
+<% form_for :product, :url => {:action => "confirm"} do |f| %>\r
+  <%= render :partial => "form", :locals => {:f => f} %>\r
+  <div class="btn_box">\r
+    <%= submit_tag "確認する", :class=>"btn" %>\r
+    <img class="btn_side" width="6" height="34" src="/images/btn_side.gif">\r
+  </div>\r
+<% end %>\r
+\r
+</div><!-- /メイン -->\r
diff --git a/app/views/admin/suppliers/search.html.erb b/app/views/admin/suppliers/search.html.erb
new file mode 100644 (file)
index 0000000..5d6f27c
--- /dev/null
@@ -0,0 +1,55 @@
+<%= render :partial => "submenu" %>\r
+\r
+<div id="main"><!-- メイン -->\r
+\r
+<h2>仕入先マスタ管理</h2>\r
+<%=h flash[:notice] %>\r
+<%=h flash[:error] %>\r
+<% form_for :condition, :url => {:action => 'search'}, :html => {:method => :get} do |f| %>\r
+  <%= render :partial => "search", :locals=>{:f => f}%>\r
+<% end %>\r
+<br />\r
+\r
+<p>&gt;&gt;検索結果一覧&nbsp;<%=@suppliers.total_entries %>件&nbsp;が該当しました。</p><br/>\r
+<span class="pnt">※ID=1のデータはデフォルトデータとして編集、削除不可です。</span><br/>\r
+<span class="pnt">※商品を持っている仕入先は削除できません。</span><br/>\r
+  <table class="data2 clear" cellspacing="1">\r
+    <tr>\r
+      <th>仕入先ID</th>\r
+      <th>仕入先名</th>\r
+      <th>担当者名</th>\r
+      <th>電話番号</th>\r
+      <th>ファックス</th>\r
+      <th>e-mail</th>\r
+      <th>編集</th>\r
+      <th>削除</th>\r
+    </tr>\r
+<%unless @suppliers.blank?%>   \r
+    <% @suppliers.each do | supplier | %>\r
+      <tr>\r
+        <td><%= h supplier.id %></td>\r
+        <td><%= h supplier.name %></td>\r
+        <td><%= h supplier.contact_name %></td>\r
+        <td><%= h supplier.tel %></td>\r
+        <td><%= h supplier.fax %></td>\r
+        <td><%= h supplier.email %></td>\r
+        <td class="t_center">\r
+          <% if supplier.id != Supplier::DEFAULT_SUPPLIER_ID%>\r
+                   <%= link_to "編集", :action=>"edit" ,:id=>supplier.id %>\r
+                 <% end%>\r
+        </td>\r
+        <td class="t_center">\r
+          <% if supplier.id != Supplier::DEFAULT_SUPPLIER_ID && supplier.products.blank?%>     \r
+                       <%= link_to "削除", :action=>"destroy" ,:id=>supplier.id %>\r
+                 <% end%>      \r
+        </td>\r
+      </tr>\r
+    <% end %>\r
+<%end%>\r
+</table>\r
+<%= will_paginate @suppliers %>\r
+<br/>\r
+<div class="t_center btn_t">\r
+<input type="button" class="btn_s" value="新規登録" onclick="location.href = '/admin/suppliers/new'">\r
+</div>\r
+</div><!-- /メイン -->\r
index 4090c6d..85d6c07 100644 (file)
       <ul id="con_menu" class="clearfix">
         <li><a href="/admin/shops" id="shop"><img src="/images/store_btn.gif" width="122" height="51" alt="店舗管理" class="hoverImg" /></a></li>
         <li><a href="/admin/products" id="product"><img src="/images/goods_btn.gif" width="122" height="51" alt="商品管理" class="hoverImg" /></a></li>
+    <% if @system.supplier_use_flag %>
+        <li><a href="/admin/suppliers" id="depot"><img src="/images/order_btn.gif" width="122" height="51" alt="発注出荷管理" class="hoverImg" /></a></li>
+       <%else%>
+               <li><a href="#" id="depot"><img src="/images/order_btn.gif" width="122" height="51" alt="発注出荷管理" class="hoverImg" /></a></li>
+       <%end%> 
         <li><a href="/"><img src="/images/site_btn.gif" width="122" height="51" alt="サイトを表示" class="hoverImg" /></a></li>
       </ul>
       <div id="head_r" class="clearfix">
index fa1adcc..f4f1cb0 100644 (file)
@@ -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 (file)
index 0000000..2dfa118
--- /dev/null
@@ -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 (file)
index 0000000..27d127c
--- /dev/null
@@ -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 (file)
index 0000000..e433380
--- /dev/null
@@ -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 (file)
index 0000000..1a1aa98
--- /dev/null
@@ -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 (file)
index 0000000..04b1497
--- /dev/null
@@ -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 (file)
index 0000000..18a4fa3
--- /dev/null
@@ -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
index 6013585..7cb1b15 100644 (file)
@@ -197,3 +197,8 @@ F900:
   name: メンバー管理\r
   code: "member"\r
   position: 900\r
+F901:\r
+  id: 41\r
+  name: 仕入先マスタ\r
+  code: "supplier"\r
+  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 (file)
index 0000000..de7610b
--- /dev/null
@@ -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
index 1b7b17a..fd27ee9 100644 (file)
@@ -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 (file)
index 0000000..cd0553f
--- /dev/null
@@ -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
index 528a872..8a42019 100644 (file)
@@ -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 (file)
index 0000000..3b6fe2e
--- /dev/null
@@ -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 (file)
index 0000000..2692a13
--- /dev/null
@@ -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
index f0314e0..579c232 100644 (file)
@@ -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)
index b1e5166..7e7166b 100644 (file)
@@ -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
index 4a10724..037d698 100644 (file)
@@ -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 (file)
index 0000000..e1ecdc2
--- /dev/null
@@ -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 (file)
index 0000000..5f6f34e
--- /dev/null
@@ -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
index c79affd..2d6f3f9 100644 (file)
@@ -1,3 +1,3 @@
-\8f¤\95iID,\8cö\8aJ\90Ý\92è,\96¼\91O,\8eQ\8fÆURL,\88ê\97\97\83R\83\81\83\93\83g,\8fÚ\8d×\83R\83\81\83\93\83g,\83L\81[\83\8f\81[\83h,\8es\8fê\8eQ\8dl\89¿\8ai,\88ê\97\97\81E\83\81\83C\83\93\89æ\91\9cID,\88ê\97\97\81E\83\81\83C\83\93\89æ\91\9c\83R\83\81\83\93\83g,\88ê\97\97\81E\83\81\83C\83\93\89æ\91\9c\83p\83X,\8fÚ\8d×\81E\83\81\83C\83\93\89æ\91\9cID,\8fÚ\8d×\81E\83\81\83C\83\93\89æ\91\9c\83R\83\81\83\93\83g,\8fÚ\8d×\81E\83\81\83C\83\93\89æ\91\9c\83p\83X,\8fÚ\8d×\81E\83\81\83C\83\93\8ag\91å\89æ\91\9cID,\8fÚ\8d×\81E\83\81\83C\83\93\8ag\91å\89æ\91\9c\83R\83\81\83\93\83g,\8fÚ\8d×\81E\83\81\83C\83\93\8ag\91å\89æ\91\9c\83p\83X,\8dw\93ü\90§\8cÀ,\83|\83C\83\93\83g\95t\97^\97¦,\94Ì\94\84\8aJ\8en\93ú,\94Ì\94\84\8fI\97¹\93ú,\8f¤\95i\83J\83e\83S\83\8a,\93ü\89×\97\\92è\93ú,\83T\83C\83Y,\91f\8dÞ,\8c´\8eY\92n,\8fd\82³,\93ü\89×\93ú,\82»\82Ì\91¼\8ed\97l,\83t\83\8a\81[\93ü\97Í,\94z\91\97\93ú,\93o\98^\93ú,\8dX\90V\93ú\r
-17,\94ñ\8cö\8aJ,\89º\92\85,,\83e\83X\83g01,\83e\83X\83g01,\83t\83@\83b\83V\83\87\83\93,5000,18,,,18,,,,,,,,,,\91å\83J\83e\83S\83\8a,2009/10/1,,,japan,,,,,3\93ú\8cã,,\r
-,\8cö\8aJ,\83\8d\83\93\83O\83R\81[\83g,,\83e\83X\83g02,\83e\83X\83g02,\83t\83@\83b\83V\83\87\83\93,15000,18,,,18,,,,,,,,,,\91å\83J\83e\83S\83\8a,2009/10/1,,,english,,,,,,,\r
+\8f¤\95iID,\8cö\8aJ\90Ý\92è,\96¼\91O,\8eQ\8fÆURL,\88ê\97\97\83R\83\81\83\93\83g,\8fÚ\8d×\83R\83\81\83\93\83g,\83L\81[\83\8f\81[\83h,\8es\8fê\8eQ\8dl\89¿\8ai,\88ê\97\97\81E\83\81\83C\83\93\89æ\91\9cID,\88ê\97\97\81E\83\81\83C\83\93\89æ\91\9c\83R\83\81\83\93\83g,\88ê\97\97\81E\83\81\83C\83\93\89æ\91\9c\83p\83X,\8fÚ\8d×\81E\83\81\83C\83\93\89æ\91\9cID,\8fÚ\8d×\81E\83\81\83C\83\93\89æ\91\9c\83R\83\81\83\93\83g,\8fÚ\8d×\81E\83\81\83C\83\93\89æ\91\9c\83p\83X,\8fÚ\8d×\81E\83\81\83C\83\93\8ag\91å\89æ\91\9cID,\8fÚ\8d×\81E\83\81\83C\83\93\8ag\91å\89æ\91\9c\83R\83\81\83\93\83g,\8fÚ\8d×\81E\83\81\83C\83\93\8ag\91å\89æ\91\9c\83p\83X,\8dw\93ü\90§\8cÀ,\83|\83C\83\93\83g\95t\97^\97¦,\94Ì\94\84\8aJ\8en\93ú,\94Ì\94\84\8fI\97¹\93ú,\8f¤\95i\83J\83e\83S\83\8a,\93ü\89×\97\\92è\93ú,\83T\83C\83Y,\91f\8dÞ,\8c´\8eY\92n,\8fd\82³,\93ü\89×\93ú,\82»\82Ì\91¼\8ed\97l,\83t\83\8a\81[\93ü\97Í,\94z\91\97\93ú,\8ed\93ü\90æ\96¼,\93o\98^\93ú,\8dX\90V\93ú\r
+17,\94ñ\8cö\8aJ,\89º\92\85,,\83e\83X\83g01,\83e\83X\83g01,\83t\83@\83b\83V\83\87\83\93,5000,18,,,18,,,,,,,,,,\91å\83J\83e\83S\83\8a,2009/10/1,,,japan,,,,,3\93ú\8cã,,,\r
+,\8cö\8aJ,\83\8d\83\93\83O\83R\81[\83g,,\83e\83X\83g02,\83e\83X\83g02,\83t\83@\83b\83V\83\87\83\93,15000,18,,,18,,,,,,,,,,\91å\83J\83e\83S\83\8a,2009/10/1,,,english,,,,,,\82Ä\82·\82Æ\81i\8a\94\81j,,\r
index 855f3e3..9dda230 100644 (file)
@@ -1,3 +1,3 @@
-\8f¤\95iID,\8cö\8aJ\90Ý\92è,\96¼\91O,\8eQ\8fÆURL,\88ê\97\97\83R\83\81\83\93\83g,\8fÚ\8d×\83R\83\81\83\93\83g,\83L\81[\83\8f\81[\83h,\8es\8fê\8eQ\8dl\89¿\8ai,\88ê\97\97\81E\83\81\83C\83\93\89æ\91\9cID,\88ê\97\97\81E\83\81\83C\83\93\89æ\91\9c\83R\83\81\83\93\83g,\88ê\97\97\81E\83\81\83C\83\93\89æ\91\9c\83p\83X,\8fÚ\8d×\81E\83\81\83C\83\93\89æ\91\9cID,\8fÚ\8d×\81E\83\81\83C\83\93\89æ\91\9c\83R\83\81\83\93\83g,\8fÚ\8d×\81E\83\81\83C\83\93\89æ\91\9c\83p\83X,\8fÚ\8d×\81E\83\81\83C\83\93\8ag\91å\89æ\91\9cID,\8fÚ\8d×\81E\83\81\83C\83\93\8ag\91å\89æ\91\9c\83R\83\81\83\93\83g,\8fÚ\8d×\81E\83\81\83C\83\93\8ag\91å\89æ\91\9c\83p\83X,\8dw\93ü\90§\8cÀ,\83|\83C\83\93\83g\95t\97^\97¦,\94Ì\94\84\8aJ\8en\93ú,\94Ì\94\84\8fI\97¹\93ú,\8f¤\95i\83J\83e\83S\83\8a,\93ü\89×\97\\92è\93ú,\83T\83C\83Y,\91f\8dÞ,\8c´\8eY\92n,\8fd\82³,\93ü\89×\93ú,\82»\82Ì\91¼\8ed\97l,\83t\83\8a\81[\93ü\97Í,\94z\91\97\93ú,\93o\98^\93ú,\8dX\90V\93ú\r
-,\94ñ\8cö\8aJ,\89º\92\85,,\83e\83X\83g01,\83e\83X\83g01,\83t\83@\83b\83V\83\87\83\93,5000,18,,,18,,sea1.PNG,18,,,,,,,\91å\83J\83e\83S\83\8a,2009/10/1,,,japan,,,,,,,,,,2012/10/30 0:00,2009/10/1 0:00,2012/10/30 0:00,2009/10/1 0:00\r
-,\8cö\8aJ,\83\8d\83\93\83O\83R\81[\83g,,\83e\83X\83g02,\83e\83X\83g02,\83t\83@\83b\83V\83\87\83\93,15000,18,,sea1.PNG,18,,,,,,,,,,\91å\83J\83e\83S\83\8a,2009/10/1,,,english,,,,,,,,,2012/10/30 0:00,2009/10/1 0:00,2012/10/30 0:00,2009/10/1 0:00
+\8f¤\95iID,\8cö\8aJ\90Ý\92è,\96¼\91O,\8eQ\8fÆURL,\88ê\97\97\83R\83\81\83\93\83g,\8fÚ\8d×\83R\83\81\83\93\83g,\83L\81[\83\8f\81[\83h,\8es\8fê\8eQ\8dl\89¿\8ai,\88ê\97\97\81E\83\81\83C\83\93\89æ\91\9cID,\88ê\97\97\81E\83\81\83C\83\93\89æ\91\9c\83R\83\81\83\93\83g,\88ê\97\97\81E\83\81\83C\83\93\89æ\91\9c\83p\83X,\8fÚ\8d×\81E\83\81\83C\83\93\89æ\91\9cID,\8fÚ\8d×\81E\83\81\83C\83\93\89æ\91\9c\83R\83\81\83\93\83g,\8fÚ\8d×\81E\83\81\83C\83\93\89æ\91\9c\83p\83X,\8fÚ\8d×\81E\83\81\83C\83\93\8ag\91å\89æ\91\9cID,\8fÚ\8d×\81E\83\81\83C\83\93\8ag\91å\89æ\91\9c\83R\83\81\83\93\83g,\8fÚ\8d×\81E\83\81\83C\83\93\8ag\91å\89æ\91\9c\83p\83X,\8dw\93ü\90§\8cÀ,\83|\83C\83\93\83g\95t\97^\97¦,\94Ì\94\84\8aJ\8en\93ú,\94Ì\94\84\8fI\97¹\93ú,\8f¤\95i\83J\83e\83S\83\8a,\93ü\89×\97\\92è\93ú,\83T\83C\83Y,\91f\8dÞ,\8c´\8eY\92n,\8fd\82³,\93ü\89×\93ú,\82»\82Ì\91¼\8ed\97l,\83t\83\8a\81[\93ü\97Í,\94z\91\97\93ú,\8ed\93ü\90æ\96¼,\93o\98^\93ú,\8dX\90V\93ú\r
+17,\94ñ\8cö\8aJ,\89º\92\85,,\83e\83X\83g01,\83e\83X\83g01,\83t\83@\83b\83V\83\87\83\93,5000,18,,,18,,sea1.PNG,18,,,,,,,\91å\83J\83e\83S\83\8a,2009/10/1,,,japan,,,,,,,,\r
+,\8cö\8aJ,\83\8d\83\93\83O\83R\81[\83g,,\83e\83X\83g02,\83e\83X\83g02,\83t\83@\83b\83V\83\87\83\93,15000,18,,sea1.PNG,18,,,,,,,,,,\91å\83J\83e\83S\83\8a,2009/10/1,,,english,,,,,,,,\r
index d3cd5f2..5ffb35e 100644 (file)
@@ -1,3 +1,3 @@
-\8f¤\95iID,\8cö\8aJ\90Ý\92è,\96¼\91O,\8eQ\8fÆURL,\88ê\97\97\83R\83\81\83\93\83g,\8fÚ\8d×\83R\83\81\83\93\83g,\83L\81[\83\8f\81[\83h,\8eQ\8dl\8es\8fê\89¿\8ai,\88ê\97\97\81E\83\81\83C\83\93\89æ\91\9cID,\88ê\97\97\81E\83\81\83C\83\93\89æ\91\9c\83R\83\81\83\93\83g,\88ê\97\97\81E\83\81\83C\83\93\89æ\91\9c\83p\83X,\8fÚ\8d×\81E\83\81\83C\83\93\89æ\91\9cID,\8fÚ\8d×\81E\83\81\83C\83\93\89æ\91\9c\83R\83\81\83\93\83g,\8fÚ\8d×\81E\83\81\83C\83\93\89æ\91\9c\83p\83X,\8fÚ\8d×\81E\83\81\83C\83\93\8ag\91å\89æ\91\9cID,\8fÚ\8d×\81E\83\81\83C\83\93\8ag\91å\89æ\91\9c\83R\83\81\83\93\83g,\8fÚ\8d×\81E\83\81\83C\83\93\8ag\91å\89æ\91\9c\83p\83X,\8dw\93ü\90§\8cÀ,\83|\83C\83\93\83g\95t\97^\97¦,\94Ì\94\84\8aJ\8en\93ú,\94Ì\94\84\8fI\97¹\93ú,\8f¤\95i\83J\83e\83S\83\8a,\93ü\89×\97\\92è\93ú,\83T\83C\83Y,\91f\8dÞ,\8c´\8eY\8d\91,\8fd\82³,\93ü\89×\93ú,\82»\82Ì\91¼\8ed\97l,\83t\83\8a\81[\93ü\97Í,\94z\91\97\93ú,\93o\98^\93ú,\8dX\90V\93ú\r
-18,\8cö\8aJ,\83X\83J\81[\83g,,\83e\83X\83g,\83e\83X\83g,,1000,70,,,69,,,,,,,,2009/10/1 9:00,2012/10/1 9:00,\91å\83J\83e\83S\83\8a,2009/10/1 9:00,,,,,,,,,2009/12/8 19:01,2009/12/8 19:01\r
-,\8cö\8aJ,\83X\83J\81[\83g,,\83e\83X\83g,\83e\83X\83g,,1000,70,,,69,,,,,,,,2009/10/1 9:00,2012/10/1 9:00,\91å\83J\83e\83S\83\8a,2009/10/1 9:00,,,,,,,,,2009/12/8 19:01,2009/12/8 19:01\r
+\8f¤\95iID,\8cö\8aJ\90Ý\92è,\96¼\91O,\8eQ\8fÆURL,\88ê\97\97\83R\83\81\83\93\83g,\8fÚ\8d×\83R\83\81\83\93\83g,\83L\81[\83\8f\81[\83h,\8eQ\8dl\8es\8fê\89¿\8ai,\88ê\97\97\81E\83\81\83C\83\93\89æ\91\9cID,\88ê\97\97\81E\83\81\83C\83\93\89æ\91\9c\83R\83\81\83\93\83g,\88ê\97\97\81E\83\81\83C\83\93\89æ\91\9c\83p\83X,\8fÚ\8d×\81E\83\81\83C\83\93\89æ\91\9cID,\8fÚ\8d×\81E\83\81\83C\83\93\89æ\91\9c\83R\83\81\83\93\83g,\8fÚ\8d×\81E\83\81\83C\83\93\89æ\91\9c\83p\83X,\8fÚ\8d×\81E\83\81\83C\83\93\8ag\91å\89æ\91\9cID,\8fÚ\8d×\81E\83\81\83C\83\93\8ag\91å\89æ\91\9c\83R\83\81\83\93\83g,\8fÚ\8d×\81E\83\81\83C\83\93\8ag\91å\89æ\91\9c\83p\83X,\8dw\93ü\90§\8cÀ,\83|\83C\83\93\83g\95t\97^\97¦,\94Ì\94\84\8aJ\8en\93ú,\94Ì\94\84\8fI\97¹\93ú,\8f¤\95i\83J\83e\83S\83\8a,\93ü\89×\97\\92è\93ú,\83T\83C\83Y,\91f\8dÞ,\8c´\8eY\8d\91,\8fd\82³,\93ü\89×\93ú,\82»\82Ì\91¼\8ed\97l,\83t\83\8a\81[\93ü\97Í,\94z\91\97\93ú,\8ed\93ü\90æ\96¼,\93o\98^\93ú,\8dX\90V\93ú\r
+18,\8cö\8aJ,\83X\83J\81[\83g,,\83e\83X\83g,\83e\83X\83g,,1000,70,,,69,,,,,,,,2009/10/1 9:00,2012/10/1 9:00,\91å\83J\83e\83S\83\8a,2009/10/1 9:00,,,,,,,,,,2009/12/8 19:01,2009/12/8 19:01\r
+,\8cö\8aJ,\83X\83J\81[\83g,,\83e\83X\83g,\83e\83X\83g,,1000,70,,,69,,,,,,,,2009/10/1 9:00,2012/10/1 9:00,\91å\83J\83e\83S\83\8a,2009/10/1 9:00,,,,,,,,,,2009/12/8 19:01,2009/12/8 19:01\r