summaryrefslogtreecommitdiff
path: root/FS
diff options
context:
space:
mode:
authorivan <ivan>2009-08-24 06:39:58 +0000
committerivan <ivan>2009-08-24 06:39:58 +0000
commita58bd9386e1e5fa1cdd16936fc29093ed67714db (patch)
tree5320c0f2eb77499e5d9ea29df22927057461ce55 /FS
parent93b257faa664416be7cface1a5663da0a86b7caf (diff)
(start of) customer move script, RT#5351
Diffstat (limited to 'FS')
-rw-r--r--FS/FS/cust_bill_ApplicationCommon.pm6
-rw-r--r--FS/FS/part_pkg.pm45
2 files changed, 30 insertions, 21 deletions
diff --git a/FS/FS/cust_bill_ApplicationCommon.pm b/FS/FS/cust_bill_ApplicationCommon.pm
index ec694ca58..d4627c0b4 100644
--- a/FS/FS/cust_bill_ApplicationCommon.pm
+++ b/FS/FS/cust_bill_ApplicationCommon.pm
@@ -1,7 +1,7 @@
package FS::cust_bill_ApplicationCommon;
use strict;
-use vars qw( @ISA $DEBUG $me );
+use vars qw( @ISA $DEBUG $me $skip_apply_to_lineitems_hack );
use List::Util qw(min);
use FS::Schema qw( dbdef );
use FS::Record qw( qsearch qsearchs dbh );
@@ -11,6 +11,8 @@ use FS::Record qw( qsearch qsearchs dbh );
$DEBUG = 0;
$me = '[FS::cust_bill_ApplicationCommon]';
+$skip_apply_to_lineitems_hack = 0;
+
=head1 NAME
FS::cust_bill_ApplicationCommon - Base class for bill application classes
@@ -113,6 +115,8 @@ Auto-applies this invoice application to specific line items, if possible.
sub apply_to_lineitems {
my $self = shift;
+ return '' if $skip_apply_to_lineitems_hack;
+
my @apply = ();
my $conf = new FS::Conf;
diff --git a/FS/FS/part_pkg.pm b/FS/FS/part_pkg.pm
index 3ee9e7f01..287453f3c 100644
--- a/FS/FS/part_pkg.pm
+++ b/FS/FS/part_pkg.pm
@@ -1,7 +1,7 @@
package FS::part_pkg;
use strict;
-use vars qw( @ISA %plans $DEBUG $setup_hack );
+use vars qw( @ISA %plans $DEBUG $setup_hack $skip_pkg_svc_hack );
use Carp qw(carp cluck confess);
use Scalar::Util qw( blessed );
use Time::Local qw( timelocal_nocheck );
@@ -23,6 +23,7 @@ use FS::part_pkg_link;
@ISA = qw( FS::m2m_Common FS::option_Common );
$DEBUG = 0;
$setup_hack = 0;
+$skip_pkg_svc_hack = 0;
=head1 NAME
@@ -217,26 +218,30 @@ sub insert {
}
}
- warn " inserting pkg_svc records" if $DEBUG;
- my $pkg_svc = $options{'pkg_svc'} || {};
- foreach my $part_svc ( qsearch('part_svc', {} ) ) {
- my $quantity = $pkg_svc->{$part_svc->svcpart} || 0;
- my $primary_svc =
- ( $options{'primary_svc'} && $options{'primary_svc'}==$part_svc->svcpart )
- ? 'Y'
- : '';
-
- my $pkg_svc = new FS::pkg_svc( {
- 'pkgpart' => $self->pkgpart,
- 'svcpart' => $part_svc->svcpart,
- 'quantity' => $quantity,
- 'primary_svc' => $primary_svc,
- } );
- my $error = $pkg_svc->insert;
- if ( $error ) {
- $dbh->rollback if $oldAutoCommit;
- return $error;
+ unless ( $skip_pkg_svc_hack ) {
+
+ warn " inserting pkg_svc records" if $DEBUG;
+ my $pkg_svc = $options{'pkg_svc'} || {};
+ foreach my $part_svc ( qsearch('part_svc', {} ) ) {
+ my $quantity = $pkg_svc->{$part_svc->svcpart} || 0;
+ my $primary_svc =
+ ( $options{'primary_svc'} && $options{'primary_svc'}==$part_svc->svcpart )
+ ? 'Y'
+ : '';
+
+ my $pkg_svc = new FS::pkg_svc( {
+ 'pkgpart' => $self->pkgpart,
+ 'svcpart' => $part_svc->svcpart,
+ 'quantity' => $quantity,
+ 'primary_svc' => $primary_svc,
+ } );
+ my $error = $pkg_svc->insert;
+ if ( $error ) {
+ $dbh->rollback if $oldAutoCommit;
+ return $error;
+ }
}
+
}
if ( $options{'cust_pkg'} ) {