Exemplo n.º 1
0
 public function initialize()
 {
     $thisMonth = DateTimeUtils::getNow(DateTimeUtils::FM_DEV_YM . '01 000000', DateTimeUtils::FM_DEV_DATETIME);
     DateTimeUtils::addDateTime($thisMonth, 'P1M', null, false);
     DateTimeUtils::subDateTime($thisMonth, 'P1D', null, false);
     $this->closing_date = $thisMonth->format(DateTimeUtils::FM_DB_DATETIME);
     $oTime = DateTimeUtils::getDateTimeFromDB($this->opening_date);
     $cTime = DateTimeUtils::getDateTimeFromDB($this->closing_date);
     $now = new \DateTime();
     $this->closing_diff = $cTime->diff($oTime)->days;
     $this->now_diff = $now->diff($oTime)->days;
     // calculate Closing Interest
     $this->closing_interest_unit = NumberUtils::getInterest($this->opening_balance, $this->term_interest_rate);
     $this->closing_interest = NumberUtils::rounds($this->closing_interest_unit * $this->closing_diff, NumberUtils::NUM_ROUND);
     $this->closing_balance = $this->opening_balance + $this->capital + $this->closing_interest;
     // calculate Interest of current date
     $this->now_interest_unit = NumberUtils::getInterest($this->opening_balance, $this->noterm_interest_rate);
     $delta = $this->now_diff - $this->closing_diff;
     if ($delta < 0) {
         $this->now_interest = NumberUtils::rounds($this->now_interest_unit * $this->now_diff, NumberUtils::NUM_ROUND);
     } else {
         $this->now_interest = $this->closing_interest + NumberUtils::getInterest($this->closing_balance, $this->noterm_interest_rate, NumberUtils::NUM_ROUND, $delta);
     }
     $this->now_balance = $this->opening_balance + $this->capital + $this->now_interest;
 }
Exemplo n.º 2
0
 public function actionAjaxchart()
 {
     // master value
     $fmShortDatePhp = DateTimeUtils::getDateFormat(DateTimeUtils::FM_KEY_PHP, null);
     $searchTradeDateFrom = isset($_POST['trade_date_from']) ? DateTimeUtils::parse($_POST['trade_date_from'], $fmShortDatePhp, DateTimeUtils::FM_DB_DATE) : false;
     $searchTradeDateTo = isset($_POST['trade_date_to']) ? DateTimeUtils::parse($_POST['trade_date_to'], $fmShortDatePhp, DateTimeUtils::FM_DB_DATE) : false;
     $searchMaxItemsChart = isset($_POST['max_items_chart']) ? $_POST['max_items_chart'] : 10;
     $dataQuery = OefNav::find()->where(['delete_flag' => MasterValueUtils::MV_FIN_FLG_DELETE_FALSE]);
     if (!empty($searchTradeDateFrom)) {
         $dataQuery->andWhere(['>=', 'trade_date', $searchTradeDateFrom]);
     }
     if (!empty($searchTradeDateTo)) {
         $dataQuery->andWhere(['<=', 'trade_date', $searchTradeDateTo]);
     }
     $dataQuery->orderBy('trade_date DESC')->limit($searchMaxItemsChart);
     $arrData = $dataQuery->all();
     $count = count($arrData);
     $arrDataChart = [];
     $arrDataChartAlias = [];
     $arrLabelChart = [];
     while ($count > 0) {
         $count--;
         $data = $arrData[$count];
         $arrDataChart[] = $data->nav_value;
         $arrDataChartAlias[] = NumberUtils::format($data->nav_value, 2);
         $arrLabelChart[] = DateTimeUtils::formatDateFromDB($data->trade_date, $fmShortDatePhp);
     }
     $renderData['chartData'] = count($arrDataChart) > 0 ? json_encode(['nav' => $arrDataChart, 'label' => $arrLabelChart, 'alias' => $arrDataChartAlias], JSON_NUMERIC_CHECK) : false;
     return $this->renderPartial('ajaxchart', $renderData);
 }
Exemplo n.º 3
0
 public function actionIndex()
 {
     // init value
     $dataQuery = FinTotalInterestUnit::find()->orderBy('id DESC');
     // chart data
     $chartModels = FinTotalInterestUnit::find()->orderBy('id DESC')->limit(30)->all();
     $arrLabelChart = [];
     $arrInterestUnitDataChart = [];
     $arrInterestUnitAliasDataChart = [];
     foreach ($chartModels as $chartModel) {
         $arrLabelChart[] = '';
         $arrInterestUnitDataChart[] = $chartModel->interest_unit;
         $arrInterestUnitAliasDataChart[] = NumberUtils::format($chartModel->interest_unit, 2);
     }
     $arrInterestUnitDataChart = array_reverse($arrInterestUnitDataChart);
     $arrInterestUnitAliasDataChart = array_reverse($arrInterestUnitAliasDataChart);
     $chartData = json_encode(['label' => $arrLabelChart, 'interestUnit' => $arrInterestUnitDataChart, 'interestUnitAlias' => $arrInterestUnitAliasDataChart], JSON_NUMERIC_CHECK);
     // render GUI
     $renderData = ['dataQuery' => $dataQuery, 'chartData' => $chartData];
     return $this->render('index', $renderData);
 }
Exemplo n.º 4
0
                        <td style="vertical-align: middle; text-align: right"><?php 
        echo $item->share_unit;
        ?>
 %</td>
                        <td style="vertical-align: middle; text-align: right"><?php 
        echo NumberUtils::format($item->share_value);
        ?>
</td>
                    </tr>
                <?php 
    }
    ?>
                <tr class="warning">
                    <th style="text-align: center" colspan="2"><?php 
    echo Yii::t('fin.grid', 'Total');
    ?>
</th>
                    <th style="text-align: right"><?php 
    echo $sumUnit;
    ?>
 %</th>
                    <th style="text-align: right"><?php 
    echo NumberUtils::format($sumShared);
    ?>
</th>
                </tr>
            </tbody>
        </table>
    </div></div></div></div></div>
</div></div></div><?php 
}
Exemplo n.º 5
0
            </a></li>
            <li><a href="javascript:void(0);">
                <?php 
echo $model->getAttributeLabel('real_purchase');
?>
                <span class="pull-right badge bg-blue"><?php 
echo NumberUtils::format($model->real_purchase);
?>
</span>
            </a></li>
            <li><a href="javascript:void(0);">
                <?php 
echo $model->getAttributeLabel('nav');
?>
                <span class="pull-right badge bg-red"><?php 
