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
141 (columns in <i>italics</i> are optional)
142 <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.
144 <li>destnum - primary key
145 <li>custnum - <a href="#cust_main">customer</a>
146 <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.
148 <li><a name="cust_main_county" href="man/FS/cust_main_county.html">cust_main_county</a> - Tax rates
150 <li>taxnum - primary key
157 <li>taxname - if defined, printed on invoices instead of "Tax"
158 <li>setuptax - if 'Y', this tax does not apply to setup fees
159 <li>recurtax - if 'Y', this tax does not apply to recurring fees
161 <li><a name="cust_tax_exempt" href="man/FS/cust_tax_exempt.html">cust_tax_exempt</a> - Tax exemption record
163 <li>exemptnum - primary key
164 <li>taxnum - <a href="#cust_main_county">tax rate</a>
169 <li><a name="cust_pay" href="man/FS/cust_pay.html">cust_pay</a> - Payments. Money being transferred from a customer.
171 <li>paynum - primary key
172 <li>custnum - <a href="#cust_main">customer</a>
175 <li>payby - CARD, CHEK, LECB, BILL, or COMP
176 <li>payinfo - card number, P.O.#, or comp issuer
177 <li>paybatch - text field for tracking card processor batches
178 <li>closed - books closed flag, empty or `Y'
180 <li><a name="cust_pay-void" href="man/FS/cust_pay_void.html">cust_pay_void</a> - Voided payments.
182 <li>paynum - primary key
183 <li>custnum - <a href="#cust_main">customer</a>
186 <li>payby - CARD, CHEK, LECB, BILL, or COMP
187 <li>payinfo - card number, P.O.#, or comp issuer
188 <li>paybatch - text field for tracking card processor batches
189 <li>closed - books closed flag, empty or `Y'
192 <li>otaker - order taker
194 <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.
197 <li>invnum - <a href="#cust_bill">invoice</a>
198 <li>paynum - <a href="#cust_pay">payment</a>
202 <li><a name="pay_batch" href="man/FS/pay_batch.html">pay_batch</a> - Pending batch
209 <li><a name="cust_pay_batch" href="man/FS/cust_pay_batch.html">cust_pay_batch</a> - Pending batch members
213 <li>payby - CARD, CHEK, LECB, BILL, or COMP
214 <li>payinfo - account number
215 <li>exp - card expiration
217 <li>invnum - <a href="#cust_bill">invoice</a>
218 <li>custnum - <a href="#cust_main">customer</a>
219 <li>payname - name on card
230 <li><a name="cust_pkg" href="man/FS/cust_pkg.html">cust_pkg</a> - Customer billing items
232 <li>pkgnum - primary key
233 <li>custnum - <a href="#cust_main">customer</a>
234 <li>pkgpart - <a href="#part_pkg">Package definition</a>
236 <li>bill - next bill date
237 <li>last_bill - last bill date
238 <li>susp - (past) suspension date
239 <li>expire - (future) cancellation date
240 <li>cancel - (past) cancellation date
241 <li>otaker - order taker
242 <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.
244 <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.
246 <li>refundnum - primary key
247 <li>custnum - <a href="#cust_main">customer</a>
250 <li>payby - CARD, CHEK, LECB, BILL or COMP
251 <li>payinfo - card number, P.O.#, or comp issuer
252 <li>otaker - order taker
253 <li>closed - books closed flag, empty or `Y'
255 <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.
257 <li>creditrefundnum - primary key
258 <li>crednum - <a href="#cust_credit">credit</a>
259 <li>refundnum - <a href="#cust_refund">refund</a>
263 <li><a name="cust_svc" href="man/FS/cust_svc.html">cust_svc</a> - Customer services
265 <li>svcnum - primary key
266 <li>pkgnum - <a href="#cust_pkg">package</a>
267 <li>svcpart - <a href="#part_svc">Service definition</a>
269 <li><a name="nas" href="man/FS/nas.html">nas</a> - Network Access Server (terminal server)
271 <li>nasnum - primary key
273 <li>nasip - NAS ip address
274 <li>nasfqdn - NAS fully-qualified domain name
275 <li>last - timestamp indicating the last instant the NAS was in a known state (used by the session monitoring).
277 <li><a name="part_pkg" href="man/FS/part_pkg.html">part_pkg</a> - Package definitions
279 <li>pkgpart - primary key
280 <li>pkg - package name
281 <li>comment - non-customer visable package comment
282 <li>promo_code - promotional code
283 <li><i>deprecated</i> setup - setup fee expression
284 <li>freq - recurring frequency (months)
285 <li><i>deprecated</i> recur - recurring fee expression
286 <li>setuptax - Setup fee tax exempt flag, empty or `Y'
287 <li>recurtax - Recurring fee tax exempt flag, empty or `Y'
288 <li>plan - price plan
289 <li><i>deprecated</i> plandata - additional price plan data
290 <li>disabled - Disabled flag, empty or `Y'
292 <li><a name="part_pkg_option" href="man/FS/part_pkg_option.html">part_pkg_option</a> - Package definition options
294 <li>optionnum - primary key
295 <li>pkgpart - <a href="#part_pkg">Package definition</a>
296 <li>optionname - option name
297 <li>optionvalue - option value
299 <li><a name="reg_code" href="man/FS/reg_code.html">reg_code</A> - One-time registration codes
301 <li>codenum - primary key
303 <li>agentnum - <a href="#agent">Agent</a>
305 <li><a name="reg_code_pkg" href="man/FS/reg_code_pkg.html">reg_code_pkg</A> - Registration code link to package definitions
307 <li>codepkgnum - primary key
308 <li>codenum - <a href="#reg_code">Registration code</a>
309 <li>pkgpart - <a href="#part_pkg">Package definition</a>
311 <li><a name="part_referral" href="man/FS/part_referral.html">part_referral</a> - Referral listing
313 <li>refnum - primary key
314 <li>referral - referral
316 <li><a name="part_svc" href="man/FS/part_svc.html">part_svc</a> - Service definitions
318 <li>svcpart - primary key
319 <li>svc - name of this service
320 <li>svcdb - table used for this service: svc_acct, svc_forward, svc_domain, svc_charge or svc_wo
321 <li>disabled - Disabled flag, empty or `Y'
322 <!-- <li><i>table</i>__<i>field</i> - Default or fixed value for <i>field</i> in <i>table</i>
323 <li><i>table</i>__<i>field</i>_flag - null, D or F
326 <li><a name="part_svc_column" href="man/FS/part_svc_column.html">part_svc_column</a>
328 <li>columnnum - primary key
329 <li>svcpart - <a href="#part_svc">Service definition</a>
330 <li>columnname - column name in part_svc.svcdb table
331 <li>columnvalue - default or fixed value for the column
332 <li>columnflag - null, D or F
334 <li><a name="pkg_svc" href="man/FS/pkg_svc.html">pkg_svc</a>
336 <li>pkgsvcnum - primary key
337 <li>pkgpart - <a href="#part_pkg">Package definition</a>
338 <li>svcpart - <a href="#part_svc">Service definition</a>
339 <li>quantity - quantity of this service that this package includes
340 <li>primary_svc - blank or Y: primary service
342 <li><a name="export_svc" href="man/FS/export_svc.html">export_svc</a>
344 <li>exportsvcnum - primary key
345 <li>svcpart - <a href="#part_svc">Service definition</a>
346 <li>exportnum - <a href="#exportnum">Export</a>
348 <li><a name="part_export" href="man/FS/part_export.html">part_export</a> - Export to external provisioning
350 <li>exportnum - primary key
351 <li>machine - Machine name
352 <li>exporttype - Export type
353 <li>nodomain - blank or Y: usernames are exported to this service with no domain
355 <li><a name="part_export_option" href="man/FS/part_export_option.html">part_export_option</a> - provisioning options
357 <li>optionnum - primary key
358 <li>exportnum - <a href="#part_export">Export</a>
359 <li>optionname - option name
360 <li>optionvalue - option value
362 <li><a name="port" href="man/FS/port.html">port</a> - individual port on a <a href="#nas">nas</a>
364 <li>portnum - primary key
365 <li>ip - IP address of this port
366 <li>nasport - port number on the NAS
367 <li>nasnum - <a href="#nas">NAS</a>
369 <li><a name="prepay_credit" href="man/FS/prepay_credit.html">prepay_credit</a> - prepaid cards
371 <li>prepaynum - primary key
372 <li>identifier - text or numeric string of prepaid card
373 <li>amount - amount of prepayment
374 <li>seconds - prepaid time instead of (or in addition to) monetary value
375 <li>agentnum - optional agent assignment for prepaid cards
377 <li><a name="session" href="man/FS/session.html">session</a>
379 <li>sessionnum - primary key
380 <li>portnum - <a href="#port">Port</a>
381 <li>svcnum - <a href="#svc_acct">Account</a>
382 <li>login - timestamp indicating the beginning of this user session.
383 <li>logout - timestamp indicating the end of this user session. May be null, which indicates a currently open session.
386 <li><a name="svc_acct" href="man/FS/svc_acct.html">svc_acct</a> - Accounts
388 <li>svcnum - <a href="#cust_svc">primary key</a>
391 <li>sec_phrase - security phrase
392 <li>popnum - <a href="#svc_acct_pop">Point of Presence</a>
398 <li>quota - (unimplementd)
399 <li>slipip - IP address
402 <li>radius_<i>Radius_Reply_Attribute</i> - Radius-Reply-Attribute
403 <li>rc_<i>Radius_Check_Attribute</i> - Radius-Check-Attribute
405 <li><a name="svc_acct_pop" href="man/FS/svc_acct_pop.html">svc_acct_pop</a> - Points of Presence
407 <li>popnum - primary key
412 <li>loc - rest of number
414 <li><a name="part_pop_local" href="man/FS/part_pop_local.html">part_pop_local</a> - Local calling areas
416 <li>localnum - primary key
417 <li>popnum - primary key
423 <li><a name="svc_domain" href="man/FS/svc_domain.html">svc_domain</a> - Domains
425 <li>svcnum - <a href="#cust_svc">primary key</a>
428 <li><a name="svc_forward" href="man/FS/svc_forward.html">svc_forward</a> - Mail forwarding aliases
430 <li>svcnum - <a href="#cust_svc">primary key</a>
431 <li>srcsvc - <a href="#svc_acct">svcnum of the source of this forward</a>
432 <li>src - literal source (username or full email address)
433 <li>dstsvc - <a href="#svc_acct">svcnum of the destination of this forward</a>
434 <li>dst - literal destination (username or full email address)
436 <li><a name="domain_record" href="man/FS/domain_record.html">domain_record</a> - Domain zone detail
438 <li>recnum - primary key
439 <li>svcnum - <a href="#svc_domain">Domain</a> (by svcnum)
440 <li>reczone - zone for this line
441 <li>recaf - address family, usually <b>IN</b>
442 <li>rectype - type for this record (<b>A</b>, <b>MX</b>, etc.)
443 <li>recdata - data for this record
445 <li><a name="svc_www" href="man/FS/svc_www.html">svc_www</a>
447 <li>svcnum - <a href="#cust-svc">primary key</a>
448 <li>recnum - <a href="#domain_record">host</a>
449 <li>usersvc - <a href="#svc_acct">account</a>
451 <li><a name="type_pkgs" href="man/FS/type_pkgs.html">type_pkgs</a>
453 <li>typepkgnum - primary key
454 <li>typenum - <a href="#agent_type">agent type</a>
455 <li>pkgpart - <a href="#part_pkg">Package definition</a>
457 <li><a name="queue" href="man/FS/queue.html">queue</a> - job queue
459 <li>jobnum - primary key
466 <li><a name="queue_arg" href="man/FS/queue_arg.html">queue_arg</a> - job arguments
468 <li>argnum - primary key
469 <li>jobnum - <a href="#queue">job</a>
472 <li><a name="queue_depend" href="man/FS/queue_depend.html">queue_depend</a> - job dependancies
474 <li>dependnum - primary key
475 <li>jobnum - source jobnum
476 <li>depend_jobnum - dependancy jobnum
478 <li><a name="radius_usergroup" href="man/FS/radius_usergroup.html">radius_usergroup</a> - Link users to RADIUS groups.
480 <li>usergroupnum - primary key
481 <li>svcnum - <a href="#svc_acct">account</a>
484 <li><a name="rate" href="man/FS/rate.html">rate</a> - Call rate plans
486 <li>ratenum - primary key
489 <li><a name="rate_detail" href="man/FS/rate_detail.html">rate_detail</a> - Call rate detail
491 <li>ratedetailnum - primary key
492 <li>ratenum - <a href="#rate">rate plan</a>
493 <li>orig_regionnum - call origination <a href="#rate_region">region</a>
494 <li>dest_regionnum - call destination <a href="#rate_region">region</a>
495 <li>min_included - included minutes
496 <li>min_charge - charge per minute
497 <li>sec_granularity - granularity in seconds, i.e. 6 or 60
499 <li><a name="rate_region" href="man/FS/rate_region.html">rate_region</a> - Call rate region
501 <li>regionnum - primary key
504 <li><a name="rate_prefix" href="man/FS/rate_prefix.html">rate_prefix</a> - Call rate prefix
506 <li>prefixnum - primary key
507 <li>regionnum - <a href="#rate_region">rate region</a>
512 <li><a name="msgcat" href="man/FS/msgcat.html">msgcat</a> - i18n message catalog
514 <li>msgnum - primary key
515 <li>msgcode - message code
517 <li>msg - Message text
519 <li><a name="clientapi_session" href="man/FS/clientapi_session.html">clientapi_session</a> - ClientAPI session store
521 <li>sessionnum - primary key
522 <li>sessionid - session ID
523 <li>namespace - session namespace
525 <li><a name="clientapi_session_field" href="man/FS/clientapi_session_field.html">clientapi_session_field</a> - Client API session store data
527 <li>fieldnum - primary key
528 <li>sessionnum - <a href="#session">session</a>