Ignore:
Timestamp:
Sep 21, 2015, 12:12:26 AM (9 years ago)
Author:
chronos
Message:

This solves problem with inconsistency between invoice and invoice items values and inconsistency between selected document line and incorrect positive or negative values.

File:
1 edited

Legend:

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

    r741 r747  
    5252  function GenerateHTML()
    5353  {
    54     $DbResult = $this->Database->select('FinanceInvoice', '*', '`Id`='.$this->InvoiceId);
     54    $DbResult = $this->Database->query('SELECT `FinanceInvoice`.*, `FinanceInvoiceGroup`.`Direction` FROM `FinanceInvoice` '.
     55      'LEFT JOIN `FinanceInvoiceGroup` ON `FinanceInvoiceGroup`.`Id`=`FinanceInvoice`.`Group` '.
     56      'WHERE `FinanceInvoice`.`Id`='.$this->InvoiceId);
    5557    $Invoice = $DbResult->fetch_assoc();
    5658
     
    7981
    8082    // If direction is in => switch sides
    81     if($Invoice['Direction'] == FINANCE_DIRECTION_OUT) 
    82     {           
     83    if($Invoice['Direction'] == FINANCE_DIRECTION_OUT)
     84    {
    8385    }
    8486    else if($Invoice['Direction'] == FINANCE_DIRECTION_IN)
     
    151153  function GenerateHTML()
    152154  {
    153     $DbResult = $this->Database->select('FinanceOperation', '*', '`Id`='.$this->OperationId);
     155    $DbResult = $this->Database->query('SELECT `FinanceOperation`.*, `FinanceOperationGroup`.`Direction` FROM `FinanceOperation` '.
     156      'LEFT JOIN `FinanceOperationGroup` ON `FinanceOperationGroup`.`Id`=`FinanceOperation`.`Group` '.
     157      'WHERE `FinanceOperation`.`Id`='.$this->OperationId);
    154158    $Operation = $DbResult->fetch_assoc();
    155159
Note: See TracChangeset for help on using the changeset viewer.