stray closing /TABLE in the no-ticket case
[freeside.git] / FS / FS / cust_bill_pay_batch.pm
1 package FS::cust_bill_pay_batch;
2 use base qw( FS::Record );
3
4 use strict;
5
6 =head1 NAME
7
8 FS::cust_bill_pay_batch - Object methods for cust_bill_pay_batch records
9
10 =head1 SYNOPSIS
11
12   use FS::cust_bill_pay_batch;
13
14   $record = new FS::cust_bill_pay_batch \%hash;
15   $record = new FS::cust_bill_pay_batch { '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::cust_bill_pay_batch object represents a relationship between a
28 customer's bill and a batch.  FS::cust_bill_pay_batch inherits from
29 FS::Record.  The following fields are currently supported:
30
31 =over 4
32
33 =item billpaynum - primary key
34
35 =item invnum - customer's bill (invoice)
36
37 =item paybatchnum - entry in cust_pay_batch table
38
39 =item amount - 
40
41 =item _date - 
42
43
44 =back
45
46 =head1 METHODS
47
48 =over 4
49
50 =item new HASHREF
51
52 Creates a new record.  To add the record to the database, see L<"insert">.
53
54 Note that this stores the hash reference, not a distinct copy of the hash it
55 points to.  You can ask the object for a copy with the I<hash> method.
56
57 =cut
58
59 sub table { 'cust_bill_pay_batch'; }
60
61 =item insert
62
63 Adds this record to the database.  If there is an error, returns the error,
64 otherwise returns false.
65
66 =cut
67
68 =item delete
69
70 Delete this record from the database.
71
72 =cut
73
74 =item replace OLD_RECORD
75
76 Replaces the OLD_RECORD with this one in the database.  If there is an error,
77 returns the error, otherwise returns false.
78
79 =cut
80
81 =item check
82
83 Checks all fields to make sure this is a valid example.  If there is
84 an error, returns the error, otherwise returns false.  Called by the insert
85 and replace methods.
86
87 =cut
88
89 sub check {
90   my $self = shift;
91
92   my $error = 
93     $self->ut_numbern('billpaynum')
94     || $self->ut_number('invnum')
95     || $self->ut_number('paybatchnum')
96     || $self->ut_money('amount')
97     || $self->ut_numbern('_date')
98   ;
99   return $error if $error;
100
101   $self->SUPER::check;
102 }
103
104 =back
105
106 =head1 BUGS
107
108 Just hangs there.
109
110 =head1 SEE ALSO
111
112 L<FS::Record>, schema.html from the base documentation.
113
114 =cut
115
116 1;
117