-- Fetch all the Invoices belonging to the NetSuite
-- store of a particular user.
SELECT *
FROM fiber.netsuite_invoice
WHERE store_id = '{user.store_id}'
-- Fetch all the Invoices belonging to the NetSuite
-- store of a particular user.
SELECT *
FROM fiber.netsuite_invoice
WHERE store_id = '{user.store_id}'
Code
CREATE TABLE fiber.netsuite_invoice (
id TEXT NOT NULL,
created_at TIMESTAMP WITH TIME ZONE,
updated_at TIMESTAMP WITH TIME ZONE,
store_id TEXT,
account JSONB,
accounting_book_detail JSONB,
amount_paid DOUBLE PRECISION,
amount_remaining DOUBLE PRECISION,
amount_unbilled DOUBLE PRECISION,
amount_remaining_total_box DOUBLE PRECISION,
approval_status JSONB,
bill_address TEXT,
bill_override TEXT,
bill_phone TEXT,
bill_state TEXT,
bill_zip TEXT,
billing_account JSONB,
department JSONB,
discount_amount DOUBLE PRECISION,
discount_total DOUBLE PRECISION,
discount_rate DOUBLE PRECISION,
email TEXT,
end_date TEXT,
estimate INT,
exchange_rate DOUBLE PRECISION,
installment JSONB,
item JSONB,
item_cost DOUBLE PRECISION,
last_modified_date TEXT,
partner JSONB,
posting_period JSONB,
prev_date TEXT,
prev_partner JSONB,
sales_channel JSONB,
ship_address TEXT,
ship_date TEXT,
start_date TEXT,
status TEXT
)
CREATE TABLE fiber.netsuite_invoice (
id TEXT NOT NULL,
created_at TIMESTAMP WITH TIME ZONE,
updated_at TIMESTAMP WITH TIME ZONE,
store_id TEXT,
account JSONB,
accounting_book_detail JSONB,
amount_paid DOUBLE PRECISION,
amount_remaining DOUBLE PRECISION,
amount_unbilled DOUBLE PRECISION,
amount_remaining_total_box DOUBLE PRECISION,
approval_status JSONB,
bill_address TEXT,
bill_override TEXT,
bill_phone TEXT,
bill_state TEXT,
bill_zip TEXT,
billing_account JSONB,
department JSONB,
discount_amount DOUBLE PRECISION,
discount_total DOUBLE PRECISION,
discount_rate DOUBLE PRECISION,
email TEXT,
end_date TEXT,
estimate INT,
exchange_rate DOUBLE PRECISION,
installment JSONB,
item JSONB,
item_cost DOUBLE PRECISION,
last_modified_date TEXT,
partner JSONB,
posting_period JSONB,
prev_date TEXT,
prev_partner JSONB,
sales_channel JSONB,
ship_address TEXT,
ship_date TEXT,
start_date TEXT,
status TEXT
)
Model definition