Zahlungsstatus Rechnung Gutschrift reworked with fibu_buchungen

This commit is contained in:
OpenXE 2023-03-25 17:50:04 +01:00
parent 6a566a99af
commit c220639e82
12 changed files with 887 additions and 942 deletions

View File

@ -6081,11 +6081,11 @@ r.land as land, p.abkuerzung as projekt, r.zahlungsweise as zahlungsweise,
$heading = array('', '', 'Gutschrift', 'Vom', 'Kd-Nr.', 'Kunde', 'Land', 'Projekt', $heading = array('', '', 'Gutschrift', 'Vom', 'Kd-Nr.', 'Kunde', 'Land', 'Projekt',
'Zahlweise', 'Betrag (brutto)', 'bezahlt','RE-Nr.', 'Status','Monitor' ,'Menü' 'Zahlweise', 'Betrag (brutto)', 'Zahlstatus','Differenz','RE-Nr.', 'Status','Monitor' ,'Menü'
); );
$width = array('1%', '1%', '10%', '10%', '10%', '25%', '5%', '1%', '1%', '1%', '1%', '1%','5%', '1%','1%', '1%'); $width = array('1%', '1%', '10%', '10%', '10%', '25%', '5%', '1%', '1%', '1%', '1%', '1%', '1%','5%', '1%','1%', '1%');
$findcols = array('open', 'r.belegnr', 'r.belegnr', 'r.datum', 'adr.kundennummer', 'r.name', 'r.land', 'p.abkuerzung', 'r.zahlungsweise', 'r.soll','re.belegnr', 'r.zahlungsstatus', 'r.status', 'pt.payement_status' ,'id'); $findcols = array('open', 'r.belegnr', 'r.belegnr', 'r.datum', 'adr.kundennummer', 'r.name', 'r.land', 'p.abkuerzung', 'r.zahlungsweise', 'r.soll','re.belegnr', 'r.zahlungsstatus','differenz', 'r.status', 'pt.payement_status' ,'id');
$searchsql = array('DATE_FORMAT(r.datum,\'%d.%m.%Y\')', 'r.belegnr', 'adr.kundennummer', 'r.name', 'r.land', 'p.abkuerzung','re.belegnr', 'r.status', "FORMAT(r.soll,2{$extended_mysql55})", 'adr.freifeld1', 'r.ihrebestellnummer','r.internebezeichnung','au.internet'); $searchsql = array('DATE_FORMAT(r.datum,\'%d.%m.%Y\')', 'r.belegnr', 'adr.kundennummer', 'r.name', 'r.land', 'p.abkuerzung','re.belegnr', 'r.status', "FORMAT(r.soll,2{$extended_mysql55})", 'adr.freifeld1', 'r.ihrebestellnummer','r.internebezeichnung','au.internet');
$defaultorder = 13; //Optional wenn andere Reihenfolge gewuenscht $defaultorder = 13; //Optional wenn andere Reihenfolge gewuenscht
@ -6127,7 +6127,7 @@ r.land as land, p.abkuerzung as projekt, r.zahlungsweise as zahlungsweise,
$menu .= "</table>"; $menu .= "</table>";
$menucol = 14; $menucol = 15;
$parameter = $this->app->User->GetParameter('table_filter_gutschrift'); $parameter = $this->app->User->GetParameter('table_filter_gutschrift');
$parameter = base64_decode($parameter); $parameter = base64_decode($parameter);
@ -6139,7 +6139,7 @@ r.land as land, p.abkuerzung as projekt, r.zahlungsweise as zahlungsweise,
DATE_FORMAT(r.datum,'%d.%m.%Y') as vom, adr.kundennummer as kundennummer, DATE_FORMAT(r.datum,'%d.%m.%Y') as vom, adr.kundennummer as kundennummer,
CONCAT(" . $this->app->erp->MarkerUseredit("r.name", "r.useredittimestamp") . ", if(r.internebezeichnung!='',CONCAT('<br><i style=color:#999>',r.internebezeichnung,'</i>'),'')) as kunde, CONCAT(" . $this->app->erp->MarkerUseredit("r.name", "r.useredittimestamp") . ", if(r.internebezeichnung!='',CONCAT('<br><i style=color:#999>',r.internebezeichnung,'</i>'),'')) as kunde,
r.land as land, p.abkuerzung as projekt, r.zahlungsweise as zahlungsweise, r.land as land, p.abkuerzung as projekt, r.zahlungsweise as zahlungsweise,
FORMAT(r.soll,2{$extended_mysql55}) as soll, r.zahlungsstatus as zahlung, re.belegnr as rechnung, UPPER(r.status) as status, FORMAT(r.soll,2{$extended_mysql55}) as soll, r.zahlungsstatus as zahlung, r.soll-r.ist as differenz, re.belegnr as rechnung, UPPER(r.status) as status,
".$this->IconsSQLReturnOrder()." ,r.id ".$this->IconsSQLReturnOrder()." ,r.id
FROM gutschrift r FROM gutschrift r
LEFT JOIN rechnung re ON re.id=r.rechnungid LEFT JOIN rechnung re ON re.id=r.rechnungid
@ -6564,8 +6564,8 @@ r.land as land, p.abkuerzung as projekt, r.zahlungsweise as zahlungsweise,
r.zahlungsweise as zahlungsweise, r.zahlungsweise as zahlungsweise,
FORMAT(r.soll,2{$extended_mysql55} ) as soll, FORMAT(r.soll,2{$extended_mysql55} ) as soll,
ifnull(r.waehrung,'EUR'), ifnull(r.waehrung,'EUR'),
if(r.soll-r.ist+r.skonto_gegeben!=0 AND r.ist > 0 AND r.zahlungsstatus!='bezahlt','teilbezahlt',r.zahlungsstatus) as zahlung, if(r.soll-r.ist=0 AND r.ist > 0 AND r.zahlungsstatus!='bezahlt','teilbezahlt',r.zahlungsstatus) as zahlung,
if(r.soll-r.ist+r.skonto_gegeben!=0 AND r.ist > 0,FORMAT(r.ist-r.soll+r.skonto_gegeben,2{$extended_mysql55}),FORMAT((r.soll-r.ist+r.skonto_gegeben)*-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,
".(!empty($zusatzcols)?implode(', ',$zusatzcols).',':'')." ".(!empty($zusatzcols)?implode(', ',$zusatzcols).',':'')."
r.id r.id

View File

@ -77689,13 +77689,13 @@
"Privileges": "select,insert,update,references", "Privileges": "select,insert,update,references",
"Comment": "" "Comment": ""
}, },
{ {
"Field": "buchhaltung_berater", "Field": "buchhaltung_berater",
"Type": "varchar(64)", "Type": "varchar(64)",
"Collation": null, "Collation": "utf8mb3_general_ci",
"Null": "NO", "Null": "NO",
"Key": "", "Key": "",
"Default": "", "Default": null,
"Extra": "", "Extra": "",
"Privileges": "select,insert,update,references", "Privileges": "select,insert,update,references",
"Comment": "" "Comment": ""
@ -77703,10 +77703,10 @@
{ {
"Field": "buchhaltung_mandant", "Field": "buchhaltung_mandant",
"Type": "varchar(64)", "Type": "varchar(64)",
"Collation": null, "Collation": "utf8mb3_general_ci",
"Null": "NO", "Null": "NO",
"Key": "", "Key": "",
"Default": "", "Default": null,
"Extra": "", "Extra": "",
"Privileges": "select,insert,update,references", "Privileges": "select,insert,update,references",
"Comment": "" "Comment": ""
@ -77714,14 +77714,14 @@
{ {
"Field": "buchhaltung_wj_beginn", "Field": "buchhaltung_wj_beginn",
"Type": "varchar(4)", "Type": "varchar(4)",
"Collation": null, "Collation": "utf8mb3_general_ci",
"Null": "NO", "Null": "NO",
"Key": "", "Key": "",
"Default": "'0101'", "Default": "'0101'",
"Extra": "", "Extra": "",
"Privileges": "select,insert,update,references", "Privileges": "select,insert,update,references",
"Comment": "" "Comment": ""
}, },
{ {
"Field": "buchhaltung_sachkontenlaenge", "Field": "buchhaltung_sachkontenlaenge",
"Type": "int(1)", "Type": "int(1)",
@ -77733,7 +77733,6 @@
"Privileges": "select,insert,update,references", "Privileges": "select,insert,update,references",
"Comment": "" "Comment": ""
} }
], ],
"keys": [ "keys": [
{ {
@ -114359,6 +114358,11 @@
"name": "belegeregs", "name": "belegeregs",
"type": "VIEW", "type": "VIEW",
"Create": "CREATE VIEW `belegeregs` AS select `rechnung`.`id` AS `id`,`rechnung`.`adresse` AS `adresse`,`rechnung`.`datum` AS `datum`,`rechnung`.`belegnr` AS `belegnr`,`rechnung`.`status` AS `status`,`rechnung`.`land` AS `land`,'rechnung' AS `typ`,`rechnung`.`umsatz_netto` AS `umsatz_netto`,`rechnung`.`erloes_netto` AS `erloes_netto`,`rechnung`.`deckungsbeitrag` AS `deckungsbeitrag`,`rechnung`.`provision_summe` AS `provision_summe`,`rechnung`.`vertriebid` AS `vertriebid`,`rechnung`.`gruppe` AS `gruppe`,`rechnung`.`projekt` AS `projekt` from `rechnung` union all select `gutschrift`.`id` AS `id`,`gutschrift`.`adresse` AS `adresse`,`gutschrift`.`datum` AS `datum`,`gutschrift`.`belegnr` AS `belegnr`,`gutschrift`.`status` AS `status`,`gutschrift`.`land` AS `land`,'gutschrift' AS `typ`,`gutschrift`.`umsatz_netto` * -1 AS `umsatz_netto*-1`,`gutschrift`.`erloes_netto` * -1 AS `erloes_netto*-1`,`gutschrift`.`deckungsbeitrag` * -1 AS `deckungsbeitrag*-1`,`gutschrift`.`provision_summe` * -1 AS `provision_summe*-1`,`gutschrift`.`vertriebid` AS `vertriebid`,`gutschrift`.`gruppe` AS `gruppe`,`gutschrift`.`projekt` AS `projekt` from `gutschrift`" "Create": "CREATE VIEW `belegeregs` AS select `rechnung`.`id` AS `id`,`rechnung`.`adresse` AS `adresse`,`rechnung`.`datum` AS `datum`,`rechnung`.`belegnr` AS `belegnr`,`rechnung`.`status` AS `status`,`rechnung`.`land` AS `land`,'rechnung' AS `typ`,`rechnung`.`umsatz_netto` AS `umsatz_netto`,`rechnung`.`erloes_netto` AS `erloes_netto`,`rechnung`.`deckungsbeitrag` AS `deckungsbeitrag`,`rechnung`.`provision_summe` AS `provision_summe`,`rechnung`.`vertriebid` AS `vertriebid`,`rechnung`.`gruppe` AS `gruppe`,`rechnung`.`projekt` AS `projekt` from `rechnung` union all select `gutschrift`.`id` AS `id`,`gutschrift`.`adresse` AS `adresse`,`gutschrift`.`datum` AS `datum`,`gutschrift`.`belegnr` AS `belegnr`,`gutschrift`.`status` AS `status`,`gutschrift`.`land` AS `land`,'gutschrift' AS `typ`,`gutschrift`.`umsatz_netto` * -1 AS `umsatz_netto*-1`,`gutschrift`.`erloes_netto` * -1 AS `erloes_netto*-1`,`gutschrift`.`deckungsbeitrag` * -1 AS `deckungsbeitrag*-1`,`gutschrift`.`provision_summe` * -1 AS `provision_summe*-1`,`gutschrift`.`vertriebid` AS `vertriebid`,`gutschrift`.`gruppe` AS `gruppe`,`gutschrift`.`projekt` AS `projekt` from `gutschrift`"
},
{
"name": "fibu_buchungen_alle",
"type": "VIEW",
"Create": "CREATE VIEW `fibu_buchungen_alle` AS select `fb`.`buchungsart` AS `buchungsart`,`fb`.`typ` AS `typ`,`fb`.`id` AS `id`,if(`bl`.`datum` <> '',`bl`.`datum`,`fb`.`datum`) AS `datum`,`fb`.`gegen_typ` AS `doc_typ`,`fb`.`gegen_id` AS `doc_id`,`bl`.`belegnr` AS `doc_belegnr`,`fb`.`soll` AS `betrag`,`fb`.`waehrung` AS `waehrung` from ((select 'umsatz' collate utf8mb4_general_ci AS `buchungsart`,'rechnung' collate utf8mb4_general_ci AS `typ`,`rechnung`.`id` AS `id`,`rechnung`.`soll` AS `soll`,`rechnung`.`waehrung` AS `waehrung`,'rechnung' collate utf8mb4_general_ci AS `gegen_typ`,`rechnung`.`id` AS `gegen_id`,`rechnung`.`datum` AS `datum` from `rechnung` where `rechnung`.`belegnr` <> '' union select 'umsatz' AS `umsatz`,'gutschrift' collate utf8mb4_general_ci AS `'gutschrift' COLLATE utf8mb4_general_ci`,`gutschrift`.`id` AS `id`,-`gutschrift`.`soll` AS `- ``openxe``.``gutschrift``.``soll```,`gutschrift`.`waehrung` AS `waehrung`,'gutschrift' collate utf8mb4_general_ci AS `gutschrift`,`gutschrift`.`id` AS `id`,`gutschrift`.`datum` AS `datum` from `gutschrift` where `gutschrift`.`belegnr` <> '' union select 'abbuchung' collate utf8mb4_general_ci AS `abbuchung`,'gutschrift' collate utf8mb4_general_ci AS `rechnung`,`gutschrift`.`id` AS `id`,`gutschrift`.`soll` AS `- ``openxe``.``gutschrift``.``soll```,`gutschrift`.`waehrung` AS `waehrung`,'rechnung' collate utf8mb4_general_ci AS `gutschrift`,`gutschrift`.`rechnungid` AS `rechnungid`,`gutschrift`.`datum` AS `datum` from `gutschrift` where `gutschrift`.`rechnungid` > 0 and `gutschrift`.`belegnr` <> '' union select 'abbuchung' collate utf8mb4_general_ci AS `abbuchung`,'rechnung' collate utf8mb4_general_ci AS `rechnung`,`gutschrift`.`rechnungid` AS `rechnungid`,-`gutschrift`.`soll` AS `- ``openxe``.``gutschrift``.``soll```,`gutschrift`.`waehrung` AS `waehrung`,'gutschrift' collate utf8mb4_general_ci AS `gutschrift`,`gutschrift`.`id` AS `id`,`gutschrift`.`datum` AS `datum` from `gutschrift` where `gutschrift`.`rechnungid` > 0 and `gutschrift`.`belegnr` <> '' union select 'aufwand' collate utf8mb4_general_ci AS `aufwand`,'verbindlichkeit' collate utf8mb4_general_ci AS `verbindlichkeit`,`verbindlichkeit`.`id` AS `id`,-`verbindlichkeit`.`betrag` AS `- ``openxe``.``verbindlichkeit``.``betrag```,`verbindlichkeit`.`waehrung` AS `waehrung`,'verbindlichkeit' collate utf8mb4_general_ci AS `verbindlichkeit`,`verbindlichkeit`.`id` AS `id`,`verbindlichkeit`.`rechnungsdatum` AS `rechnungsdatum` from `verbindlichkeit` where `verbindlichkeit`.`belegnr` <> '' union select 'abbuchung' collate utf8mb4_general_ci AS `abbuchung`,`fibu_buchungen`.`von_typ` AS `von_typ`,`fibu_buchungen`.`von_id` AS `von_id`,-`fibu_buchungen`.`betrag` AS `- ``openxe``.``fibu_buchungen``.``betrag```,`fibu_buchungen`.`waehrung` AS `waehrung`,`fibu_buchungen`.`nach_typ` AS `nach_typ`,`fibu_buchungen`.`nach_id` AS `nach_id`,`fibu_buchungen`.`zeit` AS `zeit` from `fibu_buchungen` union select 'zubuchung' collate utf8mb4_general_ci AS `zubuchung`,`fibu_buchungen`.`nach_typ` AS `nach_typ`,`fibu_buchungen`.`nach_id` AS `nach_id`,`fibu_buchungen`.`betrag` AS `betrag`,`fibu_buchungen`.`waehrung` AS `waehrung`,`fibu_buchungen`.`von_typ` AS `von_typ`,`fibu_buchungen`.`von_id` AS `von_id`,`fibu_buchungen`.`zeit` AS `zeit` from `fibu_buchungen`) `fb` left join (select `rechnung`.`datum` AS `datum`,'rechnung' collate utf8mb4_general_ci AS `typ`,`rechnung`.`id` AS `id`,`rechnung`.`belegnr` AS `belegnr` from `rechnung` where `rechnung`.`belegnr` <> '' union select `gutschrift`.`datum` AS `datum`,'gutschrift' collate utf8mb4_general_ci AS `gutschrift`,`gutschrift`.`id` AS `id`,`gutschrift`.`belegnr` AS `belegnr` from `gutschrift` where `gutschrift`.`belegnr` <> '' union select `verbindlichkeit`.`rechnungsdatum` AS `rechnungsdatum`,'verbindlichkeit' collate utf8mb4_general_ci AS `verbindlichkeit`,`verbindlichkeit`.`id` AS `id`,`verbindlichkeit`.`belegnr` AS `belegnr` from `verbindlichkeit` where `verbindlichkeit`.`belegnr` <> '' union select `kontoauszuege`.`buchung` AS `buchung`,'kontoauszuege' collate utf8mb4_general_ci AS `kontoauszuege`,`kontoauszuege`.`id` AS `id`,`kontoauszuege`.`buchungstext` AS `buchungstext` from `kontoauszuege` union select '','kontorahmen' collate utf8mb4_general_ci AS `'kontorahmen' COLLATE utf8mb4_general_ci`,`kontorahmen`.`id` AS `id`,`kontorahmen`.`beschriftung` AS `beschriftung` from `kontorahmen`) `bl` on(`fb`.`gegen_typ` = `bl`.`typ` and `fb`.`gegen_id` = `bl`.`id`))"
} }
] ]
} }

