Files
bodyshop/client/src/graphql/accounting.queries.js
2021-02-24 08:48:55 -08:00

79 lines
1.3 KiB
JavaScript

import { gql } from "@apollo/client";
export const QUERY_JOBS_FOR_EXPORT = gql`
query QUERY_JOBS_FOR_EXPORT($invoicedStatus: String!) {
jobs(
where: {
date_exported: { _is_null: true }
status: { _eq: $invoicedStatus }
}
) {
id
ro_number
ownr_fn
ownr_ln
ownr_co_nm
date_invoiced
date_exported
status
v_model_desc
v_make_desc
v_model_yr
v_color
clm_total
clm_no
ins_co_nm
}
}
`;
export const QUERY_BILLS_FOR_EXPORT = gql`
query QUERY_BILLS_FOR_EXPORT {
bills(where: { exported: { _eq: false }, isinhouse: { _eq: false } }) {
id
exported
date
invoice_number
is_credit_memo
total
job {
id
ro_number
}
vendor {
name
id
}
}
}
`;
export const QUERY_PAYMENTS_FOR_EXPORT = gql`
query QUERY_PAYMENTS_FOR_EXPORT {
payments(
where: { exportedat: { _is_null: true } }
order_by: { created_at: desc }
) {
id
amount
job {
ro_number
id
ownr_fn
ownr_ln
ownr_co_nm
}
payer
memo
exportedat
stripeid
created_at
transactionid
paymentnum
date
}
}
`;