Added invoices to global search BOD-238

This commit is contained in:
Patrick Fic
2020-07-28 16:12:39 -07:00
parent d708ac9226
commit 698833edd9
2 changed files with 26 additions and 0 deletions

View File

@@ -131,6 +131,23 @@ export default function GlobalSearch() {
};
}),
},
{
label: renderTitle(t("menus.header.search.invoices")),
options: data.search_invoices.map((invoice) => {
return {
value: `${invoice.invoice_number}`,
label: (
<Link to={`/manage/invoices?invoiceid=${invoice.id}`}>
<div className="imex-flex-row">
<span className="imex-flex-row__margin-large">{`${invoice.invoice_number}`}</span>
<span className="imex-flex-row__margin-large">{`${invoice.vendor.name}`}</span>
<span className="imex-flex-row__margin-large">{`${invoice.date}`}</span>
</div>
</Link>
),
};
}),
},
]
: [];

View File

@@ -40,5 +40,14 @@ export const GLOBAL_SEARCH_QUERY = gql`
memo
transactionid
}
search_invoices(args: { search: $search }) {
id
date
invoice_number
vendor {
id
name
}
}
}
`;