Added invoice search + reformatted invoices page BOD-123

This commit is contained in:
Patrick Fic
2020-07-28 15:59:09 -07:00
parent 64e02bf8cb
commit d708ac9226
12 changed files with 476 additions and 196 deletions

View File

@@ -11,13 +11,27 @@ export const INSERT_NEW_INVOICE = gql`
`;
export const QUERY_ALL_INVOICES_PAGINATED = gql`
query QUERY_ALL_INVOICES_PAGINATED($offset: Int, $limit: Int) {
invoices(offset: $offset, limit: $limit, order_by: { date: desc }) {
query QUERY_ALL_INVOICES_PAGINATED(
$search: String
$offset: Int
$limit: Int
$order: [invoices_order_by!]!
) {
search_invoices(
args: { search: $search }
offset: $offset
limit: $limit
order_by: $order
) {
id
vendor {
id
name
}
federal_tax_rate
local_tax_rate
state_tax_rate
is_credit_memo
total
invoice_number
date
@@ -34,6 +48,11 @@ export const QUERY_ALL_INVOICES_PAGINATED = gql`
line_desc
}
}
search_invoices_aggregate(args: { search: $search }) {
aggregate {
count(distinct: true)
}
}
}
`;