unit Unit5;

interface

uses
  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  StdCtrls, Mask, DBCtrls, ExtCtrls, Buttons, Grids, DBGrids;

type
  TForm5 = class(TForm)
    Edit1: TEdit;
    Edit2: TEdit;
    Edit3: TEdit;
    Edit8: TEdit;
    Edit9: TEdit;
    Edit10: TEdit;
    Edit11: TEdit;
    Edit12: TEdit;
    Edit13: TEdit;
    Edit14: TEdit;
    Edit15: TEdit;
    Edit16: TEdit;
    Edit17: TEdit;
    Edit18: TEdit;
    Edit19: TEdit;
    Edit20: TEdit;
    Edit21: TEdit;
    Edit22: TEdit;
    Edit23: TEdit;
    Edit24: TEdit;
    Edit25: TEdit;
    Edit26: TEdit;
    Edit27: TEdit;
    Label1: TLabel;
    Label2: TLabel;
    Label3: TLabel;
    Label4: TLabel;
    Label5: TLabel;
    Label6: TLabel;
    Label8: TLabel;
    Label9: TLabel;
    Label10: TLabel;
    Label11: TLabel;
    Label12: TLabel;
    Label13: TLabel;
    Label14: TLabel;
    Label15: TLabel;
    Label16: TLabel;
    Label17: TLabel;
    Label18: TLabel;
    Label19: TLabel;
    Label20: TLabel;
    Label21: TLabel;
    Label22: TLabel;
    Label23: TLabel;
    Label24: TLabel;
    Label25: TLabel;
    Label26: TLabel;
    Label27: TLabel;
    Label32: TLabel;
    Label28: TLabel;
    Edit4: TEdit;
    Edit5: TEdit;
    Edit6: TEdit;
    Edit7: TEdit;
    Label29: TLabel;
    Label30: TLabel;
    Label31: TLabel;
    Label33: TLabel;
    Label35: TLabel;
    Label36: TLabel;
    Label37: TLabel;
    Label38: TLabel;
    Label39: TLabel;
    Label40: TLabel;
    Label41: TLabel;
    Label42: TLabel;
    Label43: TLabel;
    Label44: TLabel;
    Panel1: TPanel;
    Bevel1: TBevel;
    BitBtn3: TBitBtn;
    BitBtn2: TBitBtn;
    BitBtn1: TBitBtn;
    BitBtn4: TBitBtn;
    Label45: TLabel;
    Label7: TLabel;
    Label34: TLabel;
    Label46: TLabel;
    Label47: TLabel;
    Label48: TLabel;
    Label49: TLabel;
    Label50: TLabel;
    Label51: TLabel;
    Label52: TLabel;
    Label53: TLabel;
    Label54: TLabel;
    Panel2: TPanel;
    Panel3: TPanel;
    Label55: TLabel;
    Label56: TLabel;
    Label57: TLabel;
    Label58: TLabel;
    Label59: TLabel;
    Label60: TLabel;
    Label61: TLabel;
    Label62: TLabel;
    Label63: TLabel;
    Label64: TLabel;
    procedure BitBtn2Click(Sender: TObject);
    procedure BitBtn3Click(Sender: TObject);
    procedure BitBtn4Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form5: TForm5;
  f1,f2,f3,f4,f5,f6,f7,f8,f9,f10,f11,f12,f13,f14,f15,f16,f17,f18,f19,f20,f21,f22,f23,f24,f25,f26,f27:string;
  s1,s2,s3,s4,s5,s6,s7,s8,s9,s10,s11,s12,s13,s14,s15,s16,s17,s18,s19,s20,s21,s22,s23,s24,s25,s26,s27:real;

  k1,k2,k3,k4,k5,k6,k7:string;
  i1,i2,i3,i4,i5,i6,i7:real;
  kode:integer;

  p1,p2,p3,p4,p5,p6,p7,p8,p9,p10,p11,p12,p13:string;
  z1,z2,z3,z4,z5,z6,z7,z8,z9,z10,z11,z12,z13:string;
  l1,l2,l3,l4,l5,l6,l7,l8,l9,l10,l11,l12,l13:real;
  code:integer;


implementation
uses Unit20, Unit3;
{$R *.DFM}

procedure TForm5.BitBtn2Click(Sender: TObject);
begin
close;
form20.show;
end;

procedure TForm5.BitBtn3Click(Sender: TObject);
begin
  with form5 do
  begin
edit1.ReadOnly:=false;
edit2.ReadOnly:=false;
edit3.ReadOnly:=false;
edit4.ReadOnly:=false;
edit5.ReadOnly:=false;
edit6.ReadOnly:=false;
edit7.ReadOnly:=false;
edit8.ReadOnly:=false;
edit9.ReadOnly:=false;
edit10.ReadOnly:=false;
edit11.ReadOnly:=false;
edit12.ReadOnly:=false;
edit13.ReadOnly:=false;
edit14.ReadOnly:=false;
edit15.ReadOnly:=false;
edit16.ReadOnly:=false;
edit17.ReadOnly:=false;
edit18.ReadOnly:=false;
edit19.ReadOnly:=false;
edit20.ReadOnly:=false;
edit21.ReadOnly:=false;
edit22.ReadOnly:=false;
edit23.ReadOnly:=false;
edit24.ReadOnly:=false;
edit26.ReadOnly:=false;
edit27.ReadOnly:=false;
    panel1.visible:=false;
    height:=465;
    width:=740;
    color:=clwhite;
    print;
    color:=clbtnface;
    panel1.visible:=true;
    width:=745;
    height:=515;
