From 25236493eeae2103175011422c49f36fb9424536 Mon Sep 17 00:00:00 2001 From: Frank Schubert Date: Wed, 11 Jan 2023 15:53:13 +0100 Subject: [PATCH] WIP Contract linking / productchange --- Layout/default/Address/View.php | 2 +- Layout/default/Contract/Form.php | 16 +- Layout/default/Contract/Index.php | 12 +- ...OnerchangeForm.php => OwnerchangeForm.php} | 0 Layout/default/Contract/ProductchangeForm.php | 272 ++++++++++++++-- Layout/default/Contract/View.php | 114 ++++--- Layout/default/Product/Form.php | 2 +- application/Contract/Contract.php | 70 ++++- application/Contract/ContractController.php | 290 +++++++++++++++++- application/Contract/ContractModel.php | 4 +- .../ContractLink/ContractLinkModel.php | 1 + application/Product/ProductController.php | 2 +- application/Producttech/ProducttechModel.php | 2 +- lang/de.php | 4 + lib/mvcfronk/mfBase/mfBaseModel.php | 8 +- 15 files changed, 672 insertions(+), 127 deletions(-) rename Layout/default/Contract/{OnerchangeForm.php => OwnerchangeForm.php} (100%) diff --git a/Layout/default/Address/View.php b/Layout/default/Address/View.php index d8541e2a9..db316cd22 100644 --- a/Layout/default/Address/View.php +++ b/Layout/default/Address/View.php @@ -208,7 +208,7 @@ "> $contract->id])?>">id?> - "> $contract->id])?>">product->name?> + "> $contract->id])?>">product_name?> "> $contract->id])?>">matchcode?> ">order_date) ? date('d.m.Y', $contract->order_date) : ""?> ">finish_date) ? date('d.m.Y', $contract->finish_date) : ""?> diff --git a/Layout/default/Contract/Form.php b/Layout/default/Contract/Form.php index 8f6b35b6d..3018db6d1 100644 --- a/Layout/default/Contract/Form.php +++ b/Layout/default/Contract/Form.php @@ -38,6 +38,7 @@
+ @@ -77,6 +78,19 @@
+
+ +
+ +
+
+ +
@@ -254,7 +268,7 @@ * customer autocomplete */ // kunde - owner_id && is_object(($contract->owner))): ?> + owner_id && is_object($contract->owner)): ?> $('#owner_id').autoComplete('set', { value: owner_id?>, text: 'owner_id) ? str_replace("'", "\\'", str_replace(["\n", "\r"], " ", $contract->owner->getCompanyOrName()))." (".$contract->owner->zip." ".$contract->owner->city.", ".$contract->owner->street.")".(($contract->owner->customer_number) ? " [".$contract->owner->customer_number."]" : "") : ""?>'}); $('#owner_id').autoComplete(); diff --git a/Layout/default/Contract/Index.php b/Layout/default/Contract/Index.php index 57bc0ca89..93d6c9dca 100644 --- a/Layout/default/Contract/Index.php +++ b/Layout/default/Contract/Index.php @@ -108,10 +108,10 @@ - $contract->id])?>">id?> + $contract->id])?>">id?> $contract->owner_id])?>" target="_blank"> owner->getCompanyOrName()?> - $contract->id])?>">product_name?> - $contract->id])?>">matchcode?> + $contract->id])?>">product_name?> + $contract->id])?>">matchcode?> + +
+ +
+ +
+
+ +
+
+ + + +
- +
- + + + +
@@ -105,4 +241,76 @@
+ + + \ No newline at end of file diff --git a/Layout/default/Contract/View.php b/Layout/default/Contract/View.php index 4b67f9c88..c0d242cf2 100644 --- a/Layout/default/Contract/View.php +++ b/Layout/default/Contract/View.php @@ -23,46 +23,32 @@
+ finish_date || $contract->finish_date > date('U')): ?> +

In Herstellung

+ isCancelled()): ?>

GEKÜNDIGT

-

">product_name?> (id?>)

+

">product_name?> [id?>]

