Index: branches/version-2_13-dev/html/install/index.php
===================================================================
--- branches/version-2_13-dev/html/install/index.php	(revision 22567)
+++ branches/version-2_13-dev/html/install/index.php	(revision 22736)
@@ -31,4 +31,7 @@
     while (ob_end_clean());
 }
+
+define("DEFAULT_COUNTRY_ID",392);
+
 require_once HTML_REALDIR . HTML2DATA_DIR . 'require_base.php';
 ob_start();
@@ -577,4 +580,5 @@
     $sqlval['mypage_tpl'] = 'default1';
     $sqlval['update_date'] = 'CURRENT_TIMESTAMP';
+    $sqlval['country_id'] = DEFAULT_COUNTRY_ID;
     $objQuery = new SC_Query($arrDsn);
     $cnt = $objQuery->count('dtb_baseinfo');
@@ -1119,4 +1123,5 @@
         array('dtb_api_config', 'api_config_id'),
         array('dtb_api_account', 'api_account_id'),
+        array('dtb_tax_rule', 'tax_rule_id'),
     );
 }
Index: branches/version-2_13-dev/html/install/sql/drop_table.sql
===================================================================
--- branches/version-2_13-dev/html/install/sql/drop_table.sql	(revision 21942)
+++ branches/version-2_13-dev/html/install/sql/drop_table.sql	(revision 22736)
@@ -96,2 +96,4 @@
 DROP TABLE dtb_api_config;
 DROP TABLE dtb_api_account;
+DROP TABLE dtb_tax_rule;
+DROP TABLE mtb_country;
Index: branches/version-2_13-dev/html/install/sql/insert_data.sql
===================================================================
--- branches/version-2_13-dev/html/install/sql/insert_data.sql	(revision 22551)
+++ branches/version-2_13-dev/html/install/sql/insert_data.sql	(revision 22736)
@@ -1255,4 +1255,6 @@
 INSERT INTO mtb_constants (id, name, rank, remarks) VALUES ('LOGIN_RETRY_INTERVAL', '0', 1411, 'ログイン失敗時の遅延時間(秒)(ブルートフォースアタック対策)');
 INSERT INTO mtb_constants (id, name, rank, remarks) VALUES ('MYPAGE_ORDER_STATUS_DISP_FLAG', 'true', 1412, 'MYページ：ご注文状況表示フラグ');
+INSERT INTO mtb_constants (id, name, rank, remarks) VALUES ('DEFAULT_COUNTRY_ID', 392, 1413, 'デフォルト国コード ISO_3166-1に準拠');
+
 
 INSERT INTO dtb_index_list (table_name, column_name, recommend_flg, recommend_comment) VALUES ('dtb_customer', 'email_mobile', 0, '会員数増加時のログイン処理速度を向上させたいときに試してみてください');
@@ -1279,2 +1281,254 @@
 INSERT INTO dtb_index_list (table_name, column_name, recommend_flg, recommend_comment) VALUES ('dtb_product_categories', 'category_id', 2, 'カテゴリが多いときに試してみてください。');
 INSERT INTO dtb_index_list (table_name, column_name, recommend_flg, recommend_comment) VALUES ('mtb_zip', 'zipcode', 2, '郵便番号検索が遅いときに試してみてください。郵便番号データの更新時には無効にしていることをおすすめします。');
