mirror of
https://github.com/OpenXE-org/OpenXE.git
synced 2024-11-14 12:07:15 +01:00
zwischenstand verbindlichkeit status, forms, positions
This commit is contained in:
parent
57f0e2f627
commit
8664e16c55
@ -1,361 +1,361 @@
|
||||
<?php
|
||||
/*
|
||||
**** COPYRIGHT & LICENSE NOTICE *** DO NOT REMOVE ****
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
**** END OF 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
|
||||
*
|
||||
* 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
|
||||
* to obtain the text of the corresponding license version.
|
||||
*
|
||||
**** END OF COPYRIGHT & LICENSE NOTICE *** DO NOT REMOVE ****
|
||||
*/
|
||||
?>
|
||||
<?php
|
||||
|
||||
/// represent a HTML Form structure
|
||||
class HTMLForm
|
||||
{
|
||||
var $action;
|
||||
var $method;
|
||||
var $name;
|
||||
var $id;
|
||||
|
||||
var $FieldList;
|
||||
|
||||
function __construct($action="",$method="post",$name="",$id="")
|
||||
{
|
||||
$this->action=$action;
|
||||
$this->name=$name;
|
||||
$this->method=$method;
|
||||
$this->id=$id;
|
||||
}
|
||||
|
||||
function Set($value)
|
||||
{
|
||||
}
|
||||
|
||||
function Get()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
function GetClose()
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
class HTMLTextarea
|
||||
{
|
||||
var $name;
|
||||
var $rows;
|
||||
var $value;
|
||||
var $cols;
|
||||
var $id="";
|
||||
var $readonly="";
|
||||
var $disabled="";
|
||||
var $class;
|
||||
|
||||
function __construct($name,$rows,$cols,$defvalue="",$id="",$readonly="",$disabled="",$class="")
|
||||
{
|
||||
$this->name = $name;
|
||||
$this->rows = $rows;
|
||||
$this->cols = $cols;
|
||||
$this->class = $class;
|
||||
$this->value = $defvalue;
|
||||
$this->id = $id;
|
||||
|
||||
if($id=="")
|
||||
$this->id = $name;
|
||||
|
||||
$this->readonly = $readonly;
|
||||
$this->disabled = $disabled;
|
||||
}
|
||||
|
||||
function Get()
|
||||
{
|
||||
// TEMP ACHTUNG HIER IST MIST!!!
|
||||
$value = $this->value;
|
||||
/*
|
||||
if(!defined('WFHTMLTextareabr') || !WFHTMLTextareabr)$value = preg_replace('/<br\\s*?\/??>/i', "\n", $value);
|
||||
*/
|
||||
// $value = str_replace("\\r\\n","\n",$value);
|
||||
|
||||
$html = "<textarea rows=\"{$this->rows}\" id=\"{$this->id}\" class=\"{$this->class}\"
|
||||
name=\"{$this->name}\" cols=\"{$this->cols}\"
|
||||
{$this->readonly} {$this->disabled} [COMMONREADONLYINPUT]>$value</textarea>";
|
||||
return $html;
|
||||
}
|
||||
|
||||
function GetClose()
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/// 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
|
||||
|
||||
class BlindField
|
||||
{
|
||||
var $name;
|
||||
var $value;
|
||||
|
||||
function __construct($name,$value)
|
||||
{
|
||||
$this->name = $name;
|
||||
$this->value = $value;
|
||||
}
|
||||
function Get(){}
|
||||
function GetClose(){}
|
||||
}
|
||||
|
||||
|
||||
class HTMLInput
|
||||
{
|
||||
var $name;
|
||||
var $type;
|
||||
var $value;
|
||||
var $dbvalue;
|
||||
var $checkvalue;
|
||||
var $onchange;
|
||||
var $onclick;
|
||||
var $defvalue;
|
||||
var $size;
|
||||
var $maxlength;
|
||||
var $tabindex;
|
||||
var $id="";
|
||||
var $readonly="";
|
||||
var $disabled="";
|
||||
var $placeholder="";
|
||||
var $class;
|
||||
var $checked;
|
||||
|
||||
function __construct($name,$type,$value,$size="",$maxlength="",$id="",$defvalue="",$checked="",$readonly="",$disabled="",$class="",$onclick="",$tabindex="",$placeholder="")
|
||||
{
|
||||
$this->name = $name;
|
||||
$this->type = $type;
|
||||
$this->value = $value;
|
||||
$this->size = $size;
|
||||
$this->maxlength = $maxlength;
|
||||
$this->id = $id;
|
||||
$this->readonly = $readonly;
|
||||
$this->disabled = $disabled;
|
||||
$this->class=$class;
|
||||
$this->checked=$checked;
|
||||
$this->tabindex=$tabindex;
|
||||
$this->placeholder=$placeholder;
|
||||
$this->defvalue=$defvalue; // if value is empty use this
|
||||
$this->onclick=$onclick;
|
||||
|
||||
}
|
||||
|
||||
function Get()
|
||||
{
|
||||
if($this->id=="") $this->id = $this->name;
|
||||
|
||||
switch($this->type)
|
||||
{
|
||||
case "text":
|
||||
$html = "<input type=\"{$this->type}\" id=\"{$this->id}\" class=\"{$this->class}\" tabindex=\"{$this->tabindex}\"
|
||||
name=\"{$this->name}\" value=\"".preg_replace("/\"/",""",$this->value)."\" size=\"{$this->size}\" placeholder=\"{$this->placeholder}\"
|
||||
maxlength=\"{$this->maxlength}\" {$this->readonly} {$this->disabled} [COMMONREADONLYINPUT]>";
|
||||
break;
|
||||
case "password":
|
||||
$html = "<input type=\"{$this->type}\" id=\"{$this->id}\" class=\"{$this->class}\" tabindex=\"{$this->tabindex}\"
|
||||
name=\"{$this->name}\" value=\"{$this->value}\" size=\"{$this->size}\"
|
||||
maxlength=\"{$this->maxlength}\" {$this->readonly} {$this->disabled} [COMMONREADONLYINPUT]>";
|
||||
break;
|
||||
case "checkbox":
|
||||
$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}\"
|
||||
{$this->readonly} {$this->disabled} [COMMONREADONLYINPUT]>";
|
||||
break;
|
||||
case "radio":
|
||||
|
||||
if($this->value==$this->defvalue) $this->checked="checked";
|
||||
|
||||
$tmpname = str_replace('_'.$this->defvalue,'',$this->name);
|
||||
|
||||
$html = "<input type=\"{$this->type}\" id=\"{$this->id}\" class=\"{$this->class}\" tabindex=\"{$this->tabindex}\"
|
||||
name=\"{$tmpname}\" value=\"{$this->defvalue}\" {$this->checked} onchange=\"{$this->onchange}\"
|
||||
{$this->readonly} {$this->disabled} [COMMONREADONLYINPUT]>";
|
||||
break;
|
||||
case "submit":
|
||||
$html = "<input type=\"{$this->type}\" id=\"{$this->id}\" class=\"{$this->class}\"
|
||||
name=\"{$this->name}\" value=\"{$this->value}\"
|
||||
{$this->readonly} {$this->disabled}>";
|
||||
break;
|
||||
case "hidden":
|
||||
$html = "<input type=\"{$this->type}\" id=\"{$this->id}\" class=\"{$this->class}\"
|
||||
name=\"{$this->name}\" value=\"{$this->value}\" size=\"{$this->size}\"
|
||||
maxlength=\"{$this->maxlength}\" {$this->readonly} {$this->disabled}>";
|
||||
break;
|
||||
}
|
||||
|
||||
return $html;
|
||||
}
|
||||
|
||||
function GetClose()
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
class HTMLCheckbox extends HTMLInput
|
||||
{
|
||||
function __construct($name,$value,$defvalue,$checkvalue="",$onclick="",$tabindex="")
|
||||
{
|
||||
|
||||
if($checkvalue!="")
|
||||
$this->checkvalue=$checkvalue;
|
||||
else
|
||||
$this->checkvalue=$value;
|
||||
|
||||
$this->name = $name;
|
||||
$this->type = "checkbox";
|
||||
$this->checkradiovalue = isset($okvalue)?$okvalue:null;
|
||||
$this->defvalue = $defvalue;
|
||||
$this->value = $value;
|
||||
$this->onclick= $onclick;
|
||||
$this->tabindex= $tabindex;
|
||||
$this->orgvalue = $value;
|
||||
}
|
||||
|
||||
|
||||
function Get()
|
||||
{
|
||||
if(($this->value=="" && $this->defvalue==$this->checkvalue)) {
|
||||
}
|
||||
if($this->checkvalue==$this->value) {
|
||||
$this->checked="checked";
|
||||
}
|
||||
if($this->value=="" && $this->defvalue!=$this->checkvalue)
|
||||
$this->checked="";
|
||||
|
||||
$this->value = $this->checkvalue;
|
||||
//$this->value=1;
|
||||
return parent::Get();
|
||||
}
|
||||
|
||||
function GetClose()
|
||||
{
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
class HTMLSelect
|
||||
{
|
||||
var $name;
|
||||
var $size;
|
||||
var $id;
|
||||
var $readonly;
|
||||
var $disabled;
|
||||
|
||||
var $options;
|
||||
var $onchange;
|
||||
var $selected;
|
||||
var $tabindex;
|
||||
|
||||
var $class;
|
||||
|
||||
function __construct($name,$size,$id="",$readonly=false,$disabled=false,$tabindex="")
|
||||
{
|
||||
$this->name=$name;
|
||||
$this->size=$size;
|
||||
$this->id=$id;
|
||||
$this->readonly=$readonly;
|
||||
$this->disabled=$disabled;
|
||||
$this->tabindex=$tabindex;
|
||||
$this->class="";
|
||||
|
||||
if($id=="")
|
||||
$this->id = $name;
|
||||
}
|
||||
|
||||
function AddOption($option,$value)
|
||||
{
|
||||
$this->options[] = array($option,$value);
|
||||
}
|
||||
|
||||
function AddOptionsDimensionalArray($values)
|
||||
{
|
||||
foreach($values as $key=>$value)
|
||||
{
|
||||
$this->options[] = array($value[wert],$value[schluessel]);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function AddOptionsAsocSimpleArray($values)
|
||||
{
|
||||
foreach($values as $key=>$value)
|
||||
$this->options[] = array($value,$key);
|
||||
}
|
||||
|
||||
function AddOptionsSimpleArray($values)
|
||||
{
|
||||
if(is_array($values))
|
||||
{
|
||||
foreach($values as $key=>$value)
|
||||
{
|
||||
if(!is_numeric($key))
|
||||
$this->options[] = array($value,$key);
|
||||
else
|
||||
$this->options[] = array($value,$value);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function AddOptions($values)
|
||||
{
|
||||
$number=0;
|
||||
if(count($values)>0)
|
||||
{
|
||||
foreach($values as $key=>$row)
|
||||
foreach($row as $value)
|
||||
{
|
||||
if($number==0){
|
||||
$option=$value;
|
||||
$number=1;
|
||||
}
|
||||
else {
|
||||
$this->options[] = array($option,$value);
|
||||
$number=0;
|
||||
$option="";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function Get()
|
||||
{
|
||||
$html = "<select name=\"{$this->name}\" size=\"{$this->size}\" tabindex=\"{$this->tabindex}\"
|
||||
id=\"{$this->id}\" class=\"{$this->class}\" onchange=\"{$this->onchange}\" [COMMONREADONLYSELECT]>";
|
||||
|
||||
if($this->options && count($this->options)>0)
|
||||
{
|
||||
foreach($this->options as $key=>$value)
|
||||
{
|
||||
if($this->value==$value[1])
|
||||
$html .="<option value=\"{$value[1]}\" selected>{$value[0]}</option>";
|
||||
else
|
||||
$html .="<option value=\"{$value[1]}\">{$value[0]}</option>";
|
||||
}
|
||||
|
||||
}
|
||||
$html .="</select>";
|
||||
return $html;
|
||||
}
|
||||
|
||||
function GetClose()
|
||||
{
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
<?php
|
||||
|
||||
/// represent a HTML Form structure
|
||||
class HTMLForm
|
||||
{
|
||||
var $action;
|
||||
var $method;
|
||||
var $name;
|
||||
var $id;
|
||||
|
||||
var $FieldList;
|
||||
|
||||
function __construct($action="",$method="post",$name="",$id="")
|
||||
{
|
||||
$this->action=$action;
|
||||
$this->name=$name;
|
||||
$this->method=$method;
|
||||
$this->id=$id;
|
||||
}
|
||||
|
||||
function Set($value)
|
||||
{
|
||||
}
|
||||
|
||||
function Get()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
function GetClose()
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
class HTMLTextarea
|
||||
{
|
||||
var $name;
|
||||
var $rows;
|
||||
var $value;
|
||||
var $cols;
|
||||
var $id="";
|
||||
var $readonly="";
|
||||
var $disabled="";
|
||||
var $class;
|
||||
|
||||
function __construct($name,$rows,$cols,$defvalue="",$id="",$readonly="",$disabled="",$class="")
|
||||
{
|
||||
$this->name = $name;
|
||||
$this->rows = $rows;
|
||||
$this->cols = $cols;
|
||||
$this->class = $class;
|
||||
$this->value = $defvalue;
|
||||
$this->id = $id;
|
||||
|
||||
if($id=="")
|
||||
$this->id = $name;
|
||||
|
||||
$this->readonly = $readonly;
|
||||
$this->disabled = $disabled;
|
||||
}
|
||||
|
||||
function Get()
|
||||
{
|
||||
// TEMP ACHTUNG HIER IST MIST!!!
|
||||
$value = $this->value;
|
||||
/*
|
||||
if(!defined('WFHTMLTextareabr') || !WFHTMLTextareabr)$value = preg_replace('/<br\\s*?\/??>/i', "\n", $value);
|
||||
*/
|
||||
// $value = str_replace("\\r\\n","\n",$value);
|
||||
|
||||
$html = "<textarea rows=\"{$this->rows}\" id=\"{$this->id}\" class=\"{$this->class}\"
|
||||
name=\"{$this->name}\" cols=\"{$this->cols}\"
|
||||
{$this->readonly} {$this->disabled} [COMMONREADONLYINPUT]>$value</textarea>";
|
||||
return $html;
|
||||
}
|
||||
|
||||
function GetClose()
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/// 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
|
||||
|
||||
class BlindField
|
||||
{
|
||||
var $name;
|
||||
var $value;
|
||||
|
||||
function __construct($name,$value)
|
||||
{
|
||||
$this->name = $name;
|
||||
$this->value = $value;
|
||||
}
|
||||
function Get(){}
|
||||
function GetClose(){}
|
||||
}
|
||||
|
||||
|
||||
class HTMLInput
|
||||
{
|
||||
var $name;
|
||||
var $type;
|
||||
var $value;
|
||||
var $dbvalue;
|
||||
var $checkvalue;
|
||||
var $onchange;
|
||||
var $onclick;
|
||||
var $defvalue;
|
||||
var $size;
|
||||
var $maxlength;
|
||||
var $tabindex;
|
||||
var $id="";
|
||||
var $readonly="";
|
||||
var $disabled="";
|
||||
var $placeholder="";
|
||||
var $class;
|
||||
var $checked;
|
||||
|
||||
function __construct($name,$type,$value,$size="",$maxlength="",$id="",$defvalue="",$checked="",$readonly="",$disabled="",$class="",$onclick="",$tabindex="",$placeholder="")
|
||||
{
|
||||
$this->name = $name;
|
||||
$this->type = $type;
|
||||
$this->value = $value;
|
||||
$this->size = $size;
|
||||
$this->maxlength = $maxlength;
|
||||
$this->id = $id;
|
||||
$this->readonly = $readonly;
|
||||
$this->disabled = $disabled;
|
||||
$this->class=$class;
|
||||
$this->checked=$checked;
|
||||
$this->tabindex=$tabindex;
|
||||
$this->placeholder=$placeholder;
|
||||
$this->defvalue=$defvalue; // if value is empty use this
|
||||
$this->onclick=$onclick;
|
||||
|
||||
}
|
||||
|
||||
function Get()
|
||||
{
|
||||
if($this->id=="") $this->id = $this->name;
|
||||
|
||||
switch($this->type)
|
||||
{
|
||||
case "text":
|
||||
$html = "<input type=\"{$this->type}\" id=\"{$this->id}\" class=\"{$this->class}\" tabindex=\"{$this->tabindex}\"
|
||||
name=\"{$this->name}\" value=\"".preg_replace("/\"/",""",$this->value)."\" size=\"{$this->size}\" placeholder=\"{$this->placeholder}\"
|
||||
maxlength=\"{$this->maxlength}\" {$this->readonly} {$this->disabled} [COMMONREADONLYINPUT]>";
|
||||
break;
|
||||
case "password":
|
||||
$html = "<input type=\"{$this->type}\" id=\"{$this->id}\" class=\"{$this->class}\" tabindex=\"{$this->tabindex}\"
|
||||
name=\"{$this->name}\" value=\"{$this->value}\" size=\"{$this->size}\"
|
||||
maxlength=\"{$this->maxlength}\" {$this->readonly} {$this->disabled} [COMMONREADONLYINPUT]>";
|
||||
break;
|
||||
case "checkbox":
|
||||
$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}\"
|
||||
{$this->readonly} {$this->disabled} [COMMONREADONLYINPUT]>";
|
||||
break;
|
||||
case "radio":
|
||||
|
||||
if($this->value==$this->defvalue) $this->checked="checked";
|
||||
|
||||
$tmpname = str_replace('_'.$this->defvalue,'',$this->name);
|
||||
|
||||
$html = "<input type=\"{$this->type}\" id=\"{$this->id}\" class=\"{$this->class}\" tabindex=\"{$this->tabindex}\"
|
||||
name=\"{$tmpname}\" value=\"{$this->defvalue}\" {$this->checked} onchange=\"{$this->onchange}\"
|
||||
{$this->readonly} {$this->disabled} [COMMONREADONLYINPUT]>";
|
||||
break;
|
||||
case "submit":
|
||||
$html = "<input type=\"{$this->type}\" id=\"{$this->id}\" class=\"{$this->class}\"
|
||||
name=\"{$this->name}\" value=\"{$this->value}\"
|
||||
{$this->readonly} {$this->disabled}>";
|
||||
break;
|
||||
case "hidden":
|
||||
$html = "<input type=\"{$this->type}\" id=\"{$this->id}\" class=\"{$this->class}\"
|
||||
name=\"{$this->name}\" value=\"{$this->value}\" size=\"{$this->size}\"
|
||||
maxlength=\"{$this->maxlength}\" {$this->readonly} {$this->disabled}>";
|
||||
break;
|
||||
}
|
||||
|
||||
return $html;
|
||||
}
|
||||
|
||||
function GetClose()
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
class HTMLCheckbox extends HTMLInput
|
||||
{
|
||||
function __construct($name,$value,$defvalue,$checkvalue="",$onclick="",$tabindex="")
|
||||
{
|
||||
|
||||
if($checkvalue!="")
|
||||
$this->checkvalue=$checkvalue;
|
||||
else
|
||||
$this->checkvalue=$value;
|
||||
|
||||
$this->name = $name;
|
||||
$this->type = "checkbox";
|
||||
$this->checkradiovalue = isset($okvalue)?$okvalue:null;
|
||||
$this->defvalue = $defvalue;
|
||||
$this->value = $value;
|
||||
$this->onclick= $onclick;
|
||||
$this->tabindex= $tabindex;
|
||||
$this->orgvalue = $value;
|
||||
}
|
||||
|
||||
|
||||
function Get()
|
||||
{
|
||||
if(($this->value=="" && $this->defvalue==$this->checkvalue)) {
|
||||
}
|
||||
if($this->checkvalue==$this->value) {
|
||||
$this->checked="checked";
|
||||
}
|
||||
if($this->value=="" && $this->defvalue!=$this->checkvalue)
|
||||
$this->checked="";
|
||||
|
||||
$this->value = $this->checkvalue;
|
||||
//$this->value=1;
|
||||
return parent::Get();
|
||||
}
|
||||
|
||||
function GetClose()
|
||||
{
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
class HTMLSelect
|
||||
{
|
||||
var $name;
|
||||
var $size;
|
||||
var $id;
|
||||
var $readonly;
|
||||
var $disabled;
|
||||
|
||||
var $options;
|
||||
var $onchange;
|
||||
var $selected;
|
||||
var $tabindex;
|
||||
|
||||
var $class;
|
||||
|
||||
function __construct($name,$size,$id="",$readonly=false,$disabled=false,$tabindex="")
|
||||
{
|
||||
$this->name=$name;
|
||||
$this->size=$size;
|
||||
$this->id=$id;
|
||||
$this->readonly=$readonly;
|
||||
$this->disabled=$disabled;
|
||||
$this->tabindex=$tabindex;
|
||||
$this->class="";
|
||||
|
||||
if($id=="")
|
||||
$this->id = $name;
|
||||
}
|
||||
|
||||
function AddOption($option,$value)
|
||||
{
|
||||
$this->options[] = array($option,$value);
|
||||
}
|
||||
|
||||
function AddOptionsDimensionalArray($values)
|
||||
{
|
||||
foreach($values as $key=>$value)
|
||||
{
|
||||
$this->options[] = array($value[wert],$value[schluessel]);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function AddOptionsAsocSimpleArray($values)
|
||||
{
|
||||
foreach($values as $key=>$value)
|
||||
$this->options[] = array($value,$key);
|
||||
}
|
||||
|
||||
function AddOptionsSimpleArray($values)
|
||||
{
|
||||
if(is_array($values))
|
||||
{
|
||||
foreach($values as $key=>$value)
|
||||
{
|
||||
if(!is_numeric($key))
|
||||
$this->options[] = array($value,$key);
|
||||
else
|
||||
$this->options[] = array($value,$value);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function AddOptions($values)
|
||||
{
|
||||
$number=0;
|
||||
if(count($values)>0)
|
||||
{
|
||||
foreach($values as $key=>$row)
|
||||
foreach($row as $value)
|
||||
{
|
||||
if($number==0){
|
||||
$option=$value;
|
||||
$number=1;
|
||||
}
|
||||
else {
|
||||
$this->options[] = array($option,$value);
|
||||
$number=0;
|
||||
$option="";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function Get()
|
||||
{
|
||||
$html = "<select name=\"{$this->name}\" size=\"{$this->size}\" tabindex=\"{$this->tabindex}\"
|
||||
id=\"{$this->id}\" class=\"{$this->class}\" onchange=\"{$this->onchange}\" [COMMONREADONLYSELECT]>";
|
||||
|
||||
if($this->options && count($this->options)>0)
|
||||
{
|
||||
foreach($this->options as $key=>$value)
|
||||
{
|
||||
if($this->value==$value[1])
|
||||
$html .="<option value=\"{$value[1]}\" selected>{$value[0]}</option>";
|
||||
else
|
||||
$html .="<option value=\"{$value[1]}\">{$value[0]}</option>";
|
||||
}
|
||||
|
||||
}
|
||||
$html .="</select>";
|
||||
return $html;
|
||||
}
|
||||
|
||||
function GetClose()
|
||||
{
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
@ -2855,16 +2855,60 @@ class YUI {
|
||||
|
||||
}
|
||||
else if ($module == "verbindlichkeit") // OpenXE
|
||||
{
|
||||
$sql = "SELECT $sortcol, 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,' *')),
|
||||
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 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
|
||||
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'";
|
||||
{
|
||||
$sql = "
|
||||
SELECT
|
||||
$sortcol,
|
||||
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, ' *')
|
||||
),
|
||||
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 {
|
||||
$sql = null;
|
||||
@ -14875,8 +14919,6 @@ source: "index.php?module=ajax&action=filter&filtername=' . $filter . $extendurl
|
||||
$table->headings[4] = 'Abr. bei Kd';
|
||||
$table->headings[5] = 'sonst. MwSt'; // kann man auch umbenennen in Keine
|
||||
|
||||
|
||||
|
||||
$table->headings[6] = 'MwSt';
|
||||
$table->headings[7] = 'Kommentar';
|
||||
$table->headings[8] = 'Bezahlt';
|
||||
|
@ -52371,6 +52371,17 @@
|
||||
"Privileges": "select,insert,update,references",
|
||||
"Comment": ""
|
||||
},
|
||||
{
|
||||
"Field": "nummer",
|
||||
"Type": "int(11)",
|
||||
"Collation": null,
|
||||
"Null": "NO",
|
||||
"Key": "PRI",
|
||||
"Default": null,
|
||||
"Extra": "",
|
||||
"Privileges": "select,insert,update,references",
|
||||
"Comment": ""
|
||||
},
|
||||
{
|
||||
"Field": "bezeichnung",
|
||||
"Type": "varchar(255)",
|
||||
@ -52382,6 +52393,17 @@
|
||||
"Privileges": "select,insert,update,references",
|
||||
"Comment": ""
|
||||
},
|
||||
{
|
||||
"Field": "beschreibung",
|
||||
"Type": "varchar(255)",
|
||||
"Collation": "utf8mb3_general_ci",
|
||||
"Null": "NO",
|
||||
"Key": "",
|
||||
"Default": null,
|
||||
"Extra": "",
|
||||
"Privileges": "select,insert,update,references",
|
||||
"Comment": ""
|
||||
},
|
||||
{
|
||||
"Field": "projekt",
|
||||
"Type": "varchar(255)",
|
||||
@ -108959,6 +108981,17 @@
|
||||
"Privileges": "select,insert,update,references",
|
||||
"Comment": ""
|
||||
},
|
||||
{
|
||||
"Field": "datum",
|
||||
"Type": "date",
|
||||
"Collation": null,
|
||||
"Null": "YES",
|
||||
"Key": "",
|
||||
"Default": null,
|
||||
"Extra": "",
|
||||
"Privileges": "select,insert,update,references",
|
||||
"Comment": ""
|
||||
},
|
||||
{
|
||||
"Field": "status_beleg",
|
||||
"Type": "varchar(64)",
|
||||
@ -110685,6 +110718,39 @@
|
||||
"Extra": "",
|
||||
"Privileges": "select,insert,update,references",
|
||||
"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": [
|
||||
|
@ -35375,6 +35375,7 @@ function Firmendaten($field,$projekt="")
|
||||
{
|
||||
case 'bestellung':
|
||||
case 'anfrage':
|
||||
case 'verbindlichkeit':
|
||||
$aufwendung = true;
|
||||
break;
|
||||
}
|
||||
|
@ -9,16 +9,19 @@
|
||||
[FORMHANDLEREVENT]
|
||||
<div class="row">
|
||||
<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="row">
|
||||
<div class="row-height">
|
||||
<div class="col-xs-12 col-md-8 col-md-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>
|
||||
[STATUSICONS]
|
||||
</fieldset>
|
||||
[STATUSICONS]
|
||||
</fieldset>
|
||||
<fieldset style="float: right;">
|
||||
<input type="submit" name="submit" value="Speichern"/>
|
||||
</fieldset>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -27,14 +30,22 @@
|
||||
<div class="row-height">
|
||||
<div class="col-xs-12 col-md-8 col-md-height">
|
||||
<div class="inside inside-full-height">
|
||||
<fieldset>
|
||||
<fieldset>
|
||||
<table width="100%" border="0" class="mkTableFormular">
|
||||
<tr>
|
||||
<td>
|
||||
{|Status|}:
|
||||
</td>
|
||||
<td>
|
||||
<input type="text" value="[STATUS]" size="20" disabled>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
{|Adresse|}:
|
||||
</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>
|
||||
</tr>
|
||||
<tr>
|
||||
@ -42,7 +53,7 @@
|
||||
{|Rechnung|}:
|
||||
</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>
|
||||
</tr>
|
||||
<tr>
|
||||
@ -50,26 +61,82 @@
|
||||
{|Rechnungsdatum|}:
|
||||
</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>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
{|Eingangsdatum|}:
|
||||
</td>
|
||||
<td>
|
||||
<input type="text" name="eingangsdatum" id="eingangsdatum" value="[EINGANGSDATUM]" size="20" [SAVEDISABLED]>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
{|Betrag|}:
|
||||
</td>
|
||||
<td>
|
||||
<input type="number" name="betrag" id="betrag" value="[BETRAG]" size="20">
|
||||
<select name="waehrung">[WAEHRUNG]</select>
|
||||
<input type="number" name="betragbrutto" id="betragbrutto" value="[BETRAGBRUTTO]" size="20" [BETRAGDISABLED] [SAVEDISABLED]>
|
||||
<select name="waehrung" [SAVEDISABLED]>[WAEHRUNG]</select>
|
||||
</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>
|
||||
<td>
|
||||
{|Zahlbarbis|}:
|
||||
</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>
|
||||
</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>
|
||||
<td>
|
||||
{|Projekt|}:
|
||||
@ -78,38 +145,6 @@
|
||||
<input type="text" name="projekt" id="projekt" value="[PROJEKT]" size="20">
|
||||
</td>
|
||||
</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>
|
||||
<td>
|
||||
{|Kostenstelle|}:
|
||||
@ -117,45 +152,13 @@
|
||||
<td>
|
||||
<input type="text" name="kostenstelle" id="kostenstelle" value="[KOSTENSTELLE]" size="20">
|
||||
</td>
|
||||
</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>
|
||||
{|Internebemerkung|}:
|
||||
</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>
|
||||
</tr>
|
||||
</table>
|
||||
@ -166,7 +169,7 @@
|
||||
</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">
|
||||
<fieldset>
|
||||
<legend>{|Vorschau|}</legend>
|
||||
@ -176,7 +179,6 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<input type="submit" name="submit" value="Speichern" style="float:right"/>
|
||||
</form>
|
||||
</div>
|
||||
<div id="tabs-2">
|
||||
|
@ -1,7 +1,8 @@
|
||||
<?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;
|
||||
@ -22,6 +23,7 @@ class Verbindlichkeit {
|
||||
$this->app->ActionHandler("dateien", "verbindlichkeit_dateien");
|
||||
$this->app->ActionHandler("inlinepdf", "verbindlichkeit_inlinepdf");
|
||||
$this->app->ActionHandler("positioneneditpopup", "verbindlichkeit_positioneneditpopup");
|
||||
$this->app->ActionHandler("freigabe", "verbindlichkeit_freigabe");
|
||||
|
||||
$this->app->DefaultActionHandler("list");
|
||||
$this->app->ActionHandlerListen($app);
|
||||
@ -35,7 +37,7 @@ class Verbindlichkeit {
|
||||
switch ($name) {
|
||||
case "verbindlichkeit_list":
|
||||
$allowed['verbindlichkeit_list'] = array('list');
|
||||
$heading = array('','','Belegnr','Adresse', 'Lieferant', 'RE-Nr', 'RE-Datum', 'Betrag (brutto)', 'Währung', 'Ziel','Skontoziel','Skonto','Monitor', 'Menü');
|
||||
$heading = array('','','Belegnr','Adresse', 'Lieferant', 'RE-Nr', 'RE-Datum', 'Betrag (brutto)', 'Währung', 'Ziel','Skontoziel','Skonto','Status','Monitor', 'Menü');
|
||||
$width = array('1%','1%','10%'); // Fill out manually later
|
||||
|
||||
// columns that are aligned right (numbers etc)
|
||||
@ -54,6 +56,7 @@ class Verbindlichkeit {
|
||||
'v.zahlbarbis',
|
||||
'v.skontobis',
|
||||
'v.skonto',
|
||||
'v.status',
|
||||
'v.status_beleg',
|
||||
'v.id'
|
||||
);
|
||||
@ -91,6 +94,7 @@ class Verbindlichkeit {
|
||||
".$app->erp->FormatDate("v.zahlbarbis").",
|
||||
IF(v.skonto <> 0,".$app->erp->FormatDate("v.skontobis").",''),
|
||||
IF(v.skonto <> 0,CONCAT(".$app->erp->FormatMenge('v.skonto',0).",'%'),''),
|
||||
v.status,
|
||||
".$app->YUI->IconsSQLVerbindlichkeit().",
|
||||
v.id FROM verbindlichkeit v
|
||||
LEFT JOIN adresse a ON v.adresse = a.id
|
||||
@ -159,17 +163,30 @@ class Verbindlichkeit {
|
||||
if (empty($id)) {
|
||||
// New item
|
||||
$id = 'NULL';
|
||||
$input['status'] = 'angelegt';
|
||||
}
|
||||
|
||||
if ($submit != '')
|
||||
{
|
||||
|
||||
// Write to database
|
||||
|
||||
// Write to database
|
||||
// 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?
|
||||
$input['adresse'] = $this->app->erp->ReplaceAdresse(true,$input['adresse'],true); // Parameters: Target db?, value, from form?
|
||||
if ($status != 'angelegt' && $id != 'NULL') {
|
||||
$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, ";
|
||||
$values = "$id, ";
|
||||
@ -196,8 +213,9 @@ class Verbindlichkeit {
|
||||
$this->app->DB->Update($sql);
|
||||
|
||||
if ($id == 'NULL') {
|
||||
$id = $this->app->DB->GetInsertID();
|
||||
$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 {
|
||||
$this->app->Tpl->Set('MESSAGE', "<div class=\"success\">Die Einstellungen wurden erfolgreich übernommen.</div>");
|
||||
}
|
||||
@ -216,6 +234,49 @@ class Verbindlichkeit {
|
||||
$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
|
||||
@ -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']);
|
||||
|
||||
$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->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']);
|
||||
$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
|
||||
|
||||
$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);
|
||||
$anzahldateien = $this->app->erp->AnzahlDateien("verbindlichkeit",$id);
|
||||
if ($anzahldateien > 0) {
|
||||
$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");
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
@ -263,12 +353,12 @@ class Verbindlichkeit {
|
||||
$input['skonto'] = $this->app->Secure->GetPOST('skonto');
|
||||
$input['skontobis'] = $this->app->Secure->GetPOST('skontobis');
|
||||
$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['eingangsdatum'] = $this->app->Secure->GetPOST('eingangsdatum');
|
||||
$input['rechnungsdatum'] = $this->app->Secure->GetPOST('rechnungsdatum');
|
||||
$input['freigabe'] = $this->app->Secure->GetPOST('freigabe');
|
||||
$input['rechnungsfreigabe'] = $this->app->Secure->GetPOST('rechnungsfreigabe');
|
||||
$input['freigabe'] = $this->app->Secure->GetPOST('freigabe')?'1':'0';
|
||||
$input['rechnungsfreigabe'] = $this->app->Secure->GetPOST('rechnungsfreigabe')?'1':'0';
|
||||
$input['kostenstelle'] = $this->app->Secure->GetPOST('kostenstelle');
|
||||
$input['sachkonto'] = $this->app->Secure->GetPOST('sachkonto');
|
||||
$input['internebemerkung'] = $this->app->Secure->GetPOST('internebemerkung');
|
||||
@ -283,9 +373,25 @@ class Verbindlichkeit {
|
||||
} else {
|
||||
$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=list", "Zurück zur Ü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()
|
||||
@ -402,4 +508,12 @@ class Verbindlichkeit {
|
||||
$this->app->BuildNavigation=false;
|
||||
}
|
||||
|
||||
function verbindlichkeit_freigabe()
|
||||
{
|
||||
$id = $this->app->Secure->GetGET('id');
|
||||
$this->app->erp->BelegFreigabe('verbindlichkeit',$id);
|
||||
$this->verbindlichkeit_edit();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
@ -85,10 +85,7 @@ class WidgetGenverbindlichkeit_position
|
||||
$this->form->NewField($field);
|
||||
$this->form->AddMandatory("menge","notempty","Pflichtfeld!","MSGMENGE");
|
||||
|
||||
$field = new HTMLInput("preis","text","","50","","","","","","","","0","","");
|
||||
$this->form->NewField($field);
|
||||
|
||||
$field = new HTMLInput("waehrung","text","","15","","","","","","","","0","","");
|
||||
$field = new HTMLInput("preis","text","","40","","","","","","","","0","","");
|
||||
$this->form->NewField($field);
|
||||
|
||||
$field = new HTMLSelect("umsatzsteuer",0,"umsatzsteuer","","","0");
|
||||
|
@ -36,8 +36,8 @@ $('#anderersteuersatz').click(function() { if (!$(this).is(':checked')) {
|
||||
<tr><td nowrap>{|Artikel-Nr|}:</td><td>[NUMMER][MSGNUMMER]</td></tr>
|
||||
<tr><td>{|Beschreibung|}:</td><td>[BESCHREIBUNG][MSGBESCHREIBUNG]</td></tr>
|
||||
<tr><td>{|Menge|}:</td><td>[MENGE][MSGMENGE]</td></tr>
|
||||
<tr><td>{|Preis|}:</td><td>[PREIS][MSGPREIS]</td></tr>
|
||||
<tr><td>{|Währung|}:</td><td>[WAEHRUNG][MSGWAEHRUNG] [WAEHRUNGSBUTTON]</td></tr>
|
||||
<tr><td>{|Preis|}:</td><td>[PREIS][MSGPREIS][WAEHRUNG]</td></tr>
|
||||
<!-- <tr><td>{|Währung|}:</td><td>[WAEHRUNG][MSGWAEHRUNG] [WAEHRUNGSBUTTON]</td></tr>-->
|
||||
<tr><td>{|Steuersatz|}:</td><td>[UMSATZSTEUER][MSGUMSATZSTEUER]
|
||||
[ANDERERSTEUERSATZ][MSGANDERERSTEUERSATZ] individuellen Steuersatz verwenden
|
||||
</td></tr>
|
||||
|
Loading…
Reference in New Issue
Block a user