// module.exports = (quotation, items, company, terms, summary) => {
    module.exports = (quotation, items, company, summary) => {
  return `
  <!DOCTYPE html>
  <html>
  <head>
    <meta charset="UTF-8" />
    <style>
      body { font-family: Arial; font-size: 12px; }
      table { width: 100%; border-collapse: collapse; }
      th, td { border: 1px solid #ddd; padding: 6px; }
    </style>
  </head>

  <body>

    <h2 style="text-align:center;">QUOTATION</h2>

    <div style="display:flex; justify-content:space-between;">
      <div><b>QTN ID:</b> ${quotation.quotation_number}</div>
      <div><b>Date:</b> ${new Date().toLocaleDateString()}</div>
    </div>

    <hr/>

    <h4>From:</h4>
    <p>${company.name}</p>
    <p>${company.address}</p>

    <h4>To:</h4>
    <p>${quotation.customer_name}</p>

    <table>
      <thead>
        <tr>
          <th>S.No</th>
          <th>Product</th>
          <th>Qty</th>
          <th>Rate</th>
          <th>Amount</th>
        </tr>
      </thead>

      <tbody>
        ${items.map((item, i) => `
          <tr>
            <td>${i + 1}</td>
            <td>${item.product_name}</td>
            <td>${item.qty}</td>
            <td>${item.rate}</td>
            <td>${item.qty * item.rate}</td>
          </tr>
        `).join("")}
      </tbody>
    </table>

    <br/>

    <div style="text-align:right;">
      <p>Subtotal: ₹ ${summary.subtotal}</p>
      <p>GST (${summary.gstPercent}%): ₹ ${summary.gst}</p>
      <h3>Total: ₹ ${summary.total}</h3>
    </div>

    <hr/>



  </body>
  </html>
  `;
};


    // <h4>Terms</h4>
    // ${terms.map((t, i) => `
    //   <p><b>${i + 1}. ${t.term}</b> - ${t.description}</p>
    // `).join("")}