Print IH invoices after creation IO-724
This commit is contained in:
@@ -7,10 +7,12 @@ import { connect } from "react-redux";
|
||||
import { Link, useHistory, useLocation } from "react-router-dom";
|
||||
import BillDeleteButton from "../../components/bill-delete-button/bill-delete-button.component";
|
||||
import PartsOrderModalContainer from "../../components/parts-order-modal/parts-order-modal.container";
|
||||
import PrintWrapperComponent from "../../components/print-wrapper/print-wrapper.component";
|
||||
import { setModalContext } from "../../redux/modals/modals.actions";
|
||||
import CurrencyFormatter from "../../utils/CurrencyFormatter";
|
||||
import { DateFormatter } from "../../utils/DateFormatter";
|
||||
import { alphaSort } from "../../utils/sorters";
|
||||
import { TemplateList } from "../../utils/TemplateConstants";
|
||||
|
||||
const mapDispatchToProps = (dispatch) => ({
|
||||
setPartsOrderContext: (context) =>
|
||||
@@ -34,6 +36,7 @@ export function BillsListPage({
|
||||
const history = useHistory();
|
||||
const search = queryString.parse(useLocation().search);
|
||||
const { page } = search;
|
||||
const Templates = TemplateList("bill");
|
||||
|
||||
const columns = [
|
||||
{
|
||||
@@ -136,7 +139,7 @@ export function BillsListPage({
|
||||
dataIndex: "actions",
|
||||
key: "actions",
|
||||
render: (text, record) => (
|
||||
<Space>
|
||||
<Space wrap>
|
||||
<Link to={`/manage/bills?billid=${record.id}`}>
|
||||
<Button>{t("bills.actions.edit")}</Button>
|
||||
</Link>
|
||||
@@ -153,7 +156,7 @@ export function BillsListPage({
|
||||
linesToOrder: record.billlines.map((i) => {
|
||||
return {
|
||||
line_desc: i.line_desc,
|
||||
// db_price: i.actual_price,
|
||||
// db_price: i.actual_price,
|
||||
act_price: i.actual_price,
|
||||
quantity: i.quantity,
|
||||
joblineid: i.joblineid,
|
||||
@@ -167,6 +170,15 @@ export function BillsListPage({
|
||||
{t("bills.actions.return")}
|
||||
</Button>
|
||||
<BillDeleteButton bill={record} />
|
||||
{record.isinhouse && (
|
||||
<PrintWrapperComponent
|
||||
templateObject={{
|
||||
name: Templates.inhouse_invoice.key,
|
||||
variables: { id: record.id },
|
||||
}}
|
||||
messageObject={{ subject: Templates.inhouse_invoice.subject }}
|
||||
/>
|
||||
)}
|
||||
</Space>
|
||||
),
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user