Changeset 302 for trunk/finance


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.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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');
Note: See TracChangeset for help on using the changeset viewer.