fix: fixed key letter in residual qr codes
This commit is contained in:
		@@ -1,4 +1,4 @@
 | 
				
			|||||||
import { Button, Flex, Stack, Title } from "@mantine/core";
 | 
					import { Button, Flex, Stack, Text, Title } from "@mantine/core";
 | 
				
			||||||
import useReceiptBox from "../hooks/useReceiptBox.tsx";
 | 
					import useReceiptBox from "../hooks/useReceiptBox.tsx";
 | 
				
			||||||
import ReceiptProducts from "./ReceiptProducts.tsx";
 | 
					import ReceiptProducts from "./ReceiptProducts.tsx";
 | 
				
			||||||
import InlineButton from "../../../../../components/InlineButton/InlineButton.tsx";
 | 
					import InlineButton from "../../../../../components/InlineButton/InlineButton.tsx";
 | 
				
			||||||
@@ -16,6 +16,8 @@ const ReceiptBoxEditor = ({ boxId }: Props) => {
 | 
				
			|||||||
        onCreateProductClick,
 | 
					        onCreateProductClick,
 | 
				
			||||||
    } = useReceiptBox({ boxId });
 | 
					    } = useReceiptBox({ boxId });
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    if (!box) return <Text>Короб c ID K{boxId} не найден</Text>;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    const backButton = (
 | 
					    const backButton = (
 | 
				
			||||||
        <Button
 | 
					        <Button
 | 
				
			||||||
            variant={"default"}
 | 
					            variant={"default"}
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -18,7 +18,7 @@ const ReceiptPalletEditor = ({ palletId }: Props) => {
 | 
				
			|||||||
        onCreateBoxClick,
 | 
					        onCreateBoxClick,
 | 
				
			||||||
    } = useReceiptPallet({ palletId });
 | 
					    } = useReceiptPallet({ palletId });
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    if (!pallet) return <Text>Паллет c ID П{palletId} не найден</Text>;
 | 
					    if (!pallet) return <Text>Паллет c ID P{palletId} не найден</Text>;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    const createButtons = () => {
 | 
					    const createButtons = () => {
 | 
				
			||||||
        const isBoxes = pallet.boxes.length > 0;
 | 
					        const isBoxes = pallet.boxes.length > 0;
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -22,7 +22,7 @@ const ReceiptQrCodeScan = () => {
 | 
				
			|||||||
    const checkQrScannedCorrectly = () => {
 | 
					    const checkQrScannedCorrectly = () => {
 | 
				
			||||||
        if (
 | 
					        if (
 | 
				
			||||||
            scannedValue.length < 2
 | 
					            scannedValue.length < 2
 | 
				
			||||||
            || (scannedValue[0] !== "П" && scannedValue[0] !== "К")
 | 
					            || (scannedValue[0] !== "P" && scannedValue[0] !== "K")
 | 
				
			||||||
            || Number.isNaN(getId())
 | 
					            || Number.isNaN(getId())
 | 
				
			||||||
        ) {
 | 
					        ) {
 | 
				
			||||||
            notifications.error({ message: `Считанный ID ${scannedValue} некорректный` });
 | 
					            notifications.error({ message: `Считанный ID ${scannedValue} некорректный` });
 | 
				
			||||||
@@ -55,7 +55,7 @@ const ReceiptQrCodeScan = () => {
 | 
				
			|||||||
        );
 | 
					        );
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    if (scannedValue.length > 0 && scannedValue[0] === "К") {
 | 
					    if (scannedValue.length > 0 && scannedValue[0] === "K") {
 | 
				
			||||||
        return <ReceiptBoxEditor boxId={getId()} />;
 | 
					        return <ReceiptBoxEditor boxId={getId()} />;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    return <ReceiptPalletEditor palletId={getId()} />;
 | 
					    return <ReceiptPalletEditor palletId={getId()} />;
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,6 +1,6 @@
 | 
				
			|||||||
import { createLazyFileRoute } from '@tanstack/react-router'
 | 
					import { createLazyFileRoute } from "@tanstack/react-router";
 | 
				
			||||||
import ReceiptPage from "../pages/ReceiptPage/ui/ReceiptPage.tsx";
 | 
					import ReceiptPage from "../pages/ReceiptPage/ui/ReceiptPage.tsx";
 | 
				
			||||||
 | 
					
 | 
				
			||||||
export const Route = createLazyFileRoute('/receipt')({
 | 
					export const Route = createLazyFileRoute("/receipt")({
 | 
				
			||||||
  component: () => <ReceiptPage />,
 | 
					    component: ReceiptPage,
 | 
				
			||||||
})
 | 
					});
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user