Changeset 302 for trunk


Ignore:
Timestamp:
Jan 20, 2011, 6:37:24 AM (14 years ago)
Author:
george
Message:
  • Opraveno: Vkládání nových plateb a faktůr.
Location:
trunk
Files:
2 added
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/aktuality/index.php

    r252 r302  
    1616    if(array_key_exists('category', $_GET)) $Category = $_GET['category'] * 1;
    1717    if(array_key_exists('category', $_POST)) $Category = $_POST['category'] * 1;
    18     $DbResult = $this->Database->select('NewsCategory', '*', 'Id='.$Category);
     18    $DbResult = $this->Database->select('NewsCategory', '*', 'Id='.$Category.' ORDER BY Sequence');
    1919    if($DbResult->num_rows > 0)
    2020    {
  • trunk/aktuality/news.php

    r252 r302  
    9494    $this->NewsSetting = array();
    9595    $I = 1;
    96     $DbResult = $this->Database->select('NewsCategory', '*');
     96    $DbResult = $this->Database->select('NewsCategory', '*', '1 ORDER BY Sequence');
    9797    while($NewsCategory = $DbResult->fetch_array())
    9898    {
  • trunk/finance/manage.php

    r297 r302  
    143143  }
    144144
    145   function InsertLiability($Subject, $Value, $Time, $BillId, $Text, $TimePayment = '')
     145  function InsertLiability($Subject, $Value, $TimeCreation, $TimeDue, $Text, $DocumentLine)
    146146  {
    147147    global $LastInsertTime;
    148148
    149     if($TimePayment != '') $TimePayment = TimeToMysqlDateTime($TimePayment);
    150     $this->Database->insert('FinanceClaimsLiabilities', array('Text' => $Text, 'Subject' => $Subject, 'TimeCreation' => TimeToMysqlDateTime($Time), 'TimeDue' => TimeToMysqlDateTime($Time + 3600*24*15), 'TimePayment' => $TimePayment, 'Value' => $Value, 'Bill' => $BillId));
     149    $BillCode = $this->System->Modules['Finance']->GetNextDocumentLineNumber($DocumentLine);
     150    $this->Database->insert('FinanceClaimsLiabilities', array('Text' => $Text, 'Subject' => $Subject, 'TimeCreation' => TimeToMysqlDateTime($TimeCreation), 'TimeDue' => TimeToMysqlDateTime($TimeDue), 'Value' => $Value, 'BillCode' => $BillCode));
    151151    $Output = '.'; //$this->Database->LastQuery.'<br />';
    152152    $LastInsertTime = $Time;
    153     $this->CheckAdvancesAndLiabilities($Subject);
    154     return($Output);
    155   }
    156 
    157   function InsertMoney($Subject, $Value, $Cash, $Taxable, $Time, $Text)
     153    //$this->CheckAdvancesAndLiabilities($Subject);
     154    return($Output);
     155  }
     156
     157  function InsertMoney($Subject, $Value, $Cash, $Taxable, $Time, $Text, $DocumentLine)
    158158  {
    159159    global $LastInsertTime;
    160160
    161     $this->Database->insert('FinanceCashFlow', array('Text' => $Text, 'Subject' => $Subject, 'Cash' => $Cash, 'Value' => $Value, 'Time' => TimeToMysqlDateTime($Time), 'Taxable' => $Taxable));
    162     if($Value >= 0)
     161    $BillCode = $this->System->Modules['Finance']->GetNextDocumentLineNumber($DocumentLine);
     162    $this->Database->insert('FinanceOperation', array('Text' => $Text, 'Subject' => $Subject, 'Cash' => $Cash, 'Value' => $Value, 'Time' => TimeToMysqlDateTime($Time), 'Taxable' => $Taxable, 'BillCode' => $BillCode));
     163    /*if($Value >= 0)
    163164    {
    164165      $this->Database->insert('FinanceAdvances', array('Subject' => $Subject, 'Value' => $Value, 'TimeCreation' => TimeToMysqlDateTime($Time), 'CashFlowId' => $this->Database->insert_id, 'Direction' => 'In'));
    165166    }
    166167    $LastInsertTime = $Time;
    167     $this->CheckAdvancesAndLiabilities($Subject);
     168    */
     169    //$this->CheckAdvancesAndLiabilities($Subject);
    168170  }
    169171
     
    216218    $Form = new Form('NewPayment');
    217219    $Form->LoadValuesFromForm();
    218     $this->InsertMoney($Form->Values['Subject'], $Form->Values['Value'], $Form->Values['Cash'], $Form->Values['Taxable'], $Form->Values['Time'], $Form->Values['Text']);
     220    $this->InsertMoney($Form->Values['Subject'], $Form->Values['Value'], $Form->Values['Cash'], $Form->Values['Taxable'], $Form->Values['Time'], $Form->Values['Text'], $Form->Values['DocumentLine']);
    219221    $Output = $this->SystemMessage('Finance', 'Platba vložena.');
    220222    $this->System->Modules['Log']->NewRecord('Finance', 'NewPaymentInserted');
     
    235237    $Form->LoadvaluesFromForm();
    236238    //print_r($Form->Values);
    237     //$this->InsertLiability($Form->Values['Subject'], $Form->Values['Value'], $Form->Values['Time'], $BillId, $Text, $TimePayment = '')
     239    $this->InsertLiability($Form->Values['Subject'], $Form->Values['Value'], $Form->Values['TimeCreation'], $Form->Values['TimeDue'], $Form->Values['Text'], $Form->Values['DocumentLine']);
    238240    $Output = $this->SystemMessage('Finance', 'Faktura vložena..');
    239241    $this->System->Modules['Log']->NewRecord('Finance', 'NewInvoiceInserted');
  • trunk/form_classes.php

    r219 r302  
    55    'Title' => 'Nová platba',
    66    'Items' => array(
     7      'DocumentLine' => array('Type' => 'TDocumentLine', 'Caption' => 'Dokladová řada', 'Default' => 3),
    78      'Time' => array('Type' => 'Time', 'Caption' => 'Čas', 'Default' => 'Now'),
    89      'Subject' => array('Type' => 'TFinanceSubject', 'Caption' => 'Subjekt', 'Default' => 0),
    910      'Value' => array('Type' => 'Float', 'Caption' => 'Částka [Kč]', 'Default' => '0'),
    10       'Text' => array('Type' => 'String', 'Caption' => 'Popis', 'Default' => 'Přijatá záloha'),
     11      'Text' => array('Type' => 'String', 'Caption' => 'Popis', 'Default' => 'Vklad'),
    1112      'Cash' => array('Type' => 'Boolean', 'Caption' => 'Hotovost', 'Default' => '1'),
    1213      'Taxable' => array('Type' => 'Boolean', 'Caption' => 'Ovlivňující daňový základ', 'Default' => '1'),
     
    1617    'Title' => 'Nová faktura',
    1718    'Items' => array(
    18       'Time' => array('Type' => 'Time', 'Caption' => 'Čas', 'Default' => 'Now'),
    19       'Contractor' => array('Type' => 'TFinanceSubject', 'Caption' => 'Dodavatel', 'Default' => 1),
    20       'Customer' => array('Type' => 'TFinanceSubject', 'Caption' => 'Odběratel', 'Default' => 0),
    21       'Items' => array('Type' => 'Array', 'Caption' => 'Položky', 'ItemClass' => 'FinanceInvoiceItem'),
     19      'DocumentLine' => array('Type' => 'TDocumentLine', 'Caption' => 'Dokladová řada', 'Default' => 5),
     20      'TimeCreation' => array('Type' => 'Time', 'Caption' => 'Čas vytvoření', 'Default' => 'Now'),
     21      'TimeDue' => array('Type' => 'Time', 'Caption' => 'Čas splatnosti', 'Default' => 'Now'),
     22      'Subject' => array('Type' => 'TFinanceSubject', 'Caption' => 'Subjekt', 'Default' => 0),
     23      'Text' => array('Type' => 'String', 'Caption' => 'Popis', 'Default' => 'Nákup zařízení'),
     24      'Value' => array('Type' => 'Float', 'Caption' => 'Částka [Kč]', 'Default' => '0'),
     25      //'Items' => array('Type' => 'Array', 'Caption' => 'Položky', 'ItemClass' => 'FinanceInvoiceItem'),
    2226    ),
    2327  ),
     
    185189    'Filter' => '1',
    186190  ),
     191  'TDocumentLine' => array(
     192    'Type' => 'Reference',
     193    'Table' => 'DocumentLine',
     194    'Id' => 'Id',
     195    'Name' => 'Name',
     196    'Filter' => '1',
     197  ),
    187198  'TNetworkDevice' => array(
    188199    'Type' => 'Reference',
  • trunk/forms.php

    r239 r302  
    9898                  if($Row['Id'] == $this->Values[$Index]) $Selected = ' selected="selected"';
    9999                    else $Selected = '';
    100                   $Edit .= '<option value="'.$Row['Id'].'"'.$Selected.'>'.$Row['Name'].'</option>';
     100                  $Edit .= '<option value="'.$Row['Id'].'"'.$Selected.'>'.$Row['Id'].': '.$Row['Name'].'</option>';
    101101                }
    102102                $Edit .= '</select>';
Note: See TracChangeset for help on using the changeset viewer.