Exemplo n.º 1
0
 public function actionActualReview($id)
 {
     /*TERM PLAN HEADER*/
     $searchModel = new TermheaderSearch();
     $dataProvider = $searchModel->searchcusbyid(Yii::$app->request->queryParams, $id);
     // $modelRslt=$dataProvider->getModels();
     $modelRslt = Termheader::find()->where(['TERM_ID' => $id])->one();
     /*BUDGET SEARCH*/
     $searchModelBudget = new TermdetailSearch();
     $dataProviderBudget = $searchModelBudget->searchbudget(Yii::$app->request->queryParams, $id);
     //*search */
     $paramCari = Yii::$app->getRequest()->getQueryParam('nomerfaktur');
     // if parent not equal null then search NOMER_FAKTURPAJAK
     if ($paramCari != '') {
         $cari = ['NOMER_FAKTURPAJAK' => $paramCari];
     } else {
         $cari = '';
     }
     $searchModelRdetail = new RtdetailSearch($cari);
     $dataProviderRdetail = $searchModelRdetail->search(Yii::$app->request->queryParams, $id);
     /*
      * Process Editable Row [Columm SQTY]
      * @author ptrnov  <*****@*****.**>
      * @since 1.1
      **/
     if (Yii::$app->request->post('hasEditable')) {
         $id = Yii::$app->request->post('editableKey');
         $model = Rtdetail::findOne($id);
         $out = Json::encode(['output' => '', 'message' => '']);
         $post = [];
         $posted = current($_POST['Rtdetail']);
         $post['Rtdetail'] = $posted;
         if ($model->load($post)) {
             $model->save();
             $output = '';
             if (isset($posted['PERIODE_START'])) {
                 $output = $model->PERIODE_START;
             }
             if (isset($posted['PERIODE_END'])) {
                 $output = $model->PERIODE_START;
             }
             if (isset($posted['STORE_ID'])) {
                 $output = $model->STORE_ID;
             }
             $out = Json::encode(['output' => $output, 'message' => '']);
         }
         // return ajax json encoded response and exit
         echo $out;
         return;
     }
     return $this->render('actual_review', ['dataProvider' => $dataProvider, 'model' => $modelRslt, 'dataProviderBudget' => $dataProviderBudget, 'dataProviderRdetail' => $dataProviderRdetail, 'searchModelRdetail' => $searchModelRdetail, 'data_toko' => self::aryData_cus(), 'data_invest' => self::aryData_invest()]);
     /*
      * NOTED VIEWS FILES:
      * review-> _reviewData  -> button [Actual Investment]  -> [contreoller]actionActualReview ->actual_review
      */
 }
Exemplo n.º 2
0
 public function actionExportDataInvestasi($id)
 {
     $searchModelExport = new RtdetailSearch();
     $dataProviderInvestasi = $searchModelExport->searchExportInvestasi(Yii::$app->request->queryParams, $id);
     $investasi = $dataProviderInvestasi->getModels();
     $data = ArrayHelper::toArray($investasi, ['lukisongroup\\purchasing\\models\\data_term\\Rtdetail' => ['PERIODE_START', 'PERIODE_END', 'nmcus', 'nminvest', 'hrga', 'PPN', 'PPH23', 'totals', 'INVESTASI_PROGRAM', 'NOMER_INVOCE', 'NOMER_FAKTURPAJAK']]);
     $excel_data = Postman4ExcelBehavior::excelDataFormat($data);
     $excel_title = $excel_data['excel_title'];
     $excel_ceils = $excel_data['excel_ceils'];
     $excel_content = [['sheet_name' => 'Investasi', 'sheet_title' => [['Periode Start', 'Periode end', 'Nama Toko', 'Nama Investasi', 'Harga', 'PPN', 'PPH23', 'TOTAL', 'Keterangan', 'Nomer Invoce', 'Nomer Faktur']], 'ceils' => $excel_ceils, 'freezePane' => 'A2', 'headerColor' => Postman4ExcelBehavior::getCssClass("header"), 'headerStyle' => [['PERIODE_START' => ['align' => 'center'], 'PERIODE_END' => ['align' => 'center'], 'nmcus' => ['align' => 'center'], 'nminvest' => ['align' => 'center'], 'HARGA' => ['align' => 'center'], 'PPN' => ['align' => 'center'], 'PPH23' => ['align' => 'center'], 'totals' => ['align' => 'center'], 'INVESTASI_PROGRAM' => ['align' => 'center'], 'NOMER_INVOCE' => ['align' => 'center'], 'NOMER_FAKTURPAJAK' => ['align' => 'center']]], 'contentStyle' => [['PERIODE_START' => ['align' => 'left'], 'PERIODE_END' => ['align' => 'left'], 'nmcus' => ['align' => 'center'], 'nminvest' => ['align' => 'center'], 'HARGA' => ['align' => 'center'], 'PPN' => ['align' => 'center'], 'PPH23' => ['align' => 'center'], 'totals' => ['align' => 'right'], 'INVESTASI_PROGRAM' => ['align' => 'center'], 'NOMER_INVOCE' => ['align' => 'center'], 'NOMER_FAKTURPAJAK' => ['align' => 'center']]], 'oddCssClass' => Postman4ExcelBehavior::getCssClass("odd"), 'evenCssClass' => Postman4ExcelBehavior::getCssClass("even")]];
     $excel_file = "Data Investasi";
     $this->export4excel($excel_content, $excel_file, 0);
 }
