Kontenrahmen module restored, also importvorlage for kontenrahmen implemented

This commit is contained in:
OpenXE 2023-03-01 16:27:52 +01:00
parent 37a6fecc36
commit 2ffee66e00
4 changed files with 242 additions and 435 deletions

View File

@ -6,6 +6,7 @@
<li><a href="#tabs-3">{|Zeiterfassung|}</a></li>
<li><a href="#tabs-4">{|Wiedervorlagen|}</a></li>
<li><a href="#tabs-5">{|Notizen|}</a></li>
<li><a href="#tabs-6">{|Kontorahmen|}</a></li>
</ul>
<div id="tabs-1">
@ -503,4 +504,51 @@
</div>
</div>
</div>
<div id="tabs-6">
<div class="row">
<div class="col-xs-12 col-sm-1 col-sm-height">
<div class="inside inside-full-height">
<fieldset><legend>{|Kontorahmen|}</legend>
<table class="mkTable">
<tr>
<th>Variable</th>
<th>Beschreibung</th>
<th>Kommentar</th>
</tr>
<tr>
<td>sachkonto</td>
<td>Sachkontonummer</td>
<td></td>
</tr>
<tr>
<td>beschriftung</td>
<td>Sachkontobeschriftung</td>
<td></td>
</tr>
<tr>
<td>art</td>
<td>Art des Kontos</td>
<td>'Aufwendungen', 'Erl&ouml;se', 'Geldtransit' oder 'Saldo'</td>
</tr>
<tr>
<td>bemerkung</td>
<td>Bemerkung zum Konto</td>
<td>optional</td>
</tr>
<tr>
<td>projekt</td>
<td>Projekt-Kennung</td>
<td>optional</td>
</tr>
<tr>
<td>ausblenden</td>
<td>Soll das Konto ausgeblendet werden?</td>
<td>0 oder 1</td>
</tr>
</table>
</fieldset>
</div>
</div>
</div>
</div>
</div>

View File

