1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:
52:
53:
54:
55:
56:
|
REPLACE MACRO workdb.s_rpt_wisconsin_manual
(acct_num INTEGER,
registration DECIMAL(18,4),
trade_in_credit DECIMAL(18,4),
negative_equity DECIMAL(18,4),
amount_down DECIMAL(18,4),
cash_sale_price DECIMAL(18,4),
trade_year CHAR(4),
trade_make CHAR(20),
trade_model CHAR(20),
trade_vin CHAR(20)
) AS (
select c.first_name,
c.lst_name,
c.st_addr_1,
c.st_addr_2,
c.city,
c.state,
c.zip_cde,
(b.loan_id*1) AS loan_id,
a.contract_date,
a.vehicle_year,
a.vehicle_make,
a.vehicle_model,
a.apr,
a.finance_charge,
a.amount_financed,
a.total_of_payments,
b.down_payment,
a.num_payments,
a.payment_amount,
a.first_payment_dte,
a.num_payments_2,
a.payment_amount_2,
(a.cash_price+a.sales_tax) AS cash_price,
a.cash_down,
(a.net_trade_amount*-1) AS net_trade_amount,
a.trade_in_year,
a.trade_in_make,
a.trade_in_model,
a.other_fee,
a.warranty_price,
(a.cash_down-b.cash_down)as Trade_In_Credit,
a.trade_payoff_amt,
EXTRACT(DAY FROM a.first_payment_dte) AS day_due,
a.vin_number
from cnt_ver a,
loi b,
cst_mst c
where a.work_id = b.work_id
AND b.loan_id = c.loan_num
/* passing account number in to stored proc as parameter; used to pull remaining account information in select statement. */
AND b.loan_id = :acct_num;
|