Ignore:
Timestamp:
Aug 2, 2022, 9:26:10 AM (22 months ago)
Author:
chronos
Message:
  • Fixed: Incorrectly used member date BillingPeriodLastDate for determining new payments log for payment notification email.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Modules/Finance/Manage.php

    r916 r939  
    393393        '<th style="border-style: solid; border-width: 1px; padding: 1px 5px 1px 5px; text-align: center; font-weight: bold;">Popis</th>'.
    394394        '<th style="border-style: solid; border-width: 1px; padding: 1px 5px 1px 5px; text-align: center; font-weight: bold;">Částka [Kč]</th></tr>'."\n";
     395      if ($Member['PaymentEmailTime'] <> 'NULL')
     396      {
     397        $Where = ' WHERE (`T1`.`Time` > "'.$Member['PaymentEmailTime'].'")';
     398      } else
     399      {
     400        $Where = '';
     401      }
    395402      $DbResult = $this->Database->query('SELECT T1.* FROM ((SELECT `Text`, `Time`, `Value`, `File` FROM `FinanceOperation` WHERE (`Subject`='.$Member['Subject'].')) UNION ALL '.
    396403        '(SELECT (SELECT GROUP_CONCAT(`Description` SEPARATOR ", ") FROM `FinanceInvoiceItem` '.
    397404        'WHERE `FinanceInvoiceItem`.`FinanceInvoice` = `FinanceInvoice`.`Id`) AS `Text`, '.
    398         '`Time`, -`Value`, `File` FROM `FinanceInvoice` WHERE (`Subject`='.
    399         $Member['Subject'].')) ORDER BY `Time` DESC) AS `T1` WHERE (`T1`.`Time` > "'.$Member['BillingPeriodLastDate'].'")');
     405        '`Time`, -`Value`, `File` FROM `FinanceInvoice` WHERE (`Subject`='.$Member['Subject'].')) ORDER BY `Time` DESC) AS `T1`'.$Where);
    400406      while ($DbRow = $DbResult->fetch_assoc())
    401407      {
     
    413419      ModuleEmailQueue::Cast($this->System->GetModule('EmailQueue'))->AddItem($User['Name'].' <'.$User['Email'].'>', $Title, $Content,
    414420         $Config['Web']['Admin'].' <'.$Config['Web']['AdminEmail'].'>');
    415       $Output = '';
     421      $this->Database->update('Member', 'Id='.$Member['Id'], array('PaymentEmailTime' => 'NOW()'));
     422      $Output = '';     
    416423    } else $Output = 'Uživatel '.$User['Name'].' nemá email.';
    417424    return $Output;
Note: See TracChangeset for help on using the changeset viewer.