mirror of
https://github.com/OpenXE-org/OpenXE.git
synced 2024-11-14 20:17:14 +01:00
zwischenstand verbindlichkeit status, forms, positions
This commit is contained in:
parent
57f0e2f627
commit
8664e16c55
@ -2856,15 +2856,59 @@ class YUI {
|
||||
}
|
||||
else if ($module == "verbindlichkeit") // OpenXE
|
||||
{
|
||||
$sql = "SELECT $sortcol, if(b.beschreibung!='',
|
||||
if(CHAR_LENGTH(b.bezeichnung)>" . $this->app->erp->MaxArtikelbezeichnung() . ",CONCAT(SUBSTR(CONCAT(b.bezeichnung,' *'),1," . $this->app->erp->MaxArtikelbezeichnung() . "),'...'),CONCAT(b.bezeichnung,' *')),
|
||||
if(CHAR_LENGTH(b.bezeichnung)>" . $this->app->erp->MaxArtikelbezeichnung() . ",CONCAT(SUBSTR(b.bezeichnung,1," . $this->app->erp->MaxArtikelbezeichnung() . "),'...'),b.bezeichnung))
|
||||
as Artikel,
|
||||
p.abkuerzung as projekt, a.nummer as nummer, b.nummer as nummer, DATE_FORMAT(lieferdatum,'%d.%m.%Y') as lieferdatum, trim(b.menge)+0 as menge, " . $this->FormatPreis($preiscell) . " as preis, CONCAT(k.sachkonto,' - ',k.beschriftung) AS sachkonto, b.id as id
|
||||
FROM $table b
|
||||
LEFT JOIN artikel a ON a.id=b.artikel LEFT JOIN projekt p ON b.projekt=p.id
|
||||
LEFT JOIN kontorahmen k ON k.id = b.sachkonto
|
||||
WHERE b.$module='$id'";
|
||||
$sql = "
|
||||
SELECT
|
||||
$sortcol,
|
||||
IF(
|
||||
b.beschreibung != '',
|
||||
IF(
|
||||
CHAR_LENGTH(b.bezeichnung) > " . $this->app->erp->MaxArtikelbezeichnung() . ",
|
||||
CONCAT(
|
||||
SUBSTR(
|
||||
CONCAT(b.bezeichnung, ' *'),
|
||||
1,
|
||||
" . $this->app->erp->MaxArtikelbezeichnung() . "
|
||||
),
|
||||
'...'
|
||||
),
|
||||
CONCAT(b.bezeichnung, ' *')
|
||||
),
|
||||
IF(
|
||||
CHAR_LENGTH(b.bezeichnung) > " . $this->app->erp->MaxArtikelbezeichnung() . ",
|
||||
CONCAT(
|
||||
SUBSTR(
|
||||
b.bezeichnung,
|
||||
1,
|
||||
" . $this->app->erp->MaxArtikelbezeichnung() . "
|
||||
),
|
||||
'...'
|
||||
),
|
||||
b.bezeichnung
|
||||
)
|
||||
) AS Artikel,
|
||||
p.abkuerzung AS projekt,
|
||||
a.nummer,
|
||||
".$this->app->erp->FormatDate('lieferdatum')." AS lieferdatum,
|
||||
TRIM(b.menge) +0 AS menge,
|
||||
" . $this->FormatPreis($preiscell) . " AS preis,
|
||||
" . $this->FormatPreis($preiscell."*menge") . " AS Betrag,
|
||||
CONCAT(
|
||||
k.sachkonto,
|
||||
' - ',
|
||||
k.beschriftung
|
||||
) AS sachkonto,
|
||||
b.id AS id
|
||||
FROM
|
||||
$table b
|
||||
LEFT JOIN artikel a ON
|
||||
a.id = b.artikel
|
||||
LEFT JOIN projekt p ON
|
||||
b.projekt = p.id
|
||||
LEFT JOIN kontorahmen k ON
|
||||
k.id = b.sachkonto
|
||||
WHERE
|
||||
b.$module = '$id'
|
||||
";
|
||||
}
|
||||
else {
|
||||
$sql = null;
|
||||
@ -14875,8 +14919,6 @@ source: "index.php?module=ajax&action=filter&filtername=' . $filter . $extendurl
|
||||
$table->headings[4] = 'Abr. bei Kd';
|
||||
$table->headings[5] = 'sonst. MwSt'; // kann man auch umbenennen in Keine
|
||||
|
||||
|
||||
|
||||
$table->headings[6] = 'MwSt';
|
||||
$table->headings[7] = 'Kommentar';
|
||||
$table->headings[8] = 'Bezahlt';
|
||||
|
@ -52371,6 +52371,17 @@
|
||||
"Privileges": "select,insert,update,references",
|
||||
"Comment": ""
|
||||
},
|
||||
{
|
||||
"Field": "nummer",
|
||||
"Type": "int(11)",
|
||||
"Collation": null,
|
||||
"Null": "NO",
|
||||
"Key": "PRI",
|
||||
"Default": null,
|
||||
"Extra": "",
|
||||
"Privileges": "select,insert,update,references",
|
||||
"Comment": ""
|
||||
},
|
||||
{
|
||||
"Field": "bezeichnung",
|
||||
"Type": "varchar(255)",
|
||||
@ -52382,6 +52393,17 @@
|
||||
"Privileges": "select,insert,update,references",
|
||||
"Comment": ""
|
||||
},
|
||||
{
|
||||
"Field": "beschreibung",
|
||||
"Type": "varchar(255)",
|
||||
"Collation": "utf8mb3_general_ci",
|
||||
"Null": "NO",
|
||||
"Key": "",
|
||||
"Default": null,
|
||||
"Extra": "",
|
||||
"Privileges": "select,insert,update,references",
|
||||
"Comment": ""
|
||||
},
|
||||
{
|
||||
"Field": "projekt",
|
||||
"Type": "varchar(255)",
|
||||
@ -108959,6 +108981,17 @@
|
||||
"Privileges": "select,insert,update,references",
|
||||
"Comment": ""
|
||||
},
|
||||
{
|
||||
"Field": "datum",
|
||||
"Type": "date",
|
||||
"Collation": null,
|
||||
"Null": "YES",
|
||||
"Key": "",
|
||||
"Default": null,
|
||||
"Extra": "",
|
||||
"Privileges": "select,insert,update,references",
|
||||
"Comment": ""
|
||||
},
|
||||
{
|
||||
"Field": "status_beleg",
|
||||
"Type": "varchar(64)",
|
||||
@ -110685,6 +110718,39 @@
|
||||
"Extra": "",
|
||||
"Privileges": "select,insert,update,references",
|
||||
"Comment": ""
|
||||
},
|
||||
{
|
||||
"Field": "steuersatz_normal",
|
||||
"Type": "decimal(5,2)",
|
||||
"Collation": null,
|
||||
"Null": "NO",
|
||||
"Key": "",
|
||||
"Default": "0",
|
||||
"Extra": "",
|
||||
"Privileges": "select,insert,update,references",
|
||||
"Comment": ""
|
||||
},
|
||||
{
|
||||
"Field": "steuersatz_ermaessigt",
|
||||
"Type": "decimal(5,2)",
|
||||
"Collation": null,
|
||||
"Null": "NO",
|
||||
"Key": "",
|
||||
"Default": "0",
|
||||
"Extra": "",
|
||||
"Privileges": "select,insert,update,references",
|
||||
"Comment": ""
|
||||
},
|
||||
{
|
||||
"Field": "ust_befreit",
|
||||
"Type": "int(1)",
|
||||
"Collation": null,
|
||||
"Null": "NO",
|
||||
"Key": "",
|
||||
"Default": "0",
|
||||
"Extra": "",
|
||||
"Privileges": "select,insert,update,references",
|
||||
"Comment": ""
|
||||
}
|
||||
],
|
||||
"keys": [
|
||||
|
@ -35375,6 +35375,7 @@ function Firmendaten($field,$projekt="")
|
||||
{
|
||||
case 'bestellung':
|
||||
case 'anfrage':
|
||||
case 'verbindlichkeit':
|
||||
$aufwendung = true;
|
||||
break;
|
||||
}
|
||||
|
@ -9,15 +9,18 @@
|
||||
[FORMHANDLEREVENT]
|
||||
<div class="row">
|
||||
<div class="row-height">
|
||||
<div class="col-xs-12 col-md-8 col-md-height">
|
||||
<div class="col-xs-12 col-md-6 col-md-height">
|
||||
<div class="inside inside-full-height">
|
||||
<div class="row">
|
||||
<div class="row-height">
|
||||
<div class="col-xs-12 col-md-8 col-md-height">
|
||||
<div class="inside inside-full-height">
|
||||
<fieldset>
|
||||
<fieldset style="float: left;">
|
||||
<legend>{|<b>Verbindlichkeit <font color="blue">[BELEGNR]</font></b> Lf-Nr. <a href="index.php?module=adresse&action=edit&id=[ADRESSE_ID]">[LIEFERANTENNUMMER]|}</a></legend>
|
||||
[STATUSICONS]
|
||||
</fieldset>
|
||||
<fieldset style="float: right;">
|
||||
<input type="submit" name="submit" value="Speichern"/>
|
||||
</fieldset>
|
||||
</div>
|
||||
</div>
|
||||
@ -29,12 +32,20 @@
|
||||
<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">
|
||||
<input type="text" name="adresse" id="adresse" value="[ADRESSE]" size="20" [SAVEDISABLED]>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
@ -42,7 +53,7 @@
|
||||
{|Rechnung|}:
|
||||
</td>
|
||||
<td>
|
||||
<input type="text" name="rechnung" id="rechnung" value="[RECHNUNG]" size="20">
|
||||
<input type="text" name="rechnung" id="rechnung" value="[RECHNUNG]" size="20" [SAVEDISABLED]>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
@ -50,7 +61,15 @@
|
||||
{|Rechnungsdatum|}:
|
||||
</td>
|
||||
<td>
|
||||
<input type="text" name="rechnungsdatum" id="rechnungsdatum" value="[RECHNUNGSDATUM]" size="20">
|
||||
<input type="text" name="rechnungsdatum" id="rechnungsdatum" value="[RECHNUNGSDATUM]" size="20" [SAVEDISABLED]>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
{|Eingangsdatum|}:
|
||||
</td>
|
||||
<td>
|
||||
<input type="text" name="eingangsdatum" id="eingangsdatum" value="[EINGANGSDATUM]" size="20" [SAVEDISABLED]>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
@ -58,8 +77,16 @@
|
||||
{|Betrag|}:
|
||||
</td>
|
||||
<td>
|
||||
<input type="number" name="betrag" id="betrag" value="[BETRAG]" size="20">
|
||||
<select name="waehrung">[WAEHRUNG]</select>
|
||||
<input type="number" name="betragbrutto" id="betragbrutto" value="[BETRAGBRUTTO]" size="20" [BETRAGDISABLED] [SAVEDISABLED]>
|
||||
<select name="waehrung" [SAVEDISABLED]>[WAEHRUNG]</select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
{|Betrag netto|}:
|
||||
</td>
|
||||
<td>
|
||||
<input type="number" name="betragnetto" id="betragnetto" value="[BETRAGNETTO]" size="20" disabled [SAVEDISABLED]>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
@ -67,7 +94,47 @@
|
||||
{|Zahlbarbis|}:
|
||||
</td>
|
||||
<td>
|
||||
<input type="text" name="zahlbarbis" id="zahlbarbis" value="[ZAHLBARBIS]" size="20">
|
||||
<input type="text" name="zahlbarbis" id="zahlbarbis" value="[ZAHLBARBIS]" size="20" [SAVEDISABLED]>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
{|Skonto %|}:
|
||||
</td>
|
||||
<td>
|
||||
<input type="text" name="skonto" id="skonto" value="[SKONTO]" size="20" [SAVEDISABLED]>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
{|Skontobis|}:
|
||||
</td>
|
||||
<td>
|
||||
<input type="text" name="skontobis" id="skontobis" value="[SKONTOBIS]" size="20" [SAVEDISABLED]>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
{|Waren-/Leistungsprüfung (Einkauf)|}:
|
||||
</td>
|
||||
<td>
|
||||
<input type="checkbox" id="freigabe" value="1" [FREIGABECHECKED] size="20" [SAVEDISABLED] disabled>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
{|Rechnungseingangsprüfung (Buchhaltung)|}:
|
||||
</td>
|
||||
<td>
|
||||
<input type="checkbox" id="rechnungsfreigabe" value="1" [RECHNUNGSFREIGABECHECKED] size="20" [SAVEDISABLED] disabled>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
{|Bezahlt|}:
|
||||
</td>
|
||||
<td>
|
||||
<input type="checkbox" id="bezahlt" value="1" [BEZAHLTCHECKED] size="20" [SAVEDISABLED] disabled>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
@ -78,38 +145,6 @@
|
||||
<input type="text" name="projekt" id="projekt" value="[PROJEKT]" size="20">
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
{|Eingangsdatum|}:
|
||||
</td>
|
||||
<td>
|
||||
<input type="text" name="eingangsdatum" id="eingangsdatum" value="[EINGANGSDATUM]" size="20">
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
{|Zahlungsweise|}:
|
||||
</td>
|
||||
<td>
|
||||
<input type="text" name="zahlungsweise" id="zahlungsweise" value="[ZAHLUNGSWEISE]" size="20">
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
{|Skonto|}:
|
||||
</td>
|
||||
<td>
|
||||
<input type="text" name="skonto" id="skonto" value="[SKONTO]" size="20">
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
{|Skontobis|}:
|
||||
</td>
|
||||
<td>
|
||||
<input type="text" name="skontobis" id="skontobis" value="[SKONTOBIS]" size="20">
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
{|Kostenstelle|}:
|
||||
@ -118,44 +153,12 @@
|
||||
<input type="text" name="kostenstelle" id="kostenstelle" value="[KOSTENSTELLE]" size="20">
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
{|Sachkonto|}:
|
||||
</td>
|
||||
<td>
|
||||
<input type="text" name="sachkonto" id="sachkonto" value="[SACHKONTO]" size="20">
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
{|Waren-/Leistungsprüfung (Einkauf)|}:
|
||||
</td>
|
||||
<td>
|
||||
<input type="text" name="freigabe" id="freigabe" value="[FREIGABE]" size="20">
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
{|Rechnungseingangsprüfung (Buchhaltung)|}:
|
||||
</td>
|
||||
<td>
|
||||
<input type="text" name="rechnungsfreigabe" id="rechnungsfreigabe" value="[RECHNUNGSFREIGABE]" size="20">
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
{|Bezahlt|}:
|
||||
</td>
|
||||
<td>
|
||||
<input type="text" name="bezahlt" id="bezahlt" value="[BEZAHLT]" size="20">
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
{|Internebemerkung|}:
|
||||
</td>
|
||||
<td>
|
||||
<input type="text" name="internebemerkung" id="internebemerkung" value="[INTERNEBEMERKUNG]" size="20">
|
||||
<textarea name="internebemerkung" id="internebemerkung" rows="6" style="width:100%;">[INTERNEBEMERKUNG]</textarea>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
@ -166,7 +169,7 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xs-12 col-md-4 col-md-height">
|
||||
<div class="col-xs-12 col-md-6 col-md-height">
|
||||
<div class="inside inside-full-height">
|
||||
<fieldset>
|
||||
<legend>{|Vorschau|}</legend>
|
||||
@ -176,7 +179,6 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<input type="submit" name="submit" value="Speichern" style="float:right"/>
|
||||
</form>
|
||||
</div>
|
||||
<div id="tabs-2">
|
||||
|
@ -1,7 +1,8 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* Copyright (c) 2022 OpenXE project
|
||||
* Copyright (c) 2023 OpenXE project
|
||||
* Xentral (c) Xentral ERP Sorftware GmbH, Fuggerstrasse 11, D-86150 Augsburg, * Germany 2019
|
||||
*/
|
||||
|
||||
use Xentral\Components\Database\Exception\QueryFailureException;
|
||||
@ -22,6 +23,7 @@ class Verbindlichkeit {
|
||||
$this->app->ActionHandler("dateien", "verbindlichkeit_dateien");
|
||||
$this->app->ActionHandler("inlinepdf", "verbindlichkeit_inlinepdf");
|
||||
$this->app->ActionHandler("positioneneditpopup", "verbindlichkeit_positioneneditpopup");
|
||||
$this->app->ActionHandler("freigabe", "verbindlichkeit_freigabe");
|
||||
|
||||
$this->app->DefaultActionHandler("list");
|
||||
$this->app->ActionHandlerListen($app);
|
||||
@ -35,7 +37,7 @@ class Verbindlichkeit {
|
||||
switch ($name) {
|
||||
case "verbindlichkeit_list":
|
||||
$allowed['verbindlichkeit_list'] = array('list');
|
||||
$heading = array('','','Belegnr','Adresse', 'Lieferant', 'RE-Nr', 'RE-Datum', 'Betrag (brutto)', 'Währung', 'Ziel','Skontoziel','Skonto','Monitor', 'Menü');
|
||||
$heading = array('','','Belegnr','Adresse', 'Lieferant', 'RE-Nr', 'RE-Datum', 'Betrag (brutto)', 'Währung', 'Ziel','Skontoziel','Skonto','Status','Monitor', 'Menü');
|
||||
$width = array('1%','1%','10%'); // Fill out manually later
|
||||
|
||||
// columns that are aligned right (numbers etc)
|
||||
@ -54,6 +56,7 @@ class Verbindlichkeit {
|
||||
'v.zahlbarbis',
|
||||
'v.skontobis',
|
||||
'v.skonto',
|
||||
'v.status',
|
||||
'v.status_beleg',
|
||||
'v.id'
|
||||
);
|
||||
@ -91,6 +94,7 @@ class Verbindlichkeit {
|
||||
".$app->erp->FormatDate("v.zahlbarbis").",
|
||||
IF(v.skonto <> 0,".$app->erp->FormatDate("v.skontobis").",''),
|
||||
IF(v.skonto <> 0,CONCAT(".$app->erp->FormatMenge('v.skonto',0).",'%'),''),
|
||||
v.status,
|
||||
".$app->YUI->IconsSQLVerbindlichkeit().",
|
||||
v.id FROM verbindlichkeit v
|
||||
LEFT JOIN adresse a ON v.adresse = a.id
|
||||
@ -159,17 +163,30 @@ class Verbindlichkeit {
|
||||
if (empty($id)) {
|
||||
// New item
|
||||
$id = 'NULL';
|
||||
$input['status'] = 'angelegt';
|
||||
}
|
||||
|
||||
if ($submit != '')
|
||||
{
|
||||
|
||||
// Write to database
|
||||
|
||||
// Add checks here
|
||||
$status = $this->app->DB->Select("SELECT status FROM verbindlichkeit WHERE id =".$id);
|
||||
|
||||
// $input['projekt'] = $this->app->erp->ReplaceProjekt(true,$input['projekt'],true); // Parameters: Target db?, value, from form?
|
||||
if ($status != 'angelegt' && $id != 'NULL') {
|
||||
$internebemerkung = $input['internebemerkung'];
|
||||
unset($input);
|
||||
$input['internebemerkung'] = $internebemerkung;
|
||||
} else {
|
||||
$input['adresse'] = $this->app->erp->ReplaceAdresse(true,$input['adresse'],true); // Parameters: Target db?, value, from form?
|
||||
$input['rechnungsdatum'] = $this->app->erp->ReplaceDatum(true,$input['rechnungsdatum'],true); // Parameters: Target db?, value, from form?
|
||||
$input['eingangsdatum'] = $this->app->erp->ReplaceDatum(true,$input['eingangsdatum'],true); // Parameters: Target db?, value, from form?
|
||||
$input['skontobis'] = $this->app->erp->ReplaceDatum(true,$input['skontobis'],true); // Parameters: Target db?, value, from form?
|
||||
$input['zahlbarbis'] = $this->app->erp->ReplaceDatum(true,$input['zahlbarbis'],true); // Parameters: Target db?, value, from form?
|
||||
$input['projekt'] = $this->app->erp->ReplaceProjekt(true,$input['projekt'],true);
|
||||
$input['kostenstelle'] = $this->app->erp->ReplaceKostenstelle(true,$input['kostenstelle'],true);
|
||||
$input['sachkonto'] = $this->app->erp->ReplaceKontorahmen(true,$input['sachkonto'],true);
|
||||
}
|
||||
|
||||
$columns = "id, ";
|
||||
$values = "$id, ";
|
||||
@ -196,8 +213,9 @@ class Verbindlichkeit {
|
||||
$this->app->DB->Update($sql);
|
||||
|
||||
if ($id == 'NULL') {
|
||||
$id = $this->app->DB->GetInsertID();
|
||||
$msg = $this->app->erp->base64_url_encode("<div class=\"success\">Das Element wurde erfolgreich angelegt.</div>");
|
||||
header("Location: index.php?module=verbindlichkeit&action=list&msg=$msg");
|
||||
header("Location: index.php?module=verbindlichkeit&action=edit&id=$id&msg=$msg");
|
||||
} else {
|
||||
$this->app->Tpl->Set('MESSAGE', "<div class=\"success\">Die Einstellungen wurden erfolgreich übernommen.</div>");
|
||||
}
|
||||
@ -216,6 +234,49 @@ class Verbindlichkeit {
|
||||
$verbindlichkeit_from_db = $result[0];
|
||||
}
|
||||
|
||||
// Summarize positions
|
||||
|
||||
$sql = "SELECT * FROM verbindlichkeit_position WHERE verbindlichkeit = ".$id;
|
||||
$positionen = $this->app->DB->SelectArr($sql);
|
||||
|
||||
if (!empty($positionen)) {
|
||||
$betrag_netto = 0;
|
||||
$betrag_brutto = 0;
|
||||
$steuer_normal = 0;
|
||||
$steuer_ermaessigt = 0;
|
||||
|
||||
/*
|
||||
Normal: umsatzsteuer leer, steuersatz = leer
|
||||
Ermäßigt: umsatzsteuer ermaessigt, steuersatz = -1
|
||||
Befreit: umsatzsteuer befreit, steursatz = -1
|
||||
Individuell: umsatzsteuer leer, steuersatz = wert
|
||||
*/
|
||||
|
||||
foreach ($positionen as $position) {
|
||||
|
||||
$tmpsteuersatz = null;
|
||||
$tmpsteuertext = null;
|
||||
$erloes = null;
|
||||
|
||||
// function GetSteuerPosition($typ, $posid,&$tmpsteuersatz = null, &$tmpsteuertext = null, &$erloes = null)
|
||||
|
||||
$this->app->erp->GetSteuerPosition("verbindlichkeit",$position['id'],$tmpsteuersatz,$tmpsteuertext,$erloes);
|
||||
|
||||
$position['steuersatz_berechnet'] = $tmpsteuersatz;
|
||||
$position['steuertext_berechnet'] = $tmpsteuertext;
|
||||
$position['steuererloes_berechnet'] = $erloes;
|
||||
|
||||
$betrag_netto += ($position['menge']*$position['preis']);
|
||||
$betrag_brutto += ($position['menge']*$position['preis'])*(1+($tmpsteuersatz/100));
|
||||
|
||||
}
|
||||
|
||||
$this->app->Tpl->Set('BETRAGNETTO', $betrag_netto);
|
||||
$this->app->Tpl->Set('BETRAGBRUTTO', round($betrag_brutto,2));
|
||||
|
||||
$this->app->Tpl->Set('BETRAGDISABLED', 'disabled');
|
||||
|
||||
}
|
||||
|
||||
/*
|
||||
* Add displayed items later
|
||||
@ -228,6 +289,23 @@ class Verbindlichkeit {
|
||||
|
||||
*/
|
||||
|
||||
if ($verbindlichkeit_from_db['status'] != 'angelegt' && $id != 'NULL') {
|
||||
$this->app->Tpl->Set('SAVEDISABLED','disabled');
|
||||
}
|
||||
|
||||
$this->app->Tpl->Set('FREIGABECHECKED', $verbindlichkeit_from_db['freigabe']==1?"checked":"");
|
||||
$this->app->Tpl->Set('RECHNUNGSFREIGABECHECKED', $verbindlichkeit_from_db['rechnungsfreigabe']==1?"checked":"");
|
||||
$this->app->Tpl->Set('BEZAHLTCHECKED', $verbindlichkeit_from_db['bezahlt']==1?"checked":"");
|
||||
|
||||
$this->app->Tpl->Set('RECHNUNGSDATUM',$this->app->erp->ReplaceDatum(false,$verbindlichkeit_from_db['rechnungsdatum'],false));
|
||||
$this->app->YUI->DatePicker("rechnungsdatum");
|
||||
$this->app->Tpl->Set('EINGANGSDATUM',$this->app->erp->ReplaceDatum(false,$verbindlichkeit_from_db['eingangsdatum'],false));
|
||||
$this->app->YUI->DatePicker("eingangsdatum");
|
||||
$this->app->Tpl->Set('SKONTOBIS',$this->app->erp->ReplaceDatum(false,$verbindlichkeit_from_db['skontobis'],false));
|
||||
$this->app->YUI->DatePicker("skontobis");
|
||||
$this->app->Tpl->Set('ZAHLBARBIS',$this->app->erp->ReplaceDatum(false,$verbindlichkeit_from_db['zahlbarbis'],false));
|
||||
$this->app->YUI->DatePicker("zahlbarbis");
|
||||
|
||||
$this->app->Tpl->Add('KURZUEBERSCHRIFT2', $verbindlichkeit_from_db['adresse_name']." ".$verbindlichkeit_from_db['rechnung']);
|
||||
|
||||
$sql = "SELECT " . $this->app->YUI->IconsSQLVerbindlichkeit() . " AS `icons` FROM verbindlichkeit v WHERE id=$id";
|
||||
@ -235,6 +313,12 @@ class Verbindlichkeit {
|
||||
$this->app->Tpl->Add('STATUSICONS', $icons[0]['icons']);
|
||||
|
||||
$this->app->YUI->AutoComplete("adresse", "adresse");
|
||||
$this->app->YUI->AutoComplete("projekt", "projektname", 1);
|
||||
$this->app->Tpl->Set('PROJEKT',$this->app->erp->ReplaceProjekt(false,$verbindlichkeit_from_db['projekt'],false));
|
||||
$this->app->YUI->AutoComplete("kostenstelle", "kostenstelle", 1);
|
||||
$this->app->Tpl->Set('KOSTENSTELLE',$this->app->erp->ReplaceKostenstelle(false,$verbindlichkeit_from_db['kostenstelle'],false));
|
||||
$this->app->YUI->AutoComplete("sachkonto","sachkonto_aufwendungen",1);
|
||||
$this->app->Tpl->Set('SACHKONTO',$this->app->erp->ReplaceKontorahmen(false,$verbindlichkeit_from_db['sachkonto'],false));
|
||||
|
||||
$waehrungenselect = $this->app->erp->GetSelect($this->app->erp->GetWaehrung(), $verbindlichkeit_from_db['waehrung']);
|
||||
$this->app->Tpl->Set('WAEHRUNG', $waehrungenselect);
|
||||
@ -243,11 +327,17 @@ class Verbindlichkeit {
|
||||
|
||||
$this->app->Tpl->Set('ADRESSE', $this->app->erp->ReplaceAdresse(false,$verbindlichkeit_from_db['adresse'],false)); // Convert ID to form display
|
||||
|
||||
$anzahldateien = $this->app->erp->AnzahlDateien("verbindlichkeit",$id);
|
||||
if ($anzahldateien > 0) {
|
||||
$file = urlencode("../../../../index.php?module=verbindlichkeit&action=inlinepdf&id=$id");
|
||||
$iframe = "<iframe width=\"100%\" height=\"100%\" style=\"height:calc(100vh - 110px)\" src=\"./js/production/generic/web/viewer.html?file=$file\"></iframe>";
|
||||
$this->app->Tpl->Set('INLINEPDF', $iframe);
|
||||
} else {
|
||||
$this->app->Tpl->Set('INLINEPDF', 'Keine Dateien vorhanden.');
|
||||
}
|
||||
|
||||
$this->app->Tpl->Parse('PAGE', "verbindlichkeit_edit.tpl");
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
@ -263,12 +353,12 @@ class Verbindlichkeit {
|
||||
$input['skonto'] = $this->app->Secure->GetPOST('skonto');
|
||||
$input['skontobis'] = $this->app->Secure->GetPOST('skontobis');
|
||||
$input['projekt'] = $this->app->Secure->GetPOST('projekt');
|
||||
$input['bezahlt'] = $this->app->Secure->GetPOST('bezahlt');
|
||||
$input['bezahlt'] = $this->app->Secure->GetPOST('bezahlt')?'1':'0';;
|
||||
$input['zahlungsweise'] = $this->app->Secure->GetPOST('zahlungsweise');
|
||||
$input['eingangsdatum'] = $this->app->Secure->GetPOST('eingangsdatum');
|
||||
$input['rechnungsdatum'] = $this->app->Secure->GetPOST('rechnungsdatum');
|
||||
$input['freigabe'] = $this->app->Secure->GetPOST('freigabe');
|
||||
$input['rechnungsfreigabe'] = $this->app->Secure->GetPOST('rechnungsfreigabe');
|
||||
$input['freigabe'] = $this->app->Secure->GetPOST('freigabe')?'1':'0';
|
||||
$input['rechnungsfreigabe'] = $this->app->Secure->GetPOST('rechnungsfreigabe')?'1':'0';
|
||||
$input['kostenstelle'] = $this->app->Secure->GetPOST('kostenstelle');
|
||||
$input['sachkonto'] = $this->app->Secure->GetPOST('sachkonto');
|
||||
$input['internebemerkung'] = $this->app->Secure->GetPOST('internebemerkung');
|
||||
@ -283,9 +373,25 @@ class Verbindlichkeit {
|
||||
} else {
|
||||
$anzahldateien="";
|
||||
}
|
||||
|
||||
if ($id != 'NULL') {
|
||||
$this->app->erp->MenuEintrag("index.php?module=verbindlichkeit&action=dateien&id=$id", "Dateien".$anzahldateien);
|
||||
}
|
||||
|
||||
$this->app->erp->MenuEintrag("index.php?module=verbindlichkeit&action=edit&id=$id", "Details");
|
||||
$this->app->erp->MenuEintrag("index.php?module=verbindlichkeit&action=list", "Zurück zur Übersicht");
|
||||
$this->app->erp->MenuEintrag("index.php?module=verbindlichkeit&action=dateien&id=$id", "Dateien".$anzahldateien);
|
||||
|
||||
$invoiceArr = $this->app->DB->SelectRow("SELECT v.belegnr, a.name, v.status FROM verbindlichkeit v LEFT JOIN adresse a ON v.adresse = a.id WHERE v.id='$id' LIMIT 1");
|
||||
$belegnr = $invoiceArr['belegnr'];
|
||||
$name = $invoiceArr['name'];
|
||||
if($belegnr=='0' || $belegnr=='') {
|
||||
$belegnr ='(Entwurf)';
|
||||
}
|
||||
$this->app->Tpl->Set('KURZUEBERSCHRIFT2',"$name Rechnung $belegnr");
|
||||
$status = $invoiceArr['status'];
|
||||
if ($status==='angelegt') {
|
||||
$this->app->erp->MenuEintrag("index.php?module=verbindlichkeit&action=freigabe&id=$id",'Freigabe');
|
||||
}
|
||||
}
|
||||
|
||||
function verbindlichkeit_dateien()
|
||||
@ -402,4 +508,12 @@ class Verbindlichkeit {
|
||||
$this->app->BuildNavigation=false;
|
||||
}
|
||||
|
||||
function verbindlichkeit_freigabe()
|
||||
{
|
||||
$id = $this->app->Secure->GetGET('id');
|
||||
$this->app->erp->BelegFreigabe('verbindlichkeit',$id);
|
||||
$this->verbindlichkeit_edit();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
@ -85,10 +85,7 @@ class WidgetGenverbindlichkeit_position
|
||||
$this->form->NewField($field);
|
||||
$this->form->AddMandatory("menge","notempty","Pflichtfeld!","MSGMENGE");
|
||||
|
||||
$field = new HTMLInput("preis","text","","50","","","","","","","","0","","");
|
||||
$this->form->NewField($field);
|
||||
|
||||
$field = new HTMLInput("waehrung","text","","15","","","","","","","","0","","");
|
||||
$field = new HTMLInput("preis","text","","40","","","","","","","","0","","");
|
||||
$this->form->NewField($field);
|
||||
|
||||
$field = new HTMLSelect("umsatzsteuer",0,"umsatzsteuer","","","0");
|
||||
|
@ -36,8 +36,8 @@ $('#anderersteuersatz').click(function() { if (!$(this).is(':checked')) {
|
||||
<tr><td nowrap>{|Artikel-Nr|}:</td><td>[NUMMER][MSGNUMMER]</td></tr>
|
||||
<tr><td>{|Beschreibung|}:</td><td>[BESCHREIBUNG][MSGBESCHREIBUNG]</td></tr>
|
||||
<tr><td>{|Menge|}:</td><td>[MENGE][MSGMENGE]</td></tr>
|
||||
<tr><td>{|Preis|}:</td><td>[PREIS][MSGPREIS]</td></tr>
|
||||
<tr><td>{|Währung|}:</td><td>[WAEHRUNG][MSGWAEHRUNG] [WAEHRUNGSBUTTON]</td></tr>
|
||||
<tr><td>{|Preis|}:</td><td>[PREIS][MSGPREIS][WAEHRUNG]</td></tr>
|
||||
<!-- <tr><td>{|Währung|}:</td><td>[WAEHRUNG][MSGWAEHRUNG] [WAEHRUNGSBUTTON]</td></tr>-->
|
||||
<tr><td>{|Steuersatz|}:</td><td>[UMSATZSTEUER][MSGUMSATZSTEUER]
|
||||
[ANDERERSTEUERSATZ][MSGANDERERSTEUERSATZ] individuellen Steuersatz verwenden
|
||||
</td></tr>
|
||||
|
Loading…
Reference in New Issue
Block a user