+
+INSERT INTO dtb_tax_rule (tax_rule_id, apply_date, member_id, del_flg, create_date, update_date) VALUES (0, CURRENT_TIMESTAMP, 1, 0, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP);
+
+INSERT INTO mtb_country (id, name, rank) VALUES (352,'アイスランド',1);
+INSERT INTO mtb_country (id, name, rank) VALUES (372,'アイルランド',2);
+INSERT INTO mtb_country (id, name, rank) VALUES (31,'アゼルバイジャン',3);
+INSERT INTO mtb_country (id, name, rank) VALUES (4,'アフガニスタン',4);
+INSERT INTO mtb_country (id, name, rank) VALUES (840,'アメリカ合衆国',5);
+INSERT INTO mtb_country (id, name, rank) VALUES (850,'アメリカ領ヴァージン諸島',6);
+INSERT INTO mtb_country (id, name, rank) VALUES (16,'アメリカ領サモア',7);
+INSERT INTO mtb_country (id, name, rank) VALUES (784,'アラブ首長国連邦',8);
+INSERT INTO mtb_country (id, name, rank) VALUES (12,'アルジェリア',9);
+INSERT INTO mtb_country (id, name, rank) VALUES (32,'アルゼンチン',10);
+INSERT INTO mtb_country (id, name, rank) VALUES (533,'アルバ',11);
+INSERT INTO mtb_country (id, name, rank) VALUES (8,'アルバニア',12);
+INSERT INTO mtb_country (id, name, rank) VALUES (51,'アルメニア',13);
+INSERT INTO mtb_country (id, name, rank) VALUES (660,'アンギラ',14);
+INSERT INTO mtb_country (id, name, rank) VALUES (24,'アンゴラ',15);
+INSERT INTO mtb_country (id, name, rank) VALUES (28,'アンティグア・バーブーダ',16);
+INSERT INTO mtb_country (id, name, rank) VALUES (20,'アンドラ',17);
+INSERT INTO mtb_country (id, name, rank) VALUES (887,'イエメン',18);
+INSERT INTO mtb_country (id, name, rank) VALUES (826,'イギリス',19);
+INSERT INTO mtb_country (id, name, rank) VALUES (86,'イギリス領インド洋地域',20);
+INSERT INTO mtb_country (id, name, rank) VALUES (92,'イギリス領ヴァージン諸島',21);
+INSERT INTO mtb_country (id, name, rank) VALUES (376,'イスラエル',22);
+INSERT INTO mtb_country (id, name, rank) VALUES (380,'イタリア',23);
+INSERT INTO mtb_country (id, name, rank) VALUES (368,'イラク',24);
+INSERT INTO mtb_country (id, name, rank) VALUES (364,'イラン|イラン・イスラム共和国',25);
+INSERT INTO mtb_country (id, name, rank) VALUES (356,'インド',26);
+INSERT INTO mtb_country (id, name, rank) VALUES (360,'インドネシア',27);
+INSERT INTO mtb_country (id, name, rank) VALUES (876,'ウォリス・フツナ',28);
+INSERT INTO mtb_country (id, name, rank) VALUES (800,'ウガンダ',29);
+INSERT INTO mtb_country (id, name, rank) VALUES (804,'ウクライナ',30);
+INSERT INTO mtb_country (id, name, rank) VALUES (860,'ウズベキスタン',31);
+INSERT INTO mtb_country (id, name, rank) VALUES (858,'ウルグアイ',32);
+INSERT INTO mtb_country (id, name, rank) VALUES (218,'エクアドル',33);
+INSERT INTO mtb_country (id, name, rank) VALUES (818,'エジプト',34);
+INSERT INTO mtb_country (id, name, rank) VALUES (233,'エストニア',35);
+INSERT INTO mtb_country (id, name, rank) VALUES (231,'エチオピア',36);
+INSERT INTO mtb_country (id, name, rank) VALUES (232,'エリトリア',37);
+INSERT INTO mtb_country (id, name, rank) VALUES (222,'エルサルバドル',38);
+INSERT INTO mtb_country (id, name, rank) VALUES (36,'オーストラリア',39);
+INSERT INTO mtb_country (id, name, rank) VALUES (40,'オーストリア',40);
+INSERT INTO mtb_country (id, name, rank) VALUES (248,'オーランド諸島',41);
+INSERT INTO mtb_country (id, name, rank) VALUES (512,'オマーン',42);
+INSERT INTO mtb_country (id, name, rank) VALUES (528,'オランダ',43);
+INSERT INTO mtb_country (id, name, rank) VALUES (288,'ガーナ',44);
+INSERT INTO mtb_country (id, name, rank) VALUES (132,'カーボベルデ',45);
+INSERT INTO mtb_country (id, name, rank) VALUES (831,'ガーンジー',46);
+INSERT INTO mtb_country (id, name, rank) VALUES (328,'ガイアナ',47);
+INSERT INTO mtb_country (id, name, rank) VALUES (398,'カザフスタン',48);
+INSERT INTO mtb_country (id, name, rank) VALUES (634,'カタール',49);
+INSERT INTO mtb_country (id, name, rank) VALUES (581,'合衆国領有小離島',50);
+INSERT INTO mtb_country (id, name, rank) VALUES (124,'カナダ',51);
+INSERT INTO mtb_country (id, name, rank) VALUES (266,'ガボン',52);
+INSERT INTO mtb_country (id, name, rank) VALUES (120,'カメルーン',53);
+INSERT INTO mtb_country (id, name, rank) VALUES (270,'ガンビア',54);
+INSERT INTO mtb_country (id, name, rank) VALUES (116,'カンボジア',55);
+INSERT INTO mtb_country (id, name, rank) VALUES (580,'北マリアナ諸島',56);
+INSERT INTO mtb_country (id, name, rank) VALUES (324,'ギニア',57);
+INSERT INTO mtb_country (id, name, rank) VALUES (624,'ギニアビサウ',58);
+INSERT INTO mtb_country (id, name, rank) VALUES (196,'キプロス',59);
+INSERT INTO mtb_country (id, name, rank) VALUES (192,'キューバ',60);
+INSERT INTO mtb_country (id, name, rank) VALUES (531,'キュラソー島|キュラソー',61);
+INSERT INTO mtb_country (id, name, rank) VALUES (300,'ギリシャ',62);
+INSERT INTO mtb_country (id, name, rank) VALUES (296,'キリバス',63);
+INSERT INTO mtb_country (id, name, rank) VALUES (417,'キルギス',64);
+INSERT INTO mtb_country (id, name, rank) VALUES (320,'グアテマラ',65);
+INSERT INTO mtb_country (id, name, rank) VALUES (312,'グアドループ',66);
+INSERT INTO mtb_country (id, name, rank) VALUES (316,'グアム',67);
+INSERT INTO mtb_country (id, name, rank) VALUES (414,'クウェート',68);
+INSERT INTO mtb_country (id, name, rank) VALUES (184,'クック諸島',69);
+INSERT INTO mtb_country (id, name, rank) VALUES (304,'グリーンランド',70);
+INSERT INTO mtb_country (id, name, rank) VALUES (162,'クリスマス島 (オーストラリア)|クリスマス島',71);
+INSERT INTO mtb_country (id, name, rank) VALUES (268,'グルジア',72);
+INSERT INTO mtb_country (id, name, rank) VALUES (308,'グレナダ',73);
+INSERT INTO mtb_country (id, name, rank) VALUES (191,'クロアチア',74);
+INSERT INTO mtb_country (id, name, rank) VALUES (136,'ケイマン諸島',75);
+INSERT INTO mtb_country (id, name, rank) VALUES (404,'ケニア',76);
+INSERT INTO mtb_country (id, name, rank) VALUES (384,'コートジボワール',77);
+INSERT INTO mtb_country (id, name, rank) VALUES (166,'ココス諸島|ココス（キーリング）諸島',78);
+INSERT INTO mtb_country (id, name, rank) VALUES (188,'コスタリカ',79);
+INSERT INTO mtb_country (id, name, rank) VALUES (174,'コモロ',80);
+INSERT INTO mtb_country (id, name, rank) VALUES (170,'コロンビア',81);
+INSERT INTO mtb_country (id, name, rank) VALUES (178,'コンゴ共和国',82);
+INSERT INTO mtb_country (id, name, rank) VALUES (180,'コンゴ民主共和国',83);
+INSERT INTO mtb_country (id, name, rank) VALUES (682,'サウジアラビア',84);
+INSERT INTO mtb_country (id, name, rank) VALUES (239,'サウスジョージア・サウスサンドウィッチ諸島',85);
+INSERT INTO mtb_country (id, name, rank) VALUES (882,'サモア',86);
+INSERT INTO mtb_country (id, name, rank) VALUES (678,'サントメ・プリンシペ',87);
+INSERT INTO mtb_country (id, name, rank) VALUES (652,'サン・バルテルミー島|サン・バルテルミー',88);
+INSERT INTO mtb_country (id, name, rank) VALUES (894,'ザンビア',89);
+INSERT INTO mtb_country (id, name, rank) VALUES (666,'サンピエール島・ミクロン島',90);
+INSERT INTO mtb_country (id, name, rank) VALUES (674,'サンマリノ',91);
+INSERT INTO mtb_country (id, name, rank) VALUES (663,'サン・マルタン (西インド諸島)|サン・マルタン（フランス領）',92);
+INSERT INTO mtb_country (id, name, rank) VALUES (694,'シエラレオネ',93);
+INSERT INTO mtb_country (id, name, rank) VALUES (262,'ジブチ',94);
+INSERT INTO mtb_country (id, name, rank) VALUES (292,'ジブラルタル',95);
+INSERT INTO mtb_country (id, name, rank) VALUES (832,'ジャージー',96);
+INSERT INTO mtb_country (id, name, rank) VALUES (388,'ジャマイカ',97);
+INSERT INTO mtb_country (id, name, rank) VALUES (760,'シリア|シリア・アラブ共和国',98);
+INSERT INTO mtb_country (id, name, rank) VALUES (702,'シンガポール',99);
+INSERT INTO mtb_country (id, name, rank) VALUES (534,'シント・マールテン|シント・マールテン（オランダ領）',100);
+INSERT INTO mtb_country (id, name, rank) VALUES (716,'ジンバブエ',101);
+INSERT INTO mtb_country (id, name, rank) VALUES (756,'スイス',102);
+INSERT INTO mtb_country (id, name, rank) VALUES (752,'スウェーデン',103);
+INSERT INTO mtb_country (id, name, rank) VALUES (729,'スーダン',104);
+INSERT INTO mtb_country (id, name, rank) VALUES (744,'スヴァールバル諸島およびヤンマイエン島',105);
+INSERT INTO mtb_country (id, name, rank) VALUES (724,'スペイン',106);
+INSERT INTO mtb_country (id, name, rank) VALUES (740,'スリナム',107);
+INSERT INTO mtb_country (id, name, rank) VALUES (144,'スリランカ',108);
+INSERT INTO mtb_country (id, name, rank) VALUES (703,'スロバキア',109);
+INSERT INTO mtb_country (id, name, rank) VALUES (705,'スロベニア',110);
+INSERT INTO mtb_country (id, name, rank) VALUES (748,'スワジランド',111);
+INSERT INTO mtb_country (id, name, rank) VALUES (690,'セーシェル',112);
+INSERT INTO mtb_country (id, name, rank) VALUES (226,'赤道ギニア',113);
+INSERT INTO mtb_country (id, name, rank) VALUES (686,'セネガル',114);
+INSERT INTO mtb_country (id, name, rank) VALUES (688,'セルビア',115);
+INSERT INTO mtb_country (id, name, rank) VALUES (659,'セントクリストファー・ネイビス',116);
+INSERT INTO mtb_country (id, name, rank) VALUES (670,'セントビンセント・グレナディーン|セントビンセントおよびグレナディーン諸島',117);
+INSERT INTO mtb_country (id, name, rank) VALUES (654,'セントヘレナ・アセンションおよびトリスタンダクーニャ',118);
+INSERT INTO mtb_country (id, name, rank) VALUES (662,'セントルシア',119);
+INSERT INTO mtb_country (id, name, rank) VALUES (706,'ソマリア',120);
+INSERT INTO mtb_country (id, name, rank) VALUES (90,'ソロモン諸島',121);
+INSERT INTO mtb_country (id, name, rank) VALUES (796,'タークス・カイコス諸島',122);
+INSERT INTO mtb_country (id, name, rank) VALUES (764,'タイ王国|タイ',123);
+INSERT INTO mtb_country (id, name, rank) VALUES (410,'大韓民国',124);
+INSERT INTO mtb_country (id, name, rank) VALUES (158,'台湾',125);
+INSERT INTO mtb_country (id, name, rank) VALUES (762,'タジキスタン',126);
+INSERT INTO mtb_country (id, name, rank) VALUES (834,'タンザニア',127);
+INSERT INTO mtb_country (id, name, rank) VALUES (203,'チェコ',128);
+INSERT INTO mtb_country (id, name, rank) VALUES (148,'チャド',129);
+INSERT INTO mtb_country (id, name, rank) VALUES (140,'中央アフリカ共和国',130);
+INSERT INTO mtb_country (id, name, rank) VALUES (156,'中華人民共和国|中国',131);
+INSERT INTO mtb_country (id, name, rank) VALUES (788,'チュニジア',132);
+INSERT INTO mtb_country (id, name, rank) VALUES (408,'朝鮮民主主義人民共和国',133);
+INSERT INTO mtb_country (id, name, rank) VALUES (152,'チリ',134);
+INSERT INTO mtb_country (id, name, rank) VALUES (798,'ツバル',135);
+INSERT INTO mtb_country (id, name, rank) VALUES (208,'デンマーク',136);
+INSERT INTO mtb_country (id, name, rank) VALUES (276,'ドイツ',137);
+INSERT INTO mtb_country (id, name, rank) VALUES (768,'トーゴ',138);
+INSERT INTO mtb_country (id, name, rank) VALUES (772,'トケラウ',139);
+INSERT INTO mtb_country (id, name, rank) VALUES (214,'ドミニカ共和国',140);
+INSERT INTO mtb_country (id, name, rank) VALUES (212,'ドミニカ国',141);
+INSERT INTO mtb_country (id, name, rank) VALUES (780,'トリニダード・トバゴ',142);
+INSERT INTO mtb_country (id, name, rank) VALUES (795,'トルクメニスタン',143);
+INSERT INTO mtb_country (id, name, rank) VALUES (792,'トルコ',144);
+INSERT INTO mtb_country (id, name, rank) VALUES (776,'トンガ',145);
+INSERT INTO mtb_country (id, name, rank) VALUES (566,'ナイジェリア',146);
+INSERT INTO mtb_country (id, name, rank) VALUES (520,'ナウル',147);
+INSERT INTO mtb_country (id, name, rank) VALUES (516,'ナミビア',148);
+INSERT INTO mtb_country (id, name, rank) VALUES (10,'南極',149);
+INSERT INTO mtb_country (id, name, rank) VALUES (570,'ニウエ',150);
+INSERT INTO mtb_country (id, name, rank) VALUES (558,'ニカラグア',151);
+INSERT INTO mtb_country (id, name, rank) VALUES (562,'ニジェール',152);
+INSERT INTO mtb_country (id, name, rank) VALUES (392,'日本',153);
+INSERT INTO mtb_country (id, name, rank) VALUES (732,'西サハラ',154);
+INSERT INTO mtb_country (id, name, rank) VALUES (540,'ニューカレドニア',155);
+INSERT INTO mtb_country (id, name, rank) VALUES (554,'ニュージーランド',156);
+INSERT INTO mtb_country (id, name, rank) VALUES (524,'ネパール',157);
+INSERT INTO mtb_country (id, name, rank) VALUES (574,'ノーフォーク島',158);
+INSERT INTO mtb_country (id, name, rank) VALUES (578,'ノルウェー',159);
+INSERT INTO mtb_country (id, name, rank) VALUES (334,'ハード島とマクドナルド諸島',160);
+INSERT INTO mtb_country (id, name, rank) VALUES (48,'バーレーン',161);
+INSERT INTO mtb_country (id, name, rank) VALUES (332,'ハイチ',162);
+INSERT INTO mtb_country (id, name, rank) VALUES (586,'パキスタン',163);
+INSERT INTO mtb_country (id, name, rank) VALUES (336,'バチカン|バチカン市国',164);
+INSERT INTO mtb_country (id, name, rank) VALUES (591,'パナマ',165);
+INSERT INTO mtb_country (id, name, rank) VALUES (548,'バヌアツ',166);
+INSERT INTO mtb_country (id, name, rank) VALUES (44,'バハマ',167);
+INSERT INTO mtb_country (id, name, rank) VALUES (598,'パプアニューギニア',168);
+INSERT INTO mtb_country (id, name, rank) VALUES (60,'バミューダ諸島|バミューダ',169);
+INSERT INTO mtb_country (id, name, rank) VALUES (585,'パラオ',170);
+INSERT INTO mtb_country (id, name, rank) VALUES (600,'パラグアイ',171);
+INSERT INTO mtb_country (id, name, rank) VALUES (52,'バルバドス',172);
+INSERT INTO mtb_country (id, name, rank) VALUES (275,'パレスチナ',173);
+INSERT INTO mtb_country (id, name, rank) VALUES (348,'ハンガリー',174);
+INSERT INTO mtb_country (id, name, rank) VALUES (50,'バングラデシュ',175);
+INSERT INTO mtb_country (id, name, rank) VALUES (626,'東ティモール',176);
+INSERT INTO mtb_country (id, name, rank) VALUES (612,'ピトケアン諸島|ピトケアン',177);
+INSERT INTO mtb_country (id, name, rank) VALUES (242,'フィジー',178);
+INSERT INTO mtb_country (id, name, rank) VALUES (608,'フィリピン',179);
+INSERT INTO mtb_country (id, name, rank) VALUES (246,'フィンランド',180);
+INSERT INTO mtb_country (id, name, rank) VALUES (64,'ブータン',181);
+INSERT INTO mtb_country (id, name, rank) VALUES (74,'ブーベ島',182);
+INSERT INTO mtb_country (id, name, rank) VALUES (630,'プエルトリコ',183);
+INSERT INTO mtb_country (id, name, rank) VALUES (234,'フェロー諸島',184);
+INSERT INTO mtb_country (id, name, rank) VALUES (238,'フォークランド諸島|フォークランド（マルビナス）諸島',185);
+INSERT INTO mtb_country (id, name, rank) VALUES (76,'ブラジル',186);
+INSERT INTO mtb_country (id, name, rank) VALUES (250,'フランス',187);
+INSERT INTO mtb_country (id, name, rank) VALUES (254,'フランス領ギアナ',188);
+INSERT INTO mtb_country (id, name, rank) VALUES (258,'フランス領ポリネシア',189);
+INSERT INTO mtb_country (id, name, rank) VALUES (260,'フランス領南方・南極地域',190);
+INSERT INTO mtb_country (id, name, rank) VALUES (100,'ブルガリア',191);
+INSERT INTO mtb_country (id, name, rank) VALUES (854,'ブルキナファソ',192);
+INSERT INTO mtb_country (id, name, rank) VALUES (96,'ブルネイ|ブルネイ・ダルサラーム',193);
+INSERT INTO mtb_country (id, name, rank) VALUES (108,'ブルンジ',194);
+INSERT INTO mtb_country (id, name, rank) VALUES (704,'ベトナム',195);
+INSERT INTO mtb_country (id, name, rank) VALUES (204,'ベナン',196);
+INSERT INTO mtb_country (id, name, rank) VALUES (862,'ベネズエラ|ベネズエラ・ボリバル共和国',197);
+INSERT INTO mtb_country (id, name, rank) VALUES (112,'ベラルーシ',198);
+INSERT INTO mtb_country (id, name, rank) VALUES (84,'ベリーズ',199);
+INSERT INTO mtb_country (id, name, rank) VALUES (604,'ペルー',200);
+INSERT INTO mtb_country (id, name, rank) VALUES (56,'ベルギー',201);
+INSERT INTO mtb_country (id, name, rank) VALUES (616,'ポーランド',202);
+INSERT INTO mtb_country (id, name, rank) VALUES (70,'ボスニア・ヘルツェゴビナ',203);
+INSERT INTO mtb_country (id, name, rank) VALUES (72,'ボツワナ',204);
+INSERT INTO mtb_country (id, name, rank) VALUES (535,'BES諸島|ボネール、シント・ユースタティウスおよびサバ',205);
+INSERT INTO mtb_country (id, name, rank) VALUES (68,'ボリビア|ボリビア多民族国',206);
+INSERT INTO mtb_country (id, name, rank) VALUES (620,'ポルトガル',207);
+INSERT INTO mtb_country (id, name, rank) VALUES (344,'香港',208);
+INSERT INTO mtb_country (id, name, rank) VALUES (340,'ホンジュラス',209);
+INSERT INTO mtb_country (id, name, rank) VALUES (584,'マーシャル諸島',210);
+INSERT INTO mtb_country (id, name, rank) VALUES (446,'マカオ',211);
+INSERT INTO mtb_country (id, name, rank) VALUES (807,'マケドニア共和国|マケドニア旧ユーゴスラビア共和国',212);
+INSERT INTO mtb_country (id, name, rank) VALUES (450,'マダガスカル',213);
+INSERT INTO mtb_country (id, name, rank) VALUES (175,'マヨット',214);
+INSERT INTO mtb_country (id, name, rank) VALUES (454,'マラウイ',215);
+INSERT INTO mtb_country (id, name, rank) VALUES (466,'マリ共和国|マリ',216);
+INSERT INTO mtb_country (id, name, rank) VALUES (470,'マルタ',217);
+INSERT INTO mtb_country (id, name, rank) VALUES (474,'マルティニーク',218);
+INSERT INTO mtb_country (id, name, rank) VALUES (458,'マレーシア',219);
+INSERT INTO mtb_country (id, name, rank) VALUES (833,'マン島',220);
+INSERT INTO mtb_country (id, name, rank) VALUES (583,'ミクロネシア連邦',221);
+INSERT INTO mtb_country (id, name, rank) VALUES (710,'南アフリカ共和国|南アフリカ',222);
+INSERT INTO mtb_country (id, name, rank) VALUES (728,'南スーダン',223);
+INSERT INTO mtb_country (id, name, rank) VALUES (104,'ミャンマー',224);
+INSERT INTO mtb_country (id, name, rank) VALUES (484,'メキシコ',225);
+INSERT INTO mtb_country (id, name, rank) VALUES (480,'モーリシャス',226);
+INSERT INTO mtb_country (id, name, rank) VALUES (478,'モーリタニア',227);
+INSERT INTO mtb_country (id, name, rank) VALUES (508,'モザンビーク',228);
+INSERT INTO mtb_country (id, name, rank) VALUES (492,'モナコ',229);
+INSERT INTO mtb_country (id, name, rank) VALUES (462,'モルディブ',230);
+INSERT INTO mtb_country (id, name, rank) VALUES (498,'モルドバ|モルドバ共和国',231);
+INSERT INTO mtb_country (id, name, rank) VALUES (504,'モロッコ',232);
+INSERT INTO mtb_country (id, name, rank) VALUES (496,'モンゴル国|モンゴル',233);
+INSERT INTO mtb_country (id, name, rank) VALUES (499,'モンテネグロ',234);
+INSERT INTO mtb_country (id, name, rank) VALUES (500,'モントセラト',235);
+INSERT INTO mtb_country (id, name, rank) VALUES (400,'ヨルダン',236);
+INSERT INTO mtb_country (id, name, rank) VALUES (418,'ラオス|ラオス人民民主共和国',237);
+INSERT INTO mtb_country (id, name, rank) VALUES (428,'ラトビア',238);
+INSERT INTO mtb_country (id, name, rank) VALUES (440,'リトアニア',239);
+INSERT INTO mtb_country (id, name, rank) VALUES (434,'リビア',240);
+INSERT INTO mtb_country (id, name, rank) VALUES (438,'リヒテンシュタイン',241);
+INSERT INTO mtb_country (id, name, rank) VALUES (430,'リベリア',242);
+INSERT INTO mtb_country (id, name, rank) VALUES (642,'ルーマニア',243);
+INSERT INTO mtb_country (id, name, rank) VALUES (442,'ルクセンブルク',244);
+INSERT INTO mtb_country (id, name, rank) VALUES (646,'ルワンダ',245);
+INSERT INTO mtb_country (id, name, rank) VALUES (426,'レソト',246);
+INSERT INTO mtb_country (id, name, rank) VALUES (422,'レバノン',247);
+INSERT INTO mtb_country (id, name, rank) VALUES (638,'レユニオン',248);
+INSERT INTO mtb_country (id, name, rank) VALUES (643,'ロシア|ロシア連邦',249);
Index: branches/version-2_13-dev/html/install/sql/create_table_mysql.sql
===================================================================
--- branches/version-2_13-dev/html/install/sql/create_table_mysql.sql	(revision 22218)
+++ branches/version-2_13-dev/html/install/sql/create_table_mysql.sql	(revision 22736)
@@ -74,4 +74,5 @@
     zip01 text,
     zip02 text,
