URI unbundled from libwww-perl, so list it separately
[freeside.git] / htdocs / docs / schema.html
1 <head>
2   <title>Schema reference</title>
3 </head>
4 <body>
5   <h1>Schema reference</h1>
6   <ul>
7     <li><a name="agent">agent</a> - Agents are resellers of your service.  Agents may be limited to a subset of your full offerings (via their agent type).
8       <ul>
9         <li>agentnum - primary key
10         <li>agent - name of this agent
11         <li>typenum - <a href="#agent_type">agent type</a>
12         <li>prog - (unimplemented)
13         <li>freq - (unimplemented)
14       </ul>
15     <li><a name="agent_type">agent_type</a> - Agent types define groups of packages that you can then assign to particular agents.
16       <ul>
17         <li>typenum - primary key
18         <li>atype - name of this agent type
19       </ul>
20     <li><a name="cust_bill">cust_bill</a> - Invoices
21       <ul>
22         <li>invnum - primary key
23         <li>custnum - <a href="#cust_main">customer</a>
24         <li>_date
25         <li>charged - amount of this invoice
26         <li>owed - amount still outstanding on this invoice
27         <li>printed - how many times this invoice has been printed automatically
28       </ul>
29     <li><a name="cust_bill_pkg">cust_bill_pkg</a> - Invoice line items
30       <ul>
31         <li>invnum - (multiple) key
32         <li>pkgnum - <a href="#cust_pkg">package</a>
33         <li>setup - setup fee 
34         <li>recur - recurring fee
35         <li>sdate - starting date
36         <li>edate - ending date
37       </ul>
38     <li><a name="cust_credit">cust_credit</a> - Credits
39       <ul>
40         <li>crednum - primary key
41         <li>custnum - <a href="#cust_main">customer</a>
42         <li>amount - amount credited
43         <li>credited - amount still outstanding (not yet refunded) on this credit
44         <li>_date
45         <li>otaker - order taker
46         <li>reason
47       </ul>
48     <li><a name="cust_main">cust_main</a> - Customers
49       <ul>
50         <li>custnum - primary key
51         <li>agentnum - <a href="#agent">agent</a>
52         <li>refnum - <a href="#part_referral">referral</a>
53         <li>titlenum - <a href="#part_title">title</a>
54         <li>first - name
55         <li>middle - name
56         <li>last - name
57         <li>ss - social security number
58         <li>company
59         <li>address1
60         <li>address2
61         <li>city
62         <li>county
63         <li>state
64         <li>zip
65         <li>country
66         <li>daytime - phone
67         <li>night - phone
68         <li>payby - CARD, BILL, or COMP
69         <li>payinfo - card number, P.O.#, or comp issuer
70         <li>paydate - expiration date
71         <li>payname - billing name (name on card)
72         <li>tax - tax exempt, Y or null
73         <li>otaker - order taker
74       </ul>
75     <li><a name="cust_main_invoice">cust_main_invoice</a> - Invoice destinations for email invoices
76       <ul>
77         <li>destnum - primary key
78         <li>custnum - <a href="#cust_main">customer</a>
79         <li>dest - Invoice destination: If numeric, a <a href="#svc_acct">svcnum</a>, if string, a literal email address, or `POST' to enable mailing (the default if no cust_main_invoice records exist)
80       </ul>
81     <li><a name="cust_main_county">cust_main_county</a> - Tax rates
82       <ul>
83         <li>taxnum - primary key
84         <li>state
85         <li>county
86         <li>country
87         <li>tax - % rate
88       </ul>
89     <li><a name="cust_pay">cust_pay</a> - Payments
90       <ul>
91         <li>paynum - primary key
92         <li>invnum - <a href="#cust_bill">invoice</a>
93         <li>paid - amount
94         <li>_date
95         <li>payby - CARD, BILL, or COMP
96         <li>payinfo - card number, P.O.#, or comp issuer
97         <li>paybatch - text field for tracking card processor batches
98       </ul>
99     <li><a name="cust_pay_batch">cust_pay_batch</a> - Pending batch
100       <ul>
101         <li>trancode - 77 for charges
102         <li>cardnum
103         <li>exp - card expiration
104         <li>amount
105         <li>invnum - <a href="#cust_bill">invoice</a>
106         <li>custnum - <a href="#cust_main">customer</a>
107         <li>payname - name on card
108         <li>first - name
109         <li>last - name
110         <li>address1
111         <li>address2
112         <li>city
113         <li>state
114         <li>zip
115         <li>country
116       </ul>
117     <li><a name="cust_pkg">cust_pkg</a> - Customer billing items
118       <ul>
119         <li>pkgnum - primary key
120         <li>custnum - <a href="#cust_main">customer</a>
121         <li>pkgpart - <a href="#part_pkg">Package definition</a>
122         <li>setup - date
123         <li>bill - next bill date
124         <li>susp - (past) suspension date
125         <li>expire - (future) cancellation date
126         <li>cancel - (past) cancellation date
127         <li>otaker - order taker
128       </ul>
129     <li><a name="cust_refund">cust_refund</a> - Refunds
130       <ul>
131         <li>refundnum - primary key
132         <li>crednum - <a href="#cust_credit">credit</a>
133         <li>refund - amount
134         <li>_date
135         <li>payby - CARD, BILL or COMP
136         <li>payinfo - card number, P.O.#, or comp issuer
137         <li>otaker - order taker
138       </ul>
139     <li><a name="cust_svc">cust_svc</a> - Customer services
140       <ul>
141         <li>svcnum - primary key
142         <li>pkgnum - <a href="#cust_pkg">package</a>
143         <li>svcpart - <a href="#part_svc">Service definition</a>
144       </ul>
145     <li><a name="part_pkg">part_pkg</a> - Package definitions
146       <ul>
147         <li>pkgpart - primary key
148         <li>pkg - package name
149         <li>comment - non-customer visable package comment
150         <li>setup - setup fee
151         <li>freq - recurring frequency (months)
152         <li>recur - recurring fee
153       </ul>
154     <li><a name="part_referral">part_referral</a> - Referral listing
155       <ul>
156         <li>refnum</li> - primary key
157         <li>referral</li> - referral
158       </ul>
159     <li><a name="part_svc">part_svc</a> - Service definitions
160       <ul>
161         <li>svcpart - primary key
162         <li>svc - name of this service
163         <li>svcdb - table used for this service: svc_acct, svc_acct_sm, svc_domain, svc_charge or svc_wo
164         <li><i>table</i>__<i>field</i> - Default or fixed value for <i>field</i> in <i>table</i>
165         <li><i>table</i>__<i>field</i>_flag - null, D or F
166       </ul>
167     <li><a name="part_title">part_title</a> - Personal titles
168       <ul>
169         <li>titlenum - primary key
170         <li>title - personal title (`Dr.' or `Mr.')
171       </ul>
172     <li><a name="pkg_svc">pkg_svc</a>
173       <ul>
174         <li>pkgpart - <a href="#part_pkg">Package definition</a>
175         <li>svcpart - <a href="#part_svc">Service definition</a>
176         <li>quantity - quantity of this service that this package includes
177       </ul>
178     <li><a name="svc_acct">svc_acct</a> - Accounts
179       <ul>
180         <li>svcnum - <a href="#cust_svc">primary key</a>
181         <li>username
182         <li>_password
183         <li>popnum - <a href="#svc_acct_pop">Point of Presence</a>
184         <li>uid
185         <li>gid
186         <li>finger - GECOS
187         <li>dir
188         <li>shell
189         <li>quota - (unimplementd)
190         <li>slipip - IP address
191         <li>radius_<i>Radius_Attribute</i> - Radius-Attribute
192       </ul>
193     <li><a name="svc_acct_pop">svc_acct_pop</a> - Points of Presence
194       <ul>
195         <li>popnum - primary key
196         <li>city
197         <li>state
198         <li>ac - area code
199         <li>exch - exchange
200       </ul>
201     <li><a name="svc_acct_sm">svc_acct_sm</a> - Domain mail aliases
202       <ul>
203         <li>svcnum - <a href="#cust_svc">primary key</a>
204         <li>domsvc - <a href="#svc_domain">Domain</a> (by svcnum)
205         <li>domuid - <a href="#svc_acct">Account</a> (by uid)
206         <li>domuser - domuser @ <a href="#svc_domain">Domain</a> forwards to <a href="#svc_acct">Account</a>
207       </ul>
208     <li><a name="svc_domain">svc_domain</a> - Domains
209       <ul>
210         <li>svcnum - <a href="#cust_svc">primary key</a>
211         <li>domain
212       </ul>
213     <li><a name="type_pkgs">type_pkgs</a>
214       <ul>
215         <li>typenum - <a href="#agent_type">agent type</a>
216         <li>pkgpart - <a href="#part_pkg">Package definition</a>
217       </ul>
218   </ul>
219 </body>