echo NumberUtils::format($model->nav, 2);
?>
</span>
            </a></li>
            <li><a href="javascript:void(0);">
                <?php 
echo $model->getAttributeLabel('found_stock');
?>
                <span class="pull-right badge bg-green"><?php 
echo NumberUtils::format($model->found_stock, 2);
?>
</span>
            </a></li>
        </ul>
    </div>
</div></div></div>
Exemplo n.º 6
0
    return ['style' => 'vertical-align: middle; text-align: left', 'class' => MasterValueUtils::getColorRow($index)];
}, 'value' => function ($model) use($arrFinAccount) {
    return isset($arrFinAccount[$model->account_source]) ? $arrFinAccount[$model->account_source] : '';
}, 'footer' => $htmlFooterDebit], ['class' => DataColumn::className(), 'label' => Yii::t('fin.grid', 'Debit Amount'), 'headerOptions' => ['style' => 'text-align: center'], 'footerOptions' => ['colspan' => 0], 'contentOptions' => function ($model, $key, $index) {
    return ['style' => 'vertical-align: middle; text-align: right', 'class' => MasterValueUtils::getColorRow($index)];
}, 'value' => function ($model) {
    $amount = $model->account_source == 0 ? '' : NumberUtils::format($model->entry_value);
    return $amount;
}], ['label' => Yii::t('fin.grid', 'Credit Account'), 'headerOptions' => ['style' => 'text-align: center'], 'footerOptions' => ['style' => 'text-align: right', 'colspan' => 2], 'contentOptions' => function ($model, $key, $index) {
    return ['style' => 'vertical-align: middle; text-align: left', 'class' => MasterValueUtils::getColorRow($index)];
}, 'value' => function ($model) use($arrFinAccount) {
    return isset($arrFinAccount[$model->account_target]) ? $arrFinAccount[$model->account_target] : '';
}, 'footer' => $htmlFooterCredit], ['class' => DataColumn::className(), 'label' => Yii::t('fin.grid', 'Credit Amount'), 'headerOptions' => ['style' => 'text-align: center'], 'footerOptions' => ['colspan' => 0], 'contentOptions' => function ($model, $key, $index) {
    return ['style' => 'vertical-align: middle; text-align: right', 'class' => MasterValueUtils::getColorRow($index)];
}, 'value' => function ($model) {
    $amount = $model->account_target == 0 ? '' : NumberUtils::format($model->entry_value);
    return $amount;
}], ['attribute' => 'description', 'label' => Yii::t('fin.grid', 'Description'), 'headerOptions' => ['style' => 'text-align: center'], 'footerOptions' => ['style' => 'text-align: right'], 'contentOptions' => function ($model, $key, $index) {
    return ['style' => 'vertical-align: middle; text-align: left', 'class' => MasterValueUtils::getColorRow($index)];
}, 'enableSorting' => false, 'value' => function ($model) use($arrEntryLog) {
    $arrEntryLogVal = StringUtils::unserializeArr($model->description);
    return StringUtils::showArrValueAsString($arrEntryLogVal, $arrEntryLog);
}], ['label' => Yii::t('fin.grid', 'Action'), 'headerOptions' => ['style' => 'text-align: center; width: 100px;'], 'contentOptions' => function ($model, $key, $index) {
    return ['style' => 'vertical-align: middle; text-align: center', 'class' => MasterValueUtils::getColorRow($index)];
}, 'format' => 'raw', 'value' => function ($model, $key, $index) {
    $btnClass = MasterValueUtils::getColorRow($index);
    $lblView = Yii::t('button', 'View');
    $lblEdit = Yii::t('button', 'Edit');
    $lblCopy = Yii::t('button', 'Copy');
    $urlEdit = false;
    $arrBtns = [];
Exemplo n.º 7
0
    return $html;
}], ['label' => Yii::t('fin.grid', 'Status'), 'headerOptions' => ['style' => 'text-align: center'], 'contentOptions' => ['style' => 'vertical-align: middle; text-align: center'], 'format' => 'raw', 'value' => function ($model) use($arrCustomerStatus) {
    $status = isset($arrCustomerStatus[$model->status]) ? $arrCustomerStatus[$model->status] : '';
    $html = '<span>' . $status . '</span>';
    $lblView = Yii::t('button', 'View');
    $lblEdit = Yii::t('button', 'Edit');
    $arrBtns = [];
    $entryId = $model->id;
    $urlEdit = BaseUrl::toRoute(['customer/update', 'id' => $entryId]);
    $arrBtns[] = StringUtils::format('<li><a href="{0}">{1}</a></li>', [$urlEdit, $lblEdit]);
    $urlView = BaseUrl::toRoute(['customer/view', 'id' => $entryId]);
    $arrBtns[] = StringUtils::format('<li><a href="{0}">{1}</a></li>', [$urlView, $lblView]);
    $html .= '<br/><div class="btn-group">';
    $html .= Html::a($lblEdit, [$urlEdit], ['class' => 'btn btn-xs btn-info']);
    $html .= '<button type="button" class="btn btn-xs btn-info dropdown-toggle" data-toggle="dropdown">';
    $html .= '<span class="caret"></span><span class="sr-only">Toggle Dropdown</span>';
    $html .= '</button>';
    $html .= '<ul class="dropdown-menu" role="menu">';
    $html .= implode('', $arrBtns);
    $html .= '</ul></div>';
    return $html;
}], ['label' => Yii::t('fin.grid', 'Balance'), 'headerOptions' => ['style' => 'text-align: center'], 'footerOptions' => ['style' => 'vertical-align: middle; text-align: right'], 'contentOptions' => ['style' => 'vertical-align: middle; text-align: right'], 'format' => 'raw', 'value' => function ($model) {
    $labelClass = $model->balance < 0 ? 'label-danger' : 'label-info';
    $labelValue = NumberUtils::format(abs($model->balance));
    return StringUtils::format('{2}<br/><span class="label {0} pull-right">{1}</span>', [$labelClass, $labelValue, $model->name]);
}, 'footer' => NumberUtils::getIncDecNumber($sumCustomerValue['balance'], ['template' => '<span class="label pull-right {color}">{number}</span>', 'incColor' => 'label-info', 'decColor' => 'label-danger'])]]]);
Pjax::end();
?>
</div>
    </div>
</div></div></div>
Exemplo n.º 8
0
                    <th class="warning"><?php 
echo $model->getAttributeLabel('interest_add');
?>
</th>
                    <td class="info"><?php 
echo NumberUtils::format($model->interest_add);
?>
</td>
                </tr>
                <tr>
                    <th class="warning"><?php 