+    country_id int,
     pref smallint,
     addr01 text,
@@ -88,4 +89,5 @@
     law_zip01 text,
     law_zip02 text,
+    law_country_id int,
     law_pref smallint,
     law_addr01 text,
@@ -109,6 +111,4 @@
     law_term09 text,
     law_term10 text,
-    tax numeric NOT NULL DEFAULT 5,
-    tax_rule smallint NOT NULL DEFAULT 1,
     email01 text,
     email02 text,
@@ -485,4 +485,5 @@
     zip01 text,
     zip02 text,
+    country_id int,
     pref smallint,
     addr01 text,
@@ -538,4 +539,5 @@
     order_zip01 text,
     order_zip02 text,
+    order_country_id int,
     order_pref smallint,
     order_addr01 text,
@@ -597,4 +599,5 @@
     order_zip01 text,
     order_zip02 text,
+    order_country_id int,
     order_pref smallint,
     order_addr01 text,
@@ -655,4 +658,5 @@
     shipping_fax02 text,
     shipping_fax03 text,
+    shipping_country_id int,
     shipping_pref smallint,
     shipping_zip01 text,
@@ -694,4 +698,5 @@
     zip01 text,
     zip02 text,
+    country_id int,
     pref smallint,
     addr01 text,
@@ -1100,4 +1105,11 @@
     name text,
     rank smallint NOT NULL,
+    PRIMARY KEY (id)
+);
+
+CREATE TABLE mtb_country (
+    id int,
+    name text,
+    rank int NOT NULL,
     PRIMARY KEY (id)
 );
@@ -1204,4 +1216,20 @@
 );
 
+CREATE TABLE dtb_tax_rule (
+    tax_rule_id int NOT NULL,
+    country_id int NOT NULL DEFAULT 0,
+    pref_id int NOT NULL DEFAULT 0,
+    product_id int NOT NULL DEFAULT 0,
+    product_class_id int NOT NULL DEFAULT 0,
+    calc_rule smallint NOT NULL DEFAULT 1,
+    tax_rate numeric NOT NULL DEFAULT 5,
+    tax_adjust numeric NOT NULL DEFAULT 0,
+    apply_date timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
+	member_id int NOT NULL,
+    del_flg smallint NOT NULL DEFAULT 0,
+    create_date timestamp NOT NULL,
+    update_date timestamp NOT NULL,
+    PRIMARY KEY (tax_rule_id)
+);
 
 CREATE INDEX dtb_customer_mobile_phone_id_key ON dtb_customer (mobile_phone_id(255));
Index: branches/version-2_13-dev/html/install/sql/create_table_pgsql.sql
===================================================================
--- branches/version-2_13-dev/html/install/sql/create_table_pgsql.sql	(revision 22218)
+++ branches/version-2_13-dev/html/install/sql/create_table_pgsql.sql	(revision 22736)
@@ -74,4 +74,5 @@
     zip01 text,
     zip02 text,
+    country_id int,
     pref smallint,
     addr01 text,
@@ -88,4 +89,5 @@
     law_zip01 text,
     law_zip02 text,
+    law_country_id int,
     law_pref smallint,
     law_addr01 text,
@@ -109,6 +111,4 @@
     law_term09 text,
     law_term10 text,
-    tax numeric NOT NULL DEFAULT 5,
-    tax_rule smallint NOT NULL DEFAULT 1,
     email01 text,
     email02 text,
@@ -485,4 +485,5 @@
     zip01 text,
     zip02 text,
+    country_id int,
     pref smallint,
     addr01 text,
@@ -538,4 +539,5 @@
     order_zip01 text,
     order_zip02 text,
+    order_country_id int,
     order_pref smallint,
     order_addr01 text,
@@ -597,4 +599,5 @@
     order_zip01 text,
     order_zip02 text,
+    order_country_id int,
     order_pref smallint,
     order_addr01 text,
@@ -655,4 +658,5 @@
     shipping_fax02 text,
     shipping_fax03 text,
+    shipping_country_id int,
     shipping_pref smallint,
     shipping_zip01 text,
@@ -694,4 +698,5 @@
     zip01 text,
     zip02 text,
+    country_id int,
     pref smallint,
     addr01 text,
@@ -1100,4 +1105,11 @@
     name text,
     rank smallint NOT NULL,
+    PRIMARY KEY (id)
+);
+
+CREATE TABLE mtb_country (
+    id int,
+    name text,
+    rank int NOT NULL,
     PRIMARY KEY (id)
 );
@@ -1204,4 +1216,20 @@
 );
 
+CREATE TABLE dtb_tax_rule (
+    tax_rule_id int NOT NULL,
+    country_id int NOT NULL DEFAULT 0,
+    pref_id int NOT NULL DEFAULT 0,
+    product_id int NOT NULL DEFAULT 0,
+    product_class_id int NOT NULL DEFAULT 0,
+    calc_rule smallint NOT NULL DEFAULT 1,
+    tax_rate numeric NOT NULL DEFAULT 5,
+    tax_adjust numeric NOT NULL DEFAULT 0,
+    apply_date timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
+	member_id int NOT NULL,
+    del_flg smallint NOT NULL DEFAULT 0,
+    create_date timestamp NOT NULL,
+    update_date timestamp NOT NULL,
+    PRIMARY KEY (tax_rule_id)
+);
 
 CREATE INDEX dtb_customer_mobile_phone_id_key ON dtb_customer (mobile_phone_id);
Index: branches/version-2_13-dev/html/admin/basis/tax.php
===================================================================
--- branches/version-2_13-dev/html/admin/basis/tax.php	(revision 22736)
+++ branches/version-2_13-dev/html/admin/basis/tax.php	(revision 22736)
@@ -0,0 +1,34 @@
+<?php
+/*
+ * This file is part of EC-CUBE
+ *
+ * Copyright(c) 2000-2013 LOCKON CO.,LTD. All Rights Reserved.
+ *
+ * http://www.lockon.co.jp/
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+ */
+
+// {{{ requires
+require_once '../require.php';
+require_once CLASS_EX_REALDIR . 'page_extends/admin/basis/LC_Page_Admin_Basis_Tax_Ex.php';
+
+// }}}
+// {{{ generate page
+
+$objPage = new LC_Page_Admin_Basis_Tax_Ex();
+register_shutdown_function(array($objPage, 'destroy'));
+$objPage->init();
+$objPage->process();
Index: branches/version-2_13-dev/data/class/SC_Product.php
===================================================================
--- branches/version-2_13-dev/data/class/SC_Product.php	(revision 22593)
+++ branches/version-2_13-dev/data/class/SC_Product.php	(revision 22736)
@@ -29,5 +29,5 @@
  * @version $Id$
  */
