<?xml version="1.0" encoding="UTF-8"?>
<database version="01.12.2009 13:36" dataDir="data">
    <!-- Article -->
    <table name="erpArticle" description="Article">
        <column name="nNr"                type="int"                    nullable="false" description="Number"/>
        <column name="sArticleNumber"     type="varchar"  length="16"   nullable="true"  description="Article number"/>
        <column name="sName"              type="varchar"  length="32"   nullable="false" description="Name"/>
        <column name="nArticleGroupNr"    type="int"                    nullable="false" description="Number of article group from table erpArticleGroups"/>
        <column name="nStorageLocationNr" type="int"                    nullable="true"  description="Number of storage location from tabee erpStorageLocations"/>
        <column name="fPrice"             type="float"                  nullable="true"  description="Price per dimension unit"/>
        <column name="fActualInventory"   type="double"                 nullable="true"  description="Actual quantity in storage"/>
        <column name="fOrderInventory"    type="double"                 nullable="true"  description="Quantity which initiates an order"/>
        <column name="fOrderQuantity"     type="double"                 nullable="true"  description="Order quantity"/>
        <column name="nDimensionNr"       type="int"                    nullable="false" description="Number of Dimension from table erpDimensions"/>
        <column name="nVendorNr"          type="int"                    nullable="true"  description="Number of Lieferanten from table erpVendors"/>
        <column name="dtAdmittance"       type="datetime"               nullable="true"  description="Date when articles was admitted"/>
        <column name="sRemarks"           type="varchar"  length="1024" nullable="true"  description="Remarks"/>
        <column name="sStatus"            type="char"     length="1"    nullable="true"  description="Status: 'A'ctive, 'I'nactive, de'L'eted"/>
        <primaryKey name="pk_erpArticle">
            <column name="nNr"/>
        </primaryKey>
    </table>

    <!-- Article groups -->
    <table name="erpArticleGroups" description="Article groups">
        <column name="nNr"          type="int"                    nullable="false" description="Number"/>
        <column name="sName"        type="varchar"  length="32"   nullable="false" description="Name"/>
        <column name="sDescription" type="varchar"  length="1024" nullable="true"  description="Detailed description"/>
        <column name="nPosition"    type="int"                    nullable="true"  description="Position for chronological order"/>
        <column name="sStatus"      type="char"     length="1"    nullable="true"  description="Status: 'A'ctive, 'I'nactive, de'L'eted"/>
        <primaryKey name="pk_erpArticleGroups">
            <column name="nNr"/>
        </primaryKey>
    </table>

    <!-- Commissions -->
    <table name="erpCommissions" description="Commissions">
        <column name="nNr"                 type="int"                    nullable="false" description="Number"/>
        <column name="nClientNr"           type="int"                    nullable="false" description="Number of client from table erpClients"/>
        <column name="sClientCommissionNr" type="varchar"  length="32"   nullable="true"  description="Commission number from client"/>
        <column name="dtCreation"          type="datetime"               nullable="true"  description="Date when commission is created"/>
        <column name="dtDestination"       type="datetime"               nullable="true"  description="Date when commission has to be completed"/>
        <column name="sRemarks"            type="varchar"  length="1024" nullable="true"  description="Remarks"/>
        <column name="sStatus"             type="char"     length="1"    nullable="true"  description="Status"/>
        <primaryKey name="pk_erpCommissions">
            <column name="nNr"/>
        </primaryKey>
    </table>

    <!-- Commission positions -->
    <table name="erpCommissionPositions" description="Commission positions">
        <column name="nCommissionNr"     type="int"                    nullable="false" description="Number of commission from table erpCommissions"/>
        <column name="nPositionNr"       type="int"                    nullable="false" description="Number of position"/>
        <column name="nArticleNr"        type="int"                    nullable="false" description="Number of article from table erpArticle"/>
        <column name="fQuantity"         type="double"                 nullable="false" description="Quantity"/>
        <column name="fPrice"            type="float"                  nullable="true"  description="Price per dimension unit"/>
        <column name="fTotalPrice"       type="float"                  nullable="true"  description="Total price"/>
        <primaryKey name="pk_erpCommissionPositions">
            <column name="nCommissionNr"/>
            <column name="nPositionNr"/>
        </primaryKey>
    </table>

    <!-- Dimensions -->
    <table name="erpDimensions" description="Dimensions">
        <column name="nNr"           type="int"                    nullable="false" description="Number"/>
        <column name="sName"         type="varchar"  length="32"   nullable="false" description="Name"/>
        <column name="sDescription"  type="varchar"  length="1024" nullable="true"  description="Detailed description"/>
        <column name="nPosition"     type="int"                    nullable="true"  description="Position for chronological order"/>
        <column name="sStatus"       type="char"     length="1"    nullable="true"  description="Status: 'A'ctive, 'I'nactive, de'L'eted"/>
        <primaryKey name="pk_erpDimensions">
            <column name="nNr"/>
        </primaryKey>
    </table>

    <!-- Clients -->
    <table name="erpClients" description="Clients">
        <column name="nNr"           type="int"                    nullable="false" description="Number"/>
        <column name="sCompany"      type="varchar"  length="32"   nullable="true"  description="Company"/>
        <column name="sName"         type="varchar"  length="32"   nullable="true"  description="Name"/>
        <column name="nCountryNr"    type="int"                    nullable="true"  description="Number of country from table erpCountries"/>
        <column name="sPostalCode"   type="varchar"  length="5"    nullable="true"  description="Postal code"/>
        <column name="sCity"         type="varchar"  length="32"   nullable="true"  description="City"/>
        <column name="sStreet"       type="varchar"  length="48"   nullable="true"  description="Street"/>
        <column name="sHouseNumber"  type="varchar"  length="8"    nullable="true"  description="House number"/>
        <column name="sTelephone"    type="varchar"  length="32"   nullable="true"  description="Telephone number"/>
        <column name="sFax"          type="varchar"  length="32"   nullable="true"  description="Fax number"/>
        <column name="sEmail"        type="varchar"  length="32"   nullable="true"  description="Emailaddress"/>
        <column name="sWeb"          type="varchar"  length="32"   nullable="true"  description="Website"/>
        <column name="sRemarks"      type="varchar"  length="1024" nullable="true"  description="Remarks"/>
        <column name="sStatus"       type="char"     length="1"    nullable="true"  description="Status: 'A'ctive, 'I'nactive, de'L'eted"/>
        <primaryKey name="pk_erpClients">
            <column name="nNr"/>
        </primaryKey>
    </table>

    <!-- Countries -->
    <table name="erpCountries" description="Countries">
        <column name="nNr"           type="int"                    nullable="false" description="Number"/>
        <column name="sCountry"      type="varchar"  length="32"   nullable="false" description="Country"/>
        <column name="sStatus"       type="char"     length="1"    nullable="false" description="Status: 'A'ctive, 'I'nactive, de'L'eted"/>
        <primaryKey name="pk_erpCountries">
            <column name="nNr"/>
        </primaryKey>
    </table>

    <!-- Storage locations -->
    <table name="erpStorageLocations" description="Storage locations">
        <column name="nNr"           type="int"                    nullable="false" description="Number"/>
        <column name="sName"         type="varchar"  length="32"   nullable="false" description="Name"/>
        <column name="sType"         type="varchar"  length="32"   nullable="true"  description="Type of storage location"/>
        <column name="sCity"         type="varchar"  length="32"   nullable="true"  description="City"/>
        <column name="sStreet"       type="varchar"  length="32"   nullable="true"  description="Street"/>
        <column name="sHouseNumber"  type="varchar"  length="8"    nullable="true"  description="House number"/>
        <column name="sRemarks"      type="varchar"  length="1024" nullable="true"  description="Remarks"/>
        <column name="nPosition"     type="int"                    nullable="true"  description="Position for chronological order"/>
        <column name="sStatus"       type="char"     length="1"    nullable="true"  description="Status: 'A'ctive, 'I'nactive, de'L'eted"/>
        <primaryKey name="pk_erpStorageLocations">
            <column name="nNr"/>
        </primaryKey>
    </table>

    <!-- Vendors -->
    <table name="erpVendors" description="Vendors">
        <column name="nNr"           type="int"                    nullable="false" description="Number"/>
        <column name="sCompany"      type="varchar"  length="32"   nullable="true"  description="Company"/>
        <column name="sName"         type="varchar"  length="32"   nullable="true"  description="Name"/>
        <column name="nCountryNr"    type="int"                    nullable="true"  description="Number of country from table erpCountries"/>
        <column name="sPostalCode"   type="varchar"  length="5"    nullable="true"  description="Postal code"/>
        <column name="sCity"         type="varchar"  length="32"   nullable="true"  description="City"/>
        <column name="sStreet"       type="varchar"  length="48"   nullable="true"  description="Street"/>
        <column name="sHouseNumber"  type="varchar"  length="8"    nullable="true"  description="House number"/>
        <column name="sTelephone"    type="varchar"  length="32"   nullable="true"  description="Telephone number"/>
        <column name="sFax"          type="varchar"  length="32"   nullable="true"  description="Fax number"/>
        <column name="sEmail"        type="varchar"  length="32"   nullable="true"  description="Emailaddress"/>
        <column name="sWeb"          type="varchar"  length="32"   nullable="true"  description="Website"/>
        <column name="sRemarks"      type="varchar"  length="1024" nullable="true"  description="Remarks"/>
        <column name="sStatus"       type="char"     length="1"    nullable="true"  description="Status: 'A'ctive, 'I'nactive, de'L'eted"/>
        <primaryKey name="pk_erpVendors">
            <column name="nNr"/>
        </primaryKey>
    </table>
</database>