<?xml version="1.0" encoding="UTF-8"?>
<!--
  Flatten Arrears - Excel JavaScript add-in manifest.

  https://kwb.dev.smart.ml is filled in when the container starts, from the ADDIN_URL
  environment variable (see docker-entrypoint.d/10-manifest.sh), so the same
  image can be deployed at any hostname.  The rendered file is served at
  https://<host>/manifest.xml - that is the file people sideload.
-->
<OfficeApp
  xmlns="http://schemas.microsoft.com/office/appforoffice/1.1"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xmlns:bt="http://schemas.microsoft.com/office/officeappbasictypes/1.0"
  xmlns:ov="http://schemas.microsoft.com/office/taskpaneappversionoverrides"
  xsi:type="TaskPaneApp">

  <Id>0be2d85c-8c48-4a59-98ce-1966f6e4fb7d</Id>
  <Version>2.0.0.0</Version>
  <ProviderName>KWB Property Management</ProviderName>
  <DefaultLocale>en-GB</DefaultLocale>
  <DisplayName DefaultValue="Flatten Arrears"/>
  <Description DefaultValue="Turns the banded 'Arrears Listing with Notes' export into a flat table with one row per invoice line."/>
  <IconUrl DefaultValue="https://kwb.dev.smart.ml/assets/icon-32.png"/>
  <HighResolutionIconUrl DefaultValue="https://kwb.dev.smart.ml/assets/icon-64.png"/>
  <SupportUrl DefaultValue="https://kwb.dev.smart.ml/"/>

  <AppDomains>
    <AppDomain>https://kwb.dev.smart.ml</AppDomain>
  </AppDomains>

  <Hosts>
    <Host Name="Workbook"/>
  </Hosts>

  <Requirements>
    <Sets DefaultMinVersion="1.7">
      <Set Name="ExcelApi" MinVersion="1.7"/>
    </Sets>
  </Requirements>

  <DefaultSettings>
    <SourceLocation DefaultValue="https://kwb.dev.smart.ml/taskpane.html"/>
  </DefaultSettings>

  <Permissions>ReadWriteDocument</Permissions>

  <VersionOverrides xmlns="http://schemas.microsoft.com/office/taskpaneappversionoverrides" xsi:type="VersionOverridesV1_0">
    <Hosts>
      <Host xsi:type="Workbook">
        <DesktopFormFactor>

          <GetStarted>
            <Title resid="GetStarted.Title"/>
            <Description resid="GetStarted.Description"/>
            <LearnMoreUrl resid="Help.Url"/>
          </GetStarted>

          <FunctionFile resid="Commands.Url"/>

          <ExtensionPoint xsi:type="PrimaryCommandSurface">
            <CustomTab id="KwbTab">

              <Group id="KwbArrearsGroup">
                <Label resid="Group.Arrears"/>
                <Icon>
                  <bt:Image size="16" resid="Icon.16"/>
                  <bt:Image size="32" resid="Icon.32"/>
                  <bt:Image size="80" resid="Icon.80"/>
                </Icon>

                <Control xsi:type="Button" id="KwbFlattenButton">
                  <Label resid="Flatten.Label"/>
                  <Supertip>
                    <Title resid="Flatten.Label"/>
                    <Description resid="Flatten.Tip"/>
                  </Supertip>
                  <Icon>
                    <bt:Image size="16" resid="Icon.16"/>
                    <bt:Image size="32" resid="Icon.32"/>
                    <bt:Image size="80" resid="Icon.80"/>
                  </Icon>
                  <Action xsi:type="ExecuteFunction">
                    <FunctionName>flattenReport</FunctionName>
                  </Action>
                </Control>

                <Control xsi:type="Button" id="KwbFlattenNewButton">
                  <Label resid="FlattenNew.Label"/>
                  <Supertip>
                    <Title resid="FlattenNew.Label"/>
                    <Description resid="FlattenNew.Tip"/>
                  </Supertip>
                  <Icon>
                    <bt:Image size="16" resid="Icon.16"/>
                    <bt:Image size="32" resid="Icon.32"/>
                    <bt:Image size="80" resid="Icon.80"/>
                  </Icon>
                  <Action xsi:type="ExecuteFunction">
                    <FunctionName>flattenToNewWorkbook</FunctionName>
                  </Action>
                </Control>

                <Control xsi:type="Button" id="KwbCsvButton">
                  <Label resid="Csv.Label"/>
                  <Supertip>
                    <Title resid="Csv.Label"/>
                    <Description resid="Csv.Tip"/>
                  </Supertip>
                  <Icon>
                    <bt:Image size="16" resid="Icon.16"/>
                    <bt:Image size="32" resid="Icon.32"/>
                    <bt:Image size="80" resid="Icon.80"/>
                  </Icon>
                  <Action xsi:type="ShowTaskpane">
                    <TaskpaneId>KwbCsvPane</TaskpaneId>
                    <SourceLocation resid="Taskpane.Csv.Url"/>
                  </Action>
                </Control>
              </Group>

              <Group id="KwbHelpGroup">
                <Label resid="Group.Help"/>
                <Icon>
                  <bt:Image size="16" resid="Icon.16"/>
                  <bt:Image size="32" resid="Icon.32"/>
                  <bt:Image size="80" resid="Icon.80"/>
                </Icon>

                <Control xsi:type="Button" id="KwbPanelButton">
                  <Label resid="Panel.Label"/>
                  <Supertip>
                    <Title resid="Panel.Label"/>
                    <Description resid="Panel.Tip"/>
                  </Supertip>
                  <Icon>
                    <bt:Image size="16" resid="Icon.16"/>
                    <bt:Image size="32" resid="Icon.32"/>
                    <bt:Image size="80" resid="Icon.80"/>
                  </Icon>
                  <Action xsi:type="ShowTaskpane">
                    <TaskpaneId>KwbPane</TaskpaneId>
                    <SourceLocation resid="Taskpane.Url"/>
                  </Action>
                </Control>
              </Group>

              <Label resid="Tab.Label"/>
            </CustomTab>
          </ExtensionPoint>

        </DesktopFormFactor>
      </Host>
    </Hosts>

    <Resources>
      <bt:Images>
        <bt:Image id="Icon.16" DefaultValue="https://kwb.dev.smart.ml/assets/icon-16.png"/>
        <bt:Image id="Icon.32" DefaultValue="https://kwb.dev.smart.ml/assets/icon-32.png"/>
        <bt:Image id="Icon.80" DefaultValue="https://kwb.dev.smart.ml/assets/icon-80.png"/>
      </bt:Images>

      <bt:Urls>
        <bt:Url id="Commands.Url" DefaultValue="https://kwb.dev.smart.ml/commands.html"/>
        <bt:Url id="Taskpane.Url" DefaultValue="https://kwb.dev.smart.ml/taskpane.html"/>
        <bt:Url id="Taskpane.Csv.Url" DefaultValue="https://kwb.dev.smart.ml/taskpane.html?a=csv"/>
        <bt:Url id="Help.Url" DefaultValue="https://kwb.dev.smart.ml/"/>
      </bt:Urls>

      <bt:ShortStrings>
        <bt:String id="Tab.Label" DefaultValue="Smart KWB"/>
        <bt:String id="Group.Arrears" DefaultValue="Arrears"/>
        <bt:String id="Group.Help" DefaultValue="Help"/>
        <bt:String id="Flatten.Label" DefaultValue="Flatten Report"/>
        <bt:String id="FlattenNew.Label" DefaultValue="Flatten to New Workbook"/>
        <bt:String id="Csv.Label" DefaultValue="Save Flat as CSV"/>
        <bt:String id="Panel.Label" DefaultValue="Open Panel"/>
        <bt:String id="GetStarted.Title" DefaultValue="Flatten Arrears is ready"/>
      </bt:ShortStrings>

      <bt:LongStrings>
        <bt:String id="Flatten.Tip" DefaultValue="Turns the open 'Arrears Listing with Notes' export into a flat table with one row per invoice line, on a new sheet called Flat."/>
        <bt:String id="FlattenNew.Tip" DefaultValue="Same as Flatten Report, but the flat table is put into a brand new workbook and the report file is left exactly as it was."/>
        <bt:String id="Csv.Tip" DefaultValue="Flattens the report and offers the flat table as a .csv file to save."/>
        <bt:String id="Panel.Tip" DefaultValue="Open the Flatten Arrears panel: all three actions, progress and what the tool does."/>
        <bt:String id="GetStarted.Description" DefaultValue="Open the exported arrears report and press Flatten Report on the Smart KWB tab."/>
      </bt:LongStrings>
    </Resources>
  </VersionOverrides>
</OfficeApp>