- - - - - billingaddress_id): ?> - - - - - - - - - - - - upgradeFrom) && count($contract->upgradeFrom)): ?> @@ -72,7 +58,7 @@ @@ -84,7 +70,7 @@ @@ -94,7 +80,7 @@ @@ -106,7 +92,7 @@ @@ -116,7 +102,7 @@ @@ -128,7 +114,7 @@ @@ -138,11 +124,29 @@ + + + + + billingaddress_id): ?> + + + + + + + + + + + + + @@ -197,9 +201,13 @@
Matchcode: matchcode?>
Vertragsinhaber: $contract->owner->id])?>">owner->getCompanyOrName()?> (owner->customer_number?>)
Rechnungsempfänger: $contract->owner->id])?>">billingaddress->getCompanyOrName()?> (billingaddress->customer_number?>)
Produkt:product_name?>
Produkt Info:product_info?>
Upgrade von: upgradeFrom as $link): ?> - $link->origin_contract_id])?>" class="contract-link origin->cancel_date <= date('U')) ? "canceled" : ""?>">origin->product_name?> [origin->matchcode?>] (origin_contract_id?>)
+ $link->origin_contract_id])?>" class="contract-link origin->cancel_date && $link->origin->cancel_date <= date('U')) ? "canceled" : ""?>">origin->product_name?> [origin->matchcode?>] (origin_contract_id?>)
Upgrade auf: upgradeTo as $link): ?> - $link->contract_id])?>">contract->product_name?> [contract->matchcode?>] (contract_id?>)
+ $link->contract_id])?>" class="contract-link contract->cancel_date && $link->contract->cancel_date <= date('U')) ? "canceled" : ""?>">contract->product_name?> [contract->matchcode?>] (contract_id?>)
Downgrade von: downgradeFrom as $link): ?> - $link->origin_contract_id])?>" class="contract-link origin->cancel_date <= date('U')) ? "canceled" : ""?>">origin->product_name?> [origin->matchcode?>] (origin_contract_id?>)
+ $link->origin_contract_id])?>" class="contract-link origin->cancel_date <= date('U')) ? "canceled" : ""?>">origin->product_name?> [origin->matchcode?>] (origin_contract_id?>)
Downgrade auf: downgradeTo as $link): ?> - $link->contract_id])?>">contract->product_name?> [contract->matchcode?>] (contract_id?>)
+ $link->contract_id])?>" class="contract-link contract->cancel_date && $link->contract->cancel_date <= date('U')) ? "canceled" : ""?>">contract->product_name?> [contract->matchcode?>] (contract_id?>)
Produktwechsel von: productchangeFrom as $link): ?> - $link->origin_contract_id])?>" class="contract-link origin->cancel_date <= date('U')) ? "canceled" : ""?>">origin->product_name?> [origin->matchcode?>] (origin_contract_id?>)
+ $link->origin_contract_id])?>" class="contract-link origin->cancel_date <= date('U')) ? "canceled" : ""?>">origin->product_name?> [origin->matchcode?>] (origin_contract_id?>)
Produktwechsel auf: productchangeTo as $link): ?> - $link->contract_id])?>">contract->product_name?> [contract->matchcode?>] (contract_id?>)
+ $link->contract_id])?>" class="contract-link contract->cancel_date && $link->contract->cancel_date <= date('U')) ? "canceled" : ""?>">contract->product_name?> [contract->matchcode?>] (contract_id?>)
Umzug von: relocationFrom as $link): ?> - $link->origin_contract_id])?>" class="contract-link origin->cancel_date && $link->origin->cancel_date <= date('U')) ? "canceled" : ""?>">origin->product_name?> [origin->matchcode?>] (origin_contract_id?>)
+ $link->origin_contract_id])?>" class="contract-link origin->cancel_date && $link->origin->cancel_date <= date('U')) ? "canceled" : ""?>">origin->product_name?> [origin->matchcode?>] (origin_contract_id?>)
Umzug auf: relocationTo as $link): ?> - $link->contract_id])?>">contract->product_name?> [contract->matchcode?>] (contract_id?>)
+ $link->contract_id])?>" class="contract-link contract->cancel_date && $link->contract->cancel_date <= date('U')) ? "canceled" : ""?>">contract->product_name?> [contract->matchcode?>] (contract_id?>)
Vertragsinhaber: $contract->owner_id])?>">owner->getCompanyOrName()?> [owner->customer_number?>]
Rechnungsempfänger: $contract->billingaddress_id])?>">billingaddress->getCompanyOrName()?> [billingaddress->customer_number?>]
Produkt:product_name?> [product_id?>]product_name != $contract->product->name) ? " (".$contract->product->name.")" : ""?>
Produkt Info:product_info?>
SLA:
$contract->id])?>"> - - - + finish_date && $contract->finish_date < date('U')): ?> + + $contract->id])?>"> + + + $contract->id])?>" onclick="if(!confirm('Jetzt fertigstellen und in Verrechnung geben?')) return false"> +
@@ -210,12 +218,13 @@ linkFrom) && count($contract->linkFrom)) || (is_array($contract->linkTo) && count($contract->linkTo))): ?>
-

Verknüpfte Verträge

+

Verknüpfte Verträge $contract->id])?>">Neuen Contract anlegen

+ @@ -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"; + } } ?> - - - + + + + @@ -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: - 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;
Kunde Contract IDTyp Produkt Matchcode Bestelldatum
$linkcontract->owner_id])?>">owner->getCompanyOrName()?>"> $linkcontract->id])?>">id?>"> $linkcontract->id])?>">product->name?>"> $linkcontract->id])?>">matchcode?>"> $linkcontract->id])?>">id?>">type, "contract")?> type != "link") ? $direction : ""?>"> $linkcontract->id])?>">product_name?>"> $linkcontract->id])?>">matchcode?> ">order_date) ? date('d.m.Y', $linkcontract->order_date) : ""?> ">finish_date) ? date('d.m.Y', $linkcontract->finish_date) : ""?> ">cancel_date) ? date('d.m.Y', $linkcontract->cancel_date) : ""?>