IO-1855 Change QBO changes to server side.

This commit is contained in:
Patrick Fic
2022-05-02 15:52:05 -07:00
parent 2d9de4703b
commit 4f6d1d27d5
18 changed files with 567 additions and 337 deletions

View File

@@ -217,6 +217,7 @@ query QUERY_JOBS_FOR_RECEIVABLES_EXPORT($ids: [uuid!]!) {
accountingconfig
md_ins_cos
timezone
md_ro_statuses
}
}
`;
@@ -408,6 +409,13 @@ query QUERY_JOBS_FOR_PBS_EXPORT($id: uuid!) {
exports.QUERY_BILLS_FOR_PAYABLES_EXPORT = `
query QUERY_BILLS_FOR_PAYABLES_EXPORT($bills: [uuid!]!) {
bodyshops(where: {associations: {active: {_eq: true}}}) {
id
md_responsibility_centers
timezone
region_config
accountingconfig
}
bills(where: {id: {_in: $bills}}) {
id
date
@@ -424,12 +432,6 @@ query QUERY_BILLS_FOR_PAYABLES_EXPORT($bills: [uuid!]!) {
ownr_ln
ownr_co_nm
class
bodyshop{
md_responsibility_centers
timezone
region_config
accountingconfig
}
}
billlines{
id
@@ -1482,6 +1484,7 @@ mutation MARK_JOB_EXPORTED($jobId: uuid!, $job: jobs_set_input!, $log: exportlog
}
}
`;
exports.INSERT_EXPORT_LOG = `
mutation INSERT_EXPORT_LOG($log: exportlog_insert_input!) {
insert_exportlog_one(object: $log) {
@@ -1534,4 +1537,52 @@ exports.QUERY_JOB_ID_MIXDATA = `query QUERY_JOB_ID_MIXDATA($roNumbers: [String!]
}
}
`;
`;
exports.QBO_MARK_JOB_EXPORTED = `
mutation QBO_MARK_JOB_EXPORTED($jobId: uuid!, $job: jobs_set_input!, $logs: [exportlog_insert_input!]!) {
insert_exportlog(objects: $logs) {
affected_rows
}
update_jobs(where: {id: {_eq: $jobId}}, _set: $job) {
returning {
id
}
}
}
`;
exports.QBO_MARK_BILL_EXPORTED = `
mutation QBO_MARK_BILL_EXPORTED($billId: uuid!, $bill: bills_set_input!, $logs: [exportlog_insert_input!]!) {
insert_exportlog(objects: $logs) {
affected_rows
}
update_bills(where: { id: { _eq: $billId } }, _set: $bill) {
returning {
id
}
}
}
`;
exports.QBO_MARK_PAYMENT_EXPORTED = `
mutation QBO_MARK_PAYMENT_EXPORTED($paymentId: uuid!, $payment: payments_set_input!, $logs: [exportlog_insert_input!]!) {
insert_exportlog(objects: $logs) {
affected_rows
}
update_payments(where: {id: {_eq: $paymentId}}, _set: $payment) {
returning {
id
}
}
}`;
exports.INSERT_EXPORT_LOG = `
mutation INSERT_EXPORT_LOG($logs: [exportlog_insert_input!]!) {
insert_exportlog(objects: $logs) {
affected_rows
}
}
`;