View File

@ -36093,9 +36093,10 @@ function Firmendaten($field,$projekt="")
/* /*
* Calculate the payments of a document (rechnung, gutschrift, auftrag, verbindlichkeit) * Calculate the payments of a document (rechnung, gutschrift, auftrag, verbindlichkeit)
* Results array of payments with information * Results array of payments (datum, doc_type, doc_id, doc_belegnr, betrag, waehrung)
* Gutschrift -> Rechnungid, Rechnung -> Auftragid * Gutschrift -> Rechnungid, Rechnung -> Auftragid
*/ */
public function GetZahlungen(int $id, string $type, bool $cascade = false, string $lastlevel = 'auftrag') : array { public function GetZahlungen(int $id, string $type, bool $cascade = false, string $lastlevel = 'auftrag') : array {
if ($cascade) { if ($cascade) {
@ -36108,91 +36109,91 @@ function Firmendaten($field,$projekt="")
return(array()); return(array());
} }
$zahlungen = array(); $ids = array();
$tables = array(
array(
'minus' => '',
'table' => 'kontoauszuege_zahlungseingang',
),
array (
'minus' => '-',
'table' => 'kontoauszuege_zahlungsausgang'
)
);
foreach ($documents as $document) { foreach ($documents as $document) {
$ids[] = $document['type'].$document['id'];
foreach ($tables as $table) {
$sql = "
SELECT
'".$document['type']."' as `doc_type`,
'".$document['id']."' as `doc_id`,
'".$document['belegnr']."' as `doc_belegnr`,
ko.bezeichnung AS konto,
DATE_FORMAT(ke.datum, '%d.%m.%Y') AS datum,
k.id AS kontoauszuege,
".$table['minus']."ke.betrag AS betrag,
k.id AS zeile,
k.waehrung
FROM
".$table['table']." ke
LEFT JOIN kontoauszuege k ON
ke.kontoauszuege = k.id
LEFT JOIN konten ko ON
k.konto = ko.id
WHERE
ke.objekt = '".$document['type']."' AND ke.parameter = '".$document['id']."'
";
$result = $this->app->DB->SelectArr($sql);
if (!empty($result)) {
$zahlungen = array_merge($zahlungen,$result);
}
}
} }
return($zahlungen);
}
public function GetZahlung(int $id, string $type, bool $cascade = false, string $lastlevel = 'auftrag') { $sql = "
$zahlungen = $this->GetZahlungen($id, $type, $cascade); SELECT
if (empty($zahlungen)) { typ,
$zahlbetrag = 0; id,
} else { ".$this->app->erp->FormatDate('datum')." as datum,
$zahlbetrag = array_sum(array_column($zahlungen,'betrag')); doc_typ,
} doc_id,
return($zahlbetrag); doc_belegnr,
".$this->app->erp->FormatMenge('betrag',2)." as betrag,
waehrung
FROM
fibu_buchungen_alle
WHERE
CONCAT(typ,id) IN ('".implode("','",$ids)."')
ORDER BY
(SELECT datum) ASC
";
$result = $this->app->DB->SelectArr($sql);
if (empty($result)) {
return(array());
}
return($result);
} }
/* /*
* Calculate the payment saldo of a document * Calculate the payment saldo information of a document
* Auftrag: gesamtsumme, rechnung: soll, gutschrift: soll verbindlichkeit: betrag * Auftrag: gesamtsumme, rechnung: soll, gutschrift: soll verbindlichkeit: betrag
* returns array(array(betrag, waehrung)) one line per waehrung
*/ */
public function GetSaldoDokument($id, $type, string $lastlevel = 'auftrag') { public function GetSaldenDokument($id, $type, string $lastlevel = 'auftrag') : array {
$zahlbetrag = $this->GetZahlung($id, $type, false); $sql = "
SELECT
$sollspalten = array( ".$this->app->erp->FormatMenge('SUM(betrag)',2)." as betrag,
'auftrag' => 'gesamtsumme', waehrung
'rechnung' => 'soll', FROM
'gutschrift' => 'soll', fibu_buchungen_alle
'verbindlichkeit' => 'betrag' WHERE
); typ = '".$type."' AND id = ".$id."
GROUP BY
$sql = "SELECT ".$sollspalten[$type]." as sollbetrag FROM ".$type." WHERE id =".$id; waehrung";
// echo($sql);
$result = $this->app->DB->SelectArr($sql); $result = $this->app->DB->SelectArr($sql);
if (!empty($result)) { if (!empty($result)) {
$sollbetrag = $result[0]['sollbetrag']; return($result);
} else { }
$sollbetrag = 0; return(array());
}
/*
* Calculate the payment amount of a document
* Auftrag: gesamtsumme, rechnung: soll, gutschrift: soll verbindlichkeit: betrag
* returns array(array(betrag, waehrung)) or empty array
*/
public function GetSaldoDokument($id, $type) : array {
$sql = "
SELECT
SUM(betrag) as betrag,
waehrung
FROM
fibu_buchungen_alle
WHERE
typ = '".$type."' AND id = ".$id."
GROUP BY
waehrung";
$result = $this->app->DB->SelectArr($sql);
if (!empty($result)) {
if (count($result) == 1) {
return($result[0]);
}
} }
return($sollbetrag-$zahlbetrag); return(array());
} }
public function ANABREGSNeuberechnen($id,$art,$force=false) public function ANABREGSNeuberechnen($id,$art,$force=false)

View File

