public function actionIndex()
 {
     $paidData = $unPaidData = $fcCategory = [];
     if (Yii::$app->session->get('stu_id')) {
         return $this->redirect(['/fees/fees-payment-transaction/stu-fees-data']);
     }
     //Course Wise Collection Count
     $cateWisePaid = 0;
     $courseWiseCollect = (new \yii\db\Query())->select(["(cs.course_name) AS '0'", 'SUM(fpt.fees_pay_tran_amount) AS "1"'])->from('fees_payment_transaction fpt')->join('JOIN', 'courses cs', 'cs.course_id = fpt.fees_pay_tran_course_id')->where(['cs.is_status' => 0, 'fpt.is_status' => 0])->groupBy('fpt.fees_pay_tran_course_id')->all();
     $actFcc = \app\modules\fees\models\FeesCollectCategory::find()->where(['is_status' => 0])->asArray()->all();
     foreach ($actFcc as $v) {
         $stuCount = \app\modules\student\models\StuMaster::find()->where(['is_status' => 0, 'stu_master_batch_id' => $v['fees_collect_batch_id']])->count();
         $fccTotal = \app\modules\fees\models\FeesCategoryDetails::getFeeCategoryTotal($v['fees_collect_category_id']);
         $cateWisePaid += $stuCount * $fccTotal;
     }
     $paidTotal = (new \yii\db\Query())->from('fees_payment_transaction fpt')->join('JOIN', 'fees_collect_category fcc', 'fpt.fees_pay_tran_collect_id = fees_collect_category_id')->where(['fcc.is_status' => 0, 'fpt.is_status' => 0])->sum('fpt.fees_pay_tran_amount');
     $paidPer = ' (' . ($cateWisePaid != 0 ? round($paidTotal * 100 / $cateWisePaid, 2) : 0) . '%)';
     $unPaidPer = ' (' . ($cateWisePaid != 0 ? round(($cateWisePaid - $paidTotal) * 100 / $cateWisePaid, 2) : 0) . '%)';
     $paidUnpaidData = [['name' => 'Paid' . $paidPer, 'y' => $paidTotal, 'color' => '#77C730'], ['name' => 'Unpaid' . $unPaidPer, 'y' => $cateWisePaid - $paidTotal, 'color' => '#F45B5B']];
     //Individual Fees Collection Category Wise
     $fcWiseDetails = (new \yii\db\Query())->select(['fees_collect_category_id', 'fees_collect_batch_id', "CONCAT(fcc.fees_collect_name,'(',bt.batch_name,')') AS fc_name"])->from('fees_collect_category fcc')->join('JOIN', 'batches bt', 'bt.batch_id = fcc.fees_collect_batch_id')->where(['fcc.is_status' => '0'])->orderBy('fcc.fees_collect_category_id DESC')->limit('10')->all();
     $fccTotal = $fccPaid = 0;
     foreach ($fcWiseDetails as $k => $v) {
         $stuCount = \app\modules\student\models\StuMaster::find()->where(['is_status' => 0, 'stu_master_batch_id' => $v['fees_collect_batch_id']])->count();
         $fccTotalTmp = \app\modules\fees\models\FeesCategoryDetails::getFeeCategoryTotal($v['fees_collect_category_id']);
         $fccPaidTmp = (new \yii\db\Query())->from('fees_payment_transaction fpt')->where(['fpt.is_status' => 0, 'fpt.fees_pay_tran_collect_id' => $v['fees_collect_category_id']])->sum('fpt.fees_pay_tran_amount');
         $fccTotal = $stuCount * $fccTotalTmp;
         $fccPaid = $fccPaidTmp === NULL ? 0 : $fccPaidTmp;
         $fccUnPaid = $fccTotal - $fccPaid;
         $fcCategory[] = $v['fc_name'];
         $paidData[] = $fccPaid;
         $unPaidData[] = $fccUnPaid;
     }
     $fccWisePaidUnPaid = [['name' => 'Paid Amount', 'data' => $paidData, 'color' => '#77C730'], ['name' => 'Unpaid Amount', 'data' => $unPaidData, 'color' => '#F45B5B']];
     //Recently fees transaction
     $feeRecent = (new \yii\db\Query())->select(['fpt.fees_pay_tran_id', 'fpt.fees_pay_tran_amount', 'stu_unique_id', "CONCAT(si.stu_first_name, ' ', si.stu_last_name) AS 'stu_name'", 'fcc.fees_collect_name', 'DATE_FORMAT(fpt.fees_pay_tran_date, "%d-%m-%Y") AS tranDate'])->from('fees_payment_transaction fpt')->join('JOIN', 'fees_collect_category fcc', 'fcc.fees_collect_category_id = fpt.fees_pay_tran_collect_id')->join('JOIN', 'stu_info si', 'si.stu_info_stu_master_id = fpt.fees_pay_tran_stu_id')->where(['fpt.is_status' => '0'])->orderBy('fees_pay_tran_id DESC')->limit(10)->all();
     return $this->render('index', ['feeRecent' => $feeRecent, 'courseWiseCollect' => $courseWiseCollect, 'paidUnpaidData' => $paidUnpaidData, 'fccWisePaidUnPaid' => $fccWisePaidUnPaid, 'fcCategory' => $fcCategory]);
 }
Beispiel #2
0
echo $orgData['org_name'];
?>
</td>
			</tr>
			<tr><td class="text-left org-address"><?php 
