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-10 18:05:33 -0600
commitb1eb27aff8062aade3f13610664ee522d13a1cf0 (patch)
treed733bfb46d41a186fe9fae8610d57845f91bac4b /FS/FS/TemplateItem_Mixin.pm
parent315f5c9e8d797046db1bc6f91ae9e9e365309514 (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;