stray closing /TABLE in the no-ticket case
[freeside.git] / FS / FS / cust_bill_pkg_display_void.pm
1 package FS::cust_bill_pkg_display_void;
2
3 use strict;
4 use base qw( FS::Record );
5 use FS::Record; # qw( qsearch qsearchs );
6 use FS::cust_bill_pkg_void;
7
8 =head1 NAME
9
10 FS::cust_bill_pkg_display_void - Object methods for cust_bill_pkg_display_void records
11
12 =head1 SYNOPSIS
13
14   use FS::cust_bill_pkg_display_void;
15
16   $record = new FS::cust_bill_pkg_display_void \%hash;
17   $record = new FS::cust_bill_pkg_display_void { 'column' => 'value' };
18
19   $error = $record->insert;
20
21   $error = $new_record->replace($old_record);
22
23   $error = $record->delete;
24
25   $error = $record->check;
26
27 =head1 DESCRIPTION
28
29 An FS::cust_bill_pkg_display_void object represents voided line item display
30 information.  FS::cust_bill_pkg_display_void inherits from FS::Record.  The
31 following fields are currently supported:
32
33 =over 4
34
35 =item billpkgdisplaynum
36
37 primary key
38
39 =item billpkgnum
40
41 billpkgnum
42
43 =item section
44
45 section
46
47 =item post_total
48
49 post_total
50
51 =item type
52
53 type
54
55 =item summary
56
57 summary
58
59
60 =back
61
62 =head1 METHODS
63
64 =over 4
65
66 =item new HASHREF
67
68 Creates a new record.  To add the record to the database, see L<"insert">.
69
70 Note that this stores the hash reference, not a distinct copy of the hash it
71 points to.  You can ask the object for a copy with the I<hash> method.
72
73 =cut
74
75 sub table { 'cust_bill_pkg_display_void'; }
76
77 =item insert
78
79 Adds this record to the database.  If there is an error, returns the error,
80 otherwise returns false.
81
82 =cut
83
84 =item delete
85
86 Delete this record from the database.
87
88 =cut
89
90 =item replace OLD_RECORD
91
92 Replaces the OLD_RECORD with this one in the database.  If there is an error,
93 returns the error, otherwise returns false.
94
95 =cut
96
97 =item check
98
99 Checks all fields to make sure this is a valid record.  If there is
100 an error, returns the error, otherwise returns false.  Called by the insert
101 and replace methods.
102
103 =cut
104
105 sub check {
106   my $self = shift;
107
108   my $error = 
109     $self->ut_number('billpkgdisplaynum')
110     || $self->ut_foreign_key('billpkgnum', 'cust_bill_pkg_void', 'billpkgnum')
111     || $self->ut_textn('section')
112     || $self->ut_enum('post_total', [ '', 'Y' ])
113     || $self->ut_enum('type', [ '', 'S', 'R', 'U' ])
114     || $self->ut_enum('summary', [ '', 'Y' ])
115   ;
116   return $error if $error;
117
118   $self->SUPER::check;
119 }
120
121 =back
122
123 =head1 BUGS
124
125 =head1 SEE ALSO
126
127 L<FS::Record>, schema.html from the base documentation.
128
129 =cut
130
131 1;
132