discounts + quotations, #33099
authorMark Wells <mark@freeside.biz>
Sun, 1 Feb 2015 00:29:38 +0000 (16:29 -0800)
committerMark Wells <mark@freeside.biz>
Sun, 1 Feb 2015 00:29:54 +0000 (16:29 -0800)
FS/FS/quotation_pkg.pm
FS/FS/quotation_pkg_discount.pm

index 28677d0..914e1ce 100644 (file)
@@ -2,7 +2,7 @@ package FS::quotation_pkg;
 
 use strict;
 use base qw( FS::TemplateItem_Mixin FS::Record );
-use FS::Record qw( qsearchs dbh ); #qsearch
+use FS::Record qw( qsearch qsearchs dbh );
 use FS::part_pkg;
 use FS::cust_location;
 use FS::quotation;
@@ -227,7 +227,7 @@ sub estimate {
   if ( $self->waive_setup eq 'Y' || $self->{'_NO_SETUP_KLUDGE'} ) {
     $unitsetup = '0.00';
   } else {
-    $unitsetup = $part_pkg->base_setup;
+    $unitsetup = $part_pkg->option('setup_fee',1) || '0.00'; # XXX 3.x only
   }
   if ( $self->{'_NO_RECUR_KLUDGE'} ) {
     $unitrecur = '0.00';
@@ -414,6 +414,18 @@ sub cust_main {
   $quotation->cust_main;
 }
 
+#stub for 3.x
+
+sub quotation {
+  my $self = shift;
+  FS::quotation->by_key($self->quotationnum);
+}
+
+sub quotation_pkg_discount {
+  my $self = shift;
+  qsearch('quotation_pkg_discount', { quotationpkgnum => $self->quotationpkgnum });
+}
+
 =back
 
 =head1 BUGS
index 15b1bfe..24cb204 100644 (file)
@@ -3,6 +3,8 @@ package FS::quotation_pkg_discount;
 use strict;
 use base qw( FS::Record );
 use FS::Record qw( qsearch qsearchs );
+use FS::quotation_pkg;
+use FS::discount;
 use FS::Maketext 'mt';
 
 =head1 NAME
@@ -161,6 +163,17 @@ sub description {
   return $desc;
 }
 
+#stub for 3.x
+sub quotation_pkg {
+  my $self = shift;
+  FS::quotation_pkg->by_key($self->quotationpkgnum);
+}
+
+sub discount {
+  my $self = shift;
+  FS::discount->by_key($self->discountnum);
+}
+
 =head1 BUGS
 
 =head1 SEE ALSO