Example #1
0
 public function Result_SearchUserGeneralRegisterFileCreate_registerFileCreateCondition($ankenId, $condition, $searchType)
 {
     //↑↑===========nm90073 2013/08/01 end=============
     $searchUserFileObject = new DataSearchUserFile();
     $loginId = $this->_core->getLoginLoginId();
     $searchUserFileObject->getField('anken_id')->setValue($ankenId);
     $searchUserFileObject->getField('parameter')->setValue($condition);
     //↓↓===========nm90073 2013/08/01 start===========
     $searchUserFileObject->getField('search_type')->setValue($searchType);
     //↑↑===========nm90073 2013/08/01 end=============
     $searchUserFileObject->getField('reg_user_id')->setValue($loginId);
     $now = date('Y-m-d H:i:s');
     $searchUserFileObject->getField('reg_time')->setValue($now);
     parent::insert($searchUserFileObject);
 }
Example #2
0
 /**
  * DB更新
  */
 public function Result_AdminReportSalesSalesEdit_update(&$newObjectArray, &$rawDetailArray, $status)
 {
     $db =& $this->_core->getDBForUpdate();
     //--------------------------
     // 案件別売上テーブル
     //--------------------------
     // 完了画面の表示に使うため、複製を利用
     $salesObject = clone $newObjectArray['sales'];
     $loginId = $this->_core->getLoginLoginId();
     $loginName = $this->_core->getLoginName();
     $now = date('Y-m-d H:i:s');
     // ステータスのフラグと変更者、変更時刻
     if ($status == ENUM_SALES_GENKA_REPORT_STATUS_INPUTTED) {
         $salesObject->getField('shime_upd_user_id')->setValue($loginId);
         $salesObject->getField('shime_upd_user_name')->setValue($loginName);
         $salesObject->getField('shime_upd_time')->setValue($now);
         $salesObject->getField('last_save_type')->setValue(ENUM_SALES_GENKA_REPORT_SAVE_TYPE_SAVE);
     } else {
         if ($status == ENUM_SALES_GENKA_REPORT_STATUS_FIXED) {
             $salesObject->getField('fixed_flg')->setValue('1');
             $salesObject->getField('fixed_user_id')->setValue($loginId);
             $salesObject->getField('fixed_user_name')->setValue($loginName);
             $salesObject->getField('fixed_time')->setValue($now);
             $salesObject->getField('status')->setValue(ENUM_SALES_GENKA_REPORT_STATUS_FIXED);
             // 表示用の売上データのステータスも更新
             $newObjectArray['sales']->getField('status')->setValue(ENUM_SALES_GENKA_REPORT_STATUS_FIXED);
         } else {
             if ($status == ENUM_SALES_GENKA_REPORT_STATUS_CANCEL_FIXED) {
                 $salesObject->getField('fixed_flg')->setValue('0');
                 $salesObject->getField('status')->setValue(ENUM_SALES_GENKA_REPORT_STATUS_INPUTTED);
                 // 表示用の売上データのステータスも更新
                 $newObjectArray['sales']->getField('status')->setValue(ENUM_SALES_GENKA_REPORT_STATUS_INPUTTED);
             }
         }
     }
     //--------------------------
     // DB更新の前にログを出力
     // 確定時は登録するデータ、それ以外は案件別売上IDをデータとして保存する
     // ↓ログ出力処理ここから
     //--------------------------
     // ステータス
     $enumStatus = new SalesGenkaReportStatusEnum();
     // ログ作成用のオブジェクトを作成
     $logObjectArray = array();
     if ($status == ENUM_SALES_GENKA_REPORT_STATUS_FIXED) {
         $logObjectArray['sales'] = clone $newObjectArray['sales'];
         foreach ($newObjectArray['detail_list'] as $newDetail) {
             $logObjectArray['detail_list'][] = clone $newDetail;
         }
     } else {
         $logObjectArray["anken_sales_id"] = $newObjectArray['sales']->getField('anken_sales_id')->getValue();
     }
     // ステータス情報
     $statusInfo = $enumStatus->getValue($status);
     // ステータスが入力中のときは保存種別も追加
     if ($status == ENUM_SALES_GENKA_REPORT_STATUS_INPUTTED) {
         // 最終保存ステータス
         $enumLastSaveStatus = new SalesGenkaReportSaveTypeEnum();
         $lastSaveStatus = $enumLastSaveStatus->getValue(ENUM_SALES_GENKA_REPORT_SAVE_TYPE_SAVE);
         $statusInfo .= "({$lastSaveStatus})";
     }
     // ログを出力
     $action = "売上更新";
     $data = $logObjectArray;
     $userId = $this->_core->getLoginLoginId();
     $userName = $this->_core->getLoginName();
     OperationHistory::writeOperationHistory($db, $action, $statusInfo, $data, $userId, $userName);
     unset($logObjectArray);
     //--------------------------
     // ↑ログ出力処理ここまで
     //--------------------------
     // 値に変更が無い場合でも更新日時が変更されるように設定
     $salesObject->getField('upd_time')->setValue($now);
     parent::update($salesObject);
     // 確定または保存ボタン押下時は売上明細を更新
     if ($status == ENUM_SALES_GENKA_REPORT_STATUS_INPUTTED || $status == ENUM_SALES_GENKA_REPORT_STATUS_FIXED) {
         //--------------------------
         // 案件別売上明細テーブルと請求発行確認テーブル
         // いったん該当する案件別売上IDに紐づくレコードをすべて削除して、
         // 新しくすべてのレコードを登録する
         //--------------------------
         // 明細の削除
         $onlyAffiliate = false;
         $this->Result_AdminReportSalesSalesEdit_deleteDetail($newObjectArray['sales']->getField('anken_sales_id')->getValue(), $onlyAffiliate, $db);
         // すべての明細レコードの登録
         foreach ($newObjectArray['detail_list'] as $detail) {
             // 完了画面の表示に使うため、複製を利用
             $detailClone = clone $detail;
             // 発行申請中、または発行確認済みの請求発行確認情報が存在する場合は取得
             $billIssue = new DataReportSalesSalesBillIssue();
             if ($detailClone->getField('bill_issue_status')->getValue() == ENUM_BILL_ISSUE_STATUS_APPLIED || $detailClone->getField('bill_issue_status')->getValue() == ENUM_BILL_ISSUE_STATUS_APPROVED) {
                 // 該当データをDataObjectにセット
                 $billIssue->getField('bill_issue_status')->setValue($detailClone->getField('bill_issue_status')->getValue());
                 $billIssue->getField('bill_issue_operation')->setValue($detailClone->getField('bill_issue_operation')->getValue());
                 $billIssue->getField('upd_user_id')->setValue($detailClone->getField('bill_issue_upd_user_id')->getValue());
                 $billIssue->getField('upd_time')->setValue($detailClone->getField('bill_issue_upd_time')->getValue());
             }
             //--------------------------
             // 案件別売上明細テーブル
             //--------------------------
             // 請求発行確認テーブルの項目を外す
             $detailClone->removeField('bill_issue_status');
             $detailClone->removeField('bill_issue_operation');
             $detailClone->removeField('bill_issue_upd_user_id');
             $detailClone->removeField('bill_issue_upd_time');
             parent::insert($detailClone);
             $ankenSalesDetailId = mysql_insert_id();
             //--------------------------
             // 請求発行確認テーブル
             //--------------------------
             // 請求発行確認情報が存在する場合は登録
             if (0 < $billIssue->getChangedCount()) {
                 // 上で登録した案件メディア企業別原価明細IDを設定
                 $billIssue->getField('anken_sales_detail_id')->setValue($ankenSalesDetailId);
                 parent::insert($billIssue);
             }
         }
         // 確定ボタン押下時は、生データから集計したデータをログとして保存する
         if ($status == ENUM_SALES_GENKA_REPORT_STATUS_FIXED) {
             // 明細ログの削除
             $this->Result_AdminReportSalesSalesEdit_deleteDetailLog($newObjectArray['sales']->getField('anken_sales_id')->getValue(), $db);
             foreach ($rawDetailArray as $rawDetail) {
                 // 完了画面の表示に使うため、複製を利用
                 $detailClone = clone $rawDetail;
                 //--------------------------
                 // 案件別売上明細ログテーブル
                 //--------------------------
                 parent::insert($detailClone);
             }
         }
     }
 }
Example #3
0
 /**
  * 情報からテキスト画面の値を取得し、プロパティに保存します。
  */
 public function setFormTextData(&$o)
 {
     parent::setFormTextData($o);
     $data =& $this->_formData['data'];
     // メディア
     $mediaId = $data['media_id'];
     $data['media_name'] = $this->Anken_PriceReserveEdit_getMediaName($mediaId);
 }