Changeset 22638 for branches/camp/camp-2_13-tax
- Timestamp:
- 2013/03/09 18:44:36 (11 years ago)
- Location:
- branches/camp/camp-2_13-tax/data/class
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/camp/camp-2_13-tax/data/class/helper/SC_Helper_TaxRule.php
r22628 r22638 134 134 $objQuery->setOrder($order); 135 135 $arrData = $objQuery->select('*', $table, $where, $arrVal); 136 print_r($arrData); 136 137 // 日付や条件でこねて選択は、作り中。取りあえずスタブ的にデフォルトを返却 137 138 return $arrData[0]; 138 139 } 139 140 140 141 /** 142 * 税金設定情報を登録する(商品管理用) 143 * 144 * @param 145 * @return 146 */ 147 function setTaxRuleForProduct($tax_rate, $tax_adjust=0, $product_id = 0, $product_class_id = 0, $pref_id = 0, $country_id = 0) 148 { 149 // デフォルトの設定取得 150 $arrRet = SC_Helper_TaxRule_Ex::getTaxRule(); 151 // 税情報を設定 152 SC_Helper_TaxRule_Ex::setTaxRule($arrRet['calc_rule'], 153 $tax_rate, 154 $arrRet['apply_date'], 155 $tax_adjust, 156 $product_id, 157 $product_class_id, 158 $pref_id, 159 $country_id); 160 } 161 162 /** 163 * 税金設定情報を登録する(仮) 164 * 165 * @param 166 * @return 167 */ 168 function setTaxRule($calc_rule, $tax_rate, $apply_date, $tax_adjust=0, $product_id = 0, $product_class_id = 0, $pref_id = 0, $country_id = 0) 169 { 170 // デフォルトの設定とtax_rateの値が同じ場合は登録しない 171 $arrRet = SC_Helper_TaxRule_Ex::getTaxRule(); 172 if( $arrRet['tax_rate'] == $tax_rate ) { 173 return; 174 } 175 // 税情報を設定 176 $objQuery =& SC_Query_Ex::getSingletonInstance(); 177 $table = 'dtb_tax_rule'; 178 $arrValues = array(); 179 // todo idを計算して設定する必要あり 180 $arrValues['tax_rule_id'] = 1; 181 $arrValues['country_id'] = $country_id; 182 $arrValues['pref_id'] = $pref_id; 183 $arrValues['product_id'] = $product_id; 184 $arrValues['product_class_id'] = $product_class_id; 185 $arrValues['calc_rule'] = $calc_rule; 186 $arrValues['tax_rate'] = $tax_rate; 187 $arrValues['tax_adjust'] = $tax_adjust; 188 $arrValues['apply_date'] = $apply_date; 189 $arrValues['create_date'] = 'CURRENT_TIMESTAMP'; 190 $arrValues['update_date'] = 'CURRENT_TIMESTAMP'; 191 192 $objQuery->insert($table, $arrValues); 193 } 194 195 141 196 function getTaxRuleList($has_disable = false) 142 197 { -
branches/camp/camp-2_13-tax/data/class/pages/admin/products/LC_Page_Admin_Products_Product.php
r22578 r22638 343 343 $objFormParam->addParam(NORMAL_PRICE_TITLE, 'price01', PRICE_LEN, 'n', array('NUM_CHECK', 'MAX_LENGTH_CHECK')); 344 344 $objFormParam->addParam(SALE_PRICE_TITLE, 'price02', PRICE_LEN, 'n', array('EXIST_CHECK', 'NUM_CHECK', 'MAX_LENGTH_CHECK')); 345 $objFormParam->addParam('消費税率', 'tax_rate', PERCENTAGE_LEN, 'n', array('EXIST_CHECK', 'NUM_CHECK', 'MAX_LENGTH_CHECK')); 345 346 $objFormParam->addParam('在庫数', 'stock', AMOUNT_LEN, 'n', array('SPTAB_CHECK', 'NUM_CHECK', 'MAX_LENGTH_CHECK')); 346 347 $objFormParam->addParam('在庫無制限', 'stock_unlimited', INT_LEN, 'n', array('SPTAB_CHECK', 'NUM_CHECK', 'MAX_LENGTH_CHECK')); … … 608 609 $arrForm['product_type_id'] = DEFAULT_PRODUCT_DOWN; 609 610 } 611 // 編集の場合は設定された税率、新規の場合はデフォルトの税率を取得 612 if ($arrForm['product_id'] == '') { 613 $arrRet = SC_Helper_TaxRule_Ex::getTaxRule(); 614 } else { 615 $arrRet = SC_Helper_TaxRule_Ex::getTaxRule($arrForm['product_id'], $arrForm['product_class_id']); 616 } 617 $arrForm['tax_rate'] = $arrRet['tax_rate']; 610 618 // アップロードファイル情報取得(Hidden用) 611 619 $arrHidden = $objUpFile->getHiddenFileList(); … … 1132 1140 $objProduct = new SC_Product_Ex(); 1133 1141 $objProduct->setProductStatus($product_id, $arrList['product_status']); 1142 1143 // 税情報設定 1144 SC_Helper_TaxRule_Ex::setTaxRuleForProduct($arrList['tax_rate'], 0, $arrList['product_id'], $arrList['product_class_id']); 1134 1145 1135 1146 // 関連商品登録
Note: See TracChangeset
for help on using the changeset viewer.