-class SC_Product 
+class SC_Product
 {
 
@@ -304,10 +304,10 @@
                 $arrClassCats2['price01']
                     = strlen($arrProductsClass['price01'])
-                    ? number_format(SC_Helper_DB_Ex::sfCalcIncTax($arrProductsClass['price01']))
+                    ? number_format(SC_Helper_TaxRule_Ex::sfCalcIncTax($arrProductsClass['price01'], $productId, $arrProductsClass['product_class_id']))
                     : '';
 
                 $arrClassCats2['price02']
                     = strlen($arrProductsClass['price02'])
-                    ? number_format(SC_Helper_DB_Ex::sfCalcIncTax($arrProductsClass['price02']))
+                    ? number_format(SC_Helper_TaxRule_Ex::sfCalcIncTax($arrProductsClass['price02'], $productId, $arrProductsClass['product_class_id']))
                     : '';
 
@@ -611,8 +611,8 @@
     static function setIncTaxToProduct(&$arrProduct)
     {
-        $arrProduct['price01_min_inctax'] = isset($arrProduct['price01_min']) ? SC_Helper_DB_Ex::sfCalcIncTax($arrProduct['price01_min']) : null;
-        $arrProduct['price01_max_inctax'] = isset($arrProduct['price01_max']) ? SC_Helper_DB_Ex::sfCalcIncTax($arrProduct['price01_max']) : null;
-        $arrProduct['price02_min_inctax'] = isset($arrProduct['price02_min']) ? SC_Helper_DB_Ex::sfCalcIncTax($arrProduct['price02_min']) : null;
-        $arrProduct['price02_max_inctax'] = isset($arrProduct['price02_max']) ? SC_Helper_DB_Ex::sfCalcIncTax($arrProduct['price02_max']) : null;
+        $arrProduct['price01_min_inctax'] = isset($arrProduct['price01_min']) ? SC_Helper_TaxRule_Ex::sfCalcIncTax($arrProduct['price01_min'], $arrProduct['product_id']) : null;
+        $arrProduct['price01_max_inctax'] = isset($arrProduct['price01_max']) ? SC_Helper_TaxRule_Ex::sfCalcIncTax($arrProduct['price01_max'], $arrProduct['product_id']) : null;
+        $arrProduct['price02_min_inctax'] = isset($arrProduct['price02_min']) ? SC_Helper_TaxRule_Ex::sfCalcIncTax($arrProduct['price02_min'], $arrProduct['product_id']) : null;
+        $arrProduct['price02_max_inctax'] = isset($arrProduct['price02_max']) ? SC_Helper_TaxRule_Ex::sfCalcIncTax($arrProduct['price02_max'], $arrProduct['product_id']) : null;
     }
 
Index: branches/version-2_13-dev/data/class/util/SC_Utils.php
===================================================================
--- branches/version-2_13-dev/data/class/util/SC_Utils.php	(revision 22603)
+++ branches/version-2_13-dev/data/class/util/SC_Utils.php	(revision 22736)
@@ -274,4 +274,20 @@
     }
 
+    /* DB用日付日時文字列取得 */
+    function sfGetTimestampistime($year, $month, $day, $hour, $minutes, $last = false)
+    {
+        if ($year != '' && $month != '' && $day != '' && $hour != '' && $minutes != '') {
+            if ($last) {
+                $time = $hour.':'.$minutes.':59';
+            } else {
+                $time = $hour.':'.$minutes.':00';
+            }
+            $date = $year.'-'.$month.'-'.$day.' '.$time;
+        } else {
+            $date = '';
+        }
+        return $date;
+    }
+
     /**
      *  INT型の数値チェック
Index: branches/version-2_13-dev/data/class/pages/admin/basis/LC_Page_Admin_Basis_Tax.php
===================================================================
--- branches/version-2_13-dev/data/class/pages/admin/basis/LC_Page_Admin_Basis_Tax.php	(revision 22736)
+++ branches/version-2_13-dev/data/class/pages/admin/basis/LC_Page_Admin_Basis_Tax.php	(revision 22736)
@@ -0,0 +1,258 @@
+<?php
+/*
+ * This file is part of EC-CUBE
+ *
+ * Copyright(c) 2000-2013 LOCKON CO.,LTD. All Rights Reserved.
+ *
+ * http://www.lockon.co.jp/
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+ */
+
+// {{{ requires
+require_once CLASS_EX_REALDIR . 'page_extends/admin/LC_Page_Admin_Ex.php';
+
+/**
+ * 税金管理 のページクラス.
+ *
+ * @package Page
+ * @author LOCKON CO.,LTD.
+ * @version $Id: LC_Page_Admin_Basis_Tax_Ex.php 22567 2013-03-09 12:18:54Z yomoro $
+ */
+class LC_Page_Admin_Basis_Tax extends LC_Page_Admin_Ex 
+{
+
+    // {{{ properties
+
+    /** エラー情報 */
+    var $arrErr;
+
+    // }}}
+    // {{{ functions
+
+    /**
+     * Page を初期化する.
+     *
+     * @return void
+     */
+    function init()
+    {
+        parent::init();
+        $this->tpl_mainpage = 'basis/tax.tpl';
+        $this->tpl_subno = 'tax';
+        $this->tpl_mainno = 'basis';
+        $this->tpl_maintitle = '基本情報管理';
+        $this->tpl_subtitle = '税金管理';
+        $masterData = new SC_DB_MasterData_Ex();
+        $this->arrPref = $masterData->getMasterData('mtb_pref');
+        $this->arrTAXCALCRULE = $masterData->getMasterData('mtb_taxrule');
+
+        //適用時刻の項目値設定
+        $this->objDate = new SC_Date();
+        //適用時間の年を、「現在年~現在年＋2」の範囲に設定
+        for ($year=date("Y"); $year<=date("Y") + 2;$year++){
+            $arrYear[$year] = $year;
+        }
+        $this->arrYear = $arrYear;
+
+        for ($minutes=0; $minutes< 60; $minutes++){
+            $arrMinutes[$minutes] = $minutes;
+        }
+        $this->arrMinutes = $arrMinutes;
+
+    }
+
+    /**
+     * Page のプロセス.
+     *
+     * @return void
+     */
+    function process()
+    {
+        $this->action();
+        $this->sendResponse();
+    }
+
+    /**
+     * Page のアクション.
+     *
+     * @return void
+     */
+    function action()
+    {
+
+        $objTaxRule = new SC_Helper_TaxRule_Ex();
+        $objFormParam = new SC_FormParam_Ex();
+
+        // パラメーター情報の初期化
+        $this->lfInitParam($objFormParam);
+
+        // POST値をセット
+        $objFormParam->setParam($_POST);
+
+        // POST値の入力文字変換
+        $objFormParam->convParam();
+
+        //tax_rule_idを変数にセット
+        $tax_rule_id = $objFormParam->getValue('tax_rule_id');
+
+        // モードによる処理切り替え
+        switch ($this->getMode()) {
+
+            // 編集処理
+            case 'edit':
+                // エラーチェック
+                $this->arrErr = $this->lfCheckError($objFormParam, $objTaxRule);
+
+                if (count($this->arrErr) <= 0) {
+                    // POST値の引き継ぎ
+                    $arrParam = $objFormParam->getHashArray();
+                    // 登録実行
+                    $res_tax_rule_id = $this->doRegist($tax_rule_id, $arrParam, $objTaxRule);
+                    if ($res_tax_rule_id !== FALSE) {
+                        // 完了メッセージ
+                        $this->tpl_onload = "alert('登録が完了しました。');";
+                        // リロード
+                        SC_Response_Ex::reload();
+                    }
+                }
+
+                break;
+
+            // 編集前処理
+            case 'pre_edit':
+                $TaxRule = $objTaxRule->getTaxRuleData($tax_rule_id);
+
+                $tmp = explode(" ", $TaxRule['apply_date']);
+                $tmp_ymd = explode("-", $tmp[0]);
+                $TaxRule['apply_date_year'] = $tmp_ymd[0];
+                $TaxRule['apply_date_month'] = $tmp_ymd[1];
+                $TaxRule['apply_date_day'] = $tmp_ymd[2];
+                $tmp_hm = explode(":", $tmp[1]);
+                $TaxRule['apply_date_hour'] = $tmp_hm[0];
+                $TaxRule['apply_date_minutes'] = $tmp_hm[1];
+
+                $objFormParam->setParam($TaxRule);
+
+                // POSTデータを引き継ぐ
+                $this->tpl_tax_rule_id = $tax_rule_id;
+                break;
+
+            // 削除
+            case 'delete':
+                $objTaxRule->deleteTaxRuleData($tax_rule_id);
+
+                // リロード
+                SC_Response_Ex::reload();
+                break;
+
+            default:
+                break;
+        }
+
+        $this->arrForm = $objFormParam->getFormParamList();
+
+        // 税規約情報読み込み
+        $this->arrTaxrule = $objTaxRule->getTaxRuleList();
+
+    }
+
+    /**
+     * デストラクタ.
+     *
+     * @return void
+     */
+    function destroy()
+    {
+        parent::destroy();
+    }
+
+    /**
+     * パラメーター情報の初期化を行う.
+     *
+     * @param SC_FormParam $objFormParam SC_FormParam インスタンス
+     * @return void
+     */
+    function lfInitParam(&$objFormParam)
+    {
+        $objFormParam->addParam('税規約ID', 'tax_rule_id', INT_LEN, 'n', array('NUM_CHECK', 'MAX_LENGTH_CHECK'));
+        $objFormParam->addParam('消費税率', 'tax_rate', PERCENTAGE_LEN, 'n', array('EXIST_CHECK', 'NUM_CHECK', 'MAX_LENGTH_CHECK'));
+        $objFormParam->addParam('課税規則', 'calc_rule', PERCENTAGE_LEN, 'n', array('EXIST_CHECK', 'NUM_CHECK', 'MAX_LENGTH_CHECK'));
+        // 適用日時
+        $objFormParam->addParam('適用年', 'apply_date_year', INT_LEN, 'n', array('EXIST_CHECK', 'MAX_LENGTH_CHECK', 'NUM_CHECK'));
+        $objFormParam->addParam('適用月', 'apply_date_month', INT_LEN, 'n', array('EXIST_CHECK', 'MAX_LENGTH_CHECK', 'NUM_CHECK'));
+        $objFormParam->addParam('適用日', 'apply_date_day', INT_LEN, 'n', array('EXIST_CHECK', 'MAX_LENGTH_CHECK', 'NUM_CHECK'));
+        $objFormParam->addParam('適用時', 'apply_date_hour', INT_LEN, 'n', array('EXIST_CHECK', 'MAX_LENGTH_CHECK', 'NUM_CHECK'));
+        $objFormParam->addParam('適用分', 'apply_date_minutes', INT_LEN, 'n', array('EXIST_CHECK', 'MAX_LENGTH_CHECK', 'NUM_CHECK'));
+        $objFormParam->addParam('適用日時', 'apply_date_year', 'apply_date_month', 'apply_date_day', INT_LEN, 'n', array("CHECK_DATE"));
+
+    }
+
+    /**
+     * 登録処理を実行.
+     *
+     * @param integer $tax_rule_id
+     * @param array $sqlval
+     * @param object $objTaxRule
+     * @return multiple
+     */
+    function doRegist($tax_rule_id, $arrParam, SC_Helper_TaxRule_Ex $objTaxRule)
+    {
+        $apply_date = SC_Utils_Ex::sfGetTimestampistime($arrParam['apply_date_year'], sprintf("%02d",$arrParam['apply_date_month']), sprintf("%02d",$arrParam['apply_date_day']),sprintf("%02d",$arrParam['apply_date_hour']), sprintf("%02d",$arrParam['apply_date_minutes']));
+
+        $calc_rule = $arrParam['calc_rule'];
+        $tax_rate = $arrParam['tax_rate'];
+        return $objTaxRule->setTaxRule($calc_rule, $tax_rate, $apply_date, $tax_rule_id);
+    }
+
+    /**
+     * 入力エラーチェック.
+     *
+     * @return array $objErr->arrErr エラー内容
+     */
+    function lfCheckError(&$objFormParam, SC_Helper_TaxRule_Ex &$objTaxRule)
+    {
+
+        $arrErr = $objFormParam->checkError();
+        $arrForm = $objFormParam->getHashArray();
+
+        // tax_rule_id の正当性チェック
+        if (!empty($arrForm['tax_rule_id'])) {
+            if (!SC_Utils_Ex::sfIsInt($arrForm['tax_rule_id'])
+                || !$objTaxRule->getTaxRuleData($arrForm['tax_rule_id'])
+            ) {
+                // tax_rule_idが指定されていて、且つその値が不正と思われる場合はエラー
+                $arrErr['tax_rule_id'] = '※ 税規約IDが不正です<br />';
+            }
+        }
+
+        if ($arrForm['tax_rule_id'] != '0') {
+        $apply_date = SC_Utils_Ex::sfGetTimestampistime($arrForm['apply_date_year'], sprintf("%02d",$arrForm['apply_date_month']), sprintf("%02d",$arrForm['apply_date_day']),sprintf("%02d",$arrForm['apply_date_hour']), sprintf("%02d",$arrForm['apply_date_minutes']));
+
+        // 税規約情報読み込み
+        $arrTaxRuleByTime = $objTaxRule->getTaxRuleByTime($apply_date);
+        // 編集中のレコード以外に同じ消費税率、課税規則が存在する場合
+            if (
+                !SC_Utils_Ex::isBlank($arrTaxRuleByTime)
+                && $arrTaxRuleByTime['tax_rule_id'] != $arrForm['tax_rule_id']
+                && $arrTaxRuleByTime['apply_date'] == $apply_date
+            ) {
+                $arrErr['apply_date'] = '※ 既に同じ適用日時で登録が存在します。<br />';
+            }
+        }
+
+        return $arrErr;
+    }
+}
Index: branches/version-2_13-dev/data/class/pages/admin/basis/LC_Page_Admin_Basis.php
===================================================================
--- branches/version-2_13-dev/data/class/pages/admin/basis/LC_Page_Admin_Basis.php	(revision 22567)
+++ branches/version-2_13-dev/data/class/pages/admin/basis/LC_Page_Admin_Basis.php	(revision 22736)
@@ -179,6 +179,4 @@
 
         // その他
