Ignore:
Timestamp:
Apr 6, 2020, 11:17:40 PM (4 years ago)
Author:
chronos
Message:
  • Modified: Improved code format.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Modules/FinanceBankAPI/FileImport.php

    r765 r873  
    2626  {
    2727    $DbResult = $this->Database->select('FinanceBankImport', '*', 'FinanceOperation IS NULL');
    28     while($DbRow = $DbResult->fetch_assoc())
     28    while ($DbRow = $DbResult->fetch_assoc())
    2929    {
    30       if(is_numeric($DbRow['VariableSymbol']))
     30      if (is_numeric($DbRow['VariableSymbol']))
    3131      {
    3232        $DbResult2 = $this->Database->select('Subject', 'Id', 'Id='.$DbRow['VariableSymbol']);
    33         if($DbResult2->num_rows == 1)
     33        if ($DbResult2->num_rows == 1)
    3434        {
    3535          $DbRow2 = $DbResult2->fetch_assoc();
    36           if($DbRow['Value'] >= 0) {
     36          if ($DbRow['Value'] >= 0) {
    3737            $FinanceGroup = $this->System->Modules['Finance']->GetFinanceGroupById(OPERATION_GROUP_ACCOUNT_IN, 'FinanceOperationGroup');
    3838          } else {
     
    5151          $Form->SetClass('FinanceOperation');
    5252          $Form->LoadValuesFromDatabase($Id);
    53           if(array_key_exists('AfterInsert', $Form->Definition))
     53          if (array_key_exists('AfterInsert', $Form->Definition))
    5454          {
    5555            $Class = $Form->Definition['AfterInsert'][0];
     
    8080    $Output .= 'Účet: '.$BankAccount['Number'].'/'.$Bank['Code'].' ('.$Bank['Name'].')'."\n";
    8181
    82     if($Bank['Code'] == '2010') $Import = new ImportFio($this->System);
    83       else if($Bank['Code'] == '0300') $Import = new ImportPS($this->System);
     82    if ($Bank['Code'] == '2010') $Import = new ImportFio($this->System);
     83      else if ($Bank['Code'] == '0300') $Import = new ImportPS($this->System);
    8484      else $Output = $this->SystemMessage('Nepodporované API', 'Pro zvolenou banku není import podporován');
    85     if(isset($Import))
     85    if (isset($Import))
    8686    {
    8787      $Import->BankAccount = $BankAccount;
     
    8989      $Import->PairOperations();
    9090    }
    91     return($Output);
     91    return ($Output);
    9292  }
    9393
    9494  function Show()
    9595  {
    96     if(!$this->System->User->CheckPermission('Finance', 'SubjectList'))
    97       return('Nemáte oprávnění');
     96    if (!$this->System->User->CheckPermission('Finance', 'SubjectList'))
     97      return ('Nemáte oprávnění');
    9898
    9999    $Output = $this->Import($_GET['i']);
    100     return($Output);
     100    return ($Output);
    101101  }
    102102}
     
    111111  {
    112112    $Output = '';
    113     if(!$this->System->User->CheckPermission('Finance', 'SubjectList')) return('Nemáte oprávnění');
    114     if(array_key_exists('Operation', $_GET))
     113    if (!$this->System->User->CheckPermission('Finance', 'SubjectList')) return ('Nemáte oprávnění');
     114    if (array_key_exists('Operation', $_GET))
    115115    {
    116       if($_GET['Operation'] == 'prepare') $Output .= $this->Prepare();
    117       else if($_GET['Operation'] == 'insert') $Output .= $this->Insert();
     116      if ($_GET['Operation'] == 'prepare') $Output .= $this->Prepare();
     117      else if ($_GET['Operation'] == 'insert') $Output .= $this->Insert();
    118118      else $Output .= 'Neplatná akce';
    119119    } else $Output .= $this->ShowForm();
    120     return($Output);
     120    return ($Output);
    121121  }
    122122
     
    128128    $Form->Values['BankAccount'] = $_GET['id'];
    129129    $Output = $Form->ShowEditForm();
    130     return($Output);
     130    return ($Output);
    131131  }
    132132
     
    147147    $Output .= 'Účet: '.$BankAccount['Number'].'/'.$Bank['Code'].' ('.$Bank['Name'].')';
    148148
    149     if($Bank['Code'] == '2010') $Import = new ImportFio($this->System);
    150       else if($Bank['Code'] == '0300') $Import = new ImportPS($this->System);
     149    if ($Bank['Code'] == '2010') $Import = new ImportFio($this->System);
     150      else if ($Bank['Code'] == '0300') $Import = new ImportPS($this->System);
    151151      else $Output = $this->SystemMessage('Nepodporované API', 'Pro zvolenou banku není import podporován');
    152152    $Import->BankAccount = $BankAccount;
    153153    $Output .= $Import->ImportFile($File->GetContent(), $File->GetExt());
    154154
    155     return($Output);
     155    return ($Output);
    156156  }
    157157
     
    171171    $Output = '';
    172172
    173     for($I = $_POST['ItemCount'] - 1; $I >= 0 ; $I--)
     173    for ($I = $_POST['ItemCount'] - 1; $I >= 0 ; $I--)
    174174    {
    175       if($_POST['Money'.$I] >= 0) {
     175      if ($_POST['Money'.$I] >= 0) {
    176176        $FinanceGroup = $Finance->GetFinanceGroupById(OPERATION_GROUP_ACCOUNT_IN,
    177177          'FinanceOperationGroup');
     
    187187      $this->System->ModuleManager->Modules['Log']->NewRecord('Finance', 'NewPaymentInserted');
    188188    }
    189     return($Output);
     189    return ($Output);
    190190  }
    191191}
Note: See TracChangeset for help on using the changeset viewer.