default to a session cookie instead of setting an explicit timeout, weird timezone...
[freeside.git] / FS / FS / quotation_pkg_detail.pm
1 package FS::quotation_pkg_detail;
2 use base qw(FS::Record);
3
4 use strict;
5
6 =head1 NAME
7
8 FS::quotation_pkg_detail - Object methods for quotation_pkg_detail records
9
10 =head1 SYNOPSIS
11
12   use FS::quotation_pkg_detail;
13
14   $record = new FS::quotation_pkg_detail \%hash;
15   $record = new FS::quotation_pkg_detail { 'column' => 'value' };
16
17   $error = $record->insert;
18
19   $error = $new_record->replace($old_record);
20
21   $error = $record->delete;
22
23   $error = $record->check;
24
25 =head1 DESCRIPTION
26
27 An FS::quotation_pkg_detail object represents additional customer package details
28 for a quotation.  FS::quotation_pkg_detail inherits from FS::Record.  The following fields are
29 currently supported:
30
31 =over 4
32
33 =item detailnum
34
35 primary key
36
37 =item quotationpkgnum
38
39 for the relevant L<FS::quotation_pkg>
40
41 =item detail
42
43 detail text
44
45 =item copy_on_order
46
47 flag, indicates detail should be copied over when ordering
48
49 =cut
50
51 # 'format' field isn't used, there for TemplateItem_Mixin
52
53 =back
54
55 =head1 METHODS
56
57 =over 4
58
59 =item new HASHREF
60
61 Creates a new record.  To add the record to the database, see L<"insert">.
62
63 Note that this stores the hash reference, not a distinct copy of the hash it
64 points to.  You can ask the object for a copy with the I<hash> method.
65
66 =cut
67
68 # the new method can be inherited from FS::Record, if a table method is defined
69
70 sub table { 'quotation_pkg_detail'; }
71
72 =item insert
73
74 Adds this record to the database.  If there is an error, returns the error,
75 otherwise returns false.
76
77 =cut
78
79 # the insert method can be inherited from FS::Record
80
81 =item delete
82
83 Delete this record from the database.
84
85 =cut
86
87 # the delete method can be inherited from FS::Record
88
89 =item replace OLD_RECORD
90
91 Replaces the OLD_RECORD with this one in the database.  If there is an error,
92 returns the error, otherwise returns false.
93
94 =cut
95
96 # the replace method can be inherited from FS::Record
97
98 =item check
99
100 Checks all fields to make sure this is a valid record.  If there is
101 an error, returns the error, otherwise returns false.  Called by the insert
102 and replace methods.
103
104 =cut
105
106 # the check method should currently be supplied - FS::Record contains some
107 # data checking routines
108
109 sub check {
110   my $self = shift;
111
112   my $error = 
113     $self->ut_numbern('detailnum')
114     || $self->ut_foreign_key('quotationpkgnum', 'quotation_pkg', 'quotationpkgnum')
115     || $self->ut_text('detail')
116     || $self->ut_flag('copy_on_order')
117   ;
118   return $error if $error;
119
120   $self->SUPER::check;
121 }
122
123 =back
124
125 =head1 BUGS
126
127 =head1 SEE ALSO
128
129 L<FS::quotation_pkg>, L<FS::Record>
130
131 =cut
132
133 1;
134