fix(inventory): 修復倉庫低庫存警告計算與全站租戶名稱動態化
All checks were successful
Koori-ERP-Deploy-System / deploy-demo (push) Has been skipped
Koori-ERP-Deploy-System / deploy-production (push) Successful in 44s

This commit is contained in:
2026-02-02 11:03:09 +08:00
parent 1748eb007e
commit 75c634ffe4
8 changed files with 24 additions and 14 deletions

View File

@@ -42,7 +42,7 @@ export default function Login() {
return (
<div className="min-h-screen flex items-center justify-center bg-gray-50 relative overflow-hidden">
<Head title="登入">
<Head title={`登入 - ${props.branding?.short_name || 'Star ERP'}`}>
<link rel="icon" type="image/png" href="/favicon.png" />
</Head>
@@ -136,7 +136,7 @@ export default function Login() {
</div>
<p className="text-center text-gray-400 text-sm mt-8">
&copy; {new Date().getFullYear()} {props.branding?.name || '小小冰室'}. All rights reserved.
&copy; {new Date().getFullYear()} {props.branding?.name || props.branding?.short_name || 'Star ERP'}. All rights reserved.
</p>
</div>
</div>

View File

@@ -1,5 +1,6 @@
import AuthenticatedLayout from '@/Layouts/AuthenticatedLayout';
import { Link, Head } from '@inertiajs/react';
import { Link, Head, usePage } from '@inertiajs/react';
import { PageProps } from '@/types/global';
import { cn } from "@/lib/utils";
import {
Package,
@@ -27,6 +28,7 @@ interface Props {
}
export default function Dashboard({ stats }: Props) {
const { branding } = usePage<PageProps>().props;
const cardData = [
{
label: '商品總數',
@@ -75,7 +77,7 @@ export default function Dashboard({ stats }: Props) {
return (
<AuthenticatedLayout>
<Head title="控制台 - 小小冰室 ERP" />
<Head title={`控制台 - ${branding?.short_name || 'Star'} ERP`} />
<div className="p-8 max-w-7xl mx-auto">
<div className="mb-8">
@@ -83,7 +85,7 @@ export default function Dashboard({ stats }: Props) {
<TrendingUp className="h-6 w-6 text-primary-main" />
</h1>
<p className="text-gray-500 mt-1"> ERP </p>
<p className="text-gray-500 mt-1"> {branding?.short_name || 'Star'} ERP </p>
</div>
{/* 主要數據卡片 */}

View File

@@ -8,7 +8,8 @@ import ProductDialog from "@/Components/Product/ProductDialog";
import CategoryManagerDialog from "@/Components/Category/CategoryManagerDialog";
import UnitManagerDialog, { Unit } from "@/Components/Unit/UnitManagerDialog";
import AuthenticatedLayout from "@/Layouts/AuthenticatedLayout";
import { Head, router } from "@inertiajs/react";
import { Head, router, usePage } from "@inertiajs/react";
import { PageProps as GlobalPageProps } from "@/types/global";
import { debounce } from "lodash";
import Pagination from "@/Components/shared/Pagination";
import { getBreadcrumbs } from "@/utils/breadcrumb";
@@ -57,6 +58,7 @@ interface PageProps {
}
export default function ProductManagement({ products, categories, units, filters }: PageProps) {
const { branding } = usePage<GlobalPageProps>().props;
const [searchTerm, setSearchTerm] = useState(filters.search || "");
const [typeFilter, setTypeFilter] = useState<string>(filters.category_id || "all");
const [perPage, setPerPage] = useState<string>(filters.per_page || "10");
@@ -182,7 +184,7 @@ export default function ProductManagement({ products, categories, units, filters
<Package className="h-6 w-6 text-primary-main" />
</h1>
<p className="text-gray-500 mt-1"></p>
<p className="text-gray-500 mt-1"> {branding?.short_name || 'Star'} </p>
</div>
{/* Toolbar */}

View File

@@ -225,7 +225,7 @@ export default function WarehouseIndex({ warehouses, totals, filters }: PageProp
key={warehouse.id}
warehouse={warehouse}
stats={{
totalQuantity: warehouse.total_quantity || 0,
totalQuantity: warehouse.book_stock || 0,
lowStockCount: warehouse.low_stock_count || 0,
replenishmentNeeded: warehouse.low_stock_count || 0
}}