Ignore:
Timestamp:
Mar 25, 2014, 12:38:20 AM (11 years ago)
Author:
chronos
Message:
  • Přidáno: Typ sazby DPH jako samostatná tabulka.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Modules/Finance/Manage.php

    r639 r645  
    151151        $InvoiceItems = array();
    152152        $MonthlyTotal = 0;
    153         $DbResult2 = $this->Database->query('SELECT Service.*, FinanceVAT.Value AS VAT '.
    154           'FROM ServiceCustomerRel LEFT JOIN Service '.
    155           'ON Service.Id=ServiceCustomerRel.Service '.
    156           'LEFT JOIN FinanceVAT ON FinanceVAT.Id=Service.VAT '.
    157           'WHERE (ServiceCustomerRel.Customer='.
    158           $Member['Id'].') AND (ServiceCustomerRel.Action IS NULL) ');
     153        $DbResult2 = $this->Database->query('SELECT `Service`.* '.
     154          'FROM `ServiceCustomerRel` LEFT JOIN `Service` '.
     155          'ON `Service`.`Id`=`ServiceCustomerRel`.`Service` '.
     156          'WHERE (`ServiceCustomerRel`.`Customer`='.
     157          $Member['Id'].') AND (`ServiceCustomerRel`.`Action` IS NULL) ');
    159158        while($Service = $DbResult2->fetch_assoc())
    160159        {
    161160          $InvoiceItems[] = array('Description' => $Service['Name'], 'Price' => $Service['Price'],
    162             'Quantity' => $Period['MonthCount'], 'VAT' => $Service['VAT']);
     161            'Quantity' => $Period['MonthCount'], 'VAT' => $this->System->Modules['Finance']->GetVATByType($Service['VAT']));
    163162          $MonthlyTotal += $Service['Price'];
    164163        }
     
    166165        {
    167166          $InvoiceItems[] = array('Description' => 'Spotřeba energie', 'Price' => -$Member['MonthlyPlus'],
    168             'Quantity' => $Period['MonthCount'], 'VAT' => 2);
     167            'Quantity' => $Period['MonthCount'], 'VAT' => $this->System->Modules['Finance']->GetVATByType(VAT_TYPE_BASE));
    169168          $MonthlyTotal -= $Member['MonthlyPlus'];
    170169        }
Note: See TracChangeset for help on using the changeset viewer.