Commit 33a94962 authored by cosine's avatar cosine

- cosine massive update allowing for sub-types of financial documents

parent d783c40a
......@@ -41,7 +41,7 @@ from
im_costs_aggreg ica
where
-- only customer invoices
ica.cost_type_id = 3700
ica.cost_type_id in ([join [im_sub_categories [im_cost_type_invoice]] ","])
-- not in paid, deleted, filed
and ica.cost_status_id not in (3810, 3812, 3814)
"]
......@@ -53,7 +53,7 @@ from
im_costs_aggreg ica
where
-- only customer invoices
ica.cost_type_id = 3704
ica.cost_type_id ([join [im_sub_categories [im_cost_type_bill]] ","])
-- not in paid, deleted, filed
and ica.cost_status_id not in (3810, 3812, 3814)
"]
......@@ -78,7 +78,7 @@ from
-- take only last X days
and ica.due_date > to_date(to_char(now(), 'YYYY-MM-DD'), 'YYYY-MM-DD') -90
-- provider bills
and ica.cost_type_id = 3700
and ica.cost_type_id in ([join [im_sub_categories [im_cost_type_invoice]] ","])
-- only source-words
and iii.item_uom_id = 324
) i
......@@ -104,7 +104,7 @@ from
-- take only last X days
and ica.due_date > to_date(to_char(now(), 'YYYY-MM-DD'), 'YYYY-MM-DD') -90
-- provider bills
and ica.cost_type_id = 3704
and ica.cost_type_id in ([join [im_sub_categories [im_cost_type_bill]] ","])
-- only source-words
and iii.item_uom_id = 324
) i
......
......@@ -50,7 +50,7 @@ set top_customers_sql "
from im_companies cust,
im_costs c
where c.customer_id = cust.company_id and
c.cost_type_id = [im_cost_type_invoice] and
c.cost_type_id in ([join [im_sub_categories [im_cost_type_invoice]] ","]) and
cust.company_path != 'internal'
$top_customer_interval_sql
group by company_name
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment