2 <title>Schema reference</title>
5 <h1>Schema reference</h1>
6 Schema diagram (1.4.1): <a href="schema.png">as a giant .png</a> or <a href="schema.dia">dia source</a> (<a href="http://www.lysator.liu.se/~alla/dia/">dia homepage</a>).
8 <li><a name="agent" href="man/FS/agent.html">agent</a> - Agents are resellers of your service. Agents may be limited to a subset of your full offerings (via their agent type).
10 <li>agentnum - primary key
11 <li>agent - name of this agent
12 <li>typenum - <a href="#agent_type">agent type</a>
13 <li>prog - (unimplemented)
14 <li>freq - (unimplemented)
15 <li>disabled - Disabled flag, empty or 'Y'
16 <li>username - Username for the Agent interface
17 <li>_password - Password for the Agent interface
19 <li><a name="agent_type" href="man/FS/agent_type.html">agent_type</a> - Agent types define groups of packages that you can then assign to particular agents.
21 <li>typenum - primary key
22 <li>atype - name of this agent type
24 <li><a name="cust_bill" href="man/FS/cust_bill.html">cust_bill</a> - Invoices. Declarations that a customer owes you money. The specific charges are itemized in <a href="#cust_bill_pkg">cust_bill_pkg</a>.
26 <li>billpkgnum - primary_key
27 <li>invnum - primary key
28 <li>custnum - <a href="#cust_main">customer</a>
30 <li>charged - amount of this invoice
31 <li>printed - how many times this invoice has been printed automatically
32 <li>closed - books closed flag, empty or `Y'
34 <li><a name="cust_bill_event" href="man/FS/cust_bill_event.html">cust_bill_event</a> - Invoice event history
36 <li>eventnum - primary key
37 <li>invnum - <a href="#cust_bill">invoice</a>
38 <li>eventpart - <a href="#part_bill_event">event definition</a>
43 <li><a name="part_bill_event" href="man/FS/part_bill_event.html">part_bill_event</a> - Invoice event definitions
45 <li>eventpart - primary key
46 <li>payby - CARD, DCRD, CHEK, DCHK, LECB, BILL, or COMP
47 <li>event - event name
48 <li>eventcode - event action
49 <li>seconds - how long after the invoice date (<a href="#cust_bill">cust_bill</a>._date) events of this type are triggered
50 <li>weight - ordering for events with identical seconds
51 <li>plan - eventcode plan
52 <li>plandata - additional plan data
53 <li>disabled - Disabled flag, empty or `Y'
54 <li>taxclass - Texas tax class flag, empty or "none", "access", or "hosting"
56 <li><a name="cust_bill_pkg" href="man/FS/cust_bill_pkg.html">cust_bill_pkg</a> - Invoice line items
58 <li>invnum - (multiple) key
59 <li>pkgnum - <a href="#cust_pkg">package</a> or 0 for the special virtual sales tax package
61 <li>recur - recurring fee
62 <li>sdate - starting date
63 <li>edate - ending date
64 <li>itemdesc - Line item description (currently used only when pkgnum is 0)
66 <li><a name="cust_bill_pkg_detail" href="man/FS/cust_bill_pkg_detail.html">cust_bill_pkg_detail</a> - Invoice line items detail
68 <li>detailnum - primary key
71 <li>detail - Detail description
73 <li><a name="cust_credit" href="man/FS/cust_credit.html">cust_credit</a> - Credits. The equivalent of a negative <a href="#cust_bill">cust_bill</a> record.
75 <li>crednum - primary key
76 <li>custnum - <a href="#cust_main">customer</a>
77 <li>amount - amount credited
79 <li>otaker - order taker
81 <li>closed - books closed flag, empty or `Y'
83 <li><a name="cust_credit_bill" href="man/FS/cust_credit_bill.html">cust_credit_bill</a> - Credit invoice application. Links a credit to an invoice.
85 <li>creditbillnum - primary key
86 <li>crednum - <a href="#cust_credit">credit</a> being applied
87 <li>invnum - <a href="#cust_bill">invoice</a> to which credit is applied
88 <li>amount - amount applied
91 <li><a name="cust_pay_refund" href="man/FS/cust_pay_refund.html">cust_credit_bill</a> - Refund payment application. Links a refund to a payment.
93 <li>payrefundnum - primary key
94 <li>paynum - <a href="#cust_pay">payment</a>
95 <li>refundnum - <a href="#cust_refund">refund</a>
96 <li>amount - amount applied
99 <li><a name="cust_main" href="man/FS/cust_main.html">cust_main</a> - Customers
101 <li>custnum - primary key
102 <li>agentnum - <a href="#agent">agent</a>
103 <li>refnum - <a href="#part_referral">referral</a>
106 <li>ss - social security number
118 <li><i>ship_first</i>
120 <li><i>ship_company</i>
121 <li><i>ship_address1</i>
122 <li><i>ship_address2</i>
124 <li><i>ship_county</i>
125 <li><i>ship_state</i>
127 <li><i>ship_country</i>
128 <li><i>ship_daytime</i>
129 <li><i>ship_night</i>
131 <li>payby - CARD, DCHK, CHEK, DCHK, LECB, BILL, or COMP
132 <li>payinfo - card number, P.O.#, or comp issuer
133 <li>paycvv - Card Verification Value, "CVV2" (also known as CVC2 or CID), the 3 or 4 digit number on the back (or front, for American Express) of the credit card
134 <li>paydate - expiration date
135 <li>payname - billing name (name on card)
136 <li>tax - tax exempt, Y or null
137 <li>otaker - order taker
140 <li>invoice_ship_address - Y or null, does ship address appear on invoice
142 (columns in <i>italics</i> are optional)
143 <li><a name="cust_main_invoice" href="man/FS/cust_main_invoice.html">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.
145 <li>destnum - primary key
146 <li>custnum - <a href="#cust_main">customer</a>
147 <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.
149 <li><a name="cust_main_county" href="man/FS/cust_main_county.html">cust_main_county</a> - Tax rates
151 <li>taxnum - primary key
158 <li>taxname - if defined, printed on invoices instead of "Tax"
159 <li>setuptax - if 'Y', this tax does not apply to setup fees
160 <li>recurtax - if 'Y', this tax does not apply to recurring fees
162 <li><a name="cust_tax_exempt" href="man/FS/cust_tax_exempt.html">cust_tax_exempt</a> - Tax exemption record
164 <li>exemptnum - primary key
165 <li>taxnum - <a href="#cust_main_county">tax rate</a>
170 <li><a name="cust_pay" href="man/FS/cust_pay.html">cust_pay</a> - Payments. Money being transferred from a customer.
172 <li>paynum - primary key
173 <li>custnum - <a href="#cust_main">customer</a>
176 <li>payby - CARD, CHEK, LECB, BILL, or COMP
177 <li>payinfo - card number, P.O.#, or comp issuer
178 <li>paybatch - text field for tracking card processor batches
179 <li>closed - books closed flag, empty or `Y'
181 <li><a name="cust_pay-void" href="man/FS/cust_pay_void.html">cust_pay_void</a> - Voided payments.
183 <li>paynum - primary key
184 <li>custnum - <a href="#cust_main">customer</a>
187 <li>payby - CARD, CHEK, LECB, BILL, or COMP
188 <li>payinfo - card number, P.O.#, or comp issuer
189 <li>paybatch - text field for tracking card processor batches
190 <li>closed - books closed flag, empty or `Y'
193 <li>otaker - order taker
195 <li><a name="cust_bill_pay" href="man/FS/cust_bill_pay.html">cust_bill_pay</a> - Applicaton of a payment to a specific invoice.
198 <li>invnum - <a href="#cust_bill">invoice</a>
199 <li>paynum - <a href="#cust_pay">payment</a>
203 <li><a name="pay_batch" href="man/FS/pay_batch.html">pay_batch</a> - Pending batch
210 <li><a name="cust_pay_batch" href="man/FS/cust_pay_batch.html">cust_pay_batch</a> - Pending batch members
214 <li>payby - CARD, CHEK, LECB, BILL, or COMP
215 <li>payinfo - account number
216 <li>exp - card expiration
218 <li>invnum - <a href="#cust_bill">invoice</a>
219 <li>custnum - <a href="#cust_main">customer</a>
220 <li>payname - name on card
231 <li><a name="cust_pkg" href="man/FS/cust_pkg.html">cust_pkg</a> - Customer billing items
233 <li>pkgnum - primary key
234 <li>custnum - <a href="#cust_main">customer</a>
235 <li>pkgpart - <a href="#part_pkg">Package definition</a>
237 <li>bill - next bill date
238 <li>last_bill - last bill date
239 <li>susp - (past) suspension date
240 <li>expire - (future) cancellation date
241 <li>cancel - (past) cancellation date
242 <li>otaker - order taker
243 <li>manual_flag - If this field is set to 1, disables the automatic unsuspensiond of this package when using the <a href="config.html#unsuspendauto">unsuspendauto</a> config file.
245 <li><a name="cust_refund" href="man/FS/cust_refund.html">cust_refund</a> - Refunds. The transfer of money to a customer; equivalent to a negative <a href="#cust_pay">cust_pay</a> record.
247 <li>refundnum - primary key
248 <li>custnum - <a href="#cust_main">customer</a>
251 <li>payby - CARD, CHEK, LECB, BILL or COMP
252 <li>payinfo - card number, P.O.#, or comp issuer
253 <li>otaker - order taker
254 <li>closed - books closed flag, empty or `Y'
256 <li><a name="cust_credit_refund" href="man/FS/cust_credit_refund.html">cust_credit_refund</a> - Applicaton of a refund to a specific credit.
258 <li>creditrefundnum - primary key
259 <li>crednum - <a href="#cust_credit">credit</a>
260 <li>refundnum - <a href="#cust_refund">refund</a>
264 <li><a name="cust_svc" href="man/FS/cust_svc.html">cust_svc</a> - Customer services
266 <li>svcnum - primary key
267 <li>pkgnum - <a href="#cust_pkg">package</a>
268 <li>svcpart - <a href="#part_svc">Service definition</a>
270 <li><a name="nas" href="man/FS/nas.html">nas</a> - Network Access Server (terminal server)
272 <li>nasnum - primary key
274 <li>nasip - NAS ip address
275 <li>nasfqdn - NAS fully-qualified domain name
276 <li>last - timestamp indicating the last instant the NAS was in a known state (used by the session monitoring).
278 <li><a name="part_pkg" href="man/FS/part_pkg.html">part_pkg</a> - Package definitions
280 <li>pkgpart - primary key
281 <li>pkg - package name
282 <li>comment - non-customer visable package comment
283 <li>promo_code - promotional code
284 <li><i>deprecated</i> setup - setup fee expression
285 <li>freq - recurring frequency (months)
286 <li><i>deprecated</i> recur - recurring fee expression
287 <li>setuptax - Setup fee tax exempt flag, empty or `Y'
288 <li>recurtax - Recurring fee tax exempt flag, empty or `Y'
289 <li>plan - price plan
290 <li><i>deprecated</i> plandata - additional price plan data
291 <li>disabled - Disabled flag, empty or `Y'
293 <li><a name="part_pkg_option" href="man/FS/part_pkg_option.html">part_pkg_option</a> - Package definition options
295 <li>optionnum - primary key
296 <li>pkgpart - <a href="#part_pkg">Package definition</a>
297 <li>optionname - option name
298 <li>optionvalue - option value
300 <li><a name="reg_code" href="man/FS/reg_code.html">reg_code</A> - One-time registration codes
302 <li>codenum - primary key
304 <li>agentnum - <a href="#agent">Agent</a>
306 <li><a name="reg_code_pkg" href="man/FS/reg_code_pkg.html">reg_code_pkg</A> - Registration code link to package definitions
308 <li>codepkgnum - primary key
309 <li>codenum - <a href="#reg_code">Registration code</a>
310 <li>pkgpart - <a href="#part_pkg">Package definition</a>
312 <li><a name="part_referral" href="man/FS/part_referral.html">part_referral</a> - Referral listing
314 <li>refnum - primary key
315 <li>referral - referral
317 <li><a name="part_svc" href="man/FS/part_svc.html">part_svc</a> - Service definitions
319 <li>svcpart - primary key
320 <li>svc - name of this service
321 <li>svcdb - table used for this service: svc_acct, svc_forward, svc_domain, svc_charge or svc_wo
322 <li>disabled - Disabled flag, empty or `Y'
323 <!-- <li><i>table</i>__<i>field</i> - Default or fixed value for <i>field</i> in <i>table</i>
324 <li><i>table</i>__<i>field</i>_flag - null, D or F
327 <li><a name="part_svc_column" href="man/FS/part_svc_column.html">part_svc_column</a>
329 <li>columnnum - primary key
330 <li>svcpart - <a href="#part_svc">Service definition</a>
331 <li>columnname - column name in part_svc.svcdb table
332 <li>columnvalue - default or fixed value for the column
333 <li>columnflag - null, D or F
335 <li><a name="pkg_svc" href="man/FS/pkg_svc.html">pkg_svc</a>
337 <li>pkgsvcnum - primary key
338 <li>pkgpart - <a href="#part_pkg">Package definition</a>
339 <li>svcpart - <a href="#part_svc">Service definition</a>
340 <li>quantity - quantity of this service that this package includes
341 <li>primary_svc - blank or Y: primary service
343 <li><a name="export_svc" href="man/FS/export_svc.html">export_svc</a>
345 <li>exportsvcnum - primary key
346 <li>svcpart - <a href="#part_svc">Service definition</a>
347 <li>exportnum - <a href="#exportnum">Export</a>
349 <li><a name="part_export" href="man/FS/part_export.html">part_export</a> - Export to external provisioning
351 <li>exportnum - primary key
352 <li>machine - Machine name
353 <li>exporttype - Export type
354 <li>nodomain - blank or Y: usernames are exported to this service with no domain
356 <li><a name="part_export_option" href="man/FS/part_export_option.html">part_export_option</a> - provisioning options
358 <li>optionnum - primary key
359 <li>exportnum - <a href="#part_export">Export</a>
360 <li>optionname - option name
361 <li>optionvalue - option value
363 <li><a name="port" href="man/FS/port.html">port</a> - individual port on a <a href="#nas">nas</a>
365 <li>portnum - primary key
366 <li>ip - IP address of this port
367 <li>nasport - port number on the NAS
368 <li>nasnum - <a href="#nas">NAS</a>
370 <li><a name="prepay_credit" href="man/FS/prepay_credit.html">prepay_credit</a> - prepaid cards
372 <li>prepaynum - primary key
373 <li>identifier - text or numeric string of prepaid card
374 <li>amount - amount of prepayment
375 <li>seconds - prepaid time instead of (or in addition to) monetary value
376 <li>agentnum - optional agent assignment for prepaid cards
378 <li><a name="session" href="man/FS/session.html">session</a>
380 <li>sessionnum - primary key
381 <li>portnum - <a href="#port">Port</a>
382 <li>svcnum - <a href="#svc_acct">Account</a>
383 <li>login - timestamp indicating the beginning of this user session.
384 <li>logout - timestamp indicating the end of this user session. May be null, which indicates a currently open session.
387 <li><a name="svc_acct" href="man/FS/svc_acct.html">svc_acct</a> - Accounts
389 <li>svcnum - <a href="#cust_svc">primary key</a>
392 <li>sec_phrase - security phrase
393 <li>popnum - <a href="#svc_acct_pop">Point of Presence</a>
399 <li>quota - (unimplementd)
400 <li>slipip - IP address
403 <li>radius_<i>Radius_Reply_Attribute</i> - Radius-Reply-Attribute
404 <li>rc_<i>Radius_Check_Attribute</i> - Radius-Check-Attribute
406 <li><a name="svc_acct_pop" href="man/FS/svc_acct_pop.html">svc_acct_pop</a> - Points of Presence
408 <li>popnum - primary key
413 <li>loc - rest of number
415 <li><a name="part_pop_local" href="man/FS/part_pop_local.html">part_pop_local</a> - Local calling areas
417 <li>localnum - primary key
418 <li>popnum - primary key
424 <li><a name="svc_domain" href="man/FS/svc_domain.html">svc_domain</a> - Domains
426 <li>svcnum - <a href="#cust_svc">primary key</a>
429 <li><a name="svc_forward" href="man/FS/svc_forward.html">svc_forward</a> - Mail forwarding aliases
431 <li>svcnum - <a href="#cust_svc">primary key</a>
432 <li>srcsvc - <a href="#svc_acct">svcnum of the source of this forward</a>
433 <li>src - literal source (username or full email address)
434 <li>dstsvc - <a href="#svc_acct">svcnum of the destination of this forward</a>
435 <li>dst - literal destination (username or full email address)
437 <li><a name="domain_record" href="man/FS/domain_record.html">domain_record</a> - Domain zone detail
439 <li>recnum - primary key
440 <li>svcnum - <a href="#svc_domain">Domain</a> (by svcnum)
441 <li>reczone - zone for this line
442 <li>recaf - address family, usually <b>IN</b>
443 <li>rectype - type for this record (<b>A</b>, <b>MX</b>, etc.)
444 <li>recdata - data for this record
446 <li><a name="svc_www" href="man/FS/svc_www.html">svc_www</a>
448 <li>svcnum - <a href="#cust-svc">primary key</a>
449 <li>recnum - <a href="#domain_record">host</a>
450 <li>usersvc - <a href="#svc_acct">account</a>
452 <li><a name="type_pkgs" href="man/FS/type_pkgs.html">type_pkgs</a>
454 <li>typepkgnum - primary key
455 <li>typenum - <a href="#agent_type">agent type</a>
456 <li>pkgpart - <a href="#part_pkg">Package definition</a>
458 <li><a name="queue" href="man/FS/queue.html">queue</a> - job queue
460 <li>jobnum - primary key
467 <li><a name="queue_arg" href="man/FS/queue_arg.html">queue_arg</a> - job arguments
469 <li>argnum - primary key
470 <li>jobnum - <a href="#queue">job</a>
473 <li><a name="queue_depend" href="man/FS/queue_depend.html">queue_depend</a> - job dependancies
475 <li>dependnum - primary key
476 <li>jobnum - source jobnum
477 <li>depend_jobnum - dependancy jobnum
479 <li><a name="radius_usergroup" href="man/FS/radius_usergroup.html">radius_usergroup</a> - Link users to RADIUS groups.
481 <li>usergroupnum - primary key
482 <li>svcnum - <a href="#svc_acct">account</a>
485 <li><a name="rate" href="man/FS/rate.html">rate</a> - Call rate plans
487 <li>ratenum - primary key
490 <li><a name="rate_detail" href="man/FS/rate_detail.html">rate_detail</a> - Call rate detail
492 <li>ratedetailnum - primary key
493 <li>ratenum - <a href="#rate">rate plan</a>
494 <li>orig_regionnum - call origination <a href="#rate_region">region</a>
495 <li>dest_regionnum - call destination <a href="#rate_region">region</a>
496 <li>min_included - included minutes
497 <li>min_charge - charge per minute
498 <li>sec_granularity - granularity in seconds, i.e. 6 or 60
500 <li><a name="rate_region" href="man/FS/rate_region.html">rate_region</a> - Call rate region
502 <li>regionnum - primary key
505 <li><a name="rate_prefix" href="man/FS/rate_prefix.html">rate_prefix</a> - Call rate prefix
507 <li>prefixnum - primary key
508 <li>regionnum - <a href="#rate_region">rate region</a>
513 <li><a name="msgcat" href="man/FS/msgcat.html">msgcat</a> - i18n message catalog
515 <li>msgnum - primary key
516 <li>msgcode - message code
518 <li>msg - Message text
520 <li><a name="clientapi_session" href="man/FS/clientapi_session.html">clientapi_session</a> - ClientAPI session store
522 <li>sessionnum - primary key
523 <li>sessionid - session ID
524 <li>namespace - session namespace
526 <li><a name="clientapi_session_field" href="man/FS/clientapi_session_field.html">clientapi_session_field</a> - Client API session store data
528 <li>fieldnum - primary key
529 <li>sessionnum - <a href="#session">session</a>