Merge branch 'feature/warehouse-improvements' into 'master'
Feature/warehouse improvements See merge request fronk/thetool!505
This commit is contained in:
@@ -18,6 +18,7 @@ class WarehouseArticleController extends TTCrud {
|
|||||||
['key' => 'criticalAmount', 'text' => 'Kritische Menge', 'required' => true,'modal' => ['type' => 'number'], 'table' => ['class' => 'text-center']], // Stock/inventory related
|
['key' => 'criticalAmount', 'text' => 'Kritische Menge', 'required' => true,'modal' => ['type' => 'number'], 'table' => ['class' => 'text-center']], // Stock/inventory related
|
||||||
['key' => 'isSerialDocumentation', 'text' => 'Seriennummern', 'required' => true,'modal' => ['type' => 'checkbox'], 'table' => false], // Boolean value
|
['key' => 'isSerialDocumentation', 'text' => 'Seriennummern', 'required' => true,'modal' => ['type' => 'checkbox'], 'table' => false], // Boolean value
|
||||||
['key' => 'isEShop', 'text' => 'Ist E-Shop', 'required' => true,'modal' => ['type' => 'checkbox'], 'table' => false], // Boolean value
|
['key' => 'isEShop', 'text' => 'Ist E-Shop', 'required' => true,'modal' => ['type' => 'checkbox'], 'table' => false], // Boolean value
|
||||||
|
['key' => 'isEShopHide', 'text' => 'E-Shop Versteckt', 'required' => true,'modal' => ['type' => 'checkbox'], 'table' => false], // Boolean value
|
||||||
['key' => 'actions', 'text' => 'Aktionen', 'required' => false, 'modal' => false, 'table' => ['filter' => false, 'sortable' => false, 'class' => 'text-center', 'priority' => 8]]
|
['key' => 'actions', 'text' => 'Aktionen', 'required' => false, 'modal' => false, 'table' => ['filter' => false, 'sortable' => false, 'class' => 'text-center', 'priority' => 8]]
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ class WarehouseArticleModel extends TTCrudBaseModel {
|
|||||||
public int $warningAmount;
|
public int $warningAmount;
|
||||||
public int $criticalAmount;
|
public int $criticalAmount;
|
||||||
public int $isEShop;
|
public int $isEShop;
|
||||||
|
public int $isEShopHide;
|
||||||
public float $defaultSellMultiplier;
|
public float $defaultSellMultiplier;
|
||||||
public string $unit;
|
public string $unit;
|
||||||
public int $isSerialDocumentation;
|
public int $isSerialDocumentation;
|
||||||
|
|||||||
@@ -1,4 +1,9 @@
|
|||||||
<?php
|
<?php
|
||||||
|
// Warrenkorb löschen
|
||||||
|
// File Upload ermöglichen
|
||||||
|
// Hide Articles
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
class WarehouseEShopController extends TTCrud {
|
class WarehouseEShopController extends TTCrud {
|
||||||
protected string $headerTitle = 'Energie Steiermark Shop';
|
protected string $headerTitle = 'Energie Steiermark Shop';
|
||||||
@@ -29,22 +34,26 @@ class WarehouseEShopController extends TTCrud {
|
|||||||
$page = $this->postData['pagination']['page'] ?? 1;
|
$page = $this->postData['pagination']['page'] ?? 1;
|
||||||
$perPage = $this->postData['pagination']['per_page'] ?? 10;
|
$perPage = $this->postData['pagination']['per_page'] ?? 10;
|
||||||
|
|
||||||
$filter['isEShop'] = 1;
|
$warehouseArticleFilter = $filter;
|
||||||
|
$warehouseArticleFilter['isEShop'] = 1;
|
||||||
|
$warehouseArticleFilter['isEShopHide'] = 0;
|
||||||
|
|
||||||
$rows = WarehouseArticleModel::getAll($filter, $perPage, ($page - 1) * $perPage, $order);
|
$warehouseArticles = WarehouseArticleModel::getAll($warehouseArticleFilter, $perPage, ($page - 1) * $perPage, $order);
|
||||||
$filteredAvailable = WarehouseArticleModel::count($filter);
|
$warehouseArticlesTotal = WarehouseArticleModel::count(['isEShop' => 1, 'isEShopHide' => 0]);
|
||||||
$totalRows = WarehouseArticleModel::count(['isEShop' => 1]);
|
$warehouseArticlesAvailable = WarehouseArticleModel::count($warehouseArticleFilter);
|
||||||
|
|
||||||
$packetRows = WarehouseArticlePacketModel::getAll();
|
$warehousePackets = WarehouseArticlePacketModel::getAll();
|
||||||
|
$warehousePacketsTotal = WarehouseArticlePacketModel::count();
|
||||||
|
$warehousePacketsAvailable = WarehouseArticlePacketModel::count($filter);
|
||||||
|
|
||||||
$rows = [...$rows, ...$packetRows];
|
$filteredAvailable = $warehouseArticlesAvailable + $warehousePacketsAvailable;
|
||||||
|
$totalRows = $warehouseArticlesTotal + $warehousePacketsTotal;
|
||||||
|
$rows = [...$warehouseArticles, ...$warehousePackets];
|
||||||
|
|
||||||
self::returnJson(["rows" => $rows,
|
self::returnJson(["rows" => $rows,
|
||||||
"pagination" => ["page" => $page,
|
"pagination" => ["page" => $page,
|
||||||
"total_pages" => ceil($filteredAvailable / $perPage),
|
"total_pages" => ceil($filteredAvailable / $perPage),
|
||||||
"per_page" => $perPage,
|
"per_page" => $perPage,
|
||||||
"filtered_available" => intval($filteredAvailable),
|
"filtered_available" => $filteredAvailable,
|
||||||
"total_rows" => intval($totalRows)]]); }
|
"total_rows" => $totalRows]]); }
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,22 @@
|
|||||||
|
<?php /** @noinspection ALL */
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
use Phinx\Migration\AbstractMigration;
|
||||||
|
|
||||||
|
final class WarehouseAddEShopHide extends AbstractMigration {
|
||||||
|
public function up(): void {
|
||||||
|
if ($this->getEnvironment() == "thetool") {
|
||||||
|
$WarehouseArticle = $this->table("WarehouseArticle");
|
||||||
|
$WarehouseArticle->addColumn("isEShopHide", "integer", ["null" => false]);
|
||||||
|
$WarehouseArticle->update();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public function down(): void {
|
||||||
|
if ($this->getEnvironment() == "thetool") {
|
||||||
|
$WarehouseArticle = $this->table("WarehouseArticle");
|
||||||
|
$WarehouseArticle->removeColumn("isEShopHide");
|
||||||
|
$WarehouseArticle->update();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -34,6 +34,8 @@ class Helper {
|
|||||||
$sql .= " AND `$columnName` LIKE '%" . $item . "%'";
|
$sql .= " AND `$columnName` LIKE '%" . $item . "%'";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
} else if ($filterValue === 0) {
|
||||||
|
$sql .= " AND `$columnName` = 0";
|
||||||
}
|
}
|
||||||
|
|
||||||
return $sql;
|
return $sql;
|
||||||
|
|||||||
@@ -25,9 +25,12 @@ Vue.component('tt-expandable-shopping-cart', {
|
|||||||
<h3>Einkaufswagen</h3>
|
<h3>Einkaufswagen</h3>
|
||||||
<ul class="list-group">
|
<ul class="list-group">
|
||||||
<template v-for="item in cartItems">
|
<template v-for="item in cartItems">
|
||||||
<li class="list-group-item d-flex justify-content-between align-items-center">
|
<li class="list-group-item" style="display:grid;grid-template-columns: 1fr auto;gap: 10px;">
|
||||||
{{ item.title }}
|
{{ item.title }}
|
||||||
<span class="badge badge-primary badge-pill">{{ item.amount }}</span>
|
<div style="display:grid;grid-template-columns: 1fr 1fr;gap: 10px;">
|
||||||
|
<span class="badge badge-primary badge-pill" style="height: 16px">{{ item.amount }}</span>
|
||||||
|
<i style="cursor: pointer" class="fas fa-trash-alt text-danger" @click="cartItems.splice(cartItems.indexOf(item), 1)"></i>
|
||||||
|
</div>
|
||||||
</li>
|
</li>
|
||||||
</template>
|
</template>
|
||||||
</ul>
|
</ul>
|
||||||
@@ -52,7 +55,7 @@ Vue.component('warehouse-e-shop', {
|
|||||||
|
|
||||||
<tt-select v-model="createOrderDialogData.deliveryMode" label="Adresse" :options="[
|
<tt-select v-model="createOrderDialogData.deliveryMode" label="Adresse" :options="[
|
||||||
{text: 'Einzelne Adresse', value: 'singleAddress'},
|
{text: 'Einzelne Adresse', value: 'singleAddress'},
|
||||||
{text: 'Mehrere Adressen', value: 'multipleAddresses'},
|
// {text: 'Mehrere Adressen', value: 'multipleAddresses'},
|
||||||
]" sm row/>
|
]" sm row/>
|
||||||
<tt-input v-model="createOrderDialogData.deliveryAddressName" label="Name" sm row/>
|
<tt-input v-model="createOrderDialogData.deliveryAddressName" label="Name" sm row/>
|
||||||
<tt-input v-model="createOrderDialogData.deliveryAddressLine" label="Straße" sm row/>
|
<tt-input v-model="createOrderDialogData.deliveryAddressLine" label="Straße" sm row/>
|
||||||
|
|||||||
@@ -261,7 +261,7 @@ td {
|
|||||||
.expanded {
|
.expanded {
|
||||||
width: 500px; /* Expanded width */
|
width: 500px; /* Expanded width */
|
||||||
height: 600px; /* Expanded height */
|
height: 600px; /* Expanded height */
|
||||||
z-index: 999999999999999;
|
z-index: 1000;
|
||||||
}
|
}
|
||||||
|
|
||||||
.toggle-button {
|
.toggle-button {
|
||||||
@@ -323,8 +323,8 @@ td {
|
|||||||
|
|
||||||
.tt-expandable-shopping-cart.expanded .cart-count {
|
.tt-expandable-shopping-cart.expanded .cart-count {
|
||||||
position: unset !important;
|
position: unset !important;
|
||||||
width: 21px;
|
width: 18px;
|
||||||
height: 21px;
|
height: 18px;
|
||||||
grid-column-start: 3;
|
grid-column-start: 3;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user