1 package FS::cust_tax_exempt;
5 use FS::Record qw( qsearch qsearchs );
11 FS::cust_tax_exempt - Object methods for cust_tax_exempt records
15 use FS::cust_tax_exempt;
17 $record = new FS::cust_tax_exempt \%hash;
18 $record = new FS::cust_tax_exempt { 'column' => 'value' };
20 $error = $record->insert;
22 $error = $new_record->replace($old_record);
24 $error = $record->delete;
26 $error = $record->check;
30 An FS::cust_tax_exempt object represents a historical record of a customer tax
31 exemption. Currently this is only used for "texas tax". FS::cust_tax_exempt
32 inherits from FS::Record. The following fields are currently supported:
36 =item exemptnum - primary key
38 =item custnum - customer (see L<FS::cust_main>)
40 =item taxnum - tax rate (see L<FS::cust_main_county>)
56 Creates a new exemption record. To add the example to the database, see
59 Note that this stores the hash reference, not a distinct copy of the hash it
60 points to. You can ask the object for a copy with the I<hash> method.
64 # the new method can be inherited from FS::Record, if a table method is defined
66 sub table { 'cust_tax_exempt'; }
70 Adds this record to the database. If there is an error, returns the error,
71 otherwise returns false.
75 # the insert method can be inherited from FS::Record
79 Delete this record from the database.
83 # the delete method can be inherited from FS::Record
85 =item replace OLD_RECORD
87 Replaces the OLD_RECORD with this one in the database. If there is an error,
88 returns the error, otherwise returns false.
92 # the replace method can be inherited from FS::Record
96 Checks all fields to make sure this is a valid example. If there is
97 an error, returns the error, otherwise returns false. Called by the insert
102 # the check method should currently be supplied - FS::Record contains some
103 # data checking routines
108 $self->ut_numbern('exemptnum')
109 || $self->ut_foreign_key('custnum', 'cust_main', 'custnum')
110 || $self->ut_foreign_key('taxnum', 'cust_main_county', 'taxnum')
111 || $self->ut_number('year') #check better
112 || $self->ut_number('month') #check better
113 || $self->ut_money('amount')
121 Texas tax is a royal pain in the ass.
125 L<FS::cust_main_county>, L<FS::cust_main>, L<FS::Record>, schema.html from the