Код: Выделить всё
Interface MatPomosh 'Материальная помощь';
create view V1
as
select PERSONS.FIO, CATALOGS.NAME, CATALOGS1.NAME, KATPODR.NAME, FORTUNE.DOCSUM, FORTUNE.DOCNMB, FORTUNE.DOCDATE
from FORTUNE, PERSONS, APPOINTMENTS, KATPODR, CATALOGS, CATALOGS CATALOGS1, CONTDOC, PARTDOC, TITLEDOC
where ((FORTUNE.CFTYPE == CATALOGS.NREC and
FORTUNE.CPERS == PERSONS.NREC and
PERSONS.APPOINTCUR == APPOINTMENTS.NREC and
APPOINTMENTS.POST == CATALOGS1.NREC and
PERSONS.GALDEP == KATPODR.NREC and
FORTUNE.CFCONT == CONTDOC.NREC and
CONTDOC.CPART == PARTDOC.NREC and
PARTDOC.CDOC == TITLEDOC.NREC and
20 == FORTUNE.WCHOICE (noIndex) and
1 == TITLEDOC.WSTATUS (noIndex)));
function SumPer : String;
{
var s : String;
s := DoubleToStr(V1.FORTUNE.DOCSUM, '666''666''666''666.88');
if (V1.FORTUNE.WATTR1 = 2)
{
s := s + '%';
}
Result := s;
}
Browse B_mat
Table FORTUNE;
Fields
V1.PERSONS.FIO 'Фамилия, имя, отчество': [22], Protect;
V1.CATALOGS.NAME 'Вид материальной помощи': [30], Protect;
V1.CATALOGS1.NAME 'Должность': [20], Protect;
V1.KATPODR.NAME 'Подразделение': [20], Protect;
SumPer 'Сумма': [10], Protect;
'№ ' + V1.FORTUNE.DOCNMB + ' от ' + V1.FORTUNE.DOCDATE '№ и дата приказа': [20], Protect;
end;
end.