fix(inventory): 修復倉庫低庫存警告計算與全站租戶名稱動態化
This commit is contained in:
@@ -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">
|
||||
© {new Date().getFullYear()} {props.branding?.name || '小小冰室'}. All rights reserved.
|
||||
© {new Date().getFullYear()} {props.branding?.name || props.branding?.short_name || 'Star ERP'}. All rights reserved.
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -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>
|
||||
|
||||
{/* 主要數據卡片 */}
|
||||
|
||||
@@ -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 */}
|
||||
|
||||
@@ -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
|
||||
}}
|
||||
|
||||
Reference in New Issue
Block a user