Fixes
This commit is contained in:
parent
4ef7099599
commit
293640a1da
@ -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;
|
||||
}
|
||||
|
||||
@ -61,7 +61,7 @@ class CalcValues
|
||||
}
|
||||
|
||||
$this->parseEdgeCollection($price, $option, $option->getEdgesCollectionContainer());
|
||||
$this->engine->setVariables($option->parseAdditionalValues($this->engine->getVariables()));
|
||||
|
||||
}
|
||||
|
||||
return $price;
|
||||
|
||||
@ -95,6 +95,8 @@ class Valid
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$this->engine->setVariables($option->parseAdditionalValues($this->engine->getVariables()));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -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();
|
||||
|
||||
Loading…
Reference in New Issue
Block a user