1 package FS::cust_tax_exempt;
2 use base qw( FS::cust_main_Mixin FS::Record );
8 FS::cust_tax_exempt - Object methods for cust_tax_exempt records
12 use FS::cust_tax_exempt;
14 $record = new FS::cust_tax_exempt \%hash;
15 $record = new FS::cust_tax_exempt { 'column' => 'value' };
17 $error = $record->insert;
19 $error = $new_record->replace($old_record);
21 $error = $record->delete;
23 $error = $record->check;
27 An FS::cust_tax_exempt object represents a record of an old-style customer tax
28 exemption. Currently this is only used for "texas tax". FS::cust_tax_exempt
29 inherits from FS::Record. The following fields are currently supported:
33 =item exemptnum - primary key
35 =item custnum - customer (see L<FS::cust_main>)
37 =item taxnum - tax rate (see L<FS::cust_main_county>)
49 Old-style customer tax exemptions are only useful for legacy migrations - if
50 you are looking for current customer tax exemption data see
51 L<FS::cust_tax_exempt_pkg>.
59 Creates a new exemption record. To add the example to the database, see
62 Note that this stores the hash reference, not a distinct copy of the hash it
63 points to. You can ask the object for a copy with the I<hash> method.
67 # the new method can be inherited from FS::Record, if a table method is defined
69 sub table { 'cust_tax_exempt'; }
73 Adds this record to the database. If there is an error, returns the error,
74 otherwise returns false.
78 # the insert method can be inherited from FS::Record
82 Delete this record from the database.
86 # the delete method can be inherited from FS::Record
88 =item replace OLD_RECORD
90 Replaces the OLD_RECORD with this one in the database. If there is an error,
91 returns the error, otherwise returns false.
95 # the replace method can be inherited from FS::Record
99 Checks all fields to make sure this is a valid example. 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
111 $self->ut_numbern('exemptnum')
112 || $self->ut_foreign_key('custnum', 'cust_main', 'custnum')
113 || $self->ut_foreign_key('taxnum', 'cust_main_county', 'taxnum')
114 || $self->ut_number('year') #check better
115 || $self->ut_number('month') #check better
116 || $self->ut_money('amount')
117 || $self->SUPER::check
121 =item cust_main_county
123 Returns the FS::cust_main_county object associated with this tax exemption.
129 Texas tax is a royal pain in the ass.
133 L<FS::cust_main_county>, L<FS::cust_main>, L<FS::Record>, schema.html from the