WIP 2025-03-17 RML Billing

This commit is contained in:
Frank Schubert
2025-03-18 02:10:53 +01:00
parent 361fc5ee9a
commit 2a7e7f1724
7 changed files with 877 additions and 128 deletions

View File

@@ -585,7 +585,7 @@
<?php foreach($preorder->history as $history): ?>
<?php if($history->key != "status_id") continue; ?>
<tr>
<td><?=date("d.m.Y H:i:s", $history->create)?></td>
<td class="text-monospace"><?=date("d.m.Y H:i:s", $history->changed)?></td>
<td><?=$history->creator->name?></td>
<td><?=$history->old->code?> - <?=$history->old->name?></td>
<td><?=$history->new->code?> - <?=$history->new->name?></td>
@@ -604,7 +604,7 @@
</tr>
<?php foreach($preorder->history as $history): ?>
<tr>
<td><?=date("d.m.Y H:i:s", $history->create)?></td>
<td class="text-monospace"><?=date("d.m.Y H:i:s", $history->create)?></td>
<td><?=$history->creator->name?></td>
<td><?=$history->getKey()?></td>
<td><?=$history->getText("old")?></td>

View File

@@ -32,21 +32,41 @@ $pagination_entity_name = "Billingrecords";
<form method="get" action="<?=self::getUrl("PreorderBilling")?>">
<div class="row">
<div class="col-1">
<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 class="col-2">
<label class="form-label" for="filter_netzgebiet_id">Kampagne</label>
<select class="form-control" name="filter[preordercampaign_id]" id="filter_preordercampaign_id">
<option></option>
<?php foreach($my_campaigns as $campaign): ?>
<option value="<?=$campaign->id?>" <?=(is_array($filter) && $filter["preordercampaign_id"] == $campaign->id) ? "selected='selected'" : ""?>><?=$campaign->name?></option>
<?php endforeach; ?>
</select>
</div>
<div class="col-1">
<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'] : ""?>"/>
<label class="form-label" for="filter_oaid">OAID</label>
<input type="text" class="form-control" name="filter[oaid]" id="filter_oaid" value="<?=(array_key_exists("oaid", $filter)) ? $filter['oaid'] : ""?>"/>
</div>
<div class="col-2">
<label class="form-label" for="filter_owner_id">Netzbetreiber</label>
<select class="form-control" name="filter[owner_id]" id="filter_owner_id">
<option></option>
<?php foreach($netoperators as $netop): ?>
<option value="<?=$netop->id?>" <?=(is_array($filter) && $filter["owner_id"] == $netop->id) ? "selected='selected'" : ""?>><?=$netop->getCompanyOrName()?></option>
<?php endforeach; ?>
</select>
</div>
<div class="col-1">
<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'] : ""?>"/>
<label class="form-label" for="filter_fibu_account_number">Fibu Kontonummer</label>
<input type="text" class="form-control" name="filter[fibu_account_number]" id="filter_fibu_account_number" value="<?=(array_key_exists("fibu_account_number", $filter)) ? $filter['fibu_account_number'] : ""?>"/>
</div>
<div class="col-1">
<div class="col-2">
<label class="form-label" for="filter_product">Produkt</label>
<input type="text" class="form-control" name="filter[product]" id="filter_product" value="<?=(array_key_exists("product", $filter)) ? $filter['product'] : ""?>"/>
<select class="form-control" name="filter[product_id]" id="filter_product_id">
<option></option>
<?php foreach(PreorderProduct::getWithTypes() as $product): ?>
<option value="<?=$product->id?>" <?=(is_array($filter) && $filter["product_id"] == $product->id) ? "selected='selected'" : ""?>><?=$product->name?></option>
<?php endforeach; ?>
</select>
</div>
<div class="col-1">
<label class="form-label" for="filter_start_date_from">Periode von</label>
@@ -56,31 +76,6 @@ $pagination_entity_name = "Billingrecords";
<label class="form-label" for="filter_start_date_to">Periode bis</label>
<input type="text" class="form-control" name="filter[start_date_to]" id="filter_start_date_to" value="<?=(array_key_exists("start_date_to", $filter)) ? $filter['start_date_to'] : ""?>"/>
</div>
<div class="col-2">
<label class="form-label" for="filter_show_credit">Gutschriften</label>
<select class="form-control" name="filter[show_credit]" id="filter_show_credit">
<option value="0" <?=(array_key_exists("show_credit", $filter) && $filter['show_credit'] == 0) ? "selected='selected'" : ""?>>Ausblenden</option>
<option value="1" <?=(array_key_exists("show_credit", $filter) && $filter['show_credit'] == 1 ) ? "selected='selected'" : ""?>>Anzeigen</option>
</select>
</div>
<div class="col-2">
<label class="form-label" for="filter_show_credit">Rechnungsperiode</label>
<select class="form-control" name="filter[billing_period]" id="filter_billing_period">
<option></option>
<option value="1" <?=(array_key_exists("billing_period", $filter) && $filter['billing_period'] == 1) ? "selected='selected'" : ""?>>Monatlich</option>
<option value="12" <?=(array_key_exists("billing_period", $filter) &&$filter['billing_period'] == 12 ) ? "selected='selected'" : ""?>>Jährlich</option>
</select>
</div>
<!--div class="col-1">
<label class="form-label" for="filter_start_month">Zeitraum Monat</label>
<input type="text" class="form-control" name="filter[start_month]" id="filter_start_month" value="<?=(array_key_exists("start_month", $filter)) ? $filter['start_month'] : ""?>"/>
</div>
<div class="col-1">
<label class="form-label" for="filter_start_year">Zeitraum Jahr</label>
<input type="text" class="form-control" name="filter[start_year]" id="filter_start_year" value="<?=(array_key_exists("start_year", $filter)) ? $filter['start_year'] : ""?>"/>
</div-->
<div class="col-2">
<label class="form-label" for="filter_status">Status</label>
@@ -127,6 +122,7 @@ $pagination_entity_name = "Billingrecords";
<table class="table table-sm table-striped table-hover">
<tr>
<th>Netzgebiet</th>
<th>OAID</th>
<th>Bestelldatum</th>
<th>Periode</th>
@@ -141,7 +137,8 @@ $pagination_entity_name = "Billingrecords";
</tr>
<?php foreach($billings as $billing): ?>
<tr>
<td><a href="<?=self::getUrl("Preorder", "Index", ["filter" => ["oaid" => $billing->preorder->oaid]])?>" target="_blank"><?=$billing->preorder->oaid?></a></td>
<td><?=$billing->preorder->adb_hausnummer->netzgebiet->name?></td>
<td><a href="<?=self::getUrl("Preorder", "Index", ["filter" => ["oaid" => $billing->oaid]])?>" target="_blank"><?=$billing->oaid?></a></td>
<td><?=$billing->order_date?></td>
<td><?=$billing->start_date?> -<br /><?=$billing->end_date?></td>
<td>