echo $orgData['org_address_line1'];
?>
</td></tr>
		</table>
		</td>
	</tr>
	<tr>
		<th colspan=3 class="border-none"> 
			<?php 
$paidAmount = $model->getStuTotalPayFees($_GET['sid'], $_GET['fcid']);
$totalAmount = \app\modules\fees\models\FeesCategoryDetails::getFeeCategoryTotal($_GET['fcid']);
echo $paidAmount < $totalAmount ? Yii::t('fees', "Partial Payment Fees Receipt") : Yii::t('fees', "Fees Receipt");
?>
		</th>
	</tr>
	<tr>
		<td class="text-left padding-left"><?php 
echo "<b> " . Yii::t('fees', "Student No :") . "</b> " . $stuData->stuMasterStuInfo->stu_unique_id;
?>
</td>
		<td></td>
		<td class="text-right padding-right"><?php 
echo "<b>" . Yii::t('fees', "Receipt Date :") . " </b>" . Yii::$app->formatter->asDate(date('Y-m-d'));
?>
</td>
	</tr>
Beispiel #3
0
?>
<html>
<head>
	<title><?php 
echo Yii::t('fees', 'Fees Collection Category Wise PDF Report');
?>
</title>
</head>
<body>
<?php 
$totalAmount = $gTotalAmount = $gpayFees = $gActualCollect = $payFees = $actualCollect = 0;
$stuDataTmp = Yii::$app->db->createCommand("SELECT stu_master_id FROM stu_master WHERE stu_master_batch_id=" . $FccModel->fees_collect_batch_id . " AND is_status=0")->queryColumn();
$payFeesTmp = Yii::$app->db->createCommand("SELECT fees_pay_tran_stu_id FROM fees_payment_transaction WHERE fees_pay_tran_batch_id=" . $FccModel->fees_collect_batch_id . " AND is_status=0 AND fees_pay_tran_collect_id=" . $FccModel->fees_collect_category_id)->queryColumn();
$stuData = array_unique(array_merge($stuDataTmp, $payFeesTmp));
$feesData = \app\modules\fees\models\FeesPaymentTransaction::find()->where(['fees_pay_tran_batch_id' => $FccModel->fees_collect_batch_id, 'is_status' => 0])->asArray()->all();
$totalAmountTmp = \app\modules\fees\models\FeesCategoryDetails::getFeeCategoryTotal($FccModel->fees_collect_category_id);
$totalAmount = !$totalAmountTmp ? 0 : $totalAmountTmp;
?>
<div class="grid-view">
<?php 
if (!empty($stuData)) {
    echo '<table class="table table-striped">';
    echo '<tr>';
    echo '<th class="text-center">' . Yii::t('fees', 'SI No.') . '</th>';
    echo '<th>' . Yii::t('fees', 'Student No') . '</th>';
    echo '<th>' . Yii::t('fees', 'Student Name') . '</th>';
    echo '<th>' . Yii::t('fees', 'Total Collection') . '</th>';
    echo '<th>' . Yii::t('fees', 'Paid Amount') . '</th>';
    echo '<th>' . Yii::t('fees', 'Unpaid Amount') . '</th>';
    echo '</tr>';
    $sr = 1;
Beispiel #4
0
echo GridView::widget(['dataProvider' => $currFeesData, 'layout' => "{items}\n{pager}", 'showOnEmpty' => true, 'emptyText' => Yii::t('fees', 'No current fees data available.'), 'columns' => [['class' => 'yii\\grid\\SerialColumn'], 'fees_collect_name', 'fees_collect_details', ['attribute' => 'fees_collect_start_date', 'value' => function ($data) {
    return Yii::$app->formatter->asDate($data['fees_collect_start_date']);
}], ['attribute' => 'fees_collect_end_date', 'value' => function ($data) {
    return Yii::$app->formatter->asDate($data['fees_collect_end_date']);
}], ['attribute' => 'fees_collect_due_date', 'value' => function ($data) {
    return Yii::$app->formatter->asDate($data['fees_collect_due_date']);
}], ['header' => 'Fees Details', 'format' => 'raw', 'value' => function ($data) {
    $fcdModel = \app\modules\fees\models\FeesCategoryDetails::find()->where(['is_status' => 0, 'fees_details_category_id' => $data->fees_collect_category_id])->asArray()->all();
    $tmp = '<ol>';
    foreach ($fcdModel as $value) {
        $tmp .= '<li>' . $value['fees_details_name'] . ' (' . $value['fees_details_amount'] . ') </li>';
    }
    $tmp .= '</ol>';
    return $tmp;
}], ['header' => Yii::t('fees', 'Total Amount'), 'value' => function ($data) {
    return \app\modules\fees\models\FeesCategoryDetails::getFeeCategoryTotal($data->fees_collect_category_id);
}], ['header' => Yii::t('fees', 'Total Paid Fees'), 'value' => function ($data) use($model, $stuData) {
    return $model->getStuTotalPayFees($stuData->stu_master_id, $data->fees_collect_category_id);
}]]]);
?>
    </div>
  </div>
</div>
<!-----End current batch fees details----->

<!-----Start student payment history block----->
<div class="col-xs-12" style="padding-top: 10px;">
    <div class="box box-info col-xs-12 col-lg-12 no-padding">
     <div class="box-header with-border">
	<h3 class="box-title"><i class="fa fa-inr"></i><sup><i class="fa fa-clock-o"></i></sup> <?php 
echo Yii::t('fees', 'Student Payment History');