mirror of
https://github.com/OpenXE-org/OpenXE.git
synced 2024-12-25 14:10:28 +01:00
zwischenstand verbindlichkeit filert, multi-action, forms
This commit is contained in:
parent
8664e16c55
commit
8f9ed4d7ae
@ -3606,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\">";
|
$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\">";
|
$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>',
|
return "CONCAT('<table><tr><td nowrap>',
|
||||||
if(v.freigabe,'$go_ware','$stop_ware'),
|
if(v.freigabe,'$go_ware','$stop_ware'),
|
||||||
if(v.rechnungsfreigabe,'$go_summe','$stop_summe'),
|
if(v.rechnungsfreigabe,'$go_summe','$stop_summe'),
|
||||||
IF( v.betragbezahlt = 0 OR (v.betrag > 0 AND v.betragbezahlt < 0),'$stop_betragbezahlt',
|
if(v.bezahlt,'$go_betragbezahlt','$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'
|
|
||||||
),
|
|
||||||
'</td></tr></table>')";
|
'</td></tr></table>')";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -45,7 +45,7 @@
|
|||||||
{|Adresse|}:
|
{|Adresse|}:
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<input type="text" name="adresse" id="adresse" value="[ADRESSE]" size="20" [SAVEDISABLED]>
|
<input type="text" name="adresse" id="adresse" value="[ADRESSE]" size="20" [SAVEDISABLED] required>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
@ -74,16 +74,24 @@
|
|||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td>
|
<td>
|
||||||
{|Betrag|}:
|
{|Betrag brutto|}:
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<input type="number" name="betragbrutto" id="betragbrutto" value="[BETRAGBRUTTO]" size="20" [BETRAGDISABLED] [SAVEDISABLED]>
|
<input type="number" name="betrag" id="betrag" value="[BETRAG]" size="20" [SAVEDISABLED]>
|
||||||
<select name="waehrung" [SAVEDISABLED]>[WAEHRUNG]</select>
|
<select name="waehrung" [SAVEDISABLED]>[WAEHRUNG]</select>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td>
|
<td>
|
||||||
{|Betrag netto|}:
|
{|Betrag Positionen brutto|}:
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<input type="number" name="betragbruttopos" id="betragbruttopos" value="[BETRAGBRUTTOPOS]" size="20" disabled>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
{|Betrag Positionen netto|}:
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<input type="number" name="betragnetto" id="betragnetto" value="[BETRAGNETTO]" size="20" disabled [SAVEDISABLED]>
|
<input type="number" name="betragnetto" id="betragnetto" value="[BETRAGNETTO]" size="20" disabled [SAVEDISABLED]>
|
||||||
@ -118,7 +126,7 @@
|
|||||||
{|Waren-/Leistungsprüfung (Einkauf)|}:
|
{|Waren-/Leistungsprüfung (Einkauf)|}:
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<input type="checkbox" id="freigabe" value="1" [FREIGABECHECKED] size="20" [SAVEDISABLED] disabled>
|
<input type="checkbox" id="wareneingang" value="1" [WARENEINGANGCHECKED] size="20" disabled><i>Wird gesetzt wenn Wareneingangspositionen vollständig</i>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
@ -126,7 +134,8 @@
|
|||||||
{|Rechnungseingangsprüfung (Buchhaltung)|}:
|
{|Rechnungseingangsprüfung (Buchhaltung)|}:
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<input type="checkbox" id="rechnungsfreigabe" value="1" [RECHNUNGSFREIGABECHECKED] size="20" [SAVEDISABLED] disabled>
|
<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"></a>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
@ -134,7 +143,8 @@
|
|||||||
{|Bezahlt|}:
|
{|Bezahlt|}:
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<input type="checkbox" id="bezahlt" value="1" [BEZAHLTCHECKED] size="20" [SAVEDISABLED] disabled>
|
<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"></a>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
|
@ -4,7 +4,61 @@
|
|||||||
</ul>
|
</ul>
|
||||||
<div id="tabs-1">
|
<div id="tabs-1">
|
||||||
[MESSAGE]
|
[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>
|
||||||
|
</ul>
|
||||||
|
<form method="post" action="#">
|
||||||
|
<input type="submit" class="btnBlue" name="status_berechnen" value="{|Status berechnen|}" />
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<form method="post" action="#">
|
||||||
[TAB1]
|
[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]
|
[TAB1NEXT]
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
function alleauswaehlen()
|
||||||
|
{
|
||||||
|
var wert = $('#auswahlalle').prop('checked');
|
||||||
|
$('#verbindlichkeit_list').find(':checkbox').prop('checked',wert);
|
||||||
|
}
|
||||||
|
|
||||||
|
</script>
|
||||||
|
@ -24,6 +24,9 @@ class Verbindlichkeit {
|
|||||||
$this->app->ActionHandler("inlinepdf", "verbindlichkeit_inlinepdf");
|
$this->app->ActionHandler("inlinepdf", "verbindlichkeit_inlinepdf");
|
||||||
$this->app->ActionHandler("positioneneditpopup", "verbindlichkeit_positioneneditpopup");
|
$this->app->ActionHandler("positioneneditpopup", "verbindlichkeit_positioneneditpopup");
|
||||||
$this->app->ActionHandler("freigabe", "verbindlichkeit_freigabe");
|
$this->app->ActionHandler("freigabe", "verbindlichkeit_freigabe");
|
||||||
|
$this->app->ActionHandler("freigabeeinkauf", "verbindlichkeit_freigabeeinkauf");
|
||||||
|
$this->app->ActionHandler("freigabebuchhaltung", "verbindlichkeit_freigabebuchhaltung");
|
||||||
|
$this->app->ActionHandler("freigabebezahlt", "verbindlichkeit_freigabebezahlt");
|
||||||
|
|
||||||
$this->app->DefaultActionHandler("list");
|
$this->app->DefaultActionHandler("list");
|
||||||
$this->app->ActionHandlerListen($app);
|
$this->app->ActionHandlerListen($app);
|
||||||
@ -33,7 +36,7 @@ class Verbindlichkeit {
|
|||||||
/* Fill out manually later */
|
/* Fill out manually later */
|
||||||
}
|
}
|
||||||
|
|
||||||
static function TableSearch(&$app, $name, $erlaubtevars) {
|
function TableSearch(&$app, $name, $erlaubtevars) {
|
||||||
switch ($name) {
|
switch ($name) {
|
||||||
case "verbindlichkeit_list":
|
case "verbindlichkeit_list":
|
||||||
$allowed['verbindlichkeit_list'] = array('list');
|
$allowed['verbindlichkeit_list'] = array('list');
|
||||||
@ -105,6 +108,52 @@ class Verbindlichkeit {
|
|||||||
$count = "SELECT count(DISTINCT id) FROM verbindlichkeit WHERE $where";
|
$count = "SELECT count(DISTINCT id) FROM verbindlichkeit WHERE $where";
|
||||||
// $groupby = "";
|
// $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
|
||||||
|
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -119,12 +168,55 @@ class Verbindlichkeit {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function verbindlichkeit_list() {
|
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':
|
||||||
|
echo("freigabeeinkauf");
|
||||||
|
break;
|
||||||
|
case 'freigabebuchhaltung':
|
||||||
|
echo("freigabebuchhaltung");
|
||||||
|
break;
|
||||||
|
case 'bezahlt':
|
||||||
|
echo("bezahlt");
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
$this->app->erp->MenuEintrag("index.php?module=verbindlichkeit&action=list", "Übersicht");
|
$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?module=verbindlichkeit&action=create", "Neu anlegen");
|
||||||
|
|
||||||
$this->app->erp->MenuEintrag("index.php", "Zurück");
|
$this->app->erp->MenuEintrag("index.php", "Zurück");
|
||||||
|
|
||||||
$this->app->YUI->TableSearch('TAB1', 'verbindlichkeit_list', "show", "", "", basename(__FILE__), __CLASS__);
|
$this->app->YUI->TableSearch('TAB1', 'verbindlichkeit_list', "show", "", "", basename(__FILE__), __CLASS__);
|
||||||
|
|
||||||
|
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->Tpl->Parse('PAGE', "verbindlichkeit_list.tpl");
|
$this->app->Tpl->Parse('PAGE', "verbindlichkeit_list.tpl");
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -175,17 +267,24 @@ class Verbindlichkeit {
|
|||||||
|
|
||||||
if ($status != 'angelegt' && $id != 'NULL') {
|
if ($status != 'angelegt' && $id != 'NULL') {
|
||||||
$internebemerkung = $input['internebemerkung'];
|
$internebemerkung = $input['internebemerkung'];
|
||||||
|
$projekt = $input['projekt'];
|
||||||
|
$kostenstelle = $input['kostenstelle'];
|
||||||
unset($input);
|
unset($input);
|
||||||
$input['internebemerkung'] = $internebemerkung;
|
$input['internebemerkung'] = $internebemerkung;
|
||||||
|
$input['projekt'] = $this->app->erp->ReplaceProjekt(true,$projekt,true);
|
||||||
|
$input['kostenstelle'] = $this->app->erp->ReplaceKostenstelle(true,$kostenstelle,true);
|
||||||
} else {
|
} else {
|
||||||
$input['adresse'] = $this->app->erp->ReplaceAdresse(true,$input['adresse'],true); // Parameters: Target db?, value, from form?
|
$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['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['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['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['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['projekt'] = $this->app->erp->ReplaceProjekt(true,$input['projekt'],true);
|
||||||
$input['kostenstelle'] = $this->app->erp->ReplaceKostenstelle(true,$input['kostenstelle'],true);
|
$input['kostenstelle'] = $this->app->erp->ReplaceKostenstelle(true,$input['kostenstelle'],true);
|
||||||
$input['sachkonto'] = $this->app->erp->ReplaceKontorahmen(true,$input['sachkonto'],true);
|
|
||||||
|
if(empty($input['projekt']) && !empty($input['adresse'])) {
|
||||||
|
$input['projekt'] = $this->app->erp->GetCreateProjekt($input['adresse']);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$columns = "id, ";
|
$columns = "id, ";
|
||||||
@ -272,7 +371,7 @@ class Verbindlichkeit {
|
|||||||
}
|
}
|
||||||
|
|
||||||
$this->app->Tpl->Set('BETRAGNETTO', $betrag_netto);
|
$this->app->Tpl->Set('BETRAGNETTO', $betrag_netto);
|
||||||
$this->app->Tpl->Set('BETRAGBRUTTO', round($betrag_brutto,2));
|
$this->app->Tpl->Set('BETRAGBRUTTOPOS', round($betrag_brutto,2));
|
||||||
|
|
||||||
$this->app->Tpl->Set('BETRAGDISABLED', 'disabled');
|
$this->app->Tpl->Set('BETRAGDISABLED', 'disabled');
|
||||||
|
|
||||||
@ -293,7 +392,14 @@ class Verbindlichkeit {
|
|||||||
$this->app->Tpl->Set('SAVEDISABLED','disabled');
|
$this->app->Tpl->Set('SAVEDISABLED','disabled');
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->app->Tpl->Set('FREIGABECHECKED', $verbindlichkeit_from_db['freigabe']==1?"checked":"");
|
if ($verbindlichkeit_from_db['status'] == 'angelegt' || $verbindlichkeit_from_db['rechnungsfreigabe']) {
|
||||||
|
$this->app->Tpl->Set('FREIGABEBUCHHALTUNGHIDDEN','hidden');
|
||||||
|
}
|
||||||
|
if ($verbindlichkeit_from_db['status'] == 'angelegt' || $verbindlichkeit_from_db['bezahlt'] == '1') {
|
||||||
|
$this->app->Tpl->Set('FREIGABEBEZAHLTHIDDEN','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('RECHNUNGSFREIGABECHECKED', $verbindlichkeit_from_db['rechnungsfreigabe']==1?"checked":"");
|
||||||
$this->app->Tpl->Set('BEZAHLTCHECKED', $verbindlichkeit_from_db['bezahlt']==1?"checked":"");
|
$this->app->Tpl->Set('BEZAHLTCHECKED', $verbindlichkeit_from_db['bezahlt']==1?"checked":"");
|
||||||
|
|
||||||
@ -306,26 +412,29 @@ class Verbindlichkeit {
|
|||||||
$this->app->Tpl->Set('ZAHLBARBIS',$this->app->erp->ReplaceDatum(false,$verbindlichkeit_from_db['zahlbarbis'],false));
|
$this->app->Tpl->Set('ZAHLBARBIS',$this->app->erp->ReplaceDatum(false,$verbindlichkeit_from_db['zahlbarbis'],false));
|
||||||
$this->app->YUI->DatePicker("zahlbarbis");
|
$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";
|
$sql = "SELECT " . $this->app->YUI->IconsSQLVerbindlichkeit() . " AS `icons` FROM verbindlichkeit v WHERE id=$id";
|
||||||
$icons = $this->app->DB->SelectArr($sql);
|
$icons = $this->app->DB->SelectArr($sql);
|
||||||
$this->app->Tpl->Add('STATUSICONS', $icons[0]['icons']);
|
$this->app->Tpl->Add('STATUSICONS', $icons[0]['icons']);
|
||||||
|
|
||||||
$this->app->YUI->AutoComplete("adresse", "adresse");
|
$this->app->YUI->AutoComplete("adresse", "lieferant");
|
||||||
$this->app->YUI->AutoComplete("projekt", "projektname", 1);
|
$this->app->YUI->AutoComplete("projekt", "projektname", 1);
|
||||||
$this->app->Tpl->Set('PROJEKT',$this->app->erp->ReplaceProjekt(false,$verbindlichkeit_from_db['projekt'],false));
|
$this->app->Tpl->Set('PROJEKT',$this->app->erp->ReplaceProjekt(false,$verbindlichkeit_from_db['projekt'],false));
|
||||||
$this->app->YUI->AutoComplete("kostenstelle", "kostenstelle", 1);
|
$this->app->YUI->AutoComplete("kostenstelle", "kostenstelle", 1);
|
||||||
$this->app->Tpl->Set('KOSTENSTELLE',$this->app->erp->ReplaceKostenstelle(false,$verbindlichkeit_from_db['kostenstelle'],false));
|
$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']);
|
$waehrungenselect = $this->app->erp->GetSelect($this->app->erp->GetWaehrung(), $verbindlichkeit_from_db['waehrung']);
|
||||||
$this->app->Tpl->Set('WAEHRUNG', $waehrungenselect);
|
$this->app->Tpl->Set('WAEHRUNG', $waehrungenselect);
|
||||||
|
|
||||||
$this->app->Tpl->Set('ADRESSE_ID', $verbindlichkeit_from_db['adresse']);
|
$this->app->Tpl->Set('ADRESSE_ID', $verbindlichkeit_from_db['adresse']);
|
||||||
|
|
||||||
$this->app->Tpl->Set('ADRESSE', $this->app->erp->ReplaceAdresse(false,$verbindlichkeit_from_db['adresse'],false)); // Convert ID to form display
|
$this->app->Tpl->Set('ADRESSE', $this->app->erp->ReplaceLieferantennummer(false,$verbindlichkeit_from_db['adresse'],false)); // Convert ID to form display
|
||||||
|
|
||||||
|
if (empty($verbindlichkeit_from_db['adresse'])) {
|
||||||
|
$this->app->Tpl->Set('FREIGABEBUCHHALTUNGHIDDEN','hidden');
|
||||||
|
$this->app->Tpl->Set('FREIGABEBEZAHLTHIDDEN','hidden');
|
||||||
|
}
|
||||||
|
|
||||||
|
$this->app->YUI->CkEditor("internebemerkung");
|
||||||
|
|
||||||
$anzahldateien = $this->app->erp->AnzahlDateien("verbindlichkeit",$id);
|
$anzahldateien = $this->app->erp->AnzahlDateien("verbindlichkeit",$id);
|
||||||
if ($anzahldateien > 0) {
|
if ($anzahldateien > 0) {
|
||||||
@ -360,13 +469,15 @@ class Verbindlichkeit {
|
|||||||
$input['freigabe'] = $this->app->Secure->GetPOST('freigabe')?'1':'0';
|
$input['freigabe'] = $this->app->Secure->GetPOST('freigabe')?'1':'0';
|
||||||
$input['rechnungsfreigabe'] = $this->app->Secure->GetPOST('rechnungsfreigabe')?'1':'0';
|
$input['rechnungsfreigabe'] = $this->app->Secure->GetPOST('rechnungsfreigabe')?'1':'0';
|
||||||
$input['kostenstelle'] = $this->app->Secure->GetPOST('kostenstelle');
|
$input['kostenstelle'] = $this->app->Secure->GetPOST('kostenstelle');
|
||||||
$input['sachkonto'] = $this->app->Secure->GetPOST('sachkonto');
|
|
||||||
$input['internebemerkung'] = $this->app->Secure->GetPOST('internebemerkung');
|
$input['internebemerkung'] = $this->app->Secure->GetPOST('internebemerkung');
|
||||||
return $input;
|
return $input;
|
||||||
}
|
}
|
||||||
|
|
||||||
function verbindlichkeit_menu($id) {
|
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);
|
$anzahldateien = $this->app->erp->AnzahlDateien("verbindlichkeit",$id);
|
||||||
if ($anzahldateien > 0) {
|
if ($anzahldateien > 0) {
|
||||||
$anzahldateien = " (".$anzahldateien.")";
|
$anzahldateien = " (".$anzahldateien.")";
|
||||||
@ -378,16 +489,13 @@ class Verbindlichkeit {
|
|||||||
$this->app->erp->MenuEintrag("index.php?module=verbindlichkeit&action=dateien&id=$id", "Dateien".$anzahldateien);
|
$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");
|
|
||||||
|
|
||||||
$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");
|
$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'];
|
$belegnr = $invoiceArr['belegnr'];
|
||||||
$name = $invoiceArr['name'];
|
$name = $invoiceArr['name'];
|
||||||
if($belegnr=='0' || $belegnr=='') {
|
if($belegnr=='0' || $belegnr=='') {
|
||||||
$belegnr ='(Entwurf)';
|
$belegnr ='(Entwurf)';
|
||||||
}
|
}
|
||||||
$this->app->Tpl->Set('KURZUEBERSCHRIFT2',"$name Rechnung $belegnr");
|
$this->app->Tpl->Set('KURZUEBERSCHRIFT2',"$name Verbindlichkeit $belegnr");
|
||||||
$status = $invoiceArr['status'];
|
$status = $invoiceArr['status'];
|
||||||
if ($status==='angelegt') {
|
if ($status==='angelegt') {
|
||||||
$this->app->erp->MenuEintrag("index.php?module=verbindlichkeit&action=freigabe&id=$id",'Freigabe');
|
$this->app->erp->MenuEintrag("index.php?module=verbindlichkeit&action=freigabe&id=$id",'Freigabe');
|
||||||
@ -515,5 +623,38 @@ class Verbindlichkeit {
|
|||||||
$this->verbindlichkeit_edit();
|
$this->verbindlichkeit_edit();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function verbindlichkeit_freigabeeinkauf($id)
|
||||||
|
{
|
||||||
|
if (empty($id)) {
|
||||||
|
$id = $this->app->Secure->GetGET('id');
|
||||||
|
}
|
||||||
|
$sql = "UPDATE verbindlichkeit SET freigabe = 1 WHERE id=".$id;
|
||||||
|
$this->app->DB->Update($sql);
|
||||||
|
$this->app->erp->BelegProtokoll("verbindlichkeit",$id,"Verbindlichkeit freigegeben (Einkauf)");
|
||||||
|
$this->verbindlichkeit_edit();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
function verbindlichkeit_freigabebuchhaltung($id)
|
||||||
|
{
|
||||||
|
if (empty($id)) {
|
||||||
|
$id = $this->app->Secure->GetGET('id');
|
||||||
|
}
|
||||||
|
$sql = "UPDATE verbindlichkeit SET rechnungsfreigabe = 1 WHERE id=".$id;
|
||||||
|
$this->app->DB->Update($sql);
|
||||||
|
$this->app->erp->BelegProtokoll("verbindlichkeit",$id,"Verbindlichkeit freigegeben (Buchhaltung)");
|
||||||
|
$this->verbindlichkeit_edit();
|
||||||
|
}
|
||||||
|
|
||||||
|
function verbindlichkeit_freigabebezahlt($id)
|
||||||
|
{
|
||||||
|
if (empty($id)) {
|
||||||
|
$id = $this->app->Secure->GetGET('id');
|
||||||
|
}
|
||||||
|
$sql = "UPDATE verbindlichkeit SET bezahlt = 1 WHERE id=".$id;
|
||||||
|
$this->app->DB->Update($sql);
|
||||||
|
$this->app->erp->BelegProtokoll("verbindlichkeit",$id,"Verbindlichkeit als bezahlt markiert");
|
||||||
|
$this->verbindlichkeit_edit();
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user