@@ -82,6 +82,7 @@ const DetailPerfomaInvoice: FC = () => {
|
||||
<th className="pb-3 font-normal">تخفیف (مبلغ)</th>
|
||||
<th className="pb-3 font-normal">تخفیف (درصد)</th>
|
||||
<th className="pb-3 font-normal">مبلغ کل</th>
|
||||
<th className="pb-3 font-normal">تاریخ تایید</th>
|
||||
<th className="pb-3 font-normal">عملیات</th>
|
||||
</tr>
|
||||
</thead>
|
||||
@@ -107,7 +108,12 @@ const DetailPerfomaInvoice: FC = () => {
|
||||
<td className="py-3">{discounts.percent}</td>
|
||||
<td className="py-3">{formatAmount(lineTotal)}</td>
|
||||
<td className="py-3">
|
||||
{item.id && (
|
||||
{item.confirmedAt
|
||||
? moment(item.confirmedAt).format('jYYYY/jMM/jDD HH:mm')
|
||||
: '-'}
|
||||
</td>
|
||||
<td className="py-3">
|
||||
{item.id && item.confirmedAt && (
|
||||
<Link
|
||||
to={convertToOrderUrl}
|
||||
>
|
||||
|
||||
@@ -10,8 +10,7 @@ import {
|
||||
getItemSubTotal,
|
||||
} from "../utils/invoiceItem";
|
||||
import { Trash } from "iconsax-react";
|
||||
import { Link } from "react-router-dom";
|
||||
import { Paths } from "@/config/Paths";
|
||||
|
||||
type Props = {
|
||||
item: CreatePreInvoiceItemType;
|
||||
index: number;
|
||||
@@ -22,7 +21,6 @@ type Props = {
|
||||
) => void;
|
||||
onRemove: () => void;
|
||||
canRemove: boolean;
|
||||
onConvertToOrder?: () => void;
|
||||
error?: Partial<Record<keyof CreatePreInvoiceItemType, string>>;
|
||||
};
|
||||
|
||||
@@ -32,18 +30,11 @@ const InvoiceItemRow: FC<Props> = ({
|
||||
onChange,
|
||||
onRemove,
|
||||
canRemove,
|
||||
onConvertToOrder,
|
||||
error,
|
||||
}) => {
|
||||
const total = getItemLineTotal(item);
|
||||
const subTotal = getItemSubTotal(item);
|
||||
const isPercentDiscount = item.discountPercent != null;
|
||||
const convertToOrderUrl = item.id
|
||||
? `${Paths.convertToOrder}?${new URLSearchParams({
|
||||
invoiceItemId: item.id,
|
||||
productId: item.productId,
|
||||
}).toString()}`
|
||||
: "";
|
||||
|
||||
const handleProductChange = (e: ChangeEvent<HTMLSelectElement>) => {
|
||||
onChange(index, "productId", e.target.value);
|
||||
@@ -178,17 +169,6 @@ const InvoiceItemRow: FC<Props> = ({
|
||||
<Trash size={18} color="#dc2626" />
|
||||
</button>
|
||||
)}
|
||||
{item.id && (
|
||||
<Link to={convertToOrderUrl}>
|
||||
<button
|
||||
type="button"
|
||||
onClick={onConvertToOrder}
|
||||
className="h-10 px-4 rounded-xl border border-primary text-primary text-sm hover:bg-primary/5 transition-colors flex-shrink-0"
|
||||
>
|
||||
تبدیل به سفارش
|
||||
</button>
|
||||
</Link>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user