More Contract stuff
This commit is contained in:
@@ -172,6 +172,58 @@
|
||||
<div class="card">
|
||||
<div class="card-body" id="link-container">
|
||||
<h4>Verknüpfungen</h4>
|
||||
|
||||
<table class="table table-striped table-sm table-bordered">
|
||||
<tr>
|
||||
<th>Verknüpfung</th>
|
||||
<th>Kunde</th>
|
||||
<th>Contract ID</th>
|
||||
<th>Produkt</th>
|
||||
<th>Matchcode</th>
|
||||
<th></th>
|
||||
</tr>
|
||||
<?php foreach($contract->links as $type => $links): ?>
|
||||
<?php foreach($links as $link): ?>
|
||||
<tr>
|
||||
<td><?=$type?></td>
|
||||
<td><a href="<?=self::getUrl("Address", "View", ["id" => $link->contract->owner_id])?>"><?=$link->contract->owner->getCompanyOrName()?></a></td>
|
||||
<td><a href="<?=self::getUrl("Contract", "View", ["id" => $link->contract_id])?>"><?=$link->contract_id?></a></td>
|
||||
<td><a href="<?=self::getUrl("Contract", "View", ["id" => $link->contract_id])?>"><?=$link->contract->product->name?></a></td>
|
||||
<td><a href="<?=self::getUrl("Contract", "View", ["id" => $link->contract_id])?>"><?=$link->contract->matchcode?></a></td>
|
||||
<td>
|
||||
<a href="<?=self::getUrl("Contract", "deleteLink", ["link_id" => $link->id])?>" onclick="if(!confirm('Verknüpfung wirklich entfernen?')) return false;" class="text-danger" title="Verknüpfung entfernen"><i class="fas fa-xmark-large"></i></a>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
<?php endforeach; ?>
|
||||
</table>
|
||||
|
||||
<?php foreach($contract->links as $link): ?>
|
||||
<div class="form-group row" id="link-<?=$linknum?>">
|
||||
<label class="col-lg-2 col-form-label" for="links_<?=$link->id?>_contract_id"></label>
|
||||
<div class="col-lg-6">
|
||||
<div class="input-group mb-3">
|
||||
<div class="input-group-prepend">
|
||||
<select class="form-control" name="links[<?=$link->id?>][type]">
|
||||
<option value="link" <?=($link->type == "link") ? "selected='selected'" : ""?>>Verknüpfung mit</option>
|
||||
<option value="upgrade" <?=($link->type == "upgrade") ? "selected='selected'" : ""?>>Upgrade von</option>
|
||||
<option value="downgrade" <?=($link->type == "downgrade") ? "selected='selected'" : ""?>>Downgrade von</option>
|
||||
<option value="relocation" <?=($link->type == "relocation") ? "selected='selected'" : ""?>>Umzug von</option>
|
||||
<option value="productchange" <?=($link->type == "productchange") ? "selected='selected'" : ""?>>Produktwechsel von</option>
|
||||
</select>
|
||||
</div>
|
||||
<!--input type="text" class="form-control" name="links[<?=$linknum?>][contract_id]" id="links_<?=$linknum?>_contract_id" placeholder="Contract ID oder Suche nach Produkt, Matchcode, Kunde" value="<?=$contract->cancel_date?>"-->
|
||||
<select class="form-control basicAutoComplete link-autocomplete" autocomplete="off" name="links[<?=$link->id?>][contract_id]" id="links_<?=$link->id?>_contract_id" data-linknum="<?=$link->id?>" data-url="<?=self::getUrl('Contract','api')?>?do=findContract&autocomplete=1&preferred_address_id=<?=$contract->owner->id?>" placeholder="Contract ID oder Suche nach Produkt, Matchcode, Kunde" data-noresults-text="Keine Suchergebnisse">
|
||||
<option></option>
|
||||
</select>
|
||||
<div class="input-group-append">
|
||||
<button type="button" class="btn btn-danger" onclick="clearNewLink(<?=$link->id?>)"><i class="fas fa-xmark-large mr-1"></i> Entfernen</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php endforeach; ?>
|
||||
|
||||
<?php $linknum = 1337; ?>
|
||||
<div class="form-group row" id="link-<?=$linknum?>">
|
||||
<label class="col-lg-2 col-form-label" for="links_<?=$linknum?>_contract_id"></label>
|
||||
|
||||
@@ -32,7 +32,12 @@
|
||||
<div class="row">
|
||||
|
||||
<div class="col-1">
|
||||
<label class="form-label" for="filter_owner">Inhaber</label>
|
||||
<label class="form-label" for="filter_owner">Kundennummer</label>
|
||||
<input type="text" class="form-control" name="filter[customer_number]" id="filter_street" value="<?=$filter['customer_number']?>" />
|
||||
</div>
|
||||
|
||||
<div class="col-1">
|
||||
<label class="form-label" for="filter_owner">Inhaber Name</label>
|
||||
<input type="text" class="form-control" name="filter[owner]" id="filter_street" value="<?=$filter['owner']?>" />
|
||||
</div>
|
||||
|
||||
@@ -51,6 +56,13 @@
|
||||
<input type="text" class="form-control" name="filter[product_name]" id="filter_product_name" value="<?=$filter['product_name']?>" />
|
||||
</div>
|
||||
|
||||
<div class="col-1">
|
||||
<label class="form-label" for="filter_show_canceled">Gekündigte Produkte</label>
|
||||
<select class="form-control" name="filter[show_canceled]" id="filter_show_canceled">
|
||||
<option value="0" <?=($filter['show_canceled'] == 0) ? "selected='selected'" : ""?>>Ausblenden</option>
|
||||
<option value="1" <?=($filter['show_canceled'] == 1 ) ? "selected='selected'" : ""?>>Anzeigen</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="row mt-2">
|
||||
|
||||
@@ -7,11 +7,11 @@
|
||||
<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("Contract")?>">Verträge</a></li>
|
||||
<li class="breadcrumb-item"><a href="<?=self::getUrl("Contract")?>">Aktive Produkte</a></li>
|
||||
<li class="breadcrumb-item active"><?=$contract->product_name?> [<?=$contract->matchcode?>]</li>
|
||||
</ol>
|
||||
</div>
|
||||
<h4 class="page-title"><?=$contract->product_name?> [<?=$contract->matchcode?>] (<?=$contract->id?>)</h4>
|
||||
<h4 class="page-title">Aktives Produkt</h4>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -29,87 +29,119 @@
|
||||
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<h4>Vertragsinhaber</h4>
|
||||
<h3 class="text-center mb-3"><?=$contract->product_name?> (<?=$contract->id?>)</h3>
|
||||
|
||||
<table class="table table-sm table-striped view-table">
|
||||
<tr>
|
||||
<th style="max-width: 50vw;">ID:</th>
|
||||
<td style="width: 50vw;"><a href="<?=self::getUrl("Address", "View", ["id" => $contract->owner->id])?>"><?=$contract->owner->id?></a></td>
|
||||
</tr><tr>
|
||||
<th>Kundennummer:</th>
|
||||
<td><?=$contract->owner->customer_number?></td>
|
||||
</tr><tr>
|
||||
<th>Adresse:</th>
|
||||
<td>
|
||||
<?=($contract->owner->company) ? nl2br($contract->owner->company)."<br />" : ""?>
|
||||
<?=$contract->owner->firstname?> <?=$contract->owner->lastname?><br />
|
||||
<?=$contract->owner->street?><br />
|
||||
<?=$contract->owner->zip?> <?=$contract->owner->city?>
|
||||
<?=($contract->owner->country) ? "<br />".$contract->owner->country : "" ?>
|
||||
</td>
|
||||
</tr><tr>
|
||||
<th>Kontakt:</th>
|
||||
<td>
|
||||
<?=($contract->owner->phone) ? "Telefon: ".$contract->owner->phone."<br />" : ""?>
|
||||
<?=($contract->owner->mobile) ? "Mobil: ".$contract->owner->mobile."<br />" : ""?>
|
||||
<?=($contract->owner->fax) ? "Fax: ".$contract->owner->fax."<br />" : ""?>
|
||||
<?=($contract->owner->email) ? "Email: ".$contract->owner->email."<br />" : ""?>
|
||||
</td>
|
||||
</tr><tr>
|
||||
<th></th>
|
||||
<td></td>
|
||||
</tr><tr>
|
||||
<th>Service PIN:</th>
|
||||
<td><?=$contract->owner->spin?></td>
|
||||
</tr><tr>
|
||||
<th>Einwilligungen:</th>
|
||||
<td>
|
||||
<p><i class="mr-1 fas <?=($contract->owner->allow_contact) ? "fa-check text-success" : "fa-xmark-large text-danger"?>"></i> Informationen per Post/Email/Telefon</p>
|
||||
<p><i class="mr-1 fas <?=($contract->owner->allow_spin) ? "fa-check text-success" : "fa-xmark-large text-danger"?>"></i>Auskunft mit Service PIN</p>
|
||||
</td>
|
||||
</tr>
|
||||
<?php if($contract->billingaddress_id): ?>
|
||||
<tr>
|
||||
<td colspan="2" class="bg-white"><h4>Rechungsempfänger</h4></td>
|
||||
</tr><tr>
|
||||
<th>ID:</th>
|
||||
<td><a href="<?=self::getUrl("Address", "View", ["id" => $contract->billingaddress->id])?>"><?=$contract->billingaddress->id?></a></td>
|
||||
</tr><tr>
|
||||
<th>Kundennummer:</th>
|
||||
<td><?=$contract->billingaddress->customer_number?></td>
|
||||
</tr><tr>
|
||||
<th>Adresse:</th>
|
||||
<td>
|
||||
<?=($contract->billingaddress->company) ? nl2br($contract->billingaddress->company)."<br />" : ""?>
|
||||
<?php if($contract->billingaddress->firstname || $contract->billingaddress->lastname): ?><?=$contract->billingaddress->firstname?> <?=$contract->billingaddress->lastname?><br /><?php endif; ?>
|
||||
<?=$contract->billingaddress->street?><br />
|
||||
<?=$contract->billingaddress->zip?> <?=$contract->billingaddress->city?>
|
||||
<?=($contract->billingaddress->country) ? "<br />".$contract->billingaddress->country : "" ?>
|
||||
</td>
|
||||
</tr><tr>
|
||||
<th>Kontakt:</th>
|
||||
<td>
|
||||
<?=($contract->billingaddress->phone) ? "Telefon: ".$contract->billingaddress->phone."<br />" : ""?>
|
||||
<?=($contract->billingaddress->mobile) ? "Mobil: ".$contract->billingaddress->mobile."<br />" : ""?>
|
||||
<?=($contract->billingaddress->fax) ? "Fax: ".$contract->billingaddress->fax."<br />" : ""?>
|
||||
<?=($contract->billingaddress->email) ? "Email: ".$contract->billingaddress->email."<br />" : ""?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endif; ?>
|
||||
</table>
|
||||
|
||||
<h4>Vertrag</h4>
|
||||
<table class="table table-sm table-striped view-table">
|
||||
<tr>
|
||||
<th style="max-width: 50vw;">Matchcode:</th>
|
||||
<td style="width: 50vw;"><?=$contract->matchcode?></td>
|
||||
</tr><tr>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Vertragsinhaber:</th>
|
||||
<td><a href="<?=self::getUrl("Address", "View", ["id" => $contract->owner->id])?>"><?=$contract->owner->getCompanyOrName()?> (<?=$contract->owner->customer_number?>)</a></td>
|
||||
</tr>
|
||||
<?php if($contract->billingaddress_id): ?>
|
||||
<tr>
|
||||
<th>Rechnungsempfänger:</th>
|
||||
<td><a href="<?=self::getUrl("Address", "View", ["id" => $contract->owner->id])?>"><?=$contract->billingaddress->getCompanyOrName()?> (<?=$contract->billingaddress->customer_number?>)</a></td>
|
||||
</tr>
|
||||
<?php endif; ?>
|
||||
<tr>
|
||||
<th>Produkt:</th>
|
||||
<td><?=$contract->product_name?></td>
|
||||
</tr><tr>
|
||||
<th>Produkt Info:</th>
|
||||
<td><?=$contract->product_info?></td>
|
||||
</tr><tr>
|
||||
</tr>
|
||||
<!-- upgrades -->
|
||||
<?php if(is_array($contract->upgradeFrom) && count($contract->upgradeFrom)): ?>
|
||||
<tr>
|
||||
<th>Upgrade von:</th>
|
||||
<td>
|
||||
<?php foreach($contract->upgradeFrom as $link): ?>
|
||||
<a href="<?=self::getUrl("Contract", "View", ["id" => $link->origin_contract_id])?>" class="contract-link <?=($link->origin->cancel_date <= date('U')) ? "canceled" : ""?>"><?=$link->origin->product_name?> [<?=$link->origin->matchcode?>] (<?=$link->origin_contract_id?>)</a><br />
|
||||
<?php endforeach; ?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endif; ?>
|
||||
<?php if(is_array($contract->upgradeTo) && count($contract->upgradeTo)): ?>
|
||||
<tr>
|
||||
<th>Upgrade auf:</th>
|
||||
<td>
|
||||
<?php foreach($contract->upgradeTo as $link): ?>
|
||||
<a href="<?=self::getUrl("Contract", "View", ["id" => $link->contract_id])?>"><?=$link->contract->product_name?> [<?=$link->contract->matchcode?>] (<?=$link->contract_id?>)</a><br />
|
||||
<?php endforeach; ?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endif; ?>
|
||||
|
||||
<!-- downgrades -->
|
||||
<?php if(is_array($contract->downgradeFrom) && count($contract->downgradeFrom)): ?>
|
||||
<tr>
|
||||
<th>Downgrade von:</th>
|
||||
<td>
|
||||
<?php foreach($contract->downgradeFrom as $link): ?>
|
||||
<a href="<?=self::getUrl("Contract", "View", ["id" => $link->origin_contract_id])?>" class="contract-link <?=($link->origin->cancel_date <= date('U')) ? "canceled" : ""?>"><?=$link->origin->product_name?> [<?=$link->origin->matchcode?>] (<?=$link->origin_contract_id?>)</a><br />
|
||||
<?php endforeach; ?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endif; ?>
|
||||
<?php if(is_array($contract->downgradeTo) && count($contract->downgradeTo)): ?>
|
||||
<tr>
|
||||
<th>Downgrade auf:</th>
|
||||
<td>
|
||||
<?php foreach($contract->downgradeTo as $link): ?>
|
||||
<a href="<?=self::getUrl("Contract", "View", ["id" => $link->contract_id])?>"><?=$link->contract->product_name?> [<?=$link->contract->matchcode?>] (<?=$link->contract_id?>)</a><br />
|
||||
<?php endforeach; ?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endif; ?>
|
||||
|
||||
<!-- productchange -->
|
||||
<?php if(is_array($contract->productchangeFrom) && count($contract->productchangeFrom)): ?>
|
||||
<tr>
|
||||
<th>Produktwechsel von:</th>
|
||||
<td>
|
||||
<?php foreach($contract->productchangeFrom as $link): ?>
|
||||
<a href="<?=self::getUrl("Contract", "View", ["id" => $link->origin_contract_id])?>" class="contract-link <?=($link->origin->cancel_date <= date('U')) ? "canceled" : ""?>"><?=$link->origin->product_name?> [<?=$link->origin->matchcode?>] (<?=$link->origin_contract_id?>)</a><br />
|
||||
<?php endforeach; ?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endif; ?>
|
||||
<?php if(is_array($contract->productchangeTo) && count($contract->productchangeTo)): ?>
|
||||
<tr>
|
||||
<th>Produktwechsel auf:</th>
|
||||
<td>
|
||||
<?php foreach($contract->productchangeTo as $link): ?>
|
||||
<a href="<?=self::getUrl("Contract", "View", ["id" => $link->contract_id])?>"><?=$link->contract->product_name?> [<?=$link->contract->matchcode?>] (<?=$link->contract_id?>)</a><br />
|
||||
<?php endforeach; ?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endif; ?>
|
||||
|
||||
<!-- relocation -->
|
||||
<?php if(is_array($contract->relocationFrom) && count($contract->relocationFrom)): ?>
|
||||
<tr>
|
||||
<th>Umzug von:</th>
|
||||
<td>
|
||||
<?php foreach($contract->relocationFrom as $link): ?>
|
||||
<a href="<?=self::getUrl("Contract", "View", ["id" => $link->origin_contract_id])?>" class="contract-link <?=($link->origin->cancel_date && $link->origin->cancel_date <= date('U')) ? "canceled" : ""?>"><?=$link->origin->product_name?> [<?=$link->origin->matchcode?>] (<?=$link->origin_contract_id?>)</a><br />
|
||||
<?php endforeach; ?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endif; ?>
|
||||
<?php if(is_array($contract->relocationTo) && count($contract->relocationTo)): ?>
|
||||
<tr>
|
||||
<th>Umzug auf:</th>
|
||||
<td>
|
||||
<?php foreach($contract->relocationTo as $link): ?>
|
||||
<a href="<?=self::getUrl("Contract", "View", ["id" => $link->contract_id])?>"><?=$link->contract->product_name?> [<?=$link->contract->matchcode?>] (<?=$link->contract_id?>)</a><br />
|
||||
<?php endforeach; ?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endif; ?>
|
||||
|
||||
<tr>
|
||||
<th>SLA:</th>
|
||||
<td><?=$contract->sla->name?></td>
|
||||
</tr><tr>
|
||||
@@ -157,14 +189,60 @@
|
||||
<th>Erstellt:</th>
|
||||
<td class="text-monospace"><?=date('d.m.Y H:i:s',$contract->create)?> (<?=$contract->creator->name?>)</td>
|
||||
</tr><tr>
|
||||
<th>Zuletzte bearbeitet:</th>
|
||||
<th>Zuletzt bearbeitet:</th>
|
||||
<td class="text-monospace"><?=date('d.m.Y H:i:s',$contract->edit)?> (<?=$contract->editor->name?>)</td>
|
||||
</tr><tr class="bg-white">
|
||||
<td colspan="2" class="text-center">
|
||||
<a href="<?=self::getUrl("Contractconfig", "edit", ["contract_id" => $contract->id])?>"><button type="button" class="btn btn-sm btn-outline-info">Konfiguration bearbeiten</button></a>
|
||||
<button type="button" class="btn btn-sm btn-outline-secondary">Inhaberwechsel</button>
|
||||
<button type="button" class="btn btn-sm btn-outline-success">Produkt-/Standortwechsel</button>
|
||||
<button type="button" class="btn btn-sm btn-outline-danger">Kündigen</button>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php if((is_array($contract->linkFrom) && count($contract->linkFrom)) || (is_array($contract->linkTo) && count($contract->linkTo))): ?>
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<h4>Verknüpfte Verträge</h4>
|
||||
|
||||
<table class="table table-striped table-sm table-bordered">
|
||||
<tr>
|
||||
<th>Kunde</th>
|
||||
<th>Contract ID</th>
|
||||
<th>Produkt</th>
|
||||
<th>Matchcode</th>
|
||||
<th></th>
|
||||
</tr>
|
||||
<?php foreach($contract->links as $link): ?>
|
||||
<?php
|
||||
|
||||
if($link->contract_id == $contract->id) {
|
||||
$linkcontract = $link->origin;
|
||||
} else {
|
||||
$linkcontract = $link->contract;
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
<tr>
|
||||
<td><a href="<?=self::getUrl("Address", "View", ["id" => $linkcontract->owner_id])?>"><?=$linkcontract->owner->getCompanyOrName()?></a></td>
|
||||
<td><a href="<?=self::getUrl("Contract", "View", ["id" => $linkcontract->id])?>"><?=$linkcontract->id?></a></td>
|
||||
<td><a href="<?=self::getUrl("Contract", "View", ["id" => $linkcontract->id])?>"><?=$linkcontract->product->name?></a></td>
|
||||
<td><a href="<?=self::getUrl("Contract", "View", ["id" => $linkcontract->id])?>"><?=$linkcontract->matchcode?></a></td>
|
||||
<td>
|
||||
<a href="<?=self::getUrl("Contract", "deleteLink", ["link_id" => $link->id])?>" onclick="if(!confirm('Verknüpfung wirklich entfernen?')) return false;" class="text-danger" title="Verknüpfung entfernen"><i class="fas fa-xmark-large"></i></a>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
<!--
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<h4>Konfiguration</h4>
|
||||
@@ -190,7 +268,7 @@
|
||||
<a href="#" class="btn btn-sm btn-outline-primary">Konfiguration bearbeiten</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>-->
|
||||
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
|
||||
Reference in New Issue
Block a user