From 7e110edd91240b93866aa9058a1cdebc89789b15 Mon Sep 17 00:00:00 2001 From: kimthu09 <21521495@gm.uit.edu.vn> Date: Mon, 15 Jan 2024 22:27:17 +0700 Subject: [PATCH] fix: invoice details --- .../app/invoice/[invoiceId]/detail-layout.tsx | 66 ++++++++++++++----- frontend/app/sale/page-layout.tsx | 1 + frontend/app/setting/detail-layout.tsx | 15 ++++- .../invoice/invoice-detail-table.tsx | 12 ++-- frontend/components/invoice/print-invoice.tsx | 56 ++++++++++++---- frontend/components/invoice/table-layout.tsx | 1 - frontend/components/sale/bill-tab.tsx | 6 +- frontend/components/staff/change-image.tsx | 2 + .../components/staff/create-staff-dialog.tsx | 2 + .../components/supplier-manage/create.tsx | 3 - frontend/lib/shop-general/getShopGeneral.ts | 1 - 11 files changed, 121 insertions(+), 44 deletions(-) diff --git a/frontend/app/invoice/[invoiceId]/detail-layout.tsx b/frontend/app/invoice/[invoiceId]/detail-layout.tsx index 976b168..8f80b73 100644 --- a/frontend/app/invoice/[invoiceId]/detail-layout.tsx +++ b/frontend/app/invoice/[invoiceId]/detail-layout.tsx @@ -43,31 +43,59 @@ const DetailLayout = (responseData: any) => { width={36} height={36} > -

{shop.name}

+

+ {shop.name} +

{shop.address && shop.address !== "" ? ( - + Địa chỉ: {shop.address} ) : null} {shop.phone && shop.phone !== "" ? ( - + Số điện thoại: {shop.phone} ) : null} {shop.wifiPass && shop.wifiPass !== "" ? ( - + Wifi: {shop.wifiPass} ) : null}
-
+
- Mã hóa đơn: + Mã hóa đơn: {responseData.invoice.id}
+ {responseData.invoice.customer && ( + <> +
+ + Khách hàng: + +
+ {responseData.invoice.customer.name} + + ({responseData.invoice.customer.phone}) + +
+
+
+ + Điểm: + +
+ +{" "} + {responseData.invoice.pointReceive.toLocaleString( + "vi-VN" + )} +
+
+ + )}
@@ -90,19 +118,21 @@ const DetailLayout = (responseData: any) => {
-
- Tổng tiền: - - {toVND(responseData.invoice.totalPrice)} - -
{responseData.invoice.amountPriceUsePoint !== 0 ? ( -
- Giảm: - - - {toVND(responseData.invoice.amountPriceUsePoint)} - -
+ <> +
+ Tổng tiền: + + {toVND(responseData.invoice.totalPrice)} + +
+
+ Giảm: + + - {toVND(responseData.invoice.amountPriceUsePoint)} + +
+ ) : null}
Thành tiền: diff --git a/frontend/app/sale/page-layout.tsx b/frontend/app/sale/page-layout.tsx index 4e632d7..6781b68 100644 --- a/frontend/app/sale/page-layout.tsx +++ b/frontend/app/sale/page-layout.tsx @@ -123,6 +123,7 @@ const SaleScreen = () => { details: [], }); mutate(`${endPoint}/v1/customers/all`); + mutate(`${endPoint}/v1/books/all`); router.refresh(); } }; diff --git a/frontend/app/setting/detail-layout.tsx b/frontend/app/setting/detail-layout.tsx index a6d9184..aa28cf5 100644 --- a/frontend/app/setting/detail-layout.tsx +++ b/frontend/app/setting/detail-layout.tsx @@ -1,6 +1,5 @@ "use client"; import ConfirmDialog from "@/components/confirm-dialog"; -import Loading from "@/components/loading"; import { Button } from "@/components/ui/button"; import { Card, CardContent } from "@/components/ui/card"; import { Input } from "@/components/ui/input"; @@ -255,6 +254,20 @@ const DetailLayout = () => { )}
+
+ + + {errors.address && ( + + {errors.address.message} + + )} +