From 63b85f213af247054dccf95a3c5213a929dcac7a Mon Sep 17 00:00:00 2001
From: OpenXE <>
Date: Wed, 24 Jan 2024 18:27:34 +0100
Subject: [PATCH] angebot deckungsbeitrag
---
phpwf/plugins/class.yui.php | 8 +
www/pages/angebot.php | 60 +-
www/pages/content/angebot_minidetail.tpl | 26 +-
.../_gen/widget.gen.angebot_position.php | 639 +++++++++---------
.../templates/_gen/angebot_position.tpl | 70 +-
www/widgets/widget.angebot_position.php | 1 +
6 files changed, 439 insertions(+), 365 deletions(-)
diff --git a/phpwf/plugins/class.yui.php b/phpwf/plugins/class.yui.php
index b6ddcbf2..244332fe 100644
--- a/phpwf/plugins/class.yui.php
+++ b/phpwf/plugins/class.yui.php
@@ -2839,6 +2839,14 @@ class YUI {
,b.waehrung, b.rabatt as rabatt,";
+
+
+ if ($this->app->erp->RechteVorhanden('angebot','einkaufspreise')) {
+ $sql .= $this->FormatPreis('einkaufspreis')." as einkaufspreis,
+ CONCAT(".$this->app->erp->FormatPreis("ROUND(deckungsbeitrag*100,2)",2).",'%') AS DB,
+ ";
+ }
+
}else{
$sql = "SELECT $sortcol, CONCAT($hersteller_ansicht if(b.beschreibung!='',
if(CHAR_LENGTH(b.bezeichnung)>" . $this->app->erp->MaxArtikelbezeichnung() . ",CONCAT(SUBSTR(CONCAT(b.bezeichnung,' *'),1," . $this->app->erp->MaxArtikelbezeichnung() . "),'...'),CONCAT(b.bezeichnung,' *')),
diff --git a/www/pages/angebot.php b/www/pages/angebot.php
index 3ead66d3..e80e0756 100644
--- a/www/pages/angebot.php
+++ b/www/pages/angebot.php
@@ -307,21 +307,52 @@ class Angebot extends GenAngebot
{
$id = $this->app->Secure->GetGET('id');
- if(!$this->app->DB->Select("SELECT deckungsbeitragcalc FROM angebot WHERE id='$id' LIMIT 1")) {
- $this->app->erp->BerechneDeckungsbeitrag($id,'angebot');
+ // Deckungsbeitrag
+ if (!$this->app->erp->RechteVorhanden('angebot','einkaufspreise')) {
+ $this->app->Tpl->Set('DBHIDDEN','hidden');
+ } else {
+ $sql = "
+ SELECT
+ umsatz_netto_gesamt,
+ artikel,
+ menge,
+ einkaufspreis
+ FROM
+ `angebot_position`
+ WHERE
+ `angebot` = ".$id."
+ ";
+
+ $positionen = $this->app->DB->SelectArr($sql);
+
+ $umsatz_gesamt = 0;
+ $kosten_gesamt = 0;
+ $db_gesamt = 0;
+ foreach ($positionen as $position) {
+ if (empty($position['einkaufspreis'])) {
+ $position['einkaufspreis'] = $this->app->erp->GetEinkaufspreis($position['artikel'],$position['menge']);
+ }
+ $kosten = ($position['einkaufspreis']*$position['menge']);
+ $db_gesamt += $position['umsatz_netto_gesamt']-$kosten;
+ $kosten_gesamt += $kosten;
+ $umsatz_gesamt += $position['umsatz_netto_gesamt'];
+ }
+
+ $this->app->Tpl->Set('NETTOGESAMT',$this->app->erp->number_format_variable($umsatz_gesamt,2));
+ $this->app->Tpl->Set('KOSTEN',$this->app->erp->number_format_variable($kosten_gesamt,2));
+ $this->app->Tpl->Set('DECKUNGSBEITRAG',$this->app->erp->number_format_variable($db_gesamt,2));
+ $this->app->Tpl->Set( 'DBPROZENT',
+ $umsatz_gesamt==0?
+ "-":
+ $this->app->erp->number_format_variable(
+ round(
+ $db_gesamt/$umsatz_gesamt*100,2
+ )
+ )."%"
+ );
}
-
- $auftragArr = $this->app->DB->SelectArr("SELECT * FROM angebot WHERE id='$id' LIMIT 1");
- $kundennummer = $this->app->DB->Select("SELECT kundennummer FROM adresse WHERE id='{$auftragArr[0]['adresse']}' LIMIT 1");
- $projekt = $this->app->DB->Select("SELECT abkuerzung FROM projekt WHERE id='{$auftragArr[0]['projekt']}' LIMIT 1");
- $kundenname = $this->app->DB->Select("SELECT name FROM adresse WHERE id='{$auftragArr[0]['adresse']}' LIMIT 1");
- $this->app->Tpl->Set('KUNDE',"".$kundennummer." ".$kundenname);
- //$this->app->Tpl->Set('KUNDE',$kundennummer." ".$kundenname);
- $this->app->Tpl->Set('DECKUNGSBEITRAG',0);
- $this->app->Tpl->Set('DBPROZENT',0);
-
if($this->app->erp->RechteVorhanden('projekt','dashboard')){
$this->app->Tpl->Set('PROJEKT', "$projekt");
}
@@ -1694,6 +1725,11 @@ class Angebot extends GenAngebot
$this->app->erp->AnsprechpartnerAlsLieferadresseButton($adresse);
$this->app->erp->AdresseAlsLieferadresseButton($adresse);
}
+
+
+ if ($schreibschutz != 1 AND $status != 'abgeschlossen') {
+ $this->app->erp->BerechneDeckungsbeitrag($id,'angebot');
+ }
if($nummer!="")
{
diff --git a/www/pages/content/angebot_minidetail.tpl b/www/pages/content/angebot_minidetail.tpl
index d35c7716..1a5e9b47 100644
--- a/www/pages/content/angebot_minidetail.tpl
+++ b/www/pages/content/angebot_minidetail.tpl
@@ -45,7 +45,25 @@
-
+
+
{|Deckungsbeitrag (netto)|}
+
+
+
+ Umsatz EUR |
+ Kosten EUR |
+ Deckungsbeitrag EUR |
+ DB % |
+
+
+ [NETTOGESAMT] |
+ [KOSTEN] |
+ [DECKUNGSBEITRAG] |
+ [DBPROZENT] |
+
+
+
+
Protokoll
@@ -59,12 +77,6 @@
[PDFARCHIV]
-
-
Deckungsbeitrag
-
-
Dieses Modul ist erst ab Version Professional verfügbar
-
-
diff --git a/www/widgets/_gen/widget.gen.angebot_position.php b/www/widgets/_gen/widget.gen.angebot_position.php
index 0cbb39e5..cc7fc2ad 100644
--- a/www/widgets/_gen/widget.gen.angebot_position.php
+++ b/www/widgets/_gen/widget.gen.angebot_position.php
@@ -1,320 +1,325 @@
-app = $app;
- $this->parsetarget = $parsetarget;
- $this->Form();
- }
-
- public function angebot_positionDelete()
- {
-
- $this->form->Execute("angebot_position","delete");
-
- $this->angebot_positionList();
- }
-
- function Edit()
- {
- $this->form->Edit();
- }
-
- function Copy()
- {
- $this->form->Copy();
- }
-
- public function Create()
- {
- $this->form->Create();
- }
-
- public function Search()
- {
- $this->app->Tpl->Set($this->parsetarget,"SUUUCHEEE");
- }
-
- public function Summary()
- {
- $this->app->Tpl->Set($this->parsetarget,"grosse Tabelle");
- }
-
- function Form()
- {
- $this->form = $this->app->FormHandler->CreateNew("angebot_position");
- $this->form->UseTable("angebot_position");
- $this->form->UseTemplate("angebot_position.tpl",$this->parsetarget);
-
- $field = new HTMLInput("nummer","text","","50","","","","","","","","0","","");
- $this->form->NewField($field);
-
- $field = new HTMLInput("bezeichnung","text","","50","","","","","","","","0","","");
- $this->form->NewField($field);
- $this->form->AddMandatory("bezeichnung","notempty","Pflichtfeld!","MSGBEZEICHNUNG");
-
- $field = new HTMLTextarea("beschreibung",8,48,"","","","","0");
- $this->form->NewField($field);
-
- $field = new HTMLInput("menge","text","","50","","","","","","","","0","","");
- $this->form->NewField($field);
- $this->form->AddMandatory("menge","notempty","Pflichtfeld!","MSGMENGE");
-
- $field = new HTMLInput("preis","text","","50","","","","","","","","0","","");
- $this->form->NewField($field);
-
- $field = new HTMLTextarea("formelmenge",2,48,"","","","","0");
- $this->form->NewField($field);
-
- $field = new HTMLTextarea("formelpreis",2,48,"","","","","0");
- $this->form->NewField($field);
-
- $field = new HTMLCheckbox("optional","","","1","0","0");
- $this->form->NewField($field);
-
- $field = new HTMLCheckbox("ohnepreis","","","1","0","0");
- $this->form->NewField($field);
-
- $field = new HTMLInput("textalternativpreis","text","","50","","","","","","","","0","","");
- $this->form->NewField($field);
-
- $field = new HTMLCheckbox("berechnen_aus_teile","","","1","0","0");
- $this->form->NewField($field);
-
- $field = new HTMLCheckbox("ausblenden_im_pdf","","","1","0","0");
- $this->form->NewField($field);
-
- $field = new HTMLInput("explodiert_parent","text","","50","","","","","","","","0","","");
- $this->form->NewField($field);
-
- $field = new HTMLInput("waehrung","text","","15","","","","","","","","0","","");
- $this->form->NewField($field);
-
- $field = new HTMLSelect("umsatzsteuer",0,"umsatzsteuer","","","0");
- $field->AddOption('{|Standard|}','');
- $field->AddOption('Ermäßigt','ermaessigt');
- $field->AddOption('Befreit','befreit');
- $this->form->NewField($field);
-
- $field = new HTMLCheckbox("anderersteuersatz","","","","0","0");
- $this->form->NewField($field);
-
- $field = new HTMLInput("steuersatz","text","","15","","","","","","","","0","","");
- $this->form->NewField($field);
-
- $field = new HTMLTextarea("steuertext",3,50,"","","","","0");
- $this->form->NewField($field);
-
- $field = new HTMLInput("grundrabatt","text","","50","","","","","","","","0","","");
- $this->form->NewField($field);
-
- $field = new HTMLInput("rabatt1","text","","5","","","","","","","","0","","");
- $this->form->NewField($field);
-
- $field = new HTMLInput("rabatt2","text","","5","","","","","","","","0","","");
- $this->form->NewField($field);
-
- $field = new HTMLInput("rabatt3","text","","5","","","","","","","","0","","");
- $this->form->NewField($field);
-
- $field = new HTMLInput("rabatt4","text","","5","","","","","","","","0","","");
- $this->form->NewField($field);
-
- $field = new HTMLInput("rabatt5","text","","5","","","","","","","","0","","");
- $this->form->NewField($field);
-
- $field = new HTMLCheckbox("keinrabatterlaubt","","","1","0","0");
- $this->form->NewField($field);
-
- $field = new HTMLInput("rabatt","text","","15","","","","","","","","0","","");
- $this->form->NewField($field);
-
- $field = new HTMLInput("einheit","text","","50","","","","","","","","0","","");
- $this->form->NewField($field);
-
- $field = new HTMLInput("vpe","text","","50","","","","","","","","0","","");
- $this->form->NewField($field);
-
- $field = new HTMLInput("lieferdatum","text","","15","","","","","","","","0","","");
- $this->form->NewField($field);
-
- $field = new HTMLCheckbox("lieferdatumkw","","","1","0","0");
- $this->form->NewField($field);
-
- $field = new HTMLInput("artikelnummerkunde","text","","50","","","","","","","","0","","");
- $this->form->NewField($field);
-
- $field = new HTMLInput("zolltarifnummer","text","","50","","","","","","","","0","","");
- $this->form->NewField($field);
-
- $field = new HTMLInput("herkunftsland","text","","50","","","","","","","","0","","");
- $this->form->NewField($field);
-
- $field = new HTMLInput("freifeld1","text","","50","","","","","","","","0","","");
- $this->form->NewField($field);
-
- $field = new HTMLInput("freifeld2","text","","50","","","","","","","","0","","");
- $this->form->NewField($field);
-
- $field = new HTMLInput("freifeld3","text","","50","","","","","","","","0","","");
- $this->form->NewField($field);
-
- $field = new HTMLInput("freifeld4","text","","50","","","","","","","","0","","");
- $this->form->NewField($field);
-
- $field = new HTMLInput("freifeld5","text","","50","","","","","","","","0","","");
- $this->form->NewField($field);
-
- $field = new HTMLInput("freifeld6","text","","50","","","","","","","","0","","");
- $this->form->NewField($field);
-
- $field = new HTMLInput("freifeld7","text","","50","","","","","","","","0","","");
- $this->form->NewField($field);
-
- $field = new HTMLInput("freifeld8","text","","50","","","","","","","","0","","");
- $this->form->NewField($field);
-
- $field = new HTMLInput("freifeld9","text","","50","","","","","","","","0","","");
- $this->form->NewField($field);
-
- $field = new HTMLInput("freifeld10","text","","50","","","","","","","","0","","");
- $this->form->NewField($field);
-
- $field = new HTMLInput("freifeld11","text","","50","","","","","","","","0","","");
- $this->form->NewField($field);
-
- $field = new HTMLInput("freifeld12","text","","50","","","","","","","","0","","");
- $this->form->NewField($field);
-
- $field = new HTMLInput("freifeld13","text","","50","","","","","","","","0","","");
- $this->form->NewField($field);
-
- $field = new HTMLInput("freifeld14","text","","50","","","","","","","","0","","");
- $this->form->NewField($field);
-
- $field = new HTMLInput("freifeld15","text","","50","","","","","","","","0","","");
- $this->form->NewField($field);
-
- $field = new HTMLInput("freifeld16","text","","50","","","","","","","","0","","");
- $this->form->NewField($field);
-
- $field = new HTMLInput("freifeld17","text","","50","","","","","","","","0","","");
- $this->form->NewField($field);
-
- $field = new HTMLInput("freifeld18","text","","50","","","","","","","","0","","");
- $this->form->NewField($field);
-
- $field = new HTMLInput("freifeld19","text","","50","","","","","","","","0","","");
- $this->form->NewField($field);
-
- $field = new HTMLInput("freifeld20","text","","50","","","","","","","","0","","");
- $this->form->NewField($field);
-
- $field = new HTMLInput("freifeld21","text","","50","","","","","","","","0","","");
- $this->form->NewField($field);
-
- $field = new HTMLInput("freifeld22","text","","50","","","","","","","","0","","");
- $this->form->NewField($field);
-
- $field = new HTMLInput("freifeld23","text","","50","","","","","","","","0","","");
- $this->form->NewField($field);
-
- $field = new HTMLInput("freifeld24","text","","50","","","","","","","","0","","");
- $this->form->NewField($field);
-
- $field = new HTMLInput("freifeld25","text","","50","","","","","","","","0","","");
- $this->form->NewField($field);
-
- $field = new HTMLInput("freifeld26","text","","50","","","","","","","","0","","");
- $this->form->NewField($field);
-
- $field = new HTMLInput("freifeld27","text","","50","","","","","","","","0","","");
- $this->form->NewField($field);
-
- $field = new HTMLInput("freifeld28","text","","50","","","","","","","","0","","");
- $this->form->NewField($field);
-
- $field = new HTMLInput("freifeld29","text","","50","","","","","","","","0","","");
- $this->form->NewField($field);
-
- $field = new HTMLInput("freifeld30","text","","50","","","","","","","","0","","");
- $this->form->NewField($field);
-
- $field = new HTMLInput("freifeld31","text","","50","","","","","","","","0","","");
- $this->form->NewField($field);
-
- $field = new HTMLInput("freifeld32","text","","50","","","","","","","","0","","");
- $this->form->NewField($field);
-
- $field = new HTMLInput("freifeld33","text","","50","","","","","","","","0","","");
- $this->form->NewField($field);
-
- $field = new HTMLInput("freifeld34","text","","50","","","","","","","","0","","");
- $this->form->NewField($field);
-
- $field = new HTMLInput("freifeld35","text","","50","","","","","","","","0","","");
- $this->form->NewField($field);
-
- $field = new HTMLInput("freifeld36","text","","50","","","","","","","","0","","");
- $this->form->NewField($field);
-
- $field = new HTMLInput("freifeld37","text","","50","","","","","","","","0","","");
- $this->form->NewField($field);
-
- $field = new HTMLInput("freifeld38","text","","50","","","","","","","","0","","");
- $this->form->NewField($field);
-
- $field = new HTMLInput("freifeld39","text","","50","","","","","","","","0","","");
- $this->form->NewField($field);
-
- $field = new HTMLInput("freifeld40","text","","50","","","","","","","","0","","");
- $this->form->NewField($field);
-
- $field = new HTMLInput("punkte","text","","50","","","","","","","","0","","");
- $this->form->NewField($field);
-
- $field = new HTMLInput("bonuspunkte","text","","50","","","","","","","","0","","");
- $this->form->NewField($field);
-
- $field = new HTMLInput("mlmdirektpraemie","text","","50","","","","","","","","0","","");
- $this->form->NewField($field);
-
-
- $field = new HTMLInput("kostenstelle","text","","15","","","","","","","","0","","");
- $this->form->NewField($field);
-
- $field = new HTMLInput("erloese","text","","15","","","","","","","","0","","");
- $this->form->NewField($field);
-
- $field = new HTMLCheckbox("erloesefestschreiben","","","1","0","0");
- $this->form->NewField($field);
-
- $field = new HTMLTextarea("bemerkung",3,40,"","","","","0");
- $this->form->NewField($field);
-
- }
-
-}
-
-?>
\ No newline at end of file
+app = $app;
+ $this->parsetarget = $parsetarget;
+ $this->Form();
+ }
+
+ public function angebot_positionDelete()
+ {
+
+ $this->form->Execute("angebot_position","delete");
+
+ $this->angebot_positionList();
+ }
+
+ function Edit()
+ {
+ $this->form->Edit();
+ }
+
+ function Copy()
+ {
+ $this->form->Copy();
+ }
+
+ public function Create()
+ {
+ $this->form->Create();
+ }
+
+ public function Search()
+ {
+ $this->app->Tpl->Set($this->parsetarget,"SUUUCHEEE");
+ }
+
+ public function Summary()
+ {
+ $this->app->Tpl->Set($this->parsetarget,"grosse Tabelle");
+ }
+
+ function Form()
+ {
+ $this->form = $this->app->FormHandler->CreateNew("angebot_position");
+ $this->form->UseTable("angebot_position");
+ $this->form->UseTemplate("angebot_position.tpl",$this->parsetarget);
+
+ $field = new HTMLInput("nummer","text","","50","","","","","","","","0","","");
+ $this->form->NewField($field);
+
+ $field = new HTMLInput("bezeichnung","text","","50","","","","","","","","0","","");
+ $this->form->NewField($field);
+ $this->form->AddMandatory("bezeichnung","notempty","Pflichtfeld!","MSGBEZEICHNUNG");
+
+ $field = new HTMLTextarea("beschreibung",8,48,"","","","","0");
+ $this->form->NewField($field);
+
+ $field = new HTMLInput("menge","text","","50","","","","","","","","0","","");
+ $this->form->NewField($field);
+ $this->form->AddMandatory("menge","notempty","Pflichtfeld!","MSGMENGE");
+
+ $field = new HTMLInput("preis","text","","50","","","","","","","","0","","");
+ $this->form->NewField($field);
+
+ $field = new HTMLTextarea("formelmenge",2,48,"","","","","0");
+ $this->form->NewField($field);
+
+ $field = new HTMLTextarea("formelpreis",2,48,"","","","","0");
+ $this->form->NewField($field);
+
+ $field = new HTMLCheckbox("optional","","","1","0","0");
+ $this->form->NewField($field);
+
+ $field = new HTMLCheckbox("ohnepreis","","","1","0","0");
+ $this->form->NewField($field);
+
+ $field = new HTMLInput("textalternativpreis","text","","50","","","","","","","","0","","");
+ $this->form->NewField($field);
+
+ $field = new HTMLCheckbox("berechnen_aus_teile","","","1","0","0");
+ $this->form->NewField($field);
+
+ $field = new HTMLCheckbox("ausblenden_im_pdf","","","1","0","0");
+ $this->form->NewField($field);
+
+ $field = new HTMLInput("explodiert_parent","text","","50","","","","","","","","0","","");
+ $this->form->NewField($field);
+
+ $field = new HTMLInput("waehrung","text","","15","","","","","","","","0","","");
+ $this->form->NewField($field);
+
+ $field = new HTMLSelect("umsatzsteuer",0,"umsatzsteuer","","","0");
+ $field->AddOption('{|Standard|}','');
+ $field->AddOption('Ermäßigt','ermaessigt');
+ $field->AddOption('Befreit','befreit');
+ $this->form->NewField($field);
+
+ $field = new HTMLCheckbox("anderersteuersatz","","","","0","0");
+ $this->form->NewField($field);
+
+ $field = new HTMLInput("steuersatz","text","","15","","","","","","","","0","","");
+ $this->form->NewField($field);
+
+ $field = new HTMLTextarea("steuertext",3,50,"","","","","0");
+ $this->form->NewField($field);
+
+ $field = new HTMLInput("grundrabatt","text","","50","","","","","","","","0","","");
+ $this->form->NewField($field);
+
+ $field = new HTMLInput("rabatt1","text","","5","","","","","","","","0","","");
+ $this->form->NewField($field);
+
+ $field = new HTMLInput("rabatt2","text","","5","","","","","","","","0","","");
+ $this->form->NewField($field);
+
+ $field = new HTMLInput("rabatt3","text","","5","","","","","","","","0","","");
+ $this->form->NewField($field);
+
+ $field = new HTMLInput("rabatt4","text","","5","","","","","","","","0","","");
+ $this->form->NewField($field);
+
+ $field = new HTMLInput("rabatt5","text","","5","","","","","","","","0","","");
+ $this->form->NewField($field);
+
+ $field = new HTMLCheckbox("keinrabatterlaubt","","","1","0","0");
+ $this->form->NewField($field);
+
+ $field = new HTMLInput("rabatt","text","","15","","","","","","","","0","","");
+ $this->form->NewField($field);
+
+ $field = new HTMLInput("einheit","text","","50","","","","","","","","0","","");
+ $this->form->NewField($field);
+
+ $field = new HTMLInput("vpe","text","","50","","","","","","","","0","","");
+ $this->form->NewField($field);
+
+ $field = new HTMLInput("lieferdatum","text","","15","","","","","","","","0","","");
+ $this->form->NewField($field);
+
+ $field = new HTMLCheckbox("lieferdatumkw","","","1","0","0");
+ $this->form->NewField($field);
+
+ $field = new HTMLInput("artikelnummerkunde","text","","50","","","","","","","","0","","");
+ $this->form->NewField($field);
+
+ $field = new HTMLInput("zolltarifnummer","text","","50","","","","","","","","0","","");
+ $this->form->NewField($field);
+
+ $field = new HTMLInput("herkunftsland","text","","50","","","","","","","","0","","");
+ $this->form->NewField($field);
+
+ $field = new HTMLInput("freifeld1","text","","50","","","","","","","","0","","");
+ $this->form->NewField($field);
+
+ $field = new HTMLInput("freifeld2","text","","50","","","","","","","","0","","");
+ $this->form->NewField($field);
+
+ $field = new HTMLInput("freifeld3","text","","50","","","","","","","","0","","");
+ $this->form->NewField($field);
+
+ $field = new HTMLInput("freifeld4","text","","50","","","","","","","","0","","");
+ $this->form->NewField($field);
+
+ $field = new HTMLInput("freifeld5","text","","50","","","","","","","","0","","");
+ $this->form->NewField($field);
+
+ $field = new HTMLInput("freifeld6","text","","50","","","","","","","","0","","");
+ $this->form->NewField($field);
+
+ $field = new HTMLInput("freifeld7","text","","50","","","","","","","","0","","");
+ $this->form->NewField($field);
+
+ $field = new HTMLInput("freifeld8","text","","50","","","","","","","","0","","");
+ $this->form->NewField($field);
+
+ $field = new HTMLInput("freifeld9","text","","50","","","","","","","","0","","");
+ $this->form->NewField($field);
+
+ $field = new HTMLInput("freifeld10","text","","50","","","","","","","","0","","");
+ $this->form->NewField($field);
+
+ $field = new HTMLInput("freifeld11","text","","50","","","","","","","","0","","");
+ $this->form->NewField($field);
+
+ $field = new HTMLInput("freifeld12","text","","50","","","","","","","","0","","");
+ $this->form->NewField($field);
+
+ $field = new HTMLInput("freifeld13","text","","50","","","","","","","","0","","");
+ $this->form->NewField($field);
+
+ $field = new HTMLInput("freifeld14","text","","50","","","","","","","","0","","");
+ $this->form->NewField($field);
+
+ $field = new HTMLInput("freifeld15","text","","50","","","","","","","","0","","");
+ $this->form->NewField($field);
+
+ $field = new HTMLInput("freifeld16","text","","50","","","","","","","","0","","");
+ $this->form->NewField($field);
+
+ $field = new HTMLInput("freifeld17","text","","50","","","","","","","","0","","");
+ $this->form->NewField($field);
+
+ $field = new HTMLInput("freifeld18","text","","50","","","","","","","","0","","");
+ $this->form->NewField($field);
+
+ $field = new HTMLInput("freifeld19","text","","50","","","","","","","","0","","");
+ $this->form->NewField($field);
+
+ $field = new HTMLInput("freifeld20","text","","50","","","","","","","","0","","");
+ $this->form->NewField($field);
+
+ $field = new HTMLInput("freifeld21","text","","50","","","","","","","","0","","");
+ $this->form->NewField($field);
+
+ $field = new HTMLInput("freifeld22","text","","50","","","","","","","","0","","");
+ $this->form->NewField($field);
+
+ $field = new HTMLInput("freifeld23","text","","50","","","","","","","","0","","");
+ $this->form->NewField($field);
+
+ $field = new HTMLInput("freifeld24","text","","50","","","","","","","","0","","");
+ $this->form->NewField($field);
+
+ $field = new HTMLInput("freifeld25","text","","50","","","","","","","","0","","");
+ $this->form->NewField($field);
+
+ $field = new HTMLInput("freifeld26","text","","50","","","","","","","","0","","");
+ $this->form->NewField($field);
+
+ $field = new HTMLInput("freifeld27","text","","50","","","","","","","","0","","");
+ $this->form->NewField($field);
+
+ $field = new HTMLInput("freifeld28","text","","50","","","","","","","","0","","");
+ $this->form->NewField($field);
+
+ $field = new HTMLInput("freifeld29","text","","50","","","","","","","","0","","");
+ $this->form->NewField($field);
+
+ $field = new HTMLInput("freifeld30","text","","50","","","","","","","","0","","");
+ $this->form->NewField($field);
+
+ $field = new HTMLInput("freifeld31","text","","50","","","","","","","","0","","");
+ $this->form->NewField($field);
+
+ $field = new HTMLInput("freifeld32","text","","50","","","","","","","","0","","");
+ $this->form->NewField($field);
+
+ $field = new HTMLInput("freifeld33","text","","50","","","","","","","","0","","");
+ $this->form->NewField($field);
+
+ $field = new HTMLInput("freifeld34","text","","50","","","","","","","","0","","");
+ $this->form->NewField($field);
+
+ $field = new HTMLInput("freifeld35","text","","50","","","","","","","","0","","");
+ $this->form->NewField($field);
+
+ $field = new HTMLInput("freifeld36","text","","50","","","","","","","","0","","");
+ $this->form->NewField($field);
+
+ $field = new HTMLInput("freifeld37","text","","50","","","","","","","","0","","");
+ $this->form->NewField($field);
+
+ $field = new HTMLInput("freifeld38","text","","50","","","","","","","","0","","");
+ $this->form->NewField($field);
+
+ $field = new HTMLInput("freifeld39","text","","50","","","","","","","","0","","");
+ $this->form->NewField($field);
+
+ $field = new HTMLInput("freifeld40","text","","50","","","","","","","","0","","");
+ $this->form->NewField($field);
+
+ $field = new HTMLInput("punkte","text","","50","","","","","","","","0","","");
+ $this->form->NewField($field);
+
+ $field = new HTMLInput("bonuspunkte","text","","50","","","","","","","","0","","");
+ $this->form->NewField($field);
+
+ $field = new HTMLInput("mlmdirektpraemie","text","","50","","","","","","","","0","","");
+ $this->form->NewField($field);
+
+
+ $field = new HTMLInput("kostenstelle","text","","15","","","","","","","","0","","");
+ $this->form->NewField($field);
+
+ $field = new HTMLInput("erloese","text","","15","","","","","","","","0","","");
+ $this->form->NewField($field);
+
+ $field = new HTMLCheckbox("erloesefestschreiben","","","1","0","0");
+ $this->form->NewField($field);
+
+ if ($this->app->erp->RechteVorhanden('angebot','einkaufspreise')) {
+ $field = new HTMLInput("einkaufspreis","text","","50","","","","","","","","0","","");
+ $this->form->NewField($field);
+ }
+
+ $field = new HTMLTextarea("bemerkung",3,40,"","","","","0");
+ $this->form->NewField($field);
+
+ }
+
+}
+
+?>
diff --git a/www/widgets/templates/_gen/angebot_position.tpl b/www/widgets/templates/_gen/angebot_position.tpl
index a08ebc4f..d62ae273 100644
--- a/www/widgets/templates/_gen/angebot_position.tpl
+++ b/www/widgets/templates/_gen/angebot_position.tpl
@@ -215,36 +215,48 @@ $('#anderersteuersatz').click(function() { if (!$(this).is(':checked')) {
-
-
-
- [ANZEIGEEINKAUFLAGER]
- {|Steuer|}
-
-
-
- [VORSTEUER]
- {|Kostenstelle|}: | [KOSTENSTELLE][MSGKOSTENSTELLE] |
- {|Erlöse|}: | [ERLOESE][MSGERLOESE] |
- {|festschreiben|}: | [ERLOESEFESTSCHREIBEN][MSGERLOESEFESTSCHREIBEN] |
- [NACHSTEUER]
-
-
+
+
+ [ANZEIGEEINKAUFLAGER]
+ {|Steuer|}
+
+
+ [VORSTEUER]
+
+ {|Kostenstelle|}: |
+ [KOSTENSTELLE][MSGKOSTENSTELLE] |
+
+
+ {|Erlöse|}: |
+ [ERLOESE][MSGERLOESE] |
+
+
+ {|festschreiben|}: |
+ [ERLOESEFESTSCHREIBEN][MSGERLOESEFESTSCHREIBEN] |
+ [NACHSTEUER]
+
+
+ {|Einkaufspreis für Deckungsbeitrag|}
+
+
+
+
+ [EINKAUFSPREIS][MSGEINKAUFSPREIS] |
+
+
+
+
+ {|Bemerkung|}
+
+
+
+
+ [BEMERKUNG][MSGBEMERKUNG] |
+
+
+
+
-
- {|Bemerkung|}
-
-
-
-
- [BEMERKUNG][MSGBEMERKUNG]
- |
-
-
-
-
-
-
|
diff --git a/www/widgets/widget.angebot_position.php b/www/widgets/widget.angebot_position.php
index 80e9e8cd..4dde1c86 100644
--- a/www/widgets/widget.angebot_position.php
+++ b/www/widgets/widget.angebot_position.php
@@ -35,6 +35,7 @@ class WidgetAngebot_position extends WidgetGenAngebot_position
$this->app->YUI->AutoComplete("kostenstelle","kostenstelle",1);
$this->app->YUI->AutoComplete("explodiert_parent","angebot_position",0,"&angebotposition=".$id."&angebot=".$this->app->DB->Select("SELECT angebot FROM angebot_position WHERE id = '$id' LIMIT 1"));
$this->form->ReplaceFunction("preis",$this,"ReplaceMengeBetrag");
+ $this->form->ReplaceFunction("einkaufspreis",$this,"ReplaceMengeBetrag");
$this->form->ReplaceFunction("steuersatz",$this,"ReplaceSteuersatz");
$this->form->ReplaceFunction("menge",$this,"ReplaceMenge");
$this->form->ReplaceFunction("grundrabatt",$this,"ReplaceDecimal");
|