public function executeSimpanElse() { $i18n = new sfI18N(); $i18n->initialize($this->getContext()); $i18n->setCulture($this->getUser()->getCulture()); $action_i18n = $i18n->globalMessageFormat->format('save as new'); $action_type = $this->getRequestParameter('action_type'); $student = StudentPeer::retrieveByPk($this->getRequestParameter('student_id')); $this->forward404Unless($student); $amount_changed = 0; $tanggal = $this->getRequestParameter('thn') . '-' . $this->getRequestParameter('bln') . '-' . $this->getRequestParameter('tgl'); $tgl_code = $this->getRequestParameter('tgl') . $this->getRequestParameter('bln') . $this->getRequestParameter('thn'); $paids = $this->getRequestParameter('paid'); foreach ($paids as $ac_id => $paid) { if ($paid != null) { $payment_journal = new PaymentJournal(); $payment_journal->setPayer($student->getId()); $payment_journal->setAcademicCostId($ac_id); $ac_cost = AcademicCostPeer::retrieveByPK($ac_id); $payment_journal->setAcademicProcessId($ac_cost->getAcademicProcessId()); $payment_journal->setPaidAt($tanggal); $payment_journal->setPayerType(PaymentJournal::PAYER_TYPE_STUDENT); $payment_journal->setAmount($ac_cost->getAmount()); $payment_journal->setPaid($paid); $payment_journal->setReceivable($ac_cost->getAmount() - $paid); $payment_journal->setPaymentModelId($this->getRequestParameter('payment_model_id')); $payment_journal->setYear($this->getRequestParameter('thn')); $payment_journal->setTransactionStatusId(2); $payment_journal->save(); } } return $this->redirect('student_payment/previewElse?student_id=' . $student->getId() . '&tgl_code=' . $tgl_code . '&tgl=' . $tanggal . '&model=' . $this->getRequestParameter('payment_model_id')); }