IO-787 Delete bill confirmation.
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import { useMutation } from "@apollo/client";
|
||||
import { Button, notification } from "antd";
|
||||
import { Button, notification, Popconfirm } from "antd";
|
||||
import React, { useState } from "react";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { DELETE_BILL } from "../../graphql/bills.queries";
|
||||
@@ -47,9 +47,19 @@ export default function BillDeleteButton({ bill }) {
|
||||
|
||||
return (
|
||||
<RbacWrapper action="bills:delete" noauth={<></>}>
|
||||
<Button disabled={bill.exported} onClick={handleDelete} loading={loading}>
|
||||
{t("general.actions.delete")}
|
||||
</Button>
|
||||
<Popconfirm
|
||||
disabled={bill.exported}
|
||||
onConfirm={handleDelete}
|
||||
title={t("bills.labels.deleteconfirm")}
|
||||
>
|
||||
<Button
|
||||
disabled={bill.exported}
|
||||
// onClick={handleDelete}
|
||||
loading={loading}
|
||||
>
|
||||
{t("general.actions.delete")}
|
||||
</Button>
|
||||
</Popconfirm>
|
||||
</RbacWrapper>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -142,6 +142,7 @@
|
||||
"billcmtotal": "Retail Total of Credit Memos",
|
||||
"bills": "Bills",
|
||||
"dedfromlbr": "Deducted from Labor",
|
||||
"deleteconfirm": "Are you sure you want to delete this bill? It cannot be undone.",
|
||||
"discrepancy": "Discrepancy",
|
||||
"discrepwithcms": "Discrepancy including Credit Memos",
|
||||
"discrepwithlbradj": "Discrepancy including Lbr. Adj.",
|
||||
|
||||
@@ -142,6 +142,7 @@
|
||||
"billcmtotal": "",
|
||||
"bills": "",
|
||||
"dedfromlbr": "",
|
||||
"deleteconfirm": "",
|
||||
"discrepancy": "",
|
||||
"discrepwithcms": "",
|
||||
"discrepwithlbradj": "",
|
||||
|
||||
@@ -142,6 +142,7 @@
|
||||
"billcmtotal": "",
|
||||
"bills": "",
|
||||
"dedfromlbr": "",
|
||||
"deleteconfirm": "",
|
||||
"discrepancy": "",
|
||||
"discrepwithcms": "",
|
||||
"discrepwithlbradj": "",
|
||||
|
||||
Reference in New Issue
Block a user