Exemplo n.º 3
0
    // $sql = "SELECT * FROM `t0001detail` ti
    // 			LEFT JOIN t0001header th on ti.KD_RIB = th.KD_RIB
    // 			LEFT JOIN c0006 c on ti.ID_INVEST = c.ID
    // 			WHERE ti.TERM_ID ='".$model->TERM_ID."'
    // 			AND ti.ID_INVEST ='".$model->INVES_ID."'
    // 			AND ti.STATUS = 102
    // 			AND (ti.KD_RIB LIKE 'RID%' OR ti.KD_RIB LIKE 'RI%')";
    // $sql = "SELECT c.INVES_TYPE,ti.PERIODE_START,ti.PERIODE_END,ti.PPN,ti.PPH23,ti.HARGA,ti.INVESTASI_PROGRAM FROM `t0001detail` ti
    // 			LEFT JOIN t0001header th on ti.KD_RIB = th.KD_RIB
    // 			LEFT JOIN c0006 c on ti.ID_INVEST = c.ID
    // 			WHERE ti.TERM_ID ='".$model->TERM_ID."'
    // 			AND ti.ID_INVEST ='".$model->INVES_ID."'
    // 			AND ti.STATUS = 102
    // 			AND (ti.KD_RIB LIKE 'RID%' OR ti.KD_RIB LIKE 'RI%')";
    // $hasil = $connect->createCommand($sql)->queryAll();
    $searchModel_inves = new RtdetailSearch();
    $dataProviderBudgetdetail_inves = $searchModel_inves->searchInvest(Yii::$app->request->queryParams, $model->TERM_ID, $model->INVES_ID);
    // $dataProviderBudgetdetail_inves = new ArrayDataProvider([
    // 		    'allModels' => $hasil,
    // 		    'pagination' => [
    // 		        'pageSize' => 10,
    // 		    ],
    // 		]);
    /* reviewDataexpandActual || budget_actual */
    $sql2 = "SELECT c.INVES_TYPE,ti.PERIODE_START,ti.PERIODE_END,ti.PPN,ti.PPH23,ti.HARGA FROM t0001detail ti\n\t\t\t\t\tLEFT JOIN c0006 c on ti.ID_INVEST = c.ID\n\t\t\t\t\tLEFT JOIN t0001header th on ti.KD_RIB = th.KD_RIB\n\t\t\t\t\tWHERE ti.TERM_ID ='" . $model->TERM_ID . "'\n\t\t\t\t\tAND ti.ID_INVEST ='" . $model->INVES_ID . "'\n\t\t\t\t\tAND ti.STATUS = 102\n\t\t\t\t\tAND (ti.KD_RIB LIKE 'RA%' OR ti.KD_RIB LIKE 'RB%')";
    $hasil1 = $connect->createCommand($sql2)->queryAll();
    $dataProviderBudgetdetail = new ArrayDataProvider(['allModels' => $hasil1, 'pagination' => ['pageSize' => 10]]);
    /*render*/
    return Yii::$app->controller->renderPartial('_reviewDataExpand', ['dataProviderBudgetdetail' => $dataProviderBudgetdetail, 'dataProviderBudgetdetail_inves' => $dataProviderBudgetdetail_inves, 'dataProviderBudget' => $dataProviderBudget, 'searchModel_inves' => $searchModel_inves, 'id' => $model->ID]);
}, 'headerOptions' => ['style' => ['text-align' => 'center', 'width' => '10px', 'font-family' => 'tahoma, arial, sans-serif', 'font-size' => '9pt', 'background-color' => 'rgba(74, 206, 231, 1)']], 'contentOptions' => ['style' => ['text-align' => 'center', 'width' => '10px', 'height' => '10px', 'font-family' => 'tahoma, arial, sans-serif', 'font-size' => '9pt', 'background-color' => 'rgba(231, 183, 108, 0.2)']]];
/*GRIDVIEW ARRAY ACTION*/