Fixes
This commit is contained in:
parent
017a7931b3
commit
4a2fed26de
2394
cobertura.xml
2394
cobertura.xml
File diff suppressed because it is too large
Load Diff
@ -1,4 +1,5 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
namespace PSC\Library\Calc\Calc;
|
namespace PSC\Library\Calc\Calc;
|
||||||
|
|
||||||
use PSC\Library\Calc\Article;
|
use PSC\Library\Calc\Article;
|
||||||
@ -10,15 +11,14 @@ use PSC\Library\Calc\General\Type\EdgeCollection;
|
|||||||
use PSC\Library\Calc\General\Type\EdgeCollectionContainer;
|
use PSC\Library\Calc\General\Type\EdgeCollectionContainer;
|
||||||
use PSC\Library\Calc\Option\Type\Base;
|
use PSC\Library\Calc\Option\Type\Base;
|
||||||
use PSC\Library\Calc\Option\Type\Checkbox;
|
use PSC\Library\Calc\Option\Type\Checkbox;
|
||||||
|
use PSC\Library\Calc\Option\Type\ColorDBSelect;
|
||||||
use PSC\Library\Calc\Option\Type\Input;
|
use PSC\Library\Calc\Option\Type\Input;
|
||||||
use PSC\Library\Calc\Option\Type\Row;
|
use PSC\Library\Calc\Option\Type\Row;
|
||||||
use PSC\Library\Calc\Option\Type\Select;
|
use PSC\Library\Calc\Option\Type\Select;
|
||||||
use PSC\Library\Calc\Option\Type\ColorDBSelect;
|
|
||||||
use PSC\Library\Calc\Option\Type\Select\ColorOpt;
|
use PSC\Library\Calc\Option\Type\Select\ColorOpt;
|
||||||
|
|
||||||
class Valid
|
class Valid
|
||||||
{
|
{
|
||||||
|
|
||||||
/** @var Engine */
|
/** @var Engine */
|
||||||
protected $engine = null;
|
protected $engine = null;
|
||||||
|
|
||||||
@ -42,40 +42,40 @@ class Valid
|
|||||||
|
|
||||||
private function validRec(\ArrayIterator $options, $withFormel = true): void
|
private function validRec(\ArrayIterator $options, $withFormel = true): void
|
||||||
{
|
{
|
||||||
foreach($options as $option) {
|
foreach ($options as $option) {
|
||||||
if($option instanceof Row) {
|
if ($option instanceof Row) {
|
||||||
foreach($option->getColumns() as $col) {
|
foreach ($option->getColumns() as $col) {
|
||||||
$this->validRec($col->getOptions(), $withFormel);
|
$this->validRec($col->getOptions(), $withFormel);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if($option instanceof Input) {
|
if ($option instanceof Input) {
|
||||||
if($option->getMaxValue() && $option->getRawValue() > $option->getMaxValue()) {
|
if ($option->getMaxValue() && $option->getRawValue() > $option->getMaxValue()) {
|
||||||
$option->addValidationError(new Max(intval($option->getRawValue()), $option->getMaxValue()));
|
$option->addValidationError(new Max(intval($option->getRawValue()), $option->getMaxValue()));
|
||||||
}
|
}
|
||||||
if($option->getMinValue() && $option->getRawValue() < $option->getMinValue()) {
|
if ($option->getMinValue() && $option->getRawValue() < $option->getMinValue()) {
|
||||||
$option->addValidationError(new Min(intval($option->getRawValue()), $option->getMinValue()));
|
$option->addValidationError(new Min(intval($option->getRawValue()), $option->getMinValue()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(($option instanceof Select || $option instanceof Checkbox) && !($option instanceOf ColorDBSelect)) {
|
if (($option instanceof Select || $option instanceof Checkbox) && !($option instanceof ColorDBSelect)) {
|
||||||
|
|
||||||
$valid = false;
|
$valid = false;
|
||||||
$nextShouldBeValid = false;
|
$nextShouldBeValid = false;
|
||||||
$isDefaultValid = true;
|
$isDefaultValid = true;
|
||||||
$option->clearSelected();
|
$option->clearSelected();
|
||||||
/** @var Select\Opt $opt */
|
/** @var Select\Opt $opt */
|
||||||
foreach ($option->getOptions() as $opt) {
|
foreach ($option->getOptions() as $opt) {
|
||||||
if(count($opt->getEdgesCollectionContainer()) > 0) {
|
if (count($opt->getEdgesCollectionContainer()) > 0) {
|
||||||
$opt->setIsValid(false);
|
$opt->setIsValid(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
$groupsValid = [];
|
$groupsValid = [];
|
||||||
/** @var EdgeCollection $collection */
|
/** @var EdgeCollection $collection */
|
||||||
foreach($opt->getEdgesCollectionContainer() as $collection) {
|
foreach ($opt->getEdgesCollectionContainer() as $collection) {
|
||||||
if(!$withFormel && trim($collection->getFormel()) != "") continue;
|
if (!$withFormel && trim($collection->getFormel()) != '')
|
||||||
|
continue;
|
||||||
|
|
||||||
$groupsValid[$collection->getName()] = false;
|
$groupsValid[$collection->getName()] = false;
|
||||||
|
|
||||||
if(trim($collection->getFormel()) != "") {
|
if (trim($collection->getFormel()) != '') {
|
||||||
$value = $this->formelCalc->parse($collection->getFormel(), true);
|
$value = $this->formelCalc->parse($collection->getFormel(), true);
|
||||||
eval('$value = ' . $value . ';');
|
eval('$value = ' . $value . ';');
|
||||||
/** @var Edge $edge */
|
/** @var Edge $edge */
|
||||||
@ -85,7 +85,7 @@ class Valid
|
|||||||
$groupsValid[$collection->getName()] = true;
|
$groupsValid[$collection->getName()] = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}else {
|
} else {
|
||||||
/** @var Edge $edge */
|
/** @var Edge $edge */
|
||||||
foreach ($collection as $edge) {
|
foreach ($collection as $edge) {
|
||||||
if ($this->edgeIsValid($collection->getName(), $edge)) {
|
if ($this->edgeIsValid($collection->getName(), $edge)) {
|
||||||
@ -96,44 +96,57 @@ class Valid
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!in_array(false, $groupsValid)) {
|
if (!in_array(false, $groupsValid)) {
|
||||||
$opt->setIsValid(true);
|
$opt->setIsValid(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!$opt->isValid() && $opt->getId() == $option->getDefault() && $option->getSelectedOptions()->count() == 0) {
|
if (
|
||||||
|
!$opt->isValid() &&
|
||||||
|
$opt->getId() == $option->getDefault() &&
|
||||||
|
$option->getSelectedOptions()->count() == 0
|
||||||
|
) {
|
||||||
$isDefaultValid = false;
|
$isDefaultValid = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if($option->getDefault() === null && $opt->isValid()) {
|
if ($option->getDefault() === null && $opt->isValid()) {
|
||||||
$option->setDefault($opt->getId());
|
$option->setDefault($opt->getId());
|
||||||
if(!$this->engine->hasVariable($option->getId())) {
|
if (!$this->engine->hasVariable($option->getId())) {
|
||||||
$this->engine->setVariable($option->getId(), $opt->getId());
|
$this->engine->setVariable($option->getId(), $opt->getId());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if($option->getDefault() !== null && $opt->isValid() && !$isDefaultValid) {
|
if ($option->getDefault() !== null && $opt->isValid() && !$isDefaultValid) {
|
||||||
$option->setDefault($opt->getId());
|
$option->setDefault($opt->getId());
|
||||||
$this->engine->setVariable($option->getId(), $opt->getId());
|
$this->engine->setVariable($option->getId(), $opt->getId());
|
||||||
if(isset($this->engine->validVars[$option->getId()]) && $opt->getId() != $this->engine->validVars[$option->getId()]) {
|
if (
|
||||||
|
isset($this->engine->validVars[$option->getId()]) &&
|
||||||
|
$opt->getId() != $this->engine->validVars[$option->getId()]
|
||||||
|
) {
|
||||||
$this->engine->validDirty = true;
|
$this->engine->validDirty = true;
|
||||||
}
|
}
|
||||||
$isDefaultValid = true;
|
$isDefaultValid = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if($option instanceof Checkbox) {
|
if ($option instanceof Checkbox) {
|
||||||
if (isset($this->engine->getVariables()[$option->getId()]) && is_array($this->engine->getVariables()[$option->getId()]) && in_array($opt->getId(), $this->engine->getVariables()[$option->getId()])) {
|
if (
|
||||||
|
isset($this->engine->getVariables()[$option->getId()]) &&
|
||||||
|
is_array($this->engine->getVariables()[$option->getId()]) &&
|
||||||
|
in_array($opt->getId(), $this->engine->getVariables()[$option->getId()])
|
||||||
|
) {
|
||||||
$option->addSelectedOption($opt);
|
$option->addSelectedOption($opt);
|
||||||
}
|
}
|
||||||
}else {
|
} else {
|
||||||
if (isset($this->engine->getVariables()[$option->getId()]) && $this->engine->getVariables()[$option->getId()] == $opt->getId()) {
|
if (
|
||||||
if(!$opt->isValid()) {
|
isset($this->engine->getVariables()[$option->getId()]) &&
|
||||||
|
$this->engine->getVariables()[$option->getId()] == $opt->getId()
|
||||||
|
) {
|
||||||
|
if (!$opt->isValid()) {
|
||||||
$nextShouldBeValid = true;
|
$nextShouldBeValid = true;
|
||||||
} else {
|
} else {
|
||||||
$option->addSelectedOption($opt);
|
$option->addSelectedOption($opt);
|
||||||
}
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
if($nextShouldBeValid && $opt->isValid()) {
|
if ($nextShouldBeValid && $opt->isValid()) {
|
||||||
$this->engine->getVariables()[$option->getId()] = $opt->getId();
|
$this->engine->getVariables()[$option->getId()] = $opt->getId();
|
||||||
$option->addSelectedOption($opt);
|
$option->addSelectedOption($opt);
|
||||||
$nextShouldBeValid = false;
|
$nextShouldBeValid = false;
|
||||||
@ -141,14 +154,14 @@ class Valid
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if($opt->isValid() && !$valid) {
|
if ($opt->isValid() && !$valid) {
|
||||||
$valid = true;
|
$valid = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if($nextShouldBeValid && $option->getSelectedOptions()->count() === 0) {
|
if ($nextShouldBeValid && $option->getSelectedOptions()->count() === 0) {
|
||||||
foreach($option->getOptions() as $opt) {
|
foreach ($option->getOptions() as $opt) {
|
||||||
if($opt->isValid()) {
|
if ($opt->isValid()) {
|
||||||
$option->addSelectedOption($opt);
|
$option->addSelectedOption($opt);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -157,54 +170,51 @@ class Valid
|
|||||||
|
|
||||||
$option->processValue();
|
$option->processValue();
|
||||||
$option->setIsValid($valid);
|
$option->setIsValid($valid);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if($option instanceof ColorDBSelect) {
|
if ($option instanceof ColorDBSelect) {
|
||||||
if (isset($this->engine->getVariables()[$option->getId()])) {
|
if (isset($this->engine->getVariables()[$option->getId()])) {
|
||||||
$element = array_find((array)$option->getOptions(), function(ColorOpt $o1) use ($option) {
|
$element = array_find((array) $option->getOptions(), function (ColorOpt $o1) use ($option) {
|
||||||
return $o1->getId() === $this->engine->getVariables()[$option->getId()];
|
return $o1->getId() === $this->engine->getVariables()[$option->getId()];
|
||||||
});
|
});
|
||||||
if($element) {
|
if ($element) {
|
||||||
$option->addSelectedOption($element);
|
$option->addSelectedOption($element);
|
||||||
}else{
|
} else {
|
||||||
$option->addSelectedOption($option->getOptions()[0]);
|
$option->addSelectedOption($option->getOptions()[0]);
|
||||||
}
|
}
|
||||||
}elseif($option->getDefault() != null) {
|
} elseif ($option->getDefault() != null) {
|
||||||
$element = array_find((array)$option->getOptions(), function(ColorOpt $o1) use ($option) {
|
$element = array_find((array) $option->getOptions(), function (ColorOpt $o1) use ($option) {
|
||||||
return $o1->getId() === $option->getDefault();
|
return $o1->getId() === $option->getDefault();
|
||||||
});
|
});
|
||||||
$option->addSelectedOption($element);
|
$option->addSelectedOption($element);
|
||||||
}else{
|
} else {
|
||||||
$option->addSelectedOption($option->getOptions()[0]);
|
$option->addSelectedOption($option->getOptions()[0]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$mainEdges = true;
|
$mainEdges = true;
|
||||||
|
|
||||||
foreach($option->getEdgesCollectionContainer() as $collection) {
|
foreach ($option->getEdgesCollectionContainer() as $collection) {
|
||||||
/** @var Edge $edge */
|
/** @var Edge $edge */
|
||||||
$collValid = false;
|
$collValid = false;
|
||||||
foreach($collection as $edge) {
|
foreach ($collection as $edge) {
|
||||||
if(!$collValid && $this->edgeIsValid($collection->getName(), $edge)) {
|
if (!$collValid && $this->edgeIsValid($collection->getName(), $edge)) {
|
||||||
$collValid = true;
|
$collValid = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(!$collValid) {
|
if (!$collValid) {
|
||||||
$mainEdges = false;
|
$mainEdges = false;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!$mainEdges && $option->isValid()) {
|
if (!$mainEdges && $option->isValid()) {
|
||||||
$option->setIsValid(false);
|
$option->setIsValid(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->engine->setVariables($option->parseAdditionalValues($this->engine->getVariables()));
|
$this->engine->setVariables($option->parseAdditionalValues($this->engine->getVariables()));
|
||||||
$this->engine->addCalcVariable($option->getId() . '_valid', (int)$option->isValid());
|
$this->engine->addCalcVariable($option->getId() . '_valid', (int) $option->isValid());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private function edgeIsValid(mixed $section, Edge $edge): bool
|
private function edgeIsValid(mixed $section, Edge $edge): bool
|
||||||
@ -212,37 +222,49 @@ class Valid
|
|||||||
$valid = false;
|
$valid = false;
|
||||||
$skipTests = false;
|
$skipTests = false;
|
||||||
|
|
||||||
if(!isset($this->engine->getVariables()[$section])) {
|
if (!isset($this->engine->getVariables()[$section])) {
|
||||||
$skipTests = true;
|
$skipTests = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!$skipTests && !$valid && $edge->isRegion() &&
|
if (
|
||||||
$edge->getFrom() <= $this->engine->getVariables()[$section] &&
|
!$skipTests &&
|
||||||
$edge->getTo() >= $this->engine->getVariables()[$section]) {
|
!$valid &&
|
||||||
|
$edge->isRegion() &&
|
||||||
|
$edge->getFrom() <= $this->engine->getVariables()[$section] &&
|
||||||
|
$edge->getTo() >= $this->engine->getVariables()[$section]
|
||||||
|
) {
|
||||||
$valid = true;
|
$valid = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!$skipTests && !$valid && $edge->isRegion() &&
|
if (
|
||||||
$edge->getFrom() <= $this->engine->getVariables()[$section] &&
|
!$skipTests &&
|
||||||
$edge->getTo() == 0) {
|
!$valid &&
|
||||||
|
$edge->isRegion() &&
|
||||||
|
$edge->getFrom() <= $this->engine->getVariables()[$section] &&
|
||||||
|
$edge->getTo() == 0
|
||||||
|
) {
|
||||||
$valid = true;
|
$valid = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!$skipTests && !$valid && !$edge->isRegion() && in_array($this->engine->getVariables()[$section], $edge->getValues())) {
|
if (
|
||||||
$valid = true;
|
!$skipTests &&
|
||||||
|
!$valid &&
|
||||||
|
!$edge->isRegion() &&
|
||||||
|
in_array($this->engine->getVariables()[$section], $edge->getValues())
|
||||||
|
) {
|
||||||
|
$valid = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!$skipTests && $valid && $edge->getEdgesCollectionContainer()->count()) {
|
if (!$skipTests && $valid && $edge->getEdgesCollectionContainer()->count()) {
|
||||||
$valid = false;
|
$valid = false;
|
||||||
/** @var EdgeCollection $collection */
|
/** @var EdgeCollection $collection */
|
||||||
foreach($edge->getEdgesCollectionContainer() as $collection) {
|
foreach ($edge->getEdgesCollectionContainer() as $collection) {
|
||||||
foreach($collection as $subEdge) {
|
foreach ($collection as $subEdge) {
|
||||||
if(!$valid) {
|
if (!$valid) {
|
||||||
$valid = $this->edgeIsValid($collection->getName(), $subEdge);
|
$valid = $this->edgeIsValid($collection->getName(), $subEdge);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return $valid;
|
return $valid;
|
||||||
@ -250,19 +272,15 @@ class Valid
|
|||||||
|
|
||||||
private function edgeIsValidWithValue(mixed $value, Edge $edge): bool
|
private function edgeIsValidWithValue(mixed $value, Edge $edge): bool
|
||||||
{
|
{
|
||||||
if($edge->isRegion() &&
|
if ($edge->isRegion() && $edge->getFrom() <= $value && $edge->getTo() >= $value) {
|
||||||
$edge->getFrom() <= $value &&
|
|
||||||
$edge->getTo() >= $value) {
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if($edge->isRegion() &&
|
if ($edge->isRegion() && $edge->getFrom() <= $value && $edge->getTo() == 0) {
|
||||||
$edge->getFrom() <= $value &&
|
|
||||||
$edge->getTo() == 0) {
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!$edge->isRegion() && in_array($value, $edge->getValues())) {
|
if (!$edge->isRegion() && in_array($value, $edge->getValues())) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -215,6 +215,9 @@ class Select extends Base
|
|||||||
$this->element->setColorSystem($colorSystem);
|
$this->element->setColorSystem($colorSystem);
|
||||||
|
|
||||||
$this->element->addOptions($value);
|
$this->element->addOptions($value);
|
||||||
|
if ($this->element->getDefault() != '') {
|
||||||
|
$this->element->addSelectedOption($this->element->getOptionById($this->element->getDefault()));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private function parseModeColorDbJson(): void
|
private function parseModeColorDbJson(): void
|
||||||
@ -256,6 +259,9 @@ class Select extends Base
|
|||||||
$this->element->setColorSystem($colorSystem);
|
$this->element->setColorSystem($colorSystem);
|
||||||
|
|
||||||
$this->element->addOptions($value);
|
$this->element->addOptions($value);
|
||||||
|
if ($this->element->getDefault() != '') {
|
||||||
|
$this->element->addSelectedOption($this->element->getOptionById($this->element->getDefault()));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private function parseModeNormalXML()
|
private function parseModeNormalXML()
|
||||||
|
|||||||
@ -1,4 +1,5 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
namespace PSC\Library\Calc\Option\Type;
|
namespace PSC\Library\Calc\Option\Type;
|
||||||
|
|
||||||
use PSC\Library\Calc\Error\Validation\Base as PSCBase;
|
use PSC\Library\Calc\Error\Validation\Base as PSCBase;
|
||||||
@ -17,11 +18,11 @@ class Base
|
|||||||
protected $default = null;
|
protected $default = null;
|
||||||
|
|
||||||
/** @var string $help */
|
/** @var string $help */
|
||||||
protected ?string $help = null;
|
protected null|string $help = null;
|
||||||
|
|
||||||
protected ?string $helpLink = null;
|
protected null|string $helpLink = null;
|
||||||
|
|
||||||
protected ?string $helpId = null;
|
protected null|string $helpId = null;
|
||||||
|
|
||||||
/** @var boolean $require */
|
/** @var boolean $require */
|
||||||
protected $require = false;
|
protected $require = false;
|
||||||
@ -52,7 +53,7 @@ class Base
|
|||||||
protected $savedCalcValues = [];
|
protected $savedCalcValues = [];
|
||||||
private $amount = true;
|
private $amount = true;
|
||||||
|
|
||||||
protected Set $validationErrors;
|
protected Set $validationErrors;
|
||||||
|
|
||||||
public function __construct()
|
public function __construct()
|
||||||
{
|
{
|
||||||
@ -160,7 +161,7 @@ class Base
|
|||||||
$this->default = $default;
|
$this->default = $default;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getHelp(): ?string
|
public function getHelp(): null|string
|
||||||
{
|
{
|
||||||
return $this->help;
|
return $this->help;
|
||||||
}
|
}
|
||||||
@ -175,7 +176,7 @@ class Base
|
|||||||
$this->helpId = $var;
|
$this->helpId = $var;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getHelpId(): ?string
|
public function getHelpId(): null|string
|
||||||
{
|
{
|
||||||
return $this->helpId;
|
return $this->helpId;
|
||||||
}
|
}
|
||||||
@ -185,7 +186,7 @@ class Base
|
|||||||
$this->helpLink = $var;
|
$this->helpLink = $var;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getHelpLink(): ?string
|
public function getHelpLink(): null|string
|
||||||
{
|
{
|
||||||
return $this->helpLink;
|
return $this->helpLink;
|
||||||
}
|
}
|
||||||
@ -201,7 +202,7 @@ class Base
|
|||||||
/**
|
/**
|
||||||
* @param string $rawValue
|
* @param string $rawValue
|
||||||
*/
|
*/
|
||||||
public function setRawValue($rawValue)
|
public function setRawValue(mixed $rawValue): void
|
||||||
{
|
{
|
||||||
$this->rawValue = $rawValue;
|
$this->rawValue = $rawValue;
|
||||||
}
|
}
|
||||||
@ -331,12 +332,13 @@ class Base
|
|||||||
$this->amount = $amount;
|
$this->amount = $amount;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function toArray() : array {
|
public function toArray(): array
|
||||||
|
{
|
||||||
return [
|
return [
|
||||||
'id' => $this->getId(),
|
'id' => $this->getId(),
|
||||||
'name' => $this->getName(),
|
'name' => $this->getName(),
|
||||||
'type' => $this->getType(),
|
'type' => $this->getType(),
|
||||||
'valid' => $this->isValid()
|
'valid' => $this->isValid(),
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -345,18 +347,18 @@ class Base
|
|||||||
$obj = new \stdClass();
|
$obj = new \stdClass();
|
||||||
$obj->id = $this->getId();
|
$obj->id = $this->getId();
|
||||||
$obj->name = $this->getName();
|
$obj->name = $this->getName();
|
||||||
if($this->default !== null) {
|
if ($this->default !== null) {
|
||||||
$obj->default = $this->default;
|
$obj->default = $this->default;
|
||||||
}
|
}
|
||||||
$obj->dependencys = [];
|
$obj->dependencys = [];
|
||||||
if($this->isAjaxExport()) {
|
if ($this->isAjaxExport()) {
|
||||||
$obj->exportAjax = $this->isAjaxExport();
|
$obj->exportAjax = $this->isAjaxExport();
|
||||||
}
|
}
|
||||||
if($this->isDisplayOnly()) {
|
if ($this->isDisplayOnly()) {
|
||||||
$obj->displayOnly = $this->isDisplayOnly();
|
$obj->displayOnly = $this->isDisplayOnly();
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach($this->edgesCollectionContainer as $col) {
|
foreach ($this->edgesCollectionContainer as $col) {
|
||||||
$obj->dependencys[] = $col->generateJson();
|
$obj->dependencys[] = $col->generateJson();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -369,24 +371,24 @@ class Base
|
|||||||
'_attributes' => [
|
'_attributes' => [
|
||||||
'id' => $this->getId(),
|
'id' => $this->getId(),
|
||||||
'type' => ucfirst($this->getType()),
|
'type' => ucfirst($this->getType()),
|
||||||
]
|
],
|
||||||
];
|
];
|
||||||
if($this->name != "") {
|
if ($this->name != '') {
|
||||||
$tmp = array_merge_recursive($tmp, ['_attributes' => [
|
$tmp = array_merge_recursive($tmp, ['_attributes' => [
|
||||||
'name' => $this->name
|
'name' => $this->name,
|
||||||
]]);
|
]]);
|
||||||
}
|
}
|
||||||
if($this->isDisplayOnly()) {
|
if ($this->isDisplayOnly()) {
|
||||||
$tmp = array_merge_recursive($tmp, ['_attributes' => [
|
$tmp = array_merge_recursive($tmp, ['_attributes' => [
|
||||||
'displayOnly' => $this->isDisplayOnly()?'1':'0'
|
'displayOnly' => $this->isDisplayOnly() ? '1' : '0',
|
||||||
]]);
|
]]);
|
||||||
}
|
}
|
||||||
if($this->isAjaxExport()) {
|
if ($this->isAjaxExport()) {
|
||||||
$tmp = array_merge_recursive($tmp, ['_attributes' => [
|
$tmp = array_merge_recursive($tmp, ['_attributes' => [
|
||||||
'exportAjax' => $this->isAjaxExport()?'1':'0'
|
'exportAjax' => $this->isAjaxExport() ? '1' : '0',
|
||||||
]]);
|
]]);
|
||||||
}
|
}
|
||||||
foreach($this->edgesCollectionContainer as $col) {
|
foreach ($this->edgesCollectionContainer as $col) {
|
||||||
$tmp[$col->getName()] = $col->generateXML();
|
$tmp[$col->getName()] = $col->generateXML();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -39,6 +39,11 @@ class Select extends Base
|
|||||||
$this->options->append($option);
|
$this->options->append($option);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function getOptionById(string $id): null|Opt
|
||||||
|
{
|
||||||
|
return array_find((array) $this->options, fn($item) => $item->getId() == $id);
|
||||||
|
}
|
||||||
|
|
||||||
public function addOptions(array $options)
|
public function addOptions(array $options)
|
||||||
{
|
{
|
||||||
$this->options = new \ArrayIterator($options);
|
$this->options = new \ArrayIterator($options);
|
||||||
@ -56,6 +61,14 @@ class Select extends Base
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function setRawValue(mixed $value): void
|
||||||
|
{
|
||||||
|
parent::setRawValue($value);
|
||||||
|
if ($this->getSelectedOption() === null || $this->getSelectedOption()->getId() != $value) {
|
||||||
|
$this->addSelectedOption($this->getOptionById($value));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public function getValue()
|
public function getValue()
|
||||||
{
|
{
|
||||||
$this->processValue();
|
$this->processValue();
|
||||||
@ -88,14 +101,16 @@ class Select extends Base
|
|||||||
$this->container = $container;
|
$this->container = $container;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
public function getOptions(): \ArrayIterator
|
||||||
* @return \ArrayIterator
|
|
||||||
*/
|
|
||||||
public function getOptions()
|
|
||||||
{
|
{
|
||||||
return $this->options;
|
return $this->options;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function clearOptions(): void
|
||||||
|
{
|
||||||
|
$this->options = [];
|
||||||
|
}
|
||||||
|
|
||||||
public function clearSelected(): void
|
public function clearSelected(): void
|
||||||
{
|
{
|
||||||
$this->selectedOptions = new \ArrayIterator();
|
$this->selectedOptions = new \ArrayIterator();
|
||||||
|
|||||||
@ -1,4 +1,5 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
namespace PSC\Library\Calc\Tests\Calc;
|
namespace PSC\Library\Calc\Tests\Calc;
|
||||||
|
|
||||||
use PHPUnit\Framework\TestCase;
|
use PHPUnit\Framework\TestCase;
|
||||||
@ -42,4 +43,17 @@ class ColorDBTest extends TestCase
|
|||||||
$this->assertSame('78', $option->getSelectedOption()->getId());
|
$this->assertSame('78', $option->getSelectedOption()->getId());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function testSetVar()
|
||||||
|
{
|
||||||
|
$this->engine->setVariable('colorpantone', '128');
|
||||||
|
$this->engine->calc();
|
||||||
|
|
||||||
|
$this->assertSame(
|
||||||
|
'128',
|
||||||
|
$this->engine
|
||||||
|
->getArticle()
|
||||||
|
->getOptionById('colorpantone')
|
||||||
|
->getRawValue(),
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,4 +1,5 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
namespace PSC\Library\Calc\Tests\Customer\GG;
|
namespace PSC\Library\Calc\Tests\Customer\GG;
|
||||||
|
|
||||||
use PHPUnit\Framework\TestCase;
|
use PHPUnit\Framework\TestCase;
|
||||||
@ -10,7 +11,6 @@ use PSC\Library\Calc\Tests\Mock\PaperRepostory;
|
|||||||
|
|
||||||
class CalcTest extends TestCase
|
class CalcTest extends TestCase
|
||||||
{
|
{
|
||||||
|
|
||||||
/** @var Engine */
|
/** @var Engine */
|
||||||
protected $engine = null;
|
protected $engine = null;
|
||||||
|
|
||||||
@ -29,8 +29,6 @@ class CalcTest extends TestCase
|
|||||||
$this->engine->setTemplates(file_get_contents(__DIR__ . '/calcTemplates.xml'));
|
$this->engine->setTemplates(file_get_contents(__DIR__ . '/calcTemplates.xml'));
|
||||||
|
|
||||||
$this->engine->loadString(file_get_contents(__DIR__ . '/calc.xml'));
|
$this->engine->loadString(file_get_contents(__DIR__ . '/calc.xml'));
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function tearDown(): void
|
public function tearDown(): void
|
||||||
@ -52,8 +50,19 @@ class CalcTest extends TestCase
|
|||||||
$this->engine->setVariable('farbe_2_v_wert_pantone', '7555');
|
$this->engine->setVariable('farbe_2_v_wert_pantone', '7555');
|
||||||
$this->engine->calc();
|
$this->engine->calc();
|
||||||
$this->assertSame(175.75, $this->engine->getPrice());
|
$this->assertSame(175.75, $this->engine->getPrice());
|
||||||
$this->assertSame($this->engine->getArticle()->getOptionById('farbe_1_v_wert_pantone')->getRawValue(), '128');
|
$this->assertSame(
|
||||||
$this->assertSame($this->engine->getArticle()->getOptionById('farbe_2_v_wert_pantone')->getRawValue(), '7555');
|
$this->engine
|
||||||
|
->getArticle()
|
||||||
|
->getOptionById('farbe_1_v_wert_pantone')
|
||||||
|
->getRawValue(),
|
||||||
|
'128',
|
||||||
|
);
|
||||||
|
$this->assertSame(
|
||||||
|
$this->engine
|
||||||
|
->getArticle()
|
||||||
|
->getOptionById('farbe_2_v_wert_pantone')
|
||||||
|
->getRawValue(),
|
||||||
|
'7555',
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,4 +1,5 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
namespace PSC\Library\Calc\Tests\Json;
|
namespace PSC\Library\Calc\Tests\Json;
|
||||||
|
|
||||||
use PHPUnit\Framework\TestCase;
|
use PHPUnit\Framework\TestCase;
|
||||||
@ -11,31 +12,34 @@ class FromJsonTest extends TestCase
|
|||||||
public function testFromJson()
|
public function testFromJson()
|
||||||
{
|
{
|
||||||
$engine1 = new Engine();
|
$engine1 = new Engine();
|
||||||
self::assertTrue($engine1->loadJson(file_get_contents(__DIR__ .'/from.json')));
|
self::assertTrue($engine1->loadJson(file_get_contents(__DIR__ . '/from.json')));
|
||||||
self::assertCount(1, $engine1->getArticles());
|
self::assertCount(1, $engine1->getArticles());
|
||||||
self::assertInstanceOf(Input::class, $engine1->getArticle()->getOptionById('auflage'));
|
self::assertInstanceOf(Input::class, $engine1->getArticle()->getOptionById('auflage'));
|
||||||
|
|
||||||
$engine2 = new Engine();
|
$engine2 = new Engine();
|
||||||
self::assertTrue($engine2->loadString(file_get_contents(__DIR__ .'/from.xml')));
|
self::assertTrue($engine2->loadString(file_get_contents(__DIR__ . '/from.xml')));
|
||||||
self::assertCount(1, $engine2->getArticles());
|
self::assertCount(1, $engine2->getArticles());
|
||||||
self::assertInstanceOf(Input::class, $engine2->getArticle()->getOptionById('auflage'));
|
self::assertInstanceOf(Input::class, $engine2->getArticle()->getOptionById('auflage'));
|
||||||
self::assertSame(1011.42, $engine1->getPrice());
|
self::assertSame(1011.42, $engine1->getPrice());
|
||||||
|
|
||||||
self::assertSame($engine1->getPrice(), $engine2->getPrice());
|
self::assertSame($engine1->getPrice(), $engine2->getPrice());
|
||||||
|
self::assertEqualsCanonicalizing(
|
||||||
|
$engine1->getArticle()->getOptionById('farbe1')->getSelectedOption(),
|
||||||
|
$engine2->getArticle()->getOptionById('farbe1')->getSelectedOption(),
|
||||||
|
);
|
||||||
self::assertEqualsCanonicalizing($engine1->getArticle(), $engine2->getArticle());
|
self::assertEqualsCanonicalizing($engine1->getArticle(), $engine2->getArticle());
|
||||||
$tempXML = tempnam(sys_get_temp_dir(), 'calc');
|
$tempXML = tempnam(sys_get_temp_dir(), 'calc');
|
||||||
$tempJson = tempnam(sys_get_temp_dir(), 'calc');
|
$tempJson = tempnam(sys_get_temp_dir(), 'calc');
|
||||||
file_put_contents($tempXML, $engine1->generateXML());
|
file_put_contents($tempXML, $engine1->generateXML());
|
||||||
file_put_contents($tempJson, $engine2->generateJson());
|
file_put_contents($tempJson, $engine2->generateJson());
|
||||||
|
|
||||||
self::assertJsonFileEqualsJsonFile(__DIR__.'/from.json', $tempJson);
|
self::assertJsonFileEqualsJsonFile(__DIR__ . '/from.json', $tempJson);
|
||||||
self::assertXmlFileEqualsXmlFile(__DIR__.'/from.xml', $tempXML);
|
self::assertXmlFileEqualsXmlFile(__DIR__ . '/from.xml', $tempXML);
|
||||||
|
|
||||||
self::assertCount(5, $engine1->getArticle()->getOptionById('farbigkeit')->getOptions());
|
self::assertCount(5, $engine1->getArticle()->getOptionById('farbigkeit')->getOptions());
|
||||||
self::assertCount(5, $engine2->getArticle()->getOptionById('farbigkeit')->getOptions());
|
self::assertCount(5, $engine2->getArticle()->getOptionById('farbigkeit')->getOptions());
|
||||||
|
|
||||||
@unlink($tempXML);
|
unlink($tempXML);
|
||||||
@unlink($tempJson);
|
unlink($tempJson);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1 +1,297 @@
|
|||||||
[{"uuid":"df2df718-b28e-482d-bf0c-67d246f05d32","name":"Test Artikel","options":[{"id":"auflage","name":"Auflage","default":"100","dependencys":[],"placeHolder":"Placeholder","required":false,"type":2},{"id":"seiten_umschlag","name":"Seiten Umschlag","default":"2","dependencys":[],"placeHolder":"Placeholder","required":false,"type":2},{"id":"seiten_anzahl_inhalt","name":"Seiten Anzahl Inhalt","default":"10","dependencys":[{"relation":"auflage","formula":"","borders":[{"calcValue":"","calcValue1":"","calcValue2":"","calcValue3":"","calcValue4":"","calcValue5":"","calcValue6":"","calcValue7":"","calcValue8":"","calcValue9":"","calcValue10":"","flatRate":"","formula":"$Vauflage$V*0.12","price":0,"value":"1-10","dependencys":[{"relation":"seiten_umschlag","formula":"","borders":[{"calcValue":"","calcValue1":"","calcValue2":"","calcValue3":"","calcValue4":"","calcValue5":"","calcValue6":"","calcValue7":"","calcValue8":"","calcValue9":"","calcValue10":"","flatRate":"","formula":"$Vseiten_umschlag$V*0.24","price":0,"value":"1-2","dependencys":[]},{"calcValue":"","calcValue1":"","calcValue2":"","calcValue3":"","calcValue4":"","calcValue5":"","calcValue6":"","calcValue7":"","calcValue8":"","calcValue9":"","calcValue10":"","flatRate":"","formula":"$Vseiten_umschlag$V*0.23","price":0,"value":"3-","dependencys":[]}]}]},{"calcValue":"","calcValue1":"","calcValue2":"","calcValue3":"","calcValue4":"","calcValue5":"","calcValue6":"","calcValue7":"","calcValue8":"","calcValue9":"","calcValue10":"","flatRate":"","formula":"$Vauflage$V*0.11","price":0,"value":"11-","dependencys":[{"relation":"seiten_umschlag","formula":"","borders":[{"calcValue":"","calcValue1":"","calcValue2":"","calcValue3":"","calcValue4":"","calcValue5":"","calcValue6":"","calcValue7":"","calcValue8":"","calcValue9":"","calcValue10":"","flatRate":"","formula":"$Vseiten_umschlag$V*0.21","price":0,"value":"1-2","dependencys":[]},{"calcValue":"","calcValue1":"","calcValue2":"","calcValue3":"","calcValue4":"","calcValue5":"","calcValue6":"","calcValue7":"","calcValue8":"","calcValue9":"","calcValue10":"","flatRate":"","formula":"$Vseiten_umschlag$V*0.20","price":0,"value":"3-","dependencys":[]}]}]}]}],"placeHolder":"Placeholder","required":true,"type":2},{"id":"farbigkeit","name":"Farbigkeit","default":"10","dependencys":[],"type":3,"options":[{"id":"10","name":"1\/0 farbig","dependencys":[{"relation":"auflage","formula":"","borders":[{"calcValue":"","calcValue1":"","calcValue2":"","calcValue3":"","calcValue4":"","calcValue5":"","calcValue6":"","calcValue7":"","calcValue8":"","calcValue9":"","calcValue10":"","flatRate":"","formula":"","price":0,"value":"1-101","dependencys":[]}]}]},{"id":"11","name":"1\/1 farbig","dependencys":[]},{"id":"20","name":"2\/0 farbig","dependencys":[]},{"id":"21","name":"2\/1 farbig","dependencys":[]},{"id":"22","name":"2\/2 farbig","dependencys":[{"relation":"auflage","formula":"","borders":[{"calcValue":"","calcValue1":"","calcValue2":"","calcValue3":"","calcValue4":"","calcValue5":"","calcValue6":"","calcValue7":"","calcValue8":"","calcValue9":"","calcValue10":"","flatRate":"","formula":"","price":0,"value":"11-50","dependencys":[]}]}]}],"mode":"normal"},{"id":"calc","name":"calc","dependencys":[{"relation":"auflage","formula":"","borders":[{"calcValue":"","calcValue1":"","calcValue2":"","calcValue3":"","calcValue4":"","calcValue5":"","calcValue6":"","calcValue7":"","calcValue8":"","calcValue9":"","calcValue10":"","flatRate":"","formula":"$Vauflage$V*$Vseiten_anzahl_inhalt$V","price":0,"value":"1-","dependencys":[]}]}],"type":1}]}]
|
[
|
||||||
|
{
|
||||||
|
"uuid": "df2df718-b28e-482d-bf0c-67d246f05d32",
|
||||||
|
"name": "Test Artikel",
|
||||||
|
"options": [
|
||||||
|
{
|
||||||
|
"id": "auflage",
|
||||||
|
"name": "Auflage",
|
||||||
|
"default": "100",
|
||||||
|
"dependencys": [],
|
||||||
|
"placeHolder": "Placeholder",
|
||||||
|
"required": false,
|
||||||
|
"type": 2
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "seiten_umschlag",
|
||||||
|
"name": "Seiten Umschlag",
|
||||||
|
"default": "2",
|
||||||
|
"dependencys": [],
|
||||||
|
"placeHolder": "Placeholder",
|
||||||
|
"required": false,
|
||||||
|
"type": 2
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "farbe1",
|
||||||
|
"name": "Farbe1",
|
||||||
|
"default": "142",
|
||||||
|
"container": "pantone+-solid-uncoated",
|
||||||
|
"mode": "colordb",
|
||||||
|
"dependencys": [],
|
||||||
|
"required": true,
|
||||||
|
"options": [
|
||||||
|
{
|
||||||
|
"dependencys": [],
|
||||||
|
"id": "142",
|
||||||
|
"name": "142"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"type": 3
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "seiten_anzahl_inhalt",
|
||||||
|
"name": "Seiten Anzahl Inhalt",
|
||||||
|
"default": "10",
|
||||||
|
"dependencys": [
|
||||||
|
{
|
||||||
|
"relation": "auflage",
|
||||||
|
"formula": "",
|
||||||
|
"borders": [
|
||||||
|
{
|
||||||
|
"calcValue": "",
|
||||||
|
"calcValue1": "",
|
||||||
|
"calcValue2": "",
|
||||||
|
"calcValue3": "",
|
||||||
|
"calcValue4": "",
|
||||||
|
"calcValue5": "",
|
||||||
|
"calcValue6": "",
|
||||||
|
"calcValue7": "",
|
||||||
|
"calcValue8": "",
|
||||||
|
"calcValue9": "",
|
||||||
|
"calcValue10": "",
|
||||||
|
"flatRate": "",
|
||||||
|
"formula": "$Vauflage$V*0.12",
|
||||||
|
"price": 0,
|
||||||
|
"value": "1-10",
|
||||||
|
"dependencys": [
|
||||||
|
{
|
||||||
|
"relation": "seiten_umschlag",
|
||||||
|
"formula": "",
|
||||||
|
"borders": [
|
||||||
|
{
|
||||||
|
"calcValue": "",
|
||||||
|
"calcValue1": "",
|
||||||
|
"calcValue2": "",
|
||||||
|
"calcValue3": "",
|
||||||
|
"calcValue4": "",
|
||||||
|
"calcValue5": "",
|
||||||
|
"calcValue6": "",
|
||||||
|
"calcValue7": "",
|
||||||
|
"calcValue8": "",
|
||||||
|
"calcValue9": "",
|
||||||
|
"calcValue10": "",
|
||||||
|
"flatRate": "",
|
||||||
|
"formula": "$Vseiten_umschlag$V*0.24",
|
||||||
|
"price": 0,
|
||||||
|
"value": "1-2",
|
||||||
|
"dependencys": []
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"calcValue": "",
|
||||||
|
"calcValue1": "",
|
||||||
|
"calcValue2": "",
|
||||||
|
"calcValue3": "",
|
||||||
|
"calcValue4": "",
|
||||||
|
"calcValue5": "",
|
||||||
|
"calcValue6": "",
|
||||||
|
"calcValue7": "",
|
||||||
|
"calcValue8": "",
|
||||||
|
"calcValue9": "",
|
||||||
|
"calcValue10": "",
|
||||||
|
"flatRate": "",
|
||||||
|
"formula": "$Vseiten_umschlag$V*0.23",
|
||||||
|
"price": 0,
|
||||||
|
"value": "3-",
|
||||||
|
"dependencys": []
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"calcValue": "",
|
||||||
|
"calcValue1": "",
|
||||||
|
"calcValue2": "",
|
||||||
|
"calcValue3": "",
|
||||||
|
"calcValue4": "",
|
||||||
|
"calcValue5": "",
|
||||||
|
"calcValue6": "",
|
||||||
|
"calcValue7": "",
|
||||||
|
"calcValue8": "",
|
||||||
|
"calcValue9": "",
|
||||||
|
"calcValue10": "",
|
||||||
|
"flatRate": "",
|
||||||
|
"formula": "$Vauflage$V*0.11",
|
||||||
|
"price": 0,
|
||||||
|
"value": "11-",
|
||||||
|
"dependencys": [
|
||||||
|
{
|
||||||
|
"relation": "seiten_umschlag",
|
||||||
|
"formula": "",
|
||||||
|
"borders": [
|
||||||
|
{
|
||||||
|
"calcValue": "",
|
||||||
|
"calcValue1": "",
|
||||||
|
"calcValue2": "",
|
||||||
|
"calcValue3": "",
|
||||||
|
"calcValue4": "",
|
||||||
|
"calcValue5": "",
|
||||||
|
"calcValue6": "",
|
||||||
|
"calcValue7": "",
|
||||||
|
"calcValue8": "",
|
||||||
|
"calcValue9": "",
|
||||||
|
"calcValue10": "",
|
||||||
|
"flatRate": "",
|
||||||
|
"formula": "$Vseiten_umschlag$V*0.21",
|
||||||
|
"price": 0,
|
||||||
|
"value": "1-2",
|
||||||
|
"dependencys": []
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"calcValue": "",
|
||||||
|
"calcValue1": "",
|
||||||
|
"calcValue2": "",
|
||||||
|
"calcValue3": "",
|
||||||
|
"calcValue4": "",
|
||||||
|
"calcValue5": "",
|
||||||
|
"calcValue6": "",
|
||||||
|
"calcValue7": "",
|
||||||
|
"calcValue8": "",
|
||||||
|
"calcValue9": "",
|
||||||
|
"calcValue10": "",
|
||||||
|
"flatRate": "",
|
||||||
|
"formula": "$Vseiten_umschlag$V*0.20",
|
||||||
|
"price": 0,
|
||||||
|
"value": "3-",
|
||||||
|
"dependencys": []
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"placeHolder": "Placeholder",
|
||||||
|
"required": true,
|
||||||
|
"type": 2
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "farbigkeit",
|
||||||
|
"name": "Farbigkeit",
|
||||||
|
"default": "10",
|
||||||
|
"dependencys": [],
|
||||||
|
"type": 3,
|
||||||
|
"options": [
|
||||||
|
{
|
||||||
|
"id": "10",
|
||||||
|
"name": "1\/0 farbig",
|
||||||
|
"dependencys": [
|
||||||
|
{
|
||||||
|
"relation": "auflage",
|
||||||
|
"formula": "",
|
||||||
|
"borders": [
|
||||||
|
{
|
||||||
|
"calcValue": "",
|
||||||
|
"calcValue1": "",
|
||||||
|
"calcValue2": "",
|
||||||
|
"calcValue3": "",
|
||||||
|
"calcValue4": "",
|
||||||
|
"calcValue5": "",
|
||||||
|
"calcValue6": "",
|
||||||
|
"calcValue7": "",
|
||||||
|
"calcValue8": "",
|
||||||
|
"calcValue9": "",
|
||||||
|
"calcValue10": "",
|
||||||
|
"flatRate": "",
|
||||||
|
"formula": "",
|
||||||
|
"price": 0,
|
||||||
|
"value": "1-101",
|
||||||
|
"dependencys": []
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "11",
|
||||||
|
"name": "1\/1 farbig",
|
||||||
|
"dependencys": []
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "20",
|
||||||
|
"name": "2\/0 farbig",
|
||||||
|
"dependencys": []
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "21",
|
||||||
|
"name": "2\/1 farbig",
|
||||||
|
"dependencys": []
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "22",
|
||||||
|
"name": "2\/2 farbig",
|
||||||
|
"dependencys": [
|
||||||
|
{
|
||||||
|
"relation": "auflage",
|
||||||
|
"formula": "",
|
||||||
|
"borders": [
|
||||||
|
{
|
||||||
|
"calcValue": "",
|
||||||
|
"calcValue1": "",
|
||||||
|
"calcValue2": "",
|
||||||
|
"calcValue3": "",
|
||||||
|
"calcValue4": "",
|
||||||
|
"calcValue5": "",
|
||||||
|
"calcValue6": "",
|
||||||
|
"calcValue7": "",
|
||||||
|
"calcValue8": "",
|
||||||
|
"calcValue9": "",
|
||||||
|
"calcValue10": "",
|
||||||
|
"flatRate": "",
|
||||||
|
"formula": "",
|
||||||
|
"price": 0,
|
||||||
|
"value": "11-50",
|
||||||
|
"dependencys": []
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"mode": "normal"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "calc",
|
||||||
|
"name": "calc",
|
||||||
|
"dependencys": [
|
||||||
|
{
|
||||||
|
"relation": "auflage",
|
||||||
|
"formula": "",
|
||||||
|
"borders": [
|
||||||
|
{
|
||||||
|
"calcValue": "",
|
||||||
|
"calcValue1": "",
|
||||||
|
"calcValue2": "",
|
||||||
|
"calcValue3": "",
|
||||||
|
"calcValue4": "",
|
||||||
|
"calcValue5": "",
|
||||||
|
"calcValue6": "",
|
||||||
|
"calcValue7": "",
|
||||||
|
"calcValue8": "",
|
||||||
|
"calcValue9": "",
|
||||||
|
"calcValue10": "",
|
||||||
|
"flatRate": "",
|
||||||
|
"formula": "$Vauflage$V*$Vseiten_anzahl_inhalt$V",
|
||||||
|
"price": 0,
|
||||||
|
"value": "1-",
|
||||||
|
"dependencys": []
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"type": 1
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
|||||||
@ -7,10 +7,14 @@
|
|||||||
|
|
||||||
<option id="auflage" name="Auflage" type="Input" placeholder="Placeholder" default="100"></option>
|
<option id="auflage" name="Auflage" type="Input" placeholder="Placeholder" default="100"></option>
|
||||||
|
|
||||||
<option id="seiten_umschlag" name="Seiten Umschlag" type="Input" default="2" placeholder="Placeholder"></option>
|
<option id="seiten_umschlag" name="Seiten Umschlag" type="Input" default="2"
|
||||||
|
placeholder="Placeholder"></option>
|
||||||
|
|
||||||
|
<option id="farbe1" name="Farbe1" type="Select"
|
||||||
|
mode="colordb" container="pantone+-solid-uncoated" default="142" require="true" />
|
||||||
|
|
||||||
<option id="seiten_anzahl_inhalt" name="Seiten Anzahl Inhalt" type="Input" default="10" require="true" placeholder="Placeholder">
|
<option id="seiten_anzahl_inhalt" name="Seiten Anzahl Inhalt" type="Input" default="10"
|
||||||
|
require="true" placeholder="Placeholder">
|
||||||
<auflage>
|
<auflage>
|
||||||
<grenze formel="$Vauflage$V*0.12" value="1-10">
|
<grenze formel="$Vauflage$V*0.12" value="1-10">
|
||||||
<seiten_umschlag>
|
<seiten_umschlag>
|
||||||
|
|||||||
@ -7,6 +7,9 @@
|
|||||||
|
|
||||||
<option id="auflage" name="Auflage" type="Input" placeholder="Placeholder" default="100"></option>
|
<option id="auflage" name="Auflage" type="Input" placeholder="Placeholder" default="100"></option>
|
||||||
|
|
||||||
|
<option id="farbe1" name="Farbe1" type="Select"
|
||||||
|
mode="colordb" container="pantone+-solid-uncoated" default="142" require="true" />
|
||||||
|
|
||||||
<option id="startkosten_1c" name="Startkosten 1C" type="Hidden" default="1">
|
<option id="startkosten_1c" name="Startkosten 1C" type="Hidden" default="1">
|
||||||
<farbigkeit_inhalt>
|
<farbigkeit_inhalt>
|
||||||
<!-- einfarbiger Inhalt -->
|
<!-- einfarbiger Inhalt -->
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user