Ignore:
Timestamp:
Mar 24, 2009, 11:44:03 AM (15 years ago)
Author:
george
Message:
  • Přidáno: Stránka pro rozeslání emailů s počátečními hesly.
  • Upraveno: Konfigurační skripty pro nastavení síťových zařízení se systémem RouterOS doplněny o podporu zápisu konfigurace do více samostatných zařízení. Změna se týká konfigurace DHCP serveru a sledování net_watch.
  • Opraveno: Některé nefunkční odkazy na hlavní stránce.
  • Upraveno: Tabulka finance_operations nově převedena na tabulky FinanceOperation a FinanceClaimsLiabilities. Upraveny související stránky.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • www/finance/prepocet.php

    r164 r167  
    1111    $Finance = &$this->System->Modules['Finance'];
    1212    $Output = 'Aktualizuju finance uživatelů...<br />';
    13         $this->Database->query('TRUNCATE TABLE MemberPayment');
     13          $this->Database->query('TRUNCATE TABLE MemberPayment');
    1414    $DbResult = $this->Database->query('SELECT * FROM Member');
    1515    while($Member = $DbResult->fetch_assoc())
    1616    {
    17       $DbResult2 = $this->Database->query('SELECT ((SELECT COALESCE(SUM(Value), 0) FROM FinanceCashFlow WHERE Subject='.$Member['Subject'].') + (SELECT COALESCE(SUM(-Value), 0) FROM FinanceClaimsLiabilities WHERE Subject='.$Member['Subject'].')) as Cash');
     17      $DbResult2 = $this->Database->query('SELECT ((SELECT COALESCE(SUM(Value), 0) FROM FinanceOperation WHERE Subject='.$Member['Subject'].') + (SELECT COALESCE(SUM(-Value), 0) FROM FinanceClaimsLiabilities WHERE Subject='.$Member['Subject'].')) as Cash');
    1818      $Cash = $DbResult2->fetch_row();
    19           $Cash = $Cash[0];
     19            $Cash = $Cash[0];
    2020         
    2121      $DbResult2 = $this->Database->query('SELECT SUM(consumption) FROM network_devices WHERE user='.$Member['Id'].' AND used=1');
    2222      $ConsumptionPlus = $DbResult2->fetch_row();
    23           $ConsumptionPlus = $ConsumptionPlus[0];
     23            $ConsumptionPlus = $ConsumptionPlus[0];
    2424
    2525      $NetworkDevice = 0;
     
    3939      $MonthlyInet = $Finance->Tarify[$Member['InternetTariffNextMonth']]['price'];
    4040      //if($Row['inet'] == 1)
    41           $Monthly += $MonthlyInet;
     41            $Monthly += $MonthlyInet;
    4242      $Monthly -= $Finance->W2Kc($ConsumptionPlus);
    4343      //if($Row['overheads'] == 1) $Monthly += $Sprava; // + W2Kc($Consumption);
     
    196196          $BillCode = $Finance->GetNextDocumentLineNumber(6); // Faktury vydané
    197197          $BillId = $this->System->Modules['Bill']->CreateBill($User['Id'], array(array('Description' => 'Připojení k síti', 'Price' => $PayPerPeriod, 'Quantity' => 1)), $PeriodFrom, $PeriodTo, $BillCode);
    198           $this->Database->insert('finance_operations', array('money' => -$PayPerPeriod, 'user' => $User['Id'], 'type' => 2, 'date' => 'NOW()', 'comment' => 'Připojení k síti za období '.$TimePeriodText, 'group' => 1, 'bill_id' => $BillId, 'BillCode' => $BillCode));
     198          $this->Database->insert('FinanceClaimsLiabilities', array('Value' => $PayPerPeriod, 'Subject' => $User['Id'], 'TimeCreation' => 'NOW()', 'Text' => 'Připojení k síti za období '.$TimePeriodText, 'Bill' => $BillId, 'BillCode' => $BillCode));
    199199        } else $Output .= ("<br />");
    200200      }
Note: See TracChangeset for help on using the changeset viewer.