@ -39,7 +39,7 @@
</div> </div>
<div style="background-color:white"> <div style="background-color:white">
<h2 class="greyh2">Zahlungs&uuml;bersicht</h2> <h2 class="greyh2">Buchungen</h2>
<div style="padding:10px"> <div style="padding:10px">
[ZAHLUNGEN] [ZAHLUNGEN]
</div> </div>

View File

@ -44,7 +44,7 @@
</div> </div>
<div style="background-color:white"> <div style="background-color:white">
<h2 class="greyh2">Zahlungs&uuml;bersicht</h2> <h2 class="greyh2">Buchungen</h2>
<div style="padding:10px"> <div style="padding:10px">
[ZAHLUNGEN] [ZAHLUNGEN]
</div> </div>

View File

@ -659,59 +659,37 @@ class Gutschrift extends GenGutschrift
{ {
$id = $this->app->Secure->GetGET('id'); $id = $this->app->Secure->GetGET('id');
$zahlungen = $this->app->erp->GetZahlungen($id,'gutschrift',true); $zahlungen = $this->app->erp->GetZahlungen($id,'gutschrift');
if (!empty($zahlungen)) {
$et = new EasyTable($this->app);
// print_r($zahlungen); $et->headings = array('Datum','Beleg','Betrag','W&auml;hrung');
$result = ""; foreach ($zahlungen as $zahlung) {
$row = array(
$zahlung['datum'],
"<a href=\"index.php?module=".$zahlung['doc_typ']."&action=edit&id=".$zahlung['doc_id']."\">
".ucfirst($zahlung['doc_typ'])."
".$zahlung['doc_belegnr']."
</a>",
$zahlung['betrag'],
$zahlung['waehrung']
);
$et->AddRow($row);
}
foreach ($zahlungen as $zahlung) { $salden = $this->app->erp->GetSaldenDokument($id,'gutschrift');
$result .= " foreach ($salden as $saldo) {
<tr> $row = array(
<td> '',
".$zahlung['datum']." '<b>Saldo</b>',
</td> "<b>".$saldo['betrag']."</b>",
<td> "<b>".$saldo['waehrung']."</b>"
<a href=\"index.php?module=".$zahlung['doc_type']."&action=edit&id=".$zahlung['doc_id']."\"> );
".ucfirst($zahlung['doc_type'])." $et->AddRow($row);
".$zahlung['doc_belegnr']." }
</a> return($et->DisplayNew('return',""));
</td> }
<td>
".$zahlung['konto']."
</td>
<td>
<a href=\"index.php?module=konto&action=auszug&id=".$zahlung['kontoauszuege']."\">
".$zahlung['betrag']." ".$zahlung['waehrung']."
</a>
</td>
</tr>";
}
$sum = array_sum(array_column($zahlungen,'betrag'))." ".$zahlung['waehrung'];
if ($sum != 0) {
$result .= "
<tr>
<td>
</td>
<td>
</td>
<td>
<b>
Summe:
</b>
</td>
<td>
<b>
".$sum."
</b>
</td>
</tr>
";
}
return("<table width=100% border=0 class=auftrag_cell cellpadding=0 cellspacing=0>".$result."</table>");
} }
@ -1136,7 +1114,6 @@ class Gutschrift extends GenGutschrift
$this->app->erp->CheckBearbeiter($id,"gutschrift"); $this->app->erp->CheckBearbeiter($id,"gutschrift");
$this->app->erp->CheckBuchhaltung($id,"gutschrift"); $this->app->erp->CheckBuchhaltung($id,"gutschrift");
$this->app->erp->GutschriftNeuberechnen($id); $this->app->erp->GutschriftNeuberechnen($id);
$this->app->erp->DisableVerband(); $this->app->erp->DisableVerband();
@ -1145,14 +1122,11 @@ class Gutschrift extends GenGutschrift
$this->app->Tpl->Set('ICONMENU',$this->GutschriftIconMenu($id)); $this->app->Tpl->Set('ICONMENU',$this->GutschriftIconMenu($id));
$this->app->Tpl->Set('ICONMENU2',$this->GutschriftIconMenu($id,2)); $this->app->Tpl->Set('ICONMENU2',$this->GutschriftIconMenu($id,2));
$belegnr = $this->app->DB->Select("SELECT belegnr FROM gutschrift WHERE id='$id' LIMIT 1"); $belegnr = $this->app->DB->Select("SELECT belegnr FROM gutschrift WHERE id='$id' LIMIT 1");
$nummer = $this->app->DB->Select("SELECT belegnr FROM gutschrift WHERE id='$id' LIMIT 1"); $nummer = $this->app->DB->Select("SELECT belegnr FROM gutschrift WHERE id='$id' LIMIT 1");
$kundennummer = $this->app->DB->Select("SELECT kundennummer FROM gutschrift WHERE id='$id' LIMIT 1"); $kundennummer = $this->app->DB->Select("SELECT kundennummer FROM gutschrift WHERE id='$id' LIMIT 1");
$adresse = $this->app->DB->Select("SELECT adresse FROM gutschrift WHERE id='$id' LIMIT 1"); $adresse = $this->app->DB->Select("SELECT adresse FROM gutschrift WHERE id='$id' LIMIT 1");
$status= $this->app->DB->Select("SELECT status FROM gutschrift WHERE id='$id' LIMIT 1"); $status= $this->app->DB->Select("SELECT status FROM gutschrift WHERE id='$id' LIMIT 1");
$schreibschutz= $this->app->DB->Select("SELECT schreibschutz FROM gutschrift WHERE id='$id' LIMIT 1"); $schreibschutz= $this->app->DB->Select("SELECT schreibschutz FROM gutschrift WHERE id='$id' LIMIT 1");
if($status !== 'angelegt' && $status !== 'angelegta' && $status !== 'a') if($status !== 'angelegt' && $status !== 'angelegta' && $status !== 'a')
@ -1201,7 +1175,12 @@ class Gutschrift extends GenGutschrift
if($zahlungsweise=="einzugsermaechtigung" || $zahlungsweise=="lastschrift") $this->app->Tpl->Set('EINZUGSERMAECHTIGUNG',""); if($zahlungsweise=="einzugsermaechtigung" || $zahlungsweise=="lastschrift") $this->app->Tpl->Set('EINZUGSERMAECHTIGUNG',"");
if($zahlungsweise=="vorkasse" || $zahlungsweise=="kreditkarte" || $zahlungsweise=="paypal" || $zahlungsweise=="bar") $this->app->Tpl->Set('VORKASSE',""); if($zahlungsweise=="vorkasse" || $zahlungsweise=="kreditkarte" || $zahlungsweise=="paypal" || $zahlungsweise=="bar") $this->app->Tpl->Set('VORKASSE',"");
$zahlungsinfo = $this->app->DB->SelectArr("SELECT zahlungsstatus, ".$this->app->erp->FormatMenge('soll*(-1)',2)." as betrag FROM gutschrift WHERE id='$id' LIMIT 1");
$this->app->Tpl->Set('ZAHLUNGSSTATUS_DB',$zahlungsinfo[0]['zahlungsstatus']);
$this->app->Tpl->Set('SOLL',$zahlungsinfo[0]['betrag']);
$ist = $this->app->erp->EUR($this->app->erp->GetSaldoDokument($id,'gutschrift')['betrag']);
$this->app->Tpl->Set('ISTDB',$ist);
if($schreibschutz=="1" && $this->app->erp->RechteVorhanden("gutschrift","schreibschutz")) if($schreibschutz=="1" && $this->app->erp->RechteVorhanden("gutschrift","schreibschutz"))
{ {
@ -1213,6 +1192,17 @@ class Gutschrift extends GenGutschrift
$this->app->erp->CommonReadonly(); $this->app->erp->CommonReadonly();
} }
if($schreibschutz=='1' && $this->app->erp->RechteVorhanden('gutschrift','edit'))
{
$this->app->erp->RemoveReadonly('zahlungsstatus');
if ($aktion = $this->app->Secure->GetPOST('speichern') == 'Speichern') {
$zahlungsstatus = $this->app->Secure->GetPOST('zahlungsstatus');
$this->app->DB->Update("UPDATE gutschrift SET zahlungsstatus='".$zahlungsstatus."' WHERE id='$id' LIMIT 1");
}
}
$rechnungid = $this->app->DB->Select("SELECT rechnungid FROM gutschrift WHERE id='$id' LIMIT 1"); $rechnungid = $this->app->DB->Select("SELECT rechnungid FROM gutschrift WHERE id='$id' LIMIT 1");
$rechnungid = $this->app->DB->Select("SELECT id FROM rechnung WHERE id='$rechnungid' AND belegnr!='' LIMIT 1"); $rechnungid = $this->app->DB->Select("SELECT id FROM rechnung WHERE id='$rechnungid' AND belegnr!='' LIMIT 1");
@ -1392,6 +1382,25 @@ class Gutschrift extends GenGutschrift
{ {
$this->app->Tpl->Set('UEBERSCHRIFT', 'Gutschriften'); $this->app->Tpl->Set('UEBERSCHRIFT', 'Gutschriften');
$this->app->DB->Update("UPDATE gutschrift SET zahlungsstatus='offen' WHERE zahlungsstatus=''");
// First refresh all open items
$openids = $this->app->DB->SelectArr("SELECT id, waehrung from gutschrift WHERE zahlungsstatus != 'bezahlt'");
foreach ($openids as $openid) {
$saldo = $this->app->erp->GetSaldoDokument($openid['id'],'gutschrift');
if (!empty($saldo)) {
if ($saldo['waehrung'] == $openid['waehrung']) {
$sql = "UPDATE gutschrift SET ist = '".$saldo['betrag']."'+soll WHERE id=".$openid['id'];
$result = $this->app->DB->Update($sql);
}
}
else {
$this->app->DB->Update("UPDATE gutschrift SET ist = null WHERE id=".$openid['id']);
}
}
if($this->app->Secure->GetPOST('ausfuehren') && $this->app->erp->RechteVorhanden('gutschrift', 'edit')) { if($this->app->Secure->GetPOST('ausfuehren') && $this->app->erp->RechteVorhanden('gutschrift', 'edit')) {
$drucker = $this->app->Secure->GetPOST('seldrucker'); $drucker = $this->app->Secure->GetPOST('seldrucker');
$aktion = $this->app->Secure->GetPOST('sel_aktion'); $aktion = $this->app->Secure->GetPOST('sel_aktion');

View File

@ -887,31 +887,9 @@ class Rechnung extends GenRechnung
$this->app->Tpl->Set('ANGEBOTFARBE',"grey"); $this->app->Tpl->Set('ANGEBOTFARBE',"grey");
$this->app->Tpl->Set('ANGEBOTTEXT',"Das Angebot wird bearbeitet und wurde noch nicht freigegeben und abgesendet!"); $this->app->Tpl->Set('ANGEBOTTEXT',"Das Angebot wird bearbeitet und wurde noch nicht freigegeben und abgesendet!");
} }
// $this->app->Tpl->Set('ZAHLUNGEN',"<table width=100% border=0 class=auftrag_cell cellpadding=0 cellspacing=0>Erst ab Version Enterprise verf&uuml;gbar</table>");
$this->app->Tpl->Set('ZAHLUNGEN',$this->RechnungZahlung(true)); $this->app->Tpl->Set('ZAHLUNGEN',$this->RechnungZahlung(true));
if (!is_null($gutschrift)) {
if((!empty($gutschrift)?count($gutschrift):0) > 0)
$this->app->Tpl->Add('ZAHLUNGEN',"<div class=\"info\">Zu dieser Rechnung existiert eine Gutschrift!</div>");
else {
if($auftragArr[0]['zahlungsstatus']!="bezahlt")
$this->app->Tpl->Add('ZAHLUNGEN',"<div class=\"warning\">Diese Rechnung ist noch nicht komplett bezahlt!</div>");
else
{
if(!empty($auftragArr[0]['bezahlt_am']) && $auftragArr[0]['bezahlt_am'] != '0000-00-00')
{
$this->app->Tpl->Add('ZAHLUNGEN',"<div class=\"success\">Diese Rechnung wurde am ".$this->app->String->Convert($auftragArr[0]['bezahlt_am'],"%1-%2-%3","%3.%2.%1")." bezahlt.</div>");
}else{
$this->app->Tpl->Add('ZAHLUNGEN',"<div class=\"success\">Diese Rechnung ist bezahlt.</div>");
}
}
}
}
$this->app->Tpl->Set('RECHNUNGADRESSE',$this->Rechnungsadresse($auftragArr[0]['id'])); $this->app->Tpl->Set('RECHNUNGADRESSE',$this->Rechnungsadresse($auftragArr[0]['id']));
$tmp = new EasyTable($this->app); $tmp = new EasyTable($this->app);
@ -1770,13 +1748,9 @@ class Rechnung extends GenRechnung
$this->app->Tpl->Set('VORKASSE',''); $this->app->Tpl->Set('VORKASSE','');
} }
$ist = $this->app->erp->EUR($this->app->erp->GetZahlung($id,'rechnung')); $ist = $this->app->erp->EUR($this->app->erp->GetSaldoDokument($id,'rechnung')['betrag']);
$this->app->Tpl->Set('ISTDB',$ist); $this->app->Tpl->Set('ISTDB',$ist);
$istgs = $this->app->erp->EUR($this->app->erp->GetZahlung($id,'rechnung',true,'rechnung'));
$this->app->Tpl->Set('ISTGS',$istgs);
if($schreibschutz=="1" && $this->app->erp->RechteVorhanden('rechnung','schreibschutz')) if($schreibschutz=="1" && $this->app->erp->RechteVorhanden('rechnung','schreibschutz'))
{ {
$this->app->Tpl->Set('MESSAGE',"<div class=\"warning\">Diese Rechnung ist schreibgesch&uuml;tzt und darf daher nicht mehr bearbeitet werden!&nbsp;<input type=\"button\" value=\"Schreibschutz entfernen\" onclick=\"if(!confirm('Soll der Schreibschutz f&uuml;r diese Rechnung wirklich entfernt werden? Die gespeicherte Rechnung wird &uuml;berschrieben!')) return false;else window.location.href='index.php?module=rechnung&action=schreibschutz&id=$id';\"></div>"); $this->app->Tpl->Set('MESSAGE',"<div class=\"warning\">Diese Rechnung ist schreibgesch&uuml;tzt und darf daher nicht mehr bearbeitet werden!&nbsp;<input type=\"button\" value=\"Schreibschutz entfernen\" onclick=\"if(!confirm('Soll der Schreibschutz f&uuml;r diese Rechnung wirklich entfernt werden? Die gespeicherte Rechnung wird &uuml;berschrieben!')) return false;else window.location.href='index.php?module=rechnung&action=schreibschutz&id=$id';\"></div>");
@ -1822,8 +1796,10 @@ class Rechnung extends GenRechnung
} }
$speichern = $this->app->Secure->GetPOST('speichern'); $speichern = $this->app->Secure->GetPOST('speichern');
if($speichern!='' && $this->app->erp->RechteVorhanden('rechnung','mahnwesen')) if($speichern!='' && $this->app->erp->RechteVorhanden('rechnung','mahnwesen'))
{ {
$mahnwesen_datum = $this->app->Secure->GetPOST('mahnwesen_datum'); $mahnwesen_datum = $this->app->Secure->GetPOST('mahnwesen_datum');
$bezahlt_am = $this->app->Secure->GetPOST('bezahlt_am'); $bezahlt_am = $this->app->Secure->GetPOST('bezahlt_am');
$mahnwesen_gesperrt = $this->app->Secure->GetPOST('mahnwesen_gesperrt'); $mahnwesen_gesperrt = $this->app->Secure->GetPOST('mahnwesen_gesperrt');
@ -1849,17 +1825,16 @@ class Rechnung extends GenRechnung
$alte_mahnstufe = $this->app->DB->Select("SELECT mahnwesen FROM rechnung WHERE id='$id' LIMIT 1"); $alte_mahnstufe = $this->app->DB->Select("SELECT mahnwesen FROM rechnung WHERE id='$id' LIMIT 1");
if($alte_mahnstufe!=$mahnwesen) $versendet=0; else $versendet=1; if($alte_mahnstufe!=$mahnwesen) $versendet=0; else $versendet=1;
if($mahnwesenfestsetzen=='1') /* if($mahnwesenfestsetzen=='1')
{ {*/
$this->app->DB->Update("UPDATE rechnung SET mahnwesen_internebemerkung='$mahnwesen_internebemerkung',zahlungsstatus='$zahlungsstatus',versendet_mahnwesen='$versendet', $this->app->DB->Update("UPDATE rechnung SET mahnwesen_internebemerkung='$mahnwesen_internebemerkung',zahlungsstatus='$zahlungsstatus',versendet_mahnwesen='$versendet',
mahnwesen_gesperrt='$mahnwesen_gesperrt',mahnwesen_datum='$mahnwesen_datum', mahnwesenfestsetzen='$mahnwesenfestsetzen',internebemerkung='$internebemerkung', mahnwesen_gesperrt='$mahnwesen_gesperrt',mahnwesen_datum='$mahnwesen_datum', mahnwesenfestsetzen='$mahnwesenfestsetzen',internebemerkung='$internebemerkung',
mahnwesen='$mahnwesen',ist='$ist',skonto_gegeben='$skonto_gegeben',bezahlt_am='$bezahlt_am' WHERE id='$id' LIMIT 1"); mahnwesen='$mahnwesen',ist='$ist',skonto_gegeben='$skonto_gegeben',bezahlt_am='$bezahlt_am' WHERE id='$id' LIMIT 1");
} else { /* } else {
$this->app->DB->Update("UPDATE rechnung SET mahnwesen='$mahnwesen', mahnwesenfestsetzen='$mahnwesenfestsetzen', mahnwesen_internebemerkung='$mahnwesen_internebemerkung', mahnwesen_gesperrt='$mahnwesen_gesperrt',mahnwesen_datum='$mahnwesen_datum' WHERE id='$id' LIMIT 1"); $this->app->DB->Update("UPDATE rechnung SET mahnwesen='$mahnwesen', mahnwesenfestsetzen='$mahnwesenfestsetzen', mahnwesen_internebemerkung='$mahnwesen_internebemerkung', mahnwesen_gesperrt='$mahnwesen_gesperrt',mahnwesen_datum='$mahnwesen_datum' WHERE id='$id' LIMIT 1");
} }*/
} }
if($status=='') if($status=='')
$this->app->DB->Update("UPDATE rechnung SET status='angelegt' WHERE id='$id' LIMIT 1"); $this->app->DB->Update("UPDATE rechnung SET status='angelegt' WHERE id='$id' LIMIT 1");
@ -2091,11 +2066,20 @@ class Rechnung extends GenRechnung
$this->app->DB->Update("UPDATE rechnung SET zahlungsstatus='offen' WHERE zahlungsstatus=''"); $this->app->DB->Update("UPDATE rechnung SET zahlungsstatus='offen' WHERE zahlungsstatus=''");
// First refresh all open items // First refresh all open items
$openids = $this->app->DB->SelectArr("SELECT id from rechnung WHERE zahlungsstatus = 'offen'"); $openids = $this->app->DB->SelectArr("SELECT id, waehrung from rechnung WHERE zahlungsstatus = 'offen'");
foreach ($openids as $openid) { foreach ($openids as $openid) {
$saldo = $this->app->erp->GetSaldoDokument($openid['id'],'rechnung'); $saldo = $this->app->erp->GetSaldoDokument($openid['id'],'rechnung');
$this->app->DB->Update("UPDATE rechnung SET ist = soll-".$saldo." WHERE id=".$openid['id']);
if (!empty($saldo)) {
if ($saldo['waehrung'] == $openid['waehrung']) {
$sql = "UPDATE rechnung SET ist = ".$saldo['betrag']."+soll WHERE id=".$openid['id'];
$this->app->DB->Update($sql);
}
}
else {
$this->app->DB->Update("UPDATE rechnung SET ist = null");
}
} }
if($this->app->Secure->GetPOST('ausfuehren') && $this->app->erp->RechteVorhanden('rechnung', 'edit')) if($this->app->Secure->GetPOST('ausfuehren') && $this->app->erp->RechteVorhanden('rechnung', 'edit'))
@ -2744,61 +2728,36 @@ class Rechnung extends GenRechnung
{ {
$id = $this->app->Secure->GetGET('id'); $id = $this->app->Secure->GetGET('id');
$zahlungen = $this->app->erp->GetZahlungen($id,'rechnung',true); $zahlungen = $this->app->erp->GetZahlungen($id,'rechnung');
if (!empty($zahlungen)) {
$et = new EasyTable($this->app);
// print_r($zahlungen); $et->headings = array('Datum','Beleg','Betrag','W&auml;hrung');
$result = ""; foreach ($zahlungen as $zahlung) {
$row = array(
$zahlung['datum'],
"<a href=\"index.php?module=".$zahlung['doc_typ']."&action=edit&id=".$zahlung['doc_id']."\">
".ucfirst($zahlung['doc_typ'])."
".$zahlung['doc_belegnr']."
</a>",
$zahlung['betrag'],
$zahlung['waehrung']
);
$et->AddRow($row);
}
foreach ($zahlungen as $zahlung) { $salden = $this->app->erp->GetSaldenDokument($id,'rechnung');
$result .= " foreach ($salden as $saldo) {
<tr> $row = array(
<td> '',
".$zahlung['datum']." '<b>Saldo</b>',
</td> "<b>".$saldo['betrag']."</b>",
<td> "<b>".$saldo['waehrung']."</b>"
<a href=\"index.php?module=".$zahlung['doc_type']."&action=edit&id=".$zahlung['doc_id']."\"> );
".ucfirst($zahlung['doc_type'])." $et->AddRow($row);
".$zahlung['doc_belegnr']." }
</a> return($et->DisplayNew('return',""));
</td>
<td>
".$zahlung['konto']."
</td>
<td>
<a href=\"index.php?module=konto&action=auszug&id=".$zahlung['kontoauszuege']."\">
".$zahlung['betrag']." ".$zahlung['waehrung']."
</a>
</td>
</tr>
";
} }
$sum = array_sum(array_column($zahlungen,'betrag'))." ".$zahlung['waehrung'];
if ($sum != 0) {
$result .= "
<tr>
<td>
</td>
<td>
</td>
<td>
<b>
Summe:
</b>
</td>
<td>
<b>
".$sum."
</b>
</td>
</tr>
";
}
return("<table width=100% border=0 class=auftrag_cell cellpadding=0 cellspacing=0>".$result."</table>");
} }
} }