@ -1,333 +1,30 @@
<!-- gehort zu tabview -->
<div id="tabs">
<ul>
<li><a href="#tabs-1">[TABTEXT]</a></li>
<li><a href="#tabs-1">[TABTEXT1]</a></li>
</ul>
<!-- ende gehort zu tabview -->
<!-- erstes tab -->
<form method="post">
<div id="tabs-1">
[MESSAGE]
[TAB1]
<fieldset>
<legend>{|Stapelverarbeitung|}</legend>
<input type="checkbox" id="auswahlalle" onchange="kontorahmenmarkieren();" />&nbsp;{|alle markieren|}&nbsp;
<input type="submit" class="btnBlue" name="loeschen" id="loeschen" value="Alle markierten l&ouml;schen" />
</fieldset>
<!--<fieldset>
<legend>Anlegen</legend>
<table>
<tr>
<td width="40">Konto:</td><td width="170"><input type="text" name="konto" id="konto"></td>
<td width="75">Beschriftung:</td><td width="170"><input type="text" name="beschriftung" id="beschriftung"></td>
<td width="23">Art:</td><td width="145"><select name="art" id="art" style="width:11em">
<option value="0"></option>
<option value="1">Aufwendungen</option>
<option value="2">Erl&ouml;se</option>
<option value="3">Geldtransit</option>
<option value="9">Saldo</option>
</select></td>
<td>Nicht sichtbar:</td><td width="40"><input type="checkbox" name="nichtsichtbar" id="nichtsichtbar" value="1"></td>
<td><input type="submit" name="anlegen" id="anlegen" value="Anlegen"></td>
</tr>
</table>
</fieldset>-->
[TAB1NEXT]
<!--<input type="button" class="check" onclick="kontorahmenmarkieren()" name="markieren" id="markieren" value="Alle markieren" />-->
</div>
<!-- tab view schließen -->
</div>
<div id="editKontorahmen" style="display:none;" title="Bearbeiten">
<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>{|Kontorahmen|}</legend>
<input type="hidden" id="editid">
<table>
<tr>
<td>{|Konto|}:</td>
<td><input type="text" name="editkonto" id="editkonto" size="40"></td>
</tr>
<tr>
<td width="120">{|Beschriftung|}:</td>
<td><input type="text" name="editbeschriftung" id="editbeschriftung" size="40"></td>
</tr>
<tr>
<td>{|Art|}:</td>
<td><select name="editart" id="editart">
<option value="0"></option>
<option value="1">Aufwendungen</option>
<option value="2">Erl&ouml;se</option>
<option value="3">Geldtransit</option>
<option value="9">Saldo</option>
</select>
</td>
</tr>
<tr>
<td>{|Bemerkung|}:</td>
<td><textarea name="editbemerkung" id="editbemerkung" rows="5" cols="38"></textarea></td>
</tr>
<tr>
<td>{|Projekt|}:</td>
<td><input type="text" name="editprojekt" id="editprojekt" size="40"></td>
</tr>
<tr>
<td>{|Nicht sichtbar|}:</td>
<td><input type="checkbox" name="editnichtsichtbar" id="editnichtsichtbar" value="1" size="40"></td>
</tr>
</table>
</fieldset>
</div>
</div>
<div id="tabs-1">
<form action="#tabs-1" id="frmauto" name="frmauto" method="post">
[MESSAGE]
[TAB1]
<fieldset>
<table>
<legend>Stapelverarbeitung</legend>
<tr>
<td><input type="checkbox" value="1" id="autoalle" />&nbsp;alle markieren&nbsp;</td><td><input type="submit" class="btnBlue" name="ausfuehren" value="{|L&ouml;schen|}" /></td>
</tr>
</table>
</fieldset>
</form>
[TAB1NEXT]
</div>
</div>
</div>
<script>
</form>
<script type="text/javascript">
$(document).ready(function() {
$('#editkonto').focus();
$("#editKontorahmen").dialog({
modal: true,
bgiframe: true,
closeOnEscape:false,
minWidth:600,
autoOpen: false,
buttons: {
ABBRECHEN: function() {
KontorahmenReset();
$(this).dialog('close');
},
SPEICHERN: function() {
Kontorahmen_EditSave();
}
}
});
$("#editKontorahmen").dialog({
close: function( event, ui ) {KontorahmenReset();}
});
});
function KontorahmenReset(){
$('#editKontorahmen').find('#editid').val('');
$('#editKontorahmen').find('#editkonto').val('');
$('#editKontorahmen').find('#editbeschriftung').val('');
$('#editKontorahmen').find('#editart').val('');
$('#editKontorahmen').find('#editbemerkung').val('');
$('#editKontorahmen').find('#editprojekt').val('');
$('#editKontorahmen').find('#editnichtsichtbar').prop('checked', false);
}
function Kontorahmen_EditSave() {
$.ajax({
url: 'index.php?module=kontorahmen&action=save',
data: {
//Alle Felder die fürs editieren vorhanden sind
editid: $('#editid').val(),
editkonto: $('#editkonto').val(),
editbeschriftung: $('#editbeschriftung').val(),
editart: $('#editart').val(),
editbemerkung: $('#editbemerkung').val(),
editprojekt: $('#editprojekt').val(),
editnichtsichtbar: $('#editnichtsichtbar').prop("checked")?1:0,
},
method: 'post',
dataType: 'json',
beforeSend: function() {
App.loading.open();
},
success: function(data) {
App.loading.close();
if (data.status == 1) {
KontorahmenReset();
updateLiveTable();
$("#editKontorahmen").dialog('close');
} else {
alert(data.statusText);
}
}
$('#autoalle').on('change',function(){
var wert = $(this).prop('checked');
$('#kontorahmen_list').find('input[type="checkbox"]').prop('checked',wert);
$('#kontorahmen_list').find('input[type="checkbox"]').first().trigger('change');
});
}
function Kontorahmen_Edit(id) {
if(id > 0){
$.ajax({
url: 'index.php?module=kontorahmen&action=edit&cmd=get',
data: {
id: id
},
method: 'post',
dataType: 'json',
beforeSend: function() {
App.loading.open();
},
success: function(data) {
$('#editKontorahmen').find('#editid').val(data.id);
$('#editKontorahmen').find('#editkonto').val(data.sachkonto);
$('#editKontorahmen').find('#editbeschriftung').val(data.beschriftung);
$('#editKontorahmen').find('#editart').val(data.art);
$('#editKontorahmen').find('#editbemerkung').val(data.bemerkung);
$('#editKontorahmen').find('#editprojekt').val(data.projekt);
$('#editKontorahmen').find('#editnichtsichtbar').prop("checked",data.ausblenden==1?true:false);
if(data.art=="" || data.art <=0 )
$('#editKontorahmen').find('#editart').val('0');
else
$('#editKontorahmen').find('#editart').val(data.art);
App.loading.close();
$("#editKontorahmen").dialog('open');
}
});
}else{
KontorahmenReset();
$("#editKontorahmen").dialog('open');
}
}
function updateLiveTable(i) {
var oTableL = $('#kontorahmenlist').dataTable();
var tmp = $('.dataTables_filter input[type=search]').val();
oTableL.fnFilter('%');
//oTableL.fnFilter('');
oTableL.fnFilter(tmp);
}
/*function Kontorahmen_Delete(id) {
var conf = confirm('Wirklich löschen?');
if (conf) {
$.ajax({
url: 'index.php?module=kontorahmen&action=delete',
data: {
id: id
},
method: 'post',
dataType: 'json',
beforeSend: function() {
App.loading.open();
},
success: function(data) {
if (data.status == 1) {
updateLiveTable();
} else {
alert(data.statusText);
}
App.loading.close();
}
});
}
return false;
}*/
</script>
<script type="text/javascript">
function chkontorahmen(kid)
{
var status = 0;
var el = '#kontorahmen_'+kid;
status = $(el).prop('checked');
if(status)status = 1;
if(kid)
{
$.ajax({
url: 'index.php?module=kontorahmen&action=chkontorahmen',
type: 'POST',
dataType: 'json',
data: {kontorahmen :kid, wert : status},
success: function(data) {
},
beforeSend: function() {
}
});
}
}
function alleauswaehlen()
{
var wert = $('#auswahlalle').prop('checked');
$('#kontorahmenlist').find(':checkbox').prop('checked',wert);
$.ajax({
url: 'index.php?module=kontorahmen&action=allemarkieren',
type: 'POST',
dataType: 'json',
data: {markiert : checked},
success: function(data){
},
beforeSend: function(){
}
});
}
function kontorahmenmarkieren(){
//$('.check:button').click(function(){
var checked = !$(this).data('checked');
$('input:checkbox').prop('checked', checked);
$('.check:button').val(checked ? 'Alle entmarkieren' : 'Alle markieren' )
$(this).data('checked', checked);
$.ajax({
url: 'index.php?module=kontorahmen&action=allemarkieren',
type: 'POST',
dataType: 'json',
data: {markiert : checked},
success: function(data){
},
beforeSend: function(){
}
});
//});
}
</script>

View File

@ -1418,7 +1418,7 @@ class Importvorlage extends GenImportvorlage {
$ersterdatensatz = 1;
$zeitstempel = time();
$number_of_rows = count($tmp['cmd']);
$number_of_rows = empty($tmp['cmd'])?0:count($tmp['cmd']);
$number_of_rows = $number_of_rows + 2;
if($isCronjob) {
@ -1553,6 +1553,13 @@ class Importvorlage extends GenImportvorlage {
}
}
// HERE START OF PROCESSING OF THE ROWS
// INSIDE FOR LOOP
// $i -> loop counter row number starting with 1
// $number_of_rows
// access data -> $tmp['column_name'][$i]
// $tmp['cmd'] -> create or update
// $tmp['checked'] -> 0 or 1
switch($ziel)
{
@ -5021,7 +5028,61 @@ class Importvorlage extends GenImportvorlage {
}
}
break;
}
case 'kontorahmen':
// Create a row dataset (without checked and cmd)
$update_sql = "";
$row = array();
$comma = "";
foreach ($tmp as $key => $value) {
if ($key != 'cmd' && $key != 'checked') {
$row[$key] = $value[$i];
$comma = ", ";
}
}
if (empty($row['sachkonto'])) {
break;
}
$art_array = array(
'1' => 'Aufwendungen',
'2' => 'Erlöse',
'3' => 'Geldtransit',
'9' => 'Saldo'
);
$row['art'] = array_search($row['art'], $art_array);
$row['projekt'] = $this->app->erp->ReplaceProjekt(true,$row['projekt'],true); // Parameters: Target db?, value, from form?
$sql = "SELECT * FROM kontorahmen WHERE sachkonto = '".$row['sachkonto']."'";
$result = $this->app->DB->SelectArr($sql);
if (!empty($result)) {
$comma = "";
foreach ($row as $key => $value) {
$update_sql .= $comma."`".$key."` = '".$value."'";
$comma = ", ";
}
$sql = "UPDATE kontorahmen SET ".$update_sql." WHERE `sachkonto` = '".$row['sachkonto']."'";
$result = $this->app->DB->Update($sql);
} else {
$sql = "INSERT INTO kontorahmen (".
implode(", ",array_keys($row)).
") VALUES ('".
implode("', '",array_values($row)).
"')";
$result = $this->app->DB->Update($sql);
}
break;
}
// HERE END OF PROCESSING THE ROWS switch($ziel);
if($isCronjob) {
$this->app->DB->Update(
sprintf(

View File

@ -1,113 +1,114 @@
<?php
/*
**** COPYRIGHT & LICENSE NOTICE *** DO NOT REMOVE ****
*
* Xentral (c) Xentral ERP Sorftware GmbH, Fuggerstrasse 11, D-86150 Augsburg, * Germany 2019
*
* This file is licensed under the Embedded Projects General Public License *Version 3.1.
*
* You should have received a copy of this license from your vendor and/or *along with this file; If not, please visit www.wawision.de/Lizenzhinweis
* to obtain the text of the corresponding license version.
*
**** END OF COPYRIGHT & LICENSE NOTICE *** DO NOT REMOVE ****
/*
**** COPYRIGHT & LICENSE NOTICE *** DO NOT REMOVE ****
*
* Xentral (c) Xentral ERP Sorftware GmbH, Fuggerstrasse 11, D-86150 Augsburg, * Germany 2019
*
* This file is licensed under the Embedded Projects General Public License *Version 3.1.
*
* You should have received a copy of this license from your vendor and/or *along with this file; If not, please visit www.wawision.de/Lizenzhinweis
* to obtain the text of the corresponding license version.
*
**** END OF COPYRIGHT & LICENSE NOTICE *** DO NOT REMOVE ****
*/
?>
<?php
class WidgetGenimportvorlage
{
private $app; //application object
public $form; //store form object
protected $parsetarget; //target for content
public function __construct($app,$parsetarget)
{
$this->app = $app;
$this->parsetarget = $parsetarget;
$this->Form();
}
public function importvorlageDelete()
{
$this->form->Execute("importvorlage","delete");
$this->importvorlageList();
}
function Edit()
{
$this->form->Edit();
}
function Copy()
{
$this->form->Copy();
}
public function Create()
{
$this->form->Create();
}
public function Search()
{
$this->app->Tpl->Set($this->parsetarget,"SUUUCHEEE");
}
public function Summary()
{
$this->app->Tpl->Set($this->parsetarget,"grosse Tabelle");
}
function Form()
{
$this->form = $this->app->FormHandler->CreateNew("importvorlage");
$this->form->UseTable("importvorlage");
$this->form->UseTemplate("importvorlage.tpl",$this->parsetarget);
$field = new HTMLInput("bezeichnung","text","","50","","","","","","","","0","2","");
$this->form->NewField($field);
$this->form->AddMandatory("bezeichnung","notempty","Pflichfeld!","MSGBEZEICHNUNG");
$field = new HTMLSelect("ziel",0,"ziel","","","0");
$field->AddOption('Adresse&nbsp;(min. Angabe: name)','adresse');
$field->AddOption('Artikel&nbsp;(min. Angabe: nummer oder name_de)','artikel');
$field->AddOption('Einkaufspreise&nbsp;(min. Angabe: lieferantennummer und herstellernummer oder herstellernummer )','einkauf');
$field->AddOption('Zeiterfassung&nbsp;(min. Angabe datum_von,zeit_von,datum_bis,zeit_bis,kundennummer,taetigkeit)','zeiterfassung');
$field->AddOption('Wiedervorlagen (min. Angabe datum_faellig, kundennummer,mitarbeiternummer,betreff)','wiedervorlagen');
$field->AddOption('Notizen (min. Angabe datum,kundennummer,mitarbeiternummer,betreff)','notizen');
$this->form->NewField($field);
$field = new HTMLInput("importerstezeilenummer","text","","15","","","","","","","","0","","");
$this->form->NewField($field);
$field = new HTMLSelect("importtrennzeichen",0,"importtrennzeichen","","","0");
$field->AddOption(';','semikolon');
$field->AddOption(',','komma');
$this->form->NewField($field);
$field = new HTMLSelect("importdatenmaskierung",0,"importdatenmaskierung","","","0");
$field->AddOption('keine','keine');
$field->AddOption('&quot;','gaensefuesschen');
$this->form->NewField($field);
$field = new HTMLInput("charset","text","","","","","","","","","","0","","");
$this->form->NewField($field);
$field = new HTMLCheckbox("utf8decode","","","1","0","0");
$this->form->NewField($field);
$field = new HTMLTextarea("fields",15,60,"","","","","0");
$this->form->NewField($field);
$field = new HTMLTextarea("internebemerkung",5,50,"","","","","0");
$this->form->NewField($field);
}
}
?>
<?php
class WidgetGenimportvorlage
{
private $app; //application object
public $form; //store form object
protected $parsetarget; //target for content
public function __construct($app,$parsetarget)
{
$this->app = $app;
$this->parsetarget = $parsetarget;
$this->Form();
}
public function importvorlageDelete()
{
$this->form->Execute("importvorlage","delete");
$this->importvorlageList();
}
function Edit()
{
$this->form->Edit();
}
function Copy()
{
$this->form->Copy();
}
public function Create()
{
$this->form->Create();
}
public function Search()
{
$this->app->Tpl->Set($this->parsetarget,"SUUUCHEEE");
}
public function Summary()
{
$this->app->Tpl->Set($this->parsetarget,"grosse Tabelle");
}
function Form()
{
$this->form = $this->app->FormHandler->CreateNew("importvorlage");
$this->form->UseTable("importvorlage");
$this->form->UseTemplate("importvorlage.tpl",$this->parsetarget);
$field = new HTMLInput("bezeichnung","text","","50","","","","","","","","0","2","");
$this->form->NewField($field);
$this->form->AddMandatory("bezeichnung","notempty","Pflichfeld!","MSGBEZEICHNUNG");
$field = new HTMLSelect("ziel",0,"ziel","","","0");
$field->AddOption('Adresse&nbsp;(min. Angabe: name)','adresse');
$field->AddOption('Artikel&nbsp;(min. Angabe: nummer oder name_de)','artikel');
$field->AddOption('Einkaufspreise&nbsp;(min. Angabe: lieferantennummer und herstellernummer oder herstellernummer )','einkauf');
$field->AddOption('Zeiterfassung&nbsp;(min. Angabe: datum_von,zeit_von,datum_bis,zeit_bis,kundennummer,taetigkeit)','zeiterfassung');
$field->AddOption('Wiedervorlagen (min. Angabe: datum_faellig, kundennummer,mitarbeiternummer,betreff)','wiedervorlagen');
$field->AddOption('Notizen (min. Angabe: datum,kundennummer,mitarbeiternummer,betreff)','notizen');
$field->AddOption('Kontenrahmen (min. Angabe: sachkonto,beschriftung,art)','kontorahmen');
$this->form->NewField($field);
$field = new HTMLInput("importerstezeilenummer","text","","15","","","","","","","","0","","");
$this->form->NewField($field);
$field = new HTMLSelect("importtrennzeichen",0,"importtrennzeichen","","","0");
$field->AddOption(';','semikolon');
$field->AddOption(',','komma');
$this->form->NewField($field);
$field = new HTMLSelect("importdatenmaskierung",0,"importdatenmaskierung","","","0");
$field->AddOption('keine','keine');
$field->AddOption('&quot;','gaensefuesschen');
$this->form->NewField($field);
$field = new HTMLInput("charset","text","","","","","","","","","","0","","");
$this->form->NewField($field);
$field = new HTMLCheckbox("utf8decode","","","1","0","0");
$this->form->NewField($field);
$field = new HTMLTextarea("fields",15,60,"","","","","0");
$this->form->NewField($field);
$field = new HTMLTextarea("internebemerkung",5,50,"","","","","0");
$this->form->NewField($field);
}
}
?>