Feature/add historic bills
This commit is contained in:
@@ -59,7 +59,7 @@ asort($Devices);
|
||||
<div class="card-body">
|
||||
<h4 class="header-title mb-2"><?= ($device->id) ? "Device bearbeiten" : "Neues Device" ?></h4>
|
||||
<form class="form-horizontal" method="post"
|
||||
action="<?= self::getUrl("Device", "save", ["returnto" => $_GET["returnto"]]) ?>">
|
||||
action="<?= self::getUrl("Device", "save", ["returnto" => $_GET["returnto"] ?? ""]) ?>">
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
|
||||
@@ -101,7 +101,7 @@ asort($Devices);
|
||||
<select class="select2 form-control " name="pop_id" id="pop_id">
|
||||
<option value="0"> </option>
|
||||
<?php foreach ($pops as $pop): ?>
|
||||
<option value="<?= $pop->id ?>" <?= ($device->pop_id == $pop->id) ? "selected='selected'" : "" ?>><?= ($pop->devicemanufactor->name . " " . $pop->name) ?></option>
|
||||
<option value="<?= $pop->id ?>" <?= ($device->pop_id == $pop->id) ? "selected='selected'" : "" ?>><?= ($pop->devicemanufactor->name ?? '' . " " . $pop->name) ?></option>
|
||||
<?php endforeach; ?>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
@@ -98,6 +98,7 @@
|
||||
<li class="has-sub-submenu"><a href="<?=self::getUrl("Contract", "AdvancedSearch")?>"><i class="far fa-fw fa-question-circle text-info"></i> Erweiterte Suche</a></li>
|
||||
<?php if($me->is(["Admin"]) && $me->can("Billing")): ?><li><a href="<?=self::getUrl("Billing")?>"><i class="far fa-fw fa-cash-register text-info"></i> Verrechnung</a></li><?php endif; ?>
|
||||
<?php if($me->is(["Admin"]) && $me->can("Billing")): ?><li><a href="<?=self::getUrl("Invoice")?>"><i class="far fa-fw fa-file-invoice-dollar text-info"></i> Rechnungen</a></li><?php endif; ?>
|
||||
<?php if($me->is(["Admin"]) && $me->can("Billing")): ?><li><a href="<?=self::getUrl("HistoricBill")?>"><i class="far fa-fw fa-file-invoice-dollar text-info"></i> Historische Rechnungen</a></li><?php endif; ?>
|
||||
</ul>
|
||||
</li>
|
||||
<?php endif; ?>
|
||||
|
||||
9
application/HistoricBill/HistoricBill.php
Normal file
9
application/HistoricBill/HistoricBill.php
Normal file
@@ -0,0 +1,9 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* @property mixed|null $name
|
||||
*/
|
||||
class HistoricBill extends mfBaseModel
|
||||
{
|
||||
|
||||
}
|
||||
16
application/HistoricBill/HistoricBillController.php
Normal file
16
application/HistoricBill/HistoricBillController.php
Normal file
@@ -0,0 +1,16 @@
|
||||
<?php
|
||||
|
||||
class HistoricBillController extends TTCrud {
|
||||
protected string $headerTitle = 'Historische Rechnungen';
|
||||
protected bool $createText = false;
|
||||
|
||||
protected array $columns = [
|
||||
['key' => 'invoice_number', 'text' => 'Rechnungsnummer', 'required' => true],
|
||||
['key' => 'cinvoice_number', 'text' => 'Kundennummer', 'required' => true],
|
||||
['key' => 'address1', 'text' => 'Adresse 1', 'required' => true],
|
||||
['key' => 'address2', 'text' => 'Adresse 2', 'required' => true],
|
||||
['key' => 'address3', 'text' => 'Adresse 3', 'required' => true],
|
||||
['key' => 'address4', 'text' => 'Adresse 4', 'required' => true],
|
||||
['key' => 'date_outgoing', 'text' => 'Ausgangsdatum', 'required' => true],
|
||||
];
|
||||
}
|
||||
19
application/HistoricBill/HistoricBillModel.php
Normal file
19
application/HistoricBill/HistoricBillModel.php
Normal file
@@ -0,0 +1,19 @@
|
||||
<?php
|
||||
|
||||
class HistoricBillModel extends TTCrudBaseModel {
|
||||
public int $id;
|
||||
public string $cinvoice_number;
|
||||
public string $invoice_number;
|
||||
public int $cid;
|
||||
public string $address1;
|
||||
public string $address2;
|
||||
public string $address3;
|
||||
public string $address4;
|
||||
public string $date_outgoing;
|
||||
public string $bankcode;
|
||||
public string $accountnumber;
|
||||
public string $BIC;
|
||||
public string $IBAN;
|
||||
public string $Mandatinvoice_number;
|
||||
public int $payment;
|
||||
}
|
||||
46
db/migrations/20241106120000_add_historic_bill.php
Normal file
46
db/migrations/20241106120000_add_historic_bill.php
Normal file
@@ -0,0 +1,46 @@
|
||||
<?php /** @noinspection ALL */
|
||||
declare(strict_types=1);
|
||||
|
||||
use Phinx\Migration\AbstractMigration;
|
||||
|
||||
final class AddHistoricBill extends AbstractMigration {
|
||||
public function up(): void {
|
||||
if ($this->getEnvironment() == "thetool") {
|
||||
//HistoricTicket Table
|
||||
$HistoricBills = $this->table("HistoricBill", ["signed" => true]);
|
||||
|
||||
$HistoricBills->addColumn("invoice_number", "integer", ["null" => true]);
|
||||
$HistoricBills->addColumn("cinvoice_number", "string", ["null" => false, "limit" => 255]);
|
||||
$HistoricBills->addColumn("invoice_number", "string", ["null" => false, "limit" => 255]);
|
||||
$HistoricBills->addColumn("cid", "integer", ["null" => false, "default" => "0"]);
|
||||
$HistoricBills->addColumn("address1", "string", ["null" => false, "limit" => 255]);
|
||||
$HistoricBills->addColumn("address2", "string", ["null" => false, "limit" => 255]);
|
||||
$HistoricBills->addColumn("address3", "string", ["null" => false, "limit" => 255]);
|
||||
$HistoricBills->addColumn("address4", "string", ["null" => false, "limit" => 255]);
|
||||
$HistoricBills->addColumn("date_outgoing", "date", ["null" => false]);
|
||||
$HistoricBills->addColumn("bankcode", "string", ["null" => false, "limit" => 255]);
|
||||
$HistoricBills->addColumn("accountnumber", "string", ["null" => false, "limit" => 255]);
|
||||
$HistoricBills->addColumn("BIC", "string", ["null" => false, "limit" => 255]);
|
||||
$HistoricBills->addColumn("IBAN", "string", ["null" => false, "limit" => 255]);
|
||||
$HistoricBills->addColumn("Mandatinvoice_number", "string", ["null" => false, "limit" => 255]);
|
||||
$HistoricBills->addColumn("payment", "integer", ["null" => false, "default" => "0"]);
|
||||
$HistoricBills->save();
|
||||
|
||||
$HistoricBills->addIndex("invoice_number", ["name" => "invoice_number"]);
|
||||
}
|
||||
|
||||
if ($this->getEnvironment() == "addressdb") {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
public function down(): void {
|
||||
if ($this->getEnvironment() == "thetool") {
|
||||
$this->table("HistoricBill")->drop()->save();
|
||||
}
|
||||
|
||||
if ($this->getEnvironment() == "addressdb") {
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
18
public/js/pages/HistoricBill/HistoricBill.js
Normal file
18
public/js/pages/HistoricBill/HistoricBill.js
Normal file
@@ -0,0 +1,18 @@
|
||||
Vue.component('historic-bill', {
|
||||
//language=Vue
|
||||
template: `
|
||||
<tt-card>
|
||||
<tt-table-crud>
|
||||
|
||||
<template v-slot:invoice_number="{ row }">
|
||||
<a :href="'/HistoricBillData/' + row.invoice_number + '.pdf'" target="_blank">{{ row.invoice_number }}</a>
|
||||
</template>
|
||||
|
||||
</tt-table-crud>
|
||||
</tt-card>
|
||||
`, data() {
|
||||
return {
|
||||
window: window, historyModal: false, historyModalId: null,
|
||||
}
|
||||
},
|
||||
})
|
||||
Reference in New Issue
Block a user