+sub tax_locationnum {
+ my $self = shift;
+ $self->locationnum;
+}
+
+#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 });
+}
+
+sub quotation_pkg_tax {
+ my $self = shift;
+ qsearch('quotation_pkg_tax', { quotationpkgnum => $self->quotationpkgnum });
+}
+
+sub cust_location {
+ my $self = shift;
+ $self->locationnum ? qsearchs('cust_location', { locationnum => $self->locationnum }) : '';
+}
+
+
+sub _upgrade_data {
+ my $class = shift;
+ my @quotation_pkg_without_location =
+ qsearch( 'quotation_pkg', { locationnum => '' } );
+ if (@quotation_pkg_without_location) {
+ warn "setting default location on quotation_pkg records\n";
+ foreach my $quotation_pkg (@quotation_pkg_without_location) {
+ # check() will fix this
+ my $error = $quotation_pkg->replace;
+ if ($error) {
+ die "quotation #".$quotation_pkg->quotationnum.": $error\n";
+ }
+ }
+ }
+ '';
+}
+