echo $model->getAttributeLabel('entry_value');
?>
</th>
                    <td class="info"><?php 
echo NumberUtils::format($model->entry_value);
?>
</td>
                </tr>
                <tr>
                    <th class="warning"><?php 
echo $model->getAttributeLabel('add_flag');
?>
</th>
                    <td class="info"><?php 
echo isset($arrTimedepositTrantype[$model->add_flag]) ? $arrTimedepositTrantype[$model->add_flag] : '';
?>
</td>
                </tr>
                <tr>
                    <th class="warning"><?php 
Exemplo n.º 9
0
						<th class="warning"><?php 
    echo $model->getAttributeLabel('entry_adjust');
    ?>
</th>
						<td class="info"><?php 
    echo NumberUtils::format($model->entry_adjust);
    ?>
</td>
					</tr>
					<tr>
						<th class="warning"><?php 
    echo $model->getAttributeLabel('entry_updated');
    ?>
</th>
						<td class="info"><?php 
    echo NumberUtils::format($model->entry_updated);
    ?>
</td>
					</tr>
				<?php 
}
?>
				<tr>
					<th class="warning"><?php 
echo $model->getAttributeLabel('description');
?>
</th>
					<td class="info"><?php 
echo StringUtils::showArrValueAsString($model->arr_entry_log, $arrEntryLog);
?>
</td>
Exemplo n.º 10
0
    ?>
</th>
                <td class="info"><?php 
    echo NumberUtils::format($model->transfer_fee);
    ?>
</td>
            </tr>
            <tr>
                <th class="warning"><?php 
    echo $model->getAttributeLabel('other_fee');
    ?>
</th>
                <td class="info"><?php 
    echo NumberUtils::format($model->other_fee);
    ?>
</td>
            </tr>
            <tr>
                <th class="warning"><?php 
    echo $model->getAttributeLabel('investment');
    ?>
</th>
                <td class="info"><?php 
    echo NumberUtils::format($model->investment);
    ?>
</td>
            </tr>
        </table>
    </div></div></div>
</div><?php 
}
Exemplo n.º 11
0
    $startDateStr = '';
    $diffDays = '';
    $diffFull = '';
    if (!is_null($model->start_date)) {
        $startDate = DateTimeUtils::parse($model->start_date, DateTimeUtils::FM_DB_DATETIME);
        $startDateStr = DateTimeUtils::htmlDateTimeFormatFromDB($model->start_date, DateTimeUtils::FM_VIEW_DATE, true);
        $interval = $currentDate->diff($startDate);
        $diffDays = $interval->days;
        $diffFull = $interval->format('%Y-%M-%D %H:%I:%S');
    }
    $costAll = '';
    $costDay = '';
    if (!is_null($model->costs)) {
        $costAll = NumberUtils::format($model->costs);
        if ($diffDays > 0) {
            $costDay = NumberUtils::format($model->costs / $diffDays, 2);
        }
    }
    ?>
            <tr class="<?php 
    echo $rowClass;
    ?>
">
                <td style="vertical-align: middle; text-align: center; width: 80px"><?php 
    echo $rowindex;
    ?>
</td>
                <td style="vertical-align: middle; text-align: left"><?php 
    echo $model->name;
    ?>
</td>
Exemplo n.º 12
0
        ?>
</td>
                        <td style="text-align: right"><?php 
        echo $compareCreditHtml;
        ?>
</td>
                        <td style="text-align: right"><?php 
        echo NumberUtils::format($girdRow['credit']);
        ?>
</td>
                        <td style="text-align: right"><?php 
        echo $compareDebitHtml;
        ?>
</td>
                        <td style="text-align: right"><?php 
        echo NumberUtils::format($girdRow['debit']);
        ?>
</td>
                        <td style="text-align: right"><?php 
        echo $balanceHtml;
        ?>
</td>
                    </tr>
                <?php 
    }
    ?>
</tbody>
            </table></div></div></div>
        <?php 
}
?>
Exemplo n.º 13
0
        ?>
                    <?php 
        $class = MasterValueUtils::getColorRow($rowindex);
        $monthStr = $girdRow['month']->format($fmKeyPhp);
        $arrNotermHtml = [];
        $arrTermHtml = [];
        $arrTotalHtml = [];
        if ($rowindex > 0) {
            $compareConfig = ['template' => '<span class="{color}">{number}</span>', 'incColor' => 'text-blue', 'decColor' => 'text-red'];
            $arrNotermHtml[] = NumberUtils::getIncDecNumber($girdRow['compareNoterm'], $compareConfig);
            $arrTermHtml[] = NumberUtils::getIncDecNumber($girdRow['compareTerm'], $compareConfig);
            $arrTotalHtml[] = NumberUtils::getIncDecNumber($girdRow['compareTotal'], $compareConfig);
        }
        $arrNotermHtml[] = NumberUtils::format($girdRow['noterm']);
        $arrTermHtml[] = NumberUtils::format($girdRow['term']);
        $arrTotalHtml[] = NumberUtils::format($girdRow['total']);
        $notermHtml = implode('<br/>', $arrNotermHtml);
        $termHtml = implode('<br/>', $arrTermHtml);
        $totalHtml = implode('<br/>', $arrTotalHtml);
        $rowindex++;
        ?>
                    <tr class="<?php 
        echo $class;
        ?>
">
                        <td style="vertical-align: middle; text-align: center"><?php 
        echo $monthStr;
        ?>
</td>
                        <td style="vertical-align: middle; text-align: right"><?php 
        echo $termHtml;
