<model>
	<catalog name="pos">
		<table name="tenants" replication="head-slave,head-master">
			<column name="tenant_no" type="int" pk="1" />
			<column name="tenant_nm" type="varchar(200)" nn="1" />
		</table>

		<table name="locations" replication="master,slave">
			<column name="tenant_no" type="int" pk="1" />
			<column name="location_no" type="int" pk="1" />
			<column name="location_nm" type="varchar(200)" nn="1" />
			<foreign-key name="tn" ref="tenants" replication="p">
				<fk-col name="tenant_no" />
			</foreign-key>
		</table>

		<table name="points_of_sale" replication="master,slave">
			<column name="tenant_no" type="int" pk="1" />
			<column name="pos_cd" type="varchar(10)" pk="1" />
			<column name="location_no" type="int" nn="1" />
			<column name="pos_nm" type="varchar(200)" nn="1" />
			<foreign-key name="tn" ref="tenants" replication="p">
				<fk-col name="tenant_no" />
			</foreign-key>
			<foreign-key name="lo" ref="locations" replication="d">
				<fk-col name="tenant_no" />
				<fk-col name="location_no" />
			</foreign-key>
		</table>

		<table name="pos_terminals" replication="master">
			<column name="tenant_no" type="int" pk="1" />
			<column name="pos_cd" type="varchar(10)" pk="1" />
			<column name="terminal_cd" type="varchar(100)" pk="1" />
			<column name="terminal_nm" type="varchar(200)" nn="1" />
			<column name="detection_hint" type="varchar(200)" />
			<foreign-key name="pos" ref="points_of_sale" replication="d">
				<fk-col name="tenant_no" />
				<fk-col name="pos_cd" />
			</foreign-key>
			<foreign-key name="tn" ref="tenants" replication="p">
				<fk-col name="tenant_no" />
			</foreign-key>
		</table>

		<table name="pos_terminal_pos_drawers" replication="master">
			<column name="tenant_no" type="int" pk="1" />
			<column name="pos_cd" type="varchar(10)" pk="1" />
			<column name="terminal_cd" type="varchar(100)" pk="1" />
			<column name="drawer_no" type="int" pk="1" />
			<foreign-key name="pot" ref="pos_terminals" replication="p">
				<fk-col name="tenant_no" />
				<fk-col name="pos_cd" />
				<fk-col name="terminal_cd" />
			</foreign-key>
			<foreign-key name="pod" ref="pos_drawers" replication="d">
				<fk-col name="tenant_no" />
				<fk-col name="pos_cd" />
				<fk-col name="drawer_no" />
			</foreign-key>
		</table>

		<table name="pos_printers" replication="none">
			<column name="tenant_no" type="int" pk="1" />
			<column name="pos_cd" type="varchar(10)" pk="1" />
			<column name="printer_type" type="int" pk="1" />
			<column name="printer_nm" type="varchar(200)" nn="1" />

			<foreign-key name="pos" ref="points_of_sale">
				<fk-col name="tenant_no" />
				<fk-col name="pos_cd" />
			</foreign-key>
		</table>

		<table name="pos_drawers" replication="master">
			<column name="tenant_no" type="int" pk="1" />
			<column name="pos_cd" type="varchar(10)" pk="1" />
			<column name="drawer_no" type="int" pk="1" />
			<column name="drawer_nm" type="varchar(200)" nn="1" />
			<column name="central" type="boolean" />
			<column name="central_drawer_no" type="int" />
			<column name="acct_cd" type="varchar(20)" />
			<column name="drawer_sequence" type="varchar(200)" />
			<column name="unselectable" type="boolean" />
			<column name="selected_ecash_terminal_cd" type="varchar(20)" />
			<foreign-key name="pos" ref="points_of_sale">
				<fk-col name="tenant_no" />
				<fk-col name="pos_cd" />
			</foreign-key>
			<foreign-key name="pd" ref="pos_drawers">
				<fk-col name="tenant_no" />
				<fk-col name="pos_cd" />
				<fk-col name="central_drawer_no" ref="drawer_no" />
			</foreign-key>
		</table>

		<table name="pos_drawer_printers" replication="none">
			<column name="tenant_no" type="int" pk="1" />
			<column name="pos_cd" type="varchar(10)" pk="1" />
			<column name="drawer_no" type="int" pk="1" />
			<column name="printer_type" type="int" pk="1" />
			<column name="printer_nm" type="varchar(200)" nn="1" />
			<foreign-key name="pod" ref="pos_drawers">
				<fk-col name="tenant_no" />
				<fk-col name="pos_cd" />
				<fk-col name="drawer_no" />
			</foreign-key>
		</table>

		<table name="ecash_terminals" replication="slave">
			<column name="tenant_no" type="int" pk="1" />
			<column name="pos_cd" type="varchar(10)" pk="1" />
			<column name="ecash_terminal_cd" type="varchar(20)" pk="1" />
			<column name="ecash_terminal_nm" type="varchar(200)" nn="1" />
			<column name="terminal_cd" type="varchar(200)" />
			<foreign-key name="pos" ref="points_of_sale">
				<fk-col name="tenant_no" />
				<fk-col name="pos_cd" />
			</foreign-key>
		</table>

		<table name="pos_drawer_ecash_terminals" replication="slave">
			<column name="tenant_no" type="int" pk="1" />
			<column name="pos_cd" type="varchar(10)" pk="1" />
			<column name="ecash_terminal_cd" type="varchar(20)" pk="1" />
			<column name="drawer_no" type="int" pk="1" />
			<foreign-key name="ect" ref="ecash_terminals">
				<fk-col name="tenant_no" />
				<fk-col name="pos_cd" />
				<fk-col name="ecash_terminal_cd" />
			</foreign-key>
			<foreign-key name="pod" ref="pos_drawers">
				<fk-col name="tenant_no" />
				<fk-col name="pos_cd" />
				<fk-col name="drawer_no" />
			</foreign-key>
		</table>

		<table name="ecash_transactions" replication="slave">
			<column name="tenant_no" type="int" pk="1" />
			<column name="pos_cd" type="varchar(10)" pk="1" />
			<column name="ecash_terminal_cd" type="varchar(20)" pk="1" />
			<column name="ecash_transaction_id" type="int" pk="1" />
			<column name="transaction_ts" type="datetime" />
			<column name="transaction_state" type="int">
				<constant name="STATE_OPEN" value="1" />
				<constant name="STATE_TRANSMISSION_TO_SERVICE_FAILED"
					value="-2" />
				<constant name="STATE_TRANSMISSION_TO_DEVICE_FAILED" value="-3" />
				<constant name="STATE_TRANSMISSION_DEVICE_BUSY" value="-4" />
				<constant name="STATE_TRANSMISSION_SUCESSFUL" value="2" />
				<constant name="STATE_REJECTED" value="-5" />
				<constant name="STATE_NO_ANSWER" value="-6" />
				<constant name="STATE_COMPLETED" value="0" />
			</column>
			<column name="transaction_type" type="int">
				<constant name="TYPE_PAYMENT" value="1" />
				<constant name="TYPE_CANCEL" value="2" />
				<constant name="TYPE_BALANCE" value="3" />
			</column>
			<column name="transaction_cd" type="varchar(200)" />
			<column name="transaction_amt" type="decimal(12,3)" />

			<column name="d_sales_inv_id" type="int" />
			<column name="d_sales_inv_payment_id" type="int" />

			<column name="sales_inv_id" type="int" />
			<column name="sales_inv_payment_id" type="int" />
			<column name="drawer_no" type="int" />
			<column name="pos_session_id" type="int" />
			<column name="pos_payment_id" type="int" />

			<foreign-key name="ets" ref="ecash_terminals">
				<fk-col name="tenant_no" />
				<fk-col name="pos_cd" />
				<fk-col name="ecash_terminal_cd" />
			</foreign-key>
		</table>

		<table name="ecash_transaction_notes" replication="slave">
			<column name="tenant_no" type="int" pk="1" />
			<column name="pos_cd" type="varchar(10)" pk="1" />
			<column name="ecash_terminal_cd" type="varchar(20)" pk="1" />
			<column name="ecash_transaction_id" type="int" pk="1" />
			<column name="ecash_transaction_note_id" type="int" pk="1" />
			<column name="note_type" type="int" />
			<column name="note_txt" type="varchar(4000)" />

			<foreign-key name="ets" ref="ecash_transactions">
				<fk-col name="tenant_no" />
				<fk-col name="pos_cd" />
				<fk-col name="ecash_terminal_cd" />
				<fk-col name="ecash_transaction_id" />
			</foreign-key>
		</table>

		<table name="ecash_transaction_properties" replication="slave">
			<column name="tenant_no" type="int" pk="1" />
			<column name="pos_cd" type="varchar(10)" pk="1" />
			<column name="ecash_terminal_cd" type="varchar(20)" pk="1" />
			<column name="ecash_transaction_id" type="int" pk="1" />
			<column name="property_name" type="varchar(100)" pk="1" />
			<column name="property_value" type="varchar(100)" />

			<foreign-key name="ets" ref="ecash_transactions">
				<fk-col name="tenant_no" />
				<fk-col name="pos_cd" />
				<fk-col name="ecash_terminal_cd" />
				<fk-col name="ecash_transaction_id" />
			</foreign-key>
		</table>

		<table name="ecash_transaction_note_lines" replication="slave">
			<column name="tenant_no" type="int" pk="1" />
			<column name="pos_cd" type="varchar(10)" pk="1" />
			<column name="ecash_terminal_cd" type="varchar(20)" pk="1" />
			<column name="ecash_transaction_id" type="int" pk="1" />
			<column name="ecash_transaction_note_id" type="int" pk="1" />
			<column name="ecash_transaction_note_line_no" type="int" pk="1" />
			<column name="line_decoration" type="varchar(20)" />
			<column name="line_txt" type="varchar(200)" />

			<foreign-key name="etn" ref="ecash_transaction_notes">
				<fk-col name="tenant_no" />
				<fk-col name="pos_cd" />
				<fk-col name="ecash_terminal_cd" />
				<fk-col name="ecash_transaction_id" />
				<fk-col name="ecash_transaction_note_id" />
			</foreign-key>
		</table>

		<table name="users" replication="none">
			<column name="tenant_no" type="int" pk="1" />
			<column name="login_nm" type="varchar(100)" pk="1" />
			<column name="password" type="varchar(100)" nn="1" />
			<foreign-key name="tn" ref="tenants">
				<fk-col name="tenant_no" />
			</foreign-key>
		</table>

		<table name="groups" replication="none">
			<column name="tenant_no" type="int" pk="1" />
			<column name="group_nm" type="varchar(100)" pk="1" />
			<foreign-key name="tn" ref="tenants">
				<fk-col name="tenant_no" />
			</foreign-key>
		</table>

		<table name="group_members" replication="none">
			<column name="tenant_no" type="int" pk="1" />
			<column name="group_nm" type="varchar(100)" pk="1" />
			<column name="login_nm" type="varchar(100)" pk="1" />
			<foreign-key name="us" ref="users">
				<fk-col name="tenant_no" />
				<fk-col name="login_nm" />
			</foreign-key>
			<foreign-key name="gs" ref="groups">
				<fk-col name="tenant_no" />
				<fk-col name="group_nm" />
			</foreign-key>
		</table>

		<table name="group_points_of_sale" replication="none">
			<column name="tenant_no" type="int" pk="1" />
			<column name="group_nm" type="varchar(100)" pk="1" />
			<column name="pos_cd" type="varchar(10)" pk="1" />
			<foreign-key name="pos" ref="points_of_sale">
				<fk-col name="tenant_no" />
				<fk-col name="pos_cd" />
			</foreign-key>
			<foreign-key name="gs" ref="groups">
				<fk-col name="tenant_no" />
				<fk-col name="group_nm" />
			</foreign-key>
		</table>




		<table name="user_groups" replication="none">
			<column name="tenant_no" type="int" pk="1" />
			<column name="user_group_cd" type="varchar(50)" pk="1" />
			<column name="user_group_nm" type="varchar(100)" nn="1" />
			<column name="all_companies" type="boolean" />
			<column name="all_businessunits" type="boolean" />
			<foreign-key name="tn" ref="tenants">
				<fk-col name="tenant_no" />
			</foreign-key>
		</table>

		<table name="user_group_members" replication="none">
			<column name="tenant_no" type="int" pk="1" />
			<column name="user_group_cd" type="varchar(50)" pk="1" />

			<column name="login_nm" type="varchar(100)" pk="1" />
			<foreign-key name="us" ref="users">
				<fk-col name="tenant_no" />
				<fk-col name="login_nm" />
			</foreign-key>
			<foreign-key name="gs" ref="user_groups">
				<fk-col name="tenant_no" />
				<fk-col name="user_group_cd" />
			</foreign-key>
		</table>


		<table name="user_group_permissions" replication="none">
			<column name="tenant_no" type="int" pk="1" />
			<column name="user_group_cd" type="varchar(50)" pk="1" />
			<column name="permission_cd" type="varchar(50)" pk="1">
				<constant name="PERMISSION_BUSINESSUNIT" value='"P_BUSINESSUNIT"' />
				<constant name="PERMISSION_EMPLOYEELIST" value='"P_EMPLOYEELIST"' />
				<constant name="PERMISSION_EMPLOYEEGROUP" value='"P_EMPLOYEEGROUP"' />
				<constant name="PERMISSION_ITEM" value='"P_ITEM"' />
				<constant name="PERMISSION_SALES_PREISLIST" value='"P_SALESPRICELIST"' />
				<constant name="PERMISSION_REPORT" value='"P_REPORT"' />
				<constant name="PERMISSION_USERGROUP" value='"P_USERGROUP"' />
				<constant name="PERMISSION_USER" value='"P_USER"' />
				<constant name="PERMISSION_EXPORT" value='"P_EXPORT"' />
				<constant name="PERMISSION_DEACTIVATE_VOUCHER" value='"P_DEACTIVATE_VOUCHER"' />
			</column>
			<column name="permission_nm" type="varchar(200)" nn="1" />
			<foreign-key name="gs" ref="user_groups">
				<fk-col name="tenant_no" />
				<fk-col name="user_group_cd" />
			</foreign-key>
		</table>



		<table name="user_group_company" replication="none">
			<column name="tenant_no" type="int" pk="1" />
			<column name="company_no" type="int" pk="1" />
			<column name="user_group_cd" type="varchar(50)" pk="1" />
			<foreign-key name="gs" ref="user_groups">
				<fk-col name="tenant_no" />
				<fk-col name="user_group_cd" />
			</foreign-key>
			<foreign-key name="co" ref="companies">
				<fk-col name="tenant_no" />
				<fk-col name="company_no" />
			</foreign-key>
		</table>



		<table name="user_group_businessunit" replication="none">
			<column name="tenant_no" type="int" pk="1" />
			<column name="company_no" type="int" pk="1" />
			<column name="department_no" type="int" pk="1" />
			<column name="businessunit_no" type="int" pk="1" />
			<column name="user_group_cd" type="varchar(50)" pk="1" />
			<foreign-key name="gs" ref="user_groups">
				<fk-col name="tenant_no" />
				<fk-col name="user_group_cd" />
			</foreign-key>
			<foreign-key name="bu" ref="businessunits">
				<fk-col name="tenant_no" />
				<fk-col name="company_no" />
				<fk-col name="department_no" />
				<fk-col name="businessunit_no" />

			</foreign-key>
		</table>

		<table name="currencies" replication="master">
			<column name="tenant_no" type="int" pk="1" />
			<column name="currency_cd" type="varchar(10)" pk="1" />
			<column name="currency_symbol" type="varchar(10)" nn="1" />
			<column name="currency_nm" type="varchar(50)" />
			<foreign-key name="tn" ref="tenants" replication="p">
				<fk-col name="tenant_no" />
			</foreign-key>
		</table>

		<table name="countries" replication="master">
			<column name="tenant_no" type="int" pk="1" />
			<column name="country_cd" type="varchar(10)" pk="1" />
			<column name="country_nm" type="varchar(50)" nn="1" />
			<foreign-key name="tn" ref="tenants" replication="p">
				<fk-col name="tenant_no" />
			</foreign-key>
		</table>

		<table name="companies" replication="master" engine="pos">
			<column name="tenant_no" type="int" pk="1" />
			<column name="company_no" type="int" pk="1" />
			<column name="company_nm" type="varchar(200)" nn="1" />
			<foreign-key name="tn" ref="tenants" replication="p">
				<fk-col name="tenant_no" />
			</foreign-key>
		</table>

		<table name="taxes" replication="master">
			<column name="tenant_no" type="int" pk="1" />
			<column name="company_no" type="int" pk="1" />
			<column name="tax_cd" type="varchar(10)" pk="1" />
			<column name="valid_from" type="datetime" pk="1" />
			<column name="tax_nm" type="varchar(10)" nn="1" />
			<column name="tax_desc" type="varchar(50)" />
			<column name="tax_rate_percent" type="decimal(6,2)" />
			<column name="valid_to" type="datetime" />
			<foreign-key name="co" ref="companies" replication="p">
				<fk-col name="tenant_no" />
				<fk-col name="company_no" />
			</foreign-key>
		</table>

		<table name="at_tax_types" replication="master">
			<column name="tenant_no" type="int" pk="1" />
			<column name="tax_cd" type="varchar(10)" pk="1" />
			<column name="at_tax_type" type="int" nn="1" />
			<foreign-key name="tn" ref="tenants" replication="p">
				<fk-col name="tenant_no" />
			</foreign-key>
		</table>

		<table name="departments" replication="master">
			<column name="tenant_no" type="int" pk="1" />
			<column name="company_no" type="int" pk="1" />
			<column name="department_no" type="int" pk="1" />
			<column name="department_nm" type="varchar(200)" nn="1" />
			<column name="currency_cd" type="varchar(10)" />
			<foreign-key name="co" ref="companies" replication="p">
				<fk-col name="tenant_no" />
				<fk-col name="company_no" />
			</foreign-key>
			<foreign-key name="cr" ref="currencies" replication="d">
				<fk-col name="tenant_no" />
				<fk-col name="currency_cd" />
			</foreign-key>
		</table>

		<table name="department_exchange_rate" replication="master">
			<column name="tenant_no" type="int" pk="1" />
			<column name="company_no" type="int" pk="1" />
			<column name="department_no" type="int" pk="1" />
			<column name="currency_cd" type="varchar(10)" pk="1" />
			<column name="to_currency_cd" type="varchar(10)" pk="1" />
			<column name="valid_from" type="datetime" pk="1" />
			<column name="exchange_rate" type="decimal(16,4)" />
			<foreign-key name="dp" ref="departments" replication="p">
				<fk-col name="tenant_no" />
				<fk-col name="company_no" />
				<fk-col name="department_no" />
			</foreign-key>
			<foreign-key name="cr1" ref="currencies" replication="d">
				<fk-col name="tenant_no" />
				<fk-col name="currency_cd" />
			</foreign-key>
			<foreign-key name="cr2" ref="currencies">
				<fk-col name="tenant_no" />
				<fk-col name="to_currency_cd" ref="currency_cd" />
			</foreign-key>
		</table>

		<table name="simple_accounts" replication="master">
			<column name="tenant_no" type="int" pk="1" />
			<column name="company_no" type="int" pk="1" />
			<column name="department_no" type="int" pk="1" />
			<column name="simple_acct_cd" type="varchar(50)" pk="1" />
			<column name="simple_acct_type" type="int">
				<constant name="REVENUE_ACCT" value="1" />
				<constant name="EXPENSES_ACCT" value="2" />
				<constant name="ASSETS_ACCT" value="3" />
				<constant name="VOUCHER_OUT_ACCT" value="4" />
				<constant name="VOUCHER_IN_ACCT" value="5" />
				<constant name="EC_ACCT" value="6" />
				<constant name="CC_ACCT" value="7" />
				<constant name="DISCOUNT_ACCT" value="8" />
				<constant name="OPEN_SI" value="9" />
				<constant name="PAYED_PREV_OPEN_SI" value="10" />
				<constant name="V_CREDITNOTE_ACC_IN" value="11" />
				<constant name="V_CREDITNOTE_ACC_OUT" value="12" />
				<constant name="OPEN_PI" value="13" />
				<constant name="PAYED_PREV_OPEN_PI" value="14" />
				<constant name="TRANSFER_PI_OUT" value="15" />
				<constant name="TRANSFER_SI_IN" value="16" />
				<constant name="CASHIN" value="17" />
				<constant name="CASHOUT" value="18" />
				<constant name="ASSETS_IN_ACCT" value="19" />
				<constant name="ASSETS_OUT_ACCT" value="20" />
				<constant name="SALES_CREDIT_VOUCHER_IN" value="21" />
				<constant name="SALES_CREDIT_VOUCHER_OUT" value="22" />
				<constant name="VOUCHER_CARD_OUT" value="23" />
				<constant name="VOUCHER_CARD_IN" value="24" />
				<constant name="ONLINE_ACC" value="25" />
			</column>
			<column name="goods_assets" type="boolean" />

			<column name="stockable" type="boolean" />

			<column name="booking_cd" type="varchar(20)" />
			<column name="acct_cd" type="varchar(20)" />
			<column name="tax_rate_percent" type="decimal(6,2)" />
			<column name="simple_acct_nm" type="varchar(200)" />
			<column name="tax_hint" type="varchar(20)" />
			<column name="simple_account_hint" type="varchar(20)" />
			<foreign-key name="dp" ref="departments" replication="p">
				<fk-col name="tenant_no" />
				<fk-col name="company_no" />
				<fk-col name="department_no" />
			</foreign-key>
		</table>




		<table name="markets" replication="master">
			<column name="tenant_no" type="int" pk="1" />
			<column name="company_no" type="int" pk="1" />
			<column name="department_no" type="int" pk="1" />
			<column name="market_no" type="int" pk="1" />
			<column name="market_nm" type="varchar(200)" nn="1" />
			<foreign-key name="dp" ref="departments" replication="p">
				<fk-col name="tenant_no" />
				<fk-col name="company_no" />
				<fk-col name="department_no" />
			</foreign-key>
		</table>

		<table name="stocks" replication="master">
			<column name="tenant_no" type="int" pk="1" />
			<column name="company_no" type="int" pk="1" />
			<column name="department_no" type="int" pk="1" />
			<column name="stock_no" type="int" pk="1" />
			<column name="stock_nm" type="varchar(200)" nn="1" />
			<column name="acct_cd" type="varchar(20)" />

			<foreign-key name="dp" ref="departments" replication="p">
				<fk-col name="tenant_no" />
				<fk-col name="company_no" />
				<fk-col name="department_no" />
			</foreign-key>
		</table>

		<table name="businessunits" replication="master">
			<column name="tenant_no" type="int" pk="1" />
			<column name="company_no" type="int" pk="1" />
			<column name="department_no" type="int" pk="1" />
			<column name="businessunit_no" type="int" pk="1" />
			<column name="businessunit_nm" type="varchar(200)" nn="1" />
			<column name="market_no" type="int" />
			<column name="sales_pricelist_id" type="int" />
			<column name="stock_no" type="int" />
			<column name="stock_nm" type="varchar(200)" />
			<column name="bu_nm_1" type="varchar(200)" />
			<column name="bu_nm_2" type="varchar(200)" />
			<column name="bu_street" type="varchar(200)" />
			<column name="bu_country_cd" type="varchar(10)" />
			<column name="bu_postal_cd" type="varchar(20)" />
			<column name="bu_city" type="varchar(200)" />
			<column name="bu_email" type="varchar(200)" />
			<column name="bu_phone" type="varchar(200)" />
			<column name="bu_web" type="varchar(200)" />
			<column name="bu_tax_id" type="varchar(30)" />
			<column name="bu_eu_tax_id" type="varchar(30)" />

			<column name="bu_iban" type="varchar(30)" />
			<column name="bu_bank_acct_holder" type="varchar(50)" />
			<column name="bu_bank_nm" type="varchar(50)" />
			<column name="bu_bic" type="varchar(30)" />

			<column name="bu_logo_url" type="varchar(200)" />
			<column name="bu_ecash_note_form_url" type="varchar(200)" />
			<column name="bu_note_form_url" type="varchar(200)" />
			<column name="bu_note_txt" type="varchar(400)" />
			<column name="bu_voucher_form_url" type="varchar(200)" />
			<column name="bu_voucher_txt" type="varchar(400)" />
			<column name="bu_voucher_card_form_url" type="varchar(200)" />
			<column name="alternate_tax_hint" type="varchar(20)" />
			<column name="alternate_tax_cd" type="varchar(10)" />
			<column name="portfolio_cd" type="varchar(20)" />
			<column name="pos_cd_hint" type="varchar(10)" />
			<foreign-key name="dp" ref="departments" replication="p">
				<fk-col name="tenant_no" />
				<fk-col name="company_no" />
				<fk-col name="department_no" />
			</foreign-key>
			<foreign-key name="mk" ref="markets" replication="d">
				<fk-col name="tenant_no" />
				<fk-col name="company_no" />
				<fk-col name="department_no" />
				<fk-col name="market_no" />
			</foreign-key>
			<foreign-key name="spl" ref="sales_pricelists"
				replication="d">
				<fk-col name="tenant_no" />
				<fk-col name="company_no" />
				<fk-col name="department_no" />
				<fk-col name="market_no" />
				<fk-col name="sales_pricelist_id" />
			</foreign-key>
		</table>


		<table name="businessunit_properties" replication="master">
			<column name="tenant_no" type="int" pk="1" />
			<column name="company_no" type="int" pk="1" />
			<column name="department_no" type="int" pk="1" />
			<column name="businessunit_no" type="int" pk="1" />
			<column name="property" type="varchar(50)" pk="1" />
			<column name="property_value" type="varchar(200)" nn="1" />
			<foreign-key name="bu" ref="businessunits" replication="p">
				<fk-col name="tenant_no" />
				<fk-col name="company_no" />
				<fk-col name="department_no" />
				<fk-col name="businessunit_no" />
			</foreign-key>
		</table>

		<table name="businessunit_stocks" replication="master">
			<column name="tenant_no" type="int" pk="1" />
			<column name="company_no" type="int" pk="1" />
			<column name="department_no" type="int" pk="1" />
			<column name="businessunit_no" type="int" pk="1" />
			<column name="stock_no" type="int" pk="1" />
			<column name="stock_nm" type="varchar(200)" nn="1" />
			<foreign-key name="bu" ref="businessunits" replication="p">
				<fk-col name="tenant_no" />
				<fk-col name="company_no" />
				<fk-col name="department_no" />
				<fk-col name="businessunit_no" />
			</foreign-key>
			<foreign-key name="st" ref="stocks" replication="d">
				<fk-col name="tenant_no" />
				<fk-col name="company_no" />
				<fk-col name="department_no" />
				<fk-col name="stock_no" />
			</foreign-key>
		</table>


		<table name="employee_groups" replication="master">
			<column name="tenant_no" type="int" pk="1" />
			<column name="company_no" type="int" pk="1" />
			<column name="employee_group_cd" type="varchar(20)" pk="1" />
			<column name="employee_group_nm" type="varchar(200)" nn="1" />
			<foreign-key name="co" ref="companies" replication="p">
				<fk-col name="tenant_no" ref="tenant_no" />
				<fk-col name="company_no" ref="company_no" />
			</foreign-key>
		</table>

		<table name="employee_group_permissions" replication="master">
			<column name="tenant_no" type="int" pk="1" />
			<column name="company_no" type="int" pk="1" />
			<column name="employee_group_cd" type="varchar(20)" pk="1" />


			<column name="permission_cd" type="varchar(20)" pk="1">

				<constant name="PERMISSION_CASH" value='"P_CASH"' />
				<constant name="PERMISSION_START_SESSION" value='"P_S_SESSION"' />
				<constant name="PERMISSION_FINISH_SESSION" value='"P_F_SESSION"' />
				<constant name="PERMISSION_SESSION_PAYMENT_WITHDRAWAL"
					value='"P_PW_SESSION"' />
				<constant name="PERMISSION_CUSTOMER" value='"P_CUS"' />
				<constant name="PERMISSION_MASTERDATA" value='"P_MASTERDATA"' />
				<constant name="PERMISSION_MODIFY_POINTS" value='"P_MOD_CCC_POINTS"' />
				<constant name="PERMISSION_CANCEL_SALESINV" value='"P_CANCEL_SALESINV"' />
				<constant name="PERMISSION_CREATE_CREDITNOTE" value='"P_CREATE_CN"' />
				<constant name="PERMISSION_POS_REPORT" value='"P_POS_REPORT"' />
				<constant name="PERMISSION_DO_DAY_CLOSURE" value='"P_DO_DAY_CLOSURE"' />
				<constant name="PERMISSION_OPEN_DAY_CLOSURE" value='"P_OPEN_DAY_CLOSURE"' />
				<constant name="PERMISSION_STATISTICS" value='"P_STATISTICS"' />
				<constant name="PERMISSION_REVENUE_DASHBOARD" value='"P_REV_DASHBOARD"' />
				<constant name="PERMISSION_CENTRAL_CARDS" value='"P_CENTRAL_CARDS"' />
				<constant name="PERMISSION_DEACTIVATE_VOUCHER" value='"P_DEACTIVATE_VOUCHER"' />

			</column>
			<column name="permission_nm" type="varchar(200)" nn="1" />
			<foreign-key name="eg" ref="employee_groups" replication="p">
				<fk-col name="tenant_no" ref="tenant_no" />
				<fk-col name="company_no" ref="company_no" />
				<fk-col name="employee_group_cd" ref="employee_group_cd" />
			</foreign-key>
		</table>

		<table name="employee_group_pos_drawers" replication="master">
			<column name="tenant_no" type="int" pk="1" />
			<column name="company_no" type="int" pk="1" />
			<column name="employee_group_cd" type="varchar(20)" pk="1" />
			<column name="pos_cd" type="varchar(10)" pk="1" />
			<column name="drawer_no" type="int" pk="1" />
			<foreign-key name="eg" ref="employee_groups" replication="p">
				<fk-col name="tenant_no" ref="tenant_no" />
				<fk-col name="company_no" ref="company_no" />
				<fk-col name="employee_group_cd" ref="employee_group_cd" />
			</foreign-key>
			<foreign-key name="pod" ref="pos_drawers" replication="d">
				<fk-col name="tenant_no" />
				<fk-col name="pos_cd" />
				<fk-col name="drawer_no" />
			</foreign-key>
		</table>

		<table name="employee_group_members" replication="master">
			<column name="tenant_no" type="int" pk="1" />
			<column name="company_no" type="int" pk="1" />
			<column name="employee_group_cd" type="varchar(20)" pk="1" />
			<column name="employee_no" type="int" pk="1" />
			<foreign-key name="eg" ref="employee_groups" replication="p">
				<fk-col name="tenant_no" ref="tenant_no" />
				<fk-col name="company_no" ref="company_no" />
				<fk-col name="employee_group_cd" ref="employee_group_cd" />
			</foreign-key>
			<foreign-key name="em" ref="employees" replication="d">
				<fk-col name="tenant_no" ref="tenant_no" />
				<fk-col name="company_no" ref="company_no" />
				<fk-col name="employee_no" ref="employee_no" />
			</foreign-key>
		</table>

		<table name="employees" replication="master">
			<column name="tenant_no" type="int" pk="1" />
			<column name="company_no" type="int" pk="1" />
			<column name="employee_no" type="int" pk="1" />
			<column name="employee_nm" type="varchar(200)" nn="1" />
			<column name="employee_nick_nm" type="varchar(200)" />
			<column name="street" type="varchar(200)" />
			<column name="country_cd" type="varchar(10)" />
			<column name="postal_cd" type="varchar(20)" />
			<column name="city" type="varchar(200)" />
			<column name="email" type="varchar(200)" />
			<column name="phone" type="varchar(200)" />
			<column name="mobile" type="varchar(200)" />
			<column name="pincode" type="varchar(64)" />
			<column name="employee_no2" type="int" />
			<column name="comment" type="varchar(200)" />
			<column name="birthday" type="datetime" />
			<column name="unselectable" type="boolean" />
			<foreign-key name="co" ref="companies" replication="p">
				<fk-col name="tenant_no" ref="tenant_no" />
				<fk-col name="company_no" ref="company_no" />
			</foreign-key>
		</table>

		<table name="employee_contracts" replication="master">
			<column name="tenant_no" type="int" pk="1" />
			<column name="company_no" type="int" pk="1" />
			<column name="employee_no" type="int" pk="1" />
			<column name="department_no" type="int" pk="1" />
			<column name="businessunit_no" type="int" pk="1" />
			<column name="valid_from" type="datetime" pk="1" />
			<column name="valid_to" type="datetime" />
			<column name="profession_no" type="int" />
			<column name="target_revenue_product" type="decimal(16,3)" />
			<column name="target_revenue_service" type="decimal(16,3)" />
			<column name="planed_week_working_hours" type="decimal(16,3)" />
			<column name="planed_week_working_days" type="decimal(16,3)" />
			<column name="work_factor" type="decimal(16,3)" />
			<column name="insurance_cd" type="varchar(200)" />
			<column name="employee_cd" type="varchar(20)" />
			<foreign-key name="em" ref="employees" replication="p">
				<fk-col name="tenant_no" />
				<fk-col name="company_no" />
				<fk-col name="employee_no" />
			</foreign-key>
			<foreign-key name="bu" ref="businessunits" replication="d">
				<fk-col name="tenant_no" />
				<fk-col name="company_no" />
				<fk-col name="department_no" />
				<fk-col name="businessunit_no" />
			</foreign-key>
			<foreign-key name="ea" ref="professions" replication="d">
				<fk-col name="tenant_no" />
				<fk-col name="company_no" />
				<fk-col name="department_no" />
				<fk-col name="profession_no" />
			</foreign-key>
		</table>


		<table name="employee_contract_att_times" replication="slave">
			<column name="tenant_no" type="int" pk="1" />
			<column name="pos_cd" type="varchar(10)" pk="1" />
			<column name="company_no" type="int" pk="1" />
			<column name="employee_no" type="int" pk="1" />
			<column name="department_no" type="int" pk="1" />
			<column name="businessunit_no" type="int" pk="1" />
			<column name="valid_from" type="datetime" pk="1" />
			<column name="from_ts" type="datetime" pk="1" />
			<column name="to_ts" type="datetime" />
			<column name="comment_txt" type="varchar(200)" />

			<foreign-key name="emc" ref="employee_contracts">
				<fk-col name="tenant_no" />
				<fk-col name="company_no" />
				<fk-col name="employee_no" />
				<fk-col name="department_no" />
				<fk-col name="businessunit_no" />
				<fk-col name="valid_from" />
			</foreign-key>

			<foreign-key name="ep" ref="points_of_sale" replication="p">
				<fk-col name="tenant_no" />
				<fk-col name="pos_cd" />
			</foreign-key>


		</table>

		<table name="professions" replication="master">
			<column name="tenant_no" type="int" pk="1" />
			<column name="company_no" type="int" pk="1" />
			<column name="department_no" type="int" pk="1" />
			<column name="profession_no" type="int" pk="1" />
			<column name="profession_nm" type="varchar(50)" nn="1" />
			<foreign-key name="dp" ref="departments" replication="p">
				<fk-col name="tenant_no" />
				<fk-col name="company_no" />
				<fk-col name="department_no" />
			</foreign-key>
		</table>

		<table name="cancel_payment_reasons" replication="master">
			<column name="tenant_no" type="int" pk="1" />
			<column name="company_no" type="int" pk="1" />
			<column name="department_no" type="int" pk="1" />
			<column name="businessunit_no" type="int" pk="1" />
			<column name="payment_cancel_cd" type="varchar(10)" pk="1" />
			<column name="payment_cancel_nm" type="varchar(50)" nn="1" />
			<foreign-key name="bu" ref="businessunits" replication="p">
				<fk-col name="tenant_no" />
				<fk-col name="company_no" />
				<fk-col name="department_no" />
				<fk-col name="businessunit_no" />
			</foreign-key>
		</table>

		<table name="cancel_note_reasons" replication="master">
			<column name="tenant_no" type="int" pk="1" />
			<column name="company_no" type="int" pk="1" />
			<column name="department_no" type="int" pk="1" />
			<column name="businessunit_no" type="int" pk="1" />
			<column name="note_cancel_cd" type="varchar(10)" pk="1" />
			<column name="note_cancel_nm" type="varchar(50)" nn="1" />
			<foreign-key name="bu" ref="businessunits" replication="p">
				<fk-col name="tenant_no" />
				<fk-col name="company_no" />
				<fk-col name="department_no" />
				<fk-col name="businessunit_no" />
			</foreign-key>
		</table>

		<table name="sales_pricelists" replication="master">
			<column name="tenant_no" type="int" pk="1" />
			<column name="company_no" type="int" pk="1" />
			<column name="department_no" type="int" pk="1" />
			<column name="market_no" type="int" pk="1" />
			<column name="sales_pricelist_id" type="int" pk="1" />
			<column name="sales_pricelist_nm" type="varchar(200)" nn="1" />
			<foreign-key name="mk" ref="markets" replication="p">
				<fk-col name="tenant_no" />
				<fk-col name="company_no" />
				<fk-col name="department_no" />
				<fk-col name="market_no" />
			</foreign-key>
		</table>

		<table name="sales_pricelist_instances" replication="master">
			<column name="tenant_no" type="int" pk="1" />
			<column name="company_no" type="int" pk="1" />
			<column name="department_no" type="int" pk="1" />
			<column name="market_no" type="int" pk="1" />
			<column name="sales_pricelist_id" type="int" pk="1" />
			<column name="sales_pricelist_instance_id" type="int" pk="1" />
			<column name="sales_pricelist_instance_nm" type="varchar(200)"
				nn="1" />
			<column name="valid_from" type="datetime" nn="1" />
			<column name="valid_to" type="datetime" />
			<foreign-key name="spl" ref="sales_pricelists"
				replication="p">
				<fk-col name="tenant_no" />
				<fk-col name="company_no" />
				<fk-col name="department_no" />
				<fk-col name="market_no" />
				<fk-col name="sales_pricelist_id" />
			</foreign-key>
		</table>
		
		<table name="sales_package_pricelist_instances" replication="master">
			<column name="tenant_no" type="int" pk="1" />
			<column name="company_no" type="int" pk="1" />
			<column name="department_no" type="int" pk="1" />
			<column name="market_no" type="int" pk="1" />
			<column name="package_item_cd" type="varchar(50)" pk="1" />
			<column name="sales_pricelist_id" type="int" pk="1" />
			<column name="sales_pricelist_instance_id" type="int" pk="1" />
			<column name="sales_pricelist_instance_nm" type="varchar(200)"
				nn="1" />
			<column name="valid_from" type="datetime" nn="1" />
			<column name="valid_to" type="datetime" />
			<foreign-key name="spl" ref="sales_pricelists"
				replication="p">
				<fk-col name="tenant_no" />
				<fk-col name="company_no" />
				<fk-col name="department_no" />
				<fk-col name="market_no" />
				<fk-col name="sales_pricelist_id" />
			</foreign-key>
			<foreign-key name="spli" ref="items"
				replication="d">
				<fk-col name="tenant_no" />
				<fk-col name="company_no" />
				<fk-col name="department_no" />
				<fk-col name="package_item_cd" ref="item_cd" />
				
			</foreign-key>
		</table>

		<table name="item_groups" replication="master">
			<column name="tenant_no" type="int" pk="1" />
			<column name="company_no" type="int" pk="1" />
			<column name="department_no" type="int" pk="1" />
			<column name="item_group_cd" type="varchar(50)" pk="1" />
			<column name="item_group_nm" type="varchar(200)" nn="1" />
			<column name="item_group_sort_nm" type="varchar(200)" />
			<column name="item_group_style" type="varchar(100)" />
			<column name="sellable" type="boolean" />
			<column name="parent_item_group_cd" type="varchar(50)" />
			<foreign-key name="dp" ref="departments" replication="p">
				<fk-col name="tenant_no" />
				<fk-col name="company_no" />
				<fk-col name="department_no" />
			</foreign-key>
			<foreign-key name="ig" ref="item_groups" replication="s">
				<fk-col name="tenant_no" />
				<fk-col name="company_no" />
				<fk-col name="department_no" />
				<fk-col name="parent_item_group_cd" ref="item_group_cd" />
			</foreign-key>
		</table>

		<table name="item_condition_groups" replication="master">
			<column name="tenant_no" type="int" pk="1" />
			<column name="company_no" type="int" pk="1" />
			<column name="department_no" type="int" pk="1" />
			<column name="market_no" type="int" pk="1" />
			<column name="item_condition_group_cd" type="varchar(50)" pk="1" />
			<column name="item_condition_group_nm" type="varchar(200)" nn="1" />
			<foreign-key name="mk" ref="markets" replication="p">
				<fk-col name="tenant_no" />
				<fk-col name="company_no" />
				<fk-col name="department_no" />
				<fk-col name="market_no" />
			</foreign-key>
		</table>

		<table name="item_condition_group_members" replication="master">
			<column name="tenant_no" type="int" pk="1" />
			<column name="company_no" type="int" pk="1" />
			<column name="department_no" type="int" pk="1" />
			<column name="market_no" type="int" pk="1" />
			<column name="item_condition_group_cd" type="varchar(50)" pk="1" />
			<column name="item_cd" type="varchar(50)" pk="1" />
			<foreign-key name="icg" ref="item_condition_groups"
				replication="p">
				<fk-col name="tenant_no" />
				<fk-col name="company_no" />
				<fk-col name="department_no" />
				<fk-col name="market_no" />
				<fk-col name="item_condition_group_cd" />
			</foreign-key>
			<foreign-key name="it" ref="items" replication="d">
				<fk-col name="tenant_no" />
				<fk-col name="company_no" />
				<fk-col name="department_no" />
				<fk-col name="item_cd" />
			</foreign-key>
		</table>

		<table name="item_conditions" replication="master">
			<column name="tenant_no" type="int" pk="1" />
			<column name="company_no" type="int" pk="1" />
			<column name="department_no" type="int" pk="1" />
			<column name="market_no" type="int" pk="1" />
			<column name="item_condition_cd" type="varchar(50)" pk="1" />
			<column name="item_condition_group_cd" type="varchar(50)" nn="1" />
			<column name="rebate_percent" type="decimal(5,2)" />
			<foreign-key name="dp" ref="item_condition_groups"
				replication="p">
				<fk-col name="tenant_no" />
				<fk-col name="company_no" />
				<fk-col name="department_no" />
				<fk-col name="market_no" />
				<fk-col name="item_condition_group_cd" />
			</foreign-key>
		</table>

		<table name="item_revenue_accounts" replication="master">
			<column name="tenant_no" type="int" pk="1" />
			<column name="company_no" type="int" pk="1" />
			<column name="department_no" type="int" pk="1" />
			<column name="item_revenue_acct_no" type="int" pk="1" />
			<column name="item_revenue_acct_nm" type="varchar(200)" nn="1" />
			<column name="acct_cd" type="varchar(50)" />
			<foreign-key name="dp" ref="departments" replication="p">
				<fk-col name="tenant_no" />
				<fk-col name="company_no" />
				<fk-col name="department_no" />
			</foreign-key>

		</table>

		<table name="item_purchase_groups" replication="master">
			<column name="tenant_no" type="int" pk="1" />
			<column name="company_no" type="int" pk="1" />
			<column name="department_no" type="int" pk="1" />
			<column name="item_purchase_group_cd" type="varchar(50)" pk="1" />
			<column name="item_purchase_group_nm" type="varchar(200)" nn="1" />

			<foreign-key name="dp" ref="departments" replication="p">
				<fk-col name="tenant_no" />
				<fk-col name="company_no" />
				<fk-col name="department_no" />
			</foreign-key>

		</table>

		<table name="sales_credits" replication="master">
			<column name="tenant_no" type="int" pk="1" />
			<column name="company_no" type="int" pk="1" />
			<column name="department_no" type="int" pk="1" />
			<column name="market_no" type="int" pk="1" />
			<column name="sales_credit_cd" type="varchar(50)" pk="1" />
			<column name="points_per_revenue" type="decimal(9,6)" />
			<column name="credit_per_point" type="decimal(9,6)" />
			<column name="min_credit_points" type="decimal(10,4)" />
			<column name="voucher_definition_cd" type="varchar(50)" />
			<foreign-key name="mk" ref="markets" replication="p">
				<fk-col name="tenant_no" />
				<fk-col name="company_no" />
				<fk-col name="department_no" />
				<fk-col name="market_no" />
			</foreign-key>
			<foreign-key name="vd" ref="voucher_definitions">
				<fk-col name="tenant_no" />
				<fk-col name="company_no" />
				<fk-col name="department_no" />
				<fk-col name="market_no" />
				<fk-col name="voucher_definition_cd" />
			</foreign-key>
		</table>

		<table name="voucher_definitions" replication="master">
			<column name="tenant_no" type="int" pk="1" />
			<column name="company_no" type="int" pk="1" />
			<column name="department_no" type="int" pk="1" />
			<column name="market_no" type="int" pk="1" />
			<column name="voucher_definition_cd" type="varchar(50)" pk="1" />
			<column name="voucher_mode" type="int" />
			<column name="voucher_type" type="int" />
			<column name="form_url" type="varchar(200)" />
			<column name="simple_account_cd" type="varchar(50)" />
			<foreign-key name="mk" ref="markets" replication="p">
				<fk-col name="tenant_no" />
				<fk-col name="company_no" />
				<fk-col name="department_no" />
				<fk-col name="market_no" />
			</foreign-key>
		</table>


		<table name="item_report_categories" replication="master">
			<column name="tenant_no" type="int" pk="1" />
			<column name="company_no" type="int" pk="1" />
			<column name="department_no" type="int" pk="1" />
			<column name="item_report_category_cd" type="varchar(50)" pk="1" />
			<column name="item_report_category_nm" type="varchar(200)" nn="1" />
			<column name="use_customer_group" type="boolean" />
			<foreign-key name="dp" ref="departments" replication="p">
				<fk-col name="tenant_no" />
				<fk-col name="company_no" />
				<fk-col name="department_no" />
			</foreign-key>
		</table>

		<table name="item_report_groups" replication="master">
			<column name="tenant_no" type="int" pk="1" />
			<column name="company_no" type="int" pk="1" />
			<column name="department_no" type="int" pk="1" />
			<column name="item_report_category_cd" type="varchar(50)" pk="1" />
			<column name="item_report_group_cd" type="varchar(50)" pk="1" />
			<column name="item_report_group_nm" type="varchar(200)" nn="1" />
			<column name="color_factor_flag" type="boolean" />
			<foreign-key name="irc" ref="item_report_categories"
				replication="p">
				<fk-col name="tenant_no" />
				<fk-col name="company_no" />
				<fk-col name="department_no" />
				<fk-col name="item_report_category_cd" />
			</foreign-key>
		</table>

		<table name="item_report_group_members" replication="master">
			<column name="tenant_no" type="int" pk="1" />
			<column name="company_no" type="int" pk="1" />
			<column name="department_no" type="int" pk="1" />
			<column name="item_report_category_cd" type="varchar(50)" pk="1" />
			<column name="item_report_group_cd" type="varchar(50)" pk="1" />
			<column name="item_cd" type="varchar(50)" pk="1" />
			<foreign-key name="icg" ref="item_report_groups"
				replication="p">
				<fk-col name="tenant_no" />
				<fk-col name="company_no" />
				<fk-col name="department_no" />
				<fk-col name="item_report_category_cd" />
				<fk-col name="item_report_group_cd" />
			</foreign-key>
			<foreign-key name="it" ref="items" replication="d">
				<fk-col name="tenant_no" />
				<fk-col name="company_no" />
				<fk-col name="department_no" />
				<fk-col name="item_cd" />
			</foreign-key>
			<index name="irgm_irc" unique="1">
				<ix-col name="tenant_no" />
				<ix-col name="company_no" />
				<ix-col name="department_no" />
				<ix-col name="item_report_category_cd" />
				<ix-col name="item_cd" />
			</index>

		</table>




		<table name="items" replication="master">
			<column name="tenant_no" type="int" pk="1" />
			<column name="company_no" type="int" pk="1" />
			<column name="department_no" type="int" pk="1" />
			<column name="item_cd" type="varchar(50)" pk="1" />
			<column name="unselectable" type="boolean" />
			<column name="item_ean" type="varchar(200)" />
			<column name="item_ean2" type="varchar(200)" />
			<column name="item_nm" type="varchar(200)" nn="1" />
			<column name="item_nm_2" type="varchar(200)" />
			<column name="item_nm_3" type="varchar(200)" />
			<column name="unit_cd" type="varchar(10)" />
			<column name="tax_cd" type="varchar(10)" />
			<column name="item_account_cd" type="varchar(10)" />
			<column name="item_group_cd" type="varchar(50)" />
			<column name="sellable" type="boolean" />
			<column name="stockable" type="boolean" />
			<column name="employee" type="boolean" />
			<column name="operating_employee" type="boolean" />
			<column name="is_package" type="boolean" />
			<column name="item_revenue_acct_no" type="int" />
			<column name="item_revenue_acct_cd" type="varchar(50)" />
			<column name="item_purchase_group_cd" type="varchar(50)" />

			<column name="item_amount_rule" type="int">
				<constant name="AMOUNT_INPUT" value="1" />
				<constant name="AMOUNT_ALWAYS_1" value="2" />
			</column>
			<column name="item_style" type="varchar(100)" />
			<column name="portfolio_cd" type="varchar(20)" />

			/* Kundenkarte */
			<column name="customer_contract" type="boolean" />
			<column name="customer_contract_no" type="int" />
			<column name="customer_contract_duration_days" type="int" />
			<column name="customer_contract_nm" type="varchar(100)" />

			<!-- alt -->
			<column name="cc_sales_pricelist_id" type="int" />
			<column name="cc_item_condition_cd" type="varchar(50)" />
			<column name="cc_sales_credit_cd" type="varchar(50)" />

			<!-- -->
			<!-- Neu -->
			<column name="condition_cd" type="varchar(10)" />
			<foreign-key name="c" ref="conditions" replication="d">
				<fk-col name="tenant_no" />
				<fk-col name="condition_cd" />
			</foreign-key>
			<foreign-key name="dp" ref="departments" replication="p">
				<fk-col name="tenant_no" />
				<fk-col name="company_no" />
				<fk-col name="department_no" />
			</foreign-key>
			<foreign-key name="ig" ref="item_groups" replication="d">
				<fk-col name="tenant_no" />
				<fk-col name="company_no" />
				<fk-col name="department_no" />
				<fk-col name="item_group_cd" />
			</foreign-key>
			<foreign-key name="ira" ref="item_revenue_accounts"
				replication="d">
				<fk-col name="tenant_no" />
				<fk-col name="company_no" />
				<fk-col name="department_no" />
				<fk-col name="item_revenue_acct_no" />
			</foreign-key>
			<foreign-key name="ipg" ref="item_purchase_groups"
				replication="d">
				<fk-col name="tenant_no" />
				<fk-col name="company_no" />
				<fk-col name="department_no" />
				<fk-col name="item_purchase_group_cd" />
			</foreign-key>
		</table>

		<table name="child_items" replication="master">
			<column name="tenant_no" type="int" pk="1" />
			<column name="company_no" type="int" pk="1" />
			<column name="department_no" type="int" pk="1" />
			<column name="parent_item_cd" type="varchar(50)" pk="1" />
			<column name="item_cd" type="varchar(50)" pk="1" />
			<foreign-key name="pit" ref="items" replication="p">
				<fk-col name="tenant_no" />
				<fk-col name="company_no" />
				<fk-col name="department_no" />
				<fk-col name="parent_item_cd" ref="item_cd" />
			</foreign-key>
			<foreign-key name="it" ref="items" replication="d">
				<fk-col name="tenant_no" />
				<fk-col name="company_no" />
				<fk-col name="department_no" />
				<fk-col name="item_cd" />
			</foreign-key>
		</table>

		<table name="sales_item_professions" replication="master">
			<column name="tenant_no" type="int" pk="1" />
			<column name="company_no" type="int" pk="1" />
			<column name="department_no" type="int" pk="1" />
			<column name="item_profession_no" type="int" pk="1" />
			<column name="item_profession_nm" type="varchar(50)" nn="1" />
			<foreign-key name="dp" ref="departments" replication="p">
				<fk-col name="tenant_no" />
				<fk-col name="company_no" />
				<fk-col name="department_no" />
			</foreign-key>
		</table>

		<table name="sales_item_profession_members" replication="master">
			<column name="tenant_no" type="int" pk="1" />
			<column name="company_no" type="int" pk="1" />
			<column name="department_no" type="int" pk="1" />
			<column name="item_profession_no" type="int" pk="1" />
			<column name="profession_no" type="int" pk="1" />
			<foreign-key name="pf" ref="professions" replication="d">
				<fk-col name="tenant_no" />
				<fk-col name="company_no" />
				<fk-col name="department_no" />
				<fk-col name="profession_no" />
			</foreign-key>
			<foreign-key name="sipf" ref="sales_item_professions"
				replication="p">
				<fk-col name="tenant_no" />
				<fk-col name="company_no" />
				<fk-col name="department_no" />
				<fk-col name="item_profession_no" />
			</foreign-key>
		</table>

		<table name="sales_item_prices" replication="master">
			<column name="tenant_no" type="int" pk="1" />
			<column name="company_no" type="int" pk="1" />
			<column name="department_no" type="int" pk="1" />
			<column name="market_no" type="int" pk="1" />
			<column name="sales_pricelist_id" type="int" pk="1" />
			<column name="sales_pricelist_instance_id" type="int" pk="1" />
			<column name="item_cd" type="varchar(50)" pk="1" />
			<column name="item_profession_no" type="int" pk="1" />
			<column name="ref_item_cd" type="varchar(10)" />
			<column name="currency_cd" type="varchar(10)" />
			<column name="item_net_price" type="decimal(16,3)" />
			<column name="gross_price" type="boolean" />
			<column name="item_gross_price" type="decimal(16,3)" />
			<column name="special_price" type="boolean" />

			<foreign-key name="pi" ref="sales_pricelist_instances"
				replication="p">
				<fk-col name="tenant_no" />
				<fk-col name="company_no" />
				<fk-col name="department_no" />
				<fk-col name="market_no" />
				<fk-col name="sales_pricelist_id" />
				<fk-col name="sales_pricelist_instance_id" />
			</foreign-key>
			<foreign-key name="it" ref="items" replication="d">
				<fk-col name="tenant_no" />
				<fk-col name="company_no" />
				<fk-col name="department_no" />
				<fk-col name="item_cd" />
			</foreign-key>
			<foreign-key name="sip" ref="sales_item_professions"
				replication="d">
				<fk-col name="tenant_no" />
				<fk-col name="company_no" />
				<fk-col name="department_no" />
				<fk-col name="item_profession_no" />
			</foreign-key>
			<foreign-key name="cr" ref="currencies" replication="d">
				<fk-col name="tenant_no" />
				<fk-col name="currency_cd" />
			</foreign-key>
		</table>
		
		
		<table name="sales_package_item_prices" replication="master">
			<column name="tenant_no" type="int" pk="1" />
			<column name="company_no" type="int" pk="1" />
			<column name="department_no" type="int" pk="1" />
			<column name="market_no" type="int" pk="1" />
			<column name="package_item_cd" type="varchar(50)" pk="1" />
			<column name="sales_pricelist_id" type="int" pk="1" />
			<column name="sales_pricelist_instance_id" type="int" pk="1" />
			<column name="item_cd" type="varchar(50)" pk="1" />
			<column name="item_profession_no" type="int" pk="1" />
			<column name="ref_item_cd" type="varchar(10)" />
			<column name="currency_cd" type="varchar(10)" />
			<column name="item_net_price" type="decimal(16,3)" />
			<column name="gross_price" type="boolean" />
			<column name="item_gross_price" type="decimal(16,3)" />
			<column name="special_price" type="boolean" />

			<foreign-key name="pi" ref="sales_package_pricelist_instances"
				replication="p">
				<fk-col name="tenant_no" />
				<fk-col name="company_no" />
				<fk-col name="department_no" />
				<fk-col name="market_no" />
				<fk-col name="package_item_cd" />
				<fk-col name="sales_pricelist_id" />
				<fk-col name="sales_pricelist_instance_id" />
			</foreign-key>
			<foreign-key name="it" ref="items" replication="d">
				<fk-col name="tenant_no" />
				<fk-col name="company_no" />
				<fk-col name="department_no" />
				<fk-col name="item_cd" />
			</foreign-key>
			<foreign-key name="sip" ref="sales_item_professions"
				replication="d">
				<fk-col name="tenant_no" />
				<fk-col name="company_no" />
				<fk-col name="department_no" />
				<fk-col name="item_profession_no" />
			</foreign-key>
			<foreign-key name="cr" ref="currencies" replication="d">
				<fk-col name="tenant_no" />
				<fk-col name="currency_cd" />
			</foreign-key>
		</table>

		<table name="item_suppliers" replication="master">
			<column name="tenant_no" type="int" pk="1" />
			<column name="contact_no" type="int" pk="1" />
			<column name="company_no" type="int" pk="1" />
			<column name="department_no" type="int" pk="1" />
			<column name="stock_no" type="int" pk="1" />
			<column name="item_cd" type="varchar(50)" pk="1" />
			<column name="supplier_no" type="int" />
			<!-- Modelländerung #2 -->
			<column name="default_supplier" type="boolean" /> <!-- für Bestellvorschläge, nur einer je item und lager darf den haken haben. -->
			<!-- /Modelländerung #2 -->

			<column name="min_stock_amount" type="decimal(16,3)" /> <!-- Entfernen! -->
			<column name="order_amount" type="decimal(16,3)" /> <!-- Entfernen! -->

			<foreign-key name="su" ref="supplier_roles" replication="d">
				<fk-col name="tenant_no" />
				<fk-col name="contact_no" />
				<fk-col name="company_no" />
				<fk-col name="supplier_no" />
			</foreign-key>
			<foreign-key name="ps" ref="stocks" replication="d">
				<fk-col name="tenant_no" />
				<fk-col name="company_no" />
				<fk-col name="department_no" />
				<fk-col name="stock_no" />
			</foreign-key>
			<foreign-key name="it" ref="items" replication="p">
				<fk-col name="tenant_no" />
				<fk-col name="company_no" />
				<fk-col name="department_no" />
				<fk-col name="item_cd" />
			</foreign-key>
		</table>

		<!-- Modelländerung #2 -->
		<table name="item_stocks" replication="master">
			<column name="tenant_no" type="int" pk="1" />
			<column name="contact_no" type="int" pk="1" />
			<column name="company_no" type="int" pk="1" />
			<column name="department_no" type="int" pk="1" />
			<column name="stock_no" type="int" pk="1" />
			<column name="item_cd" type="varchar(50)" pk="1" />
			<column name="min_stock_amount" type="decimal(16,3)" />
			<column name="desired_stock_amount" type="decimal(16,3)" /> <!-- gewünschter lagerbestand nach Bestellung -->
			<column name="max_stock_amount" type="decimal(16,3)" /> <!-- lagerbestand nach Bestellung -->
			<column name="package_size" type="decimal(16,3)" />
			<column name="package_unit_cd" type="varchar(20)" />

			<foreign-key name="ps" ref="stocks" replication="d">
				<fk-col name="tenant_no" />
				<fk-col name="company_no" />
				<fk-col name="department_no" />
				<fk-col name="stock_no" />
			</foreign-key>
			<foreign-key name="it" ref="items" replication="p">
				<fk-col name="tenant_no" />
				<fk-col name="company_no" />
				<fk-col name="department_no" />
				<fk-col name="item_cd" />
			</foreign-key>
		</table>
		<!-- /Modelländerung #2 -->

		<table name="purchase_item_prices" replication="master">
			<column name="tenant_no" type="int" pk="1" />
			<column name="contact_no" type="int" pk="1" />
			<column name="company_no" type="int" pk="1" />
			<column name="department_no" type="int" pk="1" />
			<column name="supplier_no" type="int" pk="1" />
			<column name="stock_no" type="int" pk="1" />
			<column name="item_cd" type="varchar(50)" pk="1" />
			<column name="price_ts" type="datetime" pk="1" />
			<column name="currency_cd" type="varchar(10)" />
			<column name="item_net_price" type="decimal(16,3)" />
			<column name="gross_price" type="boolean" />
			<column name="item_gross_price" type="decimal(16,3)" />

			<foreign-key name="su" ref="supplier_roles" replication="d">
				<fk-col name="tenant_no" />
				<fk-col name="contact_no" />
				<fk-col name="company_no" />
				<fk-col name="supplier_no" />
			</foreign-key>
			<foreign-key name="ps" ref="stocks" replication="d">
				<fk-col name="tenant_no" />
				<fk-col name="company_no" />
				<fk-col name="department_no" />
				<fk-col name="stock_no" />
			</foreign-key>
			<foreign-key name="it" ref="items" replication="p">
				<fk-col name="tenant_no" />
				<fk-col name="company_no" />
				<fk-col name="department_no" />
				<fk-col name="item_cd" />
			</foreign-key>
			<foreign-key name="cr" ref="currencies" replication="d">
				<fk-col name="tenant_no" />
				<fk-col name="currency_cd" />
			</foreign-key>
		</table>


		<table name="conditions" replication="master" engine="pos">
			<column name="tenant_no" type="int" pk="1" />
			<column name="condition_cd" type="varchar(10)" pk="1" />
			<column name="condition_nm" type="varchar(50)" nn="1" /> 	<!-- S-Card -->
			<column name="card_with_serial_number" type="boolean" />
			<column name="expiry" type="varchar(30)">
				<!-- 1Y = 1 Jahr, 5M = 5 Monate, 30D = 30 Tage... alles andere=never -->

			</column>
		</table>

		<table name="cards_queue" replication="slave" engine="pos">
			<column name="tenant_no" type="int" pk="1" />
			<column name="card_uid" type="varchar(36)" pk="1" />
			<column name="queue_id" type="long" pk="1" />
			<column name="card_cd" type="varchar(36)" />
			<column name="condition_cd" type="varchar(10)" />
			<column name="processed" type="boolean" />
			<column name="card_state" type="int">
			</column>
			// null = gültig 1=expired 2=canceled
			<column name="cards_usage_ts" type="datetime" />
			// Pos-Code, Anwender, Kunde....
			<column name="valid_from" type="datetime" nn="1" />
			<column name="valid_to" type="datetime" />
			<column name="owner_master_cd" type="varchar(200)" />
			<column name="cancel_reason" type="varchar(200)" />
			<column name="pos_cd" type="varchar(10)" />
			<column name="customer_no" type="int" />
			<column name="contact_no" type="int" />
			<!-- <column name="company_no" type="int" /> -->
			<column name="contact_nm" type="varchar(200)" />
			<column name="first_nm" type="varchar(60)" />
			<column name="title" type="varchar(20)" />
			<column name="salutation" type="varchar(20)" />
			<column name="street" type="varchar(200)" />
			<column name="country_cd" type="varchar(10)" />
			<column name="postal_cd" type="varchar(20)" />
			<column name="city" type="varchar(200)" />
			<column name="email" type="varchar(200)" />
			<column name="phone" type="varchar(200)" />
			<column name="mobile" type="varchar(200)" />

		</table>




		<table name="cards" replication="master" engine="pos">
			<column name="tenant_no" type="int" pk="1" />
			<column name="card_uid" type="varchar(36)" pk="1" />
			<column name="card_cd" type="varchar(36)" />
			<column name="condition_cd" type="varchar(10)" />
			<column name="update_cnt" type="long" />
			<foreign-key name="c" ref="conditions" replication="d">
				<fk-col name="tenant_no" />
				<fk-col name="condition_cd" />
			</foreign-key>
		</table>

		<table name="cards_usage" replication="master" engine="pos">
			<column name="tenant_no" type="int" pk="1" />
			<column name="card_uid" type="varchar(36)" pk="1" />
			<column name="card_usage_id" type="int" pk="1" />
			// Zeitstempel
			<column name="card_state" type="int">

			</column>
			// null = gültig 1=expired 2=canceled
			<column name="cards_usage_ts" type="datetime" />
			// Pos-Code, Anwender, Kunde....
			<column name="valid_from" type="datetime" nn="1" />
			<column name="valid_to" type="datetime" />
			<column name="owner_master_cd" type="varchar(200)" />
			<column name="cancel_reason" type="varchar(200)" />
			<column name="pos_cd" type="varchar(10)" />
			<column name="customer_no" type="int" />
			<column name="contact_no" type="int" />
			<column name="contact_nm" type="varchar(200)" />
			<column name="first_nm" type="varchar(60)" />
			<column name="title" type="varchar(20)" />
			<column name="salutation" type="varchar(20)" />
			<column name="street" type="varchar(200)" />
			<column name="country_cd" type="varchar(10)" />
			<column name="postal_cd" type="varchar(20)" />
			<column name="city" type="varchar(200)" />
			<column name="email" type="varchar(200)" />
			<column name="phone" type="varchar(200)" />
			<column name="mobile" type="varchar(200)" />


			<foreign-key name="c" ref="cards" replication="d">
				<fk-col name="tenant_no" />
				<fk-col name="card_uid" />
			</foreign-key>
		</table>




		<!-- Konditionen Typen einstellungen pro Market -->
		<table name="market_conditions" replication="master" engine="pos">
			<column name="tenant_no" type="int" pk="1" />
			<column name="company_no" type="int" pk="1" />
			<column name="department_no" type="int" pk="1" />
			<column name="market_no" type="int" pk="1" />
			<column name="condition_cd" type="varchar(10)" pk="1" />
			<column name="sales_pricelist_id" type="int" />
			<column name="item_condition_cd" type="varchar(50)" />
			<column name="sales_credit_cd" type="varchar(50)" />
			<foreign-key name="c" ref="conditions" replication="d">
				<fk-col name="tenant_no" />
				<fk-col name="condition_cd" />
			</foreign-key>
			<foreign-key name="spl" ref="sales_pricelists"
				replication="d">
				<fk-col name="tenant_no" />
				<fk-col name="company_no" />
				<fk-col name="department_no" />
				<fk-col name="market_no" />
				<fk-col name="sales_pricelist_id" />
			</foreign-key>
			<foreign-key name="ic" ref="item_conditions" replication="d">
				<fk-col name="tenant_no" />
				<fk-col name="company_no" />
				<fk-col name="department_no" />
				<fk-col name="market_no" />
				<fk-col name="item_condition_cd" />
			</foreign-key>
			<foreign-key name="sc" ref="sales_credits" replication="d">
				<fk-col name="tenant_no" />
				<fk-col name="company_no" />
				<fk-col name="department_no" />
				<fk-col name="market_no" />
				<fk-col name="sales_credit_cd" />
			</foreign-key>
		</table>


		<!-- Konditionen Typen einstellungen pro businessunit -->
		<table name="businessunit_conditions" replication="master"
			engine="pos">
			<column name="tenant_no" type="int" pk="1" />
			<column name="company_no" type="int" pk="1" />
			<column name="department_no" type="int" pk="1" />
			<column name="businessunit_no" type="int" pk="1" />
			<column name="condition_cd" type="varchar(10)" pk="1" />
			<column name="market_no" type="int" nn="1" />
			<column name="sales_pricelist_id" type="int" />
			<column name="item_condition_cd" type="varchar(50)" />
			<column name="sales_credit_cd" type="varchar(50)" />
			<foreign-key name="c" ref="conditions" replication="d">
				<fk-col name="tenant_no" />
				<fk-col name="condition_cd" />
			</foreign-key>

			<foreign-key name="spl" ref="sales_pricelists"
				replication="d">
				<fk-col name="tenant_no" />
				<fk-col name="company_no" />
				<fk-col name="department_no" />
				<fk-col name="market_no" />
				<fk-col name="sales_pricelist_id" />
			</foreign-key>
			<foreign-key name="ic" ref="item_conditions" replication="d">
				<fk-col name="tenant_no" />
				<fk-col name="company_no" />
				<fk-col name="department_no" />
				<fk-col name="market_no" />
				<fk-col name="item_condition_cd" />
			</foreign-key>
			<foreign-key name="sc" ref="sales_credits" replication="d">
				<fk-col name="tenant_no" />
				<fk-col name="company_no" />
				<fk-col name="department_no" />
				<fk-col name="market_no" />
				<fk-col name="sales_credit_cd" />
			</foreign-key>
		</table>



		<table name="contacts" replication="master">
			<column name="tenant_no" type="int" pk="1" />
			<column name="contact_no" type="int" pk="1" />
			<column name="contact_nm" type="varchar(200)" nn="1" />
			<column name="first_nm" type="varchar(60)" />
			<column name="title" type="varchar(20)" />
			<column name="salutation" type="varchar(20)" />
			<column name="street" type="varchar(200)" />
			<column name="country_cd" type="varchar(10)" />
			<column name="postal_cd" type="varchar(20)" />
			<column name="city" type="varchar(200)" />
			<column name="email" type="varchar(200)" />
			<column name="phone" type="varchar(200)" />
			<column name="mobile" type="varchar(200)" />
			<column name="update_cnt" type="long" />

			<index name="cu_co_nm">
				<ix-col name="tenant_no" />
				<ix-col name="contact_nm" />
			</index>
			<index name="cu_co_fnm">
				<ix-col name="tenant_no" />
				<ix-col name="first_nm" />
			</index>
			<index name="co_nm_fn">
				<ix-col name="tenant_no" />
				<ix-col name="contact_nm" />
				<ix-col name="first_nm" />
			</index>
			<foreign-key name="tn" ref="tenants" replication="p">
				<fk-col name="tenant_no" />
			</foreign-key>
		</table>

		<table name="customer_groups" replication="master">
			<column name="tenant_no" type="int" pk="1" />
			<column name="company_no" type="int" pk="1" />
			<column name="customer_group_no" type="int" pk="1" />
			<column name="customer_group_nm" type="varchar(200)" nn="1" />
			<column name="acct_cd" type="varchar(20)" />
			<column name="update_cnt" type="long" />

			<foreign-key name="co" ref="companies" replication="p">
				<fk-col name="tenant_no" />
				<fk-col name="company_no" />
			</foreign-key>
		</table>

		<table name="customer_roles" replication="master">
			<column name="tenant_no" type="int" pk="1" />
			<column name="contact_no" type="int" pk="1" />
			<column name="company_no" type="int" pk="1" />
			<column name="customer_no" type="int" pk="1" />
			<column name="comment" type="varchar(200)" />
			<column name="notes" type="varchar(200)" />
			<column name="customer_group_no" type="int" />
			<column name="birthday" type="datetime" />
			<column name="group_role" type="boolean" />
			<column name="unselectable" type="boolean" />
			<column name="imported" type="boolean" />
			<column name="update_cnt" type="long" />
			<foreign-key name="ct" ref="contacts" replication="d">
				<fk-col name="tenant_no" />
				<fk-col name="contact_no" />
			</foreign-key>
			<foreign-key name="co" ref="companies" replication="p">
				<fk-col name="tenant_no" />
				<fk-col name="company_no" />
			</foreign-key>
		</table>

		<table name="customer_master" replication="master">
			<column name="tenant_no" type="int" pk="1" />
			<column name="contact_no" type="int" pk="1" />
			<column name="company_no" type="int" pk="1" />
			<column name="customer_no" type="int" pk="1" />
			<column name="master_cd" type="varchar(200)" />
			<column name="update_cnt" type="long" />
			<column name="main_update_cnt" type="long" />
			<column name="deleted" type="boolean" />
			<foreign-key name="cr" ref="customer_roles" replication="d">
				<fk-col name="tenant_no" />
				<fk-col name="contact_no" />
				<fk-col name="company_no" />
				<fk-col name="customer_no" />
			</foreign-key>
		</table>

		<table name="contact_master" replication="master">
			<column name="tenant_no" type="int" pk="1" />
			<column name="master_cd" type="varchar(200)" pk="1" />
			<column name="contact_no" type="int" nn="1" />
			<column name="update_cnt" type="long" />
			<column name="main_update_cnt" type="long" />
			<column name="deleted" type="boolean" />
			<foreign-key name="cr" ref="contacts" replication="p">
				<fk-col name="tenant_no" />
				<fk-col name="contact_no" />

			</foreign-key>
		</table>

		<table name="customer_contracts" replication="master">
			<column name="tenant_no" type="int" pk="1" />
			<column name="contact_no" type="int" pk="1" />
			<column name="company_no" type="int" pk="1" />
			<column name="customer_no" type="int" pk="1" />
			<column name="customer_contract_no" type="int" pk="1" />
			<column name="customer_contract_nm" type="varchar(200)" nn="1" />
			<column name="update_cnt" type="long" />
			<foreign-key name="cu" ref="customer_roles" replication="p">
				<fk-col name="tenant_no" />
				<fk-col name="contact_no" />
				<fk-col name="company_no" />
				<fk-col name="customer_no" />
			</foreign-key>
		</table>

		<table name="customer_contract_conditions" replication="master"
			engine="pos">
			<column name="tenant_no" type="int" pk="1" />
			<column name="contact_no" type="int" pk="1" />
			<column name="company_no" type="int" pk="1" />
			<column name="department_no" type="int" pk="1" />

			<column name="customer_no" type="int" pk="1" />
			<column name="customer_contract_no" type="int" pk="1" />
			<column name="valid_from" type="datetime" pk="1" />
			<column name="valid_to" type="datetime" />

			<!-- neu -->

			<column name="condition_cd" type="varchar(10)" />

			<column name="card_uid" type="varchar(36)" />
			<column name="card_no" type="varchar(30)" />
			<column name="card_usage_id" type="int" />

			<column name="deleted" type="boolean" />
			<column name="update_cnt" type="long" />

			<foreign-key name="c" ref="conditions" replication="d">
				<fk-col name="tenant_no" />
				<fk-col name="condition_cd" />
			</foreign-key>
			<foreign-key name="cu" ref="customer_contracts"
				replication="p">
				<fk-col name="tenant_no" />
				<fk-col name="contact_no" />
				<fk-col name="company_no" />
				<fk-col name="customer_no" />
				<fk-col name="customer_contract_no" />
			</foreign-key>

		</table>


		<table name="customer_contract_conditions_mig" engine="pos">
			<column name="tenant_no" type="int" pk="1" />
			<column name="contact_no" type="int" pk="1" />
			<column name="company_no" type="int" pk="1" />
			<column name="department_no" type="int" pk="1" />
			<column name="market_no" type="int" pk="1" />
			<column name="customer_no" type="int" pk="1" />
			<column name="customer_contract_no" type="int" pk="1" />

			<column name="valid_from" type="datetime" pk="1" />
			<column name="valid_to" type="datetime" />

			<!-- neu -->

			<column name="condition_cd" type="varchar(10)" />

			<column name="card_uid" type="varchar(36)" />
			<column name="card_no" type="varchar(30)" />
			<!-- alt -->

			<column name="card_nm" type="varchar(100)" />
			<column name="sales_pricelist_id" type="int" />
			<column name="item_condition_cd" type="varchar(50)" />
			<column name="sales_credit_cd" type="varchar(50)" />
			<column name="phase_out" type="boolean" />




		</table>


		<table name="customer_businessunit_contracts" replication="master"
			engine="pos">
			<column name="tenant_no" type="int" pk="1" />
			<column name="contact_no" type="int" pk="1" />
			<column name="company_no" type="int" pk="1" />
			<column name="department_no" type="int" pk="1" />
			<column name="businessunit_no" type="int" />
			<column name="customer_no" type="int" pk="1" />
			<column name="customer_contract_no" type="int" pk="1" />
			<foreign-key name="cu" ref="customer_contracts"
				replication="p">
				<fk-col name="tenant_no" />
				<fk-col name="contact_no" />
				<fk-col name="company_no" />
				<fk-col name="customer_no" />
				<fk-col name="customer_contract_no" />
			</foreign-key>
			<foreign-key name="bu" ref="businessunits" replication="d">
				<fk-col name="tenant_no" />
				<fk-col name="company_no" />
				<fk-col name="department_no" />
				<fk-col name="businessunit_no" />
			</foreign-key>
		</table>

		<table name="supplier_roles" replication="master">
			<column name="tenant_no" type="int" pk="1" />
			<column name="contact_no" type="int" pk="1" />
			<column name="company_no" type="int" pk="1" />
			<column name="supplier_no" type="int" pk="1" />
			<column name="webpage" type="varchar(200)" />
			<column name="contact_person_nm" type="varchar(200)" />
			<column name="order_url" type="varchar(200)" />

			<column name="eu_tax_id" type="varchar(30)" />
			<column name="creditor_cd" type="varchar(20)" />

			<column name="unselectable" type="boolean" />
			<foreign-key name="ct" ref="contacts" replication="d">
				<fk-col name="tenant_no" />
				<fk-col name="contact_no" />
			</foreign-key>
			<foreign-key name="co" ref="companies" replication="p">
				<fk-col name="tenant_no" />
				<fk-col name="company_no" />
			</foreign-key>
		</table>

		<table name="supplier_contracts" replication="master">
			<column name="tenant_no" type="int" pk="1" />
			<column name="contact_no" type="int" pk="1" />
			<column name="company_no" type="int" pk="1" />
			<column name="supplier_no" type="int" pk="1" />
			<column name="supplier_contract_no" type="int" pk="1" />
			<column name="contract_nm" type="varchar(200)" nn="1" />
			<foreign-key name="su" ref="supplier_roles" replication="p">
				<fk-col name="tenant_no" />
				<fk-col name="contact_no" />
				<fk-col name="company_no" />
				<fk-col name="supplier_no" />
			</foreign-key>
		</table>

		<table name="sales_dlns" replication="slave">
			<column name="tenant_no" type="int" pk="1" />
			<column name="pos_cd" type="varchar(10)" pk="1" />
			<column name="sales_dln_id" type="int" pk="1" />

			<column name="company_no" type="int" />
			<column name="department_no" type="int" />
			<column name="businessunit_no" type="int" />
			<column name="market_no" type="int" />

			<column name="sales_business_type" type="int" />
			<column name="sales_dln_ts" type="datetime" />
			<column name="sales_dln_no" type="int" />
			<column name="sales_dln_type" type="int">
				<constant name="DELIVERY" value="1" />
				<constant name="CANCELED_DELIVERY" value="2" />
			</column>
			<column name="canceled" type="boolean" />
			<column name="cancel_reason" type="varchar(200)" />
			<column name="customer_no" type="int" />
			<column name="customer_nm" type="varchar(200)" />
			<column name="customer_contract_no" type="int" />
			<column name="customer_contract_nm" type="varchar(200)" />

			<column name="canceled_by_sales_dln_id" type="int" />
			<column name="canceled_by_sales_dln_no" type="int" />
			<column name="canceled_by_sales_dln_date" type="datetime" />

			<column name="canceled_for_sales_dln_id" type="int" />
			<column name="canceled_for_sales_dln_no" type="int" />
			<column name="canceled_for_sales_dln_date" type="datetime" />
			<column name="stock_no" type="int" />
			<column name="stock_nm" type="varchar(200)" />
			<foreign-key name="ps" ref="points_of_sale" replication="p">
				<fk-col name="tenant_no" />
				<fk-col name="pos_cd" />
			</foreign-key>
			<foreign-key name="mk" ref="markets">
				<fk-col name="tenant_no" />
				<fk-col name="company_no" />
				<fk-col name="department_no" />
				<fk-col name="market_no" />
			</foreign-key>
			<foreign-key name="bu" ref="businessunits">
				<fk-col name="tenant_no" />
				<fk-col name="company_no" />
				<fk-col name="department_no" />
				<fk-col name="businessunit_no" />
			</foreign-key>
		</table>
		<table name="sales_dln_positions" replication="slave">
			<column name="tenant_no" type="int" pk="1" />
			<column name="pos_cd" type="varchar(10)" pk="1" />
			<column name="sales_dln_id" type="int" pk="1" />
			<column name="sales_dln_position_id" type="int" pk="1" />
			<column name="company_no" type="int" />
			<column name="department_no" type="int" />
			<column name="item_cd" type="varchar(50)" />
			<column name="item_nm" type="varchar(200)" />
			<column name="unit_cd" type="varchar(10)" />
			<column name="stockable" type="boolean" />
			<column name="amount" type="decimal(20,3)" />
			/* ist eine Kundenkarte */
			<column name="customer_contract" type="boolean" />
			<foreign-key name="dn" ref="sales_dlns" replication="p">
				<fk-col name="tenant_no" />
				<fk-col name="pos_cd" />
				<fk-col name="sales_dln_id" />
			</foreign-key>
		</table>
		<table name="sales_dln_pos_work_records" replication="slave">
			<column name="tenant_no" type="int" pk="1" />
			<column name="pos_cd" type="varchar(10)" pk="1" />
			<column name="sales_dln_id" type="int" pk="1" />
			<column name="sales_dln_position_id" type="int" pk="1" />
			<column name="sales_dln_pos_rec_id" type="int" pk="1" />
			<column name="company_no" type="int" />
			<column name="operating_employee_no" type="int" />
			<column name="operating_employee_nm" type="varchar(200)" />
			<column name="operating_profession_no" type="int" />
			<column name="operating_profession_nm" type="varchar(200)" />
			<column name="work_amount" type="decimal(20,3)" />
			<column name="operating_employee_factor" type="decimal(10,9)" />

			<foreign-key name="dnp" ref="sales_dln_positions"
				replication="p">
				<fk-col name="tenant_no" />
				<fk-col name="pos_cd" />
				<fk-col name="sales_dln_id" />
				<fk-col name="sales_dln_position_id" />
			</foreign-key>
		</table>

		<table name="sales_vouchers" replication="slave">
			<column name="tenant_no" type="int" pk="1" />
			<column name="pos_cd" type="varchar(10)" pk="1" />
			<column name="sales_voucher_id" type="int" pk="1" />

			<column name="company_no" type="int" />
			<column name="department_no" type="int" />
			<column name="businessunit_no" type="int" />

			<column name="sales_voucher_no" type="int" />
			<column name="sales_voucher_ts" type="datetime" />

			<column name="sales_voucher_cd" type="varchar(50)" />
			<column name="sales_voucher_key" type="varchar(200)" />




			<!-- ab hier weg -->
			<column name="sold_by_pos_cd" type="varchar(10)" />
			<column name="sold_by_sales_inv_id" type="int" />
			<column name="sold_by_employee_no" type="int" />
			<column name="sold_by_employee_nm" type="varchar(200)" />

			<column name="used_by_pos_cd" type="varchar(10)" />
			<column name="used_by_sales_inv_id" type="int" />
			<column name="accepted_by_employee_no" type="int" />
			<column name="accepted_by_employee_nm" type="varchar(200)" />

			<column name="canceled" type="boolean" />
			<column name="cancel_reason" type="varchar(200)" />
			<column name="cancel_for_sales_voucher_id" type="int" />

			<column name="printed" type="boolean" />

			<column name="bu_nm_1" type="varchar(200)" />
			<column name="bu_nm_2" type="varchar(200)" />
			<column name="bu_street" type="varchar(200)" />
			<column name="bu_country_cd" type="varchar(10)" />
			<column name="bu_postal_cd" type="varchar(20)" />
			<column name="bu_city" type="varchar(200)" />
			<column name="bu_email" type="varchar(200)" />
			<column name="bu_phone" type="varchar(200)" />
			<column name="bu_web" type="varchar(200)" />
			<column name="bu_tax_id" type="varchar(30)" />
			<column name="bu_eu_tax_id" type="varchar(30)" />

			<column name="bu_iban" type="varchar(30)" />
			<column name="bu_bank_acct_holder" type="varchar(50)" />
			<column name="bu_bank_nm" type="varchar(50)" />
			<column name="bu_bic" type="varchar(30)" />

			<column name="bu_logo_url" type="varchar(200)" />
			<column name="bu_voucher_form_url" type="varchar(200)" />
			<column name="bu_voucher_txt" type="varchar(400)" />

			<column name="customer_no" type="int" />
			<column name="customer_salutation" type="varchar(20)" />
			<column name="customer_title" type="varchar(20)" />
			<column name="customer_first_nm" type="varchar(60)" />
			<column name="customer_contact_nm" type="varchar(200)" />
			<column name="customer_street" type="varchar(200)" />
			<column name="customer_country_cd" type="varchar(10)" />
			<column name="customer_postal_cd" type="varchar(20)" />
			<column name="customer_city" type="varchar(200)" />

			<column name="customer_contract_no" type="int" />
			<column name="customer_contract_nm" type="varchar(200)" />
			<!-- bis hier weg -->
			<column name="voucher_value" type="decimal(20,3)" />

			<column name="market_no" type="int" />
			<column name="voucher_definition_cd" type="varchar(50)" />
			<column name="voucher_mode" type="int">
				<constant name="MODE_EZGS" value="1" />
				<constant name="MODE_MZGS" value="2" />
			</column>
			<column name="voucher_type" type="int">
				<constant name="TYPE_STANDARD" value="1" />
				<constant name="TYPE_REBATE" value="2" />
			</column>
			<foreign-key name="ps" ref="points_of_sale" replication="p">
				<fk-col name="tenant_no" />
				<fk-col name="pos_cd" />
			</foreign-key>
		</table>

		<table name="sales_voucher_uses" replication="slave">
			<column name="tenant_no" type="int" pk="1" />
			<column name="pos_cd" type="varchar(10)" pk="1" />
			<column name="sales_voucher_id" type="int" pk="1" />
			<column name="sales_voucher_use_id" type="int" pk="1" /> <!-- Fortlaufend, auto-increment -->


			<column name="sales_voucher_use_ts" type="datetime" />
			<column name="cancel_reason" type="varchar(200)" />

			<column name="used_by_external_pos_ref" type="varchar(100)" />
			<column name="used_pos_cd" type="varchar(10)" /> <!-- Im Normalfall = zu pos_cd, bei Fremdeinlösung eventuell abweichend -->
			<column name="used_drawer_no" type="int" />
			<column name="used_pos_session_id" type="int" />
			<column name="used_pos_payment_id" type="int" />
			<column name="used_sales_inv_id" type="int" />
			<column name="used_sales_inv_cd" type="varchar(50)" />

			<!-- <column name="used_by_drawer_no" type="int"/> <column name="used_by_pos_session_id" 
				type="int"/> <column name="used_by_pos_payment_id" type="int"/> -->

			<column name="customer_no" type="int" />
			<column name="customer_salutation" type="varchar(20)" />
			<column name="customer_title" type="varchar(20)" />
			<column name="customer_first_nm" type="varchar(60)" />
			<column name="customer_contact_nm" type="varchar(200)" />
			<column name="customer_street" type="varchar(200)" />
			<column name="customer_country_cd" type="varchar(10)" />
			<column name="customer_postal_cd" type="varchar(20)" />
			<column name="customer_city" type="varchar(200)" />

			<column name="customer_contract_no" type="int" />
			<column name="customer_contract_nm" type="varchar(200)" />
			<column name="employee_no" type="int" />
			<column name="employee_nm" type="varchar(200)" />
			<column name="voucher_state" type="int">
				<constant name="DISTRIBUTED" value="1" />
				<constant name="DISTRIBUTION_CANCELED" value="2" />
				<constant name="USED" value="3" />
				<constant name="USED_ELSEWHERE" value="4" />
				<constant name="USAGE_CANCELED" value="5" />
				<constant name="DISABLED" value="6" />
			</column>
			<column name="is_latest" type="boolean" />
			<column name="update_cnt" type="long" />
			<foreign-key name="sv" ref="sales_vouchers" replication="p">
				<fk-col name="tenant_no" />
				<fk-col name="pos_cd" />
				<fk-col name="sales_voucher_id" />
			</foreign-key>
		</table>



		<table name="external_voucher_uses" replication="slave">
			<column name="tenant_no" type="int" pk="1" />
			<column name="pos_cd" type="varchar(10)" pk="1" />

			<column name="external_voucher_use_id" type="int" pk="1" /> <!-- Fortlaufend, auto-increment -->



			<column name="external_voucher_use_ts" type="datetime" />
			<column name="external_voucher_value" type="decimal(20,3)" />

			<column name="cancel_reason" type="varchar(200)" />
			<column name="external_voucher_cd" type="varchar(100)" />
			<column name="used_pos_cd" type="varchar(10)" />
			<column name="used_drawer_no" type="int" />
			<column name="used_pos_session_id" type="int" />
			<column name="used_pos_payment_id" type="int" />
			<column name="used_sales_inv_id" type="int" />
			<column name="used_sales_inv_cd" type="varchar(50)" />

			<column name="cancel_for_external_voucher_use_id" type="int" />

			<column name="company_no" type="int" />
			<column name="department_no" type="int" />
			<column name="businessunit_no" type="int" />
			<column name="businessunit_nm" type="varchar(200)" />

			<column name="customer_no" type="int" />
			<column name="customer_salutation" type="varchar(20)" />
			<column name="customer_title" type="varchar(20)" />
			<column name="customer_first_nm" type="varchar(60)" />
			<column name="customer_contact_nm" type="varchar(200)" />
			<column name="customer_street" type="varchar(200)" />
			<column name="customer_country_cd" type="varchar(10)" />
			<column name="customer_postal_cd" type="varchar(20)" />
			<column name="customer_city" type="varchar(200)" />

			<column name="voucher_origin" type="varchar(10)" />
			<column name="internal_voucher_origin" type="varchar(10)" />


			<column name="employee_no" type="int" />
			<column name="employee_nm" type="varchar(200)" />
			<!-- <column name="voucher_value" type="decimal(20,3)"/> -->
			<column name="voucher_state" type="int">

				<constant name="DISTRIBUTED" value="1" /><!-- gibt es hier nicht, 
					bleibr aber wegen gleicher Funktion in der Tabelle sales_voucher_uses drin -->
				<constant name="DISTRIBUTION_CANCELED" value="2" /><!-- gibt 
					es hier nicht, bleibr aber wegen gleicher Funktion in der Tabelle sales_voucher_uses 
					drin -->
				<constant name="USED" value="3" />
				<constant name="USED_ELSEWHERE" value="4" /><!-- gibt es hier 
					nicht, bleibt aber wegen gleicher Funktion in der Tabelle sales_voucher_uses 
					drin -->
				<constant name="USAGE_CANCELED" value="5" />
			</column>

		</table>

		<table name="sales_voucher_cards" replication="none">
			<column name="tenant_no" type="int" pk="1" />

			<column name="sales_voucher_card_uid" type="varchar(200)" pk="1" />

			<!-- wo initial erstellt Businessunit -->
			<column name="company_no" type="int" />
			<column name="department_no" type="int" />
			<column name="businessunit_no" type="int" />
			<column name="bu_nm_1" type="varchar(200)" />
			<column name="bu_nm_2" type="varchar(200)" />
			<column name="bu_street" type="varchar(200)" />
			<column name="bu_country_cd" type="varchar(10)" />
			<column name="bu_postal_cd" type="varchar(20)" />
			<column name="bu_city" type="varchar(200)" />
			<column name="bu_tax_id" type="varchar(30)" />
			<column name="bu_eu_tax_id" type="varchar(30)" />

			<!-- initial erstell in welchem Pos -->
			<column name="pos_cd" type="varchar(10)" />

			<!-- Erstellungszeitstempel -->
			<column name="sales_voucher_ts" type="datetime" />

			<column name="sales_voucher_card_cd" type="varchar(50)" />
			<column name="sales_voucher_card_key" type="varchar(200)" />


			<!-- welcher Mitarbeiter hat diese Karte erstellt -->
			<column name="employee_no" type="int" />
			<column name="employee_nm" type="varchar(200)" />


			<!-- welcher Kunde hat dies Karte erstellt -->
			<column name="master_cd" type="varchar(20)" />
			<column name="customer_no" type="int" />
			<column name="customer_salutation" type="varchar(20)" />
			<column name="customer_title" type="varchar(20)" />
			<column name="customer_first_nm" type="varchar(60)" />
			<column name="customer_contact_nm" type="varchar(200)" />
			<column name="customer_street" type="varchar(200)" />
			<column name="customer_country_cd" type="varchar(10)" />
			<column name="customer_postal_cd" type="varchar(20)" />
			<column name="customer_city" type="varchar(200)" />



			<!-- initialer Wert der Guthabenkarte -->
			<column name="initial_voucher_card_value" type="decimal(20,3)" />

		</table>

		<table name="sales_voucher_cards_ext" replication="none">
			<column name="tenant_no" type="int" pk="1" />

			<column name="sales_voucher_card_uid" type="varchar(200)" pk="1" />
			<column name="current_state" type="int">
				<constant name="ACTIVE" value="1" />
				<constant name="INACTIVE" value="2" />
			</column>

		</table>

		<table name="sales_voucher_card_uses" replication="none">
			<column name="tenant_no" type="int" pk="1" />

			<column name="sales_voucher_card_uid" type="varchar(200)" pk="1" />
			<column name="sales_voucher_card_uses_id" type="int" pk="1" />
			<column name="sales_voucher_card_uses_ts" type="datetime" />


			<!-- von wo ist der Eintrag erstellt worden Businessunit -->
			<column name="company_no" type="int" />
			<column name="department_no" type="int" />
			<column name="businessunit_no" type="int" />
			<column name="bu_nm_1" type="varchar(200)" />
			<column name="bu_nm_2" type="varchar(200)" />
			<column name="bu_street" type="varchar(200)" />
			<column name="bu_country_cd" type="varchar(10)" />
			<column name="bu_postal_cd" type="varchar(20)" />
			<column name="bu_city" type="varchar(200)" />
			<column name="bu_tax_id" type="varchar(30)" />
			<column name="bu_eu_tax_id" type="varchar(30)" />

			<!-- verwendet in welchem Pos -->
			<column name="pos_cd" type="varchar(10)" />

			<!-- paymnet -->
			<column name="drawer_no" type="int" />
			<column name="pos_session_id" type="int" />
			<column name="pos_payment_id" type="int" />

			<!-- sales_inv -->
			<column name="sales_inv_id" type="int" />
			<column name="sales_inv_cd" type="varchar(50)" />


			<!-- welcher Mitarbeiter hat diese Karte angenommen -->
			<column name="employee_no" type="int" />
			<column name="employee_nm" type="varchar(200)" />


			<!-- welcher Kunde hat diese Karte verwendet -->
			<column name="master_cd" type="varchar(200)" />
			<column name="customer_no" type="int" />
			<column name="customer_salutation" type="varchar(20)" />
			<column name="customer_title" type="varchar(20)" />
			<column name="customer_first_nm" type="varchar(60)" />
			<column name="customer_contact_nm" type="varchar(200)" />
			<column name="customer_street" type="varchar(200)" />
			<column name="customer_country_cd" type="varchar(10)" />
			<column name="customer_postal_cd" type="varchar(20)" />
			<column name="customer_city" type="varchar(200)" />



			<!-- gebuchter Wert auf die Guthabenkarte -->
			<column name="voucher_card_value" type="decimal(20,3)" />
			<column name="direction" type="int">
				<constant name="IN" value="1" />
				<constant name="OUT" value="2" />
			</column>

		</table>


		<table name="sales_invs" replication="slave">
			<column name="tenant_no" type="int" pk="1" />
			<column name="pos_cd" type="varchar(10)" pk="1" />
			<column name="sales_inv_id" type="int" pk="1" />

			<column name="company_no" type="int" />
			<column name="department_no" type="int" />
			<column name="businessunit_no" type="int" />
			<column name="market_no" type="int" />

			<column name="sales_business_type" type="int" />
			<column name="sales_inv_ts" type="datetime" />
			<column name="sales_inv_no" type="int" />
			<column name="sales_inv_cd" type="varchar(50)" />
			<column name="sales_inv_type" type="int">
				<constant name="INVOICE" value="1" />
				<constant name="CREDIT_NOTE" value="2" />
			</column>

			<column name="employee_no" type="int" />
			<column name="employee_nm" type="varchar(200)" />

			<column name="canceled" type="boolean" />
			<column name="cancel_reason" type="varchar(200)" />

			<column name="canceled_by_sales_inv_id" type="int" />
			<column name="canceled_by_sales_inv_no" type="int" />
			<column name="canceled_by_sales_inv_ts" type="datetime" />

			<column name="cancel_for_sales_inv_id" type="int" />
			<column name="cancel_for_sales_inv_no" type="int" />
			<column name="cancel_for_sales_inv_cd" type="varchar(50)" />
			<column name="cancel_for_sales_inv_ts" type="datetime" />

			<column name="booking_ts" type="datetime" />
			<column name="booking_state" type="int">
				<constant name="BOOKING_STATE_UNPAID" value="1" />
				<constant name="BOOKING_STATE_BOOKABLE" value="2" />
			</column>


			<column name="archived_ts" type="datetime" />
			<column name="archived" type="boolean" />

			<column name="printed" type="boolean" />
			<column name="company_nm" type="varchar(200)" />
			<column name="bu_nm_1" type="varchar(200)" />
			<column name="bu_nm_2" type="varchar(200)" />
			<column name="bu_street" type="varchar(200)" />
			<column name="bu_country_cd" type="varchar(10)" />
			<column name="bu_postal_cd" type="varchar(20)" />
			<column name="bu_city" type="varchar(200)" />
			<column name="bu_email" type="varchar(200)" />
			<column name="bu_phone" type="varchar(200)" />
			<column name="bu_web" type="varchar(200)" />
			<column name="bu_tax_id" type="varchar(30)" />
			<column name="bu_eu_tax_id" type="varchar(30)" />

			<column name="bu_iban" type="varchar(30)" />
			<column name="bu_bank_acct_holder" type="varchar(50)" />
			<column name="bu_bank_nm" type="varchar(50)" />
			<column name="bu_bic" type="varchar(30)" />

			<column name="bu_logo_url" type="varchar(200)" />
			<column name="bu_note_form_url" type="varchar(200)" />
			<column name="bu_note_txt" type="varchar(400)" />

			<column name="customer_no" type="int" />
			<column name="customer_salutation" type="varchar(20)" />
			<column name="customer_title" type="varchar(20)" />
			<column name="customer_first_nm" type="varchar(60)" />
			<column name="customer_contact_nm" type="varchar(200)" />
			<column name="customer_street" type="varchar(200)" />
			<column name="customer_country_cd" type="varchar(10)" />
			<column name="customer_postal_cd" type="varchar(20)" />
			<column name="customer_city" type="varchar(200)" />

			<column name="customer_contract_no" type="int" />
			<column name="customer_contract_nm" type="varchar(200)" />

			<column name="customer_group_no" type="int" />
			<column name="customer_group_nm" type="varchar(200)" />

			<column name="cc_condition_valid_from" type="datetime" />
			<column name="cc_condition_valid_to" type="datetime" />
			<column name="cc_condition_card_no" type="varchar(30)" />
			<column name="cc_condition_card_nm" type="varchar(100)" />
			<column name="cc_condition_sales_pricelist_id" type="int" />
			<column name="cc_condition_item_condition_cd" type="varchar(50)" />
			<column name="cc_condition_sales_credit_cd" type="varchar(50)" />
			<column name="cc_condition_cd" type="varchar(10)" />
			<column name="cc_card_uid" type="varchar(36)" />


			<column name="sales_dln_id" type="int" />

			<column name="price_ts" type="datetime" />

			<column name="inv_rebate_rate_percent" type="decimal(6,2)" />

			<column name="total_net_price" type="decimal(20,3)" />
			<column name="total_gross_price" type="decimal(20,3)" />

			<column name="sales_credit_points" type="int" />

			<column name="reporting_cd" type="varchar(50)" />
			<column name="reporting_nm" type="varchar(200)" />
			<column name="alternate_tax_hint" type="varchar(20)" />
			<column name="alternate_tax_cd" type="varchar(10)" />
			<!-- AT -->
			<column name="revenue_euroct" type="long" />
			<column name="enc_revenue_euroct" type="varchar(100)" />
			<column name="inv_revenue_tax_n_euroct" type="int" />
			<column name="inv_revenue_tax_2_euroct" type="int" />
			<column name="inv_revenue_tax_1_euroct" type="int" />
			<column name="inv_revenue_tax_0_euroct" type="int" />
			<column name="inv_revenue_tax_div_euroct" type="int" />
			<column name="prev_inv_hash" type="varchar(100)" />
			<column name="cert_serial_hex" type="varchar(100)" />
			<column name="machine_rd" type="varchar(1000)" />
			<column name="inv_hash" type="varchar(100)" />
			<column name="jws_signature" type="varchar(1000)" />
			<column name="aes_key" type="varchar(60)" />
			<column name="next_note_is_start" type="boolean" />



			/* Kundenkarten die verkauft werden können */

			<column name="v_customer_contract_no" type="int" />
			<column name="v_valid_from" type="datetime" />
			<column name="v_valid_to" type="datetime" />
			<column name="v_card_nm" type="varchar(100)" />
			<column name="v_sales_pricelist_id" type="int" />
			<column name="v_item_condition_cd" type="varchar(50)" />
			<column name="v_sales_credit_cd" type="varchar(50)" />
			<column name="v_card_no" type="varchar(30)" />
			<column name="v_condition_cd" type="varchar(10)" />


			<foreign-key name="ps" ref="points_of_sale" replication="p">
				<fk-col name="tenant_no" />
				<fk-col name="pos_cd" />
			</foreign-key>
			<index name="sales_inv_ten_pos_customer">
				<ix-col name="tenant_no" />
				<ix-col name="pos_cd" />
				<ix-col name="customer_no" />
			</index>
			<index name="sales_inv_ten_pos_ts">
				<ix-col name="tenant_no" />
				<ix-col name="pos_cd" />
				<ix-col name="sales_inv_ts" />
			</index>


		</table>

		<table name="sales_inv_positions" replication="slave">
			<constant name="SOURCE_LIST_PRICE" value="1" />
			<constant name="SOURCE_USER_SUPPLIED" value="2" />
			<column name="tenant_no" type="int" pk="1" />
			<column name="pos_cd" type="varchar(10)" pk="1" />
			<column name="sales_inv_id" type="int" pk="1" />
			<column name="sales_inv_position_id" type="int" pk="1" />
			<column name="company_no" type="int" />
			<column name="department_no" type="int" />
			<column name="sales_dln_id" type="int" />
			<column name="item_cd" type="varchar(50)" />
			<column name="item_nm" type="varchar(200)" />
			<column name="unit_cd" type="varchar(10)" />
			<column name="stockable" type="boolean" />

			<column name="amount" type="decimal(20,3)" />

			<column name="sales_pricelist_nm" type="varchar(200)" />
			<column name="sales_pricelist_instance_nm" type="varchar(200)" />
			<column name="sales_pricelist_valid_from" type="datetime" />


			<column name="gross_price" type="boolean" />
			<column name="list_price" type="decimal(20,3)" />

			<column name="item_condition_group_nm" type="varchar(200)" />
			<column name="item_rebate_rate_percent" type="decimal(20,3)" />
			<column name="applied_item_rebate_price" type="decimal(20,3)" />

			<column name="item_special_price" type="boolean" />
			<column name="special_price" type="decimal(20,3)" />
			<column name="item_price" type="decimal(20,3)" />
			<column name="item_tax_cd" type="varchar(10)" />

			<column name="pos_rebate_base_price" type="decimal(20,3)" />
			<column name="pos_rebate_price" type="decimal(20,3)" />
			<column name="pos_rebate_rate_percent" type="decimal(6,2)" />
			<column name="applied_pos_rebate_price" type="decimal(20,3)" />

			<column name="inv_rebate_base_price" type="decimal(20,3)" />
			<column name="inv_rebate_rate_percent" type="decimal(6,2)" />
			<column name="applied_inv_rebate_price" type="decimal(20,3)" />

			<column name="position_net_price" type="decimal(20,3)" />
			<column name="tax_cd" type="varchar(10)" />
			<column name="tax_nm" type="varchar(10)" />
			<column name="tax_desc" type="varchar(50)" />
			<column name="tax_rate_percent" type="decimal(6,2)" />
			<column name="position_tax_price" type="decimal(20,3)" />
			<column name="position_gross_price" type="decimal(20,3)" />

			<column name="employee_no" type="int" />
			<column name="employee_nm" type="varchar(200)" />
			<column name="profession_no" type="int" />
			<column name="profession_nm" type="varchar(200)" />

			<column name="package_item_cd" type="varchar(50)" />
			<column name="package_item_nm" type="varchar(200)" />
			<column name="package_cd" type="varchar(50)" />

			<column name="reporting_cd" type="varchar(50)" />
			<column name="reporting_nm" type="varchar(200)" />
			/* ist eine Kundenkarte */
			<column name="customer_contract" type="boolean" />

			<foreign-key name="iv" ref="sales_invs" replication="p">
				<fk-col name="tenant_no" />
				<fk-col name="pos_cd" />
				<fk-col name="sales_inv_id" />
			</foreign-key>
		</table>

		<table name="sales_inv_tax_totals" replication="slave">
			<column name="tenant_no" type="int" pk="1" />
			<column name="pos_cd" type="varchar(10)" pk="1" />
			<column name="sales_inv_id" type="int" pk="1" />
			<column name="tax_cd" type="varchar(10)" pk="1" />
			<column name="tax_nm" type="varchar(10)" />
			<column name="tax_desc" type="varchar(50)" />
			<column name="tax_rate_percent" type="decimal(6,2)" />
			<column name="total_net_price" type="decimal(20,3)" />
			<column name="total_tax_price" type="decimal(20,3)" />
			<column name="total_gross_price" type="decimal(20,3)" />
			<foreign-key name="iv" ref="sales_invs" replication="p">
				<fk-col name="tenant_no" />
				<fk-col name="pos_cd" />
				<fk-col name="sales_inv_id" />
			</foreign-key>
		</table>
		<!-- <table name="sales_inv_reservation_notes" replication="slave"> <column 
			name="tenant_no" type="int" pk="1" /> <column name="pos_cd" type="varchar(10)" 
			pk="1" /> <column name="sales_inv_id" type="int" pk="1" /> <column name="sales_inv_note_id" 
			type="int" pk="1" /> <column name="sales_inv_position_id" type="int" /> <column 
			name="done" type="boolean" /> <column name="note_txt" type="varchar(1000)" 
			/> <foreign-key name="iv" ref="d_sales_invs" replication="p"> <fk-col name="tenant_no" 
			/> <fk-col name="pos_cd" /> <fk-col name="sales_inv_id" /> </foreign-key> 
			</table> -->
		<table name="sales_inv_payments" replication="slave">
			<column name="tenant_no" type="int" pk="1" />
			<column name="pos_cd" type="varchar(10)" pk="1" />
			<column name="sales_inv_id" type="int" pk="1" />
			<column name="sales_inv_payment_id" type="int" pk="1" />
			<column name="payment_ts" type="datetime" />
			<column name="payment" type="decimal(16,3)" />
			<column name="payment_change" type="decimal(16,3)" />
			<column name="currency_cd" type="varchar(10)" />
			<column name="payment_type" type="int">
				<constant name="CASH" value="1" />
				<constant name="VOUCHER" value="2" />
				<constant name="CHANGE" value="3" />
				<constant name="EC" value="4" />
				<constant name="CREDITCARD" value="5" />
				<constant name="CASHDISCOUNT" value="6" />
				<constant name="CREDITNOTE" value="7" />
				<constant name="TRANSFER" value="8" />
				<constant name="EXPENSES" value="9" />
				<constant name="SALESCREDITPOINTS" value="10" />
				<constant name="GENERATEDVOUCHER" value="11" />
				<constant name="SALESCREDITVOUCHER" value="12" />
				<constant name="VOUCHERCARD" value="13" />
				<constant name="ONLINEPAYMENT" value="14" />

			</column>
			<column name="payment_direction" type="int">
				<constant name="IN" value="1" />
				<constant name="OUT" value="2" />
			</column>
			<column name="payment_ref" type="varchar(100)" />
			<column name="sales_voucher_pos_cd" type="varchar(10)" />
			<column name="sales_voucher_id" type="int" />
			<column name="voucher_origin" type="varchar(10)" />
			<column name="internal_voucher_origin" type="varchar(10)" />
			<column name="card_uid" type="varchar(36)" />
			<column name="sales_credit_valid_from" type="datetime" />
			<column name="sales_credit_valid_to" type="datetime" />
			<column name="sales_credit_card_no" type="varchar(30)" />
			<column name="sales_credit_card_nm" type="varchar(100)" />
			<column name="points_per_revenue" type="decimal(7,4)" />
			<column name="credit_per_point" type="decimal(7,4)" />
			<column name="sales_credit_points" type="int" />
			<column name="condition_cd" type="varchar(10)" />
			<column name="sales_credit_cd" type="varchar(50)" />

			<column name="delete_for_sales_inv_id" type="int" />
			<column name="delete_for_sales_inv_payment_id" type="int" />
			<column name="voucher_definition_cd" type="varchar(50)" />
			<column name="voucher_mode" type="int" />
			<column name="voucher_type" type="int" />

			<!-- Verlinkung zum Guthabenkarte -->
			<column name="sales_voucher_card_uid" type="varchar(200)" />


			<column name="reporting_cd" type="varchar(50)" />
			<column name="reporting_nm" type="varchar(200)" />
			<foreign-key name="iv" ref="sales_invs" replication="p">
				<fk-col name="tenant_no" />
				<fk-col name="pos_cd" />
				<fk-col name="sales_inv_id" />
			</foreign-key>
		</table>


		<table name="d_sales_dlns" replication="slave">
			<column name="tenant_no" type="int" pk="1" />
			<column name="pos_cd" type="varchar(10)" pk="1" />
			<column name="sales_dln_id" type="int" pk="1" />
			<column name="deleted" type="boolean" />
			<column name="final_sales_dln_id" type="int" />

			<column name="company_no" type="int" />
			<column name="department_no" type="int" />
			<column name="businessunit_no" type="int" />
			<column name="market_no" type="int" />

			<column name="sales_business_type" type="int" />
			<column name="sales_dln_ts" type="datetime" />
			<column name="sales_dln_no" type="int" />
			<column name="canceled" type="boolean" />
			<column name="cancel_reason" type="varchar(200)" />
			<column name="customer_no" type="int" />
			<column name="customer_nm" type="varchar(200)" />
			<column name="customer_contract_no" type="int" />
			<column name="customer_contract_nm" type="varchar(200)" />
			<column name="stock_no" type="int" />
			<column name="stock_nm" type="varchar(200)" />
			<foreign-key name="ps" ref="points_of_sale" replication="p">
				<fk-col name="tenant_no" />
				<fk-col name="pos_cd" />
			</foreign-key>
			<foreign-key name="mk" ref="markets">
				<fk-col name="tenant_no" />
				<fk-col name="company_no" />
				<fk-col name="department_no" />
				<fk-col name="market_no" />
			</foreign-key>
			<foreign-key name="bu" ref="businessunits">
				<fk-col name="tenant_no" />
				<fk-col name="company_no" />
				<fk-col name="department_no" />
				<fk-col name="businessunit_no" />
			</foreign-key>
		</table>
		<table name="d_sales_dln_positions" replication="slave">
			<column name="tenant_no" type="int" pk="1" />
			<column name="pos_cd" type="varchar(10)" pk="1" />
			<column name="sales_dln_id" type="int" pk="1" />
			<column name="sales_dln_position_id" type="int" pk="1" />
			<column name="company_no" type="int" />
			<column name="department_no" type="int" />
			<column name="item_cd" type="varchar(50)" />
			<column name="item_nm" type="varchar(200)" />
			<column name="unit_cd" type="varchar(10)" />
			<column name="stockable" type="boolean" />
			/* ist eine Kundenkarte */
			<column name="customer_contract" type="boolean" />
			<column name="amount" type="decimal(20,3)" />
			<foreign-key name="dn" ref="d_sales_dlns" replication="p">
				<fk-col name="tenant_no" />
				<fk-col name="pos_cd" />
				<fk-col name="sales_dln_id" />
			</foreign-key>
		</table>
		<table name="d_sales_dln_pos_work_records" replication="slave">
			<column name="tenant_no" type="int" pk="1" />
			<column name="pos_cd" type="varchar(10)" pk="1" />
			<column name="sales_dln_id" type="int" pk="1" />
			<column name="sales_dln_position_id" type="int" pk="1" />
			<column name="sales_dln_pos_rec_id" type="int" pk="1" />
			<column name="company_no" type="int" pk="1" />
			<column name="operating_employee_no" type="int" />
			<column name="operating_employee_nm" type="varchar(200)" />
			<column name="operating_profession_no" type="int" />
			<column name="operating_profession_nm" type="varchar(200)" />
			<column name="work_amount" type="decimal(20,3)" />
			<column name="operating_employee_factor" type="decimal(10,9)" />
			<foreign-key name="dnp" ref="d_sales_dln_positions"
				replication="p">
				<fk-col name="tenant_no" />
				<fk-col name="pos_cd" />
				<fk-col name="sales_dln_id" />
				<fk-col name="sales_dln_position_id" />
			</foreign-key>
		</table>

		<table name="d_sales_invs" replication="slave">
			<column name="tenant_no" type="int" pk="1" />
			<column name="pos_cd" type="varchar(10)" pk="1" />
			<column name="sales_inv_id" type="int" pk="1" />
			<column name="deleted" type="boolean" />
			<column name="final_sales_inv_id" type="int" />

			<column name="company_no" type="int" />
			<column name="department_no" type="int" />
			<column name="businessunit_no" type="int" />
			<column name="market_no" type="int" />
			<column name="sales_business_type" type="int" />
			<column name="sales_inv_ts" type="datetime" />
			<column name="sales_inv_no" type="int" />
			<column name="sales_inv_type" type="int">
				<constant name="INVOICE" value="1" />
				<constant name="CREDIT_NOTE" value="2" />
			</column>

			<column name="canceled" type="boolean" />
			<column name="cancel_reason" type="varchar(200)" />

			<column name="booking_ts" type="datetime" />
			<column name="booking_state" type="int">
				<constant name="BOOKING_STATE_UNPAID" value="1" />
				<constant name="BOOKING_STATE_BOOKABLE" value="2" />
			</column>

			<column name="archived_ts" type="datetime" />
			<column name="archived" type="boolean" />

			<column name="printed" type="boolean" />
			<column name="company_nm" type="varchar(200)" />
			<column name="bu_nm_1" type="varchar(200)" />
			<column name="bu_nm_2" type="varchar(200)" />
			<column name="bu_street" type="varchar(200)" />
			<column name="bu_country_cd" type="varchar(10)" />
			<column name="bu_postal_cd" type="varchar(20)" />
			<column name="bu_city" type="varchar(200)" />
			<column name="bu_email" type="varchar(200)" />
			<column name="bu_phone" type="varchar(200)" />
			<column name="bu_web" type="varchar(200)" />
			<column name="bu_tax_id" type="varchar(30)" />
			<column name="bu_eu_tax_id" type="varchar(30)" />

			<column name="bu_iban" type="varchar(30)" />
			<column name="bu_bank_acct_holder" type="varchar(50)" />
			<column name="bu_bank_nm" type="varchar(50)" />
			<column name="bu_bic" type="varchar(30)" />

			<column name="bu_logo_url" type="varchar(200)" />
			<column name="bu_note_form_url" type="varchar(200)" />
			<column name="bu_note_txt" type="varchar(400)" />

			<column name="customer_no" type="int" />
			<column name="customer_salutation" type="varchar(20)" />
			<column name="customer_title" type="varchar(20)" />
			<column name="customer_first_nm" type="varchar(60)" />
			<column name="customer_contact_nm" type="varchar(200)" />
			<column name="customer_street" type="varchar(200)" />
			<column name="customer_country_cd" type="varchar(10)" />
			<column name="customer_postal_cd" type="varchar(20)" />
			<column name="customer_city" type="varchar(200)" />

			<column name="customer_contract_no" type="int" />
			<column name="customer_contract_nm" type="varchar(200)" />

			<column name="customer_group_no" type="int" />
			<column name="customer_group_nm" type="varchar(200)" />

			<column name="cc_condition_valid_from" type="datetime" />
			<column name="cc_condition_valid_to" type="datetime" />
			<column name="cc_condition_card_no" type="varchar(30)" />
			<column name="cc_condition_card_nm" type="varchar(100)" />
			<column name="cc_condition_sales_pricelist_id" type="int" />
			<column name="cc_condition_item_condition_cd" type="varchar(50)" />
			<column name="cc_condition_sales_credit_cd" type="varchar(50)" />

			<column name="cc_condition_cd" type="varchar(10)" />
			<column name="cc_card_uid" type="varchar(36)" />

			<column name="sales_dln_id" type="int" />

			<column name="price_ts" type="datetime" />

			<column name="inv_rebate_rate_percent" type="decimal(6,2)" />

			<column name="total_net_price" type="decimal(20,3)" />
			<column name="total_gross_price" type="decimal(20,3)" />

			<column name="sales_credit_points" type="int" />

			<column name="reporting_cd" type="varchar(50)" />
			<column name="reporting_nm" type="varchar(200)" />

			<column name="alternate_tax_hint" type="varchar(20)" />
			<column name="alternate_tax_cd" type="varchar(10)" />
			<column name="sales_inv_invalid" type="boolean" />
			<column name="sales_inv_invalid_msg" type="varchar(200)" />


			<column name="v_customer_contract_no" type="int" />
			<column name="v_valid_from" type="datetime" />
			<column name="v_valid_to" type="datetime" />
			<column name="v_card_nm" type="varchar(100)" />
			<column name="v_sales_pricelist_id" type="int" />
			<column name="v_item_condition_cd" type="varchar(50)" />
			<column name="v_sales_credit_cd" type="varchar(50)" />
			<column name="v_card_no" type="varchar(30)" />
			<column name="v_condition_cd" type="varchar(10)" />
			<foreign-key name="ps" ref="points_of_sale" replication="p">
				<fk-col name="tenant_no" />
				<fk-col name="pos_cd" />
			</foreign-key>

		</table>

		<table name="d_sales_inv_positions" replication="slave">
			<column name="tenant_no" type="int" pk="1" />
			<column name="pos_cd" type="varchar(10)" pk="1" />
			<column name="sales_inv_id" type="int" pk="1" />
			<column name="sales_inv_position_id" type="int" pk="1" />
			<column name="company_no" type="int" />
			<column name="department_no" type="int" />
			<column name="sales_dln_id" type="int" />
			<column name="item_cd" type="varchar(50)" />
			<column name="item_nm" type="varchar(200)" />
			<column name="unit_cd" type="varchar(10)" />
			<column name="stockable" type="boolean" />

			<column name="amount" type="decimal(20,3)" />

			<column name="sales_pricelist_nm" type="varchar(200)" />
			<column name="sales_pricelist_instance_nm" type="varchar(200)" />
			<column name="sales_pricelist_valid_from" type="datetime" />


			<column name="gross_price" type="boolean" />
			<column name="list_price" type="decimal(20,3)" />

			<column name="item_condition_group_nm" type="varchar(200)" />
			<column name="item_rebate_rate_percent" type="decimal(20,3)" />
			<column name="applied_item_rebate_price" type="decimal(20,3)" />

			<column name="item_special_price" type="boolean" />
			<column name="special_price" type="decimal(20,3)" />
			<column name="item_price" type="decimal(20,3)" />
			<column name="item_tax_cd" type="varchar(10)" />

			<column name="pos_rebate_base_price" type="decimal(20,3)" />
			<column name="pos_rebate_price" type="decimal(20,3)" />
			<column name="pos_rebate_rate_percent" type="decimal(6,2)" />
			<column name="applied_pos_rebate_price" type="decimal(20,3)" />

			<column name="inv_rebate_base_price" type="decimal(20,3)" />
			<column name="inv_rebate_rate_percent" type="decimal(6,2)" />
			<column name="applied_inv_rebate_price" type="decimal(20,3)" />

			<column name="position_net_price" type="decimal(20,3)" />
			<column name="tax_cd" type="varchar(10)" />
			<column name="tax_nm" type="varchar(10)" />
			<column name="tax_desc" type="varchar(50)" />
			<column name="tax_rate_percent" type="decimal(6,2)" />
			<column name="position_tax_price" type="decimal(20,3)" />
			<column name="position_gross_price" type="decimal(20,3)" />

			<column name="employee_no" type="int" />
			<column name="employee_nm" type="varchar(200)" />
			<column name="profession_no" type="int" />
			<column name="profession_nm" type="varchar(200)" />

			<column name="package_item_cd" type="varchar(50)" />
			<column name="package_item_nm" type="varchar(200)" />
			<column name="package_cd" type="varchar(50)" />

			<column name="reporting_cd" type="varchar(50)" />
			<column name="reporting_nm" type="varchar(200)" />
			<column name="position_invalid" type="boolean" />
			<column name="position_invalid_msg" type="varchar(200)" />
			<column name="customer_contract" type="boolean" />
			<foreign-key name="iv" ref="d_sales_invs" replication="p">
				<fk-col name="tenant_no" />
				<fk-col name="pos_cd" />
				<fk-col name="sales_inv_id" />
			</foreign-key>
		</table>

		<!-- <table name="d_sales_inv_reservation_notes" replication="slave"> <column 
			name="tenant_no" type="int" pk="1" /> <column name="pos_cd" type="varchar(10)" 
			pk="1" /> <column name="sales_inv_id" type="int" pk="1" /> <column name="sales_inv_note_id" 
			type="int" pk="1" /> <column name="sales_inv_position_id" type="int" /> <column 
			name="done" type="boolean" /> <column name="note_txt" type="varchar(1000)" 
			/> <foreign-key name="iv" ref="d_sales_invs" replication="p"> <fk-col name="tenant_no" 
			/> <fk-col name="pos_cd" /> <fk-col name="sales_inv_id" /> </foreign-key> 
			</table> -->
		<table name="d_sales_inv_tax_totals" replication="slave">
			<column name="tenant_no" type="int" pk="1" />
			<column name="pos_cd" type="varchar(10)" pk="1" />
			<column name="sales_inv_id" type="int" pk="1" />
			<column name="tax_cd" type="varchar(10)" pk="1" />
			<column name="tax_nm" type="varchar(10)" />
			<column name="tax_desc" type="varchar(50)" />
			<column name="tax_rate_percent" type="decimal(6,2)" />
			<column name="total_net_price" type="decimal(20,3)" />
			<column name="total_tax_price" type="decimal(20,3)" />
			<column name="total_gross_price" type="decimal(20,3)" />
			<foreign-key name="iv" ref="d_sales_invs" replication="p">
				<fk-col name="tenant_no" />
				<fk-col name="pos_cd" />
				<fk-col name="sales_inv_id" />
			</foreign-key>
		</table>

		<table name="d_sales_inv_payments" replication="slave">
			<column name="tenant_no" type="int" pk="1" />
			<column name="pos_cd" type="varchar(10)" pk="1" />
			<column name="sales_inv_id" type="int" pk="1" />
			<column name="sales_inv_payment_id" type="int" pk="1" />
			<column name="payment_ts" type="datetime" />
			<column name="payment" type="decimal(16,3)" />
			<column name="payment_change" type="decimal(16,3)" />
			<column name="currency_cd" type="varchar(10)" />
			<column name="payment_type" type="int">
				<constant name="CASH" value="1" />
				<constant name="VOUCHER" value="2" />
				<constant name="CHANGE" value="3" />
				<constant name="EC" value="4" />
				<constant name="CREDITCARD" value="5" />
				<constant name="CASHDISCOUNT" value="6" />
				<constant name="CREDITNOTE" value="7" />
				<constant name="TRANSFER" value="8" />
				<constant name="EXPENSES" value="9" />
				<constant name="SALESCREDITPOINTS" value="10" />
				<constant name="GENERATEDVOUCHER" value="11" />
				<constant name="SALESCREDITVOUCHER" value="12" />
				<constant name="VOUCHERCARD" value="13" />
				<constant name="ONLINEPAYMENT" value="14" />
			</column>
			<column name="payment_direction" type="int">
				<constant name="IN" value="1" />
				<constant name="OUT" value="2" />
			</column>
			<column name="payment_ref" type="varchar(100)" />

			<column name="sales_voucher_pos_cd" type="varchar(10)" />
			<column name="sales_voucher_id" type="int" />
			<column name="voucher_origin" type="varchar(10)" />
			<column name="internal_voucher_origin" type="varchar(10)" />

			<column name="card_uid" type="varchar(36)" />
			<column name="sales_credit_valid_from" type="datetime" />
			<column name="sales_credit_valid_to" type="datetime" />
			<column name="sales_credit_card_no" type="varchar(30)" />
			<column name="sales_credit_card_nm" type="varchar(100)" />
			<column name="points_per_revenue" type="decimal(7,4)" />
			<column name="credit_per_point" type="decimal(7,4)" />
			<column name="sales_credit_points" type="int" />
			<column name="condition_cd" type="varchar(10)" />
			<column name="sales_credit_cd" type="varchar(50)" />

			<column name="delete_for_sales_inv_id" type="int" />
			<column name="delete_for_sales_inv_payment_id" type="int" />
			<column name="voucher_definition_cd" type="varchar(50)" />
			<column name="voucher_mode" type="int" />
			<column name="voucher_type" type="int" />

			<!-- Verlinkung zum Guthabenkarte -->
			<column name="sales_voucher_card_uid" type="varchar(200)" />


			<column name="reporting_cd" type="varchar(50)" />
			<column name="reporting_nm" type="varchar(200)" />

			<foreign-key name="iv" ref="d_sales_invs" replication="p">


				<fk-col name="tenant_no" />
				<fk-col name="pos_cd" />
				<fk-col name="sales_inv_id" />
			</foreign-key>
		</table>

		<table name="stock_dlns" replication="slave">
			<column name="tenant_no" type="int" pk="1" />
			<column name="pos_cd" type="varchar(10)" pk="1" />
			<column name="stock_dln_id" type="int" pk="1" />
			<column name="stock_dln_type" type="int" nn="1">
				<constant name="SALES" value="1" />
				<constant name="PURCHASE" value="2" />
				<constant name="INVENTORY" value="3" />
				<constant name="CABINET" value="4" />
				<constant name="OTHER" value="5" />
				<constant name="INVENTORY_PROCESS" value="6" />
			</column>

			<column name="company_no" type="int" />
			<column name="department_no" type="int" />
			<column name="businessunit_no" type="int" />
			<column name="businessunit_nm" type="varchar(200)" />

			<column name="stock_no" type="int" nn="1" />
			<column name="stock_nm" type="varchar(200)" />

			<column name="stock_dln_ts" type="datetime" nn="1" />


			<!-- Sales -->
			<column name="sales_dln_no" type="int" />
			<column name="customer_no" type="int" />
			<column name="customer_nm" type="varchar(200)" />
			<column name="customer_contract_no" type="int" />
			<column name="customer_contract_nm" type="varchar(200)" />

			<!-- Purchase -->
			<column name="purchase_dln_cd" type="varchar(50)" />
			<column name="supplier_no" type="int" />
			<column name="supplier_nm" type="varchar(200)" />
			<column name="supplier_contract_desc" type="varchar(200)" />

			<!-- Cabinet -->
			<column name="cabinet_dln_no" type="int" />


			<!-- Other -->
			<column name="stock_dln_no" type="int" />
			<column name="sink_stock_no" type="int" />
			<column name="sink_stock_nm" type="varchar(200)" />
			<column name="stock_dln_comment" type="varchar(50)" />
			<column name="stock_dln_usage" type="varchar(50)" />


			<!-- Inventory-Process -->
			<column name="inventory_process_nm" type="varchar(200)" />

			<column name="inventory_process_state" type="int">
				<constant name="CREATED" value="1" />
				<constant name="START" value="2" />
				<constant name="CREATE_DIFF" value="3" />

				<constant name="CLOSED" value="4" />

			</column>
			<column name="item_purchase_group_cd" type="varchar(50)" />
			<column name="item_group_cd" type="varchar(50)" />


			<column name="employee_no" type="int" />
			<column name="employee_nm" type="varchar(50)" />

			<column name="stock_revision_type_no" type="int" />
			<column name="stock_revision_type_nm" type="varchar(200)" />


			<foreign-key name="ps" ref="points_of_sale" replication="p">
				<fk-col name="tenant_no" />
				<fk-col name="pos_cd" />
			</foreign-key>
			<foreign-key name="bu" ref="businessunits">
				<fk-col name="tenant_no" />
				<fk-col name="company_no" />
				<fk-col name="department_no" />
				<fk-col name="businessunit_no" />
			</foreign-key>
			<foreign-key name="st" ref="stocks">
				<fk-col name="tenant_no" />
				<fk-col name="company_no" />
				<fk-col name="department_no" />
				<fk-col name="stock_no" />
			</foreign-key>
		</table>

		<table name="stock_dln_positions" replication="slave">
			<column name="tenant_no" type="int" pk="1" />
			<column name="pos_cd" type="varchar(10)" pk="1" />
			<column name="stock_dln_id" type="int" pk="1" />
			<column name="stock_dln_position_id" type="int" pk="1" />
			<column name="company_no" type="int" />
			<column name="department_no" type="int" />
			<column name="item_cd" type="varchar(50)" />
			<column name="item_nm" type="varchar(200)" />
			<column name="unit_cd" type="varchar(10)" />
			<column name="stockable" type="boolean" />
			<column name="amount" type="decimal(20,3)" />

			<column name="position_net_price" type="decimal(20,3)" />
			<column name="gross_price" type="boolean" />
			<column name="position_gross_price" type="decimal(20,3)" />
			<column name="direction_type" type="int">
				<constant name="IN" value="1" />
				<constant name="OUT" value="2" />
			</column>
			<column name="stock_revision_type_no" type="int" />
			<column name="stock_revision_type_nm" type="varchar(200)" />
			<!-- Inventory Process -->
			<column name="inventory_process_amount" type="decimal(20,3)" />
			<column name="inventory_process_diff_reason" type="varchar(250)" />

			<foreign-key name="dn" ref="stock_dlns" replication="p">
				<fk-col name="tenant_no" />
				<fk-col name="pos_cd" />
				<fk-col name="stock_dln_id" />
			</foreign-key>
		</table>

		<table name="d_stock_dlns" replication="slave">
			<column name="tenant_no" type="int" pk="1" />
			<column name="pos_cd" type="varchar(10)" pk="1" />
			<column name="stock_dln_id" type="int" pk="1" />
			<column name="deleted" type="boolean" />
			<column name="final_stock_dln_id" type="int" />

			<column name="stock_dln_type" type="int" nn="1">
				<constant name="SALES" value="1" />
				<constant name="PURCHASE" value="2" />
				<constant name="INVENTORY" value="3" />
				<constant name="CABINET" value="4" />
				<constant name="OTHER" value="5" />
				<constant name="INVENTORY_PROCESS" value="6" />
			</column>

			<column name="company_no" type="int" />
			<column name="department_no" type="int" />
			<column name="businessunit_no" type="int" />
			<column name="businessunit_nm" type="varchar(200)" />

			<column name="stock_no" type="int" nn="1" />
			<column name="stock_nm" type="varchar(200)" />

			<column name="stock_dln_ts" type="datetime" nn="1" />


			<!-- Sales -->
			<column name="customer_no" type="int" />
			<column name="customer_nm" type="varchar(200)" />
			<column name="customer_contract_no" type="int" />
			<column name="customer_contract_nm" type="varchar(200)" />

			<!-- Purchase -->
			<column name="purchase_dln_cd" type="varchar(50)" />
			<column name="supplier_no" type="int" />
			<column name="supplier_nm" type="varchar(200)" />
			<column name="supplier_contract_desc" type="varchar(200)" />

			<!-- Cabinet -->


			<!-- Other -->
			<column name="sink_stock_no" type="int" />
			<column name="sink_stock_nm" type="varchar(200)" />
			<column name="stock_dln_comment" type="varchar(50)" />
			<column name="stock_dln_usage" type="varchar(50)" />


			<!-- Inventory-Process -->
			<column name="inventory_process_nm" type="varchar(200)" />
			<column name="inventory_process_state" type="int">
				<constant name="CREATED" value="1" />
				<constant name="START" value="2" />

				<constant name="CREATE_DIFF" value="3" />

				<constant name="CLOSED" value="4" />

			</column>
			<column name="item_purchase_group_cd" type="varchar(50)" />
			<column name="item_group_cd" type="varchar(50)" />

			<column name="employee_no" type="int" />
			<column name="employee_nm" type="varchar(50)" />
			<column name="stock_revision_type_no" type="int" />
			<column name="stock_revision_type_nm" type="varchar(200)" />

			<foreign-key name="ps" ref="points_of_sale" replication="p">
				<fk-col name="tenant_no" />
				<fk-col name="pos_cd" />
			</foreign-key>
			<foreign-key name="bu" ref="businessunits">
				<fk-col name="tenant_no" />
				<fk-col name="company_no" />
				<fk-col name="department_no" />
				<fk-col name="businessunit_no" />
			</foreign-key>
			<foreign-key name="st" ref="stocks">
				<fk-col name="tenant_no" />
				<fk-col name="company_no" />
				<fk-col name="department_no" />
				<fk-col name="stock_no" />
			</foreign-key>
		</table>

		<table name="d_stock_dln_positions" replication="slave">
			<column name="tenant_no" type="int" pk="1" />
			<column name="pos_cd" type="varchar(10)" pk="1" />
			<column name="stock_dln_id" type="int" pk="1" />
			<column name="stock_dln_position_id" type="int" pk="1" />
			<column name="company_no" type="int" />
			<column name="department_no" type="int" />
			<column name="item_cd" type="varchar(50)" />
			<column name="item_nm" type="varchar(200)" />
			<column name="unit_cd" type="varchar(10)" />
			<column name="stockable" type="boolean" />
			<column name="amount" type="decimal(20,3)" />
			<column name="position_net_price" type="decimal(20,3)" />
			<column name="gross_price" type="boolean" />
			<column name="position_gross_price" type="decimal(20,3)" />
			<column name="direction_type" type="int">
				<constant name="IN" value="1" />
				<constant name="OUT" value="2" />
			</column>

			<column name="stock_revision_type_no" type="int" />
			<column name="stock_revision_type_nm" type="varchar(200)" />
			<!-- Inventory Process -->
			<column name="inventory_process_amount" type="decimal(20,3)" />
			<column name="inventory_process_diff_reason" type="varchar(250)" />
			<foreign-key name="dn" ref="d_stock_dlns" replication="p">
				<fk-col name="tenant_no" />
				<fk-col name="pos_cd" />
				<fk-col name="stock_dln_id" />
			</foreign-key>
		</table>


		<table name="purchase_dlns" replication="slave">
			<column name="tenant_no" type="int" pk="1" />
			<column name="pos_cd" type="varchar(10)" pk="1" />
			<column name="purchase_dln_id" type="int" pk="1" />

			<column name="company_no" type="int" />
			<column name="department_no" type="int" />
			<column name="businessunit_no" type="int" />
			<column name="stock_no" type="int" />
			<column name="stock_nm" type="varchar(200)" />
			<column name="stock_dln_ts" type="datetime" />
			<column name="purchase_dln_ts" type="datetime" />
			<column name="purchase_dln_cd" type="varchar(50)" />
			<column name="purchase_dln_type" type="int">
				<constant name="DELIVERY" value="1" />
				<constant name="CANCELED_DELIVERY" value="2" />
			</column>
			<column name="canceled" type="boolean" />
			<column name="cancel_reason" type="varchar(200)" />
			<column name="supplier_no" type="int" />
			<column name="supplier_nm" type="varchar(200)" />
			<column name="supplier_contract_desc" type="varchar(200)" />

			<foreign-key name="ps" ref="points_of_sale" replication="p">
				<fk-col name="tenant_no" />
				<fk-col name="pos_cd" />
			</foreign-key>
			<foreign-key name="bu" ref="businessunits">
				<fk-col name="tenant_no" />
				<fk-col name="company_no" />
				<fk-col name="department_no" />
				<fk-col name="businessunit_no" />
			</foreign-key>
		</table>
		<table name="purchase_dln_positions" replication="slave">
			<column name="tenant_no" type="int" pk="1" />
			<column name="pos_cd" type="varchar(10)" pk="1" />
			<column name="purchase_dln_id" type="int" pk="1" />
			<column name="purchase_dln_position_id" type="int" pk="1" />
			<column name="company_no" type="int" />
			<column name="department_no" type="int" />
			<column name="item_cd" type="varchar(50)" />
			<column name="item_nm" type="varchar(200)" />
			<column name="unit_cd" type="varchar(10)" />
			<column name="stockable" type="boolean" />
			<column name="amount" type="decimal(20,3)" />
			<foreign-key name="dn" ref="purchase_dlns" replication="p">
				<fk-col name="tenant_no" />
				<fk-col name="pos_cd" />
				<fk-col name="purchase_dln_id" />
			</foreign-key>
		</table>

		<table name="purchase_invs" replication="slave">
			<column name="tenant_no" type="int" pk="1" />
			<column name="pos_cd" type="varchar(10)" pk="1" />
			<column name="purchase_inv_id" type="int" pk="1" />

			<column name="company_no" type="int" />
			<column name="department_no" type="int" />
			<column name="businessunit_no" type="int" />

			<column name="purchase_inv_ts" type="datetime" />
			<column name="purchase_inv_cd" type="varchar(50)" />
			<column name="purchase_inv_type" type="int">
				<constant name="INVOICE" value="1" />
				<constant name="CREDIT_NOTE" value="2" />
			</column>
			<column name="purchase_inv_create_ts" type="datetime" />
			<column name="employee_no" type="int" />
			<column name="employee_nm" type="varchar(200)" />

			<column name="canceled" type="boolean" />
			<column name="cancel_reason" type="varchar(200)" />
			<column name="cancel_for_purchase_inv_id" type="int" />

			<column name="booking_ts" type="datetime" />
			<column name="booking_state" type="int">
				<constant name="BOOKING_STATE_UNPAID" value="1" />
				<constant name="BOOKING_STATE_BOOKABLE" value="2" />
			</column>


			<column name="archived_ts" type="datetime" />
			<column name="archived" type="boolean" />

			<column name="supplier_no" type="int" />
			<column name="supplier_salutation" type="varchar(20)" />
			<column name="supplier_title" type="varchar(20)" />
			<column name="supplier_first_nm" type="varchar(60)" />
			<column name="supplier_contact_nm" type="varchar(200)" />
			<column name="supplier_street" type="varchar(200)" />
			<column name="supplier_country_cd" type="varchar(10)" />
			<column name="supplier_postal_cd" type="varchar(20)" />
			<column name="supplier_city" type="varchar(200)" />

			<column name="supplier_contract_desc" type="varchar(200)" />

			<column name="purchase_dln_id" type="int" />

			<column name="total_net_price" type="decimal(20,3)" />
			<column name="total_gross_price" type="decimal(20,3)" />
			<foreign-key name="ps" ref="points_of_sale" replication="p">
				<fk-col name="tenant_no" />
				<fk-col name="pos_cd" />
			</foreign-key>
			<foreign-key name="bu" ref="businessunits">
				<fk-col name="tenant_no" />
				<fk-col name="company_no" />
				<fk-col name="department_no" />
				<fk-col name="businessunit_no" />
			</foreign-key>
		</table>

		<table name="purchase_inv_positions" replication="slave">
			<constant name="SOURCE_LIST_PRICE" value="1" />
			<constant name="SOURCE_USER_SUPPLIED" value="2" />
			<column name="tenant_no" type="int" pk="1" />
			<column name="pos_cd" type="varchar(10)" pk="1" />
			<column name="purchase_inv_id" type="int" pk="1" />
			<column name="purchase_inv_position_id" type="int" pk="1" />
			<column name="company_no" type="int" />
			<column name="department_no" type="int" />
			<column name="purchase_dln_id" type="int" />

			<column name="item_cd" type="varchar(50)" />
			<column name="item_nm" type="varchar(200)" />
			<column name="unit_cd" type="varchar(10)" />
			<column name="stockable" type="boolean" />
			<column name="amount" type="decimal(20,3)" />
			<column name="net_item_purchase_price" type="decimal(20,3)" />
			<column name="position_net_price" type="decimal(20,3)" />
			<column name="tax_cd" type="varchar(10)" />
			<column name="tax_nm" type="varchar(10)" />
			<column name="tax_desc" type="varchar(50)" />
			<column name="tax_rate_percent" type="decimal(6,2)" />
			<column name="position_tax_price" type="decimal(20,3)" />
			<column name="position_gross_price" type="decimal(20,3)" />
			<column name="simple_acct_cd" type="varchar(50)" />
			<column name="booking_cd" type="varchar(20)" />
			<column name="acct_cd" type="varchar(20)" />
			<column name="tax_hint" type="varchar(20)" />
			<column name="remarks" type="varchar(200)" />

			<foreign-key name="iv" ref="purchase_invs" replication="p">
				<fk-col name="tenant_no" />
				<fk-col name="pos_cd" />
				<fk-col name="purchase_inv_id" />
			</foreign-key>
		</table>

		<table name="d_purchase_orders" replication="slave">
			<column name="tenant_no" type="int" pk="1" />
			<column name="pos_cd" type="varchar(10)" pk="1" />
			<column name="purchase_order_id" type="int" pk="1" />
			<column name="deleted" type="boolean" />
			<column name="final_purchase_order_id" type="int" />

			<column name="company_no" type="int" />
			<column name="department_no" type="int" />
			<column name="businessunit_no" type="int" />

			<column name="purchase_order_ts" type="datetime" />

			<column name="purchase_order_cd" type="varchar(50)" />
			<column name="supplier_no" type="int" />
			<column name="supplier_salutation" type="varchar(20)" />
			<column name="supplier_title" type="varchar(20)" />
			<column name="supplier_first_nm" type="varchar(60)" />
			<column name="supplier_contact_nm" type="varchar(200)" />
			<column name="supplier_street" type="varchar(200)" />
			<column name="supplier_country_cd" type="varchar(10)" />
			<column name="supplier_postal_cd" type="varchar(20)" />
			<column name="supplier_city" type="varchar(200)" />

			<column name="supplier_contract_desc" type="varchar(200)" />
			<column name="stock_no" type="int" />
			<column name="stock_nm" type="varchar(200)" />

			<foreign-key name="ps" ref="points_of_sale" replication="p">
				<fk-col name="tenant_no" />
				<fk-col name="pos_cd" />
			</foreign-key>
			<foreign-key name="bu" ref="businessunits">
				<fk-col name="tenant_no" />
				<fk-col name="company_no" />
				<fk-col name="department_no" />
				<fk-col name="businessunit_no" />
			</foreign-key>
		</table>
		<table name="d_purchase_order_positions" replication="slave">
			<column name="tenant_no" type="int" pk="1" />
			<column name="pos_cd" type="varchar(10)" pk="1" />
			<column name="purchase_order_id" type="int" pk="1" />
			<column name="purchase_order_position_id" type="int" pk="1" />
			<column name="company_no" type="int" />
			<column name="department_no" type="int" />
			<column name="item_cd" type="varchar(50)" />
			<column name="item_ean" type="varchar(200)" />
			<column name="item_nm" type="varchar(200)" />
			<column name="package_size" type="decimal(20,3)" />  <!-- Gebindegröße -->
			<column name="package_unit_cd" type="varchar(20)" /> <!-- Gebindecode -->
			<column name="package_amount" type="decimal(20,3)" /><!-- Anzahl 
				packages -->
			<column name="amount" type="decimal(20,3)" />		 <!-- Anzahl der bestellten Produkte: evtl. Gebindegröße * anzahl packages -->
			<column name="unit_cd" type="varchar(10)" />
			<foreign-key name="or" ref="d_purchase_orders"
				replication="p">
				<fk-col name="tenant_no" />
				<fk-col name="pos_cd" />
				<fk-col name="purchase_order_id" />
			</foreign-key>
		</table>

		<table name="purchase_orders" replication="slave">
			<column name="tenant_no" type="int" pk="1" />
			<column name="pos_cd" type="varchar(10)" pk="1" />
			<column name="purchase_order_id" type="int" pk="1" />
			<column name="deleted" type="boolean" />
			<column name="final_purchase_order_id" type="int" />

			<column name="company_no" type="int" />
			<column name="department_no" type="int" />
			<column name="businessunit_no" type="int" />

			<column name="purchase_order_no" type="int" />
			<column name="purchase_order_ts" type="datetime" />

			<column name="purchase_order_cd" type="varchar(50)" />
			<column name="supplier_no" type="int" />
			<column name="supplier_salutation" type="varchar(20)" />
			<column name="supplier_title" type="varchar(20)" />
			<column name="supplier_first_nm" type="varchar(60)" />
			<column name="supplier_contact_nm" type="varchar(200)" />
			<column name="supplier_street" type="varchar(200)" />
			<column name="supplier_country_cd" type="varchar(10)" />
			<column name="supplier_postal_cd" type="varchar(20)" />
			<column name="supplier_city" type="varchar(200)" />

			<column name="supplier_contract_desc" type="varchar(200)" />
			<column name="stock_no" type="int" />
			<column name="stock_nm" type="varchar(200)" />

			<foreign-key name="ps" ref="points_of_sale" replication="p">
				<fk-col name="tenant_no" />
				<fk-col name="pos_cd" />
			</foreign-key>
			<foreign-key name="bu" ref="businessunits">
				<fk-col name="tenant_no" />
				<fk-col name="company_no" />
				<fk-col name="department_no" />
				<fk-col name="businessunit_no" />
			</foreign-key>
		</table>
		<table name="purchase_order_positions" replication="slave">
			<column name="tenant_no" type="int" pk="1" />
			<column name="pos_cd" type="varchar(10)" pk="1" />
			<column name="purchase_order_id" type="int" pk="1" />
			<column name="purchase_order_position_id" type="int" pk="1" />
			<column name="company_no" type="int" />
			<column name="department_no" type="int" />
			<column name="item_cd" type="varchar(50)" />
			<column name="item_ean" type="varchar(200)" />
			<column name="item_nm" type="varchar(200)" />
			<column name="package_size" type="decimal(20,3)" />
			<column name="package_unit_cd" type="varchar(20)" />
			<column name="package_amount" type="decimal(20,3)" />
			<column name="amount" type="decimal(20,3)" />
			<column name="unit_cd" type="varchar(10)" />
			<foreign-key name="or" ref="purchase_orders" replication="p">
				<fk-col name="tenant_no" />
				<fk-col name="pos_cd" />
				<fk-col name="purchase_order_id" />
			</foreign-key>
		</table>
		<table name="purchase_order_states" replication="slave">
			<column name="tenant_no" type="int" pk="1" />
			<column name="pos_cd" type="varchar(10)" pk="1" />
			<column name="purchase_order_id" type="int" pk="1" />
			<column name="state" type="int">
				<constant name="CANCELED" value="1" />
				<constant name="BOOKED" value="2" />
			</column>
			<foreign-key name="or" ref="purchase_orders" replication="p">
				<fk-col name="tenant_no" />
				<fk-col name="pos_cd" />
				<fk-col name="purchase_order_id" />
			</foreign-key>
		</table>



		<table name="d_purchase_dlns" replication="slave">
			<column name="tenant_no" type="int" pk="1" />
			<column name="pos_cd" type="varchar(10)" pk="1" />
			<column name="purchase_dln_id" type="int" pk="1" />
			<column name="deleted" type="boolean" />
			<column name="final_purchase_dln_id" type="int" />

			<column name="company_no" type="int" />
			<column name="department_no" type="int" />
			<column name="businessunit_no" type="int" />

			<column name="purchase_dln_ts" type="datetime" />

			<column name="purchase_dln_cd" type="varchar(50)" />
			<column name="canceled" type="boolean" />
			<column name="cancel_reason" type="varchar(200)" />
			<column name="supplier_no" type="int" />
			<column name="supplier_nm" type="varchar(200)" />
			<column name="supplier_contract_desc" type="varchar(200)" />
			<column name="stock_no" type="int" />
			<column name="stock_nm" type="varchar(200)" />

			<foreign-key name="ps" ref="points_of_sale" replication="p">
				<fk-col name="tenant_no" />
				<fk-col name="pos_cd" />
			</foreign-key>
			<foreign-key name="bu" ref="businessunits">
				<fk-col name="tenant_no" />
				<fk-col name="company_no" />
				<fk-col name="department_no" />
				<fk-col name="businessunit_no" />
			</foreign-key>
		</table>
		<table name="d_purchase_dln_positions" replication="slave">
			<column name="tenant_no" type="int" pk="1" />
			<column name="pos_cd" type="varchar(10)" pk="1" />
			<column name="purchase_dln_id" type="int" pk="1" />
			<column name="purchase_dln_position_id" type="int" pk="1" />
			<column name="company_no" type="int" />
			<column name="department_no" type="int" />
			<column name="item_cd" type="varchar(50)" />
			<column name="item_nm" type="varchar(200)" />
			<column name="unit_cd" type="varchar(10)" />
			<column name="stockable" type="boolean" />
			<column name="amount" type="decimal(20,3)" />
			<foreign-key name="dn" ref="d_purchase_dlns" replication="p">
				<fk-col name="tenant_no" />
				<fk-col name="pos_cd" />
				<fk-col name="purchase_dln_id" />
			</foreign-key>
		</table>

		<table name="d_purchase_invs" replication="slave">
			<column name="tenant_no" type="int" pk="1" />
			<column name="pos_cd" type="varchar(10)" pk="1" />
			<column name="purchase_inv_id" type="int" pk="1" />
			<column name="deleted" type="boolean" />
			<column name="final_purchase_inv_id" type="int" />

			<column name="company_no" type="int" />
			<column name="department_no" type="int" />
			<column name="businessunit_no" type="int" />

			<column name="purchase_inv_ts" type="datetime" />
			<column name="purchase_inv_cd" type="varchar(50)" />
			<column name="purchase_inv_type" type="int">
				<constant name="INVOICE" value="1" />
				<constant name="CREDIT_NOTE" value="2" />
			</column>

			<column name="canceled" type="boolean" />
			<column name="cancel_reason" type="varchar(200)" />

			<column name="booking_ts" type="datetime" />
			<column name="booking_state" type="int">
				<constant name="BOOKING_STATE_UNPAID" value="1" />
				<constant name="BOOKING_STATE_BOOKABLE" value="2" />
			</column>


			<column name="archived_ts" type="datetime" />
			<column name="archived" type="boolean" />

			<column name="supplier_no" type="int" />
			<column name="supplier_salutation" type="varchar(20)" />
			<column name="supplier_title" type="varchar(20)" />
			<column name="supplier_first_nm" type="varchar(60)" />
			<column name="supplier_contact_nm" type="varchar(200)" />
			<column name="supplier_street" type="varchar(200)" />
			<column name="supplier_country_cd" type="varchar(10)" />
			<column name="supplier_postal_cd" type="varchar(20)" />
			<column name="supplier_city" type="varchar(200)" />

			<column name="supplier_contract_desc" type="varchar(200)" />

			<column name="purchase_dln_id" type="int" />

			<column name="total_net_price" type="decimal(20,3)" />
			<column name="total_gross_price" type="decimal(20,3)" />
			<column name="stock_no" type="int" />
			<column name="stock_nm" type="varchar(200)" />
			<column name="stock_dln_ts" type="datetime" />
			<foreign-key name="ps" ref="points_of_sale" replication="p">
				<fk-col name="tenant_no" />
				<fk-col name="pos_cd" />
			</foreign-key>
			<foreign-key name="bu" ref="businessunits">
				<fk-col name="tenant_no" />
				<fk-col name="company_no" />
				<fk-col name="department_no" />
				<fk-col name="businessunit_no" />
			</foreign-key>
		</table>

		<table name="d_purchase_inv_positions" replication="slave">
			<constant name="SOURCE_LIST_PRICE" value="1" />
			<constant name="SOURCE_USER_SUPPLIED" value="2" />
			<column name="tenant_no" type="int" pk="1" />
			<column name="pos_cd" type="varchar(10)" pk="1" />
			<column name="purchase_inv_id" type="int" pk="1" />
			<column name="purchase_inv_position_id" type="int" pk="1" />
			<column name="company_no" type="int" />
			<column name="department_no" type="int" />
			<column name="purchase_dln_id" type="int" />
			<column name="item_cd" type="varchar(50)" />
			<column name="item_nm" type="varchar(200)" />
			<column name="unit_cd" type="varchar(10)" />
			<column name="stockable" type="boolean" />
			<column name="amount" type="decimal(20,3)" />
			<column name="net_item_purchase_price" type="decimal(20,3)" />
			<column name="position_net_price" type="decimal(20,3)" />
			<column name="tax_cd" type="varchar(10)" />
			<column name="tax_nm" type="varchar(10)" />
			<column name="tax_desc" type="varchar(50)" />
			<column name="tax_rate_percent" type="decimal(6,2)" />
			<column name="position_tax_price" type="decimal(20,3)" />
			<column name="position_gross_price" type="decimal(20,3)" />
			<column name="simple_acct_cd" type="varchar(50)" />
			<column name="booking_cd" type="varchar(20)" />
			<column name="acct_cd" type="varchar(20)" />
			<column name="tax_hint" type="varchar(20)" />
			<column name="remarks" type="varchar(200)" />


			<foreign-key name="d_iv" ref="d_purchase_invs"
				replication="p">
				<fk-col name="tenant_no" />
				<fk-col name="pos_cd" />
				<fk-col name="purchase_inv_id" />
			</foreign-key>
		</table>

		<table name="pos_day_closures">
			<column name="tenant_no" type="int" pk="1" />
			<column name="pos_cd" type="varchar(10)" pk="1" />
			<column name="closure_day" type="datetime" pk="1" />
			<column name="closure_change_ts" type="datetime" />
			<column name="employee_no" type="int" />
			<column name="employee_nm" type="varchar(200)" />
			<column name="status" type="int">
				<constant name="OPEN" value="1" />
				<constant name="VALIDATE" value="2" />
				<constant name="CLOSED" value="3" />
			</column>
			<column name="update_cnt" type="long" />
			<foreign-key name="ps" ref="points_of_sale" replication="p">
				<fk-col name="tenant_no" />
				<fk-col name="pos_cd" />
			</foreign-key>
		</table>

		<table name="drawer_day_closures">
			<column name="tenant_no" type="int" pk="1" />
			<column name="pos_cd" type="varchar(10)" pk="1" />
			<column name="drawer_no" type="int" pk="1" />
			<column name="closure_day" type="datetime" pk="1" />
			<column name="status" type="int">
				<constant name="OPEN" value="1" />
				<constant name="CLOSED" value="2" />
			</column>
			<column name="comment" type="varchar(200)" />
			<column name="update_cnt" type="long" />
			<foreign-key name="pod" ref="pos_drawers" replication="d">
				<fk-col name="tenant_no" />
				<fk-col name="pos_cd" />
				<fk-col name="drawer_no" />
			</foreign-key>
		</table>


		<table name="pos_sessions" replication="slave">
			<column name="tenant_no" type="int" pk="1" />
			<column name="pos_cd" type="varchar(10)" pk="1" />
			<column name="drawer_no" type="int" pk="1" />
			<column name="pos_session_id" type="int" pk="1" />
			<column name="pos_session_cd" type="varchar(50)" />
			<column name="session_start_ts" type="datetime" />
			<column name="session_end_ts" type="datetime" />
			<!-- <column name="cash_start" type="decimal(16,3)" /> <column name="cash_end" 
				type="decimal(16,3)" /> <column name="cash_in" type="decimal(16,3)" /> <column 
				name="cash_out" type="decimal(16,3)" /> <column name="cash_sales_in" type="decimal(16,3)" 
				/> <column name="cash_sales_return_out" type="decimal(16,3)" /> <column name="cash_purchase_out" 
				type="decimal(16,3)" /> <column name="cash_purchase_return_in" type="decimal(16,3)" 
				/> <column name="cash_debt_out" type="decimal(16,3)" /> <column name="cash_debt_in" 
				type="decimal(16,3)" /> <column name="transfer_purchase_out" type="decimal(16,3)" 
				/> <column name="ec_sales_in" type="decimal(16,3)" /> <column name="cc_sales_in" 
				type="decimal(16,3)" /> <column name="transfer_sales_in" type="decimal(16,3)" 
				/> <column name="creditnote_sales_out" type="decimal(16,3)" /> <column name="creditnote_sales_in" 
				type="decimal(16,3)" /> <column name="discount_sales_out" type="decimal(16,3)" 
				/> <column name="voucher_sales_in" type="decimal(16,3)" /> <column name="voucher_out" 
				type="decimal(16,3)" /> -->

			<column name="employee_nm" type="varchar(200)" />
			<column name="cash_protocol_amount" type="decimal(16,3)" />

			<foreign-key name="ps" ref="points_of_sale" replication="p">
				<fk-col name="tenant_no" />
				<fk-col name="pos_cd" />
			</foreign-key>
		</table>


		<table name="pos_payment_types" replication="master">
			<column name="tenant_no" type="int" pk="1" />
			<column name="payment_type" type="int" pk="1">
				<constant name="CASH" value="1" />
				<constant name="VOUCHER" value="2" />
				<constant name="CHANGE" value="3" />
				<constant name="EC" value="4" />
				<constant name="CREDITCARD" value="5" />
				<constant name="CASHDISCOUNT" value="6" />
				<constant name="CREDITNOTE" value="7" />
				<constant name="TRANSFER" value="8" />
				<constant name="EXPENSES" value="9" />
				<constant name="SALESCREDITPOINTS" value="10" />
				<constant name="GENERATEDVOUCHER" value="11" />
				<constant name="SALESCREDITVOUCHER" value="12" />
				<constant name="VOUCHERCARD" value="13" />
				<constant name="ONLINEPAYMENT" value="14" />
			</column>
			<column name="sales_inv" type="int" pk="1" />
			<column name="purchase_inv" type="int" pk="1" />
			<column name="payment_direction" type="int" pk="1">
				<constant name="IN" value="1" />
				<constant name="OUT" value="2" />
			</column>
			<column name="report_nm" type="varchar(50)" />
			<column name="receipt_nm" type="varchar(50)" />
			<foreign-key name="tnt" ref="tenants" replication="p">
				<fk-col name="tenant_no" />
			</foreign-key>
		</table>

		<table name="pos_payments" replication="slave">
			<column name="tenant_no" type="int" pk="1" />
			<column name="pos_cd" type="varchar(10)" pk="1" />
			<column name="drawer_no" type="int" pk="1" />
			<column name="pos_session_id" type="int" pk="1" />
			<column name="pos_payment_id" type="int" pk="1" />
			<column name="payment_ts" type="datetime" />
			<column name="payment_booking_ts" type="datetime" />
			<column name="sales_inv_id" type="int" />
			<column name="purchase_inv_id" type="int" />
			<column name="sales_voucher_pos_cd" type="varchar(10)" />
			<column name="sales_voucher_id" type="int" />
			<column name="external_voucher_pos_cd" type="varchar(10)" />
			<column name="external_voucher_uses_id" type="int" />
			<column name="card_uid" type="varchar(36)" />
			<column name="sales_credit_points" type="int" />
			<column name="sales_credit_valid_from" type="datetime" />
			<column name="sales_credit_valid_to" type="datetime" />
			<column name="sales_credit_card_no" type="varchar(30)" />
			<column name="sales_credit_card_nm" type="varchar(100)" />
			<column name="points_per_revenue" type="decimal(7,4)" />
			<column name="credit_per_point" type="decimal(7,4)" />
			<column name="condition_cd" type="varchar(10)" />
			<column name="sales_credit_cd" type="varchar(50)" />


			<column name="payment" type="decimal(16,3)" />
			<column name="payment_change" type="decimal(16,3)" />
			<column name="pos_cash_snapshot_id" type="int" />
			<column name="currency_cd" type="varchar(10)" />
			<column name="payment_type" type="int">
				<constant name="CASH" value="1" />
				<constant name="VOUCHER" value="2" />
				<constant name="CHANGE" value="3" />
				<constant name="EC" value="4" />
				<constant name="CREDITCARD" value="5" />
				<constant name="CASHDISCOUNT" value="6" />
				<constant name="CREDITNOTE" value="7" />
				<constant name="TRANSFER" value="8" />
				<constant name="EXPENSES" value="9" />
				<constant name="SALESCREDITPOINTS" value="10" />
				<constant name="GENERATEDVOUCHER" value="11" />
				<constant name="SALESCREDITVOUCHER" value="12" />
				<constant name="VOUCHERCARD" value="13" />
				<constant name="ONLINEPAYMENT" value="14" />
			</column>
			<column name="payment_direction" type="int">
				<constant name="IN" value="1" />
				<constant name="OUT" value="2" />
			</column>
			<column name="payment_ref" type="varchar(100)" />
			<column name="cancel_reason" type="varchar(200)" />
			<column name="employee_nm" type="varchar(200)" />

			<column name="cancel_for_pos_session_id" type="int" />
			<column name="cancel_for_drawer_no" type="int" />
			<column name="cancel_for_pos_payment_id" type="int" />

			<column name="voucher_definition_cd" type="varchar(50)" />
			<column name="voucher_mode" type="int" />
			<column name="voucher_type" type="int" />

			<!-- Verlinkung zum Guthabenkarte -->
			<column name="sales_voucher_card_uid" type="varchar(200)" />

			<column name="reporting_cd" type="varchar(50)" />
			<column name="reporting_nm" type="varchar(200)" />
			<column name="contra_acct_cd" type="varchar(20)" />
			<foreign-key name="pss" ref="pos_sessions" replication="p">
				<fk-col name="tenant_no" />
				<fk-col name="pos_cd" />
				<fk-col name="drawer_no" />
				<fk-col name="pos_session_id" />
			</foreign-key>
			<index name="pos_delete_ids">
				<ix-col name="tenant_no" />
				<ix-col name="pos_cd" />
				<ix-col name="cancel_for_drawer_no" />
				<ix-col name="cancel_for_pos_session_id" />
				<ix-col name="cancel_for_pos_payment_id" />
			</index>
			<index name="pos_payments_purchase_inv_id">
				<ix-col name="tenant_no" />
				<ix-col name="pos_cd" />
				<ix-col name="purchase_inv_id" />
			</index>
			<index name="pos_payments_sales_inv_id">
				<ix-col name="tenant_no" />
				<ix-col name="pos_cd" />
				<ix-col name="sales_inv_id" />
			</index>

		</table>
		<table name="pos_payment_notes" replication="slave">
			<column name="tenant_no" type="int" pk="1" />
			<column name="pos_cd" type="varchar(10)" pk="1" />
			<column name="drawer_no" type="int" pk="1" />
			<column name="pos_session_id" type="int" pk="1" />
			<column name="pos_payment_id" type="int" pk="1" />
			<column name="customer_note" type="varchar(8000)" />
			<column name="dealer_note" type="varchar(8000)" />
			<column name="protocol" type="varchar(8000)" />
			<foreign-key name="pm" ref="pos_payments" replication="p">
				<fk-col name="tenant_no" />
				<fk-col name="pos_cd" />
				<fk-col name="drawer_no" />
				<fk-col name="pos_session_id" />
				<fk-col name="pos_payment_id" />
			</foreign-key>
		</table>

		<table name="pos_session_cash_snapshots" replication="slave">
			<column name="tenant_no" type="int" pk="1" />
			<column name="pos_cd" type="varchar(10)" pk="1" />
			<column name="drawer_no" type="int" pk="1" />
			<column name="pos_session_id" type="int" pk="1" />
			<column name="pos_cash_snapshot_id" type="int" pk="1" />
			<column name="cash_note_amount" type="int" />
			<column name="cash_note_unit" type="decimal(16,3)" />
			<column name="cash_amount" type="decimal(16,3)" />
			<foreign-key name="pss" ref="pos_sessions" replication="p">
				<fk-col name="tenant_no" />
				<fk-col name="pos_cd" />
				<fk-col name="drawer_no" />
				<fk-col name="pos_session_id" />
			</foreign-key>
		</table>

		<table name="pos_cash_snapshots" replication="slave">
			<column name="tenant_no" type="int" pk="1" />
			<column name="pos_cd" type="varchar(10)" pk="1" />
			<column name="drawer_no" type="int" pk="1" />
			<column name="snapshot_ts" type="datetime" pk="1" />
			<column name="pos_cash_snapshot_id" type="int" pk="1" />
			<column name="cash_note_amount" type="int" />
			<column name="cash_note_unit" type="decimal(16,3)" />
			<column name="cash_amount" type="decimal(16,3)" />
			<column name="employee_no" type="int" />
			<column name="employee_nm" type="varchar(200)" />


		</table>

		<table name="sales_credit_balance" replication="slave">
			<column name="tenant_no" type="int" pk="1" />
			<column name="pos_cd" type="varchar(10)" pk="1" />
			<column name="sales_credit_balance_id" type="int" pk="1" />
			<!-- neue Spalte seit v1.4.0 -->
			<column name="sales_credit_balance_ts" type="datetime" />
			<column name="contact_no" type="int" />
			<column name="company_no" type="int" />
			<column name="department_no" type="int" />
			<column name="market_no" type="int" />
			<column name="customer_no" type="int" />
			<column name="customer_salutation" type="varchar(20)" />
			<column name="customer_title" type="varchar(20)" />
			<column name="customer_first_nm" type="varchar(60)" />
			<column name="customer_contact_nm" type="varchar(200)" />
			<column name="customer_street" type="varchar(200)" />
			<column name="customer_country_cd" type="varchar(10)" />
			<column name="customer_postal_cd" type="varchar(20)" />
			<column name="customer_city" type="varchar(200)" />

			<column name="customer_contract_no" type="int" />
			<column name="customer_contract_nm" type="varchar(200)" />

			<column name="valid_from" type="datetime" />
			<column name="valid_to" type="datetime" />
			<column name="card_no" type="varchar(36)" />
			<column name="card_nm" type="varchar(100)" />
			<column name="card_uid" type="varchar(36)" />
			<column name="condition_cd" type="varchar(10)" />
			<column name="sales_credit_cd" type="varchar(50)" />

			<column name="sold_by_pos_cd" type="varchar(10)" />
			<column name="sold_by_sales_inv_id" type="int" />
			<column name="sold_by_employee_no" type="int" />
			<column name="sold_by_employee_nm" type="varchar(200)" />

			<column name="used_by_pos_cd" type="varchar(10)" />
			<column name="used_by_sales_inv_id" type="int" />
			<column name="accepted_by_employee_no" type="int" />
			<column name="accepted_by_employee_nm" type="varchar(200)" />

			<column name="cancel_reason" type="varchar(200)" />
			<column name="cancel_for_sales_credit_balance_id" type="int" />

			<column name="points_per_revenue" type="decimal(7,4)" />
			<column name="credit_per_point" type="decimal(7,4)" />

			<column name="sales_credit_points" type="int" />

			<column name="pos_session_id" type="int" />
			<column name="drawer_no" type="int" />
			<column name="pos_payment_id" type="int" />

			<column name="sales_credit_value" type="decimal(20,3)" />

			<foreign-key name="ep" ref="points_of_sale" replication="p">
				<fk-col name="tenant_no" />
				<fk-col name="pos_cd" />
			</foreign-key>

		</table>


		<table name="customer_remark_types" replication="slave">
			<column name="tenant_no" type="int" pk="1" />
			<column name="pos_cd" type="varchar(10)" pk="1" />
			<column name="customer_remark_type_id" type="int" pk="1" />
			<column name="customer_remark_type_nm" type="varchar(200)" />


			<foreign-key name="ep" ref="points_of_sale" replication="p">
				<fk-col name="tenant_no" />
				<fk-col name="pos_cd" />
			</foreign-key>

		</table>

		<table name="customer_remarks" replication="slave">
			<column name="tenant_no" type="int" pk="1" />
			<column name="pos_cd" type="varchar(10)" pk="1" />
			<column name="customer_remark_id" type="int" pk="1" />

			<column name="contact_no" type="int" />
			<column name="company_no" type="int" />
			<column name="customer_no" type="int" />
			<column name="remark_ts" type="datetime" />
			<column name="remark_txt" type="varchar(1000)" />
			<column name="employee_no" type="int" />
			<column name="employee_nm" type="varchar(200)" />
			<column name="operating_employee_no" type="int" />
			<column name="operating_employee_nm" type="varchar(200)" />
			<column name="customer_remark_type_id" type="int" />
			<column name="customer_remark_type_nm" type="varchar(200)" />

			<foreign-key name="ep" ref="points_of_sale" replication="p">
				<fk-col name="tenant_no" />
				<fk-col name="pos_cd" />
			</foreign-key>

		</table>


		<table name="treatment_groups">
			<column name="tenant_no" type="int" pk="1" />
			<column name="pos_cd" type="varchar(10)" pk="1" />
			<column name="treatment_group_id" type="int" pk="1" />

			<column name="treatment_group_nm" type="varchar(100)" />
			<column name="active" type="boolean" />

			<foreign-key name="ep" ref="points_of_sale">
				<fk-col name="tenant_no" />
				<fk-col name="pos_cd" />
			</foreign-key>
		</table>


		<table name="treatment_group_fields">
			<column name="tenant_no" type="int" pk="1" />
			<column name="pos_cd" type="varchar(10)" pk="1" />
			<column name="treatment_group_id" type="int" pk="1" />
			<column name="treatment_group_field_id" type="int" pk="1" />

			<column name="treatment_group_field_nm" type="varchar(100)" />

			<foreign-key name="tg" ref="treatment_groups">
				<fk-col name="tenant_no" />
				<fk-col name="pos_cd" />
				<fk-col name="treatment_group_id" />
			</foreign-key>
		</table>


		<table name="customer_treatments">
			<column name="tenant_no" type="int" pk="1" />
			<column name="pos_cd" type="varchar(10)" pk="1" />
			<column name="treatment_id" type="int" pk="1" />

			<column name="contact_no" type="int" />
			<column name="company_no" type="int" />
			<column name="customer_no" type="int" />
			<column name="treatment_ts" type="datetime" />

			<foreign-key name="ep" ref="points_of_sale">
				<fk-col name="tenant_no" />
				<fk-col name="pos_cd" />
			</foreign-key>


			<foreign-key name="c" ref="contacts">
				<fk-col name="tenant_no" />
				<fk-col name="contact_no" />
			</foreign-key>

		</table>


		<table name="customer_treatment_groups">
			<column name="tenant_no" type="int" pk="1" />
			<column name="pos_cd" type="varchar(10)" pk="1" />
			<column name="treatment_id" type="int" pk="1" />
			<column name="treatment_group_id" type="int" pk="1" />

			

			<column name="company_no" type="int" />
			<column name="employee_no" type="int" />
			<column name="employee_nm" type="varchar(200)" />
			<column name="operating_employee_no" type="int" />
			<column name="operating_employee_nm" type="varchar(200)" />
			<column name="comment" type="varchar(1000)" />

			<foreign-key name="ct" ref="customer_treatments">
				<fk-col name="tenant_no" />
				<fk-col name="pos_cd" />
				<fk-col name="treatment_id" />
			</foreign-key>

			<foreign-key name="tg" ref="treatment_groups">
				<fk-col name="tenant_no" />
				<fk-col name="pos_cd" />
				<fk-col name="treatment_group_id" />
			</foreign-key>

		</table>


		<table name="customer_treatment_group_fields">
			<column name="tenant_no" type="int" pk="1" />
			<column name="pos_cd" type="varchar(10)" pk="1" />
			<column name="treatment_id" type="int" pk="1" />
			<column name="treatment_group_id" type="int" pk="1" />
			<column name="treatment_group_field_id" type="int" pk="1" />
			<column name="treatment_group_field_value" type="varchar(1000)" />

			<foreign-key name="ctg" ref="customer_treatment_groups">
				<fk-col name="tenant_no" />
				<fk-col name="pos_cd" />
				<fk-col name="treatment_id" />
				<fk-col name="treatment_group_id" />
			</foreign-key>

			<foreign-key name="tgf" ref="treatment_group_fields">
				<fk-col name="tenant_no" />
				<fk-col name="pos_cd" />
				<fk-col name="treatment_group_id" />
				<fk-col name="treatment_group_field_id" />
			</foreign-key>
		</table>


		<table name="customer_treatment_groups_v2">
			<column name="tenant_no" type="int" pk="1" />
			<column name="pos_cd" type="varchar(10)" pk="1" />
			<column name="treatment_id" type="int" pk="1" />
			<column name="treatment_group_id" type="int" pk="1" />
			<column name="customer_treatment_group_id" type="int" pk="1" />

			<column name="company_no" type="int" />
			<column name="employee_no" type="int" />
			<column name="employee_nm" type="varchar(200)" />
			<column name="operating_employee_no" type="int" />
			<column name="operating_employee_nm" type="varchar(200)" />
			<column name="comment" type="varchar(1000)" />

			<foreign-key name="ct" ref="customer_treatments">
				<fk-col name="tenant_no" />
				<fk-col name="pos_cd" />
				<fk-col name="treatment_id" />
			</foreign-key>

			<foreign-key name="tg" ref="treatment_groups">
				<fk-col name="tenant_no" />
				<fk-col name="pos_cd" />
				<fk-col name="treatment_group_id" />
			</foreign-key>

		</table>


		<table name="customer_treatment_group_fields_v2">
			<column name="tenant_no" type="int" pk="1" />
			<column name="pos_cd" type="varchar(10)" pk="1" />
			<column name="treatment_id" type="int" pk="1" />
			<column name="treatment_group_id" type="int" pk="1" />
			<column name="customer_treatment_group_id" type="int" pk="1" />
			<column name="treatment_group_field_id" type="int" pk="1" />
	
			<column name="treatment_group_field_value" type="varchar(1000)" />

			<foreign-key name="ctg" ref="customer_treatment_groups_v2">
				<fk-col name="tenant_no" />
				<fk-col name="pos_cd" />
				<fk-col name="treatment_id" />
				<fk-col name="treatment_group_id" />
				<fk-col name="customer_treatment_group_id" />
			</foreign-key>

			<foreign-key name="tgf" ref="treatment_group_fields">
				<fk-col name="tenant_no" />
				<fk-col name="pos_cd" />
				<fk-col name="treatment_group_id" />
				<fk-col name="treatment_group_field_id" />
			</foreign-key>
		</table>


		<table name="fast_inputs" replication="master">
			<column name="tenant_no" type="int" pk="1" />
			<column name="company_no" type="int" pk="1" />
			<column name="department_no" type="int" pk="1" />
			<column name="market_no" type="int" pk="1" />
			<column name="fast_input_cd" type="varchar(50)" pk="1" />
			<column name="fast_input_nm" type="varchar(200)" />

			<column name="fast_input_type" type="int">
				<constant name="SALES_INV" value="1" />
				<constant name="SALES_POSITION" value="2" />
				<constant name="CASHDISCOUNT" value="3" />
				<constant name="VOUCHER" value="4" />
			</column>
			<column name="fast_input_percent" type="decimal(20,3)" />
			<column name="fast_input_price" type="decimal(20,3)" />
			<column name="simple_acct_cd" type="varchar(50)" />
			<column name="fast_input_external_code" type="varchar(50)" />

			<foreign-key name="mk" ref="markets" replication="d">
				<fk-col name="tenant_no" />
				<fk-col name="company_no" />
				<fk-col name="department_no" />
				<fk-col name="market_no" />
			</foreign-key>


		</table>


		<table name="stock_revision_types" replication="master">
			<column name="tenant_no" type="int" pk="1" />
			<column name="company_no" type="int" pk="1" />
			<column name="department_no" type="int" pk="1" />
			<column name="stock_revision_type_no" type="int" pk="1" />
			<column name="stock_revision_type_nm" type="varchar(200)" />



			<foreign-key name="dp" ref="departments" replication="p">
				<fk-col name="tenant_no" />
				<fk-col name="company_no" />
				<fk-col name="department_no" />
			</foreign-key>
		</table>

		<table name="pos_audit_log_login_infos">
			<column name="tenant_no" type="int" pk="1" />
			<column name="pos_cd" type="varchar(10)" pk="1" />
			<column name="audit_log_login_id" type="int" pk="1" />
			<column name="audit_log_login_nm" type="varchar(100)" />
			<column name="audit_log_employee_nm" type="varchar(100)" />
			<column name="audit_log_permissions" type="varchar(1000)" />
			<foreign-key name="pos" ref="points_of_sale">
				<fk-col name="tenant_no" />
				<fk-col name="pos_cd" />
			</foreign-key>
		</table>

		<table name="pos_audit_logs">
			<constant name="PERSISTENCE_USAGE" value="1" />
			<constant name="PERSISTENCE_BASEFILES" value="2" />
			<constant name="PERSISTENCE_NOTES" value="3" />
			<constant name="SEVERITY_INFO" value="1" />
			<constant name="SEVERITY_WARNING" value="2" />
			<constant name="SEVERITY_ERROR" value="3" />
			<constant name="SEVERITY_FATAL" value="4" />
			<column name="tenant_no" type="int" pk="1" />
			<column name="pos_cd" type="varchar(10)" pk="1" />
			<column name="audit_log_id" type="long" pk="1" />
			<column name="audit_log_ctx_cd" type="varchar(10)" nn="1" />
			<column name="audit_log_key_cd" type="varchar(100)" nn="1" />
			<column name="audit_log_ts" type="datetime" nn="1" />
			<column name="audit_log_login_id" type="int" />
			<column name="persistence" type="int">
			</column>
			<column name="severity" type="int">
			</column>
			<column name="audit_log_message" type="varchar(100)" nn="1" />
			<column name="audit_log_data" type="varchar(2000)" />
			<foreign-key name="pos" ref="points_of_sale">
				<fk-col name="tenant_no" />
				<fk-col name="pos_cd" />
			</foreign-key>
			<foreign-key name="log" ref="pos_audit_log_login_infos">
				<fk-col name="tenant_no" />
				<fk-col name="pos_cd" />
				<fk-col name="audit_log_login_id" />

			</foreign-key>
		</table>

		<table name="planet_main_customer_groups" replication="master">
			<column name="tenant_no" type="int" pk="1" />
			<column name="customer_group_no" type="int" pk="1" />
			<column name="customer_group_nm" type="varchar(200)" nn="1" />

			<column name="update_cnt" type="long" />

			<foreign-key name="co" ref="tenants" replication="p">
				<fk-col name="tenant_no" />

			</foreign-key>
		</table>


		<table name="planet_main_customer_group_maps" replication="master">
			<column name="tenant_no" type="int" pk="1" />
			<column name="company_no" type="int" pk="1" />
			<column name="pos_cd" type="varchar(10)" pk="1" />
			<column name="customer_group_no" type="int" pk="1" />

			<column name="update_cnt" type="long" />
			<column name="main_customer_group_update_cnt" type="long" />
			<foreign-key name="t" ref="tenants">
				<fk-col name="tenant_no" />

			</foreign-key>
			<foreign-key name="pmcg" ref="planet_main_customer_groups"
				replication="p">
				<fk-col name="tenant_no" />
				<fk-col name="customer_group_no" />

			</foreign-key>
		</table>


		<table name="planet_main_contacts" replication="master">
			<column name="tenant_no" type="int" pk="1" />
			<column name="master_cd" type="varchar(200)" pk="1" />
			<column name="contact_nm" type="varchar(200)" nn="1" />
			<column name="first_nm" type="varchar(60)" />
			<column name="title" type="varchar(20)" />
			<column name="salutation" type="varchar(20)" />
			<column name="street" type="varchar(200)" />
			<column name="country_cd" type="varchar(10)" />
			<column name="postal_cd" type="varchar(20)" />
			<column name="city" type="varchar(200)" />
			<column name="email" type="varchar(200)" />
			<column name="phone" type="varchar(200)" />
			<column name="mobile" type="varchar(200)" />
			<column name="update_cnt" type="long" />

			<index name="pm_cu_co_nm">
				<ix-col name="tenant_no" />
				<ix-col name="contact_nm" />
			</index>
			<index name="pm_cu_co_fnm">
				<ix-col name="tenant_no" />
				<ix-col name="first_nm" />
			</index>
			<index name="pm_co_nm_fn">
				<ix-col name="tenant_no" />
				<ix-col name="contact_nm" />
				<ix-col name="first_nm" />
			</index>
			<foreign-key name="tn" ref="tenants" replication="p">
				<fk-col name="tenant_no" />
			</foreign-key>
		</table>


		<table name="planet_main_customer_roles" replication="master">
			<column name="tenant_no" type="int" pk="1" />
			<column name="master_cd" type="varchar(200)" pk="1" />
			<column name="comment" type="varchar(200)" />
			<column name="notes" type="varchar(200)" />
			<column name="customer_group_no" type="int" />
			<column name="birthday" type="datetime" />
			<column name="group_role" type="boolean" />
			<column name="unselectable" type="boolean" />
			<column name="imported" type="boolean" />
			<column name="update_cnt" type="long" />

			<foreign-key name="ct" ref="planet_main_contacts"
				replication="d">
				<fk-col name="tenant_no" />
				<fk-col name="master_cd" />
			</foreign-key>
			<foreign-key name="cog" ref="planet_main_customer_groups"
				replication="p">
				<fk-col name="tenant_no" />
				<fk-col name="customer_group_no" />

			</foreign-key>
		</table>



		<table name="planet_contact_master" replication="master">
			<column name="tenant_no" type="int" pk="1" />
			<column name="master_cd" type="varchar(200)" pk="1" />
			<column name="pos_cd" type="varchar(10)" pk="1" />
			<column name="contact_no" type="int" />
			<column name="update_cnt" type="long" />
			<!-- enthält den main_contac_update_cnt der als letztes auf den Satellite 
				repliziert wurde -->
			<column name="main_contact_update_cnt" type="long" />
			<column name="main_customer_role_update_cnt" type="long" />


			<column name="deleted" type="boolean" />


			<foreign-key name="cr" ref="planet_main_contacts"
				replication="p">
				<fk-col name="tenant_no" />
				<fk-col name="master_cd" />

			</foreign-key>
		</table>


		<!-- <table name="planet_main_contracts" replication="master"> <column 
			name="tenant_no" type="int" pk="1" /> <column name="master_cd" type="varchar(200)" 
			pk="1" /> <column name="customer_contract_no" type="int" pk="1" /> <column 
			name="customer_contract_nm" type="varchar(200)" nn="1" /> <column name="update_cnt" 
			type="long" /> <foreign-key name="cu" ref="planet_main_customer_roles" replication="p"> 
			<fk-col name="tenant_no" /> <fk-col name="master_cd" /> </foreign-key> </table> 
			<table name="planet_main_contract_conditions" replication="master" engine="pos"> 
			<column name="tenant_no" type="int" pk="1" /> <column name="master_cd" type="varchar(200)" 
			pk="1" /> <column name="customer_contract_no" type="int" pk="1" /> <column 
			name="valid_from" type="datetime" pk="1" /> <column name="valid_to" type="datetime" 
			/> <column name="condition_cd" type="varchar(10)" /> <column name="card_uid" 
			type="varchar(36)" /> <column name="card_no" type="varchar(30)" /> <column 
			name="deleted" type="boolean" /> <column name="update_cnt" type="long" /> 
			<foreign-key name="c" ref="conditions" replication="p"> <fk-col name="tenant_no" 
			/> <fk-col name="condition_cd" /> </foreign-key> <foreign-key name="cu" ref="planet_main_contracts" 
			replication="d"> <fk-col name="tenant_no" /> <fk-col name="master_cd" /> 
			<fk-col name="customer_contract_no" /> </foreign-key> </table> -->


		<table name="planet_contacts" replication="master">
			<column name="tenant_no" type="int" pk="1" />
			<column name="pos_cd" type="varchar(10)" pk="1" />
			<column name="contact_no" type="int" pk="1" />
			<column name="contact_nm" type="varchar(200)" nn="1" />
			<column name="first_nm" type="varchar(60)" />
			<column name="title" type="varchar(20)" />
			<column name="salutation" type="varchar(20)" />
			<column name="street" type="varchar(200)" />
			<column name="country_cd" type="varchar(10)" />
			<column name="postal_cd" type="varchar(20)" />
			<column name="city" type="varchar(200)" />
			<column name="email" type="varchar(200)" />
			<column name="phone" type="varchar(200)" />
			<column name="mobile" type="varchar(200)" />
			<column name="update_cnt" type="long" />

			<index name="p_cu_co_nm">
				<ix-col name="tenant_no" />
				<ix-col name="contact_nm" />
			</index>
			<index name="p_cu_co_fnm">
				<ix-col name="tenant_no" />
				<ix-col name="first_nm" />
			</index>
			<index name="p_co_nm_fn">
				<ix-col name="tenant_no" />
				<ix-col name="contact_nm" />
				<ix-col name="first_nm" />
			</index>
			<foreign-key name="tn" ref="tenants" replication="p">
				<fk-col name="tenant_no" />
			</foreign-key>
		</table>



		<table name="planet_customer_roles" replication="master">
			<column name="tenant_no" type="int" pk="1" />
			<column name="pos_cd" type="varchar(10)" pk="1" />
			<column name="contact_no" type="int" pk="1" />
			<column name="company_no" type="int" pk="1" />
			<column name="customer_no" type="int" pk="1" />
			<column name="comment" type="varchar(200)" />
			<column name="notes" type="varchar(200)" />
			<column name="customer_group_no" type="int" />
			<column name="birthday" type="datetime" />
			<column name="group_role" type="boolean" />
			<column name="unselectable" type="boolean" />
			<column name="imported" type="boolean" />
			<column name="update_cnt" type="long" />

			<foreign-key name="ct" ref="planet_contacts" replication="d">
				<fk-col name="tenant_no" />
				<fk-col name="pos_cd" />
				<fk-col name="contact_no" />
			</foreign-key>
			<foreign-key name="co" ref="companies" replication="p">
				<fk-col name="tenant_no" />
				<fk-col name="company_no" />
			</foreign-key>
		</table>

		<!-- alte Tabelle, wurde durch planet_contact_master ersetzt. Kann nach 
			erfolgreicher migration auf die neue Version gelöscht werden -->
		<table name="planet_customer_master" replication="master">
			<column name="tenant_no" type="int" pk="1" />
			<column name="pos_cd" type="varchar(10)" pk="1" />
			<column name="contact_no" type="int" pk="1" />
			<column name="company_no" type="int" pk="1" />
			<column name="customer_no" type="int" pk="1" />
			<column name="master_cd" type="varchar(200)" />
			<column name="update_cnt" type="long" />
			<column name="main_update_cnt" type="long" />
			<column name="deleted" type="boolean" />
			<foreign-key name="cr" ref="planet_customer_roles"
				replication="p">
				<fk-col name="tenant_no" />
				<fk-col name="pos_cd" />
				<fk-col name="contact_no" />
				<fk-col name="company_no" />
				<fk-col name="customer_no" />
			</foreign-key>
		</table>

		<table name="planet_customer_groups" replication="master">
			<column name="tenant_no" type="int" pk="1" />
			<column name="pos_cd" type="varchar(10)" pk="1" />
			<column name="company_no" type="int" pk="1" />
			<column name="customer_group_no" type="int" pk="1" />
			<column name="customer_group_nm" type="varchar(200)" nn="1" />
			<column name="acct_cd" type="varchar(20)" />
			<column name="update_cnt" type="long" />
			<foreign-key name="co" ref="companies" replication="p">
				<fk-col name="tenant_no" />
				<fk-col name="company_no" />
			</foreign-key>
		</table>

		<table name="planet_customer_contracts" replication="master">
			<column name="tenant_no" type="int" pk="1" />
			<column name="pos_cd" type="varchar(10)" pk="1" />
			<column name="contact_no" type="int" pk="1" />
			<column name="company_no" type="int" pk="1" />
			<column name="customer_no" type="int" pk="1" />
			<column name="customer_contract_no" type="int" pk="1" />
			<column name="customer_contract_nm" type="varchar(200)" nn="1" />
			<column name="update_cnt" type="long" />
			<foreign-key name="cu" ref="planet_customer_roles"
				replication="p">
				<fk-col name="tenant_no" />
				<fk-col name="pos_cd" />
				<fk-col name="contact_no" />
				<fk-col name="company_no" />
				<fk-col name="customer_no" />
			</foreign-key>
		</table>

		<table name="planet_customer_contract_conditions" replication="master"
			engine="pos">
			<column name="tenant_no" type="int" pk="1" />
			<column name="pos_cd" type="varchar(10)" pk="1" />
			<column name="contact_no" type="int" pk="1" />
			<column name="company_no" type="int" pk="1" />
			<column name="department_no" type="int" pk="1" />

			<column name="customer_no" type="int" pk="1" />
			<column name="customer_contract_no" type="int" pk="1" />
			<column name="valid_from" type="datetime" pk="1" />
			<column name="valid_to" type="datetime" />

			<!-- neu -->

			<column name="condition_cd" type="varchar(10)" />

			<column name="card_uid" type="varchar(36)" />
			<column name="card_no" type="varchar(30)" />
			<column name="card_usage_id" type="int" />
			<!-- alt -->
			<!-- <column name="market_no" type="int" /> <column name="card_nm" type="varchar(100)" 
				/> <column name="sales_pricelist_id" type="int" /> <column name="item_condition_cd" 
				type="varchar(50)" /> <column name="sales_credit_cd" type="varchar(50)" /> 
				<column name="phase_out" type="boolean" /> -->
			<column name="deleted" type="boolean" />
			<column name="update_cnt" type="long" />
			<foreign-key name="c" ref="conditions" replication="d">
				<fk-col name="tenant_no" />
				<fk-col name="condition_cd" />
			</foreign-key>
			<foreign-key name="cu" ref="planet_customer_contracts"
				replication="p">
				<fk-col name="tenant_no" />
				<fk-col name="pos_cd" />
				<fk-col name="contact_no" />
				<fk-col name="company_no" />
				<fk-col name="customer_no" />
				<fk-col name="customer_contract_no" />
			</foreign-key>
		</table>

		<table name="planet_customer_businessunit_contracts"
			replication="master" engine="pos">
			<column name="tenant_no" type="int" pk="1" />
			<column name="pos_cd" type="varchar(10)" pk="1" />
			<column name="contact_no" type="int" pk="1" />
			<column name="company_no" type="int" pk="1" />
			<column name="department_no" type="int" pk="1" />
			<column name="businessunit_no" type="int" />
			<column name="customer_no" type="int" pk="1" />
			<column name="customer_contract_no" type="int" pk="1" />
			<column name="update_cnt" type="long" />
			<foreign-key name="cu" ref="planet_customer_contracts"
				replication="p">
				<fk-col name="tenant_no" />
				<fk-col name="pos_cd" />
				<fk-col name="contact_no" />
				<fk-col name="company_no" />
				<fk-col name="customer_no" />
				<fk-col name="customer_contract_no" />
			</foreign-key>
			<foreign-key name="bu" ref="businessunits" replication="d">
				<fk-col name="tenant_no" />
				<fk-col name="company_no" />
				<fk-col name="department_no" />
				<fk-col name="businessunit_no" />
			</foreign-key>
		</table>

		<table name="planet_pos_replication_logins" replication="none"
			engine="pos">
			<column name="tenant_no" type="int" pk="1" />
			<column name="pos_cd" type="varchar(10)" pk="1" />
			<column name="user_nm" type="varchar(100)" pk="1" />
			<column name="password" type="varchar(100)" nn="1" />

			<foreign-key name="pos" ref="points_of_sale">
				<fk-col name="tenant_no" />
				<fk-col name="pos_cd" />
			</foreign-key>
		</table>

	</catalog>

</model>