Ejemplo n.º 1
0
	<tr class="row1">
		<td class="cell10"><div class="vstrut17"></div></td>
		<td class="cell10">Scadenza</td>
		<td class="cell10"><b><?php 
print $bond->scadenza();
?>
</b></td>
		<td class="cell10">&mdash;</td>
		<td class="cell10">&mdash;%</td>
	</tr>

	<tr class="row0">
		<td class="cell10"><div class="vstrut17"></div></td>
		<td class="cell10">Prossima cedola</td>
		<td class="cell10"><b><?php 
print $bond->next_coupon_date();
?>
</b></td>
		<td class="cell10"><?php 
$portfolio = new PortfolioStock();
$ports = $portfolio->find_all(array('where_clause' => "`isin` = '{$this->stock->isin}'"));
if (count($ports) > 0) {
    $port = $ports[0];
    $revenue = $bond->revenue($port->quantita);
    printf('%.2f %s', $revenue, $this->stock->divisa);
    if ($this->stock->divisa != 'EUR') {
        printf(' (%.2f EUR)', Change::convert($revenue, $this->stock->divisa));
    }
}
?>
</td>
Ejemplo n.º 2
0
 public function test_next_coupon_zero_yield()
 {
     $instance = new Bond(array('tasso' => 0));
     $this->assertEquals('&mdash;', $instance->next_coupon_date());
 }