MAJOR CHANGE: Renamed invoices to bills BOD-410

This commit is contained in:
Patrick Fic
2020-09-22 17:01:03 -07:00
parent 95ee3ae2bc
commit f84520c260
91 changed files with 2510 additions and 2624 deletions

View File

@@ -0,0 +1 @@
[]

View File

@@ -0,0 +1,5 @@
- args:
cascade: true
read_only: false
sql: DROP FUNCTION IF EXISTS search_invoices;
type: run_sql

View File

@@ -0,0 +1,5 @@
- args:
cascade: false
read_only: false
sql: alter table "public"."bills" rename to "invoices";
type: run_sql

View File

@@ -0,0 +1,5 @@
- args:
cascade: false
read_only: false
sql: alter table "public"."invoices" rename to "bills";
type: run_sql

View File

@@ -0,0 +1,5 @@
- args:
cascade: false
read_only: false
sql: alter table "public"."billlines" rename to "invoicelines";
type: run_sql

View File

@@ -0,0 +1,5 @@
- args:
cascade: false
read_only: false
sql: alter table "public"."invoicelines" rename to "billlines";
type: run_sql

View File

@@ -0,0 +1,5 @@
- args:
cascade: false
read_only: false
sql: alter table "public"."billlines" rename column "billid" to "invoiceid";
type: run_sql

View File

@@ -0,0 +1,5 @@
- args:
cascade: false
read_only: false
sql: alter table "public"."billlines" rename column "invoiceid" to "billid";
type: run_sql

View File

@@ -0,0 +1,7 @@
- args:
name: bill
new_name: invoice
table:
name: billlines
schema: public
type: rename_relationship

View File

@@ -0,0 +1,7 @@
- args:
name: invoice
new_name: bill
table:
name: billlines
schema: public
type: rename_relationship

View File

@@ -0,0 +1,7 @@
- args:
name: bill
new_name: invoice
table:
name: jobs
schema: public
type: rename_relationship

View File

@@ -0,0 +1,7 @@
- args:
name: invoice
new_name: bill
table:
name: jobs
schema: public
type: rename_relationship

View File

@@ -0,0 +1,7 @@
- args:
name: bills
new_name: invoices
table:
name: jobs
schema: public
type: rename_relationship

View File

@@ -0,0 +1,7 @@
- args:
name: invoices
new_name: bills
table:
name: jobs
schema: public
type: rename_relationship

View File

@@ -0,0 +1,7 @@
- args:
name: bill
new_name: invoice
table:
name: documents
schema: public
type: rename_relationship

View File

@@ -0,0 +1,7 @@
- args:
name: invoice
new_name: bill
table:
name: documents
schema: public
type: rename_relationship

View File

@@ -0,0 +1,7 @@
- args:
name: bill
new_name: invoice
table:
name: parts_orders
schema: public
type: rename_relationship

View File

@@ -0,0 +1,7 @@
- args:
name: invoice
new_name: bill
table:
name: parts_orders
schema: public
type: rename_relationship

View File

@@ -0,0 +1 @@
[]

View File

@@ -0,0 +1,8 @@
- args:
cascade: true
read_only: false
sql: "CREATE OR REPLACE FUNCTION public.search_bills(search text)\n RETURNS SETOF
bills\n LANGUAGE plpgsql\n STABLE\nAS $function$\n\nBEGIN\n if search = ''
then\n return query select * from bills ;\n else \n return query SELECT\n
\ *\nFROM\n bills\nWHERE\n search <% (invoice_number);\n end if;\n\n\tEND\n$function$;"
type: run_sql

View File

@@ -0,0 +1,7 @@
- args:
name: billlines
new_name: invoicelines
table:
name: bills
schema: public
type: rename_relationship

View File

@@ -0,0 +1,7 @@
- args:
name: invoicelines
new_name: billlines
table:
name: bills
schema: public
type: rename_relationship

View File

@@ -0,0 +1 @@
[]

View File

@@ -0,0 +1,8 @@
- args:
cascade: true
read_only: false
sql: "CREATE OR REPLACE FUNCTION public.search_bills(search text)\n RETURNS SETOF
bills\n LANGUAGE plpgsql\n STABLE\nAS $function$\n\nBEGIN\n if search = ''
then\n return query select * from bills ;\n else \n return query SELECT\n
\ *\nFROM\n bills\nWHERE\n search <% (invoice_number);\n end if;\n\n\tEND\n$function$;"
type: run_sql

View File

@@ -0,0 +1 @@
[]

View File

@@ -0,0 +1,12 @@
- args:
cascade: true
read_only: false
sql: "CREATE OR REPLACE FUNCTION public.search_bills(search text)\n RETURNS SETOF
bills\n LANGUAGE plpgsql\n STABLE\nAS $function$\n\nBEGIN\n if search = ''
then\n return query select * from bills ;\n else \n return query SELECT\n
\ *\nFROM\n bills\nWHERE\n search <% (invoice_number);\n end if;\n\n\tEND\n$function$;"
type: run_sql
- args:
name: search_bills
schema: public
type: track_function

View File

