Added payment reprint and print wrapper component IO-543

This commit is contained in:
Patrick Fic
2021-01-28 16:43:26 -08:00
parent 5cae88d05f
commit 99348c6400
4 changed files with 55 additions and 33 deletions

View File

@@ -1,5 +1,5 @@
import { SyncOutlined } from "@ant-design/icons";
import { Button, Input, Table } from "antd";
import { Button, Input, Space, Table } from "antd";
import queryString from "query-string";
import React, { useState } from "react";
import { useTranslation } from "react-i18next";
@@ -11,6 +11,9 @@ import { alphaSort } from "../../utils/sorters";
import { connect } from "react-redux";
import { createStructuredSelector } from "reselect";
import { setModalContext } from "../../redux/modals/modals.actions";
import PrintWrapperComponent from "../print-wrapper/print-wrapper.component";
import { TemplateList } from "../../utils/TemplateConstants";
const mapStateToProps = createStructuredSelector({
//currentUser: selectCurrentUser
});
@@ -124,19 +127,25 @@ export function PaymentsListPaginated({
dataIndex: "actions",
key: "actions",
render: (text, record) => (
<div>
<Space>
<Button
disabled={record.exportedat}
onClick={() => {
setPaymentContext({
actions: { refetch: refetch },
context: record ,
context: record,
});
}}
>
{t("general.actions.edit")}
</Button>
</div>
<PrintWrapperComponent
templateObject={{
name: TemplateList("payment").payment_receipt.key,
variables: { id: record.id },
}}
/>
</Space>
),
},
];