Fix Calc
This commit is contained in:
parent
7a55bf4cc2
commit
2711361260
@ -125,7 +125,11 @@ class Calc
|
||||
$p = 0;
|
||||
$formel = str_replace("tonumber", '$this->toNumber', $formel);
|
||||
|
||||
try {
|
||||
eval('@$p = ' . $formel . ';');
|
||||
}catch (\Throwable $e) {
|
||||
$p = 0;
|
||||
}
|
||||
//echo $option->getId(). ' / '.$formel . ' / '.$p.' / '.PHP_EOL.PHP_EOL;
|
||||
if($p > 0 || $p < 0) {
|
||||
$gesamt += $p;
|
||||
|
||||
55
tests/Customer/H/CalcTest.php
Normal file
55
tests/Customer/H/CalcTest.php
Normal file
@ -0,0 +1,55 @@
|
||||
<?php
|
||||
namespace PSC\Library\Calc\Tests\Customer\H;
|
||||
|
||||
use PSC\Library\Calc\Article;
|
||||
use PSC\Library\Calc\Engine;
|
||||
use PSC\Library\Calc\PaperContainer;
|
||||
use PSC\Library\Calc\Tests\Mock\PaperRepostory;
|
||||
|
||||
class CalcTest extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
|
||||
/** @var Engine */
|
||||
protected $engine = null;
|
||||
|
||||
public function setUp()
|
||||
{
|
||||
$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()
|
||||
{
|
||||
$this->engine = null;
|
||||
}
|
||||
|
||||
public function testIfDefaultPriceIsOk()
|
||||
{
|
||||
$this->assertEquals(33 , $this->engine->getPrice());
|
||||
}
|
||||
|
||||
public function testIfDisplayValues()
|
||||
{
|
||||
$this->assertEquals(33 , $this->engine->getPrice());
|
||||
$this->assertCount(0 , $this->engine->getDisplayVariables());
|
||||
}
|
||||
|
||||
public function testIfAjaxValues()
|
||||
{
|
||||
$this->engine->setVariable('sap_plugin', 1);
|
||||
$this->assertEquals(258 , $this->engine->getPrice());
|
||||
$this->assertCount(6 , $this->engine->getAjaxVariables());
|
||||
}
|
||||
}
|
||||
494
tests/Customer/H/calc.xml
Normal file
494
tests/Customer/H/calc.xml
Normal file
@ -0,0 +1,494 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<kalkulation>
|
||||
<artikel>
|
||||
<name>Export Filing CHIEF</name>
|
||||
<kommentar>Testkalkulation</kommentar>
|
||||
|
||||
<uploads>
|
||||
<upload id="neutral" name="Druckdaten" description="Bitte laden sie eine PDF für den Druck hoch"/>
|
||||
</uploads>
|
||||
|
||||
|
||||
<!-- ab hier beginnt die Eingabemaske -->
|
||||
|
||||
|
||||
<option id="de" name="ATLAS" type="Hidden" default="0" >
|
||||
<opt id="0" name="nein"></opt>
|
||||
<opt id="100" name="JA"></opt>
|
||||
</option>
|
||||
|
||||
<option id="fr" name="DELTA" type="Hidden" default="0" >
|
||||
<opt id="0" name="nein"></opt>
|
||||
<opt id="1" name="JA"></opt>
|
||||
</option>
|
||||
|
||||
<option id="nl" name="AGS" type="Hidden" default="0" >
|
||||
<opt id="0" name="nein"></opt>
|
||||
<opt id="1" name="JA"></opt>
|
||||
</option>
|
||||
|
||||
<option id="pl" name="PUESC" type="Hidden" default="0" >
|
||||
<opt id="0" name="nein"></opt>
|
||||
<opt id="1" name="JA"></opt>
|
||||
</option>
|
||||
|
||||
<option id="uk" name="CHIEF-CDS" type="Hidden" default="1" >
|
||||
<opt id="1" name="JA"></opt>
|
||||
</option>
|
||||
|
||||
<option id="at" name="e-zoll" type="Hidden" default="0" >
|
||||
<opt id="0" name="nein"></opt>
|
||||
<opt id="1" name="JA"></opt>
|
||||
</option>
|
||||
|
||||
<option id="ch" name="e-dec" type="Hidden" default="0">
|
||||
<opt id="0" name="nein"></opt>
|
||||
<opt id="1" name="JA"></opt>
|
||||
</option>
|
||||
|
||||
<option id="bg" name="PLDA" type="Hidden" default="0" >
|
||||
<opt id="0" name="nein"></opt>
|
||||
<opt id="1" name="JA"></opt>
|
||||
</option>
|
||||
|
||||
<option id="dk" name="SKAT" type="Hidden" default="0" >
|
||||
<opt id="0" name="nein"></opt>
|
||||
<opt id="1" name="JA"></opt>
|
||||
</option>
|
||||
|
||||
<option id="sw" name="TDS" type="Hidden" default="0" >
|
||||
<opt id="0" name="nein"></opt>
|
||||
<opt id="1" name="JA"></opt>
|
||||
</option>
|
||||
|
||||
<option id="anz_ausfuhren" name="Annual number of export declarations" type="Input" default="25"/>
|
||||
|
||||
// Anzahl User nicht mehr preisrelevant, daher Default=1 und Hidden
|
||||
<option id="anz_user" name="Anzahl Anwender" type="Hidden" default="1">
|
||||
<opt id="1" name="1 Anwender"></opt>
|
||||
</option>
|
||||
|
||||
<option id="zusatzopt_txt" name="----------------------- Additional options -----------------------" type="Text" default=""/>
|
||||
|
||||
|
||||
//Diese Option gibt es für Deutschland noch nicht!!
|
||||
//Zum Start noch nicht verfügbar
|
||||
<option id="reporting" name="Reporting und Analytics 1 System" type="Hidden" default="0">
|
||||
<opt id="0" name="Nein"></opt>
|
||||
<opt id="1" name="Ja">
|
||||
<anz_ausfuhren>
|
||||
<grenze>1375-</grenze> // Erst ab Schwellwert für Business möglich
|
||||
</anz_ausfuhren>
|
||||
</opt>
|
||||
</option>
|
||||
|
||||
<!-- //Diese Option gibt es nur für UK
|
||||
|
||||
<option id="erzeug_ausfuhr" name="Erzeugung von Ausfuhrdokumenten (ua. ABD)" type="Select" default="0">
|
||||
<opt id="0" name="Nein"></opt>
|
||||
<opt id="1" name="Ja"></opt>
|
||||
</option>
|
||||
|
||||
//Diese Option gibt es nur für UK
|
||||
<option id="transitverfahren_ncts_cr" name="Transitverfahren (NCTS Authorized Consignor (CR))" type="Select" default="0">
|
||||
<opt id="0" name="Nein"></opt>
|
||||
<opt id="1" name="Ja"></opt>
|
||||
</option>
|
||||
-->
|
||||
|
||||
// Neue Option RoRo
|
||||
<option id="roro" name="Only RoRo exports to the EU" type="Select" default="0">
|
||||
<opt id="1" name="No"></opt>
|
||||
<opt id="0" name="Yes"></opt>
|
||||
</option>
|
||||
|
||||
|
||||
// Neue Option LowRisk
|
||||
<option id="lowrisk" name="Only export of low-risk goods" type="Select" default="0">
|
||||
<opt id="1" name="No"></opt>
|
||||
<opt id="0" name="Yes"></opt>
|
||||
</option>
|
||||
|
||||
|
||||
|
||||
|
||||
<option id="integrationen_txt" name="----------------------- Integrations -----------------------" type="Text" default=""/>
|
||||
|
||||
//Diese Option gibt es NUR GEGEN Aufpreis; Projektarbeit, deshalb keine Bestellung möglich
|
||||
<option id="sap_plugin" name="SAP plug-in" type="Select" default="0">
|
||||
<opt id="0" name="No"></opt>
|
||||
<opt id="1" name="SAP ECC"></opt>
|
||||
<opt id="2" name="SAP S/4HANA"></opt>
|
||||
</option>
|
||||
|
||||
//Diese Option gibt es OHNE Aufpreis; Projektarbeit, deshalb keine Bestellung möglich
|
||||
<option id="erp_plugin" name="ERP plug-in (request quote from sales)" type="Select" default="0">
|
||||
<opt id="0" name="No"></opt>
|
||||
<opt id="1" name="Yes"></opt>
|
||||
|
||||
|
||||
</option>
|
||||
|
||||
|
||||
<!-- Auswertung RoRo und LowRisk -->
|
||||
// Wenn dieses Ergebnis >0 ist, dann kann man nicht bestellen. Das könnte für das Template verwendet werden
|
||||
<option id="auswertung_roro_lowrisk_sap_erp" name="auswertung_roro_lowrisk" type="Hidden" default="1">
|
||||
<roro>
|
||||
<grenze calc_value="$Vroro$V+$Vlowrisk$V+$Vsap_plugin$V+$Verp_plugin$V">0,1</grenze>
|
||||
</roro>
|
||||
</option>
|
||||
|
||||
|
||||
// Ansicht Auswertung RoRo und LowRisk
|
||||
<option id="roro_lowrisk_anzeige" name="Prüfung RoRo, LowRisk, ERP und SAP" type="Hidden" default="1">
|
||||
<opt id="1" name="Alles gut, RoRo und LowRisk mit JA beantwortet, kein ERP und SAP">
|
||||
<monatspreis formel="$CVauswertung_roro_lowrisk_sap_erp_roro$CV">
|
||||
<grenze>0</grenze>
|
||||
</monatspreis>
|
||||
</opt>
|
||||
<opt id="2" name="Nicht bestellbar: RoRo oder LowRisk mit NEIN beantwortet, bzw. SAP oder ERP gewählt">
|
||||
<monatspreis formel="$CVauswertung_roro_lowrisk_sap_erp_roro$CV">
|
||||
<grenze>1-</grenze>
|
||||
</monatspreis>
|
||||
</opt>
|
||||
</option>
|
||||
|
||||
|
||||
<!-- XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX -->
|
||||
<!-- Beginn Kalkulation - Beginn Kalkulation - Beginn Kalkulation - Beginn Kalkulation -->
|
||||
<!-- XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX -->
|
||||
|
||||
<!-- ANFANG Ermittlung Anzahl Länder für den Tarifwechsel -->
|
||||
<option id="anzahl_laender" name="anzahl_laender" type="Hidden" default="1">
|
||||
<ch>
|
||||
<grenze calc_value="$Vch$V+$Vbg$V+$Vde$V+$Vdk$V+$Vfr$V+$Vnl$V+$Vpl$V+$Vsw$V+$Vuk$V+$Vat$V">0,1</grenze>
|
||||
</ch>
|
||||
</option>
|
||||
<!-- ENDE Ermittlung Anzahl Länder für den Tarifwechsel -->
|
||||
|
||||
|
||||
<!-- Berechnung des Tarifmodells auf Basis Länder, Anz. User und Anz. Ausfuhren -->
|
||||
<option id="monatspreis" name="monatspreis" type="Hidden" default="33" exportAjax="1">
|
||||
<anz_ausfuhren>
|
||||
<grenze calc_value="$Ptarif_starter_brexit$P">1-183</grenze> //Ausfuhren 183 anstatt 158 für Export Filing
|
||||
<grenze calc_value="$Ptarif_basic_brexit$P">184-1374</grenze>
|
||||
<grenze calc_value="$Ptarif_business_brexit$P">1375-13749</grenze>
|
||||
<grenze calc_value="$Ptarif_enterprise_brexit$P">13750-</grenze>
|
||||
</anz_ausfuhren>
|
||||
</option>
|
||||
|
||||
<option id="monatspreis_anzeigen" name="monatspreis_anzeigen" type="Hidden" default="33">
|
||||
<anz_ausfuhren>
|
||||
<grenze calc_value="$Ptarif_starter_brexit$P">1-183</grenze> //Ausfuhren 183 anstatt 158 für Export Filing
|
||||
<grenze calc_value="$Ptarif_basic_brexit$P">184-1374</grenze>
|
||||
<grenze calc_value="$Ptarif_business_brexit$P">1375-13749</grenze>
|
||||
<grenze calc_value="$Ptarif_enterprise_brexit$P">13750-</grenze>
|
||||
</anz_ausfuhren>
|
||||
</option>
|
||||
|
||||
//Berechnung des Tarifmodells - Nach der Berechnung des Monatspreises. Wird über Javascript im Shop ausgeblendet!
|
||||
<option id="tarif" name="Calculated price plan" type="Select" default="1">
|
||||
<opt id="1" name="Starter">
|
||||
<monatspreis formel="$CVmonatspreis_anz_ausfuhren$CV">
|
||||
<grenze>1-33</grenze> // Anzeige Starter
|
||||
</monatspreis>
|
||||
</opt>
|
||||
<opt id="2" name="Basic">
|
||||
<monatspreis formel="$CVmonatspreis_anz_ausfuhren$CV">
|
||||
<grenze>34-92</grenze> // Anzeige Basic
|
||||
</monatspreis>
|
||||
</opt>
|
||||
<opt id="2" name="Business">
|
||||
<monatspreis formel="$CVmonatspreis_anz_ausfuhren$CV">
|
||||
<grenze>93-356</grenze> // Anzeige Business
|
||||
</monatspreis>
|
||||
</opt>
|
||||
<opt id="2" name="Enterprise">
|
||||
<monatspreis formel="$CVmonatspreis_anz_ausfuhren$CV">
|
||||
<grenze>357-</grenze> // Anzeige Enterprise
|
||||
</monatspreis>
|
||||
</opt>
|
||||
</option>
|
||||
|
||||
|
||||
<!-- Berechnung des Aufpreises der Ausfuhren -->
|
||||
|
||||
<option id="transaktionen" name="transaktionen" type="Hidden" default="1" exportAjax="1">
|
||||
<monatspreis formel="$CVmonatspreis_anz_ausfuhren$CV">
|
||||
<grenze value="33"> //Starter bis 50 Ausfuhren enthalten
|
||||
<anz_ausfuhren>
|
||||
<grenze formel="0">1-50</grenze>
|
||||
<grenze formel="($Vanz_ausfuhren$V-$Penthaltene_ausfuhren_starter_brexit$P)*$Pkosten_ausfuhren_starter_brexit$P/12">51-</grenze>
|
||||
</anz_ausfuhren>
|
||||
</grenze>
|
||||
|
||||
<grenze value="92"> //Basic bis 250 Ausfuhren enthalten
|
||||
<anz_ausfuhren>
|
||||
<grenze formel="0">1-250</grenze>
|
||||
<grenze formel="($Vanz_ausfuhren$V-$Penthaltene_ausfuhren_basic_brexit$P)*$Pkosten_ausfuhren_basic_brexit$P/12">251-</grenze>
|
||||
</anz_ausfuhren>
|
||||
</grenze>
|
||||
|
||||
<grenze value="356"> //Business bis 2.500 Ausfuhren enthalten
|
||||
<anz_ausfuhren>
|
||||
<grenze formel="0">1-2500</grenze>
|
||||
<grenze formel="($Vanz_ausfuhren$V-$Penthaltene_ausfuhren_business_brexit$P)*$Pkosten_ausfuhren_business_brexit$P/12">2501-</grenze>
|
||||
</anz_ausfuhren>
|
||||
</grenze>
|
||||
|
||||
<grenze value="1843"> //Enterprise bis 25.000 Ausfuhren enthalten
|
||||
<anz_ausfuhren>
|
||||
<grenze formel="0">1-25000</grenze>
|
||||
<grenze formel="($Vanz_ausfuhren$V-$Penthaltene_ausfuhren_enterprise_brexit$P)*$Pkosten_ausfuhren_enterprise_brexit$P/12">25001-</grenze>
|
||||
</anz_ausfuhren>
|
||||
</grenze>
|
||||
</monatspreis>
|
||||
</option>
|
||||
|
||||
<option id="transaktionen_anzeigen" name="transaktionen_anzeigen" type="Hidden" default="1">
|
||||
<monatspreis formel="$CVmonatspreis_anz_ausfuhren$CV">
|
||||
<grenze value="33"> //Starter bis 50 Ausfuhren enthalten
|
||||
<anz_ausfuhren>
|
||||
<grenze formel="0">1-50</grenze>
|
||||
<grenze formel="($Vanz_ausfuhren$V-$Penthaltene_ausfuhren_starter_brexit$P)*$Pkosten_ausfuhren_starter_brexit$P/12">51-</grenze>
|
||||
</anz_ausfuhren>
|
||||
</grenze>
|
||||
|
||||
<grenze value="92"> //Basic bis 250 Ausfuhren enthalten
|
||||
<anz_ausfuhren>
|
||||
<grenze formel="0">1-250</grenze>
|
||||
<grenze formel="($Vanz_ausfuhren$V-$Penthaltene_ausfuhren_basic_brexit$P)*$Pkosten_ausfuhren_basic_brexit$P/12">251-</grenze>
|
||||
</anz_ausfuhren>
|
||||
</grenze>
|
||||
|
||||
<grenze value="356"> //Business bis 2.500 Ausfuhren enthalten
|
||||
<anz_ausfuhren>
|
||||
<grenze formel="0">1-2500</grenze>
|
||||
<grenze formel="($Vanz_ausfuhren$V-$Penthaltene_ausfuhren_business_brexit$P)*$Pkosten_ausfuhren_business_brexit$P/12">2501-</grenze>
|
||||
</anz_ausfuhren>
|
||||
</grenze>
|
||||
|
||||
<grenze value="1843"> //Enterprise bis 25.000 Ausfuhren enthalten
|
||||
<anz_ausfuhren>
|
||||
<grenze formel="0">1-25000</grenze>
|
||||
<grenze formel="($Vanz_ausfuhren$V-$Penthaltene_ausfuhren_enterprise_brexit$P)*$Pkosten_ausfuhren_enterprise_brexit$P/12">25001-</grenze>
|
||||
</anz_ausfuhren>
|
||||
</grenze>
|
||||
</monatspreis>
|
||||
</option>
|
||||
|
||||
|
||||
<!-- Berechnung Reporting und Analytics (nicht für DE, sobald ein 2. Land dazu kommt, dann ja) -->
|
||||
<option id="kosten_reporting" name="kosten_reporting" type="Hidden" default="1" exportAjax="1">
|
||||
<monatspreis formel="$CVmonatspreis_anz_ausfuhren$CV">
|
||||
<grenze value="33"> //Bei Starter
|
||||
<reporting>
|
||||
<grenze formel="0">0,1</grenze>
|
||||
</reporting>
|
||||
</grenze>
|
||||
|
||||
<grenze value="92"> //Bei Basic
|
||||
<anzahl_laender formel="$CVanzahl_laender_ch$CV">
|
||||
<grenze value="100">
|
||||
<de> // Prüfung bei einem Land, ob DE
|
||||
<grenze value="100">
|
||||
<reporting>
|
||||
<grenze formel="0">0,1</grenze> // Wenn DE, dann 0
|
||||
</reporting>
|
||||
</grenze>
|
||||
</de>
|
||||
</grenze>
|
||||
|
||||
<grenze value="1-10,101-120"> // Wenn mehr als ein Land, dann berechnen
|
||||
<reporting>
|
||||
<grenze formel="0">0</grenze>
|
||||
<grenze formel="30">1</grenze>
|
||||
</reporting>
|
||||
</grenze>
|
||||
</anzahl_laender>
|
||||
</grenze>
|
||||
|
||||
<grenze value="356"> //Bei Business
|
||||
<anzahl_laender formel="$CVanzahl_laender_ch$CV">
|
||||
<grenze value="100">
|
||||
<de>
|
||||
<grenze value="100">
|
||||
<reporting>
|
||||
<grenze formel="0">0,1</grenze>
|
||||
</reporting>
|
||||
</grenze>
|
||||
</de>
|
||||
</grenze>
|
||||
|
||||
<grenze value="1-10,101-120">
|
||||
<reporting>
|
||||
<grenze formel="0">0</grenze>
|
||||
<grenze formel="60">1</grenze>
|
||||
</reporting>
|
||||
</grenze>
|
||||
</anzahl_laender>
|
||||
</grenze>
|
||||
|
||||
<grenze value="1843"> //Bei Enterprise
|
||||
<anzahl_laender formel="$CVanzahl_laender_ch$CV">
|
||||
<grenze value="100">
|
||||
<de>
|
||||
<grenze value="1">
|
||||
<reporting>
|
||||
<grenze formel="0">0,1</grenze>
|
||||
</reporting>
|
||||
</grenze>
|
||||
</de>
|
||||
</grenze>
|
||||
|
||||
<grenze value="1-10,101-120">
|
||||
<reporting>
|
||||
<grenze formel="0">0</grenze>
|
||||
<grenze formel="315">1</grenze>
|
||||
</reporting>
|
||||
</grenze>
|
||||
</anzahl_laender>
|
||||
</grenze>
|
||||
</monatspreis>
|
||||
</option>
|
||||
|
||||
|
||||
<option id="kosten_reporting_anzeige" name="kosten_reporting_anzeige" type="Hidden" default="1">
|
||||
<monatspreis formel="$CVmonatspreis_anz_ausfuhren$CV">
|
||||
<grenze value="33"> //Bei Starter
|
||||
<reporting>
|
||||
<grenze formel="0">0,1</grenze>
|
||||
</reporting>
|
||||
</grenze>
|
||||
|
||||
<grenze value="92"> //Bei Basic
|
||||
<anzahl_laender formel="$CVanzahl_laender_ch$CV">
|
||||
<grenze value="100">
|
||||
<de> // Prüfung bei einem Land, ob DE
|
||||
<grenze value="100">
|
||||
<reporting>
|
||||
<grenze formel="0">0,1</grenze> // Wenn DE, dann 0
|
||||
</reporting>
|
||||
</grenze>
|
||||
</de>
|
||||
</grenze>
|
||||
|
||||
<grenze value="1-10,101-120"> // Wenn mehr als ein Land, dann berechnen
|
||||
<reporting>
|
||||
<grenze formel="0">0</grenze>
|
||||
<grenze formel="30">1</grenze>
|
||||
</reporting>
|
||||
</grenze>
|
||||
</anzahl_laender>
|
||||
</grenze>
|
||||
|
||||
<grenze value="356"> //Bei Business
|
||||
<anzahl_laender formel="$CVanzahl_laender_ch$CV">
|
||||
<grenze value="100">
|
||||
<de>
|
||||
<grenze value="100">
|
||||
<reporting>
|
||||
<grenze formel="0">0,1</grenze>
|
||||
</reporting>
|
||||
</grenze>
|
||||
</de>
|
||||
</grenze>
|
||||
|
||||
<grenze value="1-10,101-120">
|
||||
<reporting>
|
||||
<grenze formel="0">0</grenze>
|
||||
<grenze formel="60">1</grenze>
|
||||
</reporting>
|
||||
</grenze>
|
||||
</anzahl_laender>
|
||||
</grenze>
|
||||
|
||||
<grenze value="1843"> //Bei Enterprise
|
||||
<anzahl_laender formel="$CVanzahl_laender_ch$CV">
|
||||
<grenze value="100">
|
||||
<de>
|
||||
<grenze value="1">
|
||||
<reporting>
|
||||
<grenze formel="0">0,1</grenze>
|
||||
</reporting>
|
||||
</grenze>
|
||||
</de>
|
||||
</grenze>
|
||||
|
||||
<grenze value="1-10,101-120">
|
||||
<reporting>
|
||||
<grenze formel="0">0</grenze>
|
||||
<grenze formel="315">1</grenze>
|
||||
</reporting>
|
||||
</grenze>
|
||||
</anzahl_laender>
|
||||
</grenze>
|
||||
</monatspreis>
|
||||
</option>
|
||||
|
||||
<!-- Berechnung SAP Schnittstelle -->
|
||||
<option id="sap_monatlich" name="sap_monatlich" type="Hidden" default="1" exportAjax="1">
|
||||
<sap_plugin>
|
||||
<grenze formel="0">0</grenze>
|
||||
<grenze formel="$Psap_export_filing_chief_monatlich$P">1,2</grenze>
|
||||
</sap_plugin>
|
||||
</option>
|
||||
|
||||
<option id="sap_monatlich_anzeige" name="sap_monatlich_anzeige" type="Hidden" default="1">
|
||||
<sap_plugin>
|
||||
<grenze formel="0">0</grenze>
|
||||
<grenze formel="$Psap_export_filing_chief_monatlich$P">1,2</grenze>
|
||||
</sap_plugin>
|
||||
</option>
|
||||
|
||||
<option id="sap_einmalig" name="sap_einmalig" type="Hidden" default="1" exportAjax="1">
|
||||
<sap_plugin>
|
||||
<grenze formel="0">0</grenze>
|
||||
<grenze formel="$Psap_export_filing_chief_ecc$P">1</grenze>
|
||||
<grenze formel="$Psap_export_filing_chief_hana$P">2</grenze>
|
||||
</sap_plugin>
|
||||
</option>
|
||||
|
||||
|
||||
<option id="setupkosten" name="setupkosten" type="Hidden" default="1" exportAjax="1">
|
||||
<monatspreis formel="$CVmonatspreis_anz_ausfuhren$CV">
|
||||
<grenze formel="$Psetup_export_starter_brexit$P">1-33</grenze>
|
||||
<grenze formel="$Psetup_export_basic_brexit$P">34-92</grenze>
|
||||
<grenze formel="$Psetup_export_business_brexit$P">93-356</grenze>
|
||||
<grenze formel="$Psetup_export_enterprise_brexit$P">357-</grenze>
|
||||
</monatspreis>
|
||||
</option>
|
||||
|
||||
<!--
|
||||
<option id="setupkosten_check" name="setupkosten_check" type="Hidden" default="1">
|
||||
<monatspreis formel="$CVmonatspreis_anz_ausfuhren$CV">
|
||||
<grenze formel="$Psetup_export_starter_brexit$P">1-33</grenze>
|
||||
<grenze formel="$Psetup_export_basic_brexit$P">34-92</grenze>
|
||||
<grenze formel="$Psetup_export_business_brexit$P">93-356</grenze>
|
||||
<grenze formel="$Psetup_export_enterprise_brexit$P">357-</grenze>
|
||||
</monatspreis>
|
||||
</option>
|
||||
|
||||
|
||||
|
||||
$setup_export_starter_brexit=0;
|
||||
$setup_export_basic_brexit=0;
|
||||
$setup_export_business_brexit=0;
|
||||
$setup_export_enterprose_brexit=600;
|
||||
-->
|
||||
|
||||
<option id="summe_aeb" name="summe_aeb" type="Hidden" default="1" exportAjax="1">
|
||||
<anzahl_laender formel="$CVanzahl_laender_ch$CV">
|
||||
<grenze formel="$CVmonatspreis_anz_ausfuhren$CV">1-</grenze>
|
||||
</anzahl_laender>
|
||||
</option>
|
||||
|
||||
<option id="summe_aeb_anzeige" name="summe_aeb_anzeige" type="Hidden" default="1">
|
||||
<anzahl_laender formel="$CVanzahl_laender_ch$CV">
|
||||
<grenze formel="$CVmonatspreis_anz_ausfuhren$CV">1-</grenze>
|
||||
</anzahl_laender>
|
||||
</option>
|
||||
|
||||
|
||||
</artikel>
|
||||
</kalkulation>
|
||||
4
tests/Customer/H/calcTemplates.xml
Normal file
4
tests/Customer/H/calcTemplates.xml
Normal file
@ -0,0 +1,4 @@
|
||||
<root>
|
||||
|
||||
|
||||
</root>
|
||||
0
tests/Customer/H/formels.txt
Normal file
0
tests/Customer/H/formels.txt
Normal file
4
tests/Customer/H/papierContainer.xml
Normal file
4
tests/Customer/H/papierContainer.xml
Normal file
@ -0,0 +1,4 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<container>
|
||||
|
||||
</container>
|
||||
77
tests/Customer/H/parameters.txt
Normal file
77
tests/Customer/H/parameters.txt
Normal file
@ -0,0 +1,77 @@
|
||||
// AEB Exportfilling
|
||||
|
||||
//Tairfe pro Monat Export
|
||||
$tarif_starter=33;
|
||||
$tarif_basic=92;
|
||||
$tarif_business=356;
|
||||
$tarif_enterprise=1843;
|
||||
|
||||
//Tairfe pro Monat Export Brexit
|
||||
$tarif_starter_brexit=33;
|
||||
$tarif_basic_brexit=92;
|
||||
$tarif_business_brexit=356;
|
||||
$tarif_enterprise_brexit=1843;
|
||||
|
||||
|
||||
//Schwellwerte für Tarifwechsel Export
|
||||
//bis jetzt nich verwendbar in Grenzen
|
||||
$schwellwert_starter=158;
|
||||
$schwellwert_basic=1374;
|
||||
$schwellwert_business=13749;
|
||||
$schwellwert_enterprise_ab=13750;
|
||||
|
||||
//enthaltene Ausfuhren Export
|
||||
$enthaltene_ausfuhren_starter=25;
|
||||
$enthaltene_ausfuhren_basic=250;
|
||||
$enthaltene_ausfuhren_business=2500;
|
||||
$enthaltene_ausfuhren_enterprise=25000;
|
||||
|
||||
//enthaltene Ausfuhren Export Brexit
|
||||
$enthaltene_ausfuhren_starter_brexit=50;
|
||||
$enthaltene_ausfuhren_basic_brexit=250;
|
||||
$enthaltene_ausfuhren_business_brexit=2500;
|
||||
$enthaltene_ausfuhren_enterprise_brexit=25000;
|
||||
|
||||
// Setup-Kosten
|
||||
$setup_exportfilling=600;
|
||||
|
||||
//SAP Setup einmalig Export filing Chief
|
||||
$sap_export_filing_chief_ecc=5700;
|
||||
$sap_export_filing_chief_hana=7600;
|
||||
|
||||
//SAP monatlich Export filing Chief
|
||||
$sap_export_filing_chief_monatlich=225;
|
||||
|
||||
// Setup-Kosten Export Brexit
|
||||
$setup_export_starter_brexit=0;
|
||||
$setup_export_basic_brexit=0;
|
||||
$setup_export_business_brexit=0;
|
||||
$setup_export_enterprise_brexit=600;
|
||||
|
||||
//Kosten zusätzliche Ausfuhren Export
|
||||
$kosten_ausfuhren_starter=3.60;
|
||||
$kosten_ausfuhren_basic=2.82;
|
||||
$kosten_ausfuhren_business=1.59;
|
||||
$kosten_ausfuhren_enterprise=0.88;
|
||||
|
||||
//Kosten zusätzliche Ausfuhren Export Brexit
|
||||
$kosten_ausfuhren_starter_brexit=3.60;
|
||||
$kosten_ausfuhren_basic_brexit=2.82;
|
||||
$kosten_ausfuhren_business_brexit=1.59;
|
||||
$kosten_ausfuhren_enterprise_brexit=0.88;
|
||||
|
||||
//AEB Importfilling
|
||||
//Tarife pro Monat Import
|
||||
$tarif_basic_import=92;
|
||||
$tarif_business_import=626;
|
||||
$tarif_enterprise_import=1843;
|
||||
|
||||
//enthaltene Ausfuhren Import
|
||||
$enthaltene_ausfuhren_basic_import=100;
|
||||
$enthaltene_ausfuhren_business_import=2500;
|
||||
$enthaltene_ausfuhren_enterprise_import=10000;
|
||||
|
||||
//Kosten zusätzliche Ausfuhren Import
|
||||
$kosten_ausfuhren_basic_import=5.34;
|
||||
$kosten_ausfuhren_business_import=3.89;
|
||||
$kosten_ausfuhren_enterprise_import=2.21;
|
||||
@ -12,4 +12,11 @@ class LoadTest extends \PHPUnit_Framework_TestCase
|
||||
$this->assertTrue($parser->loadString(file_get_contents(__DIR__ .'/../TestFiles/General/simple.xml')));
|
||||
}
|
||||
|
||||
public function testWrongEval()
|
||||
{
|
||||
$parser = new Engine();
|
||||
$parser->loadString(file_get_contents(__DIR__ .'/../TestFiles/General/simple.xml'));
|
||||
$this->assertEquals(0, $parser->getPrice());
|
||||
}
|
||||
|
||||
}
|
||||
@ -4,7 +4,11 @@
|
||||
<name>Blocks A5 25blatt geleimt</name>
|
||||
<kommentar>kein</kommentar>
|
||||
|
||||
<option id="auflage" name="Auflage" type="Input" width="3" require="true" default="1"/>
|
||||
<option id="auflage" name="Auflage" type="Input" width="3" require="true" default="1">
|
||||
<auflage>
|
||||
<grenze formel="(10*5">1-</grenze>
|
||||
</auflage>
|
||||
</option>
|
||||
|
||||
</artikel>
|
||||
</kalkulation>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user