diff --git a/Layout/default/Billing/Index.php b/Layout/default/Billing/Index.php
index c786a0c3c..43676214c 100644
--- a/Layout/default/Billing/Index.php
+++ b/Layout/default/Billing/Index.php
@@ -33,8 +33,20 @@ $pagination_entity_name = "Billingrecords";
@@ -92,23 +104,24 @@ $pagination_entity_name = "Billingrecords";
Vertragsinhaber
Rechnungsadresse
Kundennummer
- Einzug
- Zustellung
- Bankdaten
Produkt
Anzahl
Preis
Preis Setup
+ Zahlung
+ Zustellung
+ Bankdaten
+
$billing->contract_id])?>" target="_blank">=$billing->contract_id?>
- =$billing->start_date?> - =$billing->end_date?>
+ =$billing->start_date?> - =$billing->end_date?>
=$billing->contract->owner->getCompanyOrName()?>
=$billing->contract->owner->street?>
- =$billing->contract->owner->zip?> =$billing->contract->owner->city?>
+ =$billing->contract->owner->zip?> =$billing->contract->owner->city?>
=$billing->contract->owner->country->name?>
@@ -119,6 +132,17 @@ $pagination_entity_name = "Billingrecords";
=$billing->country?>
=$billing->customer_number?>
+
+ =$billing->product_name?>=($billing->matchcode) ? " (".$billing->matchcode.")" : ""?>
+ product_info): ?>
+
+ =$billing->product_info?>
+
+
+
+ =($billing->amount / (int)$billing->amount > 1) ? number_format($billing->amount,3,",",".") : (int)$billing->amount?>
+ ">€ =number_format($billing->price,4,",",".")?>
+ ">€ =number_format($billing->price_setup,4,",",".")?>
=($billing->billing_type == "sepa") ? "SEPA" : ""?>
=($billing->billing_delivery == "email") ? "Email" : "Papier"?>
@@ -129,17 +153,7 @@ $pagination_entity_name = "Billingrecords";
BIC: =$billing->bank_account_bic?>
-
- =$billing->product_name?>=($billing->matchcode) ? " (".$billing->matchcode.")" : ""?>
- product_info): ?>
-
- =$billing->product_info?>
-
-
-
- =number_format($billing->amount,3,",",".")?>
- € =number_format($billing->price,4,",",".")?>
- € =number_format($billing->price_setup,4,",",".")?>
+
diff --git a/Layout/default/Contract/Form.php b/Layout/default/Contract/Form.php
index 8ce9dc516..d3addd0bd 100644
--- a/Layout/default/Contract/Form.php
+++ b/Layout/default/Contract/Form.php
@@ -148,8 +148,9 @@
Verrechnungsperiode
- billing_period == 1) ? "selected='selected'" : ""?>>Monatlich
- billing_period == 12) ? "selected='selected'" : ""?>>Jährlich
+ billing_period == 0) ? "selected='selected'" : ""?>>Einmalig
+ billing_period == 1) ? "selected='selected'" : ""?>>Monatlich
+ billing_period == 12) ? "selected='selected'" : ""?>>Jährlich
diff --git a/Layout/default/Contract/Index.php b/Layout/default/Contract/Index.php
index 8926ffc5f..ee84e0460 100644
--- a/Layout/default/Contract/Index.php
+++ b/Layout/default/Contract/Index.php
@@ -131,15 +131,7 @@
=(!$contract->isFinished()) ? "not-finished" : "" ?> =($contract->price < 0) ? "text-danger" : ""?>">€ =number_format($contract->price,4,",",".")?>
=(!$contract->isFinished()) ? "not-finished" : "" ?> =($contract->price_setup < 0) ? "text-danger" : ""?>">€ =number_format($contract->price_setup,4,",",".")?>
=(!$contract->isFinished()) ? "not-finished" : "" ?>">
- billing_period == 1): ?>
- monatlich
- billing_period == 24): ?>
- biennal
- billing_period == 36): ?>
- triennal
- billing_period): ?>
- =(12 / $contract->billing_period)?>x Jährlich
-
+ =__($contract->billing_period, "billing_period")?>
">=($contract->finish_date) ? date('d.m.Y', $contract->finish_date) : ""?>
=($contract->cancel_date) ? date('d.m.Y', $contract->cancel_date) : ""?>
diff --git a/Layout/default/Contract/View.php b/Layout/default/Contract/View.php
index 53af585f4..4e83926d2 100644
--- a/Layout/default/Contract/View.php
+++ b/Layout/default/Contract/View.php
@@ -136,12 +136,12 @@
Vertragsinhaber:
- $contract->owner_id])?>">=$contract->owner->getCompanyOrName()?> [=$contract->owner->customer_number?>]
+ $contract->owner_id])?>">=$contract->owner->getCompanyOrName()?> [=$contract->owner->customer_number?>]
billingaddress_id): ?>
Rechnungsempfänger:
- $contract->billingaddress_id])?>">=$contract->billingaddress->getCompanyOrName()?> [=$contract->billingaddress->customer_number?>]
+ $contract->billingaddress_id])?>">=$contract->billingaddress->getCompanyOrName()?> [=$contract->billingaddress->customer_number?>]
@@ -160,22 +160,42 @@
Externes Produkt:
=($contract->product_external) ? "Ja" : "Nein"?>
- Setup Preis:
- ">€ =$contract->price_setup?>
-
- Preis Periodisch:
- ">€ =$contract->price?>
-
- Verrechnungsperiode:
-
- =($contract->billing_period == 1) ? "Monatlich" : ""?>
- =($contract->billing_period == 12) ? "Jährlich" : ""?>
- =($contract->billing_period == 24) ? "Zweijährlich" : ""?>
- =($contract->billing_period == 36) ? "Dreijährlich" : ""?>
-
+ Menge:
+ =(float)number_format($contract->amount, 3, ",", ".")?>
+
+
+ Preis Periodisch Netto:
+ ">€ =number_format(($contract->amount != 1) ? $contract->price * $contract->amount : $contract->price, 4, ",", ".")?>
+
+ Preis Periodisch Brutto:
+ ">€
+ price && $contract->vatrate): ?>
+ amount != 1): ?>
+ =number_format($contract->price + ($contract->price / 100) * $contract->vatrate, 4, ",", ".")?>
+
+ =number_format(($contract->price + ($contract->price / 100) * $contract->vatrate) * $contract->amount, 4, ",", ".")?>
+
+
+
+
+ Verrechnungsperiode:
+
+ =__($contract->billing_period, "billing_period")?>
+
+
+ Herstellungskosten:
+ ">
+ price_setup > 0): ?>
+ Netto: € =number_format($contract->price_setup, 4, ",", ".")?>=($contract->amount != 1) ? " (Gesamt: € ".number_format($contract->price_setup * $contract->amount, 4, ",", ".").")" : ""?>
+ Brutto: € =($contract->price_setup && $contract->vatrate) ? number_format($contract->price_setup + ($contract->price_setup / 100) * $contract->vatrate, 4, ",", ".") : ""?>=($contract->price_setup && $contract->vatrate && $contract->amount != 1) ? " (Gesamt: € ".number_format(($contract->price_setup + ($contract->price_setup / 100) * $contract->vatrate) * $contract->amount, 4, ",", ".").")" : ""?>
+
Verrechnungsstart Verzögerung:
- =$contract->billing_delay?> Monate
+
+ billing_delay): ?>
+ =$contract->billing_delay?> Monate
+
+
@@ -205,14 +225,14 @@
=date('d.m.Y H:i:s',$contract->edit)?> (=$contract->editor->name?>)
- $contract->id])?>">Konfiguration bearbeiten
- $contract->id])?>">Zugangsdaten anzeigen
+ $contract->id])?>"> Konfiguration bearbeiten
+ $contract->id])?>"> Zugangsdaten anzeigen
finish_date && $contract->finish_date < date('U')): ?>
- Inhaberwechsel
- $contract->id])?>">Produkt-/Standortwechsel
- $contract->id])?>">Kündigen
+ Inhaberwechsel
+ $contract->id])?>"> Produkt-/Standortwechsel
+ $contract->id])?>"> Kündigen
- $contract->id])?>" onclick="if(!confirm('Jetzt fertigstellen und in Verrechnung geben?')) return false">Fertigstellen
+ $contract->id])?>" onclick="if(!confirm('Jetzt fertigstellen und in Verrechnung geben?')) return false"> Fertigstellen
@@ -276,6 +296,11 @@
Vertrag aus Bestellung $contract->orderproduct->order_id])?>">#=$contract->orderproduct->order_id?> erstellt
+ type == "contract_finished"): ?>
+
+ Vertag fertiggestellt
+
+
type == "credit_created"): ?>
Gutschrift-Vertrag $j->value])?>">=$j->value?> erstellt
@@ -342,6 +367,8 @@
Kunde
Contract ID
Produkt
+ Preis
+ Preis Setup
Bestelldatum
Fertigstellung
Kündigung
@@ -377,12 +404,14 @@
">=__($link->type, "contract")?> =($link->type != "link") ? $direction : ""?>
$linkcontract->owner_id])?>">=$linkcontract->owner->getCompanyOrName()?>
- "> $linkcontract->id])?>">=$linkcontract->id?>
+ =(!$linkcontract->isFinished()) ? "not-finished" : "" ?>"> $linkcontract->id])?>">=$linkcontract->id?>
- "> $linkcontract->id])?>">=$linkcontract->product_name?> [=$linkcontract->matchcode?>]
- ">=($linkcontract->order_date) ? date('d.m.Y', $linkcontract->order_date) : ""?>
- ">=($linkcontract->finish_date) ? date('d.m.Y', $linkcontract->finish_date) : ""?>
- ">=($linkcontract->cancel_date) ? date('d.m.Y', $linkcontract->cancel_date) : ""?>
+ =(!$linkcontract->isFinished()) ? "not-finished" : "" ?>"> $linkcontract->id])?>">=$linkcontract->product_name?> [=$linkcontract->matchcode?>]
+ =(!$linkcontract->isFinished()) ? "not-finished" : "" ?> =($linkcontract->price < 0) ? "text-danger" : ""?>">€ =number_format($linkcontract->price,4,",",".")?>
+ =(!$linkcontract->isFinished()) ? "not-finished" : "" ?> =($linkcontract->price_setup < 0) ? "text-danger" : ""?>">€ =number_format($linkcontract->price_setup,4,",",".")?>
+ =(!$linkcontract->isFinished()) ? "not-finished" : "" ?>">=($linkcontract->order_date) ? date('d.m.Y', $linkcontract->order_date) : ""?>
+ =(!$linkcontract->isFinished()) ? "not-finished" : "" ?>">=($linkcontract->finish_date) ? date('d.m.Y', $linkcontract->finish_date) : ""?>
+ =(!$linkcontract->isFinished()) ? "not-finished" : "" ?>">=($linkcontract->cancel_date) ? date('d.m.Y', $linkcontract->cancel_date) : ""?>
$link->id])?>" onclick="if(!confirm('Verknüpfung wirklich entfernen?')) return false;" class="text-danger" title="Verknüpfung entfernen">
diff --git a/Layout/default/Emailtemplates/Invoice/invoice.php b/Layout/default/Emailtemplates/Invoice/invoice.php
new file mode 100644
index 000000000..b3d9bbc7f
--- /dev/null
+++ b/Layout/default/Emailtemplates/Invoice/invoice.php
@@ -0,0 +1 @@
+getUrl($Mod, "Index");
+$pagination_baseurl_params = ["filter" => $filter];
+$pagination_entity_name = "Billingrecords";
+?>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Rechungsnummer
+ Rechnungsdatum
+ Kundennummer
+ Rechnungsadresse
+ Netto
+ Ust.
+ Brutto
+ Zahlung
+ Zustellung
+
+
+
+ total + $invoice->total_setup; ?>
+ total_gross + $invoice->total_setup_gross; ?>
+
+ $invoice->id])?>"> =$invoice->invoice_number?>
+ =date("d.m.Y", $invoice->invoice_date)?>
+ =$invoice->customer_number?>
+
+ =($invoice->company) ? $invoice->company." " : ""?>
+ =($invoice->firstname || $invoice->lastname) ? $invoice->firstname." ".$invoice->lastname." " : ""?>
+ =$invoice->street?>
+ =$invoice->zip?> =$invoice->city?>
+ =$invoice->country?>
+
+ ">€ =number_format($total,2,",",".")?>
+ ">€ =number_format($invoice->total_vat,2,",",".")?>
+ ">€ =number_format($total_gross,2,",",".")?>
+ =($invoice->billing_type == "sepa") ? "SEPA" : "Überweisung"?>
+ =($invoice->billing_delivery == "email") ? "Email" : "Papier"?>
+ $invoice->id])?>">
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Layout/default/Invoice/Print.pdf.php b/Layout/default/Invoice/Print.pdf.php
new file mode 100644
index 000000000..7eecd7ddc
--- /dev/null
+++ b/Layout/default/Invoice/Print.pdf.php
@@ -0,0 +1,158 @@
+total + $invoice->total_setup;
+$gross_total = $invoice->total_gross + $invoice->total_setup_gross;
+$is_credit = $net_total < 0;
+
+
+?>
+
+
+ Xinon Billing - Rechnung =$invoice->invoice_number?>
+
+
+
+
+
+
+
+
+
+
+
=$invoice->company?>
+ firstname && $invoice->lastname): ?>=$invoice->firstname?> =$invoice->lastname?>
+ =nl2br($invoice->street)?>
+ =$invoice->zip?> =$invoice->city?>
+ country != "Österreich"):?>=$invoice->country?>
+
+
+
+
GutschriftRechnung =$invoice->invoice_number?>
+
BelegdatumRechnungsdatum: =date("d.m.Y",$invoice->invoice_date)?>
+ uid): ?> Ihre UID: =$invoice->uid?>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ positions) && count($invoice->positions)): ?>
+
+
+
+ Bezeichnung
+ Einzelpreis
+ Menge
+ Gesamtpreis
+ Ust.
+ Gesamt Brutto
+
+
+ positions as $p): ?>
+ start_date);
+ $end_date = new DateTime($p->end_date);
+ $amount = (float) number_format($p->amount, 3, ",", ".");
+ $price = number_format($p->price, 2, ",",".");
+ $price_total = number_format($p->price_total, 2, ",",".");
+ $price_gross = number_format($p->price_gross, 2, ",",".");
+ $vatrate = number_format($p->vatrate, 2, ",",".");
+ ?>
+ one-position">
+
+ =$p->product_name?>
+ format("d.m.Y") != $end_date->format("d.m.Y")): ?>
+ (=$start_date->format("d.m.Y")?> - =$end_date->format("d.m.Y")?>)
+
+ =($p->matchcode) ? "".$p->matchcode."
" : ""?>
+ =($p->product_info) ? "".nl2br($p->product_info)."
" : ""?>
+
+ =$price?> €
+ =$amount?>
+ =$price_total?> €
+ =$vatrate?>%
+ =$price_gross?> €
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Gesamtbetrag Netto:
+ =number_format($net_total, 2, ",", ".")?> €
+
+
+
+ $vat_total): ?>
+ 0): ?>
+
+ + Umsatzsteuer =$vatrate?>%:
+ =number_format($vat_total, 2, ",", ".")?> €
+
+
+
+
+
+
+ Gesamtbetrag:
+
+ Gesamtbetrag Brutto:
+
+ =number_format($gross_total, 2, ",", ".")?> €
+
+
+
+
+
+
+ Hinweis: Die Umsatzsteuerschuld geht auf den Leistungsempfänger über (Reverse Charge)
+
+
+ Gutschrift! Bitte nicht überweisen.
+
+ Ohne Abzug zu bezahlen bis =(new DateTime("@".$invoice->invoice_date))->modify("+14 days")->format("d.m.Y")?>.
+ Bitte geben Sie als Verwendungszweck unbedingt die Rechnungsnummer an, nur so können wir Ihre Zahlung eindeutig zuordnen
+
+
+
+
diff --git a/Layout/default/User/Form.php b/Layout/default/User/Form.php
index 46ca2a9c5..3bc72f040 100644
--- a/Layout/default/User/Form.php
+++ b/Layout/default/User/Form.php
@@ -218,6 +218,12 @@
Bestellung
+
+
+ can("Billing") ? "checked='checked'" : ""?> />
+ Verrechnung
+
+
Zusatzberechtigungen
diff --git a/Layout/default/menu.php b/Layout/default/menu.php
index 19efe9e0a..5fa016f8e 100644
--- a/Layout/default/menu.php
+++ b/Layout/default/menu.php
@@ -67,7 +67,7 @@
"> Geräte Hersteller
"> Geräte Typen
-
+
is(["Admin"]) || ($me->is("netowner") && $me->hasGwrNetworks())): ?>
@@ -86,6 +86,18 @@
+ is(["Admin"])): ?>
+
+
is(["Admin","netowner","lineplanner","pipeplanner","pipeworker","lineworker"])): ?>