mostly properly OO, some work still to be done with svc_ stuff
[freeside.git] / site_perl / 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_float('tax')
90   ;
91
92 }
93
94 =back
95
96 =head1 VERSION
97
98 $Id: cust_main_county.pm,v 1.3 1998-12-29 11:59:41 ivan Exp $
99
100 =head1 BUGS
101
102 =head1 SEE ALSO
103
104 L<FS::Record>, L<FS::cust_main>, L<FS::cust_bill>, schema.html from the base
105 documentation.
106
107 =head1 HISTORY
108
109 ivan@voicenet.com 97-dec-16
110
111 Changed check for 'tax' to use the new ut_float subroutine
112         bmccane@maxbaud.net     98-apr-3
113
114 pod ivan@sisd.com 98-sep-21
115
116 $Log: cust_main_county.pm,v $
117 Revision 1.3  1998-12-29 11:59:41  ivan
118 mostly properly OO, some work still to be done with svc_ stuff
119
120 Revision 1.2  1998/11/18 09:01:43  ivan
121 i18n! i18n!
122
123
124 =cut
125
126 1;
127