Андрей (andy) wrote in changelog,
Андрей
andy
changelog

[ljcom] r11589: LJSUP-9836 (Need to develop interface fo...

Committer: ailyin
LJSUP-9836 (Need to develop interface for financial reporting of LiveJournal shop transactions)
U   trunk/cgi-bin/LJ/Pay/SelfPromo.pm
Modified: trunk/cgi-bin/LJ/Pay/SelfPromo.pm
===================================================================
--- trunk/cgi-bin/LJ/Pay/SelfPromo.pm	2012-03-14 08:57:57 UTC (rev 11588)
+++ trunk/cgi-bin/LJ/Pay/SelfPromo.pm	2012-03-14 10:03:47 UTC (rev 11589)
@@ -933,16 +933,20 @@
 
     ($it) = $cart->get_items;
 
+    my $effective_profit =
+        $opts->{'price'} - $opts->{'refund'} - $opts->{'remainder'};
+
     # set payitem props as appropriate
-    $it->set_prop( 'selfpromo'                => $class->class );
-    $it->set_prop( 'selfpromo_type'           => $opts->{'type'} );
-    $it->set_prop( 'selfpromo_profit'         => $opts->{'profit'} );
-    $it->set_prop( 'selfpromo_refund'         => $opts->{'refund'} );
-    $it->set_prop( 'selfpromo_refund_userid'  => $opts->{'refund_userid'} );
-    $it->set_prop( 'selfpromo_refund_promoid' => $opts->{'refund_promoid'} );
-    $it->set_prop( 'selfpromo_remainder'      => $opts->{'remainder'} );
-    $it->set_prop( 
-                 'selfpromo_remainder_userid' => $opts->{'remainder_userid'} );
+    $it->set_prop( 'selfpromo'                  => $class->class );
+    $it->set_prop( 'selfpromo_type'             => $opts->{'type'} );
+    $it->set_prop( 'selfpromo_profit'           => $opts->{'profit'} );
+    $it->set_prop( 'selfpromo_refund'           => $opts->{'refund'} );
+    $it->set_prop( 'selfpromo_refund_userid'    => $opts->{'refund_userid'} );
+    $it->set_prop( 'selfpromo_refund_promoid'   => $opts->{'refund_promoid'} );
+    $it->set_prop( 'selfpromo_remainder'        => $opts->{'remainder'} );
+    $it->set_prop(                              
+        'selfpromo_remainder_userid' => $opts->{'remainder_userid'} );
+    $it->set_prop( 'selfpromo_effective_profit' => $effective_profit );
 
     # Add object specific properties, if object exists (in case of non refunding cart)
     if ( my $object = $opts->{'object'} ) {

Tags: ailyin, andy, ljcom, pm
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