Ignore:
Timestamp:
Oct 25, 2015, 9:51:51 PM (9 years ago)
Author:
chronos
Message:
  • Modified: Now IS Dashboard is not dependent on other modules. They need to register their view to IS dashboard.
  • Fixed: Wrong sign of created finance operations from bank import.
  • Added: Storno invoices now have special groups in FinanceInvoiceGroup table.

Both Storno and previous storned documents should be linked together using new table FinanceInvoiceStorno.
Also they should be marked as not visible to user.

Location:
trunk/Modules/FinanceBankAPI
Files:
2 edited

Legend:

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

    r747 r755  
    4242          $BillCode = $this->System->Modules['Finance']->GetNextDocumentLineNumberId($FinanceGroup['DocumentLine'], $Year);
    4343          $DbResult3 = $this->Database->insert('FinanceOperation', array('Subject' => $DbRow2['Id'], 'Cash' => 0,
    44             'Value' => Abs($DbRow['Value']), 'Taxable' => 1, 'BankAccount' => $DbRow['BankAccount'], 'Network' => 1,
     44            'ValueUser' => Abs($DbRow['Value']), 'Taxable' => 1, 'BankAccount' => $DbRow['BankAccount'], 'Network' => 1,
    4545            'Time' => $DbRow['Time'], 'Text' => $DbRow['Description'], 'BillCode' => $BillCode, 'Group' => $FinanceGroup['Id']));
    46           $this->Database->update('FinanceBankImport', 'Id='.$DbRow['Id'], array('FinanceOperation' => $this->Database->insert_id));
     46          $Id = $this->Database->insert_id;
     47          $this->Database->update('FinanceBankImport', 'Id='.$DbRow['Id'], array('FinanceOperation' => $Id));
     48
     49          // Execute after insert event
     50          $Form = new Form($this->System->FormManager);
     51          $Form->SetClass('FinanceOperation');
     52          $Form->LoadValuesFromDatabase($Id);
     53          if(array_key_exists('AfterInsert', $Form->Definition))
     54          {
     55            $Class = $Form->Definition['AfterInsert'][0];
     56            $Method = $Form->Definition['AfterInsert'][1];
     57            $Form->Values = $Class->$Method($Form, $Id);
     58          }
    4759        }
    4860      }
  • trunk/Modules/FinanceBankAPI/FinanceBankAPI.php

    r740 r755  
    6060    $this->System->RegisterPage(array('finance', 'import-api'), 'PageImportAPI');
    6161    $this->System->RegisterPage(array('finance', 'import-soubor'), 'PageImportFile');
     62
     63    $this->System->ModuleManager->Modules['IS']->RegisterDashboardItem('FinanceBankAPI',
     64      array('ModuleFinanceBankAPI', 'ShowDashboardItem'));
    6265  }
    6366
    6467  function DoStop()
    6568  {
     69  }
     70
     71  function ShowDashboardItem()
     72  {
     73    $DbResult = $this->Database->select('FinanceBankImport', 'COUNT(*)', '`FinanceOperation` IS NULL');
     74    $DbRow = $DbResult->fetch_row();
     75    $Output = 'Nezpárovaných plateb: '.$DbRow['0'].'<br/>';
     76    return($Output);
    6677  }
    6778
Note: See TracChangeset for help on using the changeset viewer.