All pastes #222907 Raw Edit

Miscellany

public text v1 · immutable
#222907 ·published 2006-10-26 16:53 UTC
rendered paste body
2006-10-26 19:46 [ 977] <- &#1103; &#1097;&#1072;&#1079; &#1079;&#1076;&#1086;&#1093;&#1085;&#1091;
2006-10-26 19:46 [ 978] <- &#1093;&#1086;&#1095;&#1077;&#1096; &#1087;&#1088;&#1080;&#1082;&#1086;&#1083;?
2006-10-26 19:46 [ 979] <- &#1082;&#1086;&#1088;&#1086;&#1095;&#1077; &#1108; &#1079;&#1072;&#1087;&#1088;&#1086;&#1089;.....
2006-10-26 19:46 [ 980] <- &#1103; &#1081;&#1086;&#1075;&#1086; &#1085;&#1077; &#1087;&#1080;&#1089;&#1072;&#1074;
2006-10-26 19:46 [ 981] <- &#1110; &#1084;&#1077;&#1085;&#1110; &#1085;&#1072;&#1076;&#1072; &#1087;&#1086;&#1087;&#1088;&#1072;&#1074;&#1080;&#1090;&#1080; &#1074; &#1085;&#1100;&#1086;&#1084;&#1091; &#1073;&#1091;&#1082;&#1074;&#1072;&#1083;&#1100;&#1085;&#1086; &#1086;&#1076;&#1080;&#1085; &#1088;&#1103;&#1076;&#1086;&#1082;
2006-10-26 19:47 [ 982] <- &#1085;&#1091; &#1086;&#1076;&#1085;&#1077; &#1079;&#1085;&#1072;&#1095;&#1077;&#1085;&#1085;&#1103; &#1076;&#1077;&#1103;&#1082;&#1086;&#1075;&#1086; &#1087;&#1086;&#1083;&#1103;
2006-10-26 19:47 [ 983] <- &#1103;&#1082;&#1086;&#1075;&#1086; &#1089;&#1072;&#1084;&#1077; - &#1085;&#1072;&#1076;&#1072; &#1088;&#1086;&#1079;&#1110;&#1073;&#1088;&#1072;&#1090;&#1080;&#1089;&#1103;
2006-10-26 19:47 [ 984] <- &#1090;&#1072;&#1082; &#1086;&#1090; &#1086;&#1089;&#1100; &#1094;&#1077;&#1081; &#1079;&#1072;&#1087;&#1088;&#1086;&#1089;!!!!
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] <- &#1075;&#1075;&#1075;&#1075;&#1075;&#1075;&#1075;
2006-10-26 19:48 [ 987] <- &#1086; &#1084;&#1086;&#1079;&#1082; &#1084;&#1086;&#1081;, &#1084;&#1086;&#1079;&#1082;!!!
2006-10-26 19:48 [ 988] -> O_O
2006-10-26 19:49 [ 990] <- &#1073;&#1083;&#1103;&#1090;&#1100; &#1103; &#1079;&#1072;&#1088;&#1072; &#1086;&#1073; &#1089;&#1090;&#1110;&#1085;&#1091; &#1073;&#1091;&#1076;&#1091; &#1073;&#1080;&#1090;&#1080;&#1089;&#1103;
2006-10-26 19:49 [ 991] <- &#1094;&#1077; &#1078;&#1086;&#1087;&#1072;
2006-10-26 19:49 [ 992] <- &#1085;&#1091; &#1103;&#1082; &#1090;&#1072;&#1084; &#1084;&#1086;&#1085;&#1072; &#1097;&#1086;&#1089;&#1100; &#1079;&#1088;&#1086;&#1079;&#1091;&#1084;&#1110;&#1090;&#1080;?
2006-10-26 19:49 [ 993] <- &#1103;&#1082;&#1080;&#1081; &#1090;&#1086; &#1079;&#1072;&#1089;&#1090;&#1088;&#1077;&#1083;&#1077;&#1085;&#1080;&#1081; &#1095;&#1091;&#1074;&#1072;&#1082; &#1087;&#1080;&#1089;&#1072;&#1074; &#1090;&#1091;&#1087;&#1086; &#1087;&#1089;&#1110;&#1093;
2006-10-26 19:49 [ 994] <- &#1085;&#1091; &#1081;&#1086;&#1075;&#1086; &#1085;&#1072;&#1092;&#1110;&#1075;