Changeset 940 for trunk


Ignore:
Timestamp:
Aug 2, 2022, 10:07:44 AM (2 years ago)
Author:
chronos
Message:
  • Fixed: Generation of customer contracts.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Modules/Contract/Contract.php

    r916 r940  
    135135    } else die('MainSubjectId not found in Subjects.');
    136136
    137     $DbResult = $this->Database->query('SELECT * FROM `Contract`');
     137    $DbResult = $this->Database->query('SELECT * FROM `Contract` WHERE `Id`='.$this->ContractId);
    138138    if ($DbResult->num_rows > 0)
    139139    {
     
    241241    } else $CustomerPhone = '';
    242242
    243     $DbResult = $this->Database->query('SELECT Contact.Value AS Email FROM User '.
     243    $DbResult = $this->Database->query('SELECT Email, Contact.Value AS ContactEmail FROM User '.
    244244      'LEFT JOIN Contact ON Contact.User=User.ID AND Contact.Category=4 '.
    245245      'WHERE User.Id='.$Customer['ResponsibleUser']);
     
    248248      $CustomerUser = $DbResult->fetch_assoc();
    249249      $CustomerEmail = $CustomerUser['Email'];
    250       if ($CustomerEmail == null) $CustomerEmail = '';
     250      if ($CustomerEmail == null)
     251      {
     252        $CustomerEmail = $CustomerUser['ContactEmail'];
     253        if ($CustomerEmail == null) $CustomerEmail = '';
     254      }
    251255    } else $CustomerEmail = '';
    252256
Note: See TracChangeset for help on using the changeset viewer.