mirror of
https://github.com/OpenXE-org/OpenXE.git
synced 2024-12-24 13:40:29 +01:00
verbindlichkeit added positionen with sachkonto
This commit is contained in:
parent
bbf8b071c0
commit
57f0e2f627
@ -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){
|
||||
|
@ -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": [
|
||||
|
@ -38,6 +38,7 @@ class ObjGenVerbindlichkeit_Position
|
||||
private $preis;
|
||||
private $menge;
|
||||
private $kostenstelle;
|
||||
private $sachkonto;
|
||||
|
||||
public $app; //application object
|
||||
|
||||
@ -76,12 +77,13 @@ $result = $result[0];
|
||||
$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}')";
|
||||
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();
|
||||
@ -113,7 +115,8 @@ $result = $result[0];
|
||||
`steuertext`='{$this->steuertext}',
|
||||
`preis`='{$this->preis}',
|
||||
`menge`='{$this->menge}',
|
||||
`kostenstelle`='{$this->kostenstelle}'
|
||||
`kostenstelle`='{$this->kostenstelle}',
|
||||
`sachkonto`='{$this->sachkonto}'
|
||||
WHERE (`id`='{$this->id}')";
|
||||
|
||||
$this->app->DB->Update($sql);
|
||||
@ -152,6 +155,7 @@ $result = $result[0];
|
||||
$this->preis='';
|
||||
$this->menge='';
|
||||
$this->kostenstelle='';
|
||||
$this->sachkonto='';
|
||||
}
|
||||
|
||||
public function Copy()
|
||||
@ -234,5 +238,7 @@ $result = $result[0];
|
||||
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; }
|
||||
|
||||
}
|
||||
|
@ -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");
|
||||
|
@ -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>
|
||||
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -115,6 +115,9 @@ class WidgetGenverbindlichkeit_position
|
||||
$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);
|
||||
|
||||
|
@ -25,9 +25,12 @@ $('#anderersteuersatz').click(function() { if (!$(this).is(':checked')) {
|
||||
});
|
||||
</script>
|
||||
<form action="" method="post" name="eprooform">
|
||||
[FORMHANDLEREVENT]
|
||||
[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>
|
||||
@ -36,20 +39,27 @@ $('#anderersteuersatz').click(function() { if (!$(this).is(':checked')) {
|
||||
<tr><td>{|Preis|}:</td><td>[PREIS][MSGPREIS]</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>
|
||||
[ANDERERSTEUERSATZ][MSGANDERERSTEUERSATZ] individuellen Steuersatz verwenden
|
||||
</td></tr>
|
||||
<tr style="display:none" class="steuersatz"><td>{|Individueller Steuersatz|}:</td><td>[STEUERSATZ][MSGSTEUERSATZ] 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>{|Lieferdatum|}:</td><td>[LIEFERDATUM][MSGLIEFERDATUM]</td></tr>
|
||||
<tr><td></td><td><input type="submit" value="Speichern" ></td></tr>
|
||||
|
||||
</tbody></table>
|
||||
<tr><td>{|Sachkonto|}:</td><td>[SACHKONTO][MSGSACHKONTO]</td></tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</form>
|
||||
[WAEHRUNGSTABELLE]
|
||||
|
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user