@@ -0,0 +1,5 @@
- args:
cascade: false
read_only: false
sql: alter table "public"."documents" rename column "billid" to "invoiceid";
type: run_sql

View File

@@ -0,0 +1,5 @@
- args:
cascade: false
read_only: false
sql: alter table "public"."documents" rename column "invoiceid" to "billid";
type: run_sql

View File

@@ -0,0 +1,5 @@
- args:
cascade: false
read_only: false
sql: alter table "public"."bodyshops" rename column "bill_tax_rates" to "invoice_tax_rates";
type: run_sql

View File

@@ -0,0 +1,5 @@
- args:
cascade: false
read_only: false
sql: alter table "public"."bodyshops" rename column "invoice_tax_rates" to "bill_tax_rates";
type: run_sql

View File

@@ -348,6 +348,227 @@ tables:
_eq: X-Hasura-User-Id
- active:
_eq: true
- table:
schema: public
name: billlines
object_relationships:
- name: bill
using:
foreign_key_constraint_on: billid
insert_permissions:
- role: user
permission:
check:
bill:
job:
bodyshop:
associations:
_and:
- user:
authid:
_eq: X-Hasura-User-Id
- active:
_eq: true
columns:
- actual_cost
- actual_price
- applicable_taxes
- cost_center
- created_at
- id
- billid
- joblineid
- line_desc
- quantity
- updated_at
select_permissions:
- role: user
permission:
columns:
- actual_cost
- actual_price
- applicable_taxes
- cost_center
- created_at
- id
- billid
- joblineid
- line_desc
- quantity
- updated_at
filter:
bill:
job:
bodyshop:
associations:
_and:
- user:
authid:
_eq: X-Hasura-User-Id
- active:
_eq: true
update_permissions:
- role: user
permission:
columns:
- actual_cost
- actual_price
- applicable_taxes
- cost_center
- created_at
- id
- billid
- joblineid
- line_desc
- quantity
- updated_at
filter:
bill:
job:
bodyshop:
associations:
_and:
- user:
authid:
_eq: X-Hasura-User-Id
- active:
_eq: true
check: null
delete_permissions:
- role: user
permission:
filter:
bill:
job:
bodyshop:
associations:
_and:
- user:
authid:
_eq: X-Hasura-User-Id
- active:
_eq: true
- table:
schema: public
name: bills
object_relationships:
- name: job
using:
foreign_key_constraint_on: jobid
- name: vendor
using:
foreign_key_constraint_on: vendorid
array_relationships:
- name: billlines
using:
foreign_key_constraint_on:
column: billid
table:
schema: public
name: billlines
- name: documents
using:
foreign_key_constraint_on:
column: billid
table:
schema: public
name: documents
- name: parts_orders
using:
foreign_key_constraint_on:
column: returnfrominvoice
table:
schema: public
name: parts_orders
insert_permissions:
- role: user
permission:
check:
job:
bodyshop:
associations:
_and:
- user:
authid:
_eq: X-Hasura-User-Id
- active:
_eq: true
columns:
- created_at
- date
- due_date
- exported
- exported_at
- federal_tax_rate
- id
- invoice_number
- is_credit_memo
- jobid
- local_tax_rate
- state_tax_rate
- total
- updated_at
- vendorid
select_permissions:
- role: user
permission:
columns:
- created_at
- date
- due_date
- exported
- exported_at
- federal_tax_rate
- id
- invoice_number
- is_credit_memo
- jobid
- local_tax_rate
- state_tax_rate
- total
- updated_at
- vendorid
filter:
job:
bodyshop:
associations:
_and:
- user:
authid:
_eq: X-Hasura-User-Id
- active:
_eq: true
allow_aggregations: true
update_permissions:
- role: user
permission:
columns:
- created_at
- date
- due_date
- exported
- exported_at
- federal_tax_rate
- id
- invoice_number
- is_credit_memo
- jobid
- local_tax_rate
- state_tax_rate
- total
- updated_at
- vendorid
filter:
job:
bodyshop:
associations:
_and:
- user:
authid:
_eq: X-Hasura-User-Id
- active:
_eq: true
check: null
- table:
schema: public
name: bodyshops
@@ -483,7 +704,7 @@ tables:
- inhousevendorid
- insurance_vendor_id
- intakechecklist
- invoice_tax_rates
- bill_tax_rates
- logo_img_path
- md_categories
- md_classes
@@ -541,7 +762,7 @@ tables:
- inhousevendorid
- insurance_vendor_id
- intakechecklist
- invoice_tax_rates
- bill_tax_rates
- logo_img_path
- md_categories
- md_classes
@@ -1170,9 +1391,9 @@ tables:
schema: public
name: documents
object_relationships:
- name: invoice
- name: bill
using:
foreign_key_constraint_on: invoiceid
foreign_key_constraint_on: billid
- name: job
using:
foreign_key_constraint_on: jobid
@@ -1197,7 +1418,7 @@ tables:
- jobid
- name
- key
- invoiceid
- billid
- type
select_permissions:
- role: user
@@ -1210,7 +1431,7 @@ tables:
- created_at
- updated_at
- id
- invoiceid
- billid
- jobid
filter:
job:
@@ -1393,227 +1614,6 @@ tables:
_eq: X-Hasura-User-Id
- active:
_eq: true
- table:
schema: public
name: invoicelines
object_relationships:
- name: invoice
using:
foreign_key_constraint_on: invoiceid
insert_permissions:
- role: user
permission:
check:
invoice:
job:
bodyshop:
associations:
_and:
- user:
authid:
_eq: X-Hasura-User-Id
- active:
_eq: true
columns:
- actual_cost
- actual_price
- applicable_taxes
- cost_center
- created_at
- id
- invoiceid
- joblineid
- line_desc
- quantity
- updated_at
select_permissions:
- role: user
permission:
columns:
- actual_cost
- actual_price
- applicable_taxes
- cost_center
- created_at
- id
- invoiceid
- joblineid
- line_desc
- quantity
- updated_at
filter:
invoice:
job:
bodyshop:
associations:
_and:
- user:
authid:
_eq: X-Hasura-User-Id
- active:
_eq: true
update_permissions:
- role: user
permission:
columns:
- actual_cost
- actual_price
- applicable_taxes
- cost_center
- created_at
- id
- invoiceid
- joblineid
- line_desc
- quantity
- updated_at
filter:
invoice:
job:
bodyshop:
associations:
_and:
- user:
authid:
_eq: X-Hasura-User-Id
- active:
_eq: true
check: null
delete_permissions:
- role: user
permission:
filter:
invoice:
job:
bodyshop:
associations:
_and:
- user:
authid:
_eq: X-Hasura-User-Id
- active:
_eq: true
- table:
schema: public
name: invoices
object_relationships:
- name: job
using:
foreign_key_constraint_on: jobid
- name: vendor
using:
foreign_key_constraint_on: vendorid
array_relationships:
- name: documents
using:
foreign_key_constraint_on:
column: invoiceid
table:
schema: public
name: documents
- name: invoicelines
using:
foreign_key_constraint_on:
column: invoiceid
table:
schema: public
name: invoicelines
- name: parts_orders
using:
foreign_key_constraint_on:
column: returnfrominvoice
table:
schema: public
name: parts_orders
insert_permissions:
- role: user
permission:
check:
job:
bodyshop:
associations:
_and:
- user:
authid:
_eq: X-Hasura-User-Id
- active:
_eq: true
columns:
- created_at
- date
- due_date
- exported
- exported_at
- federal_tax_rate
- id
- invoice_number
- is_credit_memo
- jobid
- local_tax_rate
- state_tax_rate
- total
- updated_at
- vendorid
select_permissions:
- role: user
permission:
columns:
- created_at
- date
- due_date
- exported
- exported_at
- federal_tax_rate
- id
- invoice_number
- is_credit_memo
- jobid
- local_tax_rate
- state_tax_rate
- total
- updated_at
- vendorid
filter:
job:
bodyshop:
associations:
_and:
- user:
authid:
_eq: X-Hasura-User-Id
- active:
_eq: true
allow_aggregations: true
update_permissions:
- role: user
permission:
columns:
- created_at
- date
- due_date
- exported
- exported_at
- federal_tax_rate
- id
- invoice_number
- is_credit_memo
- jobid
- local_tax_rate
- state_tax_rate
- total
- updated_at
- vendorid
filter:
job:
bodyshop:
associations:
_and:
- user:
authid:
_eq: X-Hasura-User-Id
- active:
_eq: true
check: null
- table:
schema: public
name: job_conversations
@@ -1961,6 +1961,14 @@ tables:
schema: public
name: jobs
object_relationships:
- name: bill
using:
manual_configuration:
remote_table:
schema: public
name: bills
column_mapping:
id: jobid
- name: bodyshop
using:
foreign_key_constraint_on: shopid
@@ -1973,14 +1981,6 @@ tables:
- name: employee_refinish_rel
using:
foreign_key_constraint_on: employee_refinish
- name: invoice
using:
manual_configuration:
remote_table:
schema: public
name: invoices
column_mapping:
id: jobid
- name: owner
using:
foreign_key_constraint_on: ownerid
@@ -2002,6 +2002,13 @@ tables:
table:
schema: public
name: available_jobs
- name: bills
using:
foreign_key_constraint_on:
column: jobid
table:
schema: public
name: bills
- name: cccontracts
using:
foreign_key_constraint_on:
@@ -2023,13 +2030,6 @@ tables:
table:
schema: public
name: documents
- name: invoices
using:
foreign_key_constraint_on:
column: jobid
table:
schema: public
name: invoices
- name: job_conversations
using:
foreign_key_constraint_on:
@@ -3298,7 +3298,7 @@ tables:
schema: public
name: parts_orders
object_relationships:
- name: invoice
- name: bill
using:
foreign_key_constraint_on: returnfrominvoice
- name: job
@@ -4019,7 +4019,7 @@ tables:
column: vendorid
table:
schema: public
name: invoices
name: bills
- name: parts_orders
using:
foreign_key_constraint_on:
@@ -4142,7 +4142,7 @@ tables:
functions:
- function:
schema: public
name: search_invoices
name: search_bills
- function:
schema: public
name: search_jobs