Commits

aminiy  committed 13bc584

+ Печать договора
+ Перед просмотр договора
+ Перешол на IBX

  • Participants
  • Parent commits 9fe46e2

Comments (0)

Files changed (8)

 src/lib/*
 src/*.exe
 src/*.dbg
+fbemb/*.dbg
+fbemb/*.FDB
+docs/rep/*

File db/model.grc

Binary file modified.

File fbemb/reps/CONTACRT.lrf

     <KeyWords Value=""/>
     <Comments Value=""/>
     <ReportCreateDate Value="2013-06-05 16:30:02"/>
-    <ReportLastChange Value="2013-06-05 17:24:19"/>
+    <ReportLastChange Value="2013-06-06 10:20:17"/>
     <ReportVersionBuild Value=""/>
     <ReportVersionMajor Value=""/>
     <ReportVersionMinor Value=""/>
     <Pages>
       <PrintToDefault Value="False"/>
       <DoublePass Value="False"/>
-      <SelectedPrinter Value="Canon LBP2900"/>
+      <SelectedPrinter Value="Default printer"/>
       <PageCount Value="2"/>
       <Page1>
         <Name Value="Page1"/>
         <ClassName Value="TfrPageReport"/>
         <Visible Value="True"/>
-        <Width Value="595"/>
-        <Height Value="842"/>
+        <Width Value="2100"/>
+        <Height Value="2970"/>
         <Script Value=""/>
         <PgSize Value="9"/>
         <Margins>
           <Data>
             <Format Value="556"/>
             <FormatStr Value=""/>
-            <Memo Value="ДОГОВОР №[SQLRCONTRACT.&quot;NUMBER&quot;]&#xD;&#xA;Перевозки груза&#xD;&#xA;"/>
+            <Memo Value="ДОГОВОР №[RQCONTRACT.&quot;NUMBER&quot;]&#xD;&#xA;Перевозки груза&#xD;&#xA;"/>
             <Script Value=""/>
           </Data>
           <Tag Value=""/>
           <Data>
             <Format Value="556"/>
             <FormatStr Value=""/>
-            <Memo Value="[SQLRCONTRACT.&quot;V_DATE&quot; #dd mmmm yyyy] г.&#xD;&#xA;"/>
+            <Memo Value="[RQCONTRACT.&quot;V_DATE&quot; #ddd mmmm yyyy] г.&#xD;&#xA;"/>
             <Script Value=""/>
           </Data>
           <Tag Value=""/>
           <Data>
             <Format Value="556"/>
             <FormatStr Value=""/>
-            <Memo Value="           ООО «Asia Trans Global Logistics» (далее - Перевозчик), в лице директора Иркабаева У.Р., действующего на основании Устава с одной стороны,  и [SQLRCONTRACT.&quot;NAME&quot;] (далее -Заказчик) в лице [SQLRCONTRACT.&quot;DIRECTOR&quot;].,  действующего на основании [SQLRCONTRACT.&quot;BASIS&quot;] с другой стороны, совместно именуемые “Стороны”, а по отдельности “Сторона”, заключили настоящий договор о нижеследующем:&#xD;&#xA;"/>
+            <Memo Value="           ООО «Asia Trans Global Logistics» (далее - Перевозчик), в лице директора Иркабаева У.Р., действующего на основании Устава с одной стороны,  и [RQCONTRACT.&quot;NAME&quot;] (далее -Заказчик) в лице [RQCONTRACT.&quot;DIRECTOR&quot;].,  действующего на основании [RQCONTRACT.&quot;BASIS&quot;] с другой стороны, совместно именуемые “Стороны”, а по отдельности “Сторона”, заключили настоящий договор о нижеследующем:&#xD;&#xA;"/>
             <Script Value=""/>
           </Data>
           <Tag Value=""/>
         <Name Value="Page2"/>
         <ClassName Value="TfrPageReport"/>
         <Visible Value="True"/>
-        <Width Value="595"/>
-        <Height Value="842"/>
+        <Width Value="2100"/>
+        <Height Value="2970"/>
         <Script Value=""/>
         <PgSize Value="9"/>
         <Margins>
           <Data>
             <Format Value="556"/>
             <FormatStr Value=""/>
-            <Memo Value="9.1. Все дополнения и изменения к настоящему договору действительны лишь в том случае, если они совершены в письменной форме и подписаны уполномоченными на то лицами.&#xD;&#xA;9.2. Отношения, возникающие при заключении, исполнении, изменении и расторжении настоящего договора и не оговоренные в нем регулируются Гражданским кодексом Республики Узбекистан и Законом Республики Узбекистан «О договорно-правовой базе деятельности хозяйствующих субъектов».&#xD;&#xA;9.3. Настоящий договор вступает в силу с момента его подписания, и действует до [SQLRCONTRACT.&quot;D_DATE&quot;] года &#xD;&#xA;9.4. Настоящий Договор составлен в 2-х оригинальных экземплярах на русском языке - по 1 (одному) для каждой из Сторон.&#xD;&#xA;"/>
+            <Memo Value="9.1. Все дополнения и изменения к настоящему договору действительны лишь в том случае, если они совершены в письменной форме и подписаны уполномоченными на то лицами.&#xD;&#xA;9.2. Отношения, возникающие при заключении, исполнении, изменении и расторжении настоящего договора и не оговоренные в нем регулируются Гражданским кодексом Республики Узбекистан и Законом Республики Узбекистан «О договорно-правовой базе деятельности хозяйствующих субъектов».&#xD;&#xA;9.3. Настоящий договор вступает в силу с момента его подписания, и действует до [RQCONTRACT.&quot;D_DATE&quot;] года &#xD;&#xA;9.4. Настоящий Договор составлен в 2-х оригинальных экземплярах на русском языке - по 1 (одному) для каждой из Сторон.&#xD;&#xA;"/>
             <Script Value=""/>
           </Data>
           <Tag Value=""/>
           <Data>
             <Format Value="556"/>
             <FormatStr Value=""/>
-            <Memo Value="[SQLRCONTRACT.&quot;NAME&quot;]&#xD;&#xA;[SQLRCONTRACT.&quot;ADDRESS&quot;]&#xD;&#xA;Р/с:[SQLRCONTRACT.&quot;ACCOUNT&quot;]&#xD;&#xA;МФО:[SQLRCONTRACT.&quot;MFO&quot;]&#xD;&#xA;[SQLRCONTRACT.&quot;BANK&quot;]&#xD;&#xA;ИНН:[SQLRCONTRACT.&quot;INN&quot;]&#xD;&#xA;ОКОНХ:[SQLRCONTRACT.&quot;OKONX&quot;]&#xD;&#xA;Тел(факс):[SQLRCONTRACT.&quot;FAX&quot;]&#xD;&#xA;Тел(сот):[SQLRCONTRACT.&quot;TEL&quot;]&#xD;&#xA;e-mail:[SQLRCONTRACT.&quot;E_MAIL&quot;]&#xD;&#xA;"/>
+            <Memo Value="[RQCONTRACT.&quot;NAME&quot;]&#xD;&#xA;[RQCONTRACT.&quot;ADDRESS&quot;]&#xD;&#xA;Р/с:[RQCONTRACT.&quot;ACCOUNT&quot;]&#xD;&#xA;МФО:[RQCONTRACT.&quot;MFO&quot;]&#xD;&#xA;[RQCONTRACT.&quot;BANK&quot;]&#xD;&#xA;ИНН:[RQCONTRACT.&quot;INN&quot;]&#xD;&#xA;ОКОНХ:[RQCONTRACT.&quot;OKONX&quot;]&#xD;&#xA;Тел(факс):[RQCONTRACT.&quot;FAX&quot;]&#xD;&#xA;Тел(сот):[RQCONTRACT.&quot;TEL&quot;]&#xD;&#xA;e-mail:[RQCONTRACT.&quot;E_MAIL&quot;]&#xD;&#xA;"/>
             <Script Value=""/>
           </Data>
           <Tag Value=""/>

File src/docbase.lpi

     <General>
       <SessionStorage Value="InProjectDir"/>
       <MainUnit Value="0"/>
-      <Title Value="docbase"/>
+      <Title Value="База бланков"/>
       <ResourceType Value="res"/>
       <UseXPManifest Value="True"/>
       <Icon Value="0"/>

File src/docbase.lpr

 {$R *.res}
 
 begin
+    Application.Title:='База бланков';
   RequireDerivedFormResource := True;
   Application.Initialize;
   Application.CreateForm(TForm1, Form1);

File src/docbase.lps

         <UnitName Value="docbase"/>
         <WindowIndex Value="0"/>
         <TopLine Value="1"/>
-        <CursorPos X="1" Y="19"/>
-        <UsageCount Value="65"/>
+        <CursorPos X="1" Y="20"/>
+        <UsageCount Value="69"/>
       </Unit0>
       <Unit1>
         <Filename Value="unit1.pas"/>
         <IsVisibleTab Value="True"/>
         <EditorIndex Value="0"/>
         <WindowIndex Value="0"/>
-        <TopLine Value="142"/>
-        <CursorPos X="29" Y="161"/>
-        <UsageCount Value="65"/>
+        <TopLine Value="172"/>
+        <CursorPos X="21" Y="184"/>
+        <UsageCount Value="69"/>
         <Loaded Value="True"/>
         <LoadedDesigner Value="True"/>
       </Unit1>
         <WindowIndex Value="0"/>
         <TopLine Value="349"/>
         <CursorPos X="1" Y="364"/>
-        <UsageCount Value="11"/>
+        <UsageCount Value="12"/>
       </Unit7>
       <Unit8>
         <Filename Value="C:\lazarus\components\lazreport\source\lr_class.pas"/>
         <UnitName Value="LR_Class"/>
-        <EditorIndex Value="2"/>
         <WindowIndex Value="0"/>
         <TopLine Value="8976"/>
         <CursorPos X="1" Y="8982"/>
-        <UsageCount Value="11"/>
-        <Loaded Value="True"/>
+        <UsageCount Value="13"/>
       </Unit8>
       <Unit9>
         <Filename Value="C:\lazarus\fpc\2.6.2\source\packages\fcl-db\src\base\db.pas"/>
       <Unit13>
         <Filename Value="C:\lazarus\components\lazreport\source\lr_desgn.pas"/>
         <UnitName Value="LR_Desgn"/>
-        <EditorIndex Value="1"/>
         <WindowIndex Value="0"/>
         <TopLine Value="5771"/>
         <CursorPos X="1" Y="5786"/>
-        <UsageCount Value="11"/>
-        <Loaded Value="True"/>
+        <UsageCount Value="13"/>
       </Unit13>
     </Units>
     <General>
       <ActiveWindowIndexAtStart Value="0"/>
     </General>
-    <JumpHistory Count="18" HistoryIndex="17">
+    <JumpHistory Count="29" HistoryIndex="28">
       <Position1>
         <Filename Value="unit1.pas"/>
-        <Caret Line="45" Column="28" TopLine="24"/>
+        <Caret Line="163" Column="7" TopLine="138"/>
       </Position1>
       <Position2>
         <Filename Value="unit1.pas"/>
-        <Caret Line="44" Column="28" TopLine="24"/>
+        <Caret Line="164" Column="7" TopLine="139"/>
       </Position2>
       <Position3>
         <Filename Value="unit1.pas"/>
-        <Caret Line="43" Column="32" TopLine="24"/>
+        <Caret Line="165" Column="7" TopLine="140"/>
       </Position3>
       <Position4>
         <Filename Value="unit1.pas"/>
-        <Caret Line="42" Column="26" TopLine="24"/>
+        <Caret Line="166" Column="7" TopLine="141"/>
       </Position4>
       <Position5>
         <Filename Value="unit1.pas"/>
-        <Caret Line="141" Column="7" TopLine="126"/>
+        <Caret Line="167" Column="7" TopLine="142"/>
       </Position5>
       <Position6>
         <Filename Value="unit1.pas"/>
-        <Caret Line="138" Column="70" TopLine="131"/>
+        <Caret Line="168" Column="7" TopLine="143"/>
       </Position6>
       <Position7>
         <Filename Value="unit1.pas"/>
-        <Caret Line="9" Column="3" TopLine="1"/>
+        <Caret Line="169" Column="7" TopLine="144"/>
       </Position7>
       <Position8>
         <Filename Value="unit1.pas"/>
-        <Caret Line="10" Column="38" TopLine="1"/>
+        <Caret Line="170" Column="7" TopLine="145"/>
       </Position8>
       <Position9>
         <Filename Value="unit1.pas"/>
-        <Caret Line="147" Column="6" TopLine="138"/>
+        <Caret Line="171" Column="7" TopLine="146"/>
       </Position9>
       <Position10>
         <Filename Value="unit1.pas"/>
-        <Caret Line="148" Column="6" TopLine="139"/>
+        <Caret Line="172" Column="7" TopLine="147"/>
       </Position10>
       <Position11>
         <Filename Value="unit1.pas"/>
-        <Caret Line="142" Column="24" TopLine="139"/>
+        <Caret Line="173" Column="7" TopLine="148"/>
       </Position11>
       <Position12>
         <Filename Value="unit1.pas"/>
-        <Caret Line="131" Column="1" TopLine="124"/>
+        <Caret Line="174" Column="7" TopLine="149"/>
       </Position12>
       <Position13>
         <Filename Value="unit1.pas"/>
-        <Caret Line="157" Column="20" TopLine="141"/>
+        <Caret Line="175" Column="7" TopLine="150"/>
       </Position13>
       <Position14>
         <Filename Value="unit1.pas"/>
-        <Caret Line="160" Column="29" TopLine="141"/>
+        <Caret Line="176" Column="7" TopLine="151"/>
       </Position14>
       <Position15>
         <Filename Value="unit1.pas"/>
-        <Caret Line="161" Column="29" TopLine="142"/>
+        <Caret Line="177" Column="7" TopLine="152"/>
       </Position15>
       <Position16>
         <Filename Value="unit1.pas"/>
-        <Caret Line="160" Column="29" TopLine="141"/>
+        <Caret Line="178" Column="7" TopLine="153"/>
       </Position16>
       <Position17>
         <Filename Value="unit1.pas"/>
-        <Caret Line="159" Column="29" TopLine="140"/>
+        <Caret Line="164" Column="32" TopLine="153"/>
       </Position17>
       <Position18>
         <Filename Value="unit1.pas"/>
-        <Caret Line="160" Column="29" TopLine="141"/>
+        <Caret Line="149" Column="6" TopLine="143"/>
       </Position18>
+      <Position19>
+        <Filename Value="unit1.pas"/>
+        <Caret Line="148" Column="39" TopLine="133"/>
+      </Position19>
+      <Position20>
+        <Filename Value="unit1.pas"/>
+        <Caret Line="149" Column="16" TopLine="134"/>
+      </Position20>
+      <Position21>
+        <Filename Value="unit1.pas"/>
+        <Caret Line="150" Column="16" TopLine="135"/>
+      </Position21>
+      <Position22>
+        <Filename Value="unit1.pas"/>
+        <Caret Line="149" Column="31" TopLine="143"/>
+      </Position22>
+      <Position23>
+        <Filename Value="unit1.pas"/>
+        <Caret Line="150" Column="150" TopLine="143"/>
+      </Position23>
+      <Position24>
+        <Filename Value="unit1.pas"/>
+        <Caret Line="152" Column="150" TopLine="145"/>
+      </Position24>
+      <Position25>
+        <Filename Value="unit1.pas"/>
+        <Caret Line="149" Column="15" TopLine="137"/>
+      </Position25>
+      <Position26>
+        <Filename Value="unit1.pas"/>
+        <Caret Line="167" Column="30" TopLine="162"/>
+      </Position26>
+      <Position27>
+        <Filename Value="unit1.pas"/>
+        <Caret Line="163" Column="38" TopLine="157"/>
+      </Position27>
+      <Position28>
+        <Filename Value="unit1.pas"/>
+        <Caret Line="168" Column="16" TopLine="144"/>
+      </Position28>
+      <Position29>
+        <Filename Value="unit1.pas"/>
+        <Caret Line="171" Column="30" TopLine="145"/>
+      </Position29>
     </JumpHistory>
   </ProjectSession>
 </CONFIG>

File src/unit1.lfm

 object Form1: TForm1
-  Left = 434
+  Left = 263
   Height = 609
-  Top = 139
+  Top = 110
   Width = 980
-  Caption = 'Form1'
+  Caption = 'База бланков'
   ClientHeight = 609
   ClientWidth = 980
   OnClose = FormClose
   OnCreate = FormCreate
+  ShowHint = True
   LCLVersion = '1.0.8.0'
   object PageControl1: TPageControl
     Left = 0
     Height = 552
     Top = 57
     Width = 980
-    ActivePage = TabSheet2
+    ActivePage = TabSheet1
     Align = alClient
-    TabIndex = 1
+    TabIndex = 0
     TabOrder = 0
     object TabSheet1: TTabSheet
       Caption = 'TabSheet1'
         DataSource = dsCLIENTS
         Scrollbars = ssAutoBoth
         TabOrder = 0
+        TabStop = False
         TitleStyle = tsStandard
       end
       object Panel1: TPanel
           DataSource = dsCLIENTS
           CharCase = ecNormal
           MaxLength = 0
-          TabOrder = 2
+          TabOrder = 3
         end
         object DBEditINN: TDBEdit
           Left = 92
           DataSource = dsCLIENTS
           CharCase = ecNormal
           MaxLength = 0
-          TabOrder = 3
+          TabOrder = 7
         end
         object DBEditOKONX: TDBEdit
           Left = 220
           DataSource = dsCLIENTS
           CharCase = ecNormal
           MaxLength = 0
-          TabOrder = 4
+          TabOrder = 8
         end
         object DBEditACCOUNT: TDBEdit
           Left = 476
           DataSource = dsCLIENTS
           CharCase = ecNormal
           MaxLength = 0
-          TabOrder = 5
+          TabOrder = 10
         end
         object DBEditE_MAIL: TDBEdit
           Left = 644
           DataSource = dsCLIENTS
           CharCase = ecNormal
           MaxLength = 0
-          TabOrder = 6
+          TabOrder = 5
         end
         object DBEditFAX: TDBEdit
           Left = 476
           DataSource = dsCLIENTS
           CharCase = ecNormal
           MaxLength = 0
-          TabOrder = 7
+          TabOrder = 4
         end
         object DBEditMFO: TDBEdit
           Left = 324
           DataSource = dsCLIENTS
           CharCase = ecNormal
           MaxLength = 0
-          TabOrder = 8
+          TabOrder = 9
         end
         object DBEditTEL: TDBEdit
           Left = 828
           DataSource = dsCLIENTS
           CharCase = ecNormal
           MaxLength = 0
-          TabOrder = 9
+          TabOrder = 6
         end
         object DBCBBASIS: TDBComboBox
           Left = 828
           DataSource = dsCLIENTS
           ItemHeight = 13
           MaxLength = 0
-          TabOrder = 10
+          TabOrder = 2
         end
         object Label1: TLabel
-          Left = 19
+          Left = 4
           Height = 14
           Top = 9
           Width = 68
           ParentColor = False
         end
         object Label2: TLabel
-          Left = 19
+          Left = 4
           Height = 14
           Top = 33
           Width = 37
           ParentColor = False
         end
         object Label3: TLabel
-          Left = 19
+          Left = 4
           Height = 14
           Top = 57
           Width = 22
           ParentColor = False
         end
         object Label5: TLabel
-          Left = 412
+          Left = 404
           Height = 14
           Top = 9
           Width = 51
           ParentColor = False
         end
         object Label6: TLabel
-          Left = 772
+          Left = 764
           Height = 14
           Top = 9
           Width = 38
           ParentColor = False
         end
         object Label7: TLabel
-          Left = 604
+          Left = 596
           Height = 14
           Top = 33
           Width = 29
           ParentColor = False
         end
         object Label8: TLabel
-          Left = 772
+          Left = 764
           Height = 14
           Top = 33
           Width = 45
           ParentColor = False
         end
         object Label9: TLabel
-          Left = 437
+          Left = 429
           Height = 14
           Top = 33
           Width = 26
           ParentColor = False
         end
         object Label10: TLabel
-          Left = 292
+          Left = 284
           Height = 14
           Top = 57
           Width = 25
           ParentColor = False
         end
         object Label11: TLabel
-          Left = 437
+          Left = 429
           Height = 14
           Top = 57
           Width = 26
           TabOrder = 11
         end
         object Label12: TLabel
-          Left = 19
+          Left = 4
           Height = 14
           Top = 81
           Width = 25
         Columns = <>
         DataSource = dsCONTRACT
         TabOrder = 0
+        TabStop = False
       end
       object Panel2: TPanel
         Left = 0
           DataSource = dsCONTRACT
           CharCase = ecNormal
           MaxLength = 0
-          TabOrder = 0
+          TabOrder = 2
         end
         object DBEdit2: TDBEdit
           Left = 92
           DataSource = dsCONTRACT
           CharCase = ecNormal
           MaxLength = 0
-          TabOrder = 1
+          TabOrder = 0
         end
         object DBEdit3: TDBEdit
           Left = 236
           DataSource = dsCONTRACT
           CharCase = ecNormal
           MaxLength = 0
-          TabOrder = 2
+          TabOrder = 1
         end
         object DBLookupComboBox1: TDBLookupComboBox
           Left = 92
           TabOrder = 3
         end
         object Label13: TLabel
-          Left = 20
+          Left = 4
           Height = 14
           Top = 9
           Width = 32
           ParentColor = False
         end
         object Label14: TLabel
-          Left = 20
+          Left = 4
           Height = 14
           Top = 33
           Width = 38
           ParentColor = False
         end
         object Label15: TLabel
-          Left = 188
+          Left = 180
           Height = 14
           Top = 9
           Width = 27
           ParentColor = False
         end
         object Label16: TLabel
-          Left = 332
+          Left = 324
           Height = 14
           Top = 9
           Width = 77
         object SpeedButton1: TSpeedButton
           Left = 608
           Height = 20
+          Hint = 'Печать'
           Top = 9
           Width = 20
           AutoSize = True
           Visible = False
         end
         object SpeedButton3: TSpeedButton
-          Left = 628
+          Left = 649
           Height = 20
+          Hint = 'Редактировать'
           Top = 9
           Width = 20
           AutoSize = True
           NumGlyphs = 0
           OnClick = SpeedButton3Click
         end
+        object SpeedButton4: TSpeedButton
+          Left = 629
+          Height = 20
+          Hint = 'Предварительный просмотр'
+          Top = 9
+          Width = 20
+          AutoSize = True
+          Flat = True
+          Glyph.Data = {
+            36040000424D3604000000000000360000002800000010000000100000000100
+            2000000000000004000064000000640000000000000000000000000000230000
+            0033000000330000003300000033000000330000003300000033000000330000
+            003300000033000000330000003300000033000000330000000BA4A4A2C0AFAF
+            ADFFAEAEACFFAEAEACFFAEAEACFFAEAEACFFAEAFACFFAFAFADFFAFAFADFFB0B0
+            AEFFB5B3AFFFC2BAB1FF3F7CABFF477FAAFF4881ACFF294C655EB0B0ADFFFFFF
+            FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+            FFFFFFFFFFFF3077AEFF6F9BBEFF1FADFFFF5FB7E0AD4491C6FFAEAEABFFFFFF
+            FFFFFFFFFFFF969696FFC6C6C6FFFFFFFFFFBCBBBAFF777575FF6F6D6BFF706E
+            6CFF74716FFF8C8580FFAFA59DFFA0C3D9FFB0ECFFFF3F91C6FFADADABFFFFFF
+            FFFFFCFBFBFFFFFFFFFFFFFFFFFF8C8A89FF949493FFD5D5D9FFE1E3E7FFE1E2
+            E6FFD6D6DAFF9B9998FF8A8480FFF6EDE7FFBFDFEBFF3F92CAFFADADABFFFFFF
+            FFFFF8F8F8FFFEFEFEFFBCBBBAFF9A9998FFE9E6E5FFECC88EFFF5CE7FFFFADC
+            8DFFF7E3A9FFE8E8E7FF9E9B9BFFB6AEA7FF3690CCFF4295CD00ADADABFFFFFF
+            FFFFF7F7F6FFC4C4C4FF82807EFFE4E2E2FFF2C284FFFDCD82FFFFD885FFFFE9
+            98FFFFF1A2FFF8E5A9FFE2E1E5FF8A807BFF3795D3003E98D300ADADABFFFFFF
+            FFFFF5F4F3FFFEFDFCFF7E7B78FFFDF7F4FF1688F5FF53AFFFFF0D8AFFFF499F
+            E3FFFFE998FFF9DB8CFFF4F5FAFF878481FF938A8500968C8400ADADABFFFFFF
+            FFFFF2F2F1FFC3C4C4FF827E7BFFFFFCFAFF94CCC0FFB8FBFFFF89F2FFFF098A
+            FFFFFFD886FFF3CC7DFFFAFCFFFF898685FF918D8B00938F8C00ADADABFFFFFF
+            FFFFEFEEEDFFF6F5F4FF8A8886FFF2F2F3FFECB77BFFDBE6F4FF91CDFFFF90C0
+            EBFFF6CD8AFFF0CC93FFF1F4F8FF8D8A89FF94918F0095929000ADADABFFFFFF
+            FFFFECECEBFFBFBFBFFFBEBCBBFFAEADACFFFFFFFFFFE9B87FFFEDBC80FFEEBF
+            82FFEEC78FFFFFFFFFFFB3B2B2FF93908E819794920098959300ADAEABFFFFFF
+            FFFFE9E8E7FFEEEDECFFF2F1F0FF9D9A99FFB1B0B1FFFBFDFFFFFFFFFFFFFFFF
+            FFFFFBFDFFFFB4B3B4FF989694FF93908E009592900095929000AEAEABFFFFFF
+            FFFFE6E6E5FF9B9B9BFFBDBDBCFFE7E6E5FFBCBAB7FF939190FF8C8988FF8C89
+            87FF969492FFAFAEACFFB6B7B5ABB8B8B600B8B8B600B8B8B600AEAEACFFFFFF
+            FFFFE1E0DFFFE4E3E1FFE4E3E2FFE4E2E1FFE4E3E2FFFFFFFFFFAAAAA7FFFFFF
+            FFFFEDEEEEFFB3B3B1A7B5B5B300B5B5B300B5B5B300B5B5B300AFAFADFFFFFF
+            FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEAEA
+            EAFFB0B0ADA6B3B3B100B5B5B300B5B5B300B5B5B300B5B5B300B3B3B1EFB0B0
+            ADFFAEAEACFFAEAEABFFAEAEABFFAEAEABFFADAEABFFAEAEABFFAFAFADFFB0B0
+            AEEAB3B3B100B5B5B300B5B5B300B5B5B300B5B5B300B5B5B300
+          }
+          NumGlyphs = 0
+          OnClick = SpeedButton4Click
+        end
       end
       object DBNavigator1: TDBNavigator
         Left = 508
     top = 8
     object actClients: TAction
       Caption = 'Клиенты'
+      Hint = 'Форма клиентов'
       ImageIndex = 0
       OnExecute = actClientsExecute
     end
     object ActContracts: TAction
       Caption = 'Договора'
+      Hint = 'Договора'
       ImageIndex = 1
       OnExecute = ActContractsExecute
     end
     }
   end
   object dsCLIENTS: TDatasource
-    DataSet = SQLCLIENTS
+    DataSet = IBTCLIENTS
     left = 72
     top = 408
   end
   object dsMFO: TDatasource
-    DataSet = SQLMFO
+    DataSet = IBTMFO
     left = 160
     top = 408
   end
   object dsCONTRACT: TDatasource
-    DataSet = SQLCONTRACT
+    DataSet = IBTCONTRACT
     left = 248
     top = 408
   end
-  object IBConnection1: TIBConnection
-    Connected = True
+  object frDBDataSet1: TfrDBDataSet
+    DataSet = RQCONTRACT
+    left = 336
+    top = 408
+  end
+  object frReport1: TfrReport
+    Dataset = frDBDataSet1
+    DefaultCopies = 0
+    GrayedButtons = True
+    InitialZoom = pzDefault
+    Options = []
+    PreviewButtons = [pbZoom, pbLoad, pbSave, pbPrint, pbFind, pbHelp, pbExit]
+    DataType = dtDataSet
+    Title = 'Договор'
+    left = 336
+    top = 480
+  end
+  object frDesigner1: TfrDesigner
+    left = 336
+    top = 256
+  end
+  object IBDatabase1: TIBDatabase
+    Connected = False
     LoginPrompt = False
-    AfterConnect = IBConnection1AfterConnect
-    DatabaseName = 'ldb'
-    KeepConnection = False
-    Password = 'unimaster12'
-    Transaction = SQLTransaction1
-    UserName = 'sysdba'
-    CharSet = 'utf-8'
-    LogEvents = []
+    AllowStreamedConnected = False
+    DatabaseName = 'db/db.fdb'
+    Params.Strings = (
+      'lc_ctype=UTF8'
+      'user_name=sysdba'
+      'password=unimaster12'
+    )
+    DefaultTransaction = IBTransaction1
+    IdleTimer = 0
+    TraceFlags = []
     left = 72
     top = 256
   end
-  object SQLTransaction1: TSQLTransaction
-    Active = True
-    Action = caNone
-    Database = IBConnection1
+  object IBTransaction1: TIBTransaction
+    Active = False
+    DefaultDatabase = IBDatabase1
     left = 160
     top = 256
   end
-  object SQLCLIENTS: TSQLQuery
-    FieldDefs = <    
-      item
-        Name = 'ID'
-        DataType = ftInteger
-        Precision = -1
-        Size = 0
-      end    
-      item
-        Name = 'NAME'
-        DataType = ftString
-        Precision = -1
-        Size = 240
-      end    
-      item
-        Name = 'DIRECTOR'
-        DataType = ftString
-        Precision = -1
-        Size = 240
-      end    
-      item
-        Name = 'BASIS'
-        DataType = ftString
-        Precision = -1
-        Size = 60
-      end    
-      item
-        Name = 'ADDRESS'
-        DataType = ftString
-        Precision = -1
-        Size = 240
-      end    
-      item
-        Name = 'ACCOUNT'
-        DataType = ftString
-        Precision = -1
-        Size = 60
-      end    
-      item
-        Name = 'MFO'
-        DataType = ftString
-        Precision = -1
-        Size = 15
-      end    
-      item
-        Name = 'INN'
-        DataType = ftString
-        Precision = -1
-        Size = 27
-      end    
-      item
-        Name = 'OKONX'
-        DataType = ftString
-        Precision = -1
-        Size = 15
-      end    
-      item
-        Name = 'TEL'
-        DataType = ftString
-        Precision = -1
-        Size = 45
-      end    
-      item
-        Name = 'FAX'
-        DataType = ftString
-        Precision = -1
-        Size = 45
-      end    
-      item
-        Name = 'E_MAIL'
-        DataType = ftString
-        Precision = -1
-        Size = 120
-      end>
+  object IBTCLIENTS: TIBTable
+    Database = IBDatabase1
+    Transaction = IBTransaction1
     AfterPost = SQLCLIENTSAfterPost
-    Database = IBConnection1
-    Transaction = SQLTransaction1
-    SQL.Strings = (
-      'select * from CLIENTS'
-    )
-    Params = <>
-    UpdateMode = upWhereAll
-    left = 72
+    BufferChunks = 1000
+    CachedUpdates = False
+    TableName = 'CLIENTS'
+    left = 74
     top = 336
-    object SQLCLIENTSID: TLongintField
+    object IBTCLIENTSID: TIntegerField
       DisplayWidth = 10
       FieldKind = fkData
       FieldName = 'ID'
       LookupCache = False
       ProviderFlags = [pfInUpdate, pfInWhere]
       ReadOnly = False
-      Required = True
+      Required = False
       Visible = False
     end
-    object SQLCLIENTSNAME: TStringField
-      DisplayLabel = 'Наименование'
-      DisplayWidth = 30
+    object IBTCLIENTSNAME: TIBStringField
+      DisplayLabel = 'Наименование клиента'
+      DisplayWidth = 40
       FieldKind = fkData
       FieldName = 'NAME'
       Index = 1
       ProviderFlags = [pfInUpdate, pfInWhere]
       ReadOnly = False
       Required = False
-      Size = 80
+      Size = 320
     end
-    object SQLCLIENTSDIRECTOR: TStringField
+    object IBTCLIENTSDIRECTOR: TIBStringField
+      DisplayLabel = 'Директор'
       DisplayWidth = 30
       FieldKind = fkData
       FieldName = 'DIRECTOR'
       ProviderFlags = [pfInUpdate, pfInWhere]
       ReadOnly = False
       Required = False
-      Visible = False
-      Size = 80
+      Size = 320
     end
-    object SQLCLIENTSBASIS: TStringField
-      DisplayWidth = 10
+    object IBTCLIENTSBASIS: TIBStringField
+      DisplayWidth = 80
       FieldKind = fkData
       FieldName = 'BASIS'
       Index = 3
       ReadOnly = False
       Required = False
       Visible = False
+      Size = 80
     end
-    object SQLCLIENTSADDRESS: TStringField
-      DisplayWidth = 30
+    object IBTCLIENTSADDRESS: TIBStringField
+      DisplayWidth = 320
       FieldKind = fkData
       FieldName = 'ADDRESS'
       Index = 4
       ReadOnly = False
       Required = False
       Visible = False
-      Size = 80
+      Size = 320
     end
-    object SQLCLIENTSACCOUNT: TStringField
-      DisplayLabel = 'Счет'
-      DisplayWidth = 20
+    object IBTCLIENTSMFO: TIBStringField
+      DisplayLabel = 'МФО'
+      DisplayWidth = 5
       FieldKind = fkData
-      FieldName = 'ACCOUNT'
+      FieldName = 'MFO'
       Index = 5
       LookupCache = False
       ProviderFlags = [pfInUpdate, pfInWhere]
       ReadOnly = False
       Required = False
     end
-    object SQLCLIENTSMFO: TStringField
-      DisplayWidth = 5
+    object IBTCLIENTSACCOUNT: TIBStringField
+      DisplayLabel = 'Счет'
+      DisplayWidth = 10
       FieldKind = fkData
-      FieldName = 'MFO'
+      FieldName = 'ACCOUNT'
       Index = 6
       LookupCache = False
       ProviderFlags = [pfInUpdate, pfInWhere]
       ReadOnly = False
       Required = False
-      Visible = False
-      Size = 5
+      Size = 80
     end
-    object SQLCLIENTSINN: TStringField
+    object IBTCLIENTSINN: TIBStringField
       DisplayLabel = 'ИНН'
       DisplayWidth = 9
       FieldKind = fkData
       ProviderFlags = [pfInUpdate, pfInWhere]
       ReadOnly = False
       Required = False
-      Size = 9
+      Size = 36
     end
-    object SQLCLIENTSOKONX: TStringField
-      DisplayWidth = 5
+    object IBTCLIENTSOKONX: TIBStringField
+      DisplayWidth = 20
       FieldKind = fkData
       FieldName = 'OKONX'
       Index = 8
       ReadOnly = False
       Required = False
       Visible = False
-      Size = 5
     end
-    object SQLCLIENTSTEL: TStringField
+    object IBTCLIENTSTEL: TIBStringField
       DisplayLabel = 'Телефон'
       DisplayWidth = 15
       FieldKind = fkData
       ProviderFlags = [pfInUpdate, pfInWhere]
       ReadOnly = False
       Required = False
-      Size = 15
+      Size = 60
     end
-    object SQLCLIENTSFAX: TStringField
-      DisplayWidth = 15
+    object IBTCLIENTSFAX: TIBStringField
+      DisplayWidth = 60
       FieldKind = fkData
       FieldName = 'FAX'
       Index = 10
       ReadOnly = False
       Required = False
       Visible = False
-      Size = 15
+      Size = 60
     end
-    object SQLCLIENTSE_MAIL: TStringField
+    object IBTCLIENTSE_MAIL: TIBStringField
       DisplayLabel = 'e-mail'
-      DisplayWidth = 20
+      DisplayWidth = 15
       FieldKind = fkData
       FieldName = 'E_MAIL'
       Index = 11
       ProviderFlags = [pfInUpdate, pfInWhere]
       ReadOnly = False
       Required = False
-      Size = 40
+      Size = 160
     end
   end
-  object SQLCONTRACT: TSQLQuery
-    FieldDefs = <    
-      item
-        Name = 'ID'
-        DataType = ftInteger
-        Precision = -1
-        Size = 0
-      end    
-      item
-        Name = 'NUMBER'
-        DataType = ftString
-        Precision = -1
-        Size = 30
-      end    
-      item
-        Name = 'V_DATE'
-        DataType = ftDate
-        Precision = -1
-        Size = 0
-      end    
-      item
-        Name = 'CLIENTS_ID'
-        DataType = ftInteger
-        Precision = -1
-        Size = 0
-      end    
-      item
-        Name = 'D_DATE'
-        DataType = ftDate
-        Precision = -1
-        Size = 0
-      end>
+  object IBTMFO: TIBTable
+    Database = IBDatabase1
+    Transaction = IBTransaction1
     AfterPost = SQLCLIENTSAfterPost
-    Database = IBConnection1
-    Transaction = SQLTransaction1
-    SQL.Strings = (
-      'select * from CONTRACT'
-    )
-    Params = <>
-    left = 248
+    BufferChunks = 1000
+    CachedUpdates = False
+    TableName = 'MFO'
+    left = 160
     top = 336
-    object SQLCONTRACTID: TLongintField
+    object IBTMFOMFO: TIBStringField
+      DisplayLabel = 'МФО'
+      DisplayWidth = 5
+      FieldKind = fkData
+      FieldName = 'MFO'
+      Index = 0
+      LookupCache = False
+      ProviderFlags = [pfInUpdate, pfInWhere]
+      ReadOnly = False
+      Required = False
+    end
+    object IBTMFONAME: TIBStringField
+      DisplayLabel = 'Банк'
+      DisplayWidth = 120
+      FieldKind = fkData
+      FieldName = 'NAME'
+      Index = 1
+      LookupCache = False
+      ProviderFlags = [pfInUpdate, pfInWhere]
+      ReadOnly = False
+      Required = False
+      Size = 320
+    end
+  end
+  object IBTCONTRACT: TIBTable
+    Database = IBDatabase1
+    Transaction = IBTransaction1
+    AfterPost = SQLCLIENTSAfterPost
+    BufferChunks = 1000
+    CachedUpdates = False
+    TableName = 'CONTRACT'
+    left = 247
+    top = 336
+    object IBTCONTRACTID: TIntegerField
       DisplayWidth = 10
       FieldKind = fkData
       FieldName = 'ID'
       LookupCache = False
       ProviderFlags = [pfInUpdate, pfInWhere]
       ReadOnly = False
-      Required = True
+      Required = False
       Visible = False
     end
     object StringField1: TStringField
       Index = 1
       KeyFields = 'CLIENTS_ID'
       LookupCache = False
-      LookupDataSet = SQLCLIENTS
+      LookupDataSet = IBTCLIENTS
       LookupKeyFields = 'ID'
       LookupResultField = 'NAME'
       ProviderFlags = [pfInUpdate, pfInWhere]
-      ReadOnly = False
+      ReadOnly = True
       Required = False
-      Size = 80
+      Size = 320
     end
-    object SQLCONTRACTNUMBER: TStringField
-      DisplayLabel = '№ Договора'
+    object IBTCONTRACTNUMBER: TIBStringField
+      DisplayLabel = 'Номер'
       DisplayWidth = 10
       FieldKind = fkData
       FieldName = 'NUMBER'
       ProviderFlags = [pfInUpdate, pfInWhere]
       ReadOnly = False
       Required = False
-      Size = 10
+      Size = 40
     end
-    object SQLCONTRACTV_DATE: TDateField
+    object IBTCONTRACTV_DATE: TDateField
       DisplayLabel = 'Дата'
       DisplayWidth = 10
       FieldKind = fkData
       LookupCache = False
       ProviderFlags = [pfInUpdate, pfInWhere]
       ReadOnly = False
-      Required = True
+      Required = False
       EditMask = '!99/99/0000;1;_'
     end
-    object SQLCONTRACTCLIENTS_ID: TLongintField
+    object IBTCONTRACTCLIENTS_ID: TIntegerField
       DisplayWidth = 10
       FieldKind = fkData
       FieldName = 'CLIENTS_ID'
       LookupCache = False
       ProviderFlags = [pfInUpdate, pfInWhere]
       ReadOnly = False
-      Required = True
+      Required = False
       Visible = False
     end
-    object SQLCONTRACTD_DATE: TDateField
+    object IBTCONTRACTD_DATE: TDateField
       DisplayLabel = 'Срок'
       DisplayWidth = 10
       FieldKind = fkData
       EditMask = '!99/99/0000;1;_'
     end
   end
-  object SQLMFO: TSQLQuery
-    IndexName = 'DEFAULT_ORDER'
-    FieldDefs = <    
-      item
-        Name = 'MFO'
-        DataType = ftString
-        Precision = -1
-        Size = 20
-      end    
-      item
-        Name = 'NAME'
-        DataType = ftString
-        Precision = -1
-        Size = 320
-      end>
-    Active = True
-    Filter = 'MFO=''00286'''
-    Filtered = True
-    AfterPost = SQLCLIENTSAfterPost
-    Database = IBConnection1
-    Transaction = SQLTransaction1
-    SQL.Strings = (
-      'SELECT * FROM MFO'
-    )
-    Params = <>
-    left = 160
-    top = 336
-    object SQLMFOMFO: TStringField
-      DisplayWidth = 15
-      FieldKind = fkData
-      FieldName = 'MFO'
-      Index = 0
-      LookupCache = False
-      ProviderFlags = [pfInUpdate, pfInWhere]
-      ReadOnly = False
-      Required = True
-      Size = 15
-    end
-    object SQLMFONAME: TStringField
-      DisplayWidth = 80
-      FieldKind = fkData
-      FieldName = 'NAME'
-      Index = 1
-      LookupCache = False
-      ProviderFlags = [pfInUpdate, pfInWhere]
-      ReadOnly = False
-      Required = False
-      Size = 140
-    end
-  end
-  object SQLRCONTRACT: TSQLQuery
-    IndexName = 'DEFAULT_ORDER'
-    FieldDefs = <    
-      item
-        Name = 'NAME'
-        DataType = ftString
-        Precision = -1
-        Size = 240
-      end    
-      item
-        Name = 'DIRECTOR'
-        DataType = ftString
-        Precision = -1
-        Size = 240
-      end    
-      item
-        Name = 'BASIS'
-        DataType = ftString
-        Precision = -1
-        Size = 60
-      end    
-      item
-        Name = 'ADDRESS'
-        DataType = ftString
-        Precision = -1
-        Size = 240
-      end    
-      item
-        Name = 'ACCOUNT'
-        DataType = ftString
-        Precision = -1
-        Size = 60
-      end    
-      item
-        Name = 'MFO'
-        DataType = ftString
-        Precision = -1
-        Size = 15
-      end    
-      item
-        Name = 'INN'
-        DataType = ftString
-        Precision = -1
-        Size = 27
-      end    
-      item
-        Name = 'OKONX'
-        DataType = ftString
-        Precision = -1
-        Size = 15
-      end    
-      item
-        Name = 'TEL'
-        DataType = ftString
-        Precision = -1
-        Size = 45
-      end    
-      item
-        Name = 'FAX'
-        DataType = ftString
-        Precision = -1
-        Size = 45
-      end    
-      item
-        Name = 'E_MAIL'
-        DataType = ftString
-        Precision = -1
-        Size = 120
-      end    
-      item
-        Name = 'NUMBER'
-        DataType = ftString
-        Precision = -1
-        Size = 30
-      end    
-      item
-        Name = 'V_DATE'
-        DataType = ftDate
-        Precision = -1
-        Size = 0
-      end    
-      item
-        Name = 'CLIENTS_ID'
-        DataType = ftInteger
-        Precision = -1
-        Size = 0
-      end    
-      item
-        Name = 'D_DATE'
-        DataType = ftDate
-        Precision = -1
-        Size = 0
-      end    
-      item
-        Name = 'NAME_1'
-        DataType = ftString
-        Precision = -1
-        Size = 240
-      end>
-    Database = IBConnection1
-    Transaction = SQLTransaction1
+  object RQCONTRACT: TIBQuery
+    Database = IBDatabase1
+    Transaction = IBTransaction1
+    BufferChunks = 1000
+    CachedUpdates = False
+    DataSource = dsCONTRACT
+    GeneratorField.ApplyOnEvent = gaeOnNewRecord
     SQL.Strings = (
       'SELECT'
       '    CLIENTS.NAME,'
       '   INNER JOIN CLIENTS ON (CONTRACT.CLIENTS_ID = CLIENTS.ID)'
       '   INNER JOIN MFO ON (CLIENTS.MFO = MFO.MFO)'
       'WHERE'
-      '   CONTRACT.ID = :ID'
+      '   CONTRACT.ID = :ID     '
     )
     Params = <    
       item
         ParamType = ptInput
         Size = 4
       end>
-    DataSource = dsCONTRACT
     left = 336
     top = 336
-  end
-  object frDBDataSet1: TfrDBDataSet
-    DataSet = SQLRCONTRACT
-    left = 336
-    top = 408
-  end
-  object frReport1: TfrReport
-    Dataset = frDBDataSet1
-    DefaultCopies = 0
-    GrayedButtons = True
-    InitialZoom = pzDefault
-    Options = []
-    PreviewButtons = [pbZoom, pbLoad, pbSave, pbPrint, pbFind, pbHelp, pbExit]
-    DataType = dtDataSet
-    Title = 'Договор'
-    left = 336
-    top = 480
-  end
-  object frDesigner1: TfrDesigner
-    left = 336
-    top = 256
+    ParamData = <    
+      item
+        DataType = ftInteger
+        Name = 'ID'
+        ParamType = ptInput
+        Size = 4
+      end>
   end
 end

File src/unit1.pas

 interface
 
 uses
-  Forms, Classes, SysUtils, db, IBConnection, sqldb, FileUtil, LR_DBSet,
-  LR_Class, LR_Desgn, Controls, Graphics, Dialogs, StdCtrls, ComCtrls, ActnList,
-  DBGrids, ExtCtrls, DbCtrls, Buttons, ExtDlgs;
+  Forms, Classes, SysUtils, db, IBConnection, sqldb, FileUtil, IBDatabase,
+  IBTable, IBQuery, IBCustomDataSet, LR_DBSet, LR_Class, LR_Desgn, Controls,
+  Graphics, Dialogs, StdCtrls, ComCtrls, ActnList, DBGrids, ExtCtrls, DbCtrls,
+  Buttons, ExtDlgs;
 
 type
 
       frDBDataSet1: TfrDBDataSet;
       frDesigner1: TfrDesigner;
       frReport1: TfrReport;
-      IBConnection1: TIBConnection;
+      IBDatabase1: TIBDatabase;
+      IBTCLIENTSACCOUNT: TIBStringField;
+      IBTCLIENTSADDRESS: TIBStringField;
+      IBTCLIENTSBASIS: TIBStringField;
+      IBTCLIENTSDIRECTOR: TIBStringField;
+      IBTCLIENTSE_MAIL: TIBStringField;
+      IBTCLIENTSFAX: TIBStringField;
+      IBTCLIENTSID: TIntegerField;
+      IBTCLIENTSINN: TIBStringField;
+      IBTCLIENTSMFO: TIBStringField;
+      IBTCLIENTSNAME: TIBStringField;
+      IBTCLIENTSOKONX: TIBStringField;
+      IBTCLIENTSTEL: TIBStringField;
+      IBTCONTRACTCLIENTS_ID: TIntegerField;
+      IBTCONTRACTD_DATE: TDateField;
+      IBTCONTRACTID: TIntegerField;
+      IBTCONTRACTNUMBER: TIBStringField;
+      IBTCONTRACTV_DATE: TDateField;
+      IBTMFOMFO: TIBStringField;
+      IBTMFONAME: TIBStringField;
+      RQCONTRACT: TIBQuery;
+      IBTCONTRACT: TIBTable;
+      IBTMFO: TIBTable;
+      IBTCLIENTS: TIBTable;
+      IBTransaction1: TIBTransaction;
       ImageList1: TImageList;
       Label1: TLabel;
       Label10: TLabel;
       SpeedButton1: TSpeedButton;
       SpeedButton2: TSpeedButton;
       SpeedButton3: TSpeedButton;
-      SQLCLIENTS: TSQLQuery;
-      SQLCLIENTSACCOUNT: TStringField;
-      SQLCLIENTSADDRESS: TStringField;
-      SQLCLIENTSBASIS: TStringField;
-      SQLCLIENTSDIRECTOR: TStringField;
-      SQLCLIENTSE_MAIL: TStringField;
-      SQLCLIENTSFAX: TStringField;
-      SQLCLIENTSID: TLongintField;
-      SQLCLIENTSINN: TStringField;
-      SQLCLIENTSMFO: TStringField;
-      SQLCLIENTSNAME: TStringField;
-      SQLCLIENTSOKONX: TStringField;
-      SQLCLIENTSTEL: TStringField;
-      SQLCONTRACT: TSQLQuery;
-      SQLCONTRACTCLIENTS_ID: TLongintField;
-      SQLCONTRACTD_DATE: TDateField;
-      SQLCONTRACTID: TLongintField;
-      SQLCONTRACTNUMBER: TStringField;
-      SQLCONTRACTV_DATE: TDateField;
-      SQLMFO: TSQLQuery;
-      SQLMFOMFO: TStringField;
-      SQLMFONAME: TStringField;
-      SQLRCONTRACT: TSQLQuery;
-      SQLTransaction1: TSQLTransaction;
+      SpeedButton4: TSpeedButton;
       StringField1: TStringField;
       TabSheet1: TTabSheet;
       TabSheet2: TTabSheet;
       procedure IBConnection1AfterConnect(Sender: TObject);
       procedure SpeedButton1Click(Sender: TObject);
       procedure SpeedButton3Click(Sender: TObject);
+      procedure SpeedButton4Click(Sender: TObject);
       procedure SQLCLIENTSAfterPost(DataSet: TDataSet);
   private
     { private declarations }
 procedure TForm1.FormCreate(Sender: TObject);
 begin
     PageControl1.ShowTabs:=False;
-    SQLMFO.Open;
-    SQLCLIENTS.Open;
-    SQLCONTRACT.Open;
+    IBTMFO.Open;
+    IBTCLIENTS.Open;
+    IBTCONTRACT.Open;
 end;
 
 procedure TForm1.IBConnection1AfterConnect(Sender: TObject);
 
 procedure TForm1.SpeedButton1Click(Sender: TObject);
 begin
-     SQLRCONTRACT.Close;
-     SQLRCONTRACT.Open;
+     RQCONTRACT.Close;
+     RQCONTRACT.Open;
      frReport1.LoadFromFile('reps/CONTACRT.lrf');
-     frReport1.ShowReport;
+     if frReport1.PrepareReport then begin
+     frReport1.PrintPreparedReport('1',2);
+     ShowMessage('Проверьте рапечатанный материал.' + #13#10 +
+                 'Переверните распечатанные страницы и положите в лоток.'  + #13#10 +
+                 'Нажмите ok для продолжения печети.');
+     frReport1.PrintPreparedReport('2',2);
+     end;
 end;
 
 procedure TForm1.SpeedButton3Click(Sender: TObject);
 begin
+     RQCONTRACT.Close;
+     RQCONTRACT.Open;
+     frReport1.LoadFromFile('reps/CONTACRT.lrf');
      frReport1.DesignReport;
 end;
 
+procedure TForm1.SpeedButton4Click(Sender: TObject);
+begin
+     RQCONTRACT.Close;
+     RQCONTRACT.Open;
+     frReport1.LoadFromFile('reps/CONTACRT.lrf');
+     frReport1.ShowReport;
+end;
+
 procedure TForm1.SQLCLIENTSAfterPost(DataSet: TDataSet);
 var no:Longint;
 begin
     no:= DataSet.RecNo;
-    SQLMFO.ApplyUpdates;
-    SQLCLIENTS.ApplyUpdates;
-    SQLCONTRACT.ApplyUpdates;
-    SQLMFO.Refresh;
-    SQLCLIENTS.Refresh;
-    SQLCONTRACT.Refresh;
+    IBTMFO.Close;
+    IBTCLIENTS.Close;
+    IBTCONTRACT.Close;
+    IBTMFO.Open;
+    IBTCLIENTS.Open;
+    IBTCONTRACT.Open;
     DataSet.RecNo:=no;
 end;
 
 
 procedure TForm1.FormClose(Sender: TObject; var CloseAction: TCloseAction);
 begin
-    SQLCLIENTS.ApplyUpdates(-1);
-    SQLCONTRACT.ApplyUpdates(-1);
-    SQLMFO.ApplyUpdates(-1);
-    SQLTransaction1.Commit;
+    IBTransaction1.Commit;
 end;
 
 end.