Exemplo n.º 14
0
 /**
  * update a Bill
  * @param $model
  * @param $arrBillDetail
  * @param $fmShortDatePhp
  * @throws Exception
  * @return string|true
  */
 private function updateBill($model, $arrBillDetail, $fmShortDatePhp)
 {
     // modify data for DB
     $model->bill_date = DateTimeUtils::parse($model->bill_date, $fmShortDatePhp, DateTimeUtils::FM_DB_DATE);
     $model->member_num = count($model->arr_member_list);
     $model->member_list = serialize($model->arr_member_list);
     $pricePerMember = NumberUtils::rounds($model->total / $model->member_num, NumberUtils::NUM_CEIL);
     $pricePerMemberOld = NumberUtils::rounds($model->total_old / $model->member_num_old, NumberUtils::NUM_CEIL);
     foreach ($arrBillDetail as $billDetail) {
         if (!$billDetail->delete_flag) {
             $billDetail->pay_date = DateTimeUtils::parse($billDetail->pay_date, $fmShortDatePhp, DateTimeUtils::FM_DB_DATE);
         }
     }
     $transaction = Yii::$app->db->beginTransaction();
     $save = true;
     $message = null;
     // begin transaction
     try {
         // save Bill
         $save = $model->save(false);
         // save Bill Detail
         if ($save !== false) {
             // delete all Bill Detail
             NetBillDetail::deleteAll(['bill_id' => $model->id]);
             $itemNo = 1;
             foreach ($arrBillDetail as $billDetail) {
                 if (!$billDetail->delete_flag) {
                     $billDetail->setIsNewRecord(true);
                     $billDetail->bill_id = $model->id;
                     $billDetail->item_no = $itemNo;
                     $itemNo++;
                     $save = $billDetail->save(false);
                     if ($save === false) {
                         break;
                     }
                 }
             }
         }
         // save Customer & Payment
         if ($save !== false) {
             foreach ($model->arr_member_list_old as $oldCustomerId) {
                 // save old Customer
                 $oldCustomer = NetCustomer::findOne($oldCustomerId);
                 $oldCustomer->balance = $oldCustomer->balance + $pricePerMemberOld;
                 $save = $oldCustomer->save(false);
                 if ($save === false) {
                     break;
                 }
                 // save old Payment
                 $oldPayment = NetPayment::findOne(['customer_id' => $oldCustomerId, 'order_id' => $model->id]);
                 if (!is_null($oldPayment)) {
                     if ($oldPayment->credit > 0) {
                         $oldPayment->debit = 0;
                         $oldPayment->order_id = 0;
                         $save = $oldPayment->save(false);
                     } else {
                         $save = $oldPayment->delete();
                     }
                     if ($save === false) {
                         break;
                     }
                 }
             }
             if ($save !== false) {
                 foreach ($model->arr_member_list as $customerId) {
                     // save new Customer
                     $customer = NetCustomer::findOne($customerId);
                     $customer->balance = $customer->balance - $pricePerMember;
                     $save = $customer->save(false);
                     if ($save === false) {
                         break;
                     }
                     // save new Payment
                     $payment = NetPayment::findOne(['customer_id' => $customerId, 'entry_date' => $model->bill_date]);
                     if (is_null($payment)) {
                         $payment = new NetPayment();
                         $payment->customer_id = $customerId;
                         $payment->entry_date = $model->bill_date;
                     }
                     $payment->debit = $pricePerMember;
                     $payment->order_id = $model->id;
                     $payment->secret_key = EnDescrypt::encryptSha1($payment->customer_id . $payment->entry_date);
                     $save = $payment->save(false);
                     if ($save === false) {
                         break;
                     }
                 }
             }
         }
     } catch (Exception $e) {
         $save = false;
         $message = Yii::t('common', 'Unable to save {record}.', ['record' => Yii::t('fin.models', 'Bill')]);
     }
     // end transaction
     try {
         if ($save === false) {
             $transaction->rollback();
             return $message;
         } else {
             $transaction->commit();
         }
     } catch (Exception $e) {
         throw Exception(Yii::t('common', 'Unable to excute Transaction.'));
     }
     return true;
 }
