Fixes
This commit is contained in:
parent
cce8f3c45e
commit
9315b49dfa
4198
cobertura.xml
4198
cobertura.xml
File diff suppressed because it is too large
Load Diff
@ -56,10 +56,11 @@ class Valid
|
||||
$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;
|
||||
$nextShouldBeValid = false;
|
||||
$isDefaultValid = true;
|
||||
$savedVar = null;
|
||||
$option->clearSelected();
|
||||
/** @var Select\Opt $opt */
|
||||
foreach ($option->getOptions() as $opt) {
|
||||
@ -101,9 +102,9 @@ class Valid
|
||||
}
|
||||
|
||||
if (
|
||||
!$opt->isValid() &&
|
||||
$opt->getId() == $option->getDefault() &&
|
||||
$option->getSelectedOptions()->count() == 0
|
||||
!$opt->isValid()
|
||||
&& $opt->getId() == $option->getDefault()
|
||||
&& $option->getSelectedOptions()->count() == 0
|
||||
) {
|
||||
$isDefaultValid = false;
|
||||
}
|
||||
@ -117,10 +118,13 @@ class Valid
|
||||
|
||||
if ($option->getDefault() !== null && $opt->isValid() && !$isDefaultValid) {
|
||||
$option->setDefault($opt->getId());
|
||||
if ($this->engine->hasVariable($option->getId())) {
|
||||
$savedVar = $this->engine->getVariables()[$option->getId()];
|
||||
}
|
||||
$this->engine->setVariable($option->getId(), $opt->getId());
|
||||
if (
|
||||
isset($this->engine->validVars[$option->getId()]) &&
|
||||
$opt->getId() != $this->engine->validVars[$option->getId()]
|
||||
isset($this->engine->validVars[$option->getId()])
|
||||
&& $opt->getId() != $this->engine->validVars[$option->getId()]
|
||||
) {
|
||||
$this->engine->validDirty = true;
|
||||
}
|
||||
@ -129,16 +133,16 @@ class Valid
|
||||
|
||||
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()])
|
||||
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);
|
||||
}
|
||||
} else {
|
||||
if (
|
||||
isset($this->engine->getVariables()[$option->getId()]) &&
|
||||
$this->engine->getVariables()[$option->getId()] == $opt->getId()
|
||||
isset($this->engine->getVariables()[$option->getId()])
|
||||
&& $this->engine->getVariables()[$option->getId()] == $opt->getId()
|
||||
) {
|
||||
if (!$opt->isValid()) {
|
||||
$nextShouldBeValid = true;
|
||||
@ -146,6 +150,10 @@ class Valid
|
||||
$option->addSelectedOption($opt);
|
||||
}
|
||||
} else {
|
||||
if ($savedVar == $opt->getId() && $opt->isValid()) {
|
||||
$this->engine->setVariable($option->getId(), $opt->getId());
|
||||
$option->addSelectedOption($opt);
|
||||
}
|
||||
if ($nextShouldBeValid && $opt->isValid()) {
|
||||
$this->engine->getVariables()[$option->getId()] = $opt->getId();
|
||||
$option->addSelectedOption($opt);
|
||||
@ -227,30 +235,30 @@ class Valid
|
||||
}
|
||||
|
||||
if (
|
||||
!$skipTests &&
|
||||
!$valid &&
|
||||
$edge->isRegion() &&
|
||||
$edge->getFrom() <= $this->engine->getVariables()[$section] &&
|
||||
$edge->getTo() >= $this->engine->getVariables()[$section]
|
||||
!$skipTests
|
||||
&& !$valid
|
||||
&& $edge->isRegion()
|
||||
&& $edge->getFrom() <= $this->engine->getVariables()[$section]
|
||||
&& $edge->getTo() >= $this->engine->getVariables()[$section]
|
||||
) {
|
||||
$valid = true;
|
||||
}
|
||||
|
||||
if (
|
||||
!$skipTests &&
|
||||
!$valid &&
|
||||
$edge->isRegion() &&
|
||||
$edge->getFrom() <= $this->engine->getVariables()[$section] &&
|
||||
$edge->getTo() == 0
|
||||
!$skipTests
|
||||
&& !$valid
|
||||
&& $edge->isRegion()
|
||||
&& $edge->getFrom() <= $this->engine->getVariables()[$section]
|
||||
&& $edge->getTo() == 0
|
||||
) {
|
||||
$valid = true;
|
||||
}
|
||||
|
||||
if (
|
||||
!$skipTests &&
|
||||
!$valid &&
|
||||
!$edge->isRegion() &&
|
||||
in_array($this->engine->getVariables()[$section], $edge->getValues())
|
||||
!$skipTests
|
||||
&& !$valid
|
||||
&& !$edge->isRegion()
|
||||
&& in_array($this->engine->getVariables()[$section], $edge->getValues())
|
||||
) {
|
||||
$valid = true;
|
||||
}
|
||||
|
||||
@ -19,9 +19,9 @@ use Spatie\ArrayToXml\ArrayToXml;
|
||||
|
||||
class Engine
|
||||
{
|
||||
protected null|\SimpleXMLElement $xml = null;
|
||||
protected ?\SimpleXMLElement $xml = null;
|
||||
|
||||
protected null|array $json = null;
|
||||
protected ?array $json = null;
|
||||
|
||||
protected \ArrayIterator $articles;
|
||||
|
||||
@ -52,7 +52,7 @@ class Engine
|
||||
/** @var array */
|
||||
protected $debugCalcFormel = [];
|
||||
|
||||
protected null|Graph $calcGraph = null;
|
||||
protected ?Graph $calcGraph = null;
|
||||
|
||||
/** @var array */
|
||||
protected $debugCalcVariables = [];
|
||||
@ -291,7 +291,7 @@ class Engine
|
||||
$switchedOptions = $this->checkDoubleOptions();
|
||||
if (count($switchedOptions) > 0) {
|
||||
foreach ($switchedOptions as $option) {
|
||||
if ($option->getDefault() !== null && !($option instanceof Text)) {
|
||||
if ($option->getDefault() !== null && !$option instanceof Text) {
|
||||
if ($option instanceof Checkbox) {
|
||||
$this->variables[$option->getId()] = explode(',', $option->getDefault());
|
||||
} else {
|
||||
@ -316,11 +316,7 @@ class Engine
|
||||
unParsed: implode(',', $variable),
|
||||
));
|
||||
} elseif ($variable != null) {
|
||||
$this->calcGraph->addPart(new Part(
|
||||
type: PartType::Value,
|
||||
name: $key,
|
||||
unParsed: $variable,
|
||||
));
|
||||
$this->calcGraph->addPart(new Part(type: PartType::Value, name: $key, unParsed: $variable));
|
||||
}
|
||||
}
|
||||
|
||||
@ -333,11 +329,7 @@ class Engine
|
||||
unParsed: implode(',', $variable),
|
||||
));
|
||||
} elseif ($variable != null) {
|
||||
$this->calcGraph->addPart(new Part(
|
||||
type: PartType::CalcValue,
|
||||
name: $key,
|
||||
unParsed: $variable,
|
||||
));
|
||||
$this->calcGraph->addPart(new Part(type: PartType::CalcValue, name: $key, unParsed: $variable));
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -358,9 +350,9 @@ class Engine
|
||||
$option->setSavedCalcValues($this->savedCalcValues);
|
||||
|
||||
if (
|
||||
!isset($this->variables[$option->getId()]) &&
|
||||
$option->getDefault() !== null &&
|
||||
!($option instanceof Text)
|
||||
!isset($this->variables[$option->getId()])
|
||||
&& $option->getDefault() !== null
|
||||
&& !$option instanceof Text
|
||||
) {
|
||||
if ($option instanceof Checkbox) {
|
||||
$this->variables[$option->getId()] = explode(',', $option->getDefault());
|
||||
|
||||
@ -29,8 +29,6 @@ class CalcTest extends TestCase
|
||||
$this->engine->setTemplates(file_get_contents(__DIR__ . '/calcTemplates.xml'));
|
||||
|
||||
$this->engine->loadString(file_get_contents(__DIR__ . '/calc.xml'));
|
||||
|
||||
|
||||
}
|
||||
|
||||
public function tearDown(): void
|
||||
@ -54,134 +52,129 @@ class CalcTest extends TestCase
|
||||
public function testPricePaper1(): void
|
||||
{
|
||||
$this->engine->setVariables([
|
||||
'preisart_nopresentationall' => '1',
|
||||
'festpreis_nopresentationall' => '1',
|
||||
'produktart_nopresentationpdf' => '10',
|
||||
'kalkparameterprodukt_nopresentationpdf' => '10',
|
||||
'datacheck' => '1',
|
||||
'korrektur' => '1',
|
||||
'produktion' => '1',
|
||||
'eformat' => '62370H',
|
||||
'nutzenrechner_nopresentationpdf' => '1',
|
||||
'plano' => '0',
|
||||
'oformatU' => 'XXXXXXXX',
|
||||
'formatpapierlaufrichtungU_nopresentationpdf' => '0',
|
||||
'oformat' => '02100297',
|
||||
'formatpapierlaufrichtung_nopresentationpdf' => '0',
|
||||
'broschuereklammer500' => '0',
|
||||
'broschuereklammer500param' => '0',
|
||||
'druckenU_nopresentationpdf' => 'X',
|
||||
'drucken1xxU_nopresentationpdf' => 'X',
|
||||
'farbeU' => 'X',
|
||||
'schneiden200U_nopresentationpdf' => 'X',
|
||||
'multifinisher400U_nopresentationpdf' => '0',
|
||||
'multifinisher400Uparam1_nopresentationpdf' => '0',
|
||||
'falzen302U_nopresentationpdf' => 'X',
|
||||
'drucken_nopresentationpdf' => '1',
|
||||
'drucken1xx_nopresentationpdf' => '1a',
|
||||
'farbe' => '4f4f',
|
||||
'schneiden200_nopresentationpdf' => '1',
|
||||
'multifinisher400_nopresentationpdf' => '0',
|
||||
'multifinisher400param1_nopresentationpdf' => '0',
|
||||
'falzen302_nopresentationpdf' => '0',
|
||||
'stanzen600_nopresentationpdf' => '0',
|
||||
'stanzen600param_nopresentationpdf' => '2',
|
||||
'stanzen600param2_nopresentationpdf' => '2',
|
||||
'papierauswahlU' => 'papier1_1',
|
||||
'papierU' => 'INM300ND',
|
||||
'papierlaufrichtungU_nopresentationpdf' => '1',
|
||||
'seitenU' => '0',
|
||||
'papierauswahl' => 'papier5_1',
|
||||
'papier' => 'GP150',
|
||||
'papierlaufrichtung_nopresentationpdf' => '1',
|
||||
'seiten' => '0',
|
||||
'bohrmaschine' => '0',
|
||||
'stdl701pselect' => '0',
|
||||
'eckenstanze' => '0',
|
||||
'stdl702pselect' => '0',
|
||||
'codierung' => '0',
|
||||
'codeart' => '0',
|
||||
'falzen302Uopt1' => '0',
|
||||
'falzen302Uopt1param' => '0',
|
||||
'kaschieren800U' => '0',
|
||||
'kaschieren800Uparam' => '0',
|
||||
'falzen302opt1' => '0',
|
||||
'falzen302opt1param' => '0',
|
||||
'kaschieren800' => '0',
|
||||
'kaschieren800param' => '0',
|
||||
'zusatzarbeit1select_nopresentation' => '00',
|
||||
'zusatzarbeit2select_nopresentation' => '00',
|
||||
'offline_nopresentation' => '0',
|
||||
'angebotstyp_nopresentation' => '0',
|
||||
'produktname_nopresentationpdf' => '',
|
||||
'auflage' => '100',
|
||||
'versionen' => '1',
|
||||
'eformatbreite_nopresentationpdf' => '210',
|
||||
'eformathoehe_nopresentationpdf' => '297',
|
||||
'oformatbreiteU_nopresentationpdf' => '210',
|
||||
'oformathoeheU_nopresentationpdf' => '297',
|
||||
'nutzenU_nopresentationpdf' => '2',
|
||||
'show_bernutzenU_max_nopresentationpdf' => '2',
|
||||
'show_bernutzenU_min_nopresentationpdf' => '1',
|
||||
'show_bernutzenU_nopresentationpdf' => '2',
|
||||
'oformatbreite_nopresentationpdf' => '210',
|
||||
'oformathoehe_nopresentationpdf' => '297',
|
||||
'nutzen_nopresentationpdf' => '2',
|
||||
'show_bernutzen_max_nopresentationpdf' => '2',
|
||||
'show_bernutzen_min_nopresentationpdf' => '1',
|
||||
'show_bernutzen_nopresentationpdf' => '2',
|
||||
'falzen302Uparam1input_nopresentationpdf' => '30',
|
||||
'falzen302Uparam2input_nopresentationpdf' => '10',
|
||||
'falzen302Uparam3input_nopresentationpdf' => '0',
|
||||
'falzen302param1input_nopresentationpdf' => '30',
|
||||
'falzen302param2input_nopresentationpdf' => '10',
|
||||
'falzen302param3input_nopresentationpdf' => '0',
|
||||
'stanzen600bogennutzen_nopresentationpdf' => '1',
|
||||
'stanzen600nutzen_nopresentationpdf' => '1',
|
||||
'stanzen600hub_nopresentationpdf' => '2',
|
||||
'stanzen600paraminput_nopresentationpdf' => '3000',
|
||||
'stanzen600param2input_nopresentationpdf' => '15',
|
||||
'papiernameU_nopresentationpdf' => '',
|
||||
'papiergrammaturU_nopresentationpdf' => '300',
|
||||
'papierstaerkeU_nopresentationpdf' => '0.303',
|
||||
'papierpreisU_nopresentationpdf' => '76.8',
|
||||
'papierbreiteU_nopresentationpdf' => '345',
|
||||
'papierhoeheU_nopresentationpdf' => '495',
|
||||
'papiername_nopresentationpdf' => '',
|
||||
'papiergrammatur_nopresentationpdf' => '135',
|
||||
'papierstaerke_nopresentationpdf' => '0.118',
|
||||
'papierpreis_nopresentationpdf' => '0',
|
||||
'papierbreite_nopresentationpdf' => '345',
|
||||
'papierhoehe_nopresentationpdf' => '495',
|
||||
'produktname_nopresentation' => '',
|
||||
'satzarbeitinput_nopresentation' => '',
|
||||
'satzarbeit_nopresentation' => '0',
|
||||
'zusatzarbeit1_nopresentation' => '0',
|
||||
'zusatzarbeit2_nopresentation' => '0',
|
||||
'zusatzarbeit3input_nopresentation' => '',
|
||||
'zusatzarbeit3_nopresentation' => '0',
|
||||
'zusatzarbeit4input_nopresentation' => '',
|
||||
'zusatzarbeit4_nopresentation' => '0',
|
||||
'rabattkalk_nopresentation' => '0',
|
||||
'angebotsadresse_nopresentation' => '',
|
||||
'eckenstanzecheckbox1' =>
|
||||
array(
|
||||
0 => '1',
|
||||
),
|
||||
'eckenstanzecheckbox2' =>
|
||||
array(
|
||||
0 => '1',
|
||||
),
|
||||
'eckenstanzecheckbox3' =>
|
||||
array(
|
||||
0 => '1',
|
||||
),
|
||||
'eckenstanzecheckbox4' =>
|
||||
array(
|
||||
0 => '1',
|
||||
),
|
||||
'preisart_nopresentationall' => '1',
|
||||
'festpreis_nopresentationall' => '1',
|
||||
'produktart_nopresentationpdf' => '10',
|
||||
'kalkparameterprodukt_nopresentationpdf' => '10',
|
||||
'datacheck' => '1',
|
||||
'korrektur' => '1',
|
||||
'produktion' => '1',
|
||||
'eformat' => '62370H',
|
||||
'nutzenrechner_nopresentationpdf' => '1',
|
||||
'plano' => '0',
|
||||
'oformatU' => 'XXXXXXXX',
|
||||
'formatpapierlaufrichtungU_nopresentationpdf' => '0',
|
||||
'oformat' => '02100297',
|
||||
'formatpapierlaufrichtung_nopresentationpdf' => '0',
|
||||
'broschuereklammer500' => '0',
|
||||
'broschuereklammer500param' => '0',
|
||||
'druckenU_nopresentationpdf' => 'X',
|
||||
'drucken1xxU_nopresentationpdf' => 'X',
|
||||
'farbeU' => 'X',
|
||||
'schneiden200U_nopresentationpdf' => 'X',
|
||||
'multifinisher400U_nopresentationpdf' => '0',
|
||||
'multifinisher400Uparam1_nopresentationpdf' => '0',
|
||||
'falzen302U_nopresentationpdf' => 'X',
|
||||
'drucken_nopresentationpdf' => '1',
|
||||
'drucken1xx_nopresentationpdf' => '1a',
|
||||
'farbe' => '4f4f',
|
||||
'schneiden200_nopresentationpdf' => '1',
|
||||
'multifinisher400_nopresentationpdf' => '0',
|
||||
'multifinisher400param1_nopresentationpdf' => '0',
|
||||
'falzen302_nopresentationpdf' => '0',
|
||||
'stanzen600_nopresentationpdf' => '0',
|
||||
'stanzen600param_nopresentationpdf' => '2',
|
||||
'stanzen600param2_nopresentationpdf' => '2',
|
||||
'papierauswahlU' => 'papier1_1',
|
||||
'papierU' => 'INM300ND',
|
||||
'papierlaufrichtungU_nopresentationpdf' => '1',
|
||||
'seitenU' => '0',
|
||||
'papierauswahl' => 'papier5_1',
|
||||
'papier' => 'GP150',
|
||||
'papierlaufrichtung_nopresentationpdf' => '1',
|
||||
'seiten' => '0',
|
||||
'bohrmaschine' => '0',
|
||||
'stdl701pselect' => '0',
|
||||
'eckenstanze' => '0',
|
||||
'stdl702pselect' => '0',
|
||||
'codierung' => '0',
|
||||
'codeart' => '0',
|
||||
'falzen302Uopt1' => '0',
|
||||
'falzen302Uopt1param' => '0',
|
||||
'kaschieren800U' => '0',
|
||||
'kaschieren800Uparam' => '0',
|
||||
'falzen302opt1' => '0',
|
||||
'falzen302opt1param' => '0',
|
||||
'kaschieren800' => '0',
|
||||
'kaschieren800param' => '0',
|
||||
'zusatzarbeit1select_nopresentation' => '00',
|
||||
'zusatzarbeit2select_nopresentation' => '00',
|
||||
'offline_nopresentation' => '0',
|
||||
'angebotstyp_nopresentation' => '0',
|
||||
'produktname_nopresentationpdf' => '',
|
||||
'auflage' => '100',
|
||||
'versionen' => '1',
|
||||
'eformatbreite_nopresentationpdf' => '210',
|
||||
'eformathoehe_nopresentationpdf' => '297',
|
||||
'oformatbreiteU_nopresentationpdf' => '210',
|
||||
'oformathoeheU_nopresentationpdf' => '297',
|
||||
'nutzenU_nopresentationpdf' => '2',
|
||||
'show_bernutzenU_max_nopresentationpdf' => '2',
|
||||
'show_bernutzenU_min_nopresentationpdf' => '1',
|
||||
'show_bernutzenU_nopresentationpdf' => '2',
|
||||
'oformatbreite_nopresentationpdf' => '210',
|
||||
'oformathoehe_nopresentationpdf' => '297',
|
||||
'nutzen_nopresentationpdf' => '2',
|
||||
'show_bernutzen_max_nopresentationpdf' => '2',
|
||||
'show_bernutzen_min_nopresentationpdf' => '1',
|
||||
'show_bernutzen_nopresentationpdf' => '2',
|
||||
'falzen302Uparam1input_nopresentationpdf' => '30',
|
||||
'falzen302Uparam2input_nopresentationpdf' => '10',
|
||||
'falzen302Uparam3input_nopresentationpdf' => '0',
|
||||
'falzen302param1input_nopresentationpdf' => '30',
|
||||
'falzen302param2input_nopresentationpdf' => '10',
|
||||
'falzen302param3input_nopresentationpdf' => '0',
|
||||
'stanzen600bogennutzen_nopresentationpdf' => '1',
|
||||
'stanzen600nutzen_nopresentationpdf' => '1',
|
||||
'stanzen600hub_nopresentationpdf' => '2',
|
||||
'stanzen600paraminput_nopresentationpdf' => '3000',
|
||||
'stanzen600param2input_nopresentationpdf' => '15',
|
||||
'papiernameU_nopresentationpdf' => '',
|
||||
'papiergrammaturU_nopresentationpdf' => '300',
|
||||
'papierstaerkeU_nopresentationpdf' => '0.303',
|
||||
'papierpreisU_nopresentationpdf' => '76.8',
|
||||
'papierbreiteU_nopresentationpdf' => '345',
|
||||
'papierhoeheU_nopresentationpdf' => '495',
|
||||
'papiername_nopresentationpdf' => '',
|
||||
'papiergrammatur_nopresentationpdf' => '135',
|
||||
'papierstaerke_nopresentationpdf' => '0.118',
|
||||
'papierpreis_nopresentationpdf' => '0',
|
||||
'papierbreite_nopresentationpdf' => '345',
|
||||
'papierhoehe_nopresentationpdf' => '495',
|
||||
'produktname_nopresentation' => '',
|
||||
'satzarbeitinput_nopresentation' => '',
|
||||
'satzarbeit_nopresentation' => '0',
|
||||
'zusatzarbeit1_nopresentation' => '0',
|
||||
'zusatzarbeit2_nopresentation' => '0',
|
||||
'zusatzarbeit3input_nopresentation' => '',
|
||||
'zusatzarbeit3_nopresentation' => '0',
|
||||
'zusatzarbeit4input_nopresentation' => '',
|
||||
'zusatzarbeit4_nopresentation' => '0',
|
||||
'rabattkalk_nopresentation' => '0',
|
||||
'angebotsadresse_nopresentation' => '',
|
||||
'eckenstanzecheckbox1' => array(
|
||||
0 => '1',
|
||||
),
|
||||
'eckenstanzecheckbox2' => array(
|
||||
0 => '1',
|
||||
),
|
||||
'eckenstanzecheckbox3' => array(
|
||||
0 => '1',
|
||||
),
|
||||
'eckenstanzecheckbox4' => array(
|
||||
0 => '1',
|
||||
),
|
||||
]);
|
||||
$this->assertSame(34.77, $this->engine->getPrice());
|
||||
$this->assertSame(37.74, $this->engine->getPrice());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
100
tests/Customer/NN/CalcTest.php
Normal file
100
tests/Customer/NN/CalcTest.php
Normal file
@ -0,0 +1,100 @@
|
||||
<?php
|
||||
|
||||
namespace PSC\Library\Calc\Tests\Customer\NN;
|
||||
|
||||
use PHPUnit\Framework\TestCase;
|
||||
use PSC\Library\Calc\Article;
|
||||
use PSC\Library\Calc\Engine;
|
||||
use PSC\Library\Calc\Option\Type\Select;
|
||||
use PSC\Library\Calc\PaperContainer;
|
||||
use PSC\Library\Calc\Tests\Mock\PaperRepostory;
|
||||
|
||||
class CalcTest extends TestCase
|
||||
{
|
||||
protected ?Engine $engine = null;
|
||||
|
||||
public function setUp(): void
|
||||
{
|
||||
$repository = new PaperRepostory();
|
||||
|
||||
$paperContainer = new PaperContainer();
|
||||
$paperContainer->parse(simplexml_load_string(file_get_contents(__DIR__ . '/papierContainer.xml')));
|
||||
|
||||
$this->engine = new Engine();
|
||||
$this->engine->setPaperContainer($paperContainer);
|
||||
$this->engine->setPaperRepository($repository);
|
||||
$this->engine->setFormulas(file_get_contents(__DIR__ . '/formels.txt'));
|
||||
$this->engine->setParameters(file_get_contents(__DIR__ . '/parameters.txt'));
|
||||
$this->engine->setTemplates(file_get_contents(__DIR__ . '/calcTemplates.xml'));
|
||||
|
||||
$this->engine->loadString(file_get_contents(__DIR__ . '/calc.xml'));
|
||||
}
|
||||
|
||||
public function tearDown(): void
|
||||
{
|
||||
$this->engine = null;
|
||||
}
|
||||
|
||||
public function testPrice(): void
|
||||
{
|
||||
$this->engine->calc();
|
||||
$this->assertSame(45.0, $this->engine->getPrice());
|
||||
}
|
||||
|
||||
public function testChangeFolie(): void
|
||||
{
|
||||
$this->engine->calc();
|
||||
$this->engine->setVariable('umschlagtyp', 4);
|
||||
$this->assertSame(44.7, $this->engine->getPrice());
|
||||
$this->assertSame(
|
||||
'12',
|
||||
$this->engine
|
||||
->getArticle()
|
||||
->getOptionById('umschlagvorn')
|
||||
->getSelectedOption()
|
||||
->getId(),
|
||||
);
|
||||
}
|
||||
|
||||
public function testChangeMatt(): void
|
||||
{
|
||||
$this->engine->setVariable('umschlagtyp', '4');
|
||||
$this->assertSame(44.7, $this->engine->getPrice());
|
||||
$this->assertSame(
|
||||
'12',
|
||||
$this->engine
|
||||
->getArticle()
|
||||
->getOptionById('umschlagvorn')
|
||||
->getSelectedOption()
|
||||
->getId(),
|
||||
);
|
||||
$this->engine->setVariable('umschlagvorn', '13');
|
||||
$this->assertSame(44.7, $this->engine->getPrice());
|
||||
$this->engine->calc();
|
||||
$this->assertSame(
|
||||
'13',
|
||||
$this->engine
|
||||
->getArticle()
|
||||
->getOptionById('umschlagvorn')
|
||||
->getSelectedOption()
|
||||
->getId(),
|
||||
);
|
||||
}
|
||||
|
||||
public function testChangeComplete(): void
|
||||
{
|
||||
$this->engine->calc();
|
||||
$this->engine->setVariable('umschlagtyp', '4');
|
||||
$this->engine->setVariable('umschlagvorn', '13');
|
||||
$this->engine->calc();
|
||||
$this->assertSame(44.7, $this->engine->getPrice());
|
||||
$this->assertSame(
|
||||
'13',
|
||||
$this->engine
|
||||
->getArticle()
|
||||
->getOptionById('umschlagvorn')
|
||||
->getSelectedOption()
|
||||
->getId(),
|
||||
);
|
||||
}
|
||||
}
|
||||
609
tests/Customer/NN/calc.xml
Normal file
609
tests/Customer/NN/calc.xml
Normal file
@ -0,0 +1,609 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<kalkulation>
|
||||
<artikel>
|
||||
<name>EduPrint Kalkulation Leimbindung</name>
|
||||
<kommentar>02.09.2021</kommentar>
|
||||
|
||||
<uploads>
|
||||
<upload id="Leimbindung" name="Inhalt"
|
||||
description="Bitte lade dein PDF für den Inhalt hoch">
|
||||
<preflight id="istpdf" />
|
||||
</upload>
|
||||
<upload id="Cover" name="Cover" description="Bitte lade dein PDF für das Cover hoch">
|
||||
<preflight id="istpdf" />
|
||||
</upload>
|
||||
</uploads>
|
||||
|
||||
<!-- OFFEN 9/2021 -->
|
||||
<!-- Textfeldhöhe? -->
|
||||
<!-- Maximalformat? -->
|
||||
<!-- Berechnung optimieren? -->
|
||||
<!-- Sonstiges auf Dokumenten -->
|
||||
|
||||
<!-- Eingabe -->
|
||||
<!-- Bindeart, Defaul -->
|
||||
<option id="bindeart" name="Bindeart" type="Hidden" default="2">
|
||||
<opt id="2" name="Leimbindung"></opt>
|
||||
</option>
|
||||
|
||||
<!-- Auflage -->
|
||||
<option id="auflage_txt" name="AUFLAGE" type="Text" default="" />
|
||||
<option id="auflage" name="Anzahl Exemplare" type="Input" default="2" min="1" max="500"
|
||||
helplink="/cms/hilfe-leimbindung?show=11&help=1" />
|
||||
|
||||
<!-- Inhalt-->
|
||||
<option id="papinhalt_txt" name="INHALT" type="Text" default="" />
|
||||
<option id="format1" name="Format" type="Select" default="1"
|
||||
helplink="/cms/hilfe-leimbindung?show=21&help=1">
|
||||
<opt id="1" name="A4 hoch (210 x 297 mm)"></opt>
|
||||
<opt id="2" name="A4 quer (297 x 210 mm)"></opt>
|
||||
<opt id="3" name="A5 hoch (148 x 210 mm)"></opt>
|
||||
<opt id="4" name="A5 quer (210 x 148 mm)"></opt>
|
||||
<opt id="5" name="A6 hoch (105 x 148 mm)"></opt>
|
||||
<opt id="6" name="A6 quer (148 x 105 mm)"></opt>
|
||||
<opt id="7" name="Taschenbuch (120 x 190 mm)"></opt>
|
||||
<opt id="8" name="Quadratisch (210 x 210 mm)"></opt>
|
||||
<!-- <opt id="9" name="Freies Format"></opt> -->
|
||||
</option>
|
||||
|
||||
<option id="breite_frei" name="Breite (in mm)" type="Input" default="110" min="1" max="297">
|
||||
<format1>
|
||||
<grenze>9</grenze>
|
||||
</format1>
|
||||
</option>
|
||||
|
||||
<option id="hoehe_frei" name="Höhe (in mm)" type="Input" default="140" min="1" max="297">
|
||||
<format1>
|
||||
<grenze>9</grenze>
|
||||
</format1>
|
||||
</option>
|
||||
|
||||
<option id="inhalt_druck" name="Druck Inhalt" type="Select" default="2"
|
||||
helplink="/cms/hilfe-leimbindung?show=22&help=1">
|
||||
<opt id="1" name="einseitig"></opt>
|
||||
<opt id="2" name="zweiseitig"></opt>
|
||||
</option>
|
||||
|
||||
<!-- min- und max. Seitenzahl im Zusammenhang mit Druck -->
|
||||
<option id="min_seitenzahl" name="min_blattzahl" type="Hidden" default="0">
|
||||
<inhalt_druck>
|
||||
<grenze calc_value="20">1</grenze>
|
||||
<grenze calc_value="40">2</grenze>
|
||||
</inhalt_druck>
|
||||
</option>
|
||||
<option id="max_seitenzahl" name="max_blattzahl" type="Hidden" default="0">
|
||||
<inhalt_druck>
|
||||
<grenze calc_value="450">1</grenze>
|
||||
<grenze calc_value="900">2</grenze>
|
||||
</inhalt_druck>
|
||||
</option>
|
||||
|
||||
<option id="papiersorte_inhalt" name="Papier Inhalt" type="Select" mode="papierdb"
|
||||
container="ep-std-inhalt" default="SPP090"
|
||||
helplink="/cms/hilfe-leimbindung?show=23&help=1" />
|
||||
|
||||
<option id="seiten_gesamt" name="Anzahl der Gesamtseiten" type="Input" default="100"
|
||||
min="$CVmin_seitenzahl_inhalt_druck$CV" max="$CVmax_seitenzahl_inhalt_druck$CV"
|
||||
helplink="/cms/hilfe-leimbindung?show=24&help=1" />
|
||||
|
||||
<option id="seiten_farbe" name="davon Farbseiten" type="Input" default="0" min="0" max="900"
|
||||
helplink="/cms/hilfe-leimbindung?show=25&help=1" />
|
||||
|
||||
<!-- <option id="farbseiten_info" name="Seitenzahlen der Farbseiten" type="Input"
|
||||
default=""/> -->
|
||||
|
||||
<!-- Umschlag -->
|
||||
<option id="papcover_txt" name="UMSCHLAG" type="Text" default="" />
|
||||
|
||||
<!-- Umschlag Typ -->
|
||||
<option id="umschlagtyp" name="Ausführung des Deckblatts (vorne)" type="Select" default="1"
|
||||
helplink="/cms/hilfe-leimbindung?show=31&help=1">
|
||||
<opt id="1" name="unbedruckt"></opt>
|
||||
<opt id="2" name="bedruckt s/w (nur Text)"></opt>
|
||||
<opt id="3" name="bedruckt farbig (Bild und Text)"></opt>
|
||||
<opt id="4" name="Folie als Deckblatt"></opt>
|
||||
</option>
|
||||
|
||||
<!-- Druckdaten Umschlag -->
|
||||
<option id="deckblattdaten" name="Druckdaten für das Deckblatt (vorne)" type="Select"
|
||||
default="1">
|
||||
<umschlagtyp>
|
||||
<grenze>2,3</grenze>
|
||||
</umschlagtyp>
|
||||
<opt id="1" name="Wiederholung der ersten Inhalts-Seite">
|
||||
<umschlagtyp>
|
||||
<grenze>2,3</grenze>
|
||||
</umschlagtyp>
|
||||
</opt>
|
||||
<opt id="2" name="aus seperater PDF-Datei">
|
||||
<umschlagtyp>
|
||||
<grenze>2,3</grenze>
|
||||
</umschlagtyp>
|
||||
</opt>
|
||||
</option>
|
||||
|
||||
<!-- Umschlag Material -->
|
||||
<option id="umschlagvorn" name="Material Deckblatt (vorne)" type="Select" default="7"
|
||||
helplink="/cms/hilfe-leimbindung?show=32&help=1">
|
||||
<!-- <opt id="1" name="keiner"></opt> -->
|
||||
<opt id="2" name="Bilderdruck weiß">
|
||||
<umschlagtyp>
|
||||
<grenze>1,2,3</grenze>
|
||||
</umschlagtyp>
|
||||
</opt>
|
||||
<opt id="3" name="ledergeprägt weiß">
|
||||
<umschlagtyp>
|
||||
<grenze>1,2</grenze>
|
||||
</umschlagtyp>
|
||||
</opt>
|
||||
<opt id="4" name="ledergeprägt gelb">
|
||||
<umschlagtyp>
|
||||
<grenze>1,2</grenze>
|
||||
</umschlagtyp>
|
||||
</opt>
|
||||
<opt id="5" name="ledergeprägt orange">
|
||||
<umschlagtyp>
|
||||
<grenze>1,2</grenze>
|
||||
</umschlagtyp>
|
||||
</opt>
|
||||
<opt id="6" name="ledergeprägt rot">
|
||||
<umschlagtyp>
|
||||
<grenze>1,2</grenze>
|
||||
</umschlagtyp>
|
||||
</opt>
|
||||
<opt id="7" name="ledergeprägt blau">
|
||||
<umschlagtyp>
|
||||
<grenze>1,2</grenze>
|
||||
</umschlagtyp>
|
||||
</opt>
|
||||
<opt id="8" name="ledergeprägt grün">
|
||||
<umschlagtyp>
|
||||
<grenze>1,2</grenze>
|
||||
</umschlagtyp>
|
||||
</opt>
|
||||
<opt id="9" name="ledergeprägt grau">
|
||||
<umschlagtyp>
|
||||
<grenze>1,2</grenze>
|
||||
</umschlagtyp>
|
||||
</opt>
|
||||
<opt id="10" name="ledergeprägt braun">
|
||||
<umschlagtyp>
|
||||
<grenze>1,2</grenze>
|
||||
</umschlagtyp>
|
||||
</opt>
|
||||
<opt id="11" name="ledergeprägt schwarz">
|
||||
<umschlagtyp>
|
||||
<grenze>1</grenze>
|
||||
</umschlagtyp>
|
||||
</opt>
|
||||
<opt id="12" name="Folie klar">
|
||||
<umschlagtyp>
|
||||
<grenze>4</grenze>
|
||||
</umschlagtyp>
|
||||
</opt>
|
||||
<opt id="13" name="Folie matt">
|
||||
<umschlagtyp>
|
||||
<grenze>4</grenze>
|
||||
</umschlagtyp>
|
||||
</opt>
|
||||
</option>
|
||||
|
||||
<option id="umschlaghinten" name="Material Deckblatt (hinten)" type="Select" default="7"
|
||||
helplink="/cms/hilfe-leimbindung?show=33&help=1">
|
||||
<!-- <opt id="1" name="keiner"></opt> -->
|
||||
<opt id="2" name="Bilderdruck weiß"></opt>
|
||||
<opt id="3" name="ledergeprägt weiß"></opt>
|
||||
<opt id="4" name="ledergeprägt gelb"></opt>
|
||||
<opt id="5" name="ledergeprägt orange"></opt>
|
||||
<opt id="6" name="ledergeprägt rot"></opt>
|
||||
<opt id="7" name="ledergeprägt blau"></opt>
|
||||
<opt id="8" name="ledergeprägt grün"></opt>
|
||||
<opt id="9" name="ledergeprägt grau"></opt>
|
||||
<opt id="10" name="ledergeprägt braun"></opt>
|
||||
<opt id="11" name="ledergeprägt schwarz"></opt>
|
||||
</option>
|
||||
|
||||
<option id="faelzelband" name="Fälzelband Farbe" type="Select" default="1"
|
||||
helplink="/cms/hilfe-leimbindung?show=34&help=1">
|
||||
<opt id="1" name="schwarz"></opt>
|
||||
<opt id="2" name="weiß"></opt>
|
||||
<opt id="3" name="blau"></opt>
|
||||
</option>
|
||||
|
||||
<!-- Vakatseiten -->
|
||||
<option id="leereseiten" name="leere Seiten" type="Select" default="1"
|
||||
helplink="/cms/hilfe-leimbindung?show=35&help=1">
|
||||
<opt id="1" name="ohne"></opt>
|
||||
<opt id="2" name="leeres Blatt vor und nach dem Inhalt"></opt>
|
||||
<opt id="3" name="leeres Blatt vor dem Inhalt"></opt>
|
||||
<opt id="4" name="leeres Blatt nach dem Inhalt"></opt>
|
||||
</option>
|
||||
|
||||
<!-- Datenprüfung -->
|
||||
<option id="datenpruefung_txt" name="DATENPRÜFUNG" type="Text" default="" />
|
||||
|
||||
<option id="datenpruefung" name="Datenprüfung" type="Select" default="0"
|
||||
helplink="/cms/hilfe-leimbindung?show=41&help=1">
|
||||
<opt id="0" name="Basis Datenprüfung kostenlos"></opt>
|
||||
<opt id="1" name="Profi Datenprüfung (10 €)"></opt>
|
||||
</option>
|
||||
|
||||
<!-- Extras -->
|
||||
<option id="extras_txt" name="EXTRAS" type="Text" default="" />
|
||||
<option id="cdhuelle" name="CD-Hülle" type="Select" default="0"
|
||||
helplink="/cms/hilfe-leimbindung?show=71&help=1">
|
||||
<opt id="0" name="keine CD-Hülle"></opt>
|
||||
<opt id="1" name="selbstklebende CD-Hülle beilegen"></opt>
|
||||
</option>
|
||||
|
||||
<option id="cdbrennen" name="PDF auf CD brennen" type="Select" default="0"
|
||||
helplink="/cms/hilfe-leimbindung?show=72&help=1">
|
||||
<opt id="0" name="keine CD brennen"></opt>
|
||||
<opt id="1" name="CD ohne Label brennen (5 €)"></opt>
|
||||
<opt id="2" name="CD mit Label brennen (7 €)"></opt>
|
||||
</option>
|
||||
|
||||
<option id="dreieckstasche" name="Dreiecktasche" type="Select" default="0"
|
||||
helplink="/cms/hilfe-leimbindung?show=73&help=1">
|
||||
<opt id="0" name="keine Dreiecktasche"></opt>
|
||||
<opt id="1" name="selbstklebende Dreiecktasche beilegen"></opt>
|
||||
</option>
|
||||
|
||||
<!-- Produktionszeit -->
|
||||
<option id="produktionszeit_txt" name="PRODUKTIONSZEIT" type="Text" default="" />
|
||||
<option id="produktionszeit" name="Produktionszeit" type="Select" default="0"
|
||||
helplink="/cms/hilfe-leimbindung?show=51&help=1">
|
||||
<opt id="0" name="Standard (4-5 Arbeitstage)"></opt>
|
||||
<opt id="1" name="Express (1-2 Arbeitstage)"></opt>
|
||||
<opt id="2" name="Same day (Dateneingang bis 10 Uhr)"></opt>
|
||||
</option>
|
||||
|
||||
<!-- Sonstiges -->
|
||||
<option id="sonstiges_txt" name="SONSTIGES" type="Text" default="" />
|
||||
|
||||
<option id="bemerkungen" name="Bemerkungen" type="Textarea" height="6" default=""
|
||||
helplink="/cms/hilfe-leimbindung?show=61&help=1" />
|
||||
|
||||
<!-- Kalkulation -->
|
||||
<!-- Ermittlung der Formate anhand der Formatauswahl -->
|
||||
<!-- Breite -->
|
||||
<option id="breite" name="seitenbreite" type="Hidden" default="1">
|
||||
<format1>
|
||||
<grenze calc_value="210">1,4,8</grenze>
|
||||
<grenze calc_value="297">2</grenze>
|
||||
<grenze calc_value="148">3,6</grenze>
|
||||
<grenze calc_value="105">5</grenze>
|
||||
<grenze calc_value="120">7</grenze>
|
||||
<grenze calc_value="$Vbreite_frei$V">9</grenze>
|
||||
</format1>
|
||||
</option>
|
||||
<!-- Höhe -->
|
||||
<option id="hoehe" name="seitenhoehe" type="Hidden" default="1">
|
||||
<format1>
|
||||
<grenze calc_value="297">1</grenze>
|
||||
<grenze calc_value="210">2,3,8</grenze>
|
||||
<grenze calc_value="148">4,5</grenze>
|
||||
<grenze calc_value="105">6</grenze>
|
||||
<grenze calc_value="190">7</grenze>
|
||||
<grenze calc_value="$Vhoehe_frei$V">9</grenze>
|
||||
</format1>
|
||||
</option>
|
||||
<!-- Nutzenermittlung anhand Format -->
|
||||
<option id="nutzen" name="nutzen" type="Hidden" default="1">
|
||||
<format1>
|
||||
<grenze calc_value="2">1,2,8</grenze>
|
||||
<grenze calc_value="4">3,4,7</grenze>
|
||||
<grenze
|
||||
calc_value="8">5,6</grenze>
|
||||
<grenze
|
||||
calc_value="(max((floor(320/$Vbreite_frei$V))*(floor(450/$Vhoehe_frei$V)),(floor(450/$Vbreite_frei$V))*(floor(320/$Vhoehe_frei$V))))">
|
||||
9</grenze> // SRA3 320 x 450 </format1>
|
||||
</option>
|
||||
|
||||
<!-- Gewichtsberechnung Umschlag-->
|
||||
<option id="papiergewicht_umschlag_vorn" name="papiergwicht_umschlag_vorn" type="Hidden"
|
||||
default="1">
|
||||
<umschlagvorn>
|
||||
<grenze calc_value="0">1</grenze>
|
||||
<grenze calc_value="$Pumschlag_papiergewicht$P">2-11</grenze>
|
||||
</umschlagvorn>
|
||||
</option>
|
||||
|
||||
<option id="papiergewicht_umschlag_hinten" name="papiergewicht_umschlag_hinten"
|
||||
type="Hidden" default="1">
|
||||
<umschlaghinten>
|
||||
<grenze calc_value="0">1</grenze>
|
||||
<grenze calc_value="$Pumschlag_papiergewicht$P">2-11</grenze>
|
||||
</umschlaghinten>
|
||||
</option>
|
||||
|
||||
<option id="papiergewicht_umschlag" name="papiergewicht_umschlag" type="Hidden" default="1">
|
||||
<auflage>
|
||||
<grenze
|
||||
calc_value="($CVpapiergewicht_umschlag_vorn_umschlagvorn$CV+$CVpapiergewicht_umschlag_hinten_umschlaghinten$CV)/2">
|
||||
1-</grenze>
|
||||
</auflage>
|
||||
</option>
|
||||
|
||||
<!-- Gewichtsberechnung -->
|
||||
<option id="weight" name="weight" type="Hidden" default="1">
|
||||
<auflage>
|
||||
<grenze
|
||||
formel="((($CVbreite_format1$CV)*$CVhoehe_format1$CV/1000000*(($Vseiten_gesamt$V-4)/$Vinhalt_druck$V)*$Vpapiersorte_inhalt_grammatur$V)*$Vauflage$V)+((($CVbreite_format1$CV)*$CVhoehe_format1$CV/1000000*2*$CVpapiergewicht_umschlag_auflage$CV)*$Vauflage$V)">
|
||||
1-</grenze>
|
||||
</auflage>
|
||||
</option>
|
||||
|
||||
<!-- Rückenstärke -->
|
||||
<option id="ruecken" name="ruecken" type="Hidden" default="1" exportAjax="1">
|
||||
<auflage>
|
||||
<grenze
|
||||
formel="$Vseiten_gesamt$V/$Vinhalt_druck$V*$Vpapiersorte_inhalt_grammatur$V*$Vpapiersorte_inhalt_volume$V/1000">
|
||||
1-</grenze>
|
||||
</auflage>
|
||||
</option>
|
||||
|
||||
<!-- Papiermenge -->
|
||||
<option id="papiermenge" name="papiermenge" type="Hidden" default="1">
|
||||
<auflage>
|
||||
<grenze
|
||||
calc_value="ceil($Vauflage$V*$Vseiten_gesamt$V/($CVnutzen_format1$CV*$Vinhalt_druck$V))">
|
||||
1-</grenze> //aufgerundet </auflage>
|
||||
</option>
|
||||
|
||||
<!-- Papierkosten (zur Gesamtsumme) -->
|
||||
<option id="papierkosten" name="papierkosten" type="Hidden" default="1">
|
||||
<auflage>
|
||||
<grenze calc_value="$CVpapiermenge_auflage$CV*$Vpapiersorte_inhalt_value$V/1000">1-</grenze>
|
||||
</auflage>
|
||||
</option>
|
||||
|
||||
<!-- Drucke SW -->
|
||||
<option id="drucke_sw" name="drucke_sw" type="Hidden" default="1">
|
||||
<auflage>
|
||||
<grenze
|
||||
calc_value="ceil($Vauflage$V*($Vseiten_gesamt$V-$Vseiten_farbe$V)/$CVnutzen_format1$CV)">
|
||||
1-</grenze>
|
||||
</auflage>
|
||||
</option>
|
||||
<!-- Klickpreis SW -->
|
||||
<option id="klickpreis_sw" name="klickpreis_sw" type="Hidden" default="1">
|
||||
<drucke_sw formel="$CVdrucke_sw_auflage$CV">
|
||||
<grenze calc_value="0">0</grenze>
|
||||
<grenze calc_value="$Pswklick_bis_100$P">1-100</grenze>
|
||||
<grenze calc_value="$Pswklick_bis_250$P">101-250</grenze>
|
||||
<grenze calc_value="$Pswklick_bis_500$P">251-500</grenze>
|
||||
<grenze calc_value="$Pswklick_bis_750$P">501-750</grenze>
|
||||
<grenze calc_value="$Pswklick_bis_1000$P">751-1000</grenze>
|
||||
<grenze calc_value="$Pswklick_bis_2500$P">1001-2500</grenze>
|
||||
<grenze calc_value="$Pswklick_bis_5000$P">2501-5000</grenze>
|
||||
<grenze calc_value="$Pswklick_ueber_5000$P">5001-</grenze>
|
||||
</drucke_sw>
|
||||
</option>
|
||||
<!-- Gesamtkosten SW (zur Gesamtsumme) -->
|
||||
<option id="gesamtkosten_sw" name="gesamtkosten_sw" type="Hidden" default="1">
|
||||
<auflage>
|
||||
<grenze calc_value="$CVdrucke_sw_auflage$CV*$CVklickpreis_sw_drucke_sw$CV">1-</grenze>
|
||||
</auflage>
|
||||
</option>
|
||||
|
||||
<!-- Drucke Farbe -->
|
||||
<option id="drucke_farbe" name="drucke_farbe" type="Hidden" default="1">
|
||||
<auflage>
|
||||
<grenze calc_value="ceil($Vauflage$V*$Vseiten_farbe$V/$CVnutzen_format1$CV)">1-</grenze>
|
||||
</auflage>
|
||||
</option>
|
||||
<!-- Klickpreis Farbe -->
|
||||
<option id="klickpreis_farbe" name="klickpreis_farbe" type="Hidden" default="1">
|
||||
<drucke_farbe formel="$CVdrucke_farbe_auflage$CV">
|
||||
<grenze calc_value="0">0</grenze>
|
||||
<grenze calc_value="$Pfarbklick_bis_100$P">1-100</grenze>
|
||||
<grenze calc_value="$Pfarbklick_bis_250$P">101-250</grenze>
|
||||
<grenze calc_value="$Pfarbklick_bis_500$P">251-500</grenze>
|
||||
<grenze calc_value="$Pfarbklick_bis_750$P">501-750</grenze>
|
||||
<grenze calc_value="$Pfarbklick_bis_1000$P">751-1000</grenze>
|
||||
<grenze calc_value="$Pfarbklick_bis_1500$P">1001-1500</grenze>
|
||||
<grenze calc_value="$Pfarbklick_bis_2500$P">1501-2500</grenze>
|
||||
<grenze calc_value="$Pfarbklick_bis_5000$P">2501-5000</grenze>
|
||||
<grenze calc_value="$Pfarbklick_ueber_5000$P">5001-</grenze>
|
||||
</drucke_farbe>
|
||||
</option>
|
||||
<!-- Gesamtkosten Farbe (zur Gesamtsumme) -->
|
||||
<option id="gesamtkosten_farbe" name="gesamtkosten_farbe" type="Hidden" default="1">
|
||||
<auflage>
|
||||
<grenze calc_value="$CVdrucke_farbe_auflage$CV*$CVklickpreis_farbe_drucke_farbe$CV">
|
||||
1-</grenze>
|
||||
</auflage>
|
||||
</option>
|
||||
|
||||
<!-- Variable Kosten Kaschierung -->
|
||||
<option id="kaschieren_variabel" name="kaschieren_variabel" type="Hidden" default="1">
|
||||
<auflage>
|
||||
<grenze calc_value="$Pkaschieren_bis_10$P">1-10</grenze>
|
||||
<grenze calc_value="$Pkaschieren_bis_100$P">11-100</grenze>
|
||||
<grenze calc_value="$Pkaschieren_ueber_100$P">101-</grenze>
|
||||
</auflage>
|
||||
</option>
|
||||
|
||||
<!-- Gesamtkosten Kaschierung (zur Gesamtsumme) -->
|
||||
<option id="gesamtkosten_kaschierung" name="gesamtkosten_kaschierung" type="Hidden"
|
||||
default="1">
|
||||
<umschlag_bezug>
|
||||
<grenze calc_value="0">0</grenze>
|
||||
<grenze
|
||||
calc_value="$Pkaschieren_fix$P+($Vauflage$V*$CVkaschieren_variabel_auflage$CV)">
|
||||
1,2</grenze>
|
||||
</umschlag_bezug>
|
||||
</option>
|
||||
|
||||
<!-- Fixkosten Bindung -->
|
||||
<option id="fixkosten_bindung" name="fixkosten_bindung" type="Hidden" default="1">
|
||||
<bindeart>
|
||||
<grenze calc_value="$Psoftcover_fix$P">1</grenze>
|
||||
<grenze calc_value="$Pfaelzel_fix$P">2</grenze>
|
||||
<grenze calc_value="$Phardcover_fix$P">3</grenze>
|
||||
<grenze calc_value="$Pspiralbindung_fix$P">4</grenze>
|
||||
</bindeart>
|
||||
</option>
|
||||
|
||||
<!-- Ermittlung aller variabler Kosten -->
|
||||
<!-- Variable Kosten Fälzelbindung -->
|
||||
<option id="faelzel_variabel" name="faelzel_variabel" type="Hidden" default="1">
|
||||
<auflage>
|
||||
<grenze calc_value="$Pfaelzel_bis_10$P">1-10</grenze>
|
||||
<grenze calc_value="$Pfaelzel_bis_50$P">11-50</grenze>
|
||||
<grenze calc_value="$Pfaelzel_bis_150$P">51-150</grenze>
|
||||
<grenze calc_value="$Pfaelzel_ueber_150$P">151-</grenze>
|
||||
</auflage>
|
||||
</option>
|
||||
|
||||
<!-- Variable Kosten Hardcover -->
|
||||
<option id="hardcover_variabel" name="hardcover_variabel" type="Hidden" default="1">
|
||||
<auflage>
|
||||
<grenze calc_value="$Phardcover_bis_10$P">1-10</grenze>
|
||||
<grenze calc_value="$Phardcover_bis_50$P">11-50</grenze>
|
||||
<grenze calc_value="$Phardcover_bis_150$P">51-150</grenze>
|
||||
<grenze calc_value="$Phardcover_ueber_150$P">151-</grenze>
|
||||
</auflage>
|
||||
</option>
|
||||
|
||||
<!-- Variable Kosten Spiralbindung -->
|
||||
<option id="spiralbindung_variabel" name="spiralbindung_variabel" type="Hidden" default="1">
|
||||
<auflage>
|
||||
<grenze calc_value="$Pspiralbindung_bis_10$P">1-10</grenze>
|
||||
<grenze calc_value="$Pspiralbindung_bis_50$P">11-50</grenze>
|
||||
<grenze calc_value="$Pspiralbindung_bis_150$P">51-150</grenze>
|
||||
<grenze calc_value="$Pspiralbindung_ueber_150$P">151-</grenze>
|
||||
</auflage>
|
||||
</option>
|
||||
|
||||
<!-- Gesamtkosten Bindung (zur Gesamtsumme) -->
|
||||
<option id="gesamtkosten_bindung" name="gesamtkosten_bindung" type="Hidden" default="1">
|
||||
<bindeart>
|
||||
<grenze
|
||||
calc_value="$Psoftcover_fix$P+($Vauflage$V*$CVsoftcover_variabel_auflage$CV)">1</grenze>
|
||||
<grenze calc_value="$Pfaelzel_fix$P+($Vauflage$V*$CVfaelzel_variabel_auflage$CV)">2</grenze>
|
||||
<grenze
|
||||
calc_value="$Phardcover_fix$P+($Vauflage$V*$CVhardcover_variabel_auflage$CV)">3</grenze>
|
||||
<grenze
|
||||
calc_value="$Pspiralbindung_fix$P+($Vauflage$V*$CVspiralbindung_variabel_auflage$CV)">
|
||||
4</grenze>
|
||||
</bindeart>
|
||||
</option>
|
||||
|
||||
<!-- Kosten CD-Hülle (zur Gesamtsumme) -->
|
||||
<option id="kosten_cdhuelle" name="kosten_cdhuelle" type="Hidden" default="1">
|
||||
<cdhuelle>
|
||||
<grenze calc_value="0">0</grenze>
|
||||
<grenze calc_value="$Pcd_huelle$P*$Vauflage$V">1-2</grenze>
|
||||
</cdhuelle>
|
||||
</option>
|
||||
|
||||
<!-- Kosten CD brennen (zur Gesamtsumme) -->
|
||||
<option id="kosten_cdbrennen" name="kosten_cdbrennen" type="Hidden" default="1">
|
||||
<cdbrennen>
|
||||
<grenze calc_value="0">0</grenze>
|
||||
<grenze calc_value="$Pcd_brennen_ol$P*$Vauflage$V">1</grenze>
|
||||
<grenze calc_value="$Pcd_brennen_ml$P*$Vauflage$V">2</grenze>
|
||||
</cdbrennen>
|
||||
</option>
|
||||
|
||||
<!-- Kosten Dreieckstasche (zur Gesamtsumme) -->
|
||||
<option id="kosten_dreieckstasche" name="kosten_dreieckstasche" type="Hidden" default="1">
|
||||
<dreieckstasche>
|
||||
<grenze calc_value="0">0</grenze>
|
||||
<grenze calc_value="$Pdreieckstasche$P*$Vauflage$V">1-2</grenze>
|
||||
</dreieckstasche>
|
||||
</option>
|
||||
|
||||
<!-- Kosten Datencheck (zur Gesamtsumme) -->
|
||||
<option id="kosten_datencheck" name="kosten_datencheck" type="Hidden" default="1">
|
||||
<datenpruefung>
|
||||
<grenze calc_value="0">0</grenze>
|
||||
<grenze calc_value="$Pprofidatenpruefung$P">1</grenze>
|
||||
</datenpruefung>
|
||||
</option>
|
||||
|
||||
<!-- Produktionszeit Zuschlagsfaktor -->
|
||||
<option id="produktionszeit_zuschlagsfaktor" name="produktionszeit_zuschlagsfaktor"
|
||||
type="Hidden" default="1">
|
||||
<produktionszeit>
|
||||
<grenze calc_value="1">0</grenze>
|
||||
<grenze calc_value="$Pexpress$P">1</grenze>
|
||||
<grenze calc_value="$Pstundenservice$P">2</grenze>
|
||||
</produktionszeit>
|
||||
</option>
|
||||
|
||||
<!-- Umschlag Material und Druck (19.02.2018) -->
|
||||
<!-- Umschlag Material vorn -->
|
||||
<option id="deckblatt" name="deckblatt" type="Hidden" default="1">
|
||||
<umschlagvorn>
|
||||
<grenze formel="0">1</grenze>
|
||||
<grenze formel="$Pumschlag_faelzel_spiral_material$P*$Vauflage$V">2-11</grenze>
|
||||
</umschlagvorn>
|
||||
</option>
|
||||
<!-- Umschlag Material hinten -->
|
||||
<option id="abschlussblatt" name="abschlussblatt" type="Hidden" default="1">
|
||||
<umschlaghinten>
|
||||
<grenze formel="0">1</grenze>
|
||||
<grenze formel="$Pumschlag_faelzel_spiral_material$P*$Vauflage$V">3-11</grenze>
|
||||
</umschlaghinten>
|
||||
</option>
|
||||
<!-- Umschlag Druck temp (wird benötigt, wenn Druck vom Anwender wieder rausgenommen wird) -->
|
||||
<option id="druckkosten_umschlag_temp" name="druckkosten_umschlag_temp" type="Hidden"
|
||||
default="0">
|
||||
<umschlagvorn>
|
||||
<grenze calc_value="0">1,2,6</grenze>
|
||||
<grenze calc_value="1">3-5,7-11</grenze>
|
||||
</umschlagvorn>
|
||||
</option>
|
||||
<!-- Umschlag Druck -->
|
||||
<option id="druckkosten_umschlag" name="druckkosten_umschlag" type="Hidden" default="0">
|
||||
<umschlag_druck_neu>
|
||||
<grenze formel="0">0</grenze>
|
||||
<grenze
|
||||
formel="$Pumschlag_faelzel_spiral_druck$P*$Vauflage$V*$CVdruckkosten_umschlag_temp_umschlagvorn$CV">
|
||||
1</grenze>
|
||||
<grenze
|
||||
formel="$Pumschlag_faelzel_spiral_druck$P*$Vauflage$V*$CVdruckkosten_umschlag_temp_umschlagvorn$CV*2">
|
||||
2</grenze>
|
||||
</umschlag_druck_neu>
|
||||
</option>
|
||||
|
||||
<!-- Gesamtsumme -->
|
||||
<option id="gesamtsumme" name="gesamtsumme" type="Hidden" default="1">
|
||||
<auflage>
|
||||
<grenze
|
||||
calc_value="
|
||||
($CVpapierkosten_auflage$CV)+
|
||||
($CVgesamtkosten_sw_auflage$CV)+
|
||||
($CVgesamtkosten_farbe_auflage$CV)+
|
||||
($CVgesamtkosten_kaschierung_umschlag_bezug$CV)+
|
||||
($CVgesamtkosten_bindung_bindeart$CV)+
|
||||
($CVkosten_cdhuelle_cdhuelle$CV)+
|
||||
($CVkosten_cdbrennen_cdbrennen$CV)+
|
||||
($CVkosten_dreieckstasche_dreieckstasche$CV)+
|
||||
($CVkosten_datencheck_datenpruefung$CV)
|
||||
">
|
||||
1-
|
||||
</grenze>
|
||||
</auflage>
|
||||
</option>
|
||||
|
||||
<!-- Gesamtsumme inkl. Produktionszeitzuschlag = Endpreis -->
|
||||
<option id="gesamtsumme_mit_produktionszeitzuschlag"
|
||||
name="gesamtsumme_mit_produktionszeitzuschlag" type="Hidden" default="1">
|
||||
<auflage>
|
||||
<grenze
|
||||
formel="
|
||||
ceil(((
|
||||
($CVgesamtsumme_auflage$CV)*$CVproduktionszeit_zuschlagsfaktor_produktionszeit$CV
|
||||
)*100)/$Vauflage$V)/100*$Vauflage$V">
|
||||
1-
|
||||
</grenze>
|
||||
</auflage>
|
||||
</option>
|
||||
</artikel>
|
||||
</kalkulation>
|
||||
|
||||
<!-- 【ツ】 -->
|
||||
10
tests/Customer/NN/calcTemplates.xml
Normal file
10
tests/Customer/NN/calcTemplates.xml
Normal file
@ -0,0 +1,10 @@
|
||||
<root>
|
||||
|
||||
<!-- Produktionszeit alg. -->
|
||||
<option id="produktionszeit" name="Produktionszeit" type="Select">
|
||||
<opt id="0" name="Standard (4-5 Arbeitstage)"></opt>
|
||||
<opt id="1" name="Express (1-2 Arbeitstage)"></opt>
|
||||
<opt id="2" name="Same day (Dateneingang bis 10 Uhr)"></opt>
|
||||
</option>
|
||||
|
||||
</root>
|
||||
135
tests/Customer/NN/formels.txt
Normal file
135
tests/Customer/NN/formels.txt
Normal file
@ -0,0 +1,135 @@
|
||||
//Formel Shop
|
||||
|
||||
// Flyer
|
||||
$flyer40='($Pflyerklick$P*$Vauflage$V)+($Vpapier_value$V*$Vauflage$V)';
|
||||
$flyer44='($Pflyerklick$P*2*$Vauflage$V)+($Vpapier_value$V*$Vauflage$V)';
|
||||
$fflyer44='($Pfflyerklick$P*2*$Vauflage$V)+($Vpapier_value$V*$Vauflage$V)';
|
||||
|
||||
// Karten
|
||||
$weihnachtskarte2s='((0.5*$Vauflage$V)+(5))/1.19';
|
||||
$weihnachtskarte4s='((1.5*$Vauflage$V)+(5))/1.19';
|
||||
$karte40='($Pkarteklick$P*$Vauflage$V)+($Vpapier_value$V*$Vauflage$V)';
|
||||
$karte44='($Pkarteklick$P*2*$Vauflage$V)+($Vpapier_value$V*$Vauflage$V)';
|
||||
$faltkarte44='($Pfkarteklick$P*2*$Vauflage$V)+($Vpapier_value$V*$Vauflage$V)';
|
||||
$einleger='($Pflyerklick$P*2*$Vauflage$V)+($Vpapier_value$V*$Vauflage$V)';
|
||||
$planonut='$pnuten+($Vauflage$V*$pnut$P)';
|
||||
$geschlossennut='$pnuten+($Vauflage$V*$pnutgeschlossen$P)';
|
||||
|
||||
// Kalender
|
||||
$kalendera5='($Vauflage$V*$Vseiten$V*.3)+($Vauflage$V*6.96)+5';
|
||||
$kalendera4='($Vauflage$V*$Vseiten$V*.5)+($Vauflage$V*7.96)+5';
|
||||
$kalendera3='($Vauflage$V*$Vseiten$V*.75)+($Vauflage$V*9.2)+5';
|
||||
|
||||
// Bogen
|
||||
$bogen40='($Pfarbdruck1$P*$Vauflage$V*$Vsorten$V)+($Vpapier_value$V*$Vauflage$V)';
|
||||
$bogen44='($Pflyerklick$P*2*$Vauflage$V*$Vsorten$V)+($Vpapier_value$V*$Vauflage$V)';
|
||||
|
||||
// Visitenkarte einseitig doppelseitig klapp
|
||||
$vk40='$Pvkpauschale$P+($Pvisitenkarte$P*$Vauflage$V/10)+(($Vpapier_value$V*$Vauflage$V)/20)';
|
||||
$vk44='$Pvkpauschale$P+($Pvisitenkarte$P*$Vauflage$V*2/10)+(($Vpapier_value$V*$Vauflage$V)/20)';
|
||||
$vkk44='20+($Pvisitenkartek$P*$Vauflage$V)*4+$Pvkpauschale$P+($Vpapier_value$V/10*$Vauflage$V)+($Pnut$P*$Vauflage$V)+(($Vpapier_value$V*$Vauflage$V)/20)';
|
||||
|
||||
// Poster
|
||||
$rahmen='((((tonumber($Vkurz$V)*tonumber($Vlang$V)*$Vauflage$V))/10000)*30.5)+($Vauflage$V*15)';
|
||||
$poster='2.5+(((tonumber($Vkurz$V)*tonumber($Vlang$V)*$Vauflage$V)*$Pposterqm1$P)/10000)';
|
||||
$postera1='(($Pposterqm1$P/2)*$Vauflage$V)+$Pposterpauschale$P';
|
||||
$fhhpostera1='(($Pposterqm1$P/2)*$Vmenge$V)';
|
||||
$postera0='(($Pposterqm1$P/1)*$Vauflage$V)+$Pposterpauschale$P';
|
||||
|
||||
// Plakat
|
||||
$plakata3='(0.25*$Vauflage$V)+($Vpapier_value$V*$Vauflage$V)+19.8';
|
||||
$plakata4='(0.15*$Vauflage$V)+($Vpapier_value$V*$Vauflage$V/2)+19.9';
|
||||
$plakat160='(((tonumber($Vkurz$V)*tonumber($Vlang$V)*$Vauflage$V)*$Pplakat160qm1$P)/10000)+$Pplakatpauschale$P';
|
||||
$plakat140='(((tonumber($Vkurz$V)*tonumber($Vlang$V)*$Vauflage$V)*$Pplakat140qm1$P)/10000)';
|
||||
$plakat80='(((tonumber($Vkurz$V)*tonumber($Vlang$V)*$Vauflage$V)*$Pplakat80qm1$P)/10000)';
|
||||
|
||||
// Leinwand
|
||||
$leinwand='(((tonumber($Vkurz$V)*tonumber($Vlang$V)*$Vauflage$V)*70)/10000)';
|
||||
$leisten='((tonumber($Vkurz$V)+tonumber($Vlang$V)*$Vauflage$V)*2)*5.5/100';
|
||||
$aufziehen='(((tonumber($Vkurz$V)*tonumber($Vlang$V)*$Vauflage$V)*40)/10000)+(5*$Vauflage$V)';
|
||||
|
||||
// Banner
|
||||
$banner='(((tonumber($Vkurz$V)*tonumber($Vlang$V)*$Vauflage$V)*$Pbannerqm$P)/10000)';
|
||||
$mesh='(((tonumber($Vkurz$V)*tonumber($Vlang$V)*$Vauflage$V)*$Pmeshqm$P)/10000)';
|
||||
$blockout='(((tonumber($Vkurz$V)*tonumber($Vlang$V)*$Vauflage$V)*$Pblockoutqm$P)/10000)';
|
||||
$pp='(((tonumber($Vkurz$V)*tonumber($Vlang$V)*$Vauflage$V)*$Pppqm$P)/10000)';
|
||||
$lamprotect='(((tonumber($Vkurz$V)*tonumber($Vlang$V)*$Vauflage$V)*30)/10000)';
|
||||
$solprotect='(((tonumber($Vkurz$V)*tonumber($Vlang$V)*$Vauflage$V)*12)/10000)';
|
||||
$solprotectmm='(((tonumber($Vkurz$V)*tonumber($Vlang$V)*$Vauflage$V)*12)/1000000)';
|
||||
$oesen='((tonumber($Vkurz$V)+tonumber($Vlang$V)*$Vauflage$V)*2)/50';
|
||||
|
||||
// Tapete
|
||||
$tapete='(((tonumber($Vkurz$V)*tonumber($Vlang$V))*$Vauflage$V)*(44.5)/10000)';
|
||||
|
||||
// Klebefolie
|
||||
$cutfolie='(((tonumber($Vkurz$V+1)*tonumber($Vlang$V+1)*$Vauflage$V)*$Pcutfolieqm$P)/10000)+$Pcutfoliepausch$P';
|
||||
$cuttransfer='(((tonumber($Vkurz$V+1)*tonumber($Vlang$V+1)*$Vauflage$V)*$Pcuttransferqm$P)/10000)';
|
||||
$aufkleber='(((tonumber($Vkurz$V+1)*tonumber($Vlang$V+1)*$Vauflage$V)*$Paufkleberqm$P)/1000000)+25';
|
||||
$klebefolie='(((tonumber($Vkurz$V)*tonumber($Vlang$V)*$Vauflage$V)*$Pklebefolieqm$P)/10000)';
|
||||
$diafilm='(((tonumber($Vkurz$V)*tonumber($Vlang$V)*$Vauflage$V)*(70))/10000)';
|
||||
|
||||
// Plotten
|
||||
$pltfarbe='(((tonumber($Vkurz$V)*tonumber($Vlang$V)*$Vauflage$V)*$Pplotfarbe$P)/1000000)';
|
||||
$pltsw='(((tonumber($Vkurz$V)*tonumber($Vlang$V)*$Vauflage$V)*$Pplotsw$P)/1000000)';
|
||||
$pltfarbefl='(((tonumber($Vkurz$V)*tonumber($Vlang$V)*$Vauflage$V)*$Pplotfarbefl$P)/1000000)';
|
||||
|
||||
// Laminieren
|
||||
$laminierenposter='(((tonumber($Vkurz$V)*tonumber($Vlang$V)*$Vauflage$V)*$Plaminieren$P)/10000)';
|
||||
|
||||
// Kaschieren
|
||||
$kaschieren3hsposter='((tonumber($Vkurz$V)*tonumber($Vlang$V)*$Vauflage$V)*$Pk3hs$P)/10000+$Pruestkosten$P';
|
||||
$kaschieren5hsposter='((tonumber($Vkurz$V)*tonumber($Vlang$V)*$Vauflage$V)*$Pk5hs$P)/10000+$Pruestkosten$P';
|
||||
$kaschieren5fsposter='((tonumber($Vkurz$V)*tonumber($Vlang$V)*$Vauflage$V)*$Pk5fs$P)/10000+$Pruestkosten$P';
|
||||
$kaschieren5hsposter='((tonumber($Vkurz$V)*tonumber($Vlang$V)*$Vauflage$V)*$Pk5fs$P)/10000+$Pruestkosten$P';
|
||||
$kaschieren10fsposter='((tonumber($Vkurz$V)*tonumber($Vlang$V)*$Vauflage$V)*$Pk10fs$P)/10000+$Pruestkosten$P';
|
||||
$kaschierenaluposter='((tonumber($Vkurz$V)*tonumber($Vlang$V)*$Vauflage$V)*$Pkalu$P)/10000+$Pruestkosten$P';
|
||||
$kaschierenalufolie='((tonumber($Vkurz$V)*tonumber($Vlang$V)*$Vauflage$V)*$Pkalu$P)/11000';
|
||||
$kaschieren3hs='((tonumber($Vkurz$V)*tonumber($Vlang$V)*$Vauflage$V)*$Pkaschieren3hs$P)/10000+$Pruestkosten$P';
|
||||
$kaschieren5hs='(($Vauflage$V)*$Pk5hs$P)/10000+$Pruestkosten$P';
|
||||
$kaschieren10hs='(($Vauflage$V)*$Pk10hs$P)/10000+$Pruestkosten$P';
|
||||
$kaschieren5fs='(($Vauflage$V)*$Pk5fs$P)/10000+$Pruestkosten$P';
|
||||
$kaschieren10fs='(($Vauflage$V)*$Pk10fs$P)/10000+$Pruestkosten$P';
|
||||
$kaschierenalu='(($Vauflage$V)*$Pkalu$P)/10000+$Pruestkosten$P';
|
||||
|
||||
// RollUp basic
|
||||
$rollbasic='(144.35/1.19*$Vauflage$V)';
|
||||
|
||||
// Cellophanieren
|
||||
$cello='10+$Pcello$P*$Vauflage$V';
|
||||
$cellodps='10+$Pcello$P*2*$Vauflage$V';
|
||||
$formelvkcello='5+($Pcello$P*$Vauflage$V/20)';
|
||||
|
||||
// Taschenlaminat
|
||||
$formeltl='$Ptaschenlaminieren3$P*$Vauflage$V';
|
||||
|
||||
// Eckenrunden
|
||||
$formel7='$Peckenrundeneinrichten$P+($Peckenrunden$P*$Vauflage$V)';
|
||||
|
||||
// Falten
|
||||
$falten='$Pfalte$P*$Vauflage$V';
|
||||
|
||||
// Nuten
|
||||
$nutplano='$Pnuten$P+($Pnut$P*$Vauflage$V)';
|
||||
|
||||
// Nuten für Kombiartikel
|
||||
$nutplan='($Pnut$P*$Vauflage$V)';
|
||||
$nutzu='$Pnuten$P+($Pnutgeschlossen$P*$Vauflage$V)';
|
||||
|
||||
//Heften
|
||||
$heftenX='10+(0.15*$Vauflage$V)';
|
||||
|
||||
// Briefpapier
|
||||
$briefpapier='($Vauflage$V*0.10)+25+($Vpapier_value$V/2*$Vauflage$V)';
|
||||
|
||||
// Zeitungen
|
||||
|
||||
// Abizeitung
|
||||
$abi_a4_sw='($Vauflage$V*$Vswseiten$V)*0.025)+($Vauflage$V*.08)';
|
||||
|
||||
// Schuelerzeitung
|
||||
$sza5fc='($Vauflage$V*0.6)+10+(($Vauflage$V*$Vswswseiten$V)*0.015)+($Vauflage$V*0.15)+($Vpapier_value$V/2*$Vauflage$V*$Vswswseiten$V)+($Vauflage$V/2*$Vumschlag_value$V)';
|
||||
$sza4fc='($Vauflage$V*0.6)+10+(($Vauflage$V*$Vswswseiten$V)*0.025)+($Vauflage$V*0.15)+($Vpapier_value$V/2*$Vauflage$V*$Vswswseiten$V)+($Vauflage$V/2*$Vumschlag_value$V)';
|
||||
$sza5='10+(($Vauflage$V*$Vswswseiten$V)*0.015)+($Vauflage$V*0.15)+($Vpapier_value$V/4*$Vauflage$V*$Vswswseiten$V)+($Vauflage$V/4*$Vumschlag_value$V)';
|
||||
$sza4='10+(($Vauflage$V*$Vswswseiten$V)*0.025)+($Vauflage$V*0.15)+($Vpapier_value$V/2*$Vauflage$V*$Vswswseiten$V)+($Vauflage$V/2*$Vumschlag_value$V)';
|
||||
$sz4ca5='10+(($Vauflage$V*$Vswswseiten$V)*0.15)+($Vauflage$V*0.15)+($Vpapier_value$V/4*$Vauflage$V*$Vswswseiten$V)+($Vauflage$V/4*$Vumschlag_value$V)';
|
||||
$sz4ca4='10+(($Vauflage$V*$Vswswseiten$V)*0.25)+($Vauflage$V*0.15)+($Vpapier_value$V/2*$Vauflage$V*$Vswswseiten$V)+($Vauflage$V/2*$Vumschlag_value$V)';
|
||||
327
tests/Customer/NN/papierContainer.xml
Normal file
327
tests/Customer/NN/papierContainer.xml
Normal file
@ -0,0 +1,327 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<container>
|
||||
<papiercontainer id="ep-std-inhalt">
|
||||
<papier id="SPP090" />
|
||||
<!-- <papier id="SPP100" />
|
||||
<papier id="SPP120" />
|
||||
<papier id="MCC090" />
|
||||
<papier id="MCC100" />
|
||||
<papier id="MCC120" />
|
||||
<papier id="BT3n090" />
|
||||
<papier id="BT3n120" />
|
||||
<papier id="MNC080" />
|
||||
<papier id="MNC100" />
|
||||
<papier id="MNC120" />-->
|
||||
</papiercontainer>
|
||||
<papiercontainer id="ep-uni-inhalt">
|
||||
<papier id="SPP080" />
|
||||
<papier id="SPP090" />
|
||||
<papier id="SPP100" />
|
||||
</papiercontainer>
|
||||
<papiercontainer id="ep-sc-umschlag">
|
||||
<papier id="BDM350" />
|
||||
<papier id="SPP300" />
|
||||
<papier id="MCC350" />
|
||||
<papier id="BT3n300" />
|
||||
<papier id="MNC300" />
|
||||
<papier id="bdm200" />
|
||||
</papiercontainer>
|
||||
<papiercontainer id="ep-sf-umschlag">
|
||||
<papier id="BT3n160" />
|
||||
<papier id="SPP160" />
|
||||
<papier id="MCC160" />
|
||||
<papier id="MNC160" />
|
||||
<papier id="AIC160_04" />
|
||||
<papier id="AIC160_07" />
|
||||
<papier id="AIC160_08" />
|
||||
<papier id="AIC160_15" />
|
||||
<papier id="AIC160_17" />
|
||||
<papier id="AIC160_14" />
|
||||
<papier id="AIC160_23" />
|
||||
<papier id="AIC160_25" />
|
||||
<papier id="AIC160_26" />
|
||||
<papier id="AIC160_28" />
|
||||
<papier id="AIC160_36" />
|
||||
</papiercontainer>
|
||||
<papiercontainer id="dps-swk">
|
||||
<papier id="LEPP350" />
|
||||
</papiercontainer>
|
||||
<papiercontainer id="einleger">
|
||||
<papier id="bdm135" />
|
||||
<papier id="bdg135" />
|
||||
<papier id="bdm170" />
|
||||
<papier id="bdg170" />
|
||||
<papier id="trans" />
|
||||
<papier id="c100" />
|
||||
<papier id="biotop80" />
|
||||
</papiercontainer>
|
||||
<papiercontainer id="fanbuch">
|
||||
<papier id="kp80" />
|
||||
<papier id="biotop80" />
|
||||
<papier id="c100" />
|
||||
<papier id="recy80" />
|
||||
<papier id="munken90" />
|
||||
<papier id="kar" />
|
||||
<papier id="lin" />
|
||||
</papiercontainer>
|
||||
<papiercontainer id="abi_sw_innen">
|
||||
<papier id="kp80" />
|
||||
<papier id="recy80" />
|
||||
</papiercontainer>
|
||||
<papiercontainer id="abi_farb_innen">
|
||||
<papier id="c100" />
|
||||
<papier id="recy80" />
|
||||
</papiercontainer>
|
||||
<papiercontainer id="inkjet">
|
||||
<papier id="kp80" />
|
||||
<papier id="biotop80" />
|
||||
<papier id="recy80" />
|
||||
</papiercontainer>
|
||||
<papiercontainer id="swpapier">
|
||||
<papier id="kp80" />
|
||||
<papier id="biotop80" />
|
||||
<papier id="recy80" />
|
||||
<papier id="munken80" />
|
||||
<papier id="farb80" />
|
||||
</papiercontainer>
|
||||
<papiercontainer id="briefpapier">
|
||||
<papier id="kp80" />
|
||||
<papier id="biotop80" />
|
||||
<papier id="recy80" />
|
||||
<papier id="munken80" />
|
||||
<papier id="c100" />
|
||||
</papiercontainer>
|
||||
<papiercontainer id="brosch_sw_umschlag">
|
||||
<papier id="biotop160" />
|
||||
<papier id="recy160" />
|
||||
<papier id="k160" />
|
||||
<papier id="k160f" />
|
||||
<papier id="kp80" />
|
||||
<papier id="c100" />
|
||||
<papier id="biotop80" />
|
||||
<papier id="recy80" />
|
||||
<papier id="munken90" />
|
||||
</papiercontainer>
|
||||
<papiercontainer id="brosch_farb_umschlag">
|
||||
<papier id="bdm170" />
|
||||
<papier id="bdg170" />
|
||||
<papier id="biotop160" />
|
||||
<papier id="c200" />
|
||||
<papier id="biotop80" />
|
||||
<papier id="recy80" />
|
||||
<papier id="munken90" />
|
||||
<papier id="c100" />
|
||||
<papier id="bdm135" />
|
||||
<papier id="bdg135" />
|
||||
</papiercontainer>
|
||||
<papiercontainer id="brosch_sw_innen">
|
||||
<papier id="kp80" />
|
||||
<papier id="c100" />
|
||||
<papier id="recy80" />
|
||||
<papier id="munken90" />
|
||||
</papiercontainer>
|
||||
<papiercontainer id="brosch_farb_innen">
|
||||
<papier id="c100" />
|
||||
<papier id="biotop80" />
|
||||
<papier id="recy80" />
|
||||
<papier id="munken90" />
|
||||
<papier id="bdm135" />
|
||||
<papier id="bdg135" />
|
||||
</papiercontainer>
|
||||
<papiercontainer id="titeldruck">
|
||||
<papier id="c200" />
|
||||
<papier id="c300" />
|
||||
<papier id="bdm250" />
|
||||
<papier id="bdg250" />
|
||||
<papier id="bdm170" />
|
||||
<papier id="bdg170" />
|
||||
</papiercontainer>
|
||||
<papiercontainer id="katalog_umschlag">
|
||||
<papier id="bdm250" />
|
||||
<papier id="bdg250" />
|
||||
<papier id="bdm170" />
|
||||
<papier id="bdg170" />
|
||||
</papiercontainer>
|
||||
<papiercontainer id="katalog_innen">
|
||||
<papier id="bdm170" />
|
||||
<papier id="bdg170" />
|
||||
<papier id="bdm135" />
|
||||
<papier id="bdg135" />
|
||||
</papiercontainer>
|
||||
<papiercontainer id="flyer">
|
||||
<papier id="bdm135" />
|
||||
<papier id="bdg135" />
|
||||
<papier id="bdm170" />
|
||||
<papier id="bdg170" />
|
||||
<papier id="bdm250" />
|
||||
<papier id="bdg250" />
|
||||
</papiercontainer>
|
||||
<papiercontainer id="flyerkarte">
|
||||
<papier id="kp80" />
|
||||
<papier id="recy80" />
|
||||
<papier id="munken90" />
|
||||
<papier id="c100" />
|
||||
<papier id="c120" />
|
||||
<papier id="c200" />
|
||||
<papier id="c300" />
|
||||
<papier id="bdm135" />
|
||||
<papier id="bdg135" />
|
||||
<papier id="bdm170" />
|
||||
<papier id="bdg170" />
|
||||
<papier id="bdm250" />
|
||||
<papier id="bdg250" />
|
||||
<papier id="cro270" />
|
||||
<papier id="munken240" />
|
||||
<papier id="recy240" />
|
||||
</papiercontainer>
|
||||
<papiercontainer id="4cpapier">
|
||||
<papier id="c100_incl" />
|
||||
<papier id="bdm135" />
|
||||
<papier id="bdg135" />
|
||||
<papier id="biotop80" />
|
||||
<papier id="recy80" />
|
||||
<papier id="munken90" />
|
||||
</papiercontainer>
|
||||
<papiercontainer id="stro">
|
||||
<papier id="c100_incl" />
|
||||
<papier id="bdm135" />
|
||||
<papier id="bdg135" />
|
||||
<papier id="bdm170" />
|
||||
<papier id="bdg170" />
|
||||
<papier id="c300" />
|
||||
<papier id="bdm250" />
|
||||
<papier id="bdg250" />
|
||||
</papiercontainer>
|
||||
<papiercontainer id="faltflyer">
|
||||
<papier id="c100" />
|
||||
<papier id="bdm135" />
|
||||
<papier id="bdg135" />
|
||||
<papier id="bdm170" />
|
||||
<papier id="bdg170" />
|
||||
</papiercontainer>
|
||||
<papiercontainer id="karte">
|
||||
<papier id="c300" />
|
||||
<papier id="bdm250" />
|
||||
<papier id="bdg250" />
|
||||
<papier id="bdg350" />
|
||||
<papier id="cro270" />
|
||||
</papiercontainer>
|
||||
<papiercontainer id="postkarte">
|
||||
<papier id="c300" />
|
||||
<papier id="recy240" />
|
||||
<papier id="munken240" />
|
||||
<papier id="cro270" />
|
||||
</papiercontainer>
|
||||
<papiercontainer id="vk">
|
||||
<papier id="c300" />
|
||||
<papier id="bdm250" />
|
||||
<papier id="bdg250" />
|
||||
<papier id="bdg350" />
|
||||
<papier id="visit" />
|
||||
<papier id="cro270" />
|
||||
</papiercontainer>
|
||||
<papiercontainer id="1">
|
||||
<papier id="c100" />
|
||||
<papier id="bdm135" />
|
||||
<papier id="bdg135" />
|
||||
<papier id="bdm170" />
|
||||
<papier id="bdg170" />
|
||||
</papiercontainer>
|
||||
<papiercontainer id="2">
|
||||
<papier id="c300" />
|
||||
<papier id="bdm250" />
|
||||
<papier id="bdg250" />
|
||||
<papier id="bdg350" />
|
||||
<papier id="rtemotion" />
|
||||
<papier id="cro270" />
|
||||
</papiercontainer>
|
||||
<papiercontainer id="3">
|
||||
<papier id="cc100" />
|
||||
<papier id="cc120" />
|
||||
<papier id="bdm135" />
|
||||
<papier id="bdg135" />
|
||||
<papier id="cc300" />
|
||||
<papier id="bdm250" />
|
||||
<papier id="bdm350" />
|
||||
<papier id="bdg250" />
|
||||
<papier id="bdg350" />
|
||||
<papier id="rtemotion" />
|
||||
</papiercontainer>
|
||||
<papiercontainer id="4">
|
||||
<papier id="bkls" />
|
||||
<papier id="bklg" />
|
||||
<papier id="bklr" />
|
||||
</papiercontainer>
|
||||
<papiercontainer id="01">
|
||||
<papier id="kp80" />
|
||||
<papier id="k160" />
|
||||
<papier id="k160f" />
|
||||
</papiercontainer>
|
||||
<papiercontainer id="fk">
|
||||
<papier id="c200" />
|
||||
<papier id="bdm250" />
|
||||
<papier id="bdg250" />
|
||||
<papier id="munken240" />
|
||||
</papiercontainer>
|
||||
<papiercontainer id="faltkartekoffset">
|
||||
<papier id="bdm170" />
|
||||
<papier id="bdg170" />
|
||||
<papier id="bdm250" />
|
||||
<papier id="bdg250" />
|
||||
</papiercontainer>
|
||||
<papiercontainer id="cd">
|
||||
<papier id="bdm170" />
|
||||
<papier id="bdg170" />
|
||||
<papier id="biotop160" />
|
||||
<papier id="recy160" />
|
||||
<papier id="c200" />
|
||||
<papier id="c100" />
|
||||
<papier id="bdm135" />
|
||||
<papier id="bdg135" />
|
||||
</papiercontainer>
|
||||
<papiercontainer id="zertifikat">
|
||||
<papier id="bdm170" />
|
||||
<papier id="bdg170" />
|
||||
<papier id="biotop160" />
|
||||
<papier id="recy160" />
|
||||
<papier id="c200" />
|
||||
<papier id="c300" />
|
||||
<papier id="bdm250" />
|
||||
<papier id="bdg250" />
|
||||
<papier id="bdg350" />
|
||||
<papier id="visit" />
|
||||
<papier id="cro270" />
|
||||
<papier id="munken240" />
|
||||
</papiercontainer>
|
||||
<papiercontainer id="serienbrief">
|
||||
<papier id="kp80" />
|
||||
<papier id="c100" />
|
||||
<papier id="recy80" />
|
||||
<papier id="munken90" />
|
||||
<papier id="angel" />
|
||||
</papiercontainer>
|
||||
<papiercontainer id="plakat">
|
||||
<papier id="160mt" />
|
||||
<papier id="80mt" />
|
||||
</papiercontainer>
|
||||
<papiercontainer id="ddh-buch-inhalt">
|
||||
<papier id="ss80" />
|
||||
<papier id="ss90" />
|
||||
<papier id="ss100" />
|
||||
<papier id="bd135" />
|
||||
<papier id="cc90" />
|
||||
<papier id="cc100" />
|
||||
</papiercontainer>
|
||||
<papiercontainer id="ddh-softcover-umschlag">
|
||||
<papier id="bdm300" />
|
||||
<papier id="bdm350" />
|
||||
<papier id="sulfat250" />
|
||||
<papier id="sulfat300" />
|
||||
<papier id="crom250" />
|
||||
<papier id="crom300" />
|
||||
<papier id="munk80" />
|
||||
<papier id="munk90" />
|
||||
<papier id="cc350" />
|
||||
<papier id="munk300" />
|
||||
</papiercontainer>
|
||||
</container>
|
||||
215
tests/Customer/NN/parameters.txt
Normal file
215
tests/Customer/NN/parameters.txt
Normal file
@ -0,0 +1,215 @@
|
||||
//Parameter EduPrint
|
||||
|
||||
//SW Klick-Kosten A3
|
||||
$swklick_bis_100=0.240;
|
||||
$swklick_bis_250=0.192;
|
||||
$swklick_bis_500=0.156;
|
||||
$swklick_bis_750=0.144;
|
||||
$swklick_bis_1000=0.120;
|
||||
$swklick_bis_2500=0.096;
|
||||
$swklick_bis_5000=0.072;
|
||||
$swklick_ueber_5000=0.060;
|
||||
|
||||
//Farbe Klick-Kosten A3
|
||||
$farbklick_bis_100=0.480;
|
||||
$farbklick_bis_250=0.384;
|
||||
$farbklick_bis_500=0.312;
|
||||
$farbklick_bis_750=0.288;
|
||||
$farbklick_bis_1000=0.240;
|
||||
$farbklick_bis_1500=0.220;
|
||||
$farbklick_bis_2500=0.192;
|
||||
$farbklick_bis_5000=0.144;
|
||||
$farbklick_ueber_5000=0.120;
|
||||
|
||||
//Umschlag-Kaschierung
|
||||
$kaschieren_fix=7;
|
||||
$kaschieren_bis_10=0.7;
|
||||
$kaschieren_bis_100=0.4;
|
||||
$kaschieren_ueber_100=0.25;
|
||||
|
||||
//Bindung Fixkosten Anpassung soft 03-01-2023
|
||||
$softcover_fix=20;
|
||||
$faelzel_fix=7;
|
||||
$hardcover_fix=10;
|
||||
$spiralbindung_fix=10;
|
||||
$zb_norm_fix=15;
|
||||
$psb_fix=15;
|
||||
$loseblattsammlung_fix=4;
|
||||
$squarefold_fix=4;
|
||||
$abizeitung_fix=15;
|
||||
|
||||
//Bindung variable Kosten Anpassung soft und fälzel 03-01-2023
|
||||
$softcover_bis_10=5;
|
||||
$softcover_bis_50=2.5;
|
||||
$softcover_bis_150=1.5;
|
||||
$softcover_ueber_150=1;
|
||||
|
||||
$faelzel_bis_10=6;
|
||||
$faelzel_bis_50=5;
|
||||
$faelzel_bis_150=3;
|
||||
$faelzel_ueber_150=3;
|
||||
|
||||
$hardcover_bis_9=15;
|
||||
$hardcover_bis_19=14;
|
||||
$hardcover_bis_49=13;
|
||||
$hardcover_ueber_49=12;
|
||||
|
||||
$spiralbindung_bis_10=1.8;
|
||||
$spiralbindung_bis_50=1.5;
|
||||
$spiralbindung_bis_150=1.2;
|
||||
$spiralbindung_ueber_150=0.9;
|
||||
|
||||
$zb_norm_bis_10=18;
|
||||
$zb_norm_bis_50=15;
|
||||
$zb_norm_bis_150=10;
|
||||
$zb_norm_ueber_150=7;
|
||||
|
||||
$psb_bis_10=1.8;
|
||||
$psb_bis_50=1.5;
|
||||
$psb_bis_150=1.2;
|
||||
$psb_ueber_150=0.9;
|
||||
|
||||
$loseblattsammlung_bis_9=0.5;
|
||||
$loseblattsammlung_bis_19=0.4;
|
||||
$loseblattsammlung_bis_49=0.3;
|
||||
$loseblattsammlung_ueber_49=0.2;
|
||||
|
||||
$squarefold_bis_9=0.5;
|
||||
$squarefold_bis_19=0.4;
|
||||
$squarefold_bis_49=0.3;
|
||||
$squarefold_ueber_49=0.2;
|
||||
|
||||
$lochen=0.1;
|
||||
$heften=0.1;
|
||||
|
||||
// Umschlagkosten (Änderungen 19.02.2018) rücken 03-01-2023
|
||||
$umschlag_faelzel_spiral_material=0.15;
|
||||
$umschlag_faelzel_spiral_druck=0.2;
|
||||
$umschlag_papiergewicht=400;
|
||||
$praegung_hardcover_vorn_fix=10;
|
||||
$praegung_hardcover_vorn_var=3;
|
||||
$praegung_hardcover_ruecken_fix=10;
|
||||
$praegung_hardcover_ruecken_var=5;
|
||||
|
||||
$cover_druck=10;
|
||||
$rucken_druck=5;
|
||||
$cover_schild=5;
|
||||
|
||||
//Kosten Extras
|
||||
$cd_huelle=0.5;
|
||||
$cd_brennen_ol=5;
|
||||
$cd_brennen_ml=7;
|
||||
$dreieckstasche=0.5;
|
||||
$dokumententasche=0.5;
|
||||
$verschlussband=0.5;
|
||||
$lesezeichen=0.5;
|
||||
|
||||
//Produktionszeit Zuschlag
|
||||
$express=1.2;
|
||||
$stundenservice=1.4;
|
||||
|
||||
//Datenprüfung
|
||||
$profidatenpruefung=9.346;
|
||||
$freigabeprozess=25.233;
|
||||
|
||||
// copyshop ab hier altes zeug
|
||||
$titeldruck=0.6/1.07;
|
||||
|
||||
$fswst1=0.2/1.07;
|
||||
$fswst2=0.11/1.07;
|
||||
$fswst3=0.10/1.07;
|
||||
$fswst4=0.09/1.07;
|
||||
$fswst5=0.08/1.07;
|
||||
$fswst6=0.06/1.07;
|
||||
$b100=3.3/1.07;
|
||||
$b150=3.7/1.07;
|
||||
$b200=4.3/1.07;
|
||||
$b300=5.3/1.07;
|
||||
$b300plus=6.3/1.07;
|
||||
//shopende
|
||||
|
||||
//farbdrucke
|
||||
$farbdruck1=0.80;
|
||||
$farbdruck2=0.80*0.85;
|
||||
$farbdruck3=0.80*0.75;
|
||||
$farbdruck4=0.80*0.65;
|
||||
$farbdruck5=0.80*0.55;
|
||||
$farbdruck6=0.80*0.45;
|
||||
$farbdruck7=0.80*0.37;
|
||||
$farbdruck8=0.80*0.31;
|
||||
$pauschale=30;
|
||||
$posterpauschale=0;
|
||||
$posterqm1=39.85/1.19;
|
||||
$plakatpauschale=10;
|
||||
$plakat140qm1=25;
|
||||
$plakat160qm1=20;
|
||||
$plakat80qm1=15;
|
||||
$plakatA3=10;
|
||||
$plakataffichenqm1=17.5;
|
||||
|
||||
$aufkleberqm=45;
|
||||
$klebefolieqm=45;
|
||||
$cutfolieqm=45;
|
||||
$cuttransferqm=15;
|
||||
$cutfoliepausch=25;
|
||||
$solprotectqm=15;
|
||||
$wallmountqm=60;
|
||||
//banner
|
||||
$bannerqm=40;
|
||||
$meshqm=40;
|
||||
$ppqm=40;
|
||||
$blockoutqm=40;
|
||||
|
||||
$vkpauschale=17.5;
|
||||
$laminieren=30;
|
||||
|
||||
//Flyer
|
||||
$flyerschneiden=7.5;
|
||||
$fflyerschneiden=8;
|
||||
$flyer=20;
|
||||
$fflyer=30;
|
||||
$karten=20;
|
||||
//$karten=35;
|
||||
$fkarten=25;
|
||||
$flyerklick=0.3;
|
||||
$fflyerklick=0.3;
|
||||
$fflyerfalten=0.01;
|
||||
$fkarteklick=0.310;
|
||||
$karteklick=0.25;
|
||||
// Weihnachtskarten
|
||||
|
||||
$klick=0.5;
|
||||
$visitenkarte=0.60;
|
||||
$k3hs=50;
|
||||
$k5hs=55;
|
||||
$k10hs=65;
|
||||
$k5fs=55;
|
||||
$k10fs=59.9;
|
||||
$kalu=89.99;
|
||||
$cello=0.1;
|
||||
$taschenlaminierena4=0.8;
|
||||
$taschenlaminierena3=1.25;
|
||||
$eckenrunden=0.01;
|
||||
$eckenrundeneinrichten=5;
|
||||
$nuten=12;
|
||||
$nut=.12;
|
||||
$nutgeschlossen=.18;
|
||||
$schneiden=2.5;
|
||||
$falten=0.01;
|
||||
$MiniRolli3=21.99;
|
||||
$MiniRolli4=16.99;
|
||||
$ruestkosten=0;
|
||||
$tbk=.60;
|
||||
$tbkpauschale=30;
|
||||
|
||||
//plotten
|
||||
$plotsw=3.95;
|
||||
$plotfarbe=9.95;
|
||||
$plotfarbefl=14.95;
|
||||
|
||||
//aufschlag
|
||||
$aufschlag=1.5;
|
||||
|
||||
//express
|
||||
$exp1=0.1;
|
||||
$exp2=1.2;
|
||||
@ -38,13 +38,13 @@ class CalcTest extends TestCase
|
||||
public function testPrice(): void
|
||||
{
|
||||
$this->engine->calc();
|
||||
self::assertSame(131.86, $this->engine->getPrice());
|
||||
self::assertSame(32.22, $this->engine->getPrice());
|
||||
}
|
||||
|
||||
public function testPriceProductArt(): void
|
||||
{
|
||||
$this->engine->setVariable('produktart_nopresentationpdf', 61);
|
||||
$this->engine->calc();
|
||||
self::assertSame(199.6, $this->engine->getPrice());
|
||||
self::assertSame(82.79, $this->engine->getPrice());
|
||||
}
|
||||
}
|
||||
|
||||
@ -39,11 +39,8 @@ class GraphTest extends TestCase
|
||||
{
|
||||
$this->engine->calc();
|
||||
$priceFromOldEngine = $this->engine->getPrice();
|
||||
self::assertSame(131.86, $priceFromOldEngine);
|
||||
file_put_contents(
|
||||
filename: __DIR__ . '/test.json',
|
||||
data: $this->engine->getCalcGraph()->generateJsonGraph(),
|
||||
);
|
||||
self::assertSame(32.22, $priceFromOldEngine);
|
||||
file_put_contents(filename: __DIR__ . '/test.json', data: $this->engine->getCalcGraph()->generateJsonGraph());
|
||||
self::assertSame($priceFromOldEngine, $this->engine->getCalcGraph()->getSum());
|
||||
}
|
||||
}
|
||||
|
||||
File diff suppressed because one or more lines are too long
@ -16,7 +16,7 @@ use Doctrine\Persistence\ObjectRepository;
|
||||
|
||||
class PaperRepostory implements ObjectRepository
|
||||
{
|
||||
public function find(mixed $id): null|object
|
||||
public function find(mixed $id): ?object
|
||||
{
|
||||
// TODO: Implement find() method.
|
||||
}
|
||||
@ -26,16 +26,12 @@ class PaperRepostory implements ObjectRepository
|
||||
// TODO: Implement findAll() method.
|
||||
}
|
||||
|
||||
public function findBy(
|
||||
array $criteria,
|
||||
null|array $orderBy = null,
|
||||
null|int $limit = null,
|
||||
null|int $offset = null,
|
||||
): array {
|
||||
public function findBy(array $criteria, ?array $orderBy = null, ?int $limit = null, ?int $offset = null): array
|
||||
{
|
||||
// TODO: Implement findBy() method.
|
||||
}
|
||||
|
||||
public function findOneBy(array $criteria): null|object
|
||||
public function findOneBy(array $criteria): ?object
|
||||
{
|
||||
$papier = [];
|
||||
$papier['bdm135'] = new Paper();
|
||||
@ -44,6 +40,14 @@ class PaperRepostory implements ObjectRepository
|
||||
$papier['bdm135']->setPreis(0.1);
|
||||
$papier['bdm135']->setDescription1('Bilderdruck matt 135 gr');
|
||||
|
||||
$papier['SPP090'] = new Paper();
|
||||
$papier['SPP090']->setArtNr('SPP090');
|
||||
$papier['SPP090']->setVolume(1.30);
|
||||
$papier['SPP090']->setPreis(28);
|
||||
$papier['SPP090']->setGrammatur(90);
|
||||
$papier['SPP090']->setDescription1('Soporset Premium Preprint 90g');
|
||||
$papier['SPP090']->setDescription2('matt, holzfrei, hochweiß');
|
||||
|
||||
$papier['bdg135'] = new Paper();
|
||||
$papier['bdg135']->setArtNr('bdg135');
|
||||
$papier['bdg135']->setDescription1('Bilderdruck glänzend 135 gr');
|
||||
|
||||
Loading…
Reference in New Issue
Block a user