/** BODY */
  @Override
  public void initBody() {
    String addressHtml;
    String itemsHtml;

    String billAdrs =
        "<div align=\"left\">&nbsp;"
            + forUnusedAddress(memo.getCustomer().getName(), false)
            + "</div>";
    Address bill = memo.getBillingAddress();
    if (bill != null) {
      billAdrs =
          "<div align=\"left\">&nbsp;"
              + forUnusedAddress(memo.getCustomer().getName(), false)
              + forUnusedAddress(bill.getAddress1(), false)
              + forUnusedAddress(bill.getStreet(), false)
              + forUnusedAddress(bill.getCity(), false)
              + forUnusedAddress(bill.getStateOrProvinence(), false)
              + forUnusedAddress(bill.getZipOrPostalCode(), false)
              + bill.getCountryOrRegion()
              + "</div>";
    }

    addressHtml =
        "<table style=\"width: 100%; height: 100%;\" ><tr><td style=\"vertical-align: top;\" align=\"left\"><table style=\"width: 280px; height: 100%;\" class=\"gridHeader\"><colgroup><col></colgroup><tr><td class=\"gridHeaderBackGround\"><center>Credit To</center></td></tr><tr><td align=\"left\" style=\"vertical-align: top;padding: 6px;height:105px;\">"
            + billAdrs
            + "</td></tr></table>";

    String recordsHtml =
        "<tr class=\"item-row\"><td class=\"description\"><div></div></td><td class=\"qty\"><div></div></td><td><div class=\"cost\"></div></td><td><div class=\"price\"></div></td><td class=\"vatRate\"><span ></span></td><td class=\"vatAmount\"><div></div></td></tr>";
    if (!memo.getTransactionItems().isEmpty()) {
      recordsHtml = "";
      for (TransactionItem item : memo.getTransactionItems()) {
        recordsHtml =
            recordsHtml
                + "<tr class=\"item-row\"><td style=\"padding: 6px;\" class=\"description\"><div>"
                + forNullValue(item.getDescription())
                + "</div></td><td style=\"padding: 6px;\" align=\"right\" class=\"qty\"><div>"
                + (forZeroAmounts(
                    getDecimalsUsingMaxDecimals(
                        item.getQuantity().getValue(), null, maxDecimalPoints)))
                + "</div></td><td style=\"padding: 6px;\" align=\"right\"><div class=\"cost\">"
                + (forZeroAmounts(largeAmountConversation(item.getUnitPrice())))
                + "</div></td><td style=\"padding: 6px;\" align=\"right\"><div class=\"price\">"
                + largeAmountConversation(item.getLineTotal())
                + (company.getPreferences().isTrackTax()
                    ? "</div></td><td style=\"padding: 6px;\" align=\"right\" class=\"vatRate\"><span >"
                                + Utility.getVATItemRate(item.getTaxCode(), true)
                                + "%</span></td><td style=\"padding: 6px;\" align=\"right\" class=\"vatAmount\"><div>"
                                + item.getVATfraction()
                            == null
                        ? " "
                        : getDecimalsUsingMaxDecimals(item.getVATfraction(), null, 2)
                    : "")
                + "</div></td></tr>";
      }
    }
    itemsHtml =
        ("<table id=\"items\"><tr><th>Description</th><th>Qty</th><th>Unit Price</th><th>Total Price</th><th>VAT Rate</th><th>VAT Amount</th></tr>"
            + recordsHtml
            + "</table><table id=\"totals\"><tr><td class=\"blank\" style=\"padding: 5px;\">"
            + forNullValue(memo.getMemo())
            + "</td><td class=\"total-line\" >&nbsp;&nbsp;Sub Total</td><td class=\"total-value\"><div id=\"subtotal\">"
            + largeAmountConversation(memo.getNetAmount())
            + "&nbsp;&nbsp;</div></td></tr><tr><td class=\"blank\" ></td> <td class=\"total-line\" >&nbsp;&nbsp;VAT Total</td><td class=\"total-value\"><div id=\"total\">"
            + largeAmountConversation(memo.getTotal() - memo.getNetAmount())
            + "&nbsp;&nbsp;</div></td></tr><tr><td class=\"blank\" > </td><td class=\"total-line balance\">&nbsp;&nbsp;TOTAL</td><td class=\"total-value balance\"><div id=\"due\">"
            + largeAmountConversation(memo.getTotal())
            + "&nbsp;&nbsp;</div></td></tr></table>");

    bodyHtml = addressHtml + itemsHtml;
  }