<?xml version="1.0" encoding="utf-8"?>
<table>
	<name>document</name>
	<collation>utf8_general_ci</collation>
	<description></description>
	<columns>
		<column name="id">
			<type>int</type>
			<length>11</length>
			<signed>UNSIGNED</signed>
			<null>NOT NULL</null>
			<extra>auto_increment</extra>
			<description></description>
		</column>
        <column name="document_type">
            <type>char</type>
            <length>2</length>
            <null>NOT NULL</null>
            <default>IN</default>
            <description></description>
        </column>
		<column name="vendor_id">
			<type>int</type>
			<length>11</length>
			<signed>UNSIGNED</signed>
			<null>NOT NULL</null>
			<default>0</default>
			<description></description>
		</column>
		<column name="entity_id">
			<type>int</type>
			<length>11</length>
			<null>NOT NULL</null>
			<default>0</default>
			<description></description>
		</column>
		<column name="shipping_address_id">
            <type>int</type>
            <length>11</length>
            <signed>UNSIGNED</signed>
            <null>NOT NULL</null>
            <default>0</default>
            <description></description>
        </column>
        <column name="document_no">
			<type>varchar</type>
			<length>30</length>
			<null>NOT NULL</null>
			<default></default>
			<allow_html>false</allow_html>
			<encode_html>false</encode_html>
			<description></description>
		</column>
		<column name="vendor_name">
			<type>varchar</type>
			<length>100</length>
			<null>NOT NULL</null>
			<default></default>
			<allow_html>false</allow_html>
			<encode_html>false</encode_html>
			<description></description>
		</column>
		<column name="vendor_address">
            <type>text</type>
            <length></length>
            <null>NULL</null>
            <default></default>
            <allow_html>false</allow_html>
            <encode_html>false</encode_html>
            <description></description>
        </column>
		<column name="billing_name">
			<type>varchar</type>
			<length>100</length>
			<null>NOT NULL</null>
			<default></default>
			<allow_html>false</allow_html>
			<encode_html>false</encode_html>
			<description></description>
		</column>
		<column name="billing_address">
            <type>text</type>
            <length></length>
            <null>NULL</null>
            <default></default>
            <allow_html>false</allow_html>
            <encode_html>false</encode_html>
            <description></description>
        </column>
        <column name="billing_country">
            <type>char</type>
            <length>2</length>
            <null>NOT NULL</null>
            <default></default>
            <allow_html>false</allow_html>
            <encode_html>false</encode_html>
            <description></description>
        </column>
		<column name="reference">
			<type>varchar</type>
			<length>100</length>
			<null>NOT NULL</null>
			<default></default>
			<allow_html>false</allow_html>
			<encode_html>false</encode_html>
			<description></description>
		</column>
		<column name="document_date">
			<type>int</type>
			<length>11</length>
            <signed>UNSIGNED</signed>
			<null>NOT NULL</null>
			<default>0</default>
			<description></description>
		</column>
		<column name="due_date">
            <type>int</type>
            <length>11</length>
            <signed>UNSIGNED</signed>
            <null>NOT NULL</null>
            <default>0</default>
            <description></description>
        </column>
        <column name="tax_abbreviation">
			<type>varchar</type>
			<length>10</length>
			<null>NOT NULL</null>
			<default></default>
			<allow_html>false</allow_html>
			<encode_html>false</encode_html>
			<description></description>
		</column>
		<column name="tax_desc">
			<type>varchar</type>
			<length>100</length>
			<null>NOT NULL</null>
			<default></default>
			<allow_html>false</allow_html>
			<encode_html>false</encode_html>
			<description></description>
		</column>
		<column name="tax_no">
			<type>varchar</type>
			<length>100</length>
			<null>NOT NULL</null>
			<default></default>
			<allow_html>false</allow_html>
			<encode_html>false</encode_html>
			<description></description>
		</column>
		<column name="tax_exemption_code">
			<type>varchar</type>
			<length>50</length>
			<null>NOT NULL</null>
			<default></default>
			<allow_html>false</allow_html>
			<encode_html>false</encode_html>
			<description></description>
		</column>
		<column name="currency">
			<type>char</type>
			<length>3</length>
			<null>NOT NULL</null>
			<default></default>
			<allow_html>false</allow_html>
			<encode_html>false</encode_html>
			<description></description>
		</column>
		<column name="total_net">
			<type>decimal</type>
            <length>20,6</length>
			<null>NOT NULL</null>
			<default>0.00</default>
			<description></description>
		</column>
		<column name="total_tax">
			<type>decimal</type>
            <length>20,6</length>
			<null>NOT NULL</null>
			<default>0.00</default>
			<description></description>
		</column>
		<column name="total_shipping">
			<type>decimal</type>
            <length>20,6</length>
			<null>NOT NULL</null>
			<default>0.00</default>
			<description></description>
		</column>
		<column name="total_shipping_tax">
			<type>decimal</type>
            <length>20,6</length>
			<null>NOT NULL</null>
			<default>0.00</default>
			<description></description>
		</column>
		<column name="total_gross">
			<type>decimal</type>
            <length>20,6</length>
			<null>NOT NULL</null>
			<default>0.00</default>
			<description></description>
		</column>
        <column name="quote_intro">
            <type>text</type>
            <length></length>
            <null>NULL</null>
            <default></default>
            <allow_html>true</allow_html>
            <encode_html>false</encode_html>
            <description></description>
        </column>
		<column name="payment_instructions">
            <type>text</type>
            <length></length>
            <null>NULL</null>
            <default></default>
            <allow_html>true</allow_html>
            <encode_html>false</encode_html>
            <description></description>
        </column>
        <column name="small_print">
            <type>text</type>
            <length></length>
            <null>NULL</null>
            <default></default>
            <allow_html>true</allow_html>
            <encode_html>false</encode_html>
            <description></description>
        </column>
		<column name="delivery_small_print">
            <type>text</type>
            <length></length>
            <null>NULL</null>
            <default></default>
            <allow_html>true</allow_html>
            <encode_html>false</encode_html>
            <description></description>
        </column>
        <column name="paid_in_full">
			<type>tinyint</type>
			<length>4</length>
			<null>NOT NULL</null>
			<default>0</default>
			<description></description>
		</column>
		<column name="partial_payment">
			<type>tinyint</type>
			<length>4</length>
			<null>NOT NULL</null>
			<default>0</default>
			<description></description>
		</column>
		<column name="refunded_in_full">
			<type>tinyint</type>
			<length>4</length>
			<null>NOT NULL</null>
			<default>0</default>
			<description></description>
		</column>
		<column name="partial_refund">
			<type>tinyint</type>
			<length>4</length>
			<null>NOT NULL</null>
			<default>0</default>
			<description></description>
		</column>
		<column name="notes">
            <type>text</type>
            <length></length>
            <null>NULL</null>
            <default></default>
            <allow_html>false</allow_html>
            <encode_html>false</encode_html>
            <description></description>
        </column>
		<column name="email_sent">
			<type>int</type>
			<length>11</length>
			<null>NOT NULL</null>
			<default>0</default>
			<description></description>
		</column>
		<column name="written_off">
			<type>tinyint</type>
			<length>4</length>
			<null>NOT NULL</null>
			<default>0</default>
			<description></description>
		</column>
		<column name="date_written_off">
			<type>int</type>
			<length>11</length>
			<null>NOT NULL</null>
			<default>0</default>
			<description></description>
		</column>
		<column name="claim_tax_back">
			<type>tinyint</type>
			<length>4</length>
			<null>NOT NULL</null>
			<default>1</default>
			<description></description>
		</column>
		<column name="show_invoice_paylink">
			<type>tinyint</type>
			<length>4</length>
			<null>NOT NULL</null>
			<default>0</default>
			<description></description>
		</column>
        <column name="status">
            <type>char</type>
            <length>2</length>
            <null>NULL</null>
            <default>NULL</default>
            <allow_html>false</allow_html>
            <encode_html>false</encode_html>
            <description></description>
        </column>
        <column name="correspondence">
            <type>text</type>
            <length></length>
            <null>NULL</null>
            <default></default>
            <allow_html>true</allow_html>
            <encode_html>false</encode_html>
            <description></description>
        </column>
        <column name="payment_plan_id">
            <type>int</type>
            <length>11</length>
            <signed>UNSIGNED</signed>
            <null>NOT NULL</null>
            <default>1</default>
            <description></description>
        </column>
        <column name="pay_to_accept_quote">
            <type>tinyint</type>
            <length>4</length>
            <null>NOT NULL</null>
            <default>1</default>
            <description></description>
        </column>
        <column name="quote_show_warning">
            <type>tinyint</type>
            <length>4</length>
            <null>NOT NULL</null>
            <default>1</default>
            <description></description>
        </column>
        <column name="auto_create_orders">
            <type>tinyint</type>
            <length>4</length>
            <null>NOT NULL</null>
            <default>2</default>
            <description></description>
        </column>
        <column name="auto_create_invoices">
            <type>tinyint</type>
            <length>4</length>
            <null>NOT NULL</null>
            <default>1</default>
            <description></description>
        </column>
        <column name="auto_create_income">
            <type>tinyint</type>
            <length>4</length>
            <null>NOT NULL</null>
            <default>1</default>
            <description></description>
        </column>
        <column name="related_document_id">
            <type>int</type>
            <length>11</length>
            <signed>UNSIGNED</signed>
            <null>NOT NULL</null>
            <default>0</default>
            <description></description>
        </column>
        <column name="gateway_txn_id">
            <type>int</type>
            <length>11</length>
            <signed>UNSIGNED</signed>
            <null>NOT NULL</null>
            <default>0</default>
            <description></description>
        </column>
        <column name="uploaded_files">
            <type>text</type>
            <length></length>
            <null>NULL</null>
            <default></default>
            <allow_html>false</allow_html>
            <encode_html>false</encode_html>
            <description></description>
        </column>
        <column name="quote_accept_redirect">
            <type>varchar</type>
            <length>255</length>
            <null>NOT NULL</null>
            <default></default>
            <allow_html>false</allow_html>
            <encode_html>false</encode_html>
            <description></description>
        </column>
        <column name="form_id">
            <type>int</type>
            <length>11</length>
            <signed>UNSIGNED</signed>
            <null>NOT NULL</null>
            <default>0</default>
            <description></description>
        </column>
	</columns>
	<primary>
		<columns>
			<column>
				<name>id</name>
			</column>
		</columns>
	</primary>
	<index>
		<type>multiple</type>
		<columns>
			<column>
				<name>document_date</name>
			</column>
		</columns>
		<description></description>
	</index>
</table>