197 lines
10 KiB
PHP
197 lines
10 KiB
PHP
<?php
|
|
$pagination_baseurl = $this->getUrl($Mod, "Index");
|
|
$pagination_baseurl_params = ["filter" => $filter];
|
|
$pagination_entity_name = "Rechnungen";
|
|
?>
|
|
<?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 active">Rechnungen</li>
|
|
</ol>
|
|
</div>
|
|
<h4 class="page-title">Rechnungen</h4>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<!-- end page title -->
|
|
|
|
<div class="row">
|
|
<div class="col-lg-12">
|
|
|
|
<div class="row">
|
|
<div class="col-6">
|
|
|
|
<div class="card">
|
|
<div class="card-body mb-3">
|
|
<h4 class="header-title mb-3">Filter</h4>
|
|
|
|
<form method="get" action="<?=self::getUrl("Invoice")?>">
|
|
<div class="row">
|
|
|
|
<div class="col-2">
|
|
<label class="form-label" for="filter_customer_number">Kundennummer</label>
|
|
<input type="text" class="form-control" name="filter[customer_number]" id="filter_customer_number" value="<?=(array_key_exists("customer_number", $filter)) ? $filter['customer_number'] : ""?>"/>
|
|
</div>
|
|
<div class="col-2">
|
|
<label class="form-label" for="filter_customer">Kunde</label>
|
|
<input type="text" class="form-control" name="filter[customer]" id="filter_customer" value="<?=(array_key_exists("customer", $filter)) ? $filter['customer'] : ""?>"/>
|
|
</div>
|
|
<div class="col-2">
|
|
<label class="form-label" for="filter_address">Adresse</label>
|
|
<input type="text" class="form-control" name="filter[address]" id="filter_address" value="<?=(array_key_exists("address", $filter)) ? $filter['address'] : ""?>"/>
|
|
</div>
|
|
</div>
|
|
<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("Invoice")?>?resetFilter=1">Filter zurücksetzen</a>
|
|
</div>
|
|
</div>
|
|
</form>
|
|
|
|
</div>
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="col-6">
|
|
<div class="card">
|
|
<div class="card-body">
|
|
<div class="row">
|
|
<div class="col-6">
|
|
<h4>Rechnungsversand</h4>
|
|
<form method="post" action="<?=self::getUrl("Invoice","sendInvoices")?>">
|
|
<div class="row">
|
|
<div class="col-6">
|
|
<label class="form-label" for="delivery_start_date">Rechungsdatum von</label>
|
|
<input type="text" class="form-control" name="delivery_start_date" id="delivery_start_date" value="" />
|
|
</div>
|
|
<div class="col-6">
|
|
<label class="form-label" for="delivery_end_date">Rechungsdatum bis</label>
|
|
<input type="text" class="form-control" name="delivery_end_date" id="delivery_end_date" value="" />
|
|
</div>
|
|
</div>
|
|
<div class="row mt-2">
|
|
<div class="col-12">
|
|
<button name="type" value="paper" class="btn btn-lg btn-purple"><i class="far fa-fw fa-print"></i> Rechnungen für Postversand drucken</button>
|
|
</div>
|
|
</div>
|
|
</form>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="card">
|
|
<div class="card-body mb-3">
|
|
|
|
<div class="row">
|
|
<div class="col-12">
|
|
<h4 class="header-title">Rechnungen</h4>
|
|
<div class="float-right">
|
|
<a href="<?=self::getUrl("Invoice", "exportBmd", ["type" => "credit"])?>" class="btn btn-outline-danger"><i class="far fa-fw fa-file-export"></i> Provisionsexport für BMD</a>
|
|
<a href="<?=self::getUrl("Invoice", "exportBmd")?>" class="btn btn-outline-primary ml-2"><i class="far fa-fw fa-file-export"></i> Rechnungsexport für BMD</a>
|
|
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="row">
|
|
<div class="col-12">
|
|
<?php include(realpath(dirname(__FILE__)."/../")."/tpl/pagination.php"); ?>
|
|
<?php include(realpath(dirname(__FILE__)."/../")."/tpl/pagination-summary.php"); ?>
|
|
|
|
<table class="table table-sm table-striped table-hover">
|
|
<tr>
|
|
<th>Rechungsnummer</th>
|
|
<th>Rechnungsdatum</th>
|
|
<th>Kundennummer</th>
|
|
<th>Rechnungsadresse</th>
|
|
<th>Netto</th>
|
|
<th>Ust.</th>
|
|
<th>Brutto</th>
|
|
<th>Zahlung</th>
|
|
<th>Zustellung</th>
|
|
<th></th>
|
|
</tr>
|
|
<?php foreach($invoices as $invoice): ?>
|
|
<?php $total = $invoice->total + $invoice->total_setup; ?>
|
|
<?php $total_gross = $invoice->total_gross + $invoice->total_setup_gross; ?>
|
|
<tr>
|
|
<td>
|
|
<a href="<?=self::getUrl("Invoice", "downloadInvoice", ["id" => $invoice->id])?>"><i class="fas fa-download fa-fw"></i> <?=$invoice->invoice_number?></a>
|
|
<?php if($invoice->pdf): ?>
|
|
<i class="fas fa-fw fa-check"></i>
|
|
<?php endif; ?>
|
|
</td>
|
|
<td><?=date("d.m.Y", $invoice->invoice_date)?></td>
|
|
<td><?=$invoice->customer_number?></td>
|
|
<td>
|
|
<?=($invoice->company) ? $invoice->company."<br />" : ""?>
|
|
<?=($invoice->firstname || $invoice->lastname) ? $invoice->firstname." ".$invoice->lastname."<br />" : ""?>
|
|
<?=$invoice->street?><br />
|
|
<?=$invoice->zip?> <?=$invoice->city?><br />
|
|
<?=$invoice->country?>
|
|
</td>
|
|
<td class="<?=($total < 0) ? "text-danger" : ""?>">€ <?=number_format($total,2,",",".")?></td>
|
|
<td >€ <?=number_format($total_gross - $total,2,",",".")?></td>
|
|
<td class="<?=($total_gross < 0) ? "text-danger" : ""?>">€ <?=number_format($total_gross,2,",",".")?></td>
|
|
<td><?=($invoice->billing_type == "sepa") ? "SEPA" : "Überweisung"?></td>
|
|
<td><?=($invoice->billing_delivery == "email") ? "Email" : "Papier"?></td>
|
|
<td>
|
|
<a href="<?=self::getUrl("Invoice", "downloadInvoiceCsv", ["id" => $invoice->id])?>" title="CSV-Download"><i class="fas fa-file-csv fa-fw"></i></a>
|
|
</td>
|
|
</tr>
|
|
<?php endforeach; ?>
|
|
</table>
|
|
|
|
<?php include(realpath(dirname(__FILE__)."/../")."/tpl/pagination-summary.php"); ?>
|
|
<?php include(realpath(dirname(__FILE__)."/../")."/tpl/pagination.php"); ?>
|
|
|
|
|
|
</div>
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<script>
|
|
$('#delivery_start_date').datepicker({
|
|
orientation: "bottom",
|
|
language: 'de',
|
|
format: "dd.mm.yyyy",
|
|
showWeekDays: true,
|
|
todayBtn: 'linked',
|
|
autoclose: true
|
|
});
|
|
$('#delivery_end_date').datepicker({
|
|
orientation: "bottom",
|
|
language: 'de',
|
|
format: "dd.mm.yyyy",
|
|
showWeekDays: true,
|
|
todayBtn: 'linked',
|
|
autoclose: true
|
|
});
|
|
</script>
|
|
|
|
<?php include(realpath(dirname(__FILE__) . "/../../$mfLayoutPackage") . "/footer.php"); ?>
|