Changeset 552


Ignore:
Timestamp:
Jul 7, 2013, 10:41:07 PM (11 years ago)
Author:
chronos
Message:
  • Opraveno: Generování měsíčních plateb. Chyběla funkce vkládání faktury.
  • Opraveno: Pořadí mazání starých tabulek FinanceBills.
  • Opraveno: Chyba zobrazení souborů z IS.
Location:
trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/Common/Version.php

    r551 r552  
    11<?php
    22
    3 $Revision = 551; // Subversion revision
     3$Revision = 552; // Subversion revision
    44$DatabaseRevision = 551; // SQL structure revision
    55$ReleaseTime = '2013-07-07';
  • trunk/Modules/File/File.php

    r548 r552  
    8383  function Show()
    8484  {
     85    if(array_key_exists('id', $_GET)) $Id = $_GET['id'];
     86    else if(array_key_exists('i', $_GET)) $Id = $_GET['i'];
     87    else return($this->SystemMessage('Chyba', 'Nezadáno id dokladu'));
    8588    $this->ClearPage = true;
    86     $Output = $this->System->Modules['File']->Download($_GET['id']);
     89    $Output = $this->System->Modules['File']->Download($Id);
    8790    return($Output);
    8891  }
  • trunk/Modules/Finance/Manage.php

    r551 r552  
    9999    $Output .= '<a href="?Operation=ProcessMonthlyPayment">Generovat faktury</a>';
    100100    return($Output);
     101  }
     102 
     103  function InsertInvoice($Subject, $TimeCreation, $TimeDue, $Items,
     104  $DocumentLine, $PeriodFrom, $PeriodTo)
     105  {
     106    global $LastInsertTime;
     107   
     108    $BillCode = $this->System->Modules['Finance']->GetNextDocumentLineNumber($DocumentLine);
     109    $SumValue = 0;
     110    foreach($Items as $Item)
     111        $SumValue = $SumValue + $Item['Price'];
     112    $this->Database->insert('FinanceInvoice', array(
     113          'Subject' => $Subject, 'TimeCreation' => TimeToMysqlDateTime($TimeCreation),
     114          'TimeDue' => TimeToMysqlDateTime($TimeDue), 'Value' => $SumValue, 'BillCode' => $BillCode,
     115          'PeriodFrom' => TimeToMysqlDate($PeriodFrom), 'PeriodTo' => TimeToMysqlDate($PeriodTo),
     116          'Generate' => 1));
     117    $InvoiceId = $this->Database->insert_id;
     118    foreach($Items as $Item)
     119      $this->Database->insert('FinanceInvoiceItem', array('FinanceInvoice' => $InvoiceId,
     120        'Description' => $Item['Description'], 'Price' => $Item['Price'], 'Quantity' => $Item['Quantity'], 'VAT' => $Item['VAT']));
     121    //$LastInsertTime = $Time;
     122    //$this->CheckAdvancesAndLiabilities($Subject);
     123    return($InvoiceId);
    101124  }
    102125 
  • trunk/Modules/Finance/UserState.php

    r548 r552  
    3434    $DbResult = $this->Database->query('SELECT Member.*, MemberPayment.MonthlyPlus AS MonthlyPlus '.
    3535      'FROM Member LEFT JOIN MemberPayment ON MemberPayment.Member=Member.Id WHERE Member.Subject='.$Subject['Id']);
     36    if($DbResult->num_rows == 0)
     37    {
     38      return($this->SystemMessage('Položka nenalezena', 'Zákazník nenalezen'));     
     39    }
    3640    $Member = $DbResult->fetch_assoc();
    3741    $Output = '<table width="100%" border="0" cellspacing="0" cellpadding="3"><tr><td valign="top">';
  • trunk/admin/Updates.php

    r551 r552  
    339339  $Manager->Execute('ALTER TABLE `FinanceInvoice` ADD FOREIGN KEY ( `DocumentLine` ) REFERENCES `DocumentLine` (
    340340`Id`) ON DELETE RESTRICT ON UPDATE RESTRICT ;');
     341  $Manager->Execute('DROP TABLE `FinanceBillsItemsOld`');
    341342  $Manager->Execute('DROP TABLE `FinanceBillsOld`');
    342   $Manager->Execute('DROP TABLE `FinanceBillsItemsOld`');
    343343}
    344344
Note: See TracChangeset for help on using the changeset viewer.