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; $anzeigebrutto = true;
} }
} }
$sortcol = ' b.sort '; $sortcol = ' b.sort ';
$schreibschutz = !empty($docArr)?$docArr['schreibschutz']:$this->app->DB->Select("SELECT schreibschutz FROM $module WHERE id='$id'"); $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 "; 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 LEFT JOIN artikel a ON a.id=b.artikel LEFT JOIN projekt p ON b.projekt=p.id
WHERE b.$module='$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; $sql = null;
$this->app->erp->RunHook('yui_position_sql', 3, $table, $id, $sql); $this->app->erp->RunHook('yui_position_sql', 3, $table, $id, $sql);
if($sql === null){ if($sql === null){

View File

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

View File

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

View File

@ -1,13 +1,8 @@
<div id="tabs"> <div id="tabs">
<ul> <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> </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"> <div id="tabs-1">
[MESSAGE] [MESSAGE]
<form action="" method="post"> <form action="" method="post">
@ -184,5 +179,8 @@
<input type="submit" name="submit" value="Speichern" style="float:right"/> <input type="submit" name="submit" value="Speichern" style="float:right"/>
</form> </form>
</div> </div>
<div id="tabs-2">
[POS]
</div>
</div> </div>

View File

@ -17,9 +17,12 @@ class Verbindlichkeit {
$this->app->ActionHandler("list", "verbindlichkeit_list"); $this->app->ActionHandler("list", "verbindlichkeit_list");
$this->app->ActionHandler("create", "verbindlichkeit_edit"); // This automatically adds a "New" button $this->app->ActionHandler("create", "verbindlichkeit_edit"); // This automatically adds a "New" button
$this->app->ActionHandler("edit", "verbindlichkeit_edit"); $this->app->ActionHandler("edit", "verbindlichkeit_edit");
$this->app->ActionHandler("positionen", "verbindlichkeit_positionen");
$this->app->ActionHandler("delete", "verbindlichkeit_delete"); $this->app->ActionHandler("delete", "verbindlichkeit_delete");
$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->DefaultActionHandler("list"); $this->app->DefaultActionHandler("list");
$this->app->ActionHandlerListen($app); $this->app->ActionHandlerListen($app);
} }
@ -138,6 +141,8 @@ class Verbindlichkeit {
function verbindlichkeit_edit() { function verbindlichkeit_edit() {
$id = $this->app->Secure->GetGET('id'); $id = $this->app->Secure->GetGET('id');
$this->app->YUI->AARLGPositionen(true); // create iframe with positionen action
// Check if other users are editing this id // Check if other users are editing this id
if($this->app->erp->DisableModul('artikel',$id)) if($this->app->erp->DisableModul('artikel',$id))
{ {
@ -330,4 +335,71 @@ class Verbindlichkeit {
} }
$this->app->ExitXentral(); $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 <?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
class WidgetGenverbindlichkeit_position class WidgetGenverbindlichkeit_position
{ {
private $app; //application object private $app; //application object
public $form; //store form object public $form; //store form object
protected $parsetarget; //target for content protected $parsetarget; //target for content
public function __construct($app,$parsetarget) public function __construct($app,$parsetarget)
{ {
$this->app = $app; $this->app = $app;
$this->parsetarget = $parsetarget; $this->parsetarget = $parsetarget;
$this->Form(); $this->Form();
} }
public function verbindlichkeit_positionDelete() public function verbindlichkeit_positionDelete()
{ {
$this->form->Execute("verbindlichkeit_position","delete"); $this->form->Execute("verbindlichkeit_position","delete");
$this->verbindlichkeit_positionList(); $this->verbindlichkeit_positionList();
} }
function Edit() function Edit()
{ {
$this->form->Edit(); $this->form->Edit();
} }
function Copy() function Copy()
{ {
$this->form->Copy(); $this->form->Copy();
} }
public function Create() public function Create()
{ {
$this->form->Create(); $this->form->Create();
} }
public function Search() public function Search()
{ {
$this->app->Tpl->Set($this->parsetarget,"SUUUCHEEE"); $this->app->Tpl->Set($this->parsetarget,"SUUUCHEEE");
} }
public function Summary() public function Summary()
{ {
$this->app->Tpl->Set($this->parsetarget,"grosse Tabelle"); $this->app->Tpl->Set($this->parsetarget,"grosse Tabelle");
} }
function Form() function Form()
{ {
$this->form = $this->app->FormHandler->CreateNew("verbindlichkeit_position"); $this->form = $this->app->FormHandler->CreateNew("verbindlichkeit_position");
$this->form->UseTable("verbindlichkeit_position"); $this->form->UseTable("verbindlichkeit_position");
$this->form->UseTemplate("verbindlichkeit_position.tpl",$this->parsetarget); $this->form->UseTemplate("verbindlichkeit_position.tpl",$this->parsetarget);
$field = new HTMLInput("artikel","text","","50","","","","","","","","0","",""); $field = new HTMLInput("artikel","text","","50","","","","","","","","0","","");
$this->form->NewField($field); $this->form->NewField($field);
$this->form->AddMandatory("artikel","notempty","Pflichtfeld!","MSGARTIKEL"); $this->form->AddMandatory("artikel","notempty","Pflichtfeld!","MSGARTIKEL");
$field = new HTMLInput("bezeichnung","text","","50","","","","","","","","0","",""); $field = new HTMLInput("bezeichnung","text","","50","","","","","","","","0","","");
$this->form->NewField($field); $this->form->NewField($field);
$this->form->AddMandatory("bezeichnung","notempty","Pflichtfeld!","MSGBEZEICHNUNG"); $this->form->AddMandatory("bezeichnung","notempty","Pflichtfeld!","MSGBEZEICHNUNG");
$field = new HTMLInput("nummer","text","","50","","","","","","","","0","",""); $field = new HTMLInput("nummer","text","","50","","","","","","","","0","","");
$this->form->NewField($field); $this->form->NewField($field);
$field = new HTMLTextarea("beschreibung",5,30,"","","","","0"); $field = new HTMLTextarea("beschreibung",5,30,"","","","","0");
$this->form->NewField($field); $this->form->NewField($field);
$field = new HTMLInput("menge","text","","8","","","","","","","","0","",""); $field = new HTMLInput("menge","text","","8","","","","","","","","0","","");
$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","","50","","","","","","","","0","","");
$this->form->NewField($field); $this->form->NewField($field);
$field = new HTMLInput("waehrung","text","","15","","","","","","","","0","",""); $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");
$field->AddOption('Standard',''); $field->AddOption('Standard','');
$field->AddOption('Erm&auml;&szlig;igt','ermaessigt'); $field->AddOption('Erm&auml;&szlig;igt','ermaessigt');
$field->AddOption('Befreit','befreit'); $field->AddOption('Befreit','befreit');
$this->form->NewField($field); $this->form->NewField($field);
$field = new HTMLCheckbox("anderersteuersatz","","","","0","0"); $field = new HTMLCheckbox("anderersteuersatz","","","","0","0");
$this->form->NewField($field); $this->form->NewField($field);
$field = new HTMLInput("steuersatz","text","","15","","","","","","","","0","",""); $field = new HTMLInput("steuersatz","text","","15","","","","","","","","0","","");
$this->form->NewField($field); $this->form->NewField($field);
$field = new HTMLTextarea("steuertext",3,50,"","","","","0"); $field = new HTMLTextarea("steuertext",3,50,"","","","","0");
$this->form->NewField($field); $this->form->NewField($field);
$field = new HTMLInput("einheit","text","","50","","","","","","","","0","",""); $field = new HTMLInput("einheit","text","","50","","","","","","","","0","","");
$this->form->NewField($field); $this->form->NewField($field);
$field = new HTMLInput("vpe","text","","50","","","","","","","","0","",""); $field = new HTMLInput("vpe","text","","50","","","","","","","","0","","");
$this->form->NewField($field); $this->form->NewField($field);
$field = new HTMLInput("projekt","text","","50","","","","","","","","0","",""); $field = new HTMLInput("projekt","text","","50","","","","","","","","0","","");
$this->form->NewField($field); $this->form->NewField($field);
$field = new HTMLInput("kostenstelle","text","","50","","","","","","","","0","",""); $field = new HTMLInput("sachkonto","text","","50","","","","","","","","0","","");
$this->form->NewField($field); $this->form->NewField($field);
$field = new HTMLInput("lieferdatum","text","","15","","","","","","","","0","",""); $field = new HTMLInput("kostenstelle","text","","50","","","","","","","","0","","");
$this->form->NewField($field); $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> </script>
<form action="" method="post" name="eprooform"> <form action="" method="post" name="eprooform">
[FORMHANDLEREVENT] [FORMHANDLEREVENT]
<table border="0" style="padding-right:10px;" class="mkTableFormular"> <table border="0" style="padding-right:10px;" class="mkTableFormular">
<tbody> <tbody>
<tr><td nowrap>{|Artikel-Nr|}:</td><td>[ARTIKEL][MSGARTIKEL]</td></tr> <tr valign="top">
<tr><td nowrap>{|Beschreibung|}:</td><td>[BEZEICHNUNG][MSGBEZEICHNUNG]</td></tr> <td width="550">
<tr><td nowrap>{|Artikel-Nr|}:</td><td>[NUMMER][MSGNUMMER]</td></tr> <table border="0" style="padding-right:10px;" class="mkTableFormular">
<tr><td>{|Beschreibung|}:</td><td>[BESCHREIBUNG][MSGBESCHREIBUNG]</td></tr> <tr><td nowrap>{|Artikel-Nr|}:</td><td>[ARTIKEL][MSGARTIKEL]</td></tr>
<tr><td>{|Menge|}:</td><td>[MENGE][MSGMENGE]</td></tr> <tr><td nowrap>{|Beschreibung|}:</td><td>[BEZEICHNUNG][MSGBEZEICHNUNG]</td></tr>
<tr><td>{|Preis|}:</td><td>[PREIS][MSGPREIS]</td></tr> <tr><td nowrap>{|Artikel-Nr|}:</td><td>[NUMMER][MSGNUMMER]</td></tr>
<tr><td>{|W&auml;hrung|}:</td><td>[WAEHRUNG][MSGWAEHRUNG]&nbsp;[WAEHRUNGSBUTTON]</td></tr> <tr><td>{|Beschreibung|}:</td><td>[BESCHREIBUNG][MSGBESCHREIBUNG]</td></tr>
<tr><td>{|Steuersatz|}:</td><td>[UMSATZSTEUER][MSGUMSATZSTEUER]&nbsp; <tr><td>{|Menge|}:</td><td>[MENGE][MSGMENGE]</td></tr>
<tr><td>{|Preis|}:</td><td>[PREIS][MSGPREIS]</td></tr>
[ANDERERSTEUERSATZ][MSGANDERERSTEUERSATZ]&nbsp;individuellen Steuersatz verwenden <tr><td>{|W&auml;hrung|}:</td><td>[WAEHRUNG][MSGWAEHRUNG]&nbsp;[WAEHRUNGSBUTTON]</td></tr>
</td></tr> <tr><td>{|Steuersatz|}:</td><td>[UMSATZSTEUER][MSGUMSATZSTEUER]&nbsp;
<tr style="display:none" class="steuersatz"><td>{|Individueller Steuersatz|}:</td><td>[STEUERSATZ][MSGSTEUERSATZ]&nbsp;in Prozent</td></tr> [ANDERERSTEUERSATZ][MSGANDERERSTEUERSATZ]&nbsp;individuellen Steuersatz verwenden
<tr><td>{|Rechtlicher Steuerhinweis|}:</td><td> </td></tr>
[STEUERTEXT][MSGSTEUERTEXT] <tr style="display:none" class="steuersatz"><td>{|Individueller Steuersatz|}:</td><td>[STEUERSATZ][MSGSTEUERSATZ]&nbsp;in Prozent</td></tr>
</td></tr> <tr><td>{|Rechtlicher Steuerhinweis|}:</td><td>
<tr><td>{|Einheit|}:</td><td>[EINHEIT][MSGEINHEIT]</td></tr> [STEUERTEXT][MSGSTEUERTEXT]
<tr><td>{|VPE|}:</td><td>[VPE][MSGVPE]</td></tr> </td></tr>
<tr><td>{|Projekt|}:</td><td>[PROJEKT][MSGPROJEKT]</td></tr> <tr><td>{|Einheit|}:</td><td>[EINHEIT][MSGEINHEIT]</td></tr>
<tr><td>{|Kostenstelle|}:</td><td>[KOSTENSTELLE][MSGKOSTENSTELLE]</td></tr> <tr><td>{|VPE|}:</td><td>[VPE][MSGVPE]</td></tr>
<tr><td>{|Lieferdatum|}:</td><td>[LIEFERDATUM][MSGLIEFERDATUM]</td></tr> <tr><td>{|Lieferdatum|}:</td><td>[LIEFERDATUM][MSGLIEFERDATUM]</td></tr>
<tr><td></td><td><input type="submit" value="Speichern" ></td></tr> </table>
</td>
</tbody></table> <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> </form>
[WAEHRUNGSTABELLE] [WAEHRUNGSTABELLE]

View File

@ -24,6 +24,7 @@ class WidgetVerbindlichkeit_position extends WidgetGenVerbindlichkeit_position
$this->app->YUI->AutoComplete("projekt","projektname",1); $this->app->YUI->AutoComplete("projekt","projektname",1);
$this->app->YUI->AutoComplete("kostenstelle","kostenstelle",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("artikel","artikelnummer");
//$this->app->YUI->AutoComplete(AUTO,"artikel",array('nummer','name_de','warengruppe'),"nummer"); //$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("menge",$this,"ReplaceMenge");
//$this->form->ReplaceFunction("geliefert",$this,"ReplaceMenge"); //$this->form->ReplaceFunction("geliefert",$this,"ReplaceMenge");
$this->form->ReplaceFunction("projekt",$this,"ReplaceProjekt"); $this->form->ReplaceFunction("projekt",$this,"ReplaceProjekt");
$this->form->ReplaceFunction("sachkonto",$this,"ReplaceSachkonto");
if($this->app->erp->Firmendaten("briefhtml")=="1") 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); 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) function ReplaceSteuersatz($db,$value,$fromform)
{ {
if($db) if($db)