1 package FS::currency_exchange;
2 use base qw( FS::Record );
5 #use FS::Record qw( qsearch qsearchs );
9 FS::currency_exchange - Object methods for currency_exchange records
13 use FS::currency_exchange;
15 $record = new FS::currency_exchange \%hash;
16 $record = new FS::currency_exchange { 'column' => 'value' };
18 $error = $record->insert;
20 $error = $new_record->replace($old_record);
22 $error = $record->delete;
24 $error = $record->check;
28 An FS::currency_exchange object represents an exchange rate between currencies.
29 FS::currency_exchange inherits from FS::Record. The following fields are
59 Creates a new exchange rate. To add the exchange rate 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 sub table { 'currency_exchange'; }
71 Adds this record to the database. If there is an error, returns the error,
72 otherwise returns false.
76 Delete this record from the database.
78 =item replace OLD_RECORD
80 Replaces the OLD_RECORD with this one in the database. If there is an error,
81 returns the error, otherwise returns false.
85 Checks all fields to make sure this is a valid exchange rate. If there is
86 an error, returns the error, otherwise returns false. Called by the insert
95 $self->ut_numbern('currencyratenum')
96 || $self->ut_currency('from_currency')
97 || $self->ut_currency('to_currency')
98 || $self->ut_float('rate') #good enough for untainting
100 return $error if $error;
111 L<FS::Record>, schema.html from the base documentation.