<?xml version="1.0" encoding="UTF-8"?>
<xmlpanel>
    <configuration
        table="erpCommissions"
        searchDialog="idCommissionsSearchDialog"
        recordControlPattern="{0}"
        bookmarks="true"
        bookmarkTitle="Client: $idClient"
        history="true"
        historyTitle="Client: $idClient"
    >
        <primaryKey>
            <column name="nNr" type="INT" source="AUTO" />
        </primaryKey>
    </configuration>

    <searchDialog
        id="idCommissionsSearchDialog"
        title="Commissions search"
        autoResizeMode="AUTO_RESIZE_OFF"
        size="500 500"
        table="erpCommissions"
        where="erpCommissions.sStatus!='L'"
        orderBy="erpCommissions.dtCreation"
    >
        <primaryKey>
            <column name="nNr" type="INT" />
        </primaryKey>
        <column title="Client"                 field="nClientNr"           width="180" minWidth="10" maxWidth="200"
            joinTable="erpClients" joinKeyField="nNr" joinField="sCompany"/>
        <column title="Client commisssion nr." field="sClientCommissionNr" width="120" minWidth="10" maxWidth="150"/>
        <column title="Creation"               field="dtCreation"          width="70"  minWidth="10" maxWidth="90"
            type="DATE" pattern="MM-dd-yyyy"/>
        <column title="Destination"            field="dtDestination"       width="70"  minWidth="10" maxWidth="90"
            type="DATE" pattern="MM-dd-yyyy"/>
    </searchDialog>

    <searchDialog
        id="idClientSearchDialog"
        title="Client search"
        autoResizeMode="AUTO_RESIZE_OFF"
        size="420 500"
        table="erpClients"
        where="erpClients.sStatus='A'"
        orderBy="erpClients.sCompany"
        autoTruncation="END"
        incrementalSearchDelay="500"
    >
        <primaryKey>
            <column name="nNr" type="INT" />
        </primaryKey>
        <column title="Company" field="sCompany"     width="150" minWidth="10" maxWidth="200" id="idCompany"/>
        <column title="City"    field="sCity"        width="150" minWidth="10" maxWidth="200"/>
        <column title="Street"  field="sStreet"      width="150" minWidth="10" maxWidth="200"/>
        <column title="H.nr."   field="sHouseNumber" width="50"  minWidth="10" maxWidth="600"/>
        <extension class="de.aviantes.jaf.tool.client.CUDSearchDialogExtension"
            moduleID="idClients"
            editActionVisible="true"
            size="1024 800"/>
    </searchDialog>

    <panel id="main" widgetGroupID="">
        <label text="Client:"
            constraints="0 +0 1 1 0.0 0.0 EAST NONE 5 5 0 0 0 0"
        />
        <textField
            id="idClient"
            toolTipText="Client"
            constraints="1 +0 1 1 0.0 0.0 WEST NONE 5 5 0 0 0 0"
            obligatory="true"
            size="180 21"
            searchDialog="idClientSearchDialog"
            field="nClientNr"
            type="INT"
        >
            <masterWidget
                table="erpClients"
                showField="sCompany"
                where=""
                autoTruncation="END"
                searchDialogColumnID="idCompany"
            >
                <primaryKey type="SINGLE">
                    <column name="nNr"        type="INT"/>
                </primaryKey>
                <slaveWidget id="idClientCity"        mode="VALUE" field="sCity"        type="STRING" />
                <slaveWidget id="idClientStreet"      mode="VALUE" field="sStreet"      type="STRING" />
                <slaveWidget id="idClientHouseNumber" mode="VALUE" field="sHouseNumber" type="STRING" />
            </masterWidget>
            <incrementalSearch
                table="erpClients"
                where=""
                orderBy="sCompany"
                searchField="sCompany"
                maxRowCount="20"
                showTableHeader="true"
                searchDelay="0"
            >
                <primaryKey type="SINGLE">
                    <column name="nNr"        type="INT"/>
                </primaryKey>
                <column title="Company" field="sCompany" width="200"/>
                <column title="City"    field="sCity"    width="200"/>
            </incrementalSearch>
        </textField>
        <textField
            id="idClientCity"
            toolTipText="City of client"
            constraints="2 +0 1 1 0.0 0.0 WEST NONE 5 5 0 0 0 0"
            locked="true"
            size="150 21"
        />
        <textField
            id="idClientStreet"
            toolTipText="Street of client"
            constraints="3 +0 1 1 0.0 0.0 WEST NONE 5 5 0 0 0 0"
            locked="true"
            size="150 21"
        />
        <textField
            id="idClientHouseNumber"
            toolTipText="House number of client"
            constraints="4 +0 1 1 0.0 0.0 WEST NONE 5 5 0 0 0 0"
            locked="true"
            size="50 21"
        />

        <label text="Client commission number:"
            constraints="0 +1 1 1 0.0 0.0 EAST NONE 5 5 0 0 0 0"
        />
        <textField
            id="idClientCommissionNr"
            name="Client commission number"
            toolTipText="Client commission number"
            constraints="1 +0 1 1 0.0 0.0 WEST NONE 5 5 0 0 0 0"
            size="180 21"
            field="sClientCommissionNr"
            type="STRING"
        />

        <label text="Creation date:"
            constraints="0 +1 1 1 0.0 0.0 EAST NONE 5 5 0 0 0 0"
        />
        <dateField
            id="idCreationDate"
            name="Creation date"
            format="DATE"
            defaultValue="NOW"
            toolTipText="Creation date"
            constraints="1 +0 1 1 0.0 0.0 WEST NONE 5 5 0 0 0 0"
            size="75 21"
            field="dtCreation"
            type="DATE"
        />

        <label text="Destination date:"
            constraints="2 +0 1 1 0.0 0.0 EAST NONE 5 5 0 0 0 0"
        />
        <dateField
            id="idDestinationDate"
            name="Destination date"
            format="DATE"
            toolTipText="Destination date"
            constraints="3 +0 1 1 0.0 0.0 WEST NONE 5 5 0 0 0 0"
            size="75 21"
            field="dtDestination"
            type="DATE"
        />

        <label text="Remarks:"
            constraints="0 +1 1 1 0.0 0.0 NORTHEAST NONE 5 5 0 0 0 0"
        />
        <textArea
            id="idRemarks"
            name="Remarks"
            toolTipText="Remarks"
            constraints="1 +0 4 1 10.0 0.0 WEST HORIZONTAL 5 5 0 0 0 0"
            size="300 80"
            field="sRemarks"
            type="STRING"
        />

        <label
            text="Status:"
            constraints="0 +1 1 1 0.0 0.0 EAST NONE 5 5 5 0 0 0"
        />
        <comboBox
            id="idStatus"
            name="Status"
            constraints="1 +0 1 1 0.0 0.0 WEST NONE 5 5 5 0 0 0"
            defaultValue="0"
            field="sStatus"
            type="STRING"
        >
            <item value="0" text="composing" />
            <item value="1" text="open" />
            <item value="2" text="provided" />
            <item value="3" text="billed" />
            <item value="4" text="completed" />
            <item value="S" text="canceled" />
        </comboBox>
        
        <label text=""
            constraints="0 +1 5 1 1.0 1.0 WEST BOTH 0 0 0 0 0 0"
        />
    </panel>
</xmlpanel>