Example #1
0
 public function executePaymentReceipt()
 {
     $id = $this->getRequestParameter('id');
     if (empty($id)) {
         echo 'ID Not Found';
         die;
     }
     $ta = TestApplicantPeer::retrieveByPK($id);
     if (empty($ta)) {
         echo 'Test Applicant Not Found';
         die;
     }
     $this->filename = $this->getActionName() . '_' . $ta->getName();
     $cw = new Criteria();
     $cw->add(DepartmentDetailPeer::DEPARTMENT_ID, $ta->getDepartment1());
     $this->department_detail = DepartmentDetailPeer::doSelectOne($cw);
     $c = new Criteria();
     $c->add(PaymentJournalPeer::PAYER, $ta->getId());
     $c->add(PaymentJournalPeer::PAYER_TYPE, PaymentJournal::PAYER_TYPE_APPLICANT);
     $payments = PaymentJournalPeer::doSelect($c);
     $this->payments = $payments;
     $this->ta = $ta;
     $this->ta_detail = $ta->getTestApplicantDetail();
     $this->setLayout(false);
     #$this->orientation = 'landscape';
     $this->papersize = 'a4';
     $this->setViewClass('sfDomPDF');
 }
Example #2
0
 public function executeRun()
 {
     $this->error = false;
     if (!$this->applicant) {
         $this->error = true;
         $this->messageError = 'Applicant Not Found';
         return false;
     }
     $ta = $this->applicant;
     $this->ta_detail = $ta->getTestApplicantDetail();
     if (!$this->ta_detail) {
         $this->error = true;
         $this->messageError = 'Applicant Detail Not Found';
         return false;
     }
     $cw = new Criteria();
     $cw->add(DepartmentDetailPeer::DEPARTMENT_ID, $ta->getDepartment1());
     $this->department_detail = DepartmentDetailPeer::doSelectOne($cw);
     if (!$this->department_detail) {
         $this->error = true;
         $this->messageError = 'Department not found';
         return false;
     }
     $c = new Criteria();
     $c->add(PaymentJournalPeer::PAYER, $ta->getId());
     $c->add(PaymentJournalPeer::PAYER_TYPE, PaymentJournal::PAYER_TYPE_APPLICANT);
     $payments = PaymentJournalPeer::doSelect($c);
     if (!$payments) {
         $this->error = true;
         $this->messageError = 'Payments not fond';
         return false;
     }
     $this->payments = $payments;
 }
