zwischenstand verbindlichkeit status, forms, positions

This commit is contained in:
OpenXE 2023-12-13 18:27:08 +01:00
parent 57f0e2f627
commit 8664e16c55
8 changed files with 692 additions and 470 deletions

View File

@ -1,361 +1,361 @@
<?php <?php
/* /*
**** COPYRIGHT & LICENSE NOTICE *** DO NOT REMOVE **** **** COPYRIGHT & LICENSE NOTICE *** DO NOT REMOVE ****
* *
* Xentral (c) Xentral ERP Sorftware GmbH, Fuggerstrasse 11, D-86150 Augsburg, * Germany 2019 * Xentral (c) Xentral ERP Sorftware GmbH, Fuggerstrasse 11, D-86150 Augsburg, * Germany 2019
* *
* This file is licensed under the Embedded Projects General Public License *Version 3.1. * This file is licensed under the Embedded Projects General Public License *Version 3.1.
* *
* You should have received a copy of this license from your vendor and/or *along with this file; If not, please visit www.wawision.de/Lizenzhinweis * You should have received a copy of this license from your vendor and/or *along with this file; If not, please visit www.wawision.de/Lizenzhinweis
* to obtain the text of the corresponding license version. * to obtain the text of the corresponding license version.
* *
**** END OF COPYRIGHT & LICENSE NOTICE *** DO NOT REMOVE **** **** END OF COPYRIGHT & LICENSE NOTICE *** DO NOT REMOVE ****
*/ */
?> ?>
<?php <?php
/// represent a HTML Form structure /// represent a HTML Form structure
class HTMLForm class HTMLForm
{ {
var $action; var $action;
var $method; var $method;
var $name; var $name;
var $id; var $id;
var $FieldList; var $FieldList;
function __construct($action="",$method="post",$name="",$id="") function __construct($action="",$method="post",$name="",$id="")
{ {
$this->action=$action; $this->action=$action;
$this->name=$name; $this->name=$name;
$this->method=$method; $this->method=$method;
$this->id=$id; $this->id=$id;
} }
function Set($value) function Set($value)
{ {
} }
function Get() function Get()
{ {
} }
function GetClose() function GetClose()
{ {
} }
} }
class HTMLTextarea class HTMLTextarea
{ {
var $name; var $name;
var $rows; var $rows;
var $value; var $value;
var $cols; var $cols;
var $id=""; var $id="";
var $readonly=""; var $readonly="";
var $disabled=""; var $disabled="";
var $class; var $class;
function __construct($name,$rows,$cols,$defvalue="",$id="",$readonly="",$disabled="",$class="") function __construct($name,$rows,$cols,$defvalue="",$id="",$readonly="",$disabled="",$class="")
{ {
$this->name = $name; $this->name = $name;
$this->rows = $rows; $this->rows = $rows;
$this->cols = $cols; $this->cols = $cols;
$this->class = $class; $this->class = $class;
$this->value = $defvalue; $this->value = $defvalue;
$this->id = $id; $this->id = $id;
if($id=="") if($id=="")
$this->id = $name; $this->id = $name;
$this->readonly = $readonly; $this->readonly = $readonly;
$this->disabled = $disabled; $this->disabled = $disabled;
} }
function Get() function Get()
{ {
// TEMP ACHTUNG HIER IST MIST!!! // TEMP ACHTUNG HIER IST MIST!!!
$value = $this->value; $value = $this->value;
/* /*
if(!defined('WFHTMLTextareabr') || !WFHTMLTextareabr)$value = preg_replace('/<br\\s*?\/??>/i', "\n", $value); if(!defined('WFHTMLTextareabr') || !WFHTMLTextareabr)$value = preg_replace('/<br\\s*?\/??>/i', "\n", $value);
*/ */
// $value = str_replace("\\r\\n","\n",$value); // $value = str_replace("\\r\\n","\n",$value);
$html = "<textarea rows=\"{$this->rows}\" id=\"{$this->id}\" class=\"{$this->class}\" $html = "<textarea rows=\"{$this->rows}\" id=\"{$this->id}\" class=\"{$this->class}\"
name=\"{$this->name}\" cols=\"{$this->cols}\" name=\"{$this->name}\" cols=\"{$this->cols}\"
{$this->readonly} {$this->disabled} [COMMONREADONLYINPUT]>$value</textarea>"; {$this->readonly} {$this->disabled} [COMMONREADONLYINPUT]>$value</textarea>";
return $html; return $html;
} }
function GetClose() function GetClose()
{ {
} }
} }
/// fuer Datenfelder die mit in die Datenbank o.ae. kommen sollen, aber nicht durch den /// fuer Datenfelder die mit in die Datenbank o.ae. kommen sollen, aber nicht durch den
/// user in irgendeiner art und weise gesehen und manipuliert werden koennen /// user in irgendeiner art und weise gesehen und manipuliert werden koennen
class BlindField class BlindField
{ {
var $name; var $name;
var $value; var $value;
function __construct($name,$value) function __construct($name,$value)
{ {
$this->name = $name; $this->name = $name;
$this->value = $value; $this->value = $value;
} }
function Get(){} function Get(){}
function GetClose(){} function GetClose(){}
} }
class HTMLInput class HTMLInput
{ {
var $name; var $name;
var $type; var $type;
var $value; var $value;
var $dbvalue; var $dbvalue;
var $checkvalue; var $checkvalue;
var $onchange; var $onchange;
var $onclick; var $onclick;
var $defvalue; var $defvalue;
var $size; var $size;
var $maxlength; var $maxlength;
var $tabindex; var $tabindex;
var $id=""; var $id="";
var $readonly=""; var $readonly="";
var $disabled=""; var $disabled="";
var $placeholder=""; var $placeholder="";
var $class; var $class;
var $checked; var $checked;
function __construct($name,$type,$value,$size="",$maxlength="",$id="",$defvalue="",$checked="",$readonly="",$disabled="",$class="",$onclick="",$tabindex="",$placeholder="") function __construct($name,$type,$value,$size="",$maxlength="",$id="",$defvalue="",$checked="",$readonly="",$disabled="",$class="",$onclick="",$tabindex="",$placeholder="")
{ {
$this->name = $name; $this->name = $name;
$this->type = $type; $this->type = $type;
$this->value = $value; $this->value = $value;
$this->size = $size; $this->size = $size;
$this->maxlength = $maxlength; $this->maxlength = $maxlength;
$this->id = $id; $this->id = $id;
$this->readonly = $readonly; $this->readonly = $readonly;
$this->disabled = $disabled; $this->disabled = $disabled;
$this->class=$class; $this->class=$class;
$this->checked=$checked; $this->checked=$checked;
$this->tabindex=$tabindex; $this->tabindex=$tabindex;
$this->placeholder=$placeholder; $this->placeholder=$placeholder;
$this->defvalue=$defvalue; // if value is empty use this $this->defvalue=$defvalue; // if value is empty use this
$this->onclick=$onclick; $this->onclick=$onclick;
} }
function Get() function Get()
{ {
if($this->id=="") $this->id = $this->name; if($this->id=="") $this->id = $this->name;
switch($this->type) switch($this->type)
{ {
case "text": case "text":
$html = "<input type=\"{$this->type}\" id=\"{$this->id}\" class=\"{$this->class}\" tabindex=\"{$this->tabindex}\" $html = "<input type=\"{$this->type}\" id=\"{$this->id}\" class=\"{$this->class}\" tabindex=\"{$this->tabindex}\"
name=\"{$this->name}\" value=\"".preg_replace("/\"/","&quot;",$this->value)."\" size=\"{$this->size}\" placeholder=\"{$this->placeholder}\" name=\"{$this->name}\" value=\"".preg_replace("/\"/","&quot;",$this->value)."\" size=\"{$this->size}\" placeholder=\"{$this->placeholder}\"
maxlength=\"{$this->maxlength}\" {$this->readonly} {$this->disabled} [COMMONREADONLYINPUT]>"; maxlength=\"{$this->maxlength}\" {$this->readonly} {$this->disabled} [COMMONREADONLYINPUT]>";
break; break;
case "password": case "password":
$html = "<input type=\"{$this->type}\" id=\"{$this->id}\" class=\"{$this->class}\" tabindex=\"{$this->tabindex}\" $html = "<input type=\"{$this->type}\" id=\"{$this->id}\" class=\"{$this->class}\" tabindex=\"{$this->tabindex}\"
name=\"{$this->name}\" value=\"{$this->value}\" size=\"{$this->size}\" name=\"{$this->name}\" value=\"{$this->value}\" size=\"{$this->size}\"
maxlength=\"{$this->maxlength}\" {$this->readonly} {$this->disabled} [COMMONREADONLYINPUT]>"; maxlength=\"{$this->maxlength}\" {$this->readonly} {$this->disabled} [COMMONREADONLYINPUT]>";
break; break;
case "checkbox": case "checkbox":
$html = "<input type=\"{$this->type}\" id=\"{$this->id}\" class=\"{$this->class}\" tabindex=\"{$this->tabindex}\" $html = "<input type=\"{$this->type}\" id=\"{$this->id}\" class=\"{$this->class}\" tabindex=\"{$this->tabindex}\"
name=\"{$this->name}\" value=\"{$this->value}\" {$this->checked} onchange=\"{$this->onchange}\" onclick=\"{$this->onclick}\" name=\"{$this->name}\" value=\"{$this->value}\" {$this->checked} onchange=\"{$this->onchange}\" onclick=\"{$this->onclick}\"
{$this->readonly} {$this->disabled} [COMMONREADONLYINPUT]>"; {$this->readonly} {$this->disabled} [COMMONREADONLYINPUT]>";
break; break;
case "radio": case "radio":
if($this->value==$this->defvalue) $this->checked="checked"; if($this->value==$this->defvalue) $this->checked="checked";
$tmpname = str_replace('_'.$this->defvalue,'',$this->name); $tmpname = str_replace('_'.$this->defvalue,'',$this->name);
$html = "<input type=\"{$this->type}\" id=\"{$this->id}\" class=\"{$this->class}\" tabindex=\"{$this->tabindex}\" $html = "<input type=\"{$this->type}\" id=\"{$this->id}\" class=\"{$this->class}\" tabindex=\"{$this->tabindex}\"
name=\"{$tmpname}\" value=\"{$this->defvalue}\" {$this->checked} onchange=\"{$this->onchange}\" name=\"{$tmpname}\" value=\"{$this->defvalue}\" {$this->checked} onchange=\"{$this->onchange}\"
{$this->readonly} {$this->disabled} [COMMONREADONLYINPUT]>"; {$this->readonly} {$this->disabled} [COMMONREADONLYINPUT]>";
break; break;
case "submit": case "submit":
$html = "<input type=\"{$this->type}\" id=\"{$this->id}\" class=\"{$this->class}\" $html = "<input type=\"{$this->type}\" id=\"{$this->id}\" class=\"{$this->class}\"
name=\"{$this->name}\" value=\"{$this->value}\" name=\"{$this->name}\" value=\"{$this->value}\"
{$this->readonly} {$this->disabled}>"; {$this->readonly} {$this->disabled}>";
break; break;
case "hidden": case "hidden":
$html = "<input type=\"{$this->type}\" id=\"{$this->id}\" class=\"{$this->class}\" $html = "<input type=\"{$this->type}\" id=\"{$this->id}\" class=\"{$this->class}\"
name=\"{$this->name}\" value=\"{$this->value}\" size=\"{$this->size}\" name=\"{$this->name}\" value=\"{$this->value}\" size=\"{$this->size}\"
maxlength=\"{$this->maxlength}\" {$this->readonly} {$this->disabled}>"; maxlength=\"{$this->maxlength}\" {$this->readonly} {$this->disabled}>";
break; break;
} }
return $html; return $html;
} }
function GetClose() function GetClose()
{ {
} }
} }
class HTMLCheckbox extends HTMLInput class HTMLCheckbox extends HTMLInput
{ {
function __construct($name,$value,$defvalue,$checkvalue="",$onclick="",$tabindex="") function __construct($name,$value,$defvalue,$checkvalue="",$onclick="",$tabindex="")
{ {
if($checkvalue!="") if($checkvalue!="")
$this->checkvalue=$checkvalue; $this->checkvalue=$checkvalue;
else else
$this->checkvalue=$value; $this->checkvalue=$value;
$this->name = $name; $this->name = $name;
$this->type = "checkbox"; $this->type = "checkbox";
$this->checkradiovalue = isset($okvalue)?$okvalue:null; $this->checkradiovalue = isset($okvalue)?$okvalue:null;
$this->defvalue = $defvalue; $this->defvalue = $defvalue;
$this->value = $value; $this->value = $value;
$this->onclick= $onclick; $this->onclick= $onclick;
$this->tabindex= $tabindex; $this->tabindex= $tabindex;
$this->orgvalue = $value; $this->orgvalue = $value;
} }
function Get() function Get()
{ {
if(($this->value=="" && $this->defvalue==$this->checkvalue)) { if(($this->value=="" && $this->defvalue==$this->checkvalue)) {
} }
if($this->checkvalue==$this->value) { if($this->checkvalue==$this->value) {
$this->checked="checked"; $this->checked="checked";
} }
if($this->value=="" && $this->defvalue!=$this->checkvalue) if($this->value=="" && $this->defvalue!=$this->checkvalue)
$this->checked=""; $this->checked="";
$this->value = $this->checkvalue; $this->value = $this->checkvalue;
//$this->value=1; //$this->value=1;
return parent::Get(); return parent::Get();
} }
function GetClose() function GetClose()
{ {
} }
}; };
class HTMLSelect class HTMLSelect
{ {
var $name; var $name;
var $size; var $size;
var $id; var $id;
var $readonly; var $readonly;
var $disabled; var $disabled;
var $options; var $options;
var $onchange; var $onchange;
var $selected; var $selected;
var $tabindex; var $tabindex;
var $class; var $class;
function __construct($name,$size,$id="",$readonly=false,$disabled=false,$tabindex="") function __construct($name,$size,$id="",$readonly=false,$disabled=false,$tabindex="")
{ {
$this->name=$name; $this->name=$name;
$this->size=$size; $this->size=$size;
$this->id=$id; $this->id=$id;
$this->readonly=$readonly; $this->readonly=$readonly;
$this->disabled=$disabled; $this->disabled=$disabled;
$this->tabindex=$tabindex; $this->tabindex=$tabindex;
$this->class=""; $this->class="";
if($id=="") if($id=="")
$this->id = $name; $this->id = $name;
} }
function AddOption($option,$value) function AddOption($option,$value)
{ {
$this->options[] = array($option,$value); $this->options[] = array($option,$value);
} }
function AddOptionsDimensionalArray($values) function AddOptionsDimensionalArray($values)
{ {
foreach($values as $key=>$value) foreach($values as $key=>$value)
{ {
$this->options[] = array($value[wert],$value[schluessel]); $this->options[] = array($value[wert],$value[schluessel]);
} }
} }
function AddOptionsAsocSimpleArray($values) function AddOptionsAsocSimpleArray($values)
{ {
foreach($values as $key=>$value) foreach($values as $key=>$value)
$this->options[] = array($value,$key); $this->options[] = array($value,$key);
} }
function AddOptionsSimpleArray($values) function AddOptionsSimpleArray($values)
{ {
if(is_array($values)) if(is_array($values))
{ {
foreach($values as $key=>$value) foreach($values as $key=>$value)
{ {
if(!is_numeric($key)) if(!is_numeric($key))
$this->options[] = array($value,$key); $this->options[] = array($value,$key);
else else
$this->options[] = array($value,$value); $this->options[] = array($value,$value);
} }
} }
} }
function AddOptions($values) function AddOptions($values)
{ {
$number=0; $number=0;
if(count($values)>0) if(count($values)>0)
{ {
foreach($values as $key=>$row) foreach($values as $key=>$row)
foreach($row as $value) foreach($row as $value)
{ {
if($number==0){ if($number==0){
$option=$value; $option=$value;
$number=1; $number=1;
} }
else { else {
$this->options[] = array($option,$value); $this->options[] = array($option,$value);
$number=0; $number=0;
$option=""; $option="";
} }
} }
} }
} }
function Get() function Get()
{ {
$html = "<select name=\"{$this->name}\" size=\"{$this->size}\" tabindex=\"{$this->tabindex}\" $html = "<select name=\"{$this->name}\" size=\"{$this->size}\" tabindex=\"{$this->tabindex}\"
id=\"{$this->id}\" class=\"{$this->class}\" onchange=\"{$this->onchange}\" [COMMONREADONLYSELECT]>"; id=\"{$this->id}\" class=\"{$this->class}\" onchange=\"{$this->onchange}\" [COMMONREADONLYSELECT]>";
if($this->options && count($this->options)>0) if($this->options && count($this->options)>0)
{ {
foreach($this->options as $key=>$value) foreach($this->options as $key=>$value)
{ {
if($this->value==$value[1]) if($this->value==$value[1])
$html .="<option value=\"{$value[1]}\" selected>{$value[0]}</option>"; $html .="<option value=\"{$value[1]}\" selected>{$value[0]}</option>";
else else
$html .="<option value=\"{$value[1]}\">{$value[0]}</option>"; $html .="<option value=\"{$value[1]}\">{$value[0]}</option>";
} }
} }
$html .="</select>"; $html .="</select>";
return $html; return $html;
} }
function GetClose() function GetClose()
{ {
} }
} }

