mirror of
https://github.com/OpenXE-org/OpenXE.git
synced 2024-12-25 06:00:28 +01:00
Merge branch 'OpenXE-org:master' into 231225-Alternative-Rechnungs-bezeichnung-als-standard
This commit is contained in:
commit
eae4644921
@ -2853,7 +2853,64 @@ 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,
|
||||
".$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;
|
||||
$this->app->erp->RunHook('yui_position_sql', 3, $table, $id, $sql);
|
||||
if($sql === null){
|
||||
@ -3549,24 +3606,11 @@ class YUI {
|
||||
|
||||
$stop_betragbezahlt = "<img alt=\"Zahlung fehlt\" src=\"./themes/{$this->app->Conf->WFconf['defaulttheme']}/images/vorkassestop.png\" style=\"margin-right:1px\" title=\"Zahlung fehlt\" border=\"0\">";
|
||||
$gostop_betragbezahlt = "<img alt=\"teilweise bezahlt\" src=\"./themes/{$this->app->Conf->WFconf['defaulttheme']}/images/vorkassegostop.png\" style=\"margin-right:1px\" title=\"teilweise bezahlt\" border=\"0\">";
|
||||
$go_betragbezahlt = "<img alt=\"nicht bezahlt\" src=\"./themes/{$this->app->Conf->WFconf['defaulttheme']}/images/vorkassego.png\" style=\"margin-right:1px\" title=\"komplett bezahlt\" border=\"0\">";
|
||||
$go_betragbezahlt = "<img alt=\"nicht bezahlt\" src=\"./themes/{$this->app->Conf->WFconf['defaulttheme']}/images/vorkassego.png\" style=\"margin-right:1px\" title=\"bezahlt\" border=\"0\">";
|
||||
return "CONCAT('<table><tr><td nowrap>',
|
||||
if(v.freigabe,'$go_ware','$stop_ware'),
|
||||
if(v.rechnungsfreigabe,'$go_summe','$stop_summe'),
|
||||
IF( v.betragbezahlt = 0 OR (v.betrag > 0 AND v.betragbezahlt < 0),'$stop_betragbezahlt',
|
||||
IF(v.betrag > 0 AND (v.betragbezahlt + v.skonto_erhalten) >= v.betrag, '$go_betragbezahlt',
|
||||
IF(v.betrag - v.betragbezahlt <= v.betrag-((v.betrag/100.0)*v.skonto),
|
||||
'$gostop_betragbezahlt',
|
||||
'$go_betragbezahlt'
|
||||
)
|
||||
)
|
||||
),
|
||||
if((
|
||||
(SELECT COUNT(ka.id)
|
||||
FROM kontoauszuege_zahlungsausgang ka WHERE ka.parameter=v.id AND ka.objekt='verbindlichkeit') +
|
||||
(SELECT COUNT(ke.id) FROM kontoauszuege_zahlungseingang ke WHERE ke.parameter=v.id AND ke.objekt='verbindlichkeit')) > 0,
|
||||
'$go_zahlung','$stop_zahlung'
|
||||
),
|
||||
if(v.bezahlt,'$go_betragbezahlt','$stop_betragbezahlt'),
|
||||
'</td></tr></table>')";
|
||||
}
|
||||
|
||||
@ -14862,8 +14906,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';
|
||||
|
@ -41,6 +41,10 @@ class PLACEHOLDER_MODULECLASSNAME {
|
||||
|
||||
$defaultorder = 1;
|
||||
$defaultorderdesc = 0;
|
||||
$aligncenter = array();
|
||||
$alignright = array();
|
||||
$numbercols = array();
|
||||
$sumcol = array();
|
||||
|
||||
$dropnbox = "PLACEHOLDER_DROPNBOX";
|
||||
|
||||
@ -165,6 +169,12 @@ class PLACEHOLDER_MODULECLASSNAME {
|
||||
$this->app->Tpl->Set(strtoupper($key), $value);
|
||||
}
|
||||
|
||||
if (!empty($result)) {
|
||||
$PLACEHOLDER_MODULENAME_from_db = $result[0];
|
||||
} else {
|
||||
return;
|
||||
}
|
||||
|
||||
/*
|
||||
* Add displayed items later
|
||||
*
|
||||
@ -177,7 +187,6 @@ class PLACEHOLDER_MODULECLASSNAME {
|
||||
|
||||
*/
|
||||
|
||||
// $this->SetInput($input);
|
||||
$this->app->Tpl->Parse('PAGE', "PLACEHOLDER_MODULENAME_edit.tpl");
|
||||
}
|
||||
|
||||
|
@ -16976,6 +16976,17 @@
|
||||
"Extra": "",
|
||||
"Privileges": "select,insert,update,references",
|
||||
"Comment": ""
|
||||
},
|
||||
{
|
||||
"Field": "kontorahmen",
|
||||
"Type": "int(11)",
|
||||
"Collation": null,
|
||||
"Null": "YES",
|
||||
"Key": "",
|
||||
"Default": "0",
|
||||
"Extra": "",
|
||||
"Privileges": "select,insert,update,references",
|
||||
"Comment": ""
|
||||
}
|
||||
],
|
||||
"keys": [
|
||||
@ -52382,6 +52393,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)",
|
||||
@ -52393,6 +52415,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)",
|
||||
@ -108981,6 +109014,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)",
|
||||
@ -110707,6 +110751,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": [
|
||||
@ -111160,6 +111237,17 @@
|
||||
"Privileges": "select,insert,update,references",
|
||||
"Comment": ""
|
||||
},
|
||||
{
|
||||
"Field": "paketdistribution",
|
||||
"Type": "int(11)",
|
||||
"Collation": null,
|
||||
"Null": "NO",
|
||||
"Key": "MUL",
|
||||
"Default": "0",
|
||||
"Extra": "",
|
||||
"Privileges": "select,insert,update,references",
|
||||
"Comment": ""
|
||||
},
|
||||
{
|
||||
"Field": "waehrung",
|
||||
"Type": "varchar(255)",
|
||||
@ -111302,6 +111390,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": [
|
||||
@ -117925,7 +118024,7 @@
|
||||
{
|
||||
"name": "fibu_buchungen_alle_view",
|
||||
"type": "VIEW",
|
||||
"Create": "CREATE VIEW `fibu_buchungen_alle_view` AS select `fb`.`buchungsart` AS `buchungsart`,`fb`.`typ` AS `typ`,`fb`.`id` AS `id`,if(`fibu_objekte_view`.`datum` <> '',`fibu_objekte_view`.`datum`,`fb`.`datum`) AS `datum`,`fb`.`gegen_typ` AS `doc_typ`,`fb`.`gegen_id` AS `doc_id`,`fibu_objekte_view`.`info` AS `doc_info`, CAST(`fb`.`soll` AS decimal(10,2)) AS `betrag`,`fb`.`waehrung` AS `waehrung`,`fb`.`edit_module` AS `edit_module`,`fb`.`edit_id` AS `edit_id` from ((select 'umsatz' AS `buchungsart`,'rechnung' AS `typ`,`rechnung`.`id` AS `id`,-`rechnung`.`soll` AS `soll`,`rechnung`.`waehrung` AS `waehrung`,'rechnung' AS `gegen_typ`,`rechnung`.`id` AS `gegen_id`,`rechnung`.`datum` AS `datum`,'rechnung' AS `edit_module`,`rechnung`.`id` AS `edit_id` from `rechnung` where `rechnung`.`belegnr` <> '' union select 'umsatz' AS `umsatz`,'gutschrift' AS `gutschrift`,`gutschrift`.`id` AS `id`,`gutschrift`.`soll` AS `soll`,`gutschrift`.`waehrung` AS `waehrung`,'gutschrift' AS `gutschrift`,`gutschrift`.`id` AS `id`,`gutschrift`.`datum` AS `datum`,'gutschrift' AS `edit_module`,`gutschrift`.`id` AS `id` from `gutschrift` where `gutschrift`.`belegnr` <> '' union select 'aufwand' AS `aufwand`,'verbindlichkeit' AS `verbindlichkeit`,`verbindlichkeit`.`id` AS `id`,`verbindlichkeit`.`betrag` AS `betrag`,`verbindlichkeit`.`waehrung` AS `waehrung`,'verbindlichkeit' AS `verbindlichkeit`,`verbindlichkeit`.`id` AS `id`,`verbindlichkeit`.`rechnungsdatum` AS `rechnungsdatum`,'verbindlichkeit' AS `verbindlichkeit`,`verbindlichkeit`.`id` AS `id` from `verbindlichkeit` where `verbindlichkeit`.`belegnr` <> '' union select 'zahlung' AS `zahlung`,'kontoauszuege' AS `kontoauszuege`,`kontoauszuege`.`id` AS `id`,`kontoauszuege`.`soll` AS `soll`,`kontoauszuege`.`waehrung` AS `waehrung`,'kontoauszuege' AS `kontoauszuege`,`kontoauszuege`.`id` AS `id`,`kontoauszuege`.`buchung` AS `buchung`,'kontoauszuege' AS `kontoauszuege`,`kontoauszuege`.`id` AS `id` from `kontoauszuege` where `kontoauszuege`.`importfehler` is null union select 'abbuchung' AS `abbuchung`,`fibu_buchungen`.`von_typ` AS `von_typ`,`fibu_buchungen`.`von_id` AS `von_id`,`fibu_buchungen`.`betrag` AS `betrag`,`fibu_buchungen`.`waehrung` AS `waehrung`,`fibu_buchungen`.`nach_typ` AS `nach_typ`,`fibu_buchungen`.`nach_id` AS `nach_id`,`fibu_buchungen`.`datum` AS `datum`,'fibu_buchungen' AS `fibu_buchungen`,`fibu_buchungen`.`id` AS `id` from `fibu_buchungen` union select 'zubuchung' AS `zubuchung`,`fibu_buchungen`.`nach_typ` AS `nach_typ`,`fibu_buchungen`.`nach_id` AS `nach_id`,-`fibu_buchungen`.`betrag` AS `-``openxe``.``fibu_buchungen``.``betrag```,`fibu_buchungen`.`waehrung` AS `waehrung`,`fibu_buchungen`.`von_typ` AS `von_typ`,`fibu_buchungen`.`von_id` AS `von_id`,`fibu_buchungen`.`datum` AS `datum`,'fibu_buchungen' AS `fibu_buchungen`,`fibu_buchungen`.`id` AS `id` from `fibu_buchungen`) `fb` left join `fibu_objekte_view` on(`fb`.`gegen_typ` = `fibu_objekte_view`.`typ` and `fb`.`gegen_id` = `fibu_objekte_view`.`id`)) where `fb`.`datum` >= (select `firmendaten_werte`.`wert` from `firmendaten_werte` where `firmendaten_werte`.`name` = 'fibu_buchungen_startdatum') and `fibu_objekte_view`.`datum` >= (select `firmendaten_werte`.`wert` from `firmendaten_werte` where `firmendaten_werte`.`name` = 'fibu_buchungen_startdatum') or `fibu_objekte_view`.`datum` = ''"
|
||||
"Create": "CREATE VIEW `fibu_buchungen_alle_view` AS select `fb`.`buchungsart` AS `buchungsart`,`fb`.`typ` AS `typ`,`fb`.`id` AS `id`,if(`fibu_objekte_view`.`datum` <> '',`fibu_objekte_view`.`datum`,`fb`.`datum`) AS `datum`,`fb`.`gegen_typ` AS `doc_typ`,`fb`.`gegen_id` AS `doc_id`,`fibu_objekte_view`.`info` AS `doc_info`,cast(`fb`.`soll` as decimal(10,2)) AS `betrag`,`fb`.`waehrung` AS `waehrung`,`fb`.`edit_module` AS `edit_module`,`fb`.`edit_id` AS `edit_id` from ((select 'umsatz' AS `buchungsart`,'rechnung' AS `typ`,`rechnung`.`id` AS `id`,-`rechnung`.`soll` AS `soll`,`rechnung`.`waehrung` AS `waehrung`,'rechnung' AS `gegen_typ`,`rechnung`.`id` AS `gegen_id`,`rechnung`.`datum` AS `datum`,'rechnung' AS `edit_module`,`rechnung`.`id` AS `edit_id` from `rechnung` where `rechnung`.`belegnr` <> '' union select 'umsatz' AS `umsatz`,'gutschrift' AS `gutschrift`,`gutschrift`.`id` AS `id`,`gutschrift`.`soll` AS `soll`,`gutschrift`.`waehrung` AS `waehrung`,'gutschrift' AS `gutschrift`,`gutschrift`.`id` AS `id`,`gutschrift`.`datum` AS `datum`,'gutschrift' AS `edit_module`,`gutschrift`.`id` AS `id` from `gutschrift` where `gutschrift`.`belegnr` <> '' union select 'aufwand' AS `aufwand`,'verbindlichkeit' AS `verbindlichkeit`,`verbindlichkeit`.`id` AS `id`,`verbindlichkeit`.`betrag` AS `betrag`,`verbindlichkeit`.`waehrung` AS `waehrung`,'verbindlichkeit' AS `verbindlichkeit`,`verbindlichkeit`.`id` AS `id`,`verbindlichkeit`.`rechnungsdatum` AS `rechnungsdatum`,'verbindlichkeit' AS `verbindlichkeit`,`verbindlichkeit`.`id` AS `id` from `verbindlichkeit` where `verbindlichkeit`.`belegnr` <> '' union select 'zahlung' AS `zahlung`,'kontoauszuege' AS `kontoauszuege`,`kontoauszuege`.`id` AS `id`,`kontoauszuege`.`soll` AS `soll`,`kontoauszuege`.`waehrung` AS `waehrung`,'kontoauszuege' AS `kontoauszuege`,`kontoauszuege`.`id` AS `id`,`kontoauszuege`.`buchung` AS `buchung`,'kontoauszuege' AS `kontoauszuege`,`kontoauszuege`.`id` AS `id` from `kontoauszuege` where `kontoauszuege`.`importfehler` is null union select 'abbuchung' AS `abbuchung`,`fibu_buchungen`.`von_typ` AS `von_typ`,`fibu_buchungen`.`von_id` AS `von_id`,`fibu_buchungen`.`betrag` AS `betrag`,`fibu_buchungen`.`waehrung` AS `waehrung`,`fibu_buchungen`.`nach_typ` AS `nach_typ`,`fibu_buchungen`.`nach_id` AS `nach_id`,`fibu_buchungen`.`datum` AS `datum`,'fibu_buchungen' AS `fibu_buchungen`,`fibu_buchungen`.`id` AS `id` from `fibu_buchungen` union select 'zubuchung' AS `zubuchung`,`fibu_buchungen`.`nach_typ` AS `nach_typ`,`fibu_buchungen`.`nach_id` AS `nach_id`,-`fibu_buchungen`.`betrag` AS `-``openxe``.``fibu_buchungen``.``betrag```,`fibu_buchungen`.`waehrung` AS `waehrung`,`fibu_buchungen`.`von_typ` AS `von_typ`,`fibu_buchungen`.`von_id` AS `von_id`,`fibu_buchungen`.`datum` AS `datum`,'fibu_buchungen' AS `fibu_buchungen`,`fibu_buchungen`.`id` AS `id` from `fibu_buchungen`) `fb` left join `fibu_objekte_view` on(`fb`.`gegen_typ` = `fibu_objekte_view`.`typ` and `fb`.`gegen_id` = `fibu_objekte_view`.`id`)) where `fb`.`datum` >= (select `firmendaten_werte`.`wert` from `firmendaten_werte` where `firmendaten_werte`.`name` = 'fibu_buchungen_startdatum') and `fibu_objekte_view`.`datum` >= (select `firmendaten_werte`.`wert` from `firmendaten_werte` where `firmendaten_werte`.`name` = 'fibu_buchungen_startdatum') or `fibu_objekte_view`.`datum` = ''"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
@ -1699,7 +1699,6 @@ if (typeof document.hidden !== \"undefined\") { // Opera 12.10 and Firefox 18 an
|
||||
FROM `beleg_chargesnmhd` s
|
||||
INNER JOIN lieferschein_position lp ON s.doctype = 'lieferschein' AND s.pos = lp.id AND s.type = 'sn' AND s.wert <> ''
|
||||
INNER JOIN lieferschein l ON lp.lieferschein = l.id AND l.status <> 'storniert'
|
||||
WHERE l.id NOT IN (SELECT lieferscheinid FROM retoure LIMIT 1)
|
||||
GROUP BY s.wert, lp.artikel
|
||||
)
|
||||
UNION ALL (
|
||||
@ -1708,7 +1707,7 @@ if (typeof document.hidden !== \"undefined\") { // Opera 12.10 and Firefox 18 an
|
||||
SELECT lp.artikel, s.seriennummer as wert , count(s.id) as anzahl, max(l.id) as lieferschein, max(l.belegnr) as belegnr
|
||||
FROM `seriennummern` s
|
||||
INNER JOIN lieferschein_position lp ON s.lieferscheinpos = lp.id
|
||||
INNER JOIN lieferschein l ON lp.lieferschein = l.id WHERE s.seriennummer <> '' AND l.id NOT IN (SELECT lieferscheinid FROM retoure LIMIT 1)
|
||||
INNER JOIN lieferschein l ON lp.lieferschein = l.id WHERE s.seriennummer <> ''
|
||||
GROUP BY s.seriennummer, lp.artikel
|
||||
|
||||
|
||||
|
@ -2676,7 +2676,7 @@ public function NavigationHooks(&$menu)
|
||||
// @refactor in Dateien Modul
|
||||
function AnzahlDateien($objekt,$id)
|
||||
{
|
||||
return $this->app->DB->Select("SELECT COUNT(id) FROM datei_stichwoerter WHERE objekt='$objekt' AND parameter='$id'");
|
||||
return $this->app->DB->Select("SELECT COUNT(ds.id) FROM datei_stichwoerter ds INNER JOIN datei d ON d.id = ds.datei WHERE ds.objekt='$objekt' AND ds.parameter='$id' AND d.geloescht <> 1");
|
||||
}
|
||||
|
||||
|
||||
@ -26851,7 +26851,9 @@ function Firmendaten($field,$projekt="")
|
||||
$tmp[$extra[$i]['type']] = $extra[$i]['bezeichnung'];
|
||||
}
|
||||
if($zahlungsweise && empty($tmp[$zahlungsweise]))$tmp[$zahlungsweise] = ucfirst($zahlungsweise);
|
||||
asort($tmp);
|
||||
if (!empty($tmp)) {
|
||||
asort($tmp);
|
||||
}
|
||||
return $tmp;
|
||||
// return array('rechnung'=>'Rechnung','vorkasse'=>'Vorkasse','nachnahme'=>'Nachnahme','kreditkarte'=>'Kreditkarte','einzugsermaechtigung'=>'Einzugsermaechtigung','bar'=>'Bar','paypal'=>'PayPal','lastschrift'=>'Lastschrift');
|
||||
}
|
||||
@ -35376,6 +35378,7 @@ function Firmendaten($field,$projekt="")
|
||||
{
|
||||
case 'bestellung':
|
||||
case 'anfrage':
|
||||
case 'verbindlichkeit':
|
||||
$aufwendung = true;
|
||||
break;
|
||||
}
|
||||
@ -37299,7 +37302,7 @@ function Firmendaten($field,$projekt="")
|
||||
|
||||
function GetDateiSubjektObjekt($subjekt,$objekt,$parameter)
|
||||
{
|
||||
$dateien = $this->app->DB->SelectArr("SELECT datei FROM datei_stichwoerter WHERE subjekt LIKE '$subjekt' AND objekt LIKE '$objekt' AND parameter='$parameter' GROUP by datei");
|
||||
$dateien = $this->app->DB->SelectArr("SELECT datei FROM datei_stichwoerter INNER JOIN datei d on d.id = datei WHERE subjekt LIKE '$subjekt' AND objekt LIKE '$objekt' AND parameter='$parameter' AND d.geloescht <> 1 GROUP by datei");
|
||||
if(empty($dateien)) {
|
||||
return null;
|
||||
}
|
||||
|
File diff suppressed because one or more lines are too long
@ -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; }
|
||||
|
||||
}
|
||||
|
@ -674,6 +674,7 @@ class Ajax {
|
||||
echo $str;
|
||||
exit;
|
||||
}
|
||||
|
||||
if(!empty($datei['parameter'])) {
|
||||
if($cmd === 'projekt') {
|
||||
if(!$this->app->erp->UserProjektRecht($datei['parameter'])) {
|
||||
@ -708,7 +709,6 @@ class Ajax {
|
||||
}
|
||||
}
|
||||
//Rechte prüfen
|
||||
|
||||
$userdata = isset($this->app->Conf->WFuserdata)
|
||||
?$this->app->Conf->WFuserdata
|
||||
:(str_replace('index.php', '', $_SERVER['SCRIPT_FILENAME']).'../userdata');
|
||||
@ -746,29 +746,12 @@ class Ajax {
|
||||
exit;
|
||||
break;
|
||||
case 'application/pdf':
|
||||
$str = file_get_contents(dirname(__DIR__) . '/themes/new/images/pdf.svg');
|
||||
$str = file_get_contents(dirname(__DIR__) . '/themes/new/images/pdf.png');
|
||||
header('Content-type: image/png');
|
||||
echo $str;
|
||||
exit;
|
||||
break;
|
||||
default:
|
||||
$str = file_get_contents(dirname(__DIR__) . '/themes/new/images/pdf.svg');
|
||||
if(substr(strtolower($datei['dateiname']),-4) === '.gif'){
|
||||
header('Content-type: image/gif');
|
||||
echo $str;
|
||||
exit;
|
||||
}
|
||||
if(substr(strtolower($datei['dateiname']),-4) === '.png'){
|
||||
header('Content-type: image/png');
|
||||
echo $str;
|
||||
exit;
|
||||
}
|
||||
if(substr(strtolower($datei['dateiname']),-4) === '.jpg'
|
||||
|| substr(strtolower($datei['dateiname']),-4) === 'jpeg'){
|
||||
header('Content-type: image/jpg');
|
||||
echo $str;
|
||||
exit;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -2379,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");
|
||||
@ -2458,6 +2448,7 @@ select a.kundennummer, (SELECT name FROM adresse a2 WHERE a2.kundennummer = a.ku
|
||||
$subwhere = $this->AjaxFilterWhere($termorig,$felder);
|
||||
|
||||
$arr = $this->app->DB->SelectArr("SELECT CONCAT(nummer,' ',beschreibung) as name FROM kostenstellen WHERE $subwhere ORDER by nummer");
|
||||
|
||||
$carr = !empty($arr)?count($arr):0;
|
||||
for($i = 0; $i < $carr; $i++)
|
||||
$newarr[] = $arr[$i]['name'];
|
||||
|
119
www/pages/content/kostenstellen_edit.tpl
Normal file
119
www/pages/content/kostenstellen_edit.tpl
Normal file
@ -0,0 +1,119 @@
|
||||
<div id="tabs">
|
||||
<ul>
|
||||
<li><a href="#tabs-1"></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">
|
||||
[FORMHANDLEREVENT]
|
||||
<div class="row">
|
||||
<div class="row-height">
|
||||
<div class="col-xs-12 col-md-12 col-md-height">
|
||||
<div class="inside inside-full-height">
|
||||
<fieldset>
|
||||
<legend>{|<!--Legend for this form area goes here>-->kostenstellen|}
|
||||
<table width="100%" border="0" class="mkTableFormular">
|
||||
<tr>
|
||||
<td>
|
||||
{|Nummer|}:
|
||||
</td>
|
||||
<td>
|
||||
<input type="text" name="nummer" id="nummer" value="[NUMMER]" size="20">
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
{|Beschreibung|}:
|
||||
</td>
|
||||
<td>
|
||||
<input type="text" name="beschreibung" id="beschreibung" value="[BESCHREIBUNG]" size="20">
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
{|Internebemerkung|}:
|
||||
</td>
|
||||
<td>
|
||||
<input type="text" name="internebemerkung" id="internebemerkung" value="[INTERNEBEMERKUNG]" size="20">
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
</table>
|
||||
</fieldset>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- Example for 2nd row
|
||||
<div class="row">
|
||||
<div class="row-height">
|
||||
<div class="col-xs-12 col-md-12 col-md-height">
|
||||
<div class="inside inside-full-height">
|
||||
<fieldset>
|
||||
<legend>{|Another legend|}</legend>
|
||||
<table width="100%" border="0" class="mkTableFormular">
|
||||
<tr>
|
||||
<td>
|
||||
{|Nummer|}:
|
||||
</td>
|
||||
<td>
|
||||
<input type="text" name="nummer" id="nummer" value="[NUMMER]" size="20">
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
{|Beschreibung|}:
|
||||
</td>
|
||||
<td>
|
||||
<input type="text" name="beschreibung" id="beschreibung" value="[BESCHREIBUNG]" size="20">
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
{|Internebemerkung|}:
|
||||
</td>
|
||||
<td>
|
||||
<input type="text" name="internebemerkung" id="internebemerkung" value="[INTERNEBEMERKUNG]" size="20">
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
</table>
|
||||
</fieldset>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div> -->
|
||||
<input type="submit" name="submit" value="Speichern" style="float:right"/>
|
||||
</form>
|
||||
</div>
|
||||
<!-- Example for 2nd tab
|
||||
<div id="tabs-2">
|
||||
[MESSAGE]
|
||||
<form action="" method="post">
|
||||
[FORMHANDLEREVENT]
|
||||
<div class="row">
|
||||
<div class="row-height">
|
||||
<div class="col-xs-12 col-md-12 col-md-height">
|
||||
<div class="inside inside-full-height">
|
||||
<fieldset>
|
||||
<legend>{|...|}</legend>
|
||||
<table width="100%" border="0" class="mkTableFormular">
|
||||
...
|
||||
</table>
|
||||
</fieldset>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<input type="submit" name="submit" value="Speichern" style="float:right"/>
|
||||
</form>
|
||||
</div>
|
||||
-->
|
||||
</div>
|
||||
|
10
www/pages/content/kostenstellen_list.tpl
Normal file
10
www/pages/content/kostenstellen_list.tpl
Normal file
@ -0,0 +1,10 @@
|
||||
<div id="tabs">
|
||||
<ul>
|
||||
<li><a href="#tabs-1">[TABTEXT1]</a></li>
|
||||
</ul>
|
||||
<div id="tabs-1">
|
||||
[MESSAGE]
|
||||
[TAB1]
|
||||
[TAB1NEXT]
|
||||
</div>
|
||||
</div>
|
208
www/pages/content/verbindlichkeit_edit.tpl
Normal file
208
www/pages/content/verbindlichkeit_edit.tpl
Normal file
@ -0,0 +1,208 @@
|
||||
<div id="tabs">
|
||||
<ul>
|
||||
<li><a href="#tabs-1">Details</a></li>
|
||||
<!-- <li><a href="#tabs-2">Positionen</a></li> -->
|
||||
<li><a href="#tabs-3">Protokoll</a></li>
|
||||
</ul>
|
||||
<div id="tabs-1">
|
||||
[MESSAGE]
|
||||
<form action="" method="post">
|
||||
[FORMHANDLEREVENT]
|
||||
<div class="row">
|
||||
<div class="row-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 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>
|
||||
<fieldset style="float: right;">
|
||||
<input type="submit" name="submit" value="Speichern"/>
|
||||
</fieldset>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<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>
|
||||
<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" [SAVEDISABLED] required>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
{|Rechnungs-Nr.|}:
|
||||
</td>
|
||||
<td>
|
||||
<input type="text" name="rechnung" id="rechnung" value="[RECHNUNG]" size="20" [SAVEDISABLED] required>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
{|Rechnungsdatum|}:
|
||||
</td>
|
||||
<td>
|
||||
<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 brutto|}:
|
||||
</td>
|
||||
<td>
|
||||
<input type="number" step="0.01" name="betrag" id="betrag" value="[BETRAG]" size="20" [SAVEDISABLED]>
|
||||
<select name="waehrung" [SAVEDISABLED]>[WAEHRUNGSELECT]</select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr hidden>
|
||||
<td>
|
||||
{|Betrag Positionen brutto|}:
|
||||
</td>
|
||||
<td>
|
||||
<input type="number" step="0.01" name="betragbruttopos" id="betragbruttopos" value="[BETRAGBRUTTOPOS]" size="20" disabled>
|
||||
</td>
|
||||
</tr>
|
||||
<tr hidden>
|
||||
<td>
|
||||
{|Betrag Positionen netto|}:
|
||||
</td>
|
||||
<td>
|
||||
<input type="number" step="0.01" 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" [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="wareneingang" value="1" [WARENEINGANGCHECKED] size="20" disabled>
|
||||
<a href="index.php?module=verbindlichkeit&action=freigabeeinkauf&id=[ID]" title="freigeben" [FREIGABEEINKAUFHIDDEN]><img src="themes/new/images/forward.svg" border="0" class="textfeld_icon"></a>
|
||||
<a href="index.php?module=verbindlichkeit&action=ruecksetzeneinkauf&id=[ID]" title="rücksetzen" [RUECKSETZENEINKAUFHIDDEN]><img src="themes/new/images/delete.svg" border="0" class="textfeld_icon"></a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
{|Rechnungseingangsprüfung (Buchhaltung)|}:
|
||||
</td>
|
||||
<td>
|
||||
<input type="checkbox" id="rechnungsfreigabe" [RECHNUNGSFREIGABECHECKED] size="20" disabled>
|
||||
<a href="index.php?module=verbindlichkeit&action=freigabebuchhaltung&id=[ID]" title="freigeben" [FREIGABEBUCHHALTUNGHIDDEN]><img src="themes/new/images/forward.svg" border="0" class="textfeld_icon"></a>
|
||||
<a href="index.php?module=verbindlichkeit&action=ruecksetzenbuchhaltung&id=[ID]" title="rücksetzen" [RUECKSETZENBUCHHALTUNGHIDDEN]><img src="themes/new/images/delete.svg" border="0" class="textfeld_icon"></a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
{|Bezahlt|}:
|
||||
</td>
|
||||
<td>
|
||||
<input type="checkbox" id="zahlungsstatus" [BEZAHLTCHECKED] size="20" disabled>
|
||||
<a href="index.php?module=verbindlichkeit&action=freigabebezahlt&id=[ID]" title="auf 'bezahlt' setzen" [FREIGABEBEZAHLTHIDDEN]><img src="themes/new/images/forward.svg" border="0" class="textfeld_icon"></a>
|
||||
<a href="index.php?module=verbindlichkeit&action=ruecksetzenbezahlt&id=[ID]" title="rücksetzen" [RUECKSETZENBEZAHLTHIDDEN]><img src="themes/new/images/delete.svg" border="0" class="textfeld_icon"></a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
{|Projekt|}:
|
||||
</td>
|
||||
<td>
|
||||
<input type="text" name="projekt" id="projekt" value="[PROJEKT]" size="20">
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
{|Kostenstelle|}:
|
||||
</td>
|
||||
<td>
|
||||
<input type="text" name="kostenstelle" id="kostenstelle" value="[KOSTENSTELLE]" size="20">
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
{|Internebemerkung|}:
|
||||
</td>
|
||||
<td>
|
||||
<textarea name="internebemerkung" id="internebemerkung" rows="6" style="width:100%;">[INTERNEBEMERKUNG]</textarea>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</fieldset>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xs-12 col-md-6 col-md-height">
|
||||
<div class="inside inside-full-height">
|
||||
<fieldset>
|
||||
<legend>{|Vorschau|}</legend>
|
||||
[INLINEPDF]
|
||||
</fieldset>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<!--
|
||||
<div id="tabs-2">
|
||||
[POS]
|
||||
</div>
|
||||
-->
|
||||
<div id="tabs-3">
|
||||
[MINIDETAIL]
|
||||
</div>
|
||||
</div>
|
||||
|
72
www/pages/content/verbindlichkeit_list.tpl
Normal file
72
www/pages/content/verbindlichkeit_list.tpl
Normal file
@ -0,0 +1,72 @@
|
||||
<div id="tabs">
|
||||
<ul>
|
||||
<li><a href="#tabs-1">[TABTEXT1]</a></li>
|
||||
</ul>
|
||||
<div id="tabs-1">
|
||||
[MESSAGE]
|
||||
|
||||
<div class="filter-box filter-usersave">
|
||||
<div class="filter-block filter-inline">
|
||||
<div class="filter-title">{|Filter|}</div>
|
||||
<ul class="filter-list">
|
||||
<li class="filter-item">
|
||||
<label for="wareneingang" class="switch">
|
||||
<input type="checkbox" id="wareneingang">
|
||||
<span class="slider round"></span>
|
||||
</label>
|
||||
<label for="wareneingang">{|Wareingang/Leistungsprüfung fehlt|}</label>
|
||||
</li>
|
||||
<li class="filter-item">
|
||||
<label for="rechnungsfreigabe" class="switch">
|
||||
<input type="checkbox" id="rechnungsfreigabe">
|
||||
<span class="slider round"></span>
|
||||
</label>
|
||||
<label for="rechnungsfreigabe">{|Rechnungseingangsprüfung fehlt|}</label>
|
||||
</li>
|
||||
<li class="filter-item">
|
||||
<label for="nichtbezahlt" class="switch">
|
||||
<input type="checkbox" id="nichtbezahlt">
|
||||
<span class="slider round"></span>
|
||||
</label>
|
||||
<label for="nichtbezahlt">{|Nicht bezahlt|}</label>
|
||||
</li>
|
||||
<li class="filter-item">
|
||||
<label for="zahlbarbis">{|Zahlbar bis|}:</label>
|
||||
<input type="text" name="zahlbarbis" id="zahlbarbis" size="10">
|
||||
</li>
|
||||
<li class="filter-item">
|
||||
<label for="skontobis">{|Skonto bis|}:</label>
|
||||
<input type="text" name="skontobis" id="skontobis" size="10">
|
||||
</li>
|
||||
</ul>
|
||||
<form method="post" action="#" hidden>
|
||||
<input type="submit" class="btnBlue" name="status_berechnen" value="{|Status berechnen|}" />
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<form method="post" action="#">
|
||||
[TAB1]
|
||||
<fieldset><legend>{|Stapelverarbeitung|}</legend>
|
||||
<input type="checkbox" id="auswahlalle" onchange="alleauswaehlen();" /> {|alle markieren|}
|
||||
<select id="sel_aktion" name="sel_aktion">
|
||||
<option value="">{|bitte wählen|} ...</option>
|
||||
[MANUELLFREIGABEEINKAUF]
|
||||
[MANUELLFREIGABEBUCHHALTUNG]
|
||||
[ALSBEZAHLTMARKIEREN]
|
||||
</select>
|
||||
<input type="submit" class="btnBlue" name="ausfuehren" value="{|ausführen|}" />
|
||||
</fieldset>
|
||||
</form>
|
||||
[TAB1NEXT]
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
function alleauswaehlen()
|
||||
{
|
||||
var wert = $('#auswahlalle').prop('checked');
|
||||
$('#verbindlichkeit_list').find(':checkbox').prop('checked',wert);
|
||||
}
|
||||
|
||||
</script>
|
@ -1,176 +1,76 @@
|
||||
|
||||
[FORMHANDLEREVENT]
|
||||
[MESSAGE]
|
||||
|
||||
<table class="tableborder" border="0" cellpadding="3" cellspacing="0" width="100%">
|
||||
<tbody>
|
||||
<tr valign="top" colspan="3">
|
||||
<td >
|
||||
<fieldset><legend>{|Rechnungsdaten|}</legend>
|
||||
|
||||
<style>
|
||||
.auftraginfo_cell {
|
||||
color: #636363;border: 1px solid #ccc;padding: 5px;
|
||||
}
|
||||
.auftrag_cell {
|
||||
color: #636363;border: 1px solid #fff;padding: 0px; margin:0px;
|
||||
}
|
||||
</style>
|
||||
<div style="float:left; width:49%; padding-right:1%;">
|
||||
<table width="100%" border="0">
|
||||
<tr valign="top"><td width="150">Lieferant:</td><td>[ADRESSEAUTOSTART][ADRESSE][MSGADRESSE][ADRESSEAUTOEND]</td>
|
||||
<td> </td>
|
||||
<td colspan="2" rowspan="2" align="center"><b style="color:green">[MELDUNG]</b>
|
||||
<br><font size="7">[VERBINDLICHKEIT]</font>
|
||||
</td></tr>
|
||||
|
||||
<tr><td><br><br>Rechnungs Nr.:</td><td><br><br>[RECHNUNG][MSGRECHNUNG]</td>
|
||||
<td> </td>
|
||||
</tr>
|
||||
|
||||
<tr><td>Bestellung:</td><td width="250">[DISABLESTART]<a href="index.php?module=bestellung&action=edit&id=[BESTELLUNGID]" target="_blank">[BESTELLUNG]</a>[MSGBESTELLUNG][MULTIBESTELLUNG][DISABLEENDE]</td>
|
||||
<td> </td>
|
||||
<td width="200">Zahlweise:</td><td>[ZAHLUNGSWEISE][MSGZAHLUNGSWEISE]</td></tr>
|
||||
|
||||
<tr><td>Rechnungsdatum:</td><td width="250">[RECHNUNGSDATUM][MSGRECHNUNGSDATUM]</td>
|
||||
<td> </td>
|
||||
<td width="200">Zahlbar bis:</td><td>[ZAHLBARBIS][MSGZAHLBARBIS][DATUM_ZAHLBARBIS]</td></tr>
|
||||
|
||||
<tr><td>Betrag/Total (Brutto):</td><td>[BETRAG][MSGBETRAG] [WAEHRUNG][MSGWAEHRUNG]</td><td> </td>
|
||||
<td>Skonto in %:</td><td>[SKONTO][MSGSKONTO]</td>
|
||||
</tr>
|
||||
|
||||
<tr><td>USt. 19%:</td><td>[SUMMENORMAL][MSGSUMMENORMAL]</td><td> </td>
|
||||
<td>Skonto bis:</td><td>[SKONTOBIS][MSGSKONTOBIS][DATUM_SKONTOBIS]</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>USt. 7%:</td><td>[SUMMEERMAESSIGT][MSGSUMMEERMAESSIGT]</td>
|
||||
<td> </td>
|
||||
<td>Umsatzsteuer</td><td>[UMSATZSTEUER][MSGUMSATZSTEUER]</td>
|
||||
|
||||
</tr>
|
||||
<tr>
|
||||
<td>[STEUERSATZNAME3]</td><td>[SUMMESATZ3][MSGSUMMESATZ3]</td>
|
||||
<td> </td>
|
||||
<td>[STEUERSATZNAME4]</td><td>[SUMMESATZ4][MSGSUMMESATZ4]</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Verwendungszweck:</td><td>[VERWENDUNGSZWECK][MSGVERWENDUNGSZWECK]</td>
|
||||
<td> </td>
|
||||
<td>Frachtkosten:</td><td>[FRACHTKOSTEN][MSGFRACHTKOSTEN]</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>Projekt:</td><td>[PROJEKT][MSGKOSTENSTELLE]</td>
|
||||
<td> </td>
|
||||
<td></td><td></td>
|
||||
</tr>
|
||||
|
||||
|
||||
<tr>
|
||||
<td>Kostenstelle:</td><td>[KOSTENSTELLE][MSGKOSTENSTELLE]</td>
|
||||
<td> </td>
|
||||
<td>Freigabe:</td><td>[MSGFREIGABE] <i>Wareneingangsprüfung:</i> [FREIGABE] [MSGRECHNUNGSFREIGABE] <i>Rechnungseingangsprüfung:</i> [RECHNUNGSFREIGABE]</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>Sachkonto:</td><td>[SACHKONTO][MSGSACHKONTO]</td>
|
||||
<td> </td>
|
||||
<td>Aktion:</td><td>[BUTTONBEZAHLT]</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Interne Bemerkung:</td><td colspan="4">[INTERNEBEMERKUNG]</td>
|
||||
</tr>
|
||||
|
||||
|
||||
|
||||
|
||||
</table>
|
||||
|
||||
|
||||
|
||||
</fieldset>
|
||||
</td></tr>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
|
||||
<table class="tableborder" border="0" cellpadding="3" cellspacing="0" width="100%">
|
||||
<tr valign="top"><td width="50%">
|
||||
<table cellspacing="5" width="100%">
|
||||
<!--<tr><td><b>Bestellung</b></td><td><b>Bestell-Nr.</b></td><td><b>Teilbetrag</b></td><td><b>Projekt</b></td><td><b>Kostenstelle</b></td><td><b>Bemerkung</b></td></tr>
|
||||
<tr><td>Nr. 1</td><td><a href="index.php?module=bestellung&action=edit&id=[BESTELLUNGID1]" target="_blank">[BESTELLUNG1]</a>[MSGBESTELLUNG1]</td><td>[BESTELLUNG1BETRAG][MSGBESTELLUNG1BETRAG]</td>
|
||||
<td>[BESTELLUNG1PROJEKT]</td><td>[BESTELLUNG1KOSTENSTELLE]</td>
|
||||
<td>[BESTELLUNG1BEMERKUNG][MSGBESTELLUNG1BEMERKUNG]</td></tr>
|
||||
<tr><td>Nr. 2</td><td><a href="index.php?module=bestellung&action=edit&id=[BESTELLUNGID2]" target="_blank">[BESTELLUNG2]</a>[MSGBESTELLUNG2]</td><td>[BESTELLUNG2BETRAG][MSGBESTELLUNG2BETRAG]</td>
|
||||
<td>[BESTELLUNG2PROJEKT]</td><td>[BESTELLUNG2KOSTENSTELLE]</td>
|
||||
<td>[BESTELLUNG2BEMERKUNG][MSGBESTELLUNG2BEMERKUNG]</td></tr>
|
||||
<tr><td>Nr. 3</td><td><a href="index.php?module=bestellung&action=edit&id=[BESTELLUNGID3]" target="_blank">[BESTELLUNG3]</a>[MSGBESTELLUNG3]</td><td>[BESTELLUNG3BETRAG][MSGBESTELLUNG3BETRAG]</td>
|
||||
<td>[BESTELLUNG3PROJEKT]</td><td>[BESTELLUNG3KOSTENSTELLE]</td>
|
||||
<td>[BESTELLUNG3BEMERKUNG][MSGBESTELLUNG3BEMERKUNG]</td></tr>
|
||||
<tr><td>Nr. 4</td><td><a href="index.php?module=bestellung&action=edit&id=[BESTELLUNGID4]" target="_blank">[BESTELLUNG4]</a>[MSGBESTELLUNG4]</td><td>[BESTELLUNG4BETRAG][MSGBESTELLUNG4BETRAG]</td>
|
||||
<td>[BESTELLUNG4PROJEKT]</td><td>[BESTELLUNG4KOSTENSTELLE]</td>
|
||||
<td>[BESTELLUNG4BEMERKUNG][MSGBESTELLUNG4BEMERKUNG]</td></tr>
|
||||
<tr><td>Nr. 5</td><td><a href="index.php?module=bestellung&action=edit&id=[BESTELLUNGID5]" target="_blank">[BESTELLUNG5]</a>[MSGBESTELLUNG5]</td><td>[BESTELLUNG5BETRAG][MSGBESTELLUNG5BETRAG]</td>
|
||||
<td>[BESTELLUNG5PROJEKT]</td><td>[BESTELLUNG5KOSTENSTELLE]</td>
|
||||
<td>[BESTELLUNG5BEMERKUNG][MSGBESTELLUNG5BEMERKUNG]</td></tr>
|
||||
<tr><td>Nr. 6</td><td><a href="index.php?module=bestellung&action=edit&id=[BESTELLUNGID6]" target="_blank">[BESTELLUNG6]</a>[MSGBESTELLUNG6]</td><td>[BESTELLUNG6BETRAG][MSGBESTELLUNG6BETRAG]</td>
|
||||
<td>[BESTELLUNG6PROJEKT]</td><td>[BESTELLUNG6KOSTENSTELLE]</td>
|
||||
<td>[BESTELLUNG6BEMERKUNG][MSGBESTELLUNG6BEMERKUNG]</td></tr>
|
||||
<tr><td>Nr. 7</td><td><a href="index.php?module=bestellung&action=edit&id=[BESTELLUNGID7]" target="_blank">[BESTELLUNG7]</a>[MSGBESTELLUNG7]</td><td>[BESTELLUNG7BETRAG][MSGBESTELLUNG7BETRAG]</td>
|
||||
<td>[BESTELLUNG7PROJEKT]</td><td>[BESTELLUNG7KOSTENSTELLE]</td>
|
||||
<td>[BESTELLUNG7BEMERKUNG][MSGBESTELLUNG7BEMERKUNG]</td></tr>
|
||||
<tr><td>Nr. 8</td><td><a href="index.php?module=bestellung&action=edit&id=[BESTELLUNGID8]" target="_blank">[BESTELLUNG8]</a>[MSGBESTELLUNG8]</td><td>[BESTELLUNG8BETRAG][MSGBESTELLUNG8BETRAG]</td>
|
||||
<td>[BESTELLUNG8PROJEKT]</td><td>[BESTELLUNG8KOSTENSTELLE]</td>
|
||||
<td>[BESTELLUNG8BEMERKUNG][MSGBESTELLUNG8BEMERKUNG]</td></tr>
|
||||
<tr><td>Nr. 9</td><td><a href="index.php?module=bestellung&action=edit&id=[BESTELLUNGID9]" target="_blank">[BESTELLUNG9]</a>[MSGBESTELLUNG9]</td><td>[BESTELLUNG9BETRAG][MSGBESTELLUNG9BETRAG]</td>
|
||||
<td>[BESTELLUNG9PROJEKT]</td><td>[BESTELLUNG9KOSTENSTELLE]</td>
|
||||
<td>[BESTELLUNG9BEMERKUNG][MSGBESTELLUNG9BEMERKUNG]</td></tr>
|
||||
<tr><td>Nr. 10</td><td><a href="index.php?module=bestellung&action=edit&id=[BESTELLUNGID10]" target="_blank">[BESTELLUNG10]</a>[MSGBESTELLUNG10]</td><td>[BESTELLUNG10BETRAG][MSGBESTELLUNG10BETRAG]</td>
|
||||
<td>[BESTELLUNG10PROJEKT]</td><td>[BESTELLUNG10KOSTENSTELLE]</td>
|
||||
<td>[BESTELLUNG10BEMERKUNG][MSGBESTELLUNG10BEMERKUNG]</td></tr>
|
||||
<tr><td>Nr. 11</td><td><a href="index.php?module=bestellung&action=edit&id=[BESTELLUNGID11]" target="_blank">[BESTELLUNG11]</a>[MSGBESTELLUNG11]</td><td>[BESTELLUNG11BETRAG][MSGBESTELLUNG11BETRAG]</td>
|
||||
<td>[BESTELLUNG11PROJEKT]</td><td>[BESTELLUNG11KOSTENSTELLE]</td>
|
||||
<td>[BESTELLUNG11BEMERKUNG][MSGBESTELLUNG11BEMERKUNG]</td></tr>
|
||||
<tr><td>Nr. 12</td><td><a href="index.php?module=bestellung&action=edit&id=[BESTELLUNGID12]" target="_blank">[BESTELLUNG12]</a>[MSGBESTELLUNG12]</td><td>[BESTELLUNG12BETRAG][MSGBESTELLUNG12BETRAG]</td>
|
||||
<td>[BESTELLUNG12PROJEKT]</td><td>[BESTELLUNG12KOSTENSTELLE]</td>
|
||||
<td>[BESTELLUNG12BEMERKUNG][MSGBESTELLUNG12BEMERKUNG]</td></tr>
|
||||
<tr><td>Nr. 13</td><td><a href="index.php?module=bestellung&action=edit&id=[BESTELLUNGID13]" target="_blank">[BESTELLUNG13]</a>[MSGBESTELLUNG13]</td><td>[BESTELLUNG13BETRAG][MSGBESTELLUNG13BETRAG]</td>
|
||||
<td>[BESTELLUNG13PROJEKT]</td><td>[BESTELLUNG13KOSTENSTELLE]</td>
|
||||
<td>[BESTELLUNG13BEMERKUNG][MSGBESTELLUNG13BEMERKUNG]</td></tr>
|
||||
<tr><td>Nr. 14</td><td><a href="index.php?module=bestellung&action=edit&id=[BESTELLUNGID14]" target="_blank">[BESTELLUNG14]</a>[MSGBESTELLUNG14]</td><td>[BESTELLUNG14BETRAG][MSGBESTELLUNG14BETRAG]</td>
|
||||
<td>[BESTELLUNG14PROJEKT]</td><td>[BESTELLUNG14KOSTENSTELLE]</td>
|
||||
<td>[BESTELLUNG14BEMERKUNG][MSGBESTELLUNG14BEMERKUNG]</td></tr>
|
||||
<tr><td>Nr. 15</td><td><a href="index.php?module=bestellung&action=edit&id=[BESTELLUNGID15]" target="_blank">[BESTELLUNG15]</a>[MSGBESTELLUNG15]</td><td>[BESTELLUNG15BETRAG][MSGBESTELLUNG15BETRAG]</td>
|
||||
<td>[BESTELLUNG15PROJEKT]</td><td>[BESTELLUNG15KOSTENSTELLE]</td>
|
||||
<td>[BESTELLUNG15BEMERKUNG][MSGBESTELLUNG15BEMERKUNG]</td></tr>-->
|
||||
|
||||
[TABELLEBESTELLUNGEN]
|
||||
|
||||
</table>
|
||||
</td>
|
||||
|
||||
|
||||
<td>
|
||||
|
||||
<table width="100%>">
|
||||
<tr><td>Summe Verbindlichkeit</td><td>Summe Kontierung</td></tr>
|
||||
<tr>
|
||||
<td class="greybox" width="25%">[SUMMEVERBINDLICHKEIT]</td>
|
||||
<td class="greybox" width="25%">[SUMMEKONTIERUNG]</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
[MESSAGEVORKONTIERUNG]
|
||||
[VORKONTIERUNG]
|
||||
[ZAHLUNGEN]
|
||||
|
||||
<div style="background-color:white">
|
||||
<h2 class="greyh2">{|Protokoll|}</h2>
|
||||
<div style="padding:10px">
|
||||
[PROTOKOLL]
|
||||
<tr valign="top">
|
||||
<td width="150">Lieferant:</td>
|
||||
<td colspan="3">[ADRESSEAUTOSTART][ADRESSE][MSGADRESSE][ADRESSEAUTOEND]</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Rechnungs-Nr.:</td>
|
||||
<td>[RECHNUNG][MSGRECHNUNG]</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Rechnungsdatum:</td>
|
||||
<td width="250">[RECHNUNGSDATUM][MSGRECHNUNGSDATUM]</td>
|
||||
<tr>
|
||||
</tr>
|
||||
</tr>
|
||||
<td width="200">Zahlbar bis:</td>
|
||||
<td>[ZAHLBARBIS][MSGZAHLBARBIS][DATUM_ZAHLBARBIS]</td>
|
||||
</tr>
|
||||
<td>Betrag/Total (Brutto):</td>
|
||||
<td>[BETRAG][MSGBETRAG] [WAEHRUNG][MSGWAEHRUNG]</td>
|
||||
<tr>
|
||||
<td>Skonto in %:</td>
|
||||
<td>[SKONTO][MSGSKONTO]</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Skonto bis:</td>
|
||||
<td>[SKONTOBIS][MSGSKONTOBIS][DATUM_SKONTOBIS]</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Projekt:</td>
|
||||
<td>[PROJEKT][MSGKOSTENSTELLE]</td>
|
||||
<td> </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Kostenstelle:</td>
|
||||
<td>[KOSTENSTELLE][MSGKOSTENSTELLE]</td>
|
||||
<td> </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Interne Bemerkung:</td>
|
||||
<td colspan="4">[INTERNEBEMERKUNG]</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<div style="float:left; width:50%">
|
||||
<div style="background-color:white">
|
||||
<h2 class="greyh2">Artikel</h2>
|
||||
<div style="padding:10px">
|
||||
[ARTIKEL]
|
||||
</div>
|
||||
</div>
|
||||
<div style="background-color:white">
|
||||
<h2 class="greyh2">Buchungen</h2>
|
||||
<div style="padding:10px">
|
||||
[ZAHLUNGEN]
|
||||
</div>
|
||||
</div>
|
||||
<div style="background-color:white">
|
||||
<h2 class="greyh2">Protokoll</h2>
|
||||
<div style="padding:10px;">
|
||||
[PROTOKOLL]
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</td>
|
||||
|
||||
|
||||
</tr>
|
||||
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
|
207
www/pages/kostenstellen.php
Normal file
207
www/pages/kostenstellen.php
Normal file
@ -0,0 +1,207 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* Copyright (c) 2022 OpenXE project
|
||||
*/
|
||||
|
||||
use Xentral\Components\Database\Exception\QueryFailureException;
|
||||
|
||||
class Kostenstellen {
|
||||
|
||||
function __construct($app, $intern = false) {
|
||||
$this->app = $app;
|
||||
if ($intern)
|
||||
return;
|
||||
|
||||
$this->app->ActionHandlerInit($this);
|
||||
$this->app->ActionHandler("list", "kostenstellen_list");
|
||||
$this->app->ActionHandler("create", "kostenstellen_edit"); // This automatically adds a "New" button
|
||||
$this->app->ActionHandler("edit", "kostenstellen_edit");
|
||||
$this->app->ActionHandler("delete", "kostenstellen_delete");
|
||||
$this->app->DefaultActionHandler("list");
|
||||
$this->app->ActionHandlerListen($app);
|
||||
}
|
||||
|
||||
public function Install() {
|
||||
/* Fill out manually later */
|
||||
}
|
||||
|
||||
static function TableSearch(&$app, $name, $erlaubtevars) {
|
||||
switch ($name) {
|
||||
case "kostenstellen_list":
|
||||
$allowed['kostenstellen_list'] = array('list');
|
||||
$heading = array('','','Nummer', 'Beschreibung', 'Internebemerkung', 'Menü');
|
||||
$width = array('1%','1%','10%'); // Fill out manually later
|
||||
|
||||
// columns that are aligned right (numbers etc)
|
||||
// $alignright = array(4,5,6,7,8);
|
||||
|
||||
$findcols = array('k.id','k.id','k.nummer', 'k.beschreibung', 'k.internebemerkung');
|
||||
$searchsql = array('k.nummer', 'k.beschreibung', 'k.internebemerkung');
|
||||
|
||||
$defaultorder = 1;
|
||||
$defaultorderdesc = 0;
|
||||
$aligncenter = array();
|
||||
$alignright = array();
|
||||
$numbercols = array();
|
||||
$sumcol = array();
|
||||
|
||||
$dropnbox = "'<img src=./themes/new/images/details_open.png class=details>' AS `open`, CONCAT('<input type=\"checkbox\" name=\"auswahl[]\" value=\"',k.id,'\" />') AS `auswahl`";
|
||||
|
||||
// $moreinfo = true; // Allow drop down details
|
||||
// $moreinfoaction = "lieferschein"; // specify suffix for minidetail-URL to allow different minidetails
|
||||
// $menucol = 11; // Set id col for moredata/menu
|
||||
|
||||
$menu = "<table cellpadding=0 cellspacing=0><tr><td nowrap>" . "<a href=\"index.php?module=kostenstellen&action=edit&id=%value%\"><img src=\"./themes/{$app->Conf->WFconf['defaulttheme']}/images/edit.svg\" border=\"0\"></a> <a href=\"#\" onclick=DeleteDialog(\"index.php?module=kostenstellen&action=delete&id=%value%\");>" . "<img src=\"themes/{$app->Conf->WFconf['defaulttheme']}/images/delete.svg\" border=\"0\"></a>" . "</td></tr></table>";
|
||||
|
||||
$sql = "SELECT SQL_CALC_FOUND_ROWS k.id, $dropnbox, k.nummer, k.beschreibung, k.internebemerkung, k.id FROM kostenstellen k";
|
||||
|
||||
$where = "1";
|
||||
$count = "SELECT count(DISTINCT id) FROM kostenstellen WHERE $where";
|
||||
// $groupby = "";
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
$erg = false;
|
||||
|
||||
foreach ($erlaubtevars as $k => $v) {
|
||||
if (isset($$v)) {
|
||||
$erg[$v] = $$v;
|
||||
}
|
||||
}
|
||||
return $erg;
|
||||
}
|
||||
|
||||
function kostenstellen_list() {
|
||||
$this->app->erp->MenuEintrag("index.php?module=kostenstellen&action=list", "Übersicht");
|
||||
$this->app->erp->MenuEintrag("index.php?module=kostenstellen&action=create", "Neu anlegen");
|
||||
|
||||
$this->app->erp->MenuEintrag("index.php", "Zurück");
|
||||
|
||||
$this->app->YUI->TableSearch('TAB1', 'kostenstellen_list', "show", "", "", basename(__FILE__), __CLASS__);
|
||||
$this->app->Tpl->Parse('PAGE', "kostenstellen_list.tpl");
|
||||
}
|
||||
|
||||
public function kostenstellen_delete() {
|
||||
$id = (int) $this->app->Secure->GetGET('id');
|
||||
|
||||
$this->app->DB->Delete("DELETE FROM `kostenstellen` WHERE `id` = '{$id}'");
|
||||
$this->app->Tpl->Set('MESSAGE', "<div class=\"error\">Der Eintrag wurde gelöscht.</div>");
|
||||
|
||||
$this->kostenstellen_list();
|
||||
}
|
||||
|
||||
/*
|
||||
* Edit kostenstellen item
|
||||
* If id is empty, create a new one
|
||||
*/
|
||||
|
||||
function kostenstellen_edit() {
|
||||
$id = $this->app->Secure->GetGET('id');
|
||||
|
||||
// Check if other users are editing this id
|
||||
if($this->app->erp->DisableModul('artikel',$id))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
$this->app->Tpl->Set('ID', $id);
|
||||
|
||||
$this->app->erp->MenuEintrag("index.php?module=kostenstellen&action=edit&id=$id", "Details");
|
||||
$this->app->erp->MenuEintrag("index.php?module=kostenstellen&action=list", "Zurück zur Übersicht");
|
||||
$id = $this->app->Secure->GetGET('id');
|
||||
$input = $this->GetInput();
|
||||
$submit = $this->app->Secure->GetPOST('submit');
|
||||
|
||||
if (empty($id)) {
|
||||
// New item
|
||||
$id = 'NULL';
|
||||
}
|
||||
|
||||
if ($submit != '')
|
||||
{
|
||||
|
||||
// Write to database
|
||||
|
||||
// Add checks here
|
||||
|
||||
// $input['projekt'] = $this->app->erp->ReplaceProjekt(true,$input['projekt'],true); // Parameters: Target db?, value, from form?
|
||||
|
||||
$columns = "id, ";
|
||||
$values = "$id, ";
|
||||
$update = "";
|
||||
|
||||
$fix = "";
|
||||
|
||||
foreach ($input as $key => $value) {
|
||||
$columns = $columns.$fix.$key;
|
||||
$values = $values.$fix."'".$value."'";
|
||||
$update = $update.$fix.$key." = '$value'";
|
||||
|
||||
$fix = ", ";
|
||||
}
|
||||
|
||||
// echo($columns."<br>");
|
||||
// echo($values."<br>");
|
||||
// echo($update."<br>");
|
||||
|
||||
$sql = "INSERT INTO kostenstellen (".$columns.") VALUES (".$values.") ON DUPLICATE KEY UPDATE ".$update;
|
||||
|
||||
// echo($sql);
|
||||
|
||||
$this->app->DB->Update($sql);
|
||||
|
||||
if ($id == 'NULL') {
|
||||
$msg = $this->app->erp->base64_url_encode("<div class=\"success\">Das Element wurde erfolgreich angelegt.</div>");
|
||||
header("Location: index.php?module=kostenstellen&action=list&msg=$msg");
|
||||
} else {
|
||||
$this->app->Tpl->Set('MESSAGE', "<div class=\"success\">Die Einstellungen wurden erfolgreich übernommen.</div>");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Load values again from database
|
||||
$dropnbox = "'<img src=./themes/new/images/details_open.png class=details>' AS `open`, CONCAT('<input type=\"checkbox\" name=\"auswahl[]\" value=\"',k.id,'\" />') AS `auswahl`";
|
||||
$result = $this->app->DB->SelectArr("SELECT SQL_CALC_FOUND_ROWS k.id, $dropnbox, k.nummer, k.beschreibung, k.internebemerkung, k.id FROM kostenstellen k"." WHERE id=$id");
|
||||
|
||||
foreach ($result[0] as $key => $value) {
|
||||
$this->app->Tpl->Set(strtoupper($key), $value);
|
||||
}
|
||||
|
||||
if (!empty($result)) {
|
||||
$kostenstellen_from_db = $result[0];
|
||||
} else {
|
||||
return;
|
||||
}
|
||||
|
||||
/*
|
||||
* Add displayed items later
|
||||
*
|
||||
|
||||
$this->app->Tpl->Add('KURZUEBERSCHRIFT2', $email);
|
||||
$this->app->Tpl->Add('EMAIL', $email);
|
||||
$this->app->Tpl->Add('ANGEZEIGTERNAME', $angezeigtername);
|
||||
|
||||
$this->app->YUI->AutoComplete("artikel", "artikelnummer");
|
||||
|
||||
*/
|
||||
|
||||
$this->app->Tpl->Parse('PAGE', "kostenstellen_edit.tpl");
|
||||
}
|
||||
|
||||
/**
|
||||
* Get all paramters from html form and save into $input
|
||||
*/
|
||||
public function GetInput(): array {
|
||||
$input = array();
|
||||
//$input['EMAIL'] = $this->app->Secure->GetPOST('email');
|
||||
|
||||
$input['nummer'] = $this->app->Secure->GetPOST('nummer');
|
||||
$input['beschreibung'] = $this->app->Secure->GetPOST('beschreibung');
|
||||
$input['internebemerkung'] = $this->app->Secure->GetPOST('internebemerkung');
|
||||
|
||||
|
||||
return $input;
|
||||
}
|
||||
}
|
929
www/pages/verbindlichkeit.php
Normal file
929
www/pages/verbindlichkeit.php
Normal file
@ -0,0 +1,929 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* Copyright (c) 2023 OpenXE project
|
||||
* Xentral (c) Xentral ERP Sorftware GmbH, Fuggerstrasse 11, D-86150 Augsburg, * Germany 2019
|
||||
*/
|
||||
|
||||
use Xentral\Components\Database\Exception\QueryFailureException;
|
||||
|
||||
class Verbindlichkeit {
|
||||
|
||||
function __construct($app, $intern = false) {
|
||||
$this->app = $app;
|
||||
if ($intern)
|
||||
return;
|
||||
|
||||
$this->app->ActionHandlerInit($this);
|
||||
$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->ActionHandler("freigabe", "verbindlichkeit_freigabe");
|
||||
$this->app->ActionHandler("schreibschutz", "verbindlichkeit_schreibschutz");
|
||||
$this->app->ActionHandler("freigabeeinkauf", "verbindlichkeit_freigabeeinkauf");
|
||||
$this->app->ActionHandler("freigabebuchhaltung", "verbindlichkeit_freigabebuchhaltung");
|
||||
$this->app->ActionHandler("freigabebezahlt", "verbindlichkeit_freigabebezahlt");
|
||||
$this->app->ActionHandler("ruecksetzeneinkauf", "verbindlichkeit_ruecksetzeneinkauf");
|
||||
$this->app->ActionHandler("ruecksetzenbuchhaltung", "verbindlichkeit_ruecksetzenbuchhaltung");
|
||||
$this->app->ActionHandler("ruecksetzenbezahlt", "verbindlichkeit_ruecksetzenbezahlt");
|
||||
$this->app->ActionHandler("minidetail", "verbindlichkeit_minidetail");
|
||||
|
||||
$this->app->DefaultActionHandler("list");
|
||||
$this->app->ActionHandlerListen($app);
|
||||
}
|
||||
|
||||
public function Install() {
|
||||
/* Fill out manually later */
|
||||
}
|
||||
|
||||
function TableSearch(&$app, $name, $erlaubtevars) {
|
||||
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','Status','Monitor', 'Menü');
|
||||
$width = array('1%','1%','10%'); // Fill out manually later
|
||||
|
||||
// columns that are aligned right (numbers etc)
|
||||
// $alignright = array(4,5,6,7,8);
|
||||
|
||||
$findcols = array(
|
||||
'v.id',
|
||||
'v.id',
|
||||
'v.id',
|
||||
'a.name',
|
||||
'a.lieferantennummer',
|
||||
'v.rechnung',
|
||||
'v.rechnungsdatum',
|
||||
'v.betrag',
|
||||
'v.waehrung',
|
||||
'v.zahlbarbis',
|
||||
'v.skontobis',
|
||||
'v.skonto',
|
||||
'v.status',
|
||||
'v.status_beleg',
|
||||
'v.id'
|
||||
);
|
||||
|
||||
$searchsql = array(
|
||||
'a.name',
|
||||
'a.lieferantennummer',
|
||||
'v.rechnung',
|
||||
'v.internebemerkung'
|
||||
);
|
||||
|
||||
$defaultorder = 1;
|
||||
$defaultorderdesc = 0;
|
||||
$alignright = array(8);
|
||||
$sumcol = array(8);
|
||||
|
||||
$dropnbox = "'<img src=./themes/new/images/details_open.png class=details>' AS `open`, CONCAT('<input type=\"checkbox\" name=\"auswahl[]\" value=\"',v.id,'\" />') AS `auswahl`";
|
||||
|
||||
// $moreinfo = true; // Allow drop down details
|
||||
// $moreinfoaction = "lieferschein"; // specify suffix for minidetail-URL to allow different minidetails
|
||||
// $menucol = 11; // Set id col for moredata/menu
|
||||
|
||||
$menu = "<table cellpadding=0 cellspacing=0><tr><td nowrap>" . "<a href=\"index.php?module=verbindlichkeit&action=edit&id=%value%\"><img src=\"./themes/{$app->Conf->WFconf['defaulttheme']}/images/edit.svg\" border=\"0\"></a> <a href=\"#\" onclick=DeleteDialog(\"index.php?module=verbindlichkeit&action=delete&id=%value%\");>" . "<img src=\"themes/{$app->Conf->WFconf['defaulttheme']}/images/delete.svg\" border=\"0\"></a>" . "</td></tr></table>";
|
||||
|
||||
$sql = "SELECT SQL_CALC_FOUND_ROWS
|
||||
v.id,
|
||||
$dropnbox,
|
||||
v.belegnr,
|
||||
a.name,
|
||||
a.lieferantennummer,
|
||||
v.rechnung,
|
||||
".$app->erp->FormatDate("v.rechnungsdatum").",
|
||||
".$app->erp->FormatMenge('v.betrag',2).",
|
||||
v.waehrung,
|
||||
".$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
|
||||
|
||||
";
|
||||
|
||||
$where = "1";
|
||||
$count = "SELECT count(DISTINCT id) FROM verbindlichkeit WHERE $where";
|
||||
// $groupby = "";
|
||||
|
||||
// Toggle filters
|
||||
$this->app->Tpl->Add('JQUERYREADY', "$('#wareneingang').click( function() { fnFilterColumn1( 0 ); } );");
|
||||
$this->app->Tpl->Add('JQUERYREADY', "$('#rechnungsfreigabe').click( function() { fnFilterColumn2( 0 ); } );");
|
||||
$this->app->Tpl->Add('JQUERYREADY', "$('#nichtbezahlt').click( function() { fnFilterColumn3( 0 ); } );");
|
||||
|
||||
for ($r = 1;$r <= 3;$r++) {
|
||||
$this->app->Tpl->Add('JAVASCRIPT', '
|
||||
function fnFilterColumn' . $r . ' ( i )
|
||||
{
|
||||
if(oMoreData' . $r . $name . '==1)
|
||||
oMoreData' . $r . $name . ' = 0;
|
||||
else
|
||||
oMoreData' . $r . $name . ' = 1;
|
||||
|
||||
$(\'#' . $name . '\').dataTable().fnFilter(
|
||||
\'\',
|
||||
i,
|
||||
0,0
|
||||
);
|
||||
}
|
||||
');
|
||||
}
|
||||
|
||||
|
||||
$more_data1 = $this->app->Secure->GetGET("more_data1");
|
||||
if ($more_data1 == 1) {
|
||||
$where .= " AND v.freigabe <> '1'";
|
||||
} else {
|
||||
}
|
||||
|
||||
$more_data2 = $this->app->Secure->GetGET("more_data2");
|
||||
if ($more_data2 == 1) {
|
||||
$where .= " AND v.rechnungsfreigabe <> '1'";
|
||||
}
|
||||
else {
|
||||
}
|
||||
|
||||
$more_data3 = $this->app->Secure->GetGET("more_data3");
|
||||
if ($more_data3 == 1) {
|
||||
$where .= " AND v.bezahlt <> '1'";
|
||||
}
|
||||
else {
|
||||
}
|
||||
// END Toggle filters
|
||||
|
||||
$this->app->YUI->DatePicker('zahlbarbis');
|
||||
$filterzahlbarbis = $this->app->YUI->TableSearchFilter($name, 4,'zahlbarbis');
|
||||
if (!empty($filterzahlbarbis)) {
|
||||
$filterzahlbarbis = $this->app->String->Convert($filterzahlbarbis,'%1.%2.%3','%3-%2-%1');
|
||||
$where .= " AND v.zahlbarbis <= '".$filterzahlbarbis."'";
|
||||
}
|
||||
|
||||
$this->app->YUI->DatePicker('skontobis');
|
||||
$filterskontobis = $this->app->YUI->TableSearchFilter($name, 5,'skontobis');
|
||||
if (!empty($filterskontobis)) {
|
||||
$filterskontobis = $this->app->String->Convert($filterskontobis,'%1.%2.%3','%3-%2-%1');
|
||||
$where .= " AND v.skontobis <= '".$filterskontobis."'";
|
||||
}
|
||||
|
||||
$moreinfo = true; // Allow drop down details
|
||||
$menucol = 1; // For moredata
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
$erg = false;
|
||||
|
||||
foreach ($erlaubtevars as $k => $v) {
|
||||
if (isset($$v)) {
|
||||
$erg[$v] = $$v;
|
||||
}
|
||||
}
|
||||
return $erg;
|
||||
}
|
||||
|
||||
function verbindlichkeit_list() {
|
||||
|
||||
// Process multi action
|
||||
$submit = $this->app->Secure->GetPOST('ausfuehren');
|
||||
if (!empty($submit)) {
|
||||
$auswahl = $this->app->Secure->GetPOST('auswahl');
|
||||
$aktion = $this->app->Secure->GetPOST('sel_aktion');
|
||||
|
||||
$selectedIds = [];
|
||||
if(!empty($auswahl)) {
|
||||
foreach($auswahl as $selectedId) {
|
||||
$selectedId = (int)$selectedId;
|
||||
if($selectedId > 0) {
|
||||
$selectedIds[] = $selectedId;
|
||||
}
|
||||
}
|
||||
|
||||
switch ($aktion) {
|
||||
case 'freigabeeinkauf':
|
||||
foreach ($selectedIds as $id) {
|
||||
$this->verbindlichkeit_freigabeeinkauf($id);
|
||||
}
|
||||
break;
|
||||
case 'freigabebuchhaltung':
|
||||
foreach ($selectedIds as $id) {
|
||||
$this->verbindlichkeit_freigabebuchhaltung($id);
|
||||
}
|
||||
break;
|
||||
case 'bezahlt':
|
||||
foreach ($selectedIds as $id) {
|
||||
$this->verbindlichkeit_freigabebezahlt($id);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$this->app->erp->MenuEintrag("index.php?module=verbindlichkeit&action=list", "Übersicht");
|
||||
$this->app->erp->MenuEintrag("index.php?module=verbindlichkeit&action=create", "Neu anlegen");
|
||||
|
||||
$this->app->erp->MenuEintrag("index.php", "Zurück");
|
||||
|
||||
$this->app->YUI->TableSearch('TAB1', 'verbindlichkeit_list', "show", "", "", basename(__FILE__), __CLASS__);
|
||||
|
||||
/*
|
||||
|
||||
Prepared for later use...
|
||||
|
||||
if($this->app->erp->RechteVorhanden('verbindlichkeit', 'freigabeeinkauf')){
|
||||
$this->app->Tpl->Set('MANUELLFREIGABEEINKAUF', '<option value="freigabeeinkauf">{|freigeben (Einkauf)|}</option>');
|
||||
}
|
||||
|
||||
if($this->app->erp->RechteVorhanden('verbindlichkeit', 'freigabebuchhaltung')){
|
||||
$this->app->Tpl->Set('MANUELLFREIGABEBUCHHALTUNG', '<option value="freigabebuchhaltung">{|freigeben (Buchhaltung)|}</option>');
|
||||
}
|
||||
|
||||
if($this->app->erp->RechteVorhanden('verbindlichkeit', 'freigabebezahlt')){
|
||||
$this->app->Tpl->Set('ALSBEZAHLTMARKIEREN', '<option value="bezahlt">{|als bezahlt markieren|}</option>');
|
||||
}
|
||||
*/
|
||||
$this->app->User->SetParameter('table_verbindlichkeit_list_zahlbarbis', '');
|
||||
$this->app->User->SetParameter('table_verbindlichkeit_list_skontobis', '');
|
||||
|
||||
$this->app->Tpl->Parse('PAGE', "verbindlichkeit_list.tpl");
|
||||
}
|
||||
|
||||
public function verbindlichkeit_delete() {
|
||||
$id = (int) $this->app->Secure->GetGET('id');
|
||||
|
||||
$this->app->DB->Delete("UPDATE `verbindlichkeit` SET status='storniert' WHERE `id` = '{$id}'");
|
||||
$this->app->Tpl->Set('MESSAGE', "<div class=\"error\">Der Eintrag wurde storniert.</div>");
|
||||
|
||||
$this->verbindlichkeit_list();
|
||||
}
|
||||
|
||||
/*
|
||||
* Edit verbindlichkeit item
|
||||
* If id is empty, create a new one
|
||||
*/
|
||||
|
||||
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))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
$this->app->Tpl->Set('ID', $id);
|
||||
|
||||
$this->verbindlichkeit_menu($id);
|
||||
|
||||
$input = $this->GetInput();
|
||||
$submit = $this->app->Secure->GetPOST('submit');
|
||||
|
||||
if (empty($id)) {
|
||||
// New item
|
||||
$id = 'NULL';
|
||||
$input['status'] = 'angelegt';
|
||||
}
|
||||
|
||||
if ($submit != '')
|
||||
{
|
||||
|
||||
// Write to database
|
||||
// Add checks here
|
||||
$schreibschutz = $this->app->DB->Select("SELECT schreibschutz FROM verbindlichkeit WHERE id =".$id);
|
||||
|
||||
if ($schreibschutz) {
|
||||
$internebemerkung = $input['internebemerkung'];
|
||||
$projekt = $input['projekt'];
|
||||
$kostenstelle = $input['kostenstelle'];
|
||||
unset($input);
|
||||
$input['internebemerkung'] = $internebemerkung;
|
||||
$input['projekt'] = $this->app->erp->ReplaceProjekt(true,$projekt,true);
|
||||
$input['kostenstelle'] = $this->app->DB->Select("SELECT id FROM kostenstellen WHERE nummer = '".$kostenstelle."'");
|
||||
} else {
|
||||
$input['adresse'] = $this->app->erp->ReplaceLieferantennummer(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->DB->Select("SELECT id FROM kostenstellen WHERE nummer = '".$input['kostenstelle']."'");
|
||||
if(empty($input['projekt']) && !empty($input['adresse'])) {
|
||||
$input['projekt'] = $this->app->erp->GetCreateProjekt($input['adresse']);
|
||||
}
|
||||
}
|
||||
|
||||
$columns = "id, ";
|
||||
$values = "$id, ";
|
||||
$update = "";
|
||||
|
||||
$fix = "";
|
||||
|
||||
foreach ($input as $key => $value) {
|
||||
$columns = $columns.$fix.$key;
|
||||
$values = $values.$fix."'".$value."'";
|
||||
$update = $update.$fix.$key." = '$value'";
|
||||
|
||||
$fix = ", ";
|
||||
}
|
||||
|
||||
// echo($columns."<br>");
|
||||
// echo($values."<br>");
|
||||
// echo($update."<br>");
|
||||
|
||||
$sql = "INSERT INTO verbindlichkeit (".$columns.") VALUES (".$values.") ON DUPLICATE KEY UPDATE ".$update;
|
||||
|
||||
// echo($sql);
|
||||
|
||||
$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=edit&id=$id&msg=$msg");
|
||||
} else {
|
||||
$this->app->Tpl->Set('MESSAGE', "<div class=\"success\">Die Einstellungen wurden erfolgreich übernommen.</div>");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Load values again from database
|
||||
$dropnbox = "'<img src=./themes/new/images/details_open.png class=details>' AS `open`, CONCAT('<input type=\"checkbox\" name=\"auswahl[]\" value=\"',v.id,'\" />') AS `auswahl`";
|
||||
$result = $this->app->DB->SelectArr("SELECT SQL_CALC_FOUND_ROWS v.id,
|
||||
$dropnbox,
|
||||
v.belegnr,
|
||||
v.status_beleg,
|
||||
v.schreibschutz,
|
||||
v.rechnung,
|
||||
v.zahlbarbis,
|
||||
".$this->app->erp->FormatMengeBetrag('v.betrag')." AS betrag,
|
||||
v.umsatzsteuer,
|
||||
v.ustid,
|
||||
v.summenormal,
|
||||
v.summeermaessigt,
|
||||
v.summesatz3,
|
||||
v.summesatz4,
|
||||
v.steuersatzname3,
|
||||
v.steuersatzname4,
|
||||
v.skonto,
|
||||
v.skontobis,
|
||||
v.skontofestsetzen,
|
||||
v.freigabe,
|
||||
v.freigabemitarbeiter,
|
||||
v.bestellung,
|
||||
v.adresse,
|
||||
v.projekt,
|
||||
v.teilprojekt,
|
||||
v.auftrag,
|
||||
v.status,
|
||||
v.bezahlt,
|
||||
v.kontoauszuege,
|
||||
v.firma,
|
||||
v.logdatei,
|
||||
v.waehrung,
|
||||
v.zahlungsweise,
|
||||
v.eingangsdatum,
|
||||
v.buha_konto1,
|
||||
v.buha_belegfeld1,
|
||||
v.buha_betrag1,
|
||||
v.buha_konto2,
|
||||
v.buha_belegfeld2,
|
||||
v.buha_betrag2,
|
||||
v.buha_konto3,
|
||||
v.buha_belegfeld3,
|
||||
v.buha_betrag3,
|
||||
v.buha_konto4,
|
||||
v.buha_belegfeld4,
|
||||
v.buha_betrag4,
|
||||
v.buha_konto5,
|
||||
v.buha_belegfeld5,
|
||||
v.buha_betrag5,
|
||||
v.rechnungsdatum,
|
||||
v.rechnungsfreigabe,
|
||||
v.kostenstelle,
|
||||
v.beschreibung,
|
||||
v.sachkonto,
|
||||
v.art,
|
||||
v.verwendungszweck,
|
||||
v.dta_datei,
|
||||
v.frachtkosten,
|
||||
v.internebemerkung,
|
||||
v.ustnormal,
|
||||
v.ustermaessigt,
|
||||
v.uststuer3,
|
||||
v.uststuer4,
|
||||
v.betragbezahlt,
|
||||
v.bezahltam,
|
||||
v.klaerfall,
|
||||
v.klaergrund,
|
||||
v.skonto_erhalten,
|
||||
v.kurs,
|
||||
v.sprache,
|
||||
v.id,
|
||||
a.lieferantennummer,
|
||||
a.name AS adresse_name FROM verbindlichkeit v LEFT JOIN adresse a ON a.id = v.adresse"." WHERE v.id=$id");
|
||||
|
||||
foreach ($result[0] as $key => $value) {
|
||||
$this->app->Tpl->Set(strtoupper($key), $value);
|
||||
}
|
||||
|
||||
if (!empty($result[0])) {
|
||||
$verbindlichkeit_from_db = $result[0];
|
||||
}
|
||||
|
||||
// Summarize positions
|
||||
|
||||
$sql = "SELECT * FROM verbindlichkeit_position WHERE verbindlichkeit = ".$id;
|
||||
$positionen = $this->app->DB->SelectArr($sql);
|
||||
|
||||
if (!empty($positionen)) {
|
||||
$betrag_netto = 0;
|
||||
$betrag_brutto = 0;
|
||||
$steuer_normal = 0;
|
||||
$steuer_ermaessigt = 0;
|
||||
|
||||
/*
|
||||
Normal: umsatzsteuer leer, steuersatz = leer
|
||||
Ermäßigt: umsatzsteuer ermaessigt, steuersatz = -1
|
||||
Befreit: umsatzsteuer befreit, steursatz = -1
|
||||
Individuell: umsatzsteuer leer, steuersatz = wert
|
||||
*/
|
||||
|
||||
foreach ($positionen as $position) {
|
||||
|
||||
$tmpsteuersatz = null;
|
||||
$tmpsteuertext = null;
|
||||
$erloes = null;
|
||||
|
||||
// function GetSteuerPosition($typ, $posid,&$tmpsteuersatz = null, &$tmpsteuertext = null, &$erloes = null)
|
||||
|
||||
$this->app->erp->GetSteuerPosition("verbindlichkeit",$position['id'],$tmpsteuersatz,$tmpsteuertext,$erloes);
|
||||
|
||||
$position['steuersatz_berechnet'] = $tmpsteuersatz;
|
||||
$position['steuertext_berechnet'] = $tmpsteuertext;
|
||||
$position['steuererloes_berechnet'] = $erloes;
|
||||
|
||||
$betrag_netto += ($position['menge']*$position['preis']);
|
||||
$betrag_brutto += ($position['menge']*$position['preis'])*(1+($tmpsteuersatz/100));
|
||||
|
||||
}
|
||||
|
||||
$this->app->Tpl->Set('BETRAGNETTO', $betrag_netto);
|
||||
$this->app->Tpl->Set('BETRAGBRUTTOPOS', round($betrag_brutto,2));
|
||||
|
||||
$this->app->Tpl->Set('BETRAGDISABLED', 'disabled');
|
||||
|
||||
}
|
||||
|
||||
/*
|
||||
* Add displayed items later
|
||||
*
|
||||
|
||||
$this->app->Tpl->Add('KURZUEBERSCHRIFT2', $email);
|
||||
$this->app->Tpl->Add('EMAIL', $email);
|
||||
$this->app->Tpl->Add('ANGEZEIGTERNAME', $angezeigtername);
|
||||
$this->app->YUI->AutoComplete("artikel", "artikelnummer");
|
||||
|
||||
*/
|
||||
|
||||
if ($verbindlichkeit_from_db['schreibschutz']) {
|
||||
$this->app->Tpl->Set('SAVEDISABLED','disabled');
|
||||
$this->app->Tpl->Set('MESSAGE',"<div class=\"warning\">Diese Verbindlichkeit ist schreibgeschützt und darf daher nicht mehr bearbeitet werden! <input type=\"button\" value=\"Schreibschutz entfernen\" onclick=\"if(!confirm('Soll der Schreibschutz für diese Verbindlichkeit wirklich entfernt werden?')) return false;else window.location.href='index.php?module=verbindlichkeit&action=schreibschutz&id=$id';\"></div>");
|
||||
}
|
||||
|
||||
if (empty($verbindlichkeit_from_db['adresse'] || $verbindlichkeit_from_db['status'] == 'angelegt')) {
|
||||
$this->app->Tpl->Set('FREIGABEEINKAUFHIDDEN','hidden');
|
||||
$this->app->Tpl->Set('FREIGABEBUCHHALTUNGHIDDEN','hidden');
|
||||
$this->app->Tpl->Set('FREIGABEBEZAHLTHIDDEN','hidden');
|
||||
}
|
||||
|
||||
if ($verbindlichkeit_from_db['freigabe']) {
|
||||
$this->app->Tpl->Set('FREIGABEEINKAUFHIDDEN','hidden');
|
||||
} else {
|
||||
$this->app->Tpl->Set('RUECKSETZENEINKAUFHIDDEN','hidden');
|
||||
}
|
||||
if ($verbindlichkeit_from_db['rechnungsfreigabe']) {
|
||||
$this->app->Tpl->Set('FREIGABEBUCHHALTUNGHIDDEN','hidden');
|
||||
} else {
|
||||
$this->app->Tpl->Set('RUECKSETZENBUCHHALTUNGHIDDEN','hidden');
|
||||
}
|
||||
if ($verbindlichkeit_from_db['bezahlt'] == '1') {
|
||||
$this->app->Tpl->Set('FREIGABEBEZAHLTHIDDEN','hidden');
|
||||
} else {
|
||||
$this->app->Tpl->Set('RUECKSETZENBEZAHLTHIDDEN','hidden');
|
||||
}
|
||||
|
||||
$this->app->Tpl->Set('WARENEINGANGCHECKED', $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");
|
||||
|
||||
$sql = "SELECT " . $this->app->YUI->IconsSQLVerbindlichkeit() . " AS `icons` FROM verbindlichkeit v WHERE id=$id";
|
||||
$icons = $this->app->DB->SelectArr($sql);
|
||||
$this->app->Tpl->Add('STATUSICONS', $icons[0]['icons']);
|
||||
|
||||
$this->app->YUI->AutoComplete("adresse", "lieferant");
|
||||
$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->DB->SELECT("SELECT nummer FROM kostenstellen WHERE id = '".$verbindlichkeit_from_db['kostenstelle']."'"));
|
||||
|
||||
$waehrungenselect = $this->app->erp->GetSelect($this->app->erp->GetWaehrung(), $verbindlichkeit_from_db['waehrung']);
|
||||
$this->app->Tpl->Set('WAEHRUNGSELECT', $waehrungenselect);
|
||||
|
||||
$this->app->Tpl->Set('ADRESSE_ID', $verbindlichkeit_from_db['adresse']);
|
||||
|
||||
$this->app->Tpl->Set('ADRESSE', $this->app->erp->ReplaceLieferantennummer(false,$verbindlichkeit_from_db['adresse'],false)); // Convert ID to form display
|
||||
|
||||
$this->app->YUI->CkEditor("internebemerkung");
|
||||
|
||||
$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->verbindlichkeit_minidetail('MINIDETAIL',false);
|
||||
$this->app->Tpl->Parse('PAGE', "verbindlichkeit_edit.tpl");
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Get all paramters from html form and save into $input
|
||||
*/
|
||||
public function GetInput(): array {
|
||||
$input = array();
|
||||
$input['adresse'] = $this->app->Secure->GetPOST('adresse');
|
||||
$input['rechnung'] = $this->app->Secure->GetPOST('rechnung');
|
||||
$input['zahlbarbis'] = $this->app->Secure->GetPOST('zahlbarbis');
|
||||
$input['betrag'] = $this->app->Secure->GetPOST('betrag');
|
||||
$input['waehrung'] = $this->app->Secure->GetPOST('waehrung');
|
||||
$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')?'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')?'1':'0';
|
||||
$input['rechnungsfreigabe'] = $this->app->Secure->GetPOST('rechnungsfreigabe')?'1':'0';
|
||||
$input['kostenstelle'] = $this->app->Secure->GetPOST('kostenstelle');
|
||||
$input['internebemerkung'] = $this->app->Secure->GetPOST('internebemerkung');
|
||||
return $input;
|
||||
}
|
||||
|
||||
function verbindlichkeit_menu($id) {
|
||||
|
||||
$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");
|
||||
|
||||
$anzahldateien = $this->app->erp->AnzahlDateien("verbindlichkeit",$id);
|
||||
if ($anzahldateien > 0) {
|
||||
$anzahldateien = " (".$anzahldateien.")";
|
||||
} else {
|
||||
$anzahldateien="";
|
||||
}
|
||||
|
||||
if ($id != 'NULL') {
|
||||
$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, schreibschutz 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 Verbindlichkeit $belegnr");
|
||||
|
||||
if ($invoiceArr['status'] === 'angelegt' || $invoiceArr['schreibschutz'] != 1) {
|
||||
$this->app->erp->MenuEintrag("index.php?module=verbindlichkeit&action=freigabe&id=$id",'Freigabe');
|
||||
}
|
||||
}
|
||||
|
||||
function verbindlichkeit_dateien()
|
||||
{
|
||||
$id = $this->app->Secure->GetGET("id");
|
||||
$this->verbindlichkeit_menu($id);
|
||||
$this->app->Tpl->Add('UEBERSCHRIFT'," (Dateien)");
|
||||
$this->app->YUI->DateiUpload('PAGE',"verbindlichkeit",$id);
|
||||
}
|
||||
|
||||
function verbindlichkeit_inlinepdf() {
|
||||
$id = $this->app->Secure->GetGET('id');
|
||||
|
||||
$file_attachments = $this->app->erp->GetDateiSubjektObjekt('%','verbindlichkeit',$id);
|
||||
|
||||
if (!empty($file_attachments)) {
|
||||
|
||||
// print_r($file_attachments);
|
||||
|
||||
// Try to merge all PDFs
|
||||
$file_paths = array();
|
||||
foreach ($file_attachments as $file_attachment) {
|
||||
if ($this->app->erp->GetDateiEndung($file_attachment) == 'pdf') {
|
||||
$file_paths[] = $this->app->erp->GetDateiPfad($file_attachment);
|
||||
}
|
||||
}
|
||||
$pdfMerger = $this->app->Container->get('PdfMerger');
|
||||
$mergeOutputPath = realpath($this->app->erp->GetTMP()) . '/' . uniqid('sammelpdf_', true) . '.pdf';
|
||||
try {
|
||||
$pdfMerger->merge($file_paths, $mergeOutputPath);
|
||||
header('Content-type:application/pdf');
|
||||
header('Content-Disposition: attachment;filename='.md5(microtime(true)).'.pdf');
|
||||
readfile($mergeOutputPath);
|
||||
$this->app->ExitXentral();
|
||||
} catch (\Xentral\Components\Pdf\Exception\PdfComponentExceptionInterface $exception) {
|
||||
// Just the first PDF
|
||||
foreach ($file_attachments as $file_attachment) {
|
||||
if ($this->app->erp->GetDateiEndung($file_attachment) == 'pdf') {
|
||||
$file_contents = $this->app->erp->GetDatei($file_attachment);
|
||||
header('Content-type:application/pdf');
|
||||
header('Content-Disposition: attachment;filename=verbindlichkeit_'.$id.'.pdf');
|
||||
echo($file_contents);
|
||||
$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;
|
||||
}
|
||||
|
||||
function verbindlichkeit_freigabe()
|
||||
{
|
||||
$id = $this->app->Secure->GetGET('id');
|
||||
$this->app->erp->BelegFreigabe('verbindlichkeit',$id);
|
||||
$this->app->erp->BelegProtokoll("verbindlichkeit",$id,"Verbindlichkeit freigegeben");
|
||||
$this->app->DB->Update("UPDATE verbindlichkeit SET schreibschutz = 1 WHERE id = ".$id);
|
||||
$this->verbindlichkeit_edit();
|
||||
}
|
||||
|
||||
function verbindlichkeit_freigabeeinkauf($id = null)
|
||||
{
|
||||
if (empty($id)) {
|
||||
$id = $this->app->Secure->GetGET('id');
|
||||
$gotoedit = true;
|
||||
}
|
||||
$sql = "UPDATE verbindlichkeit SET freigabe = 1 WHERE id=".$id;
|
||||
$this->app->DB->Update($sql);
|
||||
$this->app->erp->BelegProtokoll("verbindlichkeit",$id,"Verbindlichkeit freigegeben (Einkauf)");
|
||||
if ($gotoedit) {
|
||||
$this->verbindlichkeit_edit();
|
||||
}
|
||||
}
|
||||
|
||||
function verbindlichkeit_freigabebuchhaltung($id = null)
|
||||
{
|
||||
if (empty($id)) {
|
||||
$id = $this->app->Secure->GetGET('id');
|
||||
$gotoedit = true;
|
||||
}
|
||||
$sql = "UPDATE verbindlichkeit SET rechnungsfreigabe = 1 WHERE id=".$id;
|
||||
$this->app->DB->Update($sql);
|
||||
$this->app->erp->BelegProtokoll("verbindlichkeit",$id,"Verbindlichkeit freigegeben (Buchhaltung)");
|
||||
if ($gotoedit) {
|
||||
$this->verbindlichkeit_edit();
|
||||
}
|
||||
}
|
||||
|
||||
function verbindlichkeit_freigabebezahlt($id = null)
|
||||
{
|
||||
if (empty($id)) {
|
||||
$id = $this->app->Secure->GetGET('id');
|
||||
$gotoedit = true;
|
||||
}
|
||||
$sql = "UPDATE verbindlichkeit SET bezahlt = 1 WHERE id=".$id;
|
||||
$this->app->DB->Update($sql);
|
||||
$this->app->erp->BelegProtokoll("verbindlichkeit",$id,"Verbindlichkeit als bezahlt markiert");
|
||||
if ($gotoedit) {
|
||||
$this->verbindlichkeit_edit();
|
||||
}
|
||||
}
|
||||
|
||||
function verbindlichkeit_ruecksetzeneinkauf($id = null)
|
||||
{
|
||||
if (empty($id)) {
|
||||
$id = $this->app->Secure->GetGET('id');
|
||||
$gotoedit = true;
|
||||
}
|
||||
$sql = "UPDATE verbindlichkeit SET freigabe = 0 WHERE id=".$id;
|
||||
$this->app->DB->Update($sql);
|
||||
$this->app->erp->BelegProtokoll("verbindlichkeit",$id,"Verbindlichkeit rückgesetzt (Einkauf)");
|
||||
if ($gotoedit) {
|
||||
$this->verbindlichkeit_edit();
|
||||
}
|
||||
}
|
||||
|
||||
function verbindlichkeit_ruecksetzenbuchhaltung($id = null)
|
||||
{
|
||||
if (empty($id)) {
|
||||
$id = $this->app->Secure->GetGET('id');
|
||||
$gotoedit = true;
|
||||
}
|
||||
$sql = "UPDATE verbindlichkeit SET rechnungsfreigabe = 0 WHERE id=".$id;
|
||||
$this->app->DB->Update($sql);
|
||||
$this->app->erp->BelegProtokoll("verbindlichkeit",$id,"Verbindlichkeit rückgesetzt (Buchhaltung)");
|
||||
if ($gotoedit) {
|
||||
$this->verbindlichkeit_edit();
|
||||
}
|
||||
}
|
||||
|
||||
function verbindlichkeit_ruecksetzenbezahlt($id = null)
|
||||
{
|
||||
if (empty($id)) {
|
||||
$id = $this->app->Secure->GetGET('id');
|
||||
$gotoedit = true;
|
||||
}
|
||||
$sql = "UPDATE verbindlichkeit SET bezahlt = 0 WHERE id=".$id;
|
||||
$this->app->DB->Update($sql);
|
||||
$this->app->erp->BelegProtokoll("verbindlichkeit",$id,"Verbindlichkeit bezahlt rückgesetzt");
|
||||
if ($gotoedit) {
|
||||
$this->verbindlichkeit_edit();
|
||||
}
|
||||
}
|
||||
|
||||
function verbindlichkeit_schreibschutz($id = null)
|
||||
{
|
||||
if (empty($id)) {
|
||||
$id = $this->app->Secure->GetGET('id');
|
||||
$gotoedit = true;
|
||||
}
|
||||
$sql = "UPDATE verbindlichkeit SET schreibschutz = 0 WHERE id=".$id;
|
||||
$this->app->DB->Update($sql);
|
||||
$this->app->erp->BelegProtokoll("verbindlichkeit",$id,"Verbindlichkeit Schreibschutz entfernt");
|
||||
if ($gotoedit) {
|
||||
$this->verbindlichkeit_edit();
|
||||
}
|
||||
}
|
||||
|
||||
public function verbindlichkeit_minidetail($parsetarget='',$menu=true) {
|
||||
|
||||
$id = $this->app->Secure->GetGET('id');
|
||||
|
||||
$result = $this->app->DB->SelectArr("SELECT SQL_CALC_FOUND_ROWS
|
||||
v.id,
|
||||
v.belegnr,
|
||||
v.status_beleg,
|
||||
v.schreibschutz,
|
||||
v.rechnung,
|
||||
".$this->app->erp->FormatDate('v.zahlbarbis', 'zahlbarbis').",
|
||||
".$this->app->erp->FormatMengeBetrag('v.betrag')." AS betrag,
|
||||
v.umsatzsteuer,
|
||||
v.ustid,
|
||||
v.summenormal,
|
||||
v.summeermaessigt,
|
||||
v.summesatz3,
|
||||
v.summesatz4,
|
||||
v.steuersatzname3,
|
||||
v.steuersatzname4,
|
||||
v.skonto,
|
||||
".$this->app->erp->FormatDate('v.skontobis', 'skontobis').",
|
||||
v.skontofestsetzen,
|
||||
v.freigabe,
|
||||
v.freigabemitarbeiter,
|
||||
v.bestellung,
|
||||
p.abkuerzung AS projekt,
|
||||
v.teilprojekt,
|
||||
v.auftrag,
|
||||
v.status,
|
||||
v.bezahlt,
|
||||
v.kontoauszuege,
|
||||
v.firma,
|
||||
v.logdatei,
|
||||
v.waehrung,
|
||||
v.zahlungsweise,
|
||||
".$this->app->erp->FormatDate('v.eingangsdatum', 'eingangsdatum').",
|
||||
".$this->app->erp->FormatDate('v.rechnungsdatum', 'rechnungsdatum').",
|
||||
v.rechnungsfreigabe,
|
||||
k.nummer as kostenstelle,
|
||||
v.beschreibung,
|
||||
v.sachkonto,
|
||||
v.art,
|
||||
v.verwendungszweck,
|
||||
v.dta_datei,
|
||||
v.frachtkosten,
|
||||
v.internebemerkung,
|
||||
v.ustnormal,
|
||||
v.ustermaessigt,
|
||||
v.uststuer3,
|
||||
v.uststuer4,
|
||||
v.betragbezahlt,
|
||||
v.bezahltam,
|
||||
v.klaerfall,
|
||||
v.klaergrund,
|
||||
v.skonto_erhalten,
|
||||
v.kurs,
|
||||
v.sprache,
|
||||
v.id,
|
||||
CONCAT(a.lieferantennummer,' ',a.name) AS adresse
|
||||
FROM verbindlichkeit v
|
||||
LEFT JOIN adresse a ON a.id = v.adresse
|
||||
LEFT JOIN projekt p ON a.projekt = p.id
|
||||
LEFT JOIN kostenstellen k ON v.kostenstelle = k.id
|
||||
WHERE v.id='$id'");
|
||||
|
||||
foreach ($result[0] as $key => $value) {
|
||||
$this->app->Tpl->Set(strtoupper($key), $value);
|
||||
}
|
||||
|
||||
if (!empty($result[0])) {
|
||||
$verbindlichkeit_from_db = $result[0];
|
||||
}
|
||||
|
||||
$tmp = new EasyTable($this->app);
|
||||
$tmp->Query("SELECT zeit,bearbeiter,grund FROM verbindlichkeit_protokoll WHERE verbindlichkeit='$id' ORDER by zeit DESC",0,"");
|
||||
$tmp->DisplayNew('PROTOKOLL',"Protokoll","noAction");
|
||||
|
||||
if($parsetarget=='')
|
||||
{
|
||||
$this->app->Tpl->Output('verbindlichkeit_minidetail.tpl');
|
||||
$this->app->ExitXentral();
|
||||
}
|
||||
$this->app->Tpl->Parse($parsetarget,'verbindlichkeit_minidetail.tpl');
|
||||
}
|
||||
|
||||
}
|
@ -665,6 +665,9 @@ class WidgetGenartikel
|
||||
$field = new HTMLInput("steuergruppe","text","","30","","","","","","","","0","","");
|
||||
$this->form->NewField($field);
|
||||
|
||||
$field = new HTMLInput("sachkonto","text","","30","","","","","","","","0","","");
|
||||
$this->form->NewField($field);
|
||||
|
||||
$field = new HTMLInput("kostenstelle","text","","30","","","","","","","","0","","");
|
||||
$this->form->NewField($field);
|
||||
|
||||
|
@ -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");
|
||||
@ -115,6 +112,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);
|
||||
|
||||
|
@ -849,7 +849,87 @@
|
||||
[DISABLECLOSESHOP]
|
||||
|
||||
<div id="tabs-5">
|
||||
|
||||
<div class="row">
|
||||
<div class="row-height">
|
||||
<div class="col-xs-12 col-md-4 col-md-height">
|
||||
<div class="inside inside-full-height">
|
||||
<fieldset>
|
||||
<legend>{|Finanzbuchhaltung Export Erlöse|}</legend>
|
||||
<table border="0" width="100%">
|
||||
<tr>
|
||||
<td width="300">Inland (normal):</td><td>[STEUER_ERLOESE_INLAND_NORMAL][MSGSTEUER_ERLOESE_INLAND_NORMAL]</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="300">Inland (ermäßigt):</td><td>[STEUER_ERLOESE_INLAND_ERMAESSIGT][MSGSTEUER_ERLOESE_INLAND_ERMAESSIGT]</td>
|
||||
<tr>
|
||||
<td width="300">Inland (steuerfrei):</td><td>[STEUER_ERLOESE_INLAND_NICHTSTEUERBAR][MSGSTEUER_ERLOESE_INLAND_NICHTSTEUERBAR]</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="300">Innergemeinschaftlich EU:</td><td>[STEUER_ERLOESE_INLAND_INNERGEMEINSCHAFTLICH][MSGSTEUER_ERLOESE_INLAND_INNERGEMEINSCHAFTLICH]</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="300">EU (normal):</td><td>[STEUER_ERLOESE_INLAND_EUNORMAL][MSGSTEUER_ERLOESE_INLAND_EUNORMAL]</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="300">EU (ermäßigt):</td><td>[STEUER_ERLOESE_INLAND_EUERMAESSIGT][MSGSTEUER_ERLOESE_INLAND_EUERMAESSIGT]</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="300">Export:</td><td>[STEUER_ERLOESE_INLAND_EXPORT][MSGSTEUER_ERLOESE_INLAND_EXPORT]</td>
|
||||
</tr>
|
||||
</table>
|
||||
</fieldset>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xs-12 col-md-4 col-md-height">
|
||||
<div class="inside inside-full-height">
|
||||
<fieldset>
|
||||
<legend>{|Finanzbuchhaltung Export Aufwendungen|}</legend>
|
||||
<table>
|
||||
<tr>
|
||||
<td width="300">Inland (normal):</td><td>[STEUER_AUFWENDUNG_INLAND_NORMAL][MSGSTEUER_AUFWENDUNG_INLAND_NORMAL]</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="300">Inland (ermäßigt):</td><td>[STEUER_AUFWENDUNG_INLAND_ERMAESSIGT][MSGSTEUER_AUFWENDUNG_INLAND_ERMAESSIGT]</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="300">Inland (steuefrei):</td><td>[STEUER_AUFWENDUNG_INLAND_NICHTSTEUERBAR][MSGSTEUER_AUFWENDUNG_INLAND_NICHTSTEUERBAR]</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="300">Innergemeinschaftlich EU:</td><td>[STEUER_AUFWENDUNG_INLAND_INNERGEMEINSCHAFTLICH][MSGSTEUER_AUFWENDUNG_INLAND_INNERGEMEINSCHAFTLICH]</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="300">EU (normal):</td><td>[STEUER_AUFWENDUNG_INLAND_EUNORMAL][MSGSTEUER_AUFWENDUNG_INLAND_EUNORMAL]</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="300">EU (ermäßigt):</td><td>[STEUER_AUFWENDUNG_INLAND_EUERMAESSIGT][MSGSTEUER_AUFWENDUNG_INLAND_EUERMAESSIGT]</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="300">Import:</td><td>[STEUER_AUFWENDUNG_INLAND_IMPORT][MSGSTEUER_AUFWENDUNG_INLAND_IMPORT]</td>
|
||||
</tr>
|
||||
</table>
|
||||
</fieldset>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xs-12 col-md-4 col-md-height">
|
||||
<div class="inside inside-full-height">
|
||||
<fieldset>
|
||||
<legend>{|Einstellungen|}</legend>
|
||||
<table>
|
||||
<tr>
|
||||
<td width="300">Sachkonto für Verbindlichkeiten-Vorkontierung:</td><td colspan="3">[SACHKONTO]</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="300">Kostenstelle:</td><td>[KOSTENSTELLE]</td>
|
||||
</tr>
|
||||
</table>
|
||||
</fieldset>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<br />
|
||||
<input type="submit" name="speichern" value="Speichern" onclick="this.form.action += '#tabs-5';" style="float:right"/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
|
@ -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ährung|}:</td><td>[WAEHRUNG][MSGWAEHRUNG] [WAEHRUNGSBUTTON]</td></tr>
|
||||
<tr><td>{|Steuersatz|}:</td><td>[UMSATZSTEUER][MSGUMSATZSTEUER]
|
||||
|
||||
[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>{|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][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>
|
||||
<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>{|Sachkonto|}:</td><td>[SACHKONTO][MSGSACHKONTO]</td></tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</form>
|
||||
[WAEHRUNGSTABELLE]
|
||||
|
@ -38,6 +38,7 @@ class WidgetArtikel extends WidgetGenArtikel
|
||||
$this->app->YUI->AutoComplete("zolltarifnummer","zolltarifnummer",1);
|
||||
$this->app->YUI->AutoComplete("bestandalternativartikel","artikelnummer");
|
||||
$this->app->YUI->AutoComplete("steuergruppe","steuergruppe");
|
||||
$this->app->YUI->AutoComplete("sachkonto","sachkonto",1);
|
||||
$this->app->YUI->AutoComplete("kostenstelle","kostenstelle",1);
|
||||
$this->app->YUI->AutoComplete("steuersatz","steuersatz",1);
|
||||
$this->app->YUI->AutoComplete("preproduced_partlist","lagerartikelnummer");
|
||||
@ -68,6 +69,7 @@ class WidgetArtikel extends WidgetGenArtikel
|
||||
$this->form->ReplaceFunction("nummer",$this,"ReplaceTrim");
|
||||
$this->form->ReplaceFunction("ean",$this,"ReplaceTrim");
|
||||
$this->form->ReplaceFunction("name_de",$this,"ReplaceTrim");
|
||||
$this->form->ReplaceFunction("sachkonto",$this,"ReplaceKontorahmen");
|
||||
$this->form->ReplaceFunction("steuersatz",$this,"ReplaceSteuersatz");
|
||||
$this->app->Tpl->Set('GEWICHTBEZEICHNUNG', $this->app->erp->GetGewichtbezeichnung());
|
||||
|
||||
@ -643,6 +645,11 @@ class WidgetArtikel extends WidgetGenArtikel
|
||||
return $this->app->erp->ReplaceArtikel($db,$value,$fromform);
|
||||
}
|
||||
|
||||
function ReplaceKontorahmen($db,$value,$fromform)
|
||||
{
|
||||
return $this->app->erp->ReplaceKontorahmen($db,$value,$fromform);
|
||||
}
|
||||
|
||||
function ReplaceSteuersatz($db,$value,$fromform)
|
||||
{
|
||||
if($db)
|
||||
|
@ -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