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

[ljcom] r12334: LJSUP-12390: Implement statistics report...

Committer: vtroitsky
LJSUP-12390: Implement statistics reports subsystem
U   trunk/htdocs/admin/accounts/paidsummary.bml
Modified: trunk/htdocs/admin/accounts/paidsummary.bml
===================================================================
--- trunk/htdocs/admin/accounts/paidsummary.bml	2012-07-24 06:41:26 UTC (rev 12333)
+++ trunk/htdocs/admin/accounts/paidsummary.bml	2012-07-24 07:48:58 UTC (rev 12334)
@@ -88,7 +88,8 @@
     if ($pay_method && $pay_method ne '') {
         $select_payments_sql .= " AND method = '$pay_method'";
     } else {
-        $select_payments_sql .= " AND method <> 'free'";
+    # select all stuff
+    #    $select_payments_sql .= " AND method <> 'free'";
     }
 
     if ($users eq 'anon') {
@@ -145,6 +146,14 @@
             my $payid = $row->{payid};
             my $piid  = $row->{piid};
 
+            next unless ($payments_ref->{$payid});
+
+            if ( $payments_ref->{$payid} && $payments_ref->{$payid}{method} eq 'free' ) {
+                unless ($row->{subitem} && $row->{subitem} =~ /^commercial/) {
+                    delete $payments_ref->{$payid};
+                    next;
+                }
+            }
             $payitems_ref->{$piid} = LJ::Pay::Payment::PayItem->new_memonly(%$row);
             $piid_dates_ref->{$piid} = $payments_ref->{$payid}->{daterecv};
             $payid_piids_ref->{$payid} = [] unless exists $payid_piids_ref->{$payid};
@@ -255,6 +264,8 @@
         if ( $it->get_item eq 'selfpromo' ) {
             $amount -= $it->get_prop('selfpromo_refund') /
                 LJ::Pay::Wallet::EXCHANGE_RATE;
+
+#warn "selfpromo ".$it->{payid}." amount: $amount";
         }
 
         # find item and subitem key strings
@@ -267,6 +278,7 @@
             $subkey = $amount;
         } 
         elsif ($item eq 'selfpromo') {
+            # detect calendar promo rows
             my $subitem = $it->get_subitem();
             if ($subitem && $subitem =~ /^commercial/) {
                 $subkey = 'calendar';
@@ -791,11 +803,11 @@
 
         my $ret;
         if ($html_view) {
-            my $align = $is_subkey ? 'center' : 'left';
+            my $align = $is_subkey ? '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;' : '';
             $ret .= "<tr>";
             $item_name = '<b>Total</b>' if $item_name eq 'Total';
             $ret .= "<td>$day</td>" if $day;
-            $ret .= "<td align=$align>$item_name</td>";
+            $ret .= "<td align=left>$align$item_name</td>";
             $ret .= "<td align=right>" . ($cnt_pos ? $cnt_pos : '&nbsp') . "</td>";
             $ret .= money_cell($amt_pos, 1);
             $ret .= "<td align=right>" . ($cnt_neg ? $cnt_neg : '&nbsp') . "</td>";

Tags: bml, ljcom, 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