View File

@ -1,300 +1,307 @@
<?php <?php
/* /*
**** 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 * 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. * 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 * 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. * to obtain the text of the corresponding license version.
* *
**** END OF COPYRIGHT & LICENSE NOTICE *** DO NOT REMOVE **** **** END OF COPYRIGHT & LICENSE NOTICE *** DO NOT REMOVE ****
*/ */
?> ?>
<?php <?php
class WidgetGengutschrift class WidgetGengutschrift
{ {
private $app; //application object private $app; //application object
public $form; //store form object public $form; //store form object
protected $parsetarget; //target for content protected $parsetarget; //target for content
public function __construct($app,$parsetarget) public function __construct($app,$parsetarget)
{ {
$this->app = $app; $this->app = $app;
$this->parsetarget = $parsetarget; $this->parsetarget = $parsetarget;
$this->Form(); $this->Form();
} }
public function gutschriftDelete() public function gutschriftDelete()
{ {
$this->form->Execute("gutschrift","delete"); $this->form->Execute("gutschrift","delete");
$this->gutschriftList(); $this->gutschriftList();
} }
function Edit() function Edit()
{ {
$this->form->Edit(); $this->form->Edit();
} }
function Copy() function Copy()
{ {
$this->form->Copy(); $this->form->Copy();
} }
public function Create() public function Create()
{ {
$this->form->Create(); $this->form->Create();
} }
public function Search() public function Search()
{ {
$this->app->Tpl->Set($this->parsetarget,"SUUUCHEEE"); $this->app->Tpl->Set($this->parsetarget,"SUUUCHEEE");
} }
public function Summary() public function Summary()
{ {
$this->app->Tpl->Set($this->parsetarget,"grosse Tabelle"); $this->app->Tpl->Set($this->parsetarget,"grosse Tabelle");
} }
function Form() function Form()
{ {
$this->form = $this->app->FormHandler->CreateNew("gutschrift"); $this->form = $this->app->FormHandler->CreateNew("gutschrift");
$this->form->UseTable("gutschrift"); $this->form->UseTable("gutschrift");
$this->form->UseTemplate("gutschrift.tpl",$this->parsetarget); $this->form->UseTemplate("gutschrift.tpl",$this->parsetarget);
$field = new HTMLInput("lieferid","hidden","","","","","","","","","","0","",""); $field = new HTMLInput("lieferid","hidden","","","","","","","","","","0","","");
$this->form->NewField($field); $this->form->NewField($field);
$field = new HTMLInput("ansprechpartnerid","hidden","","","","","","","","","","0","",""); $field = new HTMLInput("ansprechpartnerid","hidden","","","","","","","","","","0","","");
$this->form->NewField($field); $this->form->NewField($field);
$field = new HTMLInput("adresse","text","","20","","","","","","","pflicht","0","",""); $field = new HTMLInput("adresse","text","","20","","","","","","","pflicht","0","","");
$this->form->NewField($field); $this->form->NewField($field);
$field = new HTMLInput("aktion","text","","30","","","","","","","","0","",""); $field = new HTMLInput("aktion","text","","30","","","","","","","","0","","");
$this->form->NewField($field); $this->form->NewField($field);
$field = new HTMLInput("projekt","text","","30","","","","","","","","0","",""); $field = new HTMLInput("projekt","text","","30","","","","","","","","0","","");
$this->form->NewField($field); $this->form->NewField($field);
$field = new HTMLInput("rechnungid","text","","30","","","","","","","","0","",""); $field = new HTMLInput("rechnungid","text","","30","","","","","","","","0","","");
$this->form->NewField($field); $this->form->NewField($field);
$field = new HTMLInput("kundennummer_buchhaltung","text","","30","","","","","","","","0","",""); $field = new HTMLInput("kundennummer_buchhaltung","text","","30","","","","","","","","0","","");
$this->form->NewField($field); $this->form->NewField($field);
$field = new HTMLInput("ihrebestellnummer","text","","30","","","","","","","","0","",""); $field = new HTMLInput("ihrebestellnummer","text","","30","","","","","","","","0","","");
$this->form->NewField($field); $this->form->NewField($field);
$field = new HTMLInput("internebezeichnung","text","","30","","","","","","","","0","",""); $field = new HTMLInput("internebezeichnung","text","","30","","","","","","","","0","","");
$this->form->NewField($field); $this->form->NewField($field);
$field = new HTMLInput("lieferdatum","text","","30","","","","","","","","0","",""); $field = new HTMLInput("lieferdatum","text","","30","","","","","","","","0","","");
$this->form->NewField($field); $this->form->NewField($field);
$field = new HTMLInput("datum","text","","","","","","","","","","0","",""); $field = new HTMLInput("datum","text","","","","","","","","","","0","","");
$this->form->NewField($field); $this->form->NewField($field);
$field = new HTMLCheckbox("stornorechnung","","","1","0","0"); $field = new HTMLCheckbox("stornorechnung","","","1","0","0");
$this->form->NewField($field); $this->form->NewField($field);
$field = new HTMLCheckbox("schreibschutz","","","1","0","0"); $field = new HTMLCheckbox("schreibschutz","","","1","0","0");
$this->form->NewField($field); $this->form->NewField($field);
$field = new HTMLCheckbox("nicht_umsatzmindernd","","","1","0","0"); $field = new HTMLCheckbox("nicht_umsatzmindernd","","","1","0","0");
$this->form->NewField($field); $this->form->NewField($field);
$field = new HTMLInput("manuell_vorabbezahlt","text","","","","","","","","","","0","",""); $field = new HTMLInput("manuell_vorabbezahlt","text","","","","","","","","","","0","","");
$this->form->NewField($field); $this->form->NewField($field);
$field = new HTMLTextarea("manuell_vorabbezahlt_hinweis",5,30,"","","","","0"); $field = new HTMLTextarea("manuell_vorabbezahlt_hinweis",5,30,"","","","","0");
$this->form->NewField($field); $this->form->NewField($field);
$field = new HTMLSelect("typ",0,"typ","","","0"); $field = new HTMLSelect("typ",0,"typ","","","0");
$field->AddOption('Firma','firma'); $field->AddOption('Firma','firma');
$field->AddOption('Herr','herr'); $field->AddOption('Herr','herr');
$field->AddOption('Frau','frau'); $field->AddOption('Frau','frau');
$this->form->NewField($field); $this->form->NewField($field);
$field = new HTMLInput("name","text","","30","","","","","","","","0","",""); $field = new HTMLInput("name","text","","30","","","","","","","","0","","");
$this->form->NewField($field); $this->form->NewField($field);
$this->form->AddMandatory("name","notempty","Pflichfeld!","MSGNAME"); $this->form->AddMandatory("name","notempty","Pflichfeld!","MSGNAME");
$field = new HTMLInput("titel","text","","30","","","","","","","","0","",""); $field = new HTMLInput("titel","text","","30","","","","","","","","0","","");
$this->form->NewField($field); $this->form->NewField($field);
$field = new HTMLInput("ansprechpartner","text","","30","","","","","","","","0","",""); $field = new HTMLInput("ansprechpartner","text","","30","","","","","","","","0","","");
$this->form->NewField($field); $this->form->NewField($field);
$field = new HTMLInput("abteilung","text","","30","","","","","","","","0","",""); $field = new HTMLInput("abteilung","text","","30","","","","","","","","0","","");
$this->form->NewField($field); $this->form->NewField($field);
$field = new HTMLInput("unterabteilung","text","","30","","","","","","","","0","",""); $field = new HTMLInput("unterabteilung","text","","30","","","","","","","","0","","");
$this->form->NewField($field); $this->form->NewField($field);
$field = new HTMLInput("adresszusatz","text","","30","","","","","","","","0","",""); $field = new HTMLInput("adresszusatz","text","","30","","","","","","","","0","","");
$this->form->NewField($field); $this->form->NewField($field);
$field = new HTMLInput("strasse","text","","30","","","","","","","","0","",""); $field = new HTMLInput("strasse","text","","30","","","","","","","","0","","");
$this->form->NewField($field); $this->form->NewField($field);
$field = new HTMLInput("plz","text","","5","","","","","","","","0","",""); $field = new HTMLInput("plz","text","","5","","","","","","","","0","","");
$this->form->NewField($field); $this->form->NewField($field);
$field = new HTMLInput("ort","text","","19","","","","","","","","0","",""); $field = new HTMLInput("ort","text","","19","","","","","","","","0","","");
$this->form->NewField($field); $this->form->NewField($field);
$field = new HTMLInput("gln","text","","30","","","","","","","","0","",""); $field = new HTMLInput("gln","text","","30","","","","","","","","0","","");
$this->form->NewField($field); $this->form->NewField($field);
$field = new HTMLInput("telefon","text","","30","","","","","","","","0","",""); $field = new HTMLInput("telefon","text","","30","","","","","","","","0","","");
$this->form->NewField($field); $this->form->NewField($field);
$field = new HTMLInput("telefax","text","","30","","","","","","","","0","",""); $field = new HTMLInput("telefax","text","","30","","","","","","","","0","","");
$this->form->NewField($field); $this->form->NewField($field);
$field = new HTMLInput("email","text","","30","","","","","","","","0","",""); $field = new HTMLInput("email","text","","30","","","","","","","","0","","");
$this->form->NewField($field); $this->form->NewField($field);
$field = new HTMLInput("anschreiben","text","","30","","","","","","","","0","",""); $field = new HTMLInput("anschreiben","text","","30","","","","","","","","0","","");
$this->form->NewField($field); $this->form->NewField($field);
$field = new HTMLTextarea("freitext",5,110,"","","","","0"); $field = new HTMLTextarea("freitext",5,110,"","","","","0");
$this->form->NewField($field); $this->form->NewField($field);
$field = new HTMLTextarea("bodyzusatz",5,110,"","","","","0"); $field = new HTMLTextarea("bodyzusatz",5,110,"","","","","0");
$this->form->NewField($field); $this->form->NewField($field);
$field = new HTMLSelect("zahlungsweise",0,"zahlungsweise","","","0"); $field = new HTMLSelect("zahlungsweise",0,"zahlungsweise","","","0");
$field->AddOption('Kreditkarte','kreditkarte'); $field->AddOption('Kreditkarte','kreditkarte');
$field->AddOption('&Uuml;berweisung','ueberweisung'); $field->AddOption('&Uuml;berweisung','ueberweisung');
$field->AddOption('Bar','bar'); $field->AddOption('Bar','bar');
$field->AddOption('PayPal','paypal'); $field->AddOption('PayPal','paypal');
$this->form->NewField($field); $this->form->NewField($field);
$field = new HTMLInput("lieferbedingung","text","","30","","","","","","","","0","",""); $field = new HTMLSelect("zahlungsstatus",0,"zahlungsstatus","","","0");
$this->form->NewField($field); $field->AddOption('offen','offen');
$field->AddOption('bezahlt','bezahlt');
$field = new HTMLInput("bearbeiter","text","","","","","","","","","","0","",""); // $field->AddOption('forderungsverlust','forderungsverlust');
$this->form->NewField($field); // $field->AddOption('abgebucht (bei Lastschrift)','abgebucht');
$this->form->NewField($field);
$field = new HTMLInput("vertrieb","text","","40","","","","","","","","0","","");
$this->form->NewField($field); $field = new HTMLInput("lieferbedingung","text","","30","","","","","","","","0","","");
$this->form->NewField($field);
$field = new HTMLInput("bearbeiter","text","","40","","","","","","","","0","","");
$this->form->NewField($field); $field = new HTMLInput("bearbeiter","text","","","","","","","","","","0","","");
$this->form->NewField($field);
$field = new HTMLCheckbox("ohne_briefpapier","","","1","0","0");
$this->form->NewField($field); $field = new HTMLInput("vertrieb","text","","40","","","","","","","","0","","");
$this->form->NewField($field);
$field = new HTMLCheckbox("ohne_artikeltext","","","1","0","0");
$this->form->NewField($field); $field = new HTMLInput("bearbeiter","text","","40","","","","","","","","0","","");
$this->form->NewField($field);
$field = new HTMLInput("bank_inhaber","text","","35","","","","","","","","0","","");
$this->form->NewField($field); $field = new HTMLCheckbox("ohne_briefpapier","","","1","0","0");
$this->form->NewField($field);
$field = new HTMLInput("bank_institut","text","","35","","","","","","","","0","","");
$this->form->NewField($field); $field = new HTMLCheckbox("ohne_artikeltext","","","1","0","0");
$this->form->NewField($field);
$field = new HTMLInput("bank_blz","text","","35","","","","","","","","0","","");
$this->form->NewField($field); $field = new HTMLInput("bank_inhaber","text","","35","","","","","","","","0","","");
$this->form->NewField($field);
$field = new HTMLInput("bank_konto","text","","35","","","","","","","","0","","");
$this->form->NewField($field); $field = new HTMLInput("bank_institut","text","","35","","","","","","","","0","","");
$this->form->NewField($field);
$field = new HTMLInput("paypalaccount","text","","35","","","","","","","","0","","");
$this->form->NewField($field); $field = new HTMLInput("bank_blz","text","","35","","","","","","","","0","","");
$this->form->NewField($field);
$field = new HTMLSelect("kreditkarte_typ",0,"kreditkarte_typ","","","0");
$this->form->NewField($field); $field = new HTMLInput("bank_konto","text","","35","","","","","","","","0","","");
$this->form->NewField($field);
$field = new HTMLInput("kreditkarte_inhaber","text","","35","","","","","","","","0","","");
$this->form->NewField($field); $field = new HTMLInput("paypalaccount","text","","35","","","","","","","","0","","");
$this->form->NewField($field);
$field = new HTMLInput("kreditkarte_nummer","text","","35","","","","","","","","0","","");
$this->form->NewField($field); $field = new HTMLSelect("kreditkarte_typ",0,"kreditkarte_typ","","","0");
$this->form->NewField($field);
$field = new HTMLInput("kreditkarte_pruefnummer","text","","5","","","","","","","","0","","");
$this->form->NewField($field); $field = new HTMLInput("kreditkarte_inhaber","text","","35","","","","","","","","0","","");
$this->form->NewField($field);
$field = new HTMLSelect("kreditkarte_monat",0,"kreditkarte_monat","","","0");
$this->form->NewField($field); $field = new HTMLInput("kreditkarte_nummer","text","","35","","","","","","","","0","","");
$this->form->NewField($field);
$field = new HTMLSelect("kreditkarte_jahr",0,"kreditkarte_jahr","","","0");
$this->form->NewField($field); $field = new HTMLInput("kreditkarte_pruefnummer","text","","5","","","","","","","","0","","");
$this->form->NewField($field);
$field = new HTMLInput("zahlungszielskonto","text","","30","","","","","","","","0","","");
$this->form->NewField($field); $field = new HTMLSelect("kreditkarte_monat",0,"kreditkarte_monat","","","0");
$this->form->NewField($field);
$field = new HTMLInput("rabatt","text","","4","","","","","","","","0","","");
$this->form->NewField($field); $field = new HTMLSelect("kreditkarte_jahr",0,"kreditkarte_jahr","","","0");
$this->form->NewField($field);
$field = new HTMLInput("rabatt1","text","","4","","","","","","","","0","","");
$this->form->NewField($field); $field = new HTMLInput("zahlungszielskonto","text","","30","","","","","","","","0","","");
$this->form->NewField($field);
$field = new HTMLInput("rabatt2","text","","4","","","","","","","","0","","");
$this->form->NewField($field); $field = new HTMLInput("rabatt","text","","4","","","","","","","","0","","");
$this->form->NewField($field);
$field = new HTMLInput("rabatt3","text","","4","","","","","","","","0","","");
$this->form->NewField($field); $field = new HTMLInput("rabatt1","text","","4","","","","","","","","0","","");
$this->form->NewField($field);
$field = new HTMLInput("rabatt4","text","","4","","","","","","","","0","","");
$this->form->NewField($field); $field = new HTMLInput("rabatt2","text","","4","","","","","","","","0","","");
$this->form->NewField($field);
$field = new HTMLInput("rabatt5","text","","4","","","","","","","","0","","");
$this->form->NewField($field); $field = new HTMLInput("rabatt3","text","","4","","","","","","","","0","","");
$this->form->NewField($field);
$field = new HTMLTextarea("internebemerkung",2,110,"","","","","0");
$this->form->NewField($field); $field = new HTMLInput("rabatt4","text","","4","","","","","","","","0","","");
$this->form->NewField($field);
$field = new HTMLInput("ustid","text","","","","","","","","","","0","","");
$this->form->NewField($field); $field = new HTMLInput("rabatt5","text","","4","","","","","","","","0","","");
$this->form->NewField($field);
$field = new HTMLSelect("ust_befreit",0,"ust_befreit","","","0");
$field->AddOption('{|Inland|}','0'); $field = new HTMLTextarea("internebemerkung",2,110,"","","","","0");
$field->AddOption('{|EU-Lieferung / Lieferschwelle|}','1'); $this->form->NewField($field);
$field->AddOption('{|Export|}','2');
$field->AddOption('{|Steuerfrei Inland|}','3'); $field = new HTMLInput("ustid","text","","","","","","","","","","0","","");
$this->form->NewField($field); $this->form->NewField($field);
$field = new HTMLCheckbox("keinsteuersatz","","","1","0","0"); $field = new HTMLSelect("ust_befreit",0,"ust_befreit","","","0");
$this->form->NewField($field); $field->AddOption('{|Inland|}','0');
$field->AddOption('{|EU-Lieferung / Lieferschwelle|}','1');
$field = new HTMLCheckbox("ustbrief","","","1","0","0"); $field->AddOption('{|Export|}','2');
$this->form->NewField($field); $field->AddOption('{|Steuerfrei Inland|}','3');
$this->form->NewField($field);
$field = new HTMLCheckbox("ustbrief_eingang","","","1","0","0");
$this->form->NewField($field); $field = new HTMLCheckbox("keinsteuersatz","","","1","0","0");
$this->form->NewField($field);
$field = new HTMLInput("ustbrief_eingang_am","text","","35","","","","","","","","0","","");
$this->form->NewField($field); $field = new HTMLCheckbox("ustbrief","","","1","0","0");
$this->form->NewField($field);
$field = new HTMLSelect("anzeigesteuer",0,"anzeigesteuer","","","0");
$field->AddOption('automatisch','0'); $field = new HTMLCheckbox("ustbrief_eingang","","","1","0","0");
$field->AddOption('netto','3'); $this->form->NewField($field);
$field->AddOption('brutto','4');
$this->form->NewField($field); $field = new HTMLInput("ustbrief_eingang_am","text","","35","","","","","","","","0","","");
$this->form->NewField($field);
$field = new HTMLInput("waehrung","text","","30","","","","","","","","0","","");
$this->form->NewField($field); $field = new HTMLSelect("anzeigesteuer",0,"anzeigesteuer","","","0");
$field->AddOption('automatisch','0');
$field = new HTMLInput("sprache","text","","30","","","","","","","","0","",""); $field->AddOption('netto','3');
$this->form->NewField($field); $field->AddOption('brutto','4');
$this->form->NewField($field);
$field = new HTMLInput("kurs","text","","15","","","","","","","","0","","");
$this->form->NewField($field); $field = new HTMLInput("waehrung","text","","30","","","","","","","","0","","");
$this->form->NewField($field);
$field = new HTMLInput("kostenstelle","text","","15","","","","","","","","0","","");
$this->form->NewField($field); $field = new HTMLInput("sprache","text","","30","","","","","","","","0","","");
$this->form->NewField($field);
} $field = new HTMLInput("kurs","text","","15","","","","","","","","0","","");
$this->form->NewField($field);
}
$field = new HTMLInput("kostenstelle","text","","15","","","","","","","","0","","");
?> $this->form->NewField($field);
}
}
?>

