{
  "version": 1,
  "name": "Data guide: invoice batch",
  "page": {
    "size": "Letter",
    "width": 612,
    "height": 792,
    "orientation": "portrait",
    "margins": {
      "top": 30,
      "right": 36,
      "bottom": 26,
      "left": 36
    }
  },
  "locale": "en-US",
  "defaultStyle": {
    "fontFamily": "Arimo",
    "fontSize": 8.5,
    "color": "#111827",
    "lineHeight": 1.2
  },
  "styles": {
    "title": {
      "fontSize": 18,
      "bold": true,
      "color": "#0f4c81",
      "align": "right",
      "letterSpacing": 0.3
    },
    "subtitle": {
      "fontSize": 8,
      "color": "#4b5563",
      "align": "right"
    },
    "company": {
      "fontSize": 11,
      "bold": true,
      "color": "#111827"
    },
    "companyAddr": {
      "fontSize": 7.5,
      "color": "#4b5563",
      "lineHeight": 1.3
    },
    "section": {
      "fontSize": 7.5,
      "bold": true,
      "color": "#ffffff",
      "background": "#0f4c81",
      "vAlign": "middle",
      "padding": {
        "top": 0,
        "right": 6,
        "bottom": 0,
        "left": 6
      },
      "letterSpacing": 0.4,
      "textTransform": "uppercase"
    },
    "label": {
      "fontSize": 6.5,
      "bold": true,
      "color": "#4b5563",
      "textTransform": "uppercase",
      "letterSpacing": 0.3
    },
    "value": {
      "fontSize": 9,
      "color": "#111827"
    },
    "valueStrong": {
      "fontSize": 10,
      "bold": true,
      "color": "#111827"
    },
    "body": {
      "fontSize": 8.5,
      "color": "#111827",
      "lineHeight": 1.3
    },
    "muted": {
      "fontSize": 7,
      "color": "#4b5563",
      "lineHeight": 1.3
    },
    "fine": {
      "fontSize": 6.5,
      "color": "#4b5563",
      "lineHeight": 1.3
    },
    "totalLabel": {
      "fontSize": 8.5,
      "color": "#4b5563",
      "align": "right",
      "vAlign": "middle",
      "padding": {
        "top": 0,
        "right": 6,
        "bottom": 0,
        "left": 6
      }
    },
    "totalValue": {
      "fontSize": 9,
      "color": "#111827",
      "align": "right",
      "vAlign": "middle",
      "padding": {
        "top": 0,
        "right": 6,
        "bottom": 0,
        "left": 6
      }
    },
    "grandLabel": {
      "fontSize": 10,
      "bold": true,
      "color": "#ffffff",
      "background": "#0f4c81",
      "align": "right",
      "vAlign": "middle",
      "padding": {
        "top": 0,
        "right": 6,
        "bottom": 0,
        "left": 6
      }
    },
    "grandValue": {
      "fontSize": 10,
      "bold": true,
      "color": "#ffffff",
      "background": "#0f4c81",
      "align": "right",
      "vAlign": "middle",
      "padding": {
        "top": 0,
        "right": 6,
        "bottom": 0,
        "left": 6
      }
    }
  },
  "fonts": [],
  "metadata": {
    "title": "Invoice {{ invoiceNumber }}",
    "author": "{{ company.name }}"
  },
  "bands": {
    "pageHeader": {
      "enabled": true,
      "height": 60,
      "printOn": "all",
      "elements": [
        {
          "id": "txt1",
          "type": "text",
          "x": 0,
          "y": 0,
          "width": 260,
          "height": 14,
          "text": "{{ company.name }}",
          "styleRef": "company"
        },
        {
          "id": "txt2",
          "type": "text",
          "x": 0,
          "y": 16,
          "width": 260,
          "height": 30,
          "text": "{{ company.address1 }}\n{{ company.city }}, {{ company.state }} {{ company.postalCode }}",
          "styleRef": "companyAddr"
        },
        {
          "id": "txt3",
          "type": "text",
          "x": 280,
          "y": 0,
          "width": 260,
          "height": 24,
          "text": "INVOICE",
          "styleRef": "title"
        },
        {
          "id": "txt4",
          "type": "text",
          "x": 280,
          "y": 26,
          "width": 260,
          "height": 12,
          "text": "{{ invoiceNumber }}",
          "styleRef": "subtitle",
          "style": {
            "fontSize": 10
          }
        },
        {
          "id": "ln1",
          "type": "line",
          "x": 0,
          "y": 54,
          "width": 540,
          "height": 0,
          "stroke": {
            "width": 1.5,
            "color": "#0f4c81"
          }
        }
      ]
    },
    "body": {
      "height": 210,
      "elements": [
        {
          "id": "txt5",
          "type": "text",
          "x": 0,
          "y": 0,
          "width": 260,
          "height": 14,
          "text": "Bill to",
          "styleRef": "section"
        },
        {
          "id": "box1",
          "type": "rect",
          "x": 0,
          "y": 14,
          "width": 260,
          "height": 52,
          "stroke": {
            "width": 0.5,
            "color": "#cbd5e1"
          }
        },
        {
          "id": "txt6",
          "type": "text",
          "x": 6,
          "y": 19,
          "width": 248,
          "height": 44,
          "text": "{{ billTo.name }}\n{{ billTo.address1 }}\n{{ billTo.city }}{{ billTo.state ? ', ' + billTo.state : '' }} {{ billTo.postalCode }}\n{{ billTo.country }}",
          "styleRef": "body",
          "overflow": "shrink"
        },
        {
          "id": "box2",
          "type": "rect",
          "x": 280,
          "y": 0,
          "width": 130,
          "height": 24,
          "stroke": {
            "width": 0.5,
            "color": "#cbd5e1"
          }
        },
        {
          "id": "txt7",
          "type": "text",
          "x": 284,
          "y": 3,
          "width": 122,
          "height": 9,
          "text": "Invoice date",
          "styleRef": "label"
        },
        {
          "id": "txt8",
          "type": "text",
          "x": 284,
          "y": 11,
          "width": 122,
          "height": 12,
          "text": "{{ formatDate(invoiceDate, 'MM/DD/YYYY') }}",
          "styleRef": "value",
          "overflow": "ellipsis"
        },
        {
          "id": "box3",
          "type": "rect",
          "x": 410,
          "y": 0,
          "width": 130,
          "height": 24,
          "stroke": {
            "width": 0.5,
            "color": "#cbd5e1"
          }
        },
        {
          "id": "txt9",
          "type": "text",
          "x": 414,
          "y": 3,
          "width": 122,
          "height": 9,
          "text": "Due date",
          "styleRef": "label"
        },
        {
          "id": "txt10",
          "type": "text",
          "x": 414,
          "y": 11,
          "width": 122,
          "height": 12,
          "text": "{{ formatDate(dueDate, 'MM/DD/YYYY') }}",
          "styleRef": "value",
          "overflow": "ellipsis"
        },
        {
          "id": "box4",
          "type": "rect",
          "x": 280,
          "y": 28,
          "width": 130,
          "height": 24,
          "stroke": {
            "width": 0.5,
            "color": "#cbd5e1"
          }
        },
        {
          "id": "txt11",
          "type": "text",
          "x": 284,
          "y": 31,
          "width": 122,
          "height": 9,
          "text": "PO number",
          "styleRef": "label"
        },
        {
          "id": "txt12",
          "type": "text",
          "x": 284,
          "y": 39,
          "width": 122,
          "height": 12,
          "text": "{{ poNumber }}",
          "styleRef": "value",
          "overflow": "ellipsis"
        },
        {
          "id": "box5",
          "type": "rect",
          "x": 410,
          "y": 28,
          "width": 130,
          "height": 24,
          "stroke": {
            "width": 0.5,
            "color": "#cbd5e1"
          }
        },
        {
          "id": "txt13",
          "type": "text",
          "x": 414,
          "y": 31,
          "width": 122,
          "height": 9,
          "text": "Terms",
          "styleRef": "label"
        },
        {
          "id": "txt14",
          "type": "text",
          "x": 414,
          "y": 39,
          "width": 122,
          "height": 12,
          "text": "{{ terms }}",
          "styleRef": "value",
          "overflow": "ellipsis"
        },
        {
          "id": "tbl1",
          "type": "table",
          "x": 0,
          "y": 80,
          "width": 540,
          "height": 50,
          "name": "Line items",
          "dataPath": "lines",
          "columns": [
            {
              "id": "col1",
              "header": "#",
              "value": "{{ index + 1 }}",
              "width": 28,
              "headerStyle": {
                "align": "right"
              },
              "footerStyle": {
                "align": "right"
              },
              "cellStyle": {
                "align": "right"
              }
            },
            {
              "id": "col2",
              "header": "SKU",
              "value": "{{ item.sku }}",
              "width": 92
            },
            {
              "id": "col3",
              "header": "Description",
              "value": "{{ item.description }}",
              "width": 227
            },
            {
              "id": "col4",
              "header": "Qty",
              "value": "{{ item.qty }}",
              "width": 43,
              "footer": "{{ sum(rows, 'qty') }}",
              "headerStyle": {
                "align": "right"
              },
              "footerStyle": {
                "align": "right"
              },
              "cellStyle": {
                "align": "right"
              }
            },
            {
              "id": "col5",
              "header": "Unit price",
              "value": "{{ formatCurrency(item.unitPrice, 'USD') }}",
              "width": 71,
              "headerStyle": {
                "align": "right"
              },
              "footerStyle": {
                "align": "right"
              },
              "cellStyle": {
                "align": "right"
              }
            },
            {
              "id": "col6",
              "header": "Amount",
              "value": "{{ formatCurrency(item.amount, 'USD') }}",
              "width": 79,
              "footer": "{{ formatCurrency(sum(rows, 'amount'), 'USD') }}",
              "headerStyle": {
                "align": "right"
              },
              "footerStyle": {
                "align": "right"
              },
              "cellStyle": {
                "align": "right"
              }
            }
          ],
          "showHeader": true,
          "repeatHeader": true,
          "headerHeight": 18,
          "rowHeight": 16,
          "showFooter": true,
          "footerHeight": 18,
          "headerStyle": {
            "fontSize": 7,
            "bold": true,
            "color": "#ffffff",
            "background": "#0f4c81",
            "vAlign": "middle",
            "padding": {
              "top": 2,
              "right": 4,
              "bottom": 2,
              "left": 4
            },
            "textTransform": "uppercase"
          },
          "cellStyle": {
            "fontSize": 8,
            "color": "#111827",
            "vAlign": "middle",
            "padding": {
              "top": 2,
              "right": 4,
              "bottom": 2,
              "left": 4
            }
          },
          "footerStyle": {
            "fontSize": 8,
            "bold": true,
            "color": "#111827",
            "background": "#dbe7f3",
            "vAlign": "middle",
            "padding": {
              "top": 2,
              "right": 4,
              "bottom": 2,
              "left": 4
            }
          },
          "altRowBackground": "#f5f8fb",
          "gridStroke": {
            "width": 0.5,
            "color": "#cbd5e1"
          }
        },
        {
          "id": "ln2",
          "type": "line",
          "x": 320,
          "y": 156,
          "width": 220,
          "height": 0,
          "stroke": {
            "width": 0.5,
            "color": "#cbd5e1"
          }
        },
        {
          "id": "txt15",
          "type": "text",
          "x": 320,
          "y": 140,
          "width": 121,
          "height": 16,
          "text": "Subtotal",
          "styleRef": "totalLabel"
        },
        {
          "id": "txt16",
          "type": "text",
          "x": 441,
          "y": 140,
          "width": 99,
          "height": 16,
          "text": "{{ formatCurrency(totals.subtotal, 'USD') }}",
          "styleRef": "totalValue"
        },
        {
          "id": "ln3",
          "type": "line",
          "x": 320,
          "y": 172,
          "width": 220,
          "height": 0,
          "stroke": {
            "width": 0.5,
            "color": "#cbd5e1"
          }
        },
        {
          "id": "txt17",
          "type": "text",
          "x": 320,
          "y": 156,
          "width": 121,
          "height": 16,
          "text": "Tax ({{ formatNumber(totals.taxRate * 100, 1) }}%)",
          "styleRef": "totalLabel"
        },
        {
          "id": "txt18",
          "type": "text",
          "x": 441,
          "y": 156,
          "width": 99,
          "height": 16,
          "text": "{{ formatCurrency(totals.tax, 'USD') }}",
          "styleRef": "totalValue"
        },
        {
          "id": "ln4",
          "type": "line",
          "x": 320,
          "y": 188,
          "width": 220,
          "height": 0,
          "stroke": {
            "width": 0.5,
            "color": "#cbd5e1"
          }
        },
        {
          "id": "txt19",
          "type": "text",
          "x": 320,
          "y": 172,
          "width": 121,
          "height": 16,
          "text": "Shipping",
          "styleRef": "totalLabel"
        },
        {
          "id": "txt20",
          "type": "text",
          "x": 441,
          "y": 172,
          "width": 99,
          "height": 16,
          "text": "{{ formatCurrency(totals.shipping, 'USD') }}",
          "styleRef": "totalValue"
        },
        {
          "id": "txt21",
          "type": "text",
          "x": 320,
          "y": 188,
          "width": 121,
          "height": 16,
          "text": "Total due",
          "styleRef": "grandLabel"
        },
        {
          "id": "txt22",
          "type": "text",
          "x": 441,
          "y": 188,
          "width": 99,
          "height": 16,
          "text": "{{ formatCurrency(totals.total, 'USD') }}",
          "styleRef": "grandValue"
        },
        {
          "id": "txt23",
          "type": "text",
          "x": 0,
          "y": 140,
          "width": 300,
          "height": 40,
          "name": "Notes",
          "text": "{{ notes }}",
          "styleRef": "body",
          "stretch": true,
          "visibleIf": "notes"
        }
      ]
    },
    "pageFooter": {
      "enabled": true,
      "height": 28,
      "printOn": "all",
      "elements": [
        {
          "id": "ln5",
          "type": "line",
          "x": 0,
          "y": 4,
          "width": 540,
          "height": 0,
          "stroke": {
            "width": 0.5,
            "color": "#9ca3af"
          }
        },
        {
          "id": "txt24",
          "type": "text",
          "x": 0,
          "y": 8,
          "width": 324,
          "height": 19,
          "text": "{{ company.name }} · Invoice {{ invoiceNumber }}",
          "styleRef": "fine"
        },
        {
          "id": "txt25",
          "type": "text",
          "x": 324,
          "y": 8,
          "width": 216,
          "height": 19,
          "text": "Page {{page}} of {{pages}}\nPrinted {{ formatDate(now, 'MM/DD/YYYY h:mm A') }}",
          "styleRef": "fine",
          "style": {
            "align": "right"
          }
        }
      ]
    }
  },
  "recordsPath": "invoices"
}
