Bugfixes CRM

This commit is contained in:
Xenomporio 2022-05-30 21:39:00 +02:00
parent 72b76be062
commit 526506575a
3 changed files with 1013 additions and 996 deletions

View File

@ -1182,10 +1182,13 @@ class Briefpapier extends SuperFPDF {
public function ArchiviereDocument($schreibschutz = false, $force = false, $parameter = ''): void
{
if(!$schreibschutz){
if (!is_null($this->table)) {
$schreibschutz = (bool)$this->app->DB->Select(
"SELECT `schreibschutz` FROM `{$this->table}` WHERE `id` = '{$this->id}' LIMIT 1"
);
}
}
if($parameter == ''){
$parameter = $this->parameter;
@ -1195,9 +1198,11 @@ class Briefpapier extends SuperFPDF {
return;
}
if (!is_null($this->table)) {
$isDraft = $this->app->DB->Select(
"SELECT `id` FROM `{$this->table}` WHERE `id` = '{$this->id}' AND `belegnr` <> '' AND `belegnr` <> '0' LIMIT 1"
) === null;
}
if($isDraft){
return;

View File

@ -48,7 +48,8 @@ class Dokumentenvorlage extends SuperFPDF {
$this->absender = '';
$this->firmendatenid = $this->app->DB->Select("SELECT MAX(id) FROM firmendaten LIMIT 1");
$hintergrund = $this->app->DB->Select("SELECT hintergrund FROM firmendaten WHERE id='".$this->firmendatenid."' LIMIT 1");
// $hintergrund = $this->app->DB->Select("SELECT hintergrund FROM firmendaten WHERE id='".$this->firmendatenid."' LIMIT 1");
$hintergrund = $this->app->DB->Select("SELECT wert FROM firmendaten_werte WHERE name='hintergrund' LIMIT 1");
if($hintergrund=="logo")
{
$logo = $this->app->erp->getSettingsFile('logo');

View File

@ -3819,15 +3819,26 @@ function AdresseBriefCreatePDF($dokumentId, $display=true) {
LIMIT 1
');
$data['firma'] = $this->app->DB->Select('
/* $data['firma'] = $this->app->DB->Select('
SELECT
absender
FROM
firmendaten
WHERE
id = ' . $data['firma'] . '
');*/
$data['firma'] = $this->app->DB->Select('
SELECT
wert
FROM
firmendaten_werte
WHERE
name = \'absender\'
');
$korrespondenz = new KorrespondenzPDF($this->app,$data['projekt']);
$korrespondenz->SetBetreff($this->app->erp->ReadyForPDF($data['betreff']));