gruntcontrols.yml 13.6 KB
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 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527
select: 
        select g.gruntcontrolid, g.zajavkid, g.VirobnikId, g.num, g.cultid, g.sortid, g.catid, g.genid, g.mass_part, g.partnum, g.agronomid, g.posvnum, g.actnum, g.actdate, g.oblastid, g.posada, g.vidpravlenoid,
        g.factnadhid, g.zvitnum, g.zvitdate, g.sortchyst, g.oplataid, g.active, g.usercreate, g.datecreate, g.userupdate, g.dateupdate, g.dogstatusid, g.gruntcontrol_year, g.firmid,

        z.zajavn, obl.OblastNameUA, s.NameUA, k.Kultura, ge.generation_name, c.cat_name, a.fio, a.dp_posad_name, ds.statusname,
        v.name as vname, o.name as oname, fn.name as fnname, uc.login as uclogin, uu.login as uulogin, vyr.VirobnikNameUA, f.name_firm
        
        from dp2_gruntcontrols g 

        left join dp2_zajavka_obsteg z
        on g.zajavkid = z.zajavkid

        left join k2firms f
        on g.firmid = f.firmid

        left join dp2Virobn vyr
        on g.VirobnikId = vyr.VirobnikId

        left join dp2Kultur k
        on g.cultid=k.CodKult

        left join dp2SortReestr s
        on g.sortid=s.SortID

        left join dp2Categors c
        on g.catid=c.catid

        left join dp2generation ge
        on g.genid=ge.generationid

        left join dp2_auditors a
        on g.agronomid=a.auditid

        left join dp2_grunt_factnadh fn
        on g.factnadhid = fn.factnadhid

        left join dp2_grunt_oplat o
        on g.oplataid = o.oplataid

        left join dp2_grunt_vidprav v
        on g.vidpravlenoid = v.vidpravlenoid

        left join dp2Oblast obl
        ON g.oblastid = obl.OblastId

        left join k2users uc
        on g.usercreate = uc.user_id

        left join k2users uu
        on g.userupdate = uu.user_id

        left join dp2_grunt_dogstatus ds
        on g.dogstatusid = ds.dogstatusid

