FS::Record::qsearch - more portable, doesn't depend on $sth->execute returning
[freeside.git] / FS / FS / cust_main_county.pm
1 package FS::cust_main_county;
2
3 use strict;
4 use vars qw( @ISA );
5 use FS::Record;
6
7 @ISA = qw( FS::Record );
8
9 =head1 NAME
10
11 FS::cust_main_county - Object methods for cust_main_county objects
12
13 =head1 SYNOPSIS
14
15   use FS::cust_main_county;
16
17   $record = new FS::cust_main_county \%hash;
18   $record = new FS::cust_main_county { 'column' => 'value' };
19
20   $error = $record->insert;
21
22   $error = $new_record->replace($old_record);
23
24   $error = $record->delete;
25
26   $error = $record->check;
27
28 =head1 DESCRIPTION
29
30 An FS::cust_main_county object represents a tax rate, defined by locale.
31 FS::cust_main_county inherits from FS::Record.  The following fields are
32 currently supported:
33
34 =over 4
35
36 =item taxnum - primary key (assigned automatically for new tax rates)
37
38 =item state
39
40 =item county
41
42 =item country
43
44 =item tax - percentage
45
46 =back
47
48 =head1 METHODS
49
50 =over 4
51
52 =item new HASHREF
53
54 Creates a new tax rate.  To add the tax rate to the database, see L<"insert">.
55
56 =cut
57
58 sub table { 'cust_main_county'; }
59
60 =item insert
61
62 Adds this tax rate to the database.  If there is an error, returns the error,
63 otherwise returns false.
64
65 =item delete
66
67 Deletes this tax rate from the database.  If there is an error, returns the
68 error, otherwise returns false.
69
70 =item replace OLD_RECORD
71
72 Replaces the OLD_RECORD with this one in the database.  If there is an error,
73 returns the error, otherwise returns false.
74
75 =item check
76
77 Checks all fields to make sure this is a valid tax rate.  If there is an error,
78 returns the error, otherwise returns false.  Called by the insert and replace
79 methods.
80
81 =cut
82
83 sub check {
84   my $self = shift;
85
86   $self->ut_numbern('taxnum')
87     || $self->ut_textn('state')
88     || $self->ut_textn('county')
89     || $self->ut_text('country')
90     || $self->ut_float('tax')
91   ;
92
93 }
94
95 =back
96
97 =head1 VERSION
98
99 $Id: cust_main_county.pm,v 1.1 1999-08-04 09:03:53 ivan Exp $
100
101 =head1 BUGS
102
103 =head1 SEE ALSO
104
105 L<FS::Record>, L<FS::cust_main>, L<FS::cust_bill>, schema.html from the base
106 documentation.
107
108 =cut
109
110 1;
111