1 package FS::cust_bill_pkg_tax_rate_location;
4 use base qw( FS::Record );
5 use FS::Record qw( qsearch qsearchs );
12 FS::cust_bill_pkg_tax_rate_location - Object methods for cust_bill_pkg_tax_rate_location records
16 use FS::cust_bill_pkg_tax_rate_location;
18 $record = new FS::cust_bill_pkg_tax_rate_location \%hash;
19 $record = new FS::cust_bill_pkg_tax_rate_location { 'column' => 'value' };
21 $error = $record->insert;
23 $error = $new_record->replace($old_record);
25 $error = $record->delete;
27 $error = $record->check;
31 An FS::cust_bill_pkg_tax_rate_location object represents an record of taxation
32 based on package location. FS::cust_bill_pkg_tax_rate_location inherits from
33 FS::Record. The following fields are currently supported:
37 =item billpkgtaxratelocationnum
39 billpkgtaxratelocationnum
57 =item taxratelocationnum
74 Creates a new record. To add the record to the database, see L<"insert">.
76 Note that this stores the hash reference, not a distinct copy of the hash it
77 points to. You can ask the object for a copy with the I<hash> method.
81 sub table { 'cust_bill_pkg_tax_rate_location'; }
85 Adds this record to the database. If there is an error, returns the error,
86 otherwise returns false.
90 Delete this record from the database.
92 =item replace OLD_RECORD
94 Replaces the OLD_RECORD with this one in the database. If there is an error,
95 returns the error, otherwise returns false.
99 Checks all fields to make sure this is a valid record. If there is
100 an error, returns the error, otherwise returns false. Called by the insert
105 # the check method should currently be supplied - FS::Record contains some
106 # data checking routines
112 $self->ut_numbern('billpkgtaxratelocationnum')
113 || $self->ut_foreign_key('billpkgnum', 'cust_bill_pkg', 'billpkgnum' )
114 || $self->ut_number('taxnum') #cust_bill_pkg/tax_rate key, based on taxtype
115 || $self->ut_enum('taxtype', [ qw( FS::cust_main_county FS::tax_rate ) ] )
116 || $self->ut_textn('locationtaxid')
117 || $self->ut_foreign_key('taxratelocationnum', 'tax_rate_location', 'taxratelocationnum' )
118 || $self->ut_money('amount')
120 return $error if $error;
131 L<FS::Record>, schema.html from the base documentation.