Changeset 873 for trunk/Application/UpdateTrace.php
- Timestamp:
- Apr 6, 2020, 11:17:40 PM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Application/UpdateTrace.php
r870 r873 203 203 $ServiceCategoryHire = $Manager->Database->insert_id; 204 204 $DbResult = $Manager->Execute("SELECT * FROM Member WHERE Hire>0"); 205 while ($Member = $DbResult->fetch_assoc())205 while ($Member = $DbResult->fetch_assoc()) 206 206 { 207 207 $Manager->Execute("INSERT INTO `Service` ( … … 308 308 // Set all string collation to utf8 general 309 309 $DbResult = $Manager->Execute("SHOW TABLES"); 310 while ($DbRow = $DbResult->fetch_row())310 while ($DbRow = $DbResult->fetch_row()) 311 311 { 312 312 $Manager->Execute("ALTER TABLE `".$DbRow[0]."` CONVERT TO CHARACTER SET utf8"); … … 871 871 $ActionId = $Manager->Database->insert_id; 872 872 $DbResult = $Manager->Execute('SELECT `Id` FROM `MenuItem` WHERE `Name`="Nabídky"'); 873 if ($DbResult->num_rows > 0)873 if ($DbResult->num_rows > 0) 874 874 { 875 875 $DbRow = $DbResult->fetch_assoc(); … … 889 889 // Convert monthly plus payment for consumption to regular service 890 890 $DbResult = $Manager->Execute('SELECT `MonthlyPlus`, `Member` FROM `MemberPayment` WHERE `MonthlyPlus` > 0'); 891 while ($DbRow = $DbResult->fetch_assoc)891 while ($DbRow = $DbResult->fetch_assoc) 892 892 { 893 893 $Manager->Execute("INSERT INTO `Service` (`Id` ,`Name` ,`Category` ,`Price` ,`VAT`) ". … … 987 987 $ActionId = $Manager->Database->insert_id; 988 988 $DbResult = $Manager->Execute('SELECT `Id` FROM `MenuItem` WHERE `Name`="Sklad"'); 989 if ($DbResult->num_rows > 0)989 if ($DbResult->num_rows > 0) 990 990 { 991 991 $DbRow = $DbResult->fetch_assoc(); … … 1025 1025 $ActionId = $Manager->Database->insert_id; 1026 1026 $DbResult = $Manager->Execute('SELECT `Id` FROM `MenuItem` WHERE `Name`="Finance"'); 1027 if ($DbResult->num_rows > 0)1027 if ($DbResult->num_rows > 0) 1028 1028 { 1029 1029 $DbRow = $DbResult->fetch_assoc(); … … 1047 1047 // IS menu item 1048 1048 $DbResult = $Manager->Execute('SELECT `Id` FROM `MenuItem` WHERE `Name`="Příjmy a výdaje"'); 1049 if ($DbResult->num_rows > 0)1049 if ($DbResult->num_rows > 0) 1050 1050 { 1051 1051 $DbRow = $DbResult->fetch_assoc(); … … 1089 1089 // IS menu item 1090 1090 $DbResult = $Manager->Execute('SELECT `Id` FROM `MenuItem` WHERE `Name`="Závazky a pohledávky"'); 1091 if ($DbResult->num_rows > 0)1091 if ($DbResult->num_rows > 0) 1092 1092 { 1093 1093 $DbRow = $DbResult->fetch_assoc(); … … 1120 1120 $SearchText = 'Připojení k síti'; 1121 1121 $DbResult = $Manager->Execute('SELECT * FROM `FinanceInvoiceItem` WHERE `Description` LIKE "'.$SearchText.' za období%";'); 1122 while ($DbRow = $DbResult->fetch_assoc())1122 while ($DbRow = $DbResult->fetch_assoc()) 1123 1123 { 1124 1124 $Text = trim(substr($DbRow['Description'], strlen($SearchText.' za období') + 1)); … … 1134 1134 $SearchText = 'Připojení k Internetu'; 1135 1135 $DbResult = $Manager->Execute('SELECT * FROM `FinanceInvoiceItem` WHERE `Description` LIKE "'.$SearchText.' za období%";'); 1136 while ($DbRow = $DbResult->fetch_assoc())1136 while ($DbRow = $DbResult->fetch_assoc()) 1137 1137 { 1138 1138 $Text = trim(substr($DbRow['Description'], strlen($SearchText.' za období') + 1)); … … 1141 1141 $PeriodFrom = $PeriodFrom[2].'-'.$PeriodFrom[1].'-'.$PeriodFrom[0]; 1142 1142 $Text[1] = trim($Text[1]); 1143 if (strpos($Text[1], ' ') !== false) $Text[1] = substr($Text[1], 0, strpos($Text[1], ' '));1143 if (strpos($Text[1], ' ') !== false) $Text[1] = substr($Text[1], 0, strpos($Text[1], ' ')); 1144 1144 $PeriodTo = explode('.', trim($Text[1])); 1145 1145 $PeriodTo = $PeriodTo[2].'-'.$PeriodTo[1].'-'.$PeriodTo[0]; … … 1199 1199 $ActionId = $Manager->Database->insert_id; 1200 1200 $DbResult = $Manager->Execute('SELECT `Id` FROM `MenuItem` WHERE `Name`="Systém"'); 1201 if ($DbResult->num_rows > 0)1201 if ($DbResult->num_rows > 0) 1202 1202 { 1203 1203 $DbRow = $DbResult->fetch_assoc(); … … 1250 1250 $ActionId = $Manager->Database->insert_id; 1251 1251 $DbResult = $Manager->Execute('SELECT `Id` FROM `MenuItem` WHERE `Name`="Síť"'); 1252 if ($DbResult->num_rows > 0)1252 if ($DbResult->num_rows > 0) 1253 1253 { 1254 1254 $DbRow = $DbResult->fetch_assoc(); … … 1457 1457 'LEFT JOIN `FinanceOperationGroup` ON `FinanceOperationGroup`.`Id` = `FinanceOperation`.`Group` '. 1458 1458 'WHERE `FinanceOperation`.`BillCodeText`!=""'); 1459 while ($DbRow = $DbResult->fetch_assoc())1459 while ($DbRow = $DbResult->fetch_assoc()) 1460 1460 { 1461 if ($DbRow['DocumentLine'] == '') $DbRow['DocumentLine'] = 'NULL';1461 if ($DbRow['DocumentLine'] == '') $DbRow['DocumentLine'] = 'NULL'; 1462 1462 $Manager->Execute('INSERT INTO `DocumentLineCode` (`Id` ,`DocumentLine` ,`Name`) '. 1463 1463 'VALUES (NULL , '.$DbRow['DocumentLine'].', "'.$DbRow['BillCodeText'].'");'); … … 1475 1475 'LEFT JOIN `FinanceInvoiceGroup` ON `FinanceInvoiceGroup`.`Id` = `FinanceInvoice`.`Group` '. 1476 1476 'WHERE `FinanceInvoice`.`BillCodeText`!=""'); 1477 while ($DbRow = $DbResult->fetch_assoc())1477 while ($DbRow = $DbResult->fetch_assoc()) 1478 1478 { 1479 if ($DbRow['DocumentLine'] == '') $DbRow['DocumentLine'] = 'NULL';1479 if ($DbRow['DocumentLine'] == '') $DbRow['DocumentLine'] = 'NULL'; 1480 1480 $Manager->Execute('INSERT INTO `DocumentLineCode` (`Id` ,`DocumentLine` ,`Name`) '. 1481 1481 'VALUES (NULL , '.$DbRow['DocumentLine'].', "'.$DbRow['BillCodeText'].'");'); … … 1512 1512 { 1513 1513 $DbResult = $Manager->Database->query('SELECT * FROM (SELECT `FinanceInvoice`.`Id`, ((SELECT SUM(`Price` * `Quantity`) FROM `FinanceInvoiceItem` WHERE `FinanceInvoiceItem`.`FinanceInvoice`=`FinanceInvoice`.`Id`) * `FinanceInvoiceGroup`.`ValueSign`) AS `Sum`,`FinanceInvoice`.`Value` FROM `FinanceInvoice` LEFT JOIN `FinanceInvoiceGroup` ON `FinanceInvoiceGroup`.`Id`=`FinanceInvoice`.`Group`) AS `T` WHERE `Sum` != `Value`'); 1514 while ($DbRow = $DbResult->fetch_assoc())1514 while ($DbRow = $DbResult->fetch_assoc()) 1515 1515 { 1516 1516 $Manager->Database->query('UPDATE `FinanceInvoiceItem` SET `Price` = -`Price` WHERE `FinanceInvoice`='.$DbRow['Id']); … … 1624 1624 $ActionId = $Manager->Database->insert_id; 1625 1625 $DbResult = $Manager->Execute('SELECT `Id` FROM `MenuItem` WHERE `Name`="Zákazníci"'); 1626 if ($DbResult->num_rows > 0)1626 if ($DbResult->num_rows > 0) 1627 1627 { 1628 1628 $DbRow = $DbResult->fetch_assoc(); … … 1812 1812 'FROM `Contract` '. 1813 1813 'WHERE `Contract`.`BillCodeText`!=""'); 1814 while ($DbRow = $DbResult->fetch_assoc())1814 while ($DbRow = $DbResult->fetch_assoc()) 1815 1815 { 1816 if ($DbRow['DocumentLine'] == '') $DbRow['DocumentLine'] = 'NULL';1816 if ($DbRow['DocumentLine'] == '') $DbRow['DocumentLine'] = 'NULL'; 1817 1817 $Manager->Execute('INSERT INTO `DocumentLineCode` (`Id` ,`DocumentLine` ,`Name`) '. 1818 1818 'VALUES (NULL , '.$DbRow['DocumentLine'].', "'.$DbRow['BillCodeText'].'");'); … … 1877 1877 'LEFT JOIN `StockMoveGroup` ON `StockMoveGroup`.`Id` = `StockMove`.`Group` '. 1878 1878 'WHERE `StockMove`.`BillCodeText`!=""'); 1879 while ($DbRow = $DbResult->fetch_assoc())1879 while ($DbRow = $DbResult->fetch_assoc()) 1880 1880 { 1881 if ($DbRow['DocumentLine'] == '') $DbRow['DocumentLine'] = 'NULL';1881 if ($DbRow['DocumentLine'] == '') $DbRow['DocumentLine'] = 'NULL'; 1882 1882 $Manager->Execute('INSERT INTO `DocumentLineCode` (`Id` ,`DocumentLine` ,`Name`) '. 1883 1883 'VALUES (NULL , '.$DbRow['DocumentLine'].', "'.$DbRow['BillCodeText'].'");'); … … 1940 1940 $ActionId = $Manager->Database->insert_id; 1941 1941 $DbResult = $Manager->Execute('SELECT `Id` FROM `MenuItem` WHERE `Name`="Pokladny"'); 1942 if ($DbResult->num_rows > 0)1942 if ($DbResult->num_rows > 0) 1943 1943 { 1944 1944 $DbRow = $DbResult->fetch_assoc(); … … 2096 2096 $ActionId = $Manager->Database->insert_id; 2097 2097 $DbResult = $Manager->Execute('SELECT `Id` FROM `MenuItem` WHERE `Name`="Síť"'); 2098 if ($DbResult->num_rows > 0)2098 if ($DbResult->num_rows > 0) 2099 2099 { 2100 2100 $DbRow = $DbResult->fetch_assoc(); … … 2115 2115 function Get() 2116 2116 { 2117 return (array(2117 return (array( 2118 2118 491 => array('Revision' => 493, 'Function' => 'UpdateTo493'), 2119 2119 493 => array('Revision' => 494, 'Function' => 'UpdateTo494'),
Note:
See TracChangeset
for help on using the changeset viewer.