From 33d2ca94970198dd4d039e03026fe0f44e53dcf4 Mon Sep 17 00:00:00 2001
From: OpenXE <>
Date: Sun, 7 May 2023 18:40:22 +0200
Subject: [PATCH] bestellung show wareneingang in minidetail
---
phpwf/plugins/class.yui.php | 2 +-
www/pages/bestellung.php | 27 ++++++++++++++++++++++++++-
2 files changed, 27 insertions(+), 2 deletions(-)
diff --git a/phpwf/plugins/class.yui.php b/phpwf/plugins/class.yui.php
index ae2c7ada..5ad14097 100644
--- a/phpwf/plugins/class.yui.php
+++ b/phpwf/plugins/class.yui.php
@@ -7062,7 +7062,7 @@ r.land as land, p.abkuerzung as projekt, r.zahlungsweise as zahlungsweise,
$more_data7 = $this->app->Secure->GetGET("more_data7");
// SQL statement
- $sql = "SELECT
+ $sql = "SELECT SQL_CALC_FOUND_ROWS
b.id,'app->Conf->WFconf['defaulttheme']}/images/details_open.png class=details>' AS `open`,
CONCAT('') AS `auswahl`,
IF(b.status='storniert',CONCAT(b.belegnr),b.belegnr) AS `belegnr`,
diff --git a/www/pages/bestellung.php b/www/pages/bestellung.php
index 0a27c810..8a403ecf 100644
--- a/www/pages/bestellung.php
+++ b/www/pages/bestellung.php
@@ -775,7 +775,8 @@ class Bestellung extends GenBestellung
$tmp3->DisplayNew('PDFARCHIV','Menü',"noAction");
}
-
+
+/*
$wareneingangsbelege = $this->app->DB->SelectFirstCols("SELECT
CONCAT('','>'),if(r.document_number='0' OR document_number='','ENTWURF',r.document_number),if(r.status='storniert','',''),'
') as wareneingangsbeleg
@@ -787,6 +788,30 @@ class Bestellung extends GenBestellung
else{
$this->app->Tpl->Set('WARENEINGANGSBELEG', '-');
}
+ */
+
+ $sql = "SELECT
+ CONCAT('',pa.id,'') as wareneingang
+FROM
+ paketannahme pa
+INNER JOIN paketdistribution pd ON
+ pd.paketannahme = pa.id
+INNER JOIN bestellung_position bp ON
+ pd.bestellung_position = bp.id
+INNER JOIN bestellung b ON
+ b.id = bp.bestellung
+WHERE
+ b.id = $id
+GROUP BY
+ pa.id";
+// echo($sql);
+ $wareneingangsbelege = $this->app->DB->SelectArr($sql);
+ if(!empty($wareneingangsbelege)){
+ $this->app->Tpl->Add('WARENEINGANGSBELEG', implode('
', array_column($wareneingangsbelege , 'wareneingang' )));
+ }
+ else{
+ $this->app->Tpl->Set('WARENEINGANGSBELEG', '-');
+ }
$this->app->Tpl->Set('ID', $id);