Ejemplo n.º 1
0
 /**
  * create an entry object for the transaction's entries
  */
 protected function generate_entry($payment)
 {
     $payment['receipt_number'] = \PSU\AR::generateReceiptNumber();
     $payment['balance'] = $payment['amount'] * $this->multiplier;
     $entry = new \PSU\AR\Receivable($payment);
     return $entry;
 }
Ejemplo n.º 2
0
 public static function add_memo($args)
 {
     if (!isset($args->pidm, $args->term_code, $args->date, $args->amount, $args->detail_code)) {
         throw new \Exception('Pidm, term_code, date, amount, and detail_code must be specified');
     }
     //end if
     $detail_code = \PSU\AR::detail_code($args->detail_code);
     $data = array('pidm' => $args->pidm, 'tran_number' => \PSU\AR\Memos::max_tran_number($args->pidm) + 1, 'term_code' => $args->term_code, 'detail_code' => $detail_code->detail_code, 'user' => 'PREBILLING', 'entry_date' => $args->date, 'desc' => $detail_code->desc, 'expiration_date' => strtotime('+5 days', $args->date), 'effective_date' => $args->date, 'activity_date' => $args->date, 'srce_code' => 'M', 'billing_ind' => 'N', 'create_user' => 'PREBILLING', 'amount' => $args->amount);
     $memo = new \PSU\AR\Memo($data);
     return $memo->save();
 }
Ejemplo n.º 3
0
 public function amount()
 {
     $sum = 0;
     foreach ($this->it as $item) {
         if (\PSU\AR::detail_code($item->detail_code)->type_ind == 'P') {
             $amount = -1 * $item->amount;
         } else {
             $amount = $item->amount;
         }
         //end else
         $sum += $amount;
     }
     return $sum;
 }
Ejemplo n.º 4
0
 /**
  * returns the detail description
  */
 public function detail_desc()
 {
     return \PSU\AR::detail_code($this->detail_code())->desc;
 }
Ejemplo n.º 5
0
 /**
  * returns the receivable's type indicator
  */
 public function type_ind()
 {
     return \PSU\AR::detail_code($this->detail_code)->type_ind;
 }
 public function accept()
 {
     $receivable = $this->current();
     return \PSU\AR::detail_code($receivable->detail_code)->dcat_code == 'MIS';
 }
Ejemplo n.º 7
0
 /**
  * initializes the bursar_term based on the student's level
  */
 private function _init_term()
 {
     // if grad, use grad level...otherwise default to ug
     if ($this->person->banner_roles['student_grad']) {
         $level = 'gr';
     } else {
         $level = 'ug';
     }
     //end if
     $this->term_code = \PSU\AR::bursar_term($level);
 }
Ejemplo n.º 8
0
 /**
  * parses payment plan data and inserts/updates memos for GR
  */
 public static function parsePaymentPlanGR($record, $data)
 {
     $term_code = \PSU\AR::bursar_term('gr');
     $record['expiration_date'] = strtotime('+5 days', $record['entry_date']);
     $newest_term = null;
     $terms = array();
     $contract_success = false;
     //
     // First, apply memos to terms from feed that have amounts
     //
     if ($record['amount'] = $data['fall_contract_balance']) {
         $terms[] = $record['term_code'] = self::convertPaymentPlanTerm($term_code, 'fall', 'GR');
         $contract_success = self::updateMemo($record);
         $record['tran_number']++;
         $newest_term = $record['term_code'] > $newest_term ? $record['term_code'] : $newest_term;
     }
     //end if
     if ($record['amount'] = $data['winter_contract_balance']) {
         $terms[] = $record['term_code'] = self::convertPaymentPlanTerm($term_code, 'winter', 'GR');
         $contract_success = self::updateMemo($record);
         $record['tran_number']++;
         $newest_term = $record['term_code'] > $newest_term ? $record['term_code'] : $newest_term;
     }
     //end if
     if ($record['amount'] = $data['spring_contract_balance']) {
         $terms[] = $record['term_code'] = self::convertPaymentPlanTerm($term_code, 'spring', 'GR');
         $contract_success = self::updateMemo($record);
         $record['tran_number']++;
         $newest_term = $record['term_code'] > $newest_term ? $record['term_code'] : $newest_term;
     }
     //end if
     if ($record['amount'] = $data['summer_contract_balance']) {
         $terms[] = $record['term_code'] = self::convertPaymentPlanTerm($term_code, 'summer', 'GR');
         $contract_success = self::updateMemo($record);
         $record['tran_number']++;
         $newest_term = $record['term_code'] > $newest_term ? $record['term_code'] : $newest_term;
     }
     //end if
     //
     // Now apply the pending payment
     //
     if ($data['funds_not_disbursed']) {
         $transaction = new \PSU\AR\Transaction\Memo($record['pidm'], $data['funds_not_disbursed']);
         $transaction->billable(TRUE);
         $transaction->split($record);
         return $transaction->save();
     }
     //end if
     return $contract_success;
 }
Ejemplo n.º 9
0
 public static function detail_codes()
 {
     return array('IYHE' => \PSU\AR::detail_code('IYHE'), 'IYHD' => \PSU\AR::detail_code('IYHD'), 'IYHT' => \PSU\AR::detail_code('IYHT'), 'IYHR' => \PSU\AR::detail_code('IYHR'));
 }