diff --git a/Layout/default/Product/Index.php b/Layout/default/Product/Index.php
index cfcc3d38f..13d778b79 100644
--- a/Layout/default/Product/Index.php
+++ b/Layout/default/Product/Index.php
@@ -150,7 +150,7 @@
=(count($product->networks)) ? array_shift($product->networks)->name . ((count($product->networks) > 1) ? ", ..." : "") : ""?> |
=$product->productgroup->name?> |
=$product->name?> |
-
=$product->producttech->name?> (=$product->attributes[TT_ATTRIB_RTRTECHCODE_NAME]->value?>) |
+
=$product->producttech->name?>=(is_array($product->attributes) && array_key_exists(TT_ATTRIB_RTRTECHCODE_NAME, $product->attributes)) ? " (".$product->attributes[TT_ATTRIB_RTRTECHCODE_NAME]->value.")" : "" ?> |
=__($product->producttech->customer_type)?> |
=$product->price?> |
=(12 / $product->billing_period)?>x Jährlich |
@@ -158,6 +158,7 @@
=$product->ivt_id?> |
$product->id])?>">
+
$product->id])?>" class="text-danger" onclick="if(!confirm('Berechtigungen wirklich löschen?')) return false;" title="Produkt Löschen">
|
diff --git a/application/Product/ProductController.php b/application/Product/ProductController.php
index 745cda09b..e92adc7ea 100644
--- a/application/Product/ProductController.php
+++ b/application/Product/ProductController.php
@@ -154,6 +154,7 @@ class ProductController extends mfBaseController {
$data['price_nbe'] = ($r->price_nbe) ? Layout::commaToDot($r->price_nbe) : 0;
$data['price'] = ($r->price) ? Layout::commaToDot($r->price) : 0;
$data['price_setup'] = ($r->price_setup) ? Layout::commaToDot($r->price_setup) : 0;
+ $data['vatgroup_id'] = $r->vatgroup_id;
$data['billing_period'] = $r->billing_period;
$data['billing_delay'] = ($r->billing_delay) ? $r->billing_delay : 0;
$data['contract_term'] = $r->contract_term;
diff --git a/db/migrations/20240220192901_create_vat_tables.php b/db/migrations/20240220192901_create_vat_tables.php
index 2b7af7e60..1054880b4 100644
--- a/db/migrations/20240220192901_create_vat_tables.php
+++ b/db/migrations/20240220192901_create_vat_tables.php
@@ -10,6 +10,7 @@ final class CreateVatTables extends AbstractMigration
if($this->getEnvironment() == "thetool") {
$table = $this->table("Vatgroup");
$table->addColumn("name", "string", ["null" => false, "limit" => 255]);
+ $table->addColumn("default", "string", ["null" => false, "default" => 0, "limit" => \Phinx\Db\Adapter\MysqlAdapter::INT_TINY]);
$table->addColumn("create_by", "integer", ["null" => false]);
$table->addColumn("edit_by", "integer", ["null" => false]);
$table->addColumn("create", "integer", ["null" => false]);
@@ -29,6 +30,10 @@ final class CreateVatTables extends AbstractMigration
$table->addColumn("create", "integer", ["null" => false]);
$table->addColumn("edit", "integer", ["null" => false]);
$table->create();
+
+ $table = $this->table("Product");
+ $table->addColumn("vatgroup_id", "integer", ["null" => false, "default" => 1]);
+ $table->save();
}
if($this->getEnvironment() == "addressdb") {
@@ -39,6 +44,7 @@ final class CreateVatTables extends AbstractMigration
public function down(): void
{
if($this->getEnvironment() == "thetool") {
+ $this->table("Product")->removeColumn("vatgroup_id")->save();
$this->table("Vatrate")->drop()->save();
$this->table("Vatgroup")->drop()->save();
}