coupon correct
This commit is contained in:
parent
4ec18b7fb9
commit
acf742cd63
@ -54,7 +54,7 @@ const AffiliateHistory = () => {
|
||||
},
|
||||
})
|
||||
.then((response) => {
|
||||
// console.log(response.data.message.affiliate_pay_history);
|
||||
console.log(response.data);
|
||||
setApiData(response.data.message.affiliate_pay_history);
|
||||
setName(response.data.message.name);
|
||||
setLoading(false);
|
||||
|
@ -43,7 +43,7 @@ const CouponHistory = () => {
|
||||
const month = monthsMap[monthName];
|
||||
|
||||
// Create the rearranged date string
|
||||
const rearrangedDate = `${day} ${month} ${year}`;
|
||||
const rearrangedDate = `${day}-${month}-${year}`;
|
||||
|
||||
return rearrangedDate;
|
||||
};
|
||||
@ -65,7 +65,6 @@ const CouponHistory = () => {
|
||||
},
|
||||
})
|
||||
.then((response) => {
|
||||
// console.log(response.data.message.coupon_used_history);
|
||||
setLoading(false);
|
||||
setApiData(response.data.message.coupon_used_history);
|
||||
setCouponName(response.data.message.coupon_used_history[0].couponCode);
|
||||
@ -110,11 +109,11 @@ const CouponHistory = () => {
|
||||
style={{ fontSize: "22px", fontWeight: "bold" }}
|
||||
className="fw-bold"
|
||||
>
|
||||
Coupon History {couponName}
|
||||
Coupon Claim History:{couponName}
|
||||
</div>
|
||||
|
||||
<div className="page-title-right">
|
||||
<Link to="/affiliate/affiliates">
|
||||
<Link to="/affiliate/coupons">
|
||||
<Button
|
||||
variant="contained"
|
||||
color="secondary"
|
||||
@ -178,6 +177,8 @@ const CouponHistory = () => {
|
||||
<tr>
|
||||
<th>Order Id</th>
|
||||
<th>User Id</th>
|
||||
<th>Customer Name</th>
|
||||
|
||||
<th>Date</th>
|
||||
<th>Time</th>
|
||||
</tr>
|
||||
@ -204,7 +205,9 @@ const CouponHistory = () => {
|
||||
?.map((item, i) => (
|
||||
<tr key={i}>
|
||||
<td>{item.orderId}</td>
|
||||
<td>{item.userId}</td>
|
||||
<td>{item?.userId?._id}</td>
|
||||
<td>{item?.userId?.name}</td>
|
||||
|
||||
<td>{dateFormat(item.date)}</td>
|
||||
<td>{moment(item.date).format("HH:mm:ss")}</td>
|
||||
</tr>
|
||||
|
@ -52,7 +52,7 @@ function ViewOrders() {
|
||||
setLoading(false);
|
||||
setOrderId(res.data?.order?.order_id);
|
||||
setOrderDetails(res.data?.order);
|
||||
console.log(res.data);
|
||||
console.log("nnnnnnnnnnn", res.data?.order);
|
||||
// let options = {
|
||||
// Franchisee: res.data?.order?.shippingInfo?.Franchisee?._id,
|
||||
// name: res.data?.order?.shippingInfo?.name,
|
||||
@ -573,14 +573,57 @@ function ViewOrders() {
|
||||
</div>
|
||||
)
|
||||
)}
|
||||
<div className="m-0 contents-center mt-3 mb-2">
|
||||
<small className="mb-4">Shipping Charge: </small> ₹
|
||||
{orderDetails?.shipping_charge}
|
||||
<div className="row">
|
||||
<div className="col-6 ">
|
||||
<small className="mb-3">Shipping Charge: </small>{" "}
|
||||
₹{orderDetails?.shipping_charge}
|
||||
<br />
|
||||
<h6 className="mt-2">
|
||||
{orderDetails?.isCouponUsed && (
|
||||
<h6 className="mt-1 text-success">
|
||||
Coupon_Code:
|
||||
{orderDetails?.couponUsed?.coupon_code}
|
||||
</h6>
|
||||
)}
|
||||
</div>
|
||||
<div className="col-6 ">
|
||||
<h6
|
||||
className=""
|
||||
style={{
|
||||
textDecoration: orderDetails?.isCouponUsed
|
||||
? "line-through"
|
||||
: "none",
|
||||
// color: orderDetails?.isCouponUsed
|
||||
// ? "red"
|
||||
// : "inherit",
|
||||
}}
|
||||
>
|
||||
{" "}
|
||||
Total Order Value: ₹{orderDetails?.total_amount}
|
||||
Total Amount: ₹
|
||||
{Number(orderDetails?.total_amount) +
|
||||
Number(
|
||||
orderDetails?.couponUsed?.discount_amount
|
||||
? orderDetails?.couponUsed
|
||||
?.discount_amount
|
||||
: 0
|
||||
)}
|
||||
</h6>{" "}
|
||||
{orderDetails?.isCouponUsed && (
|
||||
<small className="mb-4">
|
||||
Coupon Discount:₹
|
||||
{Number(
|
||||
orderDetails?.couponUsed?.discount_amount
|
||||
)}
|
||||
</small>
|
||||
)}
|
||||
<br />
|
||||
{orderDetails?.isCouponUsed && (
|
||||
<h6 className="">
|
||||
{" "}
|
||||
Total After Discount: ₹
|
||||
{Number(orderDetails?.total_amount)}
|
||||
</h6>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
Loading…
Reference in New Issue
Block a user