Журнал проводок

1. Имя файла: onl_dks.gml

gml [ color "lightgray" pixmap { return( PMAPS.."purple_marble.png") }
    grid [ color "pink" ]
    frame [ name "onl_dks" maximizable "true" iconifiable "true"
	title "Журнал проводок" modal "false"
	menubar [
	    include [
		src {
		    indexes = {
			{ name="r_pvdpk => 'VD+PD+STR(ND)+STR(NPD)+KP'       ",					enable=false },
			{ name="r_vkdtd => 'VKD+STR(NKD)+VKN+STR(NKN)+VKI+STR(NKI)+VD+PD+STR(ND)+STR(NPD)+KP'", enable=false },
			{ name="r_vkktd => 'VKK+STR(NKK)+VKN+STR(NKN)+VKI+STR(NKI)+VD+PD+STR(ND)+STR(NPD)+KP'", enable=false },
			{ name="r_pd => 'VD+PD+STR(ND)+STR(NPD)+STR(NPI)+STR(NPJ)'   ", 			enable=false },
			{ name="r_lpd => 'VD+PD+STR(ND)+LP+STR(NPD)+STR(NPI)+STR(NPJ)'   ",			enable=false },
			{ name="r_tnid => 'VKT+STR(NKT)+VKN+STR(NKN)+VKI+STR(NKI)+VD+PD+STR(ND)+STR(NPD)+KP'",	enable=false },
			{ name="r_tind => 'VKT+STR(NKT)+VKI+STR(NKI)+VKN+STR(NKN)+VD+PD+STR(ND)+STR(NPD)+KP'",	enable=false },
			{ name="r_it => 'VKI+STR(NKI)+VKT+STR(NKT)+VKK+STR(NKK)'     ",				enable=false },
			{ name="r_tch => 'VKT+STR(NKT)+CH+DTOC(DATE)'     ",					enable=false },
			count = 9
		    }
		    view = Dks
		    data = "dks"
		    base = dks
		    return( DEMO.."ils.gml")
		}
	    ]
	    include [
		src {
		    view = Dks
		    data = "dks"
		    base = dks
		    return( DEMO.."navi.gml")
		}
	    ]
	    menu [ str "Помощь" icon { return( ICONS.."help.png") }
		item [ str "Список полей"
		    src {
			fields = {
				"FCOD	C  1	Код состояния проводки",
				"DATE	D	Дата проводки",
				"VD	C  2	Вид документа",
				"PD	C  2	Подразделение документа",
				"ND	N  6	Номер документа",
				"LP	C  1	Уровень позиции в документе",
				"NPD	N  4	Номер позиции в документе",
				"NPI	N  2	Номер позиции в документе",
				"NPJ	N  2	Номер позиции в документе",
				"KP	C  1	Код позиции в документе",
				"CH	C  4	Счет",
				"VKD	C  1	Вид картотеки контрагента по Дт",
				"NKD	N  6	Номер карточки контрагента по Дт",
				"VKK	C  1	Вид картотеки контрагента по Кт",
				"NKK	N  6	Номер карточки контрагента по Кт",
				"UCH	C  2	Участок обслуживания",
				"VKT	C  1	Вид картотеки пациентов",
				"NKT	N  6	Номер карточки пациента",
				"VKI	C  1	Вид картотеки диагноза",
				"NKI	N  6	Номер карточки диагноза",
				"VKN	C  1    Вид картотеки номерного учета",
				"NKN	N  6	Номер карточки номеров",
				"VKP	C  1    Вид картотеки партийного учета",
				"NKP	C 15	Ссылка на карточку партии",
				"SCRIPT	C 25 	Описание",
			    count = 25
			}
			title = "DKS.DBF"
			return( DEMO.."dbh.gml")
		    }
		]
	    ]
	    menu [ str "Выход" icon { return( ICONS.."exit.png") }
		item [ str "Выход"
		    include [
			str { onl_dks:close() }
		    ]
		]
	    ]
	]
	include [
	    src { return( DEMO.."vdtab.gml") }
	]
	include [
	    src { return( DEMO.."l_dks.gml") }
	]
    ]
    rect [ color "black" ]
]

2. Имя файла: l_dks.gml

