Committer: vtroitsky
LJSUP-14051: Show Journal Promo profit in paidsummary.bmlU trunk/cgi-bin/LJ/Pay/Payment/PayItem/SelfPromo.pm
Modified: trunk/cgi-bin/LJ/Pay/Payment/PayItem/SelfPromo.pm =================================================================== --- trunk/cgi-bin/LJ/Pay/Payment/PayItem/SelfPromo.pm 2012-10-29 12:10:16 UTC (rev 12839) +++ trunk/cgi-bin/LJ/Pay/Payment/PayItem/SelfPromo.pm 2012-10-29 12:26:01 UTC (rev 12840) @@ -54,7 +54,7 @@ $url = $promo->url(); } - my $type = $self->get_prop('selfpromo_type'); + my $type = $self->get_prop($promo_class.'_type'); my $suffix = ($type && $type eq 'refund' ? '.refund' : ''); return LJ::Lang::ml( "$promo_class.$sp_type.shop_item.name$suffix", { 'promotion_url' => $url } ); @@ -95,6 +95,7 @@ $subitem ||= $self->get_subitem(); my ($class) = split(/[_\-]/, $subitem); # get first splitted element + $class ||= 'selfpromo'; return $class; } @@ -136,8 +137,10 @@ } return LJ::Lang::ml('wallet.widget.history.des.journals', { }); } else { - $prefix = 'selfpromo'; - if ( $self->get_prop($prefix.'_type') eq 'buyout' ) { + my $prop_val = $self->get_prop('selfpromo_type'); + $prop_val ||= $self->get_prop($prefix.'_type'); + + if ( $prop_val && $prop_val eq 'buyout' ) { return LJ::Lang::ml( 'wallet.widget.history.des.'.$prefix.'_refund', { 'buyer' => $buyer->ljuser_display }