where: "where (g.actdate >= '<%year%>-01-01') and (g.actdate <= '<%year%>-12-31') and (z.oblastid='<%oblid%>' or g.oblastid IN (<%listoblid%>) or '<%ROLE%>'='-1' or '<%ROLE%>'='acd5f33a70b6b05512e5859aa9c0115d' ) "
table: dp2_gruntcontrols
typeid: 1
sortname: num
sortorder: desc
caption: Грунтконтроль
detile: dp2_files_grunt
onRightClickRow: contMenu(rowid)    
height: 350
rows: 20
custom_form: true
form_width: 825
form_height: 420  
is_add: false 
is_del: false     
is_edit: false 
footer: true
after_save_script: afterSave();
fields: 
    gruntcontrolid:
        field: gruntcontrolid
        caption: ID
        width: 120
        hidden: true
        readonly: true
        align: center
        type_field: text
        primary_key: true

    zajavkid:    
        field: zajavn
        caption: Заявка №
        alias: z.zajavn
        width: 65
        readonly: true
        align: right
        disabled: true
        width_form: 220
        main_filter: true
        formoptions:
            rowpos: 1 
            colpos: 2
        type_field: text
        
    firms:
        field: name_firm
        alias: f.name_firm
        caption: Назва компанії
        alias_form: firmid
        type_fieldform: DropDown
        sql_form: select firmid as k, name_firm as v from k2firms
        width: 150
        hidden_form: true
        type_field: text
        align: left
        width_form: 220
                
    num:
        field: num
        alias: g.num
        caption: №
        width: 75
        readonly: false
        align: right
        disabled: true
        width_form: 220  
        formoptions:
            rowpos: 2 
            colpos: 0
        type_field: text
            
    gruntcontrol_year:     
        field: gruntcontrol_year
        alias: g.gruntcontrol_year
        caption: Рік
        width: 75
        readonly: true
        align: right
        disabled: true
        width_form: 220
        type_field: text
        formoptions:
            rowpos: 3 
            colpos: 0

    oblastid:    
        field: OblastNameUA
        alias: obl.OblastNameUA
        caption: Область
        width: 100
        readonly: false
        align: left
        type_fieldform: DropDown
        alias_form: oblastid
        sql_form: select OblastId as k, OblastNameUA as v from dp2Oblast order by OblastNameUA
        formoptions:
            rowpos: 4 
            colpos: 0
        width_form: 220
        main_filter: true  
        type_field: text 

    VirobnikId:    
        field: VirobnikNameUA
        alias: vyr.VirobnikNameUA
        caption: Контрагент
        width: 150
        readonly: false
        align: left
        type_fieldform: DropDown
        alias_form: VirobnikId
        sql: select VirobnikId as k, VirobnikNameUA as v from dp2Virobn order by VirobnikNameUA
        is_book: true
        sql_form: select VirobnikId as k, VirobnikNameUA as v from dp2Virobn where active = 1 order by VirobnikNameUA
        formoptions:
            rowpos: 5 
            colpos: 0
        width_form: 190
        main_filter: true   
        type_field: text
         
    VirobnikId2:    
        field: VirobnikId
        alias: g.VirobnikId
        caption: VirobnikId
        width: 200
        readonly: true
        hidden: true   
        type_field: text
         
    agronomid:
        field: fio
        alias: a.fio
        caption: ПІБ агронома-інспектора
        width: 75
        readonly: false
        hidden: false
        align: left
        width_form: 220
        alias_form: agronomid
        formoptions:
            rowpos: 5
            colpos: 2
        type_fieldform: DropDown
        sql_form: select auditid as k, fio as v from dp2_auditors
        main_filter: true
        type_field: text
        
    cultid:        
        field: Kultura
        alias: k.Kultura
        caption: Культура
        depend: sortid
        depend_sql: 'select SortID as k, NameUA as v  from dp2SortReestr where CodKult = {mid} '
        width: 150
        readonly: false
        required: true
        align: left
        formoptions:
            rowpos: 7
            colpos: 0
        width_form: 220
        additems: 
            '': ---------------
        alias_form: cultid
        type_fieldform: DropDown
        sql_form: select CodKult as k, Kultura as v from dp2Kultur order by Kultura
        main_filter: true  
        type_field: text
        
    sortid:    
        field: NameUA
        alias: s.NameUA
        caption: Сорт
        width: 75
        readonly: false
        align: left
        type_fieldform: DropDown
        alias_form: sortid
        sql_form: select SortID as k, NameUA as v from dp2SortReestr  order by NameUA
        formoptions:
            rowpos: 7
            colpos: 2
        additems: 
            '': ---------------    
        child: true
        width_form: 220
        main_filter: true    
        type_field: text
        
    catid:        
        field: cat_name
        alias: c.cat_name
        caption: Категорія
        width: 100
        readonly: false
        required: true
        align: left
        formoptions:
            rowpos: 10
            colpos: 0
        width_form: 220
        alias_form: catid
        additems: 
            '': ---------------
        type_fieldform: DropDown
        sql_form: select catid as k, cat_name as v from dp2Categors order by active desc
        main_filter: true
        type_field: text
        
    genid:
        field: generation_name
        alias: ge.generation_name
        caption: Генерація, що</br>сертифікується
        width: 100
        readonly: false
        # required: true
        align: left
        alias_form: genid
        formoptions:
            rowpos: 10
            colpos: 2
        width_form: 220
        additems: 
            '': ---------------
        type_fieldform: DropDown
        sql_form: select generationid as k, generation_name as v from dp2generation order by active desc        
        main_filter: true
        type_field: text
        
    actnum:    
        field: actnum
        caption: № Акт відбору
        alias: g.actnum
        width: 100
        readonly: false
        align: left
        width_form: 220
        type_field: text
        formoptions:
            rowpos: 12
            colpos: 0
        
    actdate:    
        field: actdate
        caption: Дата акту відбору
        alias: g.actdate
        width: 100
        readonly: false
        align: left 
        width_form: 200
        type_field: date
        formoptions:
            rowpos: 12
            colpos: 2

    partnum:    
        field: partnum
        caption: Номер партії
        alias: g.partnum
        width: 150
        readonly: false
        align: left
        width_form: 220
        formoptions:
            rowpos: 13
            colpos: 0  
        adds_class: brd_btm   
        type_field: text
                    
    mass_part:
        field: mass_part
        caption: Маса партії
        alias: g.mass_part
        width: 150
        readonly: true
        align: left
        type_field: text
        
    posada:
        field: dp_posad_name
        caption: Посада
        alias: a.dp_posad_name
        width: 150
        readonly: true
        align: left
        type_field: text
        
    vidpravlenoid:
        field: vname
        alias: v.name
        caption: Відправлено зразок
        width: 75
        readonly: false
        hidden: false
        align: left
        width_form: 220
        alias_form: vidpravlenoid
        additems: 
            '': ---------------
        formoptions:
            rowpos: 13
            colpos: 2
        type_fieldform: DropDown
        sql_form: select vidpravlenoid as k, name as v from dp2_grunt_vidprav 
        adds_class: brd_btm  
        type_field: text
    
    dogstatusid:
        field: statusname
        alias: ds.statusname
        caption: Договір <br>проект/укладено
        width: 100
        readonly: false
        hidden: false
        align: left
        width_form: 220
        alias_form: dogstatusid
        additems: 
            '': ---------------
        formoptions:
            rowpos: 30
            colpos: 2
        type_fieldform: DropDown
        sql_form: select dogstatusid as k, statusname as v from dp2_grunt_dogstatus
        type_field: text
        
    oplataid:
        field: oname
        alias: o.name
        caption: Оплата
        width: 75
        readonly: false
        hidden: false
        align: left
        width_form: 220
        alias_form: oplataid
        additems: 
            '': ---------------
        formoptions:
            rowpos: 40
            colpos: 2
        type_fieldform: DropDown
        sql_form: select oplataid as k, name as v from dp2_grunt_oplat  
        type_field: text
              
    factnadhid:
        field: fnname
        alias: fn.name
        caption: Фактичне надходження<br>зразка/Акту відбору
        width: 75
        readonly: false
        hidden: false
        align: left
        width_form: 220
        alias_form: factnadhid
        additems: 
            '': ---------------
        formoptions:
            rowpos: 30
            colpos: 0
        type_fieldform: DropDown
        sql_form: select factnadhid as k, name as v from dp2_grunt_factnadh   
        type_field: text
                
    zvitnum:
        field: zvitnum
        caption: № Звіту
        alias: zvitnum
        width: 100
        readonly: false
        align: left
        width_form: 220
        type_field: text
        formoptions:
            rowpos: 34
            colpos: 0
            
    zvitdate:
        field: zvitdate
        caption: Дата звіту
        alias: g.zvitdate
        width: 100
        readonly: false
        align: left
        width_form: 198
        type_field: date
        formoptions:
            rowpos: 34
            colpos: 2
    sortchyst:
        field: sortchyst
        caption: Сортова <br>чистота, %
        alias: g.sortchyst
        width: 75
        readonly: false
        align: right
        type_field: text
        formoptions:
            rowpos: 40
            colpos: 0
    
    usercreate:    
        field: uclogin
        alias: g.usercreate
        alias_form: uclogin
        caption: Створив
        width: 75
        readonly: true
        disabled: true
        is_change: true
        align: left
        width_form: 150
        hidden_form: true
        type_field: text 
        
    datecreate:    
        field: datecreate
        alias: g.datecreate
        caption: Коли створив
        width: 100
        readonly: true
        Акdisabled: true
        width_form: 150
        type_field: datetime
        hidden_form: true

    userupdate:    
        field: uulogin
        alias: g.userupdate
        alias_form: uulogin
        caption: Змінив
        width: 75
        readonly: false
        is_change: true
        align: left
        def_value: <%USERID%>
        width_form: 150
        hidden_form: true
        type_field: text

    dateupdate:    
        field: dateupdate
        alias: g.dateupdate
        caption: Коли змінено
        width: 100
        readonly: false
        disabled: true
        is_change: true
        def_value: <%Now%>
        # formoptions:
        #     rowpos: 46
        #     colpos: 2
        width_form: 150
        type_field: datetime
        hidden_form: true  
        
detail_field: 
    fileid:
        field: fileid
        caption: ID

    gruntcontrolid:
        field: gruntcontrolid
        caption: Зовнішній ключ з Грунтконтроль

    filename:
        field: file_name
        caption: Назва файлу
        
    usercreate:
        field: usercreate    
        caption: Створив