code: def generate_report(book_url):
                      # commodity: CommodityOption(
                      #     section="Commodity",
                      #     sort_tag="a",
                      #     documentation_string="This is a stock",
                      #     default_value="VTIP"),
                      # commodity_list: CommodityListOption(
                      #     section="Commodity",
                      #     sort_tag="a",
                      #     documentation_string="This is a stock",
                      #     default_value="VTIP")
                      #):
      
      # Report variables
      shares_no = None
      avg_price = None
  
      stock_template = templates.load_jinja_template("stock_template.html")
      stock_rows = ""
  
      with piecash.open_book(book_url, readonly=True, open_if_lock=True) as book:
          # get all commodities that are not currencies.
          all_stocks = portfoliovalue.get_all_stocks(book)
          for stock in all_stocks:
              for_date = datetime.today().date
              model = portfoliovalue.get_stock_model_from(book, stock, for_date)
              stock_rows += stock_template.render(model)
  
      # Load HTML template file.
      template = templates.load_jinja_template("template.html")
      # Render the full report.
      #return template.format(**locals())
      result = template.render(**locals())
      return result
docs: Generates an HTML report content.