1 package FS::agent_currency;
2 use base qw( FS::Record );
5 #use FS::Record qw( qsearch qsearchs );
10 FS::agent_currency - Object methods for agent_currency records
14 use FS::agent_currency;
16 $record = new FS::agent_currency \%hash;
17 $record = new FS::agent_currency { 'column' => 'value' };
19 $error = $record->insert;
21 $error = $new_record->replace($old_record);
23 $error = $record->delete;
25 $error = $record->check;
29 An FS::agent_currency object represents an agent's ability to sell
30 in a specific non-default currency. FS::agent_currency inherits from
31 FS::Record. The following fields are currently supported:
35 =item agentcurrencynum
41 Agent (see L<FS::agent>)
45 3 letter currency code
55 Creates a new record. To add the record to the database, see L<"insert">.
57 Note that this stores the hash reference, not a distinct copy of the hash it
58 points to. You can ask the object for a copy with the I<hash> method.
62 sub table { 'agent_currency'; }
66 Adds this record to the database. If there is an error, returns the error,
67 otherwise returns false.
71 Delete this record from the database.
73 =item replace OLD_RECORD
75 Replaces the OLD_RECORD with this one in the database. If there is an error,
76 returns the error, otherwise returns false.
80 Checks all fields to make sure this is a valid record. If there is
81 an error, returns the error, otherwise returns false. Called by the insert
90 $self->ut_numbern('agentcurrencynum')
91 || $self->ut_foreign_key('agentnum', 'agent', 'agentnum')
92 || $self->ut_currency('currency')
94 return $error if $error;
105 L<FS::Record>, L<FS::agent>