From 323dc1ff0c2726479e959bb487aec5a582417e88 Mon Sep 17 00:00:00 2001 From: Martin Kamerbeek Date: Thu, 14 May 2009 09:00:52 +0000 Subject: [PATCH] Adding missing tmpl_vars. --- lib/WebGUI/Account/Shop.pm | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/lib/WebGUI/Account/Shop.pm b/lib/WebGUI/Account/Shop.pm index edce68d91..3f8710586 100644 --- a/lib/WebGUI/Account/Shop.pm +++ b/lib/WebGUI/Account/Shop.pm @@ -198,6 +198,7 @@ sub www_managePurchases { %{$transaction->get}, viewDetailUrl => $self->getUrl('op=account;module=shop;do=viewTransaction;transactionId='.$id), amount => sprintf("%.2f", $transaction->get('amount')), + amountMinusTax => sprintf( '%.2f', $transaction->get('amount') - $transaction->get('taxes') ), }; } @@ -256,7 +257,14 @@ sub www_viewSales { [ $vendor->getId ] ); while (my $row = $sth->hashRef) { + my $data = $row; + + # Add asset properties to tmpl_vars. + my $asset = WebGUI::Asset->newByDynamicClass( $session, $row->{ assetId } ); + $row = { %{ $row }, %{ $asset->get } } if $asset; + push @products, $row; + $totalSales += $row->{quantity}; } $sth->finish;