454 lines
27 KiB
PHP
454 lines
27 KiB
PHP
<?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("Contract")?>">Aktive Produkte</a></li>
|
|
<li class="breadcrumb-item active"><?=$contract->product_name?> [<?=$contract->matchcode?>]</li>
|
|
</ol>
|
|
</div>
|
|
<h4 class="page-title">Aktives Produkt</h4>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<!-- end page title -->
|
|
|
|
<div class="row">
|
|
<div class="col-lg-12">
|
|
|
|
<div class="card">
|
|
<div class="card-body">
|
|
<a href="<?=self::getUrl("Contract","Index")?>" class="btn btn-sm btn-secondary mr-1"><i class="fas fa-list"></i> Zurück zur Vertragsübersicht</a>
|
|
<a href="<?=self::getUrl("Contract","edit", ['contract_id' => $contract->id, 'f' => "view"])?>" class="btn btn-sm btn-outline-success"><i class="fas fa-edit"></i> Vertrag bearbeiten</a>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="card border-top-success">
|
|
<div class="card-body">
|
|
<?php if(!$contract->isFinished()): ?>
|
|
<h2 class="text-center mb-3 text-secondary">In Herstellung</h2>
|
|
<?php endif; ?>
|
|
<?php if($contract->isCancelled()): ?>
|
|
<h2 class="text-center mb-3 text-danger">GEKÜNDIGT</h2>
|
|
<?php endif; ?>
|
|
<?php if(str_contains(strtolower($contract->sla->name), "residential")): ?>
|
|
<h2 class="text-center mb-3 text-dark-red">Privatprodukt</h2>
|
|
<?php else: ?>
|
|
<h2 class="text-center mb-3 text-primary">Businessprodukt</h2>
|
|
<?php endif; ?>
|
|
<h3 class="text-center mb-3 <?=($contract->isCancelled()) ? "canceled" : ""?>"><?=$contract->product_name?> [<?=$contract->id?>]</h3>
|
|
|
|
<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>
|
|
<!-- 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", ["contract_id" => $link->origin_contract_id])?>" class="contract-link <?=($link->origin->cancel_date && $link->origin->cancel_date <= date('U')) ? "canceled" : ""?>"><?=$link->origin->product_name?> [<?=$link->origin->matchcode?>] (<?=$link->origin_contract_id?>)</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", ["contract_id" => $link->contract_id])?>" class="contract-link <?=($link->contract->cancel_date && $link->contract->cancel_date <= date('U')) ? "canceled" : ""?>"><?=$link->contract->product_name?> [<?=$link->contract->matchcode?>] (<?=$link->contract_id?>)</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", ["contract_id" => $link->origin_contract_id])?>" class="contract-link <?=($link->origin->cancel_date <= date('U')) ? "canceled" : ""?>"><?=$link->origin->product_name?> [<?=$link->origin->matchcode?>] (<?=$link->origin_contract_id?>)</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", ["contract_id" => $link->contract_id])?>" class="contract-link <?=($link->contract->cancel_date && $link->contract->cancel_date <= date('U')) ? "canceled" : ""?>"><?=$link->contract->product_name?> [<?=$link->contract->matchcode?>] (<?=$link->contract_id?>)</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", ["contract_id" => $link->origin_contract_id])?>" class="contract-link <?=($link->origin->cancel_date <= date('U')) ? "canceled" : ""?>"><?=$link->origin->product_name?> [<?=$link->origin->matchcode?>] (<?=$link->origin_contract_id?>)</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", ["contract_id" => $link->contract_id])?>" class="contract-link <?=($link->contract->cancel_date && $link->contract->cancel_date <= date('U')) ? "canceled" : ""?>"><?=$link->contract->product_name?> [<?=$link->contract->matchcode?>] (<?=$link->contract_id?>)</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", ["contract_id" => $link->origin_contract_id])?>" class="contract-link <?=($link->origin->cancel_date && $link->origin->cancel_date <= date('U')) ? "canceled" : ""?>"><?=$link->origin->product_name?> [<?=$link->origin->matchcode?>] (<?=$link->origin_contract_id?>)</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", ["contract_id" => $link->contract_id])?>" class="contract-link <?=($link->contract->cancel_date && $link->contract->cancel_date <= date('U')) ? "canceled" : ""?>"><?=$link->contract->product_name?> [<?=$link->contract->matchcode?>] (<?=$link->contract_id?>)</a><br />
|
|
<?php endforeach; ?>
|
|
</td>
|
|
</tr>
|
|
<?php endif; ?>
|
|
<tr>
|
|
<th>Vertragsinhaber:</th>
|
|
<td><a href="<?=self::getUrl("Address", "View", ["id" => $contract->owner_id])?>"><?=$contract->owner->getCompanyOrName()?></a> [<?=$contract->owner->customer_number?>]</td>
|
|
</tr>
|
|
<?php if($contract->billingaddress_id): ?>
|
|
<tr>
|
|
<th>Rechnungsempfänger:</th>
|
|
<td><a href="<?=self::getUrl("Address", "View", ["id" => $contract->billingaddress_id])?>"><?=$contract->billingaddress->getCompanyOrName()?></a> [<?=$contract->billingaddress->customer_number?>]</td>
|
|
</tr>
|
|
<?php endif; ?>
|
|
<tr>
|
|
<th>Produkt:</th>
|
|
<td><?=$contract->product_name?> [<?=$contract->product_id?>]<?=($contract->product_name != $contract->product->name) ? " <i>(".$contract->product->name.")</i>" : ""?></td>
|
|
</tr><tr>
|
|
<th>Produkt Info:</th>
|
|
<td><?=$contract->product_info?></td>
|
|
</tr>
|
|
|
|
|
|
<tr>
|
|
<th>SLA:</th>
|
|
<td><?=$contract->sla->name?></td>
|
|
</tr><tr>
|
|
<th>Externes Produkt:</th>
|
|
<td><?=($contract->product_external) ? "Ja" : "Nein"?></td>
|
|
</tr><tr>
|
|
<th>Menge:</th>
|
|
<td><?=(float)number_format($contract->amount, 3, ",", ".")?></td>
|
|
</tr>
|
|
<tr>
|
|
<th>Preis Periodisch Netto:</th>
|
|
<td class="<?=($contract->price < 0) ? "text-danger" : ""?>">€ <?=number_format(($contract->amount != 1) ? $contract->price * $contract->amount : $contract->price, 4, ",", ".")?></td>
|
|
</tr><tr>
|
|
<th>Preis Periodisch Brutto:</th>
|
|
<td class="<?=($contract->price < 0) ? "text-danger" : ""?>">€
|
|
<?php if($contract->price && $contract->vatrate): ?>
|
|
<?php if($contract->amount != 1): ?>
|
|
<?=number_format($contract->price + ($contract->price / 100) * $contract->vatrate, 4, ",", ".")?>
|
|
<?php else: ?>
|
|
<?=number_format(($contract->price + ($contract->price / 100) * $contract->vatrate) * $contract->amount, 4, ",", ".")?>
|
|
<?php endif; ?>
|
|
<?php endif; ?>
|
|
</td>
|
|
</tr><tr>
|
|
<th>Verrechnungsperiode:</th>
|
|
<td>
|
|
<?=__($contract->billing_period, "billing_period")?>
|
|
</td>
|
|
</tr><tr>
|
|
<th>Herstellungskosten:</th>
|
|
<td class="<?=($contract->price_setup < 0) ? "text-danger" : ""?>">
|
|
<?php if($contract->price_setup > 0): ?>
|
|
Netto: € <?=number_format($contract->price_setup, 4, ",", ".")?><?=($contract->amount != 1) ? " (Gesamt: € ".number_format($contract->price_setup * $contract->amount, 4, ",", ".").")" : ""?><br />
|
|
Brutto: € <?=($contract->price_setup && $contract->vatrate) ? number_format($contract->price_setup + ($contract->price_setup / 100) * $contract->vatrate, 4, ",", ".") : ""?><?=($contract->price_setup && $contract->vatrate && $contract->amount != 1) ? " (Gesamt: € ".number_format(($contract->price_setup + ($contract->price_setup / 100) * $contract->vatrate) * $contract->amount, 4, ",", ".").")" : ""?></td>
|
|
<?php endif; ?>
|
|
</tr><tr>
|
|
<th>Verrechnungsstart Verzögerung:</th>
|
|
<td>
|
|
<?php if($contract->billing_delay): ?>
|
|
<?=$contract->billing_delay?> Monate
|
|
<?php endif; ?>
|
|
</td>
|
|
</tr><tr>
|
|
<th></th>
|
|
<td></td>
|
|
</tr><tr>
|
|
<th>Bestelldatum:</th>
|
|
<td class="text-monospace"><?=($contract->order_date) ? date('d.m.Y',$contract->order_date) : ""?></td>
|
|
</tr><tr>
|
|
<th>Fertigstellungsdatum:</th>
|
|
<td class="text-monospace">
|
|
<?=($contract->finish_date) ? date('d.m.Y',$contract->finish_date) : ""?>
|
|
<?=($contract->finish_date_by) ? "(".$contract->finisher->name.")" : ""?>
|
|
</td>
|
|
</tr><tr>
|
|
<th>Kündigungsdatum:</th>
|
|
<td class="text-monospace <?=($contract->cancel_date) ? "text-danger font-weight-bold" : ""?>">
|
|
<?=($contract->cancel_date) ? date('d.m.Y',$contract->cancel_date) : ""?>
|
|
<?=($contract->cancel_date_by) ? "(".$contract->canceler->name.")" : ""?>
|
|
</td>
|
|
</tr><tr>
|
|
<th></th>
|
|
<td></td>
|
|
</tr><tr>
|
|
<th>Erstellt:</th>
|
|
<td class="text-monospace"><?=date('d.m.Y H:i:s',$contract->create)?> (<?=$contract->creator->name?>)</td>
|
|
</tr><tr>
|
|
<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"><i class="far fa-list-dropdown fa-fw"></i> Konfiguration bearbeiten</button></a>
|
|
<a href="<?=self::getUrl("Contractaccessletter", "view", ["contract_id" => $contract->id])?>"><button type="button" class="btn btn-sm btn-outline-success"><i class="far fa-list-numeric fa-fw"></i> Zugangsdaten anzeigen</button></a>
|
|
<?php if($contract->finish_date && $contract->finish_date < date('U')): ?>
|
|
<button type="button" class="btn btn-sm btn-outline-secondary"><i class="far fa-people-arrows fa-fw"></i> Inhaberwechsel</button>
|
|
<a href="<?=self::getUrl("Contract", "productchange", ["contract_id" => $contract->id])?>"><button type="button" class="btn btn-sm btn-outline-purple"><i class="far fa-truck-container fa-fw"></i> Produkt-/Standortwechsel</button></a>
|
|
<a href="<?=self::getUrl("Contract", "cancel", ["contract_id" => $contract->id])?>"><button type="button" class="btn btn-sm btn-outline-danger"><i class="far fa-axe fa-fw"></i> Kündigen</button></a>
|
|
<?php else: ?>
|
|
<a href="<?=self::getUrl("Contract", "finishContract", ['contract_id' => $contract->id])?>" onclick="if(!confirm('Jetzt fertigstellen und in Verrechnung geben?')) return false"><button type="button" class="btn btn-sm btn-success"><i class="far fa-face-confused fa-fw"></i> Fertigstellen</button></a>
|
|
<?php endif; ?>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
|
|
</div>
|
|
</div>
|
|
|
|
|
|
<div class="card border-top-warning">
|
|
<div class="card-header">
|
|
<h5>Journaleinträge</h5>
|
|
</div>
|
|
<div class="card-body">
|
|
<div class="row justify-content-center">
|
|
<div class="col-8">
|
|
|
|
<table class="table table-striped table-sm journal">
|
|
<?php if(is_array($contract->journals) && count($contract->journals)): ?>
|
|
<?php foreach($contract->journals as $j): ?>
|
|
<tr>
|
|
<td style="white-space: nowrap" class="text-monospace"><?=date("d.m.Y H:i", $j->create)?> (<?=$j->creator?>)</td>
|
|
|
|
<?php if($j->type == "text" || $j->type == "phone"):?>
|
|
<td>
|
|
<?php if($j->type == "text"): ?>
|
|
<i class="fas fa-align-left bg-warning text-white p-1" title="Kommentar"></i>
|
|
<?php else: ?>
|
|
<i class="fas fa-phone bg-warning text-white p-1" title="Anruf"></i>
|
|
<?php endif; ?>
|
|
</td>
|
|
<?php if(strlen($j->text) > 120): ?>
|
|
<td style="width: 100%" class="pointer" onclick="toggleTruncatedJournalText(<?=$j->id?>)">
|
|
<span id="truncated-<?=$j->id?>"><i class="fas fa-caret-right"></i> <?=self::strtrim(str_replace(["\n", "\r", "\t"]," ", $j->text), 120)?></span>
|
|
<span id="fulltext-<?=$j->id?>" class="hidden"><?=nl2br(htmlentities($j->text))?></span>
|
|
</td>
|
|
<?php else: ?>
|
|
<td style="width: 100%">
|
|
<?=str_replace(["\n", "\r", "\t"]," ", $j->text)?>
|
|
</td>
|
|
<?php endif; ?>
|
|
</td>
|
|
|
|
<?php elseif($j->type == "file"): ?>
|
|
<td><i class="fas fa-download bg-primary text-white p-1" title="Dateiupload"></i></td>
|
|
<td style="width: 100%">
|
|
<?php if($j->text): ?>
|
|
<?=self::strtrim(str_replace(["\n", "\r", "\t"]," ", $j->text), 128)?><br />
|
|
<?php endif; ?>
|
|
<a class="text-monospace" href="<?=self::getUrl("File", "download", ["id" => $j->contractfile->file_id])?>"><?=$j->contractfile->name?></a>
|
|
</td>
|
|
|
|
<?php elseif($j->type == "created_from"): ?>
|
|
<td><i class="fas fa-cogs text-secondary pl-1"></i></td>
|
|
<td style="width: 100%">
|
|
<?php if($j->value == "manual"): ?>
|
|
<em>Vertrag manuell angelegt</em>
|
|
<?php elseif($j->value == "import"): ?>
|
|
<em>Vertrag importiert: <?=nl2br(htmlentities($j->text))?>
|
|
<?php elseif($j->value == "order"): ?>
|
|
<em>Vertrag aus Bestellung <a href="<?=self::getUrl("Order", "edit", ["id" => $contract->orderproduct->order_id])?>">#<?=$contract->orderproduct->order_id?></a> erstellt
|
|
<?php endif; ?>
|
|
</td>
|
|
<?php elseif($j->type == "contract_finished"): ?>
|
|
<td><i class="fas fa-flag-checkered text-success pl-1"></i></td>
|
|
<td style="width: 100%"><em>Vertag fertiggestellt</em>
|
|
|
|
</td>
|
|
<?php elseif($j->type == "credit_created"): ?>
|
|
<td><i class="far fa-money-bill-simple-wave text-secondary pl-1"></i></td>
|
|
<td style="width: 100%"><em>Gutschrift-Vertrag <a href="<?=self::getUrl("Contract", "View", ["contract_id" => $j->value])?>"><?=$j->value?></a> erstellt</em>
|
|
|
|
</td>
|
|
<?php elseif($j->type == "link"): ?>
|
|
<?php $link = new Contract($j->value); ?>
|
|
<td><i class="fas fa-link text-secondary pl-1"></i></td>
|
|
<td style="width: 100%"><em>Verknüpfung mit <a href="<?=self::getUrl("Contract", "view", ['contract_id' => $link->id])?>"><?=$link->id?> - <?=$link->product_name?> [<?=$link->matchcode?>]</a> erstellt</em></td>
|
|
|
|
<?php endif; ?>
|
|
<td style="white-space: nowrap">
|
|
<a href="<?=self::getUrl("Contractjournal", "edit", ["journal_id" => $j->id])?>" title="Journaleintrag bearbeiten"><i class="fas fa-edit"></i></a>
|
|
</td>
|
|
</tr>
|
|
<?php endforeach; ?>
|
|
<?php endif; ?>
|
|
|
|
<tr>
|
|
<td colspan="4">
|
|
<div class="ml-3"><button type="button" class="btn btn-sm btn-info" onclick="$('#new-journal').toggle()"><i class="fas fa-plus"></i> Journaleintrag hinzufügen</button></div>
|
|
<div id="new-journal" class="card-body hidden border-top mt-2">
|
|
<form method="post" action="<?=self::getUrl("Contractjournal", "save")?>" enctype="multipart/form-data">
|
|
<input type="hidden" name="contract_id" value="<?=$contract->id?>">
|
|
|
|
<label for="new_journal_type" class="form-label">Typ</label>
|
|
<select name="type" id="new_journal_type" class="form-control mb-2">
|
|
<option value="phone">Telefongespräch</option>
|
|
<option value="text">Kommentar</option>
|
|
<option value="file">Dateiupload</option>
|
|
</select>
|
|
|
|
<label for="new_journal_text" class="form-label">Text</label>
|
|
<textarea name="text" id="new_journal_text" class="form-control mb-2" style="height:120px;"></textarea>
|
|
|
|
<div id="new-journal-file-container" class="hidden">
|
|
<label for="new_journal_file" class="form-label">Dateianhang</label>
|
|
<input type="file" name="journal_file" id="new_journal_file" class="form-control mb-2" />
|
|
</div>
|
|
|
|
<button class="btn btn-sm btn-primary" type="submit"><i class="fas fa-save mr-1"></i> Speichern</button>
|
|
</form>
|
|
</div>
|
|
</td>
|
|
</tr>
|
|
|
|
|
|
</table>
|
|
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
|
|
<div class="card border-top-success">
|
|
<div class="card-body">
|
|
<h4>Verknüpfte Verträge <small><a href="<?=self::getUrl("Contract", "add", ["origin_contract_id" => $contract->id])?>"><i class="fas fa-plus"></i>Neuen Contract anlegen</a></small></h4>
|
|
<?php if((is_array($contract->linkFrom) && count($contract->linkFrom)) || (is_array($contract->linkTo) && count($contract->linkTo))): ?>
|
|
<table class="table table-striped table-sm table-bordered table-hover">
|
|
<tr>
|
|
<th>Typ</th>
|
|
<th>Kunde</th>
|
|
<th>Contract ID</th>
|
|
<th>Produkt</th>
|
|
<th>Preis</th>
|
|
<th>Preis Setup</th>
|
|
<th>Bestelldatum</th>
|
|
<th>Fertigstellung</th>
|
|
<th>Kündigung</th>
|
|
<th></th>
|
|
</tr>
|
|
<?php foreach([$contract->linkFrom, $contract->linkTo] as $links): ?>
|
|
<?php foreach($links as $link): ?>
|
|
<?php
|
|
|
|
if($link->contract_id == $contract->id) {
|
|
$direction = "von";
|
|
$linkcontract = $link->origin;
|
|
if($link->type == "credit") {
|
|
$direction = "zu";
|
|
//continue;
|
|
}
|
|
} else {
|
|
$linkcontract = $link->contract;
|
|
if($link->type == "upgrade" || $link->type == "downgrade") {
|
|
$direction = "auf";
|
|
}
|
|
if($link->type == "relocation") {
|
|
$direction = "nach";
|
|
}
|
|
if($link->type == "credit") {
|
|
$direction = "";
|
|
//continue;
|
|
}
|
|
|
|
}
|
|
|
|
?>
|
|
<tr>
|
|
<td class="contract <?=($linkcontract->isCancelled()) ? "canceled" : ""?>"><?=__($link->type, "contract")?> <?=($link->type != "link") ? $direction : ""?></td>
|
|
<td><a href="<?=self::getUrl("Address", "View", ["id" => $linkcontract->owner_id])?>"><?=$linkcontract->owner->getCompanyOrName()?></a></td>
|
|
<td class="contract <?=($linkcontract->isCancelled()) ? "canceled" : ""?> <?=(!$linkcontract->isFinished()) ? "not-finished" : "" ?>"><a href="<?=self::getUrl("Contract", "View", ["contract_id" => $linkcontract->id])?>"><?=$linkcontract->id?></a></td>
|
|
|
|
<td class="contract <?=($linkcontract->isCancelled()) ? "canceled" : ""?> <?=(!$linkcontract->isFinished()) ? "not-finished" : "" ?>"><a href="<?=self::getUrl("Contract", "View", ["contract_id" => $linkcontract->id])?>"><?=$linkcontract->product_name?> [<?=$linkcontract->matchcode?>]</a></td>
|
|
<td class="contract <?=($linkcontract->isCancelled()) ? "canceled" : "" ?> <?=(!$linkcontract->isFinished()) ? "not-finished" : "" ?> <?=($linkcontract->price < 0) ? "text-danger" : ""?>">€ <?=number_format($linkcontract->price,4,",",".")?></td>
|
|
<td class="contract <?=($linkcontract->isCancelled()) ? "canceled" : "" ?> <?=(!$linkcontract->isFinished()) ? "not-finished" : "" ?> <?=($linkcontract->price_setup < 0) ? "text-danger" : ""?>">€ <?=number_format($linkcontract->price_setup,4,",",".")?></td>
|
|
<td class="contract <?=($linkcontract->isCancelled()) ? "canceled" : ""?> <?=(!$linkcontract->isFinished()) ? "not-finished" : "" ?>"><?=($linkcontract->order_date) ? date('d.m.Y', $linkcontract->order_date) : ""?></td>
|
|
<td class="contract <?=($linkcontract->isCancelled()) ? "canceled" : ""?> <?=(!$linkcontract->isFinished()) ? "not-finished" : "" ?>"><?=($linkcontract->finish_date) ? date('d.m.Y', $linkcontract->finish_date) : ""?></td>
|
|
<td class="contract <?=($linkcontract->isCancelled()) ? "canceled" : ""?> <?=(!$linkcontract->isFinished()) ? "not-finished" : "" ?> <?=($linkcontract->cancel_date) ? "text-danger font-weight-bold" : ""?>"><?=($linkcontract->cancel_date) ? date('d.m.Y', $linkcontract->cancel_date) : ""?></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 endif; ?>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
<div class="card">
|
|
<div class="card-body">
|
|
<a href="<?=self::getUrl("Contract","Index", ['filter' => $filter, 's' => $s])?>" class="btn btn-sm btn-secondary mr-1"><i class="fas fa-list"></i> Zurück zur Vertragsübersicht</a>
|
|
<a href="<?=self::getUrl("Contract","edit", ['contract_id' => $contract->id, 'filter' => $filter, 's' => $s, 'f' => "view"])?>" class="btn btn-sm btn-outline-success"><i class="fas fa-edit"></i> Vertrag bearbeiten</a>
|
|
</div>
|
|
</div>
|
|
|
|
</div>
|
|
</div>
|
|
|
|
<script>
|
|
$(document).ready(function () {
|
|
$('#new_journal_type').change(function() {
|
|
if($('#new_journal_type').val() == "file") {
|
|
$('#new-journal-file-container').show();
|
|
} else {
|
|
$('#new-journal-file-container').hide();
|
|
}
|
|
});
|
|
});
|
|
|
|
|
|
function toggleTruncatedJournalText(id) {
|
|
$("#truncated-" + id).toggle();
|
|
$("#fulltext-" + id).toggle();
|
|
}
|
|
</script>
|
|
<?php include(realpath(dirname(__FILE__)."/../../$mfLayoutPackage")."/footer.php"); ?>
|