Skip to content
Code-Schnipsel Gruppen Projekte
Commit 134dc46f erstellt von Henning Leutz's avatar Henning Leutz :martial_arts_uniform:
Dateien durchsuchen

Merge branch 'next-3.x' into 'main'

fix: when entering gross, note the one cent problem

See merge request !143
Übergeordnete ba8a90a0 2f9bf9fd
Keine zugehörigen Branchen gefunden
Keine zugehörigen Tags gefunden
2 Merge Requests!143fix: when entering gross, note the one cent problem,!140Update 'next-4.x' with latest changes from 'main'
Pipeline-Nr. 11348 mit Warnungen bestanden
......@@ -446,22 +446,13 @@ public function calcArticleList(ArticleList $List, $callback = false): ArticleLi
// netto check 1cent check
$bruttoVatSum = 0;
foreach ($vatArray as $vat => $data) {
foreach ($vatArray as $data) {
$bruttoVatSum = $bruttoVatSum + $data['sum'];
}
if ($bruttoSum - $bruttoVatSum !== $nettoSum) {
$nettoSum = $nettoSum + $diff;
}
// doof aber -> pcsg/buero#344
if (
!$priceFactors->count()
&& count($articles) === 1
&& $nettoSubSum !== $nettoSum
) {
$nettoSum = $nettoSubSum;
}
}
}
......@@ -579,6 +570,8 @@ public function calcArticlePrice(Article $Article, $callback = false)
$vatSum = $nettoPrice * ($vat / 100);
$precision = $Currency->getPrecision();
$vatSum = round($vatSum, $precision);
$priceSum = $nettoPrice + $vatSum;
$bruttoPrice = round($priceSum, $precision);
......@@ -600,6 +593,15 @@ public function calcArticlePrice(Article $Article, $callback = false)
$vatSum = $checkVat;
}
// Related: pcsg/buero#344
// Related: pcsg/buero#436
if ($nettoSum + $checkVat !== $bruttoPrice) {
$diff = $nettoSum + $checkVat - $bruttoPrice;
$vatSum = $vatSum - $diff;
$vatSum = round($vatSum, $precision);
}
// if the user is brutto
// and we have a quantity
// we need to calc first the brutto product price of one product
......
0% Lade oder .
You are about to add 0 people to the discussion. Proceed with caution.
Bearbeitung dieser Nachricht zuerst beenden!
Bitte registrieren oder zum Kommentieren