holyandrew (holyandrew) wrote in changelog,
holyandrew
holyandrew
changelog

[ljcom] r12430: LJSUP-12945: Include data for new promo ...

Committer: akanashin
LJSUP-12945: Include data for new promo products
U   trunk/htdocs/admin/accounts/paidsummary.bml
Modified: trunk/htdocs/admin/accounts/paidsummary.bml
===================================================================
--- trunk/htdocs/admin/accounts/paidsummary.bml	2012-08-07 08:35:48 UTC (rev 12429)
+++ trunk/htdocs/admin/accounts/paidsummary.bml	2012-08-07 08:44:52 UTC (rev 12430)
@@ -182,6 +182,11 @@
                     $payid_refunds_ref->{$item->{payid}} += -$amt;
 #warn "Calendar Refund ".$item->{payid}.'/'.$item->{piid}.':'.$amt;
                 }
+                if ($item->get_prop('notificationpromo_refund')) {
+                    my $amt = $item->get_prop('notificationpromo_refund') / LJ::Pay::Wallet::EXCHANGE_RATE;
+                    $piid_refunds_ref->{$item->{piid}}    = -$amt;
+                    $payid_refunds_ref->{$item->{payid}} += -$amt;
+                }
             } else {
 #warn "Refund ".$item->{payid}.'/'.$item->{piid}.':'.$item->{amt};
                 $piid_refunds_ref->{$item->{piid}}    = -$item->{amt};
@@ -210,6 +215,12 @@
                 LJ::Pay::Wallet::EXCHANGE_RATE;
 #warn "selfpromo ".$row->{payid}." amount: $amount";
         }
+        if ( @items == 1 && $items[0]->get_item eq 'notificationpromo' && $payments_ref->{ $row->{'payid'} }{'method'} ne 'free' ) {
+            my $it = $items[0];
+            $amount -= $it->get_prop('notificationpromo_refund') /
+            LJ::Pay::Wallet::EXCHANGE_RATE;
+            #warn "selfpromo ".$row->{payid}." amount: $amount";
+        }
 
         # Determine if the hash key is labelled as positive or negative
         my $ctkey  = $amount >= 0 ? 'cnt_pos' : 'cnt_neg';
@@ -283,7 +294,12 @@
                 LJ::Pay::Wallet::EXCHANGE_RATE;
 #warn "selfpromo ".$it->{payid}." amount: $amount";
         }
+        if ( $it->get_item eq 'notificationpromo' && $payments_ref->{ $it->{'payid'} }{'method'} ne 'free' ) {
+            $amount -= $it->get_prop('notificationpromo_refund') /
+                LJ::Pay::Wallet::EXCHANGE_RATE;
+        }
 
+
         # find item and subitem key strings
         my $item = $it->{item};
         my $subkey;

Tags: akanashin, bml, holyandrew, ljcom
Subscribe
  • Post a new comment

    Error

    Anonymous comments are disabled in this journal

    default userpic

    Your reply will be screened

    Your IP address will be recorded 

  • 0 comments