View File

@ -1,344 +1,344 @@
<?php <?php
/* /*
**** 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 * 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. * 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 * 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. * to obtain the text of the corresponding license version.
* *
**** END OF COPYRIGHT & LICENSE NOTICE *** DO NOT REMOVE **** **** END OF COPYRIGHT & LICENSE NOTICE *** DO NOT REMOVE ****
*/ */
?> ?>
<?php <?php
class WidgetGenrechnung class WidgetGenrechnung
{ {
private $app; //application object private $app; //application object
public $form; //store form object public $form; //store form object
protected $parsetarget; //target for content protected $parsetarget; //target for content
public function __construct($app,$parsetarget) public function __construct($app,$parsetarget)
{ {
$this->app = $app; $this->app = $app;
$this->parsetarget = $parsetarget; $this->parsetarget = $parsetarget;
$this->Form(); $this->Form();
} }
public function rechnungDelete() public function rechnungDelete()
{ {
$this->form->Execute("rechnung","delete"); $this->form->Execute("rechnung","delete");
$this->rechnungList(); $this->rechnungList();
} }
function Edit() function Edit()
{ {
$this->form->Edit(); $this->form->Edit();
} }
function Copy() function Copy()
{ {
$this->form->Copy(); $this->form->Copy();
} }
public function Create() public function Create()
{ {
$this->form->Create(); $this->form->Create();
} }
public function Search() public function Search()
{ {
$this->app->Tpl->Set($this->parsetarget,"SUUUCHEEE"); $this->app->Tpl->Set($this->parsetarget,"SUUUCHEEE");
} }
public function Summary() public function Summary()
{ {
$this->app->Tpl->Set($this->parsetarget,"grosse Tabelle"); $this->app->Tpl->Set($this->parsetarget,"grosse Tabelle");
} }
function Form() function Form()
{ {
$this->form = $this->app->FormHandler->CreateNew("rechnung"); $this->form = $this->app->FormHandler->CreateNew("rechnung");
$this->form->UseTable("rechnung"); $this->form->UseTable("rechnung");
$this->form->UseTemplate("rechnung.tpl",$this->parsetarget); $this->form->UseTemplate("rechnung.tpl",$this->parsetarget);
$field = new HTMLInput("lieferid","hidden","","","","","","","","","","0","",""); $field = new HTMLInput("lieferid","hidden","","","","","","","","","","0","","");
$this->form->NewField($field); $this->form->NewField($field);
$field = new HTMLInput("ansprechpartnerid","hidden","","","","","","","","","","0","",""); $field = new HTMLInput("ansprechpartnerid","hidden","","","","","","","","","","0","","");
$this->form->NewField($field); $this->form->NewField($field);
$field = new HTMLInput("adresse","text","","30","","","","","","","","0","",""); $field = new HTMLInput("adresse","text","","30","","","","","","","","0","","");
$this->form->NewField($field); $this->form->NewField($field);
$field = new HTMLInput("projekt","text","","30","","","","","","","","0","",""); $field = new HTMLInput("projekt","text","","30","","","","","","","","0","","");
$this->form->NewField($field); $this->form->NewField($field);
$field = new HTMLInput("aktion","text","","30","","","","","","","","0","",""); $field = new HTMLInput("aktion","text","","30","","","","","","","","0","","");
$this->form->NewField($field); $this->form->NewField($field);
$field = new HTMLInput("auftragid","text","","30","","","","","","","","0","",""); $field = new HTMLInput("auftragid","text","","30","","","","","","","","0","","");
$this->form->NewField($field); $this->form->NewField($field);
$field = new HTMLInput("kundennummer_buchhaltung","text","","30","","","","","","","","0","",""); $field = new HTMLInput("kundennummer_buchhaltung","text","","30","","","","","","","","0","","");
$this->form->NewField($field); $this->form->NewField($field);
$field = new HTMLInput("ihrebestellnummer","text","","30","","","","","","","","0","",""); $field = new HTMLInput("ihrebestellnummer","text","","30","","","","","","","","0","","");
$this->form->NewField($field); $this->form->NewField($field);
$field = new HTMLInput("internebezeichnung","text","","30","","","","","","","","0","",""); $field = new HTMLInput("internebezeichnung","text","","30","","","","","","","","0","","");
$this->form->NewField($field); $this->form->NewField($field);
$field = new HTMLInput("lieferdatum","text","","30","","","","","","","","0","",""); $field = new HTMLInput("lieferdatum","text","","30","","","","","","","","0","","");
$this->form->NewField($field); $this->form->NewField($field);
$field = new HTMLInput("lieferschein","text","","30","","","","","","","","0","",""); $field = new HTMLInput("lieferschein","text","","30","","","","","","","","0","","");
$this->form->NewField($field); $this->form->NewField($field);
$field = new HTMLInput("datum","text","","30","","","","","","","","0","",""); $field = new HTMLInput("datum","text","","30","","","","","","","","0","","");
$this->form->NewField($field); $this->form->NewField($field);
$field = new HTMLCheckbox("doppel","","","1","0","0"); $field = new HTMLCheckbox("doppel","","","1","0","0");
$this->form->NewField($field); $this->form->NewField($field);
$field = new HTMLCheckbox("schreibschutz","","","1","0","0"); $field = new HTMLCheckbox("schreibschutz","","","1","0","0");
$this->form->NewField($field); $this->form->NewField($field);
$field = new HTMLCheckbox("abweichendebezeichnung","","","1","0","0"); $field = new HTMLCheckbox("abweichendebezeichnung","","","1","0","0");
$this->form->NewField($field); $this->form->NewField($field);
$field = new HTMLCheckbox("mahnwesenfestsetzen","","","1","0","0"); $field = new HTMLCheckbox("mahnwesenfestsetzen","","","1","0","0");
$this->form->NewField($field); $this->form->NewField($field);
$field = new HTMLSelect("zahlungsstatus",0,"zahlungsstatus","","","0"); $field = new HTMLSelect("zahlungsstatus",0,"zahlungsstatus","","","0");
$field->AddOption('offen','offen'); $field->AddOption('offen','offen');
$field->AddOption('bezahlt','bezahlt'); $field->AddOption('bezahlt','bezahlt');
$field->AddOption('forderungsverlust','forderungsverlust'); // $field->AddOption('forderungsverlust','forderungsverlust');
$field->AddOption('abgebucht (bei Lastschrift)','abgebucht'); // $field->AddOption('abgebucht (bei Lastschrift)','abgebucht');
$this->form->NewField($field); $this->form->NewField($field);
$field = new HTMLInput("bezahlt_am","text","","10","","","","","","","","0","",""); $field = new HTMLInput("bezahlt_am","text","","10","","","","","","","","0","","");
$this->form->NewField($field); $this->form->NewField($field);
$field = new HTMLInput("ist","text","","10","","","","","","","","0","",""); $field = new HTMLInput("ist","text","","10","","","","","","","","0","","");
$this->form->NewField($field); $this->form->NewField($field);
$field = new HTMLInput("skonto_gegeben","text","","10","","","","","","","","0","",""); $field = new HTMLInput("skonto_gegeben","text","","10","","","","","","","","0","","");
$this->form->NewField($field); $this->form->NewField($field);
$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');
$this->form->NewField($field); $this->form->NewField($field);
$field = new HTMLInput("mahnwesen_datum","text","","10","","","","","","","","0","",""); $field = new HTMLInput("mahnwesen_datum","text","","10","","","","","","","","0","","");
$this->form->NewField($field); $this->form->NewField($field);
$field = new HTMLCheckbox("mahnwesen_gesperrt","","","1","0","0"); $field = new HTMLCheckbox("mahnwesen_gesperrt","","","1","0","0");
$this->form->NewField($field); $this->form->NewField($field);
$field = new HTMLTextarea("mahnwesen_internebemerkung",4,60,"","","","","0"); $field = new HTMLTextarea("mahnwesen_internebemerkung",4,60,"","","","","0");
$this->form->NewField($field); $this->form->NewField($field);
$field = new HTMLSelect("typ",0,"typ","","","0"); $field = new HTMLSelect("typ",0,"typ","","","0");
$field->AddOption('Firma','firma'); $field->AddOption('Firma','firma');
$field->AddOption('Herr','herr'); $field->AddOption('Herr','herr');
$field->AddOption('Frau','frau'); $field->AddOption('Frau','frau');
$this->form->NewField($field); $this->form->NewField($field);
$field = new HTMLInput("name","text","","30","","","","","","","","0","",""); $field = new HTMLInput("name","text","","30","","","","","","","","0","","");
$this->form->NewField($field); $this->form->NewField($field);
$this->form->AddMandatory("name","notempty","Pflichfeld!","MSGNAME"); $this->form->AddMandatory("name","notempty","Pflichfeld!","MSGNAME");
$field = new HTMLInput("titel","text","","30","","","","","","","","0","",""); $field = new HTMLInput("titel","text","","30","","","","","","","","0","","");
$this->form->NewField($field); $this->form->NewField($field);
$field = new HTMLInput("ansprechpartner","text","","30","","","","","","","","0","",""); $field = new HTMLInput("ansprechpartner","text","","30","","","","","","","","0","","");
$this->form->NewField($field); $this->form->NewField($field);
$field = new HTMLInput("abteilung","text","","30","","","","","","","","0","",""); $field = new HTMLInput("abteilung","text","","30","","","","","","","","0","","");
$this->form->NewField($field); $this->form->NewField($field);
$field = new HTMLInput("unterabteilung","text","","30","","","","","","","","0","",""); $field = new HTMLInput("unterabteilung","text","","30","","","","","","","","0","","");
$this->form->NewField($field); $this->form->NewField($field);
$field = new HTMLInput("adresszusatz","text","","30","","","","","","","","0","",""); $field = new HTMLInput("adresszusatz","text","","30","","","","","","","","0","","");
$this->form->NewField($field); $this->form->NewField($field);
$field = new HTMLInput("strasse","text","","30","","","","","","","","0","",""); $field = new HTMLInput("strasse","text","","30","","","","","","","","0","","");
$this->form->NewField($field); $this->form->NewField($field);
$field = new HTMLInput("plz","text","","5","","","","","","","","0","",""); $field = new HTMLInput("plz","text","","5","","","","","","","","0","","");
$this->form->NewField($field); $this->form->NewField($field);
$field = new HTMLInput("ort","text","","19","","","","","","","","0","",""); $field = new HTMLInput("ort","text","","19","","","","","","","","0","","");
$this->form->NewField($field); $this->form->NewField($field);
$field = new HTMLInput("telefon","text","","30","","","","","","","","0","",""); $field = new HTMLInput("telefon","text","","30","","","","","","","","0","","");
$this->form->NewField($field); $this->form->NewField($field);
$field = new HTMLInput("telefax","text","","30","","","","","","","","0","",""); $field = new HTMLInput("telefax","text","","30","","","","","","","","0","","");
$this->form->NewField($field); $this->form->NewField($field);
$field = new HTMLInput("email","text","","30","","","","","","","","0","",""); $field = new HTMLInput("email","text","","30","","","","","","","","0","","");
$this->form->NewField($field); $this->form->NewField($field);
$field = new HTMLInput("anschreiben","text","","30","","","","","","","","0","",""); $field = new HTMLInput("anschreiben","text","","30","","","","","","","","0","","");
$this->form->NewField($field); $this->form->NewField($field);
$field = new HTMLTextarea("freitext",5,110,"","","","","0"); $field = new HTMLTextarea("freitext",5,110,"","","","","0");
$this->form->NewField($field); $this->form->NewField($field);
$field = new HTMLTextarea("bodyzusatz",5,110,"","","","","0"); $field = new HTMLTextarea("bodyzusatz",5,110,"","","","","0");
$this->form->NewField($field); $this->form->NewField($field);
$field = new HTMLSelect("zahlungsweise",0,"zahlungsweise","","","0"); $field = new HTMLSelect("zahlungsweise",0,"zahlungsweise","","","0");
$field->AddOption('Rechnung','rechnung'); $field->AddOption('Rechnung','rechnung');
$field->AddOption('Vorkasse','vorkasse'); $field->AddOption('Vorkasse','vorkasse');
$field->AddOption('Nachnahme','nachnahme'); $field->AddOption('Nachnahme','nachnahme');
$field->AddOption('Kreditkarte','kreditkarte'); $field->AddOption('Kreditkarte','kreditkarte');
$field->AddOption('Einzugsermaechtigung','einzugsermaechtigung'); $field->AddOption('Einzugsermaechtigung','einzugsermaechtigung');
$field->AddOption('Bar','bar'); $field->AddOption('Bar','bar');
$field->AddOption('PayPal','paypal'); $field->AddOption('PayPal','paypal');
$this->form->NewField($field); $this->form->NewField($field);
$field = new HTMLInput("lieferbedingung","text","","30","","","","","","","","0","",""); $field = new HTMLInput("lieferbedingung","text","","30","","","","","","","","0","","");
$this->form->NewField($field); $this->form->NewField($field);
$field = new HTMLInput("buchhaltung","text","","30","","","","","","","","0","",""); $field = new HTMLInput("buchhaltung","text","","30","","","","","","","","0","","");
$this->form->NewField($field); $this->form->NewField($field);
$field = new HTMLInput("vertrieb","text","","30","","","","","","","","0","",""); $field = new HTMLInput("vertrieb","text","","30","","","","","","","","0","","");
$this->form->NewField($field); $this->form->NewField($field);
$field = new HTMLInput("bearbeiter","text","","30","","","","","","","","0","",""); $field = new HTMLInput("bearbeiter","text","","30","","","","","","","","0","","");
$this->form->NewField($field); $this->form->NewField($field);
$field = new HTMLCheckbox("ohne_briefpapier","","","1","0","0"); $field = new HTMLCheckbox("ohne_briefpapier","","","1","0","0");
$this->form->NewField($field); $this->form->NewField($field);
$field = new HTMLCheckbox("ohne_artikeltext","","","1","0","0"); $field = new HTMLCheckbox("ohne_artikeltext","","","1","0","0");
$this->form->NewField($field); $this->form->NewField($field);
$field = new HTMLInput("gln","text","","30","","","","","","","","0","",""); $field = new HTMLInput("gln","text","","30","","","","","","","","0","","");
$this->form->NewField($field); $this->form->NewField($field);
$field = new HTMLInput("zahlungszieltage","text","","30","","","","","","","","0","",""); $field = new HTMLInput("zahlungszieltage","text","","30","","","","","","","","0","","");
$this->form->NewField($field); $this->form->NewField($field);
$field = new HTMLInput("zahlungszieltageskonto","text","","30","","","","","","","","0","",""); $field = new HTMLInput("zahlungszieltageskonto","text","","30","","","","","","","","0","","");
$this->form->NewField($field); $this->form->NewField($field);
$field = new HTMLInput("einzugsdatum","text","","30","","","","","","","","0","",""); $field = new HTMLInput("einzugsdatum","text","","30","","","","","","","","0","","");
$this->form->NewField($field); $this->form->NewField($field);
$field = new HTMLInput("bank_inhaber","text","","30","","","","","","","","0","",""); $field = new HTMLInput("bank_inhaber","text","","30","","","","","","","","0","","");
$this->form->NewField($field); $this->form->NewField($field);
$field = new HTMLInput("bank_institut","text","","30","","","","","","","","0","",""); $field = new HTMLInput("bank_institut","text","","30","","","","","","","","0","","");
$this->form->NewField($field); $this->form->NewField($field);
$field = new HTMLInput("bank_blz","text","","30","","","","","","","","0","",""); $field = new HTMLInput("bank_blz","text","","30","","","","","","","","0","","");
$this->form->NewField($field); $this->form->NewField($field);
$field = new HTMLInput("bank_konto","text","","30","","","","","","","","0","",""); $field = new HTMLInput("bank_konto","text","","30","","","","","","","","0","","");
$this->form->NewField($field); $this->form->NewField($field);
$field = new HTMLSelect("kreditkarte_typ",0,"kreditkarte_typ","","","0"); $field = new HTMLSelect("kreditkarte_typ",0,"kreditkarte_typ","","","0");
$this->form->NewField($field); $this->form->NewField($field);
$field = new HTMLInput("kreditkarte_inhaber","text","","30","","","","","","","","0","",""); $field = new HTMLInput("kreditkarte_inhaber","text","","30","","","","","","","","0","","");
$this->form->NewField($field); $this->form->NewField($field);
$field = new HTMLInput("kreditkarte_nummer","text","","30","","","","","","","","0","",""); $field = new HTMLInput("kreditkarte_nummer","text","","30","","","","","","","","0","","");
$this->form->NewField($field); $this->form->NewField($field);
$field = new HTMLInput("kreditkarte_pruefnummer","text","","5","","","","","","","","0","",""); $field = new HTMLInput("kreditkarte_pruefnummer","text","","5","","","","","","","","0","","");
$this->form->NewField($field); $this->form->NewField($field);
$field = new HTMLSelect("kreditkarte_monat",0,"kreditkarte_monat","","","0"); $field = new HTMLSelect("kreditkarte_monat",0,"kreditkarte_monat","","","0");
$this->form->NewField($field); $this->form->NewField($field);
$field = new HTMLSelect("kreditkarte_jahr",0,"kreditkarte_jahr","","","0"); $field = new HTMLSelect("kreditkarte_jahr",0,"kreditkarte_jahr","","","0");
$this->form->NewField($field); $this->form->NewField($field);
$field = new HTMLInput("zahlungszielskonto","text","","30","","","","","","","","0","",""); $field = new HTMLInput("zahlungszielskonto","text","","30","","","","","","","","0","","");
$this->form->NewField($field); $this->form->NewField($field);
$field = new HTMLInput("rabatt","text","","4","","","","","","","","0","",""); $field = new HTMLInput("rabatt","text","","4","","","","","","","","0","","");
$this->form->NewField($field); $this->form->NewField($field);
$field = new HTMLInput("rabatt1","text","","4","","","","","","","","0","",""); $field = new HTMLInput("rabatt1","text","","4","","","","","","","","0","","");
$this->form->NewField($field); $this->form->NewField($field);
$field = new HTMLInput("rabatt2","text","","4","","","","","","","","0","",""); $field = new HTMLInput("rabatt2","text","","4","","","","","","","","0","","");
$this->form->NewField($field); $this->form->NewField($field);
$field = new HTMLInput("rabatt3","text","","4","","","","","","","","0","",""); $field = new HTMLInput("rabatt3","text","","4","","","","","","","","0","","");
$this->form->NewField($field); $this->form->NewField($field);
$field = new HTMLInput("rabatt4","text","","4","","","","","","","","0","",""); $field = new HTMLInput("rabatt4","text","","4","","","","","","","","0","","");
$this->form->NewField($field); $this->form->NewField($field);
$field = new HTMLInput("rabatt5","text","","4","","","","","","","","0","",""); $field = new HTMLInput("rabatt5","text","","4","","","","","","","","0","","");
$this->form->NewField($field); $this->form->NewField($field);
$field = new HTMLTextarea("internebemerkung",2,110,"","","","","0"); $field = new HTMLTextarea("internebemerkung",2,110,"","","","","0");
$this->form->NewField($field); $this->form->NewField($field);
$field = new HTMLInput("ustid","text","","30","","","","","","","","0","",""); $field = new HTMLInput("ustid","text","","30","","","","","","","","0","","");
$this->form->NewField($field); $this->form->NewField($field);
$field = new HTMLSelect("ust_befreit",0,"ust_befreit","","","0"); $field = new HTMLSelect("ust_befreit",0,"ust_befreit","","","0");
$field->AddOption('{|Inland|}','0'); $field->AddOption('{|Inland|}','0');
$field->AddOption('{|EU-Lieferung / Lieferschwelle|}','1'); $field->AddOption('{|EU-Lieferung / Lieferschwelle|}','1');
$field->AddOption('{|Export|}','2'); $field->AddOption('{|Export|}','2');
$field->AddOption('{|Steuerfrei Inland|}','3'); $field->AddOption('{|Steuerfrei Inland|}','3');
$this->form->NewField($field); $this->form->NewField($field);
$field = new HTMLCheckbox("keinsteuersatz","","","1","0","0"); $field = new HTMLCheckbox("keinsteuersatz","","","1","0","0");
$this->form->NewField($field); $this->form->NewField($field);
$field = new HTMLCheckbox("ustbrief","","","1","0","0"); $field = new HTMLCheckbox("ustbrief","","","1","0","0");
$this->form->NewField($field); $this->form->NewField($field);
$field = new HTMLCheckbox("ustbrief_eingang","","","1","0","0"); $field = new HTMLCheckbox("ustbrief_eingang","","","1","0","0");
$this->form->NewField($field); $this->form->NewField($field);
$field = new HTMLInput("ustbrief_eingang_am","text","","","","","","","","","","0","",""); $field = new HTMLInput("ustbrief_eingang_am","text","","","","","","","","","","0","","");
$this->form->NewField($field); $this->form->NewField($field);
$field = new HTMLSelect("anzeigesteuer",0,"anzeigesteuer","","","0"); $field = new HTMLSelect("anzeigesteuer",0,"anzeigesteuer","","","0");
$field->AddOption('automatisch','0'); $field->AddOption('automatisch','0');
$field->AddOption('netto','3'); $field->AddOption('netto','3');
$field->AddOption('brutto','4'); $field->AddOption('brutto','4');
$this->form->NewField($field); $this->form->NewField($field);
$field = new HTMLInput("waehrung","text","","30","","","","","","","","0","",""); $field = new HTMLInput("waehrung","text","","30","","","","","","","","0","","");
$this->form->NewField($field); $this->form->NewField($field);
$field = new HTMLInput("sprache","text","","30","","","","","","","","0","",""); $field = new HTMLInput("sprache","text","","30","","","","","","","","0","","");
$this->form->NewField($field); $this->form->NewField($field);
$field = new HTMLInput("kurs","text","","15","","","","","","","","0","",""); $field = new HTMLInput("kurs","text","","15","","","","","","","","0","","");
$this->form->NewField($field); $this->form->NewField($field);
$field = new HTMLInput("kostenstelle","text","","15","","","","","","","","0","",""); $field = new HTMLInput("kostenstelle","text","","15","","","","","","","","0","","");
$this->form->NewField($field); $this->form->NewField($field);
} }
} }
?> ?>