-        $objFormParam->addParam('消費税率', 'tax', PERCENTAGE_LEN, 'n', array('EXIST_CHECK', 'NUM_CHECK', 'MAX_LENGTH_CHECK'));
-        $objFormParam->addParam('課税規則 ', 'tax_rule', PERCENTAGE_LEN, 'n', array('EXIST_CHECK', 'NUM_CHECK', 'MAX_LENGTH_CHECK'));
         $objFormParam->addParam('送料無料条件', 'free_rule', PRICE_LEN, 'n', array('NUM_CHECK', 'MAX_LENGTH_CHECK'));
         $objFormParam->addParam('店舗営業時間', 'business_hour', STEXT_LEN, 'KVa', array('MAX_LENGTH_CHECK'));
Index: branches/version-2_13-dev/data/class/pages/admin/products/LC_Page_Admin_Products_ProductClass.php
===================================================================
--- branches/version-2_13-dev/data/class/pages/admin/products/LC_Page_Admin_Products_ProductClass.php	(revision 22567)
+++ branches/version-2_13-dev/data/class/pages/admin/products/LC_Page_Admin_Products_ProductClass.php	(revision 22736)
@@ -217,4 +217,5 @@
         $objFormParam->addParam(NORMAL_PRICE_TITLE, 'price01', PRICE_LEN, 'n', array('NUM_CHECK', 'MAX_LENGTH_CHECK'));
         $objFormParam->addParam(SALE_PRICE_TITLE, 'price02', PRICE_LEN, 'n', array('NUM_CHECK', 'MAX_LENGTH_CHECK'));
+        $objFormParam->addParam('消費税率', 'tax_rate', PERCENTAGE_LEN, 'n', array('NUM_CHECK', 'MAX_LENGTH_CHECK'));
         $objFormParam->addParam('商品種別', 'product_type_id', INT_LEN, 'n', array('MAX_LENGTH_CHECK', 'NUM_CHECK'));
         $objFormParam->addParam('削除フラグ', 'del_flg', INT_LEN, 'n', array('MAX_LENGTH_CHECK', 'NUM_CHECK'));
@@ -294,4 +295,7 @@
 
             $objQuery->insert('dtb_products_class', $arrPC);
+            
+            // 税情報登録/更新
+            SC_Helper_TaxRule_Ex::setTaxRuleForProduct($arrList['tax_rate'][$i], $arrPC['product_id'], $arrPC['product_class_id']);
         }
 
@@ -361,4 +365,11 @@
                 ) {
                     $arrErr['stock'][$i] = '※ 在庫数が入力されていません。<br />';
+                }
+                /*
+                 * 消費税率の必須チェック
+                 */
+                if (SC_Utils_Ex::isBlank($arrValues['tax_rate'][$i]))
+                {
+                    $arrErr['tax_rate'][$i] = '※ 消費税率が入力されていません。<br />';
                 }
                 /*
@@ -482,5 +493,5 @@
             'classcategory_name1', 'classcategory_name2', 'stock',
             'stock_unlimited', 'price01', 'price02',
-            'product_type_id', 'down_filename', 'down_realfilename', 'upload_index',
+            'product_type_id', 'down_filename', 'down_realfilename', 'upload_index', 'tax_rate'
         );
         $arrFormValues = $objFormParam->getSwapArray($arrKeys);
@@ -506,4 +517,8 @@
                     $arrValues['del_flg'] = '0';
                 }
+                // 消費税率を設定
+                $arrRet = SC_Helper_TaxRule_Ex::getTaxRule($arrValues['product_id'], $arrValues['product_class_id']);
+                $arrValues['tax_rate'] = $arrRet['tax_rate'];
+                
                 $arrMergeProductsClass[] = $arrValues;
             }
Index: branches/version-2_13-dev/data/class/pages/admin/products/LC_Page_Admin_Products_Product.php
===================================================================
--- branches/version-2_13-dev/data/class/pages/admin/products/LC_Page_Admin_Products_Product.php	(revision 22618)
+++ branches/version-2_13-dev/data/class/pages/admin/products/LC_Page_Admin_Products_Product.php	(revision 22736)
@@ -343,4 +343,5 @@
             $objFormParam->addParam(NORMAL_PRICE_TITLE, 'price01', PRICE_LEN, 'n', array('NUM_CHECK', 'MAX_LENGTH_CHECK'));
             $objFormParam->addParam(SALE_PRICE_TITLE, 'price02', PRICE_LEN, 'n', array('EXIST_CHECK', 'NUM_CHECK', 'MAX_LENGTH_CHECK'));
+            $objFormParam->addParam('消費税率', 'tax_rate', PERCENTAGE_LEN, 'n', array('EXIST_CHECK', 'NUM_CHECK', 'MAX_LENGTH_CHECK'));
             $objFormParam->addParam('在庫数', 'stock', AMOUNT_LEN, 'n', array('SPTAB_CHECK', 'NUM_CHECK', 'MAX_LENGTH_CHECK'));
             $objFormParam->addParam('在庫無制限', 'stock_unlimited', INT_LEN, 'n', array('SPTAB_CHECK', 'NUM_CHECK', 'MAX_LENGTH_CHECK'));
@@ -609,4 +610,11 @@
             $arrForm['product_type_id'] = DEFAULT_PRODUCT_DOWN;
         }
+        // 編集の場合は設定された税率、新規の場合はデフォルトの税率を取得
+        if ($arrForm['product_id'] == '') {
+            $arrRet = SC_Helper_TaxRule_Ex::getTaxRule();
+        } else {
+            $arrRet = SC_Helper_TaxRule_Ex::getTaxRule($arrForm['product_id'], $arrForm['product_class_id']);
+        }
+        $arrForm['tax_rate'] = $arrRet['tax_rate'];
         // アップロードファイル情報取得(Hidden用)
         $arrHidden = $objUpFile->getHiddenFileList();
@@ -1133,4 +1141,7 @@
         $objProduct = new SC_Product_Ex();
         $objProduct->setProductStatus($product_id, $arrList['product_status']);
+        
+        // 税情報設定
+        SC_Helper_TaxRule_Ex::setTaxRuleForProduct($arrList['tax_rate'], $arrList['product_id'], $arrList['product_class_id']);
 
         // 関連商品登録
Index: branches/version-2_13-dev/data/class/SC_CartSession.php
===================================================================
--- branches/version-2_13-dev/data/class/SC_CartSession.php	(revision 22567)
+++ branches/version-2_13-dev/data/class/SC_CartSession.php	(revision 22736)
@@ -28,5 +28,5 @@
  * @version $Id$
  */
-class SC_CartSession 
+class SC_CartSession
 {
     /** ユニークIDを指定する. */
@@ -127,5 +127,5 @@
                 $price = $this->cartSession[$productTypeId][$i]['price'];
                 $quantity = $this->cartSession[$productTypeId][$i]['quantity'];
-                $incTax = SC_Helper_DB_Ex::sfCalcIncTax($price);
+                $incTax = SC_Helper_TaxRule_Ex::sfCalcIncTax($price, 0, $id[0]);
                 $total = $incTax * $quantity;
                 return $total;
@@ -194,5 +194,7 @@
             $quantity = $this->cartSession[$productTypeId][$i]['quantity'];
 
-            $incTax = SC_Helper_DB_Ex::sfCalcIncTax($price);
+            $incTax = SC_Helper_TaxRule_Ex::sfCalcIncTax($price,
+                $this->cartSession[$productTypeId][$i]['productsClass']['product_id'],
+                $this->cartSession[$productTypeId][$i]['id'][0]);
             $total+= ($incTax * $quantity);
         }
@@ -209,5 +211,7 @@
             $price = $this->cartSession[$productTypeId][$i]['price'];
             $quantity = $this->cartSession[$productTypeId][$i]['quantity'];
-            $tax = SC_Helper_DB_Ex::sfTax($price);
+            $tax = SC_Helper_TaxRule_Ex::sfTax($price,
+                $this->cartSession[$productTypeId][$i]['productsClass']['product_id'],
+                $this->cartSession[$productTypeId][$i]['id'][0]);
             $total+= ($tax * $quantity);
         }
@@ -374,7 +378,11 @@
 
                 $quantity = $this->cartSession[$productTypeId][$i]['quantity'];
-                $incTax = SC_Helper_DB_Ex::sfCalcIncTax($price);
+                $incTax = SC_Helper_TaxRule_Ex::sfCalcIncTax($price,
+                    $this->cartSession[$productTypeId][$i]['productsClass']['product_id'],
+                    $this->cartSession[$productTypeId][$i]['id'][0]);
+
                 $total = $incTax * $quantity;
 
+                $this->cartSession[$productTypeId][$i]['price_inctax'] = $incTax;
                 $this->cartSession[$productTypeId][$i]['total_inctax'] = $total;
 
@@ -571,5 +579,7 @@
                     if ($limit > 0) {
                         $this->setProductValue($arrItem['id'], 'quantity', $limit, $productTypeId);
-                        $total_inctax = SC_Helper_DB_Ex::sfCalcIncTax($arrItem['price']) * $limit;
+                        $total_inctax = $limit * SC_Helper_TaxRule_Ex::sfCalcIncTax($arrItem['price'],
+                            $product['product_id'],
+                            $arrItem['id'][0]);
                         $this->setProductValue($arrItem['id'], 'total_inctax', $total_inctax, $productTypeId);
                         $tpl_message .= '※「' . $product['name'] . '」は販売制限(または在庫が不足)しております。';
@@ -652,7 +662,7 @@
         $results['deliv_fee'] = 0;
 
-        $arrInfo = SC_Helper_DB_Ex::sfGetBasisData();
-        $results['order_tax_rate'] = $arrInfo['tax'];
-        $results['order_tax_rule'] = $arrInfo['tax_rule'];
+        $arrTaxInfo = SC_Helper_TaxRule_Ex::getTaxRule();
+        $results['order_tax_rate'] = $arrTaxInfo['tax_rate'];
+        $results['order_tax_rule'] = $arrTaxInfo['calc_rule'];
 
         // 商品ごとの送料を加算
Index: branches/version-2_13-dev/data/class/helper/SC_Helper_Customer.php
===================================================================
--- branches/version-2_13-dev/data/class/helper/SC_Helper_Customer.php	(revision 22569)
+++ branches/version-2_13-dev/data/class/helper/SC_Helper_Customer.php	(revision 22736)
@@ -96,4 +96,7 @@
             }
         }
