Cp1251
doc
document_title="Все документы по активу"
document_width=1000
document_height=500

postloadscript = "($X
                     ($debug 'ARGUMENTS.0: ' + ARGUMENTS.0 + ' (' + ($ARGUMENTS.0@type) + ')')
                     ($debug 'ARGUMENTS.1: ' + ARGUMENTS.1 + ' (' + ($ARGUMENTS.1@type) + ')')
                     ($debug 'substr 0 10: [' + ($ARGUMENTS.1@substr 0 10) + ']')
                     ($ret '')
                  )"


{ toolbar BACKGROUND=LIGHTGRAY
{grid
buttonbar_font_family = 0     buttonbar_font_size = 12
buttonbar_size = 30           titlebar_size = 18          titlebar_height = 40
rowsize = 20                  editable = no
return = no
edit = "open ~($g.ds@getValue 'doc_name')~ ~($g.ds@getValue 'id_head')~"

{column size=200  
   title="Тип документа"   
   target=pol_name_type_dok  title_font_family=2   halignment=left
   font_color="#000000"    font_size=12            font_family=0
}
{column size=100  
   title="№ док."   
   target=num_sd  title_font_family=2   halignment=left
   font_color="#000000"    font_size=12            font_family=0
}
{column size=100  
   title="Дата док."   
   target=date_sd  title_font_family=2   halignment=center
   font_color="#000000"    font_size=12            font_family=0
}
{column size=100  
   title="Кол-во"   
   target=q1_spc  title_font_family=2   halignment=right
   font_color="#000000"    font_size=12            font_family=0
   editmask = "# #0.000"
}

{datastore 
 alias = ds
 query = "select id_head, sort, num_sd, date_sd, q1_spc, pol_name_type_dok, doc_name
            from (
          select head.id_head, head.num_sd, head.date_sd, head.sort,
                 spc.q1_spc, type_doc.pol_name_type_dok, type_doc.doc_name
            from head, spc, type_doc
           where spc.id_active = ~($try (ARGUMENTS.0) $catch ('NullException') (1) )~
             and spc.id_head = head.id_head
             and head.id_type_doc = type_doc.id_type_doc
                 )
           order by sort desc"
        editable = no
}
}

{button
    left = 72  width = 50    height = 20
    BACKGROUND = "LIGHTGRAY"    foreground="#000000"
    label="Выход ESC"
   action="($self@actdok)"
   ShortCut = "Escape"
  }
} // toolbar


