mirror of
https://github.com/Tria-plc/edr-platform.git
synced 2026-09-08 19:28:17 +00:00
fix: merge marker in invoice detial page
This commit is contained in:
@@ -10,7 +10,6 @@ import {
|
|||||||
Group,
|
Group,
|
||||||
Loader,
|
Loader,
|
||||||
Paper,
|
Paper,
|
||||||
Select,
|
|
||||||
SimpleGrid,
|
SimpleGrid,
|
||||||
Stack,
|
Stack,
|
||||||
Table,
|
Table,
|
||||||
@@ -24,7 +23,6 @@ import {
|
|||||||
ExternalLink,
|
ExternalLink,
|
||||||
Receipt,
|
Receipt,
|
||||||
} from "lucide-react";
|
} from "lucide-react";
|
||||||
import { useState } from "react";
|
|
||||||
import toast from "react-hot-toast";
|
import toast from "react-hot-toast";
|
||||||
|
|
||||||
import { api } from "@/services/api";
|
import { api } from "@/services/api";
|
||||||
@@ -67,7 +65,9 @@ function MetaItem({ label, value }: { label: string; value: string }) {
|
|||||||
export default function InvoiceDetailPage() {
|
export default function InvoiceDetailPage() {
|
||||||
const { id = "" } = useParams();
|
const { id = "" } = useParams();
|
||||||
const navigate = useNavigate();
|
const navigate = useNavigate();
|
||||||
const [paymentMethod, setPaymentMethod] = useState<"TELEBIRR" | "WAAFI">("TELEBIRR");
|
const [paymentMethod, setPaymentMethod] = useState<"TELEBIRR" | "WAAFI">(
|
||||||
|
"TELEBIRR",
|
||||||
|
);
|
||||||
|
|
||||||
const {
|
const {
|
||||||
data: invoice,
|
data: invoice,
|
||||||
@@ -130,11 +130,6 @@ export default function InvoiceDetailPage() {
|
|||||||
const amountDue = Number(invoice.balanceAmount ?? invoice.totalAmount);
|
const amountDue = Number(invoice.balanceAmount ?? invoice.totalAmount);
|
||||||
|
|
||||||
const handlePay = () => {
|
const handlePay = () => {
|
||||||
<<<<<<< HEAD
|
|
||||||
const returnUrl = `${window.location.origin}/payment/success`;
|
|
||||||
const failureUrl = `${window.location.origin}/payment/failure`;
|
|
||||||
payMutation.mutate({ id, payload: { method: paymentMethod, returnUrl, failureUrl } });
|
|
||||||
=======
|
|
||||||
setPayModalOpen(true);
|
setPayModalOpen(true);
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -184,7 +179,6 @@ export default function InvoiceDetailPage() {
|
|||||||
}
|
}
|
||||||
toast.error("This invoice's source isn't linked to a booking.");
|
toast.error("This invoice's source isn't linked to a booking.");
|
||||||
}
|
}
|
||||||
>>>>>>> 03740ee719f22f9617379a652b26f13b6870f671
|
|
||||||
};
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
@@ -214,20 +208,6 @@ export default function InvoiceDetailPage() {
|
|||||||
</Title>
|
</Title>
|
||||||
<InvoiceStatusBadge status={invoice.status} />
|
<InvoiceStatusBadge status={invoice.status} />
|
||||||
</Group>
|
</Group>
|
||||||
<<<<<<< HEAD
|
|
||||||
{payable && (
|
|
||||||
<Group align="flex-end" gap="sm">
|
|
||||||
<Select
|
|
||||||
label="Payment provider"
|
|
||||||
value={paymentMethod}
|
|
||||||
onChange={(value) => setPaymentMethod((value as "TELEBIRR" | "WAAFI") ?? "TELEBIRR")}
|
|
||||||
data={[
|
|
||||||
{ value: "TELEBIRR", label: "Telebirr" },
|
|
||||||
{ value: "WAAFI", label: "Waafi" },
|
|
||||||
]}
|
|
||||||
w={170}
|
|
||||||
/>
|
|
||||||
=======
|
|
||||||
<Group gap={8} wrap="wrap">
|
<Group gap={8} wrap="wrap">
|
||||||
{canViewSource && (
|
{canViewSource && (
|
||||||
<Button
|
<Button
|
||||||
@@ -271,7 +251,6 @@ export default function InvoiceDetailPage() {
|
|||||||
</Button>
|
</Button>
|
||||||
)}
|
)}
|
||||||
{payable && (
|
{payable && (
|
||||||
>>>>>>> 03740ee719f22f9617379a652b26f13b6870f671
|
|
||||||
<Button
|
<Button
|
||||||
color="edr-green"
|
color="edr-green"
|
||||||
radius="md"
|
radius="md"
|
||||||
@@ -279,14 +258,6 @@ export default function InvoiceDetailPage() {
|
|||||||
leftSection={<CreditCard size={16} />}
|
leftSection={<CreditCard size={16} />}
|
||||||
loading={payMutation.isPending}
|
loading={payMutation.isPending}
|
||||||
onClick={handlePay}
|
onClick={handlePay}
|
||||||
<<<<<<< HEAD
|
|
||||||
styles={{ root: { fontWeight: 600, height: 42, paddingInline: 18 } }}
|
|
||||||
>
|
|
||||||
Pay {formatCurrency(amountDue, invoice.currency)}
|
|
||||||
</Button>
|
|
||||||
</Group>
|
|
||||||
)}
|
|
||||||
=======
|
|
||||||
styles={{
|
styles={{
|
||||||
root: { fontWeight: 600, height: 42, paddingInline: 18 },
|
root: { fontWeight: 600, height: 42, paddingInline: 18 },
|
||||||
}}
|
}}
|
||||||
@@ -296,7 +267,6 @@ export default function InvoiceDetailPage() {
|
|||||||
</Button>
|
</Button>
|
||||||
)}
|
)}
|
||||||
</Group>
|
</Group>
|
||||||
>>>>>>> 03740ee719f22f9617379a652b26f13b6870f671
|
|
||||||
</Group>
|
</Group>
|
||||||
|
|
||||||
{/* Summary */}
|
{/* Summary */}
|
||||||
|
|||||||
Reference in New Issue
Block a user