Esempio n. 1
0
 public function actionView($id)
 {
     $this->objectId = $id;
     $model = NetBill::findOne(['id' => $id, 'delete_flag' => MasterValueUtils::MV_FIN_FLG_DELETE_FALSE]);
     $renderView = 'view';
     if (is_null($model)) {
         $model = false;
         $renderData = ['model' => $model];
         Yii::$app->session->setFlash(MasterValueUtils::FLASH_ERROR, Yii::t('common', 'The requested {record} does not exist.', ['record' => Yii::t('fin.models', 'Bill')]));
     } else {
         // master value
         $arrNetCustomer = ModelUtils::getArrData(NetCustomer::find()->select(['id', 'name'])->where(['delete_flag' => MasterValueUtils::MV_FIN_FLG_DELETE_FALSE])->orderBy('order_num'), 'id', 'name');
         $model->arr_member_list = StringUtils::unserializeArr($model->member_list);
         $model->member_list = StringUtils::showArrValueAsString($model->arr_member_list, $arrNetCustomer);
         // Detail of Items
         $arrBillDetail = NetBillDetail::find()->where(['=', 'bill_id', $id])->orderBy('item_no ASC')->all();
         // data for rendering
         $renderData = ['model' => $model, 'arrBillDetail' => $arrBillDetail, 'arrNetCustomer' => $arrNetCustomer];
     }
     // render GUI
     return $this->render($renderView, $renderData);
 }
Esempio n. 2
0
    $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 = [];
    $entryId = $model->entry_id;
    $timeDepositTranId = $model->time_deposit_tran_id;
    switch ($model->entry_status) {
        case MasterValueUtils::MV_FIN_ENTRY_TYPE_SIMPLE:
            $urlEdit = BaseUrl::toRoute(['payment/update', 'id' => $entryId]);
            $arrBtns[] = StringUtils::format('<li><a href="{0}">{1}</a></li>', [$urlEdit, $lblEdit]);
Esempio n. 3
0
</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>
				</tr>
			</table>
			<div style="display: none">
				<?php 
echo $form->field($model, 'entry_date')->hiddenInput();
?>
				<?php 
echo $form->field($model, 'account_source')->hiddenInput();
?>
				<?php 
echo $form->field($model, 'account_target')->hiddenInput();
?>
				<?php 
Esempio n. 4
0
    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]);
    $urlView = BaseUrl::toRoute(['bill/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]);
    $html .= '<button type="button" class="btn btn-' . $btnClass . ' dropdown-toggle" data-toggle="dropdown">';
Esempio n. 5
0
                <th class="warning"><?php 
echo $model->getAttributeLabel('total');
?>
</th>
                <td class="info"><?php 
echo NumberUtils::format($model->total);
?>
</td>
            </tr>
            <tr>
                <th class="warning"><?php 
echo $model->getAttributeLabel('arr_member_list');
?>
</th>
                <td class="info"><?php 
echo StringUtils::showArrValueAsString($model->arr_member_list, $arrNetCustomer);
?>
</td>
            </tr>
            <tr>
                <th class="warning"><?php 
echo Yii::t('common', 'Number Of Member');
?>
</th>
                <td class="info"><?php 
echo $memberCount;
?>
</td>
            </tr>
            <tr>
                <th class="warning"><?php 
Esempio n. 6
0
 public function actionView($id)
 {
     $this->objectId = $id;
     $model = FinAccountEntry::findOne(['entry_id' => $id, 'delete_flag' => MasterValueUtils::MV_FIN_FLG_DELETE_FALSE]);
     $renderView = 'view';
     if (is_null($model)) {
         $model = false;
         $renderData = ['model' => $model];
         Yii::$app->session->setFlash(MasterValueUtils::FLASH_ERROR, Yii::t('common', 'The requested {record} does not exist.', ['record' => Yii::t('fin.models', 'Payment')]));
     } else {
         // master value
         $phpFmShortDate = DateTimeUtils::getPhpDateFormat();
         $arrEntryLog = MasterValueUtils::getArrData('fin_entry_log');
         $arrEntryLogVal = StringUtils::unserializeArr($model->description);
         $model->description = StringUtils::showArrValueAsString($arrEntryLogVal, $arrEntryLog);
         $arrFinAccount = ModelUtils::getArrData(FinAccount::find()->select(['account_id', 'account_name']), 'account_id', 'account_name');
         // data for rendering
         $renderData = ['model' => $model, 'phpFmShortDate' => $phpFmShortDate, 'arrFinAccount' => $arrFinAccount];
     }
     // render GUI
     return $this->render($renderView, $renderData);
 }