Merge branch 'master' into 'spidev'
# Conflicts: # Layout/default/header.php
This commit is contained in:
@@ -1 +1,178 @@
|
||||
<?php
|
||||
|
||||
if($unit->id && !array_key_exists($unit->hausnummer->netzgebiet_id, $my_adb_networks)) {
|
||||
$this->setFlash("Keine Berechtigung", "error");
|
||||
mfBaseController::redirect("AddressDB");
|
||||
}
|
||||
|
||||
?>
|
||||
<?php include(realpath(dirname(__FILE__)."/../../$mfLayoutPackage")."/header.php"); ?>
|
||||
<!-- start page title -->
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div class="page-title-box">
|
||||
<div class="page-title-right">
|
||||
<ol class="breadcrumb m-0">
|
||||
<li class="breadcrumb-item"><a href="<?=self::getUrl("Dashboard")?>"><?=MFAPPNAME_SLUG?></a></li>
|
||||
<li class="breadcrumb-item"><a href="<?=self::getUrl("AddressDB")?>">GWR / AddressDB</a></li>
|
||||
<li class="breadcrumb-item"><a href="<?=self::getUrl("AddressDB", "view", ["id" => $unit->hausnummer_id])?>"><?=$unit->hausnummer->getAddress()?></a></li>
|
||||
<li class="breadcrumb-item active"><?=($unit->id) ? "bearbeiten" : "Neu" ?></li>
|
||||
</ol>
|
||||
</div>
|
||||
<h4 class="page-title">Wohneinheit</h4>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- end page title -->
|
||||
|
||||
<div class="row">
|
||||
<div class="col-lg-12">
|
||||
|
||||
<div class="card bg-light">
|
||||
<div class="card-body">
|
||||
<h4 class="header-title mb-2"><?=($unit->id) ? "Wohneinheit bearbeiten" : "Neue Adresse"?></h4>
|
||||
|
||||
<form class="form-horizontal" method="post" action="<?=self::getUrl("ADBWohneinheit", "save")?>">
|
||||
<input type="hidden" name="id" value="<?=$unit->id?>" />
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
|
||||
<div class="form-group row">
|
||||
<label class="col-lg-2 col-form-label">Addresse </label>
|
||||
<div class="col-lg-10">
|
||||
<input type="text" class="form-control" value="<?=$unit->hausnummer->getAddress()?><?=($unit->hausnummer->rimo_id) ? " - ".$unit->hausnummer->rimo_id : ""?>" disabled="disabled" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group row">
|
||||
<label class="col-lg-2 col-form-label" for="oaid">OAID</label>
|
||||
<div class="col-lg-10">
|
||||
<input type="text" class="form-control" value="<?=$unit->oaid?>" disabled="disabled" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group row">
|
||||
<label class="col-lg-2 col-form-label" for="extref">Rimo External ID</label>
|
||||
<div class="col-lg-10">
|
||||
<input type="text" class="form-control" name="extref" id="extrefaid" value="<?=$unit->extref?>" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<hr />
|
||||
|
||||
<div class="form-group row">
|
||||
<label class="col-lg-2 col-form-label" for="zusatz">Zusatzbezeichnung</label>
|
||||
<div class="col-lg-10">
|
||||
<input type="text" class="form-control" name="zusatz" id="zusatz" value="<?=$unit->zusatz?>" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group row">
|
||||
<label class="col-lg-2 col-form-label" for="block">Block</label>
|
||||
<div class="col-lg-10">
|
||||
<input type="text" class="form-control" name="block" id="block" value="<?=$unit->block?>" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group row">
|
||||
<label class="col-lg-2 col-form-label" for="stiege">Stiege</label>
|
||||
<div class="col-lg-10">
|
||||
<input type="text" class="form-control" name="stiege" id="stiege" value="<?=$unit->stiege?>" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group row">
|
||||
<label class="col-lg-2 col-form-label" for="stock">Stock</label>
|
||||
<div class="col-lg-10">
|
||||
<input type="text" class="form-control" name="stock" id="stock" value="<?=$unit->stock?>" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group row">
|
||||
<label class="col-lg-2 col-form-label" for="tuer">Tür</label>
|
||||
<div class="col-lg-10">
|
||||
<input type="text" class="form-control" name="tuer" id="tuer" value="<?=$unit->tuer?>" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group row">
|
||||
<label class="col-lg-2 col-form-label" for="bezeichner">Bezeichner</label>
|
||||
<div class="col-lg-10">
|
||||
<input type="text" class="form-control" name="bezeichner" id="bezeichner" value="<?=$unit->bezeichner?>" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<hr />
|
||||
|
||||
<div class="form-group row">
|
||||
<label class="col-lg-2 col-form-label">Patchposition</label>
|
||||
<div class="col-lg-10">
|
||||
<input type="text" class="form-control" value="<?=$unit->getPatchEqString?>" disabled="disabled" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="form-group row">
|
||||
<label class="col-lg-2"></label>
|
||||
<div class="col-lg-10">
|
||||
<button type="submit" class="btn btn-primary">Speichern</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
|
||||
<?php if((is_object($unit->rimo_workorder) && $unit->rimo_workorder->id) || (is_array($unit->ftu_data) && $unit->ftu_data->id)): ?>
|
||||
<div class="row mt-2">
|
||||
<div class="col">
|
||||
<div class="card">
|
||||
|
||||
<div class="card-body">
|
||||
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
|
||||
<table class="table table-sm table-striped">
|
||||
<tr>
|
||||
<td colspan="2"><h4>FTU</h4></td>
|
||||
</tr><tr>
|
||||
<th>FTU Name:</th>
|
||||
<td class="text-monospace"><?=$unit->ftu_data["name"]?>
|
||||
</tr><tr>
|
||||
<th>FTU External ID</th>
|
||||
<td class="text-monospace"><?=$unit->ftu_data["id"]?>
|
||||
</tr><tr>
|
||||
<td colspan="2"><h4>Workorder</h4></td>
|
||||
</tr><tr>
|
||||
<th>Name</th>
|
||||
<td class="text-monospace"><?=$unit->rimo_workorder->rimo_name?></td>
|
||||
</tr><tr>
|
||||
<th>External ID</th>
|
||||
<td class="text-monospace"><?=$unit->rimo_workorder->rimo_id?></td>
|
||||
</tr><tr>
|
||||
<th>Status</th>
|
||||
<td><?=$unit->rimo_workorder->rimo_status?></td>
|
||||
</tr><tr>
|
||||
<th>Erstellt</th>
|
||||
<td class="text-monospace"><?=(is_object($unit->rimo_workorder)) ? date("d.m.Y H:i:s", $unit->rimo_workorder->create) : ""?></td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<?php include(realpath(dirname(__FILE__)."/../../$mfLayoutPackage")."/footer.php"); ?>
|
||||
@@ -1,4 +1,3 @@
|
||||
<?php //var_dump($address->parent->types);exit;?>
|
||||
<?php
|
||||
$urlfilter = [];
|
||||
if($s) {
|
||||
@@ -255,21 +254,45 @@
|
||||
<input type="text" class="form-control" name="fibu_account_number" id="fibu_account_number" value="<?=$address->fibu_account_number?>" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<hr />
|
||||
|
||||
<div class="form-group row">
|
||||
<label class="col-lg-2 col-form-label" for="fibu_supplier_number">FIBU Lieferanten Nummer</label>
|
||||
<label class="col-lg-2 col-form-label" for="fibu_supplier_number">FIBU Lieferantennummer</label>
|
||||
<div class="col-lg-10">
|
||||
<input type="text" class="form-control" name="fibu_supplier_number" id="fibu_supplier_number" value="<?=$address->fibu_supplier_number?>" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group row">
|
||||
<label class="col-lg-2 col-form-label" for="fibu_supplier_due">FIBU Lieferanten Zahlungsziel</label>
|
||||
<label class="col-lg-2 col-form-label" for="fibu_supplier_due">Lieferant Zahlungsziel</label>
|
||||
<div class="col-lg-10">
|
||||
<input type="text" class="form-control" name="fibu_supplier_due" id="fibu_supplier_due" value="<?=$address->fibu_supplier_due?>" />
|
||||
<small>Standard: <?=TT_ADDRESS_DEFAULT_SUPPLIER_DUE?> Tage</small>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group row">
|
||||
<label class="col-lg-2 col-form-label" for="fibu_supplier_skonto">Lieferant Skontotage</label>
|
||||
<div class="col-lg-10">
|
||||
<input type="text" class="form-control" name="fibu_supplier_skonto" id="fibu_supplier_skonto" value="<?=$address->fibu_supplier_skonto?>" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group row">
|
||||
<label class="col-lg-2 col-form-label" for="fibu_supplier_skonto_rate">Lieferant Skonto %</label>
|
||||
<div class="col-lg-10">
|
||||
<input type="text" class="form-control" name="fibu_supplier_skonto_rate" id="fibu_supplier_skonto_rate" value="<?=$address->fibu_supplier_skonto_rate?>" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group row">
|
||||
<label class="col-lg-2">Lieferant Zahlsperre</label>
|
||||
<div class="col-lg-10">
|
||||
<label><input type="checkbox" name="fibu_supplier_paymentblock" id="fibu_supplier_paymentblock" value="1" <?=($address->fibu_supplier_paymentblock) ? "checked='checked'" : ""?> /> Zahlsperre akiviert</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
||||
@@ -39,10 +39,11 @@
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<a href="https://thetool.xinon.at/xfarm/" class="btn btn-primary" target="_blank"><i class="far fa-arrows-to-circle fa-fw"></i> AR-Merge / Fibu Konten Import</a>
|
||||
<a href="<?=self::getUrl("Address", "exportBmd")?>" class="ml-2 btn btn-outline-primary" onclick="if(!confirm('Wirklich inkrementellen BMD-Export starten?')) return false;"><i class="fas fa-down-from-dotted-line fa-fw"></i> Inkrementellen BMD-Export starten</a>
|
||||
<a href="#" class="ml-2 btn btn-outline-primary" onclick="startBmdExport(event, 'inc')"><i class="fas fa-down-from-dotted-line fa-fw"></i> Inkrementellen BMD-Export starten</a>
|
||||
<?php if($last_bmd_export): ?><small>Letzter Export: <?=date("d.m.Y H:i", $last_bmd_export)?></small><?php endif; ?>
|
||||
|
||||
<a href="<?=self::getUrl("Address", "exportBmd", ["type" => "full"])?>" class="btn btn-outline-danger float-right" onclick="if(!confirm('Wirklich vollständigen BMD-Export starten?')) return false;"><i class="fas fa-down-from-line fa-fw"></i> Vollen BMD-Export starten</a>
|
||||
<a href="#" class="btn btn-outline-danger float-right" onclick="startBmdExport(event, 'full')"><i class="fas fa-down-from-line fa-fw"></i> Vollen BMD-Export starten</a>
|
||||
<img src="img/ajax-loader.gif" class="float-right mr-2 hidden" id="bmd-export-loader" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -259,6 +260,30 @@
|
||||
|
||||
<script type="text/javascript">
|
||||
$("#filter_addresstype").select2({closeOnSelect: false});
|
||||
|
||||
function startBmdExport(e, type) {
|
||||
e.preventDefault();
|
||||
|
||||
if(type == "inc") {
|
||||
name = "inkrementellen";
|
||||
url = "<?=self::getUrl("Address", "exportBmd")?>";
|
||||
} else if(type == "full") {
|
||||
name = "VOLLSTÄNDIGEN";
|
||||
url = "<?=self::getUrl("Address", "exportBmd", ["type" => "full"])?>";
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
console.log(name);
|
||||
if(!confirm("Wirklich " + name + " BMD-Export starten?")) {
|
||||
return false;
|
||||
}
|
||||
|
||||
$('button, input').prop('disabled', true);
|
||||
$('a').removeAttr("href");
|
||||
$("#bmd-export-loader").show();
|
||||
window.location.href = url;
|
||||
return false;
|
||||
}
|
||||
</script>
|
||||
|
||||
<?php include(realpath(dirname(__FILE__)."/../../$mfLayoutPackage")."/footer.php"); ?>
|
||||
|
||||
@@ -123,14 +123,23 @@
|
||||
<th>Ist primäres Verrechnungskonto</th>
|
||||
<td><?=($address->fibu_primary_account) ? "<i class='fas fa-check text-success' title='Primäres Verrechnungskonto'></i>" : "<i class='fas fa-xmark text-danger'></i>"?></td>
|
||||
</tr><tr>
|
||||
<th>FIBU Verrechnungskonto</th>
|
||||
<th>Verrechnungskonto</th>
|
||||
<td><?=$address->fibu_account_number?></td>
|
||||
</tr><tr>
|
||||
<th>FIBU Lieferanten Konto</th>
|
||||
<th>Lieferantenkonto</th>
|
||||
<td><?=$address->fibu_supplier_number?></td>
|
||||
</tr><tr>
|
||||
<th>FIBU Lieferanten Zahlungsziel</th>
|
||||
<th>Zahlungsziel Lieferant</th>
|
||||
<td><?=$address->fibu_supplier_due?></td>
|
||||
</tr><tr>
|
||||
<th>Lieferant Skontotage</th>
|
||||
<td><?=$address->fibu_supplier_skonto?></td>
|
||||
</tr><tr>
|
||||
<th>Lieferant Skonto %</th>
|
||||
<td><?=$address->fibu_supplier_skonto_rate?></td>
|
||||
</tr><tr>
|
||||
<th>Lieferant Zahlsperre</th>
|
||||
<td><?=($address->fibu_supplier_paymentblock) ? "<i class='fas fa-xmark text-danger'></i> Automatische Zahlungen gesperrt" : "Nicht gesperrt"?></td>
|
||||
</tr><tr>
|
||||
<td colspan="2"><h4>Zusatzdaten</h4></td>
|
||||
</tr><tr>
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
Lieferant;Kunde;address_id;FIBU-Verrechnungsnummer;FIBU Lieferantennummer;Zahlungsziel Lieferant;Firma;Vorname;Nachname;Straße Hausnummer;PLZ;Ort;Land;Telefon;Mobil;Mail;UID;Verrechnungsart;Rechnungsversand;Kreditinstitut;Kontoinhaber;IBAN;BIC
|
||||
<?php
|
||||
$header = "FIBU Kontonummber;Zahlungsziel Lieferant;Skontotage;Skontoprozent;Zahlsperre;Vorname;Nachname;Straße Hausnummer;PLZ;Ort;Land;Telefon;Mail;UID;SEPA;Kontoinhaber;IBAN;BIC;customer_numbers\n";
|
||||
$this->setReturnValue(["header" => $header]);
|
||||
|
||||
foreach($addresses as $a):
|
||||
?>
|
||||
<?=$a["is_supplier"]?>;<?=$a["is_customer"]?>;<?=$a["id"]?>;<?=$a["fibu_account_number"]?>;<?=$a["fibu_supplier_number"]?>;<?=$a["fibu_supplier_due"]?>;<?=$this->nl2ws($a["company"])?>;<?=$this->nl2ws($a["firstname"])?>;<?=$this->nl2ws($a["lastname"])?>;<?=$this->nl2ws($a["street"])?>;<?=$this->nl2ws($a["$address->zip"])?>;<?=$this->nl2ws($a["city"])?>;<?=$this->nl2ws($a["country"])?>;<?=$this->nl2ws($a["phone"])?>;<?=$this->nl2ws($a["mobile"])?>;<?=$this->nl2ws($a["email"])?>;<?=$this->nl2ws($a["uid"])?>;<?=$a["billing_type"]?>;<?=$a["billing_delivery"]?>;<?=$a["bank"]?>;<?=$a["owner"]?>;<?=$a["iban"]?>;<?=$a["bic"]?>
|
||||
<?=$a["fibu_account_number"]?>;<?=$a["fibu_supplier_due"]?>;<?=$a["fibu_supplier_skonto"]?>;<?=$a["fibu_supplier_skonto_rate"]?>;<?=$a["fibu_supplier_paymentblock"]?>;<?=$this->nl2ws($a["firstname"])?>;<?=$this->nl2ws($a["lastname"])?>;<?=$this->nl2ws($a["street"])?>;<?=$this->nl2ws($a["zip"])?>;<?=$this->nl2ws($a["city"])?>;<?=$this->nl2ws($a["countrycode"])?>;<?=$this->nl2ws($a["phone"])?>;<?=$this->nl2ws($a["email"])?>;<?=$this->nl2ws($a["uid"])?>;<?=$a["billing_type"]?>;<?=$a["bank_owner"]?>;<?=$a["iban"]?>;<?=$a["bic"]?>;<?=implode(" ",$a["customer_numbers"])?>
|
||||
|
||||
<?php
|
||||
endforeach;
|
||||
|
||||
@@ -90,6 +90,17 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group row">
|
||||
<label class="col-lg-2 col-form-label" for="rimo_id">Rimo External ID</label>
|
||||
<div class="col-lg-10">
|
||||
<?php if(is_array($save_data) && array_key_exists("rimo_id", $save_data)): ?>
|
||||
<input type="text" class="form-control" name="rimo_id" id="rimo_id" value="<?=$save_data['rimo_id']?>" />
|
||||
<?php else: ?>
|
||||
<input type="text" class="form-control" name="rimo_id" id="rimo_id" value="<?=$address->rimo_id?>" />
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<hr />
|
||||
|
||||
<div class="form-group row">
|
||||
|
||||
@@ -144,7 +144,7 @@
|
||||
</div>
|
||||
<div class="float-right">
|
||||
<a class="btn btn-primary mb-2" href="<?=self::getUrl("AddressDB", "add")?>"><i class="fas fa-plus"></i> Neue Adresse anlegen</a>
|
||||
<a class="btn btn-outline-violett mb-2" href="#" onclick="return false;"><i class="fas fa-marker"></i> Bulk update</a>
|
||||
<!--a class="btn btn-outline-violett mb-2" href="#" onclick="return false;"><i class="fas fa-marker"></i> Bulk update</a-->
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
@@ -31,7 +31,7 @@
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-8">
|
||||
<div class="col-6">
|
||||
|
||||
<div class="card border-top-primary">
|
||||
<div class="card-body">
|
||||
@@ -47,6 +47,9 @@
|
||||
</tr><tr>
|
||||
<th>Extref</th>
|
||||
<td><?=$address->extref?></td>
|
||||
</tr><tr>
|
||||
<th>Rimo External ID</th>
|
||||
<td><?=$address->rimo_id?></td>
|
||||
</tr><tr>
|
||||
<th>Netzgebiet</th>
|
||||
<td><?=$address->netzgebiet->name?></td>
|
||||
@@ -104,7 +107,7 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-4">
|
||||
<div class="col-6">
|
||||
|
||||
<div class="card border-top-success pl-2 pr-2">
|
||||
<div class="card-header">
|
||||
@@ -113,6 +116,7 @@
|
||||
<?php if(is_array($address->wohneinheiten) && count($address->wohneinheiten)): ?>
|
||||
<table class="table table-sm table-striped table-hover">
|
||||
<tr>
|
||||
<th></th>
|
||||
<th>ID</th>
|
||||
<th>OAID</th>
|
||||
<th>Status</th>
|
||||
@@ -121,8 +125,17 @@
|
||||
</tr>
|
||||
<?php foreach($address->wohneinheiten as $unit): ?>
|
||||
<tr>
|
||||
<td><a href="<?=self::getUrl("ADBWohneinheit", "edit", ["id" => $unit->id])?>"><i class="fas fa-edit"></i></a></td>
|
||||
<td><?=$unit->id?></td>
|
||||
<td class="text-pink"><?=$unit->oaid?></td>
|
||||
<td class="text-pink">
|
||||
<?php if($unit->oaid): ?>
|
||||
<?php if(OpenAccessIdModel::getFirst(["oaid" => $unit->oaid])): ?>
|
||||
<a href="<?=self::getUrl("OpenAccessId", "", ["filter" => ["oaid" => $unit->oaid]])?>" class="text-pink" target="_blank"><?=$unit->oaid?></a>
|
||||
<?php else: ?>
|
||||
<?=$unit->oaid?>
|
||||
<?php endif; ?>
|
||||
<?php endif; ?>
|
||||
</td>
|
||||
<td class="text-monospace"><?=$unit->status->code?> - <?=$unit->status->name?></td>
|
||||
<td><?=((string)$unit) ? "<strong>".(string)$unit."</strong>" : ""?></td>
|
||||
<td><?=($unit->extref) ? "[".$unit->extref."]" : ""?></td>
|
||||
|
||||
@@ -66,28 +66,53 @@ $chartColors = [
|
||||
|
||||
<div class="card bg-light border-top-success">
|
||||
<div class="card-header pb-0">
|
||||
<h4 class="card-title">Akquise Statistiken <small>Momentan nur für Admins sichtbar <i class="far fa-smile text-success"></i></small></h4>
|
||||
<h4 class="card-title">Akquise Statistiken</h4>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="row mb-2">
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<label for="campaign_id">Kampagne:</label>
|
||||
<select name="campaign_id" id="campaign_id" class="form-control">
|
||||
<option value="0">Alle</option>
|
||||
<?php foreach($campaigns as $c): ?>
|
||||
<option value="<?=$c->id?>" <?=($c->id == $campaign_id) ? 'selected="selected"' : ""?>><?=$c->name?></option>
|
||||
<?php endforeach; ?>
|
||||
</select>
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
|
||||
<?php if($me->is("Admin")): ?>
|
||||
<h5 class="mt-3">Netzinhaber:</h5>
|
||||
<div class="row mb-2">
|
||||
<div class="col-3 pb-1">
|
||||
<a href="<?=self::getUrl("Dashboard")?>" class="form-control btn btn-rounded <?=(!$netowner_id) ? "btn-primary" : "btn-outline-primary"?>">Alle</a>
|
||||
</div>
|
||||
<?php foreach(AddressModel::search(["addresstype" => ["netowner"]]) as $netowner): ?>
|
||||
<div class="col-3 pb-1">
|
||||
<?php if($netowner_id == $netowner->id): ?>
|
||||
<a href="<?=self::getUrl("Dashboard")?>" class="form-control btn btn-rounded btn-primary"><?=$netowner->getCompanyOrName()?></a>
|
||||
<?php else: ?>
|
||||
<a href="<?=self::getUrl("Dashboard", "", ["netowner_id" => $netowner->id])?>" class="form-control btn btn-rounded btn-outline-primary"><?=$netowner->getCompanyOrName()?></a>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
<?php endforeach; ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
||||
<label for="campaign_id">Kampagne:</label>
|
||||
<select name="campaign_id" id="campaign_id" class="form-control">
|
||||
<option value="0">Alle</option>
|
||||
<?php foreach($campaigns as $c): ?>
|
||||
<option value="<?=$c->id?>" <?=($c->id == $campaign_id) ? 'selected="selected"' : ""?>><?=$c->name?></option>
|
||||
<?php endforeach; ?>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="row">
|
||||
<div class="col-xl-3 col-lg-6">
|
||||
<div class="card">
|
||||
<div class="card-body p-0 bg-danger">
|
||||
<div style="height: 128px;" class="p-3">
|
||||
<div class="float-right">
|
||||
<i class="mdi mdi-cart text-white widget-icon"></i>
|
||||
<i class="fad fa-shopping-cart text-white widget-icon font-24"></i>
|
||||
</div>
|
||||
<h5 class="text-white font-weight-normal mt-0">Bestellungen</h5>
|
||||
<h3 class="mt-2 text-white"><?=$count_orders?> / <?=$max_connections?></h3>
|
||||
@@ -97,13 +122,28 @@ $chartColors = [
|
||||
</div> <!-- end card-body-->
|
||||
</div> <!-- end card-->
|
||||
</div> <!-- end col-->
|
||||
|
||||
|
||||
<div class="col-xl-3 col-lg-6">
|
||||
<div class="card">
|
||||
<div class="card-body p-0 bg-success">
|
||||
<div style="height: 128px;" class="p-3">
|
||||
<div class="float-right">
|
||||
<i class="fas fa-check text-white widget-icon font-24"></i>
|
||||
</div>
|
||||
<h5 class="text-white font-weight-normal mt-0">Aktive Anschlüsse</h5>
|
||||
<h3 class="mt-2 text-white"><?=$status_connected?> / <?=$count_orders?></h3>
|
||||
</div>
|
||||
<canvas style="position: absolute; bottom:0;" height="60" id="sparkline4"></canvas>
|
||||
</div> <!-- end card-body-->
|
||||
</div> <!-- end card-->
|
||||
</div> <!-- end col-->
|
||||
|
||||
<div class="col-xl-3 col-lg-6">
|
||||
<div class="card">
|
||||
<div class="card-body p-0 bg-primary">
|
||||
<div style="height: 128px;" class="p-3">
|
||||
<div class="float-right">
|
||||
<i class="mdi mdi-cart text-white widget-icon"></i>
|
||||
<i class="fad fa-building text-white widget-icon font-24"></i>
|
||||
</div>
|
||||
<h5 class="text-white font-weight-normal mt-0">Status BEP Installed (244, SD)</h5>
|
||||
<h3 class="mt-2 text-white"><?=$status_connected_single?> / <?=$count_orders?></h3>
|
||||
@@ -118,7 +158,7 @@ $chartColors = [
|
||||
<div class="card-body p-0 bg-info">
|
||||
<div style="height: 128px;" class="p-3">
|
||||
<div class="float-right">
|
||||
<i class="mdi mdi-cart text-white widget-icon"></i>
|
||||
<i class="fad fa-buildings text-white widget-icon font-24"></i>
|
||||
</div>
|
||||
<h5 class="text-white font-weight-normal mt-0">Status OTO Installed (245, MD)</h5>
|
||||
<h3 class="mt-2 text-white"><?=$status_connected_multi?> / <?=$count_orders?></h3>
|
||||
@@ -128,20 +168,7 @@ $chartColors = [
|
||||
</div> <!-- end card-->
|
||||
</div> <!-- end col-->
|
||||
|
||||
<div class="col-xl-3 col-lg-6">
|
||||
<div class="card">
|
||||
<div class="card-body p-0 bg-warning">
|
||||
<div style="height: 128px;" class="p-3">
|
||||
<div class="float-right">
|
||||
<i class="mdi mdi-cart text-dark widget-icon"></i>
|
||||
</div>
|
||||
<h5 class="text-dark font-weight-normal mt-0">Aktive Anschlüsse</h5>
|
||||
<h3 class="mt-2 text-dark"><?=$status_connected?> / <?=$count_orders?></h3>
|
||||
</div>
|
||||
<canvas style="position: absolute; bottom:0;" height="60" id="sparkline4"></canvas>
|
||||
</div> <!-- end card-body-->
|
||||
</div> <!-- end card-->
|
||||
</div> <!-- end col-->
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
@@ -159,22 +186,76 @@ $chartColors = [
|
||||
</div>
|
||||
<div class="col-12 col-xl-6">
|
||||
<table>
|
||||
<?php $i=0; foreach($partner_orders as $provider => $count): ?>
|
||||
<?php $i=0; foreach($partner_orders as $partner => $count): ?>
|
||||
<tr style="border-bottom: 1px solid <?=$chartColors[$i]?>;">
|
||||
<td><span style="background-color: <?=$chartColors[$i]?>; color: <?=$chartColors[$i]?>">##</span></td>
|
||||
<td class="pl-2 pr-2" style="white-space: nowrap;"><?=round(($count / $total_orders) * 100, 1)?>% (<?=($count)?>)</td>
|
||||
<td title="<?=$provider?>" style="white-space: nowrap; overflow: hidden; text-overflow: ellipsis;"><?=$this->strtrim($provider,22)?></td>
|
||||
<td title="<?=$partner?>" style="white-space: nowrap; overflow: hidden; text-overflow: ellipsis;"><?=$this->strtrim($partner,22)?></td>
|
||||
</tr>
|
||||
<?php $i++; endforeach; ?>
|
||||
</table>
|
||||
</div>
|
||||
<?php else: ?>
|
||||
<i>Keine Aktiven Anschlüsse</i>
|
||||
<i>Keine Bestellungen</i>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-12 col-xl-6">
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<h4 class="card-title">Bestellstatus je Partner</h4>
|
||||
<hr />
|
||||
<div class="row">
|
||||
<?php if(count($partner_orders_by_status)): ?>
|
||||
<?php $i=0; foreach($partner_orders_by_status as $partner => $status): ?>
|
||||
<div class="col-lg-12">
|
||||
<div class="card">
|
||||
<div class="card-header no-decoration">
|
||||
<span class="card-title" title="<?=$partner?>"><?=$this->strtrim($partner, 200)?></span>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="row">
|
||||
<div class="col-12 col-xl-6">
|
||||
<canvas id="partner-status-<?=$i?>"></canvas>
|
||||
</div>
|
||||
<div class="col-12 col-xl-6">
|
||||
<table>
|
||||
<?php $j=0; foreach($status as $status_id => $count): ?>
|
||||
<?php if($status_id == "total") continue; ?>
|
||||
<tr style="border-bottom: 1px solid <?=$chartColors[$j]?>;">
|
||||
<td class="align-top"><span style="background-color: <?=$chartColors[$j]?>; color: <?=$chartColors[$j]?>">##</span></td>
|
||||
<td class="align-top pl-2 pr-2" style="white-space: nowrap;"><?=round(($count / $status['total']) * 100, 1)?>% (<?=($count)?>)</td>
|
||||
<td title="<?=$stati[$status_id]["code"]?> - <?=$stati[$status_id]["name"]?>">
|
||||
<?=$stati[$status_id]["code"]." - ".$stati[$status_id]["name"]?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php $j++; endforeach; ?>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php if($i % 2 != 0): ?>
|
||||
</div>
|
||||
<div class="row">
|
||||
<?php endif; ?>
|
||||
<?php $i++; endforeach; ?>
|
||||
<?php if($i % 2 == 0): ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
<?php else: ?>
|
||||
<i>Keine Bestellungen</i>
|
||||
<?php endif; ?>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
@@ -301,6 +382,56 @@ $chartColors = [
|
||||
|
||||
<?php endif; ?>
|
||||
|
||||
var status = [];
|
||||
<?php foreach(PreorderstatusModel::getAll() as $status):?>
|
||||
status[<?=$status->id?>] = {"code": "<?=$status->code?>", "name": "<?=$status->name?>"};
|
||||
<?php endforeach; ?>
|
||||
|
||||
|
||||
|
||||
var productCharts = [];
|
||||
|
||||
<?php $i=0; foreach($partner_orders_by_status as $partner => $status): ?>
|
||||
productCharts[<?=$i?>] = new Chart(document.getElementById('partner-status-<?=$i?>').getContext('2d'), {
|
||||
type: 'doughnut',
|
||||
data: {
|
||||
labels: [
|
||||
<?php foreach($status as $status_id => $count): ?>
|
||||
<?php if($status_id == "total") continue; ?>
|
||||
"<?=$stati[$status_id]['code']?> - <?=$stati[$status_id]['name']?> (<?=round($count / $status["total"] * 100, 1)?>%)",
|
||||
<?php endforeach; ?>
|
||||
|
||||
],
|
||||
datasets: [{
|
||||
data: [
|
||||
<?php foreach($status as $status_id => $count): ?>
|
||||
<?php if($status_id == "total") continue; ?>
|
||||
<?=$count?>,
|
||||
<?php endforeach; ?>
|
||||
],
|
||||
backgroundColor: [
|
||||
"<?=implode('","', $chartColors)?>"
|
||||
],
|
||||
/*borderColor: [
|
||||
"#d54369",
|
||||
"#4592e0"
|
||||
],*/
|
||||
borderWidth: 1
|
||||
|
||||
}]
|
||||
},
|
||||
options: {
|
||||
scales: {
|
||||
y: {
|
||||
beginAtZero: true
|
||||
}
|
||||
},
|
||||
legend: false
|
||||
|
||||
}
|
||||
});
|
||||
<?php $i++; endforeach; ?>
|
||||
|
||||
});
|
||||
|
||||
</script>
|
||||
|
||||
101
Layout/default/OpenAccessId/ChangeUnit.php
Normal file
101
Layout/default/OpenAccessId/ChangeUnit.php
Normal file
@@ -0,0 +1,101 @@
|
||||
|
||||
<?php include(realpath(dirname(__FILE__)."/../../$mfLayoutPackage")."/header.php"); ?>
|
||||
<!-- start page title -->
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div class="page-title-box">
|
||||
<div class="page-title-right">
|
||||
<ol class="breadcrumb m-0">
|
||||
<li class="breadcrumb-item"><a href="<?=self::getUrl("Dashboard")?>"><?=MFAPPNAME_SLUG?></a></li>
|
||||
<li class="breadcrumb-item"><a href="<?=self::getUrl("AddressDB")?>">Open Access ID</a></li>
|
||||
<li class="breadcrumb-item active"><?=($oaid->id) ? "bearbeiten" : "Neu" ?></li>
|
||||
</ol>
|
||||
</div>
|
||||
<h4 class="page-title">Wohneinheit</h4>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- end page title -->
|
||||
|
||||
<div class="row">
|
||||
<div class="col-lg-12">
|
||||
|
||||
<div class="card bg-light">
|
||||
<div class="card-body">
|
||||
<h4 class="header-title mb-2"><?=($oaid->id) ? "Wohneinheit bearbeiten" : "Neue Adresse"?></h4>
|
||||
|
||||
<form class="form-horizontal" method="post" action="<?=self::getUrl("OpenAccessId", "changeUnit")?>">
|
||||
<input type="hidden" name="id" value="<?=$oaid->id?>" />
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
|
||||
<div class="form-group row">
|
||||
<label class="col-lg-2 col-form-label">OAID</label>
|
||||
<div class="col-lg-10">
|
||||
<input type="text" class="form-control" value="<?=$oaid->oaid?>" disabled="disabled" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group row">
|
||||
<label class="col-lg-2 col-form-label">Bisheriger Anschnluss</label>
|
||||
<div class="col-lg-10">
|
||||
<?php if($oaid->adb_wohneinheit_id && is_object($oaid->adb_wohneinheit)): ?>
|
||||
<input type="text" class="form-control" disabled="disabled"
|
||||
value="[<?=$oaid->adb_wohneinheit->hausnummer->strasse->gemeinde->name?>] <?=$oaid->adb_wohneinheit->hausnummer->plz->plz?><?=$oaid->adb_wohneinheit->hausnummer->ortschaft->name?>, <?=$oaid->adb_wohneinheit->hausnummer->strasse->name?><?=$oaid->adb_wohneinheit->hausnummer->hausnummer?><?=((string)$oaid->adb_wohneinheit) ? " - ".(string)$oaid->adb_wohneinheit : ""?>"
|
||||
/>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group row">
|
||||
<label class="col-lg-2 col-form-label" for="new_unit_id">Neuer Anschluss</label>
|
||||
<div class="col-lg-10">
|
||||
<input type="text" class="form-control" id="new_unit_id" value="<?=$new_unit_id?>" />
|
||||
<small>Wohneinheit ID</small>
|
||||
<p id="new_unit_text" class="text-pink"></p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="form-group row">
|
||||
<label class="col-lg-2"></label>
|
||||
<div class="col-lg-10">
|
||||
<button type="submit" class="btn btn-primary">Speichern</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function() {
|
||||
$("#new_unit_id").change(function() {
|
||||
var id = $("#new_unit_id").val();
|
||||
if(!id) return;
|
||||
|
||||
$.post("<?=self::getUrl("AddressDB", "api")?>", {
|
||||
do: "getUnit",
|
||||
id: id
|
||||
},
|
||||
function(success) {
|
||||
if(success.status == "OK") {
|
||||
console.log(success.result.string);
|
||||
$("#new_unit_text").text(success.result.string);
|
||||
}
|
||||
},
|
||||
"json"
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
</script>
|
||||
|
||||
<?php include(realpath(dirname(__FILE__)."/../../$mfLayoutPackage")."/footer.php"); ?>
|
||||
@@ -35,8 +35,8 @@
|
||||
<label class="form-label" for="filter_origin">Herkunft</label>
|
||||
<select name="filter[origin]" id="filter_origin" class="form-control">
|
||||
<option value=""></option>
|
||||
<option value="ofaa" <?=($filter['origin'] == "ofaa") ? "selected='selected'" : ""?>>OFAA</option>
|
||||
<option value="thetool" <?=($filter['origin'] == "thetool") ? "selected='selected'" : ""?>>thetool</option>
|
||||
<option value="ofaa" <?=(array_key_exists("origin", $filter) && $filter['origin'] == "ofaa") ? "selected='selected'" : ""?>>OFAA</option>
|
||||
<option value="thetool" <?=(array_key_exists("origin", $filter) && $filter['origin'] == "thetool") ? "selected='selected'" : ""?>>thetool</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
@@ -84,7 +84,7 @@
|
||||
<div class="row mt-2">
|
||||
<div class="col">
|
||||
<button type="submit" class="btn btn-primary">Filter anwenden</button>
|
||||
<a class="btn btn-secondary" href="<?=self::getUrl("OpenAccessId")?>">Filter zurücksetzen</a>
|
||||
<a class="btn btn-secondary" href="<?=self::getUrl("OpenAccessId", "", ["resetFilter" => 1])?>">Filter zurücksetzen</a>
|
||||
</div>
|
||||
<!--<div class="col">
|
||||
<button class="btn btn-info" type="button" onclick="refreshMap()"><i class="far fa-map"></i> Auf Karte anzeigen</button>
|
||||
@@ -121,8 +121,7 @@
|
||||
<th>OAID Set</th>
|
||||
<th>Herkunft</th>
|
||||
<th>Besitzer</th>
|
||||
<th>Zugewiesen</th>
|
||||
<th></th>
|
||||
<th colspan="2" title="Anzahl ADB Wohneinheiten">Zugewiesen</th>
|
||||
<th>Exportiert</th>
|
||||
<th></th>
|
||||
|
||||
@@ -136,11 +135,15 @@
|
||||
<td><?=$oaid->origin_id?></td>
|
||||
<td><?=$oaid->origin?></td>
|
||||
<td><?=$oaid->owner->getCompanyOrName()?></td>
|
||||
<td class="text-right <?=($oaid->adb_wohneinheit_count > 1 || $oaid->adb_wohneinheit_id && $oaid->adb_wohneinheit_count < 1) ? "text-danger" : ""?>">
|
||||
<?=($oaid->adb_wohneinheit_id) ? $oaid->adb_wohneinheit_count."x" : ""?>
|
||||
</td>
|
||||
<td>
|
||||
<?php if($oaid->termination_id): ?>
|
||||
<?=(is_object($oaid->termination) && $oaid->termination->building_id) ? $oaid->termination->building->getAddress() : ""?>
|
||||
<?=($oaid->termination->name) ? " - ".$oaid->termination->name : ""?>
|
||||
<?php elseif($oaid->adb_wohneinheit_id && is_object($oaid->adb_wohneinheit)): ?>
|
||||
<!--a href="<?=self::getUrl("OpenAccessId", "changeADBWohneinheit", ["id" => $oaid->id])?>" class="mr-1"><i class="fas fa-edit"></i></a-->
|
||||
[<?=$oaid->adb_wohneinheit->hausnummer->strasse->gemeinde->name?>]
|
||||
<?=$oaid->adb_wohneinheit->hausnummer->plz->plz?>
|
||||
<?=$oaid->adb_wohneinheit->hausnummer->ortschaft->name?>,
|
||||
|
||||
@@ -312,6 +312,9 @@
|
||||
<tr>
|
||||
<th>Building Name:</th>
|
||||
<td class="text-monospace"><?=$preorder->adb_hausnummer->extref?>
|
||||
</tr><tr>
|
||||
<th>Building External ID:</th>
|
||||
<td class="text-monospace"><?=$preorder->adb_hausnummer->rimo_id?>
|
||||
</tr><tr>
|
||||
<th>Home External ID:</th>
|
||||
<td class="text-monospace"><?=$preorder->adb_wohneinheit->extref?>
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
<div class="page-title-right">
|
||||
<ol class="breadcrumb m-0">
|
||||
<li class="breadcrumb-item"><a href="<?=self::getUrl("Dashboard")?>"><?=MFAPPNAME_SLUG?></a></li>
|
||||
<li class="breadcrumb-item"><a href="<?=self::getUrl("Network")?>">Produktgruppen</a></li>
|
||||
<li class="breadcrumb-item"><a href="<?=self::getUrl("Productgroup")?>">Produktgruppen</a></li>
|
||||
<li class="breadcrumb-item active"><?=($group->id) ? "bearbeiten" : "Neu" ?></li>
|
||||
</ol>
|
||||
</div>
|
||||
@@ -48,6 +48,20 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group row">
|
||||
<label class="col-lg-2 col-form-label" for="matchcodeorigin">Contract Matchcode Herkunft</label>
|
||||
<div class="col-lg-10">
|
||||
<select class="form-control" name="matchcodeorigin">
|
||||
<option></option>
|
||||
<option value="terminationaddress" <?=($group->matchcodeorigin == "terminationaddress" ? "selected='selected'" : "")?>>Anschlussadresse</option>
|
||||
<option value="address" <?=($group->matchcodeorigin == "address" ? "selected='selected'" : "")?>>Kundenadresse</option>
|
||||
<option value="voicenumber" <?=($group->matchcodeorigin == "voicenumber" ? "selected='selected'" : "")?>>Voip Nummer</option>
|
||||
<option value="domain" <?=($group->matchcodeorigin == "domain" ? "selected='selected'" : "")?>>Domain</option>
|
||||
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
@@ -50,7 +50,7 @@
|
||||
<select name="address_id" id="address_id" class="form-control">
|
||||
<option value=""></option>
|
||||
<?php foreach($addresses as $address): ?>
|
||||
<option value="<?=$address->id?>" <?=($address->id == $user->address_id || $address->id == $user->address_id) ? "selected='selected'" : ""?>><?=($address->company) ? $address->company : $address->getFullName()?></option>
|
||||
<option value="<?=$address->id?>" <?=($address->id == $user->address_id || $address->id == $user->address_id) ? "selected='selected'" : ""?>><?=($address->company) ? $address->company : $address->getFullName()?><?=($address->customer_number) ? " (".$address->customer_number.")" : ""?></option>
|
||||
<?php endforeach; ?>
|
||||
</select>
|
||||
</div>
|
||||
@@ -219,6 +219,13 @@
|
||||
<label for="can_fibu" class="form-check-label">Buchhaltung</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-4">
|
||||
<div class="form-group form-check">
|
||||
<input type="checkbox" class="form-check-input" name="can[Statistics]" id="can_statistics" value="1" <?=($user && $user->can("Statistics")) ? "checked='checked'" : ""?> />
|
||||
<label for="can_statistics" class="form-check-label">Statistiken anzeigen</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<hr />
|
||||
@@ -248,9 +255,9 @@
|
||||
<form method="post" action="<?=self::getUrl("User", "generateApikey")?>">
|
||||
<input type="hidden" name="id" value="<?=$user->id?>" />
|
||||
<?php if($user->apikey): ?>
|
||||
<button type="submit" class="btn btn-primary" onclick="if(!confirm('Achtung: Dadurch wird der bisherige API Key ungültig. Wirklich neuen API Key generieren?')) return false;">Neuen API Key generieren</button>
|
||||
<button type="submit" class="btn btn-outline-primary" onclick="if(!confirm('Achtung: Dadurch wird der bisherige API Key ungültig. Wirklich neuen API Key generieren?')) return false;">Neuen API Key generieren</button>
|
||||
<?php else: ?>
|
||||
<button type="submit" class="btn btn-primary">API Key generieren</button>
|
||||
<button type="submit" class="btn btn-outline-primary">API Key generieren</button>
|
||||
<?php endif; ?>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
@@ -9,17 +9,17 @@
|
||||
<link rel="shortcut icon" href="<?=self::getResourcePath()?>assets/images/favicon.ico">
|
||||
|
||||
<!-- App css -->
|
||||
<link href="<?=self::getResourcePath()?>fontawesome/css/all.min.css?<?=date('U')?>" rel="stylesheet" type="text/css" />
|
||||
<link href="<?=self::getResourcePath()?>assets/css/bootstrap.min.css?<?=date('U')?>" rel="stylesheet" type="text/css" />
|
||||
<link href="<?=self::getResourcePath()?>fontawesome/css/all.min.css?<?=$git_merge_ts?>" rel="stylesheet" type="text/css" />
|
||||
<link href="<?=self::getResourcePath()?>assets/css/bootstrap.min.css?<?=$git_merge_ts?>" rel="stylesheet" type="text/css" />
|
||||
<link href="<?=self::getResourcePath()?>assets/css/icons.css" rel="stylesheet" type="text/css" />
|
||||
<link href="<?=self::getResourcePath()?>assets/css/app.css?<?=date('U')?>" rel="stylesheet" type="text/css" />
|
||||
<link href="<?=self::getResourcePath()?>assets/css/app.css?<?=$git_merge_ts?>" rel="stylesheet" type="text/css" />
|
||||
<link href="<?=self::getResourcePath()?>assets/css/leaflet.css" rel="stylesheet" type="text/css" />
|
||||
<link href="<?=self::getResourcePath()?>assets/css/thetool.css?<?=date('U')?>" rel="stylesheet" type="text/css" />
|
||||
<link href="<?=self::getResourcePath()?>assets/css/thetool.css?<?=$git_merge_ts?>" rel="stylesheet" type="text/css" />
|
||||
<link href="<?=self::getResourcePath()?>assets/libs/select2/select2.min.css" rel="stylesheet" type="text/css" />
|
||||
<link href="<?=self::getResourcePath()?>assets/css/bootstrap-select.min.css" rel="stylesheet" type="text/css" />
|
||||
<link href="<?=self::getResourcePath()?>css/bootstrap-datepicker3.min.css" rel="stylesheet" type="text/css" />
|
||||
<link href="<?=self::getResourcePath()?>plugins/summernote/summernote-bs4.css" rel="stylesheet" type="text/css" />
|
||||
<link href="<?=self::getResourcePath()?>datatables/datatables.min.css" rel="stylesheet" type="text/css" />
|
||||
<link href="<?=self::getResourcePath()?>datatables/datatables.min.css?<?=$git_merge_ts?>" rel="stylesheet" type="text/css" />
|
||||
|
||||
<?php if(isset($additionalCSS) && is_array($additionalCSS) && count($additionalCSS)): ?>
|
||||
<?php foreach($additionalCSS as $css): ?>
|
||||
@@ -38,7 +38,7 @@
|
||||
<script type="text/javascript" src="<?=self::getResourcePath()?>js/bootstrap.min.js"></script>
|
||||
<script type="text/javascript" src="<?=self::getResourcePath()?>assets/js/bootstrap-select.min.js"></script>
|
||||
<script type="text/javascript" src="<?=self::getResourcePath()?>js/bootstrap-autocomplete.min.js"></script>
|
||||
<script type="text/javascript" src="<?=self::getResourcePath()?>datatables/datatables.min.js"></script>
|
||||
<script type="text/javascript" src="<?=self::getResourcePath()?>datatables/datatables.min.js?<?=$git_merge_ts?>"></script>
|
||||
|
||||
<?php if(isset($additionalJS) && is_array($additionalJS) && count($additionalJS)): ?>
|
||||
<?php foreach($additionalJS as $js): ?>
|
||||
|
||||
@@ -2,4 +2,104 @@
|
||||
|
||||
class ADBWohneinheitController extends mfBaseController {
|
||||
|
||||
protected function init() {
|
||||
$this->needlogin=true;
|
||||
$me = new User();
|
||||
$me->loadMe();
|
||||
$this->me = $me;
|
||||
$this->layout()->set("me",$me);
|
||||
|
||||
if(!$me->is(["Admin", "netowner"]) && !$me->can("Preorder")) {
|
||||
$this->redirect("Dashboard");
|
||||
}
|
||||
}
|
||||
|
||||
protected function addAction() {
|
||||
$this->layout()->setTemplate("ADBWohneinheit/Form");
|
||||
|
||||
if($this->me->is("Admin")) {
|
||||
$my_networks = NetworkModel::getAll();
|
||||
} else {
|
||||
$my_networks = $this->me->myNetworks(["netowner", "salespartner"]);
|
||||
}
|
||||
|
||||
$netzgebiet_ids = [];
|
||||
$my_adb_networks = [];
|
||||
foreach($my_networks as $network) {
|
||||
if($network->adb_netzgebiet_id && !in_array($network->adb_netzgebiet_id, $netzgebiet_ids)) {
|
||||
$netzgebiet_ids[] = $network->adb_netzgebiet_id;
|
||||
$my_adb_networks[$network->adb_netzgebiet_id] = new ADBNetzgebiet($network->adb_netzgebiet_id);
|
||||
}
|
||||
}
|
||||
$this->layout()->set("my_adb_networks", $my_adb_networks);
|
||||
|
||||
}
|
||||
|
||||
protected function editAction() {
|
||||
$id = $this->request->id;
|
||||
if(!is_numeric($id) || $id < 1) {
|
||||
$this->layout()->setFlash("Adresse nicht gefunden", "error");
|
||||
$this->redirect("AddressDB");
|
||||
}
|
||||
|
||||
$unit = new ADBWohneinheit($id);
|
||||
if(!$unit->id) {
|
||||
$this->layout()->setFlash("Wohneinheit nicht gefunden", "error");
|
||||
$this->redirect("AddressDB");
|
||||
}
|
||||
|
||||
/*if(!in_array($hausnummer->netzgebiet_id, $my_adb_networks)) {
|
||||
$this->layout()->setFlash("Adresse nicht gefunden", "error");
|
||||
$this->redirect("AddressDB");
|
||||
}*/
|
||||
|
||||
$this->layout()->set("unit", $unit);
|
||||
|
||||
return $this->addAction();
|
||||
}
|
||||
|
||||
protected function saveAction() {
|
||||
$r = $this->request;
|
||||
$id = $r->id;
|
||||
//var_dump($r->get());exit;
|
||||
|
||||
$unit_data = [];
|
||||
|
||||
if(is_numeric($id) && $id > 0) {
|
||||
$mode = "edit";
|
||||
$unit = new ADBWohneinheit($id);
|
||||
if(!$unit->id) {
|
||||
$this->layout()->setFlash("Wohneinheit nicht gefunden", "error");
|
||||
$this->redirect("AddressDB");
|
||||
}
|
||||
} else {
|
||||
$mode = "add";
|
||||
}
|
||||
|
||||
|
||||
//$unit_data["oaid"] = ($r->oaid) ? trim($r->oaid) : null;
|
||||
$unit_data["extref"] = ($r->extref) ? trim($r->extref) : null;
|
||||
$unit_data["block"] = ($r->block) ? trim($r->block) : null;
|
||||
$unit_data["stiege"] = ($r->stiege) ? trim($r->stiege) : null;
|
||||
$unit_data["stock"] = ($r->stock) ? trim($r->stock) : null;
|
||||
$unit_data["tuer"] = ($r->tuer) ? trim($r->tuer) : null;
|
||||
$unit_data["zusatz"] = ($r->zusatz) ? trim($r->zusatz) : null;
|
||||
$unit_data["bezeichner"] = ($r->bezeichner) ? trim($r->bezeichner) : null;
|
||||
|
||||
if($mode == "add") {
|
||||
$unit = ADBWohneinheitModel::create($unit_data);
|
||||
} else {
|
||||
$unit->update($unit_data);
|
||||
}
|
||||
|
||||
if(!$unit->save()) {
|
||||
$this->layout()->setFlash("Beim Speichern der Wohneinheit ist ein Fehler aufgetreten.", "error");
|
||||
$this->layout()->set("unit", $unit);
|
||||
return $this->addAction();
|
||||
}
|
||||
|
||||
$this->layout()->setFlash("Wohneinheit erfolgreich gespeichert.", "success");
|
||||
$this->redirect("AddressDB", "view", ["id" => $unit->hausnummer_id]);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,6 +1,8 @@
|
||||
<?php
|
||||
|
||||
class ADBWohneinheitModel {
|
||||
public $status_id;
|
||||
public $oaid;
|
||||
public $extref;
|
||||
public $hausnummer_id;
|
||||
public $num;
|
||||
@@ -15,7 +17,9 @@ class ADBWohneinheitModel {
|
||||
public $patch_shelf;
|
||||
public $patch_module;
|
||||
public $patch_port;
|
||||
public $external_data;
|
||||
|
||||
public $note;
|
||||
public $create_by = null;
|
||||
public $edit_by = null;
|
||||
public $create = null;
|
||||
|
||||
@@ -69,11 +69,21 @@ class Address extends mfBaseModel {
|
||||
$me->loadMe();
|
||||
|
||||
if($this->fibu_account_number) {
|
||||
$fibumerge = XinonFibuMergeModel::getFirst(["old_custnum" => $this->customer_number]);
|
||||
$old_custnum = $this->customer_number;
|
||||
if($old_custnum > 900000) {
|
||||
$old_custnum -= 900000;
|
||||
}
|
||||
|
||||
$name_search = [];
|
||||
if($this->company) $name_search[] = $this->company;
|
||||
if($this->lastname) $name_search[] = $this->lastname;
|
||||
|
||||
$fibumerge = XinonFibuMergeModel::getFirst(["old_custnum" => $old_custnum, "name" => $name_search]);
|
||||
if(!$fibumerge) {
|
||||
// create fibu merge
|
||||
$fibumerge = XinonFibuMergeModel::create([
|
||||
"old_custnum" => $this->customer_number,
|
||||
"source" => "t",
|
||||
"old_custnum" => $old_custnum,
|
||||
"new_custnum" => $this->fibu_account_number,
|
||||
"name" => ($this->company) ? $this->company : $this->lastname,
|
||||
"vorname" => ($this->company) ? "" : $this->firstname,
|
||||
@@ -86,7 +96,7 @@ class Address extends mfBaseModel {
|
||||
$fibumerge->save();
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
if($fibumerge->new_custnum != $this->fibu_account_number) {
|
||||
$fibumerge->new_custnum = $this->fibu_account_number;
|
||||
$fibumerge->save();
|
||||
|
||||
@@ -192,17 +192,22 @@ class AddressController extends mfBaseController {
|
||||
$last_export = $export_ts->value();
|
||||
}
|
||||
|
||||
$type = "inc";
|
||||
if(!file_exists(TT_ADDRESS_BMD_EXPORT_PATH)) {
|
||||
$this->layout()->setFlash("Export Pfad (".TT_ADDRESS_BMD_EXPORT_PATH.") nicht gefunden!", "error");
|
||||
}
|
||||
$filepath = TT_ADDRESS_BMD_EXPORT_PATH."/".TT_ADDRESS_BMD_EXPORT_FILENAME;
|
||||
|
||||
$type = "inc";
|
||||
if($this->request->type == "full") {
|
||||
$last_export = 0;
|
||||
$type = "full";
|
||||
}
|
||||
|
||||
if(!file_exists(TT_ADDRESS_BMD_EXPORT_PATH)) {
|
||||
$this->layout()->setFlash("Export Pfad (".TT_ADDRESS_BMD_EXPORT_PATH.") nicht gefunden!", "error");
|
||||
// delete export file if export if full
|
||||
if($last_export == 0 && file_exists($filepath)) {
|
||||
unlink($filepath);
|
||||
}
|
||||
|
||||
|
||||
$export_ts->value(date('U'));
|
||||
|
||||
$search = ["edit>" => $last_export, "customer_or_fibu_numbers" => true];
|
||||
@@ -215,7 +220,11 @@ class AddressController extends mfBaseController {
|
||||
$addresses = [];
|
||||
|
||||
foreach(AddressModel::search($search) as $address) {
|
||||
|
||||
// if supplier -> add it as extra line
|
||||
if($address->fibu_supplier_number) {
|
||||
$addresses[$address->fibu_supplier_number] = $address;
|
||||
if(!$address->fibu_account_number) continue;
|
||||
}
|
||||
|
||||
// if is primary -> use it
|
||||
if($address->fibu_account_number && $address->fibu_primary_account) {
|
||||
@@ -271,53 +280,116 @@ class AddressController extends mfBaseController {
|
||||
continue;
|
||||
}
|
||||
|
||||
// if supplier -> use it
|
||||
if($address->fibu_supplier_number) {
|
||||
$addresses[$address->fibu_supplier_number] = $address;
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
$country_code_errors = [];
|
||||
$export_addresses = [];
|
||||
|
||||
foreach($addresses as $address) {
|
||||
foreach($addresses as $fibu_num => $address) {
|
||||
$a = [];
|
||||
$a["id"] = $address->id;
|
||||
$a["is_supplier"] = (array_key_exists("supplier", $address->types) && $address->types['supplier']) ? "1" : "0";
|
||||
$a["is_customer"] = "1";
|
||||
$a["customer_number"] = $address->customer_number;
|
||||
$a["fibu_account_number"] = $address->fibu_account_number;
|
||||
$a["fibu_supplier_number"] = $address->fibu_supplier_number;
|
||||
$a["fibu_supplier_due"] = (is_numeric($address->fibu_supplier_due)) ? $address->fibu_supplier_due : TT_ADDRESS_DEFAULT_SUPPLIER_DUE;
|
||||
$a["company"] = $address->company;
|
||||
$a["firstname"] = $address->firstname;
|
||||
$a["lastname"] = $address->lastname;
|
||||
//$a["is_supplier"] = (array_key_exists("supplier", $address->types) && $address->types['supplier']) ? "1" : "0";
|
||||
//$a["is_customer"] = "1";
|
||||
//$a["customer_number"] = $address->customer_number;
|
||||
$a["fibu_account_number"] = $fibu_num;
|
||||
//$a["fibu_supplier_number"] = $address->fibu_supplier_number;
|
||||
if($fibu_num >= 300000 && $fibu_num < 400000) {
|
||||
$a["fibu_supplier_due"] = (is_numeric($address->fibu_supplier_due)) ? $address->fibu_supplier_due : TT_ADDRESS_DEFAULT_SUPPLIER_DUE;
|
||||
$a["fibu_supplier_skonto"] = $address->fibu_supplier_skonto;
|
||||
$a["fibu_supplier_skonto_rate"] = $address->fibu_supplier_skonto_rate;
|
||||
$a["fibu_supplier_paymentblock"] = $address->fibu_supplier_paymentblock;
|
||||
} else {
|
||||
$a["fibu_supplier_due"] = "";
|
||||
$a["fibu_supplier_skonto"] = "";
|
||||
$a["fibu_supplier_skonto_rate"] = "";
|
||||
$a["fibu_supplier_paymentblock"] = "";
|
||||
}
|
||||
$a["street"] = $address->street;
|
||||
$a["zip"] = $address->zip;
|
||||
$a["city"] = $address->city;
|
||||
$a["country"] = $address->country;
|
||||
$a["phone"] = $address->phone;
|
||||
$a["mobile"] = $address->mobile;
|
||||
$a["email"] = $address->email;
|
||||
if(strlen($address->country) == 2) {
|
||||
$a["countrycode"] = trim($address->country);
|
||||
} else {
|
||||
$a["countrycode"] = "AT";
|
||||
|
||||
if(trim($address->country)) {
|
||||
$acountry = strtolower(trim($address->country));
|
||||
$cc = __($acountry, "cc");
|
||||
|
||||
$this->log->debug("is $cc == cc.$acountry");
|
||||
$this->log->debug("last translation failed: ".(__last_translation_failed() ? "true" : "false"));
|
||||
|
||||
if(__last_translation_failed()) {
|
||||
//if($cc == "cc.".$acountry) {
|
||||
$a["countrycode"] = "AT";
|
||||
// email to buchhaltung
|
||||
$country_code_errors[$fibu_num] = $address;
|
||||
} else {
|
||||
$a["countrycode"] = $cc;
|
||||
}
|
||||
}
|
||||
}
|
||||
$a["phone"] = "";
|
||||
if($address->mobile) $a["phone"] = $address->mobile;
|
||||
if($address->phone) $a["phone"] = $address->phone;
|
||||
$a["uid"] = $address->uid;
|
||||
$a["billing_type"] = $address->billing_type;
|
||||
$a["billing_delivery"] = $address->billing_delivery;
|
||||
if(array_key_exists("billing", $address->links) && $address->links["billing"]) {
|
||||
$a["bank"] = $address->links["billing"]->bank_account_bank;
|
||||
$a["bank_owner"] = $address->links["billing"]->bank_account_owner;
|
||||
$a["iban"] = $address->links["billing"]->bank_account_iban;
|
||||
$a["bic"] = $address->links["billing"]->bank_account_bic;
|
||||
$a["billing_type"] = ($address->billing_type == "sepa") ? "1" : "0";
|
||||
//$a["billing_delivery"] = $address->billing_delivery;
|
||||
|
||||
if($address->company) {
|
||||
$a["firstname"] = "";
|
||||
$a["lastname"] = $address->company;
|
||||
} else {
|
||||
$a["firstname"] = $address->firstname;
|
||||
$a["lastname"] = $address->lastname;
|
||||
}
|
||||
|
||||
if(array_key_exists("billing", $address->links) && $address->links["billing"][0] && $address->links["billing"][0]->address_id) {
|
||||
//var_dump($address->links);exit;
|
||||
$bill = $address->links["billing"][0]->address;
|
||||
$a["bank"] = $bill->bank_account_bank;
|
||||
$a["bank_owner"] = $bill->bank_account_owner;
|
||||
$a["iban"] = $bill->bank_account_iban;
|
||||
$a["bic"] = $bill->bank_account_bic;
|
||||
$a["email"] = $bill->email;
|
||||
} else {
|
||||
$a["bank"] = $address->bank_account_bank;
|
||||
$a["bank_owner"] = $address->bank_account_owner;
|
||||
$a["iban"] = $address->bank_account_iban;
|
||||
$a["bic"] = $address->bank_account_bic;
|
||||
$a["email"] = $address->email;
|
||||
}
|
||||
|
||||
$a["customer_numbers"] = [];
|
||||
$a["customer_numbers"][] = $address->customer_number;
|
||||
|
||||
// add all customer numbers to customer_numbers
|
||||
if($address->fibu_account_number) {
|
||||
foreach(AddressModel::search(["fibu_account_number" => $address->fibu_account_number]) as $secondary) {
|
||||
if($secondary->customer_number && !in_array($secondary->customer_number, $a["customer_numbers"])) {
|
||||
$a["customer_numbers"][] = $secondary->customer_number;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$export_addresses[] = $a;
|
||||
}
|
||||
|
||||
if(count($country_code_errors)) {
|
||||
$msg = "Hallo,\r\n\r\ndas in thetool eingetragene Land von folgenden Kunden/Lieferanten konnte nicht in einen ISO-Code übersetzt werden:\r\n\r\n";
|
||||
foreach($country_code_errors as $fibu_num => $address) {
|
||||
$msg .= "$fibu_num (".$address->getCompanyOrName()."): ".$address->country."\r\n";
|
||||
}
|
||||
|
||||
$email = new Emailnotification();
|
||||
$email->setFrom(TT_OUTGOING_EMAIL, "thetool");
|
||||
$email->setTo(TT_FIBU_EMAIL_TO);
|
||||
$email->setSubject("[BMD-Export] Fehlerhaftes Land");
|
||||
$email->setBody($msg);
|
||||
$email->send();
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -325,13 +397,20 @@ class AddressController extends mfBaseController {
|
||||
$tpl->setTemplate("Address/bmd_export.csv");
|
||||
$tpl->set("addresses", $export_addresses);
|
||||
$csv_content = $tpl->render();
|
||||
$return_values = $tpl->getReturnedValue();
|
||||
$csv_header = $return_values['header'];
|
||||
|
||||
$filename = "thetool_address_export_".$type."_".date("Y-m-d-H-i-s").".csv";
|
||||
|
||||
// save to TT_ADDRESS_BMD_EXPORT_PATH
|
||||
$filepath = TT_ADDRESS_BMD_EXPORT_PATH."/".$filename;
|
||||
|
||||
if(!file_put_contents($filepath, $csv_content)) {
|
||||
if(file_exists($filepath)) {
|
||||
// if file exists, append new content
|
||||
$result = file_put_contents($filepath, $csv_content, FILE_APPEND);
|
||||
} else {
|
||||
// else, add content with csv header
|
||||
$result = file_put_contents($filepath, $csv_header.$csv_content);
|
||||
}
|
||||
|
||||
if($result === false) {
|
||||
$this->layout()->setFlash("Datei $filepath konnte nicht gespeichert werden!", "error");
|
||||
} else {
|
||||
$export_ts->save();
|
||||
@@ -362,29 +441,38 @@ class AddressController extends mfBaseController {
|
||||
|
||||
$data = [];
|
||||
$data['parent_id'] = (!$r->parent_id) ? null : $r->parent_id;
|
||||
$data['company'] = $r->company;
|
||||
$data['firstname'] = $r->firstname;
|
||||
$data['lastname'] = $r->lastname;
|
||||
$data['street'] = $r->street;
|
||||
$data['zip'] = $r->zip;
|
||||
$data['city'] = $r->city;
|
||||
$data['country'] = $r->country;
|
||||
$data['phone'] = $r->phone;
|
||||
$data['fax'] = $r->fax;
|
||||
$data['mobile'] = $r->mobile;
|
||||
$data['email'] = $r->email;
|
||||
$data['note'] = $r->note;
|
||||
$data['uid'] = $r->uid;
|
||||
$data['company'] = trim($r->company);
|
||||
$data['firstname'] = trim($r->firstname);
|
||||
$data['lastname'] = trim($r->lastname);
|
||||
$data['street'] = trim($r->street);
|
||||
$data['zip'] = trim($r->zip);
|
||||
$data['city'] = trim($r->city);
|
||||
$data['country'] = trim($r->country);
|
||||
$data['phone'] = trim($r->phone);
|
||||
$data['fax'] = trim($r->fax);
|
||||
$data['mobile'] = trim($r->mobile);
|
||||
$data['email'] = trim($r->email);
|
||||
$data['note'] = trim($r->note);
|
||||
$data['uid'] = trim($r->uid);
|
||||
|
||||
if($this->me->can("Fibu")) {
|
||||
$data['fibu_account_number'] = ($r->fibu_account_number) ? $r->fibu_account_number : null;
|
||||
$data['fibu_supplier_number'] = ($r->fibu_supplier_number) ? $r->fibu_supplier_number : null;
|
||||
$data['fibu_account_number'] = ($r->fibu_account_number) ? trim($r->fibu_account_number) : null;
|
||||
$data['fibu_supplier_number'] = ($r->fibu_supplier_number) ? trim($r->fibu_supplier_number) : null;
|
||||
if($r->fibu_primary_account) {
|
||||
$data['fibu_primary_account'] = 1;
|
||||
} else {
|
||||
$data['fibu_primary_account'] = 0;
|
||||
}
|
||||
$data['fibu_supplier_due'] = ($r->fibu_supplier_due) ? $r->fibu_supplier_due : null;
|
||||
|
||||
if($r->fibu_supplier_paymentblock) {
|
||||
$data['fibu_supplier_paymentblock'] = 1;
|
||||
} else {
|
||||
$data['fibu_supplier_paymentblock'] = 0;
|
||||
}
|
||||
|
||||
$data['fibu_supplier_due'] = ($r->fibu_supplier_due) ? trim($r->fibu_supplier_due) : null;
|
||||
$data['fibu_supplier_skonto'] = ($r->fibu_supplier_skonto) ? trim($r->fibu_supplier_skonto) : null;
|
||||
$data['fibu_supplier_skonto_rate'] = ($r->fibu_supplier_skonto_rate) ? trim($r->fibu_supplier_skonto_rate) : null;
|
||||
}
|
||||
|
||||
|
||||
@@ -419,10 +507,10 @@ class AddressController extends mfBaseController {
|
||||
}
|
||||
|
||||
|
||||
$data['bank_account_bank'] = $r->bank_account_bank;
|
||||
$data['bank_account_owner'] = $r->bank_account_owner;
|
||||
$data['bank_account_iban'] = $r->bank_account_iban;
|
||||
$data['bank_account_bic'] = $r->bank_account_bic;
|
||||
$data['bank_account_bank'] = trim($r->bank_account_bank);
|
||||
$data['bank_account_owner'] = trim($r->bank_account_owner);
|
||||
$data['bank_account_iban'] = trim($r->bank_account_iban);
|
||||
$data['bank_account_bic'] = trim($r->bank_account_bic);
|
||||
$data['allow_contact'] = ($r->allow_contact) ? 1 : 0;
|
||||
$data['allow_spin'] = ($r->allow_spin) ? 1 : 0;
|
||||
|
||||
|
||||
@@ -5,6 +5,9 @@ class AddressModel {
|
||||
public $customer_number;
|
||||
public $fibu_account_number;
|
||||
public $fibu_supplier_number;
|
||||
public $fibu_supplier_due;
|
||||
public $fibu_supplier_skonto;
|
||||
public $fibu_supplier_skonto_rate;
|
||||
public $fibu_primary_account;
|
||||
public $spin;
|
||||
public $company;
|
||||
|
||||
@@ -234,6 +234,7 @@ class AddressDB {
|
||||
//$hausnummer_data['oaid'] = (array_key_exists("oaid", $data) && $data['oaid']) ? $data['oaid'] : null;
|
||||
$hausnummer_data['adrcd'] = ($data['adrcd']) ? $data['adrcd'] : null;
|
||||
$hausnummer_data['extref'] = ($data['extref']) ? $data['extref'] : null;
|
||||
$hausnummer_data['rimo_id'] = ($data['rimo_id']) ? $data['rimo_id'] : null;
|
||||
$hausnummer_data['netzgebiet_id'] = $netzgebiet_id;
|
||||
$hausnummer_data['ortschaft_id'] = $ortschaft->id;
|
||||
$hausnummer_data['plz_id'] = $plz->id;
|
||||
|
||||
@@ -270,7 +270,7 @@ class AddressDBController extends mfBaseController {
|
||||
if(!$this->me->is("Admin")) {
|
||||
$required[] = "netzgebiet_id";
|
||||
}
|
||||
foreach(['adrcd','extref','netzgebiet_id','strasse','hausnummer','plz','ortschaft','gemeinde','grund_nr','gdaeigenschaft','meridian','rw','hw','gps_lat','gps_long','unit_count'] as $field) {
|
||||
foreach(['adrcd','extref','rimo_id','netzgebiet_id','strasse','hausnummer','plz','ortschaft','gemeinde','grund_nr','gdaeigenschaft','meridian','rw','hw','gps_lat','gps_long','unit_count'] as $field) {
|
||||
if(in_array($field, $required)) {
|
||||
if(!trim($r->$field)) {
|
||||
$this->layout()->setFlash("'".ucfirst($field)."' darf nicht leer sein!", "error");
|
||||
@@ -370,7 +370,9 @@ class AddressDBController extends mfBaseController {
|
||||
$this->layout()->setFlash("Fehler beim Erstellen einer Wohneinheit!", "warning");
|
||||
return $this->addAction();
|
||||
}
|
||||
$wohneinheit->oaid = $wohneinheit->getNewOAID();
|
||||
if($hausnummer->netzgebiet->unit_create_oaid) {
|
||||
$wohneinheit->oaid = $wohneinheit->getNewOAID();
|
||||
}
|
||||
$wohneinheit->save();
|
||||
$w++;
|
||||
}
|
||||
@@ -472,6 +474,9 @@ class AddressDBController extends mfBaseController {
|
||||
case 'findBuildings':
|
||||
$return = $this->findBuildingsApi();
|
||||
break;
|
||||
case 'getUnit':
|
||||
$return = $this->getUnitApi();
|
||||
break;
|
||||
case "findUnit":
|
||||
break;
|
||||
default:
|
||||
@@ -487,6 +492,18 @@ class AddressDBController extends mfBaseController {
|
||||
$this->returnJson($data);
|
||||
}
|
||||
|
||||
private function getUnitApi() {
|
||||
$id = $this->request->id;
|
||||
if(!$id) return false;
|
||||
|
||||
$unit = new ADBWohneinheit($id);
|
||||
if(!$unit->id) return false;
|
||||
|
||||
$return = $unit->hausnummer->getAddress();
|
||||
if((string)$unit) $return .= " ".(string)$unit;
|
||||
return["string" => $return];
|
||||
}
|
||||
|
||||
private function findAddressApi() {
|
||||
$addresses = [];
|
||||
$search = trim($this->request->q);
|
||||
|
||||
@@ -23,8 +23,7 @@ class DashboardController extends mfBaseController {
|
||||
$newss = NewsModel::getAll();
|
||||
$this->layout()->set("newss", $newss);
|
||||
|
||||
//if($this->me->is(["Admin", "netowner", "salespartner"]) || $this->me->can("Preorder")) {
|
||||
if($this->me->is("Admin")) {
|
||||
if($this->me->can("Statistics") && $this->me->is(["Admin", "netowner", "salespartner"])) {
|
||||
return $this->dashboardAction();
|
||||
}
|
||||
|
||||
@@ -40,52 +39,63 @@ class DashboardController extends mfBaseController {
|
||||
$campaign_ids = [$campaign_ids];
|
||||
}
|
||||
|
||||
|
||||
$netowner_id = intval($r->netowner_id);
|
||||
$this->layout()->set("netowner_id", $netowner_id);
|
||||
|
||||
if($this->me->is("Admin")) {
|
||||
$campaigns = PreordercampaignModel::getAll();
|
||||
if($netowner_id) {
|
||||
$campaigns = PreordercampaignModel::search(["owner_id" => $netowner_id]);
|
||||
} else {
|
||||
$campaigns = PreordercampaignModel::getAll();
|
||||
}
|
||||
|
||||
if(!$campaign_ids) {
|
||||
foreach(PreordercampaignModel::getAll() as $campaign) {
|
||||
$campaign_filter = [];
|
||||
if($netowner_id) {
|
||||
$campaign_filter['owner_id'] = $netowner_id;
|
||||
}
|
||||
foreach(PreordercampaignModel::search($campaign_filter) as $campaign) {
|
||||
$campaign_ids[] = $campaign->id;
|
||||
}
|
||||
}
|
||||
|
||||
$max_connections = $this->getTotalHomes($campaign_ids);
|
||||
$count_orders = PreorderModel::count(["preordercampaign_id" => $campaign_ids, "deleted" => 0]);
|
||||
$weekly_orders = $this->getWeeklyOrders($campaign_ids);
|
||||
|
||||
$status_connected_single = PreorderModel::count(["preordercampaign_id" => $campaign_ids, "deleted" => 0, "status_code" => 244]);
|
||||
$status_connected_multi = PreorderModel::count(["preordercampaign_id" => $campaign_ids, "deleted" => 0, "status_code" => 245]);
|
||||
|
||||
$status_connected = PreorderModel::count(["preordercampaign_id" => $campaign_ids, "deleted" => 0, "status_code" => 500]);
|
||||
|
||||
$partner_orders = $this->getPartnerOrderCount($campaign_ids);
|
||||
} else {
|
||||
$campaigns = PreordercampaignModel::search(["owner_id" => $this->me->address_id]);
|
||||
|
||||
$campaign_filter = ["preordercampaign_id" => $campaign_ids];
|
||||
if(!$campaign_ids) {
|
||||
foreach(PreordercampaignModel::search(["owner_id" => $this->me->address_id]) as $campaign) {
|
||||
$campaign_ids[] = $campaign->id;
|
||||
}
|
||||
}
|
||||
|
||||
$max_connections = $this->getTotalHomes($campaign_ids);
|
||||
$count_orders = PreorderModel::count(["preordercampaign_id" => $campaign_ids, "deleted" => 0]);
|
||||
$weekly_orders = $this->getWeeklyOrders($campaign_ids);
|
||||
|
||||
$status_connected_single = PreorderModel::count(["preordercampaign_id" => $campaign_ids, "deleted" => 0, "status_code" => 244]);
|
||||
$status_connected_multi = PreorderModel::count(["preordercampaign_id" => $campaign_ids, "deleted" => 0, "status_code" => 245]);
|
||||
|
||||
$status_connected = PreorderModel::count(["preordercampaign_id" => $campaign_ids, "deleted" => 0, "status_code" => 500]);
|
||||
$partner_orders = $this->getPartnerOrderCount($campaign_ids);
|
||||
}
|
||||
|
||||
if(!$campaign_ids) {
|
||||
$campaign_ids = [0];
|
||||
}
|
||||
|
||||
$max_connections = $this->getTotalHomes($campaign_ids);
|
||||
$count_orders = PreorderModel::count(["preordercampaign_id" => $campaign_ids, "deleted" => 0]);
|
||||
$weekly_orders = $this->getWeeklyOrders($campaign_ids);
|
||||
|
||||
$status_connected_single = PreorderModel::count(["preordercampaign_id" => $campaign_ids, "deleted" => 0, "status_code" => 244]);
|
||||
$status_connected_multi = PreorderModel::count(["preordercampaign_id" => $campaign_ids, "deleted" => 0, "status_code" => 245]);
|
||||
|
||||
$status_connected = PreorderModel::count(["preordercampaign_id" => $campaign_ids, "deleted" => 0, "status_code" => 500]);
|
||||
|
||||
$partner_orders = $this->getPartnerOrderCount($campaign_ids);
|
||||
$partner_orders_by_status = $this->getPartnerOrdersByStatus($campaign_ids);
|
||||
|
||||
$total_orders = $partner_orders["total"];
|
||||
unset($partner_orders["total"]);
|
||||
|
||||
//var_dump($partner_orders);exit;
|
||||
|
||||
$stati = [];
|
||||
foreach(PreorderstatusModel::getAll() as $status) {
|
||||
$stati[$status->id] = ["code" => $status->code, "name" => $status->name];
|
||||
}
|
||||
|
||||
$this->layout()->set("stati", $stati);
|
||||
|
||||
$this->layout()->set("max_connections", $max_connections);
|
||||
$this->layout()->set("count_orders", $count_orders);
|
||||
$this->layout()->set("weekly_orders", $weekly_orders);
|
||||
@@ -95,6 +105,7 @@ class DashboardController extends mfBaseController {
|
||||
$this->layout()->set("status_connected", $status_connected);
|
||||
$this->layout()->set("partner_orders", $partner_orders);
|
||||
$this->layout()->set("total_orders", $total_orders);
|
||||
$this->layout()->set("partner_orders_by_status", $partner_orders_by_status);
|
||||
|
||||
$this->layout()->set("campaigns", $campaigns);
|
||||
$this->layout()->set("campaign_id", $r->campaign_id);
|
||||
@@ -107,7 +118,7 @@ class DashboardController extends mfBaseController {
|
||||
foreach($preordercampaign_id as $campaign_id) {
|
||||
$campaign = new Preordercampaign($campaign_id);
|
||||
if($campaign->id) {
|
||||
$total_homes += $campaign->total_homes;
|
||||
$total_homes += ($campaign->homes_total) ? $campaign->homes_total : $campaign->total_homes;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -118,19 +129,24 @@ class DashboardController extends mfBaseController {
|
||||
$orders = [];
|
||||
$totals = 0;
|
||||
|
||||
|
||||
foreach(AddressModel::search(["addresstype" => ["salespartner"]]) as $partner) {
|
||||
$count = PreorderModel::count(["partner_id" => $partner->id, "preordercampaign_id" => $preordercampaign_id, "deleted" => 0]);
|
||||
if($count) {
|
||||
if(!array_key_exists($partner->getCompanyOrName(), $orders)) {
|
||||
$orders[$partner->getCompanyOrName()] = $count;
|
||||
$sql = "SELECT COUNT(Preorder.id) as cnt, IF(Address.company IS NOT NULL AND Address.company <> '', Address.company, CONCAT(Address.firstname, ' ', Address.lastname)) as partner FROM Preorder
|
||||
LEFT JOIN Address ON (Preorder.partner_id = Address.id)
|
||||
LEFT JOIN Addresstype ON (Addresstype.address_id = Address.id AND Addresstype.type='salespartner')
|
||||
WHERE Preorder.deleted = 0 AND Preorder.preordercampaign_id IN (".implode(",", $preordercampaign_id).")
|
||||
GROUP BY Address.id
|
||||
";
|
||||
$this->log->debug($sql);
|
||||
$res = $this->db()->query($sql);
|
||||
if($this->db()->num_rows($res)) {
|
||||
while($data = $this->db()->fetch_object($res)) {
|
||||
if($data->partner) {
|
||||
$orders[$data->partner] = $data->cnt;
|
||||
} else {
|
||||
$orders[$partner->getCompanyOrName()] += $count;
|
||||
$orders["Kein Partner"] = $data->cnt;
|
||||
}
|
||||
$totals += $count;
|
||||
$totals += $data->cnt;
|
||||
}
|
||||
}
|
||||
|
||||
arsort($orders);
|
||||
$orders["total"] = $totals;
|
||||
return $orders;
|
||||
@@ -161,6 +177,26 @@ class DashboardController extends mfBaseController {
|
||||
//var_dump($orders);exit;
|
||||
}
|
||||
|
||||
private function getPartnerOrdersByStatus($preordercampaign_id = []) {
|
||||
$orders = [];
|
||||
|
||||
foreach(PreorderModel::search(["preordercampaign_id" => $preordercampaign_id, "deleted" => 0]) as $preorder) {
|
||||
$name = $preorder->partner->getCompanyOrName();
|
||||
if(!$name) $name = "Kein Partner";
|
||||
if(!array_key_exists($name, $orders)) {
|
||||
$orders[$name] = [];
|
||||
$orders[$name]["total"] = 0;
|
||||
}
|
||||
if(!array_key_exists($preorder->status->id, $orders[$name])) {
|
||||
$orders[$name][$preorder->status->id] = 0;
|
||||
}
|
||||
$orders[$name][$preorder->status->id]++;
|
||||
$orders[$name]["total"]++;
|
||||
}
|
||||
//var_dump($orders);exit;
|
||||
return $orders;
|
||||
}
|
||||
|
||||
protected function pdfAction() {
|
||||
$order = new Order(7);
|
||||
$owner = new Address(1);
|
||||
|
||||
@@ -1,2 +1,10 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* will be called in mfBaseController after initializing Controller, before
|
||||
* running requested action
|
||||
*/
|
||||
|
||||
/* Get last git merge timestamp */
|
||||
$last_merge_ts = new mfConfig("git.merge.ts");
|
||||
$this->layout()->set("git_merge_ts", $last_merge_ts->value());
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
class OpenAccessId extends mfBaseModel {
|
||||
private $owner;
|
||||
private $adb_wohneinheit;
|
||||
private $adb_wohneinheit_count;
|
||||
private $termination;
|
||||
|
||||
public function loadRandomUnassigned($attributes = []) {
|
||||
@@ -94,8 +95,8 @@ class OpenAccessId extends mfBaseModel {
|
||||
$qs = http_build_query($params);
|
||||
//echo $qs."\n";
|
||||
|
||||
$createOrderEp = RIMO_API_JSON_URL.RIMO_API_JSON_EP_QUERY_HOME;
|
||||
$get_url = $createOrderEp."?".$qs;
|
||||
$queryHomeEp = RIMO_API_JSON_URL.RIMO_API_JSON_EP_QUERY_HOME;
|
||||
$get_url = $queryHomeEp."?".$qs;
|
||||
$ctx = stream_context_create($ctx_opts);
|
||||
$this->log->debug(__METHOD__.": Getting Home to fetch FTU: $get_url");
|
||||
//exit;
|
||||
@@ -189,8 +190,84 @@ class OpenAccessId extends mfBaseModel {
|
||||
$this->save();
|
||||
} else {
|
||||
$this->log->debug(__METHOD__.": OAID ".$this->oaid.": Already created in RIMO");
|
||||
|
||||
/*************************************************************************
|
||||
* get OAID from rimo and check if it's the same FTU as our Wohneinheit
|
||||
*/
|
||||
|
||||
$ftu_data = $wohneinheit->ftu_data;
|
||||
if($ftu_data['id'] && $ftu_data['name']) {
|
||||
|
||||
$params = [];
|
||||
$params['apiKey'] = RIMO_API_JSON_APIKEY;
|
||||
|
||||
$ctx_opts = [
|
||||
'http' => [
|
||||
'method' => 'GET',
|
||||
'header' => 'accept: application/json'
|
||||
]
|
||||
];
|
||||
|
||||
$qs = http_build_query($params);
|
||||
//echo $qs."\n";
|
||||
|
||||
$getOaidEp = RIMO_API_JSON_URL.RIMO_API_JSON_EP_GET_OAID;
|
||||
$getOaidEp .= "/".$this->oaid;
|
||||
$get_url = $getOaidEp."?".$qs;
|
||||
$ctx = stream_context_create($ctx_opts);
|
||||
$this->log->debug(__METHOD__.": Getting OAID from Rimo: $get_url");
|
||||
$response = file_get_contents($get_url, false, $ctx);
|
||||
//var_dump($response);exit;
|
||||
if($response === false) {
|
||||
$this->log->error("Fehler beim abfragen der OAID in RIMO ".$this->oaid."\n");
|
||||
return false;
|
||||
}
|
||||
|
||||
$resp_data = json_decode($response);
|
||||
if($resp_data->terminiationUnit && $resp_data->terminiationUnit->id) {
|
||||
if($ftu_data['id'] != $resp_data->terminiationUnit->id) {
|
||||
$old_ftu_id = $resp_data->terminiationUnit->id;
|
||||
|
||||
|
||||
// unassign oaid from FTU
|
||||
$ctx_opts["http"]["method"] = "DELETE";
|
||||
$unassignEp = RIMO_API_JSON_URL.RIMO_API_JSON_EP_UNASSIGN_OAID_TO_FTU;
|
||||
$unassignEp = str_replace("{oaidName}", $this->oaid, $unassignEp);
|
||||
$unassignEp = str_replace("{ftuExternalId}", $old_ftu_id, $unassignEp);
|
||||
|
||||
$delete_url = $unassignEp."?".$qs;
|
||||
$ctx = stream_context_create($ctx_opts);
|
||||
$this->log->debug(__METHOD__.": Unassigning OAID from FTU $old_ftu_id: $delete_url");
|
||||
$response = file_get_contents($delete_url, false, $ctx);
|
||||
|
||||
|
||||
// assign oaid to Wohneinheit FTU
|
||||
$ctx_opts["http"]["method"] = "POST";
|
||||
$assignEp = RIMO_API_JSON_URL.RIMO_API_JSON_EP_ASSIGN_OAID_TO_FTU;
|
||||
$assignEp = str_replace("{oaidName}", $this->oaid, $assignEp);
|
||||
$assignEp = str_replace("{ftuExternalId}", $ftu_data['id'], $assignEp);
|
||||
|
||||
$post_url = $assignEp."?".$qs;
|
||||
$ctx = stream_context_create($ctx_opts);
|
||||
$this->log->debug(__METHOD__.": Assigning OAID to current FTU ".$ftu_data['id'].": $post_url");
|
||||
$response = file_get_contents($post_url, false, $ctx);
|
||||
|
||||
// update OAID export data
|
||||
$exp_data_update = json_decode($this->export_data);
|
||||
$exp_data_update->rimo->ftu_id = $ftu_data['id'];
|
||||
$exp_data_update->rimo->ftu_name = $ftu_data['name'];
|
||||
$exp_data_update->rimo->ftu_assigned_date = date("U");
|
||||
$this->export_data = json_encode($ext_data_update);
|
||||
$this->save();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/*************************************************************************
|
||||
* assign OAID to FTU - POST /v1/oaid-management/oaids/{oaidName}/ftu/{ftuExternalId}
|
||||
*/
|
||||
@@ -332,6 +409,11 @@ class OpenAccessId extends mfBaseModel {
|
||||
return $this->adb_wohneinheit;
|
||||
}
|
||||
|
||||
if($name == "adb_wohneinheit_count") {
|
||||
$this->adb_wohneinheit_count = ADBWohneinheitModel::count(["oaid" => $this->oaid]);
|
||||
return $this->adb_wohneinheit_count;
|
||||
}
|
||||
|
||||
$classname = ucfirst($name);
|
||||
$idfield = $name."_id";
|
||||
$this->$name = new $classname($this->$idfield);
|
||||
|
||||
@@ -17,11 +17,23 @@ class OpenAccessIdController extends mfBaseController {
|
||||
protected function indexAction() {
|
||||
$this->layout()->setTemplate("OpenAccessId/Index");
|
||||
|
||||
$this->layout->set("filter", $this->request->filter);
|
||||
if($this->request->filter) {
|
||||
$filter = $this->getPreparedFilter($this->request->filter);
|
||||
if($this->request->resetFilter) {
|
||||
unset($_SESSION[MFAPPNAME.'-OpenAccessId-filter']);
|
||||
}
|
||||
|
||||
$filter = [];
|
||||
if(is_array($this->request->filter)) {
|
||||
$filter = $this->request->filter;
|
||||
$_SESSION[MFAPPNAME.'-OpenAccessId-filter'] = $filter;
|
||||
} else {
|
||||
if(array_key_exists(MFAPPNAME.'-OpenAccessId-filter', $_SESSION) && count($_SESSION[MFAPPNAME.'-OpenAccessId-filter'])) {
|
||||
$filter = $_SESSION[MFAPPNAME.'-OpenAccessId-filter'];
|
||||
}
|
||||
}
|
||||
|
||||
$this->layout->set("filter", $filter);
|
||||
$filter = $this->getPreparedFilter($filter);
|
||||
|
||||
// pagination defaults
|
||||
$pagination = [];
|
||||
$pagination['start'] = 0;
|
||||
@@ -73,6 +85,79 @@ class OpenAccessIdController extends mfBaseController {
|
||||
return $new_filter;
|
||||
}
|
||||
|
||||
protected function changeADBWohneinheitAction() {
|
||||
$this->layout()->setTemplate("OpenAccessId/ChangeUnit");
|
||||
$id = $this->request->id;
|
||||
if(!$id || $id <1) {
|
||||
$this->layout()->setFlash("Ungültige OAID", "error");
|
||||
$this->redirect("OpenAccessId");
|
||||
}
|
||||
|
||||
$oaid = new OpenAccessId($id);
|
||||
if(!$oaid->id) {
|
||||
$this->layout()->setFlash("Ungültige OAID", "error");
|
||||
$this->redirect("OpenAccessId");
|
||||
}
|
||||
|
||||
$this->layout()->set("oaid", $oaid);
|
||||
|
||||
if(!$this->request->new_unit_id) {
|
||||
return true;
|
||||
}
|
||||
|
||||
// get old and new unit_id
|
||||
$old_unit = ADBWohneinheitModel::getFirst(["oaid" => $oaid->oaid]);
|
||||
$new_unit = new ADBWohneinheit($this->request->new_unit_id);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
if($old_unit) {
|
||||
$old_preorder = PreorderModel::getFirst(["adb_wohneinheit_id" => $old_unit->id]);
|
||||
if($old_preorder) {
|
||||
// remove oaid from preorder
|
||||
$old_preorder->oaid = null;
|
||||
$old_preorder->save();
|
||||
}
|
||||
// unassign oaid from rimo ftu
|
||||
// get oaid from rimo
|
||||
// unassign ftu from aoid
|
||||
// remove oaid from old unit
|
||||
|
||||
// remove meta data from oaid
|
||||
$oaid->assigned = 0;
|
||||
$oaid->adb_wohneinheit_id = null;
|
||||
$oaid->termination_id = null;
|
||||
$oaid->exported = 0;
|
||||
$oaid->exported_to = null;
|
||||
$oaid->exported_data = null;
|
||||
$oaid->address = null;
|
||||
$oaid->unit_string = null;
|
||||
$oaid->save();
|
||||
}
|
||||
|
||||
if($new_unit) {
|
||||
$new_preorder = PreorderModel::getFirst(["adb_wohneinheit_id" => $new_unit->id]);
|
||||
// add oaid to new unit
|
||||
// assign oaid to new ftu in rimo
|
||||
if($new_preorder) {
|
||||
// add oaid to preorder
|
||||
$new_preorder->oaid = $oaid->oaid;
|
||||
}
|
||||
// save metadata to oaid
|
||||
$oaid->assigned = date("U");
|
||||
$oaid->adb_wohneinheit_id = $new_unit->id;
|
||||
$oaid->termination_id = null;
|
||||
$oaid->exported = date("U");
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
protected function importerAction() {
|
||||
$this->layout()->setTemplate("OpenAccessId/Importer");
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
class Preorder extends mfBaseModel {
|
||||
protected $forcestr = ['street','company','zip','phone','email','note'];
|
||||
private $in_after_save = false;
|
||||
private $in_after_save = 0;
|
||||
|
||||
private $status;
|
||||
private $campaign;
|
||||
@@ -38,7 +38,7 @@ class Preorder extends mfBaseModel {
|
||||
|
||||
// prevent potential infinite loop
|
||||
if($this->in_after_save) return true;
|
||||
$this->in_after_save = true;
|
||||
$this->in_after_save++;
|
||||
// update preorder OAID if it's different from the unit OAID
|
||||
// but only if the unit OAID is of the same origin as the campaign
|
||||
$old_oaid = $this->oaid;
|
||||
@@ -52,6 +52,8 @@ class Preorder extends mfBaseModel {
|
||||
$this->cascadeStatus();
|
||||
// Cascade status changes down all active preorders with the same hausnummer
|
||||
$this->cascadeStatusToPreorders();
|
||||
|
||||
$this->in_after_save--;
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
@@ -87,6 +87,24 @@ class ProductgroupController extends mfBaseController {
|
||||
|
||||
$group_data = [];
|
||||
$group_data['name'] = $name;
|
||||
$group_data["matchcodeorigin"] = null;
|
||||
|
||||
if($r->matchcodeorigin) {
|
||||
switch($r->matchcodeorigin) {
|
||||
case "address":
|
||||
$group_data["matchcodeorigin"] = "address";
|
||||
break;
|
||||
case "domain":
|
||||
$group_data["matchcodeorigin"] = "domain";
|
||||
break;
|
||||
case "terminationaddress":
|
||||
$group_data["matchcodeorigin"] = "terminationaddress";
|
||||
break;
|
||||
case "voicenumber":
|
||||
$group_data["matchcodeorigin"] = "voicenumber";
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if($mode == "edit") {
|
||||
$group->update($group_data);
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
<?php
|
||||
|
||||
class ProductgroupModel {
|
||||
public $name = null;
|
||||
public $description = null;
|
||||
public $name;
|
||||
public $description;
|
||||
public $matchcodeorigin;
|
||||
|
||||
public $note = null;
|
||||
|
||||
|
||||
@@ -51,7 +51,9 @@ class UserController extends mfBaseController
|
||||
}
|
||||
$this->layout()->setTemplate('User/Form');
|
||||
|
||||
$addresses = AddressModel::getAll();
|
||||
$roles = TT_NETWORK_ROLES_WITH_OWNER;
|
||||
$roles[] = "systemowner";
|
||||
$addresses = AddressModel::search(["addresstype" => $roles]);
|
||||
$this->layout()->set("addresses", $addresses);
|
||||
|
||||
if ($this->request->address_id) {
|
||||
@@ -225,6 +227,7 @@ class UserController extends mfBaseController
|
||||
$user->permissions->canPreorder = "false";
|
||||
$user->permissions->canOrder = "false";
|
||||
$user->permissions->canFibu = "false";
|
||||
$user->permissions->canStatistics = "false";
|
||||
|
||||
if($r->get("can") && is_array($r->can)) {
|
||||
foreach($r->can as $key => $can) {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
|
||||
class XinonFibuMergeModel {
|
||||
|
||||
public $source;
|
||||
public $old_custnum;
|
||||
public $new_custnum;
|
||||
public $name;
|
||||
@@ -117,9 +117,7 @@ class XinonFibuMergeModel {
|
||||
|
||||
private static function getSqlFilter($filter) {
|
||||
$where = "1=1 ";
|
||||
|
||||
|
||||
|
||||
if(array_key_exists("old_custnum", $filter)) {
|
||||
$old_custnum = $filter['old_custnum'];
|
||||
if (is_numeric($old_custnum)) {
|
||||
@@ -134,6 +132,15 @@ class XinonFibuMergeModel {
|
||||
}
|
||||
}
|
||||
|
||||
if(array_key_exists("name", $filter)) {
|
||||
$name = $filter["name"];
|
||||
if(is_array($name)) {
|
||||
$where .= " AND XinonFibuMerge.name IN ('".implode("','", $name)."')";
|
||||
} elseif($name) {
|
||||
$name = FronkDB::singleton()->escape($filter['name']);
|
||||
$where .= " AND XinonFibuMerge.name='$name'";
|
||||
}
|
||||
}
|
||||
|
||||
//var_dump($filter, $where);exit;
|
||||
return $where;
|
||||
|
||||
41
bin/post_merge_hook.php
Executable file
41
bin/post_merge_hook.php
Executable file
@@ -0,0 +1,41 @@
|
||||
#!/usr/bin/php
|
||||
<?php
|
||||
|
||||
/*
|
||||
* Run this script via git post-merge hook
|
||||
*/
|
||||
|
||||
//require 'vendor/autoload.php';
|
||||
require(dirname(__FILE__)."/../config/config.php");
|
||||
|
||||
define('FRONKDB_SQLDEBUG',false);
|
||||
error_reporting(E_ALL & ~(E_NOTICE | E_STRICT | E_DEPRECATED));
|
||||
|
||||
require_once(LIBDIR."/mvcfronk/mfRouter/mfRouter.php");
|
||||
require_once(LIBDIR."/mvcfronk/mfBase/mfBaseModel.php");
|
||||
require_once(LIBDIR."/mvcfronk/mfBase/mfBaseController.php");
|
||||
|
||||
$me = new User(1);
|
||||
|
||||
define("INTERNAL_USER_ID", $me->id);
|
||||
define("INTERNAL_USER_USERNAME", $me->username);
|
||||
|
||||
$now = date("U");
|
||||
|
||||
// update last merge timestamp
|
||||
$merge_ts = new mfConfig("git.merge.ts");
|
||||
$merge_ts->type("int");
|
||||
$merge_ts->value($now);
|
||||
$merge_ts->save();
|
||||
|
||||
|
||||
// update git commit ref
|
||||
$git_ref = new mfConfig("git.lastref");
|
||||
|
||||
$sc = new SystemController();
|
||||
$commitid = $sc->getLastCommit();
|
||||
|
||||
if($commitid) {
|
||||
$git_ref->value($commitid);
|
||||
$git_ref->save();
|
||||
}
|
||||
35
db/migrations/20240116132506_address_add_skonto.php
Normal file
35
db/migrations/20240116132506_address_add_skonto.php
Normal file
@@ -0,0 +1,35 @@
|
||||
<?php
|
||||
declare(strict_types=1);
|
||||
|
||||
use Phinx\Migration\AbstractMigration;
|
||||
|
||||
final class AddressAddSkonto extends AbstractMigration
|
||||
{
|
||||
public function up(): void
|
||||
{
|
||||
if($this->getEnvironment() == "thetool") {
|
||||
$table = $this->table("Address");
|
||||
$table->addColumn("fibu_supplier_skonto", "integer", ["null" => true, "default" => null, "after" => "fibu_supplier_due"]);
|
||||
$table->addColumn("fibu_supplier_skonto_rate", "integer", ["null" => true, "default" => null, "after" => "fibu_supplier_skonto"]);
|
||||
$table->update();
|
||||
}
|
||||
|
||||
if($this->getEnvironment() == "addressdb") {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
public function down(): void
|
||||
{
|
||||
if($this->getEnvironment() == "thetool") {
|
||||
$table = $this->table("Address");
|
||||
$table->removeColumn("fibu_supplier_skonto_rate");
|
||||
$table->removeColumn("fibu_supplier_skonto");
|
||||
$table->save();
|
||||
}
|
||||
|
||||
if($this->getEnvironment() == "addressdb") {
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
<?php
|
||||
declare(strict_types=1);
|
||||
|
||||
use Phinx\Migration\AbstractMigration;
|
||||
|
||||
final class ProductgroupAddMatchcodeorigin extends AbstractMigration
|
||||
{
|
||||
public function up(): void
|
||||
{
|
||||
if($this->getEnvironment() == "thetool") {
|
||||
$table = $this->table("Productgroup");
|
||||
$table->addColumn("matchcodeorigin", "string", ["null" => true, "default" => null, "limit" => 64, "after" => "name"]);
|
||||
$table->update();
|
||||
}
|
||||
|
||||
if($this->getEnvironment() == "addressdb") {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
public function down(): void
|
||||
{
|
||||
if($this->getEnvironment() == "thetool") {
|
||||
$this->table("Productgroup")->removeColumn("matchcodeorigin")->save();
|
||||
}
|
||||
|
||||
if($this->getEnvironment() == "addressdb") {
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
<?php
|
||||
declare(strict_types=1);
|
||||
|
||||
use Phinx\Migration\AbstractMigration;
|
||||
|
||||
final class AddCanStatisticsPermission extends AbstractMigration
|
||||
{
|
||||
public function up(): void
|
||||
{
|
||||
if($this->getEnvironment() == "thetool") {
|
||||
$table = $this->table("WorkerPermission");
|
||||
$table->addColumn("canStatistics", "enum", ["values" => 'false,true', "default" => "false", "after" => "canOrder"]);
|
||||
$table->update();
|
||||
}
|
||||
|
||||
if($this->getEnvironment() == "addressdb") {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
public function down(): void
|
||||
{
|
||||
if($this->getEnvironment() == "thetool") {
|
||||
$this->table("WorkerPermission")->removeColumn("canStatistics")->save();
|
||||
}
|
||||
|
||||
if($this->getEnvironment() == "addressdb") {
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
<?php
|
||||
declare(strict_types=1);
|
||||
|
||||
use Phinx\Migration\AbstractMigration;
|
||||
|
||||
final class NetzgebietAddUnitCreateOaid extends AbstractMigration
|
||||
{
|
||||
public function up(): void
|
||||
{
|
||||
if($this->getEnvironment() == "thetool") {
|
||||
|
||||
}
|
||||
|
||||
if($this->getEnvironment() == "addressdb") {
|
||||
$table = $this->table("Netzgebiet");
|
||||
$table->addColumn("unit_create_oaid", "integer", ["null" => false, "default" => 0, "after" => "unit_count"]);
|
||||
$table->update();
|
||||
}
|
||||
}
|
||||
|
||||
public function down(): void
|
||||
{
|
||||
if($this->getEnvironment() == "thetool") {
|
||||
|
||||
}
|
||||
|
||||
if($this->getEnvironment() == "addressdb") {
|
||||
$this->table("Netzgebiet")->removeColumn("unit_create_oaid")->save();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
<?php
|
||||
declare(strict_types=1);
|
||||
|
||||
use Phinx\Migration\AbstractMigration;
|
||||
|
||||
final class AddressAddFibuSupplierPaymentblock extends AbstractMigration
|
||||
{
|
||||
public function up(): void
|
||||
{
|
||||
if($this->getEnvironment() == "thetool") {
|
||||
$table = $this->table("Address");
|
||||
$table->addColumn("fibu_supplier_paymentblock", "integer", ["null" => false, "default" => 0, "limit" => \Phinx\Db\Adapter\MysqlAdapter::INT_TINY, "after" => "fibu_supplier_skonto_rate"]);
|
||||
$table->update();
|
||||
}
|
||||
|
||||
if($this->getEnvironment() == "addressdb") {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
public function down(): void
|
||||
{
|
||||
if($this->getEnvironment() == "thetool") {
|
||||
$this->table("Address")->removeColumn("fibu_supplier_paymentblock")->save();
|
||||
}
|
||||
|
||||
if($this->getEnvironment() == "addressdb") {
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
82
lang/de.php
82
lang/de.php
@@ -32,7 +32,7 @@ $l['connected-b'] = "Rohr im Haus";
|
||||
$l['created-t'] = "Erstellt";
|
||||
$l['planned-t'] = "Faserplan vorhanden";
|
||||
$l['assigned-t'] = "Bauauftrag zugeteilt";
|
||||
$l['passed-t'] = "Fasern im Gebäude";
|
||||
$l['passed-t'] = "Fasern im Gebaeude";
|
||||
$l['connected-t'] = "Passiv erschlossen";
|
||||
$l['active-t'] = "Internetprodukt aktiv";
|
||||
|
||||
@@ -56,4 +56,84 @@ $l['contract.downgrade'] = "Downgrade";
|
||||
$l['contract.relocation'] = "Umzug";
|
||||
$l['contract.productchange'] = "Produktwechsel";
|
||||
|
||||
|
||||
$l['cc.oesterreich'] = "AT";
|
||||
$l['cc.oestereich'] = "AT";
|
||||
$l['cc.osterreich'] = "AT";
|
||||
$l['cc.oesterreich'] = "AT";
|
||||
$l['cc.austria'] = "AT";
|
||||
$l['cc.at'] = "AT";
|
||||
$l["cc.bulgarien"] = "BG";
|
||||
$l["cc.bulgaria"] = "BG";
|
||||
$l["cc.schweiz"] = "CH";
|
||||
$l["cc.switzerland"] = "CH";
|
||||
$l["cc.zypern"] = "CY";
|
||||
$l["cc.cyprus"] = "CY";
|
||||
$l["cc.tschechien"] = "CZ";
|
||||
$l["cc.czechia"] = "CZ";
|
||||
$l["cc.tschechische republik"] = "CZ";
|
||||
$l["cc.czech republic"] = "CZ";
|
||||
$l["cc.Ceska republika"] = "CZ";
|
||||
$l["cc.deutschland"] = "DE";
|
||||
$l["cc.germany"] = "DE";
|
||||
$l["cc.frankreich"] = "FR";
|
||||
$l["cc.france"] = "FR";
|
||||
$l["cc.francaise"] = "FR";
|
||||
$l["cc.République française"] = "FR";
|
||||
$l["cc.Republique francaise"] = "FR";
|
||||
$l["cc.grossbritannien"] = "GB";
|
||||
$l["cc.britain"] = "GB";
|
||||
$l["cc.great britain"] = "GB";
|
||||
$l["cc.uk"] = "GB";
|
||||
$l["cc.united kingdom"] = "GB";
|
||||
$l["cc.United Kingdom of Great Britain and Northern Ireland"] = "GB";
|
||||
$l["cc.Vereinigtes Koenigreich"] = "GB";
|
||||
$l["cc.Vereinigtes Koenigreich Grossbritannien und Nordirland"] = "GB";
|
||||
$l["cc.ungarn"] = "HU";
|
||||
$l["cc.hungary"] = "HU";
|
||||
$l["cc.irland"] = "IE";
|
||||
$l["cc.ireland"] = "IE";
|
||||
$l["cc.republic of ireland"] = "IE";
|
||||
$l["cc.italien"] = "IT";
|
||||
$l["cc.italia"] = "IT";
|
||||
$l["cc.japan"] = "JP";
|
||||
$l["cc.jpn"] = "JP";
|
||||
$l["cc.nippon"] = "JP";
|
||||
$l["cc.nihon"] = "JP";
|
||||
$l["cc.日本"] = "JP";
|
||||
$l["cc.日本国"] = "JP";
|
||||
$l["cc.luxemburg"] = "LU";
|
||||
$l["cc.grossherzogtum luxemburg"] = "LU";
|
||||
$l["cc.luxembourg"] = "LU";
|
||||
$l["cc.grand duchy of luxembourg"] = "LU";
|
||||
$l["cc.groussherzogtum lëtzebuerg"] = "LU";
|
||||
$l["cc.groussherzogtum letzebuerg"] = "LU";
|
||||
$l["cc.niederlande"] = "NL";
|
||||
$l["cc.netherlands"] = "NL";
|
||||
$l["cc.nederland"] = "NL";
|
||||
$l["cc.holland"] = "NL";
|
||||
$l["cc.polen"] = "PL";
|
||||
$l["cc.poland"] = "PL";
|
||||
$l["cc.polska"] = "PL";
|
||||
$l["cc.rumaenien"] = "RO";
|
||||
$l["cc.rumaenien"] = "RO";
|
||||
$l["cc.romania"] = "RO";
|
||||
$l["cc.slowenien"] = "SL";
|
||||
$l["cc.slovenia"] = "SL";
|
||||
$l["cc.slowakei"] = "SK";
|
||||
$l["cc.slovakia"] = "SK";
|
||||
$l["cc.slowakische republik"] = "SK";
|
||||
$l["cc.slovak republic"] = "SK";
|
||||
$l["cc.vereinigte staaten"] = "US";
|
||||
$l["cc.vereinigte staaten von amerika"] = "US";
|
||||
$l["cc.usa - vereinigte staaten"] = "US";
|
||||
$l["cc.Amerika"] = "US";
|
||||
$l["cc.us"] = "US";
|
||||
$l["cc.usa"] = "US";
|
||||
$l["cc.u.s.a."] = "US";
|
||||
$l["cc.america"] = "US";
|
||||
$l["cc.united states"] = "US";
|
||||
$l["cc.united states of america"] = "US";
|
||||
$l["cc.mm"] = "CW";
|
||||
|
||||
$lang['de'] = $l;
|
||||
@@ -261,7 +261,7 @@ function mfLayoutInclude($filename, $folder = "") {
|
||||
global $mfLayoutPackage;
|
||||
|
||||
if($folder) {
|
||||
$folder = $fodler."/";
|
||||
$folder = $folder."/";
|
||||
}
|
||||
|
||||
$inc_path = VIEWDIR . "/" . LAYOUT_DEFAULTPACKAGE . "/" . $folder . $filename;
|
||||
@@ -279,8 +279,14 @@ if(!isset($lang)) {
|
||||
$lang = [];
|
||||
}
|
||||
|
||||
function __($string, $prefix = null) {
|
||||
$last_translation_failed = false;
|
||||
|
||||
function __($_string, $prefix = null) {
|
||||
global $lang;
|
||||
global $last_translation_failed;
|
||||
$last_translation_failed = false;
|
||||
|
||||
$string = str_replace(["Ä","Ö","Ü","ß","ä","ö","ü","ß"], ["ae","oe","ue","ss","ae","oe","ue", "ss"], strtolower($_string));
|
||||
|
||||
if(!$lang) {
|
||||
//mfLoghandler::singleton()->debug("Loading language file for __() function");
|
||||
@@ -294,6 +300,11 @@ function __($string, $prefix = null) {
|
||||
if (array_key_exists($string, $lang['de'])) {
|
||||
return $lang['de'][$string];
|
||||
}
|
||||
$last_translation_failed = true;
|
||||
return $string;
|
||||
}
|
||||
|
||||
function __last_translation_failed() {
|
||||
global $last_translation_failed;
|
||||
return $last_translation_failed;
|
||||
}
|
||||
@@ -2,6 +2,7 @@
|
||||
|
||||
class mfRequest {
|
||||
protected static $instance;
|
||||
protected $original_request = [];
|
||||
protected $request = [];
|
||||
|
||||
public function __construct(Array $request = []) {
|
||||
@@ -9,8 +10,19 @@ class mfRequest {
|
||||
$this->request = $request;
|
||||
} else {
|
||||
// get request from POST/GET
|
||||
if(isset($_POST) && isset($_GET)) {
|
||||
$this->request = array_merge($_GET, $_POST);
|
||||
$_request = [];
|
||||
if(isset($_GET)) {
|
||||
$_request = array_merge($_request, $_GET);
|
||||
}
|
||||
if(isset($_POST)) {
|
||||
$_request = array_merge($_request, $_POST);
|
||||
}
|
||||
if(!count($_request)) {
|
||||
return true;
|
||||
}
|
||||
foreach($_request as $key => $name) {
|
||||
$this->original_request[$key] = $name;
|
||||
$this->request[$key] = trim($name);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -41,6 +53,18 @@ class mfRequest {
|
||||
return $this->request;
|
||||
}
|
||||
|
||||
public function getUnmodified($name = null) {
|
||||
if($name) {
|
||||
if(array_key_exists($name, $this->original_request)) {
|
||||
//var_dump($this->request);exit;
|
||||
return $this->original_request[$name];
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
return $this->request;
|
||||
}
|
||||
|
||||
public function __get($name) {
|
||||
return $this->get($name);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user