<!DOCTYPE task PUBLIC "-//LogPerspective//DITA Storm Model//EN" "model.dtd">
<!--
  * Invoice XML structure configuration.
  *
  * This file defines original structure and features of XML consumed
  * and editable by DITA Storm.
  *
  * IMPORTANT: Any changes to this file need to be compiled with provided
  *      Resource Compiler.  Result of compilation (file 'model.js'), should
  *      replace original 'model.js' in DITAStorm/config directory.
  *
  * (c) LogPerspective Inc. 2006,2007
 -->
<model>

    <element name='invoice' title='Invoice' addToNewButton='true'>
        <group allows='invoiceheader' card='1'/>
        <group allows='invoicedetails' card='1..n'/>
        <group allows='invoicesummary' card='1'/>
        <default><![CDATA[
                <invoice>
                    <invoiceheader>
                        <party type='seller'>
                            <name/>
                            <address/>
                        </party>
                        <party type='buyer'>
                            <name/>
                            <address/>
                        </party>
                    </invoiceheader>
                    <invoicedetails>
                        <partnum/>
                        <partdesc/>
                        <quantity/>
                        <unitprice/>
                    </invoicedetails>
                    <invoicedetails>
                        <partnum/>
                        <partdesc/>
                        <quantity/>
                        <unitprice/>
                    </invoicedetails>
                    <invoicesummary>
                        <netvalue/>
                        <taxvalue/>
                        <grossvalue/>
                    </invoicesummary>
                </invoice>]]>
        </default>
	</element>

    <element name='invoiceheader' title='Header'>
        <group allows='party' card='1..n'/>
    </element>

    <element name='party' title='Party' confirmDelete='true' attributeEditor='party'>
        <group allows='name' card='1..n'/>
        <group allows='address' card='1..n'/>
        <group allows='contact'/>
    </element>

    <element name='name' title='Name'>
        <group allows='#text'
            handlerDelete='genericDeleteHandler'
			handlerBackspace='genericBackspaceHandler'
			handlerEnter='genericEnterHandler'
            />
    </element>

    <element name='address' title='Address'>
        <group allows='#text'
            handlerDelete='genericDeleteHandler'
			handlerBackspace='genericBackspaceHandler'
			handlerEnter='genericEnterHandler'
            />
    </element>

    <element name='contact' title='Contact'>
    </element>

    <element name='invoicedetails' title='Item'>
        <group allows='partnum' card='1'/>
        <group allows='partdesc' card='1'/>
        <group allows='quantity' card='1'/>
        <group allows='unitprice' card='1'/>
    </element>


    <element name='partnum' title='Part Number'>
        <group allows='#text' emptyText='part'/>
    </element>

    <element name='partdesc' title='Part Description'>
        <group allows='#text' emptyText='description'/>
    </element>

    <element name='quantity' title='Quantity'>
        <group allows='#text' emptyText='quantity'/>
    </element>

    <element name='unitprice' title='Unit Price'>
        <group allows='#text' emptyText='price'/>
    </element>

    <element name='invoicesummary' title='Summary'>
        <group allows='netvalue' card='1'/>
        <group allows='taxvalue' card='1'/>
        <group allows='grossvalue' card='1'/>
    </element>

    <element name='netvalue' title='Net Value'>
        <group allows='#text' emptyText='net value'/>
    </element>

    <element name='taxvalue' title='Tax Value'>
        <group allows='#text' emptyText='tax value'/>
    </element>

    <element name='grossvalue' title='Gross Value'>
        <group allows='#text' emptyText='gross value'/>
    </element>

    <editor name="party">
        <field attribute="type" title="Type" type="choice">
            <option title="" value=""/>
            <option title="Seller" value="seller"/>
            <option title="Buyer" value="buyer"/>
            <option title="Invoicee" value="invoicee"/>
            <option title="Other" value="other"/>
		</field>
	</editor>

</model>
