d863ea8524ca80ea757391a00fec0a46cd7ae9fe
[freeside.git] / htdocs / docs / man / cust_svc.txt
1 NAME
2     FS::cust_svc - Object method for cust_svc objects
3
4 SYNOPSIS
5       use FS::cust_svc;
6
7       $record = create FS::cust_svc \%hash
8       $record = create FS::cust_svc { 'column' => 'value' };
9
10       $error = $record->insert;
11
12       $error = $new_record->replace($old_record);
13
14       $error = $record->delete;
15
16       $error = $record->check;
17
18 DESCRIPTION
19     An FS::cust_svc represents a service. FS::cust_svc inherits from
20     FS::Record. The following fields are currently supported:
21
22     svcnum - primary key (assigned automatically for new services)
23     pkgnum - Package (see the FS::cust_pkg manpage)
24     svcpart - Service definition (see the FS::part_svc manpage)
25 METHODS
26     create HASHREF
27         Creates a new service. To add the refund to the database,
28         see the section on "insert". Services are normally created
29         by creating FS::svc_ objects (see the FS::svc_acct manpage,
30         the FS::svc_domain manpage, and the FS::svc_acct_sm manpage,
31         among others).
32
33     insert
34         Adds this service to the database. If there is an error,
35         returns the error, otherwise returns false.
36
37     delete
38         Deletes this service from the database. If there is an
39         error, returns the error, otherwise returns false.
40
41         Called by the cancel method of the package (see the
42         FS::cust_pkg manpage).
43
44     replace OLD_RECORD
45         Replaces the OLD_RECORD with this one in the database. If
46         there is an error, returns the error, otherwise returns
47         false.
48
49     check
50         Checks all fields to make sure this is a valid service. If
51         there is an error, returns the error, otehrwise returns
52         false. Called by the insert and replace methods.
53
54 BUGS
55     Behaviour of changing the svcpart of cust_svc records is
56     undefined and should possibly be prohibited, and pkg_svc records
57     are not checked.
58
59     pkg_svc records are not checket in general (here).
60
61 SEE ALSO
62     the FS::Record manpage, the FS::cust_pkg manpage, the
63     FS::part_svc manpage, the FS::pkg_svc manpage, schema.html from
64     the base documentation
65
66 HISTORY
67     ivan@voicenet.com 97-jul-10,14
68
69     no TableUtil, no FS::Lock ivan@sisd.com 98-mar-7
70
71     pod ivan@sisd.com 98-sep-21
72