<!-- $Header: /cvsroot/autodoc/autodoc/html.tmpl,v 1.4 2006/05/16 19:01:27 rbt Exp $ --> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <html> <head> <title>Index for lsmb13-new</title> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <style type="text/css"> BODY { color: #000000; background-color: #FFFFFF; font-family: Helvetica, sans-serif; } P { margin-top: 5px; margin-bottom: 5px; } P.w3ref { font-size: 8pt; font-style: italic; text-align: right; } P.detail { font-size: 10pt; } .error { color: #FFFFFF; background-color: #FF0000; } H1, H2, H3, H4, H5, H6 { } OL { list-style-type: upper-alpha; } UL.topic { list-style-type: upper-alpha; } LI.topic { font-weight : bold; } HR { color: #00FF00; background-color: #808080; } TABLE { border-width: medium; padding: 3px; background-color: #000000; width: 90%; } CAPTION { text-transform: capitalize; font-weight : bold; font-size: 14pt; } TH { color: #FFFFFF; background-color: #000000; text-align: left; } TR { color: #000000; background-color: #000000; vertical-align: top; } TR.tr0 { background-color: #F0F0F0; } TR.tr1 { background-color: #D8D8D8; } TD { font-size: 12pt; } TD.col0 { font-weight : bold; width: 20%; } TD.col1 { font-style: italic; width: 15%; } TD.col2 { font-size: 12px; } </style> <link rel="stylesheet" type="text/css" media="all" href="all.css"> <link rel="stylesheet" type="text/css" media="screen" href="screen.css"> <link rel="stylesheet" type="text/css" media="print" href="print.css"> <meta HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1"> </head> <body> <!-- Primary Index --> <p><br><br>Dumped on 2007-06-13</p> <h1><a name="index">Index of database - lsmb13-new</a></h1> <ul> <li><a name="public.schema">public</a></li><ul> <li><a href="#public.table.acc-trans">acc_trans</a></li><li><a href="#public.table.ap">ap</a></li><li><a href="#public.table.ar">ar</a></li><li><a href="#public.table.assembly">assembly</a></li><li><a href="#public.table.audittrail">audittrail</a></li><li><a href="#public.table.business">business</a></li><li><a href="#public.table.chart">chart</a></li><li><a href="#public.table.company">company</a></li><li><a href="#public.table.company-to-contact">company_to_contact</a></li><li><a href="#public.table.company-to-entity">company_to_entity</a></li><li><a href="#public.table.company-to-location">company_to_location</a></li><li><a href="#public.table.contact-class">contact_class</a></li><li><a href="#public.table.country">country</a></li><li><a href="#public.table.custom-field-catalog">custom_field_catalog</a></li><li><a href="#public.table.custom-table-catalog">custom_table_catalog</a></li><li><a href="#public.table.customer">customer</a></li><li><a href="#public.table.customertax">customertax</a></li><li><a href="#public.table.defaults">defaults</a></li><li><a href="#public.table.department">department</a></li><li><a href="#public.table.dpt-trans">dpt_trans</a></li><li><a href="#public.table.employee">employee</a></li><li><a href="#public.table.entity">entity</a></li><li><a href="#public.table.entity-class">entity_class</a></li><li><a href="#public.table.entity-class-to-entity">entity_class_to_entity</a></li><li><a href="#public.table.entity-other-name">entity_other_name</a></li><li><a href="#public.table.exchangerate">exchangerate</a></li><li><a href="#public.table.gifi">gifi</a></li><li><a href="#public.table.gl">gl</a></li><li><a href="#public.table.inventory">inventory</a></li><li><a href="#public.table.invoice">invoice</a></li><li><a href="#public.table.jcitems">jcitems</a></li><li><a href="#public.table.language">language</a></li><li><a href="#public.table.location">location</a></li><li><a href="#public.table.makemodel">makemodel</a></li><li><a href="#public.table.oe">oe</a></li><li><a href="#public.table.oe-class">oe_class</a></li><li><a href="#public.table.orderitems">orderitems</a></li><li><a href="#public.table.parts">parts</a></li><li><a href="#public.table.partscustomer">partscustomer</a></li><li><a href="#public.table.partsgroup">partsgroup</a></li><li><a href="#public.table.partstax">partstax</a></li><li><a href="#public.table.partsvendor">partsvendor</a></li><li><a href="#public.table.person">person</a></li><li><a href="#public.table.person-to-company">person_to_company</a></li><li><a href="#public.table.person-to-contact">person_to_contact</a></li><li><a href="#public.table.person-to-entity">person_to_entity</a></li><li><a href="#public.table.pricegroup">pricegroup</a></li><li><a href="#public.table.project">project</a></li><li><a href="#public.table.recurring">recurring</a></li><li><a href="#public.table.recurringemail">recurringemail</a></li><li><a href="#public.table.recurringprint">recurringprint</a></li><li><a href="#public.table.salutation">salutation</a></li><li><a href="#public.table.shipto">shipto</a></li><li><a href="#public.table.sic">sic</a></li><li><a href="#public.table.status">status</a></li><li><a href="#public.table.tax">tax</a></li><li><a href="#public.table.taxcategory">taxcategory</a></li><li><a href="#public.table.taxmodule">taxmodule</a></li><li><a href="#public.table.transactions">transactions</a></li><li><a href="#public.table.translation">translation</a></li><li><a href="#public.table.vendor">vendor</a></li><li><a href="#public.table.vendortax">vendortax</a></li><li><a href="#public.table.warehouse">warehouse</a></li><li><a href="#public.table.yearend">yearend</a></li> <li><a href="#public.function.add-custom-field-character-varying-character-varying-character-varying">add_custom_field( character varying, character varying, character varying )</a></li><li><a href="#public.function.avgcost-integer">avgcost( integer )</a></li><li><a href="#public.function.check-department">check_department( )</a></li><li><a href="#public.function.check-inventory">check_inventory( )</a></li><li><a href="#public.function.del-customer">del_customer( )</a></li><li><a href="#public.function.del-department">del_department( )</a></li><li><a href="#public.function.del-exchangerate">del_exchangerate( )</a></li><li><a href="#public.function.del-recurring">del_recurring( )</a></li><li><a href="#public.function.del-vendor">del_vendor( )</a></li><li><a href="#public.function.del-yearend">del_yearend( )</a></li><li><a href="#public.function.drop-custom-field-character-varying-character-varying">drop_custom_field( character varying, character varying )</a></li><li><a href="#public.function.lastcost-integer">lastcost( integer )</a></li><li><a href="#public.function.trigger-parts-short">trigger_parts_short( )</a></li><li><a href="#public.function.update-user-integer-text">update_user( integer, text )</a></li> </ul> </ul> <!-- Schema Creation --> <!-- publicpublic --> <hr> <h2>Table: <a name="public.table.acc-trans">acc_trans</a> </h2> <table width="100%" cellspacing="0" cellpadding="3"> <caption>acc_trans Structure</caption> <tr> <th>F-Key</th> <th>Name</th> <th>Type</th> <th>Description</th> </tr> <tr class="tr0"> <td> </td> <td>trans_id</td> <td>integer</td> <td><i> </i> </td> </tr> <tr class="tr1"> <td> <a href="#public.table.chart">chart.id</a> </td> <td>chart_id</td> <td>integer</td> <td><i> NOT NULL </i> </td> </tr> <tr class="tr0"> <td> </td> <td>amount</td> <td>numeric</td> <td><i> </i> </td> </tr> <tr class="tr1"> <td> </td> <td>transdate</td> <td>date</td> <td><i> DEFAULT ('now'::text)::date </i> </td> </tr> <tr class="tr0"> <td> </td> <td>source</td> <td>text</td> <td><i> </i> </td> </tr> <tr class="tr1"> <td> </td> <td>cleared</td> <td>boolean</td> <td><i> DEFAULT false </i> </td> </tr> <tr class="tr0"> <td> </td> <td>fx_transaction</td> <td>boolean</td> <td><i> DEFAULT false </i> </td> </tr> <tr class="tr1"> <td> </td> <td>project_id</td> <td>integer</td> <td><i> </i> </td> </tr> <tr class="tr0"> <td> </td> <td>memo</td> <td>text</td> <td><i> </i> </td> </tr> <tr class="tr1"> <td> </td> <td>invoice_id</td> <td>integer</td> <td><i> </i> </td> </tr> <tr class="tr0"> <td> </td> <td>entry_id</td> <td>serial</td> <td><i> PRIMARY KEY </i> </td> </tr> </table> <!-- Inherits --> <!-- Constraint List --> <!-- Foreign Key Discovery --> <!-- Indexes --> acc_trans_chart_id_key chart_id acc_trans_source_key lower(source) acc_trans_trans_id_key trans_id acc_trans_transdate_key transdate <!-- View Definition --> <!-- List off permissions --> <p> <a href="#index">Index</a> - <a href="#public.schema">Schema public</a> </p> <hr> <h2>Table: <a name="public.table.ap">ap</a> </h2> <table width="100%" cellspacing="0" cellpadding="3"> <caption>ap Structure</caption> <tr> <th>F-Key</th> <th>Name</th> <th>Type</th> <th>Description</th> </tr> <tr class="tr0"> <td> </td> <td>id</td> <td>serial</td> <td><i> PRIMARY KEY </i> </td> </tr> <tr class="tr1"> <td> </td> <td>invnumber</td> <td>text</td> <td><i> </i> </td> </tr> <tr class="tr0"> <td> </td> <td>transdate</td> <td>date</td> <td><i> DEFAULT ('now'::text)::date </i> </td> </tr> <tr class="tr1"> <td> <a href="#public.table.entity">entity.id</a> </td> <td>entity_id</td> <td>integer</td> <td><i> </i> <br><br> Used to be customer_id, but customer is now metadata. You need to push to entity </td> </tr> <tr class="tr0"> <td> </td> <td>taxincluded</td> <td>boolean</td> <td><i> DEFAULT false </i> </td> </tr> <tr class="tr1"> <td> </td> <td>amount</td> <td>numeric</td> <td><i> </i> </td> </tr> <tr class="tr0"> <td> </td> <td>netamount</td> <td>numeric</td> <td><i> </i> </td> </tr> <tr class="tr1"> <td> </td> <td>paid</td> <td>numeric</td> <td><i> </i> </td> </tr> <tr class="tr0"> <td> </td> <td>datepaid</td> <td>date</td> <td><i> </i> </td> </tr> <tr class="tr1"> <td> </td> <td>duedate</td> <td>date</td> <td><i> </i> </td> </tr> <tr class="tr0"> <td> </td> <td>invoice</td> <td>boolean</td> <td><i> DEFAULT false </i> </td> </tr> <tr class="tr1"> <td> </td> <td>ordnumber</td> <td>text</td> <td><i> </i> </td> </tr> <tr class="tr0"> <td> </td> <td>curr</td> <td>character(3)</td> <td><i> </i> </td> </tr> <tr class="tr1"> <td> </td> <td>notes</td> <td>text</td> <td><i> </i> </td> </tr> <tr class="tr0"> <td> <a href="#public.table.person">person.id</a> </td> <td>person_id</td> <td>integer</td> <td><i> NOT NULL </i> </td> </tr> <tr class="tr1"> <td> </td> <td>till</td> <td>character varying(20)</td> <td><i> </i> </td> </tr> <tr class="tr0"> <td> </td> <td>quonumber</td> <td>text</td> <td><i> </i> </td> </tr> <tr class="tr1"> <td> </td> <td>intnotes</td> <td>text</td> <td><i> </i> </td> </tr> <tr class="tr0"> <td> </td> <td>department_id</td> <td>integer</td> <td><i> </i> </td> </tr> <tr class="tr1"> <td> </td> <td>shipvia</td> <td>text</td> <td><i> </i> </td> </tr> <tr class="tr0"> <td> </td> <td>language_code</td> <td>character varying(6)</td> <td><i> </i> </td> </tr> <tr class="tr1"> <td> </td> <td>ponumber</td> <td>text</td> <td><i> </i> </td> </tr> <tr class="tr0"> <td> </td> <td>shippingpoint</td> <td>text</td> <td><i> </i> </td> </tr> <tr class="tr1"> <td> </td> <td>terms</td> <td>smallint</td> <td><i> </i> </td> </tr> </table> <!-- Inherits --> <!-- Constraint List --> <!-- Foreign Key Discovery --> <!-- Indexes --> ap_id_key id ap_invnumber_key invnumber ap_ordnumber_key ordnumber ap_quonumber_key quonumber ap_transdate_key transdate <!-- View Definition --> <!-- List off permissions --> <p> <a href="#index">Index</a> - <a href="#public.schema">Schema public</a> </p> <hr> <h2>Table: <a name="public.table.ar">ar</a> </h2> <table width="100%" cellspacing="0" cellpadding="3"> <caption>ar Structure</caption> <tr> <th>F-Key</th> <th>Name</th> <th>Type</th> <th>Description</th> </tr> <tr class="tr0"> <td> </td> <td>id</td> <td>serial</td> <td><i> PRIMARY KEY </i> </td> </tr> <tr class="tr1"> <td> </td> <td>invnumber</td> <td>text</td> <td><i> </i> </td> </tr> <tr class="tr0"> <td> </td> <td>transdate</td> <td>date</td> <td><i> DEFAULT ('now'::text)::date </i> </td> </tr> <tr class="tr1"> <td> <a href="#public.table.entity">entity.id</a> </td> <td>entity_id</td> <td>integer</td> <td><i> </i> <br><br> Used to be customer_id, but customer is now metadata. You need to push to entity </td> </tr> <tr class="tr0"> <td> </td> <td>taxincluded</td> <td>boolean</td> <td><i> </i> </td> </tr> <tr class="tr1"> <td> </td> <td>amount</td> <td>numeric</td> <td><i> </i> </td> </tr> <tr class="tr0"> <td> </td> <td>netamount</td> <td>numeric</td> <td><i> </i> </td> </tr> <tr class="tr1"> <td> </td> <td>paid</td> <td>numeric</td> <td><i> </i> </td> </tr> <tr class="tr0"> <td> </td> <td>datepaid</td> <td>date</td> <td><i> </i> </td> </tr> <tr class="tr1"> <td> </td> <td>duedate</td> <td>date</td> <td><i> </i> </td> </tr> <tr class="tr0"> <td> </td> <td>invoice</td> <td>boolean</td> <td><i> DEFAULT false </i> </td> </tr> <tr class="tr1"> <td> </td> <td>shippingpoint</td> <td>text</td> <td><i> </i> </td> </tr> <tr class="tr0"> <td> </td> <td>terms</td> <td>smallint</td> <td><i> </i> </td> </tr> <tr class="tr1"> <td> </td> <td>notes</td> <td>text</td> <td><i> </i> </td> </tr> <tr class="tr0"> <td> </td> <td>curr</td> <td>character(3)</td> <td><i> </i> </td> </tr> <tr class="tr1"> <td> </td> <td>ordnumber</td> <td>text</td> <td><i> </i> </td> </tr> <tr class="tr0"> <td> <a href="#public.table.person">person.id</a> </td> <td>person_id</td> <td>integer</td> <td><i> NOT NULL </i> </td> </tr> <tr class="tr1"> <td> </td> <td>till</td> <td>character varying(20)</td> <td><i> </i> </td> </tr> <tr class="tr0"> <td> </td> <td>quonumber</td> <td>text</td> <td><i> </i> </td> </tr> <tr class="tr1"> <td> </td> <td>intnotes</td> <td>text</td> <td><i> </i> </td> </tr> <tr class="tr0"> <td> </td> <td>department_id</td> <td>integer</td> <td><i> </i> </td> </tr> <tr class="tr1"> <td> </td> <td>shipvia</td> <td>text</td> <td><i> </i> </td> </tr> <tr class="tr0"> <td> </td> <td>language_code</td> <td>character varying(6)</td> <td><i> </i> </td> </tr> <tr class="tr1"> <td> </td> <td>ponumber</td> <td>text</td> <td><i> </i> </td> </tr> </table> <!-- Inherits --> <!-- Constraint List --> <!-- Foreign Key Discovery --> <!-- Indexes --> ar_id_key id ar_invnumber_key invnumber ar_ordnumber_key ordnumber ar_quonumber_key quonumber ar_transdate_key transdate <!-- View Definition --> <!-- List off permissions --> <p> <a href="#index">Index</a> - <a href="#public.schema">Schema public</a> </p> <hr> <h2>Table: <a name="public.table.assembly">assembly</a> </h2> <table width="100%" cellspacing="0" cellpadding="3"> <caption>assembly Structure</caption> <tr> <th>F-Key</th> <th>Name</th> <th>Type</th> <th>Description</th> </tr> <tr class="tr0"> <td> </td> <td>id</td> <td>integer</td> <td><i> PRIMARY KEY </i> </td> </tr> <tr class="tr1"> <td> </td> <td>parts_id</td> <td>integer</td> <td><i> PRIMARY KEY </i> </td> </tr> <tr class="tr0"> <td> </td> <td>qty</td> <td>numeric</td> <td><i> </i> </td> </tr> <tr class="tr1"> <td> </td> <td>bom</td> <td>boolean</td> <td><i> </i> </td> </tr> <tr class="tr0"> <td> </td> <td>adj</td> <td>boolean</td> <td><i> </i> </td> </tr> </table> <!-- Inherits --> <!-- Constraint List --> <!-- Foreign Key Discovery --> <!-- Indexes --> assembly_id_key id <!-- View Definition --> <!-- List off permissions --> <p> <a href="#index">Index</a> - <a href="#public.schema">Schema public</a> </p> <hr> <h2>Table: <a name="public.table.audittrail">audittrail</a> </h2> <table width="100%" cellspacing="0" cellpadding="3"> <caption>audittrail Structure</caption> <tr> <th>F-Key</th> <th>Name</th> <th>Type</th> <th>Description</th> </tr> <tr class="tr0"> <td> </td> <td>trans_id</td> <td>integer</td> <td><i> </i> </td> </tr> <tr class="tr1"> <td> </td> <td>tablename</td> <td>text</td> <td><i> </i> </td> </tr> <tr class="tr0"> <td> </td> <td>reference</td> <td>text</td> <td><i> </i> </td> </tr> <tr class="tr1"> <td> </td> <td>formname</td> <td>text</td> <td><i> </i> </td> </tr> <tr class="tr0"> <td> </td> <td>action</td> <td>text</td> <td><i> </i> </td> </tr> <tr class="tr1"> <td> </td> <td>transdate</td> <td>timestamp without time zone</td> <td><i> DEFAULT now() </i> </td> </tr> <tr class="tr0"> <td> <a href="#public.table.person">person.id</a> </td> <td>person_id</td> <td>integer</td> <td><i> NOT NULL </i> </td> </tr> <tr class="tr1"> <td> </td> <td>entry_id</td> <td>bigserial</td> <td><i> PRIMARY KEY </i> </td> </tr> </table> <!-- Inherits --> <!-- Constraint List --> <!-- Foreign Key Discovery --> <!-- Indexes --> audittrail_trans_id_key trans_id <!-- View Definition --> <!-- List off permissions --> <p> <a href="#index">Index</a> - <a href="#public.schema">Schema public</a> </p> <hr> <h2>Table: <a name="public.table.business">business</a> </h2> <table width="100%" cellspacing="0" cellpadding="3"> <caption>business Structure</caption> <tr> <th>F-Key</th> <th>Name</th> <th>Type</th> <th>Description</th> </tr> <tr class="tr0"> <td> </td> <td>id</td> <td>serial</td> <td><i> PRIMARY KEY </i> </td> </tr> <tr class="tr1"> <td> </td> <td>description</td> <td>text</td> <td><i> </i> </td> </tr> <tr class="tr0"> <td> </td> <td>discount</td> <td>numeric</td> <td><i> </i> </td> </tr> </table> <!-- Inherits --> <!-- Constraint List --> <!-- Foreign Key Discovery --> <!-- Indexes --> <!-- View Definition --> <!-- List off permissions --> <p> <a href="#index">Index</a> - <a href="#public.schema">Schema public</a> </p> <hr> <h2>Table: <a name="public.table.chart">chart</a> </h2> <table width="100%" cellspacing="0" cellpadding="3"> <caption>chart Structure</caption> <tr> <th>F-Key</th> <th>Name</th> <th>Type</th> <th>Description</th> </tr> <tr class="tr0"> <td> </td> <td>id</td> <td>serial</td> <td><i> PRIMARY KEY </i> </td> </tr> <tr class="tr1"> <td> </td> <td>accno</td> <td>text</td> <td><i> NOT NULL </i> </td> </tr> <tr class="tr0"> <td> </td> <td>description</td> <td>text</td> <td><i> </i> </td> </tr> <tr class="tr1"> <td> </td> <td>charttype</td> <td>character(1)</td> <td><i> DEFAULT 'A'::bpchar </i> </td> </tr> <tr class="tr0"> <td> </td> <td>category</td> <td>character(1)</td> <td><i> </i> </td> </tr> <tr class="tr1"> <td> </td> <td>link</td> <td>text</td> <td><i> </i> </td> </tr> <tr class="tr0"> <td> </td> <td>gifi_accno</td> <td>text</td> <td><i> </i> </td> </tr> <tr class="tr1"> <td> </td> <td>contra</td> <td>boolean</td> <td><i> DEFAULT false </i> </td> </tr> </table> <!-- Inherits --> <!-- Constraint List --> <!-- Foreign Key Discovery --> <p>Tables referencing this one via Foreign Key Constraints:</p> <ul> <li><a href="#public.table.acc-trans">acc_trans</a></li> </ul> <ul> <li><a href="#public.table.partstax">partstax</a></li> </ul> <ul> <li><a href="#public.table.tax">tax</a></li> </ul> <!-- Indexes --> chart_category_key category chart_gifi_accno_key gifi_accno chart_id_key id chart_link_key link <!-- View Definition --> <!-- List off permissions --> <p> <a href="#index">Index</a> - <a href="#public.schema">Schema public</a> </p> <hr> <h2>Table: <a name="public.table.company">company</a> </h2> <table width="100%" cellspacing="0" cellpadding="3"> <caption>company Structure</caption> <tr> <th>F-Key</th> <th>Name</th> <th>Type</th> <th>Description</th> </tr> <tr class="tr0"> <td> </td> <td>id</td> <td>serial</td> <td><i> UNIQUE NOT NULL </i> </td> </tr> <tr class="tr1"> <td> <a href="#public.table.entity">entity.id</a> </td> <td>entity_id</td> <td>integer</td> <td><i> NOT NULL </i> </td> </tr> <tr class="tr0"> <td> </td> <td>legal_name</td> <td>text</td> <td><i> PRIMARY KEY </i> </td> </tr> <tr class="tr1"> <td> <a href="#public.table.entity-class">entity_class.id</a> </td> <td>entity_class_id</td> <td>integer</td> <td><i> NOT NULL </i> </td> </tr> <tr class="tr0"> <td> <a href="#public.table.location">location.id</a> </td> <td>primary_location_id</td> <td>integer</td> <td><i> PRIMARY KEY </i> <br><br> This is the location that should show up by default for any forms </td> </tr> <tr class="tr1"> <td> </td> <td>tax_id</td> <td>text</td> <td><i> </i> <br><br> In the US this would be a EIN. </td> </tr> </table> <!-- Inherits --> <!-- Constraint List --> <p> </p> <table width="100%" cellspacing="0" cellpadding="3"> <caption>company Constraints</caption> <tr> <th>Name</th> <th>Constraint</th> </tr> <tr class="tr0"> <td>company_legal_name_check</td> <td>CHECK ((legal_name ~ '[[:alnum:]_]'::text))</td> </tr> </table> <!-- Foreign Key Discovery --> <p>Tables referencing this one via Foreign Key Constraints:</p> <ul> <li><a href="#public.table.company-to-contact">company_to_contact</a></li> </ul> <ul> <li><a href="#public.table.company-to-entity">company_to_entity</a></li> </ul> <ul> <li><a href="#public.table.company-to-location">company_to_location</a></li> </ul> <!-- Indexes --> <!-- View Definition --> <!-- List off permissions --> <p> <a href="#index">Index</a> - <a href="#public.schema">Schema public</a> </p> <hr> <h2>Table: <a name="public.table.company-to-contact">company_to_contact</a> </h2> <p> To keep track of the relationship between multiple contact methods and a single company </p> <table width="100%" cellspacing="0" cellpadding="3"> <caption>company_to_contact Structure</caption> <tr> <th>F-Key</th> <th>Name</th> <th>Type</th> <th>Description</th> </tr> <tr class="tr0"> <td> <a href="#public.table.company">company.id</a> </td> <td>company_id</td> <td>integer</td> <td><i> PRIMARY KEY </i> </td> </tr> <tr class="tr1"> <td> <a href="#public.table.contact-class">contact_class.id</a> </td> <td>contact_class_id</td> <td>integer</td> <td><i> PRIMARY KEY </i> </td> </tr> <tr class="tr0"> <td> </td> <td>contact</td> <td>text</td> <td><i> PRIMARY KEY </i> </td> </tr> </table> <!-- Inherits --> <!-- Constraint List --> <p> </p> <table width="100%" cellspacing="0" cellpadding="3"> <caption>company_to_contact Constraints</caption> <tr> <th>Name</th> <th>Constraint</th> </tr> <tr class="tr0"> <td>company_to_contact_contact_check</td> <td>CHECK ((contact ~ '[[:alnum:]_]'::text))</td> </tr> </table> <!-- Foreign Key Discovery --> <!-- Indexes --> <!-- View Definition --> <!-- List off permissions --> <p> <a href="#index">Index</a> - <a href="#public.schema">Schema public</a> </p> <hr> <h2>Table: <a name="public.table.company-to-entity">company_to_entity</a> </h2> <table width="100%" cellspacing="0" cellpadding="3"> <caption>company_to_entity Structure</caption> <tr> <th>F-Key</th> <th>Name</th> <th>Type</th> <th>Description</th> </tr> <tr class="tr0"> <td> <a href="#public.table.company">company.id</a> </td> <td>company_id</td> <td>integer</td> <td><i> PRIMARY KEY </i> </td> </tr> <tr class="tr1"> <td> <a href="#public.table.entity">entity.id</a> </td> <td>entity_id</td> <td>integer</td> <td><i> PRIMARY KEY </i> </td> </tr> <tr class="tr0"> <td> </td> <td>related_how</td> <td>text</td> <td><i> </i> </td> </tr> <tr class="tr1"> <td> </td> <td>created</td> <td>date</td> <td><i> NOT NULL DEFAULT ('now'::text)::date </i> </td> </tr> </table> <!-- Inherits --> <!-- Constraint List --> <p> </p> <table width="100%" cellspacing="0" cellpadding="3"> <caption>company_to_entity Constraints</caption> <tr> <th>Name</th> <th>Constraint</th> </tr> <tr class="tr0"> <td>company_to_entity_check</td> <td>CHECK ((entity_id <> company_id))</td> </tr> </table> <!-- Foreign Key Discovery --> <!-- Indexes --> <!-- View Definition --> <!-- List off permissions --> <p> <a href="#index">Index</a> - <a href="#public.schema">Schema public</a> </p> <hr> <h2>Table: <a name="public.table.company-to-location">company_to_location</a> </h2> <table width="100%" cellspacing="0" cellpadding="3"> <caption>company_to_location Structure</caption> <tr> <th>F-Key</th> <th>Name</th> <th>Type</th> <th>Description</th> </tr> <tr class="tr0"> <td> <a href="#public.table.location">location.id</a> </td> <td>location_id</td> <td>integer</td> <td><i> PRIMARY KEY </i> </td> </tr> <tr class="tr1"> <td> <a href="#public.table.company">company.id</a> </td> <td>company_id</td> <td>integer</td> <td><i> PRIMARY KEY </i> </td> </tr> </table> <!-- Inherits --> <!-- Constraint List --> <!-- Foreign Key Discovery --> <!-- Indexes --> <!-- View Definition --> <!-- List off permissions --> <p> <a href="#index">Index</a> - <a href="#public.schema">Schema public</a> </p> <hr> <h2>Table: <a name="public.table.contact-class">contact_class</a> </h2> <table width="100%" cellspacing="0" cellpadding="3"> <caption>contact_class Structure</caption> <tr> <th>F-Key</th> <th>Name</th> <th>Type</th> <th>Description</th> </tr> <tr class="tr0"> <td> </td> <td>id</td> <td>serial</td> <td><i> UNIQUE NOT NULL </i> </td> </tr> <tr class="tr1"> <td> </td> <td>class</td> <td>text</td> <td><i> PRIMARY KEY </i> </td> </tr> </table> <!-- Inherits --> <!-- Constraint List --> <p> </p> <table width="100%" cellspacing="0" cellpadding="3"> <caption>contact_class Constraints</caption> <tr> <th>Name</th> <th>Constraint</th> </tr> <tr class="tr0"> <td>contact_class_class_check</td> <td>CHECK (("class" ~ '[[:alnum:]_]'::text))</td> </tr> </table> <!-- Foreign Key Discovery --> <p>Tables referencing this one via Foreign Key Constraints:</p> <ul> <li><a href="#public.table.company-to-contact">company_to_contact</a></li> </ul> <ul> <li><a href="#public.table.person-to-contact">person_to_contact</a></li> </ul> <!-- Indexes --> <!-- View Definition --> <!-- List off permissions --> <p> <a href="#index">Index</a> - <a href="#public.schema">Schema public</a> </p> <hr> <h2>Table: <a name="public.table.country">country</a> </h2> <table width="100%" cellspacing="0" cellpadding="3"> <caption>country Structure</caption> <tr> <th>F-Key</th> <th>Name</th> <th>Type</th> <th>Description</th> </tr> <tr class="tr0"> <td> </td> <td>id</td> <td>serial</td> <td><i> PRIMARY KEY </i> </td> </tr> <tr class="tr1"> <td> </td> <td>name</td> <td>text</td> <td><i> NOT NULL </i> </td> </tr> <tr class="tr0"> <td> </td> <td>short_name</td> <td>text</td> <td><i> NOT NULL </i> </td> </tr> <tr class="tr1"> <td> </td> <td>itu</td> <td>text</td> <td><i> </i> <br><br> The ITU Telecommunication Standardization Sector code for calling internationally. For example, the US is 1, Great Britain is 44 </td> </tr> </table> <!-- Inherits --> <!-- Constraint List --> <p> </p> <table width="100%" cellspacing="0" cellpadding="3"> <caption>country Constraints</caption> <tr> <th>Name</th> <th>Constraint</th> </tr> <tr class="tr0"> <td>country_name_check</td> <td>CHECK ((name ~ '[[:alnum:]_]'::text))</td> </tr> <tr class="tr1"> <td>country_short_name_check</td> <td>CHECK ((short_name ~ '[[:alnum:]_]'::text))</td> </tr> </table> <!-- Foreign Key Discovery --> <p>Tables referencing this one via Foreign Key Constraints:</p> <ul> <li><a href="#public.table.location">location</a></li> </ul> <!-- Indexes --> <!-- View Definition --> <!-- List off permissions --> <p> <a href="#index">Index</a> - <a href="#public.schema">Schema public</a> </p> <hr> <h2>Table: <a name="public.table.custom-field-catalog">custom_field_catalog</a> </h2> <table width="100%" cellspacing="0" cellpadding="3"> <caption>custom_field_catalog Structure</caption> <tr> <th>F-Key</th> <th>Name</th> <th>Type</th> <th>Description</th> </tr> <tr class="tr0"> <td> </td> <td>field_id</td> <td>serial</td> <td><i> PRIMARY KEY </i> </td> </tr> <tr class="tr1"> <td> <a href="#public.table.custom-table-catalog">custom_table_catalog.table_id</a> </td> <td>table_id</td> <td>integer</td> <td><i> </i> </td> </tr> <tr class="tr0"> <td> </td> <td>field_name</td> <td>text</td> <td><i> </i> </td> </tr> </table> <!-- Inherits --> <!-- Constraint List --> <!-- Foreign Key Discovery --> <!-- Indexes --> <!-- View Definition --> <!-- List off permissions --> <p> <a href="#index">Index</a> - <a href="#public.schema">Schema public</a> </p> <hr> <h2>Table: <a name="public.table.custom-table-catalog">custom_table_catalog</a> </h2> <table width="100%" cellspacing="0" cellpadding="3"> <caption>custom_table_catalog Structure</caption> <tr> <th>F-Key</th> <th>Name</th> <th>Type</th> <th>Description</th> </tr> <tr class="tr0"> <td> </td> <td>table_id</td> <td>serial</td> <td><i> PRIMARY KEY </i> </td> </tr> <tr class="tr1"> <td> </td> <td>extends</td> <td>text</td> <td><i> </i> </td> </tr> <tr class="tr0"> <td> </td> <td>table_name</td> <td>text</td> <td><i> </i> </td> </tr> </table> <!-- Inherits --> <!-- Constraint List --> <!-- Foreign Key Discovery --> <p>Tables referencing this one via Foreign Key Constraints:</p> <ul> <li><a href="#public.table.custom-field-catalog">custom_field_catalog</a></li> </ul> <!-- Indexes --> <!-- View Definition --> <!-- List off permissions --> <p> <a href="#index">Index</a> - <a href="#public.schema">Schema public</a> </p> <hr> <h2>Table: <a name="public.table.customer">customer</a> </h2> <p> This is now a metadata table that holds information specific to customers. Source info is not part of the entity management </p> <table width="100%" cellspacing="0" cellpadding="3"> <caption>customer Structure</caption> <tr> <th>F-Key</th> <th>Name</th> <th>Type</th> <th>Description</th> </tr> <tr class="tr0"> <td> </td> <td>id</td> <td>serial</td> <td><i> PRIMARY KEY </i> </td> </tr> <tr class="tr1"> <td> <a href="#public.table.entity">entity.id</a> </td> <td>entity_id</td> <td>integer</td> <td><i> </i> <br><br> This is the relationship between entities and customers </td> </tr> <tr class="tr0"> <td> </td> <td>discount</td> <td>numeric</td> <td><i> </i> </td> </tr> <tr class="tr1"> <td> </td> <td>taxincluded</td> <td>boolean</td> <td><i> DEFAULT false </i> </td> </tr> <tr class="tr0"> <td> </td> <td>creditlimit</td> <td>numeric</td> <td><i> </i> </td> </tr> <tr class="tr1"> <td> </td> <td>terms</td> <td>smallint</td> <td><i> </i> </td> </tr> <tr class="tr0"> <td> </td> <td>customernumber</td> <td>character varying(32)</td> <td><i> </i> </td> </tr> <tr class="tr1"> <td> </td> <td>cc</td> <td>text</td> <td><i> </i> </td> </tr> <tr class="tr0"> <td> </td> <td>bcc</td> <td>text</td> <td><i> </i> </td> </tr> <tr class="tr1"> <td> </td> <td>business_id</td> <td>integer</td> <td><i> </i> </td> </tr> <tr class="tr0"> <td> </td> <td>sic_code</td> <td>character varying(6)</td> <td><i> </i> </td> </tr> <tr class="tr1"> <td> </td> <td>iban</td> <td>character varying(34)</td> <td><i> </i> </td> </tr> <tr class="tr0"> <td> </td> <td>bic</td> <td>character varying(11)</td> <td><i> </i> </td> </tr> <tr class="tr1"> <td> </td> <td>language_code</td> <td>character varying(6)</td> <td><i> </i> </td> </tr> <tr class="tr0"> <td> </td> <td>pricegroup_id</td> <td>integer</td> <td><i> </i> </td> </tr> <tr class="tr1"> <td> </td> <td>curr</td> <td>character(3)</td> <td><i> </i> </td> </tr> <tr class="tr0"> <td> </td> <td>startdate</td> <td>date</td> <td><i> DEFAULT ('now'::text)::date </i> </td> </tr> <tr class="tr1"> <td> </td> <td>enddate</td> <td>date</td> <td><i> </i> </td> </tr> <tr class="tr0"> <td> </td> <td>invoice_notes</td> <td>text</td> <td><i> </i> </td> </tr> </table> <!-- Inherits --> <!-- Constraint List --> <!-- Foreign Key Discovery --> <!-- Indexes --> customer_customernumber_key customernumber customer_id_key id <!-- View Definition --> <!-- List off permissions --> <p> <a href="#index">Index</a> - <a href="#public.schema">Schema public</a> </p> <hr> <h2>Table: <a name="public.table.customertax">customertax</a> </h2> <table width="100%" cellspacing="0" cellpadding="3"> <caption>customertax Structure</caption> <tr> <th>F-Key</th> <th>Name</th> <th>Type</th> <th>Description</th> </tr> <tr class="tr0"> <td> </td> <td>customer_id</td> <td>integer</td> <td><i> PRIMARY KEY </i> </td> </tr> <tr class="tr1"> <td> </td> <td>chart_id</td> <td>integer</td> <td><i> PRIMARY KEY </i> </td> </tr> </table> <!-- Inherits --> <!-- Constraint List --> <!-- Foreign Key Discovery --> <!-- Indexes --> customer_customer_id_key customer_id <!-- View Definition --> <!-- List off permissions --> <p> <a href="#index">Index</a> - <a href="#public.schema">Schema public</a> </p> <hr> <h2>Table: <a name="public.table.defaults">defaults</a> </h2> <table width="100%" cellspacing="0" cellpadding="3"> <caption>defaults Structure</caption> <tr> <th>F-Key</th> <th>Name</th> <th>Type</th> <th>Description</th> </tr> <tr class="tr0"> <td> </td> <td>setting_key</td> <td>text</td> <td><i> PRIMARY KEY </i> </td> </tr> <tr class="tr1"> <td> </td> <td>value</td> <td>text</td> <td><i> </i> </td> </tr> </table> <!-- Inherits --> <!-- Constraint List --> <!-- Foreign Key Discovery --> <!-- Indexes --> <!-- View Definition --> <!-- List off permissions --> <p> <a href="#index">Index</a> - <a href="#public.schema">Schema public</a> </p> <hr> <h2>Table: <a name="public.table.department">department</a> </h2> <table width="100%" cellspacing="0" cellpadding="3"> <caption>department Structure</caption> <tr> <th>F-Key</th> <th>Name</th> <th>Type</th> <th>Description</th> </tr> <tr class="tr0"> <td> </td> <td>id</td> <td>serial</td> <td><i> PRIMARY KEY </i> </td> </tr> <tr class="tr1"> <td> </td> <td>description</td> <td>text</td> <td><i> </i> </td> </tr> <tr class="tr0"> <td> </td> <td>role</td> <td>character(1)</td> <td><i> DEFAULT 'P'::bpchar </i> </td> </tr> </table> <!-- Inherits --> <!-- Constraint List --> <!-- Foreign Key Discovery --> <!-- Indexes --> department_id_key id <!-- View Definition --> <!-- List off permissions --> <p> <a href="#index">Index</a> - <a href="#public.schema">Schema public</a> </p> <hr> <h2>Table: <a name="public.table.dpt-trans">dpt_trans</a> </h2> <table width="100%" cellspacing="0" cellpadding="3"> <caption>dpt_trans Structure</caption> <tr> <th>F-Key</th> <th>Name</th> <th>Type</th> <th>Description</th> </tr> <tr class="tr0"> <td> </td> <td>trans_id</td> <td>integer</td> <td><i> PRIMARY KEY </i> </td> </tr> <tr class="tr1"> <td> </td> <td>department_id</td> <td>integer</td> <td><i> </i> </td> </tr> </table> <!-- Inherits --> <!-- Constraint List --> <!-- Foreign Key Discovery --> <!-- Indexes --> <!-- View Definition --> <!-- List off permissions --> <p> <a href="#index">Index</a> - <a href="#public.schema">Schema public</a> </p> <hr> <h2>Table: <a name="public.table.employee">employee</a> </h2> <p> Is a metadata table specific to employees </p> <table width="100%" cellspacing="0" cellpadding="3"> <caption>employee Structure</caption> <tr> <th>F-Key</th> <th>Name</th> <th>Type</th> <th>Description</th> </tr> <tr class="tr0"> <td> </td> <td>id</td> <td>serial</td> <td><i> PRIMARY KEY </i> </td> </tr> <tr class="tr1"> <td> <a href="#public.table.entity">entity.id</a> </td> <td>entity_id</td> <td>integer</td> <td><i> NOT NULL </i> </td> </tr> <tr class="tr0"> <td> </td> <td>login</td> <td>text</td> <td><i> </i> </td> </tr> <tr class="tr1"> <td> </td> <td>startdate</td> <td>date</td> <td><i> DEFAULT ('now'::text)::date </i> </td> </tr> <tr class="tr0"> <td> </td> <td>enddate</td> <td>date</td> <td><i> </i> </td> </tr> <tr class="tr1"> <td> </td> <td>notes</td> <td>text</td> <td><i> </i> </td> </tr> <tr class="tr0"> <td> </td> <td>role</td> <td>character varying(20)</td> <td><i> </i> </td> </tr> <tr class="tr1"> <td> </td> <td>sales</td> <td>boolean</td> <td><i> DEFAULT false </i> </td> </tr> <tr class="tr0"> <td> </td> <td>ssn</td> <td>character varying(20)</td> <td><i> </i> </td> </tr> <tr class="tr1"> <td> </td> <td>iban</td> <td>character varying(34)</td> <td><i> </i> </td> </tr> <tr class="tr0"> <td> </td> <td>bic</td> <td>character varying(11)</td> <td><i> </i> </td> </tr> <tr class="tr1"> <td> </td> <td>managerid</td> <td>integer</td> <td><i> </i> </td> </tr> <tr class="tr0"> <td> </td> <td>employeenumber</td> <td>character varying(32)</td> <td><i> </i> </td> </tr> <tr class="tr1"> <td> </td> <td>dob</td> <td>date</td> <td><i> </i> </td> </tr> </table> <!-- Inherits --> <!-- Constraint List --> <!-- Foreign Key Discovery --> <!-- Indexes --> <!-- View Definition --> <!-- List off permissions --> <p> <a href="#index">Index</a> - <a href="#public.schema">Schema public</a> </p> <hr> <h2>Table: <a name="public.table.entity">entity</a> </h2> <p> The primary entity table to map to all contacts </p> <table width="100%" cellspacing="0" cellpadding="3"> <caption>entity Structure</caption> <tr> <th>F-Key</th> <th>Name</th> <th>Type</th> <th>Description</th> </tr> <tr class="tr0"> <td> </td> <td>id</td> <td>serial</td> <td><i> PRIMARY KEY </i> </td> </tr> <tr class="tr1"> <td> </td> <td>name</td> <td>text</td> <td><i> </i> <br><br> This is the common name of an entity. If it was a person it may be Joshua Drake, a company Acme Corp. You may also choose to use a domain such as commandprompt.com </td> </tr> <tr class="tr0"> <td> <a href="#public.table.entity-class">entity_class.id</a> </td> <td>entity_class</td> <td>integer</td> <td><i> NOT NULL </i> </td> </tr> </table> <!-- Inherits --> <!-- Constraint List --> <p> </p> <table width="100%" cellspacing="0" cellpadding="3"> <caption>entity Constraints</caption> <tr> <th>Name</th> <th>Constraint</th> </tr> <tr class="tr0"> <td>entity_name_check</td> <td>CHECK ((name ~ '[[:alnum:]_]'::text))</td> </tr> </table> <!-- Foreign Key Discovery --> <p>Tables referencing this one via Foreign Key Constraints:</p> <ul> <li><a href="#public.table.ap">ap</a></li> </ul> <ul> <li><a href="#public.table.ar">ar</a></li> </ul> <ul> <li><a href="#public.table.company">company</a></li> </ul> <ul> <li><a href="#public.table.company-to-entity">company_to_entity</a></li> </ul> <ul> <li><a href="#public.table.customer">customer</a></li> </ul> <ul> <li><a href="#public.table.employee">employee</a></li> </ul> <ul> <li><a href="#public.table.entity-class-to-entity">entity_class_to_entity</a></li> </ul> <ul> <li><a href="#public.table.entity-other-name">entity_other_name</a></li> </ul> <ul> <li><a href="#public.table.oe">oe</a></li> </ul> <ul> <li><a href="#public.table.partsvendor">partsvendor</a></li> </ul> <ul> <li><a href="#public.table.person">person</a></li> </ul> <ul> <li><a href="#public.table.person-to-entity">person_to_entity</a></li> </ul> <ul> <li><a href="#public.table.vendor">vendor</a></li> </ul> <!-- Indexes --> <!-- View Definition --> <!-- List off permissions --> <p> <a href="#index">Index</a> - <a href="#public.schema">Schema public</a> </p> <hr> <h2>Table: <a name="public.table.entity-class">entity_class</a> </h2> <p> Defines the class type such as vendor, customer, contact, employee </p> <table width="100%" cellspacing="0" cellpadding="3"> <caption>entity_class Structure</caption> <tr> <th>F-Key</th> <th>Name</th> <th>Type</th> <th>Description</th> </tr> <tr class="tr0"> <td> </td> <td>id</td> <td>serial</td> <td><i> PRIMARY KEY </i> <br><br> The first 7 values are reserved and permanent </td> </tr> <tr class="tr1"> <td> </td> <td>class</td> <td>text</td> <td><i> NOT NULL </i> </td> </tr> <tr class="tr0"> <td> </td> <td>active</td> <td>boolean</td> <td><i> NOT NULL DEFAULT true </i> </td> </tr> </table> <!-- Inherits --> <!-- Constraint List --> <p> </p> <table width="100%" cellspacing="0" cellpadding="3"> <caption>entity_class Constraints</caption> <tr> <th>Name</th> <th>Constraint</th> </tr> <tr class="tr0"> <td>entity_class_class_check</td> <td>CHECK (("class" ~ '[[:alnum:]_]'::text))</td> </tr> </table> <!-- Foreign Key Discovery --> <p>Tables referencing this one via Foreign Key Constraints:</p> <ul> <li><a href="#public.table.company">company</a></li> </ul> <ul> <li><a href="#public.table.entity">entity</a></li> </ul> <ul> <li><a href="#public.table.entity-class-to-entity">entity_class_to_entity</a></li> </ul> <!-- Indexes --> <!-- View Definition --> <!-- List off permissions --> <p> <a href="#index">Index</a> - <a href="#public.schema">Schema public</a> </p> <hr> <h2>Table: <a name="public.table.entity-class-to-entity">entity_class_to_entity</a> </h2> <p> Relation builder for classes to entity </p> <table width="100%" cellspacing="0" cellpadding="3"> <caption>entity_class_to_entity Structure</caption> <tr> <th>F-Key</th> <th>Name</th> <th>Type</th> <th>Description</th> </tr> <tr class="tr0"> <td> <a href="#public.table.entity-class">entity_class.id</a> </td> <td>entity_class_id</td> <td>integer</td> <td><i> PRIMARY KEY </i> </td> </tr> <tr class="tr1"> <td> <a href="#public.table.entity">entity.id</a> </td> <td>entity_id</td> <td>integer</td> <td><i> PRIMARY KEY </i> </td> </tr> </table> <!-- Inherits --> <!-- Constraint List --> <!-- Foreign Key Discovery --> <!-- Indexes --> <!-- View Definition --> <!-- List off permissions --> <p> <a href="#index">Index</a> - <a href="#public.schema">Schema public</a> </p> <hr> <h2>Table: <a name="public.table.entity-other-name">entity_other_name</a> </h2> <p> Similar to company_other_name, a person may be jd, Joshua Drake, linuxpoet... all are the same person. </p> <table width="100%" cellspacing="0" cellpadding="3"> <caption>entity_other_name Structure</caption> <tr> <th>F-Key</th> <th>Name</th> <th>Type</th> <th>Description</th> </tr> <tr class="tr0"> <td> <a href="#public.table.entity">entity.id</a> </td> <td>entity_id</td> <td>integer</td> <td><i> PRIMARY KEY </i> </td> </tr> <tr class="tr1"> <td> </td> <td>other_name</td> <td>text</td> <td><i> PRIMARY KEY </i> </td> </tr> </table> <!-- Inherits --> <!-- Constraint List --> <p> </p> <table width="100%" cellspacing="0" cellpadding="3"> <caption>entity_other_name Constraints</caption> <tr> <th>Name</th> <th>Constraint</th> </tr> <tr class="tr0"> <td>entity_other_name_other_name_check</td> <td>CHECK ((other_name ~ '[[:alnum:]_]'::text))</td> </tr> </table> <!-- Foreign Key Discovery --> <!-- Indexes --> <!-- View Definition --> <!-- List off permissions --> <p> <a href="#index">Index</a> - <a href="#public.schema">Schema public</a> </p> <hr> <h2>Table: <a name="public.table.exchangerate">exchangerate</a> </h2> <table width="100%" cellspacing="0" cellpadding="3"> <caption>exchangerate Structure</caption> <tr> <th>F-Key</th> <th>Name</th> <th>Type</th> <th>Description</th> </tr> <tr class="tr0"> <td> </td> <td>curr</td> <td>character(3)</td> <td><i> PRIMARY KEY </i> </td> </tr> <tr class="tr1"> <td> </td> <td>transdate</td> <td>date</td> <td><i> PRIMARY KEY </i> </td> </tr> <tr class="tr0"> <td> </td> <td>buy</td> <td>numeric</td> <td><i> </i> </td> </tr> <tr class="tr1"> <td> </td> <td>sell</td> <td>numeric</td> <td><i> </i> </td> </tr> </table> <!-- Inherits --> <!-- Constraint List --> <!-- Foreign Key Discovery --> <!-- Indexes --> exchangerate_ct_key curr, transdate <!-- View Definition --> <!-- List off permissions --> <p> <a href="#index">Index</a> - <a href="#public.schema">Schema public</a> </p> <hr> <h2>Table: <a name="public.table.gifi">gifi</a> </h2> <table width="100%" cellspacing="0" cellpadding="3"> <caption>gifi Structure</caption> <tr> <th>F-Key</th> <th>Name</th> <th>Type</th> <th>Description</th> </tr> <tr class="tr0"> <td> </td> <td>accno</td> <td>text</td> <td><i> PRIMARY KEY </i> </td> </tr> <tr class="tr1"> <td> </td> <td>description</td> <td>text</td> <td><i> </i> </td> </tr> </table> <!-- Inherits --> <!-- Constraint List --> <!-- Foreign Key Discovery --> <!-- Indexes --> <!-- View Definition --> <!-- List off permissions --> <p> <a href="#index">Index</a> - <a href="#public.schema">Schema public</a> </p> <hr> <h2>Table: <a name="public.table.gl">gl</a> </h2> <table width="100%" cellspacing="0" cellpadding="3"> <caption>gl Structure</caption> <tr> <th>F-Key</th> <th>Name</th> <th>Type</th> <th>Description</th> </tr> <tr class="tr0"> <td> </td> <td>id</td> <td>serial</td> <td><i> PRIMARY KEY </i> </td> </tr> <tr class="tr1"> <td> </td> <td>reference</td> <td>text</td> <td><i> </i> </td> </tr> <tr class="tr0"> <td> </td> <td>description</td> <td>text</td> <td><i> </i> </td> </tr> <tr class="tr1"> <td> </td> <td>transdate</td> <td>date</td> <td><i> DEFAULT ('now'::text)::date </i> </td> </tr> <tr class="tr0"> <td> <a href="#public.table.person">person.id</a> </td> <td>person_id</td> <td>integer</td> <td><i> </i> </td> </tr> <tr class="tr1"> <td> </td> <td>notes</td> <td>text</td> <td><i> </i> </td> </tr> <tr class="tr0"> <td> </td> <td>department_id</td> <td>integer</td> <td><i> </i> </td> </tr> </table> <!-- Inherits --> <!-- Constraint List --> <!-- Foreign Key Discovery --> <!-- Indexes --> gl_description_key lower(description) gl_id_key id gl_reference_key reference gl_transdate_key transdate <!-- View Definition --> <!-- List off permissions --> <p> <a href="#index">Index</a> - <a href="#public.schema">Schema public</a> </p> <hr> <h2>Table: <a name="public.table.inventory">inventory</a> </h2> <table width="100%" cellspacing="0" cellpadding="3"> <caption>inventory Structure</caption> <tr> <th>F-Key</th> <th>Name</th> <th>Type</th> <th>Description</th> </tr> <tr class="tr0"> <td> </td> <td>warehouse_id</td> <td>integer</td> <td><i> </i> </td> </tr> <tr class="tr1"> <td> </td> <td>parts_id</td> <td>integer</td> <td><i> </i> </td> </tr> <tr class="tr0"> <td> </td> <td>trans_id</td> <td>integer</td> <td><i> </i> </td> </tr> <tr class="tr1"> <td> </td> <td>orderitems_id</td> <td>integer</td> <td><i> </i> </td> </tr> <tr class="tr0"> <td> </td> <td>qty</td> <td>numeric</td> <td><i> </i> </td> </tr> <tr class="tr1"> <td> </td> <td>shippingdate</td> <td>date</td> <td><i> </i> </td> </tr> <tr class="tr0"> <td> <a href="#public.table.person">person.id</a> </td> <td>person_id</td> <td>integer</td> <td><i> NOT NULL </i> </td> </tr> <tr class="tr1"> <td> </td> <td>entry_id</td> <td>serial</td> <td><i> PRIMARY KEY </i> </td> </tr> </table> <!-- Inherits --> <!-- Constraint List --> <!-- Foreign Key Discovery --> <!-- Indexes --> <!-- View Definition --> <!-- List off permissions --> <p> <a href="#index">Index</a> - <a href="#public.schema">Schema public</a> </p> <hr> <h2>Table: <a name="public.table.invoice">invoice</a> </h2> <table width="100%" cellspacing="0" cellpadding="3"> <caption>invoice Structure</caption> <tr> <th>F-Key</th> <th>Name</th> <th>Type</th> <th>Description</th> </tr> <tr class="tr0"> <td> </td> <td>id</td> <td>serial</td> <td><i> PRIMARY KEY </i> </td> </tr> <tr class="tr1"> <td> </td> <td>trans_id</td> <td>integer</td> <td><i> </i> </td> </tr> <tr class="tr0"> <td> </td> <td>parts_id</td> <td>integer</td> <td><i> </i> </td> </tr> <tr class="tr1"> <td> </td> <td>description</td> <td>text</td> <td><i> </i> </td> </tr> <tr class="tr0"> <td> </td> <td>qty</td> <td>integer</td> <td><i> </i> </td> </tr> <tr class="tr1"> <td> </td> <td>allocated</td> <td>integer</td> <td><i> </i> </td> </tr> <tr class="tr0"> <td> </td> <td>sellprice</td> <td>numeric</td> <td><i> </i> </td> </tr> <tr class="tr1"> <td> </td> <td>fxsellprice</td> <td>numeric</td> <td><i> </i> </td> </tr> <tr class="tr0"> <td> </td> <td>discount</td> <td>real</td> <td><i> </i> </td> </tr> <tr class="tr1"> <td> </td> <td>assemblyitem</td> <td>boolean</td> <td><i> DEFAULT false </i> </td> </tr> <tr class="tr0"> <td> </td> <td>unit</td> <td>character varying(5)</td> <td><i> </i> </td> </tr> <tr class="tr1"> <td> </td> <td>project_id</td> <td>integer</td> <td><i> </i> </td> </tr> <tr class="tr0"> <td> </td> <td>deliverydate</td> <td>date</td> <td><i> </i> </td> </tr> <tr class="tr1"> <td> </td> <td>serialnumber</td> <td>text</td> <td><i> </i> </td> </tr> <tr class="tr0"> <td> </td> <td>notes</td> <td>text</td> <td><i> </i> </td> </tr> </table> <!-- Inherits --> <!-- Constraint List --> <!-- Foreign Key Discovery --> <!-- Indexes --> invoice_id_key id invoice_trans_id_key trans_id <!-- View Definition --> <!-- List off permissions --> <p> <a href="#index">Index</a> - <a href="#public.schema">Schema public</a> </p> <hr> <h2>Table: <a name="public.table.jcitems">jcitems</a> </h2> <table width="100%" cellspacing="0" cellpadding="3"> <caption>jcitems Structure</caption> <tr> <th>F-Key</th> <th>Name</th> <th>Type</th> <th>Description</th> </tr> <tr class="tr0"> <td> </td> <td>id</td> <td>serial</td> <td><i> PRIMARY KEY </i> </td> </tr> <tr class="tr1"> <td> </td> <td>project_id</td> <td>integer</td> <td><i> </i> </td> </tr> <tr class="tr0"> <td> </td> <td>parts_id</td> <td>integer</td> <td><i> </i> </td> </tr> <tr class="tr1"> <td> </td> <td>description</td> <td>text</td> <td><i> </i> </td> </tr> <tr class="tr0"> <td> </td> <td>qty</td> <td>numeric</td> <td><i> </i> </td> </tr> <tr class="tr1"> <td> </td> <td>allocated</td> <td>numeric</td> <td><i> </i> </td> </tr> <tr class="tr0"> <td> </td> <td>sellprice</td> <td>numeric</td> <td><i> </i> </td> </tr> <tr class="tr1"> <td> </td> <td>fxsellprice</td> <td>numeric</td> <td><i> </i> </td> </tr> <tr class="tr0"> <td> </td> <td>serialnumber</td> <td>text</td> <td><i> </i> </td> </tr> <tr class="tr1"> <td> </td> <td>checkedin</td> <td>timestamp with time zone</td> <td><i> </i> </td> </tr> <tr class="tr0"> <td> </td> <td>checkedout</td> <td>timestamp with time zone</td> <td><i> </i> </td> </tr> <tr class="tr1"> <td> <a href="#public.table.person">person.id</a> </td> <td>person_id</td> <td>integer</td> <td><i> NOT NULL </i> </td> </tr> <tr class="tr0"> <td> </td> <td>notes</td> <td>text</td> <td><i> </i> </td> </tr> </table> <!-- Inherits --> <!-- Constraint List --> <!-- Foreign Key Discovery --> <!-- Indexes --> jcitems_id_key id <!-- View Definition --> <!-- List off permissions --> <p> <a href="#index">Index</a> - <a href="#public.schema">Schema public</a> </p> <hr> <h2>Table: <a name="public.table.language">language</a> </h2> <table width="100%" cellspacing="0" cellpadding="3"> <caption>language Structure</caption> <tr> <th>F-Key</th> <th>Name</th> <th>Type</th> <th>Description</th> </tr> <tr class="tr0"> <td> </td> <td>code</td> <td>character varying(6)</td> <td><i> PRIMARY KEY </i> </td> </tr> <tr class="tr1"> <td> </td> <td>description</td> <td>text</td> <td><i> </i> </td> </tr> </table> <!-- Inherits --> <!-- Constraint List --> <!-- Foreign Key Discovery --> <!-- Indexes --> <!-- View Definition --> <!-- List off permissions --> <p> <a href="#index">Index</a> - <a href="#public.schema">Schema public</a> </p> <hr> <h2>Table: <a name="public.table.location">location</a> </h2> <table width="100%" cellspacing="0" cellpadding="3"> <caption>location Structure</caption> <tr> <th>F-Key</th> <th>Name</th> <th>Type</th> <th>Description</th> </tr> <tr class="tr0"> <td> </td> <td>id</td> <td>serial</td> <td><i> PRIMARY KEY </i> </td> </tr> <tr class="tr1"> <td> </td> <td>line_one</td> <td>text</td> <td><i> NOT NULL </i> </td> </tr> <tr class="tr0"> <td> </td> <td>line_two</td> <td>text</td> <td><i> </i> </td> </tr> <tr class="tr1"> <td> </td> <td>line_three</td> <td>text</td> <td><i> </i> </td> </tr> <tr class="tr0"> <td> </td> <td>city_province</td> <td>text</td> <td><i> NOT NULL </i> </td> </tr> <tr class="tr1"> <td> <a href="#public.table.country">country.id</a> </td> <td>country_id</td> <td>integer</td> <td><i> NOT NULL </i> </td> </tr> <tr class="tr0"> <td> </td> <td>mail_code</td> <td>text</td> <td><i> NOT NULL </i> </td> </tr> </table> <!-- Inherits --> <!-- Constraint List --> <p> </p> <table width="100%" cellspacing="0" cellpadding="3"> <caption>location Constraints</caption> <tr> <th>Name</th> <th>Constraint</th> </tr> <tr class="tr0"> <td>location_city_province_check</td> <td>CHECK ((city_province ~ '[[:alnum:]_]'::text))</td> </tr> <tr class="tr1"> <td>location_line_one_check</td> <td>CHECK ((line_one ~ '[[:alnum:]_]'::text))</td> </tr> <tr class="tr0"> <td>location_mail_code_check</td> <td>CHECK ((mail_code ~ '[[:alnum:]_]'::text))</td> </tr> </table> <!-- Foreign Key Discovery --> <p>Tables referencing this one via Foreign Key Constraints:</p> <ul> <li><a href="#public.table.company">company</a></li> </ul> <ul> <li><a href="#public.table.company-to-location">company_to_location</a></li> </ul> <ul> <li><a href="#public.table.person">person</a></li> </ul> <ul> <li><a href="#public.table.person-to-company">person_to_company</a></li> </ul> <!-- Indexes --> <!-- View Definition --> <!-- List off permissions --> <p> <a href="#index">Index</a> - <a href="#public.schema">Schema public</a> </p> <hr> <h2>Table: <a name="public.table.makemodel">makemodel</a> </h2> <table width="100%" cellspacing="0" cellpadding="3"> <caption>makemodel Structure</caption> <tr> <th>F-Key</th> <th>Name</th> <th>Type</th> <th>Description</th> </tr> <tr class="tr0"> <td> </td> <td>parts_id</td> <td>integer</td> <td><i> PRIMARY KEY </i> </td> </tr> <tr class="tr1"> <td> </td> <td>make</td> <td>text</td> <td><i> </i> </td> </tr> <tr class="tr0"> <td> </td> <td>model</td> <td>text</td> <td><i> </i> </td> </tr> </table> <!-- Inherits --> <!-- Constraint List --> <!-- Foreign Key Discovery --> <!-- Indexes --> makemodel_make_key lower(make) makemodel_model_key lower(model) makemodel_parts_id_key parts_id <!-- View Definition --> <!-- List off permissions --> <p> <a href="#index">Index</a> - <a href="#public.schema">Schema public</a> </p> <hr> <h2>Table: <a name="public.table.oe">oe</a> </h2> <table width="100%" cellspacing="0" cellpadding="3"> <caption>oe Structure</caption> <tr> <th>F-Key</th> <th>Name</th> <th>Type</th> <th>Description</th> </tr> <tr class="tr0"> <td> </td> <td>id</td> <td>serial</td> <td><i> PRIMARY KEY </i> </td> </tr> <tr class="tr1"> <td> </td> <td>ordnumber</td> <td>text</td> <td><i> </i> </td> </tr> <tr class="tr0"> <td> </td> <td>transdate</td> <td>date</td> <td><i> DEFAULT ('now'::text)::date </i> </td> </tr> <tr class="tr1"> <td> <a href="#public.table.entity">entity.id</a> </td> <td>entity_id</td> <td>integer</td> <td><i> NOT NULL </i> </td> </tr> <tr class="tr0"> <td> </td> <td>amount</td> <td>numeric</td> <td><i> </i> </td> </tr> <tr class="tr1"> <td> </td> <td>netamount</td> <td>numeric</td> <td><i> </i> </td> </tr> <tr class="tr0"> <td> </td> <td>reqdate</td> <td>date</td> <td><i> </i> </td> </tr> <tr class="tr1"> <td> </td> <td>taxincluded</td> <td>boolean</td> <td><i> </i> </td> </tr> <tr class="tr0"> <td> </td> <td>shippingpoint</td> <td>text</td> <td><i> </i> </td> </tr> <tr class="tr1"> <td> </td> <td>notes</td> <td>text</td> <td><i> </i> </td> </tr> <tr class="tr0"> <td> </td> <td>curr</td> <td>character(3)</td> <td><i> </i> </td> </tr> <tr class="tr1"> <td> <a href="#public.table.person">person.id</a> </td> <td>person_id</td> <td>integer</td> <td><i> NOT NULL </i> </td> </tr> <tr class="tr0"> <td> </td> <td>closed</td> <td>boolean</td> <td><i> DEFAULT false </i> </td> </tr> <tr class="tr1"> <td> </td> <td>quotation</td> <td>boolean</td> <td><i> DEFAULT false </i> </td> </tr> <tr class="tr0"> <td> </td> <td>quonumber</td> <td>text</td> <td><i> </i> </td> </tr> <tr class="tr1"> <td> </td> <td>intnotes</td> <td>text</td> <td><i> </i> </td> </tr> <tr class="tr0"> <td> </td> <td>department_id</td> <td>integer</td> <td><i> </i> </td> </tr> <tr class="tr1"> <td> </td> <td>shipvia</td> <td>text</td> <td><i> </i> </td> </tr> <tr class="tr0"> <td> </td> <td>language_code</td> <td>character varying(6)</td> <td><i> </i> </td> </tr> <tr class="tr1"> <td> </td> <td>ponumber</td> <td>text</td> <td><i> </i> </td> </tr> <tr class="tr0"> <td> </td> <td>terms</td> <td>smallint</td> <td><i> </i> </td> </tr> <tr class="tr1"> <td> <a href="#public.table.oe-class">oe_class.id</a> </td> <td>oe_class_id</td> <td>integer</td> <td><i> NOT NULL </i> </td> </tr> </table> <!-- Inherits --> <!-- Constraint List --> <!-- Foreign Key Discovery --> <!-- Indexes --> oe_id_key id oe_ordnumber_key ordnumber oe_transdate_key transdate <!-- View Definition --> <!-- List off permissions --> <p> <a href="#index">Index</a> - <a href="#public.schema">Schema public</a> </p> <hr> <h2>Table: <a name="public.table.oe-class">oe_class</a> </h2> <p> This could probably be done better. But I need to remove the customer_id/vendor_id relationship and instead rely on a classification </p> <table width="100%" cellspacing="0" cellpadding="3"> <caption>oe_class Structure</caption> <tr> <th>F-Key</th> <th>Name</th> <th>Type</th> <th>Description</th> </tr> <tr class="tr0"> <td> </td> <td>id</td> <td>smallint</td> <td><i> UNIQUE </i> </td> </tr> <tr class="tr1"> <td> </td> <td>oe_class</td> <td>text</td> <td><i> PRIMARY KEY </i> </td> </tr> </table> <!-- Inherits --> <!-- Constraint List --> <p> </p> <table width="100%" cellspacing="0" cellpadding="3"> <caption>oe_class Constraints</caption> <tr> <th>Name</th> <th>Constraint</th> </tr> <tr class="tr0"> <td>oe_class_id_check</td> <td>CHECK (((id = 1) OR (id = 2)))</td> </tr> </table> <!-- Foreign Key Discovery --> <p>Tables referencing this one via Foreign Key Constraints:</p> <ul> <li><a href="#public.table.oe">oe</a></li> </ul> <!-- Indexes --> <!-- View Definition --> <!-- List off permissions --> <p> <a href="#index">Index</a> - <a href="#public.schema">Schema public</a> </p> <hr> <h2>Table: <a name="public.table.orderitems">orderitems</a> </h2> <table width="100%" cellspacing="0" cellpadding="3"> <caption>orderitems Structure</caption> <tr> <th>F-Key</th> <th>Name</th> <th>Type</th> <th>Description</th> </tr> <tr class="tr0"> <td> </td> <td>id</td> <td>serial</td> <td><i> PRIMARY KEY </i> </td> </tr> <tr class="tr1"> <td> </td> <td>trans_id</td> <td>integer</td> <td><i> </i> </td> </tr> <tr class="tr0"> <td> </td> <td>parts_id</td> <td>integer</td> <td><i> </i> </td> </tr> <tr class="tr1"> <td> </td> <td>description</td> <td>text</td> <td><i> </i> </td> </tr> <tr class="tr0"> <td> </td> <td>qty</td> <td>numeric</td> <td><i> </i> </td> </tr> <tr class="tr1"> <td> </td> <td>sellprice</td> <td>numeric</td> <td><i> </i> </td> </tr> <tr class="tr0"> <td> </td> <td>discount</td> <td>numeric</td> <td><i> </i> </td> </tr> <tr class="tr1"> <td> </td> <td>unit</td> <td>character varying(5)</td> <td><i> </i> </td> </tr> <tr class="tr0"> <td> </td> <td>project_id</td> <td>integer</td> <td><i> </i> </td> </tr> <tr class="tr1"> <td> </td> <td>reqdate</td> <td>date</td> <td><i> </i> </td> </tr> <tr class="tr0"> <td> </td> <td>ship</td> <td>numeric</td> <td><i> </i> </td> </tr> <tr class="tr1"> <td> </td> <td>serialnumber</td> <td>text</td> <td><i> </i> </td> </tr> <tr class="tr0"> <td> </td> <td>notes</td> <td>text</td> <td><i> </i> </td> </tr> </table> <!-- Inherits --> <!-- Constraint List --> <!-- Foreign Key Discovery --> <!-- Indexes --> orderitems_id_key id orderitems_trans_id_key trans_id <!-- View Definition --> <!-- List off permissions --> <p> <a href="#index">Index</a> - <a href="#public.schema">Schema public</a> </p> <hr> <h2>Table: <a name="public.table.parts">parts</a> </h2> <table width="100%" cellspacing="0" cellpadding="3"> <caption>parts Structure</caption> <tr> <th>F-Key</th> <th>Name</th> <th>Type</th> <th>Description</th> </tr> <tr class="tr0"> <td> </td> <td>id</td> <td>serial</td> <td><i> PRIMARY KEY </i> </td> </tr> <tr class="tr1"> <td> </td> <td>partnumber</td> <td>text</td> <td><i> </i> </td> </tr> <tr class="tr0"> <td> </td> <td>description</td> <td>text</td> <td><i> </i> </td> </tr> <tr class="tr1"> <td> </td> <td>unit</td> <td>character varying(5)</td> <td><i> </i> </td> </tr> <tr class="tr0"> <td> </td> <td>listprice</td> <td>numeric</td> <td><i> </i> </td> </tr> <tr class="tr1"> <td> </td> <td>sellprice</td> <td>numeric</td> <td><i> </i> </td> </tr> <tr class="tr0"> <td> </td> <td>lastcost</td> <td>numeric</td> <td><i> </i> </td> </tr> <tr class="tr1"> <td> </td> <td>priceupdate</td> <td>date</td> <td><i> DEFAULT ('now'::text)::date </i> </td> </tr> <tr class="tr0"> <td> </td> <td>weight</td> <td>numeric</td> <td><i> </i> </td> </tr> <tr class="tr1"> <td> </td> <td>onhand</td> <td>numeric</td> <td><i> </i> </td> </tr> <tr class="tr0"> <td> </td> <td>notes</td> <td>text</td> <td><i> </i> </td> </tr> <tr class="tr1"> <td> </td> <td>makemodel</td> <td>boolean</td> <td><i> DEFAULT false </i> </td> </tr> <tr class="tr0"> <td> </td> <td>assembly</td> <td>boolean</td> <td><i> DEFAULT false </i> </td> </tr> <tr class="tr1"> <td> </td> <td>alternate</td> <td>boolean</td> <td><i> DEFAULT false </i> </td> </tr> <tr class="tr0"> <td> </td> <td>rop</td> <td>real</td> <td><i> </i> </td> </tr> <tr class="tr1"> <td> </td> <td>inventory_accno_id</td> <td>integer</td> <td><i> </i> </td> </tr> <tr class="tr0"> <td> </td> <td>income_accno_id</td> <td>integer</td> <td><i> </i> </td> </tr> <tr class="tr1"> <td> </td> <td>expense_accno_id</td> <td>integer</td> <td><i> </i> </td> </tr> <tr class="tr0"> <td> </td> <td>bin</td> <td>text</td> <td><i> </i> </td> </tr> <tr class="tr1"> <td> </td> <td>obsolete</td> <td>boolean</td> <td><i> DEFAULT false </i> </td> </tr> <tr class="tr0"> <td> </td> <td>bom</td> <td>boolean</td> <td><i> DEFAULT false </i> </td> </tr> <tr class="tr1"> <td> </td> <td>image</td> <td>text</td> <td><i> </i> </td> </tr> <tr class="tr0"> <td> </td> <td>drawing</td> <td>text</td> <td><i> </i> </td> </tr> <tr class="tr1"> <td> </td> <td>microfiche</td> <td>text</td> <td><i> </i> </td> </tr> <tr class="tr0"> <td> </td> <td>partsgroup_id</td> <td>integer</td> <td><i> </i> </td> </tr> <tr class="tr1"> <td> </td> <td>project_id</td> <td>integer</td> <td><i> </i> </td> </tr> <tr class="tr0"> <td> </td> <td>avgcost</td> <td>numeric</td> <td><i> </i> </td> </tr> </table> <!-- Inherits --> <!-- Constraint List --> <!-- Foreign Key Discovery --> <p>Tables referencing this one via Foreign Key Constraints:</p> <ul> <li><a href="#public.table.partstax">partstax</a></li> </ul> <!-- Indexes --> parts_description_key lower(description) parts_id_key id parts_partnumber_key lower(partnumber) <!-- View Definition --> <!-- List off permissions --> <p> <a href="#index">Index</a> - <a href="#public.schema">Schema public</a> </p> <hr> <h2>Table: <a name="public.table.partscustomer">partscustomer</a> </h2> <table width="100%" cellspacing="0" cellpadding="3"> <caption>partscustomer Structure</caption> <tr> <th>F-Key</th> <th>Name</th> <th>Type</th> <th>Description</th> </tr> <tr class="tr0"> <td> </td> <td>parts_id</td> <td>integer</td> <td><i> </i> </td> </tr> <tr class="tr1"> <td> </td> <td>customer_id</td> <td>integer</td> <td><i> </i> </td> </tr> <tr class="tr0"> <td> </td> <td>pricegroup_id</td> <td>integer</td> <td><i> </i> </td> </tr> <tr class="tr1"> <td> </td> <td>pricebreak</td> <td>numeric</td> <td><i> </i> </td> </tr> <tr class="tr0"> <td> </td> <td>sellprice</td> <td>numeric</td> <td><i> </i> </td> </tr> <tr class="tr1"> <td> </td> <td>validfrom</td> <td>date</td> <td><i> </i> </td> </tr> <tr class="tr0"> <td> </td> <td>validto</td> <td>date</td> <td><i> </i> </td> </tr> <tr class="tr1"> <td> </td> <td>curr</td> <td>character(3)</td> <td><i> </i> </td> </tr> <tr class="tr0"> <td> </td> <td>entry_id</td> <td>serial</td> <td><i> PRIMARY KEY </i> </td> </tr> </table> <!-- Inherits --> <!-- Constraint List --> <!-- Foreign Key Discovery --> <!-- Indexes --> <!-- View Definition --> <!-- List off permissions --> <p> <a href="#index">Index</a> - <a href="#public.schema">Schema public</a> </p> <hr> <h2>Table: <a name="public.table.partsgroup">partsgroup</a> </h2> <table width="100%" cellspacing="0" cellpadding="3"> <caption>partsgroup Structure</caption> <tr> <th>F-Key</th> <th>Name</th> <th>Type</th> <th>Description</th> </tr> <tr class="tr0"> <td> </td> <td>id</td> <td>serial</td> <td><i> PRIMARY KEY </i> </td> </tr> <tr class="tr1"> <td> </td> <td>partsgroup</td> <td>text</td> <td><i> </i> </td> </tr> </table> <!-- Inherits --> <!-- Constraint List --> <!-- Foreign Key Discovery --> <!-- Indexes --> partsgroup_id_key id <!-- View Definition --> <!-- List off permissions --> <p> <a href="#index">Index</a> - <a href="#public.schema">Schema public</a> </p> <hr> <h2>Table: <a name="public.table.partstax">partstax</a> </h2> <table width="100%" cellspacing="0" cellpadding="3"> <caption>partstax Structure</caption> <tr> <th>F-Key</th> <th>Name</th> <th>Type</th> <th>Description</th> </tr> <tr class="tr0"> <td> <a href="#public.table.parts">parts.id</a> </td> <td>parts_id</td> <td>integer</td> <td><i> PRIMARY KEY </i> </td> </tr> <tr class="tr1"> <td> <a href="#public.table.chart">chart.id</a> </td> <td>chart_id</td> <td>integer</td> <td><i> PRIMARY KEY </i> </td> </tr> <tr class="tr0"> <td> <a href="#public.table.taxcategory">taxcategory.taxcategory_id</a> </td> <td>taxcategory_id</td> <td>integer</td> <td><i> </i> </td> </tr> </table> <!-- Inherits --> <!-- Constraint List --> <!-- Foreign Key Discovery --> <!-- Indexes --> partstax_parts_id_key parts_id <!-- View Definition --> <!-- List off permissions --> <p> <a href="#index">Index</a> - <a href="#public.schema">Schema public</a> </p> <hr> <h2>Table: <a name="public.table.partsvendor">partsvendor</a> </h2> <table width="100%" cellspacing="0" cellpadding="3"> <caption>partsvendor Structure</caption> <tr> <th>F-Key</th> <th>Name</th> <th>Type</th> <th>Description</th> </tr> <tr class="tr0"> <td> <a href="#public.table.entity">entity.id</a> </td> <td>entity_id</td> <td>integer</td> <td><i> NOT NULL </i> </td> </tr> <tr class="tr1"> <td> </td> <td>parts_id</td> <td>integer</td> <td><i> </i> </td> </tr> <tr class="tr0"> <td> </td> <td>partnumber</td> <td>text</td> <td><i> </i> </td> </tr> <tr class="tr1"> <td> </td> <td>leadtime</td> <td>smallint</td> <td><i> </i> </td> </tr> <tr class="tr0"> <td> </td> <td>lastcost</td> <td>numeric</td> <td><i> </i> </td> </tr> <tr class="tr1"> <td> </td> <td>curr</td> <td>character(3)</td> <td><i> </i> </td> </tr> <tr class="tr0"> <td> </td> <td>entry_id</td> <td>serial</td> <td><i> PRIMARY KEY </i> </td> </tr> </table> <!-- Inherits --> <!-- Constraint List --> <!-- Foreign Key Discovery --> <!-- Indexes --> partsvendor_parts_id_key parts_id <!-- View Definition --> <!-- List off permissions --> <p> <a href="#index">Index</a> - <a href="#public.schema">Schema public</a> </p> <hr> <h2>Table: <a name="public.table.person">person</a> </h2> <p> Every person, must have an entity to derive a common or display name. The correct way to get class information on a person would be person.entity_id->entity_class_to_entity.entity_id. </p> <table width="100%" cellspacing="0" cellpadding="3"> <caption>person Structure</caption> <tr> <th>F-Key</th> <th>Name</th> <th>Type</th> <th>Description</th> </tr> <tr class="tr0"> <td> </td> <td>id</td> <td>serial</td> <td><i> PRIMARY KEY </i> </td> </tr> <tr class="tr1"> <td> <a href="#public.table.entity">entity.id</a> </td> <td>entity_id</td> <td>integer</td> <td><i> NOT NULL </i> </td> </tr> <tr class="tr0"> <td> <a href="#public.table.salutation">salutation.id</a> </td> <td>salutation_id</td> <td>integer</td> <td><i> </i> </td> </tr> <tr class="tr1"> <td> </td> <td>first_name</td> <td>text</td> <td><i> NOT NULL </i> </td> </tr> <tr class="tr0"> <td> </td> <td>middle_name</td> <td>text</td> <td><i> </i> </td> </tr> <tr class="tr1"> <td> </td> <td>last_name</td> <td>text</td> <td><i> NOT NULL </i> </td> </tr> <tr class="tr0"> <td> <a href="#public.table.location">location.id</a> </td> <td>primary_location_id</td> <td>integer</td> <td><i> </i> </td> </tr> </table> <!-- Inherits --> <!-- Constraint List --> <p> </p> <table width="100%" cellspacing="0" cellpadding="3"> <caption>person Constraints</caption> <tr> <th>Name</th> <th>Constraint</th> </tr> <tr class="tr0"> <td>person_first_name_check</td> <td>CHECK ((first_name ~ '[[:alnum:]_]'::text))</td> </tr> <tr class="tr1"> <td>person_last_name_check</td> <td>CHECK ((last_name ~ '[[:alnum:]_]'::text))</td> </tr> </table> <!-- Foreign Key Discovery --> <p>Tables referencing this one via Foreign Key Constraints:</p> <ul> <li><a href="#public.table.ap">ap</a></li> </ul> <ul> <li><a href="#public.table.ar">ar</a></li> </ul> <ul> <li><a href="#public.table.audittrail">audittrail</a></li> </ul> <ul> <li><a href="#public.table.gl">gl</a></li> </ul> <ul> <li><a href="#public.table.inventory">inventory</a></li> </ul> <ul> <li><a href="#public.table.jcitems">jcitems</a></li> </ul> <ul> <li><a href="#public.table.oe">oe</a></li> </ul> <ul> <li><a href="#public.table.person-to-company">person_to_company</a></li> </ul> <ul> <li><a href="#public.table.person-to-contact">person_to_contact</a></li> </ul> <ul> <li><a href="#public.table.person-to-entity">person_to_entity</a></li> </ul> <!-- Indexes --> <!-- View Definition --> <!-- List off permissions --> <p> <a href="#index">Index</a> - <a href="#public.schema">Schema public</a> </p> <hr> <h2>Table: <a name="public.table.person-to-company">person_to_company</a> </h2> <table width="100%" cellspacing="0" cellpadding="3"> <caption>person_to_company Structure</caption> <tr> <th>F-Key</th> <th>Name</th> <th>Type</th> <th>Description</th> </tr> <tr class="tr0"> <td> <a href="#public.table.location">location.id</a> </td> <td>location_id</td> <td>integer</td> <td><i> PRIMARY KEY </i> </td> </tr> <tr class="tr1"> <td> <a href="#public.table.person">person.id</a> </td> <td>person_id</td> <td>integer</td> <td><i> PRIMARY KEY </i> </td> </tr> </table> <!-- Inherits --> <!-- Constraint List --> <!-- Foreign Key Discovery --> <!-- Indexes --> <!-- View Definition --> <!-- List off permissions --> <p> <a href="#index">Index</a> - <a href="#public.schema">Schema public</a> </p> <hr> <h2>Table: <a name="public.table.person-to-contact">person_to_contact</a> </h2> <p> To keep track of the relationship between multiple contact methods and a single individual </p> <table width="100%" cellspacing="0" cellpadding="3"> <caption>person_to_contact Structure</caption> <tr> <th>F-Key</th> <th>Name</th> <th>Type</th> <th>Description</th> </tr> <tr class="tr0"> <td> <a href="#public.table.person">person.id</a> </td> <td>person_id</td> <td>integer</td> <td><i> PRIMARY KEY </i> </td> </tr> <tr class="tr1"> <td> <a href="#public.table.contact-class">contact_class.id</a> </td> <td>contact_class_id</td> <td>integer</td> <td><i> PRIMARY KEY </i> </td> </tr> <tr class="tr0"> <td> </td> <td>contact</td> <td>text</td> <td><i> PRIMARY KEY </i> </td> </tr> </table> <!-- Inherits --> <!-- Constraint List --> <p> </p> <table width="100%" cellspacing="0" cellpadding="3"> <caption>person_to_contact Constraints</caption> <tr> <th>Name</th> <th>Constraint</th> </tr> <tr class="tr0"> <td>person_to_contact_contact_check</td> <td>CHECK ((contact ~ '[[:alnum:]_]'::text))</td> </tr> </table> <!-- Foreign Key Discovery --> <!-- Indexes --> <!-- View Definition --> <!-- List off permissions --> <p> <a href="#index">Index</a> - <a href="#public.schema">Schema public</a> </p> <hr> <h2>Table: <a name="public.table.person-to-entity">person_to_entity</a> </h2> <table width="100%" cellspacing="0" cellpadding="3"> <caption>person_to_entity Structure</caption> <tr> <th>F-Key</th> <th>Name</th> <th>Type</th> <th>Description</th> </tr> <tr class="tr0"> <td> <a href="#public.table.person">person.id</a> </td> <td>person_id</td> <td>integer</td> <td><i> PRIMARY KEY </i> </td> </tr> <tr class="tr1"> <td> <a href="#public.table.entity">entity.id</a> </td> <td>entity_id</td> <td>integer</td> <td><i> PRIMARY KEY </i> </td> </tr> <tr class="tr0"> <td> </td> <td>related_how</td> <td>text</td> <td><i> </i> </td> </tr> <tr class="tr1"> <td> </td> <td>created</td> <td>date</td> <td><i> NOT NULL DEFAULT ('now'::text)::date </i> </td> </tr> </table> <!-- Inherits --> <!-- Constraint List --> <p> </p> <table width="100%" cellspacing="0" cellpadding="3"> <caption>person_to_entity Constraints</caption> <tr> <th>Name</th> <th>Constraint</th> </tr> <tr class="tr0"> <td>person_to_entity_check</td> <td>CHECK ((entity_id <> person_id))</td> </tr> </table> <!-- Foreign Key Discovery --> <!-- Indexes --> <!-- View Definition --> <!-- List off permissions --> <p> <a href="#index">Index</a> - <a href="#public.schema">Schema public</a> </p> <hr> <h2>Table: <a name="public.table.pricegroup">pricegroup</a> </h2> <table width="100%" cellspacing="0" cellpadding="3"> <caption>pricegroup Structure</caption> <tr> <th>F-Key</th> <th>Name</th> <th>Type</th> <th>Description</th> </tr> <tr class="tr0"> <td> </td> <td>id</td> <td>serial</td> <td><i> PRIMARY KEY </i> </td> </tr> <tr class="tr1"> <td> </td> <td>pricegroup</td> <td>text</td> <td><i> </i> </td> </tr> </table> <!-- Inherits --> <!-- Constraint List --> <!-- Foreign Key Discovery --> <!-- Indexes --> pricegroup_id_key id pricegroup_pricegroup_key pricegroup <!-- View Definition --> <!-- List off permissions --> <p> <a href="#index">Index</a> - <a href="#public.schema">Schema public</a> </p> <hr> <h2>Table: <a name="public.table.project">project</a> </h2> <table width="100%" cellspacing="0" cellpadding="3"> <caption>project Structure</caption> <tr> <th>F-Key</th> <th>Name</th> <th>Type</th> <th>Description</th> </tr> <tr class="tr0"> <td> </td> <td>id</td> <td>serial</td> <td><i> PRIMARY KEY </i> </td> </tr> <tr class="tr1"> <td> </td> <td>projectnumber</td> <td>text</td> <td><i> </i> </td> </tr> <tr class="tr0"> <td> </td> <td>description</td> <td>text</td> <td><i> </i> </td> </tr> <tr class="tr1"> <td> </td> <td>startdate</td> <td>date</td> <td><i> </i> </td> </tr> <tr class="tr0"> <td> </td> <td>enddate</td> <td>date</td> <td><i> </i> </td> </tr> <tr class="tr1"> <td> </td> <td>parts_id</td> <td>integer</td> <td><i> </i> </td> </tr> <tr class="tr0"> <td> </td> <td>production</td> <td>numeric</td> <td><i> </i> </td> </tr> <tr class="tr1"> <td> </td> <td>completed</td> <td>numeric</td> <td><i> </i> </td> </tr> <tr class="tr0"> <td> </td> <td>customer_id</td> <td>integer</td> <td><i> </i> </td> </tr> </table> <!-- Inherits --> <!-- Constraint List --> <!-- Foreign Key Discovery --> <!-- Indexes --> project_id_key id <!-- View Definition --> <!-- List off permissions --> <p> <a href="#index">Index</a> - <a href="#public.schema">Schema public</a> </p> <hr> <h2>Table: <a name="public.table.recurring">recurring</a> </h2> <table width="100%" cellspacing="0" cellpadding="3"> <caption>recurring Structure</caption> <tr> <th>F-Key</th> <th>Name</th> <th>Type</th> <th>Description</th> </tr> <tr class="tr0"> <td> </td> <td>id</td> <td>integer</td> <td><i> PRIMARY KEY </i> </td> </tr> <tr class="tr1"> <td> </td> <td>reference</td> <td>text</td> <td><i> </i> </td> </tr> <tr class="tr0"> <td> </td> <td>startdate</td> <td>date</td> <td><i> </i> </td> </tr> <tr class="tr1"> <td> </td> <td>nextdate</td> <td>date</td> <td><i> </i> </td> </tr> <tr class="tr0"> <td> </td> <td>enddate</td> <td>date</td> <td><i> </i> </td> </tr> <tr class="tr1"> <td> </td> <td>repeat</td> <td>smallint</td> <td><i> </i> </td> </tr> <tr class="tr0"> <td> </td> <td>unit</td> <td>character varying(6)</td> <td><i> </i> </td> </tr> <tr class="tr1"> <td> </td> <td>howmany</td> <td>integer</td> <td><i> </i> </td> </tr> <tr class="tr0"> <td> </td> <td>payment</td> <td>boolean</td> <td><i> DEFAULT false </i> </td> </tr> </table> <!-- Inherits --> <!-- Constraint List --> <!-- Foreign Key Discovery --> <!-- Indexes --> <!-- View Definition --> <!-- List off permissions --> <p> <a href="#index">Index</a> - <a href="#public.schema">Schema public</a> </p> <hr> <h2>Table: <a name="public.table.recurringemail">recurringemail</a> </h2> <table width="100%" cellspacing="0" cellpadding="3"> <caption>recurringemail Structure</caption> <tr> <th>F-Key</th> <th>Name</th> <th>Type</th> <th>Description</th> </tr> <tr class="tr0"> <td> </td> <td>id</td> <td>integer</td> <td><i> PRIMARY KEY </i> </td> </tr> <tr class="tr1"> <td> </td> <td>formname</td> <td>text</td> <td><i> </i> </td> </tr> <tr class="tr0"> <td> </td> <td>format</td> <td>text</td> <td><i> </i> </td> </tr> <tr class="tr1"> <td> </td> <td>message</td> <td>text</td> <td><i> </i> </td> </tr> </table> <!-- Inherits --> <!-- Constraint List --> <!-- Foreign Key Discovery --> <!-- Indexes --> <!-- View Definition --> <!-- List off permissions --> <p> <a href="#index">Index</a> - <a href="#public.schema">Schema public</a> </p> <hr> <h2>Table: <a name="public.table.recurringprint">recurringprint</a> </h2> <table width="100%" cellspacing="0" cellpadding="3"> <caption>recurringprint Structure</caption> <tr> <th>F-Key</th> <th>Name</th> <th>Type</th> <th>Description</th> </tr> <tr class="tr0"> <td> </td> <td>id</td> <td>integer</td> <td><i> PRIMARY KEY </i> </td> </tr> <tr class="tr1"> <td> </td> <td>formname</td> <td>text</td> <td><i> </i> </td> </tr> <tr class="tr0"> <td> </td> <td>format</td> <td>text</td> <td><i> </i> </td> </tr> <tr class="tr1"> <td> </td> <td>printer</td> <td>text</td> <td><i> </i> </td> </tr> </table> <!-- Inherits --> <!-- Constraint List --> <!-- Foreign Key Discovery --> <!-- Indexes --> <!-- View Definition --> <!-- List off permissions --> <p> <a href="#index">Index</a> - <a href="#public.schema">Schema public</a> </p> <hr> <h2>Table: <a name="public.table.salutation">salutation</a> </h2> <table width="100%" cellspacing="0" cellpadding="3"> <caption>salutation Structure</caption> <tr> <th>F-Key</th> <th>Name</th> <th>Type</th> <th>Description</th> </tr> <tr class="tr0"> <td> </td> <td>id</td> <td>serial</td> <td><i> UNIQUE NOT NULL </i> </td> </tr> <tr class="tr1"> <td> </td> <td>salutation</td> <td>text</td> <td><i> PRIMARY KEY </i> </td> </tr> </table> <!-- Inherits --> <!-- Constraint List --> <!-- Foreign Key Discovery --> <p>Tables referencing this one via Foreign Key Constraints:</p> <ul> <li><a href="#public.table.person">person</a></li> </ul> <!-- Indexes --> <!-- View Definition --> <!-- List off permissions --> <p> <a href="#index">Index</a> - <a href="#public.schema">Schema public</a> </p> <hr> <h2>Table: <a name="public.table.shipto">shipto</a> </h2> <table width="100%" cellspacing="0" cellpadding="3"> <caption>shipto Structure</caption> <tr> <th>F-Key</th> <th>Name</th> <th>Type</th> <th>Description</th> </tr> <tr class="tr0"> <td> </td> <td>trans_id</td> <td>integer</td> <td><i> </i> </td> </tr> <tr class="tr1"> <td> </td> <td>shiptoname</td> <td>character varying(64)</td> <td><i> </i> </td> </tr> <tr class="tr0"> <td> </td> <td>shiptoaddress1</td> <td>character varying(32)</td> <td><i> </i> </td> </tr> <tr class="tr1"> <td> </td> <td>shiptoaddress2</td> <td>character varying(32)</td> <td><i> </i> </td> </tr> <tr class="tr0"> <td> </td> <td>shiptocity</td> <td>character varying(32)</td> <td><i> </i> </td> </tr> <tr class="tr1"> <td> </td> <td>shiptostate</td> <td>character varying(32)</td> <td><i> </i> </td> </tr> <tr class="tr0"> <td> </td> <td>shiptozipcode</td> <td>character varying(10)</td> <td><i> </i> </td> </tr> <tr class="tr1"> <td> </td> <td>shiptocountry</td> <td>character varying(32)</td> <td><i> </i> </td> </tr> <tr class="tr0"> <td> </td> <td>shiptocontact</td> <td>character varying(64)</td> <td><i> </i> </td> </tr> <tr class="tr1"> <td> </td> <td>shiptophone</td> <td>character varying(20)</td> <td><i> </i> </td> </tr> <tr class="tr0"> <td> </td> <td>shiptofax</td> <td>character varying(20)</td> <td><i> </i> </td> </tr> <tr class="tr1"> <td> </td> <td>shiptoemail</td> <td>text</td> <td><i> </i> </td> </tr> <tr class="tr0"> <td> </td> <td>entry_id</td> <td>serial</td> <td><i> PRIMARY KEY </i> </td> </tr> </table> <!-- Inherits --> <!-- Constraint List --> <!-- Foreign Key Discovery --> <!-- Indexes --> shipto_trans_id_key trans_id <!-- View Definition --> <!-- List off permissions --> <p> <a href="#index">Index</a> - <a href="#public.schema">Schema public</a> </p> <hr> <h2>Table: <a name="public.table.sic">sic</a> </h2> <table width="100%" cellspacing="0" cellpadding="3"> <caption>sic Structure</caption> <tr> <th>F-Key</th> <th>Name</th> <th>Type</th> <th>Description</th> </tr> <tr class="tr0"> <td> </td> <td>code</td> <td>character varying(6)</td> <td><i> PRIMARY KEY </i> </td> </tr> <tr class="tr1"> <td> </td> <td>sictype</td> <td>character(1)</td> <td><i> </i> </td> </tr> <tr class="tr0"> <td> </td> <td>description</td> <td>text</td> <td><i> </i> </td> </tr> </table> <!-- Inherits --> <!-- Constraint List --> <!-- Foreign Key Discovery --> <!-- Indexes --> <!-- View Definition --> <!-- List off permissions --> <p> <a href="#index">Index</a> - <a href="#public.schema">Schema public</a> </p> <hr> <h2>Table: <a name="public.table.status">status</a> </h2> <table width="100%" cellspacing="0" cellpadding="3"> <caption>status Structure</caption> <tr> <th>F-Key</th> <th>Name</th> <th>Type</th> <th>Description</th> </tr> <tr class="tr0"> <td> </td> <td>trans_id</td> <td>integer</td> <td><i> PRIMARY KEY </i> </td> </tr> <tr class="tr1"> <td> </td> <td>formname</td> <td>text</td> <td><i> </i> </td> </tr> <tr class="tr0"> <td> </td> <td>printed</td> <td>boolean</td> <td><i> DEFAULT false </i> </td> </tr> <tr class="tr1"> <td> </td> <td>emailed</td> <td>boolean</td> <td><i> DEFAULT false </i> </td> </tr> <tr class="tr0"> <td> </td> <td>spoolfile</td> <td>text</td> <td><i> </i> </td> </tr> </table> <!-- Inherits --> <!-- Constraint List --> <!-- Foreign Key Discovery --> <!-- Indexes --> status_trans_id_key trans_id <!-- View Definition --> <!-- List off permissions --> <p> <a href="#index">Index</a> - <a href="#public.schema">Schema public</a> </p> <hr> <h2>Table: <a name="public.table.tax">tax</a> </h2> <table width="100%" cellspacing="0" cellpadding="3"> <caption>tax Structure</caption> <tr> <th>F-Key</th> <th>Name</th> <th>Type</th> <th>Description</th> </tr> <tr class="tr0"> <td> <a href="#public.table.chart">chart.id</a> </td> <td>chart_id</td> <td>integer</td> <td><i> PRIMARY KEY </i> </td> </tr> <tr class="tr1"> <td> </td> <td>rate</td> <td>numeric</td> <td><i> </i> </td> </tr> <tr class="tr0"> <td> </td> <td>taxnumber</td> <td>text</td> <td><i> </i> </td> </tr> <tr class="tr1"> <td> </td> <td>validto</td> <td>date</td> <td><i> </i> </td> </tr> <tr class="tr0"> <td> </td> <td>pass</td> <td>integer</td> <td><i> NOT NULL </i> </td> </tr> <tr class="tr1"> <td> <a href="#public.table.taxmodule">taxmodule.taxmodule_id</a> </td> <td>taxmodule_id</td> <td>integer</td> <td><i> NOT NULL DEFAULT 1 </i> </td> </tr> </table> <!-- Inherits --> <!-- Constraint List --> <!-- Foreign Key Discovery --> <!-- Indexes --> <!-- View Definition --> <!-- List off permissions --> <p> <a href="#index">Index</a> - <a href="#public.schema">Schema public</a> </p> <hr> <h2>Table: <a name="public.table.taxcategory">taxcategory</a> </h2> <table width="100%" cellspacing="0" cellpadding="3"> <caption>taxcategory Structure</caption> <tr> <th>F-Key</th> <th>Name</th> <th>Type</th> <th>Description</th> </tr> <tr class="tr0"> <td> </td> <td>taxcategory_id</td> <td>serial</td> <td><i> PRIMARY KEY </i> </td> </tr> <tr class="tr1"> <td> </td> <td>taxcategoryname</td> <td>text</td> <td><i> NOT NULL </i> </td> </tr> <tr class="tr0"> <td> <a href="#public.table.taxmodule">taxmodule.taxmodule_id</a> </td> <td>taxmodule_id</td> <td>integer</td> <td><i> NOT NULL </i> </td> </tr> </table> <!-- Inherits --> <!-- Constraint List --> <!-- Foreign Key Discovery --> <p>Tables referencing this one via Foreign Key Constraints:</p> <ul> <li><a href="#public.table.partstax">partstax</a></li> </ul> <!-- Indexes --> <!-- View Definition --> <!-- List off permissions --> <p> <a href="#index">Index</a> - <a href="#public.schema">Schema public</a> </p> <hr> <h2>Table: <a name="public.table.taxmodule">taxmodule</a> </h2> <table width="100%" cellspacing="0" cellpadding="3"> <caption>taxmodule Structure</caption> <tr> <th>F-Key</th> <th>Name</th> <th>Type</th> <th>Description</th> </tr> <tr class="tr0"> <td> </td> <td>taxmodule_id</td> <td>serial</td> <td><i> PRIMARY KEY </i> </td> </tr> <tr class="tr1"> <td> </td> <td>taxmodulename</td> <td>text</td> <td><i> NOT NULL </i> </td> </tr> </table> <!-- Inherits --> <!-- Constraint List --> <!-- Foreign Key Discovery --> <p>Tables referencing this one via Foreign Key Constraints:</p> <ul> <li><a href="#public.table.tax">tax</a></li> </ul> <ul> <li><a href="#public.table.taxcategory">taxcategory</a></li> </ul> <!-- Indexes --> <!-- View Definition --> <!-- List off permissions --> <p> <a href="#index">Index</a> - <a href="#public.schema">Schema public</a> </p> <hr> <h2>Table: <a name="public.table.transactions">transactions</a> </h2> <table width="100%" cellspacing="0" cellpadding="3"> <caption>transactions Structure</caption> <tr> <th>F-Key</th> <th>Name</th> <th>Type</th> <th>Description</th> </tr> <tr class="tr0"> <td> </td> <td>id</td> <td>integer</td> <td><i> PRIMARY KEY </i> </td> </tr> <tr class="tr1"> <td> </td> <td>table_name</td> <td>text</td> <td><i> </i> </td> </tr> </table> <!-- Inherits --> <!-- Constraint List --> <!-- Foreign Key Discovery --> <!-- Indexes --> <!-- View Definition --> <!-- List off permissions --> <p> <a href="#index">Index</a> - <a href="#public.schema">Schema public</a> </p> <hr> <h2>Table: <a name="public.table.translation">translation</a> </h2> <table width="100%" cellspacing="0" cellpadding="3"> <caption>translation Structure</caption> <tr> <th>F-Key</th> <th>Name</th> <th>Type</th> <th>Description</th> </tr> <tr class="tr0"> <td> </td> <td>trans_id</td> <td>integer</td> <td><i> PRIMARY KEY </i> </td> </tr> <tr class="tr1"> <td> </td> <td>language_code</td> <td>character varying(6)</td> <td><i> PRIMARY KEY </i> </td> </tr> <tr class="tr0"> <td> </td> <td>description</td> <td>text</td> <td><i> </i> </td> </tr> </table> <!-- Inherits --> <!-- Constraint List --> <!-- Foreign Key Discovery --> <!-- Indexes --> translation_trans_id_key trans_id <!-- View Definition --> <!-- List off permissions --> <p> <a href="#index">Index</a> - <a href="#public.schema">Schema public</a> </p> <hr> <h2>Table: <a name="public.table.vendor">vendor</a> </h2> <p> Now a meta data table </p> <table width="100%" cellspacing="0" cellpadding="3"> <caption>vendor Structure</caption> <tr> <th>F-Key</th> <th>Name</th> <th>Type</th> <th>Description</th> </tr> <tr class="tr0"> <td> </td> <td>id</td> <td>serial</td> <td><i> PRIMARY KEY </i> </td> </tr> <tr class="tr1"> <td> <a href="#public.table.entity">entity.id</a> </td> <td>entity_id</td> <td>integer</td> <td><i> NOT NULL </i> </td> </tr> <tr class="tr0"> <td> </td> <td>terms</td> <td>smallint</td> <td><i> </i> </td> </tr> <tr class="tr1"> <td> </td> <td>taxincluded</td> <td>boolean</td> <td><i> DEFAULT false </i> </td> </tr> <tr class="tr0"> <td> </td> <td>vendornumber</td> <td>character varying(32)</td> <td><i> </i> </td> </tr> <tr class="tr1"> <td> </td> <td>cc</td> <td>text</td> <td><i> </i> </td> </tr> <tr class="tr0"> <td> </td> <td>bcc</td> <td>text</td> <td><i> </i> </td> </tr> <tr class="tr1"> <td> </td> <td>gifi_accno</td> <td>character varying(30)</td> <td><i> </i> </td> </tr> <tr class="tr0"> <td> </td> <td>business_id</td> <td>integer</td> <td><i> </i> </td> </tr> <tr class="tr1"> <td> </td> <td>taxnumber</td> <td>character varying(32)</td> <td><i> </i> </td> </tr> <tr class="tr0"> <td> </td> <td>sic_code</td> <td>character varying(6)</td> <td><i> </i> </td> </tr> <tr class="tr1"> <td> </td> <td>discount</td> <td>numeric</td> <td><i> </i> </td> </tr> <tr class="tr0"> <td> </td> <td>creditlimit</td> <td>numeric</td> <td><i> </i> </td> </tr> <tr class="tr1"> <td> </td> <td>iban</td> <td>character varying(34)</td> <td><i> </i> </td> </tr> <tr class="tr0"> <td> </td> <td>bic</td> <td>character varying(11)</td> <td><i> </i> </td> </tr> <tr class="tr1"> <td> </td> <td>language_code</td> <td>character varying(6)</td> <td><i> </i> </td> </tr> <tr class="tr0"> <td> </td> <td>pricegroup_id</td> <td>integer</td> <td><i> </i> </td> </tr> <tr class="tr1"> <td> </td> <td>curr</td> <td>character(3)</td> <td><i> </i> </td> </tr> <tr class="tr0"> <td> </td> <td>startdate</td> <td>date</td> <td><i> </i> </td> </tr> <tr class="tr1"> <td> </td> <td>enddate</td> <td>date</td> <td><i> </i> </td> </tr> </table> <!-- Inherits --> <!-- Constraint List --> <!-- Foreign Key Discovery --> <!-- Indexes --> vendor_id_key id vendor_vendornumber_key vendornumber <!-- View Definition --> <!-- List off permissions --> <p> <a href="#index">Index</a> - <a href="#public.schema">Schema public</a> </p> <hr> <h2>Table: <a name="public.table.vendortax">vendortax</a> </h2> <table width="100%" cellspacing="0" cellpadding="3"> <caption>vendortax Structure</caption> <tr> <th>F-Key</th> <th>Name</th> <th>Type</th> <th>Description</th> </tr> <tr class="tr0"> <td> </td> <td>vendor_id</td> <td>integer</td> <td><i> PRIMARY KEY </i> </td> </tr> <tr class="tr1"> <td> </td> <td>chart_id</td> <td>integer</td> <td><i> PRIMARY KEY </i> </td> </tr> </table> <!-- Inherits --> <!-- Constraint List --> <!-- Foreign Key Discovery --> <!-- Indexes --> <!-- View Definition --> <!-- List off permissions --> <p> <a href="#index">Index</a> - <a href="#public.schema">Schema public</a> </p> <hr> <h2>Table: <a name="public.table.warehouse">warehouse</a> </h2> <table width="100%" cellspacing="0" cellpadding="3"> <caption>warehouse Structure</caption> <tr> <th>F-Key</th> <th>Name</th> <th>Type</th> <th>Description</th> </tr> <tr class="tr0"> <td> </td> <td>id</td> <td>serial</td> <td><i> PRIMARY KEY </i> </td> </tr> <tr class="tr1"> <td> </td> <td>description</td> <td>text</td> <td><i> </i> </td> </tr> </table> <!-- Inherits --> <!-- Constraint List --> <!-- Foreign Key Discovery --> <!-- Indexes --> <!-- View Definition --> <!-- List off permissions --> <p> <a href="#index">Index</a> - <a href="#public.schema">Schema public</a> </p> <hr> <h2>Table: <a name="public.table.yearend">yearend</a> </h2> <table width="100%" cellspacing="0" cellpadding="3"> <caption>yearend Structure</caption> <tr> <th>F-Key</th> <th>Name</th> <th>Type</th> <th>Description</th> </tr> <tr class="tr0"> <td> </td> <td>trans_id</td> <td>integer</td> <td><i> PRIMARY KEY </i> </td> </tr> <tr class="tr1"> <td> </td> <td>transdate</td> <td>date</td> <td><i> </i> </td> </tr> </table> <!-- Inherits --> <!-- Constraint List --> <!-- Foreign Key Discovery --> <!-- Indexes --> <!-- View Definition --> <!-- List off permissions --> <p> <a href="#index">Index</a> - <a href="#public.schema">Schema public</a> </p> <!-- We've gone through the table structure, now lets take a look at user functions --> <hr> <h2>Function: <a href="#public.schema"><a name="public.function.add-custom-field-character-varying-character-varying-character-varying">add_custom_field( character varying, character varying, character varying )</a> </h2> <h3>Returns: boolean</h3> <h3>Language: PLPGSQL</h3> <pre> DECLARE table_name ALIAS FOR $1; new_field_name ALIAS FOR $2; field_datatype ALIAS FOR $3; BEGIN EXECUTE 'SELECT TABLE_ID FROM custom_table_catalog WHERE extends = ''' || table_name || ''' '; IF NOT FOUND THEN BEGIN INSERT INTO custom_table_catalog (extends) VALUES (table_name); EXECUTE 'CREATE TABLE custom_'||table_name || ' (row_id INT PRIMARY KEY)'; EXCEPTION WHEN duplicate_table THEN -- do nothing END; END IF; EXECUTE 'INSERT INTO custom_field_catalog (field_name, table_id) VALUES ( ''' || new_field_name ||''', (SELECT table_id FROM custom_table_catalog WHERE extends = '''|| table_name || '''))'; EXECUTE 'ALTER TABLE custom_'||table_name || ' ADD COLUMN ' || new_field_name || ' ' || field_datatype; RETURN TRUE; END; </pre> <hr> <h2>Function: <a href="#public.schema"><a name="public.function.avgcost-integer">avgcost( integer )</a> </h2> <h3>Returns: double precision</h3> <h3>Language: PLPGSQL</h3> <pre> DECLARE v_cost float; v_qty float; v_parts_id alias for $1; BEGIN SELECT INTO v_cost, v_qty SUM(i.sellprice * i.qty), SUM(i.qty) FROM invoice i JOIN ap a ON (a.id = i.trans_id) WHERE i.parts_id = v_parts_id; IF v_cost IS NULL THEN v_cost := 0; END IF; IF NOT v_qty IS NULL THEN IF v_qty = 0 THEN v_cost := 0; ELSE v_cost := v_cost/v_qty; END IF; END IF; RETURN v_cost; END; </pre> <hr> <h2>Function: <a href="#public.schema"><a name="public.function.check-department">check_department( )</a> </h2> <h3>Returns: "trigger"</h3> <h3>Language: PLPGSQL</h3> <pre> declare dpt_id int; begin if new.department_id = 0 then delete from dpt_trans where trans_id = new.id; return NULL; end if; select into dpt_id trans_id from dpt_trans where trans_id = new.id; if dpt_id > 0 then update dpt_trans set department_id = new.department_id where trans_id = dpt_id; else insert into dpt_trans (trans_id, department_id) values (new.id, new.department_id); end if; return NULL; end; </pre> <hr> <h2>Function: <a href="#public.schema"><a name="public.function.check-inventory">check_inventory( )</a> </h2> <h3>Returns: "trigger"</h3> <h3>Language: PLPGSQL</h3> <pre> declare itemid int; row_data inventory%rowtype; begin if not old.quotation then for row_data in select * from inventory where trans_id = old.id loop select into itemid id from orderitems where trans_id = old.id and id = row_data.orderitems_id; if itemid is null then delete from inventory where trans_id = old.id and orderitems_id = row_data.orderitems_id; end if; end loop; end if; return old; end; </pre> <hr> <h2>Function: <a href="#public.schema"><a name="public.function.del-customer">del_customer( )</a> </h2> <h3>Returns: "trigger"</h3> <h3>Language: PLPGSQL</h3> <pre> begin delete from shipto where trans_id = old.id; delete from customertax where customer_id = old.id; delete from partscustomer where customer_id = old.id; return NULL; end; </pre> <hr> <h2>Function: <a href="#public.schema"><a name="public.function.del-department">del_department( )</a> </h2> <h3>Returns: "trigger"</h3> <h3>Language: PLPGSQL</h3> <pre> begin delete from dpt_trans where trans_id = old.id; return NULL; end; </pre> <hr> <h2>Function: <a href="#public.schema"><a name="public.function.del-exchangerate">del_exchangerate( )</a> </h2> <h3>Returns: "trigger"</h3> <h3>Language: PLPGSQL</h3> <pre> declare t_transdate date; t_curr char(3); t_id int; d_curr text; begin select into d_curr substr(value,1,3) from defaults where setting_key = 'curr'; if TG_RELNAME = 'ar' then select into t_curr, t_transdate curr, transdate from ar where id = old.id; end if; if TG_RELNAME = 'ap' then select into t_curr, t_transdate curr, transdate from ap where id = old.id; end if; if TG_RELNAME = 'oe' then select into t_curr, t_transdate curr, transdate from oe where id = old.id; end if; if d_curr != t_curr then select into t_id a.id from acc_trans ac join ar a on (a.id = ac.trans_id) where a.curr = t_curr and ac.transdate = t_transdate except select a.id from ar a where a.id = old.id union select a.id from acc_trans ac join ap a on (a.id = ac.trans_id) where a.curr = t_curr and ac.transdate = t_transdate except select a.id from ap a where a.id = old.id union select o.id from oe o where o.curr = t_curr and o.transdate = t_transdate except select o.id from oe o where o.id = old.id; if not found then delete from exchangerate where curr = t_curr and transdate = t_transdate; end if; end if; return old; end; </pre> <hr> <h2>Function: <a href="#public.schema"><a name="public.function.del-recurring">del_recurring( )</a> </h2> <h3>Returns: "trigger"</h3> <h3>Language: PLPGSQL</h3> <pre> BEGIN DELETE FROM recurring WHERE id = old.id; DELETE FROM recurringemail WHERE id = old.id; DELETE FROM recurringprint WHERE id = old.id; RETURN NULL; END; </pre> <hr> <h2>Function: <a href="#public.schema"><a name="public.function.del-vendor">del_vendor( )</a> </h2> <h3>Returns: "trigger"</h3> <h3>Language: PLPGSQL</h3> <pre> begin delete from shipto where trans_id = old.id; delete from vendortax where vendor_id = old.id; delete from partsvendor where vendor_id = old.id; return NULL; end; </pre> <hr> <h2>Function: <a href="#public.schema"><a name="public.function.del-yearend">del_yearend( )</a> </h2> <h3>Returns: "trigger"</h3> <h3>Language: PLPGSQL</h3> <pre> begin delete from yearend where trans_id = old.id; return NULL; end; </pre> <hr> <h2>Function: <a href="#public.schema"><a name="public.function.drop-custom-field-character-varying-character-varying">drop_custom_field( character varying, character varying )</a> </h2> <h3>Returns: boolean</h3> <h3>Language: PLPGSQL</h3> <pre> DECLARE table_name ALIAS FOR $1; custom_field_name ALIAS FOR $2; BEGIN DELETE FROM custom_field_catalog WHERE field_name = custom_field_name AND table_id = (SELECT table_id FROM custom_table_catalog WHERE extends = table_name); EXECUTE 'ALTER TABLE custom_' || table_name || ' DROP COLUMN ' || custom_field_name; RETURN TRUE; END; </pre> <hr> <h2>Function: <a href="#public.schema"><a name="public.function.lastcost-integer">lastcost( integer )</a> </h2> <h3>Returns: double precision</h3> <h3>Language: PLPGSQL</h3> <pre> DECLARE v_cost float; v_parts_id alias for $1; BEGIN SELECT INTO v_cost sellprice FROM invoice i JOIN ap a ON (a.id = i.trans_id) WHERE i.parts_id = v_parts_id ORDER BY a.transdate desc, a.id desc LIMIT 1; IF v_cost IS NULL THEN v_cost := 0; END IF; RETURN v_cost; END; </pre> <hr> <h2>Function: <a href="#public.schema"><a name="public.function.trigger-parts-short">trigger_parts_short( )</a> </h2> <h3>Returns: "trigger"</h3> <h3>Language: PLPGSQL</h3> <pre> BEGIN IF NEW.onhand >= NEW.rop THEN NOTIFY parts_short; END IF; RETURN NEW; END; </pre> <hr> <h2>Function: <a href="#public.schema"><a name="public.function.update-user-integer-text">update_user( integer, text )</a> </h2> <h3>Returns: integer</h3> <h3>Language: SQL</h3> <p> Takes int4 which is users.id and text which is username. Will update username based on id. Username is unique </p> <pre> UPDATE users SET username = '$2' WHERE id = $1; SELECT 1; </pre> <p class="w3ref">Generated by <a href="http://www.rbt.ca/autodoc/">PostgreSQL Autodoc</a></p> <p class="w3ref"><a href="http://validator.w3.org/check/referer">W3C HTML 4.01 Strict</a></p> </body></html>