View File

@ -61,7 +61,7 @@
<div class="col-xs-12 col-sm-6 col-sm-height"> <div class="col-xs-12 col-sm-6 col-sm-height">
<div class="inside inside-full-height"> <div class="inside inside-full-height">
<!--
<fieldset><legend>{|Forderung|}</legend> <fieldset><legend>{|Forderung|}</legend>
<table width="100%" height="240"> <table width="100%" height="240">
<tr><td width="200">{|erledigt am|}:</td><td>[MANUELL_VORABBEZAHLT][MSGMANUELL_VORABBEZAHLT]&nbsp;</td></tr> <tr><td width="200">{|erledigt am|}:</td><td>[MANUELL_VORABBEZAHLT][MSGMANUELL_VORABBEZAHLT]&nbsp;</td></tr>
@ -70,6 +70,41 @@
<tr><td></td><td>[HINWEISAVIS]</td></tr> <tr><td></td><td>[HINWEISAVIS]</td></tr>
</table> </table>
</fieldset> </fieldset>
-->
<fieldset>
<legend>{|Zahlungsstatus|}</legend>
<table class="tablemahnwesenfestsetzen">
<tr>
<td width="200">{|Zahlungsstatus|}:</td>
<td width="70%">[ZAHLUNGSSTATUS][MSGZAHLUNGSSTATUS]
</td>
</tr>
<tr>
<td></td>
<td colspan="1">
<table>
<tr>
<td>
{|SOLL|}:
</td>
<td>
[SOLL]
</td>
</tr>
<tr>
<td>
{|OFFEN|}:
</td>
<td id="istdb">
[ISTDB]
</td>
</tr>
</table>
</td>
</tr>
</table>
</fieldset>
</div> </div>
</div> </div>

