Changeset 901 for trunk/Modules/Finance/UserState.php
- Timestamp:
- Feb 17, 2021, 9:27:32 PM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Modules/Finance/UserState.php
r888 r901 11 11 } 12 12 13 function ShowFinanceOperation(int $Subject ): string13 function ShowFinanceOperation(int $SubjectId): string 14 14 { 15 $UserOperationTableQuery = '((SELECT `Text`, ` Time`, `Value`, `File`, `BillCode`, NULL AS `PeriodFrom`, NULL AS `PeriodTo`, `DocumentLineCode`.`Name` AS `BillName` '.15 $UserOperationTableQuery = '((SELECT `Text`, `FinanceOperation`.`Time`, `Value`, `File`.`Hash` AS `FileHash`, `BillCode`, NULL AS `PeriodFrom`, NULL AS `PeriodTo`, `DocumentLineCode`.`Name` AS `BillName` '. 16 16 'FROM `FinanceOperation` '. 17 17 'LEFT JOIN `DocumentLineCode` ON `DocumentLineCode`.`Id`=`FinanceOperation`.`BillCode` '. 18 'WHERE (`Subject`='.$Subject['Id'].') '. 18 'LEFT JOIN `File` ON `File`.`Id`=`FinanceOperation`.`File` '. 19 'WHERE (`Subject`='.$SubjectId.') '. 19 20 ') UNION ALL '. 20 21 '(SELECT (SELECT GROUP_CONCAT(`Description` SEPARATOR ",") FROM `FinanceInvoiceItem` WHERE `FinanceInvoice`=`FinanceInvoice`.`Id`) AS `Text`, '. 21 '`Time`, -`Value`, `File`, `BillCode`, `PeriodFrom`, `PeriodTo`, `DocumentLineCode`.`Name` AS `BillName` FROM `FinanceInvoice` '. 22 '`FinanceInvoice`.`Time`, -`Value`, `File`.`Hash` AS `FileHash`, `BillCode`, `PeriodFrom`, `PeriodTo`, `DocumentLineCode`.`Name` AS `BillName` '. 23 'FROM `FinanceInvoice` '. 22 24 'LEFT JOIN `DocumentLineCode` ON `DocumentLineCode`.`Id`=`FinanceInvoice`.`BillCode` '. 23 'WHERE (`Subject`='.$Subject['Id'].') AND (`VisibleToUser` = 1)))'; 25 'LEFT JOIN `File` ON `File`.`Id`=`FinanceInvoice`.`File` '. 26 'WHERE (`Subject`='.$SubjectId.') AND (`VisibleToUser` = 1)))'; 24 27 25 28 $Output = '<div style="text-align:center">Výpis finančních operací</div>'; … … 56 59 if ($Row['Value'] > 0) $Row['Value'] = '+'.$Row['Value']; 57 60 if ($Row['BillName'] == '') $Row['BillName'] = 'PDF'; 58 if ($Row['File '] > 0) $Invoice = '<a href="'.$this->System->Link('/file?id='.$Row['File']).'">'.$Row['BillName'].'</a>';61 if ($Row['FileHash'] != '') $Invoice = '<a href="'.$this->System->Link('/file?h='.$Row['FileHash']).'">'.$Row['BillName'].'</a>'; 59 62 else $Invoice = NotBlank($Row['BillName']); 60 63 if ($Row['PeriodFrom'] != '') $Period = HumanDate($Row['PeriodFrom']).' - '.HumanDate($Row['PeriodTo']); … … 102 105 } else return $this->SystemMessage('Položka nenalezena', 'Zákazník nenalezen'); 103 106 104 105 107 // Load subject info 106 108 $DbResult = $this->Database->query('SELECT * FROM `Subject` WHERE `Id`='.$Customer['Subject']); … … 109 111 $Subject = $DbResult->fetch_assoc(); 110 112 } else return $this->SystemMessage('Položka nenalezena', 'Subjekt nenalezen'); 111 112 113 113 114 $Output = '<table width="100%" border="0" cellspacing="0" cellpadding="3"><tr><td valign="top">'; … … 124 125 125 126 // Tabulka operaci 126 $Output .= $this->ShowFinanceOperation($Subject );127 $Output .= $this->ShowFinanceOperation($Subject['Id']); 127 128 128 129 $Output .= '</td><td valign="top">';
Note:
See TracChangeset
for help on using the changeset viewer.