mirror of
https://github.com/OpenXE-org/OpenXE.git
synced 2024-12-25 06:00:28 +01:00
mahnwesen initial
This commit is contained in:
parent
1f6caa8632
commit
2c7f113d6b
@ -28975,7 +28975,7 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "bestellvorschlag",
|
"name": "bestellvorschlag",
|
||||||
"collation": "utf8mb4_general_ci",
|
"collation": "utf8mb3_general_ci",
|
||||||
"type": "BASE TABLE",
|
"type": "BASE TABLE",
|
||||||
"columns": [
|
"columns": [
|
||||||
{
|
{
|
||||||
@ -39026,7 +39026,7 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "fibu_buchungen",
|
"name": "fibu_buchungen",
|
||||||
"collation": "utf8mb4_general_ci",
|
"collation": "utf8mb3_general_ci",
|
||||||
"type": "BASE TABLE",
|
"type": "BASE TABLE",
|
||||||
"columns": [
|
"columns": [
|
||||||
{
|
{
|
||||||
@ -39164,13 +39164,13 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "fibu_buchungen_alle",
|
"name": "fibu_buchungen_alle",
|
||||||
"collation": "utf8mb4_general_ci",
|
"collation": "utf8mb3_general_ci",
|
||||||
"type": "BASE TABLE",
|
"type": "BASE TABLE",
|
||||||
"columns": [
|
"columns": [
|
||||||
{
|
{
|
||||||
"Field": "buchungsart",
|
"Field": "buchungsart",
|
||||||
"Type": "varchar(9)",
|
"Type": "varchar(9)",
|
||||||
"Collation": "utf8mb4_general_ci",
|
"Collation": "utf8mb3_general_ci",
|
||||||
"Null": "NO",
|
"Null": "NO",
|
||||||
"Key": "",
|
"Key": "",
|
||||||
"Default": null,
|
"Default": null,
|
||||||
@ -39203,7 +39203,7 @@
|
|||||||
{
|
{
|
||||||
"Field": "datum",
|
"Field": "datum",
|
||||||
"Type": "varchar(10)",
|
"Type": "varchar(10)",
|
||||||
"Collation": "utf8mb4_general_ci",
|
"Collation": "utf8mb3_general_ci",
|
||||||
"Null": "YES",
|
"Null": "YES",
|
||||||
"Key": "",
|
"Key": "",
|
||||||
"Default": null,
|
"Default": null,
|
||||||
@ -39269,7 +39269,7 @@
|
|||||||
{
|
{
|
||||||
"Field": "edit_module",
|
"Field": "edit_module",
|
||||||
"Type": "varchar(15)",
|
"Type": "varchar(15)",
|
||||||
"Collation": "utf8mb4_general_ci",
|
"Collation": "utf8mb3_general_ci",
|
||||||
"Null": "NO",
|
"Null": "NO",
|
||||||
"Key": "",
|
"Key": "",
|
||||||
"Default": null,
|
"Default": null,
|
||||||
@ -39293,13 +39293,13 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "fibu_objekte",
|
"name": "fibu_objekte",
|
||||||
"collation": "utf8mb4_general_ci",
|
"collation": "utf8mb3_general_ci",
|
||||||
"type": "BASE TABLE",
|
"type": "BASE TABLE",
|
||||||
"columns": [
|
"columns": [
|
||||||
{
|
{
|
||||||
"Field": "datum",
|
"Field": "datum",
|
||||||
"Type": "varchar(10)",
|
"Type": "varchar(10)",
|
||||||
"Collation": "utf8mb4_general_ci",
|
"Collation": "utf8mb3_general_ci",
|
||||||
"Null": "YES",
|
"Null": "YES",
|
||||||
"Key": "",
|
"Key": "",
|
||||||
"Default": null,
|
"Default": null,
|
||||||
@ -39310,7 +39310,7 @@
|
|||||||
{
|
{
|
||||||
"Field": "typ",
|
"Field": "typ",
|
||||||
"Type": "varchar(15)",
|
"Type": "varchar(15)",
|
||||||
"Collation": "utf8mb4_general_ci",
|
"Collation": "utf8mb3_general_ci",
|
||||||
"Null": "NO",
|
"Null": "NO",
|
||||||
"Key": "",
|
"Key": "",
|
||||||
"Default": null,
|
"Default": null,
|
||||||
@ -39343,7 +39343,7 @@
|
|||||||
{
|
{
|
||||||
"Field": "parent_typ",
|
"Field": "parent_typ",
|
||||||
"Type": "varchar(7)",
|
"Type": "varchar(7)",
|
||||||
"Collation": "utf8mb4_general_ci",
|
"Collation": "utf8mb3_general_ci",
|
||||||
"Null": "NO",
|
"Null": "NO",
|
||||||
"Key": "",
|
"Key": "",
|
||||||
"Default": null,
|
"Default": null,
|
||||||
@ -39354,7 +39354,7 @@
|
|||||||
{
|
{
|
||||||
"Field": "parent_id",
|
"Field": "parent_id",
|
||||||
"Type": "varchar(11)",
|
"Type": "varchar(11)",
|
||||||
"Collation": "utf8mb4_general_ci",
|
"Collation": "utf8mb3_general_ci",
|
||||||
"Null": "NO",
|
"Null": "NO",
|
||||||
"Key": "",
|
"Key": "",
|
||||||
"Default": null,
|
"Default": null,
|
||||||
@ -101383,7 +101383,7 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "subscription_cycle_job",
|
"name": "subscription_cycle_job",
|
||||||
"collation": "utf8mb4_general_ci",
|
"collation": "utf8mb3_general_ci",
|
||||||
"type": "BASE TABLE",
|
"type": "BASE TABLE",
|
||||||
"columns": [
|
"columns": [
|
||||||
{
|
{
|
||||||
@ -117603,6 +117603,89 @@
|
|||||||
"Non_unique": ""
|
"Non_unique": ""
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "mahnwesen",
|
||||||
|
"collation": "utf8mb3_general_ci",
|
||||||
|
"type": "BASE TABLE",
|
||||||
|
"columns": [
|
||||||
|
{
|
||||||
|
"Field": "id",
|
||||||
|
"Type": "int(11)",
|
||||||
|
"Collation": null,
|
||||||
|
"Null": "NO",
|
||||||
|
"Key": "PRI",
|
||||||
|
"Default": null,
|
||||||
|
"Extra": "auto_increment",
|
||||||
|
"Privileges": "select,insert,update,references",
|
||||||
|
"Comment": ""
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"Field": "name",
|
||||||
|
"Type": "varchar(50)",
|
||||||
|
"Collation": "utf8mb3_general_ci",
|
||||||
|
"Null": "NO",
|
||||||
|
"Key": "",
|
||||||
|
"Default": null,
|
||||||
|
"Extra": "",
|
||||||
|
"Privileges": "select,insert,update,references",
|
||||||
|
"Comment": ""
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"Field": "tage",
|
||||||
|
"Type": "int(11)",
|
||||||
|
"Collation": null,
|
||||||
|
"Null": "NO",
|
||||||
|
"Key": "",
|
||||||
|
"Default": null,
|
||||||
|
"Extra": "",
|
||||||
|
"Privileges": "select,insert,update,references",
|
||||||
|
"Comment": ""
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"Field": "gebuehr",
|
||||||
|
"Type": "decimal(10,2)",
|
||||||
|
"Collation": null,
|
||||||
|
"Null": "NO",
|
||||||
|
"Key": "",
|
||||||
|
"Default": null,
|
||||||
|
"Extra": "",
|
||||||
|
"Privileges": "select,insert,update,references",
|
||||||
|
"Comment": ""
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"Field": "mail",
|
||||||
|
"Type": "int(11)",
|
||||||
|
"Collation": null,
|
||||||
|
"Null": "NO",
|
||||||
|
"Key": "",
|
||||||
|
"Default": null,
|
||||||
|
"Extra": "",
|
||||||
|
"Privileges": "select,insert,update,references",
|
||||||
|
"Comment": ""
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"Field": "druck",
|
||||||
|
"Type": "int(11)",
|
||||||
|
"Collation": null,
|
||||||
|
"Null": "NO",
|
||||||
|
"Key": "",
|
||||||
|
"Default": null,
|
||||||
|
"Extra": "",
|
||||||
|
"Privileges": "select,insert,update,references",
|
||||||
|
"Comment": ""
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"keys": [
|
||||||
|
{
|
||||||
|
"Key_name": "PRIMARY",
|
||||||
|
"Index_type": "BTREE",
|
||||||
|
"columns": [
|
||||||
|
"id"
|
||||||
|
],
|
||||||
|
"Non_unique": ""
|
||||||
|
}
|
||||||
|
]
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"views": [
|
"views": [
|
||||||
|
@ -5426,6 +5426,18 @@ title: 'Abschicken',
|
|||||||
return $ret;
|
return $ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Replace {VARS} with texts given in array
|
||||||
|
* Input array(key => value)
|
||||||
|
*/
|
||||||
|
function ParseVars(array $mapping, $text) {
|
||||||
|
foreach ($mapping as $key => $value) {
|
||||||
|
$text = str_replace('{'.strtoupper($key).'}',$value,$text);
|
||||||
|
}
|
||||||
|
return $text;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// @refactor Document Komponente
|
// @refactor Document Komponente
|
||||||
function CheckBearbeiter($id,$module)
|
function CheckBearbeiter($id,$module)
|
||||||
{
|
{
|
||||||
@ -14548,156 +14560,6 @@ function get_emails ($str)
|
|||||||
else return false;
|
else return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// @refactor Mahnwesen Modul
|
|
||||||
function MahnwesenBody($id,$als,$_datum=null,$sprache='')
|
|
||||||
{
|
|
||||||
if($id > 0)
|
|
||||||
{
|
|
||||||
$rechnungarr = $this->app->DB->SelectRow("SELECT r.*,DATE_FORMAT(datum,'%d.%m.%Y') as datum_de,DATE_FORMAT(mahnwesen_datum,'%d.%m.%Y') as mahnwesen_datum_de,r.mahnwesen_datum
|
|
||||||
FROM rechnung AS r WHERE r.id=$id LIMIT 1");
|
|
||||||
}
|
|
||||||
if(empty($rechnungarr))
|
|
||||||
{
|
|
||||||
return '';
|
|
||||||
}
|
|
||||||
|
|
||||||
$adresse = $rechnungarr['adresse'];
|
|
||||||
if($sprache==''){
|
|
||||||
$sprache = $rechnungarr['sprache'];
|
|
||||||
}
|
|
||||||
if($sprache==''){
|
|
||||||
$sprache = $this->app->DB->Select("SELECT sprache FROM adresse WHERE id='$adresse' LIMIT 1");
|
|
||||||
}
|
|
||||||
// OfferNo, customerId, OfferDate
|
|
||||||
|
|
||||||
$kundennummer = $rechnungarr['kundennummer'];
|
|
||||||
$projekt = $rechnungarr['projekt'];
|
|
||||||
$auftrag= $rechnungarr['auftrag'];
|
|
||||||
$buchhaltung= $rechnungarr['buchhaltung'];
|
|
||||||
$lieferschein = $rechnungarr['lieferschein'];
|
|
||||||
$lieferscheinid = $lieferschein;
|
|
||||||
if($lieferscheinid){
|
|
||||||
$lieferschein = $this->app->DB->Select("SELECT belegnr FROM lieferschein WHERE id='$lieferschein' LIMIT 1");
|
|
||||||
}else{
|
|
||||||
$lieferschein = '';
|
|
||||||
}
|
|
||||||
$bestellbestaetigung = $rechnungarr['kundennummer'];
|
|
||||||
$datum = $rechnungarr['datum_de'];
|
|
||||||
$datum_sql = $rechnungarr['datum'];
|
|
||||||
$belegnr = $rechnungarr['belegnr'];
|
|
||||||
$doppel = $rechnungarr['doppel'];
|
|
||||||
$freitext = $rechnungarr['freitext'];
|
|
||||||
$ustid = $rechnungarr['ustid'];
|
|
||||||
$soll = $rechnungarr['soll'];
|
|
||||||
$ist = $rechnungarr['ist'];
|
|
||||||
$land = $rechnungarr['land'];
|
|
||||||
$mahnwesen_datum = $rechnungarr['mahnwesen_datum'];
|
|
||||||
$mahnwesen_datum_deutsch = $rechnungarr['mahnwesen_datum_de'];
|
|
||||||
$zahlungsweise = $rechnungarr['zahlungsweise'];
|
|
||||||
$zahlungsstatus = $rechnungarr['zahlungsstatus'];
|
|
||||||
$zahlungszieltage = $rechnungarr['zahlungszieltage'];
|
|
||||||
$zahlungszieltageskonto = $rechnungarr['zahlungszieltageskonto'];
|
|
||||||
$zahlungszielskonto = $rechnungarr['zahlungszielskonto'];
|
|
||||||
$waehrung = $rechnungarr['waehrung'];
|
|
||||||
|
|
||||||
$zahlungdatum = $this->app->DB->Select("SELECT DATE_FORMAT(DATE_ADD(datum, INTERVAL $zahlungszieltage DAY),'%d.%m.%Y') FROM rechnung WHERE id='$id' LIMIT 1");
|
|
||||||
|
|
||||||
if($_datum!=null)
|
|
||||||
{
|
|
||||||
$mahnwesen_datum = $this->app->String->Convert($_datum,'%1.%2.%3','%3-%2-%1');
|
|
||||||
$mahnwesen_datum_deutsch = $_datum;
|
|
||||||
}
|
|
||||||
|
|
||||||
$zahlungsweise = strtolower($zahlungsweise);
|
|
||||||
|
|
||||||
if($als=='zahlungserinnerung')
|
|
||||||
{
|
|
||||||
$body = $this->GetGeschaeftsBriefText("MahnwesenZahlungserinnerung",$sprache,$projekt,"rechnung",$id);
|
|
||||||
$tage = $this->GetKonfiguration('mahnwesen_m1_tage');
|
|
||||||
}
|
|
||||||
else if($als=='mahnung1')
|
|
||||||
{
|
|
||||||
$body = $this->GetGeschaeftsBriefText("MahnwesenMahnung1",$sprache,$projekt,"rechnung",$id);
|
|
||||||
$mahngebuehr = $this->GetKonfiguration('mahnwesen_m1_gebuehr');
|
|
||||||
$tage = $this->GetKonfiguration('mahnwesen_m2_tage');
|
|
||||||
}
|
|
||||||
else if($als=='mahnung2')
|
|
||||||
{
|
|
||||||
$body = $this->GetGeschaeftsBriefText("MahnwesenMahnung2",$sprache,$projekt,"rechnung",$id);
|
|
||||||
$tage = $this->GetKonfiguration('mahnwesen_m3_tage');
|
|
||||||
$mahngebuehr = $this->GetKonfiguration('mahnwesen_m2_gebuehr');
|
|
||||||
}
|
|
||||||
else if($als=='mahnung3')
|
|
||||||
{
|
|
||||||
$body = $this->GetGeschaeftsBriefText("MahnwesenMahnung3",$sprache,$projekt,"rechnung",$id);
|
|
||||||
$tage = $this->GetKonfiguration('mahnwesen_ik_tage');
|
|
||||||
$mahngebuehr = $this->GetKonfiguration('mahnwesen_m3_gebuehr');
|
|
||||||
}
|
|
||||||
else if($als=='inkasso')
|
|
||||||
{
|
|
||||||
$body = $this->GetGeschaeftsBriefText("MahnwesenInkasso",$sprache,$projekt,"rechnung",$id);
|
|
||||||
//$tage = $this->GetKonfiguration("mahnwesen_ik_tage");
|
|
||||||
$tage = 3; //eigentlich vorbei
|
|
||||||
$mahngebuehr = $this->GetKonfiguration('mahnwesen_ik_gebuehr');
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
$body = $this->app->erp->Beschriftung("dokument_anschreiben");
|
|
||||||
}
|
|
||||||
|
|
||||||
if($tage <=0) $tage = 0;
|
|
||||||
|
|
||||||
$datummahnung= $this->app->DB->Select("SELECT DATE_FORMAT(DATE_ADD('$mahnwesen_datum', INTERVAL $tage DAY),'%d.%m.%Y')");
|
|
||||||
$datumrechnungzahlungsziel= $this->app->DB->Select("SELECT DATE_FORMAT(DATE_ADD('$datum_sql', INTERVAL $zahlungszieltage DAY),'%d.%m.%Y')");
|
|
||||||
|
|
||||||
$tage_ze = $zahlungszieltage + $this->GetKonfiguration('mahnwesen_m1_tage');
|
|
||||||
$datumzahlungserinnerung= $this->app->DB->Select("SELECT DATE_FORMAT(DATE_ADD('$datum_sql', INTERVAL $tage_ze DAY),'%d.%m.%Y')");
|
|
||||||
|
|
||||||
// checkstamp $this->CheckStamp("jhdskKUHsiusakiakuhsd"); // errechnet aus laufzeit und kundenid // wenn es nicht drinnen ist darf es nicht gehen
|
|
||||||
|
|
||||||
if($mahngebuehr=='' || !is_numeric($mahngebuehr))
|
|
||||||
$mahngebuehr = 0;
|
|
||||||
|
|
||||||
//$offen= '11,23';
|
|
||||||
$body = str_replace('{RECHNUNG}',$belegnr,$body);
|
|
||||||
$body = str_replace('{BELEGNR}',$belegnr,$body);
|
|
||||||
$body = str_replace('{DATUMRECHNUNG}',$datum,$body);
|
|
||||||
$body = str_replace('{TAGE}',$tage,$body);
|
|
||||||
$body = str_replace('{OFFEN}',$this->formatMoney($soll - $ist,$waehrung),$body);
|
|
||||||
$body = str_replace('{SOLL}',$this->formatMoney($soll,$waehrung),$body);
|
|
||||||
$body = str_replace('{SUMME}',$this->formatMoney($soll - $ist + $mahngebuehr,$waehrung),$body);
|
|
||||||
$body = str_replace('{IST}',$this->formatMoney($ist,$waehrung),$body);
|
|
||||||
$body = str_replace('{DATUM}',$datummahnung,$body);
|
|
||||||
$body = str_replace('{MAHNGEBUEHR}',$this->formatMoney($mahngebuehr,$waehrung),$body);
|
|
||||||
$body = str_replace('{OFFENMITMAHNGEBUEHR}',$this->formatMoney($mahngebuehr + $soll - $ist,$waehrung),$body);
|
|
||||||
$body = str_replace('{MAHNDATUM}',$mahnwesen_datum_deutsch,$body);
|
|
||||||
|
|
||||||
|
|
||||||
// Im Protokoll suchen Datum von Zahlungserinnerung, Mahnung 1, Mahnung 2, Mahnung 3
|
|
||||||
|
|
||||||
$mahnung1 = $this->app->DB->Select("SELECT DATE_FORMAT(zeit,'%d.%m.%Y') FROM rechnung_protokoll WHERE rechnung='$id'
|
|
||||||
AND grund LIKE 'Mahnung1 versendet%' ORDER by Zeit DESC LIMIT 1");
|
|
||||||
|
|
||||||
$mahnung2 = $this->app->DB->Select("SELECT DATE_FORMAT(zeit,'%d.%m.%Y') FROM rechnung_protokoll WHERE rechnung='$id'
|
|
||||||
AND grund LIKE 'Mahnung2 versendet%' ORDER by Zeit DESC LIMIT 1");
|
|
||||||
|
|
||||||
$mahnung3 = $this->app->DB->Select("SELECT DATE_FORMAT(zeit,'%d.%m.%Y') FROM rechnung_protokoll WHERE rechnung='$id'
|
|
||||||
AND grund LIKE 'Mahnung3 versendet%' ORDER by Zeit DESC LIMIT 1");
|
|
||||||
|
|
||||||
$body = str_replace('{DATUMMAHNUNG1}',$mahnung1,$body);
|
|
||||||
$body = str_replace('{DATUMMAHNUNG2}',$mahnung2,$body);
|
|
||||||
$body = str_replace('{DATUMMAHNUNG3}',$mahnung3,$body);
|
|
||||||
|
|
||||||
$body = str_replace('{DATUMZAHLUNGSERINNERUNGFAELLIG}',$datumzahlungserinnerung,$body);
|
|
||||||
$body = str_replace('{DATUMZAHLUNGSERINNERUNG}',$datumzahlungserinnerung,$body);
|
|
||||||
$body = str_replace('{DATUMRECHNUNGZAHLUNGSZIEL}',$datumrechnungzahlungsziel,$body);
|
|
||||||
|
|
||||||
$body = $this->ParseUserVars('rechnung',$id,$body);
|
|
||||||
|
|
||||||
return $body;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**@deprecated */
|
/**@deprecated */
|
||||||
function AufragZuDTA($auftrag,$rechnung="1")
|
function AufragZuDTA($auftrag,$rechnung="1")
|
||||||
{
|
{
|
||||||
|
@ -43,9 +43,9 @@ class RechnungPDF extends BriefpapierCustom {
|
|||||||
parent::__construct($this->app,$projekt,$styleData);
|
parent::__construct($this->app,$projekt,$styleData);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function GetRechnung($id,$als="",$doppeltmp=0, $_datum = null)
|
public function GetRechnung($id, $titel_abw="",$doppeltmp=0, $_datum = null, $text_abw = '')
|
||||||
{
|
{
|
||||||
$this->parameter = $als;
|
|
||||||
if($this->app->erp->Firmendaten("steuerspalteausblenden")=="1")
|
if($this->app->erp->Firmendaten("steuerspalteausblenden")=="1")
|
||||||
{
|
{
|
||||||
// pruefe ob es mehr als ein steuersatz gibt // wenn ja dann darf man sie nicht ausblenden
|
// pruefe ob es mehr als ein steuersatz gibt // wenn ja dann darf man sie nicht ausblenden
|
||||||
@ -124,10 +124,10 @@ class RechnungPDF extends BriefpapierCustom {
|
|||||||
|
|
||||||
$lieferschein = $this->app->DB->Select("SELECT belegnr FROM lieferschein WHERE id='$lieferscheinid' LIMIT 1");
|
$lieferschein = $this->app->DB->Select("SELECT belegnr FROM lieferschein WHERE id='$lieferscheinid' LIMIT 1");
|
||||||
|
|
||||||
if(empty($als) || $als === 'doppel') {
|
/* if(empty($als) || $als === 'doppel') {
|
||||||
$rechnungsnummeranzeigen = false;
|
$rechnungsnummeranzeigen = false;
|
||||||
}
|
}
|
||||||
elseif(!empty($belegnr)){
|
else*/if(!empty($belegnr)){
|
||||||
$rechnungsnummeranzeigen = true;
|
$rechnungsnummeranzeigen = true;
|
||||||
}
|
}
|
||||||
$projektabkuerzung = $this->app->DB->Select(sprintf('SELECT abkuerzung FROM projekt WHERE id = %d', $projekt));
|
$projektabkuerzung = $this->app->DB->Select(sprintf('SELECT abkuerzung FROM projekt WHERE id = %d', $projekt));
|
||||||
@ -172,7 +172,7 @@ class RechnungPDF extends BriefpapierCustom {
|
|||||||
$zahlungsweisetext = $this->app->erp->Zahlungsweisetext("rechnung",$id);
|
$zahlungsweisetext = $this->app->erp->Zahlungsweisetext("rechnung",$id);
|
||||||
|
|
||||||
|
|
||||||
if($doppel==1) $als = "doppel";
|
// if($doppel==1) $als = "doppel";
|
||||||
|
|
||||||
if($belegnr=="" || $belegnr=="0") $belegnr = "- ".$this->app->erp->Beschriftung("dokument_entwurf");
|
if($belegnr=="" || $belegnr=="0") $belegnr = "- ".$this->app->erp->Beschriftung("dokument_entwurf");
|
||||||
else {
|
else {
|
||||||
@ -181,7 +181,7 @@ class RechnungPDF extends BriefpapierCustom {
|
|||||||
}
|
}
|
||||||
|
|
||||||
$posanzeigen = true;
|
$posanzeigen = true;
|
||||||
if($als=="zahlungserinnerung")
|
/* if($als=="zahlungserinnerung")
|
||||||
{
|
{
|
||||||
$this->doctypeOrig=$this->app->erp->Beschriftung("dokument_zahlungserinnerung")." ".(is_null($_datum)?$mahnwesen_datum:$_datum);
|
$this->doctypeOrig=$this->app->erp->Beschriftung("dokument_zahlungserinnerung")." ".(is_null($_datum)?$mahnwesen_datum:$_datum);
|
||||||
if($this->app->erp->GetKonfiguration("mahnwesen_ze_pos") === '0')$posanzeigen = false;
|
if($this->app->erp->GetKonfiguration("mahnwesen_ze_pos") === '0')$posanzeigen = false;
|
||||||
@ -207,14 +207,12 @@ class RechnungPDF extends BriefpapierCustom {
|
|||||||
if($this->app->erp->GetKonfiguration("mahnwesen_inkasso_pos") === '0')$posanzeigen = false;
|
if($this->app->erp->GetKonfiguration("mahnwesen_inkasso_pos") === '0')$posanzeigen = false;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{*/
|
||||||
if($rechnungersatz)
|
if($rechnungersatz)
|
||||||
$this->doctypeOrig=($this->app->erp->Beschriftung("bezeichnungrechnungersatz")?$this->app->erp->Beschriftung("bezeichnungrechnungersatz"):$this->app->erp->Beschriftung("dokument_rechnung"))." $belegnr";
|
$this->doctypeOrig=($this->app->erp->Beschriftung("bezeichnungrechnungersatz")?$this->app->erp->Beschriftung("bezeichnungrechnungersatz"):$this->app->erp->Beschriftung("dokument_rechnung"))." $belegnr";
|
||||||
else
|
else
|
||||||
$this->doctypeOrig=$this->app->erp->Beschriftung("dokument_rechnung")." $belegnr";
|
$this->doctypeOrig=$this->app->erp->Beschriftung("dokument_rechnung")." $belegnr";
|
||||||
}
|
// }
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
$this->zusatzfooter = " (RE$belegnr)";
|
$this->zusatzfooter = " (RE$belegnr)";
|
||||||
|
|
||||||
@ -407,12 +405,12 @@ class RechnungPDF extends BriefpapierCustom {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
if($als!="" && $als!="doppel")
|
/* if($als!="" && $als!="doppel")
|
||||||
{
|
{
|
||||||
$body = $this->app->erp->MahnwesenBody($id,$als,$_datum);
|
$body = $this->app->erp->MahnwesenBody($id,$als,$_datum);
|
||||||
$footer =$this->app->erp->ParseUserVars("rechnung",$id, $this->app->erp->Beschriftung("rechnung_footer"));
|
$footer =$this->app->erp->ParseUserVars("rechnung",$id, $this->app->erp->Beschriftung("rechnung_footer"));
|
||||||
}
|
}
|
||||||
else {
|
else {*/
|
||||||
$body = $this->app->erp->Beschriftung("rechnung_header");
|
$body = $this->app->erp->Beschriftung("rechnung_header");
|
||||||
if($bodyzusatz!="") $body=$body."\r\n".$bodyzusatz;
|
if($bodyzusatz!="") $body=$body."\r\n".$bodyzusatz;
|
||||||
$body = $this->app->erp->ParseUserVars("rechnung",$id,$body);
|
$body = $this->app->erp->ParseUserVars("rechnung",$id,$body);
|
||||||
@ -442,6 +440,14 @@ class RechnungPDF extends BriefpapierCustom {
|
|||||||
$footer = $versandinfo."$freitext"."\r\n".$this->app->erp->ParseUserVars("rechnung",$id,$this->app->erp->Beschriftung("rechnung_footer").
|
$footer = $versandinfo."$freitext"."\r\n".$this->app->erp->ParseUserVars("rechnung",$id,$this->app->erp->Beschriftung("rechnung_footer").
|
||||||
"\r\n$steuer\r\n$zahlungsweisetext").$systemfreitext;
|
"\r\n$steuer\r\n$zahlungsweisetext").$systemfreitext;
|
||||||
}
|
}
|
||||||
|
// }
|
||||||
|
|
||||||
|
if ($titel_abw != '') {
|
||||||
|
$this->doctypeOrig = $titel_abw;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($text_abw != '') {
|
||||||
|
$body = $text_abw;
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->setTextDetails(array(
|
$this->setTextDetails(array(
|
||||||
@ -686,10 +692,10 @@ class RechnungPDF extends BriefpapierCustom {
|
|||||||
$tmp_name = str_replace(' ','',trim($this->recipient['enterprise']));
|
$tmp_name = str_replace(' ','',trim($this->recipient['enterprise']));
|
||||||
$tmp_name = str_replace('.','',$tmp_name);
|
$tmp_name = str_replace('.','',$tmp_name);
|
||||||
|
|
||||||
if($als=="" || $als=="doppel")
|
if($titel_abw != "")
|
||||||
$this->filename = $datum2."_RE".$belegnr.".pdf";
|
$this->filename = $datum2."_RE".$belegnr."_INFO.pdf";
|
||||||
else
|
else
|
||||||
$this->filename = $datum2."_MA".$belegnr.".pdf";
|
$this->filename = $datum2."_RE".$belegnr.".pdf";
|
||||||
|
|
||||||
$this->setBarcode($belegnr);
|
$this->setBarcode($belegnr);
|
||||||
}
|
}
|
||||||
|
@ -68,13 +68,13 @@
|
|||||||
<td width="25%" style="position:relative"><a href="index.php?module=versandarten&action=list"><img src="./themes/[THEME]/images/einstellungen/Icons_dunkel_16.gif" border="0" width="30%"></a></td>
|
<td width="25%" style="position:relative"><a href="index.php?module=versandarten&action=list"><img src="./themes/[THEME]/images/einstellungen/Icons_dunkel_16.gif" border="0" width="30%"></a></td>
|
||||||
<td width="25%" style="position:relative"><a href="index.php?module=zahlungsweisen&action=list"><img src="./themes/[THEME]/images/einstellungen/Icons_dunkel_16.gif" border="0" width="30%"></a></td>
|
<td width="25%" style="position:relative"><a href="index.php?module=zahlungsweisen&action=list"><img src="./themes/[THEME]/images/einstellungen/Icons_dunkel_16.gif" border="0" width="30%"></a></td>
|
||||||
<td width="25%" style="position:relative"><a [LIEFERBEDINGUNGENLINK]><img src="./themes/[THEME]/images/einstellungen/Icons_dunkel_16.gif" border="0" width="30%"></a>[GREYLIEFERBEDINGUNGEN]</td>
|
<td width="25%" style="position:relative"><a [LIEFERBEDINGUNGENLINK]><img src="./themes/[THEME]/images/einstellungen/Icons_dunkel_16.gif" border="0" width="30%"></a>[GREYLIEFERBEDINGUNGEN]</td>
|
||||||
<td width="25%"></td>
|
<td width="25%" style="position:relative"><a href="index.php?module=mahnwesen&action=einstellungen"><img src="./themes/[THEME]/images/einstellungen/Icons_dunkel_11.gif" border="0" width="30%"></a></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr align="center">
|
<tr align="center">
|
||||||
<td><a href="index.php?module=versandarten&action=list">{|Versandarten|}</a></td>
|
<td><a href="index.php?module=versandarten&action=list">{|Versandarten|}</a></td>
|
||||||
<td><a href="index.php?module=zahlungsweisen&action=list">{|Zahlungsweisen|}</a></td>
|
<td><a href="index.php?module=zahlungsweisen&action=list">{|Zahlungsweisen|}</a></td>
|
||||||
<td><a [LIEFERBEDINGUNGENLINK]>{|Lieferbedingungen|}</a></td>
|
<td><a [LIEFERBEDINGUNGENLINK]>{|Lieferbedingungen|}</a></td>
|
||||||
<td></td>
|
<td><a href="index.php?module=mahnwesen&action=einstellungen">{|Mahnwesen|}</a></td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
</table>
|
</table>
|
||||||
|
142
www/pages/content/mahnwesen_edit.tpl
Normal file
142
www/pages/content/mahnwesen_edit.tpl
Normal file
@ -0,0 +1,142 @@
|
|||||||
|
<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>-->Mahnwesen-Einstellungen|}</legend><i>Info like this.</i>
|
||||||
|
<table width="100%" border="0" class="mkTableFormular">
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
{|Name|}:
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<input type="text" name="name" id="name" value="[NAME]" size="20">
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
{|Tage|}:
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<input type="number" name="tage" id="tage" value="[TAGE]" size="20">
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
{|Gebuehr|}:
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<input type="number" step="0.01" name="gebuehr" id="gebuehr" value="[GEBUEHR]" size="20">
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
{|E-Mail senden|}:
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<input type="checkbox" name="mail" id="mail" [MAIL] size="20">
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
{|Mahnung ausdrucken|}:
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<input type="checkbox" name="druck" id="druck" [DRUCK] 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>
|
||||||
|
{|Name|}:
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<input type="text" name="name" id="name" value="[NAME]" size="20">
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
{|Tage|}:
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<input type="text" name="tage" id="tage" value="[TAGE]" size="20">
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
{|Gebuehr|}:
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<input type="text" name="gebuehr" id="gebuehr" value="[GEBUEHR]" size="20">
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
{|Versandmethode|}:
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<input type="text" name="versandmethode" id="versandmethode" value="[VERSANDMETHODE]" 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/mahnwesen_einstellungen.tpl
Normal file
10
www/pages/content/mahnwesen_einstellungen.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>
|
@ -10,6 +10,13 @@
|
|||||||
<div class="filter-block filter-inline">
|
<div class="filter-block filter-inline">
|
||||||
<div class="filter-title">{|Filter|}</div>
|
<div class="filter-title">{|Filter|}</div>
|
||||||
<ul class="filter-list">
|
<ul class="filter-list">
|
||||||
|
<li class="filter-item">
|
||||||
|
<label for="zu_mahnen" class="switch">
|
||||||
|
<input type="checkbox" id="zu_mahnen">
|
||||||
|
<span class="slider round"></span>
|
||||||
|
</label>
|
||||||
|
<label for="zu_mahnen">{|Nur zu mahnende|}</label>
|
||||||
|
</li>
|
||||||
<li class="filter-item">
|
<li class="filter-item">
|
||||||
<label for="inkl_bezahlte" class="switch">
|
<label for="inkl_bezahlte" class="switch">
|
||||||
<input type="checkbox" id="inkl_bezahlte">
|
<input type="checkbox" id="inkl_bezahlte">
|
||||||
@ -25,7 +32,8 @@
|
|||||||
<label for="inkl_gesperrte">{|Inkl. gesperrte|}</label>
|
<label for="inkl_gesperrte">{|Inkl. gesperrte|}</label>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
<input type="submit" class="btnBlue" name="zahlungsstatus_berechnen" value="{|Zahlungsstatus berechnen|}" />
|
<input type="submit" class="btnBlue" name="mahnstufe_berechnen" value="{|Mahnstufe berechnen|}" />
|
||||||
|
<input type="submit" class="btnBlue" name="mahnen" value="{|Mahnung durchführen|}" title="Alle markierten mit neuer Mahnstufe mahnen" />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
[MESSAGE]
|
[MESSAGE]
|
||||||
@ -38,9 +46,10 @@
|
|||||||
<option value="">{|bitte wählen|} ...</option>
|
<option value="">{|bitte wählen|} ...</option>
|
||||||
[ALSBEZAHLTMARKIEREN]
|
[ALSBEZAHLTMARKIEREN]
|
||||||
<option value="offen">{|als offen markieren|}</option>
|
<option value="offen">{|als offen markieren|}</option>
|
||||||
<option value="mahnen">{|Mahnenstufe erhöhen|}</option>
|
<option value="mahnung_reset">{|Mahnstatus zurücksetzen|}</option>
|
||||||
<option value="email">{|Mahnungen versenden (E-Mail)|}</option>
|
<!-- <option value="mahnen">{|Mahnung durchführen|}</option>
|
||||||
<option value="drucken">{|Mahnungen drucken|}</option>
|
<option value="email">{|Mahnung durchführen (nur E-Mail)|}</option>
|
||||||
|
<option value="email">{|Mahnung durchführen (nur Drucken)|}</option> -->
|
||||||
</select> {|Drucker|}: <select name="seldrucker">[SELDRUCKER]</select> <input type="submit" class="btnBlue" name="ausfuehren" value="{|ausführen|}" />
|
</select> {|Drucker|}: <select name="seldrucker">[SELDRUCKER]</select> <input type="submit" class="btnBlue" name="ausfuehren" value="{|ausführen|}" />
|
||||||
</fieldset>
|
</fieldset>
|
||||||
</div>
|
</div>
|
||||||
|
@ -17,7 +17,7 @@ class Mahnwesen {
|
|||||||
$this->app->ActionHandler("list", "mahnwesen_list");
|
$this->app->ActionHandler("list", "mahnwesen_list");
|
||||||
$this->app->ActionHandler("create", "mahnwesen_edit"); // This automatically adds a "New" button
|
$this->app->ActionHandler("create", "mahnwesen_edit"); // This automatically adds a "New" button
|
||||||
$this->app->ActionHandler("edit", "mahnwesen_edit");
|
$this->app->ActionHandler("edit", "mahnwesen_edit");
|
||||||
$this->app->ActionHandler("delete", "mahnwesen_delete");
|
$this->app->ActionHandler("einstellungen", "mahnwesen_einstellungen");
|
||||||
$this->app->DefaultActionHandler("list");
|
$this->app->DefaultActionHandler("list");
|
||||||
$this->app->ActionHandlerListen($app);
|
$this->app->ActionHandlerListen($app);
|
||||||
}
|
}
|
||||||
@ -33,13 +33,16 @@ class Mahnwesen {
|
|||||||
$extended_mysql55 = ",'de_DE'";
|
$extended_mysql55 = ",'de_DE'";
|
||||||
|
|
||||||
$allowed['mahnwesen_list'] = array('list');
|
$allowed['mahnwesen_list'] = array('list');
|
||||||
$heading = array('', '', 'Rechnung', 'Vom', 'Kd-Nr.', 'Kunde', 'Land', 'Projekt', 'Zahlung', 'Betrag (brutto)', 'Währung', 'Zahlstatus', 'Differenz', 'Status','Mahnstufe','Mahn-Datum','Gemahnt','Sperre','Interne Bemerkung','Menü');
|
$heading = array('', '', 'Rechnung', 'Vom', 'Kd-Nr.', 'Kunde', 'Land', 'Projekt', 'Zahlung', 'Betrag (brutto)', 'Währung', 'Zahlstatus', 'Differenz', 'Status','Fällig am','Tage','Mahnstufe','Gemahnt','Mahn-Datum','Sperre','Interne Bemerkung','Menü');
|
||||||
$width = array('1%','1%','01%', '01%', '01%', '05%', '01%', '01%', '01%', '01%', '01%', '01%', '01%', '01%', '01%', '01%', '01%', '01%', '20%', '1%'); // Fill out manually later
|
$width = array('1%','1%','01%', '01%', '01%', '05%', '01%', '01%', '01%', '01%', '01%', '01%', '01%', '01%', '01%', '01%', '01%', '01%', '01%', '01%', '20%', '1%'); // Fill out manually later
|
||||||
|
|
||||||
// columns that are aligned right (numbers etc)
|
// columns that are aligned right (numbers etc)
|
||||||
// $alignright = array(4,5,6,7,8);
|
// $alignright = array(4,5,6,7,8);
|
||||||
|
|
||||||
$findcols = array('r.id','r.id','r.belegnr', $app->erp->FormatDateShort('r.datum'), 'r.kundennummer','r.name', 'r.land','p.abkuerzung','r.zahlungsweise','r.soll','r.waehrung','r.zahlungsstatus','r.soll','r.status','r.mahnwesen');
|
$faellig_datum = $app->erp->FormatDateShort("DATE_ADD(r.datum, INTERVAL r.zahlungszieltage DAY)");
|
||||||
|
$faellig_tage = "if(DATEDIFF(CURRENT_DATE,DATE_ADD(r.datum, INTERVAL r.zahlungszieltage DAY)) > 0,DATEDIFF(CURRENT_DATE,DATE_ADD(r.datum, INTERVAL r.zahlungszieltage DAY)),'')";
|
||||||
|
|
||||||
|
$findcols = array('r.id','r.id','r.belegnr', $app->erp->FormatDateShort('r.datum'), 'r.kundennummer','r.name', 'r.land','p.abkuerzung','r.zahlungsweise','r.soll','r.waehrung','r.zahlungsstatus','r.soll','r.status',$faellig_datum,$faellig_tage,'r.name');
|
||||||
$searchsql = array('belegnr', 'kunde', 'datum');
|
$searchsql = array('belegnr', 'kunde', 'datum');
|
||||||
|
|
||||||
$defaultorder = 1;
|
$defaultorder = 1;
|
||||||
@ -64,21 +67,23 @@ class Mahnwesen {
|
|||||||
r.zahlungsstatus as zahlung,
|
r.zahlungsstatus as zahlung,
|
||||||
if(r.soll-r.ist!=0 AND r.ist > 0,FORMAT(r.ist-r.soll,2{$extended_mysql55}),FORMAT((r.soll-r.ist)*-1,2{$extended_mysql55})) as fehlt,
|
if(r.soll-r.ist!=0 AND r.ist > 0,FORMAT(r.ist-r.soll,2{$extended_mysql55}),FORMAT((r.soll-r.ist)*-1,2{$extended_mysql55})) as fehlt,
|
||||||
if(r.status = 'storniert' AND r.teilstorno = 1,'TEILSTORNO',UPPER(r.status)) as status,
|
if(r.status = 'storniert' AND r.teilstorno = 1,'TEILSTORNO',UPPER(r.status)) as status,
|
||||||
r.mahnwesen,
|
".$faellig_datum." as faellig_datum,
|
||||||
".$app->erp->FormatDateShort('mahnwesen_datum')." as datum,
|
".$faellig_tage." as faellig_tage,
|
||||||
if(r.versendet_mahnwesen,'Ja',''),
|
m.name,
|
||||||
|
if(r.versendet_mahnwesen,'Ja','') as versendet_mahnwesen,
|
||||||
|
if(mahnwesen_datum <> '0000-00-00',".$app->erp->FormatDateShort('mahnwesen_datum').",'') as mahnwesen_datum,
|
||||||
if(r.mahnwesen_gesperrt,'Ja',''),
|
if(r.mahnwesen_gesperrt,'Ja',''),
|
||||||
REPLACE(r.mahnwesen_internebemerkung,'\r\n','<br> '),
|
REPLACE(r.mahnwesen_internebemerkung,'\r\n','<br> '),
|
||||||
r.id
|
r.id
|
||||||
FROM rechnung r LEFT JOIN projekt p ON p.id=r.projekt LEFT JOIN adresse adr ON r.adresse=adr.id LEFT JOIN auftrag au ON au.id = r.auftragid ";
|
FROM rechnung r LEFT JOIN projekt p ON p.id=r.projekt LEFT JOIN adresse adr ON r.adresse=adr.id LEFT JOIN auftrag au ON au.id = r.auftragid LEFT JOIN mahnwesen m ON r.mahnwesen = m.id";
|
||||||
|
|
||||||
$where = " r.belegnr <> ''";
|
$where = " r.belegnr <> ''";
|
||||||
|
|
||||||
// Toggle filters
|
// Toggle filters
|
||||||
$this->app->Tpl->Add('JQUERYREADY', "$('#inkl_bezahlte').click( function() { fnFilterColumn1( 0 ); } );");
|
$this->app->Tpl->Add('JQUERYREADY', "$('#zu_mahnen').click( function() { fnFilterColumn1( 0 ); } );");
|
||||||
$this->app->Tpl->Add('JQUERYREADY', "$('#inkl_gesperrte').click( function() { fnFilterColumn2( 0 ); } );");
|
$this->app->Tpl->Add('JQUERYREADY', "$('#inkl_bezahlte').click( function() { fnFilterColumn2( 0 ); } );");
|
||||||
|
$this->app->Tpl->Add('JQUERYREADY', "$('#inkl_gesperrte').click( function() { fnFilterColumn3( 0 ); } );");
|
||||||
for ($r = 1;$r <= 2;$r++) {
|
for ($r = 1;$r <= 3;$r++) {
|
||||||
$this->app->Tpl->Add('JAVASCRIPT', '
|
$this->app->Tpl->Add('JAVASCRIPT', '
|
||||||
function fnFilterColumn' . $r . ' ( i )
|
function fnFilterColumn' . $r . ' ( i )
|
||||||
{
|
{
|
||||||
@ -96,15 +101,19 @@ class Mahnwesen {
|
|||||||
');
|
');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
$more_data1 = $app->Secure->GetGET("more_data1");
|
$more_data1 = $app->Secure->GetGET("more_data1");
|
||||||
if ($more_data1 == 1) {
|
if ($more_data1 == 1) {
|
||||||
|
$where .= " AND NOT r.versendet_mahnwesen AND r.mahnwesen <> ''";
|
||||||
|
} else {
|
||||||
|
}
|
||||||
|
$more_data2 = $app->Secure->GetGET("more_data2");
|
||||||
|
if ($more_data2 == 1) {
|
||||||
} else {
|
} else {
|
||||||
$where .= " AND r.zahlungsstatus <> 'bezahlt' ";
|
$where .= " AND r.zahlungsstatus <> 'bezahlt' ";
|
||||||
}
|
}
|
||||||
|
|
||||||
$more_data2 = $app->Secure->GetGET("more_data2");
|
$more_data3 = $app->Secure->GetGET("more_data3");
|
||||||
if ($more_data2 == 1) {
|
if ($more_data3 == 1) {
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$where .= " AND NOT r.mahnwesen_gesperrt ";
|
$where .= " AND NOT r.mahnwesen_gesperrt ";
|
||||||
@ -115,6 +124,39 @@ class Mahnwesen {
|
|||||||
$count = "SELECT count(DISTINCT id) FROM rechnung r WHERE $where";
|
$count = "SELECT count(DISTINCT id) FROM rechnung r WHERE $where";
|
||||||
// $groupby = "";
|
// $groupby = "";
|
||||||
|
|
||||||
|
break;
|
||||||
|
case "mahnwesen_einstellungen":
|
||||||
|
$allowed['mahnwesen_list'] = array('list');
|
||||||
|
$heading = array('', 'Tage', 'Name', 'Gebuehr', 'E-Mail', 'Druck', '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('m.id', 'm.tage','m.name', 'm.gebuehr', 'm.mail','m.druck');
|
||||||
|
$searchsql = array('m.stufe','m.name','m.tage', 'm.gebuehr', 'm.versandmethode');
|
||||||
|
|
||||||
|
$defaultorder = 1;
|
||||||
|
$defaultorderdesc = 1;
|
||||||
|
|
||||||
|
$dropnbox = "'<img src=./themes/new/images/details_open.png class=details>' AS `open`";
|
||||||
|
|
||||||
|
$menu = "<table cellpadding=0 cellspacing=0><tr><td nowrap>" . "<a href=\"index.php?module=mahnwesen&action=edit&id=%value%\"><img src=\"./themes/{$app->Conf->WFconf['defaulttheme']}/images/edit.svg\" border=\"0\"></a> <a href=\"#\" onclick=DeleteDialog(\"index.php?module=mahnwesen&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
|
||||||
|
m.id,
|
||||||
|
$dropnbox,
|
||||||
|
m.tage,
|
||||||
|
m.name,
|
||||||
|
".$this->app->erp->FormatMenge('m.gebuehr',2).",
|
||||||
|
if(m.mail,'Ja',''),
|
||||||
|
if(m.druck,'Ja',''),
|
||||||
|
m.id FROM mahnwesen m";
|
||||||
|
|
||||||
|
$where = "1";
|
||||||
|
$count = "SELECT count(DISTINCT id) FROM mahnwesen WHERE $where";
|
||||||
|
// $groupby = "";
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -131,10 +173,119 @@ class Mahnwesen {
|
|||||||
function mahnwesen_list() {
|
function mahnwesen_list() {
|
||||||
$this->app->erp->MenuEintrag("index.php?module=mahnwesen&action=list", "Übersicht");
|
$this->app->erp->MenuEintrag("index.php?module=mahnwesen&action=list", "Übersicht");
|
||||||
// $this->app->erp->MenuEintrag("index.php?module=mahnwesen&action=create", "Neu anlegen");
|
// $this->app->erp->MenuEintrag("index.php?module=mahnwesen&action=create", "Neu anlegen");
|
||||||
$this->app->erp->MenuEintrag("index.php", "Zurück");
|
// $this->app->erp->MenuEintrag("index.php?module=mahnwesen&action=einstellungen", "Einstellungen");
|
||||||
|
|
||||||
if($this->app->Secure->GetPOST('zahlungsstatus_berechnen') && $this->app->erp->RechteVorhanden('rechnung', 'edit')) {
|
if($this->app->Secure->GetPOST('mahnstufe_berechnen') && $this->app->erp->RechteVorhanden('rechnung', 'edit')) {
|
||||||
$this->app->erp->rechnung_zahlstatus_berechnen();
|
$this->app->erp->rechnung_zahlstatus_berechnen();
|
||||||
|
|
||||||
|
$sql = "
|
||||||
|
SELECT
|
||||||
|
r.id, r.mahnwesen, rid_mid.mahnwesen_neu
|
||||||
|
FROM
|
||||||
|
rechnung r
|
||||||
|
INNER JOIN
|
||||||
|
(
|
||||||
|
SELECT
|
||||||
|
id_tage.id,
|
||||||
|
m.id AS mahnwesen_neu
|
||||||
|
FROM
|
||||||
|
mahnwesen m
|
||||||
|
INNER JOIN(
|
||||||
|
SELECT
|
||||||
|
id,
|
||||||
|
MAX(tage) AS tage
|
||||||
|
FROM
|
||||||
|
(
|
||||||
|
SELECT
|
||||||
|
r.id,
|
||||||
|
m.tage
|
||||||
|
FROM
|
||||||
|
rechnung r
|
||||||
|
INNER JOIN mahnwesen m ON
|
||||||
|
DATEDIFF(
|
||||||
|
CURRENT_DATE,
|
||||||
|
DATE_ADD(
|
||||||
|
r.datum,
|
||||||
|
INTERVAL r.zahlungszieltage DAY
|
||||||
|
)
|
||||||
|
) > m.tage
|
||||||
|
WHERE
|
||||||
|
r.zahlungsstatus = 'offen'
|
||||||
|
ORDER BY
|
||||||
|
`r`.`id` ASC
|
||||||
|
) temp
|
||||||
|
GROUP BY
|
||||||
|
id
|
||||||
|
) id_tage
|
||||||
|
ON
|
||||||
|
m.tage = id_tage.tage
|
||||||
|
) rid_mid
|
||||||
|
ON r.id = rid_mid.id
|
||||||
|
";
|
||||||
|
$offene_rechnungen = $this->app->DB->SelectArr($sql);
|
||||||
|
|
||||||
|
foreach ($offene_rechnungen as $offene_rechnung) {
|
||||||
|
if ($offene_rechnung['mahnwesen'] != $offene_rechnung['mahnwesen_neu']) {
|
||||||
|
$sql = "UPDATE rechnung set mahnwesen = ".$offene_rechnung['mahnwesen_neu'].", versendet_mahnwesen = 0 WHERE id = ".$offene_rechnung['id'];
|
||||||
|
$this->app->DB->Update($sql);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
if($this->app->Secure->GetPOST('mahnen') && $this->app->erp->RechteVorhanden('rechnung', 'edit')) {
|
||||||
|
|
||||||
|
// Process multi action
|
||||||
|
$auswahl = $this->app->Secure->GetPOST('auswahl');
|
||||||
|
$selectedIds = [];
|
||||||
|
if(!empty($auswahl)) {
|
||||||
|
foreach($auswahl as $selectedId) {
|
||||||
|
$selectedId = (int)$selectedId;
|
||||||
|
if($selectedId > 0) {
|
||||||
|
$selectedIds[] = $selectedId;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$mails = 0;
|
||||||
|
$drucke = 0;
|
||||||
|
|
||||||
|
foreach ($selectedIds as $rechnung_id) {
|
||||||
|
|
||||||
|
$mahnung = $this->MahnwesenMessage($rechnung_id);
|
||||||
|
|
||||||
|
if ($mahnung['druck']) {
|
||||||
|
$drucker = $this->app->Secure->GetPOST('seldrucker');
|
||||||
|
if($drucker > 0) {
|
||||||
|
$this->app->erp->BriefpapierHintergrundDisable($drucker);
|
||||||
|
} else {
|
||||||
|
$msg .= "<div class=\"error\">Kein Drucker gewählt.</div>";
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
if(class_exists('RechnungPDFCustom')) {
|
||||||
|
$Brief = new RechnungPDFCustom($this->app,$projekt);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
$Brief = new RechnungPDF($this->app,$projekt);
|
||||||
|
}
|
||||||
|
$Brief->GetRechnung($rechnung_id,$mahnung['betreff'],0,null,$mahnung['body']);
|
||||||
|
$tmpfile = $Brief->displayTMP();
|
||||||
|
$this->app->printer->Drucken($drucker,$tmpfile);
|
||||||
|
unlink($tmpfile);
|
||||||
|
$this->app->erp->RechnungProtokoll($rechnung_id,'Mahnung gedruckt');
|
||||||
|
$drucke++;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($mahnung['mail']) {
|
||||||
|
$this->app->erp->RechnungProtokoll($rechnung_id,'Mahnung versendet');
|
||||||
|
$mails++;
|
||||||
|
}
|
||||||
|
|
||||||
|
$sql = "UPDATE rechnung set mahnwesen_datum = CURRENT_DATE, versendet_mahnwesen = 1";
|
||||||
|
$this->app->DB->Update($sql);
|
||||||
|
|
||||||
|
}
|
||||||
|
$msg .= "<div class=\"success\">$mails E-Mails versendet, $drucke Dokumente gedruckt.</div>";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if($this->app->Secure->GetPOST('sel_aktion') && $this->app->erp->RechteVorhanden('rechnung', 'edit'))
|
if($this->app->Secure->GetPOST('sel_aktion') && $this->app->erp->RechteVorhanden('rechnung', 'edit'))
|
||||||
@ -162,161 +313,18 @@ class Mahnwesen {
|
|||||||
case 'offen':
|
case 'offen':
|
||||||
$this->app->DB->Update("UPDATE rechnung SET zahlungsstatus='offen',bezahlt_am = NULL, mahnwesen_internebemerkung=CONCAT(mahnwesen_internebemerkung,'\r\n','Manuell als bezahlt entfernt am ".date('d.m.Y')."') WHERE id IN (".implode(', ',$auswahl).')');
|
$this->app->DB->Update("UPDATE rechnung SET zahlungsstatus='offen',bezahlt_am = NULL, mahnwesen_internebemerkung=CONCAT(mahnwesen_internebemerkung,'\r\n','Manuell als bezahlt entfernt am ".date('d.m.Y')."') WHERE id IN (".implode(', ',$auswahl).')');
|
||||||
break;
|
break;
|
||||||
case 'mail':
|
case 'mahnung_reset':
|
||||||
$auswahl = $this->app->DB->SelectFirstCols(
|
$sql = "UPDATE rechnung SET mahnwesen='', versendet_mahnwesen ='', mahnwesen_datum = '0000-00-00' WHERE id IN (".Implode(', ',$auswahl).')';
|
||||||
sprintf(
|
$this->app->DB->Update($sql);
|
||||||
"SELECT id FROM rechnung WHERE belegnr <> '' AND id IN (%s)",
|
|
||||||
implode(', ', $auswahl)
|
|
||||||
)
|
|
||||||
);
|
|
||||||
foreach($auswahl as $v) {
|
|
||||||
if(!$v) {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
$checkpapier = $this->app->DB->Select(
|
|
||||||
"SELECT a.rechnung_papier FROM rechnung AS r
|
|
||||||
LEFT JOIN adresse AS a ON r.adresse=a.id
|
|
||||||
WHERE r.id='$v'
|
|
||||||
LIMIT 1"
|
|
||||||
);
|
|
||||||
if($checkpapier!=1 &&
|
|
||||||
$this->app->DB->Select(
|
|
||||||
"SELECT r.id
|
|
||||||
FROM rechnung AS r
|
|
||||||
INNER JOIN adresse AS a ON r.adresse = a.id
|
|
||||||
WHERE r.id = '$v' AND r.email <> '' OR a.email <> ''
|
|
||||||
LIMIT 1"
|
|
||||||
)
|
|
||||||
) {
|
|
||||||
$this->app->erp->PDFArchivieren('rechnung', $v, true);
|
|
||||||
$this->app->erp->Rechnungsmail($v);
|
|
||||||
}
|
|
||||||
else if($checkpapier && $drucker) {
|
|
||||||
$this->app->erp->PDFArchivieren('rechnung', $v, true);
|
|
||||||
$projekt = $this->app->DB->Select(
|
|
||||||
"SELECT projekt FROM rechnung WHERE id='$v' LIMIT 1"
|
|
||||||
);
|
|
||||||
if(class_exists('RechnungPDFCustom')) {
|
|
||||||
$Brief = new RechnungPDFCustom($this->app,$projekt);
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
$Brief = new RechnungPDF($this->app,$projekt);
|
|
||||||
}
|
|
||||||
$Brief->GetRechnung($v);
|
|
||||||
$tmpfile = $Brief->displayTMP();
|
|
||||||
$Brief->ArchiviereDocument();
|
|
||||||
$this->app->printer->Drucken($drucker,$tmpfile);
|
|
||||||
unlink($tmpfile);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case 'versendet':
|
|
||||||
$auswahl = $this->app->DB->SelectFirstCols(
|
|
||||||
sprintf(
|
|
||||||
"SELECT id FROM rechnung WHERE belegnr <> '' AND id IN (%s)",
|
|
||||||
implode(', ', $auswahl)
|
|
||||||
)
|
|
||||||
);
|
|
||||||
foreach($auswahl as $v) {
|
|
||||||
if($v) {
|
|
||||||
$reArr = $this->app->DB->SelectRow(
|
|
||||||
sprintf(
|
|
||||||
"SELECT projekt,belegnr,status,usereditid,
|
|
||||||
DATE_SUB(NOW(), INTERVAL 30 SECOND) < useredittimestamp AS `open`
|
|
||||||
FROM rechnung WHERE id=%d LIMIT 1",
|
|
||||||
$v
|
|
||||||
)
|
|
||||||
);
|
|
||||||
if($reArr['belegnr'] === '' || ($reArr['open'] && $reArr['status'] === 'freigegeben')) {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
$this->markInvoiceAsClosed($v);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case 'drucken':
|
|
||||||
if($drucker) {
|
|
||||||
$auswahl = $this->app->DB->SelectFirstCols(
|
|
||||||
sprintf(
|
|
||||||
"SELECT id FROM rechnung WHERE belegnr <> '' AND id IN (%s)",
|
|
||||||
implode(', ', $auswahl)
|
|
||||||
)
|
|
||||||
);
|
|
||||||
foreach($auswahl as $v) {
|
|
||||||
$reArr = $this->app->DB->SelectRow(
|
|
||||||
sprintf(
|
|
||||||
"SELECT projekt,belegnr,status,usereditid,adresse,
|
|
||||||
DATE_SUB(NOW(), INTERVAL 30 SECOND) < useredittimestamp AS `open`
|
|
||||||
FROM rechnung WHERE id=%d LIMIT 1",
|
|
||||||
$v
|
|
||||||
)
|
|
||||||
);
|
|
||||||
if($reArr['belegnr'] === '' || ($reArr['open'] && $reArr['status'] === 'freigegeben')) {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
if($reArr['status'] === 'freigegeben') {
|
|
||||||
$this->app->erp->RechnungNeuberechnen($v);
|
|
||||||
}
|
|
||||||
$projekt = $reArr['projekt'];//$this->app->DB->Select("SELECT projekt FROM rechnung WHERE id='$v' LIMIT 1");
|
|
||||||
$this->app->erp->RechnungProtokoll($v,'Rechnung gedruckt');
|
|
||||||
$this->app->DB->Update("UPDATE rechnung SET schreibschutz=1, versendet = 1 WHERE id = '$v' LIMIT 1");
|
|
||||||
$this->app->DB->Update("UPDATE rechnung SET status='versendet' WHERE id = '$v' AND status!='storniert' LIMIT 1");
|
|
||||||
$this->app->erp->PDFArchivieren('rechnung', $v, true);
|
|
||||||
if(class_exists('RechnungPDFCustom')) {
|
|
||||||
$Brief = new RechnungPDFCustom($this->app,$projekt);
|
|
||||||
}
|
|
||||||
else{
|
|
||||||
$Brief = new RechnungPDF($this->app,$projekt);
|
|
||||||
}
|
|
||||||
$Brief->GetRechnung($v);
|
|
||||||
$tmpfile = $Brief->displayTMP();
|
|
||||||
$Brief->ArchiviereDocument();
|
|
||||||
$this->app->printer->Drucken($drucker,$tmpfile);
|
|
||||||
$doctype = 'rechnung';
|
|
||||||
$this->app->erp->RunHook('dokumentsend_ende', 5, $doctype, $v, $projekt, $reArr['adresse'], $aktion);
|
|
||||||
@unlink($tmpfile);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case 'pdf':
|
|
||||||
$tmpfile = [];
|
|
||||||
foreach($auswahl as $v) {
|
|
||||||
$projekt = $this->app->DB->Select("SELECT projekt FROM rechnung WHERE id=$v LIMIT 1");
|
|
||||||
if(class_exists('RechnungPDFCustom')) {
|
|
||||||
$Brief = new RechnungPDFCustom($this->app,$projekt);
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
$Brief = new RechnungPDF($this->app,$projekt);
|
|
||||||
}
|
|
||||||
$Brief->GetRechnung($v);
|
|
||||||
$tmpfile[] = $Brief->displayTMP();
|
|
||||||
}
|
|
||||||
|
|
||||||
if((!empty($tmpfile)?count($tmpfile):0) > 0) {
|
|
||||||
try {
|
|
||||||
/** @var PdfMerger $pdfMerger */
|
|
||||||
$pdfMerger = $this->app->Container->get('PdfMerger');
|
|
||||||
$mergeOutputPath = realpath($this->app->erp->GetTMP()) . '/' . uniqid('sammelpdf_', true) . '.pdf';
|
|
||||||
$pdfMerger->merge($tmpfile, $mergeOutputPath);
|
|
||||||
|
|
||||||
foreach($tmpfile as $key=>$value) {
|
|
||||||
unlink($value);
|
|
||||||
}
|
|
||||||
|
|
||||||
header('Content-type:application/pdf');
|
|
||||||
header('Content-Disposition: attachment;filename='.md5(microtime(true)).'.pdf');
|
|
||||||
readfile($mergeOutputPath);
|
|
||||||
$this->app->ExitXentral();
|
|
||||||
} catch (PdfComponentExceptionInterface $exception) {
|
|
||||||
echo 'Fehler beim Generieren der Sammelpdf: ' . htmlspecialchars($exception->getMessage());
|
|
||||||
$this->app->ExitXentral();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} // ende ausfuehren
|
} // ende ausfuehren
|
||||||
|
|
||||||
|
if (!empty($msg)) {
|
||||||
|
$this->app->Tpl->Set('MESSAGE', $msg);
|
||||||
|
}
|
||||||
|
|
||||||
if($this->app->erp->RechteVorhanden('rechnung', 'manuellbezahltmarkiert')){
|
if($this->app->erp->RechteVorhanden('rechnung', 'manuellbezahltmarkiert')){
|
||||||
$this->app->Tpl->Set('ALSBEZAHLTMARKIEREN', '<option value="bezahlt">{|als bezahlt markieren|}</option>');
|
$this->app->Tpl->Set('ALSBEZAHLTMARKIEREN', '<option value="bezahlt">{|als bezahlt markieren|}</option>');
|
||||||
}
|
}
|
||||||
@ -327,6 +335,16 @@ class Mahnwesen {
|
|||||||
$this->app->Tpl->Parse('PAGE', "mahnwesen_list.tpl");
|
$this->app->Tpl->Parse('PAGE', "mahnwesen_list.tpl");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function mahnwesen_einstellungen() {
|
||||||
|
$this->app->erp->MenuEintrag("index.php?module=mahnwesen&action=einstellungen", "Übersicht");
|
||||||
|
$this->app->erp->MenuEintrag("index.php?module=mahnwesen&action=create", "Neu anlegen");
|
||||||
|
$this->app->erp->MenuEintrag("index.php?module=einstellungen&action=list", "Zurück");
|
||||||
|
$this->app->erp->Headlines('Mahnwesen Einstellungen');
|
||||||
|
|
||||||
|
$this->app->YUI->TableSearch('TAB1', 'mahnwesen_einstellungen', "show", "", "", basename(__FILE__), __CLASS__);
|
||||||
|
$this->app->Tpl->Parse('PAGE', "mahnwesen_einstellungen.tpl");
|
||||||
|
}
|
||||||
|
|
||||||
public function mahnwesen_delete() {
|
public function mahnwesen_delete() {
|
||||||
$id = (int) $this->app->Secure->GetGET('id');
|
$id = (int) $this->app->Secure->GetGET('id');
|
||||||
|
|
||||||
@ -353,7 +371,7 @@ class Mahnwesen {
|
|||||||
$this->app->Tpl->Set('ID', $id);
|
$this->app->Tpl->Set('ID', $id);
|
||||||
|
|
||||||
$this->app->erp->MenuEintrag("index.php?module=mahnwesen&action=edit&id=$id", "Details");
|
$this->app->erp->MenuEintrag("index.php?module=mahnwesen&action=edit&id=$id", "Details");
|
||||||
$this->app->erp->MenuEintrag("index.php?module=mahnwesen&action=list", "Zurück zur Übersicht");
|
$this->app->erp->MenuEintrag("index.php?module=mahnwesen&action=einstellungen", "Zurück zur Übersicht");
|
||||||
$id = $this->app->Secure->GetGET('id');
|
$id = $this->app->Secure->GetGET('id');
|
||||||
$input = $this->GetInput();
|
$input = $this->GetInput();
|
||||||
$submit = $this->app->Secure->GetPOST('submit');
|
$submit = $this->app->Secure->GetPOST('submit');
|
||||||
@ -384,19 +402,18 @@ class Mahnwesen {
|
|||||||
$fix = ", ";
|
$fix = ", ";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// echo($columns."<br>");
|
// echo($columns."<br>");
|
||||||
// echo($values."<br>");
|
// echo($values."<br>");
|
||||||
// echo($update."<br>");
|
// echo($update."<br>");
|
||||||
|
|
||||||
$sql = "INSERT INTO mahnwesen (".$columns.") VALUES (".$values.") ON DUPLICATE KEY UPDATE ".$update;
|
$sql = "INSERT INTO mahnwesen (".$columns.") VALUES (".$values.") ON DUPLICATE KEY UPDATE ".$update;
|
||||||
|
|
||||||
// echo($sql);
|
|
||||||
|
|
||||||
$this->app->DB->Update($sql);
|
$this->app->DB->Update($sql);
|
||||||
|
|
||||||
if ($id == 'NULL') {
|
if ($id == 'NULL') {
|
||||||
$msg = $this->app->erp->base64_url_encode("<div class=\"success\">Das Element wurde erfolgreich angelegt.</div>");
|
$msg = $this->app->erp->base64_url_encode("<div class=\"success\">Das Element wurde erfolgreich angelegt.</div>");
|
||||||
header("Location: index.php?module=mahnwesen&action=list&msg=$msg");
|
header("Location: index.php?module=mahnwesen&action=einstellungen&msg=$msg");
|
||||||
} else {
|
} else {
|
||||||
$this->app->Tpl->Set('MESSAGE', "<div class=\"success\">Die Einstellungen wurden erfolgreich übernommen.</div>");
|
$this->app->Tpl->Set('MESSAGE', "<div class=\"success\">Die Einstellungen wurden erfolgreich übernommen.</div>");
|
||||||
}
|
}
|
||||||
@ -405,7 +422,7 @@ class Mahnwesen {
|
|||||||
|
|
||||||
// Load values again from database
|
// 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=\"',m.id,'\" />') AS `auswahl`";
|
$dropnbox = "'<img src=./themes/new/images/details_open.png class=details>' AS `open`, CONCAT('<input type=\"checkbox\" name=\"auswahl[]\" value=\"',m.id,'\" />') AS `auswahl`";
|
||||||
$result = $this->app->DB->SelectArr("SELECT SQL_CALC_FOUND_ROWS m.id, $dropnbox, m.name, m.rest, m.test, m.id FROM mahnwesen m"." WHERE id=$id");
|
$result = $this->app->DB->SelectArr("SELECT SQL_CALC_FOUND_ROWS m.id, $dropnbox, m.stufe, m.name, m.tage, m.gebuehr, m.mail, m.druck, m.id FROM mahnwesen m"." WHERE id=$id");
|
||||||
|
|
||||||
foreach ($result[0] as $key => $value) {
|
foreach ($result[0] as $key => $value) {
|
||||||
$this->app->Tpl->Set(strtoupper($key), $value);
|
$this->app->Tpl->Set(strtoupper($key), $value);
|
||||||
@ -420,7 +437,9 @@ class Mahnwesen {
|
|||||||
$this->app->Tpl->Add('ANGEZEIGTERNAME', $angezeigtername);
|
$this->app->Tpl->Add('ANGEZEIGTERNAME', $angezeigtername);
|
||||||
*/
|
*/
|
||||||
|
|
||||||
// $this->SetInput($input);
|
$this->app->Tpl->Set('MAIL', $result[0]['mail']?'checked':'');
|
||||||
|
$this->app->Tpl->Set('DRUCK', $result[0]['druck']?'checked':'');
|
||||||
|
|
||||||
$this->app->Tpl->Parse('PAGE', "mahnwesen_edit.tpl");
|
$this->app->Tpl->Parse('PAGE', "mahnwesen_edit.tpl");
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -429,13 +448,12 @@ class Mahnwesen {
|
|||||||
*/
|
*/
|
||||||
public function GetInput(): array {
|
public function GetInput(): array {
|
||||||
$input = array();
|
$input = array();
|
||||||
//$input['EMAIL'] = $this->app->Secure->GetPOST('email');
|
|
||||||
|
|
||||||
$input['name'] = $this->app->Secure->GetPOST('name');
|
$input['name'] = $this->app->Secure->GetPOST('name');
|
||||||
$input['rest'] = $this->app->Secure->GetPOST('rest');
|
$input['stufe'] = $this->app->Secure->GetPOST('stufe');
|
||||||
$input['test'] = $this->app->Secure->GetPOST('test');
|
$input['tage'] = $this->app->Secure->GetPOST('tage');
|
||||||
|
$input['gebuehr'] = $this->app->Secure->GetPOST('gebuehr');
|
||||||
|
$input['mail'] = $this->app->Secure->GetPOST('mail')?'1':'0';
|
||||||
|
$input['druck'] = $this->app->Secure->GetPOST('druck')?'1':'0';
|
||||||
return $input;
|
return $input;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -443,11 +461,201 @@ class Mahnwesen {
|
|||||||
* Set all fields in the page corresponding to $input
|
* Set all fields in the page corresponding to $input
|
||||||
*/
|
*/
|
||||||
function SetInput($input) {
|
function SetInput($input) {
|
||||||
// $this->app->Tpl->Set('EMAIL', $input['email']);
|
|
||||||
|
|
||||||
$this->app->Tpl->Set('NAME', $input['name']);
|
$this->app->Tpl->Set('NAME', $input['name']);
|
||||||
$this->app->Tpl->Set('REST', $input['rest']);
|
$this->app->Tpl->Set('STUFE', $input['stufe']);
|
||||||
$this->app->Tpl->Set('TEST', $input['test']);
|
$this->app->Tpl->Set('TAGE', $input['tage']);
|
||||||
|
$this->app->Tpl->Set('GEBUEHR', $input['gebuehr']);
|
||||||
|
$this->app->Tpl->Set('MAIL', $input['mail']);
|
||||||
|
$this->app->Tpl->Set('DRUCK', $input['druck']);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Constuct the Mahnwesen message according to GeschäftsbriefVorlage
|
||||||
|
* Returns Array (string betreff, string body, boolean mail, boolean druck)
|
||||||
|
*/
|
||||||
|
function MahnwesenMessage($rechnung_id) {
|
||||||
|
|
||||||
|
$sql = "SELECT
|
||||||
|
r.*,
|
||||||
|
".$this->app->erp->FormatDate('datum')." datum,
|
||||||
|
".$this->app->erp->FormatDate('CURRENT_DATE')." heute,
|
||||||
|
m.name as mahn_name,
|
||||||
|
m.tage as mahn_tage,
|
||||||
|
m.gebuehr as mahn_gebuehr,
|
||||||
|
m.mail as mahn_mail,
|
||||||
|
m.druck as mahn_druck
|
||||||
|
FROM
|
||||||
|
rechnung r
|
||||||
|
INNER JOIN
|
||||||
|
mahnwesen m
|
||||||
|
ON
|
||||||
|
r.mahnwesen = m.id WHERE r.id = ".$rechnung_id." LIMIT 1";
|
||||||
|
$rechnungarr = $this->app->DB->SelectArr($sql)[0];
|
||||||
|
|
||||||
|
if (empty($rechnungarr)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
$adresse = $rechnungarr['adresse'];
|
||||||
|
if($sprache==''){
|
||||||
|
$sprache = $rechnungarr['sprache'];
|
||||||
|
}
|
||||||
|
if($sprache==''){
|
||||||
|
$sprache = $this->app->DB->Select("SELECT sprache FROM adresse WHERE id='$adresse' LIMIT 1");
|
||||||
|
}
|
||||||
|
|
||||||
|
$kundennummer = $rechnungarr['kundennummer'];
|
||||||
|
$projekt = $rechnungarr['projekt'];
|
||||||
|
$auftrag= $rechnungarr['auftrag'];
|
||||||
|
$buchhaltung= $rechnungarr['buchhaltung'];
|
||||||
|
$lieferschein = $rechnungarr['lieferschein'];
|
||||||
|
$lieferscheinid = $lieferschein;
|
||||||
|
if($lieferscheinid){
|
||||||
|
$lieferschein = $this->app->DB->Select("SELECT belegnr FROM lieferschein WHERE id='$lieferschein' LIMIT 1");
|
||||||
|
}else{
|
||||||
|
$lieferschein = '';
|
||||||
|
}
|
||||||
|
$bestellbestaetigung = $rechnungarr['kundennummer'];
|
||||||
|
$datum = $rechnungarr['datum_de'];
|
||||||
|
$datum_sql = $rechnungarr['datum'];
|
||||||
|
$belegnr = $rechnungarr['belegnr'];
|
||||||
|
$doppel = $rechnungarr['doppel'];
|
||||||
|
$freitext = $rechnungarr['freitext'];
|
||||||
|
$ustid = $rechnungarr['ustid'];
|
||||||
|
$soll = $rechnungarr['soll'];
|
||||||
|
$ist = $rechnungarr['ist'];
|
||||||
|
$land = $rechnungarr['land'];
|
||||||
|
$mahnwesen_datum = $rechnungarr['mahnwesen_datum'];
|
||||||
|
$mahnwesen_datum_deutsch = $rechnungarr['mahnwesen_datum_de'];
|
||||||
|
$zahlungsweise = $rechnungarr['zahlungsweise'];
|
||||||
|
$zahlungsstatus = $rechnungarr['zahlungsstatus'];
|
||||||
|
$zahlungszieltage = $rechnungarr['zahlungszieltage'];
|
||||||
|
$zahlungszieltageskonto = $rechnungarr['zahlungszieltageskonto'];
|
||||||
|
$zahlungszielskonto = $rechnungarr['zahlungszielskonto'];
|
||||||
|
$waehrung = $rechnungarr['waehrung'];
|
||||||
|
|
||||||
|
$zahlungdatum = $this->app->DB->Select("SELECT DATE_FORMAT(DATE_ADD(datum, INTERVAL $zahlungszieltage DAY),'%d.%m.%Y') FROM rechnung WHERE id='$rechnung_id' LIMIT 1");
|
||||||
|
|
||||||
|
if($_datum!=null)
|
||||||
|
{
|
||||||
|
$mahnwesen_datum = $this->app->String->Convert($_datum,'%1.%2.%3','%3-%2-%1');
|
||||||
|
$mahnwesen_datum_deutsch = $_datum;
|
||||||
|
}
|
||||||
|
|
||||||
|
$zahlungsweise = strtolower($zahlungsweise);
|
||||||
|
/*
|
||||||
|
if($als=='zahlungserinnerung')
|
||||||
|
{
|
||||||
|
$body = $this->GetGeschaeftsBriefText("MahnwesenZahlungserinnerung",$sprache,$projekt,"rechnung",$rechnung_id);
|
||||||
|
$tage = $this->GetKonfiguration('mahnwesen_m1_tage');
|
||||||
|
}
|
||||||
|
else if($als=='mahnung1')
|
||||||
|
{
|
||||||
|
$body = $this->GetGeschaeftsBriefText("MahnwesenMahnung1",$sprache,$projekt,"rechnung",$rechnung_id);
|
||||||
|
$mahngebuehr = $this->GetKonfiguration('mahnwesen_m1_gebuehr');
|
||||||
|
$tage = $this->GetKonfiguration('mahnwesen_m2_tage');
|
||||||
|
}
|
||||||
|
else if($als=='mahnung2')
|
||||||
|
{
|
||||||
|
$body = $this->GetGeschaeftsBriefText("MahnwesenMahnung2",$sprache,$projekt,"rechnung",$rechnung_id);
|
||||||
|
$tage = $this->GetKonfiguration('mahnwesen_m3_tage');
|
||||||
|
$mahngebuehr = $this->GetKonfiguration('mahnwesen_m2_gebuehr');
|
||||||
|
}
|
||||||
|
else if($als=='mahnung3')
|
||||||
|
{
|
||||||
|
$body = $this->GetGeschaeftsBriefText("MahnwesenMahnung3",$sprache,$projekt,"rechnung",$rechnung_id);
|
||||||
|
$tage = $this->GetKonfiguration('mahnwesen_ik_tage');
|
||||||
|
$mahngebuehr = $this->GetKonfiguration('mahnwesen_m3_gebuehr');
|
||||||
|
}
|
||||||
|
else if($als=='inkasso')
|
||||||
|
{
|
||||||
|
$body = $this->GetGeschaeftsBriefText("MahnwesenInkasso",$sprache,$projekt,"rechnung",$rechnung_id);
|
||||||
|
//$tage = $this->GetKonfiguration("mahnwesen_ik_tage");
|
||||||
|
$tage = 3; //eigentlich vorbei
|
||||||
|
$mahngebuehr = $this->GetKonfiguration('mahnwesen_ik_gebuehr');
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$body = $this->app->erp->Beschriftung("dokument_anschreiben");
|
||||||
|
} */
|
||||||
|
|
||||||
|
$betreff = $this->app->erp->GetGeschaeftsBriefBetreff($rechnungarr['mahn_name'],$sprache,$projekt,"rechnung",$rechnung_id);
|
||||||
|
$body = $this->app->erp->GetGeschaeftsBriefText($rechnungarr['mahn_name'],$sprache,$projekt,"rechnung",$rechnung_id);
|
||||||
|
|
||||||
|
if (empty($betreff) || empty($body)) {
|
||||||
|
throw new QueryFailureException("Geschaeftsbrief-Vorlage nicht gefunden: ''".$rechnungarr['mahn_name']."'");
|
||||||
|
}
|
||||||
|
|
||||||
|
$offen = $this->app->erp->GetSaldoDokument($rechnung_id, 'rechnung');
|
||||||
|
|
||||||
|
if($tage <=0) $tage = 0;
|
||||||
|
|
||||||
|
/* $datummahnung= $this->app->DB->Select("SELECT DATE_FORMAT(DATE_ADD('$mahnwesen_datum', INTERVAL $tage DAY),'%d.%m.%Y')");
|
||||||
|
$datumrechnungzahlungsziel= $this->app->DB->Select("SELECT DATE_FORMAT(DATE_ADD('$datum_sql', INTERVAL $zahlungszieltage DAY),'%d.%m.%Y')");
|
||||||
|
|
||||||
|
$tage_ze = $zahlungszieltage + $this->GetKonfiguration('mahnwesen_m1_tage');
|
||||||
|
$datumzahlungserinnerung= $this->app->DB->Select("SELECT DATE_FORMAT(DATE_ADD('$datum_sql', INTERVAL $tage_ze DAY),'%d.%m.%Y')");*/
|
||||||
|
|
||||||
|
// checkstamp $this->CheckStamp("jhdskKUHsiusakiakuhsd"); // errechnet aus laufzeit und kundenid // wenn es nicht drinnen ist darf es nicht gehen
|
||||||
|
/*
|
||||||
|
if($mahngebuehr=='' || !is_numeric($mahngebuehr))
|
||||||
|
$mahngebuehr = 0;
|
||||||
|
|
||||||
|
//$offen= '11,23';
|
||||||
|
$body = str_replace('{RECHNUNG}',$belegnr,$body);
|
||||||
|
$body = str_replace('{BELEGNR}',$belegnr,$body);
|
||||||
|
$body = str_replace('{DATUMRECHNUNG}',$datum,$body);
|
||||||
|
$body = str_replace('{TAGE}',$tage,$body);
|
||||||
|
$body = str_replace('{OFFEN}',$this->app->erp->formatMoney(-$offen['betrag'],$offen['waehrung']),$body);
|
||||||
|
$body = str_replace('{SOLL}',$this->app->erp->formatMoney($soll,$waehrung),$body);
|
||||||
|
$body = str_replace('{SUMME}',$this->app->erp->formatMoney($soll - $ist + $mahngebuehr,$waehrung),$body);
|
||||||
|
$body = str_replace('{IST}',$this->app->erp->formatMoney($ist,$waehrung),$body);
|
||||||
|
$body = str_replace('{DATUM}',$datummahnung,$body);
|
||||||
|
$body = str_replace('{MAHNGEBUEHR}',$this->app->erp->formatMoney($mahngebuehr,$waehrung),$body);
|
||||||
|
$body = str_replace('{OFFENMITMAHNGEBUEHR}',$this->app->erp->formatMoney($mahngebuehr + $soll - $ist,$waehrung),$body);
|
||||||
|
$body = str_replace('{MAHNDATUM}',$mahnwesen_datum_deutsch,$body);
|
||||||
|
|
||||||
|
|
||||||
|
// Im Protokoll suchen Datum von Zahlungserinnerung, Mahnung 1, Mahnung 2, Mahnung 3
|
||||||
|
|
||||||
|
$mahnung1 = $this->app->DB->Select("SELECT DATE_FORMAT(zeit,'%d.%m.%Y') FROM rechnung_protokoll WHERE rechnung='$rechnung_id'
|
||||||
|
AND grund LIKE 'Mahnung1 versendet%' ORDER by Zeit DESC LIMIT 1");
|
||||||
|
|
||||||
|
$mahnung2 = $this->app->DB->Select("SELECT DATE_FORMAT(zeit,'%d.%m.%Y') FROM rechnung_protokoll WHERE rechnung='$rechnung_id'
|
||||||
|
AND grund LIKE 'Mahnung2 versendet%' ORDER by Zeit DESC LIMIT 1");
|
||||||
|
|
||||||
|
$mahnung3 = $this->app->DB->Select("SELECT DATE_FORMAT(zeit,'%d.%m.%Y') FROM rechnung_protokoll WHERE rechnung='$rechnung_id'
|
||||||
|
AND grund LIKE 'Mahnung3 versendet%' ORDER by Zeit DESC LIMIT 1");
|
||||||
|
|
||||||
|
$body = str_replace('{DATUMMAHNUNG1}',$mahnung1,$body);
|
||||||
|
$body = str_replace('{DATUMMAHNUNG2}',$mahnung2,$body);
|
||||||
|
$body = str_replace('{DATUMMAHNUNG3}',$mahnung3,$body);
|
||||||
|
|
||||||
|
$body = str_replace('{DATUMZAHLUNGSERINNERUNGFAELLIG}',$datumzahlungserinnerung,$body);
|
||||||
|
$body = str_replace('{DATUMZAHLUNGSERINNERUNG}',$datumzahlungserinnerung,$body);
|
||||||
|
$body = str_replace('{DATUMRECHNUNGZAHLUNGSZIEL}',$datumrechnungzahlungsziel,$body);*/
|
||||||
|
|
||||||
|
$mapping = [
|
||||||
|
'rechnung' => $belegnr,
|
||||||
|
'belegnr' => $belegnr,
|
||||||
|
'datum' => $datum_sql,
|
||||||
|
'offen' => $this->app->erp->EUR(-$offen['betrag'])." ".$offen['waehrung'],
|
||||||
|
'mahngebuehr' => $this->app->erp->EUR($rechnungarr['mahn_gebuehr']),
|
||||||
|
'heute' => $rechnungarr['heute']
|
||||||
|
];
|
||||||
|
|
||||||
|
$betreff = $this->app->erp->ParseVars($mapping,$betreff);
|
||||||
|
$body = $this->app->erp->ParseVars($mapping,$body);
|
||||||
|
$body = $this->app->erp->ParseUserVars('rechnung',$rechnung_id,$body);
|
||||||
|
|
||||||
|
return(array(
|
||||||
|
'betreff' => $betreff,
|
||||||
|
'body' => $body,
|
||||||
|
'mail' => $rechnungarr['mahn_mail'] != 0,
|
||||||
|
'druck' => $rechnungarr['mahn_druck'] != 0,
|
||||||
|
'empfaenger' => $rechnungarr['email']
|
||||||
|
));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -644,7 +644,11 @@ class Rechnung extends GenRechnung
|
|||||||
if($auftragArr[0]['mahnwesen']=='') {
|
if($auftragArr[0]['mahnwesen']=='') {
|
||||||
$auftragArr[0]['mahnwesen']='-';
|
$auftragArr[0]['mahnwesen']='-';
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->app->Tpl->Set('MAHNWESEN',$auftragArr[0]['mahnwesen']);
|
$this->app->Tpl->Set('MAHNWESEN',$auftragArr[0]['mahnwesen']);
|
||||||
|
|
||||||
|
$this->app->Tpl->Set('MAHNWESEN','XXX');
|
||||||
|
|
||||||
if($auftragArr[0]['mahnwesen_datum']=='0000-00-00') {
|
if($auftragArr[0]['mahnwesen_datum']=='0000-00-00') {
|
||||||
$auftragArr[0]['mahnwesen_datum']='-';
|
$auftragArr[0]['mahnwesen_datum']='-';
|
||||||
}
|
}
|
||||||
@ -889,7 +893,7 @@ class Rechnung extends GenRechnung
|
|||||||
$tmp->Query("SELECT zeit,bearbeiter,grund FROM rechnung_protokoll WHERE rechnung='$id' ORDER by zeit DESC",0,"");
|
$tmp->Query("SELECT zeit,bearbeiter,grund FROM rechnung_protokoll WHERE rechnung='$id' ORDER by zeit DESC",0,"");
|
||||||
$tmp->DisplayNew('PROTOKOLL',"Protokoll","noAction");
|
$tmp->DisplayNew('PROTOKOLL',"Protokoll","noAction");
|
||||||
|
|
||||||
|
/*
|
||||||
$query = $this->app->DB->SelectArr("SELECT zeit,bearbeiter,grund FROM rechnung_protokoll WHERE rechnung='$id' ORDER by zeit");
|
$query = $this->app->DB->SelectArr("SELECT zeit,bearbeiter,grund FROM rechnung_protokoll WHERE rechnung='$id' ORDER by zeit");
|
||||||
if($query)
|
if($query)
|
||||||
{
|
{
|
||||||
@ -905,12 +909,12 @@ class Rechnung extends GenRechnung
|
|||||||
{
|
{
|
||||||
|
|
||||||
$tmp2 = new EasyTable($this->app);
|
$tmp2 = new EasyTable($this->app);
|
||||||
$tmp2->Query("SELECT concat('<a href=\"index.php?module=mahnwesen&action=mahnpdf&id=',rechnung,'&datum=',DATE_FORMAT(zeit,'%d.%m.%Y'),'&mahnwesen=',LOWER(LEFT(grund,LOCATE(' ',grund))),'\"><img src=\"themes/{$this->app->Conf->WFconf[defaulttheme]}/images/pdf.svg\" border=\"0\"></a>') as PDF, Date(zeit) as Datum, bearbeiter,grund FROM rechnung_protokoll WHERE rechnung='$id' AND zeit >= '".$zeit."' ORDER by zeit DESC");
|
$tmp2->Query("SELECT concat('<a href=\"index.php?module=mahnwesen&action=mahnpdf&id=',rechnung,'&datum=',DATE_FORMAT(zeit,'%d.%m.%Y'),'&mahnwesen=',LOWER(LEFT(grund,LOCATE(' ',grund))),'\"><img src=\"themes/{$this->app->Conf->WFconf['defaulttheme']}/images/pdf.svg\" border=\"0\"></a>') as PDF, Date(zeit) as Datum, bearbeiter,grund FROM rechnung_protokoll WHERE rechnung='$id' AND zeit >= '".$zeit."' ORDER by zeit DESC");
|
||||||
$tmp2->DisplayNew('MAHNPROTOKOLL',"Protokoll","noAction");
|
$tmp2->DisplayNew('MAHNPROTOKOLL',"Protokoll","noAction");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}*/
|
||||||
|
|
||||||
if(class_exists('RechnungPDFCustom'))
|
if(class_exists('RechnungPDFCustom'))
|
||||||
{
|
{
|
||||||
@ -2780,7 +2784,7 @@ class Rechnung extends GenRechnung
|
|||||||
// Skonto ok -> book difference
|
// Skonto ok -> book difference
|
||||||
$sachkonto = $this->app->erp->Firmendaten('rechnung_skonto_kontorahmen');
|
$sachkonto = $this->app->erp->Firmendaten('rechnung_skonto_kontorahmen');
|
||||||
if (!empty($sachkonto)) {
|
if (!empty($sachkonto)) {
|
||||||
$this->app->erp->fibu_buchungen_buchen('rechnung',$offene_rechnung['id'],'kontorahmen',$sachkonto,-$saldo['betrag'],$offene_rechnung['waehrung'],'CURRENT_DATE','');
|
$this->app->erp->fibu_buchungen_buchen('rechnung',$offene_rechnung['id'],'kontorahmen',$sachkonto,-$saldo['betrag'],$offene_rechnung['waehrung'],date('Y-m-d'),'');
|
||||||
$offene_rechnung['ist'] = $offene_rechnung['soll'];
|
$offene_rechnung['ist'] = $offene_rechnung['soll'];
|
||||||
} else {
|
} else {
|
||||||
}
|
}
|
||||||
|
@ -133,12 +133,19 @@ class WidgetGenrechnung
|
|||||||
|
|
||||||
$field = new HTMLSelect("mahnwesen",0,"mahnwesen","","","0");
|
$field = new HTMLSelect("mahnwesen",0,"mahnwesen","","","0");
|
||||||
$field->AddOption('','');
|
$field->AddOption('','');
|
||||||
$field->AddOption('Zahlungserinnerung','zahlungserinnerung');
|
/* $field->AddOption('Zahlungserinnerung','zahlungserinnerung');
|
||||||
$field->AddOption('Mahnung 1','mahnung1');
|
$field->AddOption('Mahnung 1','mahnung1');
|
||||||
$field->AddOption('Mahnung 2','mahnung2');
|
$field->AddOption('Mahnung 2','mahnung2');
|
||||||
$field->AddOption('Mahnung 3','mahnung3');
|
$field->AddOption('Mahnung 3','mahnung3');
|
||||||
$field->AddOption('Inkasso','inkasso');
|
$field->AddOption('Inkasso','inkasso');
|
||||||
$field->AddOption('Forderungsverlust','forderungsverlust');
|
$field->AddOption('Forderungsverlust','forderungsverlust');*/
|
||||||
|
|
||||||
|
$mahnstufen = $this->app->DB->SelectArr("Select name,id FROM mahnwesen ORDER BY tage DESC");
|
||||||
|
|
||||||
|
foreach ($mahnstufen as $mahnstufe) {
|
||||||
|
$field->AddOption($mahnstufe['name'],$mahnstufe['id']);
|
||||||
|
}
|
||||||
|
|
||||||
$this->form->NewField($field);
|
$this->form->NewField($field);
|
||||||
|
|
||||||
$field = new HTMLInput("mahnwesen_datum","text","","10","","","","","","","","0","","");
|
$field = new HTMLInput("mahnwesen_datum","text","","10","","","","","","","","0","","");
|
||||||
|
Loading…
Reference in New Issue
Block a user