{
    "config": {
        "inputFields": [
            {
                "weight": -1,
                "label": "invoiceNumber",
                "field": "field1",
                "type": "text",
                "value": "007"
            },
            {
                "weight": -1,
                "label": "clientName",
                "field": "field2",
                "type": "text",
                "value": "Test Company"
            },
            {
                "weight": -1,
                "label": "clientAddress1",
                "field": "field3",
                "type": "text",
                "value": "Street No. 7"
            },
            {
                "weight": -1,
                "label": "clientAddress2",
                "field": "field4",
                "type": "text",
                "value": "New York, 10001"
            },
            {
                "weight": -1,
                "label": "clientTax",
                "field": "field5",
                "type": "text",
                "value": "US87654"
            },
            {
                "weight": -1,
                "label": "descriptions",
                "field": "field6",
                "type": "text",
                "value": "Item 1 Description,Item 2 Description"
            },
            {
                "weight": -1,
                "label": "prices",
                "field": "field7",
                "type": "text",
                "value": "900,1200"
            },
            {
                "weight": -1,
                "label": "invoiceDate",
                "field": "field8",
                "type": "text",
                "value": "05.03.2025"
            },
            {
                "weight": -1,
                "label": "invoiceDueDate",
                "field": "field9",
                "type": "text",
                "value": "19.03.2025"
            },
            {
                "weight": -1,
                "label": "items",
                "field": "field10",
                "type": "text",
                "value": "[{\"price\": 100, \"hours\": 2, \"description\": \"Software Development\"}]"
            },
            {
                "label": "subTotal",
                "value": "200",
                "field": "field11",
                "weight": -1,
                "type": "text"
            },
            {
                "label": "taxAmount",
                "value": "28",
                "field": "field12",
                "weight": -1,
                "type": "text"
            },
            {
                "label": "total",
                "value": "238",
                "field": "field13",
                "weight": -1,
                "type": "text"
            }
        ],
        "method": "GET",
        "returnType": "PDF",
        "staticVars": [
            {
                "type": "text",
                "value": "<!DOCTYPE html>\n<html lang=\"en, id\">\n  <head>\n    <meta charset=\"UTF-8\" />\n    <meta http-equiv=\"X-UA-Compatible\" content=\"IE=edge\" />\n    <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\" />\n    <title>\n      A Simple Invoice Template Responsive and clean with HTML CSS SCSS\n    </title>\n    <link rel=\"preconnect\" href=\"https://fonts.gstatic.com\" crossorigin />\n    <link\n      href=\"https://fonts.googleapis.com/css2?family=Inter:wght@100;200;300;400;500;600;700;800;900&display=swap\"\n      rel=\"stylesheet\"\n    />\n    <style>\n      @media print {\n          body {\n              width: 210mm;\n              height: 297mm;\n              margin: 0;\n              padding: 20px;\n              font-size: 12pt;\n            line-height: 1.6;\n            font-family: Arial, sans-serif;\n            text-rendering: optimizeLegibility;\n          }\n      }\n      body { \n        height: 297mm;\n        margin: 0;\n        padding: 0px;\n        font-size: 12pt;\n        --main-font-size: 1.5vh;\n        \n    \n    \n      }\n\n      @import \"https://fonts.googleapis.com/css2?family=Inter:wght@100;200;300;400;500;600;700;800;900&display=swap\";\n      * {\n\n      margin: 0 auto;\n      padding: 0 auto;\n      }\n\n      body {\n        padding:40px;\n        min-height:100vh;\n        font-family: Arial, sans-serif;\n        /*\nfont-family: \"Inter\", -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Oxygen, Ubuntu, Cantarell, \"Open Sans\", \"Helvetica Neue\", sans-serif;\n        */\n      }\n\n      .wrapper-invoice {\n      display: flex;\n      justify-content: center;\n      }\n      .wrapper-invoice .invoice {\n      height: auto;\n      background: #fff;\n      margin-top: 5vh;\n      max-width: 110vh;\n      width: 100%;\n      box-sizing: border-box;\n      }\n      .wrapper-invoice .invoice .invoice-information {\n      float: right;\n      text-align: left;\n      width: auto;\n      display: inline-block;\n      }\n      .wrapper-invoice .invoice .invoice-information b {\n      color:#929292;\n      margin-left:0;\n      padding-right:10px;\n      }\n      .wrapper-invoice .invoice .invoice-information p {\n      font-size: var(--main-font-size);\n      color: gray;\n      display: flex;\n      justify-content: space-between;\n      }\n      .wrapper-invoice .invoice .invoice-information span {\n      margin-right: 0px;\n      }\n      .wrapper-invoice .invoice .invoice-logo-brand h2 {\n      text-transform: uppercase;\n      font-family: \"Inter\", -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Oxygen, Ubuntu, Cantarell, \"Open Sans\", \"Helvetica Neue\", sans-serif;\n      font-size: 2.9vh;\n      color: \"#0F172A\";\n      }\n      .wrapper-invoice .invoice .invoice-logo-brand img {\n      max-width: 200px;\n      width: 100%;\n      object-fit: fill;\n      }\n      .wrapper-invoice .invoice .invoice-head b{\n        color:#929292;\n      }\n      .wrapper-invoice .invoice .invoice-head {\n      display: flex;\n      margin-top: 8vh;\n      }\n      .wrapper-invoice .invoice .invoice-head .head {\n      width: 100%;\n      box-sizing: border-box;\n      }\n      .wrapper-invoice .invoice .invoice-head .client-info {\n      text-align: left;\n      }\n      .wrapper-invoice .invoice .invoice-head .client-info h2 {\n      font-weight: 500;\n      letter-spacing: 0.3px;\n      font-size: var(--main-font-size);\n      color: \"#0F172A\";\n      }\n      .wrapper-invoice .invoice .invoice-head .client-info p {\n      font-size: var(--main-font-size);\n      color: gray;\n      }\n      .wrapper-invoice .invoice .invoice-head .client-info .receiver-tax{\n        margin-top:10px;\n      }\n      .wrapper-invoice .invoice .invoice-head .client-data {\n      text-align: right;\n      }\n      .wrapper-invoice .invoice .invoice-head .client-data .sender-tax{\n        margin-top:10px;\n      }\n      .wrapper-invoice .invoice .invoice-head .client-data h2 {\n      font-weight: 500;\n      letter-spacing: 0.3px;\n      font-size: var(--main-font-size);\n      color: \"#0F172A\";\n      }\n      .wrapper-invoice .invoice .invoice-head .client-data p {\n      font-size: var(--main-font-size);\n      color: gray;\n      }\n      .wrapper-invoice .invoice .invoice-body {\n      margin-top: 8vh;\n      }\n      .wrapper-invoice .invoice .invoice-body .table {\n      border-collapse: collapse;\n      width: 100%;\n      }\n      .wrapper-invoice .invoice .invoice-body .table thead tr th {\n      font-size: var(--main-font-size);  \n      border: 1px solid #dcdcdc;\n      text-align: left;\n      padding: 1vh;\n      background-color: #eeeeee;\n      color:black;\n      }\n      .wrapper-invoice .invoice .invoice-body .table tbody tr td {\n      font-size: var(--main-font-size);\n      border: 1px solid #dcdcdc;\n      text-align: left;\n      padding: 1vh;\n      background-color: #fff;\n      }\n      .wrapper-invoice .invoice .invoice-body .table tbody tr td:nth-child(2) {\n      text-align: right;\n      }\n      .wrapper-invoice .invoice .invoice-body .flex-table {\n      display: flex;\n      }\n      .wrapper-invoice .invoice .invoice-body .flex-table .flex-column {\n      width: 100%;\n      box-sizing: border-box;\n      }\n      .wrapper-invoice .invoice .invoice-body .flex-table .flex-column .table-subtotal {\n      border-collapse: collapse;\n      box-sizing: border-box;\n      width: 100%;\n      margin-top: var(--main-font-size);\n      }\n      .wrapper-invoice .invoice .invoice-body .flex-table .flex-column .table-subtotal tbody tr td {\n      font-size: var(--main-font-size);\n      border-bottom: 1px solid #dcdcdc;\n      text-align: left;\n      padding: 1vh;\n      background-color: #fff;\n      }\n      .wrapper-invoice .invoice .invoice-body .flex-table .flex-column .table-subtotal tbody tr td:nth-child(2) {\n      text-align: right;\n      }\n      .wrapper-invoice .invoice .invoice-body .invoice-total-amount {\n      margin-top: 1rem;\n      margin-right: 10px;\n      }\n      .wrapper-invoice .invoice .invoice-body .invoice-total-amount p {\n      font-weight: bold;\n      color: \"#0F172A\";\n      text-align: right;\n      font-size: var(--main-font-size);\n      }\n      .wrapper-invoice .invoice .invoice-footer {\n          position: fixed;\n          bottom: 20px;\n          font-size:6px;\n          left:0;\n          width: 100%;\n          background: white;\n          text-align: center;\n      }\n      .wrapper-invoice .invoice .invoice-footer p {\n      font-size: 1.4vh;\n      color: gray;\n      text-align: center;\n      }\n\n      .copyright {\n      margin-top: 2rem;\n      text-align: center;\n      }\n      .copyright p {\n      color: gray;\n      font-size: 1.8vh;\n      }\n\n      @media print {\n      .table thead tr th {\n          -webkit-print-color-adjust: exact;\n          background-color: #eeeeee !important;\n      }\n\n      .copyright {\n          display: none;\n      }\n      }\n      .rtl {\n      direction: rtl;\n      font-family: \"Inter\", -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Oxygen, Ubuntu, Cantarell, \"Open Sans\", \"Helvetica Neue\", sans-serif;\n      }\n      .rtl .invoice-information {\n      float: left !important;\n      text-align: left !important;\n      }\n      .rtl .invoice-head .client-info {\n      text-align: right !important;\n      }\n      .rtl .invoice-head .client-data {\n      text-align: left !important;\n      }\n      .rtl .invoice-body .table thead tr th {\n      text-align: right !important;\n      }\n      .rtl .invoice-body .table tbody tr td {\n      text-align: right !important;\n      }\n      .rtl .invoice-body .table tbody tr td:nth-child(2) {\n      text-align: left !important;\n      }\n      .rtl .invoice-body .flex-table .flex-column .table-subtotal tbody tr td {\n      text-align: right !important;\n      }\n      .rtl .invoice-body .flex-table .flex-column .table-subtotal tbody tr td:nth-child(2) {\n      text-align: left !important;\n      }\n      .rtl .invoice-body .invoice-total-amount p {\n      text-align: left !important;\n      }\n    </style>\n  </head>\n  <body>\n    <section class=\"wrapper-invoice\">\n      <!-- switch mode rtl by adding class rtl on invoice class -->\n      <div class=\"invoice\">\n        <div class=\"invoice-information\">\n          <p>\n            <b>Invoice No.</b>\n            <span>{{invoiceNumber}}</span>\n          </p>\n          <p>\n            <b>Date</b>\n            <span>{{createdDate}}</span>\n          </p>\n          <p>\n            <b>Due Date</b>\n            <span>{{dueDate}}</span>\n          </p>\n        </div>\n        <!-- logo brand invoice -->\n        <div class=\"invoice-logo-brand\">\n          <!-- <h2>Tampsh.</h2> -->\n          <img src=\"https://www.technologycircle.io/images/TechnologyCircle-Logo-With-Text.png\" alt=\"\" />\n        </div>\n        <!-- invoice head -->\n        <div class=\"invoice-head\">\n          <div class=\"head client-info\">\n            <p><b style=\"color:black;\">To</b></p>\n            <p>{{ receiver.name }}</p>\n            <p>{{ receiver.address1 }}</p>\n            <p>{{ receiver.address2 }}</p>\n            <p class=\"receiver-tax\">{{ receiver.tax }}</p>\n          </div>\n          <div class=\"head client-data\">\n            <p><b style=\"color:black;\">From</b></p>\n            <p>{{ sender.name }}</p>\n            <p>{{ sender.address1 }}</p>\n            <p>{{ sender.address2 }}</p>\n            <p class=\"sender-tax\">{{ sender.tax }}</p>\n          </div>\n        </div>\n        <!-- invoice body-->\n        <div class=\"invoice-body\">\n          <table class=\"table\">\n            <thead>\n              <tr>\n                <th style=\"color:black;\">Description</th>\n                <th style=\"text-align:right;color:black\">Hours</th>\n                <th style=\"text-align:right;color:black\">Price</th>\n              </tr>\n            </thead>\n            <tbody>\n              {% for item in items %}\n              <tr>\n                <td>{{item.description}}</td>\n                <td style=\"text-align:right\">{{item.hours}}</td>\n                <td style=\"text-align:right\">{{item.price}} {{currency}}</td>\n              </tr>\n              {% endfor %}\n            </tbody>\n          </table>\n          <div class=\"flex-table\">\n            <div class=\"flex-column\"></div>\n            <div class=\"flex-column\">\n              <table class=\"table-subtotal\">\n                <tbody>\n                  <tr>\n                    <td>Subtotal</td>\n                    <td>\n                      {{ subTotal }} {{currency}}\n                    </td>\n                  </tr>\n                  <tr>\n                    <td>Tax {{taxRate}}%</td>\n                    <td>\n                      {{ taxAmount }} {{currency}}\n                    </td>\n                  </tr>\n                </tbody>\n              </table>\n            </div>\n          </div>\n          <!-- invoice total  -->\n          <div class=\"invoice-total-amount\">\n            <p>\n              Total : {{ total }}\n              {{currency}}\n            </p>\n          </div>\n        </div>\n        <!-- invoice footer -->\n        <div class=\"invoice-footer\">\n          <p>{{ footerText }} {{sender.name}}</p>\n          <br>\n          <p>IBAN {{ sender.iban }}, BIC {{ sender.bic }}</p>\n          <p>{{footerText2 }}</p>\n          <p>{{ sender.name}}, {{ sender.address1}}, {{ sender.address2}}</p>\n          <br>\n        </div>\n      </div>\n    </section>\n  </body>\n</html>\n",
                "label": "Template"
            }
        ]
    },
    "code": "const { HTML2PDF } = require(\"./utils\");\nconst nunjucks = require(\"nunjucks\");\n\nconst content = nunjucks.renderString(variables.Template, {\n  currency: \"€\",\n  items: JSON.parse(input.items),\n  taxRate: 19,\n  subTotal: input.subTotal,\n  taxAmount: input.taxAmount,\n  total: input.total,\n  invoiceNumber: input.invoiceNumber,\n  createdDate: input.invoiceDate,\n  dueDate: input.invoiceDueDate,\n  companyLogo: \"https://beta.customjs.space/customJS-logo.png\",\n  sender: {\n    name: \"Technology Circle GmbH\",\n    address1: \"Karolinenstraße 24 Haus 4\",\n    address2: \"20357 Hamburg\",\n    iban: \"IBAN SAMPLE\",\n    bic: \"BIC SAMPLE\"\n  },\n  receiver: {\n    name: input.clientName,\n    address1: input.clientAddress1,\n    address2: input.clientAddress2,\n    tax: input.clientTax,\n  },\n  footerText: \"2025© TechnologyCircle\",\n});\n\nreturn await HTML2PDF(content);\n",
    "name": "Generate Invoice",
    "description": " "
}