2 <title>Schema reference</title>
5 <h1>Schema reference</h1>
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).
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)
15 <li><a name="agent_type">agent_type</a> - Agent types define groups of packages that you can then assign to particular agents.
17 <li>typenum - primary key
18 <li>atype - name of this agent type
20 <li><a name="cust_bill">cust_bill</a> - Invoices. Declarations that a customer owes you money. The specific charges are itemized in <a href="#cust_billl_pkg">cust_bill_pkg</a>.
22 <li>invnum - primary key
23 <li>custnum - <a href="#cust_main">customer</a>
25 <li>charged - amount of this invoice
26 <li>printed - how many times this invoice has been printed automatically
28 <li><a name="cust_bill_pkg">cust_bill_pkg</a> - Invoice line items
30 <li>invnum - (multiple) key
31 <li>pkgnum - <a href="#cust_pkg">package</a> or 0 for the special virtual sales tax package
33 <li>recur - recurring fee
34 <li>sdate - starting date
35 <li>edate - ending date
37 <li><a name="cust_credit">cust_credit</a> - Credits. The equivalent of a negative <a href="#cust_bill">cust_bill</a> record.
39 <li>crednum - primary key
40 <li>custnum - <a href="#cust_main">customer</a>
41 <li>amount - amount credited
43 <li>otaker - order taker
46 <li><a name="cust_main">cust_main</a> - Customers
48 <li>custnum - primary key
49 <li>agentnum - <a href="#agent">agent</a>
50 <li>refnum - <a href="#part_referral">referral</a>
51 <li>titlenum - <a href="#part_title">title</a>
54 <li>ss - social security number
68 <li><i>ship_company</i>
69 <li><i>ship_address1</i>
70 <li><i>ship_address2</i>
72 <li><i>ship_county</i>
75 <li><i>ship_country</i>
76 <li><i>ship_daytime</i>
79 <li>payby - CARD, BILL, or COMP
80 <li>payinfo - card number, P.O.#, or comp issuer
81 <li>paydate - expiration date
82 <li>payname - billing name (name on card)
83 <li>tax - tax exempt, Y or null
84 <li>otaker - order taker
86 (columns in <i>italics</i> are optional)
87 <li><a name="cust_main_invoice">cust_main_invoice</a> - Invoice destinations for email invoices. Note that a customer can have many email destinations for their invoice (either literal or via svcnum), but only one postal destination.
89 <li>destnum - primary key
90 <li>custnum - <a href="#cust_main">customer</a>
91 <li>dest - Invoice destination. Freeside supports three types of invoice delivery: send directly to a service defined in Freeside, send to an arbitrary email address, or print the invoice to a printer and have someone send it out via snail mail. Freeside determines which method to use based on the contents of the dest field. If the contents are numeric, a <a href="#svc_acct">svcnum</a> pointing to a valid service is expected in the field. If the contents are a string, a literal email address is expected to be in the field. If the special keyword `POST' is present, the snail mail method is used (which is the default if no cust_main_invoice records exist). Snail mail invoices get their address information from <A name="#cust_main">cust_main</A> and are printed with the printer defined in the configuration files.
93 <li><a name="cust_main_county">cust_main_county</a> - Tax rates
95 <li>taxnum - primary key
101 <li><a name="cust_pay">cust_pay</a> - Payments. Money being transferred from a customer.
103 <li>paynum - primary key
104 <li>invnum - <a href="#cust_bill">invoice</a>
107 <li>payby - CARD, BILL, or COMP
108 <li>payinfo - card number, P.O.#, or comp issuer
109 <li>paybatch - text field for tracking card processor batches
111 <li><a name="cust_pay_batch">cust_pay_batch</a> - Pending batch
113 <li>trancode - 77 for charges
115 <li>exp - card expiration
117 <li>invnum - <a href="#cust_bill">invoice</a>
118 <li>custnum - <a href="#cust_main">customer</a>
119 <li>payname - name on card
129 <li><a name="cust_pkg">cust_pkg</a> - Customer billing items
131 <li>pkgnum - primary key
132 <li>custnum - <a href="#cust_main">customer</a>
133 <li>pkgpart - <a href="#part_pkg">Package definition</a>
135 <li>bill - next bill date
136 <li>susp - (past) suspension date
137 <li>expire - (future) cancellation date
138 <li>cancel - (past) cancellation date
139 <li>otaker - order taker
141 <li><a name="cust_refund">cust_refund</a> - Refunds. The transfer of money to a customer; equivalent to a negative <a href="#cust_pay">cust_pay</a> record.
143 <li>refundnum - primary key
144 <li>crednum - <a href="#cust_credit">credit</a>
147 <li>payby - CARD, BILL or COMP
148 <li>payinfo - card number, P.O.#, or comp issuer
149 <li>otaker - order taker
151 <li><a name="cust_svc">cust_svc</a> - Customer services
153 <li>svcnum - primary key
154 <li>pkgnum - <a href="#cust_pkg">package</a>
155 <li>svcpart - <a href="#part_svc">Service definition</a>
157 <li><a name="nas">nas</a> - Network Access Server (terminal server)
159 <li>nasnum - primary key
161 <li>nasip - NAS ip address
162 <li>nasfqdn - NAS fully-qualified domain name
163 <li>last - timestamp indicating the last instant the NAS was in a known state (used by the session monitoring).
165 <li><a name="part_pkg">part_pkg</a> - Package definitions
167 <li>pkgpart - primary key
168 <li>pkg - package name
169 <li>comment - non-customer visable package comment
170 <li>setup - setup fee
171 <li>freq - recurring frequency (months)
172 <li>recur - recurring fee
174 <li><a name="part_referral">part_referral</a> - Referral listing
176 <li>refnum - primary key
177 <li>referral - referral
179 <li><a name="part_svc">part_svc</a> - Service definitions
181 <li>svcpart - primary key
182 <li>svc - name of this service
183 <li>svcdb - table used for this service: svc_acct, svc_acct_sm, svc_forward, svc_domain, svc_charge or svc_wo
184 <li><i>table</i>__<i>field</i> - Default or fixed value for <i>field</i> in <i>table</i>
185 <li><i>table</i>__<i>field</i>_flag - null, D or F
187 <li><a name="part_title">part_title</a> - Personal titles
189 <li>titlenum - primary key
190 <li>title - personal title (`Dr.' or `Mr.')
192 <li><a name="pkg_svc">pkg_svc</a>
194 <li>pkgpart - <a href="#part_pkg">Package definition</a>
195 <li>svcpart - <a href="#part_svc">Service definition</a>
196 <li>quantity - quantity of this service that this package includes
198 <li><a name="port">port</a> - individual port on a <a href="#nas">nas</a>
200 <li>portnum - primary key
201 <li>ip - IP address of this port
202 <li>nasport - port number on the NAS
203 <li>nasnum - <a href="#nas">NAS</a>
205 <li><a name="prepay_credit">prepay_credit</a>
207 <li>prepaynum - primary key
208 <li>identifier - text or numeric string used to receive this credit
209 <li>amount - amount of credit
211 <li><a name="session">session</a>
213 <li>sessionnum - primary key
214 <li>portnum - <a href="#port">Port</a>
215 <li>svcnum - <a href="#svc_acct">Account</a>
216 <li>login - timestamp indicating the beginning of this user session.
217 <li>logout - timestamp indicating the end of this user session. May be null, which indicates a currently open session.
220 <li><a name="svc_acct">svc_acct</a> - Accounts
222 <li>svcnum - <a href="#cust_svc">primary key</a>
225 <li>popnum - <a href="#svc_acct_pop">Point of Presence</a>
231 <li>quota - (unimplementd)
232 <li>slipip - IP address
233 <li>radius_<i>Radius_Attribute</i> - Radius-Attribute
235 <li><a name="svc_acct_pop">svc_acct_pop</a> - Points of Presence
237 <li>popnum - primary key
242 <li>loc - rest of number
244 <li><a name="svc_acct_sm">svc_acct_sm</a> - <b>DEPRICIATED</b> Domain mail aliases
246 <li>svcnum - <a href="#cust_svc">primary key</a>
247 <li>domsvc - <a href="#svc_domain">Domain</a> (by svcnum)
248 <li>domuid - <a href="#svc_acct">Account</a> (by uid)
249 <li>domuser - domuser @ <a href="#svc_domain">Domain</a> forwards to <a href="#svc_acct">Account</a>
251 <li><a name="svc_domain">svc_domain</a> - Domains
253 <li>svcnum - <a href="#cust_svc">primary key</a>
256 <li><a name="svc_forward>svc_forward</a> - Mail forwarding aliases
258 <li>svcnum - <a href="#cust_svc">primary key</a>
259 <li>srcsvc - <a href="#svc_acct">svcnum of the source of this forward
260 <li>dstsvc - <a href="#svc_acct">svcnum of the destination of this forward
261 <li>dst - foreign destination (email address) - forward not local to freeside
263 <li><a name="domain_record">domain_record</a> - Domain zone detail
265 <li>recnum - primary key
266 <li>svcnum - <a href="#svc_domain">Domain</a> (by svcnum)
267 <li>reczone - zone for this line
268 <li>recaf - address family, usually <b>IN</b>
269 <li>rectype - type for this record (<b>A</b>, <b>MX</b>, etc.)
270 <li>recdata - data for this record
272 <li><a name="svc_www">svc_www</a>
274 <li>svcnum - <a href="#cust-svc">primary key</a>
275 <li>recnum - <a href="#domain_record">host</a>
276 <li>usersvc - <a href="#svc_acct">account</a>
278 <li><a name="type_pkgs">type_pkgs</a>
280 <li>typenum - <a href="#agent_type">agent type</a>
281 <li>pkgpart - <a href="#part_pkg">Package definition</a>