Changeset 19674


Ignore:
Timestamp:
2010/11/17 16:17:36 (13 years ago)
Author:
ToshiyaF
Message:

所持ポイント計算処理の修理
更新処理の度にポイントが不正に変更されてしまう。問題を解消。

従来の問題の原因は、オーダー修正時にポイントを購買前に戻すことをしていなかった為、ポイント利用顧客のオーダーを修正するたびに、所持ポイントから使用ポイントが減算され、最終的にポイントがマイナスになりレコードが更新できないなどの問題があった。

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/version-2_5-dev/data/class/pages/admin/order/LC_Page_Admin_Order_Edit.php

    r19670 r19674  
    426426            $arrRet = $objQuery->select("*", "dtb_order", $where, array($order_id)); 
    427427            $this->objFormParam->setParam($arrRet[0]); 
    428             list($point, $total_point) = $objDb->sfGetCustomerPoint($order_id, $arrRet[0]['use_point'], $arrRet[0]['add_point']); 
    429             $this->objFormParam->setValue('total_point', $total_point); 
    430             $this->objFormParam->setValue('point', $point); 
     428            list($db_point, $rollback_point) = $objDb->sfGetRollbackPoint($order_id, $arrRet[0]['use_point'], $arrRet[0]['add_point']); 
     429            $this->objFormParam->setValue('total_point', $db_point); 
     430            $this->objFormParam->setValue('point', $rollback_point); 
    431431            $this->arrForm = $arrRet[0]; 
    432432 
     
    505505        // 加算ポイント 
    506506        $arrVal['add_point'] = SC_Helper_DB_Ex::sfGetAddPoint($totalpoint, $arrVal['use_point']); 
    507  
    508         if (strlen($_POST['customer_id']) > 0){ 
    509             list($arrVal['point'], $arrVal['total_point']) = $objDb->sfGetCustomerPointFromCid($_POST['customer_id'], $arrVal['use_point'], $arrVal['add_point']); 
    510         }else{ 
    511             list($arrVal['point'], $arrVal['total_point']) = $objDb->sfGetCustomerPoint($_POST['order_id'], $arrVal['use_point'], $arrVal['add_point']); 
    512         } 
     507         
     508        // 最終保持ポイント 
     509        $arrVal['total_point'] = $this->objFormParam->getValue('point') - $arrVal['use_point'] + $arrVal['add_point']; 
     510         
    513511        if ($arrVal['total'] < 0) { 
    514512            $arrErr['total'] = '合計額がマイナス表示にならないように調整して下さい。<br />'; 
Note: See TracChangeset for help on using the changeset viewer.