Changeset 726 for trunk/Modules/Finance/Finance.php
- Timestamp:
- Jan 5, 2015, 10:01:40 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Modules/Finance/Finance.php
r725 r726 46 46 47 47 // Period parameter is not used as it have to be determined from item replacement 48 $DbResult = $this->Database->query('SELECT * FROM `FinanceCharge` WHERE `ReplaceId` IS NULLLIMIT 1');48 $DbResult = $this->Database->query('SELECT * FROM `FinanceCharge` WHERE (`ChangeAction` IS NULL) LIMIT 1'); 49 49 $Row = $DbResult->fetch_array(); 50 50 $this->kWh = $Row['kWh']; … … 115 115 while($Member = $DbResult->fetch_assoc()) 116 116 { 117 $DbResult2 = $this->Database->query('SELECT ((SELECT COALESCE( -SUM(Value*Direction), 0) FROM FinanceOperation '.118 'WHERE Subject='.$Member['Subject'].') + (SELECT COALESCE(-SUM(Value*Direction), 0) FROM FinanceInvoice '.117 $DbResult2 = $this->Database->query('SELECT ((SELECT COALESCE(SUM(Value*Direction), 0) FROM FinanceOperation '. 118 'WHERE Subject='.$Member['Subject'].') - (SELECT COALESCE(SUM(Value*Direction), 0) FROM FinanceInvoice '. 119 119 'WHERE Subject='.$Member['Subject'].')) AS Cash'); 120 120 $Cash = $DbResult2->fetch_row(); … … 129 129 $DbResult2 = $this->Database->query('SELECT SUM(`Service`.`Price`) AS `Price` '. 130 130 'FROM `ServiceCustomerRel` LEFT JOIN '. 131 '`Service` ON `Service`.`Id` = `ServiceCustomerRel`.`Service` WHERE `ServiceCustomerRel`.`Customer`='.132 $Member['Id'].' AND `ServiceCustomerRel`.`Action` IS NULL');131 '`Service` ON `Service`.`Id` = `ServiceCustomerRel`.`Service` WHERE (`ServiceCustomerRel`.`Customer`='. 132 $Member['Id'].') AND (`ServiceCustomerRel`.`ChangeAction` IS NULL)'); 133 133 $DbRow = $DbResult2->fetch_assoc(); 134 134 $Monthly = 0; … … 149 149 } 150 150 $this->Database->insert('MemberPayment', array('Member' => $Member['Id'], 151 ' NetworkDevice' => $NetworkDevice, 'MonthlyInternet' => $MonthlyInet,151 'MonthlyInternet' => $MonthlyInet, 152 152 'MonthlyTotal' => $Monthly, 'MonthlyConsumption' => $this->W2Kc($Consumption), 153 153 'Cash' => $Cash, 'MonthlyPlus' => $this->W2Kc($ConsumptionPlus))); … … 430 430 'BaseTariffPrice' => array('Type' => 'Integer', 'Caption' => 'Základní cena tarifu', 'Default' => '0', 'Suffix' => 'Kč'), 431 431 'TopTariffPrice' => array('Type' => 'Integer', 'Caption' => 'Nejvyšší cena tarifu', 'Default' => '0', 'Suffix' => 'Kč'), 432 'Action' => array('Type' => 'TActionEnum', 'Caption' => 'Změna období', 'Default' => '', 'Null' => true), 433 'ReplaceId' => array('Type' => 'TFinanceCharge', 'Caption' => 'Cílová položka', 'Default' => '0', 'Null' => true), 432 'ChangeAction' => array('Type' => 'TActionEnum', 'Caption' => 'Změna - akce', 'Default' => '', 'Null' => true), 433 'ChangeTime' => array('Type' => 'DateTime', 'Caption' => 'Změna - čas', 'Default' => '', 'Null' => true), 434 'ChangeReplaceId' => array('Type' => 'TFinanceCharge', 'Caption' => 'Změna - položka', 'Default' => '0', 'Null' => true), 434 435 ), 435 436 ));
Note:
See TracChangeset
for help on using the changeset viewer.