2006-10-26 19:46 [ 977] <- я щаз здохну 2006-10-26 19:46 [ 978] <- хочеш прикол? 2006-10-26 19:46 [ 979] <- короче є запрос..... 2006-10-26 19:46 [ 980] <- я його не писав 2006-10-26 19:46 [ 981] <- і мені нада поправити в ньому буквально один рядок 2006-10-26 19:47 [ 982] <- ну одне значення деякого поля 2006-10-26 19:47 [ 983] <- якого саме - нада розібратися 2006-10-26 19:47 [ 984] <- так от ось цей запрос!!!! 2006-10-26 19:47 [ 985] <- --WorkdoneRealiz select l.id_line, get_obj_fname(l.id_obj) name_obj, l.nat_sum, obj_nds_sum sum_nds, l.obj_quantity, get_obj_sname(l.obj_unit) name_unit, ls.number, l.type, l.id_obj, decode(nvl(l.id_line_parent,0),0,l.id_line,l.id_line_parent) id_line_parent, (select number from sdl_cpursp where id_line = decode(nvl(l.id_line_parent,0),0,l.id_line,l.id_line_parent)) as parent_number, (select id_obj from sd_lines where id_line = decode(nvl(l.id_line_parent,0),0,l.id_line,l.id_line_parent)) as parent_id_obj, ls.id_budget, get_obj_tcode(ls.id_budget) budget, -- get_obj_tcode(ls.id_dep) dep, get_obj_fname(nvl(ls.id_dep, t.id_obj_to)) dep, -- get_obj_tcode(ls.id_expense_obj)||' '|| get_obj_fname(ls.id_expense_obj) expense_obj, (select count(*) id_line from sd_lines lc where lc.id_line_parent = l.id_line) child_count, ls.comments from sd_lines l, sdl_cpursp ls, sd_title t where t.id_doc = [DocId] and l.id_doc = t.id_doc and l.id_line = ls.id_line order by ls.number into temp tmpSalWorkDoneSpec; update tmpSalWorkDoneSpec set parent_number = 99 where parent_id_obj = get_pointer_id('oppDgNDS'); --execute PROCEDURE osfpGetMTOBudget(1, null); -- ???????? ?????? ??????? ? ??????? tmpBudgetTree --?????? ???????? ? ??????? ? ??????? ???? ???????? -- update tmpSalWorkDoneSpec set -- budget = null,dep = null, expense_obj = null -- where (id_line = id_line_parent) and (child_count <>0); update tmpSalWorkDoneSpec set number = null where id_line <> id_line_parent; select trim(get_obj_fname(e.id_enterprise)) name_ka, e.okpo, Case When (nvl(a.id_accua,0)<>0) Then a.id_accua Else Null End As id_accua, Case When (nvl(a.id_accua,0)<>0) Then get_obj_tcode(a.id_bank) Else ca.mfoban End As mfo, Case When (nvl(a.id_accua,0)<>0) Then get_obj_fname(a.id_bank) Else ca.naiban End As name_bank, ca.mfoban clp_mfo, ca.naiban clp_name_bank, Case When (nvl(a.id_accua,0)<>0) Then a.number Else ca.rassch End As number, ca.rassch clp_number, a_index,a_district,a_street,a_flat,a_home, c.post, trim(upper(c.fio)) fio, -- c.fio short_fio, trim(upper(c.short_fio)) short_fio, decode(adr.id_country,NULL,'',trim(get_obj_fname(adr.id_country))) name_country, decode(adr.id_city,NULL,'',trim(get_obj_fname(adr.id_city))) name_city, t.nat_sum sum_doc, osfpMoneyInUkrText(t.nat_sum) sum_as_words, td.pd_date_out pd_date_contract, td.pd_number_out pd_number_contract, ' ???? ? '||trim(get_obj_tcode(ts.id_step)) name_step, t.pd_number_out, t.pd_date_out, t.pd_date, (select max(date_actual) from sd_schedule where id_doc=t.id_doc and num_shedul=25) as pd_opr_hard, trim(get_obj_tcode(t.id_obj_from)) code_dep, trim(get_obj_fname(t.id_obj_from)) name_dep, trim(get_obj_sname(t.id_curator)) name_curator, trim(get_obj_fname(ts.id_budget)) name_budget, -- get_bdg_class_stat(ts.id_budget) stat_class, 1 as stat_class, t.id_doc, d.description from sop_entrprise e, outer(sop_address adr), outer(sope_contact c), outer( sd_lines pl, outer(sope_account a), outer(sprsch ca)), sd_title t, sdt_tmc ts, outer(sd_title td), outer(so_description d) where t.id_doc = [DocId] and ts.id_doc = t.id_doc and ts.id_contract = td.id_doc and ts.id_contract = pl.id_doc and pl.type = 1 and pl.id_obj = [RasSchKA] and e.id_enterprise = t.id_obj_to and e.id_address = adr.id_address and c.id_enterprise = e.id_enterprise and c.number = 1 -- and e.id_enterprise = a.id_enterprise -- and e.id_enterprise = ca.id_enterprise and a.id_accua = pl.obj_unit and ca.id_obj_prim = pl.obj_unit and d.id_obj = t.id_doc into temp tmpSaleWorkDoneKA; update tmpSaleWorkDoneKA set number = clp_number, name_bank=clp_name_bank, mfo =clp_mfo where id_accua is null; update tmpSaleWorkDoneKA set number = nvl(number , ' '), name_bank = nvl(name_bank, ' '), mfo = nvl(mfo , ' '), a_home = nvl(a_home , ' '), okpo = nvl(okpo , ' '), a_index = nvl(a_index , ' '), a_street = nvl(a_street , ' '), post = nvl(post , ' '), fio = nvl(fio , ' '), short_fio = nvl(short_fio, fio); select trim(s.name) as post, trim(p.name||' '||w.io) as short_fio, trim(p.name||' '||w.name||' '||w.patronymic) as fio from sop_workers w, so_secondary s, so_primary p where s.id_obj_sec = [object1_id] and s.id_obj_prim = p.id_obj_prim and s.id_obj_prim = w.id_worker into temp tmpSaleWorkDoneOC; execute procedure get_pointer_id('opDgOurAccDef') into server temp tmpOurRS (id_rs); execute procedure get_pointer_id('opSprOrgSelf') into server temp tmpOurent(id_ent); select trim(get_obj_fname(e.id_enterprise)) name_ka, e.okpo, get_obj_tcode(a.id_bank) mfo, trim(get_obj_fname(a.id_bank)) name_bank, a.number, a_index,a_district,a_street,a_flat,a_home, decode(adr.id_country,NULL,'',trim(get_obj_fname(adr.id_country))) name_country, decode(adr.id_city,NULL,'',trim(get_obj_fname(adr.id_city))) name_city from sop_entrprise e, sop_address adr, sop_locacc a, -- outer(sprsch ca), tmpOurRS pl, tmpOurent t where e.id_enterprise = t.id_ent and e.id_address = adr.id_address and a.id_locacc = pl.id_rs into temp tmpMWDOurKA; 2006-10-26 19:48 [ 986] <- ггггггг 2006-10-26 19:48 [ 987] <- о мозк мой, мозк!!! 2006-10-26 19:48 [ 988] -> O_O 2006-10-26 19:49 [ 990] <- блять я зара об стіну буду битися 2006-10-26 19:49 [ 991] <- це жопа 2006-10-26 19:49 [ 992] <- ну як там мона щось зрозуміти? 2006-10-26 19:49 [ 993] <- який то застрелений чувак писав тупо псіх 2006-10-26 19:49 [ 994] <- ну його нафіг