This commit is contained in:
Thomas Peterson 2019-06-26 13:35:55 +02:00
parent 4ef7099599
commit 293640a1da
4 changed files with 6 additions and 16 deletions

View File

@ -51,21 +51,7 @@ class Calc
/** @var Base $option */
foreach($this->article->getOptions() as $option) {
if($option instanceof PaperDbSelect) {
/** @var Select\Opt $opt */
foreach($option->getOptions() as $opt) {
if ($opt->isValid() && $opt->isSelected()) {
/** @var Paper $paper */
$paper = $this->engine->getPaperRepository()->findOneBy(['artNr' => $opt->getId()]);
$this->engine->setVariable($option->getId().'_digital_fix', $paper->getDigitalFix());
$this->engine->setVariable($option->getId().'_digital_var', $paper->getDigitalVar());
$this->engine->setVariable($option->getId().'_value', $paper->getPreis());
$this->engine->setVariable($option->getId().'_volume', $paper->getVolume());
}
}
}elseif($option instanceof Select) {
if($option instanceof Select) {
/** @var Select\Opt $opt */
foreach($option->getOptions() as $opt) {
if($opt->isValid() && $opt->isSelected()) {
@ -129,6 +115,7 @@ class Calc
$p = 0;
eval('@$p = ' . $formel . ';');
echo $formel . ": " . $p . PHP_EOL. PHP_EOL;
if($p > 0) {
$price += $p;
}

View File

@ -61,7 +61,7 @@ class CalcValues
}
$this->parseEdgeCollection($price, $option, $option->getEdgesCollectionContainer());
$this->engine->setVariables($option->parseAdditionalValues($this->engine->getVariables()));
}
return $price;

View File

@ -95,6 +95,8 @@ class Valid
}
}
}
$this->engine->setVariables($option->parseAdditionalValues($this->engine->getVariables()));
}
}

View File

@ -18,6 +18,7 @@ class PaperDbSelect extends Select
$variables[$this->getId() . '_grammatur'] = $paper->getGrammatur();
$variables[$this->getId() . '_volume'] = $paper->getVolume();
$variables[$this->getId() . '_value'] = $paper->getPreis();
$variables[$this->getId() . '_offset_fix'] = $paper->getOffsetFix();
$variables[$this->getId() . '_offset_var'] = $paper->getOffsetVar();
$variables[$this->getId() . '_digital_fix'] = $paper->getDigitalFix();