<?xml version="1.0" encoding="utf-8"?>
<TfrxReport Version="5.4.6" DotMatrixReport="False" EngineOptions.SilentMode="True" EngineOptions.NewSilentMode="simSilent" IniFile="\Software\Fast Reports" PreviewOptions.Buttons="4095" PreviewOptions.Zoom="1" PrintOptions.Printer="Default" PrintOptions.PrintOnSheet="0" ReportOptions.CreateDate="42119.8655733102" ReportOptions.Description.Text="" ReportOptions.LastChange="42816.5949802083" ScriptLanguage="PascalScript" ScriptText.Text="&#13;&#10;procedure DialogPage1OnActivate(Sender: TfrxComponent);&#13;&#10;begin&#13;&#10;  date1.date:=now  ;&#13;&#10;  date2.date:=now  ;&#13;&#10;&#13;&#10;  qry_dept.close ;&#13;&#10;  qry_dept.open ;&#13;&#10;&#13;&#10;  cbb_dept.keyvalue:=&#60;MY_STOCK_CODE&#62; ;                                       &#13;&#10;    &#13;&#10;end;&#13;&#10;&#13;&#10;&#13;&#10;&#13;&#10;&#13;&#10;&#13;&#10;begin&#13;&#10;&#13;&#10;end.">
  <Datasets>
    <item DataSet="qry_rp1" DataSetName="rp1"/>
    <item DataSet="qry_dept" DataSetName="dept"/>
  </Datasets>
  <Variables>
    <item Name="MY_STOCK_CODE"/>
    <item Name="MY_STOCK_NAME"/>
  </Variables>
  <TfrxDataPage Name="Data" Height="1000" Left="0" Top="0" Width="1000">
    <TfrxUniDACQuery Name="qry_rp1" UserName="rp1" CloseDataSource="True" FieldAliases.Text="" BCDToCurrency="False" IgnoreDupParams="False" SQL.Text="{IF SQLSERVER}                             &#13;&#10;select m.DEPT_ID,m.INVOICE_NO,m.RECEIVE_NO,m.PO_NO,&#13;&#10;substring(m.RECEIVE_DATE,1,4)+'-'+substring(m.RECEIVE_DATE,5,2)+'-'+substring(m.RECEIVE_DATE,7,2) as RCVDATE&#13;&#10;,v.COMPANY_NAME as VENDOR_NAME,c.QTY_ORDER,c.QTY_RCV,&#13;&#10;c.COST,c.PACK_RATIO,s1.SALE_UNIT as SUBPACKUNIT,&#13;&#10;s2.SALE_UNIT as PACKUNIT,dbo.IS_ED(g.IS_ED) as ED_FLAG,&#13;&#10;CASE when c.FREE_FLAG='N' then c.[VALUE] else 0 end as VALUE_PO,&#13;&#10;CASE when c.FREE_FLAG&#60;&#62;'N' then c.[VALUE] else 0 end as VALUE_FREE,&#13;&#10;c.BUY_UNIT_COST,c.WORKING_CODE,g.DRUG_NAME&#13;&#10;from MS_IVO m (NOLOCK)&#13;&#10;left join MS_IVO_C c (NOLOCK) on (c.RECEIVE_NO=m.RECEIVE_NO and c.REV_FLAG='N')                                                                                                            &#13;&#10;left join COMPANY v (NOLOCK) on (v.COMPANY_CODE=m.VENDOR_CODE)   &#13;&#10;left JOIN PACK_RATIO p on (p.PACK_CODE=c.PACK_CODE)&#13;&#10;left join SALE_UNIT s1 (NOLOCK) on (s1.SU_ID=p.SUBPACK_UNIT)     &#13;&#10;left join SALE_UNIT s2 (NOLOCK) on (s2.SU_ID=p.PACK_UNIT)     &#13;&#10;left join DRUG_GN g (NOLOCK) on (c.WORKING_CODE = g.WORKING_CODE)                                                                                                                              &#13;&#10;where m.RECEIVE_DATE between :date1 and :date2  and m.DEPT_ID=:stockid&#13;&#10;and c.REV_FLAG='N'&#13;&#10;order by m.RECEIVE_DATE&#13;&#10;&#13;&#10;{ELSE}&#13;&#10;&#13;&#10;select m.DEPT_ID,m.INVOICE_NO,m.RECEIVE_NO,m.PO_NO,&#13;&#10;CONCAT(substring(m.RECEIVE_DATE,1,4),'-',substring(m.RECEIVE_DATE,5,2),'-',substring(m.RECEIVE_DATE,7,2)) as RCVDATE&#13;&#10;,v.COMPANY_NAME as VENDOR_NAME,c.QTY_ORDER,c.QTY_RCV,&#13;&#10;c.COST,c.PACK_RATIO,s1.SALE_UNIT as SUBPACKUNIT,&#13;&#10;s2.SALE_UNIT as PACKUNIT, IS_ED(g.IS_ED) as ED_FLAG,&#13;&#10;CASE when c.FREE_FLAG='N' then c. VALUE  else 0 end as VALUE_PO,&#13;&#10;CASE when c.FREE_FLAG&#60;&#62;'N' then c. VALUE  else 0 end as VALUE_FREE,&#13;&#10;c.BUY_UNIT_COST,c.WORKING_CODE,g.DRUG_NAME&#13;&#10;from MS_IVO m  &#13;&#10;left join MS_IVO_C c   on (c.RECEIVE_NO=m.RECEIVE_NO and c.REV_FLAG='N')                                                                                                            &#13;&#10;left join COMPANY v   on (v.COMPANY_CODE=m.VENDOR_CODE)   &#13;&#10;left JOIN PACK_RATIO p on (p.PACK_CODE=c.PACK_CODE)&#13;&#10;left join SALE_UNIT s1   on (s1.SU_ID=p.SUBPACK_UNIT)     &#13;&#10;left join SALE_UNIT s2   on (s2.SU_ID=p.PACK_UNIT)     &#13;&#10;left join DRUG_GN g   on (c.WORKING_CODE = g.WORKING_CODE)                                                                                                                              &#13;&#10;where m.RECEIVE_DATE between :date1 and :date2  and m.DEPT_ID=:stockid&#13;&#10;and c.REV_FLAG='N'&#13;&#10;order by m.RECEIVE_DATE  &#13;&#10;  &#13;&#10;{ENDIF}                &#13;&#10;  " SpecificOptions.Text="" PropData="05704C6566740387000470546F7002570A506172616D657465727301010C54000000204E616D653D226461746531222044617461547970653D226674537472696E67222045787072657373696F6E3D22466F726D61744461746554696D652827595959596D6D6464272C64617465312E64617465292200010C54000000204E616D653D226461746532222044617461547970653D226674537472696E67222045787072657373696F6E3D22466F726D61744461746554696D652827595959596D6D6464272C64617465322E64617465292200010C42000000204E616D653D2273746F636B6964222044617461547970653D226674537472696E67222045787072657373696F6E3D226362625F646570742E6B657976616C75652200010C54000000204E616D653D226461746531222044617461547970653D226674537472696E67222045787072657373696F6E3D22466F726D61744461746554696D652827595959596D6D6464272C64617465312E64617465292200010C54000000204E616D653D226461746532222044617461547970653D226674537472696E67222045787072657373696F6E3D22466F726D61744461746554696D652827595959596D6D6464272C64617465322E64617465292200010C42000000204E616D653D2273746F636B6964222044617461547970653D226674537472696E67222045787072657373696F6E3D226362625F646570742E6B657976616C7565220000"/>
    <TfrxUniDACQuery Name="qry_dept" UserName="dept" CloseDataSource="True" FieldAliases.Text="" BCDToCurrency="False" IgnoreDupParams="False" SQL.Text="{IF SQLSERVER}                             &#13;&#10;select * from DEPT_ID (NOLOCK) where (HIDE is null or HIDE='' or HIDE='N') and DEPT_TYPE=2&#13;&#10;{ELSE}&#13;&#10;select * from DEPT_ID where (HIDE is null or HIDE='' or HIDE='N') and DEPT_TYPE=2&#13;&#10;{ENDIF}                " SpecificOptions.Text="" PropData="05704C6566740384000470546F700396000A506172616D65746572730100"/>
  </TfrxDataPage>
  <TfrxReportPage Name="Page1" Orientation="poLandscape" PaperWidth="320" PaperHeight="210" PaperSize="256" LeftMargin="5" RightMargin="5" TopMargin="5" BottomMargin="5" ColumnWidth="0" ColumnPositions.Text="" HGuides.Text="" VGuides.Text="">
    <TfrxMasterData Name="MasterData1" FillType="ftBrush" FillGap.Top="0" FillGap.Left="0" FillGap.Bottom="0" FillGap.Right="0" Font.Charset="1" Font.Color="0" Font.Height="-19" Font.Name="AngsanaUPC" Font.Style="0" Height="22.67718" Left="0" ParentFont="False" Top="60" Width="1171.6543" ColumnWidth="0" ColumnGap="0" DataSet="qry_rp1" DataSetName="rp1" RowCount="0">
      <TfrxMemoView Name="rp1COMPANY_NAME" Left="984.94558" Top="0" Width="83.14966" Height="22.67718" DataSet="qry_rp1" DataSetName="rp1" DisplayFormat.FormatStr="%2.0n" DisplayFormat.Kind="fkNumeric" Font.Charset="1" Font.Color="-16777208" Font.Height="-19" Font.Name="AngsanaUPC" Font.Style="0" ParentFont="False" Text="[rp1.&#34;PACK_RATIO&#34;] [rp1.&#34;SUBPACKUNIT&#34;] ([rp1.&#34;PACKUNIT&#34;])"/>
      <TfrxMemoView Name="rp1INVOICE_NO" Left="663.19711646" Top="0" Width="219.21274" Height="22.67718" DataSet="qry_rp1" DataSetName="rp1" Font.Charset="1" Font.Color="-16777208" Font.Height="-19" Font.Name="AngsanaUPC" Font.Style="0" ParentFont="False" Text="[rp1.&#34;DRUG_NAME&#34;]"/>
      <TfrxMemoView Name="rp1TOTAL_COST" Left="882.33921" Top="0" Width="102.04731" Height="22.67718" DataSet="qry_rp1" DataSetName="rp1" DisplayFormat.FormatStr="%2.0n" DisplayFormat.Kind="fkNumeric" Font.Charset="1" Font.Color="-16777208" Font.Height="-19" Font.Name="AngsanaUPC" Font.Style="0" HAlign="haCenter" ParentFont="False" Text="[&#60;rp1.&#34;QTY_RCV&#34;&#62;/&#60;rp1.&#34;PACK_RATIO&#34;&#62;]"/>
      <TfrxMemoView Name="Memo12" Left="1068.48887" Top="0" Width="71.81107" Height="22.67718" DataSet="qry_rp1" DataSetName="rp1" DisplayFormat.FormatStr="%2.2n" DisplayFormat.Kind="fkNumeric" Font.Charset="1" Font.Color="-16777208" Font.Height="-19" Font.Name="AngsanaUPC" Font.Style="0" HAlign="haRight" ParentFont="False" Text="[rp1.&#34;VALUE_FREE&#34;]"/>
      <TfrxMemoView Name="Memo21" Left="91.48825" Top="0" Width="154.96073" Height="22.67718" DataSet="qry_rp1" DataSetName="rp1" DisplayFormat.FormatStr="%2.2n" DisplayFormat.Kind="fkNumeric" Font.Charset="1" Font.Color="-16777208" Font.Height="-19" Font.Name="AngsanaUPC" Font.Style="0" ParentFont="False" Text="[rp1.&#34;VENDOR_NAME&#34;]"/>
      <TfrxMemoView Name="Memo17" Left="0.55906" Top="0" Width="90.70872" Height="22.67718" DataSet="qry_rp1" DataSetName="rp1" Font.Charset="1" Font.Color="-16777208" Font.Height="-19" Font.Name="AngsanaUPC" Font.Style="0" ParentFont="False" Text="[rp1.&#34;PO_NO&#34;]"/>
      <TfrxMemoView Name="rp1RCV_DATE" Left="246.66945" Top="0" Width="98.26778" Height="22.67718" DataSet="qry_rp1" DataSetName="rp1" Font.Charset="1" Font.Color="-16777208" Font.Height="-19" Font.Name="AngsanaUPC" Font.Style="0" ParentFont="False" Text="[rp1.&#34;RCVDATE&#34;]"/>
      <TfrxMemoView Name="Memo15" Left="345.71676" Top="0" Width="86.92919" Height="22.67718" DisplayFormat.FormatStr="%2.2n" DisplayFormat.Kind="fkNumeric" Font.Charset="1" Font.Color="-16777208" Font.Height="-19" Font.Name="AngsanaUPC" Font.Style="0" HAlign="haRight" ParentFont="False" Text="[rp1.&#34;VALUE_PO&#34;]"/>
      <TfrxMemoView Name="Memo16" Left="432.26788496" Top="0" Width="79.37007874" Height="22.67718" DataSet="qry_rp1" DataSetName="rp1" Font.Charset="1" Font.Color="-16777208" Font.Height="-19" Font.Name="AngsanaUPC" Font.Style="0" ParentFont="False" Text="[rp1.&#34;INVOICE_NO&#34;]"/>
      <TfrxMemoView Name="Memo7" Left="512.01601654" Top="0" Width="75.5906" Height="22.67718" DataSet="qry_rp1" DataSetName="rp1" Font.Charset="1" Font.Color="-16777208" Font.Height="-19" Font.Name="AngsanaUPC" Font.Style="0" ParentFont="False" Text="[rp1.&#34;RECEIVE_NO&#34;]"/>
      <TfrxMemoView Name="Memo1" Left="587.60668" Top="0" Width="75.5906" Height="22.67718" DataSet="qry_rp1" DataSetName="rp1" Font.Charset="1" Font.Color="-16777208" Font.Height="-19" Font.Name="AngsanaUPC" Font.Style="0" ParentFont="False" Text="[rp1.&#34;ED_FLAG&#34;]"/>
    </TfrxMasterData>
    <TfrxHeader Name="Header1" FillType="ftBrush" FillGap.Top="0" FillGap.Left="0" FillGap.Bottom="0" FillGap.Right="0" Font.Charset="1" Font.Color="0" Font.Height="-19" Font.Name="AngsanaUPC" Font.Style="0" Height="22.67718" Left="0" ParentFont="False" Top="16" Width="1171.6543">
      <TfrxMemoView Name="Memo3" Left="882.79592" Top="0" Width="102.04731" Height="22.67718" Font.Charset="1" Font.Color="-16777208" Font.Height="-19" Font.Name="TH SarabunPSK" Font.Style="0" ParentFont="False" Text="จำนวนรับ"/>
      <TfrxMemoView Name="Memo9" Left="663.1107" Top="0" Width="219.21274" Height="22.67718" Font.Charset="1" Font.Color="-16777208" Font.Height="-19" Font.Name="TH SarabunPSK" Font.Style="0" HAlign="haCenter" ParentFont="False" Text="ชื่อยา"/>
      <TfrxMemoView Name="Memo10" Left="985.40229" Top="0" Width="83.14966" Height="22.67718" Font.Charset="1" Font.Color="-16777208" Font.Height="-19" Font.Name="TH SarabunPSK" Font.Style="0" ParentFont="False" Text="ขนาดบรรจุ"/>
      <TfrxMemoView Name="Memo11" Left="1069.28417" Top="0" Width="71.81102362" Height="22.67718" Font.Charset="1" Font.Color="-16777208" Font.Height="-19" Font.Name="TH SarabunPSK" Font.Style="0" ParentFont="False" Text="มูลค่าบริจาค"/>
      <TfrxMemoView Name="Memo18" Left="91.16543" Top="0" Width="154.96062992" Height="22.67718" Font.Charset="1" Font.Color="-16777208" Font.Height="-19" Font.Name="TH SarabunPSK" Font.Style="0" ParentFont="False" Text="ผู้ขาย"/>
      <TfrxMemoView Name="Memo8" Left="0.51128378" Top="0" Width="90.70866142" Height="22.67718" Font.Charset="1" Font.Color="-16777208" Font.Height="-19" Font.Name="TH SarabunPSK" Font.Style="0" ParentFont="False" Text="เลขที่สั่งซื้อ"/>
      <TfrxMemoView Name="Memo2" Left="246.66945" Top="0" Width="98.26778" Height="22.67718" Font.Charset="1" Font.Color="-16777208" Font.Height="-19" Font.Name="TH SarabunPSK" Font.Style="0" ParentFont="False" Text="วันที่รับ"/>
      <TfrxMemoView Name="Memo14" Left="345.582677165354" Top="0" Width="86.92919" Height="22.67718" Font.Charset="1" Font.Color="-16777208" Font.Height="-19" Font.Name="TH SarabunPSK" Font.Style="0" HAlign="haCenter" ParentFont="False" Text="มูลค่าซื้อ"/>
      <TfrxMemoView Name="Memo5" Left="432.32313" Top="0" Width="79.37013" Height="22.67718" Font.Charset="1" Font.Color="-16777208" Font.Height="-19" Font.Name="TH SarabunPSK" Font.Style="0" ParentFont="False" Text="เลขที่บิล"/>
      <TfrxMemoView Name="Memo4" Left="512.01601654" Top="0" Width="75.59055118" Height="22.67718" Font.Charset="1" Font.Color="-16777208" Font.Height="-19" Font.Name="TH SarabunPSK" Font.Style="0" ParentFont="False" Text="เลขที่รับ"/>
      <TfrxMemoView Name="Memo6" Left="587.60668" Top="0" Width="75.59055118" Height="22.67718" Font.Charset="1" Font.Color="-16777208" Font.Height="-19" Font.Name="TH SarabunPSK" Font.Style="0" ParentFont="False" Text="ประเภท"/>
    </TfrxHeader>
  </TfrxReportPage>
  <TfrxDialogPage Name="DialogPage1" Font.Charset="1" Font.Color="0" Font.Height="-11" Font.Name="Tahoma" Font.Style="0" BorderStyle="bsDialog" Caption="ÃÒ§ҹ¡ÒÃÃѺàǪÀѳ±ì" Color="16770263" Height="327" ClientHeight="289" Left="477" Position="poMainFormCenter" Top="231" Width="521" ClientWidth="505" OnActivate="DialogPage1OnActivate">
    <TfrxDateEditControl Name="date1" Left="132" Top="67" Width="117" Height="25" Font.Charset="1" Font.Color="0" Font.Height="-16" Font.Name="MS Sans Serif" Font.Style="0" ParentFont="False" ShowHint="True" Color="-16777211" Date="41559.6971358681" Time="41559.6971358681" WeekNumbers="False"/>
    <TfrxDateEditControl Name="date2" Left="308" Top="67" Width="117" Height="25" Font.Charset="1" Font.Color="0" Font.Height="-16" Font.Name="MS Sans Serif" Font.Style="0" ParentFont="False" ShowHint="True" Color="-16777211" Date="41559.6971358681" Time="41559.6971358681" WeekNumbers="False"/>
    <TfrxBitBtnControl Name="BitBtn1" Left="220" Top="184" Width="87" Height="33" Font.Charset="0" Font.Color="-16777208" Font.Height="-21" Font.Name="AngsanaUPC" Font.Style="0" ParentFont="False" ShowHint="True" Glyph.PropData="04446174610AE2010000DE010000424DDE01000000000000760000002800000024000000120000000100040000000000680100000000000000000000100000000000000000000000000080000080000000808000800000008000800080800000C0C0C000808080000000FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFFFF003333333333333333333333333333333333330000333333333333333333333333F3333333333300003333344333333333333333388F3333333333000033334224333333333333338338F3333333330000333422224333333333333833338F3333333300003342222224333333333383333338F3333333000034222A22224333333338F338F3338F33333300003222A3A2224333333338F3838F338F33333300003A2A333A222433333338F83338F338F33333000033A33333A222433333338333338F338F33330000333333333A222433333333333338F338F33300003333333333A222433333333333338F338F33000033333333333A222433333333333338F338F30000333333333333A222433333333333338F338F00003333333333333A224333333333333338F38F000033333333333333A223333333333333338F830000333333333333333A3333333333333333383300003333333333333333333333333333333333330000" Kind="bkOK" Caption="OK" ModalResult="1" NumGlyphs="2"/>
    <TfrxLabelControl Name="Label1" Left="60" Top="72" Width="60" Height="20" Font.Charset="0" Font.Color="-16777208" Font.Height="-16" Font.Name="MS Sans Serif" Font.Style="0" ParentFont="False" ShowHint="True" Caption="µÑé§áµèÇѹ·Õè" Color="16768462"/>
    <TfrxLabelControl Name="Label2" Left="260" Top="69" Width="42" Height="20" Font.Charset="0" Font.Color="-16777208" Font.Height="-16" Font.Name="MS Sans Serif" Font.Style="0" ParentFont="False" ShowHint="True" Caption="¶֧Çѹ·Õè" Color="16768462"/>
    <TfrxDBLookupComboBox Name="cbb_dept" Left="130" Top="115" Width="297" Height="25" Font.Charset="1" Font.Color="0" Font.Height="-16" Font.Name="Tahoma" Font.Style="0" ParentFont="False" ShowHint="True" DataSet="qry_dept" DataSetName="dept" ListField="DEPT_NAME" KeyField="DEPT_ID" DropDownWidth="0" DropDownRows="7"/>
    <TfrxLabelControl Name="Label3" Left="91" Top="114" Width="24" Height="20" Font.Charset="0" Font.Color="-16777208" Font.Height="-16" Font.Name="MS Sans Serif" Font.Style="0" ParentFont="False" ShowHint="True" Caption="¤Åѧ" Color="16768462"/>
  </TfrxDialogPage>
</TfrxReport>
