1 package FS::quotation_pkg_tax;
4 use base qw( FS::Record );
5 use FS::Record qw( qsearch qsearchs );
6 use FS::cust_main_county;
11 FS::quotation_pkg_tax - Object methods for quotation_pkg_tax records
15 use FS::quotation_pkg_tax;
17 $record = new FS::quotation_pkg_tax \%hash;
18 $record = new FS::quotation_pkg_tax { 'column' => 'value' };
20 $error = $record->insert;
22 $error = $new_record->replace($old_record);
24 $error = $record->delete;
26 $error = $record->check;
30 An FS::quotation_pkg_tax object represents tax on a quoted package.
31 FS::quotation_pkg_tax inherits from FS::Record (though it should eventually
32 inherit from some shared superclass of L<FS::cust_bill_pkg_tax_location>).
33 The following fields are currently supported:
37 =item quotationtaxnum - primary key
39 =item quotationpkgnum - the L<FS::quotation_pkg> record that the tax applies
42 =item itemdesc - the name of the tax
44 =item taxnum - the L<FS::cust_main_county> or L<FS::tax_rate> defining the
47 =item taxtype - the class of the tax rate represented by C<taxnum>.
49 =item setup_amount - the amount of tax calculated on one-time charges
51 =item recur_amount - the amount of tax calculated on recurring charges
61 Creates a new estimated tax amount. To add the record to the database,
66 sub table { 'quotation_pkg_tax'; }
70 Adds this record to the database. If there is an error, returns the error,
71 otherwise returns false.
75 Delete this record from the database.
77 =item replace OLD_RECORD
79 Replaces the OLD_RECORD with this one in the database. If there is an error,
80 returns the error, otherwise returns false.
84 Checks all fields to make sure this is a valid example. If there is
85 an error, returns the error, otherwise returns false. Called by the insert
94 $self->ut_numbern('quotationtaxnum')
95 || $self->ut_foreign_key('quotationpkgnum', 'quotation_pkg', 'quotationpkgnum')
96 || $self->ut_text('itemdesc')
97 || $self->ut_number('taxnum')
98 || $self->ut_enum('taxtype', [ 'FS::cust_main_county', 'FS::tax_rate' ])
99 || $self->ut_money('setup_amount')
100 || $self->ut_money('recur_amount')
102 return $error if $error;
110 FS::quotation_pkg->by_key($self->quotationpkgnum);
117 L<FS::Record>, schema.html from the base documentation.