MAJOR CHANGE: Renamed invoices to bills BOD-410
This commit is contained in:
@@ -28,9 +28,9 @@ export const QUERY_JOBS_FOR_EXPORT = gql`
|
||||
}
|
||||
`;
|
||||
|
||||
export const QUERY_INVOICES_FOR_EXPORT = gql`
|
||||
query QUERY_INVOICES_FOR_EXPORT {
|
||||
invoices(where: { exported: { _eq: false } }) {
|
||||
export const QUERY_BILLS_FOR_EXPORT = gql`
|
||||
query QUERY_BILLS_FOR_EXPORT {
|
||||
bills(where: { exported: { _eq: false } }) {
|
||||
id
|
||||
exported
|
||||
date
|
||||
|
||||
14
client/src/graphql/bill-lines.queries.js
Normal file
14
client/src/graphql/bill-lines.queries.js
Normal file
@@ -0,0 +1,14 @@
|
||||
import gql from "graphql-tag";
|
||||
|
||||
export const UPDATE_BILL_LINE = gql`
|
||||
mutation UPDATE_BILL_LINE(
|
||||
$billLineId: uuid!
|
||||
$billLine: billlines_set_input!
|
||||
) {
|
||||
update_billlines(where: { id: { _eq: $billLineId } }, _set: $billLine) {
|
||||
returning {
|
||||
id
|
||||
}
|
||||
}
|
||||
}
|
||||
`;
|
||||
@@ -1,8 +1,8 @@
|
||||
import gql from "graphql-tag";
|
||||
|
||||
export const INSERT_NEW_INVOICE = gql`
|
||||
mutation INSERT_NEW_INVOICE($invoice: [invoices_insert_input!]!) {
|
||||
insert_invoices(objects: $invoice) {
|
||||
export const INSERT_NEW_BILL = gql`
|
||||
mutation INSERT_NEW_BILL($bill: [bills_insert_input!]!) {
|
||||
insert_bills(objects: $bill) {
|
||||
returning {
|
||||
id
|
||||
}
|
||||
@@ -10,14 +10,14 @@ export const INSERT_NEW_INVOICE = gql`
|
||||
}
|
||||
`;
|
||||
|
||||
export const QUERY_ALL_INVOICES_PAGINATED = gql`
|
||||
query QUERY_ALL_INVOICES_PAGINATED(
|
||||
export const QUERY_ALL_BILLS_PAGINATED = gql`
|
||||
query QUERY_ALL_BILLS_PAGINATED(
|
||||
$search: String
|
||||
$offset: Int
|
||||
$limit: Int
|
||||
$order: [invoices_order_by!]!
|
||||
$order: [bills_order_by!]!
|
||||
) {
|
||||
search_invoices(
|
||||
search_bills(
|
||||
args: { search: $search }
|
||||
offset: $offset
|
||||
limit: $limit
|
||||
@@ -39,7 +39,7 @@ export const QUERY_ALL_INVOICES_PAGINATED = gql`
|
||||
id
|
||||
ro_number
|
||||
}
|
||||
invoicelines {
|
||||
billlines {
|
||||
actual_price
|
||||
quantity
|
||||
actual_cost
|
||||
@@ -48,7 +48,7 @@ export const QUERY_ALL_INVOICES_PAGINATED = gql`
|
||||
line_desc
|
||||
}
|
||||
}
|
||||
search_invoices_aggregate(args: { search: $search }) {
|
||||
search_bills_aggregate(args: { search: $search }) {
|
||||
aggregate {
|
||||
count(distinct: true)
|
||||
}
|
||||
@@ -56,8 +56,8 @@ export const QUERY_ALL_INVOICES_PAGINATED = gql`
|
||||
}
|
||||
`;
|
||||
|
||||
export const QUERY_INVOICES_BY_JOBID = gql`
|
||||
query QUERY_PARTS_INVOICES_BY_JOBID($jobid: uuid!) {
|
||||
export const QUERY_BILLS_BY_JOBID = gql`
|
||||
query QUERY_PARTS_BILLS_BY_JOBID($jobid: uuid!) {
|
||||
parts_orders(
|
||||
where: { jobid: { _eq: $jobid } }
|
||||
order_by: { order_date: desc }
|
||||
@@ -89,7 +89,7 @@ export const QUERY_INVOICES_BY_JOBID = gql`
|
||||
order_number
|
||||
user_email
|
||||
}
|
||||
invoices(where: { jobid: { _eq: $jobid } }, order_by: { date: desc }) {
|
||||
bills(where: { jobid: { _eq: $jobid } }, order_by: { date: desc }) {
|
||||
id
|
||||
vendorid
|
||||
vendor {
|
||||
@@ -103,7 +103,7 @@ export const QUERY_INVOICES_BY_JOBID = gql`
|
||||
state_tax_rate
|
||||
local_tax_rate
|
||||
is_credit_memo
|
||||
invoicelines {
|
||||
billlines {
|
||||
actual_price
|
||||
quantity
|
||||
actual_cost
|
||||
@@ -117,57 +117,39 @@ export const QUERY_INVOICES_BY_JOBID = gql`
|
||||
}
|
||||
`;
|
||||
|
||||
export const QUERY_INVOICES_BY_VENDOR = gql`
|
||||
query QUERY_INVOICES_BY_VENDOR($vendorId: uuid!) {
|
||||
invoices(
|
||||
where: { vendorid: { _eq: $vendorId } }
|
||||
order_by: { date: desc }
|
||||
) {
|
||||
id
|
||||
job {
|
||||
id
|
||||
ro_number
|
||||
}
|
||||
total
|
||||
invoice_number
|
||||
date
|
||||
}
|
||||
}
|
||||
`;
|
||||
// export const QUERY_INVOICES_BY_VENDOR_PAGINATED = gql`
|
||||
// query QUERY_INVOICES_BY_VENDOR_PAGINATED(
|
||||
// $vendorId: uuid!
|
||||
// $offset: Int
|
||||
// $limit: Int
|
||||
// $order: [invoices_order_by!]!
|
||||
// ) {
|
||||
// invoices(
|
||||
// where: { vendorid: { _eq: $vendorId } }
|
||||
// offset: $offset
|
||||
// limit: $limit
|
||||
// order_by: $order
|
||||
// ) {
|
||||
// id
|
||||
// job {
|
||||
// id
|
||||
// ro_number
|
||||
// }
|
||||
// total
|
||||
// invoice_number
|
||||
// date
|
||||
// }
|
||||
// invoices_aggregate(where: { vendorid: { _eq: $vendorId } }) {
|
||||
// aggregate {
|
||||
// count(distinct: true)
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// `;
|
||||
|
||||
export const QUERY_INVOICES_BY_VENDOR_PAGINATED = gql`
|
||||
query QUERY_INVOICES_BY_VENDOR_PAGINATED(
|
||||
$vendorId: uuid!
|
||||
$offset: Int
|
||||
$limit: Int
|
||||
$order: [invoices_order_by!]!
|
||||
) {
|
||||
invoices(
|
||||
where: { vendorid: { _eq: $vendorId } }
|
||||
offset: $offset
|
||||
limit: $limit
|
||||
order_by: $order
|
||||
) {
|
||||
id
|
||||
job {
|
||||
id
|
||||
ro_number
|
||||
}
|
||||
total
|
||||
invoice_number
|
||||
date
|
||||
}
|
||||
invoices_aggregate(where: { vendorid: { _eq: $vendorId } }) {
|
||||
aggregate {
|
||||
count(distinct: true)
|
||||
}
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
export const QUERY_INVOICE_BY_PK = gql`
|
||||
query QUERY_INVOICE_BY_PK($invoiceid: uuid!) {
|
||||
invoices_by_pk(id: $invoiceid) {
|
||||
export const QUERY_BILL_BY_PK = gql`
|
||||
query QUERY_BILL_BY_PK($billid: uuid!) {
|
||||
bills_by_pk(id: $billid) {
|
||||
due_date
|
||||
exported
|
||||
exported_at
|
||||
@@ -187,7 +169,7 @@ export const QUERY_INVOICE_BY_PK = gql`
|
||||
name
|
||||
discount
|
||||
}
|
||||
invoicelines {
|
||||
billlines {
|
||||
id
|
||||
line_desc
|
||||
actual_price
|
||||
@@ -207,9 +189,9 @@ export const QUERY_INVOICE_BY_PK = gql`
|
||||
}
|
||||
`;
|
||||
|
||||
export const UPDATE_INVOICE = gql`
|
||||
mutation UPDATE_INVOICE($invoiceId: uuid!, $invoice: invoices_set_input!) {
|
||||
update_invoices(where: { id: { _eq: $invoiceId } }, _set: $invoice) {
|
||||
export const UPDATE_BILL = gql`
|
||||
mutation UPDATE_BILL($billId: uuid!, $bill: bills_set_input!) {
|
||||
update_bills(where: { id: { _eq: $billId } }, _set: $bill) {
|
||||
returning {
|
||||
id
|
||||
exported
|
||||
@@ -219,12 +201,9 @@ export const UPDATE_INVOICE = gql`
|
||||
}
|
||||
`;
|
||||
|
||||
export const UPDATE_INVOICES = gql`
|
||||
mutation UPDATE_INVOICES(
|
||||
$invoiceIdList: [uuid!]!
|
||||
$invoice: invoices_set_input!
|
||||
) {
|
||||
update_invoices(where: { id: { _in: $invoiceIdList } }, _set: $invoice) {
|
||||
export const UPDATE_BILLS = gql`
|
||||
mutation UPDATE_BILLS($billIdList: [uuid!]!, $bill: bills_set_input!) {
|
||||
update_bills(where: { id: { _in: $billIdList } }, _set: $bill) {
|
||||
returning {
|
||||
id
|
||||
exported
|
||||
@@ -48,7 +48,7 @@ export const QUERY_BODYSHOP = gql`
|
||||
template_header
|
||||
textid
|
||||
production_config
|
||||
invoice_tax_rates
|
||||
bill_tax_rates
|
||||
inhousevendorid
|
||||
accountingconfig
|
||||
appt_length
|
||||
@@ -118,7 +118,7 @@ export const UPDATE_SHOP = gql`
|
||||
template_header
|
||||
textid
|
||||
production_config
|
||||
invoice_tax_rates
|
||||
bill_tax_rates
|
||||
appt_length
|
||||
stripe_acct_id
|
||||
ssbuckets
|
||||
|
||||
@@ -1,17 +0,0 @@
|
||||
import gql from "graphql-tag";
|
||||
|
||||
export const UPDATE_INVOICE_LINE = gql`
|
||||
mutation UPDATE_INVOICE_LINE(
|
||||
$invoicelineId: uuid!
|
||||
$invoiceLine: invoicelines_set_input!
|
||||
) {
|
||||
update_invoicelines(
|
||||
where: { id: { _eq: $invoicelineId } }
|
||||
_set: $invoiceLine
|
||||
) {
|
||||
returning {
|
||||
id
|
||||
}
|
||||
}
|
||||
}
|
||||
`;
|
||||
@@ -124,8 +124,8 @@ export const UPDATE_JOB_LINE = gql`
|
||||
}
|
||||
`;
|
||||
|
||||
export const GET_JOB_LINES_TO_ENTER_INVOICE = gql`
|
||||
query GET_JOB_LINES_TO_ENTER_INVOICE($id: uuid!) {
|
||||
export const GET_JOB_LINES_TO_ENTER_BILL = gql`
|
||||
query GET_JOB_LINES_TO_ENTER_BILL($id: uuid!) {
|
||||
joblines(where: { jobid: { _eq: $id } }) {
|
||||
id
|
||||
line_desc
|
||||
|
||||
@@ -215,13 +215,13 @@ export const QUERY_JOB_COSTING_DETAILS = gql`
|
||||
lbr_amt
|
||||
op_code_desc
|
||||
}
|
||||
invoices {
|
||||
bills {
|
||||
id
|
||||
federal_tax_rate
|
||||
local_tax_rate
|
||||
state_tax_rate
|
||||
is_credit_memo
|
||||
invoicelines {
|
||||
billlines {
|
||||
actual_cost
|
||||
cost_center
|
||||
id
|
||||
|
||||
@@ -42,7 +42,7 @@ export const GLOBAL_SEARCH_QUERY = gql`
|
||||
memo
|
||||
transactionid
|
||||
}
|
||||
search_invoices(args: { search: $search }) {
|
||||
search_bills(args: { search: $search }) {
|
||||
id
|
||||
date
|
||||
invoice_number
|
||||
|
||||
Reference in New Issue
Block a user