mirror of
https://github.com/OpenXE-org/OpenXE.git
synced 2024-11-14 20:17:14 +01:00
versandpaket paketmarke calculate weight of versandpaket
This commit is contained in:
parent
63aaaf96ee
commit
e19484b597
@ -162,13 +162,7 @@ abstract class Versanddienstleister
|
||||
AND r.status != 'storniert'
|
||||
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 = [];
|
||||
|
@ -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");
|
||||
}
|
||||
|
||||
|
@ -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");
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user