Example #3
0
foreach ($months as $month) {
    ?>
						   <tr class="list<?php 
    ++$i;
    if ($i % 2 == 0) {
        echo ' even';
    }
    ?>
">
							<?php 
    $c = new Criteria();
    $c->add(PaymentJournalPeer::PAYER_TYPE, PaymentJournal::PAYER_TYPE_STUDENT);
    $c->add(PaymentJournalPeer::PAYER, $student->getId());
    $c->add(PaymentJournalPeer::ACADEMIC_COST_ID, $ac_cost->getId());
    $c->add(PaymentJournalPeer::MONTH, $month->getId());
    $payment = PaymentJournalPeer::doSelectOne($c);
    ?>
                            <td nowrap="nowrap" style="vertical-align:middle; text-align: center;">
								<?php 
    if ($payment) {
        echo link_to_remote(image_tag('delete.gif', 'title=Pembayaran Batal'), array('url' => 'student_payment/deleteSpp?id=' . $payment->getId() . '&student_id=' . $student->getId(), 'confirm' => __('Anda Yakin Akan Membatalkan Pembayaran SPP Bulan&nbsp;') . $month->getName() . '&nbsp;?', 'update' => 'content', 'script' => 'true'));
    } else {
        echo checkbox_tag('months', $month->getId(), false, array('id' => 'months'));
    }
    ?>
                            </td>
							<td style="vertical-align:middle;"><?php 
    echo $month->getName() ? $month->getName() : 'n/a';
    ?>
</td>
						   	<td style="text-align:right; vertical-align:middle;"><?php 
 public static function doSelectJoinAllExceptAcademicCost(Criteria $c, $con = null)
 {
     $c = clone $c;
     if ($c->getDbName() == Propel::getDefaultDB()) {
         $c->setDbName(self::DATABASE_NAME);
     }
     PaymentHistoryPeer::addSelectColumns($c);
     $startcol2 = PaymentHistoryPeer::NUM_COLUMNS - PaymentHistoryPeer::NUM_LAZY_LOAD_COLUMNS + 1;
     PaymentJournalPeer::addSelectColumns($c);
     $startcol3 = $startcol2 + PaymentJournalPeer::NUM_COLUMNS;
     $c->addJoin(PaymentHistoryPeer::PAYMENT_JOURNAL_ID, PaymentJournalPeer::ID);
     $rs = BasePeer::doSelect($c, $con);
     $results = array();
     while ($rs->next()) {
         $omClass = PaymentHistoryPeer::getOMClass();
         $cls = Propel::import($omClass);
         $obj1 = new $cls();
         $obj1->hydrate($rs);
         $omClass = PaymentJournalPeer::getOMClass();
         $cls = Propel::import($omClass);
         $obj2 = new $cls();
         $obj2->hydrate($rs, $startcol2);
         $newObject = true;
         for ($j = 0, $resCount = count($results); $j < $resCount; $j++) {
             $temp_obj1 = $results[$j];
             $temp_obj2 = $temp_obj1->getPaymentJournal();
             if ($temp_obj2->getPrimaryKey() === $obj2->getPrimaryKey()) {
                 $newObject = false;
                 $temp_obj2->addPaymentHistory($obj1);
                 break;
             }
         }
         if ($newObject) {
             $obj2->initPaymentHistorys();
             $obj2->addPaymentHistory($obj1);
         }
         $results[] = $obj1;
     }
     return $results;
 }
Example #5
0
 public function getPaymentJournalsJoinTransactionStatus($criteria = null, $con = null)
 {
     include_once 'lib/model/om/BasePaymentJournalPeer.php';
     if ($criteria === null) {
         $criteria = new Criteria();
     } elseif ($criteria instanceof Criteria) {
         $criteria = clone $criteria;
     }
     if ($this->collPaymentJournals === null) {
         if ($this->isNew()) {
             $this->collPaymentJournals = array();
         } else {
             $criteria->add(PaymentJournalPeer::ACADEMIC_COST_ID, $this->getId());
             $this->collPaymentJournals = PaymentJournalPeer::doSelectJoinTransactionStatus($criteria, $con);
         }
     } else {
         $criteria->add(PaymentJournalPeer::ACADEMIC_COST_ID, $this->getId());
         if (!isset($this->lastPaymentJournalCriteria) || !$this->lastPaymentJournalCriteria->equals($criteria)) {
             $this->collPaymentJournals = PaymentJournalPeer::doSelectJoinTransactionStatus($criteria, $con);
         }
     }
     $this->lastPaymentJournalCriteria = $criteria;
     return $this->collPaymentJournals;
 }
Example #6
0
 public function filterHistory($c, $filters)
 {
     $filters_key = array_keys($filters);
     foreach ($filters_key as $key) {
         $value = $filters[$key];
         if ($value == '' || $value == null) {
             continue;
         }
         if ($key == 'ACADEMIC_COST_COMPONENT_ID') {
             $c->addJoin(AcademicCostPeer::ACADEMIC_COST_COMPONENT_ID, AcademicCostComponentPeer::ID);
             $c->addJoin(PaymentJournalPeer::ACADEMIC_COST_ID, AcademicCostPeer::ID);
             $column = AcademicCostPeer::getTableMap()->getColumn($key);
         } elseif ($key == 'DEPARTMENT_ID') {
             $c->addJoin(DepartmentPeer::ID, CurriculumPeer::DEPARTMENT_ID);
             $c->addJoin(CurriculumPeer::ID, AcademicCalendarPeer::CURRICULUM_ID);
             $c->addJoin(AcademicCostPeer::ACADEMIC_CALENDAR_ID, AcademicCalendarPeer::ID);
             $c->addJoin(PaymentJournalPeer::ACADEMIC_COST_ID, AcademicCostPeer::ID);
             $column = CurriculumPeer::getTableMap()->getColumn($key);
         } elseif ($key == 'PAYER') {
             $c->addJoin(StudentPeer::ID, PaymentJournalPeer::PAYER);
             $c->addJoin(StudentPeer::CURRICULUM_ID, AcademicCalendarPeer::CURRICULUM_ID);
             $c->addJoin(AcademicCostPeer::ACADEMIC_CALENDAR_ID, AcademicCalendarPeer::ID);
             $c->addJoin(PaymentJournalPeer::ACADEMIC_COST_ID, AcademicCostPeer::ID);
             $column = StudentPeer::getTableMap()->getColumn('NAME');
         } elseif ($key == 'ACADEMIC_PROCESS_ID') {
             $c->addJoin(PaymentJournalPeer::ID, PaymentHistoryPeer::PAYMENT_JOURNAL_ID);
             $column = PaymentJournalPeer::getTableMap()->getColumn($key);
         } else {
             $column = PaymentHistoryPeer::getTableMap()->getColumn($key);
         }
         $name = $column->getFullyQualifiedName();
         $creoleType = $column->getCreoleType();
         if ($creoleType == CreoleTypes::TIMESTAMP) {
             $from = $value['from'];
             $to = $value['to'];
             $c2 = null;
             if ($from != '' && $from != null) {
                 $c->add($name, $from, Criteria::GREATER_EQUAL);
                 $c2 = $c->getCriterion($name);
             }
             if ($from != '' && $from != null && $to != '' && $to != null) {
                 $c3 = new Criterion($c, $name, $to, Criteria::LESS_EQUAL);
                 $c2->addAnd($c3);
             }
             if (($from == '' || $from == null) && $to != '' && $to != null) {
                 $c->add($name, $to, Criteria::LESS_EQUAL);
             }
         } else {
             if ($creoleType == CreoleTypes::INTEGER) {
                 $c->add($name, $value, Criteria::EQUAL);
             } else {
                 if ($creoleType == CreoleTypes::VARCHAR || $creoleType == CreoleTypes::CHAR) {
                     $c->add($name, "%{$value}%", Criteria::LIKE);
                 }
             }
         }
     }
 }
Example #7
0
 public function filterStudent($c, $filters)
 {
     $filters_key = array_keys($filters);
     foreach ($filters_key as $key) {
         $value = $filters[$key];
         if ($value == '' || $value == null) {
             continue;
         }
         if ($key == 'DEPARTMENT_ID') {
             $c->addJoin(AcademicCalendarPeer::ID, StudentPeer::ACADEMIC_CALENDAR_ID);
             $c->addJoin(DepartmentPeer::ID, AcademicCalendarPeer::DEPARTMENT_ID);
             $column = DepartmentPeer::getTableMap()->getColumn('ID');
         } elseif ($key == 'CLASS_NAME') {
             $c->addJoin(ClassGroupPeer::ID, StudentPeer::CLASS_GROUP_ID);
             $column = ClassGroupPeer::getTableMap()->getColumn('NAME');
         } elseif ($key == 'ACADEMIC_COST_COMPONENT_ID') {
             $c->addJoin(PaymentJournalPeer::PAYER, StudentPeer::ID);
             $c->addJoin(AcademicCostPeer::ID, PaymentJournalPeer::ACADEMIC_COST_ID);
             $c->addJoin(AcademicCostComponentPeer::ID, AcademicCostPeer::ACADEMIC_COST_COMPONENT_ID);
             $column = AcademicCostComponentPeer::getTableMap()->getColumn('ID');
         } elseif ($key == 'PAID_AT') {
             $c->addJoin(PaymentJournalPeer::PAYER, StudentPeer::ID);
             $column = PaymentJournalPeer::getTableMap()->getColumn('PAID_AT');
         } elseif ($key == 'STATUS') {
             $c->addJoin(PaymentJournalPeer::PAYER, StudentPeer::ID);
             $column = PaymentJournalPeer::getTableMap()->getColumn('STATUS');
         } elseif ($key == 'PAYMENT_MODEL_ID') {
             $c->addJoin(PaymentJournalPeer::PAYER, StudentPeer::ID);
             $c->addJoin(PaymentModelPeer::ID, PaymentJournalPeer::PAYMENT_MODEL_ID);
             $column = PaymentModelPeer::getTableMap()->getColumn('ID');
         } else {
             $column = StudentPeer::getTableMap()->getColumn($key);
         }
         $name = $column->getFullyQualifiedName();
         $creoleType = $column->getCreoleType();
         if ($creoleType == CreoleTypes::TIMESTAMP) {
             $c->add($name, $value, Criteria::EQUAL);
         } else {
             if ($creoleType == CreoleTypes::DATE) {
                 $c->add($name, $value, Criteria::EQUAL);
             } else {
                 if ($creoleType == CreoleTypes::INTEGER) {
                     if ($name == StudentPeer::CLASS_GROUP_ID) {
                         $cg = ClassGroupPeer::retrieveByPK($value);
                         $c->add($name, $cg->getChildRecurs(), Criteria::IN);
                     } else {
                         $c->add($name, $value, Criteria::EQUAL);
                     }
                 } else {
                     if ($creoleType == CreoleTypes::VARCHAR || $creoleType == CreoleTypes::CHAR) {
                         $c->add($name, "%{$value}%", Criteria::LIKE);
                     }
                 }
             }
         }
     }
 }
Example #8
0
 public function executePrintReceipt()
 {
     $journal_id = $this->getRequestParameter('id');
     $journal = PaymentJournalPeer::retrieveByPK($journal_id);
     $this->forward404Unless($journal);
     $this->journal = $journal;
     $this->papersize = 'gdscform';
     $this->orientation = 'portrait';
     $this->setViewClass('sfDomPDF');
 }
Example #9
0
 public function fromArray($arr, $keyType = BasePeer::TYPE_PHPNAME)
 {
     $keys = PaymentJournalPeer::getFieldNames($keyType);
     if (array_key_exists($keys[0], $arr)) {
         $this->setId($arr[$keys[0]]);
     }
     if (array_key_exists($keys[1], $arr)) {
         $this->setPayer($arr[$keys[1]]);
     }
     if (array_key_exists($keys[2], $arr)) {
         $this->setAcademicCostId($arr[$keys[2]]);
     }
     if (array_key_exists($keys[3], $arr)) {
         $this->setJobId($arr[$keys[3]]);
     }
     if (array_key_exists($keys[4], $arr)) {
         $this->setAcademicProcessId($arr[$keys[4]]);
     }
     if (array_key_exists($keys[5], $arr)) {
         $this->setAmount($arr[$keys[5]]);
     }
     if (array_key_exists($keys[6], $arr)) {
         $this->setCreatedAt($arr[$keys[6]]);
     }
     if (array_key_exists($keys[7], $arr)) {
         $this->setUpdatedAt($arr[$keys[7]]);
     }
     if (array_key_exists($keys[8], $arr)) {
         $this->setPayerType($arr[$keys[8]]);
     }
     if (array_key_exists($keys[9], $arr)) {
         $this->setReceivable($arr[$keys[9]]);
     }
     if (array_key_exists($keys[10], $arr)) {
         $this->setPaid($arr[$keys[10]]);
     }
     if (array_key_exists($keys[11], $arr)) {
         $this->setStatus($arr[$keys[11]]);
     }
     if (array_key_exists($keys[12], $arr)) {
         $this->setComments($arr[$keys[12]]);
     }
     if (array_key_exists($keys[13], $arr)) {
         $this->setPaymentModelId($arr[$keys[13]]);
     }
     if (array_key_exists($keys[14], $arr)) {
         $this->setTransactionStatusId($arr[$keys[14]]);
     }
     if (array_key_exists($keys[15], $arr)) {
         $this->setPaidAt($arr[$keys[15]]);
     }
     if (array_key_exists($keys[16], $arr)) {
         $this->setYear($arr[$keys[16]]);
     }
     if (array_key_exists($keys[17], $arr)) {
         $this->setMonth($arr[$keys[17]]);
     }
 }
Example #10
0
</th>
                    <th style="vertical-align: middle;"><?php 
echo __('Status');
?>
</th>
                </tr>
            </thead>
            <tbody>
            	<?php 
$c = new Criteria();
$c->add(PaymentJournalPeer::PAYER, $student->getId());
$c->add(PaymentJournalPeer::PAID_AT, $paid_at);
$c->add(PaymentJournalPeer::YEAR, $year);
$c->add(PaymentJournalPeer::TRANSACTION_STATUS_ID, 1);
$c->add(PaymentJournalPeer::ACADEMIC_COST_ID, $ac_cost->getId());
$payments = PaymentJournalPeer::doSelect($c);
?>
				<?php 
$i = 0;
foreach ($payments as $payment) {
    ?>
				<tr class="list<?php 
    ++$i;
    if ($i % 2 == 0) {
        echo ' even';
    }
    ?>
">
					<td style="vertical-align: middle;"><?php 
    #echo $i
    echo $i + ($pager->getPage() - 1) * $pager->getMaxPerPage();
Example #11
0
           </td>
        </tr>
        <tr>
           <td style="vertical-align:middle;"><label ><?php 
echo __('Total Kewajiban');
?>
</label></td>
           <td width="2%" style="text-align:center; vertical-align:middle;">:</td>
		   <td style="vertical-align:middle;">
		    <?php 
$cw = new Criteria();
$cw->add(PaymentJournalPeer::PAYER, $student->getId());
$cw->add(PaymentJournalPeer::PAID_AT, $tanggal1);
$cw->add(PaymentJournalPeer::PAYMENT_MODEL_ID, $model);
$cw->add(PaymentJournalPeer::TRANSACTION_STATUS_ID, 2);
$ps = PaymentJournalPeer::doSelect($cw);
?>
		   <?php 
$total_cost = 0;
foreach ($ps as $c) {
    $total_cost += $c->getAmount();
}
?>
           <p class="detail" style="font-weight: bold;"><?php 
echo 'Rp. ' . format_number($total_cost);
?>
</p>
           </td>
        </tr>
        <tr>
        	<td class="first" colspan="3" width="100%">
Example #12
0
 public static function retrieveByPKs($pks, $con = null)
 {
     if ($con === null) {
         $con = Propel::getConnection(self::DATABASE_NAME);
     }
     $objs = null;
     if (empty($pks)) {
         $objs = array();
     } else {
         $criteria = new Criteria();
         $criteria->add(PaymentJournalPeer::ID, $pks, Criteria::IN);
         $objs = PaymentJournalPeer::doSelect($criteria, $con);
     }
     return $objs;
 }
Example #13
0
 public function getPaymentJournal($con = null)
 {
     include_once 'lib/model/om/BasePaymentJournalPeer.php';
     if ($this->aPaymentJournal === null && $this->payment_journal_id !== null) {
         $this->aPaymentJournal = PaymentJournalPeer::retrieveByPK($this->payment_journal_id, $con);
     }
     return $this->aPaymentJournal;
 }
Example #14
0
 public function executeShow()
 {
     $group_id = $this->getContext()->getUser()->getAttribute('group_id', null, 'bo');
     $c = new Criteria();
     $c->add(JobPeer::CODE, $this->getModuleName());
     $job = JobPeer::doSelectOne($c);
     $acl = AclPeer::retrieveByPK($group_id, $job->getId());
     if (!$acl) {
         $this->forward('default', 'error404');
     }
     $payment_journal = PaymentJournalPeer::retrieveByPk($this->getRequestParameter('id'));
     $this->forward404Unless($payment_journal);
     $this->subtitle = $payment_journal->toString() . ' - id:' . $payment_journal->getId();
     $stu = StudentPeer::retrieveByPK($this->getContext()->getUser()->getAttribute('user_id', '', 'bo'));
     $actions = array(array('name' => 'back', 'url' => ' payment_journal_s/listByStudent?student_id=' . $stu->getId(), 'color' => 'white'));
     $this->actions = $actions;
     $this->payment_journal = $payment_journal;
 }
Example #15
0
 public function executeDelete()
 {
     $history_spp = PaymentJournalPeer::retrieveByPk($this->getRequestParameter('id'));
     $this->forward404Unless($history_spp);
     $ref_error = 0;
     foreach ($history_spp->getRefCountMethods() as $ref) {
         $method = "count" . $ref['affix'];
         $count = $history_spp->{$method}();
         if ($count > 0) {
             ++$ref_error;
             $this->getRequest()->setError('history_spp/delete/' . sfInflector::camelize($ref['table']), $count);
         }
     }
     if ($ref_error > 0) {
         $this->getRequest()->setError('history_spp/delete', '_ERR_DELETE_ (' . $history_spp->getStudent()->toString() . ' - id:' . $history_spp->getId() . ')');
     } else {
         $history_spp->delete();
     }
     return $this->forward('history_spp', 'list');
 }