<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
  <title><?lsmb text('Statement') ?></title>
  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
</head>
<body bgcolor=ffffff>

<?lsmb FOREACH customer IN data ?>
<?lsmb import(customer) ?>

<table width="100%">

  <?lsmb INCLUDE letterhead.html ?>
  
  <tr>
    <td width=10>&nbsp;</td>
    
    <th colspan=3><h4 style="text-transform:uppercase">
         <?lsmb text('Statement') ?></h4></th>
    
  </tr>

  <tr>
    <td>&nbsp;</td>
    
    <td colspan=3 align=right><?lsmb statementdate ?></td>
  </tr>
  
  <tr>
    <td>&nbsp;</td>
    
    <td>
      <table width="100%">
	<tr valign=top>
	  <td><?lsmb name ?>
	  <br><?lsmb address1 ?>
	  <?lsmb IF address2 ?>
	  <br><?lsmb address2 ?>
	  <?lsmb END ?>
	  <br><?lsmb city ?>
	  <?lsmb IF state ?>
	  , <?lsmb state ?>
	  <?lsmb END ?>
	  <?lsmb zipcode ?>
	  <?lsmb IF country ?>
	  <br><?lsmb country ?>
	  <?lsmb END ?>
	  <br>
          <?lsmb IF customerphone ?>
	  <br><?lsmb text('Tel: [_1],' customerphone) ?>
          <?lsmb END ?>
          <?lsmb IF customerfax ?>
	  <br><?lsmb text('Fax: [_1]', customerfax) ?>
          <?lsmb END ?>
          <?lsmb IF email ?>
	  <br><?lsmb email ?>
          <?lsmb END ?>
	  </td>
	</tr>
      </table>
    </td>
  </tr>
  
  <tr height=10></tr>
  
  <tr>
    <td>&nbsp;</td>
    
    <td>
      <table width="100%">
        <tr>
	  <th align=left><?lsmb text('Invoice #') ?></th>
          <th align=left><?lsmb text('Order#') ?></th>
	  <th width="10%"><?lsmb text('Date') ?></th>
	  <th width="10%"><?lsmb text('Due') ?></th>
	  <th width="10%"><?lsmb text('Current') ?></th>
	  <th width="10%"><?lsmb text('30') ?></th>
	  <th width="10%"><?lsmb text('60') ?></th>
	  <th width="10%"><?lsmb text('90') ?></th>
	</tr>
        
	<?lsmb FOREACH invnumber ?>
	<?lsmb loop_count = loop.count - 1 ?>
	<tr>
	  <td><?lsmb invnumber.${loop_count} ?></td>
          <td><?lsmb ordnumber.${loop_count} ?></td>
	  <td><?lsmb invdate.${loop_count} ?></td>
	  <td><?lsmb duedate.${loop_count} ?></td>
	  <td align=right><?lsmb c0.${loop_count} ?></td>
	  <td align=right><?lsmb c30.${loop_count} ?></td>
	  <td align=right><?lsmb c60.${loop_count} ?></td>
	  <td align=right><?lsmb c90.${loop_count} ?></td>
	</tr>
        <?lsmb END ?>
	
        <tr>
	  <td colspan=8><hr size=1></td>
	</tr>
	
	<tr>
	  <td>&nbsp;</td>
	  <td>&nbsp;</td>
          <td>&nbsp;</td>
          <td>&nbsp;</td>
	  <th align=right><?lsmb c0total ?></td>
	  <th align=right><?lsmb c30total ?></td>
	  <th align=right><?lsmb c60total ?></td>
	  <th align=right><?lsmb c90total ?></td>
	</tr>
      </table>
    </td>
  </tr>
  
  <tr height=10></tr>
  
  <tr>
    <td>&nbsp;</td>
    
    <td align=right>
      <table width="50%">
        <tr>
	  <th><?lsmb text('Total Outstanding') ?></th>
          <th align=right><?lsmb total ?></th>
	</tr>
      </table>
    </td>
  </tr>
  
  <tr>
    <td>&nbsp;</td>
    
    <td><hr noshade></td>
  </tr>
  
  <tr>
    <td>&nbsp;</td>
    <td><?lsmb text('All amounts in [_1] Funds', currency) ?>
    <br><?lsmb text('Please make check payable to [_1].', company) ?>
    </td>
  </tr>

</table>

<?lsmb END ?>
</body>
</html>