Exemplo n.º 15
0
    return NumberUtils::format($model->nav_value, 2);
}], ['label' => Yii::t('fin.grid', 'Prev Nav'), 'headerOptions' => ['style' => 'text-align: center'], 'contentOptions' => function ($model, $key, $index) {
    return ['style' => 'vertical-align: middle; text-align: right', 'class' => MasterValueUtils::getColorRow($index)];
}, 'value' => function ($model) {
    return NumberUtils::format($model->nav_value_prev, 2);
}], ['label' => Yii::t('fin.grid', 'Delta'), 'headerOptions' => ['style' => 'text-align: center'], 'contentOptions' => function ($model, $key, $index) {
    return ['style' => 'vertical-align: middle; text-align: right', 'class' => MasterValueUtils::getColorRow($index)];
}, 'format' => 'raw', 'value' => function ($model) {
    $config = ['template' => '<span class="{color}">{number}</span>', 'incColor' => 'text-blue', 'decColor' => 'text-red'];
    return NumberUtils::getIncDecNumber($model->nav_value - $model->nav_value_prev, $config, 2);
}], ['label' => Yii::t('fin.grid', 'Delta'), 'headerOptions' => ['style' => 'text-align: center'], 'contentOptions' => function ($model, $key, $index) {
    return ['style' => 'vertical-align: middle; text-align: right', 'class' => MasterValueUtils::getColorRow($index)];
}, 'format' => 'raw', 'value' => function ($model) {
    $config = ['template' => '<span class="{color}">{number} %</span>', 'incColor' => 'text-blue', 'decColor' => 'text-red'];
    $percent = 100 * ($model->nav_value - $model->nav_value_prev) / $model->nav_value_prev;
    return NumberUtils::getIncDecNumber($percent, $config, 2);
}], ['label' => Yii::t('fin.grid', 'Action'), 'headerOptions' => ['style' => 'text-align: center; width: 100px;'], 'contentOptions' => function ($model, $key, $index) {
    return ['style' => 'vertical-align: middle; text-align: center', 'class' => MasterValueUtils::getColorRow($index)];
}, 'format' => 'raw', 'value' => function ($model, $key, $index) {
    $btnClass = MasterValueUtils::getColorRow($index);
    $lblView = Yii::t('button', 'View');
    $lblEdit = Yii::t('button', 'Edit');
    $urlEdit = null;
    $arrBtns = [];
    $entryId = $model->nav_id;
    $urlEdit = BaseUrl::toRoute(['nav/update', 'id' => $entryId]);
    $arrBtns[] = StringUtils::format('<li><a href="{0}">{1}</a></li>', [$urlEdit, $lblEdit]);
    $urlView = BaseUrl::toRoute(['nav/view', 'id' => $entryId]);
    $arrBtns[] = StringUtils::format('<li><a href="{0}">{1}</a></li>', [$urlView, $lblView]);
    $html = '<div class="btn-group">';
    $html .= Html::a($lblEdit, [$urlEdit], ['class' => 'btn btn-' . $btnClass]);
Exemplo n.º 16
0
                    <?php 
        $class = MasterValueUtils::getColorRow($rowindex);
        $monthStr = $girdRow['month']->format($fmKeyPhp);
        $arrCreditHtml = [];
        $arrDebitHtml = [];
        $arrBalanceHtml = [];
        if ($rowindex > 0) {
            $compareCreditConfig = ['template' => '<span class="{color}">{number}</span>', 'incColor' => 'text-blue', 'decColor' => 'text-red'];
            $arrCreditHtml[] = NumberUtils::getIncDecNumber($girdRow['compareCredit'], $compareCreditConfig);
            $arrBalanceHtml[] = NumberUtils::getIncDecNumber($girdRow['compareBalance'], $compareCreditConfig);
            $compareDebitConfig = ['template' => '<span class="{color}">{number}</span>', 'incColor' => 'text-red', 'decColor' => 'text-blue'];
            $arrDebitHtml[] = NumberUtils::getIncDecNumber($girdRow['compareDebit'], $compareDebitConfig);
        }
        $arrCreditHtml[] = NumberUtils::format($girdRow['credit']);
        $arrDebitHtml[] = NumberUtils::format($girdRow['debit']);
        $arrBalanceHtml[] = NumberUtils::getIncDecNumber($girdRow['balance'], ['template' => '<span class="{color}">{number}</span>', 'incColor' => 'text-blue', 'decColor' => 'text-red']);
        $creditHtml = implode('<br/>', $arrCreditHtml);
        $debitHtml = implode('<br/>', $arrDebitHtml);
        $balanceHtml = implode('<br/>', $arrBalanceHtml);
        $rowindex++;
        ?>
                    <tr class="<?php 
        echo $class;
        ?>
">
                        <td style="vertical-align: middle; text-align: center"><?php 
        echo $monthStr;
        ?>
</td>
                        <td style="vertical-align: middle; text-align: right"><?php 
        echo $creditHtml;
Exemplo n.º 17
0
    return ['style' => 'vertical-align: middle; text-align: right', 'class' => MasterValueUtils::getColorRow($index)];
}, 'format' => 'raw', 'value' => function ($model) {
    $interestRate = NumberUtils::format($model->interest_rate, 4) . ' %';
    $interestUnit = NumberUtils::format($model->interest_unit, 4) . ' d';
    return $interestRate . '<br/>' . $interestUnit;
}], ['class' => DataColumn::className(), 'label' => Yii::t('fin.grid', 'Term'), 'headerOptions' => ['style' => 'text-align: center'], 'footerOptions' => ['colspan' => 0], 'contentOptions' => function ($model, $key, $index) {
    return ['style' => 'vertical-align: middle; text-align: center', 'class' => MasterValueUtils::getColorRow($index)];
}, 'format' => 'raw', 'value' => function ($model) use($phpFmShortDate) {
    $openingDate = DateTimeUtils::htmlDateFormatFromDB($model->opening_date, DateTimeUtils::FM_VIEW_DATE, true);
    $closingDate = DateTimeUtils::htmlDateFormatFromDB($model->closing_date, DateTimeUtils::FM_VIEW_DATE, true);
    return $openingDate . '<br/>' . $closingDate;
}], ['label' => Yii::t('fin.grid', 'Principal'), 'headerOptions' => ['style' => 'text-align: center'], 'footerOptions' => ['style' => 'text-align: right'], 'contentOptions' => function ($model, $key, $index) {
    return ['style' => 'vertical-align: middle; text-align: right', 'class' => MasterValueUtils::getColorRow($index)];
}, 'format' => 'raw', 'value' => function ($model) {
    $interestAdd = NumberUtils::format($model->interest_add);
    $entryValue = NumberUtils::format($model->entry_value);
    return $entryValue . '<br/>' . $interestAdd;
}, 'footer' => $htmlFooterInterest], ['label' => Yii::t('fin.grid', 'Amount Type'), 'headerOptions' => ['style' => 'text-align: center'], 'contentOptions' => function ($model, $key, $index) {
    return ['style' => 'vertical-align: middle; text-align: center', 'class' => MasterValueUtils::getColorRow($index)];
}, 'value' => function ($model) use($arrTimedepositTrantype) {
    return isset($arrTimedepositTrantype[$model->add_flag]) ? $arrTimedepositTrantype[$model->add_flag] : '';
}], ['label' => Yii::t('fin.grid', 'Current Assets'), 'headerOptions' => ['style' => 'text-align: center'], 'footerOptions' => ['style' => 'text-align: right'], 'contentOptions' => function ($model, $key, $index) {
    return ['style' => 'vertical-align: middle; text-align: left', 'class' => MasterValueUtils::getColorRow($index)];
}, 'value' => function ($model) use($arrCurrentAssets) {
    return isset($arrCurrentAssets[$model->current_assets]) ? $arrCurrentAssets[$model->current_assets] : '';
}, 'footer' => $htmlFooterAdding], ['label' => Yii::t('fin.grid', 'Action'), 'headerOptions' => ['style' => 'text-align: center; width: 100px;'], 'contentOptions' => function ($model, $key, $index) {
    return ['style' => 'vertical-align: middle; text-align: center', 'class' => MasterValueUtils::getColorRow($index)];
}, 'format' => 'raw', 'value' => function ($model, $key, $index) {
    $btnClass = MasterValueUtils::getColorRow($index);
    $lblView = Yii::t('button', 'View');
    $lblEdit = Yii::t('button', 'Edit');
Exemplo n.º 18
0
}], ['class' => DataColumn::className(), 'label' => Yii::t('fin.grid', 'Bill Date'), 'headerOptions' => ['style' => 'text-align: center'], 'footerOptions' => ['colspan' => 0], 'contentOptions' => function ($model, $key, $index) {
    return ['style' => 'vertical-align: middle; text-align: center', 'class' => MasterValueUtils::getColorRow($index)];
}, 'format' => 'raw', 'value' => function ($model) {
    return DateTimeUtils::htmlDateFormatFromDB($model->bill_date, DateTimeUtils::FM_VIEW_DATE, true);
}], ['label' => Yii::t('fin.grid', 'Amount'), 'headerOptions' => ['style' => 'text-align: center'], 'footerOptions' => ['style' => 'text-align: right'], 'contentOptions' => function ($model, $key, $index) {
    return ['style' => 'vertical-align: middle; text-align: right', 'class' => MasterValueUtils::getColorRow($index)];
}, 'value' => function ($model) {
    return NumberUtils::format($model->total);
}, 'footer' => $htmlFooterTotal], ['label' => Yii::t('fin.grid', 'Member'), 'headerOptions' => ['style' => 'text-align: center'], 'contentOptions' => function ($model, $key, $index) {
    return ['style' => 'vertical-align: middle; text-align: center', 'class' => MasterValueUtils::getColorRow($index)];
}, 'value' => function ($model) {
    return $model->member_num;
}], ['label' => Yii::t('fin.grid', 'Per Member'), 'headerOptions' => ['style' => 'text-align: center'], 'contentOptions' => function ($model, $key, $index) {
    return ['style' => 'vertical-align: middle; text-align: right', 'class' => MasterValueUtils::getColorRow($index)];
}, 'value' => function ($model) {
    return NumberUtils::format(NumberUtils::rounds($model->total / $model->member_num, NumberUtils::NUM_CEIL));
}], ['label' => Yii::t('fin.grid', 'Member'), 'headerOptions' => ['style' => 'text-align: center'], 'contentOptions' => function ($model, $key, $index) {
    return ['style' => 'vertical-align: middle; text-align: left; max-width:280px', 'class' => MasterValueUtils::getColorRow($index)];
}, 'value' => function ($model) use($arrNetCustomer) {
    $arrMemberListVal = StringUtils::unserializeArr($model->member_list);
    return StringUtils::showArrValueAsString($arrMemberListVal, $arrNetCustomer);
}], ['label' => Yii::t('fin.grid', 'Action'), 'headerOptions' => ['style' => 'text-align: center; width: 100px;'], 'contentOptions' => function ($model, $key, $index) {
    return ['style' => 'vertical-align: middle; text-align: center', 'class' => MasterValueUtils::getColorRow($index)];
}, 'format' => 'raw', 'value' => function ($model, $key, $index) {
    $btnClass = MasterValueUtils::getColorRow($index);
    $lblView = Yii::t('button', 'View');
    $lblEdit = Yii::t('button', 'Edit');
    $arrBtns = [];
    $entryId = $model->id;
    $urlEdit = BaseUrl::toRoute(['bill/update', 'id' => $entryId]);
    $arrBtns[] = StringUtils::format('<li><a href="{0}">{1}</a></li>', [$urlEdit, $lblEdit]);
Exemplo n.º 19
0
 public function calculate()
 {
     $this->purchase_fee_rate = ParamUtils::getPurchaseFeeRate($this->purchase);
     $this->discount_rate = ParamUtils::getPurchaseFeeDiscountRate($this->purchase_type);
     $this->total_fee_rate = $this->purchase_fee_rate * (100 - $this->discount_rate) / 100;
     $this->purchase_fee_rule = ParamUtils::getPurchaseFeeRule();
     $this->purchase_fee = NumberUtils::rounds($this->purchase * $this->total_fee_rate / 100, $this->purchase_fee_rule);
     $this->real_purchase = $this->purchase - $this->purchase_fee;
     $this->found_stock_rule = ParamUtils::getFoundStockRule();
     $this->found_stock = NumberUtils::rounds(100 * ($this->real_purchase / $this->nav), $this->found_stock_rule) / 100;
     $this->investment = $this->purchase + $this->transfer_fee + $this->other_fee;
     if ($this->purchase_type == MasterValueUtils::MV_OEF_PERCHASE_TYPE_DIVIDEND) {
         $this->fin_entry_id = 0;
         $this->jar_payment_id = 0;
     }
 }
Exemplo n.º 20
0
    if ($model->credit > 0) {
        ?>
<li><a href="javascript:void(0);">
                <?php 
        echo $model->getAttributeLabel('credit');
        ?>
                <span class="pull-right badge bg-aqua"><?php 
        echo NumberUtils::format($model->credit);
        ?>
</span>
            </a></li><?php 
    }
    ?>
            <?php 
    if ($model->debit > 0) {
        ?>
<li><a href="javascript:void(0);">
                <?php 
        echo $model->getAttributeLabel('debit');
        ?>
                <span class="pull-right badge bg-red"><?php 
        echo NumberUtils::format($model->debit);
        ?>
</span>
            </a></li><?php 
    }
    ?>
        </ul>
    </div>
</div></div></div><?php 
}
Exemplo n.º 21
0
                    <th class="warning"><?php 
echo $model->getAttributeLabel('entry_date');
?>
</th>
                    <td class="info"><?php 
echo DateTimeUtils::htmlDateFormat($model->entry_date, DateTimeUtils::FM_VIEW_DATE_WD, $fmShortDatePhp, true);
?>
</td>
                </tr>
                <tr>
                    <th class="warning"><?php 
echo $model->getAttributeLabel('credit');
?>
</th>
                    <td class="info"><?php 
echo NumberUtils::format($model->credit);
?>
</td>
                </tr>
            </table>
            <div style="display: none">
                <?php 
echo $form->field($model, 'customer_id')->hiddenInput();
?>
                <?php 
echo $form->field($model, 'entry_date')->hiddenInput();
?>
                <?php 
echo $form->field($model, 'credit')->hiddenInput();
?>
            </div>
Exemplo n.º 22
0
    return $html;
}, 'footer' => $htmlFooterInterest], ['label' => Yii::t('fin.grid', 'Principal'), 'headerOptions' => ['style' => 'text-align: center'], 'footerOptions' => ['style' => 'text-align: right'], 'contentOptions' => ['style' => 'vertical-align: middle; text-align: left; min-width:162px'], 'format' => 'raw', 'value' => function ($model) use($arrSavingAccount, $arrCurrentAssets) {
    $htmls = [];
    $htmlSavingAccount = isset($arrSavingAccount[$model->saving_account]) ? $arrSavingAccount[$model->saving_account] : '';
    if (!empty($htmlSavingAccount)) {
        $amount = NumberUtils::format($model->interest_add);
        $htmlSavingAccount .= '<span class="label label-info pull-right">' . $amount . '</span>';
        $htmls[] = $htmlSavingAccount;
    }
    $htmlCurrentAssets = isset($arrCurrentAssets[$model->current_assets]) ? $arrCurrentAssets[$model->current_assets] : '';
    if (!empty($htmlCurrentAssets)) {
        $amount = NumberUtils::format($model->entry_value);
        if ($model->add_flag == MasterValueUtils::MV_FIN_TIMEDP_TRANTYPE_ADDING) {
            $htmlCurrentAssets .= '<span class="label label-info pull-right">' . $amount . '</span>';
        } else {
            $htmlCurrentAssets .= '<span class="label label-danger pull-right">' . $amount . '</span>';
        }
        $htmls[] = $htmlCurrentAssets;
    }
    return implode('<br/>', $htmls);
}, 'footer' => $htmlFooterAdding], ['label' => Yii::t('fin.grid', 'Unit'), 'headerOptions' => ['style' => 'text-align: center'], 'contentOptions' => ['style' => 'vertical-align: middle; text-align: right'], 'format' => 'raw', 'value' => function ($model) {
    $interestRate = NumberUtils::format($model->interest_rate, 4) . ' %';
    $interestUnit = NumberUtils::format($model->interest_unit, 4) . ' d';
    return $interestRate . '<br/>' . $interestUnit;
}], ['label' => Yii::t('fin.grid', 'Closing'), 'headerOptions' => ['style' => 'text-align: center'], 'contentOptions' => ['style' => 'vertical-align: middle; text-align: center'], 'format' => 'raw', 'value' => function ($model) {
    return DateTimeUtils::htmlDateFormatFromDB($model->closing_date, DateTimeUtils::FM_VIEW_DATE, true);
}]]]);
Pjax::end();
?>
</div></div>
</div></div></div>
Exemplo n.º 23
0
</td>
				<td style="text-align: right"><?php 
    echo NumberUtils::format($otherFound->opening_balance);
    ?>
