projects
/
freeside.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
quick payment entry: if both a custnum and an agent_custid match, allow the user...
[freeside.git]
/
FS
/
FS
/
part_export.pm
diff --git
a/FS/FS/part_export.pm
b/FS/FS/part_export.pm
index
9a479b7
..
45773e0
100644
(file)
--- a/
FS/FS/part_export.pm
+++ b/
FS/FS/part_export.pm
@@
-4,8
+4,8
@@
use strict;
use vars qw( @ISA @EXPORT_OK $DEBUG %exports );
use Exporter;
use Tie::IxHash;
use vars qw( @ISA @EXPORT_OK $DEBUG %exports );
use Exporter;
use Tie::IxHash;
+use base qw( FS::option_Common FS::m2m_Common ); # m2m for 'export_nas'
use FS::Record qw( qsearch qsearchs dbh );
use FS::Record qw( qsearch qsearchs dbh );
-use FS::option_Common;
use FS::part_svc;
use FS::part_export_option;
use FS::export_svc;
use FS::part_svc;
use FS::part_export_option;
use FS::export_svc;
@@
-13,7
+13,6
@@
use FS::export_svc;
#for export modules, though they should probably just use it themselves
use FS::queue;
#for export modules, though they should probably just use it themselves
use FS::queue;
-@ISA = qw( FS::option_Common );
@EXPORT_OK = qw(export_info);
$DEBUG = 0;
@EXPORT_OK = qw(export_info);
$DEBUG = 0;
@@
-129,7
+128,12
@@
sub delete {
local $FS::UID::AutoCommit = 0;
my $dbh = dbh;
local $FS::UID::AutoCommit = 0;
my $dbh = dbh;
- my $error = $self->SUPER::delete;
+ # clean up export_nas records
+ my $error = $self->process_m2m(
+ 'link_table' => 'export_nas',
+ 'target_table' => 'nas',
+ 'params' => [],
+ ) || $self->SUPER::delete;
if ( $error ) {
$dbh->rollback if $oldAutoCommit;
return $error;
if ( $error ) {
$dbh->rollback if $oldAutoCommit;
return $error;
@@
-469,6
+473,12
@@
sub _upgrade_data { #class method
$error = $opt->replace;
die $error if $error;
}
$error = $opt->replace;
die $error if $error;
}
+ # pass downstream
+ my %exports_in_use;
+ $exports_in_use{ref $_} = 1 foreach qsearch('part_export', {});
+ foreach (keys(%exports_in_use)) {
+ $_->_upgrade_exporttype(%opts) if $_->can('_upgrade_exporttype');
+ }
}
#=item exporttype2svcdb EXPORTTYPE
}
#=item exporttype2svcdb EXPORTTYPE