Ignore:
Timestamp:
2013/08/29 17:11:06 (11 years ago)
Author:
m_uehara
Message:

#2323
・税金設定の適用日の日付チェックを修正
・受注編集の税率に数値チェックを追加
・カートの税率取得処理を修正
・税規約IDのエラーメッセージ表示

Location:
branches/version-2_13_0/data
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • branches/version-2_13_0/data/Smarty/templates/admin/basis/tax.tpl

    r23103 r23157  
    3030 
    3131<h2>税率設定</h2> 
     32    <span class="attention"><!--{$arrErr.tax_rule_id}--></span> 
    3233 
    3334    <table id="basis-tax-func"> 
  • branches/version-2_13_0/data/Smarty/templates/mobile/cart/index.tpl

    r22766 r23157  
    5757                    <!--{* 規格名2 *}--><!--{if $item.productsClass.classcategory_name2 != ""}--><!--{$item.productsClass.class_name2|h}-->:<!--{$item.productsClass.classcategory_name2|h}--><br><!--{/if}--> 
    5858                    <!--{* 販売価格 *}--> 
    59                     <!--{$item.price|sfCalcIncTax|number_format}-->円 
     59                    <!--{$item.price_inctax|number_format}-->円 
    6060                    × <!--{$item.quantity}--><br> 
    6161                    <br> 
  • branches/version-2_13_0/data/Smarty/templates/sphone/cart/index.tpl

    r23126 r23157  
    117117                                                    <span class="mini"><!--{$arrItem.productsClass.class_name2}-->:<!--{$arrItem.productsClass.classcategory_name2}--></span><br /> 
    118118                                                <!--{/if}--> 
    119                                                 <span class="mini">価格:</span><!--{$arrItem.price|sfCalcIncTax|number_format}-->円 
     119                                                <span class="mini">価格:</span><!--{$arrItem.price_inctax|number_format}-->円 
    120120                                            </p> 
    121121                                            <p class="btn_delete"> 
  • branches/version-2_13_0/data/class/SC_CartSession.php

    r23126 r23157  
    171171            $incTax = SC_Helper_TaxRule_Ex::sfCalcIncTax($price, 
    172172                $this->cartSession[$productTypeId][$i]['productsClass']['product_id'], 
    173                 $this->cartSession[$productTypeId][$i]['id'][0], 
     173                $this->cartSession[$productTypeId][$i]['productsClass']['product_class_id'], 
    174174                $pref_id, $country_id); 
    175175 
     
    191191            $tax = SC_Helper_TaxRule_Ex::sfTax($price, 
    192192                $this->cartSession[$productTypeId][$i]['productsClass']['product_id'], 
    193                 $this->cartSession[$productTypeId][$i]['id'][0], 
     193                $this->cartSession[$productTypeId][$i]['productsClass']['product_class_id'], 
    194194                $pref_id, $country_id); 
    195195 
     
    416416                $arrTaxRule = SC_Helper_TaxRule_Ex::getTaxRule( 
    417417                                    $this->cartSession[$productTypeId][$i]['productsClass']['product_id'], 
    418                                     $this->cartSession[$productTypeId][$i]['id'][0], 
     418                                    $this->cartSession[$productTypeId][$i]['productsClass']['product_class_id'], 
    419419                                    $pref_id, 
    420420                                    $country_id); 
  • branches/version-2_13_0/data/class/helper/SC_Helper_TaxRule.php

    r23126 r23157  
    168168            $table = 'dtb_tax_rule'; 
    169169            $cols = '*'; 
    170             $where = '((product_id = 0 OR product_id = ?)' 
    171                         . ' OR (product_class_id = 0 OR product_class_id = ?))' 
    172                         . ' AND (pref_id = 0 OR pref_id = ?)' 
    173                         . ' AND (country_id = 0 OR country_id = ?)' 
    174                         . ' AND apply_date < CURRENT_TIMESTAMP' 
    175                         . ' AND del_flg = 0'; 
    176  
    177             $arrVal = array($product_id, $product_class_id, $pref_id, $country_id); 
     170             
     171            // 商品税率有無設定により分岐 
     172            if(OPTION_PRODUCT_TAX_RULE == 1) { 
     173                $where = '((product_id = 0 OR product_id = ?)' 
     174                            . ' OR (product_class_id = 0 OR product_class_id = ?))' 
     175                            . ' AND (pref_id = 0 OR pref_id = ?)' 
     176                            . ' AND (country_id = 0 OR country_id = ?)' 
     177                            . ' AND apply_date < CURRENT_TIMESTAMP' 
     178                            . ' AND del_flg = 0'; 
     179                $arrVal = array($product_id, $product_class_id, $pref_id, $country_id); 
     180            } else { 
     181                $where = '     product_id = 0 ' 
     182                       . ' AND product_class_id = 0 ' 
     183                       . ' AND (pref_id = 0 OR pref_id = ?)' 
     184                       . ' AND (country_id = 0 OR country_id = ?)' 
     185                       . ' AND apply_date < CURRENT_TIMESTAMP' 
     186                       . ' AND del_flg = 0'; 
     187                $arrVal = array($pref_id, $country_id); 
     188            } 
     189 
    178190            $order = 'apply_date DESC'; 
    179191            $objQuery->setOrder($order); 
  • branches/version-2_13_0/data/class/pages/admin/basis/LC_Page_Admin_Basis_Tax.php

    r23126 r23157  
    194194        $objFormParam->addParam('適用時', 'apply_date_hour', INT_LEN, 'n', array('EXIST_CHECK', 'MAX_LENGTH_CHECK', 'NUM_CHECK')); 
    195195        $objFormParam->addParam('適用分', 'apply_date_minutes', INT_LEN, 'n', array('EXIST_CHECK', 'MAX_LENGTH_CHECK', 'NUM_CHECK')); 
    196         $objFormParam->addParam('適用日時', 'apply_date_year', 'apply_date_month', 'apply_date_day', INT_LEN, 'n', array("CHECK_DATE")); 
    197196    } 
    198197 
     
    256255        $arrErr = $objFormParam->checkError(); 
    257256        $arrForm = $objFormParam->getHashArray(); 
     257        $objErr = new SC_CheckError_Ex($arrForm); 
    258258 
    259259        // tax_rule_id の正当性チェック 
     
    267267        } 
    268268 
    269         if ($arrForm['tax_rule_id'] != '0') { 
    270         $apply_date = SC_Utils_Ex::sfGetTimestampistime( 
    271                 $arrForm['apply_date_year'], 
    272                 sprintf("%02d", $arrForm['apply_date_month']), 
    273                 sprintf("%02d", $arrForm['apply_date_day']), 
    274                 sprintf("%02d", $arrForm['apply_date_hour']), 
    275                 sprintf("%02d", $arrForm['apply_date_minutes']) 
    276                 ); 
    277  
    278         // 税規約情報読み込み 
    279         $arrTaxRuleByTime = $objTaxRule->getTaxRuleByTime($apply_date); 
    280         // 編集中のレコード以外に同じ消費税率、課税規則が存在する場合 
     269        // 適用日時チェック 
     270        $objErr->doFunc(array('適用日時', 'apply_date_year', 'apply_date_month', 'apply_date_day'), array('CHECK_DATE')); 
     271        if (SC_Utils_Ex::isBlank($objErr->arrErr['apply_date_year']) && $arrForm['tax_rule_id'] != '0') { 
     272            $apply_date = SC_Utils_Ex::sfGetTimestampistime( 
     273                    $arrForm['apply_date_year'], 
     274                    sprintf("%02d", $arrForm['apply_date_month']), 
     275                    sprintf("%02d", $arrForm['apply_date_day']), 
     276                    sprintf("%02d", $arrForm['apply_date_hour']), 
     277                    sprintf("%02d", $arrForm['apply_date_minutes']) 
     278                    ); 
     279 
     280            // 税規約情報読み込み 
     281            $arrTaxRuleByTime = $objTaxRule->getTaxRuleByTime($apply_date); 
     282 
     283            // 編集中のレコード以外に同じ消費税率、課税規則が存在する場合 
    281284            if ( 
    282285                !SC_Utils_Ex::isBlank($arrTaxRuleByTime) 
     
    287290            } 
    288291        } 
     292        if (!SC_Utils_Ex::isBlank($objErr->arrErr)) { 
     293            $arrErr = array_merge($arrErr, $objErr->arrErr); 
     294        } 
    289295 
    290296        return $arrErr; 
  • branches/version-2_13_0/data/class/pages/admin/order/LC_Page_Admin_Order_Edit.php

    r23126 r23157  
    367367        $objFormParam->addParam('規格名1', 'classcategory_name1'); 
    368368        $objFormParam->addParam('規格名2', 'classcategory_name2'); 
    369         $objFormParam->addParam('税率', 'tax_rate'); 
    370         $objFormParam->addParam('課税規則', 'tax_rule'); 
     369        $objFormParam->addParam('税率', 'tax_rate', INT_LEN, 'n', array('NUM_CHECK')); 
     370        $objFormParam->addParam('課税規則', 'tax_rule', INT_LEN, 'n', array('NUM_CHECK')); 
    371371        $objFormParam->addParam('メモ', 'note', MTEXT_LEN, 'KVa', array('MAX_LENGTH_CHECK')); 
    372372        $objFormParam->addParam('削除用項番', 'delete_no', INT_LEN, 'n', array('MAX_LENGTH_CHECK', 'NUM_CHECK')); 
Note: See TracChangeset for help on using the changeset viewer.