Changeset 873 for trunk/Modules/Finance/UserState.php
- Timestamp:
- Apr 6, 2020, 11:17:40 PM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Modules/Finance/UserState.php
r825 r873 44 44 $DbResult = $this->Database->query($Query); 45 45 $SumValue = 0; 46 while ($Row = $DbResult->fetch_assoc())46 while ($Row = $DbResult->fetch_assoc()) 47 47 { 48 48 $Row['State'] = round($Row['State'], 2); 49 if ($Row['State'] > 0) $Row['State'] = '<span style="color:green;">'.$Row['State'].'</span>';50 if ($Row['State'] < 0) $Row['State'] = '<span style="color:red;">'.$Row['State'].'</span>';51 if ($Row['Value'] == -0) $Row['Value'] = 0;52 if ($Row['Value'] > 0) $Row['Value'] = '+'.$Row['Value'];53 if ($Row['BillName'] == '') $Row['BillName'] = 'PDF';54 if ($Row['File'] > 0) $Invoice = '<a href="'.$this->System->Link('/file?id='.$Row['File']).'">'.$Row['BillName'].'</a>';49 if ($Row['State'] > 0) $Row['State'] = '<span style="color:green;">'.$Row['State'].'</span>'; 50 if ($Row['State'] < 0) $Row['State'] = '<span style="color:red;">'.$Row['State'].'</span>'; 51 if ($Row['Value'] == -0) $Row['Value'] = 0; 52 if ($Row['Value'] > 0) $Row['Value'] = '+'.$Row['Value']; 53 if ($Row['BillName'] == '') $Row['BillName'] = 'PDF'; 54 if ($Row['File'] > 0) $Invoice = '<a href="'.$this->System->Link('/file?id='.$Row['File']).'">'.$Row['BillName'].'</a>'; 55 55 else $Invoice = NotBlank($Row['BillName']); 56 if ($Row['PeriodFrom'] != '') $Period = HumanDate($Row['PeriodFrom']).' - '.HumanDate($Row['PeriodTo']);56 if ($Row['PeriodFrom'] != '') $Period = HumanDate($Row['PeriodFrom']).' - '.HumanDate($Row['PeriodTo']); 57 57 else $Period = ' '; 58 58 $Output .= '<tr><td style="text-align: right;">'.HumanDate($Row['Time']).'</td>'. … … 66 66 $Output .= '</table>'; 67 67 $Output .= $PageList['Output']; 68 return ($Output);68 return ($Output); 69 69 } 70 70 … … 75 75 76 76 // Determine which customer should be displayed 77 if (array_key_exists('i', $_GET))77 if (array_key_exists('i', $_GET)) 78 78 { 79 if (!$this->System->User->CheckPermission('Finance', 'Manage')) return('Nemáte oprávnění');79 if (!$this->System->User->CheckPermission('Finance', 'Manage')) return ('Nemáte oprávnění'); 80 80 $CustomerId = $_GET['i']; 81 81 } else 82 82 { 83 if (!$this->System->User->CheckPermission('Finance', 'DisplaySubjectState')) return('Nemáte oprávnění');83 if (!$this->System->User->CheckPermission('Finance', 'DisplaySubjectState')) return ('Nemáte oprávnění'); 84 84 $UserId = $this->System->User->User['Id']; 85 85 $DbResult = $this->Database->query('SELECT `Customer` FROM `UserCustomerRel` WHERE `User`='.$UserId.' LIMIT 1'); 86 if ($DbResult->num_rows > 0)86 if ($DbResult->num_rows > 0) 87 87 { 88 88 $CustomerUserRel = $DbResult->fetch_assoc(); 89 89 $CustomerId = $CustomerUserRel['Customer']; 90 } else return ($this->SystemMessage('Chyba', 'Nejste zákazníkem'));90 } else return ($this->SystemMessage('Chyba', 'Nejste zákazníkem')); 91 91 } 92 92 93 93 // Load customer info 94 94 $DbResult = $this->Database->query('SELECT * FROM `Member` WHERE `Id`='.$CustomerId); 95 if ($DbResult->num_rows == 1)95 if ($DbResult->num_rows == 1) 96 96 { 97 97 $Customer = $DbResult->fetch_assoc(); 98 } else return ($this->SystemMessage('Položka nenalezena', 'Zákazník nenalezen'));98 } else return ($this->SystemMessage('Položka nenalezena', 'Zákazník nenalezen')); 99 99 100 100 101 101 // Load subject info 102 102 $DbResult = $this->Database->query('SELECT * FROM `Subject` WHERE `Id`='.$Customer['Subject']); 103 if ($DbResult->num_rows == 1)103 if ($DbResult->num_rows == 1) 104 104 { 105 105 $Subject = $DbResult->fetch_assoc(); 106 } else return ($this->SystemMessage('Položka nenalezena', 'Subjekt nenalezen'));106 } else return ($this->SystemMessage('Položka nenalezena', 'Subjekt nenalezen')); 107 107 108 108 … … 141 141 'LEFT JOIN `Service` ON `Service`.`Id`=`ServiceCustomerRel`.`Service` '. 142 142 'WHERE (`ServiceCustomerRel`.`Customer`='.$Customer['Id'].') AND (`ServiceCustomerRel`.`ChangeAction` IS NULL)'); 143 while ($DbRow = $DbResult->fetch_assoc())143 while ($DbRow = $DbResult->fetch_assoc()) 144 144 { 145 145 $Output .= '<tr><td>'.$DbRow['Name'].'</td><td>'.$DbRow['Price'].'</td></tr>'; … … 152 152 153 153 $Output .= '</td></tr></table>'; 154 return ($Output);154 return ($Output); 155 155 } 156 156 }
Note:
See TracChangeset
for help on using the changeset viewer.