Ignore:
Timestamp:
Apr 1, 2013, 8:36:27 PM (12 years ago)
Author:
chronos
Message:
  • Opraveno: Negenerovat faktury pokud fakturovaná částka je nula.
  • Přidáno: Zobrazení akcí při prohlížení položek správy dat.
  • Přidáno: V tabulce Subjektů se nyní zobrazují související platby.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/finance/manage.php

    r507 r508  
    320320      'ON Subject.Id=Member.Subject LEFT JOIN FinanceBillingPeriod ON '.
    321321      'FinanceBillingPeriod.Id=Member.BillingPeriodNext WHERE (Member.Blocked = 0)'.
    322       'AND (Member.BillingPeriodNext > 1)';
     322      'AND (Member.BillingPeriodNext > 1) AND (MemberPayment.MonthlyTotal != 0)';
    323323   
    324324    $DbResult = $this->Database->query('SELECT COUNT(*) FROM ('.$SQL.') AS T');
     
    404404          $MonthlyTotal -= $Member['MonthlyPlus'];
    405405        }
    406         $PayPerPeriod = $MonthlyTotal * $Period['MonthCount'];
    407    
    408         $TimePeriodText = date('j.n.Y', $Period['From']).' - '.date('j.n.Y', $Period['To']);
    409         $Output .= $TimePeriodText.': '.$MonthlyTotal.' * '.$Period['MonthCount'].' = '.$PayPerPeriod.'<br />';
    410         $this->InsertInvoice($Member['Subject'], time(), time() + 3600 * 24 * INVOICE_DUE_DAYS,
    411           $InvoiceItems, INVOICE_OUT_DOC_LINE, $Period['From'], $Period['To']);
    412    
    413         $Output .= $this->SendPaymentEmail($Member['Id']);
     406        $PayPerPeriod = $MonthlyTotal * $Period['MonthCount']; 
     407        if($PayPerPeriod != 0)
     408        {
     409          $TimePeriodText = date('j.n.Y', $Period['From']).' - '.date('j.n.Y', $Period['To']);
     410          $Output .= $TimePeriodText.': '.$MonthlyTotal.' * '.$Period['MonthCount'].' = '.$PayPerPeriod.'<br />';
     411          $this->InsertInvoice($Member['Subject'], time(), time() + 3600 * 24 * INVOICE_DUE_DAYS,
     412            $InvoiceItems, INVOICE_OUT_DOC_LINE, $Period['From'], $Period['To']);
     413   
     414          $Output .= $this->SendPaymentEmail($Member['Id']);
     415        } else $Output .= '<br />';
    414416        $this->Database->update('Member', 'Id='.$Member['Id'],
    415417          array('BillingPeriodLastDate' => TimeToMysqlDateTime($Period['To'])));
Note: See TracChangeset for help on using the changeset viewer.