@@ -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>
|
<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>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
@@ -107,7 +108,12 @@ const DetailPerfomaInvoice: FC = () => {
|
|||||||
<td className="py-3">{discounts.percent}</td>
|
<td className="py-3">{discounts.percent}</td>
|
||||||
<td className="py-3">{formatAmount(lineTotal)}</td>
|
<td className="py-3">{formatAmount(lineTotal)}</td>
|
||||||
<td className="py-3">
|
<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
|
<Link
|
||||||
to={convertToOrderUrl}
|
to={convertToOrderUrl}
|
||||||
>
|
>
|
||||||
|
|||||||
@@ -10,8 +10,7 @@ import {
|
|||||||
getItemSubTotal,
|
getItemSubTotal,
|
||||||
} from "../utils/invoiceItem";
|
} from "../utils/invoiceItem";
|
||||||
import { Trash } from "iconsax-react";
|
import { Trash } from "iconsax-react";
|
||||||
import { Link } from "react-router-dom";
|
|
||||||
import { Paths } from "@/config/Paths";
|
|
||||||
type Props = {
|
type Props = {
|
||||||
item: CreatePreInvoiceItemType;
|
item: CreatePreInvoiceItemType;
|
||||||
index: number;
|
index: number;
|
||||||
@@ -22,7 +21,6 @@ type Props = {
|
|||||||
) => void;
|
) => void;
|
||||||
onRemove: () => void;
|
onRemove: () => void;
|
||||||
canRemove: boolean;
|
canRemove: boolean;
|
||||||
onConvertToOrder?: () => void;
|
|
||||||
error?: Partial<Record<keyof CreatePreInvoiceItemType, string>>;
|
error?: Partial<Record<keyof CreatePreInvoiceItemType, string>>;
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -32,18 +30,11 @@ const InvoiceItemRow: FC<Props> = ({
|
|||||||
onChange,
|
onChange,
|
||||||
onRemove,
|
onRemove,
|
||||||
canRemove,
|
canRemove,
|
||||||
onConvertToOrder,
|
|
||||||
error,
|
error,
|
||||||
}) => {
|
}) => {
|
||||||
const total = getItemLineTotal(item);
|
const total = getItemLineTotal(item);
|
||||||
const subTotal = getItemSubTotal(item);
|
const subTotal = getItemSubTotal(item);
|
||||||
const isPercentDiscount = item.discountPercent != null;
|
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>) => {
|
const handleProductChange = (e: ChangeEvent<HTMLSelectElement>) => {
|
||||||
onChange(index, "productId", e.target.value);
|
onChange(index, "productId", e.target.value);
|
||||||
@@ -178,17 +169,6 @@ const InvoiceItemRow: FC<Props> = ({
|
|||||||
<Trash size={18} color="#dc2626" />
|
<Trash size={18} color="#dc2626" />
|
||||||
</button>
|
</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>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
|||||||
Reference in New Issue
Block a user