font [ name "Serif" size 16
    include [
	src { return( BASE.."dks_0.gml") }
    ]
    box [ type "col"
	include [
	    src { 
		task = "onl_dks.gml"
		data = "dks"
		base = dks
		return( DEMO.."header.gml")
	    }
	]
	box [ type "row"
	    label [ color "blue" str "Документ:" ]
	    space [ type "rigid" w 10 ]
	    label [ name "Vd"
		str {
		    return( Codetab( vdtab, dks [dks.select].vd))
		}
	    ]
	    space [ type "glue" ]
	]
	font [ size 14
	    list [ name "Dks" rows 17
#		border "boxraised" title "Проводки"
		selected [
		    include [
			str { dks.select = Dks:getSelectedIndex() + 1 }
		    ]

		    emit [ signal "SELECTED" ]
		]
		key [ name "F1"
		    message [ title "Диалог" type "info" window "false"
			str { return( "Номер записи " .. dks [dks.select].recno) }
		    ]
		]
		include [
		    src {
			view = Dks
			data = "dks"
			base = dks
			return( DEMO.."page.gml")
		    }
		]
		key [ name "ESCAPE"
		    include [
			str { onl_dks:close() }
		    ]
		]
		head [
		    field [ len 1 str "D" ]
		    field [ len 7 align "right" str "N п/п" ]
		    field [ len 9 str "Дата" ]
		    field [ len 3 str "Vd" ]
		    field [ len 6 align "right" str "Nd" ]
		    field [ len 4 align "right" str "Npd" ]
		    field [ len 1 str " " ]
		    field [ len 1 str " " ]
		    field [ len 2 str "Kp" ]
		    field [ len 6 str "Шифр" ]
		    field [ len 3 str "Vkn" ]
		    field [ len 6 align "right" str "Nkn" ]
		    field [ len 3 str "Vkt" ]
		    field [ len 6 align "right" str "Nkt" ]
		    field [ len 3 str "Vki" ]
		    field [ len 6 align "right" str "Nki" ]
		]
		repeat [ name "J" from 1 step 1 until { return( dks.count) }
		    item [
			field [ str { return( dks [J:getValue()].del) } ]
			field [ align "right" str { return( dks [J:getValue()].recno) } ]
			field [ str { return( Ctod( dks [J:getValue()].date)) } ]
			field [ str { return( dks [J:getValue()].vd) } ]
			field [ align "right" str { return( dks [J:getValue()].nd) } ]
			field [ align "right" str { return( dks [J:getValue()].npd) } ]
			field [ align "right" str { return( dks [J:getValue()].npi) } ]
			field [ align "right" str { return( dks [J:getValue()].npj) } ]
			field [ str { return( dks [J:getValue()].kp) } ]
			field [ str { return( dks [J:getValue()].ch) } ]
			field [ str { return( dks [J:getValue()].vkn) } ]
			field [ align "right" str { return( dks [J:getValue()].nkn) } ]
			field [ str { return( dks [J:getValue()].vkt) } ]
			field [ align "right" str { return( dks [J:getValue()].nkt) } ]
			field [ str { return( dks [J:getValue()].vki) } ]
			field [ align "right" str { return( dks [J:getValue()].nki) } ]
		    ]
		]
		count { return( dks.count) }
		select { return( dks.select - 1) }
	    ]
	]
	box [ type "col" border "boxraised"
	    box [ type "row"
		label [ color "blue" str "Диагноз:" ]
		label [ name "Vki" len 2 border "boxsunken"
		    str { return( dks [dks.select].vki) }
		]
		space [ type "rigid" w 5 ]
		label [ name "Nki" halign "right" len 6 border "boxsunken"
		    str { return( dks [dks.select].nki) }
		]
		space [ type "rigid" w 5 ]
		label [ name "Namei" border "boxsunken" len 57
		    str { return( dks [dks.select].namei) }
		]
		space [ type "glue" ]
	    ]
	    space [ type "rigid" h 5 ]
	    box [ type "row"
		label [ color "blue" str "Пациент:" ]
		label [ name "Vkt" len 2 border "boxsunken"
		    str { return( dks [dks.select].vkt) }
		]
		space [ type "rigid" w 5 ]
		label [ name "Nkt" halign "right" len 6 border "boxsunken"
		    str { return( dks [dks.select].nkt) }
		]
		space [ type "rigid" w 5 ]
		label [ name "Namet" border "boxsunken" len 55
		    str { return( dks [dks.select].namet) }
		]
		space [ type "glue" ]
	    ]
	    space [ type "rigid" h 5 ]
	    box [ type "row"
		label [ color "blue" str "Врач:" ]
		label [ name "Vkk" len 2 border "boxsunken"
		    str { return( dks [dks.select].vkk) }
		]
		space [ type "rigid" w 5 ]
		label [ name "Nkk" halign "right" len 6 border "boxsunken"
		    str { return( dks [dks.select].nkk) }
		]
		space [ type "rigid" w 5 ]
		label [ name "Namek" border "boxsunken" len 48
		    str { return( dks [dks.select].namek) }
		]
		space [ type "glue" ]
		label [ color "blue" str "Участок:" ]
		label [ name "Uch" len 2 border "boxsunken"
		    str { return( dks [dks.select].uch) }
		]
	    ]
	    space [ type "rigid" h 5 ]
	    box [ type "row"
		label [ color "blue" str "Описание:" ]
		label [ name "Script" border "boxsunken" len 40
		    str { return( dks [dks.select].script) }
		]
		space [ type "glue" ]
	    ]
	]
    ]
    event [ signal "SELECTED"
	include [
	    str {
		Base:refresh()
		Vd:refresh()
		Vki:refresh()
		Nki:refresh()
		Namei:refresh()
		Vkt:refresh()
		Nkt:refresh()
		Namet:refresh()
		Vkk:refresh()
		Nkk:refresh()
		Uch:refresh()
		Namek:refresh()
		Script:refresh()
	    }
	]
    ]
]