</td>
				<td style="text-align: right"><?php 
    echo NumberUtils::format($otherFound->closing_balance);
    ?>
</td>
			</tr><?php 
}
?>
			<tr class="danger">
				<td style="text-align: left"><?php 
echo Yii::t('fin.grid', 'Total');
?>
</td>
				<td style="text-align: right"><?php 
echo NumberUtils::format($sumTotal['opening_balance']);
?>
</td>
				<td style="text-align: right"><?php 
echo NumberUtils::format($sumTotal['closing_balance']);
?>
</td>
			</tr>
		</table></div></div>
	</div></div>
</div>

Exemplo n.º 24
0
?>
        <tr class="warning">
            <th colspan="2" style="text-align: center"><?php 
echo Yii::t('fin.grid', 'Total');
?>
</th>
            <th style="text-align: right"><?php 
echo $sumAccountValue['share'];
?>
 %</th>
            <th style="text-align: right"><?php 
echo NumberUtils::getIncDecNumber($sumAccountValue['useable_balance'], $numberHtmlConfig);
?>
</th>
            <th style="text-align: right"><?php 
echo NumberUtils::getIncDecNumber($sumAccountValue['real_balance'], $numberHtmlConfig);
?>
</th>
            <th style="text-align: right">
                <?php 
echo NumberUtils::getIncDecNumber($tempAccount->useable_balance, $numberHtmlConfig);
?>
            </th>
            <th style="text-align: left">
                <?php 
