Changeset 632


Ignore:
Timestamp:
Jan 3, 2014, 5:55:20 PM (11 years ago)
Author:
chronos
Message:
  • Přidáno: Vztahy faktura - platba lze definovat jako vztah N:M. Jedna platba může být přiřazena k více fakturám. K jedné fakturě může být přiřazeno více plateb.
Location:
trunk
Files:
1 added
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/Application/FormClasses.php

    r628 r632  
    3535    ),
    3636  ),
     37  'FinanceInvoiceOperationRel' => array(
     38    'Title' => 'Zaplacení faktůr',
     39    'Table' => 'FinanceInvoiceOperationRel',
     40    'Items' => array(
     41      'Invoice' => array('Type' => 'TFinanceInvoice', 'Caption' => 'Faktura', 'Default' => ''),       
     42      'Operation' => array('Type' => 'TFinanceOperation', 'Caption' => 'Platba', 'Default' => ''),       
     43    ),
     44  ),
    3745  'ServiceCustomerRel' => array(
    3846    'Title' => 'Vztahy služba - zákazník',
     
    602610    'Filter' => '1',
    603611  ),
     612  'TFinanceInvoiceOperationRelListInvoice' => array(
     613    'Type' => 'ManyToOne',
     614    'Table' => 'FinanceInvoiceOperationRel',
     615    'Id' => 'Id',
     616    'Ref' => 'Invoice',
     617    'Filter' => '1',
     618  ),
     619  'TFinanceInvoiceOperationRelListOperation' => array(
     620    'Type' => 'ManyToOne',
     621    'Table' => 'FinanceInvoiceOperationRel',
     622    'Id' => 'Id',
     623    'Ref' => 'Operation',
     624    'Filter' => '1',
     625  ),
    604626  'TServiceCustomerRelListCustomer' => array(
    605627    'Type' => 'ManyToOne',
  • trunk/Application/Version.php

    r630 r632  
    11<?php
    22
    3 $Revision = 630; // Subversion revision
    4 $DatabaseRevision = 627; // SQL structure revision
     3$Revision = 632; // Subversion revision
     4$DatabaseRevision = 632; // SQL structure revision
    55$ReleaseTime = mktime(0, 0, 0, 2, 2, 2014);
  • trunk/Common/Setup/Updates.php

    r627 r632  
    542542}
    543543
     544function UpdateTo632($Manager)
     545{
     546        $Manager->Execute('CREATE TABLE IF NOT EXISTS `FinanceInvoiceOperationRel` (
     547  `Id` int(11) NOT NULL AUTO_INCREMENT,
     548  `Invoice` int(11) NOT NULL,
     549  `Operation` int(11) NOT NULL,
     550  PRIMARY KEY (`Id`),
     551  KEY `Invoice` (`Invoice`),
     552  KEY `Operation` (`Operation`)
     553) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;');
     554  $Manager->Execute('ALTER TABLE `FinanceInvoiceOperationRel`
     555  ADD CONSTRAINT `FinanceInvoiceOperationRel_ibfk_2` FOREIGN KEY (`Operation`) REFERENCES `FinanceOperation` (`Id`),
     556  ADD CONSTRAINT `FinanceInvoiceOperationRel_ibfk_1` FOREIGN KEY (`Invoice`) REFERENCES `FinanceInvoice` (`Id`);');
     557}
     558
    544559class Updates
    545560{
     
    576591      619 => array('Revision' => 620, 'Function' => 'UpdateTo620'),
    577592      620 => array('Revision' => 627, 'Function' => 'UpdateTo627'),
     593      627 => array('Revision' => 632, 'Function' => 'UpdateTo632'),
    578594    ));
    579595  }
  • trunk/Modules/Finance/Finance.php

    r628 r632  
    345345        'Treasury' => array('Type' => 'TFinanceTreasury', 'Caption' => 'Pokladna', 'Default' => '', 'Null' => true),
    346346        'Generate' => array('Type' => 'Boolean', 'Caption' => 'Generovat', 'Default' => ''),
     347        'InvoiceRel' => array('Type' => 'TFinanceInvoiceOperationRelListOperation', 'Caption' => 'Zaplacené faktury', 'Default' => ''),       
    347348      ),
    348349      'BeforeInsert' => array($this, 'BeforeInsertFinanceOperation'),
     
    363364        'Generate' => array('Type' => 'Boolean', 'Caption' => 'Generovat', 'Default' => ''),
    364365        'Items' => array('Type' => 'TFinanceInvoiceItemListInvoice', 'Caption' => 'Položky', 'Default' => ''),
     366        'OperationRel' => array('Type' => 'TFinanceInvoiceOperationRelListInvoice', 'Caption' => 'Platba', 'Default' => ''),
    365367      ),
    366368      'BeforeInsert' => array($this, 'BeforeInsertFinanceOperation'),
     
    450452        'ReplaceId' => array('Type' => 'TFinanceCharge', 'Caption' => 'Cílová položka', 'Default' => '0', 'Null' => true),
    451453      ),
    452     ));   
     454    ));     
    453455   
    454456    $this->System->AddModule(new Bill($this->System));
Note: See TracChangeset for help on using the changeset viewer.