sme-pos-package 1.0.14 → 1.0.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.mts +1 -1
- package/dist/index.mjs +1 -0
- package/package.json +4 -1
- package/dist/index.css.map +0 -1
- package/dist/index.mjs.map +0 -1
- package/dist/tailwind.preset.mjs.map +0 -1
- package/public/assets/images/bank-logos.png +0 -0
- package/public/assets/images/banner1.png +0 -0
- package/public/assets/images/banner2.png +0 -0
- package/public/assets/images/banner3.png +0 -0
- package/public/assets/images/banner4.png +0 -0
- package/public/assets/images/cashier.svg +0 -9
- package/public/assets/images/empty-cart.png +0 -0
- package/public/assets/images/empty-table-state.png +0 -0
- package/public/assets/images/layout-display/left-layout.png +0 -0
- package/public/assets/images/layout-display/right-layout.png +0 -0
- package/public/assets/images/modal-illustration.png +0 -0
- package/public/assets/images/order-empty-state.png +0 -0
- package/public/assets/images/order.png +0 -0
- package/public/assets/images/payment-success-label.png +0 -0
- package/public/assets/images/table-empty.png +0 -0
- package/public/assets/images/take-away.png +0 -0
- package/public/assets/lottie/loading.json +0 -1
- package/public/assets/lottie/soft_pos.json +0 -1
- package/public/assets/lottie/success.json +0 -1
- package/public/config.json +0 -27
- package/public/env.json +0 -17
- package/src/animations/success.json +0 -9730
- package/src/assets/icons/breadcrumbs-icon.tsx +0 -85
- package/src/assets/icons/cart-icon.tsx +0 -14
- package/src/assets/icons/common.tsx +0 -270
- package/src/assets/icons/customer-view-icon.tsx +0 -20
- package/src/assets/icons/dining-table.tsx +0 -34
- package/src/assets/icons/edit-line-icon.tsx +0 -18
- package/src/assets/icons/emenu-icon.tsx +0 -39
- package/src/assets/icons/file-close-line-icon.tsx +0 -18
- package/src/assets/icons/helper-icon.tsx +0 -84
- package/src/assets/icons/home-gear-line-icon.tsx +0 -18
- package/src/assets/icons/kanban-icon.tsx +0 -16
- package/src/assets/icons/loading-icon.tsx +0 -45
- package/src/assets/icons/logout-box-line-icon.tsx +0 -18
- package/src/assets/icons/order-icon.tsx +0 -92
- package/src/assets/icons/payment-icon.tsx +0 -429
- package/src/assets/icons/pincode.tsx +0 -196
- package/src/assets/icons/pos-connect-icon.tsx +0 -67
- package/src/assets/icons/pos-device-icon.tsx +0 -52
- package/src/assets/icons/pos-icon.tsx +0 -75
- package/src/assets/icons/printer-line-icon.tsx +0 -18
- package/src/assets/icons/star-icon.tsx +0 -174
- package/src/assets/icons/table-icon.tsx +0 -77
- package/src/assets/icons/user-add-line-icon.tsx +0 -33
- package/src/assets/icons/user-icon.tsx +0 -65
- package/src/components/common/button-action.tsx +0 -46
- package/src/components/common/button-icon.tsx +0 -23
- package/src/components/common/dropdown/index.tsx +0 -79
- package/src/components/common/empty-state.tsx +0 -60
- package/src/components/common/header/index.tsx +0 -89
- package/src/components/common/header/tabs.tsx +0 -119
- package/src/components/common/image.tsx +0 -20
- package/src/components/common/input/index.tsx +0 -55
- package/src/components/common/input/radio-group.tsx +0 -75
- package/src/components/common/input/text-area.tsx +0 -28
- package/src/components/common/modal/delete-confirm-modal-container.tsx +0 -65
- package/src/components/common/modal/index.ts +0 -2
- package/src/components/common/modal/modal-direction.tsx +0 -125
- package/src/components/common/modal/modal-header.tsx +0 -37
- package/src/components/common/modal/modal-wrapper.tsx +0 -56
- package/src/components/common/modal/modal-zoom.tsx +0 -61
- package/src/components/common/pagination.tsx +0 -95
- package/src/components/common/refresh-button.tsx +0 -28
- package/src/components/common/search-bar.tsx +0 -27
- package/src/components/common/search.tsx +0 -59
- package/src/components/common/skeleton.tsx +0 -7
- package/src/components/common/tabs-layout.tsx +0 -98
- package/src/components/common/use-check-session.tsx +0 -19
- package/src/components/customer-management/add-customer/add-customer-drawer.tsx +0 -286
- package/src/components/customer-management/add-customer/address-select.tsx +0 -51
- package/src/components/customer-management/choose-customer-drawer.tsx +0 -177
- package/src/components/customer-management/customer-info-drawer.tsx +0 -166
- package/src/components/customer-management/customer-no-data.tsx +0 -18
- package/src/components/emenu/emenu-qr-code.tsx +0 -59
- package/src/components/emenu/menu-link.tsx +0 -67
- package/src/components/index.ts +0 -8
- package/src/components/kanban-template/kitchen-template.tsx +0 -60
- package/src/components/kanban-template/pos-order-template.tsx +0 -77
- package/src/components/kanban-template/pos-template.tsx +0 -170
- package/src/components/kitchen-management/change-status-confirm-modal.tsx +0 -61
- package/src/components/kitchen-management/index.ts +0 -1
- package/src/components/kitchen-management/kitchen-order/index.tsx +0 -153
- package/src/components/kitchen-management/kitchen-order/line.tsx +0 -78
- package/src/components/kitchen-management/kitchen-order/state.tsx +0 -52
- package/src/components/kitchen-management/kitchen-status.tsx +0 -69
- package/src/components/kitchen-management/orders-kitchen-management.tsx +0 -113
- package/src/components/order-management/index.tsx +0 -128
- package/src/components/order-management/order-actions.tsx +0 -46
- package/src/components/order-management/order-detail/header.tsx +0 -37
- package/src/components/order-management/order-detail/index.ts +0 -3
- package/src/components/order-management/order-detail/information.tsx +0 -96
- package/src/components/order-management/order-detail/order-detail.tsx +0 -84
- package/src/components/order-management/order-detail/order-line.tsx +0 -56
- package/src/components/order-management/order-detail/summary.tsx +0 -221
- package/src/components/order-management/order-header.tsx +0 -113
- package/src/components/order-management/order-pagination.tsx +0 -49
- package/src/components/order-management/order-status.tsx +0 -58
- package/src/components/order-management/order-table.tsx +0 -179
- package/src/components/order-management/order-tabs.tsx +0 -48
- package/src/components/pos-management/add-product-from-barcode/index.tsx +0 -97
- package/src/components/pos-management/cart-content/action-line.tsx +0 -81
- package/src/components/pos-management/cart-content/cancel-order-line-modal.tsx +0 -41
- package/src/components/pos-management/cart-content/cart-item.tsx +0 -173
- package/src/components/pos-management/cart-content/cart-items.tsx +0 -130
- package/src/components/pos-management/cart-content/draft-orders/draft-order-line.tsx +0 -67
- package/src/components/pos-management/cart-content/draft-orders/index.tsx +0 -40
- package/src/components/pos-management/cart-content/edit-cart-modal.tsx +0 -11
- package/src/components/pos-management/cart-content/index.tsx +0 -260
- package/src/components/pos-management/cart-content/no-select-order.tsx +0 -26
- package/src/components/pos-management/cart-content/order-info/customer-info.tsx +0 -53
- package/src/components/pos-management/cart-content/order-info/index.tsx +0 -109
- package/src/components/pos-management/cart-content/order-total.tsx +0 -36
- package/src/components/pos-management/cart-content/orders-line.tsx +0 -72
- package/src/components/pos-management/menu-content/category-tab.tsx +0 -38
- package/src/components/pos-management/menu-content/create-order-modal.tsx +0 -65
- package/src/components/pos-management/menu-content/product-content.tsx +0 -93
- package/src/components/pos-management/menu-content/product-detail/info.tsx +0 -28
- package/src/components/pos-management/menu-content/product-detail/modal.tsx +0 -148
- package/src/components/pos-management/menu-content/product-detail/option.tsx +0 -87
- package/src/components/pos-management/menu-content/product-detail/quantity-control.tsx +0 -155
- package/src/components/pos-management/menu-content/product-detail/sale-keypad.tsx +0 -100
- package/src/components/pos-management/menu-content/product-item.tsx +0 -65
- package/src/components/pos-management/order-helper/cancel-order-confirm.tsx +0 -43
- package/src/components/pos-management/order-helper/history-call.tsx +0 -105
- package/src/components/pos-management/order-helper/order-helper-modal.tsx +0 -116
- package/src/components/pos-management/payment-content/bill/actions.tsx +0 -46
- package/src/components/pos-management/payment-content/bill/content.tsx +0 -207
- package/src/components/pos-management/payment-content/bill/index.tsx +0 -18
- package/src/components/pos-management/payment-content/card-payment/index.tsx +0 -124
- package/src/components/pos-management/payment-content/card-payment/pos-payment/pos-connect.tsx +0 -183
- package/src/components/pos-management/payment-content/card-payment/pos-payment/qr-connect.tsx +0 -185
- package/src/components/pos-management/payment-content/card-payment/waiting-for-payment-pos-modal.tsx +0 -37
- package/src/components/pos-management/payment-content/cash-payment/index.tsx +0 -216
- package/src/components/pos-management/payment-content/index.tsx +0 -70
- package/src/components/pos-management/payment-content/payment-info.tsx +0 -67
- package/src/components/pos-management/payment-content/payment-layout.tsx +0 -16
- package/src/components/pos-management/payment-content/payment-method-cards.tsx +0 -99
- package/src/components/pos-management/payment-content/qr-payment/index.tsx +0 -118
- package/src/components/pos-management/payment-content/qr-payment/qr_code.js +0 -29
- package/src/components/pos-management/payment-content/qr-payment/vietqr.js +0 -436
- package/src/components/pos-management/payment-content/session-close-modal.tsx +0 -35
- package/src/components/pos-management/payment-content/soft-pos-payment/index.tsx +0 -48
- package/src/components/pos-management/pos-helpers/back-confirm.tsx +0 -45
- package/src/components/pos-management/pos-helpers/index.tsx +0 -135
- package/src/components/pos-management/pos-helpers/layout-display-modal.tsx +0 -99
- package/src/components/pos-management/search.tsx +0 -48
- package/src/components/pos-management/table-content/filtered-tables.tsx +0 -59
- package/src/components/pos-management/table-content/floor-tabs.tsx +0 -65
- package/src/components/pos-management/table-content/index.tsx +0 -76
- package/src/components/pos-management/table-content/table-item.tsx +0 -127
- package/src/components/pos-management/table-content/tables.tsx +0 -96
- package/src/components/restaurant-management/add-floor-modal.tsx +0 -133
- package/src/components/restaurant-management/add-table-modal.tsx +0 -198
- package/src/components/restaurant-management/delete-floor-confirm-modal.tsx +0 -42
- package/src/components/restaurant-management/delete-table-confirm-modal.tsx +0 -51
- package/src/components/restaurant-management/header.tsx +0 -22
- package/src/components/restaurant-management/index.tsx +0 -54
- package/src/components/restaurant-management/left-side.tsx +0 -51
- package/src/components/restaurant-management/right-side.tsx +0 -179
- package/src/components/restaurant-management/table-empty.tsx +0 -43
- package/src/components/session-management/close-session-modal/actions.tsx +0 -45
- package/src/components/session-management/close-session-modal/close-session-confirm.tsx +0 -157
- package/src/components/session-management/close-session-modal/close-session-ticket.tsx +0 -218
- package/src/components/session-management/close-session-modal/container.tsx +0 -25
- package/src/components/session-management/close-session-modal/draft-orders-confirm.tsx +0 -53
- package/src/components/session-management/close-session-modal/draft-orders-summary.tsx +0 -82
- package/src/components/session-management/close-session-modal/draft-orders.tsx +0 -34
- package/src/components/session-management/close-session-modal/index.tsx +0 -35
- package/src/components/session-management/close-session-modal/order/index.ts +0 -1
- package/src/components/session-management/close-session-modal/order/order-line.tsx +0 -64
- package/src/components/session-management/close-session-modal/order/orders-in-draft.tsx +0 -31
- package/src/components/session-management/close-session-modal/session-summary.tsx +0 -165
- package/src/components/session-management/index.ts +0 -1
- package/src/components/session-management/open-shift/index.tsx +0 -172
- package/src/components/table-management/index.tsx +0 -0
- package/src/constants/api/index.ts +0 -1
- package/src/constants/headers.constant.tsx +0 -24
- package/src/constants/index.ts +0 -1
- package/src/constants/language.store.ts +0 -21
- package/src/constants/methods.constant.ts +0 -10
- package/src/constants/order-state.ts +0 -8
- package/src/constants/payment-color.constant.ts +0 -26
- package/src/constants/query.constant.ts +0 -14
- package/src/constants/routes.constants.ts +0 -23
- package/src/constants/template-name.constant.ts +0 -9
- package/src/hooks/bill/use-get-bill-information.ts +0 -49
- package/src/hooks/bill/use-print-bill.tsx +0 -0
- package/src/hooks/common/load-env-config.ts +0 -98
- package/src/hooks/common/use-back.ts +0 -13
- package/src/hooks/common/use-broadcast.ts +0 -22
- package/src/hooks/common/use-click-outside.ts +0 -58
- package/src/hooks/common/use-get-base64-photo.ts +0 -71
- package/src/hooks/common/use-get-query.ts +0 -25
- package/src/hooks/common/use-pos.ts +0 -21
- package/src/hooks/common/use-query-params.ts +0 -89
- package/src/hooks/common/use-speech.ts +0 -36
- package/src/hooks/customer/use-customer-provider.ts +0 -247
- package/src/hooks/floor/use-floor-provider.ts +0 -172
- package/src/hooks/kitchen/use-kitchen-provider.ts +0 -80
- package/src/hooks/order/use-get-point-reward.ts +0 -50
- package/src/hooks/order/use-loop-fetch-order.ts +0 -30
- package/src/hooks/order/use-order-items.ts +0 -61
- package/src/hooks/order/use-orders.ts +0 -76
- package/src/hooks/payment/use-payment-provider.ts +0 -221
- package/src/hooks/product/use-product-provider.ts +0 -87
- package/src/hooks/session/use-check-session.tsx +0 -19
- package/src/hooks/session/use-session-provider.ts +0 -79
- package/src/hooks/table/use-pos-table-provider.ts +0 -193
- package/src/index.css +0 -5
- package/src/index.ts +0 -13
- package/src/layouts/common.tsx +0 -15
- package/src/layouts/index.ts +0 -4
- package/src/layouts/pos-layout.tsx +0 -33
- package/src/layouts/pos-order-layout.tsx +0 -43
- package/src/layouts/sale-layout.tsx +0 -25
- package/src/locales/en.json +0 -394
- package/src/locales/vi.json +0 -400
- package/src/pages/index.ts +0 -4
- package/src/pages/login/index.tsx +0 -128
- package/src/pages/pincode/index.tsx +0 -198
- package/src/pages/pos/kitchen-management/layout.tsx +0 -18
- package/src/pages/pos/management-floor/index.tsx +0 -7
- package/src/pages/pos/management-order/index.tsx +0 -7
- package/src/pages/pos/management-order/order-detail/index.tsx +0 -7
- package/src/pages/pos/management-table/index.tsx +0 -0
- package/src/pages/pos/payment-success/index.tsx +0 -75
- package/src/provider/app-provider.tsx +0 -56
- package/src/provider/fallback/custom-error.tsx +0 -26
- package/src/provider/main-provider.tsx +0 -41
- package/src/provider/meta-provider.tsx +0 -72
- package/src/provider/modal-provider.tsx +0 -48
- package/src/provider/notification-provider.tsx +0 -64
- package/src/provider/pos-provider/close-session-provider/index.tsx +0 -207
- package/src/provider/pos-provider/customer-provider/index.tsx +0 -30
- package/src/provider/pos-provider/floor-provider/index.tsx +0 -39
- package/src/provider/pos-provider/index.ts +0 -6
- package/src/provider/pos-provider/kitchen-provider/index.tsx +0 -30
- package/src/provider/pos-provider/order-detail-provider/index.tsx +0 -233
- package/src/provider/pos-provider/order-provider/index.tsx +0 -803
- package/src/provider/pos-provider/payment-provider/index.tsx +0 -30
- package/src/provider/pos-provider/product-provider/index.tsx +0 -30
- package/src/provider/pos-provider/sale-provider/index.tsx +0 -168
- package/src/provider/pos-provider/session-provider/index.tsx +0 -30
- package/src/provider/pos-provider/socket-provider/index.tsx +0 -118
- package/src/provider/pos-provider/table-provider/index.tsx +0 -30
- package/src/provider/public-provider.tsx +0 -104
- package/src/provider/use-session-provider.ts +0 -79
- package/src/router/app-router.tsx +0 -38
- package/src/router/index.tsx +0 -26
- package/src/router/pos-route.tsx +0 -75
- package/src/router/protected-route.tsx +0 -16
- package/src/router/public-route.tsx +0 -11
- package/src/store/header/index.ts +0 -21
- package/src/store/session/index.ts +0 -25
- package/src/store/states/cart.state.ts +0 -135
- package/src/store/states/close-session.state.ts +0 -20
- package/src/store/states/customer.state.ts +0 -19
- package/src/store/states/payment.state.ts +0 -14
- package/src/styles/base.css +0 -212
- package/src/styles/common.css +0 -65
- package/src/styles/lib/tailwind.css +0 -0
- package/src/styles/lib/tailwind.theme.css +0 -34
- package/src/styles/loading.css +0 -72
- package/src/styles/main.css +0 -5
- package/src/styles/refreshing-content.css +0 -55
- package/src/styles/text.css +0 -44
- package/src/types/account.ts +0 -61
- package/src/types/branch.ts +0 -6
- package/src/types/category.ts +0 -13
- package/src/types/common.ts +0 -4
- package/src/types/customer.ts +0 -52
- package/src/types/dashboard.ts +0 -18
- package/src/types/edc.ts +0 -37
- package/src/types/export-e-invoice.ts +0 -17
- package/src/types/filter.d.ts +0 -12
- package/src/types/floor/floor.ts +0 -16
- package/src/types/floor.d.ts +0 -36
- package/src/types/index.ts +0 -127
- package/src/types/invoice.ts +0 -32
- package/src/types/modal.ts +0 -15
- package/src/types/notification.ts +0 -12
- package/src/types/order.ts +0 -182
- package/src/types/payment.ts +0 -44
- package/src/types/product/product.ts +0 -47
- package/src/types/product.ts +0 -137
- package/src/types/provider-info.d.ts +0 -14
- package/src/types/qr.d.ts +0 -25
- package/src/types/report.d.ts +0 -43
- package/src/types/sale.d.ts +0 -68
- package/src/types/search.d.ts +0 -7
- package/src/types/session.d.ts +0 -30
- package/src/types/shop-qr.d.ts +0 -89
- package/src/types/staff.d.ts +0 -35
- package/src/types/store.d.ts +0 -25
- package/src/types/table.d.ts +0 -57
- package/src/utils/close-session-ticket.tsx +0 -129
- package/src/utils/functions.ts +0 -299
- package/src/utils/i18n.ts +0 -25
- package/src/utils/pos/bill.ts +0 -156
- package/src/utils/pos/convert-order.ts +0 -58
- package/src/utils/pos/helpers.ts +0 -48
- package/src/utils/pos/session.ts +0 -44
- package/src/utils/storages/index.ts +0 -1
- package/src/utils/storages/local-storage.ts +0 -72
- package/tailwind.preset.ts +0 -25
- package/tsconfig.json +0 -30
- package/tsup.config.ts +0 -30
|
@@ -1,179 +0,0 @@
|
|
|
1
|
-
import { IcPlus, IcTrash } from "@assets/icons/common";
|
|
2
|
-
import DiningTableIcon from "@assets/icons/dining-table";
|
|
3
|
-
import EditLineIcon from "@assets/icons/edit-line-icon";
|
|
4
|
-
import ButtonAction from "@components/common/button-action";
|
|
5
|
-
import { ButtonIcon } from "@components/common/button-icon";
|
|
6
|
-
import { AddTableModal } from "@components/restaurant-management/add-table-modal";
|
|
7
|
-
import DeleteTableConfirmModal from "@components/restaurant-management/delete-table-confirm-modal";
|
|
8
|
-
import { LayerLoading } from "@fctc/sme-widget-ui";
|
|
9
|
-
import useGetLoadPosSession from "@provider/pos-provider/sale-provider";
|
|
10
|
-
import { usePosTable } from "@provider/pos-provider/table-provider";
|
|
11
|
-
import { TFloor } from "@type/floor/floor";
|
|
12
|
-
import { TBasicTable } from "@type/table";
|
|
13
|
-
import { useMemo, useState } from "react";
|
|
14
|
-
import { toast } from "react-toastify";
|
|
15
|
-
import DeleteFloorConfirmModal from "./delete-floor-confirm-modal";
|
|
16
|
-
import TableEmpty from "./table-empty";
|
|
17
|
-
|
|
18
|
-
type TProps = {
|
|
19
|
-
activeFloor: TFloor | undefined;
|
|
20
|
-
setIsOpenAddFloor: (isOpen: boolean) => void;
|
|
21
|
-
isOpenAddFloor: boolean;
|
|
22
|
-
setIsEditingFloor?: (val: number | undefined) => void;
|
|
23
|
-
};
|
|
24
|
-
|
|
25
|
-
const RightSide = ({
|
|
26
|
-
activeFloor,
|
|
27
|
-
setIsOpenAddFloor,
|
|
28
|
-
setIsEditingFloor,
|
|
29
|
-
}: TProps) => {
|
|
30
|
-
const [isOpenAddModal, setIsOpenAddModal] = useState(false);
|
|
31
|
-
const [tableSelected, setTableSelected] = useState<TBasicTable | undefined>(
|
|
32
|
-
undefined
|
|
33
|
-
);
|
|
34
|
-
const [openDeleteConfirmModal, setOpenDeleteConfirmModal] = useState(false);
|
|
35
|
-
const [isOpenDeleteTable, setIsOpenDeleteTable] = useState(false);
|
|
36
|
-
const { tablesByFloor, mapTablesWithOrder } = usePosTable();
|
|
37
|
-
|
|
38
|
-
const { queryResult: getLoadPosSessionQueryResult, getData } =
|
|
39
|
-
useGetLoadPosSession();
|
|
40
|
-
|
|
41
|
-
const onOpenAddTable = () => {
|
|
42
|
-
setIsOpenAddModal(true);
|
|
43
|
-
};
|
|
44
|
-
|
|
45
|
-
const isFloorHaveTableContainOrder = useMemo(() => {
|
|
46
|
-
return mapTablesWithOrder.some((table) => table?.currentOrder);
|
|
47
|
-
}, [mapTablesWithOrder]);
|
|
48
|
-
|
|
49
|
-
const handleDeleteFloor = () => {
|
|
50
|
-
if (isFloorHaveTableContainOrder) {
|
|
51
|
-
toast.error("Tầng đang có đơn hàng");
|
|
52
|
-
} else {
|
|
53
|
-
setOpenDeleteConfirmModal(true);
|
|
54
|
-
}
|
|
55
|
-
};
|
|
56
|
-
|
|
57
|
-
if (!activeFloor) {
|
|
58
|
-
return (
|
|
59
|
-
<div className="font-medium text-strong-950 leading-[26px] flex-1 bg-neutral-100-96 p-4">
|
|
60
|
-
Chưa có tầng nào được chọn
|
|
61
|
-
</div>
|
|
62
|
-
);
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
return getLoadPosSessionQueryResult.isPending ? (
|
|
66
|
-
<div className="flex-1 bg-neutral-100-96">
|
|
67
|
-
<LayerLoading />
|
|
68
|
-
</div>
|
|
69
|
-
) : (
|
|
70
|
-
<div className="flex-1 p-4 flex flex-col gap-4 bg-neutral-100-96">
|
|
71
|
-
<div className="flex items-center justify-between">
|
|
72
|
-
<div className="flex items-center gap-4">
|
|
73
|
-
<p className="text-lg font-semibold leading-[26px] text-strong-950">
|
|
74
|
-
{activeFloor?.name}
|
|
75
|
-
</p>
|
|
76
|
-
<ButtonIcon
|
|
77
|
-
iconSrc={<EditLineIcon />}
|
|
78
|
-
onClick={() => {
|
|
79
|
-
setIsOpenAddFloor(true);
|
|
80
|
-
setIsEditingFloor && setIsEditingFloor(activeFloor.id);
|
|
81
|
-
}}
|
|
82
|
-
className="bg-inherit border-none shadow-none rounded-lg text-text-primary"
|
|
83
|
-
/>
|
|
84
|
-
<ButtonIcon
|
|
85
|
-
iconSrc={<IcTrash />}
|
|
86
|
-
onClick={handleDeleteFloor}
|
|
87
|
-
className="bg-inherit border-none shadow-none rounded-lg text-state-error-base"
|
|
88
|
-
/>
|
|
89
|
-
</div>
|
|
90
|
-
|
|
91
|
-
<ButtonAction
|
|
92
|
-
iconSrc={<IcPlus />}
|
|
93
|
-
onClick={onOpenAddTable}
|
|
94
|
-
className="button-primary"
|
|
95
|
-
text=" Thêm bàn"
|
|
96
|
-
/>
|
|
97
|
-
</div>
|
|
98
|
-
|
|
99
|
-
{tablesByFloor.length ? (
|
|
100
|
-
<div className="grid gap-3 grid-cols-[repeat(auto-fill,minmax(178px,1fr))]">
|
|
101
|
-
{tablesByFloor?.map((table: TBasicTable) => (
|
|
102
|
-
<FloorItem
|
|
103
|
-
key={table.id}
|
|
104
|
-
table={table}
|
|
105
|
-
onTableSelected={setTableSelected}
|
|
106
|
-
onOpenAddTable={onOpenAddTable}
|
|
107
|
-
/>
|
|
108
|
-
))}
|
|
109
|
-
</div>
|
|
110
|
-
) : (
|
|
111
|
-
<TableEmpty onOpenAddTable={onOpenAddTable} showAddTableAction />
|
|
112
|
-
)}
|
|
113
|
-
|
|
114
|
-
<AddTableModal
|
|
115
|
-
isOpen={isOpenAddModal}
|
|
116
|
-
onClose={() => setIsOpenAddModal(false)}
|
|
117
|
-
tableSelected={tableSelected}
|
|
118
|
-
editMode={Boolean(tableSelected)}
|
|
119
|
-
onOpenDeleteConfirmModal={() => setIsOpenDeleteTable(true)}
|
|
120
|
-
onTableSelected={setTableSelected}
|
|
121
|
-
/>
|
|
122
|
-
|
|
123
|
-
<DeleteFloorConfirmModal
|
|
124
|
-
isOpen={openDeleteConfirmModal}
|
|
125
|
-
onClose={() => setOpenDeleteConfirmModal(false)}
|
|
126
|
-
floorId={activeFloor.id}
|
|
127
|
-
floorName={activeFloor.name}
|
|
128
|
-
/>
|
|
129
|
-
|
|
130
|
-
<DeleteTableConfirmModal
|
|
131
|
-
isOpen={isOpenDeleteTable}
|
|
132
|
-
onClose={() => setIsOpenDeleteTable(false)}
|
|
133
|
-
tableSelected={tableSelected}
|
|
134
|
-
/>
|
|
135
|
-
</div>
|
|
136
|
-
);
|
|
137
|
-
};
|
|
138
|
-
|
|
139
|
-
export default RightSide;
|
|
140
|
-
|
|
141
|
-
const FloorItem = ({
|
|
142
|
-
table,
|
|
143
|
-
onTableSelected,
|
|
144
|
-
onOpenAddTable,
|
|
145
|
-
}: {
|
|
146
|
-
table: TBasicTable;
|
|
147
|
-
onTableSelected: (table: TBasicTable) => void;
|
|
148
|
-
onOpenAddTable: () => void;
|
|
149
|
-
}) => {
|
|
150
|
-
return (
|
|
151
|
-
<div className="rounded-xl border border-primary-sub bg-white flex flex-col gap-2 items-center justify-center px-3 h-[100px]">
|
|
152
|
-
<div className="flex items-center justify-between w-full">
|
|
153
|
-
<p className="rounded-full text-text-primary font-semibold leading-6 tracking-[-0.24px]">
|
|
154
|
-
Bàn {table.table_number}
|
|
155
|
-
{/* TODO */}
|
|
156
|
-
</p>
|
|
157
|
-
|
|
158
|
-
<button
|
|
159
|
-
onClick={() => {
|
|
160
|
-
onOpenAddTable();
|
|
161
|
-
onTableSelected({
|
|
162
|
-
...table,
|
|
163
|
-
});
|
|
164
|
-
}}
|
|
165
|
-
className="size-10 flex items-center justify-center text-neutral-400-68"
|
|
166
|
-
>
|
|
167
|
-
<EditLineIcon />
|
|
168
|
-
</button>
|
|
169
|
-
</div>
|
|
170
|
-
|
|
171
|
-
<div className="flex items-center justify-start w-full gap-1 text-colored-primary">
|
|
172
|
-
<DiningTableIcon />
|
|
173
|
-
<p className="font-semibold leading-6 tracking-[-0.24px]">
|
|
174
|
-
{table.seats}
|
|
175
|
-
</p>
|
|
176
|
-
</div>
|
|
177
|
-
</div>
|
|
178
|
-
);
|
|
179
|
-
};
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
import { IcPlus } from "@assets/icons/common";
|
|
2
|
-
import ButtonAction from "@components/common/button-action";
|
|
3
|
-
import Image from "@components/common/image";
|
|
4
|
-
import { useTranslation } from "react-i18next";
|
|
5
|
-
|
|
6
|
-
type TProps = {
|
|
7
|
-
showAddTableAction?: boolean;
|
|
8
|
-
onOpenAddTable?: () => void;
|
|
9
|
-
keyString?: string;
|
|
10
|
-
};
|
|
11
|
-
|
|
12
|
-
const TableEmpty = ({
|
|
13
|
-
onOpenAddTable,
|
|
14
|
-
showAddTableAction = false,
|
|
15
|
-
keyString,
|
|
16
|
-
}: TProps) => {
|
|
17
|
-
const { t } = useTranslation();
|
|
18
|
-
return (
|
|
19
|
-
<div className="flex flex-col gap-4 items-center justify-center h-full">
|
|
20
|
-
<Image
|
|
21
|
-
imageUrl="/assets/images/table-empty.png"
|
|
22
|
-
className="w-[136px] h-[106px]"
|
|
23
|
-
/>
|
|
24
|
-
|
|
25
|
-
<div className="flex flex-col gap-2 items-center justify-center">
|
|
26
|
-
<p className="text-2xl font-semibold leading-8 text-text-primary tracking-[-0.24px]">
|
|
27
|
-
{t("no_table")} {keyString}
|
|
28
|
-
</p>
|
|
29
|
-
</div>
|
|
30
|
-
|
|
31
|
-
{showAddTableAction && (
|
|
32
|
-
<ButtonAction
|
|
33
|
-
text={t("create_table")}
|
|
34
|
-
iconSrc={<IcPlus />}
|
|
35
|
-
onClick={onOpenAddTable}
|
|
36
|
-
className="button-secondary bg-white"
|
|
37
|
-
/>
|
|
38
|
-
)}
|
|
39
|
-
</div>
|
|
40
|
-
);
|
|
41
|
-
};
|
|
42
|
-
|
|
43
|
-
export default TableEmpty;
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
import ButtonAction from "@components/common/button-action";
|
|
2
|
-
import { useSessionStore } from "@store/session";
|
|
3
|
-
import { cn } from "@utils/functions";
|
|
4
|
-
import { useTranslation } from "react-i18next";
|
|
5
|
-
|
|
6
|
-
type TActionsProps = {
|
|
7
|
-
onContinue: () => void;
|
|
8
|
-
onClose?: () => void;
|
|
9
|
-
buttonLabel?: string;
|
|
10
|
-
isDisabled?: boolean;
|
|
11
|
-
className?: string;
|
|
12
|
-
};
|
|
13
|
-
|
|
14
|
-
const Actions = (props: TActionsProps) => {
|
|
15
|
-
const { onContinue, onClose, buttonLabel, isDisabled, className } = props;
|
|
16
|
-
const { setStep } = useSessionStore();
|
|
17
|
-
const { t } = useTranslation();
|
|
18
|
-
|
|
19
|
-
const handleClose = () => (onClose ? onClose() : setStep(0));
|
|
20
|
-
|
|
21
|
-
return (
|
|
22
|
-
<div
|
|
23
|
-
className={cn(
|
|
24
|
-
"flex pt-6 bg-white flex-col gap-2 w-full justify-center",
|
|
25
|
-
className
|
|
26
|
-
)}
|
|
27
|
-
{...props}
|
|
28
|
-
>
|
|
29
|
-
<ButtonAction
|
|
30
|
-
disabled={isDisabled}
|
|
31
|
-
onClick={onContinue}
|
|
32
|
-
text={buttonLabel}
|
|
33
|
-
className="button-primary w-full"
|
|
34
|
-
/>
|
|
35
|
-
|
|
36
|
-
<ButtonAction
|
|
37
|
-
onClick={handleClose}
|
|
38
|
-
text={t("cancel")}
|
|
39
|
-
className="button-secondary w-full"
|
|
40
|
-
/>
|
|
41
|
-
</div>
|
|
42
|
-
);
|
|
43
|
-
};
|
|
44
|
-
|
|
45
|
-
export default Actions;
|
|
@@ -1,157 +0,0 @@
|
|
|
1
|
-
import { QUERY_KEYS } from "@constants/query.constant";
|
|
2
|
-
import { useGetBase64Photo } from "@hooks/common/use-get-base64-photo";
|
|
3
|
-
import useGetQuery from "@hooks/common/use-get-query";
|
|
4
|
-
import { useQueryParams } from "@hooks/common/use-query-params";
|
|
5
|
-
import { usePosAppProvider } from "@provider/app-provider";
|
|
6
|
-
import { useCloseSession } from "@provider/pos-provider/close-session-provider";
|
|
7
|
-
import { LoadDataModel, useSale } from "@provider/pos-provider/sale-provider";
|
|
8
|
-
import { useSessionStore } from "@store/session";
|
|
9
|
-
import { useMemo, useRef, useState } from "react";
|
|
10
|
-
import { useTranslation } from "react-i18next";
|
|
11
|
-
import { useNavigate } from "react-router-dom";
|
|
12
|
-
import { toast } from "react-toastify";
|
|
13
|
-
import Actions from "./actions";
|
|
14
|
-
import CloseSessionModalContainer from "./container";
|
|
15
|
-
|
|
16
|
-
type TProps = {
|
|
17
|
-
posName: string;
|
|
18
|
-
};
|
|
19
|
-
|
|
20
|
-
export const CloseSessionConfirm = ({ posName }: TProps) => {
|
|
21
|
-
const { t } = useTranslation();
|
|
22
|
-
const navigate = useNavigate();
|
|
23
|
-
const { getData } = useSale();
|
|
24
|
-
const posSessionData = getData(LoadDataModel.POS_SESSION);
|
|
25
|
-
|
|
26
|
-
const { setStep, sessionConfirmParams } = useSessionStore();
|
|
27
|
-
const { removeParam } = useQueryParams();
|
|
28
|
-
const { user: userData, company } = usePosAppProvider();
|
|
29
|
-
const { data: brandLogo } = useGetBase64Photo(
|
|
30
|
-
company?.companyInfo.data[0]?.logo
|
|
31
|
-
);
|
|
32
|
-
const { posId } = useGetQuery();
|
|
33
|
-
const ref = useRef<HTMLDivElement>(null);
|
|
34
|
-
|
|
35
|
-
const {
|
|
36
|
-
getDataCloseSessionQuery: { data: dataCloseSession },
|
|
37
|
-
closeSession,
|
|
38
|
-
} = useCloseSession();
|
|
39
|
-
|
|
40
|
-
// const {
|
|
41
|
-
// getPosQueryResult: { data: posDetailInfo },
|
|
42
|
-
// } = usePosTableProvider();
|
|
43
|
-
|
|
44
|
-
const posDetailInfo = getData(LoadDataModel.POS_CONFIG);
|
|
45
|
-
|
|
46
|
-
const [isClosing, setIsClosing] = useState(false);
|
|
47
|
-
|
|
48
|
-
const onContinue = async () => {
|
|
49
|
-
try {
|
|
50
|
-
setIsClosing(true);
|
|
51
|
-
await closeSession({
|
|
52
|
-
countedCash: sessionConfirmParams.cashCount,
|
|
53
|
-
notes: sessionConfirmParams.note,
|
|
54
|
-
});
|
|
55
|
-
setIsClosing(false);
|
|
56
|
-
setStep(0);
|
|
57
|
-
navigate(
|
|
58
|
-
`/console${
|
|
59
|
-
sessionStorage.getItem("enter_pincode") ??
|
|
60
|
-
localStorage.getItem("backUrl")
|
|
61
|
-
}`
|
|
62
|
-
);
|
|
63
|
-
} catch (e: any) {
|
|
64
|
-
toast.error(e?.message);
|
|
65
|
-
console.log("error", e);
|
|
66
|
-
}
|
|
67
|
-
};
|
|
68
|
-
|
|
69
|
-
const handleClose = () => {
|
|
70
|
-
setStep(0);
|
|
71
|
-
removeParam([QUERY_KEYS.OPEN]);
|
|
72
|
-
};
|
|
73
|
-
|
|
74
|
-
// const handlePrintBase64 = async (imgSrc: string) => {
|
|
75
|
-
// if (!imgSrc) return
|
|
76
|
-
// try {
|
|
77
|
-
// await UsbPrinter.connect()
|
|
78
|
-
// await UsbPrinter.printBase64({
|
|
79
|
-
// data: imgSrc,
|
|
80
|
-
// })
|
|
81
|
-
|
|
82
|
-
// await UsbPrinter.disconnect()
|
|
83
|
-
// } catch (e) {
|
|
84
|
-
// console.error("USB Print failed:", e)
|
|
85
|
-
// }
|
|
86
|
-
// }
|
|
87
|
-
|
|
88
|
-
const cashDifference = useMemo(() => {
|
|
89
|
-
const totalAmount = dataCloseSession?.default_cash_details?.amount || 0;
|
|
90
|
-
const totalCash = sessionConfirmParams.cashCount || 0;
|
|
91
|
-
return totalAmount - totalCash;
|
|
92
|
-
}, [dataCloseSession, sessionConfirmParams]);
|
|
93
|
-
|
|
94
|
-
const handlePrintText = async () => {
|
|
95
|
-
// if (!isAndroid) return;
|
|
96
|
-
// try {
|
|
97
|
-
// await UsbPrinter.connect();
|
|
98
|
-
// const cleanBase64 = brandLogo?.replace(
|
|
99
|
-
// /^data:image\/[a-zA-Z]+;base64,/,
|
|
100
|
-
// ""
|
|
101
|
-
// );
|
|
102
|
-
// await UsbPrinter.disconnect();
|
|
103
|
-
// const textBill = await generateTextShift({
|
|
104
|
-
// sessionConfirmParams,
|
|
105
|
-
// userData,
|
|
106
|
-
// posId,
|
|
107
|
-
// dataCloseSession,
|
|
108
|
-
// posDetailInfo,
|
|
109
|
-
// cashDifference,
|
|
110
|
-
// company,
|
|
111
|
-
// openAt: posSessionData?.[0]?.start_at,
|
|
112
|
-
// });
|
|
113
|
-
// await UsbPrinter.printText({
|
|
114
|
-
// text: textBill,
|
|
115
|
-
// logoBase64: cleanBase64,
|
|
116
|
-
// });
|
|
117
|
-
// await UsbPrinter.disconnect();
|
|
118
|
-
// } catch (e) {
|
|
119
|
-
// toast.error(`USB Print failed: ${e}`);
|
|
120
|
-
// }
|
|
121
|
-
};
|
|
122
|
-
|
|
123
|
-
return (
|
|
124
|
-
<CloseSessionModalContainer
|
|
125
|
-
isOpen={true}
|
|
126
|
-
onClose={handleClose}
|
|
127
|
-
title={t("confirm_close_session_title")}
|
|
128
|
-
>
|
|
129
|
-
<div className="flex flex-col h-full relative overflow-auto gap-3">
|
|
130
|
-
<div className="flex flex-col gap-1 flex-1">
|
|
131
|
-
<p className="text-text-primary text-lg font-semibold leading-[26px]">
|
|
132
|
-
{t("confirm_close_session", { sessionId: posName })}
|
|
133
|
-
</p>
|
|
134
|
-
<p className="text-text-secondary text-sm leading-5 tracking-[-0.12px]">
|
|
135
|
-
{t("check_session_info_before_closing")}
|
|
136
|
-
</p>
|
|
137
|
-
</div>
|
|
138
|
-
|
|
139
|
-
{/* <div className="overflow-auto hide-scrollbar">
|
|
140
|
-
<div ref={ref}>
|
|
141
|
-
<CloseSessionTicket />
|
|
142
|
-
</div>
|
|
143
|
-
</div> */}
|
|
144
|
-
|
|
145
|
-
<Actions
|
|
146
|
-
isDisabled={isClosing}
|
|
147
|
-
onContinue={async () => {
|
|
148
|
-
onContinue();
|
|
149
|
-
handlePrintText();
|
|
150
|
-
}}
|
|
151
|
-
buttonLabel={isClosing ? t("is_closing") : t("yes_button")}
|
|
152
|
-
className="flex flex-row-reverse items-center gap-2 w-full pt-6 sticky bottom-0 bg-white"
|
|
153
|
-
/>
|
|
154
|
-
</div>
|
|
155
|
-
</CloseSessionModalContainer>
|
|
156
|
-
);
|
|
157
|
-
};
|
|
@@ -1,218 +0,0 @@
|
|
|
1
|
-
import { useGetBase64Photo } from "@hooks/common/use-get-base64-photo";
|
|
2
|
-
import useGetQuery from "@hooks/common/use-get-query";
|
|
3
|
-
import { usePosAppProvider } from "@provider/app-provider";
|
|
4
|
-
import { useCloseSession } from "@provider/pos-provider/close-session-provider";
|
|
5
|
-
import { LoadDataModel, useSale } from "@provider/pos-provider/sale-provider";
|
|
6
|
-
import { useSessionStore } from "@store/session";
|
|
7
|
-
import { formatCurrency, getDate, hh_mm_dd_mm_yyyy } from "@utils/functions";
|
|
8
|
-
import { useMemo } from "react";
|
|
9
|
-
|
|
10
|
-
const CloseSessionTicket = () => {
|
|
11
|
-
const { posId } = useGetQuery();
|
|
12
|
-
const { getData } = useSale();
|
|
13
|
-
const { sessionConfirmParams } = useSessionStore();
|
|
14
|
-
const { user: userData } = usePosAppProvider();
|
|
15
|
-
const user = userData?.userProfile?.data;
|
|
16
|
-
const company = useMemo(() => user?.company, [user]);
|
|
17
|
-
const address = useMemo(() => user?.company?.address, [user?.company]);
|
|
18
|
-
const addressFormat = useMemo(() => {
|
|
19
|
-
return `${address?.street ?? ""} ${address?.street2 ?? ""}, ${
|
|
20
|
-
address?.ward ?? ""
|
|
21
|
-
}, Tỉnh ${address?.state ?? ""}`;
|
|
22
|
-
}, [address]);
|
|
23
|
-
|
|
24
|
-
const { data: brandLogo } = useGetBase64Photo(company?.logo);
|
|
25
|
-
|
|
26
|
-
const {
|
|
27
|
-
getDataCloseSessionQuery: { data: dataCloseSession },
|
|
28
|
-
} = useCloseSession();
|
|
29
|
-
|
|
30
|
-
const posDetailInfo = getData(LoadDataModel.POS_CONFIG);
|
|
31
|
-
|
|
32
|
-
const currentPos = posDetailInfo?.records?.find(
|
|
33
|
-
(item: any) => item.id === Number(posId)
|
|
34
|
-
);
|
|
35
|
-
|
|
36
|
-
const date = getDate(new Date());
|
|
37
|
-
|
|
38
|
-
const cashDifference = useMemo(() => {
|
|
39
|
-
const totalAmount = dataCloseSession?.default_cash_details?.amount || 0;
|
|
40
|
-
const totalCash = sessionConfirmParams.cashCount || 0;
|
|
41
|
-
return totalAmount - totalCash;
|
|
42
|
-
}, [dataCloseSession, sessionConfirmParams]);
|
|
43
|
-
|
|
44
|
-
return (
|
|
45
|
-
<div className="inline-flex w-full flex-col items-center gap-3 rounded-2xl bg-white">
|
|
46
|
-
<div className="flex flex-col items-center justify-center gap-2 self-stretch">
|
|
47
|
-
{brandLogo && <img className="w-[20%]" src={brandLogo} />}
|
|
48
|
-
<div className="flex flex-col items-center justify-center gap-2 self-stretch font-normal text-strong-950">
|
|
49
|
-
<div className="text-xs font-semibold">{company?.invoice_name}</div>
|
|
50
|
-
<div className="text-[10px]">{addressFormat}</div>
|
|
51
|
-
</div>
|
|
52
|
-
</div>
|
|
53
|
-
|
|
54
|
-
<div className="flex flex-col items-start justify-start gap-2 self-stretch">
|
|
55
|
-
<div className="flex flex-col items-center justify-center gap-1 self-stretch">
|
|
56
|
-
<div className="text-center text-xs font-bold leading-7 text-strong-950">
|
|
57
|
-
PHIẾU GIAO CA
|
|
58
|
-
</div>
|
|
59
|
-
{[
|
|
60
|
-
[
|
|
61
|
-
{
|
|
62
|
-
title: "Mã ca / Quầy",
|
|
63
|
-
value: [
|
|
64
|
-
currentPos?.current_session_id?.display_name,
|
|
65
|
-
currentPos?.name,
|
|
66
|
-
].join(" / "),
|
|
67
|
-
},
|
|
68
|
-
undefined,
|
|
69
|
-
{
|
|
70
|
-
title: "Nhân viên",
|
|
71
|
-
value: currentPos?.current_user_id?.display_name,
|
|
72
|
-
},
|
|
73
|
-
],
|
|
74
|
-
[
|
|
75
|
-
{ title: "Giờ mở ca", value: hh_mm_dd_mm_yyyy(new Date()) },
|
|
76
|
-
undefined,
|
|
77
|
-
{ title: "Giờ đóng ca", value: hh_mm_dd_mm_yyyy(new Date()) },
|
|
78
|
-
],
|
|
79
|
-
].map((row, i) => (
|
|
80
|
-
<div
|
|
81
|
-
key={i}
|
|
82
|
-
className="flex w-full items-stretch gap-2 text-[10px] font-normal text-strong-950"
|
|
83
|
-
>
|
|
84
|
-
{row.map((cell, idx) => {
|
|
85
|
-
if (!cell)
|
|
86
|
-
return (
|
|
87
|
-
<div key={idx} className="w-[1.5px] bg-soft-400"></div>
|
|
88
|
-
);
|
|
89
|
-
return (
|
|
90
|
-
<div
|
|
91
|
-
key={cell.title}
|
|
92
|
-
className="flex flex-1 items-center gap-1"
|
|
93
|
-
>
|
|
94
|
-
<div>{cell.title}:</div>
|
|
95
|
-
<div className="font-medium">{cell.value}</div>
|
|
96
|
-
</div>
|
|
97
|
-
);
|
|
98
|
-
})}
|
|
99
|
-
</div>
|
|
100
|
-
))}
|
|
101
|
-
</div>
|
|
102
|
-
|
|
103
|
-
<div className="h-[1px] bg-soft-400"></div>
|
|
104
|
-
|
|
105
|
-
<div className="inline-flex self-stretch text-xs font-semibold text-strong-950">
|
|
106
|
-
<div className="flex-1">Tiền mặt đầu ca (1)</div>
|
|
107
|
-
<div>
|
|
108
|
-
{formatCurrency(dataCloseSession?.default_cash_details?.opening) ||
|
|
109
|
-
0}
|
|
110
|
-
đ
|
|
111
|
-
</div>
|
|
112
|
-
</div>
|
|
113
|
-
|
|
114
|
-
<div className="h-[1px] bg-soft-400"></div>
|
|
115
|
-
|
|
116
|
-
{[
|
|
117
|
-
{
|
|
118
|
-
title: "Tiền mặt trong ca (2)",
|
|
119
|
-
value: `${
|
|
120
|
-
formatCurrency(
|
|
121
|
-
dataCloseSession?.default_cash_details?.payment_amount
|
|
122
|
-
) || 0
|
|
123
|
-
}đ`,
|
|
124
|
-
items: [
|
|
125
|
-
{
|
|
126
|
-
title: "Bán hàng",
|
|
127
|
-
value: `${
|
|
128
|
-
formatCurrency(
|
|
129
|
-
dataCloseSession?.default_cash_details?.payment_amount
|
|
130
|
-
) || 0
|
|
131
|
-
}đ`,
|
|
132
|
-
},
|
|
133
|
-
],
|
|
134
|
-
},
|
|
135
|
-
undefined,
|
|
136
|
-
{
|
|
137
|
-
title: "Tiền mặt cuối ca (3)=(1)+(2)",
|
|
138
|
-
value: `${
|
|
139
|
-
formatCurrency(dataCloseSession?.default_cash_details?.amount) ||
|
|
140
|
-
0
|
|
141
|
-
}đ`,
|
|
142
|
-
items: [
|
|
143
|
-
{
|
|
144
|
-
title: "Tiền mặt bàn giao thực tế",
|
|
145
|
-
value: `${
|
|
146
|
-
formatCurrency(sessionConfirmParams.cashCount) || 0
|
|
147
|
-
}đ`,
|
|
148
|
-
},
|
|
149
|
-
{
|
|
150
|
-
title: "Số tiền chênh lệch",
|
|
151
|
-
value: `${formatCurrency(cashDifference) || 0}đ`,
|
|
152
|
-
},
|
|
153
|
-
],
|
|
154
|
-
},
|
|
155
|
-
undefined,
|
|
156
|
-
{
|
|
157
|
-
title: "Phương thức thanh toán khác",
|
|
158
|
-
value: `${
|
|
159
|
-
formatCurrency(
|
|
160
|
-
dataCloseSession?.non_cash_payment_methods?.reduce(
|
|
161
|
-
(a: number, b: any) => a + (b?.amount || 0),
|
|
162
|
-
0
|
|
163
|
-
)
|
|
164
|
-
) || 0
|
|
165
|
-
}đ`,
|
|
166
|
-
items:
|
|
167
|
-
dataCloseSession?.non_cash_payment_methods?.map((item: any) => ({
|
|
168
|
-
title: item?.name ?? "",
|
|
169
|
-
value: formatCurrency(item?.amount || 0),
|
|
170
|
-
})) || [],
|
|
171
|
-
},
|
|
172
|
-
].map((section, idx) => {
|
|
173
|
-
if (!section)
|
|
174
|
-
return <div key={idx} className="h-[1px] bg-soft-400"></div>;
|
|
175
|
-
return (
|
|
176
|
-
<div
|
|
177
|
-
key={idx}
|
|
178
|
-
className="flex flex-col items-start gap-2 self-stretch"
|
|
179
|
-
>
|
|
180
|
-
<div className="inline-flex items-start justify-between self-stretch text-sm font-semibold text-strong-950">
|
|
181
|
-
<div className="text-xs w-full min-w-fit">{section.title}</div>
|
|
182
|
-
<div className="text-xs">{section.value}</div>
|
|
183
|
-
</div>
|
|
184
|
-
{section.items?.map((item: any) => (
|
|
185
|
-
<div
|
|
186
|
-
key={item.title}
|
|
187
|
-
className="inline-flex justify-between self-stretch text-[10px] font-normal text-strong-950"
|
|
188
|
-
>
|
|
189
|
-
<div>{item.title}</div>
|
|
190
|
-
<div className="font-semibold">{item.value}</div>
|
|
191
|
-
</div>
|
|
192
|
-
))}
|
|
193
|
-
</div>
|
|
194
|
-
);
|
|
195
|
-
})}
|
|
196
|
-
|
|
197
|
-
<div className="h-[1px] bg-soft-400"></div>
|
|
198
|
-
</div>
|
|
199
|
-
|
|
200
|
-
<div className="flex flex-col items-center gap-4 self-stretch text-xs text-strong-950 flex-shrink-0">
|
|
201
|
-
<div className="w-full text-center font-normal">
|
|
202
|
-
Ngày {date.day} tháng {date.month} năm {date.year}
|
|
203
|
-
</div>
|
|
204
|
-
<div className="flex flex-col gap-20 items-center w-full">
|
|
205
|
-
<div className="flex w-full items-center gap-8 text-sm font-semibold text-strong-950">
|
|
206
|
-
<div className="flex-1 text-center">Người bàn giao</div>
|
|
207
|
-
<div className="flex-1 text-center">Người nhận bàn giao</div>
|
|
208
|
-
</div>
|
|
209
|
-
<div className="text-xs font-normal mt-4 text-center min-w-fit">
|
|
210
|
-
Powered by {company?.companyInfo?.data?.[0]?.display_name}
|
|
211
|
-
</div>
|
|
212
|
-
</div>
|
|
213
|
-
</div>
|
|
214
|
-
</div>
|
|
215
|
-
);
|
|
216
|
-
};
|
|
217
|
-
|
|
218
|
-
export default CloseSessionTicket;
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import ModalDirection from "@components/common/modal/modal-direction";
|
|
2
|
-
|
|
3
|
-
type TProps = {
|
|
4
|
-
isOpen: boolean;
|
|
5
|
-
onClose: () => void;
|
|
6
|
-
children: React.ReactNode;
|
|
7
|
-
title: string;
|
|
8
|
-
};
|
|
9
|
-
|
|
10
|
-
function CloseSessionModalContainer(props: TProps) {
|
|
11
|
-
const { isOpen, onClose, children, title } = props;
|
|
12
|
-
|
|
13
|
-
return (
|
|
14
|
-
<ModalDirection
|
|
15
|
-
isOpen={isOpen}
|
|
16
|
-
onClose={onClose}
|
|
17
|
-
title={title}
|
|
18
|
-
className="overflow-hidden"
|
|
19
|
-
>
|
|
20
|
-
<div className="flex flex-col h-full">{children}</div>
|
|
21
|
-
</ModalDirection>
|
|
22
|
-
);
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
export default CloseSessionModalContainer;
|