
{{~#*inline "format-money"~}}
{{money-amount money}} {{money.currency}}
{{~/inline~}}

{{~#*inline "format-date"~}}
{{date date format="MMM d, YYYY"}}
{{~/inline~}}

<html>
  <body>
    <h1>Your booking request was accepted!</h1>

    {{#with transaction}}
    <p>{{provider.display-name}} has accepted your booking request for {{listing.title}} from {{> format-date date=booking.start}} to {{> format-date date=booking.end}}.</p>

    <p>We have charged {{> format-money money=payin-total}} from your credit card. Here's your receipt.</p>

    <table>
      <thead>
        <tr>
          <th style="text-align: left;">Payment</th>
        </tr>
      </thead>
      <tbody>
      {{#each line-items}}
        {{#contains include-for "customer"}}
          <tr>
            {{#eq "day" code}}
            <td>{{> format-money money=unit-price}} &times; {{number quantity}} {{inflect quantity "day" "days"}}</td>
            <td style="padding-left: 20px;">{{> format-money money=line-total}}</td>
            {{/eq}}
            {{#eq "night" code}}
            <td>{{> format-money money=unit-price}} &times; {{number quantity}} {{inflect quantity "night" "nights"}}</td>
            <td style="padding-left: 20px;">{{> format-money money=line-total}}</td>
            {{/eq}}
          </tr>
        {{/contains}}
      {{/each}}
      </tbody>
      <tfoot>
        <tr>
          <th style="text-align: left;">Payment total</th>
          <th style="text-align: left; padding-left: 20px;">{{> format-money money=payin-total}}</th>
        </tr>
      </tfoot>
    </table>

    {{/with}}
  </body>
</html>