Changeset 508 for trunk/finance/manage.php
- Timestamp:
- Apr 1, 2013, 8:36:27 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/finance/manage.php
r507 r508 320 320 'ON Subject.Id=Member.Subject LEFT JOIN FinanceBillingPeriod ON '. 321 321 'FinanceBillingPeriod.Id=Member.BillingPeriodNext WHERE (Member.Blocked = 0)'. 322 'AND (Member.BillingPeriodNext > 1) ';322 'AND (Member.BillingPeriodNext > 1) AND (MemberPayment.MonthlyTotal != 0)'; 323 323 324 324 $DbResult = $this->Database->query('SELECT COUNT(*) FROM ('.$SQL.') AS T'); … … 404 404 $MonthlyTotal -= $Member['MonthlyPlus']; 405 405 } 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 />'; 414 416 $this->Database->update('Member', 'Id='.$Member['Id'], 415 417 array('BillingPeriodLastDate' => TimeToMysqlDateTime($Period['To'])));
Note:
See TracChangeset
for help on using the changeset viewer.