verbindlichkeit added positionen with sachkonto

This commit is contained in:
OpenXE 2023-12-11 22:17:28 +01:00
parent bbf8b071c0
commit 57f0e2f627
9 changed files with 524 additions and 397 deletions

View File

@ -2563,7 +2563,7 @@ class YUI {
$anzeigebrutto = true;
}
}
$sortcol = ' b.sort ';
$schreibschutz = !empty($docArr)?$docArr['schreibschutz']:$this->app->DB->Select("SELECT schreibschutz FROM $module WHERE id='$id'");
if(!$schreibschutz)$sortcol = " concat('<input type=\"checkbox\" name=\"belegsort[]\" value=\"',b.id,'\" />',b.sort) as sort ";
@ -2853,7 +2853,20 @@ class YUI {
LEFT JOIN artikel a ON a.id=b.artikel LEFT JOIN projekt p ON b.projekt=p.id
WHERE b.$module='$id'";
} else {
}
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'";
}
else {
$sql = null;
$this->app->erp->RunHook('yui_position_sql', 3, $table, $id, $sql);
if($sql === null){

View File

@ -104773,7 +104773,7 @@
},
{
"Field": "adresse",
"Type": "int",
"Type": "int(11)",
"Collation": null,
"Null": "NO",
"Key": "",
@ -111280,6 +111280,17 @@
"Extra": "",
"Privileges": "select,insert,update,references",
"Comment": ""
},
{
"Field": "sachkonto",
"Type": "int(11)",
"Collation": null,
"Null": "NO",
"Key": "",
"Default": "0",
"Extra": "",
"Privileges": "select,insert,update,references",
"Comment": ""
}
],
"keys": [

View File

@ -1,238 +1,244 @@
<?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
class ObjGenVerbindlichkeit_Position
{
private $id;
private $verbindlichkeit;
private $sort;
private $artikel;
private $projekt;
private $bestellung;
private $nummer;
private $bestellnummer;
private $waehrung;
private $einheit;
private $vpe;
private $bezeichnung;
private $umsatzsteuer;
private $status;
private $beschreibung;
private $lieferdatum;
private $steuersatz;
private $steuertext;
private $preis;
private $menge;
private $kostenstelle;
public $app; //application object
public function __construct($app)
{
$this->app = $app;
}
public function Select($id)
{
if(is_numeric($id))
$result = $this->app->DB->SelectArr("SELECT * FROM `verbindlichkeit_position` WHERE (`id` = '$id')");
else
return -1;
$result = $result[0];
$this->id=$result['id'];
$this->verbindlichkeit=$result['verbindlichkeit'];
$this->sort=$result['sort'];
$this->artikel=$result['artikel'];
$this->projekt=$result['projekt'];
$this->bestellung=$result['bestellung'];
$this->nummer=$result['nummer'];
$this->bestellnummer=$result['bestellnummer'];
$this->waehrung=$result['waehrung'];
$this->einheit=$result['einheit'];
$this->vpe=$result['vpe'];
$this->bezeichnung=$result['bezeichnung'];
$this->umsatzsteuer=$result['umsatzsteuer'];
$this->status=$result['status'];
$this->beschreibung=$result['beschreibung'];
$this->lieferdatum=$result['lieferdatum'];
$this->steuersatz=$result['steuersatz'];
$this->steuertext=$result['steuertext'];
$this->preis=$result['preis'];
$this->menge=$result['menge'];
$this->kostenstelle=$result['kostenstelle'];
}
public function Create()
{
$sql = "INSERT INTO `verbindlichkeit_position` (`id`,`verbindlichkeit`,`sort`,`artikel`,`projekt`,`bestellung`,`nummer`,`bestellnummer`,`waehrung`,`einheit`,`vpe`,`bezeichnung`,`umsatzsteuer`,`status`,`beschreibung`,`lieferdatum`,`steuersatz`,`steuertext`,`preis`,`menge`,`kostenstelle`)
VALUES(NULL,'{$this->verbindlichkeit}','{$this->sort}','{$this->artikel}','{$this->projekt}','{$this->bestellung}','{$this->nummer}','{$this->bestellnummer}','{$this->waehrung}','{$this->einheit}','{$this->vpe}','{$this->bezeichnung}','{$this->umsatzsteuer}','{$this->status}','{$this->beschreibung}','{$this->lieferdatum}','{$this->steuersatz}','{$this->steuertext}','{$this->preis}','{$this->menge}','{$this->kostenstelle}')";
$this->app->DB->Insert($sql);
$this->id = $this->app->DB->GetInsertID();
}
public function Update()
{
if(!is_numeric($this->id)) {
return -1;
}
$sql = "UPDATE `verbindlichkeit_position` SET
`verbindlichkeit`='{$this->verbindlichkeit}',
`sort`='{$this->sort}',
`artikel`='{$this->artikel}',
`projekt`='{$this->projekt}',
`bestellung`='{$this->bestellung}',
`nummer`='{$this->nummer}',
`bestellnummer`='{$this->bestellnummer}',
`waehrung`='{$this->waehrung}',
`einheit`='{$this->einheit}',
`vpe`='{$this->vpe}',
`bezeichnung`='{$this->bezeichnung}',
`umsatzsteuer`='{$this->umsatzsteuer}',
`status`='{$this->status}',
`beschreibung`='{$this->beschreibung}',
`lieferdatum`='{$this->lieferdatum}',
`steuersatz`='{$this->steuersatz}',
`steuertext`='{$this->steuertext}',
`preis`='{$this->preis}',
`menge`='{$this->menge}',
`kostenstelle`='{$this->kostenstelle}'
WHERE (`id`='{$this->id}')";
$this->app->DB->Update($sql);
}
public function Delete($id='')
{
if(is_numeric($id))
{
$this->id=$id;
}
else
return -1;
$sql = "DELETE FROM `verbindlichkeit_position` WHERE (`id`='{$this->id}')";
$this->app->DB->Delete($sql);
$this->id='';
$this->verbindlichkeit='';
$this->sort='';
$this->artikel='';
$this->projekt='';
$this->bestellung='';
$this->nummer='';
$this->bestellnummer='';
$this->waehrung='';
$this->einheit='';
$this->vpe='';
$this->bezeichnung='';
$this->umsatzsteuer='';
$this->status='';
$this->beschreibung='';
$this->lieferdatum='';
$this->steuersatz='';
$this->steuertext='';
$this->preis='';
$this->menge='';
$this->kostenstelle='';
}
public function Copy()
{
$this->id = '';
$this->Create();
}
/**
Mit dieser Funktion kann man einen Datensatz suchen
dafuer muss man die Attribute setzen nach denen gesucht werden soll
dann kriegt man als ergebnis den ersten Datensatz der auf die Suche uebereinstimmt
zurueck. Mit Next() kann man sich alle weiteren Ergebnisse abholen
**/
public function Find()
{
//TODO Suche mit den werten machen
}
public function FindNext()
{
//TODO Suche mit den alten werten fortsetzen machen
}
/** Funktionen um durch die Tabelle iterieren zu koennen */
public function Next()
{
//TODO: SQL Statement passt nach meiner Meinung nach noch nicht immer
}
public function First()
{
//TODO: SQL Statement passt nach meiner Meinung nach noch nicht immer
}
/** dank dieser funktionen kann man die tatsaechlichen werte einfach
ueberladen (in einem Objekt das mit seiner klasse ueber dieser steht)**/
public function SetId($value) { $this->id=$value; }
public function GetId() { return $this->id; }
public function SetVerbindlichkeit($value) { $this->verbindlichkeit=$value; }
public function GetVerbindlichkeit() { return $this->verbindlichkeit; }
public function SetSort($value) { $this->sort=$value; }
public function GetSort() { return $this->sort; }
public function SetArtikel($value) { $this->artikel=$value; }
public function GetArtikel() { return $this->artikel; }
public function SetProjekt($value) { $this->projekt=$value; }
public function GetProjekt() { return $this->projekt; }
public function SetBestellung($value) { $this->bestellung=$value; }
public function GetBestellung() { return $this->bestellung; }
public function SetNummer($value) { $this->nummer=$value; }
public function GetNummer() { return $this->nummer; }
public function SetBestellnummer($value) { $this->bestellnummer=$value; }
public function GetBestellnummer() { return $this->bestellnummer; }
public function SetWaehrung($value) { $this->waehrung=$value; }
public function GetWaehrung() { return $this->waehrung; }
public function SetEinheit($value) { $this->einheit=$value; }
public function GetEinheit() { return $this->einheit; }
public function SetVpe($value) { $this->vpe=$value; }
public function GetVpe() { return $this->vpe; }
public function SetBezeichnung($value) { $this->bezeichnung=$value; }
public function GetBezeichnung() { return $this->bezeichnung; }
public function SetUmsatzsteuer($value) { $this->umsatzsteuer=$value; }
public function GetUmsatzsteuer() { return $this->umsatzsteuer; }
public function SetStatus($value) { $this->status=$value; }
public function GetStatus() { return $this->status; }
public function SetBeschreibung($value) { $this->beschreibung=$value; }
public function GetBeschreibung() { return $this->beschreibung; }
public function SetLieferdatum($value) { $this->lieferdatum=$value; }
public function GetLieferdatum() { return $this->lieferdatum; }
public function SetSteuersatz($value) { $this->steuersatz=$value; }
public function GetSteuersatz() { return $this->steuersatz; }
public function SetSteuertext($value) { $this->steuertext=$value; }
public function GetSteuertext() { return $this->steuertext; }
public function SetPreis($value) { $this->preis=$value; }
public function GetPreis() { return $this->preis; }
public function SetMenge($value) { $this->menge=$value; }
public function GetMenge() { return $this->menge; }
public function SetKostenstelle($value) { $this->kostenstelle=$value; }
public function GetKostenstelle() { return $this->kostenstelle; }
}
<?php
class ObjGenVerbindlichkeit_Position
{
private $id;
private $verbindlichkeit;
private $sort;
private $artikel;
private $projekt;
private $bestellung;
private $nummer;
private $bestellnummer;
private $waehrung;
private $einheit;
private $vpe;
private $bezeichnung;
private $umsatzsteuer;
private $status;
private $beschreibung;
private $lieferdatum;
private $steuersatz;
private $steuertext;
private $preis;
private $menge;
private $kostenstelle;
private $sachkonto;
public $app; //application object
public function __construct($app)
{
$this->app = $app;
}
public function Select($id)
{
if(is_numeric($id))
$result = $this->app->DB->SelectArr("SELECT * FROM `verbindlichkeit_position` WHERE (`id` = '$id')");
else
return -1;
$result = $result[0];
$this->id=$result['id'];
$this->verbindlichkeit=$result['verbindlichkeit'];
$this->sort=$result['sort'];
$this->artikel=$result['artikel'];
$this->projekt=$result['projekt'];
$this->bestellung=$result['bestellung'];
$this->nummer=$result['nummer'];
$this->bestellnummer=$result['bestellnummer'];
$this->waehrung=$result['waehrung'];
$this->einheit=$result['einheit'];
$this->vpe=$result['vpe'];
$this->bezeichnung=$result['bezeichnung'];
$this->umsatzsteuer=$result['umsatzsteuer'];
$this->status=$result['status'];
$this->beschreibung=$result['beschreibung'];
$this->lieferdatum=$result['lieferdatum'];
$this->steuersatz=$result['steuersatz'];
$this->steuertext=$result['steuertext'];
$this->preis=$result['preis'];
$this->menge=$result['menge'];
$this->kostenstelle=$result['kostenstelle'];
$this->sachkonto=$result['sachkonto'];
}
public function Create()
{
$sql = "INSERT INTO `verbindlichkeit_position` (`id`,`verbindlichkeit`,`sort`,`artikel`,`projekt`,`bestellung`,`nummer`,`bestellnummer`,`waehrung`,`einheit`,`vpe`,`bezeichnung`,`umsatzsteuer`,`status`,`beschreibung`,`lieferdatum`,`steuersatz`,`steuertext`,`preis`,`menge`,`kostenstelle`)
VALUES(NULL,'{$this->verbindlichkeit}','{$this->sort}','{$this->artikel}','{$this->projekt}','{$this->bestellung}','{$this->nummer}','{$this->bestellnummer}','{$this->waehrung}','{$this->einheit}','{$this->vpe}','{$this->bezeichnung}','{$this->umsatzsteuer}','{$this->status}','{$this->beschreibung}','{$this->lieferdatum}','{$this->steuersatz}','{$this->steuertext}','{$this->preis}','{$this->menge}','{$this->kostenstelle}','{$this->sachkonto}')";
$this->app->DB->Insert($sql);
$this->id = $this->app->DB->GetInsertID();
}
public function Update()
{
if(!is_numeric($this->id)) {
return -1;
}
$sql = "UPDATE `verbindlichkeit_position` SET
`verbindlichkeit`='{$this->verbindlichkeit}',
`sort`='{$this->sort}',
`artikel`='{$this->artikel}',
`projekt`='{$this->projekt}',
`bestellung`='{$this->bestellung}',
`nummer`='{$this->nummer}',
`bestellnummer`='{$this->bestellnummer}',
`waehrung`='{$this->waehrung}',
`einheit`='{$this->einheit}',
`vpe`='{$this->vpe}',
`bezeichnung`='{$this->bezeichnung}',
`umsatzsteuer`='{$this->umsatzsteuer}',
`status`='{$this->status}',
`beschreibung`='{$this->beschreibung}',
`lieferdatum`='{$this->lieferdatum}',
`steuersatz`='{$this->steuersatz}',
`steuertext`='{$this->steuertext}',
`preis`='{$this->preis}',
`menge`='{$this->menge}',
`kostenstelle`='{$this->kostenstelle}',
`sachkonto`='{$this->sachkonto}'
WHERE (`id`='{$this->id}')";
$this->app->DB->Update($sql);
}
public function Delete($id='')
{
if(is_numeric($id))
{
$this->id=$id;
}
else
return -1;
$sql = "DELETE FROM `verbindlichkeit_position` WHERE (`id`='{$this->id}')";
$this->app->DB->Delete($sql);
$this->id='';
$this->verbindlichkeit='';
$this->sort='';
$this->artikel='';
$this->projekt='';
$this->bestellung='';
$this->nummer='';
$this->bestellnummer='';
$this->waehrung='';
$this->einheit='';
$this->vpe='';
$this->bezeichnung='';
$this->umsatzsteuer='';
$this->status='';
$this->beschreibung='';
$this->lieferdatum='';
$this->steuersatz='';
$this->steuertext='';
$this->preis='';
$this->menge='';
$this->kostenstelle='';
$this->sachkonto='';
}
public function Copy()
{
$this->id = '';
$this->Create();
}
/**
Mit dieser Funktion kann man einen Datensatz suchen
dafuer muss man die Attribute setzen nach denen gesucht werden soll
dann kriegt man als ergebnis den ersten Datensatz der auf die Suche uebereinstimmt
zurueck. Mit Next() kann man sich alle weiteren Ergebnisse abholen
**/
public function Find()
{
//TODO Suche mit den werten machen
}
public function FindNext()
{
//TODO Suche mit den alten werten fortsetzen machen
}
/** Funktionen um durch die Tabelle iterieren zu koennen */
public function Next()
{
//TODO: SQL Statement passt nach meiner Meinung nach noch nicht immer
}
public function First()
{
//TODO: SQL Statement passt nach meiner Meinung nach noch nicht immer
}
/** dank dieser funktionen kann man die tatsaechlichen werte einfach
ueberladen (in einem Objekt das mit seiner klasse ueber dieser steht)**/
public function SetId($value) { $this->id=$value; }
public function GetId() { return $this->id; }
public function SetVerbindlichkeit($value) { $this->verbindlichkeit=$value; }
public function GetVerbindlichkeit() { return $this->verbindlichkeit; }
public function SetSort($value) { $this->sort=$value; }
public function GetSort() { return $this->sort; }
public function SetArtikel($value) { $this->artikel=$value; }
public function GetArtikel() { return $this->artikel; }
public function SetProjekt($value) { $this->projekt=$value; }
public function GetProjekt() { return $this->projekt; }
public function SetBestellung($value) { $this->bestellung=$value; }
public function GetBestellung() { return $this->bestellung; }
public function SetNummer($value) { $this->nummer=$value; }
public function GetNummer() { return $this->nummer; }
public function SetBestellnummer($value) { $this->bestellnummer=$value; }
public function GetBestellnummer() { return $this->bestellnummer; }
public function SetWaehrung($value) { $this->waehrung=$value; }
public function GetWaehrung() { return $this->waehrung; }
public function SetEinheit($value) { $this->einheit=$value; }
public function GetEinheit() { return $this->einheit; }
public function SetVpe($value) { $this->vpe=$value; }
public function GetVpe() { return $this->vpe; }
public function SetBezeichnung($value) { $this->bezeichnung=$value; }
public function GetBezeichnung() { return $this->bezeichnung; }
public function SetUmsatzsteuer($value) { $this->umsatzsteuer=$value; }
public function GetUmsatzsteuer() { return $this->umsatzsteuer; }
public function SetStatus($value) { $this->status=$value; }
public function GetStatus() { return $this->status; }
public function SetBeschreibung($value) { $this->beschreibung=$value; }
public function GetBeschreibung() { return $this->beschreibung; }
public function SetLieferdatum($value) { $this->lieferdatum=$value; }
public function GetLieferdatum() { return $this->lieferdatum; }
public function SetSteuersatz($value) { $this->steuersatz=$value; }
public function GetSteuersatz() { return $this->steuersatz; }
public function SetSteuertext($value) { $this->steuertext=$value; }
public function GetSteuertext() { return $this->steuertext; }
public function SetPreis($value) { $this->preis=$value; }
public function GetPreis() { return $this->preis; }
public function SetMenge($value) { $this->menge=$value; }
public function GetMenge() { return $this->menge; }
public function SetKostenstelle($value) { $this->kostenstelle=$value; }
public function GetKostenstelle() { return $this->kostenstelle; }
public function SetSachkonto($value) { $this->sachkonto=$value; }
public function GetSachkonto() { return $this->sachkonto; }
}

View File

@ -2362,7 +2362,14 @@ select a.kundennummer, (SELECT name FROM adresse a2 WHERE a2.kundennummer = a.ku
for($i = 0; $i < $carr; $i++)
$newarr[] = $arr[$i]['name'];
break;
case "sachkonto_aufwendungen":
$arr = $this->app->DB->SelectArr("SELECT CONCAT(sachkonto,' ',beschriftung) as name FROM kontorahmen
WHERE art = 1 AND (beschriftung LIKE '%$term%' OR sachkonto LIKE '%$term%' OR sachkonto LIKE '%$term2%' OR sachkonto LIKE '%$term3%' OR beschriftung LIKE '%$term2%' OR beschriftung LIKE '%$term3%') AND ausblenden!=1 $andprojekt ORDER by sachkonto");
$carr = !empty($arr)?count($arr):0;
for($i = 0; $i < $carr; $i++)
$newarr[] = $arr[$i]['name'];
break;
case "lieferbedingungen":
$arr = $this->app->DB->SelectArr("SELECT CONCAT(lieferbedingungen) as name FROM lieferbedingungen
WHERE (lieferbedingungen LIKE '%$term%' OR lieferbedingungen LIKE '%$term2%' OR lieferbedingungen LIKE '%$term3%') ORDER by lieferbedingungen");

View File

@ -1,13 +1,8 @@
<div id="tabs">
<ul>
<li><a href="#tabs-1"></a></li>
<li><a href="#tabs-1">Details</a></li>
<li><a href="#tabs-2">Positionen</a></li>
</ul>
<!-- Example for multiple tabs
<ul hidden">
<li><a href="#tabs-1">First Tab</a></li>
<li><a href="#tabs-2">Second Tab</a></li>
</ul>
-->
<div id="tabs-1">
[MESSAGE]
<form action="" method="post">
@ -184,5 +179,8 @@
<input type="submit" name="submit" value="Speichern" style="float:right"/>
</form>
</div>
<div id="tabs-2">
[POS]
</div>
</div>

View File

@ -17,9 +17,12 @@ class Verbindlichkeit {
$this->app->ActionHandler("list", "verbindlichkeit_list");
$this->app->ActionHandler("create", "verbindlichkeit_edit"); // This automatically adds a "New" button
$this->app->ActionHandler("edit", "verbindlichkeit_edit");
$this->app->ActionHandler("positionen", "verbindlichkeit_positionen");
$this->app->ActionHandler("delete", "verbindlichkeit_delete");
$this->app->ActionHandler("dateien", "verbindlichkeit_dateien");
$this->app->ActionHandler("inlinepdf", "verbindlichkeit_inlinepdf");
$this->app->ActionHandler("positioneneditpopup", "verbindlichkeit_positioneneditpopup");
$this->app->DefaultActionHandler("list");
$this->app->ActionHandlerListen($app);
}
@ -138,6 +141,8 @@ class Verbindlichkeit {
function verbindlichkeit_edit() {
$id = $this->app->Secure->GetGET('id');
$this->app->YUI->AARLGPositionen(true); // create iframe with positionen action
// Check if other users are editing this id
if($this->app->erp->DisableModul('artikel',$id))
{
@ -330,4 +335,71 @@ class Verbindlichkeit {
}
$this->app->ExitXentral();
}
function verbindlichkeit_positionen() {
$this->app->YUI->AARLGPositionen(false); // Render positionen editable into iframe
}
function verbindlichkeit_positioneneditpopup() {
$cmd = $this->app->Secure->GetGET('cmd');
if($cmd === 'getopenaccordions')
{
$accordions = $this->app->Secure->GetPOST('accordions');
$accordions = explode('*|*',$accordions);
foreach($accordions as $k => $v)
{
if(empty($v))
{
unset($accordions[$k]);
}else{
$accordions[$k] = 'verbindlichkeit_accordion'.$v;
}
}
$ret = [];
if(!empty($accordions))
{
$accordions = $this->app->User->GetParameter($accordions);
if(!empty($accordions))
{
foreach($accordions as $v)
{
if(!empty($v['value']))
{
$ret['accordions'][] = str_replace('verbindlichkeit_accordion','',$v['name']);
}
}
}
}
echo json_encode($ret);
$this->app->ExitXentral();
}
if($cmd === 'setaccordion')
{
$name = $this->app->Secure->GetPOST('name');
$active = $this->app->Secure->GetPOST('active');
$this->app->User->SetParameter('verbindlichkeit_accordion'.$name, $active);
echo json_encode(array('success'=>1));
$this->app->ExitXentral();
}
$id = $this->app->Secure->GetGET('id');
$fmodul = $this->app->Secure->GetGET('fmodul');
$artikel= $this->app->DB->Select("SELECT artikel FROM verbindlichkeit_position WHERE id='$id' LIMIT 1");
// nach page inhalt des dialogs ausgeben
$filename = 'widgets/widget.auftag_position_custom.php';
if(is_file($filename))
{
include_once $filename;
$widget = new WidgetVerbindlichkeit_positionCustom($this->app,'PAGE');
} else {
$widget = new WidgetVerbindlichkeit_position($this->app,'PAGE');
}
$sid= $this->app->DB->Select("SELECT verbindlichkeit FROM verbindlichkeit_position WHERE id='$id' LIMIT 1");
$widget->form->SpecialActionAfterExecute('close_refresh',
"index.php?module=verbindlichkeit&action=positionen&id=$sid&fmodul=$fmodul");
$widget->Edit();
$this->app->BuildNavigation=false;
}
}

View File

@ -1,129 +1,132 @@
<?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
class WidgetGenverbindlichkeit_position
{
private $app; //application object
public $form; //store form object
protected $parsetarget; //target for content
public function __construct($app,$parsetarget)
{
$this->app = $app;
$this->parsetarget = $parsetarget;
$this->Form();
}
public function verbindlichkeit_positionDelete()
{
$this->form->Execute("verbindlichkeit_position","delete");
$this->verbindlichkeit_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("verbindlichkeit_position");
$this->form->UseTable("verbindlichkeit_position");
$this->form->UseTemplate("verbindlichkeit_position.tpl",$this->parsetarget);
$field = new HTMLInput("artikel","text","","50","","","","","","","","0","","");
$this->form->NewField($field);
$this->form->AddMandatory("artikel","notempty","Pflichtfeld!","MSGARTIKEL");
$field = new HTMLInput("bezeichnung","text","","50","","","","","","","","0","","");
$this->form->NewField($field);
$this->form->AddMandatory("bezeichnung","notempty","Pflichtfeld!","MSGBEZEICHNUNG");
$field = new HTMLInput("nummer","text","","50","","","","","","","","0","","");
$this->form->NewField($field);
$field = new HTMLTextarea("beschreibung",5,30,"","","","","0");
$this->form->NewField($field);
$field = new HTMLInput("menge","text","","8","","","","","","","","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 HTMLInput("waehrung","text","","15","","","","","","","","0","","");
$this->form->NewField($field);
$field = new HTMLSelect("umsatzsteuer",0,"umsatzsteuer","","","0");
$field->AddOption('Standard','');
$field->AddOption('Erm&auml;&szlig;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("einheit","text","","50","","","","","","","","0","","");
$this->form->NewField($field);
$field = new HTMLInput("vpe","text","","50","","","","","","","","0","","");
$this->form->NewField($field);
$field = new HTMLInput("projekt","text","","50","","","","","","","","0","","");
$this->form->NewField($field);
$field = new HTMLInput("kostenstelle","text","","50","","","","","","","","0","","");
$this->form->NewField($field);
$field = new HTMLInput("lieferdatum","text","","15","","","","","","","","0","","");
$this->form->NewField($field);
}
}
?>
<?php
class WidgetGenverbindlichkeit_position
{
private $app; //application object
public $form; //store form object
protected $parsetarget; //target for content
public function __construct($app,$parsetarget)
{
$this->app = $app;
$this->parsetarget = $parsetarget;
$this->Form();
}
public function verbindlichkeit_positionDelete()
{
$this->form->Execute("verbindlichkeit_position","delete");
$this->verbindlichkeit_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("verbindlichkeit_position");
$this->form->UseTable("verbindlichkeit_position");
$this->form->UseTemplate("verbindlichkeit_position.tpl",$this->parsetarget);
$field = new HTMLInput("artikel","text","","50","","","","","","","","0","","");
$this->form->NewField($field);
$this->form->AddMandatory("artikel","notempty","Pflichtfeld!","MSGARTIKEL");
$field = new HTMLInput("bezeichnung","text","","50","","","","","","","","0","","");
$this->form->NewField($field);
$this->form->AddMandatory("bezeichnung","notempty","Pflichtfeld!","MSGBEZEICHNUNG");
$field = new HTMLInput("nummer","text","","50","","","","","","","","0","","");
$this->form->NewField($field);
$field = new HTMLTextarea("beschreibung",5,30,"","","","","0");
$this->form->NewField($field);
$field = new HTMLInput("menge","text","","8","","","","","","","","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 HTMLInput("waehrung","text","","15","","","","","","","","0","","");
$this->form->NewField($field);
$field = new HTMLSelect("umsatzsteuer",0,"umsatzsteuer","","","0");
$field->AddOption('Standard','');
$field->AddOption('Erm&auml;&szlig;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("einheit","text","","50","","","","","","","","0","","");
$this->form->NewField($field);
$field = new HTMLInput("vpe","text","","50","","","","","","","","0","","");
$this->form->NewField($field);
$field = new HTMLInput("projekt","text","","50","","","","","","","","0","","");
$this->form->NewField($field);
$field = new HTMLInput("sachkonto","text","","50","","","","","","","","0","","");
$this->form->NewField($field);
$field = new HTMLInput("kostenstelle","text","","50","","","","","","","","0","","");
$this->form->NewField($field);
$field = new HTMLInput("lieferdatum","text","","15","","","","","","","","0","","");
$this->form->NewField($field);
}
}
?>

View File

@ -25,31 +25,41 @@ $('#anderersteuersatz').click(function() { if (!$(this).is(':checked')) {
});
</script>
<form action="" method="post" name="eprooform">
[FORMHANDLEREVENT]
<table border="0" style="padding-right:10px;" class="mkTableFormular">
<tbody>
<tr><td nowrap>{|Artikel-Nr|}:</td><td>[ARTIKEL][MSGARTIKEL]</td></tr>
<tr><td nowrap>{|Beschreibung|}:</td><td>[BEZEICHNUNG][MSGBEZEICHNUNG]</td></tr>
<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&auml;hrung|}:</td><td>[WAEHRUNG][MSGWAEHRUNG]&nbsp;[WAEHRUNGSBUTTON]</td></tr>
<tr><td>{|Steuersatz|}:</td><td>[UMSATZSTEUER][MSGUMSATZSTEUER]&nbsp;
[ANDERERSTEUERSATZ][MSGANDERERSTEUERSATZ]&nbsp;individuellen Steuersatz verwenden
</td></tr>
<tr style="display:none" class="steuersatz"><td>{|Individueller Steuersatz|}:</td><td>[STEUERSATZ][MSGSTEUERSATZ]&nbsp;in Prozent</td></tr>
<tr><td>{|Rechtlicher Steuerhinweis|}:</td><td>
[STEUERTEXT][MSGSTEUERTEXT]
</td></tr>
<tr><td>{|Einheit|}:</td><td>[EINHEIT][MSGEINHEIT]</td></tr>
<tr><td>{|VPE|}:</td><td>[VPE][MSGVPE]</td></tr>
<tr><td>{|Projekt|}:</td><td>[PROJEKT][MSGPROJEKT]</td></tr>
<tr><td>{|Kostenstelle|}:</td><td>[KOSTENSTELLE][MSGKOSTENSTELLE]</td></tr>
<tr><td>{|Lieferdatum|}:</td><td>[LIEFERDATUM][MSGLIEFERDATUM]</td></tr>
<tr><td></td><td><input type="submit" value="Speichern" ></td></tr>
</tbody></table>
[FORMHANDLEREVENT]
<table border="0" style="padding-right:10px;" class="mkTableFormular">
<tbody>
<tr valign="top">
<td width="550">
<table border="0" style="padding-right:10px;" class="mkTableFormular">
<tr><td nowrap>{|Artikel-Nr|}:</td><td>[ARTIKEL][MSGARTIKEL]</td></tr>
<tr><td nowrap>{|Beschreibung|}:</td><td>[BEZEICHNUNG][MSGBEZEICHNUNG]</td></tr>
<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&auml;hrung|}:</td><td>[WAEHRUNG][MSGWAEHRUNG]&nbsp;[WAEHRUNGSBUTTON]</td></tr>
<tr><td>{|Steuersatz|}:</td><td>[UMSATZSTEUER][MSGUMSATZSTEUER]&nbsp;
[ANDERERSTEUERSATZ][MSGANDERERSTEUERSATZ]&nbsp;individuellen Steuersatz verwenden
</td></tr>
<tr style="display:none" class="steuersatz"><td>{|Individueller Steuersatz|}:</td><td>[STEUERSATZ][MSGSTEUERSATZ]&nbsp;in Prozent</td></tr>
<tr><td>{|Rechtlicher Steuerhinweis|}:</td><td>
[STEUERTEXT][MSGSTEUERTEXT]
</td></tr>
<tr><td>{|Einheit|}:</td><td>[EINHEIT][MSGEINHEIT]</td></tr>
<tr><td>{|VPE|}:</td><td>[VPE][MSGVPE]</td></tr>
<tr><td>{|Lieferdatum|}:</td><td>[LIEFERDATUM][MSGLIEFERDATUM]</td></tr>
</table>
</td>
<td width="30%" [STYLERECHTS]>
<table width="100%">
<tr><td></td><td align="right"><input type="submit" value="Speichern" ></td></tr>
<tr><td>{|Projekt|}:</td><td>[PROJEKT][MSGPROJEKT]</td></tr>
<tr><td>{|Kostenstelle|}:</td><td>[KOSTENSTELLE][MSGKOSTENSTELLE]</td></tr>
<tr><td>{|Sachkonto|}:</td><td>[SACHKONTO][MSGSACHKONTO]</td></tr>
</table>
</td>
</tr>
</tbody>
</table>
</form>
[WAEHRUNGSTABELLE]

View File

@ -24,6 +24,7 @@ class WidgetVerbindlichkeit_position extends WidgetGenVerbindlichkeit_position
$this->app->YUI->AutoComplete("projekt","projektname",1);
$this->app->YUI->AutoComplete("kostenstelle","kostenstelle",1);
$this->app->YUI->AutoComplete("sachkonto","sachkonto_aufwendungen",1);
$this->app->YUI->AutoComplete("artikel","artikelnummer");
//$this->app->YUI->AutoComplete(AUTO,"artikel",array('nummer','name_de','warengruppe'),"nummer");
@ -36,6 +37,7 @@ class WidgetVerbindlichkeit_position extends WidgetGenVerbindlichkeit_position
$this->form->ReplaceFunction("menge",$this,"ReplaceMenge");
//$this->form->ReplaceFunction("geliefert",$this,"ReplaceMenge");
$this->form->ReplaceFunction("projekt",$this,"ReplaceProjekt");
$this->form->ReplaceFunction("sachkonto",$this,"ReplaceSachkonto");
if($this->app->erp->Firmendaten("briefhtml")=="1")
{
@ -79,6 +81,11 @@ class WidgetVerbindlichkeit_position extends WidgetGenVerbindlichkeit_position
return $this->app->erp->ReplaceProjekt($db,$value,$fromform);
}
function ReplaceSachkonto($db,$value,$fromform)
{
return $this->app->erp->ReplaceKontorahmen($db,$value,$fromform);
}
function ReplaceSteuersatz($db,$value,$fromform)
{
if($db)