0% found this document useful (0 votes)
15 views1 page

Insert Customer Invoice Debt

The document contains SQL insert statements for adding customer invoice debt records into a database. Each record includes details such as transaction number, invoice number, order and due dates, unpaid amount, customer codes, and debt amounts. The entries are marked as 'SIGNED' and are associated with the organization and group ID 'FDCHCM'.

Uploaded by

anhbh2012
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
15 views1 page

Insert Customer Invoice Debt

The document contains SQL insert statements for adding customer invoice debt records into a database. Each record includes details such as transaction number, invoice number, order and due dates, unpaid amount, customer codes, and debt amounts. The entries are marked as 'SIGNED' and are associated with the organization and group ID 'FDCHCM'.

Uploaded by

anhbh2012
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 1

INSERT INTO public.

customer_invoice_debt (transaction_number, invoice_no,


invoice_order_date, invoice_due_date, invoice_unpaid_amount,
customer_oracle_code, customer_code, customer_code_group,
customer_oracle_code_group, created_time, debt_amount, debt_amount_vnd, org_id,
group_id,currency, status,
created_by,invoice_finance_number, customer_type, customer_status)
VALUES('227777', 'NVANZ2502169', '2025-03-18', '2025-03-18', 15000000, '100324',
(select ci.customer_code from customer_info ci left join customer_info ci2 on
ci.customer_parent_oracle_code = ci2.customer_oracle_code where
ci.customer_oracle_code = '100324'),
(select coalesce(ci2.customer_code, ci.customer_code) as parent_customer_code from
customer_info ci left join customer_info ci2 on ci.customer_parent_oracle_code =
ci2.customer_oracle_code where ci.customer_oracle_code = '100324'),
(select coalesce(ci2.customer_oracle_code, ci.customer_oracle_code) as
parent_customer_code from customer_info ci left join customer_info ci2 on
ci.customer_parent_oracle_code = ci2.customer_oracle_code where
ci.customer_oracle_code = '100324'),
now(), 15000000, 15000000, 'FDCHCM', 'FDCHCM', 'VND', 'SIGNED', 'SYSTEM',
'NVANZ2502169','CUSTOMER','ACTIVE');"
"INSERT INTO public.customer_invoice_debt (transaction_number, invoice_no,
invoice_order_date, invoice_due_date, invoice_unpaid_amount,
customer_oracle_code, customer_code, customer_code_group,
customer_oracle_code_group, created_time, debt_amount, debt_amount_vnd, org_id,
group_id,currency, status,
created_by,invoice_finance_number, customer_type, customer_status)
VALUES('227776', 'NVANZ2502165', '2025-03-14', '2025-03-14', 29700000, '110856',
(select ci.customer_code from customer_info ci left join customer_info ci2 on
ci.customer_parent_oracle_code = ci2.customer_oracle_code where
ci.customer_oracle_code = '110856'),
(select coalesce(ci2.customer_code, ci.customer_code) as parent_customer_code from
customer_info ci left join customer_info ci2 on ci.customer_parent_oracle_code =
ci2.customer_oracle_code where ci.customer_oracle_code = '110856'),
(select coalesce(ci2.customer_oracle_code, ci.customer_oracle_code) as
parent_customer_code from customer_info ci left join customer_info ci2 on
ci.customer_parent_oracle_code = ci2.customer_oracle_code where
ci.customer_oracle_code = '110856'),
now(), 29700000, 29700000, 'FDCHCM', 'FDCHCM', 'VND', 'SIGNED', 'SYSTEM',
'NVANZ2502165','CUSTOMER','ACTIVE');

You might also like