<core:FragmentDefinition
    xmlns="sap.m"
    xmlns:core="sap.ui.core"
    xmlns:table="sap.ui.table">
    <table:Table
        id="stockListLocationTable"
        selectionMode="None"
        ariaLabelledBy="title"
        enableBusyIndicator="true"
        visibleRowCountMode="Auto">
        <table:extension>
            <OverflowToolbar style="Clear">
                <Title
                    id="stockListLocationTableTitle"
                    text="{path: '$count'} {i18n>Dash.StockListTableTitle}" />
                <ToolbarSpacer />
                <Button
                    icon="sap-icon://excel-attachment"
                    tooltip="{i18n>Dash.ExcelExport}"
                    press="onStockListLocationExportPress"/>
            </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="KUN_KUNNR"
                autoResizable="true">
                <Label
                    text="{i18n>Dash.CustomerNumber}"
                    wrapping="true"
                    wrappingType="Hyphenated" />
                <table:template>
                    <Text
                        text="{
                            path: 'KUN_KUNNR',
                            targetType: 'any',
                            formatter: '.formatter.lTrimZeros'
                        }"
                        wrapping="false"
                    />
                </table:template>
            </table:Column>
            <table:Column
                sortProperty="KUNDE"
                autoResizable="true">
                <Label
                    text="{i18n>Dash.Customer}"
                    wrapping="true"
                    wrappingType="Hyphenated" />
                <table:template>
                    <Text
                        text="{KUNDE}"
                        wrapping="false" />
                </table:template>
            </table:Column>
            <table:Column
                sortProperty="WEM_KUNWE"
                autoResizable="true">
                <Label
                    text="{i18n>Dash.GoodsRecipientId}"
                    wrapping="true"
                    wrappingType="Hyphenated" />
                <table:template>
                    <Text
                        text="{
                            path: 'WEM_KUNWE',
                            targetType: 'any',
                            formatter: '.formatter.lTrimZeros'
                        }"
                        wrapping="false"
                    />
                </table:template>
            </table:Column>
            <table:Column
                sortProperty="WARENEMPFAENGER"
                autoResizable="true">
                <Label
                    text="{i18n>Dash.GoodsRecipient}"
                    wrapping="true"
                    wrappingType="Hyphenated" />
                <table:template>
                    <Text
                        text="{WARENEMPFAENGER}"
                        tooltip="{WARENEMPFAENGER}"
                        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.StockGoodsRecipient}"
                    wrapping="true"
                    wrappingType="Hyphenated" />
                <table:template>
                    <Text
                        text="{BESTAND}"
                        wrapping="false" />
                </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>