projects
/
freeside.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
bae611e
)
set charged_party to accoutncode for vedeye, RT#4342
author
ivan
<ivan>
Mon, 1 Dec 2008 07:53:12 +0000
(07:53 +0000)
committer
ivan
<ivan>
Mon, 1 Dec 2008 07:53:12 +0000
(07:53 +0000)
FS/FS/Conf.pm
patch
|
blob
|
history
FS/FS/cdr.pm
patch
|
blob
|
history
diff --git
a/FS/FS/Conf.pm
b/FS/FS/Conf.pm
index
e1fb842
..
eba04d4
100644
(file)
--- a/
FS/FS/Conf.pm
+++ b/
FS/FS/Conf.pm
@@
-2584,6
+2584,14
@@
worry that config_items is freeside-specific and icky.
'type' => 'text',
},
'type' => 'text',
},
+ {
+ 'key' => 'cdr-charged_party-accountcode',
+ 'section' => '',
+ 'description' => 'Set the charged_party field of CDRs to the accountcode.',
+ 'type' => 'checkbox',
+ },
+
+
);
1;
);
1;
diff --git
a/FS/FS/cdr.pm
b/FS/FS/cdr.pm
index
20c3dbc
..
ba3e492
100644
(file)
--- a/
FS/FS/cdr.pm
+++ b/
FS/FS/cdr.pm
@@
-233,12
+233,24
@@
sub check {
$self->calldate( $self->startdate_sql )
if !$self->calldate && $self->startdate;
$self->calldate( $self->startdate_sql )
if !$self->calldate && $self->startdate;
+ my $conf = new FS::Conf;
+
unless ( $self->charged_party ) {
unless ( $self->charged_party ) {
- if ( $self->dst =~ /^(\+?1)?8[02-8]{2}/ ) {
- $self->charged_party($self->dst);
+
+ if ( $conf->exists('cdr-charged_party-accountcode') && $self->accountcode ){
+
+ $self->charged_party( $self->accountcode );
+
} else {
} else {
- $self->charged_party($self->src);
+
+ if ( $self->dst =~ /^(\+?1)?8[02-8]{2}/ ) {
+ $self->charged_party($self->dst);
+ } else {
+ $self->charged_party($self->src);
+ }
+
}
}
+
}
#check the foreign keys even?
}
#check the foreign keys even?