Skip to content
Code-Schnipsel Gruppen Projekte
Commit 17e97683 erstellt von Henning Leutz's avatar Henning Leutz :martial_arts_uniform:
Dateien durchsuchen
Übergeordneter bf653b29
No related branches found
No related tags found
Keine zugehörigen Merge Requests gefunden
......@@ -136,7 +136,7 @@ public function setUser(QUI\Interfaces\Users\User $User)
}
$this->calculated = false;
$this->User = $User;
$this->User = $User;
foreach ($this->articles as $Article) {
$Article->setUser($User);
......@@ -213,6 +213,21 @@ public function setCurrency(QUI\ERP\Currency\Currency $Currency)
$Article->setCurrency($Currency);
}
}
$PriceFactors = $this->getPriceFactors();
$priceFactors = $PriceFactors->toArray();
foreach ($priceFactors as $k => $factor) {
$priceFactors[$k]['sumFormatted'] = $Currency->format($factor['sum']);
$priceFactors[$k]['nettoSumFormatted'] = $Currency->format($factor['nettoSum']);
$priceFactors[$k]['valueText'] = $priceFactors[$k]['sumFormatted'];
if ($factor['sum'] > 0) {
$priceFactors[$k]['valueText'] = '+' . $priceFactors[$k]['sumFormatted'];
}
}
$this->PriceFactors = new QUI\ERP\Accounting\PriceFactors\FactorList($priceFactors);
}
/**
......@@ -231,7 +246,7 @@ public function toArray(): array
$Currency = $this->getCurrency();
// format
$articles = $data['articles'];
$articles = $data['articles'];
$calculations = $data['calculations'];
$calculations['currencyData'] = $Currency->toArray();
......@@ -241,16 +256,16 @@ public function toArray(): array
);
$calculations['display_subSum'] = $Currency->format($calculations['subSum']);
$calculations['display_sum'] = $Currency->format($calculations['sum']);
$calculations['display_sum'] = $Currency->format($calculations['sum']);
$calculations['display_vatSum'] = $Currency->format($calculations['vatSum']);
foreach ($articles as $key => $article) {
$articles[$key]['position'] = $key + 1;
$articles[$key]['display_sum'] = $Currency->format($article['sum']);
$articles[$key]['position'] = $key + 1;
$articles[$key]['display_sum'] = $Currency->format($article['sum']);
$articles[$key]['display_unitPrice'] = $Currency->format($article['unitPrice']);
}
$data['articles'] = $articles;
$data['articles'] = $articles;
$data['calculations'] = $calculations;
/* @var $Factor PriceFactors\Factor */
......@@ -333,15 +348,15 @@ public function calc($Calc = null)
}
$Calc->calcArticleList($this, function ($data) use ($self) {
$self->sum = $data['sum'];
$self->grandSubSum = $data['grandSubSum'];
$self->subSum = $data['subSum'];
$self->nettoSum = $data['nettoSum'];
$self->nettoSubSum = $data['nettoSubSum'];
$self->vatArray = $data['vatArray'];
$self->vatText = $data['vatText'];
$self->isEuVat = $data['isEuVat'];
$self->isNetto = $data['isNetto'];
$self->sum = $data['sum'];
$self->grandSubSum = $data['grandSubSum'];
$self->subSum = $data['subSum'];
$self->nettoSum = $data['nettoSum'];
$self->nettoSubSum = $data['nettoSubSum'];
$self->vatArray = $data['vatArray'];
$self->vatText = $data['vatText'];
$self->isEuVat = $data['isEuVat'];
$self->isNetto = $data['isNetto'];
$self->currencyData = $data['currencyData'];
$this->calculations = [
......
......@@ -12,7 +12,7 @@
* Class FactorList
*
* List with multiple price factors
* This list cant be edited and is not changeable
* This list can't be edited and is not changeable
*
* This is list is only a presentation layer
*/
......@@ -23,7 +23,7 @@ class FactorList implements \IteratorAggregate, \Countable
*
* @var Factor[]
*/
protected $list = [];
protected array $list = [];
/**
* FactorList constructor.
......
0% oder .
You are about to add 0 people to the discussion. Proceed with caution.
Bearbeitung dieser Nachricht zuerst beenden!
Bitte registrieren oder zum Kommentieren