echo $tempAccount->account_name;
?>
            </th>
        </tr>
    </tbody></table></div>
</div></div></div>
Exemplo n.º 25
0
    ?>
                <li><a href="javascript:void(0);">
                    <?php 
    echo $model->getAttributeLabel('entry_adjust');
    ?>
                    <span class="pull-right badge bg-red"><?php 
    echo NumberUtils::format($model->entry_adjust);
    ?>
</span>
                </a></li>
                <li><a href="javascript:void(0);">
                    <?php 
    echo $model->getAttributeLabel('entry_update');
    ?>
                    <span class="pull-right badge bg-red"><?php 
    echo NumberUtils::format($model->entry_value + $model->entry_adjust);
    ?>
</span>
                </a></li>
            <?php 
}
?>
            <li><a href="javascript:void(0);">
                <?php 
echo $model->getAttributeLabel('description');
?>
                <span class="pull-right"><?php 
echo $model->description;
?>
</span>
            </a></li>
Exemplo n.º 26
0
 $arrBtns[] = StringUtils::format("<li><a href='javascript:void(0)' onclick='editBillItem(this);' data-maps='{0}'>{1}</a></li>", [$datasetDeleteStr, $lblDetele]);
 $htmlAction = '<div class="btn-group">';
 $htmlAction .= StringUtils::format("<a href='javascript:void(0)' onclick='editBillItem(this);' data-maps='{0}' class='btn btn-{1}'>{2}</a>", [$datasetUpdateStr, $btnClass, $lblEdit]);
 $htmlAction .= '<button type="button" class="btn btn-' . $btnClass . ' dropdown-toggle" data-toggle="dropdown">';
 $htmlAction .= '<span class="caret"></span><span class="sr-only">Toggle Dropdown</span>';
 $htmlAction .= '</button>';
 $htmlAction .= '<ul class="dropdown-menu" role="menu">';
 $htmlAction .= implode('', $arrBtns);
 $htmlAction .= '</ul></div>';
 // show error columns
 $colItemNameStyle = '';
 $colPriceStyle = '';
 $colPayDateStyle = '';
 $colDescriptionStyle = '';
 $htmlItemName = $item->item_name;
 $htmlPrice = is_numeric($item->price) ? NumberUtils::format($item->price) : $item->price;
 $htmlPayDate = empty($item->pay_date) ? '' : DateTimeUtils::htmlDateFormat($item->pay_date, DateTimeUtils::FM_VIEW_DATE_WD, $fmShortDatePhp, true);
 $htmlDescription = $item->description;
 if (!$item->is_valid) {
     $errorItemName = $item->getErrors('item_name');
     if (count($errorItemName) > 0) {
         $colItemNameStyle = ' class="danger"';
         $htmlItemName = '<i class="fa fa-question-circle" data-toggle="tooltip" data-placement="top" title="' . $errorItemName[0] . '"></i> ' . $htmlItemName;
     }
     $errorPrice = $item->getErrors('price');
     if (count($errorPrice) > 0) {
         $colPriceStyle = ' class="danger"';
         $htmlPrice = '<i class="fa fa-question-circle" data-toggle="tooltip" data-placement="top" title="' . $errorPrice[0] . '"></i> ' . $htmlPrice;
     }
     $errorPayDate = $item->getErrors('pay_date');
     if (count($errorPayDate) > 0) {
Exemplo n.º 27
0
    $html .= '<br/><div class="btn-group">';
    $html .= Html::a($lblEdit, [$urlEdit], ['class' => 'btn btn-xs btn-info']);
    $html .= '<button type="button" class="btn btn-xs btn-info dropdown-toggle" data-toggle="dropdown">';
    $html .= '<span class="caret"></span><span class="sr-only">Toggle Dropdown</span>';
    $html .= '</button>';
    $html .= '<ul class="dropdown-menu" role="menu">';
    $html .= implode('', $arrBtns);
    $html .= '</ul></div>';
    return $html;
}], ['label' => Yii::t('fin.grid', 'Nav / Prev'), 'headerOptions' => ['style' => 'text-align: center'], 'contentOptions' => ['style' => 'vertical-align: middle; text-align: left;'], 'format' => 'raw', 'value' => function ($model) {
    $htmls = [];
    $navPrev = NumberUtils::format($model->nav_value_prev, 2);
    $htmls[] = '<span class="label label-info pull-right">' . $navPrev . '</span>';
    $nav = NumberUtils::format($model->nav_value, 2);
    $htmls[] = '<span class="label label-info pull-right">' . $nav . '</span>';
    return implode('<br/>', $htmls);
}], ['label' => Yii::t('fin.grid', 'Delta'), 'headerOptions' => ['style' => 'text-align: center'], 'contentOptions' => ['style' => 'vertical-align: middle; text-align: left'], 'format' => 'raw', 'value' => function ($model) {
    $config1 = ['template' => '<span class="label {color} pull-right">{number}</span>', 'incColor' => 'label-info', 'decColor' => 'label-danger'];
    $config2 = ['template' => '<span class="label {color} pull-right">{number} %</span>', 'incColor' => 'label-info', 'decColor' => 'label-danger'];
    $delta1 = $model->nav_value - $model->nav_value_prev;
    $delta2 = 100 * $delta1 / $model->nav_value_prev;
    $htmls = [];
    $htmls[] = NumberUtils::getIncDecNumber($delta1, $config1, 2);
    $htmls[] = NumberUtils::getIncDecNumber($delta2, $config2, 2);
    return implode('<br/>', $htmls);
}]]]);
Pjax::end();
?>
</div>
    </div>
