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 setup_amount - the amount of tax calculated on one-time charges
46 =item recur_amount - the amount of tax calculated on recurring charges
56 Creates a new estimated tax amount. To add the record to the database,
61 sub table { 'quotation_pkg_tax'; }
65 Adds this record to the database. If there is an error, returns the error,
66 otherwise returns false.
70 Delete this record from the database.
72 =item replace OLD_RECORD
74 Replaces the OLD_RECORD with this one in the database. If there is an error,
75 returns the error, otherwise returns false.
79 Checks all fields to make sure this is a valid example. If there is
80 an error, returns the error, otherwise returns false. Called by the insert
89 $self->ut_numbern('quotationtaxnum')
90 || $self->ut_foreign_key('quotationpkgnum', 'quotation_pkg', 'quotationpkgnum')
91 || $self->ut_text('itemdesc')
92 || $self->ut_money('setup_amount')
93 || $self->ut_money('recur_amount')
95 return $error if $error;
104 L<FS::Record>, schema.html from the base documentation.