View File

@ -1,39 +1,3 @@
<script type="text/javascript">
jQuery(document).ready(function() {
mahnwesenfest();
});
function skonto()
{
// var ist = $('#ist').val();
var ist = document.getElementById('istdb').innerText;
ist = ist.replace(',', '.');
$('#skonto_gegeben').val(($('#soll_tmp').val() - ist).toFixed(2));
}
function mahnwesenfest(cmd)
{
var inp = 'in'+'put';
var sel = 'sel'+'ect';
jQuery('table.tablemahnwesenfestsetzen').find(inp).prop('disabled', true);
jQuery('table.tablemahnwesenfestsetzen').find(sel).prop('disabled', true);
jQuery('table.tablemahnwesenfestsetzen').find(sel).css('background', '#ececec');
jQuery('table.tablemahnwesenfestsetzen').find(inp).css('background', '#ececec');
jQuery('table.tablemahnwesenfestsetzen').find(inp).first().prop('disabled', false);
if(document.getElementById('mahnwesenfestsetzen').checked)
{
jQuery('table.tablemahnwesenfestsetzen').find(inp).prop('disabled', false);
jQuery('table.tablemahnwesenfestsetzen').find(sel).prop('disabled', false);
jQuery('table.tablemahnwesenfestsetzen').find(inp).css('background', '#fff');
jQuery('table.tablemahnwesenfestsetzen').find(sel).css('background', '#fff');
// $('.ist').show();
// $('.istberechnet').hide();
} else {
// $('.ist').hide();
// $('.istberechnet').show();
}
}
</script>
[SAVEPAGEREALLY] [SAVEPAGEREALLY]
<!-- gehort zu tabview --> <!-- gehort zu tabview -->
<div id="tabs"> <div id="tabs">
@ -141,17 +105,10 @@
[MAHNWESENIF] [MAHNWESENIF]
<fieldset> <fieldset>
<legend>{|Zahlungsstatus|}</legend> <legend>{|Zahlungsstatus|}</legend>
<table class="tablemahnwesenfestsetzen"> <table class="tablemahnwesenfestsetzen">
<tr>
<td colspan="2">Alle Einstellungen manuell festsetzen:&nbsp;[MAHNWESENFESTSETZEN][MSGMAHNWESENFESTSETZEN]&nbsp;</td>
</tr>
<tr>
<td></td>
<td><br></td>
</tr>
<tr> <tr>
<td width="200">{|Zahlungsstatus|}:</td> <td width="200">{|Zahlungsstatus|}:</td>
<td width="70%">[ZAHLUNGSSTATUS][MSGZAHLUNGSSTATUS] Bezahlt am: [BEZAHLT_AM][MSGBEZAHLT_AM] <td width="70%">[ZAHLUNGSSTATUS][MSGZAHLUNGSSTATUS]
</td> </td>
</tr> </tr>
<tr> <tr>
@ -168,38 +125,12 @@
</tr> </tr>
<tr> <tr>
<td> <td>
{|IST|}: {|OFFEN|}:
</td> </td>
<td id="istdb"> <td id="istdb">
[ISTDB] [ISTDB]
</td> </td>
</tr> </tr>
<tr>
<td>
{|Gutschriften|}:
</td>
<td id="istgs">
[ISTGS]
</td>
</tr>
<!--
<tr class="ist">
<td>
{|IST|}:
</td>
<td>
[IST][MSGIST]&nbsp;<i>(manuelle Eingabe)</i>
</td>
</tr>
-->
<tr>
<td>
{|Skonto gegeben|}:
</td>
<td>
[SKONTO_GEGEBEN][MSGSKONTO_GEGEBEN]&nbsp;<img src="./themes/new/images/add.png" onclick=skonto() title="Skonto berechnen">&nbsp;<i>(als Geldbetrag)</i>
</td>
</tr>
</table> </table>
</td> </td>
</tr> </tr>

View File

@ -130,7 +130,6 @@ class WidgetRechnung extends WidgetGenRechnung
$status = $this->app->erp->GetStatusRechnung(); $status = $this->app->erp->GetStatusRechnung();
$zahlungsweisenmodule = $this->app->DB->SelectArr("SELECT id, modul, type FROM zahlungsweisen WHERE verhalten = 'rechnung'"); $zahlungsweisenmodule = $this->app->DB->SelectArr("SELECT id, modul, type FROM zahlungsweisen WHERE verhalten = 'rechnung'");
if (!is_null($zahlungsweisenmodule)) { if (!is_null($zahlungsweisenmodule)) {