Exemple #1
0
<?php

$person = Person::model()->findByPk($loan->member);
$address = PersonAddress::model()->addressForPerson($person->primaryKey);
$loanType = Loans::model()->findByPk($loan->loan_type);
?>

<table>
    <tr>
        <td style="display:table-cell; text-align:justify; width:200px; height: 12px">
            <font style="font-family: sans-serif; font-weight: bold" size="11">Member’s Full Names:</font>
        </td>
        <td style="display:table-cell; text-align:justify; width:300px; height: 12px">
            <font style="font-family: sans-serif; font-weight: normal" size="11">
            <?php 
echo strtoupper("{$person->first_name} {$person->middle_name} {$person->last_name}");
?>
            </font>
        </td>
    </tr>

    <tr>
        <td style="display:table-cell; text-align:justify; width:200px; height: 12px">
            <font style="font-family: sans-serif; font-weight: bold" size="11">National Identity Card Number:</font>
        </td>
        <td style="display:table-cell; text-align:justify; width:300px; height: 12px">
            <font style="font-family: sans-serif; font-weight: normal" size="11">
            <?php 
echo $person->idno;
?>
            </font>
Exemple #2
0
 /**
  * Analyze parameters that define applied loan
  * 
  * @param type $attribute
  */
 public function respectiveLoanParameters($attribute)
 {
     $this->net_pay_after_loan_repayment = null;
     $loan = Loans::model()->defaultLoanParameters($this->{$attribute});
     if ($this->repayment_period > $loan->repayment_period) {
         $this->addError('repayment_period', $this->getAttributeLabel('repayment_period') . " must not exceed {$loan->repayment_period}");
     }
     if ($this->closed != 'Yes') {
         $this->interest_rate = $loan->interest_rate;
         $this->max_repayment_period = $loan->repayment_period;
     }
     $totalContributions = ContributionsByMembers::model()->netTotalMemberContribution($this->member, $this->borrowingDate($this));
     $available = Loans::model()->availableLoan($loan, $totalContributions);
     if ($this->amout_borrowed > $available) {
         $this->addError('amout_borrowed', "Your available loan amount is KShs. {$available}");
     } else {
         if (!empty($this->amout_borrowed)) {
             if (empty($this->present_net_pay)) {
                 $this->addError('amout_borrowed', $this->getAttributeLabel('present_net_pay') . " is required");
             } else {
                 if (empty($this->repayment_period)) {
                     $this->addError('amout_borrowed', $this->getAttributeLabel('repayment_period') . " is required");
                 } else {
                     $amount = LoanRepayments::model()->amountDue($this->amout_borrowed, $this->interest_rate, $this->borrowingDate($this), $this->repaymentDate($this->borrowingDate($this), $this->repayment_period), 0);
                     $monthlyRepaymentAmount = round($amount / $this->repayment_period, 2);
                     if (Loans::model()->oneThirdRule($monthlyRepaymentAmount, $loan->one_third, $this->basic_pay) == true) {
                         $this->addError('amout_borrowed', $this->getAttributeLabel('amout_borrowed') . " exceeds the One-Third Rule requirement");
                     } else {
                         $this->net_pay_after_loan_repayment = $this->present_net_pay - $monthlyRepaymentAmount;
                     }
                 }
             }
         }
     }
 }
<?php

$member = Person::model()->findByPk($model->member);
$witness = Person::model()->findByPk($model->witness);
if ($model->loan_type == 4) {
    $guarantor1 = Person::model()->findByPk($model->guarantor1);
    $guarantor2 = Person::model()->findByPk($model->guarantor2);
}
$address = PersonAddress::model()->find('person_id=:id', array(':id' => $model->member));
$loan = Loans::model()->findByPk($model->loan_type);
$contributions = ContributionsByMembers::model()->netTotalMemberContribution($model->member, date('Y') . '-' . date('m') . '-' . date('d'));
?>
<div style="height: 400px; border-right: 3px solid #4f99c6">

    <?php 
