projects
/
freeside.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
a094dcf
)
multi-currency, RT#21565
author
Ivan Kohler
<ivan@freeside.biz>
Tue, 11 Jun 2013 07:34:19 +0000
(
00:34
-0700)
committer
Ivan Kohler
<ivan@freeside.biz>
Tue, 11 Jun 2013 07:34:19 +0000
(
00:34
-0700)
FS/FS/cust_main.pm
patch
|
blob
|
history
diff --git
a/FS/FS/cust_main.pm
b/FS/FS/cust_main.pm
index
f3122aa
..
18ad9e3
100644
(file)
--- a/
FS/FS/cust_main.pm
+++ b/
FS/FS/cust_main.pm
@@
-58,6
+58,7
@@
use FS::cust_main_exemption;
use FS::cust_tax_adjustment;
use FS::cust_tax_location;
use FS::agent;
use FS::cust_tax_adjustment;
use FS::cust_tax_location;
use FS::agent;
+use FS::agent_currency;
use FS::cust_main_invoice;
use FS::cust_tag;
use FS::prepay_credit;
use FS::cust_main_invoice;
use FS::cust_tag;
use FS::prepay_credit;
@@
-1771,8
+1772,17
@@
sub check {
if $error =~ /^Illegal or empty \(numeric\) refnum: /;
return $error if $error;
if $error =~ /^Illegal or empty \(numeric\) refnum: /;
return $error if $error;
- return "Unknown agent"
- unless qsearchs( 'agent', { 'agentnum' => $self->agentnum } );
+ my $agent = qsearchs( 'agent', { 'agentnum' => $self->agentnum } )
+ or return "Unknown agent";
+
+ if ( $self->currency ) {
+ my $agent_currency = qsearchs( 'agent_currency', {
+ 'agentnum' => $agent->agentnum,
+ 'currency' => $self->currency,
+ })
+ or return "Agent ". $agent->agent.
+ " not permitted to offer ". $self->currency. " invoicing";
+ }
return "Unknown refnum"
unless qsearchs( 'part_referral', { 'refnum' => $self->refnum } );
return "Unknown refnum"
unless qsearchs( 'part_referral', { 'refnum' => $self->refnum } );