Changeset 747 for trunk/Modules/Finance/Manage.php
- Timestamp:
- Sep 21, 2015, 12:12:26 AM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Modules/Finance/Manage.php
r741 r747 100 100 } 101 101 102 function InsertInvoice($Subject, $TimeCreation, $TimeDue, $ ValueSign, $Items,103 $Group, $PeriodFrom, $PeriodTo, $Direction)102 function InsertInvoice($Subject, $TimeCreation, $TimeDue, $Items, 103 $Group, $PeriodFrom, $PeriodTo) 104 104 { 105 105 global $LastInsertTime; 106 106 107 107 $Year = date('Y', $TimeCreation); 108 $BillCode = $this->System->Modules['Finance']->GetNextDocumentLineNumber ($Group['DocumentLine'], $Year);108 $BillCode = $this->System->Modules['Finance']->GetNextDocumentLineNumberId($Group['DocumentLine'], $Year); 109 109 $SumValue = 0; 110 110 foreach($Items as $Item) { … … 113 113 $this->Database->insert('FinanceInvoice', array( 114 114 'Subject' => $Subject, 'Time' => TimeToMysqlDateTime($TimeCreation), 115 'TimeDue' => TimeToMysqlDateTime($TimeDue), 'Value' => $SumValue ,116 ' ValueSign' => $ValueSign, 'BillCode' => $BillCode, 'Direction' => $Direction,115 'TimeDue' => TimeToMysqlDateTime($TimeDue), 'Value' => $SumValue * $Group['ValueSign'], 116 'BillCode' => $BillCode, 117 117 'PeriodFrom' => TimeToMysqlDate($PeriodFrom), 'PeriodTo' => TimeToMysqlDate($PeriodTo), 118 'Generate' => 1, 'Group' => $ FinanceGroup['Id']));118 'Generate' => 1, 'Group' => $Group['Id'])); 119 119 $InvoiceId = $this->Database->insert_id; 120 120 foreach($Items as $Item) … … 185 185 $Output .= $TimePeriodText.': '.$MonthlyTotal.' * '.$Period['MonthCount'].' = '.$PayPerPeriod.'<br />'; 186 186 $this->InsertInvoice($Member['Subject'], time(), time() + 3600 * 24 * INVOICE_DUE_DAYS, 187 $ FinanceGroup['ValueSign'], $InvoiceItems, $FinanceGroup, $Period['From'],188 $Period['To'], $FinanceGroup['Direction']);187 $InvoiceItems, $FinanceGroup, $Period['From'], 188 $Period['To']); 189 189 190 190 $Output .= $this->SendPaymentEmail($Member['Id']); … … 358 358 '<th style="border-style: solid; border-width: 1px; padding: 1px 5px 1px 5px; text-align: center; font-weight: bold;">Popis</th>'. 359 359 '<th style="border-style: solid; border-width: 1px; padding: 1px 5px 1px 5px; text-align: center; font-weight: bold;">Částka [Kč]</th></tr>'."\n"; 360 $DbResult = $this->Database->query('SELECT T1.* FROM ((SELECT `Text`, `Time`, (`Value`*`ValueSign`) AS`Value`, `File` FROM `FinanceOperation` WHERE (`Subject`='.$Member['Subject'].')) UNION ALL '.360 $DbResult = $this->Database->query('SELECT T1.* FROM ((SELECT `Text`, `Time`, `Value`, `File` FROM `FinanceOperation` WHERE (`Subject`='.$Member['Subject'].')) UNION ALL '. 361 361 '(SELECT (SELECT GROUP_CONCAT(`Description` SEPARATOR ", ") FROM `FinanceInvoiceItem` '. 362 362 'WHERE `FinanceInvoiceItem`.`FinanceInvoice` = `FinanceInvoice`.`Id`) AS `Text`, '. 363 '`Time`, - (`Value`*`ValueSign`) AS`Value`, `File` FROM `FinanceInvoice` WHERE (`Subject`='.363 '`Time`, -`Value`, `File` FROM `FinanceInvoice` WHERE (`Subject`='. 364 364 $Member['Subject'].')) ORDER BY `Time` DESC) AS `T1` WHERE (`T1`.`Time` > "'.$Member['BillingPeriodLastDate'].'")'); 365 365 while($DbRow = $DbResult->fetch_assoc())
Note:
See TracChangeset
for help on using the changeset viewer.