</div></div></div>
Exemplo n.º 28
0
        $rowindex++;
        ?>
                <tr class="<?php 
        echo $class;
        ?>
">
                    <td style="vertical-align: middle; text-align: center"><?php 
        echo $item->item_no;
        ?>
</td>
                    <td style="vertical-align: middle; text-align: left"><?php 
        echo $item->item_name;
        ?>
</td>
                    <td style="vertical-align: middle; text-align: right"><?php 
        echo NumberUtils::format($item->price);
        ?>
</td>
                    <td style="vertical-align: middle; text-align: left"><?php 
        echo DateTimeUtils::htmlDateFormat($item->pay_date, DateTimeUtils::FM_VIEW_DATE, DateTimeUtils::FM_DB_DATE, true);
        ?>
</td>
                    <td style="vertical-align: middle; text-align: left"><?php 
        echo $item->description;
        ?>
</td>
                </tr>
            <?php 
    }
    ?>
</tbody>
Exemplo n.º 29
0
            </a></li>
            <li><a href="javascript:void(0);">
                <?php 
    echo $model->getAttributeLabel('decide_date');
    ?>
                <?php 
    echo DateTimeUtils::htmlDateFormatFromDB($model->decide_date, DateTimeUtils::FM_VIEW_DATE_WD, ['class' => 'pull-right']);
    ?>
            </a></li>
            <li><a href="javascript:void(0);">
                <?php 
    echo $model->getAttributeLabel('nav_value');
    ?>
                <span class="pull-right badge bg-red"><?php 
    echo NumberUtils::format($model->nav_value, 2);
    ?>
</span>
            </a></li>
            <li><a href="javascript:void(0);">
                <?php 
    echo $model->getAttributeLabel('nav_value_prev');
    ?>
                <span class="pull-right badge bg-red"><?php 
    echo NumberUtils::format($model->nav_value_prev, 2);
    ?>
</span>
            </a></li>
        </ul>
    </div>
</div></div></div><?php 
}
Exemplo n.º 30
0
    return ['style' => 'vertical-align: middle; text-align: center', 'class' => MasterValueUtils::getColorRow($index)];
}, 'value' => function ($model, $key, $index, $column) {
    $pagination = $column->grid->dataProvider->pagination;
    return $pagination->page * $pagination->pageSize + $index + 1;
}, 'footer' => Yii::t('fin.grid', 'Total')], ['class' => DataColumn::className(), 'label' => Yii::t('fin.grid', 'ID'), 'headerOptions' => ['style' => 'text-align: center'], 'footerOptions' => ['colspan' => 0], 'contentOptions' => function ($model, $key, $index) {
    return ['style' => 'vertical-align: middle; text-align: center', 'class' => MasterValueUtils::getColorRow($index)];
}, 'value' => function ($model) {
    return str_pad($model->share_id, 6, '0', STR_PAD_LEFT);
}], ['class' => DataColumn::className(), 'label' => Yii::t('fin.grid', 'Share Date'), 'headerOptions' => ['style' => 'text-align: center'], 'footerOptions' => ['colspan' => 0], 'contentOptions' => function ($model, $key, $index) {
    return ['style' => 'vertical-align: middle; text-align: center', 'class' => MasterValueUtils::getColorRow($index)];
}, 'format' => 'raw', 'value' => function ($model) {
    return DateTimeUtils::htmlDateFormatFromDB($model->share_date, DateTimeUtils::FM_VIEW_DATE, true);
}], ['label' => Yii::t('fin.grid', 'Share Value'), 'headerOptions' => ['style' => 'text-align: center'], 'footerOptions' => ['style' => 'text-align: right'], 'contentOptions' => function ($model, $key, $index) {
    return ['style' => 'vertical-align: middle; text-align: right', 'class' => MasterValueUtils::getColorRow($index)];
}, 'value' => function ($model) {
    return NumberUtils::format($model->share_value);
}, 'footer' => $htmlFooterShareValue], ['label' => Yii::t('fin.grid', 'Description'), 'headerOptions' => ['style' => 'text-align: center'], 'contentOptions' => function ($model, $key, $index) {
    return ['style' => 'vertical-align: middle; text-align: left; max-width:280px', 'class' => MasterValueUtils::getColorRow($index)];
}, 'value' => function ($model) {
    return $model->description;
}], ['label' => Yii::t('fin.grid', 'Action'), 'headerOptions' => ['style' => 'text-align: center; width: 100px;'], 'contentOptions' => function ($model, $key, $index) {
    return ['style' => 'vertical-align: middle; text-align: center', 'class' => MasterValueUtils::getColorRow($index)];
}, 'format' => 'raw', 'value' => function ($model, $key, $index) {
    $btnClass = MasterValueUtils::getColorRow($index);
    $lblView = Yii::t('button', 'View');
    $lblEdit = Yii::t('button', 'Edit');
    $arrBtns = [];
    $entryId = $model->share_id;
    $urlEdit = BaseUrl::toRoute(['distribute/update', 'id' => $entryId]);
    $arrBtns[] = StringUtils::format('<li><a href="{0}">{1}</a></li>', [$urlEdit, $lblEdit]);
    $urlView = BaseUrl::toRoute(['distribute/view', 'id' => $entryId]);