371 lines
20 KiB
PHP
371 lines
20 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="javascript: void(0);"><?=MFAPPNAME_SLUG?></a></li>
|
|
<li class="breadcrumb-item"><a href="javascript: void(0);">Personen & Firmen</a></li>
|
|
<li class="breadcrumb-item active"><?=$address->getCompanyOrName()?> [<?=$address->customer_number?>]</li>
|
|
</ol>
|
|
</div>
|
|
<h4 class="page-title">Personen & Firmen</h4>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<!-- end page title -->
|
|
|
|
<div class="row">
|
|
<div class="col-lg-12">
|
|
|
|
<div class="card">
|
|
<div class="card-body">
|
|
<div class="float-left">
|
|
<a href="<?=self::getUrl("Address","Index", ['s' => $s])?>" class="btn btn-secondary mr-1"><i class="fas fa-list"></i> Zurück zur Übersicht</a>
|
|
<a href="<?=self::getUrl("Address","edit", ['id' => $address->id, 's' => $s, 'f' => "view"])?>" class="btn btn-outline-success"><i class="fas fa-edit"></i> Adresse bearbeiten</a>
|
|
</div>
|
|
<div class="float-right">
|
|
<a href="<?=self::getUrl("Address","TicketsAndShippingNote", ["address_id" => $address->id])?>" class="btn btn-purple mr-1"><i class="far fa-user-headset"></i> Tickets und LS</a>
|
|
<a href="<?=self::getUrl("Address","invoice", ["address_id" => $address->id])?>" class="btn btn-purple mr-1"><i class="far fa-file-invoice-dollar"></i> Rechungsübersicht</a>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="row">
|
|
<div class="col-8">
|
|
|
|
<div class="card border-top-primary">
|
|
<div class="card-body">
|
|
<h3 class="text-center mb-3"><?=$address->getCompanyOrName()?><?=($address->customer_number) ? " [".$address->customer_number."]" : ""?></h3>
|
|
|
|
<table class="table table-sm table-striped view-table">
|
|
<tr>
|
|
<th>Kundennummer</th>
|
|
<td><?=$address->customer_number?></td>
|
|
</tr><tr>
|
|
<th>Firmenname</th>
|
|
<td><?=nl2br($address->company)?></td>
|
|
</tr><tr>
|
|
<th>Vorname</th>
|
|
<td><?=$address->firstname?></td>
|
|
</tr><tr>
|
|
<th>Nachname</th>
|
|
<td><?=$address->lastname?></td>
|
|
</tr><tr>
|
|
<th>Straße</th>
|
|
<td><?=$address->street?></td>
|
|
</tr><tr>
|
|
<th>PLZ / Ort</th>
|
|
<td><?=$address->zip?> <?=$address->city?></td>
|
|
</tr><tr>
|
|
<th>Land</th>
|
|
<td><?=$address->country->name?></td>
|
|
</tr><tr>
|
|
<th>Telefon</th>
|
|
<td><?=$address->phone?></td>
|
|
</tr><tr>
|
|
<th>Mobil</th>
|
|
<td><?=$address->mobile?></td>
|
|
</tr><tr>
|
|
<th>Fax</th>
|
|
<td><?=$address->fax?></td>
|
|
</tr><tr>
|
|
<th>Email</th>
|
|
<td><?=$address->email?></td>
|
|
</tr><tr>
|
|
<th>Geburtsdatum</th>
|
|
<td><?=($address->birthdate) ? (new DateTime($address->birthdate))->format("d.m.Y") : ""?></td>
|
|
</tr><tr>
|
|
<th>Interne Notiz</th>
|
|
<td><?=nl2br($address->note)?></td>
|
|
</tr><tr>
|
|
<th></th>
|
|
<td></td>
|
|
</tr><tr>
|
|
<th>Service PIN</th>
|
|
<td><?=$address->spin?></td>
|
|
</tr><tr>
|
|
<th>Einwilligungen</th>
|
|
<td>
|
|
<p><i class="mr-1 fas <?=($address->allow_contact) ? "fa-check text-success" : "fa-xmark-large text-danger"?>"></i> Informationen per Post/Email/Telefon</p>
|
|
<p><i class="mr-1 fas <?=($address->allow_spin) ? "fa-check text-success" : "fa-xmark-large text-danger"?>"></i>Auskunft mit Service PIN</p>
|
|
</td>
|
|
</tr><tr>
|
|
<th>Rollen</th>
|
|
<td>
|
|
<?php if(is_array($address->types) && count($address->types)): ?>
|
|
<?php foreach(TT_ROLES as $role): ?>
|
|
<ul>
|
|
<?php if(array_key_exists($role, $address->types)): ?>
|
|
<li><?=__($role)?></li>
|
|
<?php endif; ?>
|
|
</ul>
|
|
<?php endforeach; ?>
|
|
<?php endif; ?>
|
|
</td>
|
|
</tr><tr>
|
|
<td colspan="2">
|
|
<h4>
|
|
Verrechnungsdaten
|
|
<?php if(array_key_exists("billing", $address->links_to) && is_array($address->links_to["billing"]) && count($address->links_to["billing"])): ?>
|
|
(<span class='text-danger'>Achtung: Seperate Rechnungsadresse vorhanden</span>)
|
|
<?php elseif(array_key_exists("billing", $address->linked_as) && is_array($address->linked_as["billing"]) && count($address->linked_as["billing"])): ?>
|
|
<span class='text-success'>(Ist aktive Rechnungsadresse)</span>
|
|
<?php endif; ?>
|
|
|
|
</h4>
|
|
</td>
|
|
</tr><tr>
|
|
<th>UID</th>
|
|
<td><?=$address->uid?></td>
|
|
</tr><tr>
|
|
<th>Verrechnungsart</th>
|
|
<td><?=($address->billing_type == "sepa") ? "SEPA Bankeinzug" : "Rechnung"?></td>
|
|
</tr><tr>
|
|
<th>Rechnungsversand</th>
|
|
<td><?=($address->billing_delivery == "paper" || !$address->billing_delivery) ? "Post" : "Email"?></td>
|
|
</tr><tr>
|
|
<th>Kreditinstitut</th>
|
|
<td><?=$address->bank_account_bank?></td>
|
|
</tr><tr>
|
|
<th>Kontoinhaber</th>
|
|
<td><?=$address->bank_account_owner?></td>
|
|
</tr><tr>
|
|
<th>IBAN</th>
|
|
<td><?php
|
|
$iban = $address->bank_account_iban;
|
|
$iban = preg_replace('/\s+/', '', $iban);
|
|
$iban = chunk_split($iban, 4, ' ');
|
|
$iban = trim($iban);
|
|
echo $iban;
|
|
?></td>
|
|
</tr><tr>
|
|
<th>BIC</th>
|
|
<td><?=$address->bank_account_bic?></td>
|
|
</tr>
|
|
<?php if($me->can("Fibu")): ?>
|
|
<tr>
|
|
<th>Manuelle Rechnungen abbuchen bis (erfordert Bankeinzug)</th>
|
|
<td><?=number_format($address->manual_invoice_sepa_limit, 2, ",", ".")?> €</td>
|
|
</tr>
|
|
<tr>
|
|
<th>Sepa Mandatsdatum</th>
|
|
<td><?=($address->sepa_date) ? date("d.m.Y", $address->sepa_date) : ""?></td>
|
|
</tr>
|
|
<?php endif; ?>
|
|
<tr>
|
|
<td colspan="2"><h4>FIBU</h4></td>
|
|
</tr>
|
|
<tr>
|
|
<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>Verrechnungskonto</th>
|
|
<td><?=$address->fibu_account_number?></td>
|
|
</tr><tr>
|
|
<th>Zahlungsziel</th>
|
|
<td><?=($address->fibu_payment_due) ? $address->fibu_payment_due." Tage" : TT_ADDRESS_DEFAULT_PAYMENT_DUE." Tage"?></td>
|
|
</tr><tr>
|
|
<th>Skontotage</th>
|
|
<td><?=$address->fibu_payment_skonto?></td>
|
|
</tr><tr>
|
|
<th>Skonto %</th>
|
|
<td><?=($address->fibu_payment_skonto_rate) ? $address->fibu_payment_skonto_rate." %" : ""?></td>
|
|
</tr><tr>
|
|
<th>Lieferantenkonto</th>
|
|
<td><?=$address->fibu_supplier_number?></td>
|
|
</tr><tr>
|
|
<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>
|
|
<th>RTR Code</th>
|
|
<td><?=(is_array($address->attributes) && array_key_exists("rtrcode", $address->attributes)) ? $address->attributes['rtrcode']->value : ""?></td>
|
|
</tr>
|
|
<?php if(is_array($address->attributes) && array_key_exists("rtrcode", $address->attributes) && $address->attributes['rml-fibu-account']->value): ?>
|
|
<tr>
|
|
<th>RML FIBU Konto</th>
|
|
<td><?=$address->attributes['rml-fibu-account']->value?></td>
|
|
</tr>
|
|
<?php endif; ?>
|
|
<tr>
|
|
<th></th>
|
|
<td></td>
|
|
</tr><tr>
|
|
<th>Erstellt</th>
|
|
<td class="text-monospace"><?=date("d.m.Y H:i:s", $address->create)?> (<?=$address->creator->name?>)</td>
|
|
</tr><tr>
|
|
<th>Letzte Bearbeitung</th>
|
|
<td class="text-monospace"><?=date("d.m.Y H:i:s", $address->edit)?> (<?=$address->editor->name?>)</td>
|
|
</tr>
|
|
</table>
|
|
|
|
<h4>Verknüpfungen</h4>
|
|
<?php if(is_array($address->links) && count($address->links)): ?>
|
|
<div class="card border-top-warning">
|
|
<div class="card-body" id="link-container">
|
|
<table class="table table-striped table-sm table-bordered">
|
|
<tr>
|
|
<th>Typ</th>
|
|
<th>Firma</th>
|
|
<th>Name</th>
|
|
<th>Telefon</th>
|
|
<th>Mobil</th>
|
|
<th>Email</th>
|
|
<th></th>
|
|
</tr>
|
|
<?php foreach(TT_ADDRESS_LINK_TYPES as $type): ?>
|
|
<?php if(is_array($address->links_to) && array_key_exists($type, $address->links_to)): ?>
|
|
<?php foreach($address->links_to[$type] as $link): ?>
|
|
<tr>
|
|
<td class="font-weight-bold"><?=__($type)?></td>
|
|
<td><a href="<?=self::getUrl("Address", "view", ["id" => $link->address_id])?>"><?=$link->address->company?></a></td>
|
|
<td><a href="<?=self::getUrl("Address", "view", ["id" => $link->address_id])?>"><?=$link->address->getFullName()?></a></td>
|
|
<td><?=$link->address->phone?></td>
|
|
<td><?=$link->address->mobile?></td>
|
|
<td><?=$link->address->email?></td>
|
|
<td>
|
|
<a class="mr-2" href="<?=self::getUrl("Address", "view", ["id" => $link->address_id])?>"><i class="far fa-eyes" title="Anzeigen"></i></a>
|
|
</td>
|
|
</tr>
|
|
<?php endforeach; ?>
|
|
<?php endif; ?>
|
|
<?php endforeach; ?>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
<?php endif; ?>
|
|
|
|
<?php if(is_array($address->linked_as) && count($address->linked_as)): ?>
|
|
<h4>Verknüpft als</h4>
|
|
<div class="card">
|
|
<div class="card-body" id="link-container">
|
|
<table class="table-sm table-striped">
|
|
<?php foreach(TT_ADDRESS_LINK_TYPES as $type): ?>
|
|
<?php if(array_key_exists($type, $address->linked_as)): ?>
|
|
<?php foreach($address->linked_as[$type] as $link): ?>
|
|
<tr>
|
|
<td><strong><?=__($type)?></strong> für:</td>
|
|
<td><a href="<?=self::getUrl("Address", "view", ['id' => $link->origin_address_id])?>"><?=$link->origin->getCompanyOrName()?><?=($link->origin->customer_number) ? " [".$link->origin->customer_number."]" : ""?></a></td>
|
|
</tr>
|
|
<?php endforeach; ?>
|
|
<?php endif; ?>
|
|
<?php endforeach; ?>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
<?php endif; ?>
|
|
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="col-4">
|
|
|
|
<div class="card border-top-success">
|
|
<div class="card-header">
|
|
Aktive Produkte (Contracts)
|
|
</div>
|
|
<?php if(is_array($address->contracts) && count($address->contracts)): ?>
|
|
<ul class="list-group list-group-flush">
|
|
<?php foreach($address->contracts as $contract): ?>
|
|
<?php if($contract->owner_id != $address->id) continue; ?>
|
|
<li class="list-group-item <?=$contract->isCancelled() ? "canceled" : ""?>">
|
|
<?php if($contract->billingaddress_id && $contract->owner_id != $contract->billingaddress_id): ?>
|
|
<a href="<?=self::getUrl("Address", "view", ["id" => $contract->billingaddress_id])?>" class="mr-1">
|
|
<i class="far fa-fw fa-money-bill-simple-wave" title="Hat separate Rechungsadresse"></i>
|
|
</a>
|
|
<?php endif; ?>
|
|
<?php if($contract->cancel_date && $contract->cancel_date > date("U")): ?>
|
|
<i class="far fa-fw fa-eraser text-danger mr-1" title="Kündigungsdatum <?=date("d.m.Y", $contract->cancel_date)?>"></i>
|
|
<?php endif; ?>
|
|
<a href="<?=self::getUrl("Contract", "View", ["id" => $contract->id])?>" class="<?=($contract->price < 0) ? "text-danger" : ""?>">
|
|
<?=$contract->product_name?> <?=($contract->matchcode) ? "[".$contract->matchcode."]" : ""?>
|
|
</a>
|
|
<?php if(is_array($contract->voicenumbers)): ?>
|
|
<span class="text-pink">
|
|
(<?=implode(", ", $contract->voicenumbers)?>)
|
|
</span>
|
|
<?php endif; ?>
|
|
<span class='text-secondary'>
|
|
<?=($contract->finish_date) ? "Fertigstellung: ".date('d.m.Y', $contract->finish_date) : "in Herstellung"?>
|
|
<?=($contract->cancel_date) ? "Kündigung: ".date('d.m.Y', $contract->cancel_date) : ""?>
|
|
</span>
|
|
</li>
|
|
<?php endforeach; ?>
|
|
</ul>
|
|
<?php endif; ?>
|
|
</div>
|
|
|
|
|
|
</div>
|
|
</div>
|
|
|
|
<?php if(is_array($address->active_contracts) && count($address->active_contracts)): ?>
|
|
<div class="card border-top-success">
|
|
<div class="card-header">
|
|
Verträge
|
|
</div>
|
|
<div class="card-body">
|
|
|
|
<table class="table table-striped table-sm table-bordered table-hover">
|
|
<tr>
|
|
<th>Rolle</th>
|
|
<th>Contract ID</th>
|
|
<th>Produkt</th>
|
|
<th>Matchcode</th>
|
|
<th>Preis</th>
|
|
<th>Setup</th>
|
|
<th>Bestelldatum</th>
|
|
<th>Fertigstellung</th>
|
|
<th>Kündigung</th>
|
|
</tr>
|
|
<?php foreach($address->active_contracts as $contract): ?>
|
|
<tr>
|
|
<td class="contract <?=($contract->isCancelled()) ? "canceled" : ""?>">
|
|
<a href="<?=self::getUrl("Contract", "View", ["id" => $contract->id])?>">
|
|
<?php if($contract->owner_id == $address->id): ?>
|
|
Vertragsinhaber
|
|
<?php elseif($contract->billingaddress_id == $address->id): ?>
|
|
Rechnungsempfänger
|
|
<?php endif; ?>
|
|
</a>
|
|
</td>
|
|
<td class="contract <?=($contract->isCancelled()) ? "canceled" : ""?>"><a href="<?=self::getUrl("Contract", "View", ["id" => $contract->id])?>"><?=$contract->id?></a></td>
|
|
<td class="contract <?=($contract->isCancelled()) ? "canceled" : ""?>"><a href="<?=self::getUrl("Contract", "View", ["id" => $contract->id])?>"><?=$contract->product_name?></a></td>
|
|
<td class="contract <?=($contract->isCancelled()) ? "canceled" : ""?>"><a href="<?=self::getUrl("Contract", "View", ["id" => $contract->id])?>"><?=$contract->matchcode?></a></td>
|
|
<td class="contract <?=($contract->isCancelled()) ? "canceled" : ""?> <?=($contract->price < 0) ? "text-danger" : ""?>">€ <?=number_format($contract->price,4,",",".")?></td>
|
|
<td class="contract <?=($contract->isCancelled()) ? "canceled" : ""?> <?=($contract->price_setup < 0) ? "text-danger" : ""?>">€ <?=number_format($contract->price_setup,4,",",".")?></td>
|
|
<td class="contract <?=($contract->isCancelled()) ? "canceled" : ""?>"><?=($contract->order_date) ? date('d.m.Y', $contract->order_date) : ""?></td>
|
|
<td class="contract <?=($contract->isCancelled()) ? "canceled" : ""?>"><?=($contract->finish_date) ? date('d.m.Y', $contract->finish_date) : ""?></td>
|
|
<td class="contract <?=($contract->isCancelled()) ? "canceled" : ""?> <?=($contract->cancel_date) ? "font-weight-bold text-danger" : ""?>"><?=($contract->cancel_date) ? date('d.m.Y', $contract->cancel_date) : ""?></td>
|
|
|
|
</tr>
|
|
<?php endforeach; ?>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
<?php endif; ?>
|
|
|
|
<div class="card">
|
|
<div class="card-body">
|
|
<a href="<?=self::getUrl("Address","Index", ['s' => $s])?>" class="btn btn-secondary mr-1"><i class="fas fa-list"></i> Zurück zur Übersicht</a>
|
|
<a href="<?=self::getUrl("Address","edit", ['id' => $address->id, 's' => $s, 'f' => "view"])?>" class="btn btn-outline-success"><i class="fas fa-edit"></i> Adresse bearbeiten</a>
|
|
</div>
|
|
</div>
|
|
|
|
</div>
|
|
</div>
|
|
|
|
<?php include(realpath(dirname(__FILE__)."/../../$mfLayoutPackage")."/footer.php"); ?>
|