#
# Pbx Accounting / Billing
# Copyright 2000-2002 (c) Calin Damian
# http://pbx.sourceforge.net
#
# $Id: cost-HOWTO.txt,v 1.3 2002/02/28 06:59:16 calinovich Exp $
#


    This document is intended to help you understand the cost calculation
mechanism used by reporting scripts.

    I will give a breef description of each table purpose and some other
helpful hints.


Database structure:
=-=-=-=-=-=-=-=-=-

+----------------+
| Tables_in_pbx  |
+----------------+
| cos            |
| currencies     |
| e_patterns     |
| exts           |
| logging        |
| networks       |
| tariffs        |
| te_dates       |
| te_days        |
| valabilities   |
| zones          |
+----------------+


valabilities -> this table holds data about the calendaristic valabilities
                for cos, exts, currencies, tariffs, te_days, te_dates,
                zones, e_patterns.
cos        -> external phone lines conected to your central
exts       -> extensions (internal phone lines conected to your central)
currencies -> stores parities between different currency at differnet moment
              of time
tariffs    -> main tariff rules table
te_days    -> table with tariff rulling exceptions (days -> let's say sunday
              you have a preferential tarif ->> 80% fewer :))
te_dates   -> table with tariff rulling exceptions (days -> 25 Dec for instance)
zones      -> this table describes tariff zones
e_patterns -> extended patterns for zone definitions


