<core:FragmentDefinition
    xmlns="sap.m"
    xmlns:core="sap.ui.core"
    xmlns:table="sap.ui.table">
    <table:Table
        id="stockListBranchTable"
        selectionMode="None"
        ariaLabelledBy="title"
        enableBusyIndicator="true"
        visibleRowCountMode="Auto">
        <table:extension>
            <OverflowToolbar style="Clear">
                <Title
                    id="stockListBranchTableTitle"
                    text="{path: '$count'} {i18n>Dash.StockListTableTitle}" />
                <ToolbarSpacer />
                <Button
                    icon="sap-icon://excel-attachment"
                    tooltip="{i18n>Dash.ExcelExport}"
                    press="onStockListBranchExportPress" />
            </OverflowToolbar>
        </table:extension>
        <table:columns>
            <table:Column
                sortProperty="VKO_FILIALENAME"
                autoResizable="true"
            >
                <Label
                    text="{i18n>Dash.Branch}"
                    wrapping="true"
                    wrappingType="Hyphenated"
                />
                <table:template>
                    <Text
                        text="{VKO_FILIALENAME}"
                        tooltip="{VKO_FILIALENAME}"
                        wrapping="false"
                    />
                </table:template>
            </table:Column>
            <table:Column
                sortProperty="WARENGRUPPE_BEZEICHNUNG"
                autoResizable="true">
                <Label
                    text="{i18n>Dash.ProductGroup}"
                    wrapping="true"
                    wrappingType="Hyphenated" />
                <table:template>
                    <Text
                        text="{WARENGRUPPE_BEZEICHNUNG}"
                        wrapping="false" />
                </table:template>
            </table:Column>
            <table:Column
                sortProperty="ZMB_MATNR"
                autoResizable="true">
                <Label
                    text="{i18n>Dash.MaterialId}"
                    wrapping="true"
                    wrappingType="Hyphenated"
                />
                <table:template>
                    <Text
                        text="{
                            path: 'ZMB_MATNR',
                            targetType: 'any',
                            formatter: '.formatter.formatMaterialNumber'
                        }"
                        wrapping="false"
                    />
                </table:template>
            </table:Column>
            <table:Column
                sortProperty="BTX_TEXT"
                autoResizable="true">
                <Label
                    text="{i18n>Dash.MaterialName}"
                    wrapping="true"
                    wrappingType="Hyphenated"
                />
                <table:template>
                    <Text
                        text="{BTX_TEXT}"
                        tooltip="{BTX_TEXT}"
                        wrapping="false"
                    />
                </table:template>
            </table:Column>
            <table:Column
                sortProperty="BESTAND"
                autoResizable="true">
                <Label
                    text="{i18n>Dash.StockBranch}"
                    wrapping="true"
                    wrappingType="Hyphenated" />
                <table:template>
                    <Text
                        text="{BESTAND}"
                        wrapping="false" />
                </table:template>
            </table:Column>
            <table:Column
                sortProperty="THRESHOLD1"
                autoResizable="true">
                <Label
                    text="{i18n>Dash.4WeeksLimit}"
                    wrapping="true"
                    wrappingType="Hyphenated" />
                <table:template>
                    <FormattedText
                        htmlText="{
                            parts: [
                                {path: 'THRESHOLD1_PERCENTAGE', type: 'sap.ui.model.type.Float'},
                                {path: 'THRESHOLD1'}
                            ],
                            formatter: '.formatter.addPercentageValue'
                            }" />
                </table:template>
            </table:Column>
            <table:Column
                sortProperty="THRESHOLD2"
                autoResizable="true">
                <Label
                    text="{i18n>Dash.5To6WeeksLimit}"
                    wrapping="true"
                    wrappingType="Hyphenated" />
                <table:template>
                    <FormattedText
                        htmlText="{
                            parts: [
                                {path: 'THRESHOLD2_PERCENTAGE', type: 'sap.ui.model.type.Float'},
                                {path: 'THRESHOLD2'}
                            ],
                            formatter: '.formatter.addPercentageValue'
                            }" />
                </table:template>
            </table:Column>
            <table:Column
                sortProperty="THRESHOLD3"
                autoResizable="true">
                <Label
                    text="{i18n>Dash.MoreThan6Weeks}"
                    wrapping="true"
                    wrappingType="Hyphenated" />
                <table:template>
                    <FormattedText
                        htmlText="{
                            parts: [
                                {path: 'THRESHOLD3_PERCENTAGE', type: 'sap.ui.model.type.Float'},
                                {path: 'THRESHOLD3'}
                            ],
                            formatter: '.formatter.addPercentageValue'
                            }" />
                </table:template>
            </table:Column>
            <table:Column
                sortProperty="AVG_DWELL_TIME"
                autoResizable="true">
                <Label
                    text="{i18n>Dash.AverageDwellTime}"
                    wrapping="true"
                    wrappingType="Hyphenated" />
                <table:template>
                    <FormattedText
                        htmlText="{
                            parts: [
                                {path: 'AVG_DWELL_TIME', targetType : 'any'},
                                {path: 'i18n>Dash.Days'}
                            ],
                            formatter: '.formatter.formatAvgDwellTime'
                            }" />
                </table:template>
            </table:Column>
        </table:columns>
    </table:Table>
</core:FragmentDefinition>