edit1.ReadOnly:=true;
edit2.ReadOnly:=true;
edit3.ReadOnly:=true;
edit4.ReadOnly:=true;
edit5.ReadOnly:=true;
edit6.ReadOnly:=true;
edit7.ReadOnly:=true;
edit8.ReadOnly:=true;
edit9.ReadOnly:=true;
edit10.ReadOnly:=true;
edit11.ReadOnly:=true;
edit12.ReadOnly:=true;
edit13.ReadOnly:=true;
edit14.ReadOnly:=true;
edit15.ReadOnly:=true;
edit16.ReadOnly:=true;
edit17.ReadOnly:=true;
edit18.ReadOnly:=true;
edit19.ReadOnly:=true;
edit20.ReadOnly:=true;
edit21.ReadOnly:=true;
edit22.ReadOnly:=true;
edit23.ReadOnly:=true;
edit24.ReadOnly:=true;
edit26.ReadOnly:=true;
edit27.ReadOnly:=true;

  end

end;

procedure TForm5.BitBtn4Click(Sender: TObject);
begin

 k1:=form20.edit1.text;
 k2:=form20.edit2.text;
 k3:=form20.edit3.text;
 k4:=form20.edit4.text;
 k5:=form20.edit5.text;
 k6:=form20.edit6.text;
 k7:=form20.edit7.text;
kode:=0;
 val(k1,i1,kode);
 val(k2,i2,kode);
 val(k3,i3,kode);
 val(k4,i4,kode);
 val(k5,i5,kode);
 val(k6,i6,kode);
 val(k7,i7,kode);

p1:=form3.edit1.text;
p2:=form3.edit2.text;
p3:=form3.edit3.text;
p4:=form3.edit4.text;
p5:=form3.edit5.text;
p6:=form3.edit6.text;
p7:=form3.edit7.text;
p8:=form3.edit8.text;
p9:=form3.edit9.text;
p10:=form3.edit10.text;
p11:=form3.edit11.text;
p12:=form3.edit12.text;
p13:=form3.edit13.text;

code:=0;
val(p1,l1,code);
val(p2,l2,code);
val(p3,l3,code);
val(p4,l4,code);
val(p5,l5,code);
val(p6,l6,code);
val(p7,l7,code);
val(p8,l8,code);
val(p9,l9,code);
val(p10,l10,code);
val(p11,l11,code);
val(p12,l12,code);
val(p13,l13,code);

s1:=i1;                      {Выручка}
str(s1:10:2,f1);
edit1.text:=f1;
s2:=i1*l1/100;                   {НДСп}
str(s2:10:2,f2);          {Прямые затраты}
edit2.text:=f2;
s3:=i1*i2/100;
str(s3:10:2,f3);
edit3.text:=f3;
s4:=s3*l1/100;
str(s4:10:2,f4);
edit4.text:=f4;
s5:=s2-s4;
str(s5:10:2,f5);
edit5.text:=f5;
s6:=s1-s2;
str(s6:10:2,f6);
edit6.text:=f6;
s7:=s6*l2/100;
str(s7:10:2,f7);
edit7.text:=f7;
s8:=s6*l3/100;
str(s8:10:2,f8);
edit8.text:=f8;
s9:=i3*i4;
str(s9:10:2,f9);
edit9.text:=f9;

s10:=s9*l4/100;
str(s10:10:2,f10);
edit10.text:=f10;
s11:=s9*l5/100;
str(s11:10:2,f11);
edit11.text:=f11;
s12:=s9*l6/100;
str(s12:10:2,f12);
edit12.text:=f12;
s13:=s9*l7/100;
str(s13:10:2,f13);
edit13.text:=f13;
s14:=s9*l8/100;
str(s14:10:2,f14);
edit14.text:=f14;
s15:=s9*l9/100;
str(s15:10:2,f15);
edit15.text:=f15;
s16:=l10*i5/100/12;
str(s16:10:2,f16);
edit16.text:=f16;
s17:=i6;    {Хозяйственные расходы}
str(s17:10:2,f17);
edit17.text:=f17;
s18:=i5*l11/100/12;
str(s18:10:2,f18);
edit18.text:=f18;
s19:=i7;
str(s19:10:2,f19);
edit19.text:=f19;
s20:=s19*l12/100;
str(s20:10:2,f20);
edit20.text:=f20;
s21:=s3-s4+s9+s10+s11+s12+s13+s16+s17+s19+s7;
str(s21:10:2,f21);
edit21.text:=f21;
s22:=s6-s21-s8-s14-s18-s20;
str(s22:10:2,f22);
edit22.text:=f22;
s23:=s22*l13/100;
str(s23:10:2,f23);
edit23.text:=f23;
s24:=s22-s23;
str(s24:10:2,f24);
edit24.text:=f24;
s25:=s23+s20+s18+s15+s14+s13+s12+s11+s10+s8+s7+s4+s2;
str(s25:10:2,f25);
edit25.text:=f25;
s26:=s25/s1*100;
str(s26:10:2,f26);
edit26.text:=f26;
s27:=s24/s1*100;
str(s27:10:2,f27);
edit27.text:=f27;

end;


end.
