Ignore:
Timestamp:
Apr 14, 2015, 10:20:16 PM (9 years ago)
Author:
chronos
Message:
  • Removed: Spaces on end of line.
  • Modified: Tabs converted to spaces.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Modules/Finance/Import.php

    r719 r738  
    2525    }
    2626  }
    27  
     27
    2828  function Prepare()
    29   {   
     29  {
    3030    $Finance = $this->System->Modules['Finance'];
    3131    $Finance->LoadMonthParameters(0);
     
    3939      {
    4040        if(substr($Data[$Key][$Key2], 0, 2) == '\"')
    41           $Data[$Key][$Key2] = substr($Data[$Key][$Key2], 2, -2); 
     41          $Data[$Key][$Key2] = substr($Data[$Key][$Key2], 2, -2);
    4242      }
    4343    }
    4444    $Header = array(
    45       0 => 'datum zaúčtování',         
     45      0 => 'datum zaúčtování',
    4646      1 => 'částka',
    4747      2 => 'měna',
     
    6060    //print_r($_POST['Source']);
    6161    //print_r($Data);
    62  
     62
    6363    if($Header != $Data[0]) $Output = 'Nekompatibilní struktura CSV';
    64     else 
     64    else
    6565    {
    6666      array_shift($Data);
     
    8585          $Subject = '? ('.$Value[5].')';
    8686        }
    87         if(!is_numeric($Subject)) 
     87        if(!is_numeric($Subject))
    8888        {
    8989          $Mode = 'Ručně';
    9090          $Style = 'style="background-color: LightPink;" ';
    91         } else 
     91        } else
    9292        {
    9393          $Mode = 'Automaticky';
    9494          $Style = '';
    9595        }
    96    
     96
    9797        if($Money < 0) $Text = 'Platba převodem';
    9898          else $Text = 'Přijatá platba';
     
    106106            '<td><input type="text" name="Taxable'.$I.'" value="1"/></td>'.
    107107            '<td><input type="text" name="Network'.$I.'" value="1"/></td>'.
    108             '</tr><tr><td colspan="7">'.implode(', ', $Value).'</td></tr>'; 
     108            '</tr><tr><td colspan="7">'.implode(', ', $Value).'</td></tr>';
    109109        $I++;
    110110      }
     
    114114        '<th>Datum</th><th>Var. symbol</th><th>Protiúčet</th><th>Částka [Kč]</th><th>Text</th><th>Zdanitelné</th><th>Síť</th></tr>';
    115115      $Output .= $Automatic.'</table>';
    116       $Output .= '<input type="hidden" name="ItemCount" value="'.$I.'"/>'; 
    117       $Output .= '<input type="submit" value="Zpracovat"/></form>';     
     116      $Output .= '<input type="hidden" name="ItemCount" value="'.$I.'"/>';
     117      $Output .= '<input type="submit" value="Zpracovat"/></form>';
    118118    }
    119119    return($Output);
    120120  }
    121  
     121
    122122  function InsertMoney($Subject, $Value, $Direction, $Cash, $Taxable, $Time, $Text, $DocumentLine)
    123123  {
     
    125125    $BillCode = $this->System->Modules['Finance']->GetNextDocumentLineNumber($DocumentLine, $Year);
    126126    // TODO: Fixed BankAccount=1, allow to select bank account for import
    127     $this->Database->insert('FinanceOperation', array('Text' => $Text, 
    128       'Subject' => $Subject, 'Cash' => $Cash, 'Value' => $Value, 'Direction' => $Direction, 
     127    $this->Database->insert('FinanceOperation', array('Text' => $Text,
     128      'Subject' => $Subject, 'Cash' => $Cash, 'Value' => $Value, 'Direction' => $Direction,
    129129      'Time' => TimeToMysqlDateTime($Time), 'Taxable' => $Taxable, 'BillCode' => $BillCode,
    130130      'BankAccount' => 1));
     
    136136    $Finance->LoadMonthParameters(0);
    137137    $Output = '';
    138    
     138
    139139    for($I = $_POST['ItemCount'] - 1; $I >= 0 ; $I--)
    140140    {
    141         // TODO: Use links to database records instead of contants
     141      // TODO: Use links to database records instead of contants
    142142      if($_POST['Money'.$I] < 0) {
    143         $DocumentLine = 4;
    144         $Direction = -1;
     143        $DocumentLine = 4;
     144        $Direction = -1;
    145145      } else {
    146         $DocumentLine = 3;
    147         $Direction = 1;
     146        $DocumentLine = 3;
     147        $Direction = 1;
    148148      }
    149149      $Date = explode('-', $_POST['Date'.$I]);
Note: See TracChangeset for help on using the changeset viewer.