sunnyman's (sunnyman) wrote in changelog,
sunnyman's
sunnyman
changelog

[ljcom] r11485: LJSUP-11276: Workaround for over expired...

Committer: vtroitsky
LJSUP-11276: Workaround for over expired promos: fix negative refund sums
U   trunk/cgi-bin/LJ/Pay/SelfPromo.pm
Modified: trunk/cgi-bin/LJ/Pay/SelfPromo.pm
===================================================================
--- trunk/cgi-bin/LJ/Pay/SelfPromo.pm	2012-02-16 16:05:23 UTC (rev 11484)
+++ trunk/cgi-bin/LJ/Pay/SelfPromo.pm	2012-02-16 17:59:19 UTC (rev 11485)
@@ -1037,6 +1037,8 @@
     my $refund_step = $LJ::SELF_PROMO_CONF->{$class->class}{'refund_step'};
 
     my $remaining_time       = $promo->exptime - time;
+    $remaining_time = 0 if $remaining_time < 0; 
+
     my $remaining_time_units = int( $remaining_time / $unit );
 
     my $unit_cost     = $promo->cost * $unit / $duration;

Tags: ljcom, pm, sunnyman, vtroitsky
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