enable CardFortress in test database, #71513
[freeside.git] / FS / FS / cust_bill_pkg_fee_void.pm
1 package FS::cust_bill_pkg_fee_void;
2
3 use strict;
4 use base qw( FS::Record );
5 use FS::Record qw( qsearch qsearchs );
6
7 =head1 NAME
8
9 FS::cust_bill_pkg_fee - Object methods for cust_bill_pkg_fee_void records
10
11 =head1 SYNOPSIS
12
13   use FS::cust_bill_pkg_fee;
14
15   $record = new FS::cust_bill_pkg_fee \%hash;
16   $record = new FS::cust_bill_pkg_fee { 'column' => 'value' };
17
18   $error = $record->insert;
19
20   $error = $new_record->replace($old_record);
21
22   $error = $record->delete;
23
24   $error = $record->check;
25
26 =head1 DESCRIPTION
27
28 An FS::cust_bill_pkg_fee_void object records the origin of a fee that 
29 appears on a voided invoice.  FS::cust_bill_pkg_fee_void inherits from
30 FS::Record.  The following fields are currently supported:
31
32 =over 4
33
34 =item billpkgfeenum - primary key
35
36 =item billpkgnum - the billpkgnum of the fee line item
37
38 =item base_invnum - the invoice number (L<FS::cust_bill>) that caused (this
39 portion of) the fee to be charged.
40
41 =item base_billpkgnum - the invoice line item (L<FS::cust_bill_pkg>) that
42 caused (this portion of) the fee to be charged.  May be null.
43
44 =item amount - the fee amount
45
46 =back
47
48 =head1 METHODS
49
50 =over 4
51
52 =cut
53
54 sub table { 'cust_bill_pkg_fee_void'; }
55
56 =item check
57
58 Checks all fields to make sure this is a valid record.  If there is an error,
59 returns the error, otherwise returns false.  Called by the insert and replace
60 methods.
61
62 =cut
63
64 sub check { my $self = shift;
65
66   my $error = $self->ut_numbern('billpkgfeenum')
67            || $self->ut_number('billpkgnum')
68            || $self->ut_foreign_key('base_invnum', 'cust_bill', 'invnum')
69            || $self->ut_foreign_keyn('base_billpkgnum', 'cust_bill_pkg', 'billpkgnum')
70            || $self->ut_money('amount')
71   ;
72   return $error if $error;
73
74   $self->SUPER::check; }
75
76 =back
77
78 =head1 SEE ALSO
79
80 L<FS::Record>
81
82 =cut
83
84 1;
85