+        
+        //デフォルト国IDを追加
+        $arrData['country_id'] = DEFAULT_COUNTRY_ID;
 
         //-- 編集登録実行
Index: branches/version-2_13-dev/data/class/helper/SC_Helper_Purchase.php
===================================================================
--- branches/version-2_13-dev/data/class/helper/SC_Helper_Purchase.php	(revision 22568)
+++ branches/version-2_13-dev/data/class/helper/SC_Helper_Purchase.php	(revision 22736)
@@ -37,5 +37,5 @@
     var $arrShippingKey = array(
         'name01', 'name02', 'kana01', 'kana02',
-        'sex', 'zip01', 'zip02', 'pref', 'addr01', 'addr02',
+        'sex', 'zip01', 'zip02', 'country_id','pref', 'addr01', 'addr02',
         'tel01', 'tel02', 'tel03', 'fax01', 'fax02', 'fax03',
     );
@@ -289,4 +289,8 @@
         }
         $exists = $this->getOrderTemp($uniqId);
+        
+        //国ID追加
+        $sqlval['order_country_id'] = DEFAULT_COUNTRY_ID;
+        
         if (SC_Utils_Ex::isBlank($exists)) {
             $sqlval['order_temp_id'] = $uniqId;
@@ -466,5 +470,5 @@
     function copyFromCustomer(&$dest, &$objCustomer, $prefix = 'order',
         $keys = array('name01', 'name02', 'kana01', 'kana02',
-            'sex', 'zip01', 'zip02', 'pref', 'addr01', 'addr02',
+            'sex', 'zip01', 'zip02', 'country_id','pref', 'addr01', 'addr02',
             'tel01', 'tel02', 'tel03', 'fax01', 'fax02', 'fax03',
             'job', 'birth', 'email',
@@ -665,4 +669,9 @@
             $arrValues['create_date'] = 'CURRENT_TIMESTAMP';
             $arrValues['update_date'] = 'CURRENT_TIMESTAMP';
+            //国ID追加
+            /*いらないかもしれないんでとりあえずコメントアウト
+            $arrValues['shipping_country_id'] = DEFAULT_COUNTRY_ID;
+            */
+
             $objQuery->insert($table, $arrValues);
         }
Index: branches/version-2_13-dev/data/class/helper/SC_Helper_TaxRule.php
===================================================================
--- branches/version-2_13-dev/data/class/helper/SC_Helper_TaxRule.php	(revision 22736)
+++ branches/version-2_13-dev/data/class/helper/SC_Helper_TaxRule.php	(revision 22736)
@@ -0,0 +1,330 @@
+<?php
+/*
+ * This file is part of EC-CUBE
+ *
+ * Copyright(c) 2000-2013 LOCKON CO.,LTD. All Rights Reserved.
+ *
+ * http://www.lockon.co.jp/
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+ */
+
+/**
+ * 税規約を管理するヘルパークラス.
+ *
+ * @package Helper
+ * @author AMUAMU
+ * @version $Id:$
+ */
+class SC_Helper_TaxRule
+{
+
+    /**
+     * 設定情報に基づいて税金付与した金額を返す
+     *
+     * @param integer $price 計算対象の金額
+     * @return integer 税金付与した金額
+     */
+    function sfCalcIncTax($price, $product_id = 0, $product_class_id = 0, $pref_id =0, $country_id = 0)
+    {
+        return $price + SC_Helper_TaxRule_Ex::sfTax($price, $product_id, $product_class_id, $pref_id, $country_id);
+    }
+
+    /**
+     * 設定情報に基づいて税金の金額を返す
+     *
+     * @param integer $price 計算対象の金額
+     * @return integer 税金した金額
+     */
+    function sfTax($price, $product_id = 0, $product_class_id = 0, $pref_id =0, $country_id = 0)
+    {
+        $arrTaxRule = SC_Helper_TaxRule_Ex::getTaxRule($product_id, $product_class_id, $pref_id, $country_id);
+        return SC_Helper_TaxRule_Ex::calcTax($price, $arrTaxRule['tax_rate'], $arrTaxRule['tax_rule'], $arrTaxRule['tax_adjust']);
+    }
+
+    /**
+     * 設定情報IDに基づいて税金付与した金額を返す
+     * (受注データのようにルールが決まっている場合用)
+     *
+     * @param integer $price 計算対象の金額
+     * @return integer 税金付与した金額
+     */
+    function calcIncTaxFromRuleId($price, $tax_rule_id = 0)
+    {
+        return $price + SC_Helper_TaxRule_Ex::calcTaxFromRuleId($price, $tax_rule_id);
+    }
+
+    /**
+     * 設定情報IDに基づいて税金の金額を返す
+     * (受注データのようにルールが決まっている場合用)
+     *
+     * @param integer $price 計算対象の金額
+     * @return integer 税金した金額
+     */
+    function calcTaxFromRuleId($price, $tax_rule_id = 0)
+    {
+        $arrTaxRule = SC_Helper_TaxRule_Ex::getTaxRuleData($tax_rule_id);
+        return SC_Helper_TaxRule_Ex::calcTax($price, $arrTaxRule['tax_rate'], $arrTaxRule['tax_rule'], $arrTaxRule['tax_adjust']);
+    }
+
+    /**
+     * 税金額を計算する
+     *
+     * @param integer $price 計算対象の金額
+     * @param integer $tax 税率(%単位)
+     *     XXX integer のみか不明
+     * @param integer $tax_rule 端数処理
+     * @return integer 税金額
+     */
+    function calcTax ($price, $tax, $calc_rule, $tax_adjust = 0)
+    {
+        $real_tax = $tax / 100;
+        $ret = $price * $real_tax;
+        switch ($calc_rule) {
+            // 四捨五入
+            case 1:
+                $ret = round($ret);
+                break;
+            // 切り捨て
+            case 2:
+                $ret = floor($ret);
+                break;
+            // 切り上げ
+            case 3:
+                $ret = ceil($ret);
+                break;
+            // デフォルト:切り上げ
+            default:
+                $ret = ceil($ret);
+                break;
+        }
+        return $ret + $tax_adjust;
+    }
+
+
+    /**
+     * 現在有効な税金設定情報を返す
+     *
+     * @param integer $price 計算対象の金額
+     * @return array 税設定情報
+     */
+    function getTaxRule ($product_id = 0, $product_class_id = 0, $pref_id = 0, $country_id = 0)
+    {
+        // 初期化
+        $product_id = $product_id > 0 ? $product_id : 0;
+        $product_class_id = $product_class_id > 0 ? $product_class_id : 0;
+        $pref_id = $pref_id > 0 ? $pref_id : 0;
+        $country_id = $country_id > 0 ? $country_id : 0;
+
+        $objCustomer = new SC_Customer_Ex();
+        if ($objCustomer->isLoginSuccess(true)) {
+            if ($country_id == 0) {
+                $objCustomer->getValue('country_id');
+            }
+            if ($pref_id == 0) {
+                $objCustomer->getValue('pref');
+            }
+        }
+
+        // リクエストの配列化
+        $arrRequest = array('product_id' => $product_id,
+                        'product_class_id' => $product_class_id,
+                        'pref_id' => $pref_id,
+                        'country_id' => $country_id);
+
+        // 地域設定を優先するが、システムパラメーターなどに設定を持っていくか
+        // 後に書いてあるほど優先される、詳細後述MEMO参照
+        $arrPriorityKeys = array('product_id', 'product_class_id', 'pref_id', 'country_id');    // TODO: パラメーター設定に持っていく
+        $cache_key = "$product_id,$product_class_id,$pref_id,$country_id";
+
+        // 複数回呼出があるのでキャッシュ化
+        static $data_c = array();
+
+        if (empty($data_c[$cache_key])) {
+            $arrRet = array();
+
+            // 条件に基づいて税の設定情報を取得
+            $objQuery =& SC_Query_Ex::getSingletonInstance();
+            $table = 'dtb_tax_rule';
+            $cols = '*, CASE WHEN apply_date IS NULL THEN 1 ELSE 0 END as nullorder';
+            $where = '((product_id = 0 OR product_id = ?)'
+                        . ' OR (product_class_id = 0 OR product_class_id = ?))'
+                        . ' AND (pref_id = 0 OR pref_id = ?)'
+                        . ' AND (country_id = 0 OR country_id = ?)'
+                        . ' AND (apply_date < CURRENT_TIMESTAMP OR apply_date IS NULL)'
+                        . ' AND del_flg = 0';
+
+            $arrVal = array($product_id, $product_class_id, $pref_id, $country_id);
+            $order = 'nullorder ASC, apply_date DESC';
+            $objQuery->setOrder($order);
+            $arrData = $objQuery->select($cols, $table, $where, $arrVal);
+            // 優先度付け
+            // MEMO: 税の設定は相反する設定を格納可能だが、その中で優先度を付けるため
+            //       キーの優先度により、利用する税設定を判断する
+            //       優先度が同等の場合、適用日付で判断する
+
+            // XXXX: ビット演算で優先順位を判断という雑な事してます。すいません
+            foreach ($arrData as $data_key => $data) {
+                $res = 0;
+                foreach ($arrPriorityKeys as $key_no => $key) {
+                    if ($arrRequest[$key] != 0 && $data[$key] == $arrRequest[$key]) {
+                        // 配列の数値添字を重みとして利用する
+                        $res += 1 << ($key_no + 1);
+                    }
+                }
+                $arrData[$data_key]['rank'] = $res;
+            }
+
+            // 優先順位が高いものを返却値として確定
+            // 適用日降順に並んでいるので、単に優先順位比較のみで格納判断可能
+            foreach ($arrData as $data) {
+                if (!isset($arrRet['rank']) || $arrRet['rank'] < $data['rank']) {
+                    // 優先度が高い場合, または空の場合
+                    $arrRet = $data;
+                }
+            }
+            $data_c[$cache_key] = $arrRet;
+        }
+
+        GC_Utils_Ex::gfPrintLog('tax_key=' . $cache_key . ' result_tax=' . print_r($data_c[$cache_key],true));
+        return $data_c[$cache_key];
+    }
+
+    /**
+     * 税金設定情報を登録する（商品管理用）
+     *
+     * @param decimal $tax_rate 消費税率
+     * @param integer $product_id 商品ID
+     * @param integer $product_class_id 商品規格ID
+     * @param decimal $tax_adjust 消費税加算額
+     * @param integer $pref_id 県ID
+     * @param integer $country_id 国ID
+     * @return void
+     */
+    function setTaxRuleForProduct($tax_rate, $product_id = 0, $product_class_id = 0, $tax_adjust=0, $pref_id = 0, $country_id = 0)
+    {
+        // 基本設定を取得
+        $arrRet = SC_Helper_taxRule_Ex::getTaxRule();
+        // 基本設定の消費税率と一緒であれば設定しない
+        if( $arrRet['tax_rate'] != $tax_rate ) {
+            // 課税規則は基本設定のものを使用
+            $calc_rule = $arrRet['calc_rule'];
+            // 税情報を設定
+            SC_Helper_TaxRule_Ex::setTaxRule($calc_rule, $tax_rate, $apply_date, $tax_rule_id=NULL, $tax_adjust=0, $product_id, $product_class_id, $pref_id, $country_id);
+
+        }
+    }
+
+    /**
+     * 税金設定情報を登録する（仮）リファクタする（memo：規格設定後に商品編集を行うと消費税が0になるのを対応が必要）
+     *
+     * @param
+     * @return
+     */
+    function setTaxRule($calc_rule, $tax_rate, $apply_date, $tax_rule_id=NULL, $tax_adjust=0, $product_id = 0, $product_class_id = 0, $pref_id = 0, $country_id = 0)
+    {
+        $table = 'dtb_tax_rule';
+        $arrValues = array();
+        $arrValues['calc_rule'] = $calc_rule;
+        $arrValues['tax_rate'] = $tax_rate;
+        $arrValues['tax_adjust'] = $tax_adjust;
+        $arrValues['apply_date'] = $apply_date;
+        $arrValues['member_id'] = $_SESSION['member_id'];
+        $arrValues['update_date'] = 'CURRENT_TIMESTAMP';
+
+        // 新規か更新か？
+        $objQuery =& SC_Query_Ex::getSingletonInstance();
+        if($tax_rule_id == NULL && $product_id != 0 && $product_class_id != 0){
+            $where = 'product_id = ? AND product_class_id= ? AND pref_id = ? AND country_id = ?';
+            $arrVal = array($product_id, $product_class_id, $pref_id, $country_id);
+            $arrCheck = $objQuery->getRow('*', 'dtb_tax_rule', $where, $arrVal);
+            $tax_rule_id = $arrCheck['tax_rule_id'];
+        }
+
+        if($tax_rule_id == NULL) {
+            // 税情報を新規
+            // INSERTの実行
+            $arrValues['tax_rule_id'] = $objQuery->nextVal('dtb_tax_rule_tax_rule_id');
+            $arrValues['country_id'] = $country_id;
+            $arrValues['pref_id'] = $pref_id;
+            $arrValues['product_id'] = $product_id;
+            $arrValues['product_class_id'] = $product_class_id;
+            $arrValues['create_date'] = 'CURRENT_TIMESTAMP';
+
+            $objQuery->insert($table, $arrValues);
+        } else {
+            // 税情報を更新
+            $where = 'tax_rule_id = ?';
+            $objQuery->update($table, $arrValues, $where, array($tax_rule_id));
+        }
+    }
+
+
+    function getTaxRuleList($has_deleted = false)
+    {
+        $objQuery =& SC_Query_Ex::getSingletonInstance();
+        $col = 'tax_rule_id, tax_rate, calc_rule, apply_date';
+        $where = '';
+        if (!$has_deleted) {
+            $where .= 'del_flg = 0 AND product_id = 0 AND product_class_id = 0';
+        }
+        $table = 'dtb_tax_rule';
+		// 適用日時順に更新
+        $objQuery->setOrder('apply_date DESC');
+        $arrRet = $objQuery->select($col, $table, $where);
+        return $arrRet;
+
+    }
+
+    function getTaxRuleData($tax_rule_id, $has_deleted = false)
+    {
+        $objQuery =& SC_Query_Ex::getSingletonInstance();
+        $where = 'tax_rule_id = ?';
+        if (!$has_deleted) {
+            $where .= ' AND del_flg = 0';
+        }
+        return $objQuery->getRow('*', 'dtb_tax_rule', $where, array($tax_rule_id));
+    }
+
+
+
+    function getTaxRuleByTime($apply_date, $has_deleted = false)
+    {
+        $objQuery =& SC_Query_Ex::getSingletonInstance();
+        $where = 'apply_date = ?';
+        if (!$has_deleted) {
+            $where .= ' AND del_flg = 0';
+        }
+        $arrRet = $objQuery->select('*', 'dtb_tax_rule', $where, array($apply_date));
+        return $arrRet[0];
+    }
+
+    /**
+     * 税規約の削除.
+     *
+     * @param integer $tax_rule_id 税規約ID
+     * @return void
+     */
+    function deleteTaxRuleData($tax_rule_id)
+    {
+        $objQuery =& SC_Query_Ex::getSingletonInstance();
+
+        $sqlval = array();
+        $sqlval['del_flg']     = 1;
+        $sqlval['update_date'] = 'CURRENT_TIMESTAMP';
+        $where = 'tax_rule_id = ?';
+        $objQuery->update('dtb_tax_rule', $sqlval, $where, array($tax_rule_id));
+    }
+}
Index: branches/version-2_13-dev/data/Smarty/templates/default/cart/index.tpl
===================================================================
--- branches/version-2_13-dev/data/Smarty/templates/default/cart/index.tpl	(revision 22608)
+++ branches/version-2_13-dev/data/Smarty/templates/default/cart/index.tpl	(revision 22736)
@@ -133,5 +133,5 @@
                                     </td>
                                     <td class="alignR">
-                                        <!--{$item.price|sfCalcIncTax|number_format|h}-->円
+                                        <!--{$item.price_inctax|number_format|h}-->円
                                     </td>
                                     <td class="alignC"><!--{$item.quantity|h}-->
Index: branches/version-2_13-dev/data/Smarty/templates/admin/products/product_class.tpl
===================================================================
--- branches/version-2_13-dev/data/Smarty/templates/admin/products/product_class.tpl	(revision 22571)
+++ branches/version-2_13-dev/data/Smarty/templates/admin/products/product_class.tpl	(revision 22736)
@@ -201,4 +201,5 @@
             <th><!--{$smarty.const.NORMAL_PRICE_TITLE}-->(円)</th>
             <th><!--{$smarty.const.SALE_PRICE_TITLE}-->(円)<span class="attention">*</span></th>
+            <th>消費税率(%)<span class="attention">*</span></th>
             <th>商品種別<span class="attention">*</span></th>
             <th>ダウンロード<br />ファイル名<span class="red"><br />上限<!--{$smarty.const.STEXT_LEN}-->文字</span></th>
@@ -270,4 +271,11 @@
                     <!--{/if}-->
                     <input type="text" name="<!--{$key}-->[<!--{$index}-->]" value="<!--{$arrForm[$key].value[$index]|h}-->" size="6" class="box6" maxlength="<!--{$arrForm[$key].length}-->" <!--{if $arrErr[$key][$index] != ""}--><!--{sfSetErrorStyle}--><!--{/if}--> id="<!--{$key}-->_<!--{$index}-->" />
+                </td>
+                <td class="center">
+                    <!--{assign var=key value="tax_rate"}-->
+                    <!--{if $arrErr[$key][$index]}-->
+                        <span class="attention"><!--{$arrErr[$key][$index]}--></span>
+                    <!--{/if}-->
+                    <input type="text" name="<!--{$key}-->[<!--{$index}-->]" value="<!--{$arrForm[$key].value[$index]|h}-->" size="6" class="box6" maxlength="<!--{$arrForm[$key].length}-->" <!--{if $arrErr[$key][$index] != ""}--><!--{sfSetErrorStyle}--><!--{/if}--> id="<!--{$key}-->_<!--{$index}-->" />                
                 </td>
                 <td class="class-product-type">
Index: branches/version-2_13-dev/data/Smarty/templates/admin/products/product.tpl
===================================================================
--- branches/version-2_13-dev/data/Smarty/templates/admin/products/product.tpl	(revision 22618)
+++ branches/version-2_13-dev/data/Smarty/templates/admin/products/product.tpl	(revision 22736)
@@ -199,4 +199,12 @@
         </tr>
         <tr>
+            <th>消費税率<span class="attention"> *</span></th>
+            <td>
+                <span class="attention"><!--{$arrErr.tax_rate}--></span>
+                <input type="text" name="tax_rate" value="<!--{$arrForm.tax_rate|h}-->" size="6" class="box6" maxlength="<!--{$smarty.const.PERCENTAGE_LEN}-->" style="<!--{if $arrErr.tax_rate != ""}-->background-color: <!--{$smarty.const.ERR_COLOR}-->;<!--{/if}-->"/>%
+                <span class="attention">(半角数字で入力)</span>
+            </td>
+        </tr>
+        <tr>
             <th>在庫数<span class="attention"> *</span></th>
             <td>
Index: branches/version-2_13-dev/data/Smarty/templates/admin/products/product_class_confirm.tpl
===================================================================
--- branches/version-2_13-dev/data/Smarty/templates/admin/products/product_class_confirm.tpl	(revision 22206)
+++ branches/version-2_13-dev/data/Smarty/templates/admin/products/product_class_confirm.tpl	(revision 22736)
@@ -64,4 +64,5 @@
                 <th><!--{$smarty.const.NORMAL_PRICE_TITLE}-->(円)</th>
                 <th><!--{$smarty.const.SALE_PRICE_TITLE}-->(円)</th>
+                <th>消費税率(%)</th>
                 <th>商品種別</th>
                 <th>ダウンロードファイル名</th>
@@ -91,4 +92,6 @@
                         <td class="right"><!--{$arrForm[$key].value[$index]|h}--></td>
                         <!--{assign var=key value="price02"}-->
+                        <td class="right"><!--{$arrForm[$key].value[$index]|h}--></td>
+                        <!--{assign var=key value="tax_rate"}-->
                         <td class="right"><!--{$arrForm[$key].value[$index]|h}--></td>
                         <!--{assign var=key value="product_type_id"}-->
Index: branches/version-2_13-dev/data/Smarty/templates/admin/products/confirm.tpl
===================================================================
--- branches/version-2_13-dev/data/Smarty/templates/admin/products/confirm.tpl	(revision 22571)
+++ branches/version-2_13-dev/data/Smarty/templates/admin/products/confirm.tpl	(revision 22736)
@@ -123,4 +123,10 @@
             </tr>
             <tr>
+                <th>消費税率</th>
+                <td>
+                    <!--{if strlen($arrForm.tax_rate) >= 1}--><!--{$arrForm.tax_rate|h}--> %<!--{/if}-->
+                </td>
+            </tr>
+            <tr>
                 <th>在庫数</th>
                 <td>
Index: branches/version-2_13-dev/data/Smarty/templates/admin/basis/index.tpl
===================================================================
--- branches/version-2_13-dev/data/Smarty/templates/admin/basis/index.tpl	(revision 22477)
+++ branches/version-2_13-dev/data/Smarty/templates/admin/basis/index.tpl	(revision 22736)
@@ -276,18 +276,4 @@
     <table id="basis-index-func">
         <tr>
-            <th>消費税率<span class="attention"> *</span></th>
-            <td>
-                <span class="attention"><!--{$arrErr.tax}--></span>
-                <input type="text" name="tax" value="<!--{$arrForm.tax|h}-->" maxlength="<!--{$smarty.const.PERCENTAGE_LEN}-->" size="6" class="box6" style="<!--{if $arrErr.tax != ""}-->background-color: <!--{$smarty.const.ERR_COLOR}-->;<!--{/if}-->" /> ％
-            </td>
-        </tr>
-        <tr>
-            <th>課税規則<span class="attention"> *</span></th>
-            <td>
-                <span class="attention"><!--{$arrErr.tax_rule}--></span>
-                <!--{html_radios name="tax_rule" options=$arrTAXRULE selected=$arrForm.tax_rule}-->
-            </td>
-        </tr>
-        <tr>
             <th>送料無料条件</th>
             <td>
Index: branches/version-2_13-dev/data/Smarty/templates/admin/basis/subnavi.tpl
===================================================================
--- branches/version-2_13-dev/data/Smarty/templates/admin/basis/subnavi.tpl	(revision 22206)
+++ branches/version-2_13-dev/data/Smarty/templates/admin/basis/subnavi.tpl	(revision 22736)
@@ -34,3 +34,4 @@
 <li<!--{if $tpl_subno == 'zip_install'}--> class="on"<!--{/if}--> id="navi-basis-zip"><a href="<!--{$smarty.const.ROOT_URLPATH}--><!--{$smarty.const.ADMIN_DIR}-->basis/zip_install.php"><span>郵便番号DB登録</span></a></li>
 <li<!--{if $tpl_subno == 'holiday'}--> class="on"<!--{/if}--> id="navi-basis-holiday"><a href="<!--{$smarty.const.ROOT_URLPATH}--><!--{$smarty.const.ADMIN_DIR}-->basis/holiday.php"><span>定休日管理</span></a></li>
+<li<!--{if $tpl_subno == 'tax'}--> class="on"<!--{/if}--> id="navi-basis-tax"><a href="<!--{$smarty.const.ROOT_URLPATH}--><!--{$smarty.const.ADMIN_DIR}-->basis/tax.php"><span>税金管理</span></a></li>
 </ul>
Index: branches/version-2_13-dev/data/Smarty/templates/admin/basis/tax.tpl
===================================================================
--- branches/version-2_13-dev/data/Smarty/templates/admin/basis/tax.tpl	(revision 22736)
+++ branches/version-2_13-dev/data/Smarty/templates/admin/basis/tax.tpl	(revision 22736)
@@ -0,0 +1,126 @@
+<script type="text/javascript" src="<!--{$smarty.const.ROOT_URLPATH}-->js/jquery.fancybox/jquery.mousewheel-3.0.4.pack.js"></script>
+<script type="text/javascript" src="<!--{$smarty.const.ROOT_URLPATH}-->js/jquery.fancybox/jquery.fancybox-1.3.4.pack.js"></script>
+<link rel="stylesheet" href="<!--{$smarty.const.ROOT_URLPATH}-->js/jquery.fancybox/jquery.fancybox-1.3.4.css" type="text/css" media="screen" />
+
+<form name="form1" id="form1" method="post" action="?">
+<input type="hidden" name="<!--{$smarty.const.TRANSACTION_ID_NAME}-->" value="<!--{$transactionid}-->" />
+<input type="hidden" name="mode" value="edit" />
+<input type="hidden" name="tax_rule_id" value="<!--{$tpl_tax_rule_id}-->" />
+<!--{* ▼登録テーブルここから *}-->
+<div id="basis" class="contents-main">
+
+<h2>税金管理</h2>
+
+    <table id="basis-tax-func">
+        <tr>
+            <th>消費税率<span class="attention"> *</span></th>
+            <td>
+                <span class="attention"><!--{$arrErr.tax_rate}--></span>
+                <input type="text" name="tax_rate" value="<!--{$arrForm.tax_rate.value|h}-->" maxlength="<!--{$smarty.const.PERCENTAGE_LEN}-->" size="6" class="box6" style="<!--{if $arrErr.tax_rate != ""}-->background-color: <!--{$smarty.const.ERR_COLOR}-->;<!--{/if}-->" /> ％
+            </td>
+        </tr>
+        <tr>
+            <th>課税規則<span class="attention"> *</span></th>
+            <td>
+                <span class="attention"><!--{$arrErr.calc_rule}--></span>
+                <!--{html_radios name="calc_rule" options=$arrTAXCALCRULE selected=$arrForm.calc_rule.value}-->
+            </td>
+        </tr>
+        <!--{if $tpl_tax_rule_id != "0"}-->
+        <tr>
+            <th>適用日時<span class="attention"> *</span></th>
+            <td><span class="attention"><!--{$arrErr.apply_date}--></span>
+                <!--{assign var=key value="apply_date_year"}-->
+                <span class="attention"><!--{$arrErr[$key]}--></span>
+                <select name="<!--{$key}-->" <!--{if $arrErr[$key] != ""}--><!--{sfSetErrorStyle}--><!--{/if}--> >
+                <option value="" selected="selected">------</option>
+                <!--{html_options options=$arrYear selected=$arrForm[$key].value|h}-->
+                </select>年
+                <!--{assign var=key value="apply_date_month"}-->
+                <span class="attention"><!--{$arrErr[$key]}--></span>
+                <select name="<!--{$key}-->" <!--{if $arrErr[$key] != ""}--><!--{sfSetErrorStyle}--><!--{/if}--> >
+                <option value="" selected="selected">----</option>
+                <!--{html_options options=$objDate->getMonth() selected=$arrForm[$key].value|h}-->
+                </select>月
+                <!--{assign var=key value="apply_date_day"}-->
+                <span class="attention"><!--{$arrErr[$key]}--></span>
+                <select name="<!--{$key}-->" <!--{if $arrErr[$key] != ""}--><!--{sfSetErrorStyle}--><!--{/if}--> >
+                <option value="" selected="selected">----</option>
+                <!--{html_options options=$objDate->getDay() selected=$arrForm[$key].value|h}-->
+                </select>日
+                <!--{assign var=key value="apply_date_hour"}-->
+                <span class="attention"><!--{$arrErr[$key]}--></span>
+                <select name="<!--{$key}-->" <!--{if $arrErr[$key] != ""}--><!--{sfSetErrorStyle}--><!--{/if}--> >
+                <option value="" selected="selected">----</option>
+                <!--{html_options options=$objDate->getHour() selected=$arrForm[$key].value|h}-->
+                </select>時
+                <!--{assign var=key value="apply_date_minutes"}-->
+                <span class="attention"><!--{$arrErr[$key]}--></span>
+                <select name="<!--{$key}-->" <!--{if $arrErr[$key] != ""}--><!--{sfSetErrorStyle}--><!--{/if}--> >
+                <option value="" selected="selected">----</option>
+                <!--{html_options options=$arrMinutes selected=$arrForm[$key].value|h}-->
+                </select>分
+            </td>
+        </tr>
+        <!--{else}-->
+        <input type="hidden" name="apply_date_year" value="<!--{$arrForm.apply_date_year.value|h}-->" />
+        <input type="hidden" name="apply_date_month" value="<!--{$arrForm.apply_date_month.value|h}-->" />
+        <input type="hidden" name="apply_date_day" value="<!--{$arrForm.apply_date_day.value|h}-->" />
+        <input type="hidden" name="apply_date_hour" value="<!--{$arrForm.apply_date_hour.value|h}-->" />
+        <input type="hidden" name="apply_date_minutes" value="<!--{$arrForm.apply_date_minutes.value|h}-->" />
+        <!--{/if}-->
+    </table>
+
+    <div class="btn-area">
+        <ul>
+            <li><a class="btn-action" href="javascript:;" onclick="fnFormModeSubmit('form1', 'edit', '', ''); return false;"><span class="btn-next">この内容で登録する</span></a></li>
+        </ul>
+    </div>
+    <!--{if count($arrTaxrule) > 0}-->
+    <table class="list">
+        <col width="22%" />
+        <col width="23%" />
+        <col width="35%" />
+        <col width="10%" />
+        <col width="10%" />
+        <tr>
+            <th>消費税率</th>
+            <th>課税規則</th>
+            <th>適用日時</th>
+            <th class="edit">編集</th>
+            <th class="delete">削除</th>
+        </tr>
+        <!--{section name=cnt loop=$arrTaxrule}-->
+        <tr style="background:<!--{if $tpl_tax_rule_id != $arrTaxrule[cnt].tax_rule_id}-->#ffffff<!--{else}--><!--{$smarty.const.SELECT_RGB}--><!--{/if}-->;">
+            <td class="center"><!--{$arrTaxrule[cnt].tax_rate|h}--></td>
+            <td class="center"><!--{assign var=calc_rule value=$arrTaxrule[cnt].calc_rule}-->
+                <!--{$arrTAXCALCRULE[$calc_rule]}--></td>
+            <td class="center">
+                <!--{if $arrTaxrule[cnt].tax_rule_id == 0}-->
+                基本税率設定
+                <!--{else}-->
+                <!--{$arrTaxrule[cnt].apply_date|h}-->
+                <!--{/if}-->
+            </td>
+            <td class="center">
+            <!--{if $tpl_tax_rule_id != $arrTaxrule[cnt].tax_rule_id}-->
+                <a href="?" onclick="fnModeSubmit('pre_edit', 'tax_rule_id', '<!--{$arrTaxrule[cnt].tax_rule_id}-->'); return false;">編集</a>
+            <!--{else}-->
+                編集中
+            <!--{/if}-->
+            </td>
+            <td class="center">
+            <!--{if $arrTaxrule[cnt].tax_rule_id == 0}-->
+                -
+            <!--{else}-->
+                <a href="?" onclick="fnModeSubmit('delete', 'tax_rule_id', '<!--{$arrTaxrule[cnt].tax_rule_id}-->'); return false;">削除</a>
+            <!--{/if}-->
+            </td>
+        </tr>
+        <!--{/section}-->
+    </table>
+    <!--{/if}-->
+</div>
+
+<!--{* ▲登録テーブルここまで *}-->
+</form>
Index: branches/version-2_13-dev/data/class_extends/helper_extends/SC_Helper_TaxRule_Ex.php
===================================================================
--- branches/version-2_13-dev/data/class_extends/helper_extends/SC_Helper_TaxRule_Ex.php	(revision 22736)
+++ branches/version-2_13-dev/data/class_extends/helper_extends/SC_Helper_TaxRule_Ex.php	(revision 22736)
@@ -0,0 +1,39 @@
+<?php
+/*
+ * This file is part of EC-CUBE
+ *
+ * Copyright(c) 2000-2013 LOCKON CO.,LTD. All Rights Reserved.
+ *
+ * http://www.lockon.co.jp/
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+ */
+
+// {{{ requires
+require_once CLASS_REALDIR . 'helper/SC_Helper_TaxRule.php';
+
+/**
+ * 税金計算を管理するヘルパークラス(拡張).
+ *
+ * LC_Helper_TaxRule をカスタマイズする場合はこのクラスを編集する.
+ *
+ * @package Helper
+ * @author AMUAMU
+ * @version $Id:$
+ */
+class SC_Helper_TaxRule_Ex extends SC_Helper_TaxRule
+{
+    //put your code here
+}
Index: branches/version-2_13-dev/data/class_extends/page_extends/admin/basis/LC_Page_Admin_Basis_Tax_Ex.php
===================================================================
--- branches/version-2_13-dev/data/class_extends/page_extends/admin/basis/LC_Page_Admin_Basis_Tax_Ex.php	(revision 22736)
+++ branches/version-2_13-dev/data/class_extends/page_extends/admin/basis/LC_Page_Admin_Basis_Tax_Ex.php	(revision 22736)
@@ -0,0 +1,71 @@
+<?php
+/*
+ * This file is part of EC-CUBE
+ *
+ * Copyright(c) 2000-2013 LOCKON CO.,LTD. All Rights Reserved.
+ *
+ * http://www.lockon.co.jp/
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+ */
+
+// {{{ requires
+require_once CLASS_REALDIR . 'pages/admin/basis/LC_Page_Admin_Basis_Tax.php';
+
+/**
+ * 税金管理 のページクラス(拡張).
+ *
+ * LC_Page_Admin_Basis_Tax をカスタマイズする場合はこのクラスを編集する.
+ *
+ * @package Page
+ * @author LOCKON CO.,LTD.
+ * @version $Id: LC_Page_Admin_Basis_Tax_Ex.php 22567 2013-03-09 12:18:54Z yomoro $
+ */
+class LC_Page_Admin_Basis_Tax_Ex extends LC_Page_Admin_Basis_Tax 
+{
+
+    // }}}
+    // {{{ functions
+
+    /**
+     * Page を初期化する.
+     *
+     * @return void
+     */
+    function init()
+    {
+        parent::init();
+    }
+
+    /**
+     * Page のプロセス.
+     *
+     * @return void
+     */
+    function process()
+    {
+        parent::process();
+    }
+
+    /**
+     * デストラクタ.
+     *
+     * @return void
+     */
+    function destroy()
+    {
+        parent::destroy();
+    }
+}
