Compare commits

...

2 Commits

Author SHA1 Message Date
OpenXE
042f5b5527 Bugfix cronjobs shopimport 2024-05-27 11:42:54 +02:00
OpenXE
e19484b597 versandpaket paketmarke calculate weight of versandpaket 2024-05-23 14:27:32 +02:00
4 changed files with 25 additions and 11 deletions

View File

@ -945,7 +945,7 @@ if($shops) {
{
$onlinebestellnummer = $tmpwarenkorb['auftrag'];
}
$projekt = $app->DB->Select("SELECT projekt WHERE shopexport = '$id' LIMIT 1");
$projekt = $app->DB->Select("SELECT projekt FROM shopexport WHERE id = '$id' LIMIT 1");
if(!empty($tmpwarenkorb['projekt']) && $app->DB->Select("SELECT id FROM projekt WHERE id = '".(int)$tmpwarenkorb['projekt']."' LIMIT 1"))$projekt = (int)$tmpwarenkorb['projekt'];
if(isset($tmpwarenkorb['subshop']) && $tmpwarenkorb['subshop'])
{

View File

@ -163,12 +163,6 @@ abstract class Versanddienstleister
ORDER BY lp.sort";
$ret['positions'] = $this->app->DB->SelectArr($sql) ?? [];
if ($sid === "lieferschein") {
$standardkg = $this->app->erp->VersandartMindestgewicht($lieferscheinId);
} else {
$standardkg = $this->app->erp->VersandartMindestgewicht();
}
$ret['weight'] = $standardkg;
return $ret;
}
@ -370,9 +364,11 @@ abstract class Versanddienstleister
return true;
}
public function Paketmarke(string $target, string $docType, int $docId, $versandpaket = null): void
public function Paketmarke(string $target, string $docType, int $docId, $gewicht = 0, $versandpaket = null): void
{
$address = $this->GetAdressdaten($docId, $docType);
$address['weight'] = $gewicht;
if (isset($_SERVER['CONTENT_TYPE']) && ($_SERVER['CONTENT_TYPE'] === 'application/json')) {
$json = json_decode(file_get_contents('php://input'));
$ret = [];

View File

@ -575,7 +575,10 @@ class Lieferschein extends GenLieferschein
return;
}
$versandmodul = $this->app->erp->LoadVersandModul($result['modul'], $result['id']);
$versandmodul->Paketmarke('TAB1', 'lieferschein', $id);
$gewicht = $this->app->erp->VersandartMindestgewicht($id, 'lieferschein');
$versandmodul->Paketmarke('TAB1', docType: 'lieferschein', docId: $id, gewicht: $gewicht);
$this->app->Tpl->Parse('PAGE',"tabview.tpl");
}

View File

@ -1176,7 +1176,22 @@ class Versandpakete {
}
$lieferschein = $this->app->DB->SelectRow("SELECT * FROM (".self::SQL_VERSANDPAKETE_LIEFERSCHEIN.") temp WHERE versandpaket = ".$id." LIMIT 1");
$versandmodul = $this->app->erp->LoadVersandModul($versandart['modul'], $versandart['id']);
$versandmodul->Paketmarke('TAB1', 'lieferschein', $lieferschein['lieferschein'], $id);
$sql = "
SELECT
SUM(COALESCE(a.gewicht,0)*vlp.menge)
FROM
artikel a
INNER JOIN lieferschein_position lp ON
a.id = lp.artikel
INNER JOIN
versandpaket_lieferschein_position vlp ON
vlp.lieferschein_position = lp.id
WHERE vlp.versandpaket = ".$id."
";
$gewicht = $this->app->DB->Select($sql);
$versandmodul->Paketmarke('TAB1', docType: 'lieferschein', docId: $lieferschein['lieferschein'], versandpaket: $id, gewicht: $gewicht);
$this->app->Tpl->Parse('PAGE',"tabview.tpl");
}