summaryrefslogtreecommitdiff
path: root/FS/FS/TemplateItem_Mixin.pm
diff options
context:
space:
mode:
authorJonathan Prykop <jonathan@freeside.biz>2015-11-09 17:05:36 -0600
committerJonathan Prykop <jonathan@freeside.biz>2015-11-09 17:05:36 -0600
commit96b69dd1aa5c8045b5a4297ecea510d60f575251 (patch)
treefbe98f788ff92323990e7f778df466c8b0529985 /FS/FS/TemplateItem_Mixin.pm
parentb3c70d709fd646ef355d49a4e87151c99ee413e9 (diff)
RT#34960: Quotations [changed billpkgnum to quotationpkgnum]
Diffstat (limited to 'FS/FS/TemplateItem_Mixin.pm')
-rw-r--r--FS/FS/TemplateItem_Mixin.pm7
1 files changed, 4 insertions, 3 deletions
diff --git a/FS/FS/TemplateItem_Mixin.pm b/FS/FS/TemplateItem_Mixin.pm
index dcd7ab3..248da3c 100644
--- a/FS/FS/TemplateItem_Mixin.pm
+++ b/FS/FS/TemplateItem_Mixin.pm
@@ -175,6 +175,7 @@ sub details {
my $escape_function = $opt{escape_function} || sub { shift };
my $csv = new Text::CSV_XS;
+ my $key = $self->primary_key;
if ( $opt{format_function} ) {
@@ -189,14 +190,14 @@ sub details {
)
}
qsearch ({ 'table' => $self->detail_table,
- 'hashref' => { 'billpkgnum' => $self->billpkgnum },
+ 'hashref' => { $key => $self->get($key) },
'order_by' => 'ORDER BY detailnum',
});
} elsif ( $opt{'no_usage'} ) {
my $sql = "SELECT detail FROM ". $self->detail_table.
- " WHERE billpkgnum = ". $self->billpkgnum.
+ " WHERE " . $key . " = ". $self->get($key).
" AND ( format IS NULL OR format != 'C' ) ".
" ORDER BY detailnum";
my $sth = dbh->prepare($sql) or die dbh->errstr;
@@ -251,7 +252,7 @@ sub details {
}
my $sql = "SELECT format, detail FROM ". $self->detail_table.
- " WHERE billpkgnum = ". $self->billpkgnum.
+ " WHERE " . $key . " = ". $self->get($key).
" ORDER BY detailnum";
my $sth = dbh->prepare($sql) or die dbh->errstr;
$sth->execute or die $sth->errstr;