Программное средство, которое обеспечивает учет спецодежды в Молодечненских электрических сетях
Описание предметной области, входной и выходной информации, функциональное и информационное моделирование, разработка структуры базы данных. Требования к аппаратному и программному обеспечению. Компоненты и интерфейс программы, ее вызов и загрузка.
Рубрика | Программирование, компьютеры и кибернетика |
Вид | дипломная работа |
Язык | русский |
Дата добавления | 06.07.2012 |
Размер файла | 4,8 M |
Отправить свою хорошую работу в базу знаний просто. Используйте форму, расположенную ниже
Студенты, аспиранты, молодые ученые, использующие базу знаний в своей учебе и работе, будут вам очень благодарны.
Form1.norm_rasc_Set.First;
for i:=0 to Form1.norm_rasc_Set.RecordCount-1 do
begin
x:=x+Form1.norm_rasc_Set.fieldbyName('norma').Value;
y:=y+Form1.norm_rasc_Set.fieldbyName('rascenka').Value;
Form1.norm_rasc_Set.Next;
end;
edit1.Text:=floattostr(x);
edit2.Text:=floattostr(y);
end;
end.
unit Unit10;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls, Buttons, DBCtrls;
type
Tnov_norm_rasc = class(TForm)
GroupBox1: TGroupBox;
DBLookupComboBox1: TDBLookupComboBox;
BitBtn1: TBitBtn;
GroupBox2: TGroupBox;
ComboBox1: TComboBox;
ComboBox2: TComboBox;
BitBtn2: TBitBtn;
BitBtn3: TBitBtn;
procedure BitBtn1Click(Sender: TObject);
procedure BitBtn2Click(Sender: TObject);
procedure FormActivate(Sender: TObject);
procedure BitBtn3Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
nov_norm_rasc: Tnov_norm_rasc;
implementation
uses Unit1, Unit9, Unit2, Unit3, Unit4, Unit5, Unit6, Unit7, Unit8, Unit12, Unit15, Unit11, Unit13, Unit14;
{$R *.dfm}
procedure Tnov_norm_rasc.BitBtn1Click(Sender: TObject);
begin
if (combobox1.Text='') or (combobox2.Text='') or (dblookupcombobox1.Text='')
then showmessage('Не все поля заполнены!')
else
begin
Form1.norm_rasc_Set.Active:=false;
Form1.norm_rasc_Set.SelectSQL.Clear;
Form1.norm_rasc_Set.SelectSQL.Add('select * from norm_rascenki where kod_izd=:param_izd and mes=:param_mes and god=:param_god');
Form1.norm_rasc_Set.ParamByName('param_izd').Value:=dbLookupcombobox1.KeyValue;
Form1.norm_rasc_Set.ParamByName('param_mes').Value:=combobox1.Text;
Form1.norm_rasc_Set.ParamByName('param_god').Value:=strtoint(combobox2.Text);
Form1.norm_rasc_Set.Active:=true;
if Form1.norm_rasc_Set.RecordCount=0 then
showmessage('На этот период нормы времени и расценки для данного изделия не введены')
else
begin
norm_rasc.Label3.Caption:=combobox1.Text;
norm_rasc.Label4.Caption:=combobox2.Text;
norm_rasc.Label5.Caption:=dbLookupcombobox1.Text;
norm_rasc.Label6.Caption:=dbLookupcombobox1.KeyValue;
norm_rasc.Show;
nov_norm_rasc.Close;
end
end;
end;
procedure Tnov_norm_rasc.BitBtn2Click(Sender: TObject);
var
i:integer;
begin
if (combobox1.Text='') or (combobox2.Text='') or (dblookupcombobox1.Text='')
then showmessage('Не все поля заполнены!')
else
begin
Form1.norm_rasc_Set.Active:=false;
Form1.norm_rasc_Set.SelectSQL.Clear;
Form1.norm_rasc_Set.SelectSQL.Add('select * from norm_rascenki where kod_izd=:param_izd and mes=:param_mes and god=:param_god');
Form1.norm_rasc_Set.ParamByName('param_izd').Value:=dbLookupcombobox1.KeyValue;
Form1.norm_rasc_Set.ParamByName('param_mes').Value:=combobox1.Text;
Form1.norm_rasc_Set.ParamByName('param_god').Value:=strtoint(combobox2.Text);
Form1.norm_rasc_Set.Active:=true;
Form1.norm_rasc_Set.Last;
if Form1.norm_rasc_Set.RecordCount<>0 then
showmessage('Нормы времени и расценки по данному изделию на этот период уже введены')
else
begin
norm_rasc.Label3.Caption:=combobox1.Text;
norm_rasc.Label4.Caption:=combobox2.Text;
norm_rasc.Label5.Caption:=dbLookupcombobox1.Text;
norm_rasc.Label6.Caption:=dbLookupcombobox1.KeyValue;
norm_rasc.Show;
nov_norm_rasc.Close;
end;
end;
end;
procedure Tnov_norm_rasc.FormActivate(Sender: TObject);
begin
combobox1.Text:=FormatDateTime('mmmm', Now);
combobox2.Text:=FormatDateTime('yyyy', Now);
end;
procedure Tnov_norm_rasc.BitBtn3Click(Sender: TObject);
begin
if (combobox1.Text='') or (combobox2.Text='') or (dblookupcombobox1.Text='')
then showmessage('Не все поля заполнены!')
else
begin
Form1.norm_rasc_Set.Active:=false;
Form1.norm_rasc_Set.SelectSQL.Clear;
Form1.norm_rasc_Set.SelectSQL.Add('select * from norm_rascenki where kod_izd=:param_izd and mes=:param_mes and god=:param_god');
Form1.norm_rasc_Set.ParamByName('param_izd').Value:=dbLookupcombobox1.KeyValue;
Form1.norm_rasc_Set.ParamByName('param_mes').Value:=combobox1.Text;
Form1.norm_rasc_Set.ParamByName('param_god').Value:=strtoint(combobox2.Text);
Form1.norm_rasc_Set.Active:=true;
if Form1.norm_rasc_Set.RecordCount=0 then
showmessage('На этот период нормы времени и расценки для данного изделия не введены')
else
begin
otch_norm_rasc.QuickRep1.Preview;
nov_norm_rasc.Close;
end
end;
end;
end.
unit Unit11;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls, Buttons, DBCtrls, Grids, DBGrids, DB, ExtCtrls;
type
Tkalk = class(TForm)
DBGrid1: TDBGrid;
GroupBox1: TGroupBox;
Label1: TLabel;
BitBtn1: TBitBtn;
BitBtn2: TBitBtn;
BitBtn3: TBitBtn;
BitBtn4: TBitBtn;
Label2: TLabel;
BitBtn5: TBitBtn;
Label3: TLabel;
Label4: TLabel;
Label5: TLabel;
BitBtn6: TBitBtn;
procedure BitBtn2Click(Sender: TObject);
procedure BitBtn1Click(Sender: TObject);
procedure BitBtn3Click(Sender: TObject);
procedure BitBtn4Click(Sender: TObject);
procedure BitBtn5Click(Sender: TObject);
procedure BitBtn6Click(Sender: TObject);
procedure FormActivate(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
kalk: Tkalk;
implementation
uses Unit1, Unit10, Unit2, Unit3, Unit4, Unit5, Unit6, Unit7, Unit8, Unit9, Unit12, Unit13;
{$R *.dfm}
procedure Tkalk.BitBtn2Click(Sender: TObject);
begin
Form1.kalk_Set.Prior;
end;
procedure Tkalk.BitBtn1Click(Sender: TObject);
begin
Form1.kalk_Set.First;
end;
procedure Tkalk.BitBtn3Click(Sender: TObject);
begin
Form1.kalk_Set.Next;
end;
procedure Tkalk.BitBtn4Click(Sender: TObject);
begin
Form1.kalk_Set.Last;
end;
procedure Tkalk.BitBtn5Click(Sender: TObject);
begin
otch_kalk.QuickRep1.Preview;
close;
end;
procedure Tkalk.BitBtn6Click(Sender: TObject);
var x,y: double;
i: integer;
begin
x:=0;
//сумма на сырье и материалы
Form1.sostav_Set.Last;
Form1.sostav_Set.First;
for i:=0 to Form1.sostav_Set.RecordCount-1 do
begin
x:=x+strtofloat(Form1.sostav_Set.fieldbyName('sum').AsString);
Form1.sostav_Set.Next;
end;
x:=round(x);
y:=0;
//сумма осн.з/п произв. рабочих
Form1.norm_rasc_Set.Last;
Form1.norm_rasc_Set.First;
for i:=0 to Form1.norm_rasc_Set.RecordCount-1 do
begin
y:=y+Form1.norm_rasc_Set.fieldbyName('rascenka').Value;
Form1.norm_rasc_Set.Next;
end;
//исчисление калькуляции
Form1.kalk_Set.Last;
Form1.kalk_Set.First;
for i:=0 to Form1.kalk_Set.RecordCount-1 do
begin
if Form1.kalk_Set.Locate('kod_stat','5',[loCaseInsensitive, loPartialKey])
then
begin
s_ten:=Form1.kalk_Set.FieldByName('summa').Value;
Form1.kalk_Set.Edit;
Form1.kalk_Set.FieldByName('summa').Value:=s_ten;
Form1.kalk_Set.Post;
end;
if Form1.kalk_Set.Locate('kod_stat','6',[loCaseInsensitive, loPartialKey])
then
begin
s_en:=Form1.kalk_Set.FieldByName('summa').Value;
Form1.kalk_Set.Edit;
Form1.kalk_Set.FieldByName('summa').Value:=s_en;
Form1.kalk_Set.Post;
end;
if Form1.kalk_Set.Locate('kod_stat','1',[loCaseInsensitive, loPartialKey])
then
begin
Form1.kalk_Set.Edit;
Form1.kalk_Set.FieldByName('summa').Value:=x;
s_m:=Form1.kalk_Set.FieldByName('summa').Value;
Form1.kalk_Set.Post;
end;
if Form1.kalk_Set.Locate('kod_stat','8',[loCaseInsensitive, loPartialKey])
then
begin
Form1.kalk_Set.Edit;
Form1.kalk_Set.FieldByName('summa').Value:=y;
s_ozp:=Form1.kalk_Set.FieldByName('summa').Value;
Form1.kalk_Set.Post;
end;
if Form1.kalk_Set.Locate('kod_stat','2',[loCaseInsensitive, loPartialKey])
then
begin
Form1.kalk_Set.Edit;
Form1.kalk_Set.FieldByName('summa').Value:=round(s_m/100*strtofloat(Form1.kalk_Set.fieldbyname('koef').AsString));
s_tzr:=Form1.kalk_Set.FieldByName('summa').Value;
Form1.kalk_Set.Post;
end;
if Form1.kalk_Set.Locate('kod_stat','7',[loCaseInsensitive, loPartialKey])
then
begin
Form1.kalk_Set.Edit;
Form1.kalk_Set.FieldByName('summa').Value:=round(s_ozp*strtofloat(Form1.kalk_Set.fieldbyname('koef').AsString));
s_zp:=Form1.kalk_Set.FieldByName('summa').Value;
Form1.kalk_Set.Post;
end;
if Form1.kalk_Set.Locate('kod_stat','9',[loCaseInsensitive, loPartialKey])
then
begin
Form1.kalk_Set.Edit;
Form1.kalk_Set.FieldByName('summa').Value:=round(s_zp/100*strtofloat(Form1.kalk_Set.fieldbyname('koef').AsString));
s_strah:=Form1.kalk_Set.FieldByName('summa').Value;
Form1.kalk_Set.Post;
end;
if Form1.kalk_Set.Locate('kod_stat','11',[loCaseInsensitive, loPartialKey])
then
begin
Form1.kalk_Set.Edit;
Form1.kalk_Set.FieldByName('summa').Value:=round(s_zp/100*strtofloat(Form1.kalk_Set.fieldbyname('koef').AsString));
s_nesch:=Form1.kalk_Set.FieldByName('summa').Value;
Form1.kalk_Set.Post;
end;
if Form1.kalk_Set.Locate('kod_stat','12',[loCaseInsensitive, loPartialKey])
then
begin
Form1.kalk_Set.Edit;
Form1.kalk_Set.FieldByName('summa').Value:=round(s_zp/100*strtofloat(Form1.kalk_Set.fieldbyname('koef').AsString));
s_proizv:=Form1.kalk_Set.FieldByName('summa').Value;
Form1.kalk_Set.Post;
end;
if Form1.kalk_Set.Locate('kod_stat','13',[loCaseInsensitive, loPartialKey])
then
begin
Form1.kalk_Set.Edit;
Form1.kalk_Set.FieldByName('summa').Value:=s_m+s_tzr+s_ten+s_en+s_zp+s_strah+s_nesch+s_proizv;
s_pr_s:=Form1.kalk_Set.FieldByName('summa').Value;
Form1.kalk_Set.Post;
end;
if Form1.kalk_Set.Locate('kod_stat','14',[loCaseInsensitive, loPartialKey])
then
begin
Form1.kalk_Set.Edit;
Form1.kalk_Set.FieldByName('summa').Value:=round(s_pr_s/100*strtofloat(Form1.kalk_Set.fieldbyname('koef').AsString));
s_kr:=Form1.kalk_Set.FieldByName('summa').Value;
Form1.kalk_Set.Post;
end;
if Form1.kalk_Set.Locate('kod_stat','15',[loCaseInsensitive, loPartialKey])
then
begin
Form1.kalk_Set.Edit;
Form1.kalk_Set.FieldByName('summa').Value:=round(s_pr_s/100*strtofloat(Form1.kalk_Set.fieldbyname('koef').AsString));
s_ohr:=Form1.kalk_Set.FieldByName('summa').Value;
Form1.kalk_Set.Post;
end;
if Form1.kalk_Set.Locate('kod_stat','16',[loCaseInsensitive, loPartialKey])
then
begin
Form1.kalk_Set.Edit;
Form1.kalk_Set.FieldByName('summa').Value:=s_pr_s+s_kr+s_ohr;
s_pol_s:=Form1.kalk_Set.FieldByName('summa').Value;
Form1.kalk_Set.Post;
end;
if Form1.kalk_Set.Locate('kod_stat','17',[loCaseInsensitive, loPartialKey])
then
begin
Form1.kalk_Set.Edit;
Form1.kalk_Set.FieldByName('summa').Value:=round(s_pol_s/100*strtofloat(Form1.kalk_Set.fieldbyname('koef').AsString));
s_p:=Form1.kalk_Set.FieldByName('summa').Value;
Form1.kalk_Set.Post;
end;
if Form1.kalk_Set.Locate('kod_stat','18',[loCaseInsensitive, loPartialKey])
then
begin
Form1.kalk_Set.Edit;
Form1.kalk_Set.FieldByName('summa').Value:=s_pol_s+s_p;
s_op_c:=Form1.kalk_Set.FieldByName('summa').Value;
Form1.kalk_Set.Post;
end;
if Form1.kalk_Set.Locate('kod_stat','20',[loCaseInsensitive, loPartialKey])
then
begin
Form1.kalk_Set.Edit;
m:=s_op_c;
n:=Trunc(m);
s:=n mod 100;
if s<50 then s_d_op_c:=n-s else s_d_op_c:=n+(100-s);
Form1.kalk_Set.FieldByName('summa').Value:=s_d_op_c;
Form1.kalk_Set.Post;
end;
if Form1.kalk_Set.Locate('kod_stat','21',[loCaseInsensitive, loPartialKey])
then
begin
Form1.kalk_Set.Edit;
Form1.kalk_Set.FieldByName('summa').Value:=s_pol_s;
s_zat:=Form1.kalk_Set.FieldByName('summa').Value;
Form1.kalk_Set.Post;
end;
if Form1.kalk_Set.Locate('kod_stat','22',[loCaseInsensitive, loPartialKey])
then
begin
Form1.kalk_Set.Edit;
Form1.kalk_Set.FieldByName('summa').Value:=s_d_op_c;
s_bezNDS:=Form1.kalk_Set.FieldByName('summa').Value;
Form1.kalk_Set.Post;
end;
if Form1.kalk_Set.Locate('kod_stat','23',[loCaseInsensitive, loPartialKey])
then
begin
Form1.kalk_Set.Edit;
Form1.kalk_Set.FieldByName('summa').Value:=round(s_bezNDS/100*strtofloat(Form1.kalk_Set.fieldbyname('koef').AsString));
s_NDS:=Form1.kalk_Set.FieldByName('summa').Value;
Form1.kalk_Set.Post;
end;
if Form1.kalk_Set.Locate('kod_stat','24',[loCaseInsensitive, loPartialKey])
then
begin
Form1.kalk_Set.Edit;
Form1.kalk_Set.FieldByName('summa').Value:=s_bezNDS+s_NDS;
Form1.kalk_Set.Post;
end;
end;
showmessage('Пересчет калькуляции выполнен успешно.');
//конец исчисления
end;
procedure Tkalk.FormActivate(Sender: TObject);
begin
ShowScrollBar(DBGrid1.Handle, SB_VERt, false);
end;
end.
unit Unit12;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls, Buttons, DB, DBCtrls;
type
Tnov_kalk = class(TForm)
GroupBox2: TGroupBox;
DBLookupComboBox1: TDBLookupComboBox;
BitBtn2: TBitBtn;
GroupBox1: TGroupBox;
ComboBox1: TComboBox;
ComboBox2: TComboBox;
GroupBox3: TGroupBox;
Label1: TLabel;
Label2: TLabel;
Edit1: TEdit;
BitBtn3: TBitBtn;
Label3: TLabel;
Label4: TLabel;
BitBtn1: TBitBtn;
procedure BitBtn1Click(Sender: TObject);
procedure BitBtn2Click(Sender: TObject);
procedure FormActivate(Sender: TObject);
procedure BitBtn3Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
nov_kalk: Tnov_kalk;
s_NDS, s_bezNDS, s_m, s_zp, s_ten, s_en, s_tzr, s_ozp, s_strah, s_nesch, s_proizv, s_pr_s, s_kr, s_ohr, s_pol_s, s_p, s_op_c, s_d_op_c, s_zat: double;
i, n, s: integer;
x, y, m: double;
implementation
uses Unit1, Unit10, Unit11, Unit2, Unit3, Unit4, Unit5, Unit6, Unit7, Unit8, Unit9, Unit13, Unit14, Unit15, Unit16, Unit17, Unit18, Unit19, Unit20, Unit21;
{$R *.dfm}
procedure Tnov_kalk.BitBtn1Click(Sender: TObject);
var
s_NDS, s_bezNDS, s_m, s_zp, s_ten, s_en, s_tzr, s_ozp, s_strah, s_nesch, s_proizv, s_pr_s, s_kr, s_ohr, s_pol_s, s_p, s_op_c, s_d_op_c, s_zat: double;
i, n, s: integer;
x, y, m: double;
begin
if (dblookupcombobox1.Text='') or (combobox1.text='')
or (combobox2.Text='') or (edit1.Text='') or (edit2.Text='')
then showMessage('Не все поля заполнены!')
else
begin
Form1.kalk_Set.Active:=false;
Form1.kalk_Set.SelectSQL.Clear;
Form1.kalk_Set.SelectSQL.Add('select * from kalkul where kod_izd=:param_izd and mes=:param_mes and god=:param_god');
Form1.kalk_Set.ParamByName('param_izd').Value:=dbLookupcombobox1.KeyValue;
Form1.kalk_Set.ParamByName('param_mes').Value:=combobox1.Text;
Form1.kalk_Set.ParamByName('param_god').Value:=strtoint(combobox2.Text);
Form1.kalk_Set.Active:=true;
Form1.kalk_Set.Last;
if Form1.kalk_Set.RecordCount<>0
then showmessage('Калькуляция по данному изделию на этот период уже составлена')
else
begin
//есть ли расход материалов?
Form1.sostav_Set.Active:=false;
Form1.sostav_Set.SelectSQL.Clear;
Form1.sostav_Set.SelectSQL.Add('select * from sostav_izd where kod_izd=:param_izd and mes=:param_mes and god=:param_god');
Form1.sostav_Set.ParamByName('param_izd').Value:=dbLookupcombobox1.KeyValue;
Form1.sostav_Set.ParamByName('param_mes').Value:=combobox1.Text;
Form1.sostav_Set.ParamByName('param_god').Value:=strtoint(combobox2.Text);
Form1.sostav_Set.Active:=true;
if Form1.sostav_Set.RecordCount=0 then
begin
showmessage('На этот период расход материалов на данное изделие не составлен');
end
else
begin
//есть ли нормы и расценки?
Form1.norm_rasc_Set.Active:=false;
Form1.norm_rasc_Set.SelectSQL.Clear;
Form1.norm_rasc_Set.SelectSQL.Add('select * from norm_rascenki where kod_izd=:param_izd and mes=:param_mes and god=:param_god');
Form1.norm_rasc_Set.ParamByName('param_izd').Value:=dbLookupcombobox1.KeyValue;
Form1.norm_rasc_Set.ParamByName('param_mes').Value:=combobox1.Text;
Form1.norm_rasc_Set.ParamByName('param_god').Value:=strtoint(combobox2.Text);
Form1.norm_rasc_Set.Active:=true;
if Form1.norm_rasc_Set.RecordCount=0 then
begin
showmessage('На этот период нормы времени и расценки для данного изделия не введены');
end
else
begin
x:=0;
//сумма на сырье и материалы
Form1.sostav_Set.Last;
Form1.sostav_Set.First;
for i:=0 to Form1.sostav_Set.RecordCount-1 do
begin
x:=x+strtofloat(Form1.sostav_Set.fieldbyName('sum').AsString);
Form1.sostav_Set.Next;
end;
x:=round(x);
y:=0;
//сумма осн.з/п произв. рабочих
Form1.norm_rasc_Set.Last;
Form1.norm_rasc_Set.First;
for i:=0 to Form1.norm_rasc_Set.RecordCount-1 do
begin
y:=y+Form1.norm_rasc_Set.fieldbyName('rascenka').Value;
Form1.norm_rasc_Set.Next;
end;
Form1.stat_Set.Last;
Form1.stat_Set.First;
for i:=0 to Form1.stat_Set.RecordCount-1 do
begin
//добавление всех статей
Form1.kalk_Set.Insert;
Form1.kalk_Set.FieldByName('mes').Value:=combobox1.Text;
Form1.kalk_Set.FieldByName('god').Value:=strtoint(combobox2.Text);
Form1.kalk_Set.FieldByName('kod_izd').Value:=dblookupcombobox1.KeyValue;
Form1.kalk_Set.FieldByName('kod_stat').Value:=Form1.stat_Set.fieldbyname('kod_stat').Value;
Form1.kalk_Set.FieldByName('koef').Value:=Form1.stat_Set.fieldbyname('koef').Value;
Form1.stat_Set.Next;
Form1.kalk_Set.Post;
end;
//калькуляция на данное изделие на период
Form1.kalk_Set.Active:=false;
Form1.kalk_Set.SelectSQL.Clear;
Form1.kalk_Set.SelectSQL.Add('select * from kalkul where kod_izd=:param_izd and mes=:param_mes and god=:param_god');
Form1.kalk_Set.ParamByName('param_izd').Value:=dbLookupcombobox1.KeyValue;
Form1.kalk_Set.ParamByName('param_mes').Value:=combobox1.Text;
Form1.kalk_Set.ParamByName('param_god').Value:=strtoint(combobox2.Text);
Form1.kalk_Set.Active:=true;
//исчисление калькуляции
Form1.kalk_Set.Last;
Form1.kalk_Set.First;
for i:=0 to Form1.kalk_Set.RecordCount-1 do
begin
if Form1.kalk_Set.Locate('kod_stat','1',[loCaseInsensitive, loPartialKey])
then
begin
Form1.kalk_Set.Edit;
Form1.kalk_Set.FieldByName('summa').Value:=x;
s_m:=Form1.kalk_Set.FieldByName('summa').Value;
Form1.kalk_Set.Post;
end;
if Form1.kalk_Set.Locate('kod_stat','8',[loCaseInsensitive, loPartialKey])
then
begin
Form1.kalk_Set.Edit;
Form1.kalk_Set.FieldByName('summa').Value:=y;
s_ozp:=Form1.kalk_Set.FieldByName('summa').Value;
Form1.kalk_Set.Post;
end;
if Form1.kalk_Set.Locate('kod_stat','5',[loCaseInsensitive, loPartialKey])
then
begin
Form1.kalk_Set.Edit;
Form1.kalk_Set.FieldByName('summa').Value:=strtofloat(edit1.Text);
s_ten:=Form1.kalk_Set.FieldByName('summa').Value;
Form1.kalk_Set.Post;
end;
if Form1.kalk_Set.Locate('kod_stat','6',[loCaseInsensitive, loPartialKey])
then
begin
Form1.kalk_Set.Edit;
Form1.kalk_Set.FieldByName('summa').Value:=strtofloat(edit2.Text);
s_en:=Form1.kalk_Set.FieldByName('summa').Value;
Form1.kalk_Set.Post;
end;
if Form1.kalk_Set.Locate('kod_stat','2',[loCaseInsensitive, loPartialKey])
then
begin
Form1.kalk_Set.Edit;
Form1.kalk_Set.FieldByName('summa').Value:=round(s_m/100*strtofloat(Form1.kalk_Set.fieldbyname('koef').AsString));
s_tzr:=Form1.kalk_Set.FieldByName('summa').Value;
Form1.kalk_Set.Post;
end;
if Form1.kalk_Set.Locate('kod_stat','7',[loCaseInsensitive, loPartialKey])
then
begin
Form1.kalk_Set.Edit;
Form1.kalk_Set.FieldByName('summa').Value:=round(s_ozp*strtofloat(Form1.kalk_Set.fieldbyname('koef').AsString));
s_zp:=Form1.kalk_Set.FieldByName('summa').Value;
Form1.kalk_Set.Post;
end;
if Form1.kalk_Set.Locate('kod_stat','9',[loCaseInsensitive, loPartialKey])
then
begin
Form1.kalk_Set.Edit;
Form1.kalk_Set.FieldByName('summa').Value:=round(s_zp/100*strtofloat(Form1.kalk_Set.fieldbyname('koef').AsString));
s_strah:=Form1.kalk_Set.FieldByName('summa').Value;
Form1.kalk_Set.Post;
end;
if Form1.kalk_Set.Locate('kod_stat','11',[loCaseInsensitive, loPartialKey])
then
begin
Form1.kalk_Set.Edit;
Form1.kalk_Set.FieldByName('summa').Value:=round(s_zp/100*strtofloat(Form1.kalk_Set.fieldbyname('koef').AsString));
s_nesch:=Form1.kalk_Set.FieldByName('summa').Value;
Form1.kalk_Set.Post;
end;
if Form1.kalk_Set.Locate('kod_stat','12',[loCaseInsensitive, loPartialKey])
then
begin
Form1.kalk_Set.Edit;
Form1.kalk_Set.FieldByName('summa').Value:=round(s_zp/100*strtofloat(Form1.kalk_Set.fieldbyname('koef').AsString));
s_proizv:=Form1.kalk_Set.FieldByName('summa').Value;
Form1.kalk_Set.Post;
end;
if Form1.kalk_Set.Locate('kod_stat','13',[loCaseInsensitive, loPartialKey])
then
begin
Form1.kalk_Set.Edit;
Form1.kalk_Set.FieldByName('summa').Value:=s_m+s_tzr+s_ten+s_en+s_zp+s_strah+s_nesch+s_proizv;
s_pr_s:=Form1.kalk_Set.FieldByName('summa').Value;
Form1.kalk_Set.Post;
end;
if Form1.kalk_Set.Locate('kod_stat','14',[loCaseInsensitive, loPartialKey])
then
begin
Form1.kalk_Set.Edit;
Form1.kalk_Set.FieldByName('summa').Value:=round(s_pr_s/100*strtofloat(Form1.kalk_Set.fieldbyname('koef').AsString));
s_kr:=Form1.kalk_Set.FieldByName('summa').Value;
Form1.kalk_Set.Post;
end;
if Form1.kalk_Set.Locate('kod_stat','15',[loCaseInsensitive, loPartialKey])
then
begin
Form1.kalk_Set.Edit;
Form1.kalk_Set.FieldByName('summa').Value:=round(s_pr_s/100*strtofloat(Form1.kalk_Set.fieldbyname('koef').AsString));
s_ohr:=Form1.kalk_Set.FieldByName('summa').Value;
Form1.kalk_Set.Post;
end;
if Form1.kalk_Set.Locate('kod_stat','16',[loCaseInsensitive, loPartialKey])
then
begin
Form1.kalk_Set.Edit;
Form1.kalk_Set.FieldByName('summa').Value:=s_pr_s+s_kr+s_ohr;
s_pol_s:=Form1.kalk_Set.FieldByName('summa').Value;
Form1.kalk_Set.Post;
end;
if Form1.kalk_Set.Locate('kod_stat','17',[loCaseInsensitive, loPartialKey])
then
begin
Form1.kalk_Set.Edit;
Form1.kalk_Set.FieldByName('summa').Value:=round(s_pol_s/100*strtofloat(Form1.kalk_Set.fieldbyname('koef').AsString));
s_p:=Form1.kalk_Set.FieldByName('summa').Value;
Form1.kalk_Set.Post;
end;
if Form1.kalk_Set.Locate('kod_stat','18',[loCaseInsensitive, loPartialKey])
then
begin
Form1.kalk_Set.Edit;
Form1.kalk_Set.FieldByName('summa').Value:=s_pol_s+s_p;
s_op_c:=Form1.kalk_Set.FieldByName('summa').Value;
Form1.kalk_Set.Post;
end;
if Form1.kalk_Set.Locate('kod_stat','20',[loCaseInsensitive, loPartialKey])
then
begin
Form1.kalk_Set.Edit;
m:=s_op_c;
n:=Trunc(m);
s:=n mod 100;
if s<50 then s_d_op_c:=n-s else s_d_op_c:=n+(100-s);
Form1.kalk_Set.FieldByName('summa').Value:=s_d_op_c;
Form1.kalk_Set.Post;
end;
if Form1.kalk_Set.Locate('kod_stat','21',[loCaseInsensitive, loPartialKey])
then
begin
Form1.kalk_Set.Edit;
Form1.kalk_Set.FieldByName('summa').Value:=s_pol_s;
s_zat:=Form1.kalk_Set.FieldByName('summa').Value;
Form1.kalk_Set.Post;
end;
if Form1.kalk_Set.Locate('kod_stat','22',[loCaseInsensitive, loPartialKey])
then
begin
Form1.kalk_Set.Edit;
Form1.kalk_Set.FieldByName('summa').Value:=s_d_op_c;
s_bezNDS:=Form1.kalk_Set.FieldByName('summa').Value;
Form1.kalk_Set.Post;
end;
if Form1.kalk_Set.Locate('kod_stat','23',[loCaseInsensitive, loPartialKey])
then
begin
Form1.kalk_Set.Edit;
Form1.kalk_Set.FieldByName('summa').Value:=round(s_bezNDS/100*strtofloat(Form1.kalk_Set.fieldbyname('koef').AsString));
s_NDS:=Form1.kalk_Set.FieldByName('summa').Value;
Form1.kalk_Set.Post;
end;
if Form1.kalk_Set.Locate('kod_stat','24',[loCaseInsensitive, loPartialKey])
then
begin
Form1.kalk_Set.Edit;
Form1.kalk_Set.FieldByName('summa').Value:=s_bezNDS+s_NDS;
Form1.kalk_Set.Post;
end;
end;
//конец исчисления
kalk.Label3.Caption:=combobox1.Text;
kalk.Label4.Caption:=combobox2.Text;
kalk.Label5.Caption:=dblookupcombobox1.Text;
kalk.Show;
end;
close;
end;
end;
end;
end;
procedure Tnov_kalk.BitBtn2Click(Sender: TObject);
begin
if (dblookupcombobox1.Text='') or (combobox1.text='')
or (combobox2.Text='')
then showMessage('Не все поля заполнены!')
else
begin
Form1.kalk_Set.Active:=false;
Form1.kalk_Set.SelectSQL.Clear;
Form1.kalk_Set.SelectSQL.Add('select * from kalkul where kod_izd=:param_izd and mes=:param_mes and god=:param_god');
Form1.kalk_Set.ParamByName('param_izd').Value:=dbLookupcombobox1.KeyValue;
Form1.kalk_Set.ParamByName('param_mes').Value:=combobox1.Text;
Form1.kalk_Set.ParamByName('param_god').Value:=strtoint(combobox2.Text);
Form1.kalk_Set.Active:=true;
if Form1.kalk_Set.RecordCount=0 then
showmessage('Калькуляция на этот период по данному изделию не составлена')
else
begin
kalk.Label3.Caption:=combobox1.Text;
kalk.Label4.Caption:=combobox2.Text;
kalk.Label5.Caption:=dblookupcombobox1.Text;
kalk.Show;
nov_kalk.Close;
end;
end;
end;
procedure Tnov_kalk.FormActivate(Sender: TObject);
begin
combobox1.Text:=FormatDateTime('mmmm', Now);
combobox2.Text:=FormatDateTime('yyyy', Now);
end;
procedure Tnov_kalk.BitBtn3Click(Sender: TObject);
begin
if (dblookupcombobox1.Text='') or (combobox1.text='')
or (combobox2.Text='')
then showMessage('Не все поля заполнены!')
else
begin
Form1.kalk_Set.Active:=false;
Form1.kalk_Set.SelectSQL.Clear;
Form1.kalk_Set.SelectSQL.Add('select * from kalkul where kod_izd=:param_izd and mes=:param_mes and god=:param_god');
Form1.kalk_Set.ParamByName('param_izd').Value:=dbLookupcombobox1.KeyValue;
Form1.kalk_Set.ParamByName('param_mes').Value:=combobox1.Text;
Form1.kalk_Set.ParamByName('param_god').Value:=strtoint(combobox2.Text);
Form1.kalk_Set.Active:=true;
if Form1.kalk_Set.RecordCount=0 then
showmessage('Калькуляция на этот период по данному изделию не составлена')
else
begin
otch_kalk.QuickRep1.Preview;
nov_kalk.Close;
end;
end;
end;
end.
unit Unit12;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls, Buttons, DB, DBCtrls;
type
Tnov_kalk = class(TForm)
GroupBox2: TGroupBox;
DBLookupComboBox1: TDBLookupComboBox;
BitBtn2: TBitBtn;
GroupBox1: TGroupBox;
ComboBox1: TComboBox;
ComboBox2: TComboBox;
GroupBox3: TGroupBox;
Label1: TLabel;
Label2: TLabel;
Edit1: TEdit;
Edit2: TEdit;
BitBtn3: TBitBtn;
Label3: TLabel;
Label4: TLabel;
BitBtn1: TBitBtn;
procedure BitBtn1Click(Sender: TObject);
procedure BitBtn2Click(Sender: TObject);
procedure FormActivate(Sender: TObject);
procedure BitBtn3Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
nov_kalk: Tnov_kalk;
implementation
uses Unit1, Unit10, Unit11, Unit2, Unit3, Unit4, Unit5, Unit6, Unit7, Unit8, Unit9, Unit13, Unit14, Unit15, Unit16, Unit17, Unit18, Unit19, Unit20, Unit21;
{$R *.dfm}
procedure Tnov_kalk.BitBtn1Click(Sender: TObject);
var
s_NDS, s_bezNDS, s_m, s_zp, s_ten, s_en, s_tzr, s_ozp, s_strah, s_nesch, s_proizv, s_pr_s, s_kr, s_ohr, s_pol_s, s_p, s_op_c, s_d_op_c, s_zat: double;
i, n, s: integer;
x, y, m: double;
begin
if (dblookupcombobox1.Text='') or (combobox1.text='')
or (combobox2.Text='') or (edit1.Text='') or (edit2.Text='')
then showMessage('Не все поля заполнены!')
else
begin
Form1.kalk_Set.Active:=false;
Form1.kalk_Set.SelectSQL.Clear;
Form1.kalk_Set.SelectSQL.Add('select * from kalkul where kod_izd=:param_izd and mes=:param_mes and god=:param_god');
Form1.kalk_Set.ParamByName('param_izd').Value:=dbLookupcombobox1.KeyValue;
Form1.kalk_Set.ParamByName('param_mes').Value:=combobox1.Text;
Form1.kalk_Set.ParamByName('param_god').Value:=strtoint(combobox2.Text);
Form1.kalk_Set.Active:=true;
Form1.kalk_Set.Last;
if Form1.kalk_Set.RecordCount<>0
then showmessage('Калькуляция по данному периода на данное изделие уже составлена')
else
begin
Form1.sostav_Set.Active:=false;
Form1.sostav_Set.SelectSQL.Clear;
Form1.sostav_Set.SelectSQL.Add('select * from sostav_izd where kod_izd=:param_izd and mes=:param_mes and god=:param_god');
Form1.sostav_Set.ParamByName('param_izd').Value:=dbLookupcombobox1.KeyValue;
Form1.sostav_Set.ParamByName('param_mes').Value:=combobox1.Text;
Form1.sostav_Set.ParamByName('param_god').Value:=strtoint(combobox2.Text);
Form1.sostav_Set.Active:=true;
if Form1.sostav_Set.RecordCount=0 then
begin
showmessage('На этот период расход материалов на данное изделие не составлен');
end
else
begin
Form1.norm_rasc_Set.Active:=false;
Form1.norm_rasc_Set.SelectSQL.Clear;
Form1.norm_rasc_Set.SelectSQL.Add('select * from norm_rascenki where kod_izd=:param_izd and mes=:param_mes and god=:param_god');
Form1.norm_rasc_Set.ParamByName('param_izd').Value:=dbLookupcombobox1.KeyValue;
Form1.norm_rasc_Set.ParamByName('param_mes').Value:=combobox1.Text;
Form1.norm_rasc_Set.ParamByName('param_god').Value:=strtoint(combobox2.Text);
Form1.norm_rasc_Set.Active:=true;
if Form1.norm_rasc_Set.RecordCount=0 then
begin
showmessage('На этот период нормы времени и расценки для данного изделия не введены');
end
else
begin
x:=0;
Form1.sostav_Set.Last;
Form1.sostav_Set.First;
for i:=0 to Form1.sostav_Set.RecordCount-1 do
begin
x:=x+strtofloat(Form1.sostav_Set.fieldbyName('sum').AsString);
Form1.sostav_Set.Next;
end;
x:=round(x);
y:=0;
Form1.norm_rasc_Set.Last;
Form1.norm_rasc_Set.First;
for i:=0 to Form1.norm_rasc_Set.RecordCount-1 do
begin
y:=y+Form1.norm_rasc_Set.fieldbyName('rascenka').Value;
Form1.norm_rasc_Set.Next;
end;
Form1.stat_Set.Last;
Form1.stat_Set.First;
for i:=0 to Form1.stat_Set.RecordCount-1 do
begin
Form1.kalk_Set.Insert;
Form1.kalk_Set.FieldByName('mes').Value:=combobox1.Text;
Form1.kalk_Set.FieldByName('god').Value:=strtoint(combobox2.Text);
Form1.kalk_Set.FieldByName('kod_izd').Value:=dblookupcombobox1.KeyValue;
Form1.kalk_Set.FieldByName('kod_stat').Value:=Form1.stat_Set.fieldbyname('kod_stat').Value;
Form1.kalk_Set.FieldByName('koef').Value:=Form1.stat_Set.fieldbyname('koef').Value;
Form1.stat_Set.Next;
Form1.kalk_Set.Post;
end;
Form1.kalk_Set.Active:=false;
Form1.kalk_Set.SelectSQL.Clear;
Form1.kalk_Set.SelectSQL.Add('select * from kalkul where kod_izd=:param_izd and mes=:param_mes and god=:param_god');
Form1.kalk_Set.ParamByName('param_izd').Value:=dbLookupcombobox1.KeyValue;
Form1.kalk_Set.ParamByName('param_mes').Value:=combobox1.Text;
Form1.kalk_Set.ParamByName('param_god').Value:=strtoint(combobox2.Text);
Form1.kalk_Set.Active:=true;
Form1.kalk_Set.Last;
Form1.kalk_Set.First;
for i:=0 to Form1.kalk_Set.RecordCount-1 do
begin
if Form1.kalk_Set.Locate('kod_stat','1',[loCaseInsensitive, loPartialKey])
then
begin
Form1.kalk_Set.Edit;
Form1.kalk_Set.FieldByName('summa').Value:=x;
s_m:=Form1.kalk_Set.FieldByName('summa').Value;
Form1.kalk_Set.Post;
end;
if Form1.kalk_Set.Locate('kod_stat','8',[loCaseInsensitive, loPartialKey])
then
begin
Form1.kalk_Set.Edit;
Form1.kalk_Set.FieldByName('summa').Value:=y;
s_ozp:=Form1.kalk_Set.FieldByName('summa').Value;
Form1.kalk_Set.Post;
end;
if Form1.kalk_Set.Locate('kod_stat','5',[loCaseInsensitive, loPartialKey])
then
begin
Form1.kalk_Set.Edit;
Form1.kalk_Set.FieldByName('summa').Value:=strtofloat(edit1.Text);
s_ten:=Form1.kalk_Set.FieldByName('summa').Value;
Form1.kalk_Set.Post;
end;
if Form1.kalk_Set.Locate('kod_stat','6',[loCaseInsensitive, loPartialKey])
then
begin
Form1.kalk_Set.Edit;
Form1.kalk_Set.FieldByName('summa').Value:=strtofloat(edit2.Text);
s_en:=Form1.kalk_Set.FieldByName('summa').Value;
Form1.kalk_Set.Post;
end;
if Form1.kalk_Set.Locate('kod_stat','2',[loCaseInsensitive, loPartialKey])
then
begin
Form1.kalk_Set.Edit;
Form1.kalk_Set.FieldByName('summa').Value:=round(s_m/100*strtofloat(Form1.kalk_Set.fieldbyname('koef').AsString));
s_tzr:=Form1.kalk_Set.FieldByName('summa').Value;
Form1.kalk_Set.Post;
end;
if Form1.kalk_Set.Locate('kod_stat','7',[loCaseInsensitive, loPartialKey])
then
begin
Form1.kalk_Set.Edit;
Form1.kalk_Set.FieldByName('summa').Value:=round(s_ozp*strtofloat(Form1.kalk_Set.fieldbyname('koef').AsString));
s_zp:=Form1.kalk_Set.FieldByName('summa').Value;
Form1.kalk_Set.Post;
end;
if Form1.kalk_Set.Locate('kod_stat','9',[loCaseInsensitive, loPartialKey])
then
begin
Form1.kalk_Set.Edit;
Form1.kalk_Set.FieldByName('summa').Value:=round(s_zp/100*strtofloat(Form1.kalk_Set.fieldbyname('koef').AsString));
s_strah:=Form1.kalk_Set.FieldByName('summa').Value;
Form1.kalk_Set.Post;
end;
if Form1.kalk_Set.Locate('kod_stat','11',[loCaseInsensitive, loPartialKey])
then
begin
Form1.kalk_Set.Edit;
Form1.kalk_Set.FieldByName('summa').Value:=round(s_zp/100*strtofloat(Form1.kalk_Set.fieldbyname('koef').AsString));
s_nesch:=Form1.kalk_Set.FieldByName('summa').Value;
Form1.kalk_Set.Post;
end;
if Form1.kalk_Set.Locate('kod_stat','12',[loCaseInsensitive, loPartialKey])
then
begin
Form1.kalk_Set.Edit;
Form1.kalk_Set.FieldByName('summa').Value:=round(s_zp/100*strtofloat(Form1.kalk_Set.fieldbyname('koef').AsString));
s_proizv:=Form1.kalk_Set.FieldByName('summa').Value;
Form1.kalk_Set.Post;
end;
if Form1.kalk_Set.Locate('kod_stat','13',[loCaseInsensitive, loPartialKey])
then
begin
Form1.kalk_Set.Edit;
Form1.kalk_Set.FieldByName('summa').Value:=s_m+s_tzr+s_ten+s_en+s_zp+s_strah+s_nesch+s_proizv;
s_pr_s:=Form1.kalk_Set.FieldByName('summa').Value;
Form1.kalk_Set.Post;
end;
if Form1.kalk_Set.Locate('kod_stat','14',[loCaseInsensitive, loPartialKey])
then
begin
Form1.kalk_Set.Edit;
Form1.kalk_Set.FieldByName('summa').Value:=round(s_pr_s/100*strtofloat(Form1.kalk_Set.fieldbyname('koef').AsString));
s_kr:=Form1.kalk_Set.FieldByName('summa').Value;
Form1.kalk_Set.Post;
end;
if Form1.kalk_Set.Locate('kod_stat','15',[loCaseInsensitive, loPartialKey])
then
begin
Form1.kalk_Set.Edit;
Form1.kalk_Set.FieldByName('summa').Value:=round(s_pr_s/100*strtofloat(Form1.kalk_Set.fieldbyname('koef').AsString));
s_ohr:=Form1.kalk_Set.FieldByName('summa').Value;
Form1.kalk_Set.Post;
end;
if Form1.kalk_Set.Locate('kod_stat','16',[loCaseInsensitive, loPartialKey])
then
begin
Form1.kalk_Set.Edit;
Form1.kalk_Set.FieldByName('summa').Value:=s_pr_s+s_kr+s_ohr;
s_pol_s:=Form1.kalk_Set.FieldByName('summa').Value;
Form1.kalk_Set.Post;
end;
if Form1.kalk_Set.Locate('kod_stat','17',[loCaseInsensitive, loPartialKey])
then
begin
Form1.kalk_Set.Edit;
Form1.kalk_Set.FieldByName('summa').Value:=round(s_pol_s/100*strtofloat(Form1.kalk_Set.fieldbyname('koef').AsString));
s_p:=Form1.kalk_Set.FieldByName('summa').Value;
Form1.kalk_Set.Post;
end;
if Form1.kalk_Set.Locate('kod_stat','18',[loCaseInsensitive, loPartialKey])
then
begin
Form1.kalk_Set.Edit;
Form1.kalk_Set.FieldByName('summa').Value:=s_pol_s+s_p;
s_op_c:=Form1.kalk_Set.FieldByName('summa').Value;
Form1.kalk_Set.Post;
end;
if Form1.kalk_Set.Locate('kod_stat','20',[loCaseInsensitive, loPartialKey])
then
begin
Form1.kalk_Set.Edit;
m:=s_op_c;
n:=Trunc(m);
s:=n mod 100;
if s<50 then s_d_op_c:=n-s else s_d_op_c:=n+(100-s);
Form1.kalk_Set.FieldByName('summa').Value:=s_d_op_c;
Form1.kalk_Set.Post;
end;
if Form1.kalk_Set.Locate('kod_stat','21',[loCaseInsensitive, loPartialKey])
then
begin
Form1.kalk_Set.Edit;
Form1.kalk_Set.FieldByName('summa').Value:=s_pol_s;
s_zat:=Form1.kalk_Set.FieldByName('summa').Value;
Form1.kalk_Set.Post;
end;
if Form1.kalk_Set.Locate('kod_stat','22',[loCaseInsensitive, loPartialKey])
then
begin
Form1.kalk_Set.Edit;
Form1.kalk_Set.FieldByName('summa').Value:=s_d_op_c;
s_bezNDS:=Form1.kalk_Set.FieldByName('summa').Value;
Form1.kalk_Set.Post;
end;
if Form1.kalk_Set.Locate('kod_stat','23',[loCaseInsensitive, loPartialKey])
then
begin
Form1.kalk_Set.Edit;
Form1.kalk_Set.FieldByName('summa').Value:=round(s_bezNDS/100*strtofloat(Form1.kalk_Set.fieldbyname('koef').AsString));
s_NDS:=Form1.kalk_Set.FieldByName('summa').Value;
Form1.kalk_Set.Post;
end;
if Form1.kalk_Set.Locate('kod_stat','24',[loCaseInsensitive, loPartialKey])
then
begin
Form1.kalk_Set.Edit;
Form1.kalk_Set.FieldByName('summa').Value:=s_bezNDS+s_NDS;
Form1.kalk_Set.Post;
end;
end;
kalk.Label3.Caption:=combobox1.Text;
kalk.Label4.Caption:=combobox2.Text;
kalk.Label5.Caption:=dblookupcombobox1.Text;
kalk.Show;
end;
close;
end;
end;
end;
end;
procedure Tnov_kalk.BitBtn2Click(Sender: TObject);
begin
if (dblookupcombobox1.Text='') or (combobox1.text='')
or (combobox2.Text='')
then showMessage('Не все поля заполнены!')
else
begin
Form1.kalk_Set.Active:=false;
Form1.kalk_Set.SelectSQL.Clear;
Form1.kalk_Set.SelectSQL.Add('select * from kalkul where kod_izd=:param_izd and mes=:param_mes and god=:param_god');
Form1.kalk_Set.ParamByName('param_izd').Value:=dbLookupcombobox1.KeyValue;
Form1.kalk_Set.ParamByName('param_mes').Value:=combobox1.Text;
Form1.kalk_Set.ParamByName('param_god').Value:=strtoint(combobox2.Text);
Form1.kalk_Set.Active:=true;
if Form1.kalk_Set.RecordCount=0 then
showmessage('Калькуляция по данному изделию на данный период не составлена')
else
begin
kalk.Label3.Caption:=combobox1.Text;
kalk.Label4.Caption:=combobox2.Text;
kalk.Label5.Caption:=dblookupcombobox1.Text;
kalk.Show;
nov_kalk.Close;
end;
end;
end;
procedure Tnov_kalk.FormActivate(Sender: TObject);
begin
combobox1.Text:=FormatDateTime('mmmm', Now);
combobox2.Text:=FormatDateTime('yyyy', Now);
end;
procedure Tnov_kalk.BitBtn3Click(Sender: TObject);
begin
if (dblookupcombobox1.Text='') or (combobox1.text='')
or (combobox2.Text='')
then showMessage('Не все поля заполнены!')
else
begin
Form1.kalk_Set.Active:=false;
Form1.kalk_Set.SelectSQL.Clear;
Form1.kalk_Set.SelectSQL.Add('select * from kalkul where kod_izd=:param_izd and mes=:param_mes and god=:param_god');
Form1.kalk_Set.ParamByName('param_izd').Value:=dbLookupcombobox1.KeyValue;
Form1.kalk_Set.ParamByName('param_mes').Value:=combobox1.Text;
Form1.kalk_Set.ParamByName('param_god').Value:=strtoint(combobox2.Text);
Form1.kalk_Set.Active:=true;
if Form1.kalk_Set.RecordCount=0 then
showmessage('Калькуляция по данному изделию на данный период не составлена')
else
begin
otch_kalk.QuickRep1.Preview;
nov_kalk.Close;
end;
end;
end;
end.
unit Unit13;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, QRCtrls, QuickRpt, ExtCtrls;
type
Totch_kalk = class(TForm)
QuickRep1: TQuickRep;
ColumnHeaderBand1: TQRBand;
DetailBand1: TQRBand;
PageFooterBand1: TQRBand;
PageHeaderBand1: TQRBand;
SummaryBand1: TQRBand;
TitleBand1: TQRBand;
QRLabel1: TQRLabel;
QRLabel2: TQRLabel;
QRLabel3: TQRLabel;
QRLabel4: TQRLabel;
QRDBText1: TQRDBText;
QRDBText2: TQRDBText;
QRShape1: TQRShape;
QRShape2: TQRShape;
QRShape3: TQRShape;
QRShape4: TQRShape;
QRLabel5: TQRLabel;
QRLabel6: TQRLabel;
QRLabel8: TQRLabel;
QRLabel9: TQRLabel;
QRExpr1: TQRExpr;
QRShape6: TQRShape;
QRDBText3: TQRDBText;
QRShape7: TQRShape;
QRDBText4: TQRDBText;
QRShape8: TQRShape;
QRDBText5: TQRDBText;
QRShape5: TQRShape;
QRShape9: TQRShape;
QRLabel7: TQRLabel;
QRShape10: TQRShape;
QRExpr2: TQRExpr;
QRLabel10: TQRLabel;
QRLabel11: TQRLabel;
QRDBText6: TQRDBText;
QRDBText7: TQRDBText;
QRLabel12: TQRLabel;
private
{ Private declarations }
public
{ Public declarations }
end;
var
otch_kalk: Totch_kalk;
implementation
uses Unit1, Unit10, Unit11, Unit12, Unit2, Unit3, Unit4, Unit5, Unit6, Unit7, Unit8, Unit9;
{$R *.dfm}
end.
unit Unit14;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, QRCtrls, QuickRpt, ExtCtrls, IBCustomDataSet, DB, StdCtrls;
type
Totch_sostav = class(TForm)
QuickRep1: TQuickRep;
ColumnHeaderBand1: TQRBand;
DetailBand1: TQRBand;
PageFooterBand1: TQRBand;
PageHeaderBand1: TQRBand;
SummaryBand1: TQRBand;
TitleBand1: TQRBand;
QRLabel1: TQRLabel;
QRLabel2: TQRLabel;
QRExpr1: TQRExpr;
QRLabel3: TQRLabel;
QRDBText1: TQRDBText;
QRDBText2: TQRDBText;
QRLabel4: TQRLabel;
QRLabel5: TQRLabel;
QRShape1: TQRShape;
QRShape2: TQRShape;
QRShape3: TQRShape;
QRShape4: TQRShape;
QRShape5: TQRShape;
QRLabel6: TQRLabel;
QRLabel7: TQRLabel;
QRLabel8: TQRLabel;
QRLabel10: TQRLabel;
QRLabel12: TQRLabel;
QRLabel13: TQRLabel;
QRDBText3: TQRDBText;
QRLabel14: TQRLabel;
QRDBText4: TQRDBText;
QRLabel15: TQRLabel;
QRDBText5: TQRDBText;
QRDBText6: TQRDBText;
QRDBText7: TQRDBText;
QRDBText8: TQRDBText;
QRDBText9: TQRDBText;
QRDBText10: TQRDBText;
QRLabel11: TQRLabel;
QRLabel9: TQRLabel;
QRLabel16: TQRLabel;
QRLabel17: TQRLabel;
QRLabel18: TQRLabel;
QRExpr2: TQRExpr;
private
{ Private declarations }
public
{ Public declarations }
end;
var
otch_sostav: Totch_sostav;
implementation
uses Unit1, Unit10, Unit11, Unit12, Unit13, Unit2, Unit3, Unit4, Unit5, Unit6, Unit7, Unit8, Unit9, Unit15;
{$R *.dfm}
end.
unit Unit15;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, QRCtrls, QuickRpt, ExtCtrls;
type
Totch_norm_rasc = class(TForm)
QuickRep1: TQuickRep;
ColumnHeaderBand1: TQRBand;
QRShape1: TQRShape;
QRShape4: TQRShape;
QRShape5: TQRShape;
QRLabel10: TQRLabel;
QRLabel12: TQRLabel;
QRLabel13: TQRLabel;
QRDBText3: TQRDBText;
QRLabel14: TQRLabel;
QRDBText4: TQRDBText;
QRLabel15: TQRLabel;
QRDBText5: TQRDBText;
DetailBand1: TQRBand;
QRDBText6: TQRDBText;
QRDBText9: TQRDBText;
QRDBText10: TQRDBText;
PageFooterBand1: TQRBand;
QRLabel16: TQRLabel;
QRLabel17: TQRLabel;
PageHeaderBand1: TQRBand;
QRLabel1: TQRLabel;
QRLabel2: TQRLabel;
QRExpr1: TQRExpr;
SummaryBand1: TQRBand;
QRLabel18: TQRLabel;
TitleBand1: TQRBand;
QRLabel3: TQRLabel;
QRDBText1: TQRDBText;
QRDBText2: TQRDBText;
QRLabel4: TQRLabel;
QRExpr2: TQRExpr;
QRExpr3: TQRExpr;
QRLabel5: TQRLabel;
private
{ Private declarations }
public
{ Public declarations }
end;
var
otch_norm_rasc: Totch_norm_rasc;
implementation
uses Unit1, Unit10, Unit11, Unit12, Unit13, Unit14, Unit2, Unit3, Unit4, Unit5, Unit6, Unit7, Unit8, Unit9;
{$R *.dfm}
end.
unit Unit16;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, QRCtrls, QuickRpt, ExtCtrls;
type
Totch_izd = class(TForm)
QuickRep1: TQuickRep;
ColumnHeaderBand1: TQRBand;
DetailBand1: TQRBand;
PageFooterBand1: TQRBand;
PageHeaderBand1: TQRBand;
SummaryBand1: TQRBand;
TitleBand1: TQRBand;
QRShape1: TQRShape;
QRShape2: TQRShape;
QRShape3: TQRShape;
QRShape4: TQRShape;
QRLabel3: TQRLabel;
QRLabel4: TQRLabel;
QRLabel5: TQRLabel;
QRLabel6: TQRLabel;
QRLabel1: TQRLabel;
QRLabel2: TQRLabel;
QRLabel7: TQRLabel;
QRExpr2: TQRExpr;
QRShape6: TQRShape;
QRShape7: TQRShape;
QRShape8: TQRShape;
QRExpr1: TQRExpr;
QRDBText3: TQRDBText;
QRDBText4: TQRDBText;
QRDBText5: TQRDBText;
private
{ Private declarations }
public
{ Public declarations }
end;
var
otch_izd: Totch_izd;
implementation
uses Unit1, Unit10, Unit11, Unit12, Unit13, Unit14, Unit15, Unit2, Unit3, Unit4, Unit5, Unit6, Unit7, Unit8, Unit9;
{$R *.dfm}
end.
unit Unit17;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls, Buttons, QRCtrls, QuickRpt, ExtCtrls;
type
Totch_mat = class(TForm)
QuickRep1: TQuickRep;
ColumnHeaderBand1: TQRBand;
QRShape1: TQRShape;
QRShape3: TQRShape;
QRShape4: TQRShape;
QRLabel3: TQRLabel;
QRLabel4: TQRLabel;
QRLabel6: TQRLabel;
DetailBand1: TQRBand;
PageFooterBand1: TQRBand;
PageHeaderBand1: TQRBand;
QRLabel2: TQRLabel;
QRLabel7: TQRLabel;
QRExpr2: TQRExpr;
SummaryBand1: TQRBand;
TitleBand1: TQRBand;
QRLabel1: TQRLabel;
QRShape2: TQRShape;
QRShape5: TQRShape;
QRShape6: TQRShape;
QRExpr1: TQRExpr;
QRDBText3: TQRDBText;
QRDBText5: TQRDBText;
private
{ Private declarations }
public
{ Public declarations }
end;
var
otch_mat: Totch_mat;
implementation
uses Unit1, Unit10, Unit11, Unit12, Unit13, Unit14, Unit15, Unit16, Unit2, Unit3, Unit4, Unit5, Unit6, Unit7, Unit8, Unit9;
{$R *.dfm}
end.
unit Unit18;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, QRCtrls, QuickRpt, ExtCtrls;
type
Totch_rab = class(TForm)
QuickRep1: TQuickRep;
ColumnHeaderBand1: TQRBand;
QRShape1: TQRShape;
QRShape3: TQRShape;
QRLabel3: TQRLabel;
DetailBand1: TQRBand;
PageFooterBand1: TQRBand;
PageHeaderBand1: TQRBand;
QRLabel2: TQRLabel;
QRLabel7: TQRLabel;
QRExpr2: TQRExpr;
SummaryBand1: TQRBand;
TitleBand1: TQRBand;
QRLabel1: TQRLabel;
QRShape2: TQRShape;
QRExpr1: TQRExpr;
QRDBText3: TQRDBText;
QRShape4: TQRShape;
QRLabel4: TQRLabel;
private
{ Private declarations }
public
{ Public declarations }
end;
var
otch_rab: Totch_rab;
implementation
uses Unit1, Unit10, Unit11, Unit12, Unit13, Unit14, Unit15, Unit16, Unit17, Unit2, Unit3, Unit4, Unit5, Unit6, Unit7, Unit8, Unit9;
{$R *.dfm}
end.
unit Unit19;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls, Buttons;
type
To_prog = class(TForm)
Label1: TLabel;
Label2: TLabel;
GroupBox1: TGroupBox;
Label3: TLabel;
Label4: TLabel;
BitBtn1: TBitBtn;
Label5: TLabel;
Label6: TLabel;
procedure BitBtn1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
o_prog: To_prog;
implementation
{$R *.dfm}
procedure To_prog.BitBtn1Click(Sender: TObject);
begin
close;
end;
end.
unit Unit20;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls, Buttons, ComCtrls;
type
Thelp = class(TForm)
RichEdit1: TRichEdit;
BitBtn1: TBitBtn;
procedure BitBtn1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
help: Thelp;
implementation
uses Unit1, Unit10, Unit11, Unit12, Unit13, Unit14, Unit15, Unit16, Unit17, Unit18, Unit19, Unit2, Unit3, Unit4, Unit5, Unit6, Unit7, Unit8, Unit9;
{$R *.dfm}
procedure Thelp.BitBtn1Click(Sender: TObject);
begin
close;
end;
end.
unit Unit21;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls, Buttons;
type
Tstyle = class(TForm)
BitBtn1: TBitBtn;
GroupBox1: TGroupBox;
ListBox1: TListBox;
procedure BitBtn1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
style: Tstyle;
implementation
uses Unit1, Unit10, Unit11, Unit12, Unit13, Unit14, Unit15, Unit16, Unit17, Unit18, Unit19, Unit2, Unit20, Unit3, Unit4, Unit5, Unit6, Unit7, Unit8, Unit9;
{$R *.dfm}
procedure Tstyle.BitBtn1Click(Sender: TObject);
begin
Form1.sSkinManager1.Active:=false;
Form1.sSkinManager1.SkinName:=listbox1.Items[listbox1.itemindex];
Form1.sSkinManager1.Active:=true;
end;
end. Размещено на www.allbest.ru
Подобные документы
Описание предметной области. Концептуальное проектирование базы данных. Разработка базы данных оптового склада. Требования, предъявляемые к аппаратному и программному обеспечению Borland Delphi 7.0 и MySQL. Работа с базой данных оптового склада.
курсовая работа [705,8 K], добавлен 18.06.2015Анализ предметной области с использованием моделей методологии ARIS и разработка ER-диаграммы. Описание входной и выходной информации для проектирования реляционной базы данных. Разработка управляющих запросов и связей между ними с помощью языка SQL.
курсовая работа [975,2 K], добавлен 30.01.2014Функциональное назначение и область применения программы "Локальный сетевой чат"; логическая структура, технические и программные средства. Требования к программе; характеристика, вызов и загрузка, входные и выходные данные, настройка, интерфейс.
дипломная работа [1,3 M], добавлен 18.10.2013Ведение базы данных кассы кинотеатра. Обоснование необходимости компьютерной обработки информации. Требования к программному, аппаратному обеспечению, графическому интерфейсу. Выбор, обоснование среды разработки. Модель предметной области. Этапы отладки.
дипломная работа [1,5 M], добавлен 09.09.2010Обследование предметной области. Проектирование реляционной базы данных: описание входной и выходной информации, перечень сущностей и атрибутов, создание модели, выбор ключей. Разработка и обоснование представлений для отображения результатов выборки.
курсовая работа [539,0 K], добавлен 12.12.2011Описание предметной области. Характеристика программных средств. Описание компонентов, интерфейс программы. Описание процедур и функций. Вызов и загрузка программы. Испытание методом белого и черного ящика на ошибки кода программного приложения.
курсовая работа [2,2 M], добавлен 26.04.2015Создание баз данных с использованием Database Desktop. Проведение автоматизации рабочего места кассира. Описание входной и выходной информации. Выбор среды реализации, состава и параметров технических средств. Проектирование интерфейса программы.
курсовая работа [1021,5 K], добавлен 22.01.2015Написание программы для работы со списком документов, разработка функционала. Требования к аппаратному и программному обеспечению. Описание интерфейса пользователя. Структура программы и описание данных. Процедура тестирования и его результаты.
курсовая работа [1,5 M], добавлен 26.08.2012Офисные программы, необходимые для автоматизации работы турфирмы. Описание входной и выходной информации, структуры базы данных. Аппаратное и программное средства для функционирования автоматизированной информационной системы, ее работоспособность.
курсовая работа [902,2 K], добавлен 02.05.2017Написание программы, которая позволяет пользователю играть в графическом режиме в игру "Тетрис". Разработка функционала с возможностью выбора скорости. Обзор требований к аппаратному и программному обеспечению. Интерфейс, описание данных и тестирование.
курсовая работа [506,3 K], добавлен 17.12.2014