View File

@ -2855,16 +2855,60 @@ class YUI {
} }
else if ($module == "verbindlichkeit") // OpenXE else if ($module == "verbindlichkeit") // OpenXE
{ {
$sql = "SELECT $sortcol, if(b.beschreibung!='', $sql = "
if(CHAR_LENGTH(b.bezeichnung)>" . $this->app->erp->MaxArtikelbezeichnung() . ",CONCAT(SUBSTR(CONCAT(b.bezeichnung,' *'),1," . $this->app->erp->MaxArtikelbezeichnung() . "),'...'),CONCAT(b.bezeichnung,' *')), SELECT
if(CHAR_LENGTH(b.bezeichnung)>" . $this->app->erp->MaxArtikelbezeichnung() . ",CONCAT(SUBSTR(b.bezeichnung,1," . $this->app->erp->MaxArtikelbezeichnung() . "),'...'),b.bezeichnung)) $sortcol,
as Artikel, IF(
p.abkuerzung as projekt, a.nummer as nummer, b.nummer as nummer, DATE_FORMAT(lieferdatum,'%d.%m.%Y') as lieferdatum, trim(b.menge)+0 as menge, " . $this->FormatPreis($preiscell) . " as preis, CONCAT(k.sachkonto,' - ',k.beschriftung) AS sachkonto, b.id as id b.beschreibung != '',
FROM $table b IF(
LEFT JOIN artikel a ON a.id=b.artikel LEFT JOIN projekt p ON b.projekt=p.id CHAR_LENGTH(b.bezeichnung) > " . $this->app->erp->MaxArtikelbezeichnung() . ",
LEFT JOIN kontorahmen k ON k.id = b.sachkonto CONCAT(
WHERE b.$module='$id'"; SUBSTR(
CONCAT(b.bezeichnung, ' *'),
1,
" . $this->app->erp->MaxArtikelbezeichnung() . "
),
'...'
),
CONCAT(b.bezeichnung, ' *')
),
IF(
CHAR_LENGTH(b.bezeichnung) > " . $this->app->erp->MaxArtikelbezeichnung() . ",
CONCAT(
SUBSTR(
b.bezeichnung,
1,
" . $this->app->erp->MaxArtikelbezeichnung() . "
),
'...'
),
b.bezeichnung
)
) AS Artikel,
p.abkuerzung AS projekt,
a.nummer,
".$this->app->erp->FormatDate('lieferdatum')." AS lieferdatum,
TRIM(b.menge) +0 AS menge,
" . $this->FormatPreis($preiscell) . " AS preis,
" . $this->FormatPreis($preiscell."*menge") . " AS Betrag,
CONCAT(
k.sachkonto,
' - ',
k.beschriftung
) AS sachkonto,
b.id AS id
FROM
$table b
LEFT JOIN artikel a ON
a.id = b.artikel
LEFT JOIN projekt p ON
b.projekt = p.id
LEFT JOIN kontorahmen k ON
k.id = b.sachkonto
WHERE
b.$module = '$id'
";
} }
else { else {
$sql = null; $sql = null;
@ -14875,8 +14919,6 @@ source: "index.php?module=ajax&action=filter&filtername=' . $filter . $extendurl
$table->headings[4] = 'Abr. bei Kd'; $table->headings[4] = 'Abr. bei Kd';
$table->headings[5] = 'sonst. MwSt'; // kann man auch umbenennen in Keine $table->headings[5] = 'sonst. MwSt'; // kann man auch umbenennen in Keine
$table->headings[6] = 'MwSt'; $table->headings[6] = 'MwSt';
$table->headings[7] = 'Kommentar'; $table->headings[7] = 'Kommentar';
$table->headings[8] = 'Bezahlt'; $table->headings[8] = 'Bezahlt';

View File

@ -52371,6 +52371,17 @@
"Privileges": "select,insert,update,references", "Privileges": "select,insert,update,references",
"Comment": "" "Comment": ""
}, },
{
"Field": "nummer",
"Type": "int(11)",
"Collation": null,
"Null": "NO",
"Key": "PRI",
"Default": null,
"Extra": "",
"Privileges": "select,insert,update,references",
"Comment": ""
},
{ {
"Field": "bezeichnung", "Field": "bezeichnung",
"Type": "varchar(255)", "Type": "varchar(255)",
@ -52382,6 +52393,17 @@
"Privileges": "select,insert,update,references", "Privileges": "select,insert,update,references",
"Comment": "" "Comment": ""
}, },
{
"Field": "beschreibung",
"Type": "varchar(255)",
"Collation": "utf8mb3_general_ci",
"Null": "NO",
"Key": "",
"Default": null,
"Extra": "",
"Privileges": "select,insert,update,references",
"Comment": ""
},
{ {
"Field": "projekt", "Field": "projekt",
"Type": "varchar(255)", "Type": "varchar(255)",
@ -108959,6 +108981,17 @@
"Privileges": "select,insert,update,references", "Privileges": "select,insert,update,references",
"Comment": "" "Comment": ""
}, },
{
"Field": "datum",
"Type": "date",
"Collation": null,
"Null": "YES",
"Key": "",
"Default": null,
"Extra": "",
"Privileges": "select,insert,update,references",
"Comment": ""
},
{ {
"Field": "status_beleg", "Field": "status_beleg",
"Type": "varchar(64)", "Type": "varchar(64)",
@ -110685,6 +110718,39 @@
"Extra": "", "Extra": "",
"Privileges": "select,insert,update,references", "Privileges": "select,insert,update,references",
"Comment": "" "Comment": ""
},
{
"Field": "steuersatz_normal",
"Type": "decimal(5,2)",
"Collation": null,
"Null": "NO",
"Key": "",
"Default": "0",
"Extra": "",
"Privileges": "select,insert,update,references",
"Comment": ""
},
{
"Field": "steuersatz_ermaessigt",
"Type": "decimal(5,2)",
"Collation": null,
"Null": "NO",
"Key": "",
"Default": "0",
"Extra": "",
"Privileges": "select,insert,update,references",
"Comment": ""
},
{
"Field": "ust_befreit",
"Type": "int(1)",
"Collation": null,
"Null": "NO",
"Key": "",
"Default": "0",
"Extra": "",
"Privileges": "select,insert,update,references",
"Comment": ""
} }
], ],
"keys": [ "keys": [

View File

@ -35375,6 +35375,7 @@ function Firmendaten($field,$projekt="")
{ {
case 'bestellung': case 'bestellung':
case 'anfrage': case 'anfrage':
case 'verbindlichkeit':
$aufwendung = true; $aufwendung = true;
break; break;
} }

View File

@ -9,16 +9,19 @@
[FORMHANDLEREVENT] [FORMHANDLEREVENT]
<div class="row"> <div class="row">
<div class="row-height"> <div class="row-height">
<div class="col-xs-12 col-md-8 col-md-height"> <div class="col-xs-12 col-md-6 col-md-height">
<div class="inside inside-full-height"> <div class="inside inside-full-height">
<div class="row"> <div class="row">
<div class="row-height"> <div class="row-height">
<div class="col-xs-12 col-md-8 col-md-height"> <div class="col-xs-12 col-md-8 col-md-height">
<div class="inside inside-full-height"> <div class="inside inside-full-height">
<fieldset> <fieldset style="float: left;">
<legend>{|<b>Verbindlichkeit <font color="blue">[BELEGNR]</font></b> Lf-Nr. <a href="index.php?module=adresse&action=edit&id=[ADRESSE_ID]">[LIEFERANTENNUMMER]|}</a></legend> <legend>{|<b>Verbindlichkeit <font color="blue">[BELEGNR]</font></b> Lf-Nr. <a href="index.php?module=adresse&action=edit&id=[ADRESSE_ID]">[LIEFERANTENNUMMER]|}</a></legend>
[STATUSICONS] [STATUSICONS]
</fieldset> </fieldset>
<fieldset style="float: right;">
<input type="submit" name="submit" value="Speichern"/>
</fieldset>
</div> </div>
</div> </div>
</div> </div>
@ -27,14 +30,22 @@
<div class="row-height"> <div class="row-height">
<div class="col-xs-12 col-md-8 col-md-height"> <div class="col-xs-12 col-md-8 col-md-height">
<div class="inside inside-full-height"> <div class="inside inside-full-height">
<fieldset> <fieldset>
<table width="100%" border="0" class="mkTableFormular"> <table width="100%" border="0" class="mkTableFormular">
<tr>
<td>
{|Status|}:
</td>
<td>
<input type="text" value="[STATUS]" size="20" disabled>
</td>
</tr>
<tr> <tr>
<td> <td>
{|Adresse|}: {|Adresse|}:
</td> </td>
<td> <td>
<input type="text" name="adresse" id="adresse" value="[ADRESSE]" size="20"> <input type="text" name="adresse" id="adresse" value="[ADRESSE]" size="20" [SAVEDISABLED]>
</td> </td>
</tr> </tr>
<tr> <tr>
@ -42,7 +53,7 @@
{|Rechnung|}: {|Rechnung|}:
</td> </td>
<td> <td>
<input type="text" name="rechnung" id="rechnung" value="[RECHNUNG]" size="20"> <input type="text" name="rechnung" id="rechnung" value="[RECHNUNG]" size="20" [SAVEDISABLED]>
</td> </td>
</tr> </tr>
<tr> <tr>
@ -50,26 +61,82 @@
{|Rechnungsdatum|}: {|Rechnungsdatum|}:
</td> </td>
<td> <td>
<input type="text" name="rechnungsdatum" id="rechnungsdatum" value="[RECHNUNGSDATUM]" size="20"> <input type="text" name="rechnungsdatum" id="rechnungsdatum" value="[RECHNUNGSDATUM]" size="20" [SAVEDISABLED]>
</td> </td>
</tr> </tr>
<tr>
<td>
{|Eingangsdatum|}:
</td>
<td>
<input type="text" name="eingangsdatum" id="eingangsdatum" value="[EINGANGSDATUM]" size="20" [SAVEDISABLED]>
</td>
</tr>
<tr> <tr>
<td> <td>
{|Betrag|}: {|Betrag|}:
</td> </td>
<td> <td>
<input type="number" name="betrag" id="betrag" value="[BETRAG]" size="20"> <input type="number" name="betragbrutto" id="betragbrutto" value="[BETRAGBRUTTO]" size="20" [BETRAGDISABLED] [SAVEDISABLED]>
<select name="waehrung">[WAEHRUNG]</select> <select name="waehrung" [SAVEDISABLED]>[WAEHRUNG]</select>
</td> </td>
</tr> </tr>
<tr>
<td>
{|Betrag netto|}:
</td>
<td>
<input type="number" name="betragnetto" id="betragnetto" value="[BETRAGNETTO]" size="20" disabled [SAVEDISABLED]>
</td>
</tr>
<tr> <tr>
<td> <td>
{|Zahlbarbis|}: {|Zahlbarbis|}:
</td> </td>
<td> <td>
<input type="text" name="zahlbarbis" id="zahlbarbis" value="[ZAHLBARBIS]" size="20"> <input type="text" name="zahlbarbis" id="zahlbarbis" value="[ZAHLBARBIS]" size="20" [SAVEDISABLED]>
</td>
</tr>
<tr>
<td>
{|Skonto %|}:
</td>
<td>
<input type="text" name="skonto" id="skonto" value="[SKONTO]" size="20" [SAVEDISABLED]>
</td> </td>
</tr> </tr>
<tr>
<td>
{|Skontobis|}:
</td>
<td>
<input type="text" name="skontobis" id="skontobis" value="[SKONTOBIS]" size="20" [SAVEDISABLED]>
</td>
</tr>
<tr>
<td>
{|Waren-/Leistungsprüfung (Einkauf)|}:
</td>
<td>
<input type="checkbox" id="freigabe" value="1" [FREIGABECHECKED] size="20" [SAVEDISABLED] disabled>
</td>
</tr>
<tr>
<td>
{|Rechnungseingangsprüfung (Buchhaltung)|}:
</td>
<td>
<input type="checkbox" id="rechnungsfreigabe" value="1" [RECHNUNGSFREIGABECHECKED] size="20" [SAVEDISABLED] disabled>
</td>
</tr>
<tr>
<td>
{|Bezahlt|}:
</td>
<td>
<input type="checkbox" id="bezahlt" value="1" [BEZAHLTCHECKED] size="20" [SAVEDISABLED] disabled>
</td>
</tr>
<tr> <tr>
<td> <td>
{|Projekt|}: {|Projekt|}:
@ -78,38 +145,6 @@
<input type="text" name="projekt" id="projekt" value="[PROJEKT]" size="20"> <input type="text" name="projekt" id="projekt" value="[PROJEKT]" size="20">
</td> </td>
</tr> </tr>
<tr>
<td>
{|Eingangsdatum|}:
</td>
<td>
<input type="text" name="eingangsdatum" id="eingangsdatum" value="[EINGANGSDATUM]" size="20">
</td>
</tr>
<tr>
<td>
{|Zahlungsweise|}:
</td>
<td>
<input type="text" name="zahlungsweise" id="zahlungsweise" value="[ZAHLUNGSWEISE]" size="20">
</td>
</tr>
<tr>
<td>
{|Skonto|}:
</td>
<td>
<input type="text" name="skonto" id="skonto" value="[SKONTO]" size="20">
</td>
</tr>
<tr>
<td>
{|Skontobis|}:
</td>
<td>
<input type="text" name="skontobis" id="skontobis" value="[SKONTOBIS]" size="20">
</td>
</tr>
<tr> <tr>
<td> <td>
{|Kostenstelle|}: {|Kostenstelle|}:
@ -117,45 +152,13 @@
<td> <td>
<input type="text" name="kostenstelle" id="kostenstelle" value="[KOSTENSTELLE]" size="20"> <input type="text" name="kostenstelle" id="kostenstelle" value="[KOSTENSTELLE]" size="20">
</td> </td>
</tr> </tr>
<tr>
<td>
{|Sachkonto|}:
</td>
<td>
<input type="text" name="sachkonto" id="sachkonto" value="[SACHKONTO]" size="20">
</td>
</tr>
<tr>
<td>
{|Waren-/Leistungsprüfung (Einkauf)|}:
</td>
<td>
<input type="text" name="freigabe" id="freigabe" value="[FREIGABE]" size="20">
</td>
</tr>
<tr>
<td>
{|Rechnungseingangsprüfung (Buchhaltung)|}:
</td>
<td>
<input type="text" name="rechnungsfreigabe" id="rechnungsfreigabe" value="[RECHNUNGSFREIGABE]" size="20">
</td>
</tr>
<tr>
<td>
{|Bezahlt|}:
</td>
<td>
<input type="text" name="bezahlt" id="bezahlt" value="[BEZAHLT]" size="20">
</td>
</tr>
<tr> <tr>
<td> <td>
{|Internebemerkung|}: {|Internebemerkung|}:
</td> </td>
<td> <td>
<input type="text" name="internebemerkung" id="internebemerkung" value="[INTERNEBEMERKUNG]" size="20"> <textarea name="internebemerkung" id="internebemerkung" rows="6" style="width:100%;">[INTERNEBEMERKUNG]</textarea>
</td> </td>
</tr> </tr>
</table> </table>
@ -166,7 +169,7 @@
</div> </div>
</div> </div>
</div> </div>
<div class="col-xs-12 col-md-4 col-md-height"> <div class="col-xs-12 col-md-6 col-md-height">
<div class="inside inside-full-height"> <div class="inside inside-full-height">
<fieldset> <fieldset>
<legend>{|Vorschau|}</legend> <legend>{|Vorschau|}</legend>
@ -176,7 +179,6 @@
</div> </div>
</div> </div>
</div> </div>
<input type="submit" name="submit" value="Speichern" style="float:right"/>
</form> </form>
</div> </div>
<div id="tabs-2"> <div id="tabs-2">

View File

@ -1,7 +1,8 @@
<?php <?php
/* /*
* Copyright (c) 2022 OpenXE project * Copyright (c) 2023 OpenXE project
* Xentral (c) Xentral ERP Sorftware GmbH, Fuggerstrasse 11, D-86150 Augsburg, * Germany 2019
*/ */
use Xentral\Components\Database\Exception\QueryFailureException; use Xentral\Components\Database\Exception\QueryFailureException;
@ -22,6 +23,7 @@ class Verbindlichkeit {
$this->app->ActionHandler("dateien", "verbindlichkeit_dateien"); $this->app->ActionHandler("dateien", "verbindlichkeit_dateien");
$this->app->ActionHandler("inlinepdf", "verbindlichkeit_inlinepdf"); $this->app->ActionHandler("inlinepdf", "verbindlichkeit_inlinepdf");
$this->app->ActionHandler("positioneneditpopup", "verbindlichkeit_positioneneditpopup"); $this->app->ActionHandler("positioneneditpopup", "verbindlichkeit_positioneneditpopup");
$this->app->ActionHandler("freigabe", "verbindlichkeit_freigabe");
$this->app->DefaultActionHandler("list"); $this->app->DefaultActionHandler("list");
$this->app->ActionHandlerListen($app); $this->app->ActionHandlerListen($app);
@ -35,7 +37,7 @@ class Verbindlichkeit {
switch ($name) { switch ($name) {
case "verbindlichkeit_list": case "verbindlichkeit_list":
$allowed['verbindlichkeit_list'] = array('list'); $allowed['verbindlichkeit_list'] = array('list');
$heading = array('','','Belegnr','Adresse', 'Lieferant', 'RE-Nr', 'RE-Datum', 'Betrag (brutto)', 'W&auml;hrung', 'Ziel','Skontoziel','Skonto','Monitor', 'Men&uuml;'); $heading = array('','','Belegnr','Adresse', 'Lieferant', 'RE-Nr', 'RE-Datum', 'Betrag (brutto)', 'W&auml;hrung', 'Ziel','Skontoziel','Skonto','Status','Monitor', 'Men&uuml;');
$width = array('1%','1%','10%'); // Fill out manually later $width = array('1%','1%','10%'); // Fill out manually later
// columns that are aligned right (numbers etc) // columns that are aligned right (numbers etc)
@ -54,6 +56,7 @@ class Verbindlichkeit {
'v.zahlbarbis', 'v.zahlbarbis',
'v.skontobis', 'v.skontobis',
'v.skonto', 'v.skonto',
'v.status',
'v.status_beleg', 'v.status_beleg',
'v.id' 'v.id'
); );
@ -91,6 +94,7 @@ class Verbindlichkeit {
".$app->erp->FormatDate("v.zahlbarbis").", ".$app->erp->FormatDate("v.zahlbarbis").",
IF(v.skonto <> 0,".$app->erp->FormatDate("v.skontobis").",''), IF(v.skonto <> 0,".$app->erp->FormatDate("v.skontobis").",''),
IF(v.skonto <> 0,CONCAT(".$app->erp->FormatMenge('v.skonto',0).",'%'),''), IF(v.skonto <> 0,CONCAT(".$app->erp->FormatMenge('v.skonto',0).",'%'),''),
v.status,
".$app->YUI->IconsSQLVerbindlichkeit().", ".$app->YUI->IconsSQLVerbindlichkeit().",
v.id FROM verbindlichkeit v v.id FROM verbindlichkeit v
LEFT JOIN adresse a ON v.adresse = a.id LEFT JOIN adresse a ON v.adresse = a.id
@ -159,17 +163,30 @@ class Verbindlichkeit {
if (empty($id)) { if (empty($id)) {
// New item // New item
$id = 'NULL'; $id = 'NULL';
$input['status'] = 'angelegt';
} }
if ($submit != '') if ($submit != '')
{ {
// Write to database // Write to database
// Add checks here // Add checks here
$status = $this->app->DB->Select("SELECT status FROM verbindlichkeit WHERE id =".$id);
// $input['projekt'] = $this->app->erp->ReplaceProjekt(true,$input['projekt'],true); // Parameters: Target db?, value, from form? if ($status != 'angelegt' && $id != 'NULL') {
$input['adresse'] = $this->app->erp->ReplaceAdresse(true,$input['adresse'],true); // Parameters: Target db?, value, from form? $internebemerkung = $input['internebemerkung'];
unset($input);
$input['internebemerkung'] = $internebemerkung;
} else {
$input['adresse'] = $this->app->erp->ReplaceAdresse(true,$input['adresse'],true); // Parameters: Target db?, value, from form?
$input['rechnungsdatum'] = $this->app->erp->ReplaceDatum(true,$input['rechnungsdatum'],true); // Parameters: Target db?, value, from form?
$input['eingangsdatum'] = $this->app->erp->ReplaceDatum(true,$input['eingangsdatum'],true); // Parameters: Target db?, value, from form?
$input['skontobis'] = $this->app->erp->ReplaceDatum(true,$input['skontobis'],true); // Parameters: Target db?, value, from form?
$input['zahlbarbis'] = $this->app->erp->ReplaceDatum(true,$input['zahlbarbis'],true); // Parameters: Target db?, value, from form?
$input['projekt'] = $this->app->erp->ReplaceProjekt(true,$input['projekt'],true);
$input['kostenstelle'] = $this->app->erp->ReplaceKostenstelle(true,$input['kostenstelle'],true);
$input['sachkonto'] = $this->app->erp->ReplaceKontorahmen(true,$input['sachkonto'],true);
}
$columns = "id, "; $columns = "id, ";
$values = "$id, "; $values = "$id, ";
@ -196,8 +213,9 @@ class Verbindlichkeit {
$this->app->DB->Update($sql); $this->app->DB->Update($sql);
if ($id == 'NULL') { if ($id == 'NULL') {
$id = $this->app->DB->GetInsertID();
$msg = $this->app->erp->base64_url_encode("<div class=\"success\">Das Element wurde erfolgreich angelegt.</div>"); $msg = $this->app->erp->base64_url_encode("<div class=\"success\">Das Element wurde erfolgreich angelegt.</div>");
header("Location: index.php?module=verbindlichkeit&action=list&msg=$msg"); header("Location: index.php?module=verbindlichkeit&action=edit&id=$id&msg=$msg");
} else { } else {
$this->app->Tpl->Set('MESSAGE', "<div class=\"success\">Die Einstellungen wurden erfolgreich &uuml;bernommen.</div>"); $this->app->Tpl->Set('MESSAGE', "<div class=\"success\">Die Einstellungen wurden erfolgreich &uuml;bernommen.</div>");
} }
@ -216,6 +234,49 @@ class Verbindlichkeit {
$verbindlichkeit_from_db = $result[0]; $verbindlichkeit_from_db = $result[0];
} }
// Summarize positions
$sql = "SELECT * FROM verbindlichkeit_position WHERE verbindlichkeit = ".$id;
$positionen = $this->app->DB->SelectArr($sql);
if (!empty($positionen)) {
$betrag_netto = 0;
$betrag_brutto = 0;
$steuer_normal = 0;
$steuer_ermaessigt = 0;
/*
Normal: umsatzsteuer leer, steuersatz = leer
Ermäßigt: umsatzsteuer ermaessigt, steuersatz = -1
Befreit: umsatzsteuer befreit, steursatz = -1
Individuell: umsatzsteuer leer, steuersatz = wert
*/
foreach ($positionen as $position) {
$tmpsteuersatz = null;
$tmpsteuertext = null;
$erloes = null;
// function GetSteuerPosition($typ, $posid,&$tmpsteuersatz = null, &$tmpsteuertext = null, &$erloes = null)
$this->app->erp->GetSteuerPosition("verbindlichkeit",$position['id'],$tmpsteuersatz,$tmpsteuertext,$erloes);
$position['steuersatz_berechnet'] = $tmpsteuersatz;
$position['steuertext_berechnet'] = $tmpsteuertext;
$position['steuererloes_berechnet'] = $erloes;
$betrag_netto += ($position['menge']*$position['preis']);
$betrag_brutto += ($position['menge']*$position['preis'])*(1+($tmpsteuersatz/100));
}
$this->app->Tpl->Set('BETRAGNETTO', $betrag_netto);
$this->app->Tpl->Set('BETRAGBRUTTO', round($betrag_brutto,2));
$this->app->Tpl->Set('BETRAGDISABLED', 'disabled');
}
/* /*
* Add displayed items later * Add displayed items later
@ -228,6 +289,23 @@ class Verbindlichkeit {
*/ */
if ($verbindlichkeit_from_db['status'] != 'angelegt' && $id != 'NULL') {
$this->app->Tpl->Set('SAVEDISABLED','disabled');
}
$this->app->Tpl->Set('FREIGABECHECKED', $verbindlichkeit_from_db['freigabe']==1?"checked":"");
$this->app->Tpl->Set('RECHNUNGSFREIGABECHECKED', $verbindlichkeit_from_db['rechnungsfreigabe']==1?"checked":"");
$this->app->Tpl->Set('BEZAHLTCHECKED', $verbindlichkeit_from_db['bezahlt']==1?"checked":"");
$this->app->Tpl->Set('RECHNUNGSDATUM',$this->app->erp->ReplaceDatum(false,$verbindlichkeit_from_db['rechnungsdatum'],false));
$this->app->YUI->DatePicker("rechnungsdatum");
$this->app->Tpl->Set('EINGANGSDATUM',$this->app->erp->ReplaceDatum(false,$verbindlichkeit_from_db['eingangsdatum'],false));
$this->app->YUI->DatePicker("eingangsdatum");
$this->app->Tpl->Set('SKONTOBIS',$this->app->erp->ReplaceDatum(false,$verbindlichkeit_from_db['skontobis'],false));
$this->app->YUI->DatePicker("skontobis");
$this->app->Tpl->Set('ZAHLBARBIS',$this->app->erp->ReplaceDatum(false,$verbindlichkeit_from_db['zahlbarbis'],false));
$this->app->YUI->DatePicker("zahlbarbis");
$this->app->Tpl->Add('KURZUEBERSCHRIFT2', $verbindlichkeit_from_db['adresse_name']." ".$verbindlichkeit_from_db['rechnung']); $this->app->Tpl->Add('KURZUEBERSCHRIFT2', $verbindlichkeit_from_db['adresse_name']." ".$verbindlichkeit_from_db['rechnung']);
$sql = "SELECT " . $this->app->YUI->IconsSQLVerbindlichkeit() . " AS `icons` FROM verbindlichkeit v WHERE id=$id"; $sql = "SELECT " . $this->app->YUI->IconsSQLVerbindlichkeit() . " AS `icons` FROM verbindlichkeit v WHERE id=$id";
@ -235,6 +313,12 @@ class Verbindlichkeit {
$this->app->Tpl->Add('STATUSICONS', $icons[0]['icons']); $this->app->Tpl->Add('STATUSICONS', $icons[0]['icons']);
$this->app->YUI->AutoComplete("adresse", "adresse"); $this->app->YUI->AutoComplete("adresse", "adresse");
$this->app->YUI->AutoComplete("projekt", "projektname", 1);
$this->app->Tpl->Set('PROJEKT',$this->app->erp->ReplaceProjekt(false,$verbindlichkeit_from_db['projekt'],false));
$this->app->YUI->AutoComplete("kostenstelle", "kostenstelle", 1);
$this->app->Tpl->Set('KOSTENSTELLE',$this->app->erp->ReplaceKostenstelle(false,$verbindlichkeit_from_db['kostenstelle'],false));
$this->app->YUI->AutoComplete("sachkonto","sachkonto_aufwendungen",1);
$this->app->Tpl->Set('SACHKONTO',$this->app->erp->ReplaceKontorahmen(false,$verbindlichkeit_from_db['sachkonto'],false));
$waehrungenselect = $this->app->erp->GetSelect($this->app->erp->GetWaehrung(), $verbindlichkeit_from_db['waehrung']); $waehrungenselect = $this->app->erp->GetSelect($this->app->erp->GetWaehrung(), $verbindlichkeit_from_db['waehrung']);
$this->app->Tpl->Set('WAEHRUNG', $waehrungenselect); $this->app->Tpl->Set('WAEHRUNG', $waehrungenselect);
@ -243,11 +327,17 @@ class Verbindlichkeit {
$this->app->Tpl->Set('ADRESSE', $this->app->erp->ReplaceAdresse(false,$verbindlichkeit_from_db['adresse'],false)); // Convert ID to form display $this->app->Tpl->Set('ADRESSE', $this->app->erp->ReplaceAdresse(false,$verbindlichkeit_from_db['adresse'],false)); // Convert ID to form display
$file = urlencode("../../../../index.php?module=verbindlichkeit&action=inlinepdf&id=$id"); $anzahldateien = $this->app->erp->AnzahlDateien("verbindlichkeit",$id);
$iframe = "<iframe width=\"100%\" height=\"100%\" style=\"height:calc(100vh - 110px)\" src=\"./js/production/generic/web/viewer.html?file=$file\"></iframe>"; if ($anzahldateien > 0) {
$this->app->Tpl->Set('INLINEPDF', $iframe); $file = urlencode("../../../../index.php?module=verbindlichkeit&action=inlinepdf&id=$id");
$iframe = "<iframe width=\"100%\" height=\"100%\" style=\"height:calc(100vh - 110px)\" src=\"./js/production/generic/web/viewer.html?file=$file\"></iframe>";
$this->app->Tpl->Set('INLINEPDF', $iframe);
} else {
$this->app->Tpl->Set('INLINEPDF', 'Keine Dateien vorhanden.');
}
$this->app->Tpl->Parse('PAGE', "verbindlichkeit_edit.tpl"); $this->app->Tpl->Parse('PAGE', "verbindlichkeit_edit.tpl");
} }
/** /**
@ -263,12 +353,12 @@ class Verbindlichkeit {
$input['skonto'] = $this->app->Secure->GetPOST('skonto'); $input['skonto'] = $this->app->Secure->GetPOST('skonto');
$input['skontobis'] = $this->app->Secure->GetPOST('skontobis'); $input['skontobis'] = $this->app->Secure->GetPOST('skontobis');
$input['projekt'] = $this->app->Secure->GetPOST('projekt'); $input['projekt'] = $this->app->Secure->GetPOST('projekt');
$input['bezahlt'] = $this->app->Secure->GetPOST('bezahlt'); $input['bezahlt'] = $this->app->Secure->GetPOST('bezahlt')?'1':'0';;
$input['zahlungsweise'] = $this->app->Secure->GetPOST('zahlungsweise'); $input['zahlungsweise'] = $this->app->Secure->GetPOST('zahlungsweise');
$input['eingangsdatum'] = $this->app->Secure->GetPOST('eingangsdatum'); $input['eingangsdatum'] = $this->app->Secure->GetPOST('eingangsdatum');
$input['rechnungsdatum'] = $this->app->Secure->GetPOST('rechnungsdatum'); $input['rechnungsdatum'] = $this->app->Secure->GetPOST('rechnungsdatum');
$input['freigabe'] = $this->app->Secure->GetPOST('freigabe'); $input['freigabe'] = $this->app->Secure->GetPOST('freigabe')?'1':'0';
$input['rechnungsfreigabe'] = $this->app->Secure->GetPOST('rechnungsfreigabe'); $input['rechnungsfreigabe'] = $this->app->Secure->GetPOST('rechnungsfreigabe')?'1':'0';
$input['kostenstelle'] = $this->app->Secure->GetPOST('kostenstelle'); $input['kostenstelle'] = $this->app->Secure->GetPOST('kostenstelle');
$input['sachkonto'] = $this->app->Secure->GetPOST('sachkonto'); $input['sachkonto'] = $this->app->Secure->GetPOST('sachkonto');
$input['internebemerkung'] = $this->app->Secure->GetPOST('internebemerkung'); $input['internebemerkung'] = $this->app->Secure->GetPOST('internebemerkung');
@ -283,9 +373,25 @@ class Verbindlichkeit {
} else { } else {
$anzahldateien=""; $anzahldateien="";
} }
if ($id != 'NULL') {
$this->app->erp->MenuEintrag("index.php?module=verbindlichkeit&action=dateien&id=$id", "Dateien".$anzahldateien);
}
$this->app->erp->MenuEintrag("index.php?module=verbindlichkeit&action=edit&id=$id", "Details"); $this->app->erp->MenuEintrag("index.php?module=verbindlichkeit&action=edit&id=$id", "Details");
$this->app->erp->MenuEintrag("index.php?module=verbindlichkeit&action=list", "Zur&uuml;ck zur &Uuml;bersicht"); $this->app->erp->MenuEintrag("index.php?module=verbindlichkeit&action=list", "Zur&uuml;ck zur &Uuml;bersicht");
$this->app->erp->MenuEintrag("index.php?module=verbindlichkeit&action=dateien&id=$id", "Dateien".$anzahldateien);
$invoiceArr = $this->app->DB->SelectRow("SELECT v.belegnr, a.name, v.status FROM verbindlichkeit v LEFT JOIN adresse a ON v.adresse = a.id WHERE v.id='$id' LIMIT 1");
$belegnr = $invoiceArr['belegnr'];
$name = $invoiceArr['name'];
if($belegnr=='0' || $belegnr=='') {
$belegnr ='(Entwurf)';
}
$this->app->Tpl->Set('KURZUEBERSCHRIFT2',"$name Rechnung $belegnr");
$status = $invoiceArr['status'];
if ($status==='angelegt') {
$this->app->erp->MenuEintrag("index.php?module=verbindlichkeit&action=freigabe&id=$id",'Freigabe');
}
} }
function verbindlichkeit_dateien() function verbindlichkeit_dateien()
@ -402,4 +508,12 @@ class Verbindlichkeit {
$this->app->BuildNavigation=false; $this->app->BuildNavigation=false;
} }
function verbindlichkeit_freigabe()
{
$id = $this->app->Secure->GetGET('id');
$this->app->erp->BelegFreigabe('verbindlichkeit',$id);
$this->verbindlichkeit_edit();
}
} }

View File

@ -85,10 +85,7 @@ class WidgetGenverbindlichkeit_position
$this->form->NewField($field); $this->form->NewField($field);
$this->form->AddMandatory("menge","notempty","Pflichtfeld!","MSGMENGE"); $this->form->AddMandatory("menge","notempty","Pflichtfeld!","MSGMENGE");
$field = new HTMLInput("preis","text","","50","","","","","","","","0","",""); $field = new HTMLInput("preis","text","","40","","","","","","","","0","","");
$this->form->NewField($field);
$field = new HTMLInput("waehrung","text","","15","","","","","","","","0","","");
$this->form->NewField($field); $this->form->NewField($field);
$field = new HTMLSelect("umsatzsteuer",0,"umsatzsteuer","","","0"); $field = new HTMLSelect("umsatzsteuer",0,"umsatzsteuer","","","0");

View File

@ -36,8 +36,8 @@ $('#anderersteuersatz').click(function() { if (!$(this).is(':checked')) {
<tr><td nowrap>{|Artikel-Nr|}:</td><td>[NUMMER][MSGNUMMER]</td></tr> <tr><td nowrap>{|Artikel-Nr|}:</td><td>[NUMMER][MSGNUMMER]</td></tr>
<tr><td>{|Beschreibung|}:</td><td>[BESCHREIBUNG][MSGBESCHREIBUNG]</td></tr> <tr><td>{|Beschreibung|}:</td><td>[BESCHREIBUNG][MSGBESCHREIBUNG]</td></tr>
<tr><td>{|Menge|}:</td><td>[MENGE][MSGMENGE]</td></tr> <tr><td>{|Menge|}:</td><td>[MENGE][MSGMENGE]</td></tr>
<tr><td>{|Preis|}:</td><td>[PREIS][MSGPREIS]</td></tr> <tr><td>{|Preis|}:</td><td>[PREIS][MSGPREIS][WAEHRUNG]</td></tr>
<tr><td>{|W&auml;hrung|}:</td><td>[WAEHRUNG][MSGWAEHRUNG]&nbsp;[WAEHRUNGSBUTTON]</td></tr> <!-- <tr><td>{|W&auml;hrung|}:</td><td>[WAEHRUNG][MSGWAEHRUNG]&nbsp;[WAEHRUNGSBUTTON]</td></tr>-->
<tr><td>{|Steuersatz|}:</td><td>[UMSATZSTEUER][MSGUMSATZSTEUER]&nbsp; <tr><td>{|Steuersatz|}:</td><td>[UMSATZSTEUER][MSGUMSATZSTEUER]&nbsp;
[ANDERERSTEUERSATZ][MSGANDERERSTEUERSATZ]&nbsp;individuellen Steuersatz verwenden [ANDERERSTEUERSATZ][MSGANDERERSTEUERSATZ]&nbsp;individuellen Steuersatz verwenden
</td></tr> </td></tr>