1 package FS::cust_main_county;
4 use vars qw(@ISA @EXPORT_OK);
6 use FS::Record qw(fields hfields qsearch qsearchs);
8 @ISA = qw(FS::Record Exporter);
9 @EXPORT_OK = qw(hfields);
13 FS::cust_main_county - Object methods for cust_main_county objects
17 use FS::cust_main_county;
19 $record = create FS::cust_main_county \%hash;
20 $record = create FS::cust_main_county { 'column' => 'value' };
22 $error = $record->insert;
24 $error = $new_record->replace($old_record);
26 $error = $record->delete;
28 $error = $record->check;
32 An FS::cust_main_county object represents a tax rate, defined by locale.
33 FS::cust_main_county inherits from FS::Record. The following fields are
38 =item taxnum - primary key (assigned automatically for new tax rates)
46 =item tax - percentage
56 Creates a new tax rate. To add the tax rate to the database, see L<"insert">.
61 my($proto,$hashref)=@_;
63 #now in FS::Record::new
65 #foreach $field (fields('cust_main_county')) {
66 # $hashref->{$field}='' unless defined $hashref->{$field};
69 $proto->new('cust_main_county',$hashref);
74 Adds this tax rate to the database. If there is an error, returns the error,
75 otherwise returns false.
88 Deletes this tax rate from the database. If there is an error, returns the
89 error, otherwise returns false.
99 =item replace OLD_RECORD
101 Replaces the OLD_RECORD with this one in the database. If there is an error,
102 returns the error, otherwise returns false.
108 return "(Old) Not a cust_main_county record!"
109 unless $old->table eq "cust_main_county";
110 return "Can't change taxnum!"
111 unless $old->getfield('taxnum') eq $new->getfield('taxnum');
118 Checks all fields to make sure this is a valid tax rate. If there is an error,
119 returns the error, otherwise returns false. Called by the insert and replace
126 return "Not a cust_main_county record!"
127 unless $self->table eq "cust_main_county";
128 my($recref) = $self->hashref;
130 $self->ut_numbern('taxnum')
131 or $self->ut_textn('state')
132 or $self->ut_textn('county')
133 or $self->ut_float('tax')
142 $Id: cust_main_county.pm,v 1.2 1998-11-18 09:01:43 ivan Exp $
146 It doesn't properly override FS::Record yet.
150 L<FS::Record>, L<FS::cust_main>, L<FS::cust_bill>, schema.html from the base
155 ivan@voicenet.com 97-dec-16
157 Changed check for 'tax' to use the new ut_float subroutine
158 bmccane@maxbaud.net 98-apr-3
160 pod ivan@sisd.com 98-sep-21
162 $Log: cust_main_county.pm,v $
163 Revision 1.2 1998-11-18 09:01:43 ivan