summaryrefslogtreecommitdiff
path: root/doc/database/ledgersmb.xml
blob: 82672ad6082162852f9fba608a3a39856d338ee8 (plain)
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <!-- $Header: /cvsroot/autodoc/autodoc/xml.tmpl,v 1.2 2006/05/16 19:01:27 rbt Exp $ -->
  3. <book id="database.ledgersmb" xreflabel="ledgersmb database schema"><title>ledgersmb Model</title>
  4. <chapter id="public.schema"
  5. xreflabel="public">
  6. <title>Schema public</title>
  7. <para>Standard public schema</para>
  8. <section id="public.table.acc-trans"
  9. xreflabel="public.acc_trans">
  10. <title id="public.table.acc-trans-title">
  11. Table:
  12. <structname>acc_trans</structname>
  13. </title>
  14. <para>
  15. <variablelist>
  16. <title>
  17. Structure of <structname>acc_trans</structname>
  18. </title>
  19. <varlistentry>
  20. <term><structfield>trans_id</structfield></term>
  21. <listitem><para>
  22. <type>integer</type>
  23. </para>
  24. </listitem>
  25. </varlistentry>
  26. <varlistentry>
  27. <term><structfield>chart_id</structfield></term>
  28. <listitem><para>
  29. <type>integer</type>
  30. <literal>NOT NULL</literal>
  31. <literal>REFERENCES</literal> <xref linkend="public.table.chart"/>
  32. </para>
  33. </listitem>
  34. </varlistentry>
  35. <varlistentry>
  36. <term><structfield>amount</structfield></term>
  37. <listitem><para>
  38. <type>numeric</type>
  39. </para>
  40. </listitem>
  41. </varlistentry>
  42. <varlistentry>
  43. <term><structfield>transdate</structfield></term>
  44. <listitem><para>
  45. <type>date</type>
  46. <literal>DEFAULT (&apos;now&apos;::text)::date</literal>
  47. </para>
  48. </listitem>
  49. </varlistentry>
  50. <varlistentry>
  51. <term><structfield>source</structfield></term>
  52. <listitem><para>
  53. <type>text</type>
  54. </para>
  55. </listitem>
  56. </varlistentry>
  57. <varlistentry>
  58. <term><structfield>cleared</structfield></term>
  59. <listitem><para>
  60. <type>boolean</type>
  61. <literal>DEFAULT false</literal>
  62. </para>
  63. </listitem>
  64. </varlistentry>
  65. <varlistentry>
  66. <term><structfield>fx_transaction</structfield></term>
  67. <listitem><para>
  68. <type>boolean</type>
  69. <literal>DEFAULT false</literal>
  70. </para>
  71. </listitem>
  72. </varlistentry>
  73. <varlistentry>
  74. <term><structfield>project_id</structfield></term>
  75. <listitem><para>
  76. <type>integer</type>
  77. </para>
  78. </listitem>
  79. </varlistentry>
  80. <varlistentry>
  81. <term><structfield>memo</structfield></term>
  82. <listitem><para>
  83. <type>text</type>
  84. </para>
  85. </listitem>
  86. </varlistentry>
  87. <varlistentry>
  88. <term><structfield>invoice_id</structfield></term>
  89. <listitem><para>
  90. <type>integer</type>
  91. </para>
  92. </listitem>
  93. </varlistentry>
  94. <varlistentry>
  95. <term><structfield>entry_id</structfield></term>
  96. <listitem><para>
  97. <type>serial</type>
  98. <literal>PRIMARY KEY</literal>
  99. </para>
  100. </listitem>
  101. </varlistentry>
  102. </variablelist>
  103. <variablelist>
  104. <title>Indexes on acc_trans</title>
  105. <varlistentry>
  106. <term>acc_trans_chart_id_key</term>
  107. <listitem><para>chart_id</para></listitem>
  108. </varlistentry>
  109. <varlistentry>
  110. <term>acc_trans_source_key</term>
  111. <listitem><para>lower(source)</para></listitem>
  112. </varlistentry>
  113. <varlistentry>
  114. <term>acc_trans_trans_id_key</term>
  115. <listitem><para>trans_id</para></listitem>
  116. </varlistentry>
  117. <varlistentry>
  118. <term>acc_trans_transdate_key</term>
  119. <listitem><para>transdate</para></listitem>
  120. </varlistentry>
  121. </variablelist>
  122. </para>
  123. </section>
  124. <section id="public.table.ap"
  125. xreflabel="public.ap">
  126. <title id="public.table.ap-title">
  127. Table:
  128. <structname>ap</structname>
  129. </title>
  130. <para>
  131. <variablelist>
  132. <title>
  133. Structure of <structname>ap</structname>
  134. </title>
  135. <varlistentry>
  136. <term><structfield>id</structfield></term>
  137. <listitem><para>
  138. <type>integer</type>
  139. <literal>PRIMARY KEY</literal>
  140. <literal>DEFAULT nextval(&apos;id&apos;::regclass)</literal>
  141. </para>
  142. </listitem>
  143. </varlistentry>
  144. <varlistentry>
  145. <term><structfield>invnumber</structfield></term>
  146. <listitem><para>
  147. <type>text</type>
  148. </para>
  149. </listitem>
  150. </varlistentry>
  151. <varlistentry>
  152. <term><structfield>transdate</structfield></term>
  153. <listitem><para>
  154. <type>date</type>
  155. <literal>DEFAULT (&apos;now&apos;::text)::date</literal>
  156. </para>
  157. </listitem>
  158. </varlistentry>
  159. <varlistentry>
  160. <term><structfield>vendor_id</structfield></term>
  161. <listitem><para>
  162. <type>integer</type>
  163. </para>
  164. </listitem>
  165. </varlistentry>
  166. <varlistentry>
  167. <term><structfield>taxincluded</structfield></term>
  168. <listitem><para>
  169. <type>boolean</type>
  170. <literal>DEFAULT false</literal>
  171. </para>
  172. </listitem>
  173. </varlistentry>
  174. <varlistentry>
  175. <term><structfield>amount</structfield></term>
  176. <listitem><para>
  177. <type>numeric</type>
  178. </para>
  179. </listitem>
  180. </varlistentry>
  181. <varlistentry>
  182. <term><structfield>netamount</structfield></term>
  183. <listitem><para>
  184. <type>numeric</type>
  185. </para>
  186. </listitem>
  187. </varlistentry>
  188. <varlistentry>
  189. <term><structfield>paid</structfield></term>
  190. <listitem><para>
  191. <type>numeric</type>
  192. </para>
  193. </listitem>
  194. </varlistentry>
  195. <varlistentry>
  196. <term><structfield>datepaid</structfield></term>
  197. <listitem><para>
  198. <type>date</type>
  199. </para>
  200. </listitem>
  201. </varlistentry>
  202. <varlistentry>
  203. <term><structfield>duedate</structfield></term>
  204. <listitem><para>
  205. <type>date</type>
  206. </para>
  207. </listitem>
  208. </varlistentry>
  209. <varlistentry>
  210. <term><structfield>invoice</structfield></term>
  211. <listitem><para>
  212. <type>boolean</type>
  213. <literal>DEFAULT false</literal>
  214. </para>
  215. </listitem>
  216. </varlistentry>
  217. <varlistentry>
  218. <term><structfield>ordnumber</structfield></term>
  219. <listitem><para>
  220. <type>text</type>
  221. </para>
  222. </listitem>
  223. </varlistentry>
  224. <varlistentry>
  225. <term><structfield>curr</structfield></term>
  226. <listitem><para>
  227. <type>character(3)</type>
  228. </para>
  229. </listitem>
  230. </varlistentry>
  231. <varlistentry>
  232. <term><structfield>notes</structfield></term>
  233. <listitem><para>
  234. <type>text</type>
  235. </para>
  236. </listitem>
  237. </varlistentry>
  238. <varlistentry>
  239. <term><structfield>employee_id</structfield></term>
  240. <listitem><para>
  241. <type>integer</type>
  242. </para>
  243. </listitem>
  244. </varlistentry>
  245. <varlistentry>
  246. <term><structfield>till</structfield></term>
  247. <listitem><para>
  248. <type>character varying(20)</type>
  249. </para>
  250. </listitem>
  251. </varlistentry>
  252. <varlistentry>
  253. <term><structfield>quonumber</structfield></term>
  254. <listitem><para>
  255. <type>text</type>
  256. </para>
  257. </listitem>
  258. </varlistentry>
  259. <varlistentry>
  260. <term><structfield>intnotes</structfield></term>
  261. <listitem><para>
  262. <type>text</type>
  263. </para>
  264. </listitem>
  265. </varlistentry>
  266. <varlistentry>
  267. <term><structfield>department_id</structfield></term>
  268. <listitem><para>
  269. <type>integer</type>
  270. </para>
  271. </listitem>
  272. </varlistentry>
  273. <varlistentry>
  274. <term><structfield>shipvia</structfield></term>
  275. <listitem><para>
  276. <type>text</type>
  277. </para>
  278. </listitem>
  279. </varlistentry>
  280. <varlistentry>
  281. <term><structfield>language_code</structfield></term>
  282. <listitem><para>
  283. <type>character varying(6)</type>
  284. </para>
  285. </listitem>
  286. </varlistentry>
  287. <varlistentry>
  288. <term><structfield>ponumber</structfield></term>
  289. <listitem><para>
  290. <type>text</type>
  291. </para>
  292. </listitem>
  293. </varlistentry>
  294. <varlistentry>
  295. <term><structfield>shippingpoint</structfield></term>
  296. <listitem><para>
  297. <type>text</type>
  298. </para>
  299. </listitem>
  300. </varlistentry>
  301. <varlistentry>
  302. <term><structfield>terms</structfield></term>
  303. <listitem><para>
  304. <type>smallint</type>
  305. </para>
  306. </listitem>
  307. </varlistentry>
  308. </variablelist>
  309. <variablelist>
  310. <title>Indexes on ap</title>
  311. <varlistentry>
  312. <term>ap_employee_id_key</term>
  313. <listitem><para>employee_id</para></listitem>
  314. </varlistentry>
  315. <varlistentry>
  316. <term>ap_id_key</term>
  317. <listitem><para>id</para></listitem>
  318. </varlistentry>
  319. <varlistentry>
  320. <term>ap_invnumber_key</term>
  321. <listitem><para>invnumber</para></listitem>
  322. </varlistentry>
  323. <varlistentry>
  324. <term>ap_ordnumber_key</term>
  325. <listitem><para>ordnumber</para></listitem>
  326. </varlistentry>
  327. <varlistentry>
  328. <term>ap_quonumber_key</term>
  329. <listitem><para>quonumber</para></listitem>
  330. </varlistentry>
  331. <varlistentry>
  332. <term>ap_transdate_key</term>
  333. <listitem><para>transdate</para></listitem>
  334. </varlistentry>
  335. <varlistentry>
  336. <term>ap_vendor_id_key</term>
  337. <listitem><para>vendor_id</para></listitem>
  338. </varlistentry>
  339. </variablelist>
  340. </para>
  341. </section>
  342. <section id="public.table.ar"
  343. xreflabel="public.ar">
  344. <title id="public.table.ar-title">
  345. Table:
  346. <structname>ar</structname>
  347. </title>
  348. <para>
  349. <variablelist>
  350. <title>
  351. Structure of <structname>ar</structname>
  352. </title>
  353. <varlistentry>
  354. <term><structfield>id</structfield></term>
  355. <listitem><para>
  356. <type>integer</type>
  357. <literal>PRIMARY KEY</literal>
  358. <literal>DEFAULT nextval(&apos;id&apos;::regclass)</literal>
  359. </para>
  360. </listitem>
  361. </varlistentry>
  362. <varlistentry>
  363. <term><structfield>invnumber</structfield></term>
  364. <listitem><para>
  365. <type>text</type>
  366. </para>
  367. </listitem>
  368. </varlistentry>
  369. <varlistentry>
  370. <term><structfield>transdate</structfield></term>
  371. <listitem><para>
  372. <type>date</type>
  373. <literal>DEFAULT (&apos;now&apos;::text)::date</literal>
  374. </para>
  375. </listitem>
  376. </varlistentry>
  377. <varlistentry>
  378. <term><structfield>customer_id</structfield></term>
  379. <listitem><para>
  380. <type>integer</type>
  381. </para>
  382. </listitem>
  383. </varlistentry>
  384. <varlistentry>
  385. <term><structfield>taxincluded</structfield></term>
  386. <listitem><para>
  387. <type>boolean</type>
  388. </para>
  389. </listitem>
  390. </varlistentry>
  391. <varlistentry>
  392. <term><structfield>amount</structfield></term>
  393. <listitem><para>
  394. <type>numeric</type>
  395. </para>
  396. </listitem>
  397. </varlistentry>
  398. <varlistentry>
  399. <term><structfield>netamount</structfield></term>
  400. <listitem><para>
  401. <type>numeric</type>
  402. </para>
  403. </listitem>
  404. </varlistentry>
  405. <varlistentry>
  406. <term><structfield>paid</structfield></term>
  407. <listitem><para>
  408. <type>numeric</type>
  409. </para>
  410. </listitem>
  411. </varlistentry>
  412. <varlistentry>
  413. <term><structfield>datepaid</structfield></term>
  414. <listitem><para>
  415. <type>date</type>
  416. </para>
  417. </listitem>
  418. </varlistentry>
  419. <varlistentry>
  420. <term><structfield>duedate</structfield></term>
  421. <listitem><para>
  422. <type>date</type>
  423. </para>
  424. </listitem>
  425. </varlistentry>
  426. <varlistentry>
  427. <term><structfield>invoice</structfield></term>
  428. <listitem><para>
  429. <type>boolean</type>
  430. <literal>DEFAULT false</literal>
  431. </para>
  432. </listitem>
  433. </varlistentry>
  434. <varlistentry>
  435. <term><structfield>shippingpoint</structfield></term>
  436. <listitem><para>
  437. <type>text</type>
  438. </para>
  439. </listitem>
  440. </varlistentry>
  441. <varlistentry>
  442. <term><structfield>terms</structfield></term>
  443. <listitem><para>
  444. <type>smallint</type>
  445. </para>
  446. </listitem>
  447. </varlistentry>
  448. <varlistentry>
  449. <term><structfield>notes</structfield></term>
  450. <listitem><para>
  451. <type>text</type>
  452. </para>
  453. </listitem>
  454. </varlistentry>
  455. <varlistentry>
  456. <term><structfield>curr</structfield></term>
  457. <listitem><para>
  458. <type>character(3)</type>
  459. </para>
  460. </listitem>
  461. </varlistentry>
  462. <varlistentry>
  463. <term><structfield>ordnumber</structfield></term>
  464. <listitem><para>
  465. <type>text</type>
  466. </para>
  467. </listitem>
  468. </varlistentry>
  469. <varlistentry>
  470. <term><structfield>employee_id</structfield></term>
  471. <listitem><para>
  472. <type>integer</type>
  473. </para>
  474. </listitem>
  475. </varlistentry>
  476. <varlistentry>
  477. <term><structfield>till</structfield></term>
  478. <listitem><para>
  479. <type>character varying(20)</type>
  480. </para>
  481. </listitem>
  482. </varlistentry>
  483. <varlistentry>
  484. <term><structfield>quonumber</structfield></term>
  485. <listitem><para>
  486. <type>text</type>
  487. </para>
  488. </listitem>
  489. </varlistentry>
  490. <varlistentry>
  491. <term><structfield>intnotes</structfield></term>
  492. <listitem><para>
  493. <type>text</type>
  494. </para>
  495. </listitem>
  496. </varlistentry>
  497. <varlistentry>
  498. <term><structfield>department_id</structfield></term>
  499. <listitem><para>
  500. <type>integer</type>
  501. </para>
  502. </listitem>
  503. </varlistentry>
  504. <varlistentry>
  505. <term><structfield>shipvia</structfield></term>
  506. <listitem><para>
  507. <type>text</type>
  508. </para>
  509. </listitem>
  510. </varlistentry>
  511. <varlistentry>
  512. <term><structfield>language_code</structfield></term>
  513. <listitem><para>
  514. <type>character varying(6)</type>
  515. </para>
  516. </listitem>
  517. </varlistentry>
  518. <varlistentry>
  519. <term><structfield>ponumber</structfield></term>
  520. <listitem><para>
  521. <type>text</type>
  522. </para>
  523. </listitem>
  524. </varlistentry>
  525. </variablelist>
  526. <variablelist>
  527. <title>Indexes on ar</title>
  528. <varlistentry>
  529. <term>ar_customer_id_key</term>
  530. <listitem><para>customer_id</para></listitem>
  531. </varlistentry>
  532. <varlistentry>
  533. <term>ar_employee_id_key</term>
  534. <listitem><para>employee_id</para></listitem>
  535. </varlistentry>
  536. <varlistentry>
  537. <term>ar_id_key</term>
  538. <listitem><para>id</para></listitem>
  539. </varlistentry>
  540. <varlistentry>
  541. <term>ar_invnumber_key</term>
  542. <listitem><para>invnumber</para></listitem>
  543. </varlistentry>
  544. <varlistentry>
  545. <term>ar_ordnumber_key</term>
  546. <listitem><para>ordnumber</para></listitem>
  547. </varlistentry>
  548. <varlistentry>
  549. <term>ar_quonumber_key</term>
  550. <listitem><para>quonumber</para></listitem>
  551. </varlistentry>
  552. <varlistentry>
  553. <term>ar_transdate_key</term>
  554. <listitem><para>transdate</para></listitem>
  555. </varlistentry>
  556. </variablelist>
  557. </para>
  558. </section>
  559. <section id="public.table.assembly"
  560. xreflabel="public.assembly">
  561. <title id="public.table.assembly-title">
  562. Table:
  563. <structname>assembly</structname>
  564. </title>
  565. <para>
  566. <variablelist>
  567. <title>
  568. Structure of <structname>assembly</structname>
  569. </title>
  570. <varlistentry>
  571. <term><structfield>id</structfield></term>
  572. <listitem><para>
  573. <type>integer</type>
  574. <literal>PRIMARY KEY</literal>
  575. </para>
  576. </listitem>
  577. </varlistentry>
  578. <varlistentry>
  579. <term><structfield>parts_id</structfield></term>
  580. <listitem><para>
  581. <type>integer</type>
  582. <literal>PRIMARY KEY</literal>
  583. </para>
  584. </listitem>
  585. </varlistentry>
  586. <varlistentry>
  587. <term><structfield>qty</structfield></term>
  588. <listitem><para>
  589. <type>numeric</type>
  590. </para>
  591. </listitem>
  592. </varlistentry>
  593. <varlistentry>
  594. <term><structfield>bom</structfield></term>
  595. <listitem><para>
  596. <type>boolean</type>
  597. </para>
  598. </listitem>
  599. </varlistentry>
  600. <varlistentry>
  601. <term><structfield>adj</structfield></term>
  602. <listitem><para>
  603. <type>boolean</type>
  604. </para>
  605. </listitem>
  606. </varlistentry>
  607. </variablelist>
  608. <variablelist>
  609. <title>Indexes on assembly</title>
  610. <varlistentry>
  611. <term>assembly_id_key</term>
  612. <listitem><para>id</para></listitem>
  613. </varlistentry>
  614. </variablelist>
  615. </para>
  616. </section>
  617. <section id="public.table.audittrail"
  618. xreflabel="public.audittrail">
  619. <title id="public.table.audittrail-title">
  620. Table:
  621. <structname>audittrail</structname>
  622. </title>
  623. <para>
  624. <variablelist>
  625. <title>
  626. Structure of <structname>audittrail</structname>
  627. </title>
  628. <varlistentry>
  629. <term><structfield>trans_id</structfield></term>
  630. <listitem><para>
  631. <type>integer</type>
  632. </para>
  633. </listitem>
  634. </varlistentry>
  635. <varlistentry>
  636. <term><structfield>tablename</structfield></term>
  637. <listitem><para>
  638. <type>text</type>
  639. </para>
  640. </listitem>
  641. </varlistentry>
  642. <varlistentry>
  643. <term><structfield>reference</structfield></term>
  644. <listitem><para>
  645. <type>text</type>
  646. </para>
  647. </listitem>
  648. </varlistentry>
  649. <varlistentry>
  650. <term><structfield>formname</structfield></term>
  651. <listitem><para>
  652. <type>text</type>
  653. </para>
  654. </listitem>
  655. </varlistentry>
  656. <varlistentry>
  657. <term><structfield>action</structfield></term>
  658. <listitem><para>
  659. <type>text</type>
  660. </para>
  661. </listitem>
  662. </varlistentry>
  663. <varlistentry>
  664. <term><structfield>transdate</structfield></term>
  665. <listitem><para>
  666. <type>timestamp without time zone</type>
  667. <literal>DEFAULT now()</literal>
  668. </para>
  669. </listitem>
  670. </varlistentry>
  671. <varlistentry>
  672. <term><structfield>employee_id</structfield></term>
  673. <listitem><para>
  674. <type>integer</type>
  675. </para>
  676. </listitem>
  677. </varlistentry>
  678. <varlistentry>
  679. <term><structfield>entry_id</structfield></term>
  680. <listitem><para>
  681. <type>bigserial</type>
  682. <literal>PRIMARY KEY</literal>
  683. </para>
  684. </listitem>
  685. </varlistentry>
  686. </variablelist>
  687. <variablelist>
  688. <title>Indexes on audittrail</title>
  689. <varlistentry>
  690. <term>audittrail_trans_id_key</term>
  691. <listitem><para>trans_id</para></listitem>
  692. </varlistentry>
  693. </variablelist>
  694. </para>
  695. </section>
  696. <section id="public.table.business"
  697. xreflabel="public.business">
  698. <title id="public.table.business-title">
  699. Table:
  700. <structname>business</structname>
  701. </title>
  702. <para>
  703. <variablelist>
  704. <title>
  705. Structure of <structname>business</structname>
  706. </title>
  707. <varlistentry>
  708. <term><structfield>id</structfield></term>
  709. <listitem><para>
  710. <type>integer</type>
  711. <literal>PRIMARY KEY</literal>
  712. <literal>DEFAULT nextval(&apos;id&apos;::regclass)</literal>
  713. </para>
  714. </listitem>
  715. </varlistentry>
  716. <varlistentry>
  717. <term><structfield>description</structfield></term>
  718. <listitem><para>
  719. <type>text</type>
  720. </para>
  721. </listitem>
  722. </varlistentry>
  723. <varlistentry>
  724. <term><structfield>discount</structfield></term>
  725. <listitem><para>
  726. <type>numeric</type>
  727. </para>
  728. </listitem>
  729. </varlistentry>
  730. </variablelist>
  731. </para>
  732. </section>
  733. <section id="public.table.chart"
  734. xreflabel="public.chart">
  735. <title id="public.table.chart-title">
  736. Table:
  737. <structname>chart</structname>
  738. </title>
  739. <para>
  740. <variablelist>
  741. <title>
  742. Structure of <structname>chart</structname>
  743. </title>
  744. <varlistentry>
  745. <term><structfield>id</structfield></term>
  746. <listitem><para>
  747. <type>integer</type>
  748. <literal>PRIMARY KEY</literal>
  749. <literal>DEFAULT nextval(&apos;id&apos;::regclass)</literal>
  750. </para>
  751. </listitem>
  752. </varlistentry>
  753. <varlistentry>
  754. <term><structfield>accno</structfield></term>
  755. <listitem><para>
  756. <type>text</type>
  757. <literal>NOT NULL</literal>
  758. </para>
  759. </listitem>
  760. </varlistentry>
  761. <varlistentry>
  762. <term><structfield>description</structfield></term>
  763. <listitem><para>
  764. <type>text</type>
  765. </para>
  766. </listitem>
  767. </varlistentry>
  768. <varlistentry>
  769. <term><structfield>charttype</structfield></term>
  770. <listitem><para>
  771. <type>character(1)</type>
  772. <literal>DEFAULT &apos;A&apos;::bpchar</literal>
  773. </para>
  774. </listitem>
  775. </varlistentry>
  776. <varlistentry>
  777. <term><structfield>category</structfield></term>
  778. <listitem><para>
  779. <type>character(1)</type>
  780. </para>
  781. </listitem>
  782. </varlistentry>
  783. <varlistentry>
  784. <term><structfield>link</structfield></term>
  785. <listitem><para>
  786. <type>text</type>
  787. </para>
  788. </listitem>
  789. </varlistentry>
  790. <varlistentry>
  791. <term><structfield>gifi_accno</structfield></term>
  792. <listitem><para>
  793. <type>text</type>
  794. </para>
  795. </listitem>
  796. </varlistentry>
  797. <varlistentry>
  798. <term><structfield>contra</structfield></term>
  799. <listitem><para>
  800. <type>boolean</type>
  801. <literal>DEFAULT false</literal>
  802. </para>
  803. </listitem>
  804. </varlistentry>
  805. </variablelist>
  806. <variablelist>
  807. <title>Indexes on chart</title>
  808. <varlistentry>
  809. <term>chart_category_key</term>
  810. <listitem><para>category</para></listitem>
  811. </varlistentry>
  812. <varlistentry>
  813. <term>chart_gifi_accno_key</term>
  814. <listitem><para>gifi_accno</para></listitem>
  815. </varlistentry>
  816. <varlistentry>
  817. <term>chart_id_key</term>
  818. <listitem><para>id</para></listitem>
  819. </varlistentry>
  820. <varlistentry>
  821. <term>chart_link_key</term>
  822. <listitem><para>link</para></listitem>
  823. </varlistentry>
  824. </variablelist>
  825. <itemizedlist>
  826. <title>
  827. Tables referencing acc_trans via Foreign Key Constraints
  828. </title>
  829. <listitem>
  830. <para>
  831. <xref linkend="public.table.acc-trans"/>
  832. </para>
  833. </listitem>
  834. <listitem>
  835. <para>
  836. <xref linkend="public.table.partstax"/>
  837. </para>
  838. </listitem>
  839. <listitem>
  840. <para>
  841. <xref linkend="public.table.tax"/>
  842. </para>
  843. </listitem>
  844. </itemizedlist>
  845. </para>
  846. </section>
  847. <section id="public.table.custom-field-catalog"
  848. xreflabel="public.custom_field_catalog">
  849. <title id="public.table.custom-field-catalog-title">
  850. Table:
  851. <structname>custom_field_catalog</structname>
  852. </title>
  853. <para>
  854. <variablelist>
  855. <title>
  856. Structure of <structname>custom_field_catalog</structname>
  857. </title>
  858. <varlistentry>
  859. <term><structfield>field_id</structfield></term>
  860. <listitem><para>
  861. <type>serial</type>
  862. <literal>PRIMARY KEY</literal>
  863. </para>
  864. </listitem>
  865. </varlistentry>
  866. <varlistentry>
  867. <term><structfield>table_id</structfield></term>
  868. <listitem><para>
  869. <type>integer</type>
  870. <literal>REFERENCES</literal> <xref linkend="public.table.custom-table-catalog"/>
  871. </para>
  872. </listitem>
  873. </varlistentry>
  874. <varlistentry>
  875. <term><structfield>field_name</structfield></term>
  876. <listitem><para>
  877. <type>text</type>
  878. </para>
  879. </listitem>
  880. </varlistentry>
  881. </variablelist>
  882. </para>
  883. </section>
  884. <section id="public.table.custom-table-catalog"
  885. xreflabel="public.custom_table_catalog">
  886. <title id="public.table.custom-table-catalog-title">
  887. Table:
  888. <structname>custom_table_catalog</structname>
  889. </title>
  890. <para>
  891. <variablelist>
  892. <title>
  893. Structure of <structname>custom_table_catalog</structname>
  894. </title>
  895. <varlistentry>
  896. <term><structfield>table_id</structfield></term>
  897. <listitem><para>
  898. <type>serial</type>
  899. <literal>PRIMARY KEY</literal>
  900. </para>
  901. </listitem>
  902. </varlistentry>
  903. <varlistentry>
  904. <term><structfield>extends</structfield></term>
  905. <listitem><para>
  906. <type>text</type>
  907. </para>
  908. </listitem>
  909. </varlistentry>
  910. <varlistentry>
  911. <term><structfield>table_name</structfield></term>
  912. <listitem><para>
  913. <type>text</type>
  914. </para>
  915. </listitem>
  916. </varlistentry>
  917. </variablelist>
  918. <itemizedlist>
  919. <title>
  920. Tables referencing custom_field_catalog via Foreign Key Constraints
  921. </title>
  922. <listitem>
  923. <para>
  924. <xref linkend="public.table.custom-field-catalog"/>
  925. </para>
  926. </listitem>
  927. </itemizedlist>
  928. </para>
  929. </section>
  930. <section id="public.table.customer"
  931. xreflabel="public.customer">
  932. <title id="public.table.customer-title">
  933. Table:
  934. <structname>customer</structname>
  935. </title>
  936. <para>
  937. <variablelist>
  938. <title>
  939. Structure of <structname>customer</structname>
  940. </title>
  941. <varlistentry>
  942. <term><structfield>id</structfield></term>
  943. <listitem><para>
  944. <type>integer</type>
  945. <literal>PRIMARY KEY</literal>
  946. <literal>DEFAULT nextval(&apos;id&apos;::regclass)</literal>
  947. </para>
  948. </listitem>
  949. </varlistentry>
  950. <varlistentry>
  951. <term><structfield>name</structfield></term>
  952. <listitem><para>
  953. <type>character varying(64)</type>
  954. </para>
  955. </listitem>
  956. </varlistentry>
  957. <varlistentry>
  958. <term><structfield>address1</structfield></term>
  959. <listitem><para>
  960. <type>character varying(32)</type>
  961. </para>
  962. </listitem>
  963. </varlistentry>
  964. <varlistentry>
  965. <term><structfield>address2</structfield></term>
  966. <listitem><para>
  967. <type>character varying(32)</type>
  968. </para>
  969. </listitem>
  970. </varlistentry>
  971. <varlistentry>
  972. <term><structfield>city</structfield></term>
  973. <listitem><para>
  974. <type>character varying(32)</type>
  975. </para>
  976. </listitem>
  977. </varlistentry>
  978. <varlistentry>
  979. <term><structfield>state</structfield></term>
  980. <listitem><para>
  981. <type>character varying(32)</type>
  982. </para>
  983. </listitem>
  984. </varlistentry>
  985. <varlistentry>
  986. <term><structfield>zipcode</structfield></term>
  987. <listitem><para>
  988. <type>character varying(10)</type>
  989. </para>
  990. </listitem>
  991. </varlistentry>
  992. <varlistentry>
  993. <term><structfield>country</structfield></term>
  994. <listitem><para>
  995. <type>character varying(32)</type>
  996. </para>
  997. </listitem>
  998. </varlistentry>
  999. <varlistentry>
  1000. <term><structfield>contact</structfield></term>
  1001. <listitem><para>
  1002. <type>character varying(64)</type>
  1003. </para>
  1004. </listitem>
  1005. </varlistentry>
  1006. <varlistentry>
  1007. <term><structfield>phone</structfield></term>
  1008. <listitem><para>
  1009. <type>character varying(20)</type>
  1010. </para>
  1011. </listitem>
  1012. </varlistentry>
  1013. <varlistentry>
  1014. <term><structfield>fax</structfield></term>
  1015. <listitem><para>
  1016. <type>character varying(20)</type>
  1017. </para>
  1018. </listitem>
  1019. </varlistentry>
  1020. <varlistentry>
  1021. <term><structfield>email</structfield></term>
  1022. <listitem><para>
  1023. <type>text</type>
  1024. </para>
  1025. </listitem>
  1026. </varlistentry>
  1027. <varlistentry>
  1028. <term><structfield>notes</structfield></term>
  1029. <listitem><para>
  1030. <type>text</type>
  1031. </para>
  1032. </listitem>
  1033. </varlistentry>
  1034. <varlistentry>
  1035. <term><structfield>discount</structfield></term>
  1036. <listitem><para>
  1037. <type>numeric</type>
  1038. </para>
  1039. </listitem>
  1040. </varlistentry>
  1041. <varlistentry>
  1042. <term><structfield>taxincluded</structfield></term>
  1043. <listitem><para>
  1044. <type>boolean</type>
  1045. <literal>DEFAULT false</literal>
  1046. </para>
  1047. </listitem>
  1048. </varlistentry>
  1049. <varlistentry>
  1050. <term><structfield>creditlimit</structfield></term>
  1051. <listitem><para>
  1052. <type>numeric</type>
  1053. </para>
  1054. </listitem>
  1055. </varlistentry>
  1056. <varlistentry>
  1057. <term><structfield>terms</structfield></term>
  1058. <listitem><para>
  1059. <type>smallint</type>
  1060. </para>
  1061. </listitem>
  1062. </varlistentry>
  1063. <varlistentry>
  1064. <term><structfield>customernumber</structfield></term>
  1065. <listitem><para>
  1066. <type>character varying(32)</type>
  1067. </para>
  1068. </listitem>
  1069. </varlistentry>
  1070. <varlistentry>
  1071. <term><structfield>cc</structfield></term>
  1072. <listitem><para>
  1073. <type>text</type>
  1074. </para>
  1075. </listitem>
  1076. </varlistentry>
  1077. <varlistentry>
  1078. <term><structfield>bcc</structfield></term>
  1079. <listitem><para>
  1080. <type>text</type>
  1081. </para>
  1082. </listitem>
  1083. </varlistentry>
  1084. <varlistentry>
  1085. <term><structfield>business_id</structfield></term>
  1086. <listitem><para>
  1087. <type>integer</type>
  1088. </para>
  1089. </listitem>
  1090. </varlistentry>
  1091. <varlistentry>
  1092. <term><structfield>taxnumber</structfield></term>
  1093. <listitem><para>
  1094. <type>character varying(32)</type>
  1095. </para>
  1096. </listitem>
  1097. </varlistentry>
  1098. <varlistentry>
  1099. <term><structfield>sic_code</structfield></term>
  1100. <listitem><para>
  1101. <type>character varying(6)</type>
  1102. </para>
  1103. </listitem>
  1104. </varlistentry>
  1105. <varlistentry>
  1106. <term><structfield>iban</structfield></term>
  1107. <listitem><para>
  1108. <type>character varying(34)</type>
  1109. </para>
  1110. </listitem>
  1111. </varlistentry>
  1112. <varlistentry>
  1113. <term><structfield>bic</structfield></term>
  1114. <listitem><para>
  1115. <type>character varying(11)</type>
  1116. </para>
  1117. </listitem>
  1118. </varlistentry>
  1119. <varlistentry>
  1120. <term><structfield>employee_id</structfield></term>
  1121. <listitem><para>
  1122. <type>integer</type>
  1123. </para>
  1124. </listitem>
  1125. </varlistentry>
  1126. <varlistentry>
  1127. <term><structfield>language_code</structfield></term>
  1128. <listitem><para>
  1129. <type>character varying(6)</type>
  1130. </para>
  1131. </listitem>
  1132. </varlistentry>
  1133. <varlistentry>
  1134. <term><structfield>pricegroup_id</structfield></term>
  1135. <listitem><para>
  1136. <type>integer</type>
  1137. </para>
  1138. </listitem>
  1139. </varlistentry>
  1140. <varlistentry>
  1141. <term><structfield>curr</structfield></term>
  1142. <listitem><para>
  1143. <type>character(3)</type>
  1144. </para>
  1145. </listitem>
  1146. </varlistentry>
  1147. <varlistentry>
  1148. <term><structfield>startdate</structfield></term>
  1149. <listitem><para>
  1150. <type>date</type>
  1151. </para>
  1152. </listitem>
  1153. </varlistentry>
  1154. <varlistentry>
  1155. <term><structfield>enddate</structfield></term>
  1156. <listitem><para>
  1157. <type>date</type>
  1158. </para>
  1159. </listitem>
  1160. </varlistentry>
  1161. </variablelist>
  1162. <variablelist>
  1163. <title>Indexes on customer</title>
  1164. <varlistentry>
  1165. <term>customer_contact_key</term>
  1166. <listitem><para>lower((contact)::text)</para></listitem>
  1167. </varlistentry>
  1168. <varlistentry>
  1169. <term>customer_customernumber_key</term>
  1170. <listitem><para>customernumber</para></listitem>
  1171. </varlistentry>
  1172. <varlistentry>
  1173. <term>customer_id_key</term>
  1174. <listitem><para>id</para></listitem>
  1175. </varlistentry>
  1176. <varlistentry>
  1177. <term>customer_name_key</term>
  1178. <listitem><para>lower((name)::text)</para></listitem>
  1179. </varlistentry>
  1180. </variablelist>
  1181. </para>
  1182. </section>
  1183. <section id="public.table.customertax"
  1184. xreflabel="public.customertax">
  1185. <title id="public.table.customertax-title">
  1186. Table:
  1187. <structname>customertax</structname>
  1188. </title>
  1189. <para>
  1190. <variablelist>
  1191. <title>
  1192. Structure of <structname>customertax</structname>
  1193. </title>
  1194. <varlistentry>
  1195. <term><structfield>customer_id</structfield></term>
  1196. <listitem><para>
  1197. <type>integer</type>
  1198. <literal>PRIMARY KEY</literal>
  1199. </para>
  1200. </listitem>
  1201. </varlistentry>
  1202. <varlistentry>
  1203. <term><structfield>chart_id</structfield></term>
  1204. <listitem><para>
  1205. <type>integer</type>
  1206. <literal>PRIMARY KEY</literal>
  1207. </para>
  1208. </listitem>
  1209. </varlistentry>
  1210. </variablelist>
  1211. <variablelist>
  1212. <title>Indexes on customertax</title>
  1213. <varlistentry>
  1214. <term>customer_customer_id_key</term>
  1215. <listitem><para>customer_id</para></listitem>
  1216. </varlistentry>
  1217. </variablelist>
  1218. </para>
  1219. </section>
  1220. <section id="public.table.defaults"
  1221. xreflabel="public.defaults">
  1222. <title id="public.table.defaults-title">
  1223. Table:
  1224. <structname>defaults</structname>
  1225. </title>
  1226. <para>
  1227. <variablelist>
  1228. <title>
  1229. Structure of <structname>defaults</structname>
  1230. </title>
  1231. <varlistentry>
  1232. <term><structfield>setting_key</structfield></term>
  1233. <listitem><para>
  1234. <type>text</type>
  1235. <literal>PRIMARY KEY</literal>
  1236. </para>
  1237. </listitem>
  1238. </varlistentry>
  1239. <varlistentry>
  1240. <term><structfield>value</structfield></term>
  1241. <listitem><para>
  1242. <type>text</type>
  1243. </para>
  1244. </listitem>
  1245. </varlistentry>
  1246. </variablelist>
  1247. </para>
  1248. </section>
  1249. <section id="public.table.department"
  1250. xreflabel="public.department">
  1251. <title id="public.table.department-title">
  1252. Table:
  1253. <structname>department</structname>
  1254. </title>
  1255. <para>
  1256. <variablelist>
  1257. <title>
  1258. Structure of <structname>department</structname>
  1259. </title>
  1260. <varlistentry>
  1261. <term><structfield>id</structfield></term>
  1262. <listitem><para>
  1263. <type>integer</type>
  1264. <literal>PRIMARY KEY</literal>
  1265. <literal>DEFAULT nextval(&apos;id&apos;::regclass)</literal>
  1266. </para>
  1267. </listitem>
  1268. </varlistentry>
  1269. <varlistentry>
  1270. <term><structfield>description</structfield></term>
  1271. <listitem><para>
  1272. <type>text</type>
  1273. </para>
  1274. </listitem>
  1275. </varlistentry>
  1276. <varlistentry>
  1277. <term><structfield>role</structfield></term>
  1278. <listitem><para>
  1279. <type>character(1)</type>
  1280. <literal>DEFAULT &apos;P&apos;::bpchar</literal>
  1281. </para>
  1282. </listitem>
  1283. </varlistentry>
  1284. </variablelist>
  1285. <variablelist>
  1286. <title>Indexes on department</title>
  1287. <varlistentry>
  1288. <term>department_id_key</term>
  1289. <listitem><para>id</para></listitem>
  1290. </varlistentry>
  1291. </variablelist>
  1292. </para>
  1293. </section>
  1294. <section id="public.table.dpt-trans"
  1295. xreflabel="public.dpt_trans">
  1296. <title id="public.table.dpt-trans-title">
  1297. Table:
  1298. <structname>dpt_trans</structname>
  1299. </title>
  1300. <para>
  1301. <variablelist>
  1302. <title>
  1303. Structure of <structname>dpt_trans</structname>
  1304. </title>
  1305. <varlistentry>
  1306. <term><structfield>trans_id</structfield></term>
  1307. <listitem><para>
  1308. <type>integer</type>
  1309. <literal>PRIMARY KEY</literal>
  1310. </para>
  1311. </listitem>
  1312. </varlistentry>
  1313. <varlistentry>
  1314. <term><structfield>department_id</structfield></term>
  1315. <listitem><para>
  1316. <type>integer</type>
  1317. </para>
  1318. </listitem>
  1319. </varlistentry>
  1320. </variablelist>
  1321. </para>
  1322. </section>
  1323. <section id="public.table.employee"
  1324. xreflabel="public.employee">
  1325. <title id="public.table.employee-title">
  1326. Table:
  1327. <structname>employee</structname>
  1328. </title>
  1329. <para>
  1330. <variablelist>
  1331. <title>
  1332. Structure of <structname>employee</structname>
  1333. </title>
  1334. <varlistentry>
  1335. <term><structfield>id</structfield></term>
  1336. <listitem><para>
  1337. <type>integer</type>
  1338. <literal>PRIMARY KEY</literal>
  1339. <literal>DEFAULT nextval(&apos;id&apos;::regclass)</literal>
  1340. </para>
  1341. </listitem>
  1342. </varlistentry>
  1343. <varlistentry>
  1344. <term><structfield>login</structfield></term>
  1345. <listitem><para>
  1346. <type>text</type>
  1347. </para>
  1348. </listitem>
  1349. </varlistentry>
  1350. <varlistentry>
  1351. <term><structfield>name</structfield></term>
  1352. <listitem><para>
  1353. <type>character varying(64)</type>
  1354. </para>
  1355. </listitem>
  1356. </varlistentry>
  1357. <varlistentry>
  1358. <term><structfield>address1</structfield></term>
  1359. <listitem><para>
  1360. <type>character varying(32)</type>
  1361. </para>
  1362. </listitem>
  1363. </varlistentry>
  1364. <varlistentry>
  1365. <term><structfield>address2</structfield></term>
  1366. <listitem><para>
  1367. <type>character varying(32)</type>
  1368. </para>
  1369. </listitem>
  1370. </varlistentry>
  1371. <varlistentry>
  1372. <term><structfield>city</structfield></term>
  1373. <listitem><para>
  1374. <type>character varying(32)</type>
  1375. </para>
  1376. </listitem>
  1377. </varlistentry>
  1378. <varlistentry>
  1379. <term><structfield>state</structfield></term>
  1380. <listitem><para>
  1381. <type>character varying(32)</type>
  1382. </para>
  1383. </listitem>
  1384. </varlistentry>
  1385. <varlistentry>
  1386. <term><structfield>zipcode</structfield></term>
  1387. <listitem><para>
  1388. <type>character varying(10)</type>
  1389. </para>
  1390. </listitem>
  1391. </varlistentry>
  1392. <varlistentry>
  1393. <term><structfield>country</structfield></term>
  1394. <listitem><para>
  1395. <type>character varying(32)</type>
  1396. </para>
  1397. </listitem>
  1398. </varlistentry>
  1399. <varlistentry>
  1400. <term><structfield>workphone</structfield></term>
  1401. <listitem><para>
  1402. <type>character varying(20)</type>
  1403. </para>
  1404. </listitem>
  1405. </varlistentry>
  1406. <varlistentry>
  1407. <term><structfield>homephone</structfield></term>
  1408. <listitem><para>
  1409. <type>character varying(20)</type>
  1410. </para>
  1411. </listitem>
  1412. </varlistentry>
  1413. <varlistentry>
  1414. <term><structfield>startdate</structfield></term>
  1415. <listitem><para>
  1416. <type>date</type>
  1417. <literal>DEFAULT (&apos;now&apos;::text)::date</literal>
  1418. </para>
  1419. </listitem>
  1420. </varlistentry>
  1421. <varlistentry>
  1422. <term><structfield>enddate</structfield></term>
  1423. <listitem><para>
  1424. <type>date</type>
  1425. </para>
  1426. </listitem>
  1427. </varlistentry>
  1428. <varlistentry>
  1429. <term><structfield>notes</structfield></term>
  1430. <listitem><para>
  1431. <type>text</type>
  1432. </para>
  1433. </listitem>
  1434. </varlistentry>
  1435. <varlistentry>
  1436. <term><structfield>role</structfield></term>
  1437. <listitem><para>
  1438. <type>character varying(20)</type>
  1439. </para>
  1440. </listitem>
  1441. </varlistentry>
  1442. <varlistentry>
  1443. <term><structfield>sales</structfield></term>
  1444. <listitem><para>
  1445. <type>boolean</type>
  1446. <literal>DEFAULT false</literal>
  1447. </para>
  1448. </listitem>
  1449. </varlistentry>
  1450. <varlistentry>
  1451. <term><structfield>email</structfield></term>
  1452. <listitem><para>
  1453. <type>text</type>
  1454. </para>
  1455. </listitem>
  1456. </varlistentry>
  1457. <varlistentry>
  1458. <term><structfield>ssn</structfield></term>
  1459. <listitem><para>
  1460. <type>character varying(20)</type>
  1461. </para>
  1462. </listitem>
  1463. </varlistentry>
  1464. <varlistentry>
  1465. <term><structfield>iban</structfield></term>
  1466. <listitem><para>
  1467. <type>character varying(34)</type>
  1468. </para>
  1469. </listitem>
  1470. </varlistentry>
  1471. <varlistentry>
  1472. <term><structfield>bic</structfield></term>
  1473. <listitem><para>
  1474. <type>character varying(11)</type>
  1475. </para>
  1476. </listitem>
  1477. </varlistentry>
  1478. <varlistentry>
  1479. <term><structfield>managerid</structfield></term>
  1480. <listitem><para>
  1481. <type>integer</type>
  1482. </para>
  1483. </listitem>
  1484. </varlistentry>
  1485. <varlistentry>
  1486. <term><structfield>employeenumber</structfield></term>
  1487. <listitem><para>
  1488. <type>character varying(32)</type>
  1489. </para>
  1490. </listitem>
  1491. </varlistentry>
  1492. <varlistentry>
  1493. <term><structfield>dob</structfield></term>
  1494. <listitem><para>
  1495. <type>date</type>
  1496. </para>
  1497. </listitem>
  1498. </varlistentry>
  1499. </variablelist>
  1500. <variablelist>
  1501. <title>Indexes on employee</title>
  1502. <varlistentry>
  1503. <term>employee_id_key</term>
  1504. <listitem><para>id</para></listitem>
  1505. </varlistentry>
  1506. <varlistentry>
  1507. <term>employee_name_key</term>
  1508. <listitem><para>lower((name)::text)</para></listitem>
  1509. </varlistentry>
  1510. </variablelist>
  1511. </para>
  1512. </section>
  1513. <section id="public.table.exchangerate"
  1514. xreflabel="public.exchangerate">
  1515. <title id="public.table.exchangerate-title">
  1516. Table:
  1517. <structname>exchangerate</structname>
  1518. </title>
  1519. <para>
  1520. <variablelist>
  1521. <title>
  1522. Structure of <structname>exchangerate</structname>
  1523. </title>
  1524. <varlistentry>
  1525. <term><structfield>curr</structfield></term>
  1526. <listitem><para>
  1527. <type>character(3)</type>
  1528. <literal>PRIMARY KEY</literal>
  1529. </para>
  1530. </listitem>
  1531. </varlistentry>
  1532. <varlistentry>
  1533. <term><structfield>transdate</structfield></term>
  1534. <listitem><para>
  1535. <type>date</type>
  1536. <literal>PRIMARY KEY</literal>
  1537. </para>
  1538. </listitem>
  1539. </varlistentry>
  1540. <varlistentry>
  1541. <term><structfield>buy</structfield></term>
  1542. <listitem><para>
  1543. <type>numeric</type>
  1544. </para>
  1545. </listitem>
  1546. </varlistentry>
  1547. <varlistentry>
  1548. <term><structfield>sell</structfield></term>
  1549. <listitem><para>
  1550. <type>numeric</type>
  1551. </para>
  1552. </listitem>
  1553. </varlistentry>
  1554. </variablelist>
  1555. <variablelist>
  1556. <title>Indexes on exchangerate</title>
  1557. <varlistentry>
  1558. <term>exchangerate_ct_key</term>
  1559. <listitem><para>curr, transdate</para></listitem>
  1560. </varlistentry>
  1561. </variablelist>
  1562. </para>
  1563. </section>
  1564. <section id="public.table.gifi"
  1565. xreflabel="public.gifi">
  1566. <title id="public.table.gifi-title">
  1567. Table:
  1568. <structname>gifi</structname>
  1569. </title>
  1570. <para>
  1571. <variablelist>
  1572. <title>
  1573. Structure of <structname>gifi</structname>
  1574. </title>
  1575. <varlistentry>
  1576. <term><structfield>accno</structfield></term>
  1577. <listitem><para>
  1578. <type>text</type>
  1579. <literal>PRIMARY KEY</literal>
  1580. </para>
  1581. </listitem>
  1582. </varlistentry>
  1583. <varlistentry>
  1584. <term><structfield>description</structfield></term>
  1585. <listitem><para>
  1586. <type>text</type>
  1587. </para>
  1588. </listitem>
  1589. </varlistentry>
  1590. </variablelist>
  1591. </para>
  1592. </section>
  1593. <section id="public.table.gl"
  1594. xreflabel="public.gl">
  1595. <title id="public.table.gl-title">
  1596. Table:
  1597. <structname>gl</structname>
  1598. </title>
  1599. <para>
  1600. <variablelist>
  1601. <title>
  1602. Structure of <structname>gl</structname>
  1603. </title>
  1604. <varlistentry>
  1605. <term><structfield>id</structfield></term>
  1606. <listitem><para>
  1607. <type>integer</type>
  1608. <literal>PRIMARY KEY</literal>
  1609. <literal>DEFAULT nextval(&apos;id&apos;::regclass)</literal>
  1610. </para>
  1611. </listitem>
  1612. </varlistentry>
  1613. <varlistentry>
  1614. <term><structfield>reference</structfield></term>
  1615. <listitem><para>
  1616. <type>text</type>
  1617. </para>
  1618. </listitem>
  1619. </varlistentry>
  1620. <varlistentry>
  1621. <term><structfield>description</structfield></term>
  1622. <listitem><para>
  1623. <type>text</type>
  1624. </para>
  1625. </listitem>
  1626. </varlistentry>
  1627. <varlistentry>
  1628. <term><structfield>transdate</structfield></term>
  1629. <listitem><para>
  1630. <type>date</type>
  1631. <literal>DEFAULT (&apos;now&apos;::text)::date</literal>
  1632. </para>
  1633. </listitem>
  1634. </varlistentry>
  1635. <varlistentry>
  1636. <term><structfield>employee_id</structfield></term>
  1637. <listitem><para>
  1638. <type>integer</type>
  1639. </para>
  1640. </listitem>
  1641. </varlistentry>
  1642. <varlistentry>
  1643. <term><structfield>notes</structfield></term>
  1644. <listitem><para>
  1645. <type>text</type>
  1646. </para>
  1647. </listitem>
  1648. </varlistentry>
  1649. <varlistentry>
  1650. <term><structfield>department_id</structfield></term>
  1651. <listitem><para>
  1652. <type>integer</type>
  1653. </para>
  1654. </listitem>
  1655. </varlistentry>
  1656. </variablelist>
  1657. <variablelist>
  1658. <title>Indexes on gl</title>
  1659. <varlistentry>
  1660. <term>gl_description_key</term>
  1661. <listitem><para>lower(description)</para></listitem>
  1662. </varlistentry>
  1663. <varlistentry>
  1664. <term>gl_employee_id_key</term>
  1665. <listitem><para>employee_id</para></listitem>
  1666. </varlistentry>
  1667. <varlistentry>
  1668. <term>gl_id_key</term>
  1669. <listitem><para>id</para></listitem>
  1670. </varlistentry>
  1671. <varlistentry>
  1672. <term>gl_reference_key</term>
  1673. <listitem><para>reference</para></listitem>
  1674. </varlistentry>
  1675. <varlistentry>
  1676. <term>gl_transdate_key</term>
  1677. <listitem><para>transdate</para></listitem>
  1678. </varlistentry>
  1679. </variablelist>
  1680. </para>
  1681. </section>
  1682. <section id="public.table.inventory"
  1683. xreflabel="public.inventory">
  1684. <title id="public.table.inventory-title">
  1685. Table:
  1686. <structname>inventory</structname>
  1687. </title>
  1688. <para>
  1689. <variablelist>
  1690. <title>
  1691. Structure of <structname>inventory</structname>
  1692. </title>
  1693. <varlistentry>
  1694. <term><structfield>warehouse_id</structfield></term>
  1695. <listitem><para>
  1696. <type>integer</type>
  1697. </para>
  1698. </listitem>
  1699. </varlistentry>
  1700. <varlistentry>
  1701. <term><structfield>parts_id</structfield></term>
  1702. <listitem><para>
  1703. <type>integer</type>
  1704. </para>
  1705. </listitem>
  1706. </varlistentry>
  1707. <varlistentry>
  1708. <term><structfield>trans_id</structfield></term>
  1709. <listitem><para>
  1710. <type>integer</type>
  1711. </para>
  1712. </listitem>
  1713. </varlistentry>
  1714. <varlistentry>
  1715. <term><structfield>orderitems_id</structfield></term>
  1716. <listitem><para>
  1717. <type>integer</type>
  1718. </para>
  1719. </listitem>
  1720. </varlistentry>
  1721. <varlistentry>
  1722. <term><structfield>qty</structfield></term>
  1723. <listitem><para>
  1724. <type>numeric</type>
  1725. </para>
  1726. </listitem>
  1727. </varlistentry>
  1728. <varlistentry>
  1729. <term><structfield>shippingdate</structfield></term>
  1730. <listitem><para>
  1731. <type>date</type>
  1732. </para>
  1733. </listitem>
  1734. </varlistentry>
  1735. <varlistentry>
  1736. <term><structfield>employee_id</structfield></term>
  1737. <listitem><para>
  1738. <type>integer</type>
  1739. </para>
  1740. </listitem>
  1741. </varlistentry>
  1742. <varlistentry>
  1743. <term><structfield>entry_id</structfield></term>
  1744. <listitem><para>
  1745. <type>serial</type>
  1746. <literal>PRIMARY KEY</literal>
  1747. </para>
  1748. </listitem>
  1749. </varlistentry>
  1750. </variablelist>
  1751. </para>
  1752. </section>
  1753. <section id="public.table.invoice"
  1754. xreflabel="public.invoice">
  1755. <title id="public.table.invoice-title">
  1756. Table:
  1757. <structname>invoice</structname>
  1758. </title>
  1759. <para>
  1760. <variablelist>
  1761. <title>
  1762. Structure of <structname>invoice</structname>
  1763. </title>
  1764. <varlistentry>
  1765. <term><structfield>id</structfield></term>
  1766. <listitem><para>
  1767. <type>integer</type>
  1768. <literal>PRIMARY KEY</literal>
  1769. <literal>DEFAULT nextval(&apos;invoiceid&apos;::regclass)</literal>
  1770. </para>
  1771. </listitem>
  1772. </varlistentry>
  1773. <varlistentry>
  1774. <term><structfield>trans_id</structfield></term>
  1775. <listitem><para>
  1776. <type>integer</type>
  1777. </para>
  1778. </listitem>
  1779. </varlistentry>
  1780. <varlistentry>
  1781. <term><structfield>parts_id</structfield></term>
  1782. <listitem><para>
  1783. <type>integer</type>
  1784. </para>
  1785. </listitem>
  1786. </varlistentry>
  1787. <varlistentry>
  1788. <term><structfield>description</structfield></term>
  1789. <listitem><para>
  1790. <type>text</type>
  1791. </para>
  1792. </listitem>
  1793. </varlistentry>
  1794. <varlistentry>
  1795. <term><structfield>qty</structfield></term>
  1796. <listitem><para>
  1797. <type>integer</type>
  1798. </para>
  1799. </listitem>
  1800. </varlistentry>
  1801. <varlistentry>
  1802. <term><structfield>allocated</structfield></term>
  1803. <listitem><para>
  1804. <type>integer</type>
  1805. </para>
  1806. </listitem>
  1807. </varlistentry>
  1808. <varlistentry>
  1809. <term><structfield>sellprice</structfield></term>
  1810. <listitem><para>
  1811. <type>numeric</type>
  1812. </para>
  1813. </listitem>
  1814. </varlistentry>
  1815. <varlistentry>
  1816. <term><structfield>fxsellprice</structfield></term>
  1817. <listitem><para>
  1818. <type>numeric</type>
  1819. </para>
  1820. </listitem>
  1821. </varlistentry>
  1822. <varlistentry>
  1823. <term><structfield>discount</structfield></term>
  1824. <listitem><para>
  1825. <type>real</type>
  1826. </para>
  1827. </listitem>
  1828. </varlistentry>
  1829. <varlistentry>
  1830. <term><structfield>assemblyitem</structfield></term>
  1831. <listitem><para>
  1832. <type>boolean</type>
  1833. <literal>DEFAULT false</literal>
  1834. </para>
  1835. </listitem>
  1836. </varlistentry>
  1837. <varlistentry>
  1838. <term><structfield>unit</structfield></term>
  1839. <listitem><para>
  1840. <type>character varying(5)</type>
  1841. </para>
  1842. </listitem>
  1843. </varlistentry>
  1844. <varlistentry>
  1845. <term><structfield>project_id</structfield></term>
  1846. <listitem><para>
  1847. <type>integer</type>
  1848. </para>
  1849. </listitem>
  1850. </varlistentry>
  1851. <varlistentry>
  1852. <term><structfield>deliverydate</structfield></term>
  1853. <listitem><para>
  1854. <type>date</type>
  1855. </para>
  1856. </listitem>
  1857. </varlistentry>
  1858. <varlistentry>
  1859. <term><structfield>serialnumber</structfield></term>
  1860. <listitem><para>
  1861. <type>text</type>
  1862. </para>
  1863. </listitem>
  1864. </varlistentry>
  1865. <varlistentry>
  1866. <term><structfield>notes</structfield></term>
  1867. <listitem><para>
  1868. <type>text</type>
  1869. </para>
  1870. </listitem>
  1871. </varlistentry>
  1872. </variablelist>
  1873. <variablelist>
  1874. <title>Indexes on invoice</title>
  1875. <varlistentry>
  1876. <term>invoice_id_key</term>
  1877. <listitem><para>id</para></listitem>
  1878. </varlistentry>
  1879. <varlistentry>
  1880. <term>invoice_trans_id_key</term>
  1881. <listitem><para>trans_id</para></listitem>
  1882. </varlistentry>
  1883. </variablelist>
  1884. </para>
  1885. </section>
  1886. <section id="public.table.jcitems"
  1887. xreflabel="public.jcitems">
  1888. <title id="public.table.jcitems-title">
  1889. Table:
  1890. <structname>jcitems</structname>
  1891. </title>
  1892. <para>
  1893. <variablelist>
  1894. <title>
  1895. Structure of <structname>jcitems</structname>
  1896. </title>
  1897. <varlistentry>
  1898. <term><structfield>id</structfield></term>
  1899. <listitem><para>
  1900. <type>integer</type>
  1901. <literal>PRIMARY KEY</literal>
  1902. <literal>DEFAULT nextval(&apos;jcitemsid&apos;::regclass)</literal>
  1903. </para>
  1904. </listitem>
  1905. </varlistentry>
  1906. <varlistentry>
  1907. <term><structfield>project_id</structfield></term>
  1908. <listitem><para>
  1909. <type>integer</type>
  1910. </para>
  1911. </listitem>
  1912. </varlistentry>
  1913. <varlistentry>
  1914. <term><structfield>parts_id</structfield></term>
  1915. <listitem><para>
  1916. <type>integer</type>
  1917. </para>
  1918. </listitem>
  1919. </varlistentry>
  1920. <varlistentry>
  1921. <term><structfield>description</structfield></term>
  1922. <listitem><para>
  1923. <type>text</type>
  1924. </para>
  1925. </listitem>
  1926. </varlistentry>
  1927. <varlistentry>
  1928. <term><structfield>qty</structfield></term>
  1929. <listitem><para>
  1930. <type>numeric</type>
  1931. </para>
  1932. </listitem>
  1933. </varlistentry>
  1934. <varlistentry>
  1935. <term><structfield>allocated</structfield></term>
  1936. <listitem><para>
  1937. <type>numeric</type>
  1938. </para>
  1939. </listitem>
  1940. </varlistentry>
  1941. <varlistentry>
  1942. <term><structfield>sellprice</structfield></term>
  1943. <listitem><para>
  1944. <type>numeric</type>
  1945. </para>
  1946. </listitem>
  1947. </varlistentry>
  1948. <varlistentry>
  1949. <term><structfield>fxsellprice</structfield></term>
  1950. <listitem><para>
  1951. <type>numeric</type>
  1952. </para>
  1953. </listitem>
  1954. </varlistentry>
  1955. <varlistentry>
  1956. <term><structfield>serialnumber</structfield></term>
  1957. <listitem><para>
  1958. <type>text</type>
  1959. </para>
  1960. </listitem>
  1961. </varlistentry>
  1962. <varlistentry>
  1963. <term><structfield>checkedin</structfield></term>
  1964. <listitem><para>
  1965. <type>timestamp with time zone</type>
  1966. </para>
  1967. </listitem>
  1968. </varlistentry>
  1969. <varlistentry>
  1970. <term><structfield>checkedout</structfield></term>
  1971. <listitem><para>
  1972. <type>timestamp with time zone</type>
  1973. </para>
  1974. </listitem>
  1975. </varlistentry>
  1976. <varlistentry>
  1977. <term><structfield>employee_id</structfield></term>
  1978. <listitem><para>
  1979. <type>integer</type>
  1980. </para>
  1981. </listitem>
  1982. </varlistentry>
  1983. <varlistentry>
  1984. <term><structfield>notes</structfield></term>
  1985. <listitem><para>
  1986. <type>text</type>
  1987. </para>
  1988. </listitem>
  1989. </varlistentry>
  1990. </variablelist>
  1991. <variablelist>
  1992. <title>Indexes on jcitems</title>
  1993. <varlistentry>
  1994. <term>jcitems_id_key</term>
  1995. <listitem><para>id</para></listitem>
  1996. </varlistentry>
  1997. </variablelist>
  1998. </para>
  1999. </section>
  2000. <section id="public.table.language"
  2001. xreflabel="public.language">
  2002. <title id="public.table.language-title">
  2003. Table:
  2004. <structname>language</structname>
  2005. </title>
  2006. <para>
  2007. <variablelist>
  2008. <title>
  2009. Structure of <structname>language</structname>
  2010. </title>
  2011. <varlistentry>
  2012. <term><structfield>code</structfield></term>
  2013. <listitem><para>
  2014. <type>character varying(6)</type>
  2015. <literal>PRIMARY KEY</literal>
  2016. </para>
  2017. </listitem>
  2018. </varlistentry>
  2019. <varlistentry>
  2020. <term><structfield>description</structfield></term>
  2021. <listitem><para>
  2022. <type>text</type>
  2023. </para>
  2024. </listitem>
  2025. </varlistentry>
  2026. </variablelist>
  2027. </para>
  2028. </section>
  2029. <section id="public.table.makemodel"
  2030. xreflabel="public.makemodel">
  2031. <title id="public.table.makemodel-title">
  2032. Table:
  2033. <structname>makemodel</structname>
  2034. </title>
  2035. <para>
  2036. <variablelist>
  2037. <title>
  2038. Structure of <structname>makemodel</structname>
  2039. </title>
  2040. <varlistentry>
  2041. <term><structfield>parts_id</structfield></term>
  2042. <listitem><para>
  2043. <type>integer</type>
  2044. <literal>PRIMARY KEY</literal>
  2045. </para>
  2046. </listitem>
  2047. </varlistentry>
  2048. <varlistentry>
  2049. <term><structfield>make</structfield></term>
  2050. <listitem><para>
  2051. <type>text</type>
  2052. </para>
  2053. </listitem>
  2054. </varlistentry>
  2055. <varlistentry>
  2056. <term><structfield>model</structfield></term>
  2057. <listitem><para>
  2058. <type>text</type>
  2059. </para>
  2060. </listitem>
  2061. </varlistentry>
  2062. </variablelist>
  2063. <variablelist>
  2064. <title>Indexes on makemodel</title>
  2065. <varlistentry>
  2066. <term>makemodel_make_key</term>
  2067. <listitem><para>lower(make)</para></listitem>
  2068. </varlistentry>
  2069. <varlistentry>
  2070. <term>makemodel_model_key</term>
  2071. <listitem><para>lower(model)</para></listitem>
  2072. </varlistentry>
  2073. <varlistentry>
  2074. <term>makemodel_parts_id_key</term>
  2075. <listitem><para>parts_id</para></listitem>
  2076. </varlistentry>
  2077. </variablelist>
  2078. </para>
  2079. </section>
  2080. <section id="public.table.oe"
  2081. xreflabel="public.oe">
  2082. <title id="public.table.oe-title">
  2083. Table:
  2084. <structname>oe</structname>
  2085. </title>
  2086. <para>
  2087. <variablelist>
  2088. <title>
  2089. Structure of <structname>oe</structname>
  2090. </title>
  2091. <varlistentry>
  2092. <term><structfield>id</structfield></term>
  2093. <listitem><para>
  2094. <type>integer</type>
  2095. <literal>PRIMARY KEY</literal>
  2096. <literal>DEFAULT nextval(&apos;id&apos;::regclass)</literal>
  2097. </para>
  2098. </listitem>
  2099. </varlistentry>
  2100. <varlistentry>
  2101. <term><structfield>ordnumber</structfield></term>
  2102. <listitem><para>
  2103. <type>text</type>
  2104. </para>
  2105. </listitem>
  2106. </varlistentry>
  2107. <varlistentry>
  2108. <term><structfield>transdate</structfield></term>
  2109. <listitem><para>
  2110. <type>date</type>
  2111. <literal>DEFAULT (&apos;now&apos;::text)::date</literal>
  2112. </para>
  2113. </listitem>
  2114. </varlistentry>
  2115. <varlistentry>
  2116. <term><structfield>vendor_id</structfield></term>
  2117. <listitem><para>
  2118. <type>integer</type>
  2119. </para>
  2120. </listitem>
  2121. </varlistentry>
  2122. <varlistentry>
  2123. <term><structfield>customer_id</structfield></term>
  2124. <listitem><para>
  2125. <type>integer</type>
  2126. </para>
  2127. </listitem>
  2128. </varlistentry>
  2129. <varlistentry>
  2130. <term><structfield>amount</structfield></term>
  2131. <listitem><para>
  2132. <type>numeric</type>
  2133. </para>
  2134. </listitem>
  2135. </varlistentry>
  2136. <varlistentry>
  2137. <term><structfield>netamount</structfield></term>
  2138. <listitem><para>
  2139. <type>numeric</type>
  2140. </para>
  2141. </listitem>
  2142. </varlistentry>
  2143. <varlistentry>
  2144. <term><structfield>reqdate</structfield></term>
  2145. <listitem><para>
  2146. <type>date</type>
  2147. </para>
  2148. </listitem>
  2149. </varlistentry>
  2150. <varlistentry>
  2151. <term><structfield>taxincluded</structfield></term>
  2152. <listitem><para>
  2153. <type>boolean</type>
  2154. </para>
  2155. </listitem>
  2156. </varlistentry>
  2157. <varlistentry>
  2158. <term><structfield>shippingpoint</structfield></term>
  2159. <listitem><para>
  2160. <type>text</type>
  2161. </para>
  2162. </listitem>
  2163. </varlistentry>
  2164. <varlistentry>
  2165. <term><structfield>notes</structfield></term>
  2166. <listitem><para>
  2167. <type>text</type>
  2168. </para>
  2169. </listitem>
  2170. </varlistentry>
  2171. <varlistentry>
  2172. <term><structfield>curr</structfield></term>
  2173. <listitem><para>
  2174. <type>character(3)</type>
  2175. </para>
  2176. </listitem>
  2177. </varlistentry>
  2178. <varlistentry>
  2179. <term><structfield>employee_id</structfield></term>
  2180. <listitem><para>
  2181. <type>integer</type>
  2182. </para>
  2183. </listitem>
  2184. </varlistentry>
  2185. <varlistentry>
  2186. <term><structfield>closed</structfield></term>
  2187. <listitem><para>
  2188. <type>boolean</type>
  2189. <literal>DEFAULT false</literal>
  2190. </para>
  2191. </listitem>
  2192. </varlistentry>
  2193. <varlistentry>
  2194. <term><structfield>quotation</structfield></term>
  2195. <listitem><para>
  2196. <type>boolean</type>
  2197. <literal>DEFAULT false</literal>
  2198. </para>
  2199. </listitem>
  2200. </varlistentry>
  2201. <varlistentry>
  2202. <term><structfield>quonumber</structfield></term>
  2203. <listitem><para>
  2204. <type>text</type>
  2205. </para>
  2206. </listitem>
  2207. </varlistentry>
  2208. <varlistentry>
  2209. <term><structfield>intnotes</structfield></term>
  2210. <listitem><para>
  2211. <type>text</type>
  2212. </para>
  2213. </listitem>
  2214. </varlistentry>
  2215. <varlistentry>
  2216. <term><structfield>department_id</structfield></term>
  2217. <listitem><para>
  2218. <type>integer</type>
  2219. </para>
  2220. </listitem>
  2221. </varlistentry>
  2222. <varlistentry>
  2223. <term><structfield>shipvia</structfield></term>
  2224. <listitem><para>
  2225. <type>text</type>
  2226. </para>
  2227. </listitem>
  2228. </varlistentry>
  2229. <varlistentry>
  2230. <term><structfield>language_code</structfield></term>
  2231. <listitem><para>
  2232. <type>character varying(6)</type>
  2233. </para>
  2234. </listitem>
  2235. </varlistentry>
  2236. <varlistentry>
  2237. <term><structfield>ponumber</structfield></term>
  2238. <listitem><para>
  2239. <type>text</type>
  2240. </para>
  2241. </listitem>
  2242. </varlistentry>
  2243. <varlistentry>
  2244. <term><structfield>terms</structfield></term>
  2245. <listitem><para>
  2246. <type>smallint</type>
  2247. </para>
  2248. </listitem>
  2249. </varlistentry>
  2250. </variablelist>
  2251. <variablelist>
  2252. <title>Indexes on oe</title>
  2253. <varlistentry>
  2254. <term>oe_employee_id_key</term>
  2255. <listitem><para>employee_id</para></listitem>
  2256. </varlistentry>
  2257. <varlistentry>
  2258. <term>oe_id_key</term>
  2259. <listitem><para>id</para></listitem>
  2260. </varlistentry>
  2261. <varlistentry>
  2262. <term>oe_ordnumber_key</term>
  2263. <listitem><para>ordnumber</para></listitem>
  2264. </varlistentry>
  2265. <varlistentry>
  2266. <term>oe_transdate_key</term>
  2267. <listitem><para>transdate</para></listitem>
  2268. </varlistentry>
  2269. </variablelist>
  2270. </para>
  2271. </section>
  2272. <section id="public.table.orderitems"
  2273. xreflabel="public.orderitems">
  2274. <title id="public.table.orderitems-title">
  2275. Table:
  2276. <structname>orderitems</structname>
  2277. </title>
  2278. <para>
  2279. <variablelist>
  2280. <title>
  2281. Structure of <structname>orderitems</structname>
  2282. </title>
  2283. <varlistentry>
  2284. <term><structfield>id</structfield></term>
  2285. <listitem><para>
  2286. <type>integer</type>
  2287. <literal>PRIMARY KEY</literal>
  2288. <literal>DEFAULT nextval(&apos;orderitemsid&apos;::regclass)</literal>
  2289. </para>
  2290. </listitem>
  2291. </varlistentry>
  2292. <varlistentry>
  2293. <term><structfield>trans_id</structfield></term>
  2294. <listitem><para>
  2295. <type>integer</type>
  2296. </para>
  2297. </listitem>
  2298. </varlistentry>
  2299. <varlistentry>
  2300. <term><structfield>parts_id</structfield></term>
  2301. <listitem><para>
  2302. <type>integer</type>
  2303. </para>
  2304. </listitem>
  2305. </varlistentry>
  2306. <varlistentry>
  2307. <term><structfield>description</structfield></term>
  2308. <listitem><para>
  2309. <type>text</type>
  2310. </para>
  2311. </listitem>
  2312. </varlistentry>
  2313. <varlistentry>
  2314. <term><structfield>qty</structfield></term>
  2315. <listitem><para>
  2316. <type>numeric</type>
  2317. </para>
  2318. </listitem>
  2319. </varlistentry>
  2320. <varlistentry>
  2321. <term><structfield>sellprice</structfield></term>
  2322. <listitem><para>
  2323. <type>numeric</type>
  2324. </para>
  2325. </listitem>
  2326. </varlistentry>
  2327. <varlistentry>
  2328. <term><structfield>discount</structfield></term>
  2329. <listitem><para>
  2330. <type>numeric</type>
  2331. </para>
  2332. </listitem>
  2333. </varlistentry>
  2334. <varlistentry>
  2335. <term><structfield>unit</structfield></term>
  2336. <listitem><para>
  2337. <type>character varying(5)</type>
  2338. </para>
  2339. </listitem>
  2340. </varlistentry>
  2341. <varlistentry>
  2342. <term><structfield>project_id</structfield></term>
  2343. <listitem><para>
  2344. <type>integer</type>
  2345. </para>
  2346. </listitem>
  2347. </varlistentry>
  2348. <varlistentry>
  2349. <term><structfield>reqdate</structfield></term>
  2350. <listitem><para>
  2351. <type>date</type>
  2352. </para>
  2353. </listitem>
  2354. </varlistentry>
  2355. <varlistentry>
  2356. <term><structfield>ship</structfield></term>
  2357. <listitem><para>
  2358. <type>numeric</type>
  2359. </para>
  2360. </listitem>
  2361. </varlistentry>
  2362. <varlistentry>
  2363. <term><structfield>serialnumber</structfield></term>
  2364. <listitem><para>
  2365. <type>text</type>
  2366. </para>
  2367. </listitem>
  2368. </varlistentry>
  2369. <varlistentry>
  2370. <term><structfield>notes</structfield></term>
  2371. <listitem><para>
  2372. <type>text</type>
  2373. </para>
  2374. </listitem>
  2375. </varlistentry>
  2376. </variablelist>
  2377. <variablelist>
  2378. <title>Indexes on orderitems</title>
  2379. <varlistentry>
  2380. <term>orderitems_id_key</term>
  2381. <listitem><para>id</para></listitem>
  2382. </varlistentry>
  2383. <varlistentry>
  2384. <term>orderitems_trans_id_key</term>
  2385. <listitem><para>trans_id</para></listitem>
  2386. </varlistentry>
  2387. </variablelist>
  2388. </para>
  2389. </section>
  2390. <section id="public.table.parts"
  2391. xreflabel="public.parts">
  2392. <title id="public.table.parts-title">
  2393. Table:
  2394. <structname>parts</structname>
  2395. </title>
  2396. <para>
  2397. <variablelist>
  2398. <title>
  2399. Structure of <structname>parts</structname>
  2400. </title>
  2401. <varlistentry>
  2402. <term><structfield>id</structfield></term>
  2403. <listitem><para>
  2404. <type>integer</type>
  2405. <literal>PRIMARY KEY</literal>
  2406. <literal>DEFAULT nextval(&apos;id&apos;::regclass)</literal>
  2407. </para>
  2408. </listitem>
  2409. </varlistentry>
  2410. <varlistentry>
  2411. <term><structfield>partnumber</structfield></term>
  2412. <listitem><para>
  2413. <type>text</type>
  2414. </para>
  2415. </listitem>
  2416. </varlistentry>
  2417. <varlistentry>
  2418. <term><structfield>description</structfield></term>
  2419. <listitem><para>
  2420. <type>text</type>
  2421. </para>
  2422. </listitem>
  2423. </varlistentry>
  2424. <varlistentry>
  2425. <term><structfield>unit</structfield></term>
  2426. <listitem><para>
  2427. <type>character varying(5)</type>
  2428. </para>
  2429. </listitem>
  2430. </varlistentry>
  2431. <varlistentry>
  2432. <term><structfield>listprice</structfield></term>
  2433. <listitem><para>
  2434. <type>numeric</type>
  2435. </para>
  2436. </listitem>
  2437. </varlistentry>
  2438. <varlistentry>
  2439. <term><structfield>sellprice</structfield></term>
  2440. <listitem><para>
  2441. <type>numeric</type>
  2442. </para>
  2443. </listitem>
  2444. </varlistentry>
  2445. <varlistentry>
  2446. <term><structfield>lastcost</structfield></term>
  2447. <listitem><para>
  2448. <type>numeric</type>
  2449. </para>
  2450. </listitem>
  2451. </varlistentry>
  2452. <varlistentry>
  2453. <term><structfield>priceupdate</structfield></term>
  2454. <listitem><para>
  2455. <type>date</type>
  2456. <literal>DEFAULT (&apos;now&apos;::text)::date</literal>
  2457. </para>
  2458. </listitem>
  2459. </varlistentry>
  2460. <varlistentry>
  2461. <term><structfield>weight</structfield></term>
  2462. <listitem><para>
  2463. <type>numeric</type>
  2464. </para>
  2465. </listitem>
  2466. </varlistentry>
  2467. <varlistentry>
  2468. <term><structfield>onhand</structfield></term>
  2469. <listitem><para>
  2470. <type>numeric</type>
  2471. </para>
  2472. </listitem>
  2473. </varlistentry>
  2474. <varlistentry>
  2475. <term><structfield>notes</structfield></term>
  2476. <listitem><para>
  2477. <type>text</type>
  2478. </para>
  2479. </listitem>
  2480. </varlistentry>
  2481. <varlistentry>
  2482. <term><structfield>makemodel</structfield></term>
  2483. <listitem><para>
  2484. <type>boolean</type>
  2485. <literal>DEFAULT false</literal>
  2486. </para>
  2487. </listitem>
  2488. </varlistentry>
  2489. <varlistentry>
  2490. <term><structfield>assembly</structfield></term>
  2491. <listitem><para>
  2492. <type>boolean</type>
  2493. <literal>DEFAULT false</literal>
  2494. </para>
  2495. </listitem>
  2496. </varlistentry>
  2497. <varlistentry>
  2498. <term><structfield>alternate</structfield></term>
  2499. <listitem><para>
  2500. <type>boolean</type>
  2501. <literal>DEFAULT false</literal>
  2502. </para>
  2503. </listitem>
  2504. </varlistentry>
  2505. <varlistentry>
  2506. <term><structfield>rop</structfield></term>
  2507. <listitem><para>
  2508. <type>real</type>
  2509. </para>
  2510. </listitem>
  2511. </varlistentry>
  2512. <varlistentry>
  2513. <term><structfield>inventory_accno_id</structfield></term>
  2514. <listitem><para>
  2515. <type>integer</type>
  2516. </para>
  2517. </listitem>
  2518. </varlistentry>
  2519. <varlistentry>
  2520. <term><structfield>income_accno_id</structfield></term>
  2521. <listitem><para>
  2522. <type>integer</type>
  2523. </para>
  2524. </listitem>
  2525. </varlistentry>
  2526. <varlistentry>
  2527. <term><structfield>expense_accno_id</structfield></term>
  2528. <listitem><para>
  2529. <type>integer</type>
  2530. </para>
  2531. </listitem>
  2532. </varlistentry>
  2533. <varlistentry>
  2534. <term><structfield>bin</structfield></term>
  2535. <listitem><para>
  2536. <type>text</type>
  2537. </para>
  2538. </listitem>
  2539. </varlistentry>
  2540. <varlistentry>
  2541. <term><structfield>obsolete</structfield></term>
  2542. <listitem><para>
  2543. <type>boolean</type>
  2544. <literal>DEFAULT false</literal>
  2545. </para>
  2546. </listitem>
  2547. </varlistentry>
  2548. <varlistentry>
  2549. <term><structfield>bom</structfield></term>
  2550. <listitem><para>
  2551. <type>boolean</type>
  2552. <literal>DEFAULT false</literal>
  2553. </para>
  2554. </listitem>
  2555. </varlistentry>
  2556. <varlistentry>
  2557. <term><structfield>image</structfield></term>
  2558. <listitem><para>
  2559. <type>text</type>
  2560. </para>
  2561. </listitem>
  2562. </varlistentry>
  2563. <varlistentry>
  2564. <term><structfield>drawing</structfield></term>
  2565. <listitem><para>
  2566. <type>text</type>
  2567. </para>
  2568. </listitem>
  2569. </varlistentry>
  2570. <varlistentry>
  2571. <term><structfield>microfiche</structfield></term>
  2572. <listitem><para>
  2573. <type>text</type>
  2574. </para>
  2575. </listitem>
  2576. </varlistentry>
  2577. <varlistentry>
  2578. <term><structfield>partsgroup_id</structfield></term>
  2579. <listitem><para>
  2580. <type>integer</type>
  2581. </para>
  2582. </listitem>
  2583. </varlistentry>
  2584. <varlistentry>
  2585. <term><structfield>project_id</structfield></term>
  2586. <listitem><para>
  2587. <type>integer</type>
  2588. </para>
  2589. </listitem>
  2590. </varlistentry>
  2591. <varlistentry>
  2592. <term><structfield>avgcost</structfield></term>
  2593. <listitem><para>
  2594. <type>numeric</type>
  2595. </para>
  2596. </listitem>
  2597. </varlistentry>
  2598. </variablelist>
  2599. <variablelist>
  2600. <title>Indexes on parts</title>
  2601. <varlistentry>
  2602. <term>parts_description_key</term>
  2603. <listitem><para>lower(description)</para></listitem>
  2604. </varlistentry>
  2605. <varlistentry>
  2606. <term>parts_id_key</term>
  2607. <listitem><para>id</para></listitem>
  2608. </varlistentry>
  2609. <varlistentry>
  2610. <term>parts_partnumber_key</term>
  2611. <listitem><para>lower(partnumber)</para></listitem>
  2612. </varlistentry>
  2613. </variablelist>
  2614. <itemizedlist>
  2615. <title>
  2616. Tables referencing partstax via Foreign Key Constraints
  2617. </title>
  2618. <listitem>
  2619. <para>
  2620. <xref linkend="public.table.partstax"/>
  2621. </para>
  2622. </listitem>
  2623. </itemizedlist>
  2624. </para>
  2625. </section>
  2626. <section id="public.table.partscustomer"
  2627. xreflabel="public.partscustomer">
  2628. <title id="public.table.partscustomer-title">
  2629. Table:
  2630. <structname>partscustomer</structname>
  2631. </title>
  2632. <para>
  2633. <variablelist>
  2634. <title>
  2635. Structure of <structname>partscustomer</structname>
  2636. </title>
  2637. <varlistentry>
  2638. <term><structfield>parts_id</structfield></term>
  2639. <listitem><para>
  2640. <type>integer</type>
  2641. </para>
  2642. </listitem>
  2643. </varlistentry>
  2644. <varlistentry>
  2645. <term><structfield>customer_id</structfield></term>
  2646. <listitem><para>
  2647. <type>integer</type>
  2648. </para>
  2649. </listitem>
  2650. </varlistentry>
  2651. <varlistentry>
  2652. <term><structfield>pricegroup_id</structfield></term>
  2653. <listitem><para>
  2654. <type>integer</type>
  2655. </para>
  2656. </listitem>
  2657. </varlistentry>
  2658. <varlistentry>
  2659. <term><structfield>pricebreak</structfield></term>
  2660. <listitem><para>
  2661. <type>numeric</type>
  2662. </para>
  2663. </listitem>
  2664. </varlistentry>
  2665. <varlistentry>
  2666. <term><structfield>sellprice</structfield></term>
  2667. <listitem><para>
  2668. <type>numeric</type>
  2669. </para>
  2670. </listitem>
  2671. </varlistentry>
  2672. <varlistentry>
  2673. <term><structfield>validfrom</structfield></term>
  2674. <listitem><para>
  2675. <type>date</type>
  2676. </para>
  2677. </listitem>
  2678. </varlistentry>
  2679. <varlistentry>
  2680. <term><structfield>validto</structfield></term>
  2681. <listitem><para>
  2682. <type>date</type>
  2683. </para>
  2684. </listitem>
  2685. </varlistentry>
  2686. <varlistentry>
  2687. <term><structfield>curr</structfield></term>
  2688. <listitem><para>
  2689. <type>character(3)</type>
  2690. </para>
  2691. </listitem>
  2692. </varlistentry>
  2693. <varlistentry>
  2694. <term><structfield>entry_id</structfield></term>
  2695. <listitem><para>
  2696. <type>serial</type>
  2697. <literal>PRIMARY KEY</literal>
  2698. </para>
  2699. </listitem>
  2700. </varlistentry>
  2701. </variablelist>
  2702. </para>
  2703. </section>
  2704. <section id="public.table.partsgroup"
  2705. xreflabel="public.partsgroup">
  2706. <title id="public.table.partsgroup-title">
  2707. Table:
  2708. <structname>partsgroup</structname>
  2709. </title>
  2710. <para>
  2711. <variablelist>
  2712. <title>
  2713. Structure of <structname>partsgroup</structname>
  2714. </title>
  2715. <varlistentry>
  2716. <term><structfield>id</structfield></term>
  2717. <listitem><para>
  2718. <type>integer</type>
  2719. <literal>PRIMARY KEY</literal>
  2720. <literal>DEFAULT nextval(&apos;id&apos;::regclass)</literal>
  2721. </para>
  2722. </listitem>
  2723. </varlistentry>
  2724. <varlistentry>
  2725. <term><structfield>partsgroup</structfield></term>
  2726. <listitem><para>
  2727. <type>text</type>
  2728. </para>
  2729. </listitem>
  2730. </varlistentry>
  2731. </variablelist>
  2732. <variablelist>
  2733. <title>Indexes on partsgroup</title>
  2734. <varlistentry>
  2735. <term>partsgroup_id_key</term>
  2736. <listitem><para>id</para></listitem>
  2737. </varlistentry>
  2738. </variablelist>
  2739. </para>
  2740. </section>
  2741. <section id="public.table.partstax"
  2742. xreflabel="public.partstax">
  2743. <title id="public.table.partstax-title">
  2744. Table:
  2745. <structname>partstax</structname>
  2746. </title>
  2747. <para>
  2748. <variablelist>
  2749. <title>
  2750. Structure of <structname>partstax</structname>
  2751. </title>
  2752. <varlistentry>
  2753. <term><structfield>parts_id</structfield></term>
  2754. <listitem><para>
  2755. <type>integer</type>
  2756. <literal>PRIMARY KEY</literal>
  2757. <literal>REFERENCES</literal> <xref linkend="public.table.parts"/>
  2758. </para>
  2759. </listitem>
  2760. </varlistentry>
  2761. <varlistentry>
  2762. <term><structfield>chart_id</structfield></term>
  2763. <listitem><para>
  2764. <type>integer</type>
  2765. <literal>PRIMARY KEY</literal>
  2766. <literal>REFERENCES</literal> <xref linkend="public.table.chart"/>
  2767. </para>
  2768. </listitem>
  2769. </varlistentry>
  2770. <varlistentry>
  2771. <term><structfield>taxcategory_id</structfield></term>
  2772. <listitem><para>
  2773. <type>integer</type>
  2774. <literal>REFERENCES</literal> <xref linkend="public.table.taxcategory"/>
  2775. </para>
  2776. </listitem>
  2777. </varlistentry>
  2778. </variablelist>
  2779. <variablelist>
  2780. <title>Indexes on partstax</title>
  2781. <varlistentry>
  2782. <term>partstax_parts_id_key</term>
  2783. <listitem><para>parts_id</para></listitem>
  2784. </varlistentry>
  2785. </variablelist>
  2786. </para>
  2787. </section>
  2788. <section id="public.table.partsvendor"
  2789. xreflabel="public.partsvendor">
  2790. <title id="public.table.partsvendor-title">
  2791. Table:
  2792. <structname>partsvendor</structname>
  2793. </title>
  2794. <para>
  2795. <variablelist>
  2796. <title>
  2797. Structure of <structname>partsvendor</structname>
  2798. </title>
  2799. <varlistentry>
  2800. <term><structfield>vendor_id</structfield></term>
  2801. <listitem><para>
  2802. <type>integer</type>
  2803. </para>
  2804. </listitem>
  2805. </varlistentry>
  2806. <varlistentry>
  2807. <term><structfield>parts_id</structfield></term>
  2808. <listitem><para>
  2809. <type>integer</type>
  2810. </para>
  2811. </listitem>
  2812. </varlistentry>
  2813. <varlistentry>
  2814. <term><structfield>partnumber</structfield></term>
  2815. <listitem><para>
  2816. <type>text</type>
  2817. </para>
  2818. </listitem>
  2819. </varlistentry>
  2820. <varlistentry>
  2821. <term><structfield>leadtime</structfield></term>
  2822. <listitem><para>
  2823. <type>smallint</type>
  2824. </para>
  2825. </listitem>
  2826. </varlistentry>
  2827. <varlistentry>
  2828. <term><structfield>lastcost</structfield></term>
  2829. <listitem><para>
  2830. <type>numeric</type>
  2831. </para>
  2832. </listitem>
  2833. </varlistentry>
  2834. <varlistentry>
  2835. <term><structfield>curr</structfield></term>
  2836. <listitem><para>
  2837. <type>character(3)</type>
  2838. </para>
  2839. </listitem>
  2840. </varlistentry>
  2841. <varlistentry>
  2842. <term><structfield>entry_id</structfield></term>
  2843. <listitem><para>
  2844. <type>serial</type>
  2845. <literal>PRIMARY KEY</literal>
  2846. </para>
  2847. </listitem>
  2848. </varlistentry>
  2849. </variablelist>
  2850. <variablelist>
  2851. <title>Indexes on partsvendor</title>
  2852. <varlistentry>
  2853. <term>partsvendor_parts_id_key</term>
  2854. <listitem><para>parts_id</para></listitem>
  2855. </varlistentry>
  2856. <varlistentry>
  2857. <term>partsvendor_vendor_id_key</term>
  2858. <listitem><para>vendor_id</para></listitem>
  2859. </varlistentry>
  2860. </variablelist>
  2861. </para>
  2862. </section>
  2863. <section id="public.table.pricegroup"
  2864. xreflabel="public.pricegroup">
  2865. <title id="public.table.pricegroup-title">
  2866. Table:
  2867. <structname>pricegroup</structname>
  2868. </title>
  2869. <para>
  2870. <variablelist>
  2871. <title>
  2872. Structure of <structname>pricegroup</structname>
  2873. </title>
  2874. <varlistentry>
  2875. <term><structfield>id</structfield></term>
  2876. <listitem><para>
  2877. <type>integer</type>
  2878. <literal>PRIMARY KEY</literal>
  2879. <literal>DEFAULT nextval(&apos;id&apos;::regclass)</literal>
  2880. </para>
  2881. </listitem>
  2882. </varlistentry>
  2883. <varlistentry>
  2884. <term><structfield>pricegroup</structfield></term>
  2885. <listitem><para>
  2886. <type>text</type>
  2887. </para>
  2888. </listitem>
  2889. </varlistentry>
  2890. </variablelist>
  2891. <variablelist>
  2892. <title>Indexes on pricegroup</title>
  2893. <varlistentry>
  2894. <term>pricegroup_id_key</term>
  2895. <listitem><para>id</para></listitem>
  2896. </varlistentry>
  2897. <varlistentry>
  2898. <term>pricegroup_pricegroup_key</term>
  2899. <listitem><para>pricegroup</para></listitem>
  2900. </varlistentry>
  2901. </variablelist>
  2902. </para>
  2903. </section>
  2904. <section id="public.table.project"
  2905. xreflabel="public.project">
  2906. <title id="public.table.project-title">
  2907. Table:
  2908. <structname>project</structname>
  2909. </title>
  2910. <para>
  2911. <variablelist>
  2912. <title>
  2913. Structure of <structname>project</structname>
  2914. </title>
  2915. <varlistentry>
  2916. <term><structfield>id</structfield></term>
  2917. <listitem><para>
  2918. <type>integer</type>
  2919. <literal>PRIMARY KEY</literal>
  2920. <literal>DEFAULT nextval(&apos;id&apos;::regclass)</literal>
  2921. </para>
  2922. </listitem>
  2923. </varlistentry>
  2924. <varlistentry>
  2925. <term><structfield>projectnumber</structfield></term>
  2926. <listitem><para>
  2927. <type>text</type>
  2928. </para>
  2929. </listitem>
  2930. </varlistentry>
  2931. <varlistentry>
  2932. <term><structfield>description</structfield></term>
  2933. <listitem><para>
  2934. <type>text</type>
  2935. </para>
  2936. </listitem>
  2937. </varlistentry>
  2938. <varlistentry>
  2939. <term><structfield>startdate</structfield></term>
  2940. <listitem><para>
  2941. <type>date</type>
  2942. </para>
  2943. </listitem>
  2944. </varlistentry>
  2945. <varlistentry>
  2946. <term><structfield>enddate</structfield></term>
  2947. <listitem><para>
  2948. <type>date</type>
  2949. </para>
  2950. </listitem>
  2951. </varlistentry>
  2952. <varlistentry>
  2953. <term><structfield>parts_id</structfield></term>
  2954. <listitem><para>
  2955. <type>integer</type>
  2956. </para>
  2957. </listitem>
  2958. </varlistentry>
  2959. <varlistentry>
  2960. <term><structfield>production</structfield></term>
  2961. <listitem><para>
  2962. <type>numeric</type>
  2963. </para>
  2964. </listitem>
  2965. </varlistentry>
  2966. <varlistentry>
  2967. <term><structfield>completed</structfield></term>
  2968. <listitem><para>
  2969. <type>numeric</type>
  2970. </para>
  2971. </listitem>
  2972. </varlistentry>
  2973. <varlistentry>
  2974. <term><structfield>customer_id</structfield></term>
  2975. <listitem><para>
  2976. <type>integer</type>
  2977. </para>
  2978. </listitem>
  2979. </varlistentry>
  2980. </variablelist>
  2981. <variablelist>
  2982. <title>Indexes on project</title>
  2983. <varlistentry>
  2984. <term>project_id_key</term>
  2985. <listitem><para>id</para></listitem>
  2986. </varlistentry>
  2987. </variablelist>
  2988. </para>
  2989. </section>
  2990. <section id="public.table.recurring"
  2991. xreflabel="public.recurring">
  2992. <title id="public.table.recurring-title">
  2993. Table:
  2994. <structname>recurring</structname>
  2995. </title>
  2996. <para>
  2997. <variablelist>
  2998. <title>
  2999. Structure of <structname>recurring</structname>
  3000. </title>
  3001. <varlistentry>
  3002. <term><structfield>id</structfield></term>
  3003. <listitem><para>
  3004. <type>integer</type>
  3005. <literal>PRIMARY KEY</literal>
  3006. </para>
  3007. </listitem>
  3008. </varlistentry>
  3009. <varlistentry>
  3010. <term><structfield>reference</structfield></term>
  3011. <listitem><para>
  3012. <type>text</type>
  3013. </para>
  3014. </listitem>
  3015. </varlistentry>
  3016. <varlistentry>
  3017. <term><structfield>startdate</structfield></term>
  3018. <listitem><para>
  3019. <type>date</type>
  3020. </para>
  3021. </listitem>
  3022. </varlistentry>
  3023. <varlistentry>
  3024. <term><structfield>nextdate</structfield></term>
  3025. <listitem><para>
  3026. <type>date</type>
  3027. </para>
  3028. </listitem>
  3029. </varlistentry>
  3030. <varlistentry>
  3031. <term><structfield>enddate</structfield></term>
  3032. <listitem><para>
  3033. <type>date</type>
  3034. </para>
  3035. </listitem>
  3036. </varlistentry>
  3037. <varlistentry>
  3038. <term><structfield>repeat</structfield></term>
  3039. <listitem><para>
  3040. <type>smallint</type>
  3041. </para>
  3042. </listitem>
  3043. </varlistentry>
  3044. <varlistentry>
  3045. <term><structfield>unit</structfield></term>
  3046. <listitem><para>
  3047. <type>character varying(6)</type>
  3048. </para>
  3049. </listitem>
  3050. </varlistentry>
  3051. <varlistentry>
  3052. <term><structfield>howmany</structfield></term>
  3053. <listitem><para>
  3054. <type>integer</type>
  3055. </para>
  3056. </listitem>
  3057. </varlistentry>
  3058. <varlistentry>
  3059. <term><structfield>payment</structfield></term>
  3060. <listitem><para>
  3061. <type>boolean</type>
  3062. <literal>DEFAULT false</literal>
  3063. </para>
  3064. </listitem>
  3065. </varlistentry>
  3066. </variablelist>
  3067. </para>
  3068. </section>
  3069. <section id="public.table.recurringemail"
  3070. xreflabel="public.recurringemail">
  3071. <title id="public.table.recurringemail-title">
  3072. Table:
  3073. <structname>recurringemail</structname>
  3074. </title>
  3075. <para>
  3076. <variablelist>
  3077. <title>
  3078. Structure of <structname>recurringemail</structname>
  3079. </title>
  3080. <varlistentry>
  3081. <term><structfield>id</structfield></term>
  3082. <listitem><para>
  3083. <type>integer</type>
  3084. <literal>PRIMARY KEY</literal>
  3085. </para>
  3086. </listitem>
  3087. </varlistentry>
  3088. <varlistentry>
  3089. <term><structfield>formname</structfield></term>
  3090. <listitem><para>
  3091. <type>text</type>
  3092. </para>
  3093. </listitem>
  3094. </varlistentry>
  3095. <varlistentry>
  3096. <term><structfield>format</structfield></term>
  3097. <listitem><para>
  3098. <type>text</type>
  3099. </para>
  3100. </listitem>
  3101. </varlistentry>
  3102. <varlistentry>
  3103. <term><structfield>message</structfield></term>
  3104. <listitem><para>
  3105. <type>text</type>
  3106. </para>
  3107. </listitem>
  3108. </varlistentry>
  3109. </variablelist>
  3110. </para>
  3111. </section>
  3112. <section id="public.table.recurringprint"
  3113. xreflabel="public.recurringprint">
  3114. <title id="public.table.recurringprint-title">
  3115. Table:
  3116. <structname>recurringprint</structname>
  3117. </title>
  3118. <para>
  3119. <variablelist>
  3120. <title>
  3121. Structure of <structname>recurringprint</structname>
  3122. </title>
  3123. <varlistentry>
  3124. <term><structfield>id</structfield></term>
  3125. <listitem><para>
  3126. <type>integer</type>
  3127. <literal>PRIMARY KEY</literal>
  3128. </para>
  3129. </listitem>
  3130. </varlistentry>
  3131. <varlistentry>
  3132. <term><structfield>formname</structfield></term>
  3133. <listitem><para>
  3134. <type>text</type>
  3135. </para>
  3136. </listitem>
  3137. </varlistentry>
  3138. <varlistentry>
  3139. <term><structfield>format</structfield></term>
  3140. <listitem><para>
  3141. <type>text</type>
  3142. </para>
  3143. </listitem>
  3144. </varlistentry>
  3145. <varlistentry>
  3146. <term><structfield>printer</structfield></term>
  3147. <listitem><para>
  3148. <type>text</type>
  3149. </para>
  3150. </listitem>
  3151. </varlistentry>
  3152. </variablelist>
  3153. </para>
  3154. </section>
  3155. <section id="public.table.shipto"
  3156. xreflabel="public.shipto">
  3157. <title id="public.table.shipto-title">
  3158. Table:
  3159. <structname>shipto</structname>
  3160. </title>
  3161. <para>
  3162. <variablelist>
  3163. <title>
  3164. Structure of <structname>shipto</structname>
  3165. </title>
  3166. <varlistentry>
  3167. <term><structfield>trans_id</structfield></term>
  3168. <listitem><para>
  3169. <type>integer</type>
  3170. </para>
  3171. </listitem>
  3172. </varlistentry>
  3173. <varlistentry>
  3174. <term><structfield>shiptoname</structfield></term>
  3175. <listitem><para>
  3176. <type>character varying(64)</type>
  3177. </para>
  3178. </listitem>
  3179. </varlistentry>
  3180. <varlistentry>
  3181. <term><structfield>shiptoaddress1</structfield></term>
  3182. <listitem><para>
  3183. <type>character varying(32)</type>
  3184. </para>
  3185. </listitem>
  3186. </varlistentry>
  3187. <varlistentry>
  3188. <term><structfield>shiptoaddress2</structfield></term>
  3189. <listitem><para>
  3190. <type>character varying(32)</type>
  3191. </para>
  3192. </listitem>
  3193. </varlistentry>
  3194. <varlistentry>
  3195. <term><structfield>shiptocity</structfield></term>
  3196. <listitem><para>
  3197. <type>character varying(32)</type>
  3198. </para>
  3199. </listitem>
  3200. </varlistentry>
  3201. <varlistentry>
  3202. <term><structfield>shiptostate</structfield></term>
  3203. <listitem><para>
  3204. <type>character varying(32)</type>
  3205. </para>
  3206. </listitem>
  3207. </varlistentry>
  3208. <varlistentry>
  3209. <term><structfield>shiptozipcode</structfield></term>
  3210. <listitem><para>
  3211. <type>character varying(10)</type>
  3212. </para>
  3213. </listitem>
  3214. </varlistentry>
  3215. <varlistentry>
  3216. <term><structfield>shiptocountry</structfield></term>
  3217. <listitem><para>
  3218. <type>character varying(32)</type>
  3219. </para>
  3220. </listitem>
  3221. </varlistentry>
  3222. <varlistentry>
  3223. <term><structfield>shiptocontact</structfield></term>
  3224. <listitem><para>
  3225. <type>character varying(64)</type>
  3226. </para>
  3227. </listitem>
  3228. </varlistentry>
  3229. <varlistentry>
  3230. <term><structfield>shiptophone</structfield></term>
  3231. <listitem><para>
  3232. <type>character varying(20)</type>
  3233. </para>
  3234. </listitem>
  3235. </varlistentry>
  3236. <varlistentry>
  3237. <term><structfield>shiptofax</structfield></term>
  3238. <listitem><para>
  3239. <type>character varying(20)</type>
  3240. </para>
  3241. </listitem>
  3242. </varlistentry>
  3243. <varlistentry>
  3244. <term><structfield>shiptoemail</structfield></term>
  3245. <listitem><para>
  3246. <type>text</type>
  3247. </para>
  3248. </listitem>
  3249. </varlistentry>
  3250. <varlistentry>
  3251. <term><structfield>entry_id</structfield></term>
  3252. <listitem><para>
  3253. <type>serial</type>
  3254. <literal>PRIMARY KEY</literal>
  3255. </para>
  3256. </listitem>
  3257. </varlistentry>
  3258. </variablelist>
  3259. <variablelist>
  3260. <title>Indexes on shipto</title>
  3261. <varlistentry>
  3262. <term>shipto_trans_id_key</term>
  3263. <listitem><para>trans_id</para></listitem>
  3264. </varlistentry>
  3265. </variablelist>
  3266. </para>
  3267. </section>
  3268. <section id="public.table.sic"
  3269. xreflabel="public.sic">
  3270. <title id="public.table.sic-title">
  3271. Table:
  3272. <structname>sic</structname>
  3273. </title>
  3274. <para>
  3275. <variablelist>
  3276. <title>
  3277. Structure of <structname>sic</structname>
  3278. </title>
  3279. <varlistentry>
  3280. <term><structfield>code</structfield></term>
  3281. <listitem><para>
  3282. <type>character varying(6)</type>
  3283. <literal>PRIMARY KEY</literal>
  3284. </para>
  3285. </listitem>
  3286. </varlistentry>
  3287. <varlistentry>
  3288. <term><structfield>sictype</structfield></term>
  3289. <listitem><para>
  3290. <type>character(1)</type>
  3291. </para>
  3292. </listitem>
  3293. </varlistentry>
  3294. <varlistentry>
  3295. <term><structfield>description</structfield></term>
  3296. <listitem><para>
  3297. <type>text</type>
  3298. </para>
  3299. </listitem>
  3300. </varlistentry>
  3301. </variablelist>
  3302. </para>
  3303. </section>
  3304. <section id="public.table.status"
  3305. xreflabel="public.status">
  3306. <title id="public.table.status-title">
  3307. Table:
  3308. <structname>status</structname>
  3309. </title>
  3310. <para>
  3311. <variablelist>
  3312. <title>
  3313. Structure of <structname>status</structname>
  3314. </title>
  3315. <varlistentry>
  3316. <term><structfield>trans_id</structfield></term>
  3317. <listitem><para>
  3318. <type>integer</type>
  3319. <literal>PRIMARY KEY</literal>
  3320. </para>
  3321. </listitem>
  3322. </varlistentry>
  3323. <varlistentry>
  3324. <term><structfield>formname</structfield></term>
  3325. <listitem><para>
  3326. <type>text</type>
  3327. </para>
  3328. </listitem>
  3329. </varlistentry>
  3330. <varlistentry>
  3331. <term><structfield>printed</structfield></term>
  3332. <listitem><para>
  3333. <type>boolean</type>
  3334. <literal>DEFAULT false</literal>
  3335. </para>
  3336. </listitem>
  3337. </varlistentry>
  3338. <varlistentry>
  3339. <term><structfield>emailed</structfield></term>
  3340. <listitem><para>
  3341. <type>boolean</type>
  3342. <literal>DEFAULT false</literal>
  3343. </para>
  3344. </listitem>
  3345. </varlistentry>
  3346. <varlistentry>
  3347. <term><structfield>spoolfile</structfield></term>
  3348. <listitem><para>
  3349. <type>text</type>
  3350. </para>
  3351. </listitem>
  3352. </varlistentry>
  3353. </variablelist>
  3354. <variablelist>
  3355. <title>Indexes on status</title>
  3356. <varlistentry>
  3357. <term>status_trans_id_key</term>
  3358. <listitem><para>trans_id</para></listitem>
  3359. </varlistentry>
  3360. </variablelist>
  3361. </para>
  3362. </section>
  3363. <section id="public.table.tax"
  3364. xreflabel="public.tax">
  3365. <title id="public.table.tax-title">
  3366. Table:
  3367. <structname>tax</structname>
  3368. </title>
  3369. <para>
  3370. <variablelist>
  3371. <title>
  3372. Structure of <structname>tax</structname>
  3373. </title>
  3374. <varlistentry>
  3375. <term><structfield>chart_id</structfield></term>
  3376. <listitem><para>
  3377. <type>integer</type>
  3378. <literal>PRIMARY KEY</literal>
  3379. <literal>REFERENCES</literal> <xref linkend="public.table.chart"/>
  3380. </para>
  3381. </listitem>
  3382. </varlistentry>
  3383. <varlistentry>
  3384. <term><structfield>rate</structfield></term>
  3385. <listitem><para>
  3386. <type>numeric</type>
  3387. </para>
  3388. </listitem>
  3389. </varlistentry>
  3390. <varlistentry>
  3391. <term><structfield>taxnumber</structfield></term>
  3392. <listitem><para>
  3393. <type>text</type>
  3394. </para>
  3395. </listitem>
  3396. </varlistentry>
  3397. <varlistentry>
  3398. <term><structfield>validto</structfield></term>
  3399. <listitem><para>
  3400. <type>date</type>
  3401. </para>
  3402. </listitem>
  3403. </varlistentry>
  3404. <varlistentry>
  3405. <term><structfield>pass</structfield></term>
  3406. <listitem><para>
  3407. <type>integer</type>
  3408. <literal>NOT NULL</literal>
  3409. </para>
  3410. </listitem>
  3411. </varlistentry>
  3412. <varlistentry>
  3413. <term><structfield>taxmodule_id</structfield></term>
  3414. <listitem><para>
  3415. <type>integer</type>
  3416. <literal>NOT NULL</literal>
  3417. <literal>DEFAULT 1</literal>
  3418. <literal>REFERENCES</literal> <xref linkend="public.table.taxmodule"/>
  3419. </para>
  3420. </listitem>
  3421. </varlistentry>
  3422. </variablelist>
  3423. </para>
  3424. </section>
  3425. <section id="public.table.taxcategory"
  3426. xreflabel="public.taxcategory">
  3427. <title id="public.table.taxcategory-title">
  3428. Table:
  3429. <structname>taxcategory</structname>
  3430. </title>
  3431. <para>
  3432. <variablelist>
  3433. <title>
  3434. Structure of <structname>taxcategory</structname>
  3435. </title>
  3436. <varlistentry>
  3437. <term><structfield>taxcategory_id</structfield></term>
  3438. <listitem><para>
  3439. <type>serial</type>
  3440. <literal>PRIMARY KEY</literal>
  3441. </para>
  3442. </listitem>
  3443. </varlistentry>
  3444. <varlistentry>
  3445. <term><structfield>taxcategoryname</structfield></term>
  3446. <listitem><para>
  3447. <type>text</type>
  3448. <literal>NOT NULL</literal>
  3449. </para>
  3450. </listitem>
  3451. </varlistentry>
  3452. <varlistentry>
  3453. <term><structfield>taxmodule_id</structfield></term>
  3454. <listitem><para>
  3455. <type>integer</type>
  3456. <literal>NOT NULL</literal>
  3457. <literal>REFERENCES</literal> <xref linkend="public.table.taxmodule"/>
  3458. </para>
  3459. </listitem>
  3460. </varlistentry>
  3461. </variablelist>
  3462. <itemizedlist>
  3463. <title>
  3464. Tables referencing partstax via Foreign Key Constraints
  3465. </title>
  3466. <listitem>
  3467. <para>
  3468. <xref linkend="public.table.partstax"/>
  3469. </para>
  3470. </listitem>
  3471. </itemizedlist>
  3472. </para>
  3473. </section>
  3474. <section id="public.table.taxmodule"
  3475. xreflabel="public.taxmodule">
  3476. <title id="public.table.taxmodule-title">
  3477. Table:
  3478. <structname>taxmodule</structname>
  3479. </title>
  3480. <para>
  3481. <variablelist>
  3482. <title>
  3483. Structure of <structname>taxmodule</structname>
  3484. </title>
  3485. <varlistentry>
  3486. <term><structfield>taxmodule_id</structfield></term>
  3487. <listitem><para>
  3488. <type>serial</type>
  3489. <literal>PRIMARY KEY</literal>
  3490. </para>
  3491. </listitem>
  3492. </varlistentry>
  3493. <varlistentry>
  3494. <term><structfield>taxmodulename</structfield></term>
  3495. <listitem><para>
  3496. <type>text</type>
  3497. <literal>NOT NULL</literal>
  3498. </para>
  3499. </listitem>
  3500. </varlistentry>
  3501. </variablelist>
  3502. <itemizedlist>
  3503. <title>
  3504. Tables referencing tax via Foreign Key Constraints
  3505. </title>
  3506. <listitem>
  3507. <para>
  3508. <xref linkend="public.table.tax"/>
  3509. </para>
  3510. </listitem>
  3511. <listitem>
  3512. <para>
  3513. <xref linkend="public.table.taxcategory"/>
  3514. </para>
  3515. </listitem>
  3516. </itemizedlist>
  3517. </para>
  3518. </section>
  3519. <section id="public.table.transactions"
  3520. xreflabel="public.transactions">
  3521. <title id="public.table.transactions-title">
  3522. Table:
  3523. <structname>transactions</structname>
  3524. </title>
  3525. <para>
  3526. <variablelist>
  3527. <title>
  3528. Structure of <structname>transactions</structname>
  3529. </title>
  3530. <varlistentry>
  3531. <term><structfield>id</structfield></term>
  3532. <listitem><para>
  3533. <type>integer</type>
  3534. <literal>PRIMARY KEY</literal>
  3535. </para>
  3536. </listitem>
  3537. </varlistentry>
  3538. <varlistentry>
  3539. <term><structfield>table_name</structfield></term>
  3540. <listitem><para>
  3541. <type>text</type>
  3542. </para>
  3543. </listitem>
  3544. </varlistentry>
  3545. </variablelist>
  3546. </para>
  3547. </section>
  3548. <section id="public.table.translation"
  3549. xreflabel="public.translation">
  3550. <title id="public.table.translation-title">
  3551. Table:
  3552. <structname>translation</structname>
  3553. </title>
  3554. <para>
  3555. <variablelist>
  3556. <title>
  3557. Structure of <structname>translation</structname>
  3558. </title>
  3559. <varlistentry>
  3560. <term><structfield>trans_id</structfield></term>
  3561. <listitem><para>
  3562. <type>integer</type>
  3563. <literal>PRIMARY KEY</literal>
  3564. </para>
  3565. </listitem>
  3566. </varlistentry>
  3567. <varlistentry>
  3568. <term><structfield>language_code</structfield></term>
  3569. <listitem><para>
  3570. <type>character varying(6)</type>
  3571. <literal>PRIMARY KEY</literal>
  3572. </para>
  3573. </listitem>
  3574. </varlistentry>
  3575. <varlistentry>
  3576. <term><structfield>description</structfield></term>
  3577. <listitem><para>
  3578. <type>text</type>
  3579. </para>
  3580. </listitem>
  3581. </varlistentry>
  3582. </variablelist>
  3583. <variablelist>
  3584. <title>Indexes on translation</title>
  3585. <varlistentry>
  3586. <term>translation_trans_id_key</term>
  3587. <listitem><para>trans_id</para></listitem>
  3588. </varlistentry>
  3589. </variablelist>
  3590. </para>
  3591. </section>
  3592. <section id="public.table.vendor"
  3593. xreflabel="public.vendor">
  3594. <title id="public.table.vendor-title">
  3595. Table:
  3596. <structname>vendor</structname>
  3597. </title>
  3598. <para>
  3599. <variablelist>
  3600. <title>
  3601. Structure of <structname>vendor</structname>
  3602. </title>
  3603. <varlistentry>
  3604. <term><structfield>id</structfield></term>
  3605. <listitem><para>
  3606. <type>integer</type>
  3607. <literal>PRIMARY KEY</literal>
  3608. <literal>DEFAULT nextval(&apos;id&apos;::regclass)</literal>
  3609. </para>
  3610. </listitem>
  3611. </varlistentry>
  3612. <varlistentry>
  3613. <term><structfield>name</structfield></term>
  3614. <listitem><para>
  3615. <type>character varying(64)</type>
  3616. </para>
  3617. </listitem>
  3618. </varlistentry>
  3619. <varlistentry>
  3620. <term><structfield>address1</structfield></term>
  3621. <listitem><para>
  3622. <type>character varying(32)</type>
  3623. </para>
  3624. </listitem>
  3625. </varlistentry>
  3626. <varlistentry>
  3627. <term><structfield>address2</structfield></term>
  3628. <listitem><para>
  3629. <type>character varying(32)</type>
  3630. </para>
  3631. </listitem>
  3632. </varlistentry>
  3633. <varlistentry>
  3634. <term><structfield>city</structfield></term>
  3635. <listitem><para>
  3636. <type>character varying(32)</type>
  3637. </para>
  3638. </listitem>
  3639. </varlistentry>
  3640. <varlistentry>
  3641. <term><structfield>state</structfield></term>
  3642. <listitem><para>
  3643. <type>character varying(32)</type>
  3644. </para>
  3645. </listitem>
  3646. </varlistentry>
  3647. <varlistentry>
  3648. <term><structfield>zipcode</structfield></term>
  3649. <listitem><para>
  3650. <type>character varying(10)</type>
  3651. </para>
  3652. </listitem>
  3653. </varlistentry>
  3654. <varlistentry>
  3655. <term><structfield>country</structfield></term>
  3656. <listitem><para>
  3657. <type>character varying(32)</type>
  3658. </para>
  3659. </listitem>
  3660. </varlistentry>
  3661. <varlistentry>
  3662. <term><structfield>contact</structfield></term>
  3663. <listitem><para>
  3664. <type>character varying(64)</type>
  3665. </para>
  3666. </listitem>
  3667. </varlistentry>
  3668. <varlistentry>
  3669. <term><structfield>phone</structfield></term>
  3670. <listitem><para>
  3671. <type>character varying(20)</type>
  3672. </para>
  3673. </listitem>
  3674. </varlistentry>
  3675. <varlistentry>
  3676. <term><structfield>fax</structfield></term>
  3677. <listitem><para>
  3678. <type>character varying(20)</type>
  3679. </para>
  3680. </listitem>
  3681. </varlistentry>
  3682. <varlistentry>
  3683. <term><structfield>email</structfield></term>
  3684. <listitem><para>
  3685. <type>text</type>
  3686. </para>
  3687. </listitem>
  3688. </varlistentry>
  3689. <varlistentry>
  3690. <term><structfield>notes</structfield></term>
  3691. <listitem><para>
  3692. <type>text</type>
  3693. </para>
  3694. </listitem>
  3695. </varlistentry>
  3696. <varlistentry>
  3697. <term><structfield>terms</structfield></term>
  3698. <listitem><para>
  3699. <type>smallint</type>
  3700. </para>
  3701. </listitem>
  3702. </varlistentry>
  3703. <varlistentry>
  3704. <term><structfield>taxincluded</structfield></term>
  3705. <listitem><para>
  3706. <type>boolean</type>
  3707. <literal>DEFAULT false</literal>
  3708. </para>
  3709. </listitem>
  3710. </varlistentry>
  3711. <varlistentry>
  3712. <term><structfield>vendornumber</structfield></term>
  3713. <listitem><para>
  3714. <type>character varying(32)</type>
  3715. </para>
  3716. </listitem>
  3717. </varlistentry>
  3718. <varlistentry>
  3719. <term><structfield>cc</structfield></term>
  3720. <listitem><para>
  3721. <type>text</type>
  3722. </para>
  3723. </listitem>
  3724. </varlistentry>
  3725. <varlistentry>
  3726. <term><structfield>bcc</structfield></term>
  3727. <listitem><para>
  3728. <type>text</type>
  3729. </para>
  3730. </listitem>
  3731. </varlistentry>
  3732. <varlistentry>
  3733. <term><structfield>gifi_accno</structfield></term>
  3734. <listitem><para>
  3735. <type>character varying(30)</type>
  3736. </para>
  3737. </listitem>
  3738. </varlistentry>
  3739. <varlistentry>
  3740. <term><structfield>business_id</structfield></term>
  3741. <listitem><para>
  3742. <type>integer</type>
  3743. </para>
  3744. </listitem>
  3745. </varlistentry>
  3746. <varlistentry>
  3747. <term><structfield>taxnumber</structfield></term>
  3748. <listitem><para>
  3749. <type>character varying(32)</type>
  3750. </para>
  3751. </listitem>
  3752. </varlistentry>
  3753. <varlistentry>
  3754. <term><structfield>sic_code</structfield></term>
  3755. <listitem><para>
  3756. <type>character varying(6)</type>
  3757. </para>
  3758. </listitem>
  3759. </varlistentry>
  3760. <varlistentry>
  3761. <term><structfield>discount</structfield></term>
  3762. <listitem><para>
  3763. <type>numeric</type>
  3764. </para>
  3765. </listitem>
  3766. </varlistentry>
  3767. <varlistentry>
  3768. <term><structfield>creditlimit</structfield></term>
  3769. <listitem><para>
  3770. <type>numeric</type>
  3771. </para>
  3772. </listitem>
  3773. </varlistentry>
  3774. <varlistentry>
  3775. <term><structfield>iban</structfield></term>
  3776. <listitem><para>
  3777. <type>character varying(34)</type>
  3778. </para>
  3779. </listitem>
  3780. </varlistentry>
  3781. <varlistentry>
  3782. <term><structfield>bic</structfield></term>
  3783. <listitem><para>
  3784. <type>character varying(11)</type>
  3785. </para>
  3786. </listitem>
  3787. </varlistentry>
  3788. <varlistentry>
  3789. <term><structfield>employee_id</structfield></term>
  3790. <listitem><para>
  3791. <type>integer</type>
  3792. </para>
  3793. </listitem>
  3794. </varlistentry>
  3795. <varlistentry>
  3796. <term><structfield>language_code</structfield></term>
  3797. <listitem><para>
  3798. <type>character varying(6)</type>
  3799. </para>
  3800. </listitem>
  3801. </varlistentry>
  3802. <varlistentry>
  3803. <term><structfield>pricegroup_id</structfield></term>
  3804. <listitem><para>
  3805. <type>integer</type>
  3806. </para>
  3807. </listitem>
  3808. </varlistentry>
  3809. <varlistentry>
  3810. <term><structfield>curr</structfield></term>
  3811. <listitem><para>
  3812. <type>character(3)</type>
  3813. </para>
  3814. </listitem>
  3815. </varlistentry>
  3816. <varlistentry>
  3817. <term><structfield>startdate</structfield></term>
  3818. <listitem><para>
  3819. <type>date</type>
  3820. </para>
  3821. </listitem>
  3822. </varlistentry>
  3823. <varlistentry>
  3824. <term><structfield>enddate</structfield></term>
  3825. <listitem><para>
  3826. <type>date</type>
  3827. </para>
  3828. </listitem>
  3829. </varlistentry>
  3830. </variablelist>
  3831. <variablelist>
  3832. <title>Indexes on vendor</title>
  3833. <varlistentry>
  3834. <term>vendor_contact_key</term>
  3835. <listitem><para>lower((contact)::text)</para></listitem>
  3836. </varlistentry>
  3837. <varlistentry>
  3838. <term>vendor_id_key</term>
  3839. <listitem><para>id</para></listitem>
  3840. </varlistentry>
  3841. <varlistentry>
  3842. <term>vendor_name_key</term>
  3843. <listitem><para>lower((name)::text)</para></listitem>
  3844. </varlistentry>
  3845. <varlistentry>
  3846. <term>vendor_vendornumber_key</term>
  3847. <listitem><para>vendornumber</para></listitem>
  3848. </varlistentry>
  3849. </variablelist>
  3850. </para>
  3851. </section>
  3852. <section id="public.table.vendortax"
  3853. xreflabel="public.vendortax">
  3854. <title id="public.table.vendortax-title">
  3855. Table:
  3856. <structname>vendortax</structname>
  3857. </title>
  3858. <para>
  3859. <variablelist>
  3860. <title>
  3861. Structure of <structname>vendortax</structname>
  3862. </title>
  3863. <varlistentry>
  3864. <term><structfield>vendor_id</structfield></term>
  3865. <listitem><para>
  3866. <type>integer</type>
  3867. <literal>PRIMARY KEY</literal>
  3868. </para>
  3869. </listitem>
  3870. </varlistentry>
  3871. <varlistentry>
  3872. <term><structfield>chart_id</structfield></term>
  3873. <listitem><para>
  3874. <type>integer</type>
  3875. <literal>PRIMARY KEY</literal>
  3876. </para>
  3877. </listitem>
  3878. </varlistentry>
  3879. </variablelist>
  3880. <variablelist>
  3881. <title>Indexes on vendortax</title>
  3882. <varlistentry>
  3883. <term>vendortax_vendor_id_key</term>
  3884. <listitem><para>vendor_id</para></listitem>
  3885. </varlistentry>
  3886. </variablelist>
  3887. </para>
  3888. </section>
  3889. <section id="public.table.warehouse"
  3890. xreflabel="public.warehouse">
  3891. <title id="public.table.warehouse-title">
  3892. Table:
  3893. <structname>warehouse</structname>
  3894. </title>
  3895. <para>
  3896. <variablelist>
  3897. <title>
  3898. Structure of <structname>warehouse</structname>
  3899. </title>
  3900. <varlistentry>
  3901. <term><structfield>id</structfield></term>
  3902. <listitem><para>
  3903. <type>integer</type>
  3904. <literal>PRIMARY KEY</literal>
  3905. <literal>DEFAULT nextval(&apos;id&apos;::regclass)</literal>
  3906. </para>
  3907. </listitem>
  3908. </varlistentry>
  3909. <varlistentry>
  3910. <term><structfield>description</structfield></term>
  3911. <listitem><para>
  3912. <type>text</type>
  3913. </para>
  3914. </listitem>
  3915. </varlistentry>
  3916. </variablelist>
  3917. </para>
  3918. </section>
  3919. <section id="public.table.yearend"
  3920. xreflabel="public.yearend">
  3921. <title id="public.table.yearend-title">
  3922. Table:
  3923. <structname>yearend</structname>
  3924. </title>
  3925. <para>
  3926. <variablelist>
  3927. <title>
  3928. Structure of <structname>yearend</structname>
  3929. </title>
  3930. <varlistentry>
  3931. <term><structfield>trans_id</structfield></term>
  3932. <listitem><para>
  3933. <type>integer</type>
  3934. <literal>PRIMARY KEY</literal>
  3935. </para>
  3936. </listitem>
  3937. </varlistentry>
  3938. <varlistentry>
  3939. <term><structfield>transdate</structfield></term>
  3940. <listitem><para>
  3941. <type>date</type>
  3942. </para>
  3943. </listitem>
  3944. </varlistentry>
  3945. </variablelist>
  3946. </para>
  3947. </section>
  3948. <!-- Function add_custom_field( character varying, character varying, character varying ) -->
  3949. <section id="public.function.add-custom-field-character-varying-character-varying-character-varying"
  3950. xreflabel="publicadd_custom_field( character varying, character varying, character varying )">
  3951. <title id="public.function.add-custom-field-character-varying-character-varying-character-varying-title">
  3952. add_custom_field( character varying, character varying, character varying )
  3953. </title>
  3954. <titleabbrev id="public.function.add-custom-field-character-varying-character-varying-character-varying-titleabbrev">
  3955. add_custom_field( character varying, character varying, character varying )
  3956. </titleabbrev>
  3957. <para>
  3958. <segmentedlist>
  3959. <title>Function Properties</title>
  3960. <?dbhtml list-presentation="list"?>
  3961. <segtitle>Language</segtitle>
  3962. <segtitle>Return Type</segtitle>
  3963. <seglistitem>
  3964. <seg>PLPGSQL</seg>
  3965. <seg>boolean</seg>
  3966. </seglistitem>
  3967. </segmentedlist>
  3968. <programlisting>
  3969. DECLARE
  3970. table_name ALIAS FOR $1;
  3971. new_field_name ALIAS FOR $2;
  3972. field_datatype ALIAS FOR $3;
  3973. BEGIN
  3974. EXECUTE &#39;SELECT TABLE_ID FROM custom_table_catalog
  3975. WHERE extends = &#39;&#39;&#39; || table_name || &#39;&#39;&#39; &#39;;
  3976. IF NOT FOUND THEN
  3977. BEGIN
  3978. INSERT INTO custom_table_catalog (extends)
  3979. VALUES (table_name);
  3980. EXECUTE &#39;CREATE TABLE custom_&#39;||table_name ||
  3981. &#39; (row_id INT PRIMARY KEY)&#39;;
  3982. EXCEPTION WHEN duplicate_table THEN
  3983. -- do nothing
  3984. END;
  3985. END IF;
  3986. EXECUTE &#39;INSERT INTO custom_field_catalog (field_name, table_id)
  3987. VALUES ( &#39;&#39;&#39; || new_field_name ||&#39;&#39;&#39;, (SELECT table_id FROM custom_table_catalog
  3988. WHERE extends = &#39;&#39;&#39;|| table_name || &#39;&#39;&#39;))&#39;;
  3989. EXECUTE &#39;ALTER TABLE custom_&#39;||table_name || &#39; ADD COLUMN &#39;
  3990. || new_field_name || &#39; &#39; || field_datatype;
  3991. RETURN TRUE;
  3992. END;
  3993. </programlisting>
  3994. </para>
  3995. </section>
  3996. <!-- Function avgcost( integer ) -->
  3997. <section id="public.function.avgcost-integer"
  3998. xreflabel="publicavgcost( integer )">
  3999. <title id="public.function.avgcost-integer-title">
  4000. avgcost( integer )
  4001. </title>
  4002. <titleabbrev id="public.function.avgcost-integer-titleabbrev">
  4003. avgcost( integer )
  4004. </titleabbrev>
  4005. <para>
  4006. <segmentedlist>
  4007. <title>Function Properties</title>
  4008. <?dbhtml list-presentation="list"?>
  4009. <segtitle>Language</segtitle>
  4010. <segtitle>Return Type</segtitle>
  4011. <seglistitem>
  4012. <seg>PLPGSQL</seg>
  4013. <seg>double precision</seg>
  4014. </seglistitem>
  4015. </segmentedlist>
  4016. <programlisting>
  4017. DECLARE
  4018. v_cost float;
  4019. v_qty float;
  4020. v_parts_id alias for $1;
  4021. BEGIN
  4022. SELECT INTO v_cost, v_qty SUM(i.sellprice * i.qty), SUM(i.qty)
  4023. FROM invoice i
  4024. JOIN ap a ON (a.id = i.trans_id)
  4025. WHERE i.parts_id = v_parts_id;
  4026. IF v_cost IS NULL THEN
  4027. v_cost := 0;
  4028. END IF;
  4029. IF NOT v_qty IS NULL THEN
  4030. IF v_qty = 0 THEN
  4031. v_cost := 0;
  4032. ELSE
  4033. v_cost := v_cost/v_qty;
  4034. END IF;
  4035. END IF;
  4036. RETURN v_cost;
  4037. END;
  4038. </programlisting>
  4039. </para>
  4040. </section>
  4041. <!-- Function check_department( ) -->
  4042. <section id="public.function.check-department"
  4043. xreflabel="publiccheck_department( )">
  4044. <title id="public.function.check-department-title">
  4045. check_department( )
  4046. </title>
  4047. <titleabbrev id="public.function.check-department-titleabbrev">
  4048. check_department( )
  4049. </titleabbrev>
  4050. <para>
  4051. <segmentedlist>
  4052. <title>Function Properties</title>
  4053. <?dbhtml list-presentation="list"?>
  4054. <segtitle>Language</segtitle>
  4055. <segtitle>Return Type</segtitle>
  4056. <seglistitem>
  4057. <seg>PLPGSQL</seg>
  4058. <seg>&quot;trigger&quot;</seg>
  4059. </seglistitem>
  4060. </segmentedlist>
  4061. <programlisting>
  4062. declare
  4063. dpt_id int;
  4064. begin
  4065. if new.department_id = 0 then
  4066. delete from dpt_trans where trans_id = new.id;
  4067. return NULL;
  4068. end if;
  4069. select into dpt_id trans_id from dpt_trans where trans_id = new.id;
  4070. if dpt_id &gt; 0 then
  4071. update dpt_trans set department_id = new.department_id where trans_id = dpt_id;
  4072. else
  4073. insert into dpt_trans (trans_id, department_id) values (new.id, new.department_id);
  4074. end if;
  4075. return NULL;
  4076. end;
  4077. </programlisting>
  4078. </para>
  4079. </section>
  4080. <!-- Function check_inventory( ) -->
  4081. <section id="public.function.check-inventory"
  4082. xreflabel="publiccheck_inventory( )">
  4083. <title id="public.function.check-inventory-title">
  4084. check_inventory( )
  4085. </title>
  4086. <titleabbrev id="public.function.check-inventory-titleabbrev">
  4087. check_inventory( )
  4088. </titleabbrev>
  4089. <para>
  4090. <segmentedlist>
  4091. <title>Function Properties</title>
  4092. <?dbhtml list-presentation="list"?>
  4093. <segtitle>Language</segtitle>
  4094. <segtitle>Return Type</segtitle>
  4095. <seglistitem>
  4096. <seg>PLPGSQL</seg>
  4097. <seg>&quot;trigger&quot;</seg>
  4098. </seglistitem>
  4099. </segmentedlist>
  4100. <programlisting>
  4101. declare
  4102. itemid int;
  4103. row_data inventory%rowtype;
  4104. begin
  4105. if not old.quotation then
  4106. for row_data in select * from inventory where trans_id = old.id loop
  4107. select into itemid id from orderitems where trans_id = old.id and id = row_data.orderitems_id;
  4108. if itemid is null then
  4109. delete from inventory where trans_id = old.id and orderitems_id = row_data.orderitems_id;
  4110. end if;
  4111. end loop;
  4112. end if;
  4113. return old;
  4114. end;
  4115. </programlisting>
  4116. </para>
  4117. </section>
  4118. <!-- Function del_customer( ) -->
  4119. <section id="public.function.del-customer"
  4120. xreflabel="publicdel_customer( )">
  4121. <title id="public.function.del-customer-title">
  4122. del_customer( )
  4123. </title>
  4124. <titleabbrev id="public.function.del-customer-titleabbrev">
  4125. del_customer( )
  4126. </titleabbrev>
  4127. <para>
  4128. <segmentedlist>
  4129. <title>Function Properties</title>
  4130. <?dbhtml list-presentation="list"?>
  4131. <segtitle>Language</segtitle>
  4132. <segtitle>Return Type</segtitle>
  4133. <seglistitem>
  4134. <seg>PLPGSQL</seg>
  4135. <seg>&quot;trigger&quot;</seg>
  4136. </seglistitem>
  4137. </segmentedlist>
  4138. <programlisting>
  4139. begin
  4140. delete from shipto where trans_id = old.id;
  4141. delete from customertax where customer_id = old.id;
  4142. delete from partscustomer where customer_id = old.id;
  4143. return NULL;
  4144. end;
  4145. </programlisting>
  4146. </para>
  4147. </section>
  4148. <!-- Function del_department( ) -->
  4149. <section id="public.function.del-department"
  4150. xreflabel="publicdel_department( )">
  4151. <title id="public.function.del-department-title">
  4152. del_department( )
  4153. </title>
  4154. <titleabbrev id="public.function.del-department-titleabbrev">
  4155. del_department( )
  4156. </titleabbrev>
  4157. <para>
  4158. <segmentedlist>
  4159. <title>Function Properties</title>
  4160. <?dbhtml list-presentation="list"?>
  4161. <segtitle>Language</segtitle>
  4162. <segtitle>Return Type</segtitle>
  4163. <seglistitem>
  4164. <seg>PLPGSQL</seg>
  4165. <seg>&quot;trigger&quot;</seg>
  4166. </seglistitem>
  4167. </segmentedlist>
  4168. <programlisting>
  4169. begin
  4170. delete from dpt_trans where trans_id = old.id;
  4171. return NULL;
  4172. end;
  4173. </programlisting>
  4174. </para>
  4175. </section>
  4176. <!-- Function del_exchangerate( ) -->
  4177. <section id="public.function.del-exchangerate"
  4178. xreflabel="publicdel_exchangerate( )">
  4179. <title id="public.function.del-exchangerate-title">
  4180. del_exchangerate( )
  4181. </title>
  4182. <titleabbrev id="public.function.del-exchangerate-titleabbrev">
  4183. del_exchangerate( )
  4184. </titleabbrev>
  4185. <para>
  4186. <segmentedlist>
  4187. <title>Function Properties</title>
  4188. <?dbhtml list-presentation="list"?>
  4189. <segtitle>Language</segtitle>
  4190. <segtitle>Return Type</segtitle>
  4191. <seglistitem>
  4192. <seg>PLPGSQL</seg>
  4193. <seg>&quot;trigger&quot;</seg>
  4194. </seglistitem>
  4195. </segmentedlist>
  4196. <programlisting>
  4197. declare
  4198. t_transdate date;
  4199. t_curr char(3);
  4200. t_id int;
  4201. d_curr text;
  4202. begin
  4203. select into d_curr substr(value,1,3) from defaults where setting_key = &#39;curr&#39;;
  4204. if TG_RELNAME = &#39;ar&#39; then
  4205. select into t_curr, t_transdate curr, transdate from ar where id = old.id;
  4206. end if;
  4207. if TG_RELNAME = &#39;ap&#39; then
  4208. select into t_curr, t_transdate curr, transdate from ap where id = old.id;
  4209. end if;
  4210. if TG_RELNAME = &#39;oe&#39; then
  4211. select into t_curr, t_transdate curr, transdate from oe where id = old.id;
  4212. end if;
  4213. if d_curr != t_curr then
  4214. select into t_id a.id from acc_trans ac
  4215. join ar a on (a.id = ac.trans_id)
  4216. where a.curr = t_curr
  4217. and ac.transdate = t_transdate
  4218. except select a.id from ar a where a.id = old.id
  4219. union
  4220. select a.id from acc_trans ac
  4221. join ap a on (a.id = ac.trans_id)
  4222. where a.curr = t_curr
  4223. and ac.transdate = t_transdate
  4224. except select a.id from ap a where a.id = old.id
  4225. union
  4226. select o.id from oe o
  4227. where o.curr = t_curr
  4228. and o.transdate = t_transdate
  4229. except select o.id from oe o where o.id = old.id;
  4230. if not found then
  4231. delete from exchangerate where curr = t_curr and transdate = t_transdate;
  4232. end if;
  4233. end if;
  4234. return old;
  4235. end;
  4236. </programlisting>
  4237. </para>
  4238. </section>
  4239. <!-- Function del_recurring( ) -->
  4240. <section id="public.function.del-recurring"
  4241. xreflabel="publicdel_recurring( )">
  4242. <title id="public.function.del-recurring-title">
  4243. del_recurring( )
  4244. </title>
  4245. <titleabbrev id="public.function.del-recurring-titleabbrev">
  4246. del_recurring( )
  4247. </titleabbrev>
  4248. <para>
  4249. <segmentedlist>
  4250. <title>Function Properties</title>
  4251. <?dbhtml list-presentation="list"?>
  4252. <segtitle>Language</segtitle>
  4253. <segtitle>Return Type</segtitle>
  4254. <seglistitem>
  4255. <seg>PLPGSQL</seg>
  4256. <seg>&quot;trigger&quot;</seg>
  4257. </seglistitem>
  4258. </segmentedlist>
  4259. <programlisting>
  4260. BEGIN
  4261. DELETE FROM recurring WHERE id = old.id;
  4262. DELETE FROM recurringemail WHERE id = old.id;
  4263. DELETE FROM recurringprint WHERE id = old.id;
  4264. RETURN NULL;
  4265. END;
  4266. </programlisting>
  4267. </para>
  4268. </section>
  4269. <!-- Function del_vendor( ) -->
  4270. <section id="public.function.del-vendor"
  4271. xreflabel="publicdel_vendor( )">
  4272. <title id="public.function.del-vendor-title">
  4273. del_vendor( )
  4274. </title>
  4275. <titleabbrev id="public.function.del-vendor-titleabbrev">
  4276. del_vendor( )
  4277. </titleabbrev>
  4278. <para>
  4279. <segmentedlist>
  4280. <title>Function Properties</title>
  4281. <?dbhtml list-presentation="list"?>
  4282. <segtitle>Language</segtitle>
  4283. <segtitle>Return Type</segtitle>
  4284. <seglistitem>
  4285. <seg>PLPGSQL</seg>
  4286. <seg>&quot;trigger&quot;</seg>
  4287. </seglistitem>
  4288. </segmentedlist>
  4289. <programlisting>
  4290. begin
  4291. delete from shipto where trans_id = old.id;
  4292. delete from vendortax where vendor_id = old.id;
  4293. delete from partsvendor where vendor_id = old.id;
  4294. return NULL;
  4295. end;
  4296. </programlisting>
  4297. </para>
  4298. </section>
  4299. <!-- Function del_yearend( ) -->
  4300. <section id="public.function.del-yearend"
  4301. xreflabel="publicdel_yearend( )">
  4302. <title id="public.function.del-yearend-title">
  4303. del_yearend( )
  4304. </title>
  4305. <titleabbrev id="public.function.del-yearend-titleabbrev">
  4306. del_yearend( )
  4307. </titleabbrev>
  4308. <para>
  4309. <segmentedlist>
  4310. <title>Function Properties</title>
  4311. <?dbhtml list-presentation="list"?>
  4312. <segtitle>Language</segtitle>
  4313. <segtitle>Return Type</segtitle>
  4314. <seglistitem>
  4315. <seg>PLPGSQL</seg>
  4316. <seg>&quot;trigger&quot;</seg>
  4317. </seglistitem>
  4318. </segmentedlist>
  4319. <programlisting>
  4320. begin
  4321. delete from yearend where trans_id = old.id;
  4322. return NULL;
  4323. end;
  4324. </programlisting>
  4325. </para>
  4326. </section>
  4327. <!-- Function drop_custom_field( character varying, character varying ) -->
  4328. <section id="public.function.drop-custom-field-character-varying-character-varying"
  4329. xreflabel="publicdrop_custom_field( character varying, character varying )">
  4330. <title id="public.function.drop-custom-field-character-varying-character-varying-title">
  4331. drop_custom_field( character varying, character varying )
  4332. </title>
  4333. <titleabbrev id="public.function.drop-custom-field-character-varying-character-varying-titleabbrev">
  4334. drop_custom_field( character varying, character varying )
  4335. </titleabbrev>
  4336. <para>
  4337. <segmentedlist>
  4338. <title>Function Properties</title>
  4339. <?dbhtml list-presentation="list"?>
  4340. <segtitle>Language</segtitle>
  4341. <segtitle>Return Type</segtitle>
  4342. <seglistitem>
  4343. <seg>PLPGSQL</seg>
  4344. <seg>boolean</seg>
  4345. </seglistitem>
  4346. </segmentedlist>
  4347. <programlisting>
  4348. DECLARE
  4349. table_name ALIAS FOR $1;
  4350. custom_field_name ALIAS FOR $2;
  4351. BEGIN
  4352. DELETE FROM custom_field_catalog
  4353. WHERE field_name = custom_field_name AND
  4354. table_id = (SELECT table_id FROM custom_table_catalog
  4355. WHERE extends = table_name);
  4356. EXECUTE &#39;ALTER TABLE custom_&#39; || table_name ||
  4357. &#39; DROP COLUMN &#39; || custom_field_name;
  4358. RETURN TRUE;
  4359. END;
  4360. </programlisting>
  4361. </para>
  4362. </section>
  4363. <!-- Function lastcost( integer ) -->
  4364. <section id="public.function.lastcost-integer"
  4365. xreflabel="publiclastcost( integer )">
  4366. <title id="public.function.lastcost-integer-title">
  4367. lastcost( integer )
  4368. </title>
  4369. <titleabbrev id="public.function.lastcost-integer-titleabbrev">
  4370. lastcost( integer )
  4371. </titleabbrev>
  4372. <para>
  4373. <segmentedlist>
  4374. <title>Function Properties</title>
  4375. <?dbhtml list-presentation="list"?>
  4376. <segtitle>Language</segtitle>
  4377. <segtitle>Return Type</segtitle>
  4378. <seglistitem>
  4379. <seg>PLPGSQL</seg>
  4380. <seg>double precision</seg>
  4381. </seglistitem>
  4382. </segmentedlist>
  4383. <programlisting>
  4384. DECLARE
  4385. v_cost float;
  4386. v_parts_id alias for $1;
  4387. BEGIN
  4388. SELECT INTO v_cost sellprice FROM invoice i
  4389. JOIN ap a ON (a.id = i.trans_id)
  4390. WHERE i.parts_id = v_parts_id
  4391. ORDER BY a.transdate desc, a.id desc
  4392. LIMIT 1;
  4393. IF v_cost IS NULL THEN
  4394. v_cost := 0;
  4395. END IF;
  4396. RETURN v_cost;
  4397. END;
  4398. </programlisting>
  4399. </para>
  4400. </section>
  4401. <!-- Function trigger_parts_short( ) -->
  4402. <section id="public.function.trigger-parts-short"
  4403. xreflabel="publictrigger_parts_short( )">
  4404. <title id="public.function.trigger-parts-short-title">
  4405. trigger_parts_short( )
  4406. </title>
  4407. <titleabbrev id="public.function.trigger-parts-short-titleabbrev">
  4408. trigger_parts_short( )
  4409. </titleabbrev>
  4410. <para>
  4411. <segmentedlist>
  4412. <title>Function Properties</title>
  4413. <?dbhtml list-presentation="list"?>
  4414. <segtitle>Language</segtitle>
  4415. <segtitle>Return Type</segtitle>
  4416. <seglistitem>
  4417. <seg>PLPGSQL</seg>
  4418. <seg>&quot;trigger&quot;</seg>
  4419. </seglistitem>
  4420. </segmentedlist>
  4421. <programlisting>
  4422. BEGIN
  4423. IF NEW.onhand &gt;= NEW.rop THEN
  4424. NOTIFY parts_short;
  4425. END IF;
  4426. RETURN NEW;
  4427. END;
  4428. </programlisting>
  4429. </para>
  4430. </section>
  4431. <!-- Function update_user( integer, text ) -->
  4432. <section id="public.function.update-user-integer-text"
  4433. xreflabel="publicupdate_user( integer, text )">
  4434. <title id="public.function.update-user-integer-text-title">
  4435. update_user( integer, text )
  4436. </title>
  4437. <titleabbrev id="public.function.update-user-integer-text-titleabbrev">
  4438. update_user( integer, text )
  4439. </titleabbrev>
  4440. <para>
  4441. <segmentedlist>
  4442. <title>Function Properties</title>
  4443. <?dbhtml list-presentation="list"?>
  4444. <segtitle>Language</segtitle>
  4445. <segtitle>Return Type</segtitle>
  4446. <seglistitem>
  4447. <seg>SQL</seg>
  4448. <seg>integer</seg>
  4449. </seglistitem>
  4450. </segmentedlist>
  4451. Takes int4 which is users.id and text which is username. Will update username based on id. Username is unique
  4452. <programlisting>
  4453. UPDATE users SET username = &#39;$2&#39; WHERE id = $1;
  4454. SELECT 1;
  4455. </programlisting>
  4456. </para>
  4457. </section>
  4458. </chapter>
  4459. </book>