if ($model->closed != 'Yes' && empty($model->close_date)) {
    ?>
        <div style="height: 20px; text-align: center">
            <b><?php 
    echo "{$member->last_name} {$member->first_name} {$member->middle_name}";
    ?>
</b>
        </div>

        <div style="height: 360px; overflow-y: scroll">

            <?php 
    $form = $this->beginWidget('CActiveForm', array('id' => 'loan-applications-form', 'enableAjaxValidation' => false));
    ?>

Exemple #4
0
    echo $form->labelEx($model, 'repayment_period');
    ?>
</td>
        <td>&nbsp;</td>
        <td>
            <?php 
    if ($others['readOnly'] == true) {
        ?>
                <?php 
        echo $form->textField($model, 'repayment_period', array('value' => "{$model->repayment_period} Months", 'required' => true, 'style' => 'text-align:center', 'readonly' => $others['readOnly']));
        ?>
            <?php 
    } else {
        ?>
                <?php 
        $loan = Loans::model()->defaultLoanParameters($model->loan_type);
        for ($i = 1; $i <= $loan->repayment_period; $i++) {
            $months[$i]['id'] = $i;
            $months[$i]['val'] = "{$i} Months";
        }
        $months = CHtml::listData($months, 'id', 'val');
        echo $form->dropDownList($model, 'repayment_period', $months, array('prompt' => '-- Months --', 'required' => true, 'style' => 'text-align:center', 'readonly' => $others['readOnly']));
        ?>
            <?php 
    }
    ?>
        </td>
        <td>&nbsp;</td>
    </tr>
    <tr>
        <td>&nbsp;</td>
Exemple #5
0
 /**
  * Retuen a required loan type
  * 
  * @param int $pk
  * @return \Loans
  */
 public function returnARequiredLoan($pk)
 {
     return Loans::model()->findByPk($pk);
 }
<?php

$lastDate = $endDate;
$loanType = Loans::model()->findByPk($loanApplication->loan_type);
?>

<table>
    <tr>
        <td style="display:table-cell; text-align:justify; width:50px; height: 12px">
            <font style="font-family: sans-serif; font-weight: bold" size="11">Name:</font>
        </td>
        <td style="display:table-cell; text-align:justify; width:450px; height: 12px">
            <font style="font-family: sans-serif; font-weight: normal" size="11">
            <?php 
echo strtoupper("{$person->first_name} {$person->middle_name} {$person->last_name}");
?>
            </font>
        </td>
    </tr>

    <tr>
        <td style="display:table-cell; text-align:justify; width:100px; height: 12px">
            <font style="font-family: sans-serif; font-weight: bold" size="11">National ID. No.: </font>
        </td>
        <td style="display:table-cell; text-align:justify; width:80px; height: 12px">
            <font style="font-family: sans-serif; font-weight: normal" size="11">
            <?php 
echo $person->idno;
?>
            </font>
        </td>
Exemple #7
0
                        <td style="text-align: center">Loan</td>
                        <td style="text-align: center">Date</td>
                        <td style="text-align: center">Balance</td>
                        <td style="text-align: center">Repayment</td>
                    </tr>
                    <?php 
foreach ($loansMemberIsServicing as $loanApplicationId => $loanMemberIsServicing) {
    ?>
                        <?php 
    if (get_class($loanMemberIsServicing) == 'LoanRepayments') {
        $model = $loanMemberIsServicing;
        $loanMemberIsServicing = LoanApplications::model()->findByPk($loanApplicationId);
    }
    ?>
                        <?php 
    $loan = Loans::model()->findByPk($loanMemberIsServicing->loan_type);
    ?>
                        <?php 
    $amountDue = LoanApplications::model()->computeTotals(array($loanMemberIsServicing), $date);
    ?>
                        <tr>
                            <td><?php 
    echo $loan->loan_type;
    ?>
</td>
                            <td style="text-align: center"><?php 
    echo $loanMemberIsServicing->close_date;
    ?>
</td>
                            <td style="text-align: center"><?php 
    echo $form->textField($model, "[{$loanMemberIsServicing->primaryKey}]balance", array('size' => 8, 'value' => $amountDue, 'readonly' => true, 'style' => 'text-align: center'));