Changeset 873 for trunk/Modules/Finance/Trade.php
- Timestamp:
- Apr 6, 2020, 11:17:40 PM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Modules/Finance/Trade.php
r847 r873 65 65 $Row = $DbResult->fetch_array(); 66 66 $Balance['SmallAssets']['End'] = $Row[0] + 0; 67 return ($Balance);67 return ($Balance); 68 68 } 69 69 … … 77 77 $StartYear = date('Y', $this->StartEvidence); 78 78 $EndYear = date('Y', time()); 79 for ($Year = $StartYear; $Year <= $EndYear; $Year++)79 for ($Year = $StartYear; $Year <= $EndYear; $Year++) 80 80 { 81 81 $EndTime = mktime(0, 0, 0, 12, 31, $Year); 82 82 //$Year = date('Y', $EndTime); 83 83 $StartTime = mktime(0, 0, 0, 1, 1, $Year); 84 if ($StartTime < $this->StartEvidence) $StartTime = $this->StartEvidence;84 if ($StartTime < $this->StartEvidence) $StartTime = $this->StartEvidence; 85 85 86 86 $Balance = $this->GetTimePeriodBalance($StartTime, $EndTime); … … 113 113 $StartYear = date('Y', $this->StartEvidence); 114 114 $EndYear = date('Y', time()); 115 for ($Year = $StartYear; $Year <= $EndYear; $Year++)116 { 117 for ($Month = 1; $Month <= 12; $Month++)115 for ($Year = $StartYear; $Year <= $EndYear; $Year++) 116 { 117 for ($Month = 1; $Month <= 12; $Month++) 118 118 { 119 119 $EndTime = mktime(0, 0, 0, $Month, 31, $Year); 120 120 //$Year = date('Y', $EndTime); 121 121 $StartTime = mktime(0, 0, 0, $Month, 1, $Year); 122 if (($StartTime < time()) and ($EndTime > $this->StartEvidence))122 if (($StartTime < time()) and ($EndTime > $this->StartEvidence)) 123 123 { 124 if ($StartTime < $this->StartEvidence) $StartTime = $this->StartEvidence;124 if ($StartTime < $this->StartEvidence) $StartTime = $this->StartEvidence; 125 125 126 126 $Balance = $this->GetTimePeriodBalance($StartTime, $EndTime); … … 164 164 'WHERE (`ValueSign` = 1) AND (`FinanceOperation`.`Time` >= "'.$Year['DateStart'].'") '. 165 165 'AND (`FinanceOperation`.`Time` <= "'.$Year['DateEnd'].'") ORDER BY `Time`'); 166 while ($Row = $DbResult->fetch_array())166 while ($Row = $DbResult->fetch_array()) 167 167 { 168 168 $Row['Time'] = explode(' ', $Row['Time']); … … 204 204 'WHERE (`FinanceOperationGroup`.`ValueSign` = -1) AND (`FinanceOperation`.`Time` >= "'.$Year['DateStart'].'") '. 205 205 'AND (`FinanceOperation`.`Time` <= "'.$Year['DateEnd'].'") ORDER BY `Time`'); 206 while ($Row = $DbResult->fetch_array())206 while ($Row = $DbResult->fetch_array()) 207 207 { 208 208 $Row['Time'] = explode(' ', $Row['Time']); … … 245 245 'WHERE (`FinanceInvoiceGroup`.`ValueSign` = 1) AND (`FinanceInvoice`.`Time` >= "'.$Year['DateStart']. 246 246 '") AND (`FinanceInvoice`.`Time` <= "'.$Year['DateEnd'].'") ORDER BY `Time`'); 247 while ($Row = $DbResult->fetch_array())248 { 249 if ($Row['TimePayment'] == '0000-00-00 00:00:00') $Row['TimePayment'] = ' ';247 while ($Row = $DbResult->fetch_array()) 248 { 249 if ($Row['TimePayment'] == '0000-00-00 00:00:00') $Row['TimePayment'] = ' '; 250 250 $Output .= '<tr><td>'.HumanDate($Row['Time']).'</td><td>'.$Row['BillName']. 251 251 '</td><td>'.$Row['SubjectName'].'</td><td>'.$Row['Text'].'</td><td>'.$Row['Value'].'</td></tr>'; … … 276 276 'WHERE (`FinanceInvoiceGroup`.`ValueSign` = -1) AND (`FinanceInvoice`.`Time` >= "'.$Year['DateStart']. 277 277 '") AND (FinanceInvoice.Time <= "'.$Year['DateEnd'].'") ORDER BY Time'); 278 while ($Row = $DbResult->fetch_array())279 { 280 if ($Row['TimePayment'] == '0000-00-00 00:00:00') $Row['TimePayment'] = ' ';278 while ($Row = $DbResult->fetch_array()) 279 { 280 if ($Row['TimePayment'] == '0000-00-00 00:00:00') $Row['TimePayment'] = ' '; 281 281 $Row['Value'] = $Row['Value'] * $Row['ValueSign']; 282 282 $Output .= '<tr><td>'.HumanDate($Row['Time']).'</td><td>'.$Row['BillName']. … … 314 314 'WHERE (T6.Subject = Subject.Id) AND (`FinanceOperationGroup`.`ValueSign` = -1)) AS `Spends` '. 315 315 'FROM Subject ORDER BY Name'); 316 while ($Row = $DbResult->fetch_assoc())316 while ($Row = $DbResult->fetch_assoc()) 317 317 { 318 318 $Output .= '<tr><td style="text-align: left;"><a href="?table=SubjectAccount&Id='.$Row['Id'].'">'.$Row['Name'].'</a></td><td>'.$Row['Liabilities'].' / '.$Row['OpenedLiabilities'].'</td><td>'.$Row['Claims'].' / '.$Row['OpenedClaims'].'</td><td>'.$Row['Gains'].'</td><td>'.$Row['Spends'].'</td><td>'.($Row['Gains'] - $Row['Spends'] - $Row['Claims'] + $Row['Liabilities']).'</td><td>'.$Row['Cash'].'</td></tr>'; … … 330 330 'FROM StockSerialNumber JOIN Product ON Product.Id = StockSerialNumber.Product '. 331 331 'WHERE (TimeElimination IS NOT NULL)'); 332 while ($Row = $DbResult->fetch_array())332 while ($Row = $DbResult->fetch_array()) 333 333 { 334 334 $Output .= '<tr><td>'.$Row['Name'].'</td><td>'.$Row['Price'].'</td><td>'.$Row['TimeEnlistment'].'</td><td>'.$Row['TimeElimination'].'</td></tr>'; … … 349 349 'LEFT JOIN `FinanceOperationGroup` ON `FinanceOperationGroup`.`Id` = `FinanceOperation`.`Group` '. 350 350 'WHERE `Subject`='.$_GET['Id'].' ORDER BY `Time`'); 351 while ($Row = $DbResult->fetch_array())351 while ($Row = $DbResult->fetch_array()) 352 352 { 353 353 $Output .= '<tr><td>'.HumanDate($Row['Time']).'</td><td>'.$Row['Text']. … … 364 364 'LEFT JOIN `DocumentLineCode` ON `DocumentLineCode`.`Id` = `FinanceInvoice`.`BillCode` '. 365 365 'WHERE `Subject`='.$_GET['Id'].' ORDER BY `Time`'); 366 while ($Row = $DbResult->fetch_array())366 while ($Row = $DbResult->fetch_array()) 367 367 { 368 368 $Output .= '<tr><td>'.HumanDate($Row['Time']).'</td><td>'.HumanDate($Row['TimePayment']). … … 375 375 $Output .= '<tr><th>Datum vytvoření</th><th>Datum zaplacení</th><th>Název</th><th>Hodnota [Kč]</th></tr>'; 376 376 $DbResult = $this->Database->select('FinanceAdvances', '*', 'Subject='.$_GET['Id']); 377 while ($Row = $DbResult->fetch_array())377 while ($Row = $DbResult->fetch_array()) 378 378 { 379 379 $Output .= '<tr><td>'.$Row['Time'].'</td><td>'.$Row['TimePass'].'</td><td>'.$Row['ValueSign'].'</td><td>'.($Row['Value']).'</td><td>'.$Row['CashFlowId'].'</td></tr>'; … … 411 411 $Output .= '<strong>Roční přehledy</strong><br/>'; 412 412 $Output .= $this->ShowFinanceYears(); 413 if (array_key_exists('year', $_GET))413 if (array_key_exists('year', $_GET)) 414 414 { 415 415 $Year = $_GET['year'] * 1; … … 426 426 function Show() 427 427 { 428 if (!$this->System->User->CheckPermission('Finance', 'TradingStatus'))429 return ('Nemáte oprávnění');428 if (!$this->System->User->CheckPermission('Finance', 'TradingStatus')) 429 return ('Nemáte oprávnění'); 430 430 431 431 $Finance = &$this->System->Modules['Finance']; 432 432 433 433 $Output = ''; 434 if (!array_key_exists('table', $_GET)) $_GET['table'] = '';435 switch ($_GET['table'])434 if (!array_key_exists('table', $_GET)) $_GET['table'] = ''; 435 switch ($_GET['table']) 436 436 { 437 437 case 'AnnualBalance': … … 478 478 $Output = $this->ShowDefault(); 479 479 } 480 return ($Output);480 return ($Output); 481 481 } 482 482 … … 485 485 $Output = 'Roky: '; 486 486 $DbRows = $this->Database->select('FinanceYear', '*'); 487 while ($DbRow = $DbRows->fetch_assoc())487 while ($DbRow = $DbRows->fetch_assoc()) 488 488 $Output .= '<a href="?year='.$DbRow['Id'].'">'.$DbRow['Year'].'</a> '; 489 489 $Output .= '<br/>'; 490 return ($Output);490 return ($Output); 491 491 } 492 492
Note:
See TracChangeset
for help on using the changeset viewer.