Exemplo n.º 1
0
 public function get_id_view()
 {
     global $FANNIE_URL;
     $ret = '';
     $ret .= '<input onclick="location=\'GumLoanPayoffPage.php?id=' . $this->id . '&pdf=1\'; return false;"
                 type="button" value="Print" />';
     $ret .= '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;';
     $ret .= sprintf('<label for="issueCheckbox">Check has been issued</label> 
                     <input type="checkbox" onclick="return issueWarning();"
                     onchange="issueCheck(\'%s\');" id="issueCheckbox" %s />
                     <span id="issueDate">%s</span>', $this->id, $this->check_info->checkIssued() ? 'checked disabled' : '', $this->check_info->checkIssued() ? $this->check_info->issueDate() : '');
     $this->add_script('js/loan_payoff.js');
     if (file_exists('img/letterhead.png')) {
         $ret .= '<img src="img/letterhead.png" style="width: 100%;" />';
     }
     $ret .= '<p>Pursuant to the terms of your Promissory Note with WFC, below please find a check for the principal and, as applicable, compound interest due.   A statement showing the terms of your loan and annual compounding of the interest thereon is provided. If your loan was for more than 0.00% interest, also below is an IRS form 1099-INT to be included with your ' . date('Y') . ' federal tax filing.  If you have questions regarding this payment, please contact Financial Manager Dale Maiers (dmaiers@wholefoods.coop).  Thank you very much for your support.</p>';
     $ret .= '<div>';
     $ret .= '<table style="border: solid 1px black; border-collapse: collapse; width: 20%; float:left;">';
     $ret .= '<tr><td style="text-align:center; border: solid 1px black;"><b>Loan Amount</b><br />';
     $ret .= number_format($this->loan->principal(), 2);
     $ret .= '</td></tr>';
     $ret .= '<tr><td style="text-align:center; border: solid 1px black;"><b>Term</b><br />';
     $ret .= $this->loan->termInMonths() / 12 . ' Years';
     $ret .= '</td></tr>';
     $ret .= '<tr><td style="text-align:center; border: solid 1px black;"><b>Loan Date</b><br />';
     $ret .= date('m/d/Y', strtotime($this->loan->loanDate()));
     $ret .= '</td></tr>';
     $ret .= '<tr><td style="text-align:center; border: solid 1px black;"><b>Interest Rate</b><br />';
     $ret .= $this->loan->interestRate() * 100 . '%';
     $ret .= '</td></tr>';
     $ld = strtotime($this->loan->loanDate());
     $ed = mktime(0, 0, 0, date('n', $ld) + $this->loan->termInMonths(), date('j', $ld), date('Y', $ld));
     $ret .= '<tr><td style="text-align:center; border: solid 1px black;"><b>Maturity Date</b><br />';
     $ret .= date('m/d/Y', $ed);
     $ret .= '</td></tr>';
     $ret .= '</table>';
     $loan_info = GumLib::loanSchedule($this->loan);
     $ret .= '<table style="width: 75%; float: left;">';
     $ret .= '<tr>
             <td style="font-weight: bold; text-decoration: underline; text-align:center;">Ending Period</td>
             <td style="font-weight: bold; text-decoration: underline; text-align:center;">Days</td>
             <td style="font-weight: bold; text-decoration: underline; text-align:right;">Interest</td>
             <td style="font-weight: bold; text-decoration: underline; text-align:right;">Closing Balance</td>
             </tr>';
     foreach ($loan_info['schedule'] as $year) {
         $ret .= sprintf('<tr>
                         <td style="text-align:center;">%s</td>
                         <td style="text-align:center;">%s</td>
                         <td style="text-align:right;">%s</td>
                         <td style="text-align:right;">%s</td>
                         </tr>', $year['end_date'], $year['days'], number_format($year['interest'], 2), number_format($year['balance'], 2));
     }
     $ret .= sprintf('<tr>
                         <td style="text-align:right;">Total</td>
                         <td style="text-align:right;">%s</td>
                         <td style="text-align:right;">%s</td>
                         <td style="text-align:right;">%s</td>
                         </tr>', number_format($this->loan->principal(), 2), number_format($loan_info['total_interest'], 2), number_format($loan_info['balance'], 2));
     $ret .= '</table>';
     $ret .= '</div>';
     $ret .= '<div style="clear: left;"></div>';
     $ret .= '<hr />';
     $fields = array(1 => $loan_info['balance']);
     $this->settings->key('storeStateID');
     if ($this->settings->load()) {
         $fields[12] = $this->settings->value();
     }
     $this->settings->key('storeState');
     if ($this->settings->load()) {
         $fields[11] = $this->settings->value();
     }
     $ssn = 'Unknown';
     if ($this->taxid->load()) {
         $ssn = 'xxx-xx-' . $this->taxid->maskedTaxIdentifier();
     }
     $form = new GumTaxFormTemplate($this->custdata, $this->meminfo, $ssn, date('Y'), $fields, $this->loan->accountNumber());
     $ret .= $form->renderAsHTML();
     $ret .= '<hr />';
     $check = new GumCheckTemplate($this->custdata, $this->meminfo, $loan_info['balance'], 'Loan Repayment', $this->check_info->checkNumber());
     $ret .= $check->renderAsHTML();
     return $ret;
 }
Exemplo n.º 2
0
 public function get_id_view()
 {
     global $FANNIE_URL;
     $ret = '';
     $ret .= '<input onclick="location=\'GumEquityPayoffPage.php?id=' . $this->id . '&pdf=1\'; return false;"
                 type="button" value="Print" />';
     $ret .= '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;';
     $ret .= sprintf('<label for="issueCheckbox">Check has been issued</label> 
                     <input type="checkbox" onclick="return issueWarning();"
                     onchange="issueCheck(\'%s\');" id="issueCheckbox" %s />
                     <span id="issueDate">%s</span>', $this->id, $this->check_info->checkIssued() ? 'checked disabled' : '', $this->check_info->checkIssued() ? $this->check_info->issueDate() : '');
     $this->add_script('js/equity_payoff.js');
     if (file_exists('img/letterhead.png')) {
         $ret .= '<img src="img/letterhead.png" style="width: 100%;" />';
     }
     $ret .= '<p>
         Based on the terms of Wholefoods Community Coop Class C Stock you Payout Request has been received and approved by  our Board of Directors.  Please find attached a schedule of your most recent Class C activity as well as a check for the class C payout.  Thankyou for your continued support.  
         </p>';
     $ret .= '<table id="infoTable" cellspacing="0" cellpadding="4">';
     $ret .= '<tr><td colspan="3">Class C Schedule</td></tr>';
     $ret .= '<tr><td>Date</td><td>Shares</td><td>Total</td></tr>';
     foreach ($this->all->find('tdate') as $obj) {
         $ret .= sprintf('<tr class="%s">
                         <td>%s</td>
                         <td>%d</td>
                         <td>%s</td>
                         </tr>', $obj->shares() < 0 ? 'red' : '', date('m/d/Y', strtotime($obj->tdate())), $obj->shares(), number_format($obj->value(), 2));
         if ($obj->gumEquityShareID() == $this->id) {
             break;
         }
     }
     $ret .= '</table>';
     $ret .= '<hr />';
     $check = new GumCheckTemplate($this->custdata, $this->meminfo, $this->payoff->value() * -1, 'Class C Payout', $this->check_info->checkNumber());
     $ret .= $check->renderAsHTML();
     return $ret;
 }