X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=FS%2FFS%2Fpart_export%2Fa2billing.pm;h=dbbd1bef85ebe3aff6020124228962c9630b6554;hb=7be116339beee253f9bf8805076c766cf0f8e318;hp=b080d07b9137d33ad729de34c3612213fc8ae11e;hpb=b7cf1606a66cca95e3540f803ffa66d223f23a40;p=freeside.git diff --git a/FS/FS/part_export/a2billing.pm b/FS/FS/part_export/a2billing.pm index b080d07b9..dbbd1bef8 100644 --- a/FS/FS/part_export/a2billing.pm +++ b/FS/FS/part_export/a2billing.pm @@ -105,7 +105,7 @@ sub replace { ''; } -sub export_insert { +sub _export_insert { my $self = shift; my $svc = shift; my $cust_pkg = $svc->cust_svc->cust_pkg; @@ -224,9 +224,15 @@ sub export_insert { id_cc_didgroup => $self->option('didgroup'), id_cc_country => $cc_country_id, iduser => $cc_card_id, - did => $svc->phonenum, + did => $svc->countrycode. $svc->phonenum, billingtype => ($self->option('billtype') eq 'Dial Out Rate' ? 2 : 3), activated => 1, + aleg_carrier_cost_min_offp => $part_pkg->option('a2billing_carrier_cost_min'), + aleg_carrier_initblock_offp => $part_pkg->option('a2billing_carrier_initblock_offp'), + aleg_carrier_increment_offp => $part_pkg->option('a2billing_carrier_increment_offp'), + aleg_retail_cost_min_offp => $part_pkg->option('a2billing_retail_cost_min_offp'), + aleg_retail_initblock_offp => $part_pkg->option('a2billing_retail_initblock_offp'), + aleg_retail_increment_offp => $part_pkg->option('a2billing_retail_increment_offp'), ); # use 'did' as the key here so that if the DID already exists, we @@ -236,7 +242,7 @@ sub export_insert { my $cc_did_id = $self->a2b_find('cc_did', 'svcnum', $svc->svcnum); - my $destination = 'SIP/user-'. $svc_acct->username. '@'. $svc->sip_server. "!". $svc->phonenum; + my $destination = 'SIP/user-'. $svc_acct->username. '@'. $svc->sip_server. "!". $svc->countrycode. $svc->phonenum; my %cc_did_destination = ( destination => $destination, priority => 1, @@ -284,7 +290,7 @@ sub export_insert { ''; } -sub export_delete { +sub _export_delete { my $self = shift; my $svc = shift; @@ -370,7 +376,7 @@ sub export_delete { ''; } -sub export_replace { +sub _export_replace { my $self = shift; my $new = shift; my $old = shift || $self->replace_old; @@ -402,7 +408,7 @@ sub export_replace { } elsif ( $new->isa('FS::svc_phone') ) { # if the phone number has changed, need to create a new DID. - if ( $new->phonenum ne $old->phonenum ) { + if ( $new->phonenum ne $old->phonenum || $new->countrycode ne $old->countrycode ) { # deactivate/unlink/close the old DID # and create/link the new one $error = $self->export_delete($old) @@ -415,7 +421,7 @@ sub export_replace { ''; } -sub export_suspend { +sub _export_suspend { my $self = shift; my $svc = shift; @@ -440,7 +446,7 @@ sub export_suspend { $error || ''; } -sub export_unsuspend { +sub _export_unsuspend { my $self = shift; my $svc = shift;