+ finish_date || $contract->finish_date > date('U')): ?>
+
In Herstellung
+
isCancelled()): ?>
GEKÜNDIGT
-
">=$contract->product_name?> (=$contract->id?>)
+
">=$contract->product_name?> [=$contract->id?>]
Matchcode:
=$contract->matchcode?>
-
- Vertragsinhaber:
- $contract->owner->id])?>">=$contract->owner->getCompanyOrName()?> (=$contract->owner->customer_number?>)
-
- billingaddress_id): ?>
-
- Rechnungsempfänger:
- $contract->owner->id])?>">=$contract->billingaddress->getCompanyOrName()?> (=$contract->billingaddress->customer_number?>)
-
-
-
- Produkt:
- =$contract->product_name?>
-
- Produkt Info:
- =$contract->product_info?>
-
upgradeFrom) && count($contract->upgradeFrom)): ?>
Upgrade von:
upgradeFrom as $link): ?>
- $link->origin_contract_id])?>" class="contract-link =($link->origin->cancel_date <= date('U')) ? "canceled" : ""?>">=$link->origin->product_name?> [=$link->origin->matchcode?>] (=$link->origin_contract_id?>)
+ $link->origin_contract_id])?>" class="contract-link =($link->origin->cancel_date && $link->origin->cancel_date <= date('U')) ? "canceled" : ""?>">=$link->origin->product_name?> [=$link->origin->matchcode?>] (=$link->origin_contract_id?>)
@@ -72,7 +58,7 @@
Upgrade auf:
upgradeTo as $link): ?>
- $link->contract_id])?>">=$link->contract->product_name?> [=$link->contract->matchcode?>] (=$link->contract_id?>)
+ $link->contract_id])?>" class="contract-link =($link->contract->cancel_date && $link->contract->cancel_date <= date('U')) ? "canceled" : ""?>">=$link->contract->product_name?> [=$link->contract->matchcode?>] (=$link->contract_id?>)
@@ -84,7 +70,7 @@
Downgrade von:
downgradeFrom as $link): ?>
- $link->origin_contract_id])?>" class="contract-link =($link->origin->cancel_date <= date('U')) ? "canceled" : ""?>">=$link->origin->product_name?> [=$link->origin->matchcode?>] (=$link->origin_contract_id?>)
+ $link->origin_contract_id])?>" class="contract-link =($link->origin->cancel_date <= date('U')) ? "canceled" : ""?>">=$link->origin->product_name?> [=$link->origin->matchcode?>] (=$link->origin_contract_id?>)
@@ -94,7 +80,7 @@
Downgrade auf:
downgradeTo as $link): ?>
- $link->contract_id])?>">=$link->contract->product_name?> [=$link->contract->matchcode?>] (=$link->contract_id?>)
+ $link->contract_id])?>" class="contract-link =($link->contract->cancel_date && $link->contract->cancel_date <= date('U')) ? "canceled" : ""?>">=$link->contract->product_name?> [=$link->contract->matchcode?>] (=$link->contract_id?>)
@@ -106,7 +92,7 @@
Produktwechsel von:
productchangeFrom as $link): ?>
- $link->origin_contract_id])?>" class="contract-link =($link->origin->cancel_date <= date('U')) ? "canceled" : ""?>">=$link->origin->product_name?> [=$link->origin->matchcode?>] (=$link->origin_contract_id?>)
+ $link->origin_contract_id])?>" class="contract-link =($link->origin->cancel_date <= date('U')) ? "canceled" : ""?>">=$link->origin->product_name?> [=$link->origin->matchcode?>] (=$link->origin_contract_id?>)
@@ -116,7 +102,7 @@
Produktwechsel auf:
productchangeTo as $link): ?>
- $link->contract_id])?>">=$link->contract->product_name?> [=$link->contract->matchcode?>] (=$link->contract_id?>)
+ $link->contract_id])?>" class="contract-link =($link->contract->cancel_date && $link->contract->cancel_date <= date('U')) ? "canceled" : ""?>">=$link->contract->product_name?> [=$link->contract->matchcode?>] (=$link->contract_id?>)
@@ -128,7 +114,7 @@
Umzug von:
relocationFrom as $link): ?>
- $link->origin_contract_id])?>" class="contract-link =($link->origin->cancel_date && $link->origin->cancel_date <= date('U')) ? "canceled" : ""?>">=$link->origin->product_name?> [=$link->origin->matchcode?>] (=$link->origin_contract_id?>)
+ $link->origin_contract_id])?>" class="contract-link =($link->origin->cancel_date && $link->origin->cancel_date <= date('U')) ? "canceled" : ""?>">=$link->origin->product_name?> [=$link->origin->matchcode?>] (=$link->origin_contract_id?>)
@@ -138,11 +124,29 @@
Umzug auf:
relocationTo as $link): ?>
- $link->contract_id])?>">=$link->contract->product_name?> [=$link->contract->matchcode?>] (=$link->contract_id?>)
+ $link->contract_id])?>" class="contract-link =($link->contract->cancel_date && $link->contract->cancel_date <= date('U')) ? "canceled" : ""?>">=$link->contract->product_name?> [=$link->contract->matchcode?>] (=$link->contract_id?>)
+
+ Vertragsinhaber:
+ $contract->owner_id])?>">=$contract->owner->getCompanyOrName()?> [=$contract->owner->customer_number?>]
+
+ billingaddress_id): ?>
+
+ Rechnungsempfänger:
+ $contract->billingaddress_id])?>">=$contract->billingaddress->getCompanyOrName()?> [=$contract->billingaddress->customer_number?>]
+
+
+
+ Produkt:
+ =$contract->product_name?> [=$contract->product_id?>]=($contract->product_name != $contract->product->name) ? " (".$contract->product->name.") " : ""?>
+
+ Produkt Info:
+ =$contract->product_info?>
+
+
SLA:
@@ -197,9 +201,13 @@
$contract->id])?>">Konfiguration bearbeiten
- Inhaberwechsel
- Produkt-/Standortwechsel
- Kündigen
+ finish_date && $contract->finish_date < date('U')): ?>
+ Inhaberwechsel
+ $contract->id])?>">Produkt-/Standortwechsel
+ Kündigen
+
+ $contract->id])?>" onclick="if(!confirm('Jetzt fertigstellen und in Verrechnung geben?')) return false">Fertigstellen
+
@@ -210,12 +218,13 @@
linkFrom) && count($contract->linkFrom)) || (is_array($contract->linkTo) && count($contract->linkTo))): ?>
-
Verknüpfte Verträge
+
Kunde
Contract ID
+ Typ
Produkt
Matchcode
Bestelldatum
@@ -227,18 +236,26 @@
contract_id == $contract->id) {
+ $direction = "von";
$linkcontract = $link->origin;
} else {
$linkcontract = $link->contract;
+ if($link->type == "upgrade" || $link->type == "downgrade") {
+ $direction = "auf";
+ }
+ if($link->type == "relocation") {
+ $direction = "nach";
+ }
}
?>
$linkcontract->owner_id])?>">=$linkcontract->owner->getCompanyOrName()?>
- "> $linkcontract->id])?>">=$linkcontract->id?>
- "> $linkcontract->id])?>">=$linkcontract->product->name?>
- "> $linkcontract->id])?>">=$linkcontract->matchcode?>
+ "> $linkcontract->id])?>">=$linkcontract->id?>
+ ">=__($link->type, "contract")?> =($link->type != "link") ? $direction : ""?>
+ "> $linkcontract->id])?>">=$linkcontract->product_name?>
+ "> $linkcontract->id])?>">=$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) : ""?>
@@ -251,38 +268,11 @@
-
diff --git a/Layout/default/Product/Form.php b/Layout/default/Product/Form.php
index 9d6458aff..4c0f007e5 100644
--- a/Layout/default/Product/Form.php
+++ b/Layout/default/Product/Form.php
@@ -114,7 +114,7 @@
Name:
Kundentyp: Residential Business
- RTR Code:
+
Beschreibung:
Interne Notiz:
diff --git a/application/Contract/Contract.php b/application/Contract/Contract.php
index fc2dfd6d6..50c120017 100644
--- a/application/Contract/Contract.php
+++ b/application/Contract/Contract.php
@@ -100,7 +100,7 @@ class Contract extends mfBaseModel {
}
$now = date('U');
- if($this->cancel_date < $now) {
+ if($this->cancel_date <= $now) {
return true;
}
@@ -110,11 +110,18 @@ class Contract extends mfBaseModel {
public function getProperty($name) {
if($this->$name == null) {
- if(!$this->id) {
- return null;
+ if($name == "billingaddress" && $this->billingaddress_id) {
+ $this->billingaddress = mfValuecache::singleton()->get("mfObjectmodel-Address-".$this->billingaddress_id);
+ if($this->billingaddress === null) {
+ $this->billingaddress = new Address($this->billingaddress_id);
+ if($this->billingaddress->id) {
+ mfValuecache::singleton()->set("mfObjectmodel-Address-".$this->billingaddress_id, $this->billingaddress);
+ }
+ }
+ return $this->billingaddress;
}
- if($name == "owner") {
+ if($name == "owner" && $this->owner_id) {
$this->owner = mfValuecache::singleton()->get("mfObjectmodel-Address-".$this->owner_id);
if($this->owner === null) {
$this->owner = new Address($this->owner_id);
@@ -125,18 +132,12 @@ class Contract extends mfBaseModel {
return $this->owner;
}
- if($name == "billingaddress") {
-
- $this->billingaddress = mfValuecache::singleton()->get("mfObjectmodel-Address-".$this->billingaddress_id);
- if($this->billingaddress === null) {
- $this->billingaddress = new Address($this->billingaddress_id);
- if($this->billingaddress->id) {
- mfValuecache::singleton()->set("mfObjectmodel-Address-".$this->billingaddress_id, $this->billingaddress);
- }
- }
- return $this->billingaddress;
+
+ if(!$this->id) {
+ return null;
}
+
if($name == "product") {
$this->product = mfValuecache::singleton()->get("mfObjectmodel-Product-".$this->product_id);
if($this->product === null) {
@@ -264,4 +265,45 @@ class Contract extends mfBaseModel {
return $this->$name;
}
+
+
+ /*
+ * When object is cloned, new object will call this funtion to let us clean up the new Contract.
+ * Throws Exception if cloning fails.
+ */
+ public function __clone() {
+ $me = new User;
+ $me->loadMe();
+
+ $old_id = $this->id;
+ $old_nummer = $this->nummer;
+ unset($this->id);
+
+
+ // cleanup Contract daten
+ $this->orderproduct_id = null;
+ $this->order_date = null;
+ $this->finish_date = null;
+ $this->finish_date_by = null;
+ $this->cancel_date = null;
+ $this->cancel_date_by = null;
+ $this->create_by = $me->id;
+ $this->edit_by = $me->id;
+
+ $this->create = null;
+ $this->edit = null;
+ $this->saved = 0;
+ $this->mode = "new";
+ $this->_old_data = new StdClass();
+
+ //$this->save();
+
+ if($old_id == $this->id) {
+ $this->log->error("save() of cloned Contract $old_nummer failed!");
+ throw new Exception("Saving clone failed.");
+ }
+
+ $this->log->debug("Cloned Contract $old_id");
+ }
+
}
\ No newline at end of file
diff --git a/application/Contract/ContractController.php b/application/Contract/ContractController.php
index 97e785476..96ed5ae69 100644
--- a/application/Contract/ContractController.php
+++ b/application/Contract/ContractController.php
@@ -67,7 +67,10 @@ class ContractController extends mfBaseController {
protected function viewAction() {
$this->layout()->setTemplate("Contract/View");
- $id = $this->request->id;
+ $id = $this->request->contract_id;
+ if(!$id) {
+ $id = $this->request->id;
+ }
if(!is_numeric($id) || !$id) {
$this->layout()->setFlash("Vertrag nicht gefunden", "error");
$this->redirect("Contract");
@@ -90,12 +93,280 @@ class ContractController extends mfBaseController {
}
+ protected function productchangeAction() {
+ $this->layout()->setTemplate("Contract/ProductchangeForm");
+
+ $id = $this->request->contract_id;
+ if(!$id) {
+ $id = $this->request->id;
+ }
+ if(!is_numeric($id) || !$id) {
+ $this->layout()->setFlash("Vertrag nicht gefunden", "error");
+ $this->redirect("Contract");
+ }
+
+ $contract = new Contract($id);
+ if(!$contract->id) {
+ $this->layout()->setFlash("Vertrag nicht gefunden", "error");
+ $this->redirect("Contract");
+ }
+
+ $this->layout()->set("contract", $contract);
+ $this->layout()->set("terminations", TerminationModel::getAll());
+
+ if($this->request->filter) {
+ $this->layout()->set("filter", $this->request->filter);
+ }
+ if($this->request->s) {
+ $this->layout()->set("filter", $this->request->s);
+ }
+ }
+
+ protected function saveProductchangeAction() {
+ $r = $this->request;
+
+ $id = $r->contract_id;
+ if(!is_numeric($id) || !$id) {
+ $this->layout()->setFlash("Vertrag nicht gefunden", "error");
+ $this->redirect("Contract");
+ }
+
+ $contract = new Contract($id);
+ if(!$contract->id) {
+ $this->layout()->setFlash("Vertrag nicht gefunden", "error");
+ $this->redirect("Contract");
+ }
+
+ $new_contract = clone($contract);
+
+
+ $contract_data = [];
+ $contract_data['product_id'] = $r->product_id;
+ $contract_data['product_name'] = trim($r->product_name);
+ $contract_data['product_info'] = trim($r->product_info);
+ $contract_data['matchcode'] = trim($r->matchcode);
+ $contract_data['termination_id'] = $r->termination_id;
+ $contract_data['amount'] = 1;
+ $contract_data['price'] = $r->price;
+ $contract_data['price_setup'] = $r->price_setup;
+ $contract_data['price_nne'] = $r->price_nne;
+ $contract_data['price_nbe'] = $r->price_nbe;
+ $contract_data['note'] = trim($r->note);
+
+ /*
+ * termination check
+ */
+ $product = new Product($r->product_id);
+ if(!$product->id) {
+ $this->layout()->setFlash("Produkt nicht gefunden", "error");
+ $this->redirect("Contract", "productchange", ["contract_id" => $id]);
+ }
+
+ $contract_data['product_external'] = $product->external;
+ $contract_data['product_external_id'] = $product->external_id;
+ $contract_data['sla_id'] = $product->sla_id;
+
+ $require_term = false;
+ if(array_key_exists(TT_ATTRIB_TERMINATION_REQUIRED_NAME, $product->attributes) && $product->attributes[TT_ATTRIB_TERMINATION_REQUIRED_NAME]->value == 1) {
+ //var_dump($prod->attributes);
+ $require_term = true;
+ $termination = new Termination($contract_data['termination_id']);
+
+ if(!$contract_data['termination_id'] || !$termination->id) {
+ $this->layout()->setFlash("Produkt erfordert Anschluss.", "error");
+ $this->redirect("Contract", "productchange", ["contract_id" => $id]);
+ }
+ } else {
+ $contract_data['termination_id'] = null;
+ }
+
+
+ $new_contract->update($contract_data);
+ $new_contract_id = $new_contract->save();
+
+ if(!$new_contract_id) {
+ $this->layout()->setFlash("Neuer Contract konnte nicht gespeichert werden", "error");
+ $this->redirect("Contract", "productchange", ["contract_id" => $id]);
+ }
+
+
+
+ if(is_array($r->links) && count($r->links)) {
+ foreach($r->links as $link_id => $action) {
+ $old_link = new ContractLink($link_id);
+ if(!$old_link->id) continue;
+ $new_link_origin_id = 0;
+ $new_link_origin_id = 0;
+ // check if link contains this contract
+ if($old_link->contract_id == $contract->id) {
+ $new_link_contract_id = $new_contract->id;
+ $new_link_origin_id = $old_link->origin_contract_id;
+ } elseif($old_link->origin_contract_id == $contract->id) {
+ $new_link_contract_id = $old_link->contract_id;
+ $new_link_origin_id = $new_contract->id;
+ } else {
+ continue;
+ }
+
+ $new_link = ContractLinkModel::create([
+ 'contract_id' => $new_link_contract_id,
+ 'origin_contract_id' => $new_link_origin_id,
+ 'type' => $old_link->type,
+ ]);
+ if(!$new_link->save()) {
+ $this->layout()->setFlash("Konnte neuen Link nicht speichern", "warn");
+ }
+
+ if($action == "cancel") {
+ $old_link->change_action = "cancel";
+ if(!$old_link->save()) {
+ $this->layout()->setFlash("Konnte alten Link nicht speichern", "warn");
+ }
+ }
+
+ //var_dump($new_link);exit;
+ }
+ }
+
+ /*
+ * Upgrade Link erstellen
+ */
+ $change_type = "upgrade";
+ /*if($contract->product_id != $new_contract->product_id) {
+ $change_type = "upgrade";
+ } elseif($contract->matchcode != $new_contract->matchcode) {
+ $change_type = "relocation";
+ } else {
+ $change_type = "productchange";
+ }*/
+
+ $link = ContractLinkModel::create([
+ 'contract_id' => $new_contract_id,
+ 'origin_contract_id' => $id,
+ 'type' => $change_type
+ ]);
+
+ $link_id = $link->save();
+ if(!$link_id) {
+ $this->layout()->setFlash("Konnte Verknüpfung nicht speichern", "warn");
+ }
+
+ $this->layout()->setFlash("Neuer Contract erfolgreich erstellt", "success");
+ $this->redirect("Contract", "view", ["contract_id" => $new_contract_id]);
+
+
+
+ }
+
+ protected function finishContractAction() {
+ $r = $this->request;
+
+ $id = $r->contract_id;
+ if(!is_numeric($id) || !$id) {
+ $this->layout()->setFlash("Contract nicht gefunden", "error");
+ $this->redirect("Contract");
+ }
+
+ $contract = new Contract($id);
+ if(!$contract->id) {
+ $this->layout()->setFlash("Contract nicht gefunden", "error");
+ $this->redirect("Contract");
+ }
+
+ $now = date('U');
+
+ /*
+ * Vorgänger Contracts kündigen
+ */
+ foreach(ContractLinkModel::search(['contract_id' => $id]) as $link) {
+ if(!in_array($link->type, ["upgrade","downgrade","relocation","productchange"])) {
+ continue;
+ }
+
+ $origin = $link->origin;
+ $origin->cancel_date = $now;
+ $origin->cancel_date_by = $this->me->id;
+ $origin->edit_by = $this->me->id;
+ if(!$origin->save()) {
+ $this->layout()->setFlash("Achtung: Konnte nicht alle Vorgängercontracts kündigen!", "warn");
+ }
+
+ /*
+ * alte Links übernehmen / kündigen
+ */
+ foreach(ContractLinkModel::search(['type' => "link", 'contract_id' => $origin->id] ) as $old_link) {
+ // verlinkten Contract kündigen (wenn nicht schon gekündigt)
+ if($old_link->change_action == "cancel" && !$old_link->contract->cancel_date) {
+ $old_link->origin->update([
+ 'cancel_date' => $now,
+ 'cancel_date_by' => $this->me->id,
+ 'edit_by' => $this->me->id
+ ]);
+ $old_link->origin->save();
+
+ $old_link->change_action = null;
+ $old_link->save();
+ }
+ }
+
+ foreach(ContractLinkModel::search(['type' => "link", 'origin_contract_id' => $origin->id] ) as $old_link) {
+ // verlinkten Contract kündigen (wenn nicht schon gekündigt)
+ if($old_link->change_action == "cancel" && !$old_link->contract->cancel_date) {
+ $old_link->contract->update([
+ 'cancel_date' => $now,
+ 'cancel_date_by' => $this->me->id,
+ 'edit_by' => $this->me->id
+ ]);
+ $old_link->contract->save();
+
+ $old_link->change_action = null;
+ $old_link->save();
+ }
+ }
+
+ }
+
+
+
+ $contract->finish_date = $now;
+ $contract->finish_date_by = $this->me->id;
+ if(!$contract->save()) {
+ $this->layout()->setFlash("Contract konnte nicht gespeichert werden", "error");
+ $this->redirect("Contract", "view", ['contract_id' => $id]);
+ }
+
+ /*
+ * bestehende Links übernehmen oder kündigen
+ */
+
+ $this->layout()->setFlash("Contract erfolgreich fertiggestellt", "success");
+ $this->redirect("Contract", "view", ['contract_id' => $id]);
+
+ }
+
protected function addAction() {
$this->layout()->setTemplate("Contract/Form");
+ $this->layout()->set("terminations", TerminationModel::getAll());
+
+ if($this->request->origin_contract_id) {
+ $origin = new Contract($this->request->origin_contract_id);
+ if($origin->id) {
+ $contract = new Contract();
+ $contract->owner_id = $origin->owner_id;
+ $contract->billingaddress_id = $origin->billingaddress_id;
+ $contract->matchcode = $origin->matchcode;
+ //var_dump($contract);exit;
+ $this->layout()->set("contract", $contract);
+ $this->layout()->set("origin_contract_id", $origin->id);
+ }
+ }
}
protected function editAction() {
- $id = $this->request->id;
+ $id = $this->request->contract_id;
+ if(!$id) {
+ $id = $this->request->id;
+ }
if(!is_numeric($id) || !$id) {
$this->layout()->setFlash("Vertrag nicht gefunden", "error");
$this->redirect("Contract");
@@ -205,6 +476,21 @@ class ContractController extends mfBaseController {
$this->layout()->setFlash("Vertrag erfolgreich gespeichert.", "success");
+ /*
+ * Create link to origin contract if set
+ */
+ if($mode == "add" && $r->origin_contract_id) {
+ $origin = new Contract($r->origin_contract_id);
+ if($origin->id) {
+ $link = ContractLinkModel::create([
+ 'contract_id' => $contract_id,
+ 'origin_contract_id' => $origin->id,
+ 'type' => 'link'
+ ]);
+ $link->save();
+ }
+ }
+
/* ContractLinks */
diff --git a/application/Contract/ContractModel.php b/application/Contract/ContractModel.php
index 9d97cb5d3..67fabb5f9 100644
--- a/application/Contract/ContractModel.php
+++ b/application/Contract/ContractModel.php
@@ -59,7 +59,7 @@ class ContractModel {
$db = FronkDB::singleton();
- $res = $db->select("Contract", "*", "1 = 1 ORDER BY owner_id,product_id,`create`");
+ $res = $db->select("Contract", "*", "1 = 1 ORDER BY owner_id,`create`");
if($db->num_rows($res)) {
while($data = $db->fetch_object($res)) {
$items[] = new Contract($data);
@@ -129,7 +129,7 @@ class ContractModel {
LEFT JOIN Product ON (Contract.product_id = Product.id)
WHERE $where
GROUP BY Contract.id
- ORDER BY Contract.owner_id,Contract.product_id,Contract.`create`";
+ ORDER BY Contract.owner_id,Contract.`create`";
if(is_array($limit) && count($limit)) {
if(is_numeric($limit['start']) && is_numeric($limit['count'])) {
diff --git a/application/ContractLink/ContractLinkModel.php b/application/ContractLink/ContractLinkModel.php
index 586f770dc..a3a7cfc30 100644
--- a/application/ContractLink/ContractLinkModel.php
+++ b/application/ContractLink/ContractLinkModel.php
@@ -4,6 +4,7 @@ class ContractLinkModel {
public $contract_id;
public $origin_contract_id;
public $type;
+ public $change_action;
public $create_by = null;
public $edit_by = null;
diff --git a/application/Product/ProductController.php b/application/Product/ProductController.php
index c9d80018f..937c115f6 100644
--- a/application/Product/ProductController.php
+++ b/application/Product/ProductController.php
@@ -202,7 +202,7 @@ class ProductController extends mfBaseController {
if($r->producttech_id == "new") {
$nt = [];
$nt['name'] = $r->producttech_new_name;
- $nt['rtrcode'] = $r->producttech_new_rtrcode;
+ //$nt['rtrcode'] = $r->producttech_new_rtrcode;
$nt['customer_type'] = ($r->producttech_new_customer_type == "business") ? "business" : "residential";
$nt['description'] = $r->producttech_new_description;
$nt['note'] = $r->producttech_new_note;
diff --git a/application/Producttech/ProducttechModel.php b/application/Producttech/ProducttechModel.php
index 8c6b4427f..9d758d169 100644
--- a/application/Producttech/ProducttechModel.php
+++ b/application/Producttech/ProducttechModel.php
@@ -2,7 +2,7 @@
class ProducttechModel {
public $name = null;
- public $rtrcode = null;
+ //public $rtrcode = null;
public $customer_type = null;
public $description = null;
diff --git a/lang/de.php b/lang/de.php
index fca251ea6..7cb6fb875 100644
--- a/lang/de.php
+++ b/lang/de.php
@@ -45,5 +45,9 @@ $l['preorder.order'] = "Vollanschluss";
$l['preorder.reorder'] = "Nachbestellung";
$l['contract.link'] = "Verknüpfung";
+$l['contract.upgrade'] = "Upgrade";
+$l['contract.downgrade'] = "Downgrade";
+$l['contract.relocation'] = "Umzug";
+$l['contract.productchange'] = "Produktwechsel";
$lang['de'] = $l;
\ No newline at end of file
diff --git a/lib/mvcfronk/mfBase/mfBaseModel.php b/lib/mvcfronk/mfBase/mfBaseModel.php
index 51cb71dc3..9b118177b 100644
--- a/lib/mvcfronk/mfBase/mfBaseModel.php
+++ b/lib/mvcfronk/mfBase/mfBaseModel.php
@@ -16,13 +16,13 @@ class mfBaseModel {
public $id;
public $data;
public $_old_data;
- private $create;
- private $edit;
+ protected $create;
+ protected $edit;
private $worker;
protected $forcestr;
- private $mode = "new";
- private $saved = 0;
+ protected $mode = "new";
+ protected $saved = 0;
protected $db;
protected $log;
protected $table=false;