<?lsmb#   This is a comment block; it's ignored by the template engine.

   Version:  1.2
   Date:     2025-10-29
   File:     invoice.html
   Set:      demo

Template version numbers are explicitly not aligned across templates or
releases. No explicit versioning was applied before 2021-01-04.

Version   Changes
1.1       Extended with 'shiptoattn' (at the attention of)
1.2       Add missing space before 'on' in tax specification row

-?>
<!DOCTYPE html>
<html>
<head>
  <meta name="generator" content="HTML Tidy for HTML5 for Linux version 5.6.0">
  <title><?lsmb text('Invoice') ?></title>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  <style type="text/css">
  span.c5 {font-size: 64%}
  span.c4 {font-size: 51%}
  tr.c3 {background-color: black}
  span.c2 {color: white}
  h4.c1 {text-transform:uppercase}
  </style>
</head>
<body>
  <table width="100%">
    <?lsmb INCLUDE letterhead ?>
    <tr>
      <th colspan="3">
        <h4 class="c1">
        <?lsmb IF reverse; text('Credit Invoice'); ELSE; text('Invoice'); END; ?></h4>
      </th>
    </tr>
    <tr>
      <td>
        <table width="100%" cellspacing="0" cellpadding="0">
          <tr class="c3">
            <th align="left" width="50%"><span class="c2"><?lsmb text('To') ?></span></th>
            <th align="left" width="50%"><span class="c2"><?lsmb text('Ship To') ?></span></th>
          </tr>
          <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 contact ?><br>
            <?lsmb contact ?><br>
            <?lsmb END ?> <?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>
            <td><?lsmb shiptoname ?><br>
            <?lsmb IF shiptoattn ?><?lsmb shiptoattn ?><br><?lsmb END ?>
            <?lsmb shiptoaddress1 ?> <?lsmb IF shiptoaddress2 ?><br>
            <?lsmb shiptoaddress2 ?> <?lsmb END ?><br>
            <?lsmb shiptocity ?> <?lsmb IF shiptostate ?> , <?lsmb shiptostate ?> <?lsmb END ?>
            <?lsmb shiptozipcode ?> <?lsmb IF shiptocountry ?><br>
            <?lsmb shiptocountry ?> <?lsmb END ?><br>
            <?lsmb IF shiptocontact ?><br>
            <?lsmb shiptocontact ?><br>
            <?lsmb END ?> <?lsmb IF shiptophone ?><br>
            <?lsmb text('Tel: [_1]', shiptophone) ?> <?lsmb END ?> <?lsmb IF shiptofax ?><br>
            <?lsmb text('Fax: [_1]', shiptofax) ?> <?lsmb END ?> <?lsmb IF shiptoemail ?><br>
            <?lsmb shiptoemail ?> <?lsmb END ?></td>
          </tr>
        </table>
      </td>
    </tr>
    <tr>
      <td></td>
    </tr>
    <tr>
      <td>
        <table width="100%" border="1">
          <tr>
            <th width="14%" align="left" nowrap><?lsmb text('Invoice #') ?></th>
            <th width="14%" align="left" nowrap><?lsmb text('Date') ?></th>
            <th width="14%" align="left" nowrap><?lsmb text('Due') ?></th>
            <th width="14%" align="left"><?lsmb text('Order #') ?></th>
            <th width="14%" align="left" nowrap><?lsmb text('Salesperson') ?></th>
            <th width="14%" align="left" nowrap><?lsmb text('Shipping Point') ?></th>
            <th width="14%" align="left" nowrap><?lsmb text('Ship via') ?></th>
          </tr>
          <tr>
            <td><?lsmb invnumber ?></td>
            <td><?lsmb invdate ?></td>
            <td><?lsmb duedate ?></td>
            <td><?lsmb ordnumber ?>&nbsp;</td>
            <td><?lsmb employee ?>&nbsp;</td>
            <td><?lsmb shippingpoint ?>&nbsp;</td>
            <td><?lsmb shipvia ?>&nbsp;</td>
          </tr>
        </table>
      </td>
    </tr>
    <tr>
      <td>
        <table width="100%">
          <tr class="c3">
            <th align="right"><span class="c2"><?lsmb text('Item') ?></span></th>
            <th align="left"><span class="c2"><?lsmb text('Number') ?></span></th>
            <th align="left"><span class="c2"><?lsmb text('Description') ?></span></th>
            <th>&nbsp;</th>
            <th align="right"><span class="c2"><?lsmb text('Qty') ?></span></th>
            <th>&nbsp;</th>
            <th align="right"><span class="c2"><?lsmb text('Unit Price') ?></span></th>
            <th align="right"><span class="c2"><?lsmb text('Disc %') ?></span></th>
            <th align="right"><span class="c2"><?lsmb text('Extended') ?></span></th>
          </tr><?lsmb FOREACH number ?><?lsmb loop_count = loop.index ?>
          <tr valign="top">
            <td align="right"><?lsmb runningnumber.${loop_count} ?>.</td>
            <td><?lsmb number.${loop_count} ?></td>
            <td><?lsmb item_description.${loop_count}.replace("\n","<br />") ?></td>
            <td><?lsmb deliverydate.${loop_count} ?></td>
            <td align="right"><?lsmb qty.${loop_count} ?></td>
            <td><?lsmb unit.${loop_count} ?></td>
            <td align="right"><?lsmb sellprice.${loop_count} ?></td>
            <td align="right"><?lsmb discountrate.${loop_count} ?></td>
            <td align="right"><?lsmb linetotal.${loop_count} ?></td>
          </tr><?lsmb END ?>
          <tr>
            <td colspan="9">
              <hr noshade>
            </td>
          </tr><?lsmb IF tax -?>
          <tr>
            <th colspan="7" align="right"><?lsmb text('Subtotal') ?></th>
            <td colspan="2" align="right"><?lsmb subtotal ?></td>
          </tr><?lsmb FOREACH tax ?><?lsmb loop_count = loop.index ?>
          <tr>
            <th colspan="7" align="right">
            <?lsmb taxdescription.${loop_count}.replace("\n","<br />") ?> on
            <?lsmb taxbase.${loop_count} ?> @ <?lsmb taxrate.${loop_count} ?> %</th>
            <td colspan="2" align="right"><?lsmb tax.${loop_count} ?></td>
          </tr><?lsmb END ?><?lsmb END -?>
          <tr>
            <th colspan="7" align="right"><?lsmb text('Total') ?></th>
            <td colspan="2" align="right"><?lsmb invtotal ?></td>
          </tr><?lsmb IF paymentdate.0 ?>
          <tr>
            <th colspan="7" align="right"><?lsmb text('Paid') ?></th>
            <td colspan="2" align="right">- <?lsmb paid ?></td>
          </tr>
          <tr>
            <td colspan="5">&nbsp;</td>
            <td colspan="4">
              <hr noshade>
            </td>
          </tr>
          <tr>
            <td colspan="5">&nbsp;</td>
            <th colspan="2" align="right" nowrap><?lsmb text('Balance') ?></th>
            <th colspan="2" align="right"><?lsmb total ?></th>
          </tr><?lsmb END ?>
        </table>
      </td>
    </tr>
    <tr>
      <td>
        <table width="100%">
          <tr valign="top">
            <?lsmb IF notes ?>
            <td>
              <?lsmb  FOREACH P IN notes.split('\n\n') ?>
              <p><?lsmb P ?></p><?lsmb END ?>
            </td><?lsmb END ?>
            <td><?lsmb text_amount ?>***** <?lsmb decimal ?>/100</td>
            <td align="right" nowrap><?lsmb text('All prices in [_1]', currency) ?></td>
          </tr>
        </table>
      </td>
    </tr><?lsmb IF paymentdate.0 ?>
    <tr>
      <td colspan="9">
        <table width="60%">
          <tr>
            <th align="left"><?lsmb text('Payments') ?></th>
          </tr>
          <tr>
            <td colspan="4">
              <hr noshade>
            </td>
          </tr>
          <tr>
            <th align="left"><?lsmb text('Date') ?></th>
            <th align="left"><?lsmb text('Account') ?></th>
            <th align="left"><?lsmb text('Source') ?></th>
            <th align="left"><?lsmb text('Amount') ?></th>
          </tr><?lsmb FOREACH payment ?><?lsmb loop_count = loop.index ?>
          <tr>
            <td><?lsmb paymentdate.${loop_count} ?></td>
            <td><?lsmb paymentaccount.${loop_count} ?></td>
            <td><?lsmb paymentsource.${loop_count} ?></td>
            <td><?lsmb payment.${loop_count} ?></td>
          </tr><?lsmb END ?>
        </table>
      </td>
    </tr><?lsmb END ?>
    <tr>
      <td></td>
    </tr>
    <tr>
      <th><?lsmb text('Thank you for your valued business!') ?></th>
    </tr>
    <tr>
      <td>
        <table width="100%">
          <tr valign="top">
            <td width="60%"><span class="c4"><?lsmb text('Payment due by [_1].', duedate) ?>
            <?lsmb text('Items returned are subject to a 10% restocking charge. A return authorization must be obtained from [_1] before goods are returned. Returns must be shipped prepaid and properly insured. [_1] will not be responsible for damages during transit.', company) ?></span></td>
            <td width="40%">
              X
              <hr noshade>
            </td>
          </tr>
        </table>
      </td>
    </tr><?lsmb FOREACH tax ?><?lsmb loop_count = loop.index ?>
    <tr>
      <th colspan="9" align="left"><span class=
      "c5"><?lsmb taxdescription.${loop_count}.replace("\n","<br />") ?>
      <?lsmb text('Registration [_1]', taxnumber.${loop_count}) ?></span></th>
    </tr><?lsmb END ?><?lsmb IF taxincluded ?>
    <tr>
      <td></td>
    </tr>
    <tr>
      <th colspan="8" align="left"><span class=
      "c5"><?lsmb text('Taxes shown are included in price.') ?></span></th>
    </tr><?lsmb END ?>
  </table>
</body>
</html>
