<?xml version="1.0" encoding="utf-8"?>
<TfrxReport Version="5.2.12" DotMatrixReport="False" IniFile="\Software\Fast Reports" PreviewOptions.Buttons="4095" PreviewOptions.Zoom="1" PrintOptions.Printer="Default" PrintOptions.PrintOnSheet="0" ReportOptions.CreateDate="41380.5820669097" ReportOptions.Description.Text="" ReportOptions.LastChange="42970.6808964352" ScriptLanguage="PascalScript" ScriptText.Text="var&#13;&#10; lineno: integer ;&#13;&#10; qty_orderx: string ;                                          &#13;&#10;   &#13;&#10;procedure Page1OnBeforePrint(Sender: TfrxComponent);&#13;&#10;begin&#13;&#10;  lineno:= 0 ;&#13;&#10;    &#13;&#10;end;&#13;&#10;&#13;&#10;procedure LineOnBeforePrint(Sender: TfrxComponent);&#13;&#10;begin&#13;&#10; // lineno:=lineno+1 ;                                     &#13;&#10;end;&#13;&#10;&#13;&#10;procedure Memo11OnBeforePrint(Sender: TfrxComponent);&#13;&#10;begin&#13;&#10;    if (&#60;SMPOC.&#34;QTY_RCV&#34;&#62;mod&#60;SMPOC.&#34;PACK_RATIO&#34;&#62;)  &#62;   0 then &#13;&#10;     qty_orderx:= inttostr(TRUNC(&#60;SMPOC.&#34;QTY_RCV&#34;&#62;/&#60;SMPOC.&#34;PACK_RATIO&#34;&#62;))+ ' x ' + inttostr(&#60;SMPOC.&#34;PACK_RATIO&#34;&#62;) +' (+' + inttostr(&#60;SMPOC.&#34;QTY_RCV&#34;&#62;mod&#60;SMPOC.&#34;PACK_RATIO&#34;&#62;)+')'        &#13;&#10;     else &#13;&#10;      qty_orderx:= inttostr(TRUNC(&#60;SMPOC.&#34;QTY_RCV&#34;&#62;/&#60;SMPOC.&#34;PACK_RATIO&#34;&#62;))+ ' x ' + inttostr(&#60;SMPOC.&#34;PACK_RATIO&#34;&#62;) ;     &#13;&#10;       &#13;&#10;end;&#13;&#10;&#13;&#10;procedure MasterData1OnBeforePrint(Sender: TfrxComponent);&#13;&#10;begin&#13;&#10;  &#13;&#10;    if &#60;SMPOC.&#34;CANCEL_DISP&#34;&#62;&#60;&#62;'' then&#13;&#10;    begin&#13;&#10;      MasterData1.visible:=False ;&#13;&#10;    end&#13;&#10;    else&#13;&#10;    begin&#13;&#10;        MasterData1.visible:=True ;&#13;&#10;       lineno:=lineno+1 ;           &#13;&#10;    end;        &#13;&#10;   &#13;&#10;     &#13;&#10;end;&#13;&#10;&#13;&#10;begin&#13;&#10;&#13;&#10;end.">
  <Datasets>
    <item DataSet="frxDBDataset1" DataSetName="MSIVOC"/>
    <item DataSet="qry_sub" DataSetName="qry_sub"/>
    <item DataSet="user" DataSetName="user"/>
    <item DataSet="dept" DataSetName="dept"/>
  </Datasets>
  <Variables>
    <item Name="sub_po_no"/>
    <item Name="dept_name"/>
    <item Name="po_date"/>
    <item Name="stockname"/>
    <item Name="consol_item"/>
    <item Name="hosp_name"/>
  </Variables>
  <TfrxDataPage Name="Data" Height="1000" Left="0" Top="0" Width="1000">
    <TfrxUniDACQuery Name="qry_sub" UserName="qry_sub" CloseDataSource="True" FieldAliases.Text="" BCDToCurrency="False" IgnoreDupParams="False" SQL.Text="{IF SQLSERVER}&#13;&#10;  &#13;&#10;SELECT i.*,s2.REORDER_QTY*i.RATE_PER_DAY as RATE_DIS                                                  &#13;&#10;FROM INV_MD i (NOLOCK)&#13;&#10;left join SPECIAL s2 (NOLOCK) on (s2.SPECIAL_CODE = i.SPECIAL_CODE)                                                                                                                                              &#13;&#10;WHERE &#13;&#10;i.DEPT_ID =(&#13;&#10;    select s.DEPT_ID from SM_PO s (NOLOCK) &#13;&#10;    where  s.SUB_PO_NO=:SUB_PO_NO              &#13;&#10;)&#13;&#10;and i.WORKING_CODE=:WORKING_CODE  &#13;&#10;&#13;&#10;{ELSE}&#13;&#10;&#13;&#10;SELECT i.*,s2.REORDER_QTY*i.RATE_PER_DAY as RATE_DIS          &#13;&#10;FROM INV_MD i &#13;&#10;left join SPECIAL s2  on (s2.SPECIAL_CODE = i.SPECIAL_CODE)                               &#13;&#10;WHERE &#13;&#10;i.DEPT_ID =(&#13;&#10;    select s.DEPT_ID from SM_PO s  &#13;&#10;    where  s.SUB_PO_NO=:SUB_PO_NO              &#13;&#10;)  &#13;&#10;and i.WORKING_CODE=:WORKING_CODE  &#13;&#10;&#13;&#10;{ENDIF}                &#13;&#10;  " SpecificOptions.Text="" PropData="05704C656674032C010470546F7003A0000A506172616D657465727301010C56000000204E616D653D225355425F504F5F4E4F222044617461547970653D226674537472696E67222045787072657373696F6E3D22262336303B534D504F432E262333343B5355425F504F5F4E4F262333343B262336323B2200010C5C000000204E616D653D22574F524B494E475F434F4445222044617461547970653D226674537472696E67222045787072657373696F6E3D22262336303B534D504F432E262333343B574F524B494E475F434F4445262333343B262336323B2200010C56000000204E616D653D225355425F504F5F4E4F222044617461547970653D226674537472696E67222045787072657373696F6E3D22262336303B534D504F432E262333343B5355425F504F5F4E4F262333343B262336323B2200010C5C000000204E616D653D22574F524B494E475F434F4445222044617461547970653D226674537472696E67222045787072657373696F6E3D22262336303B534D504F432E262333343B574F524B494E475F434F4445262333343B262336323B220000"/>
    <TfrxUniDACQuery Name="user" UserName="user" CloseDataSource="True" FieldAliases.Text="" BCDToCurrency="False" IgnoreDupParams="False" SQL.Text="SELECT p.*&#13;&#10;FROM&#13;&#10;    profile p (NOLOCK)                             &#13;&#10;WHERE&#13;&#10;    p.UserCode =:UserCode  " SpecificOptions.Text="" PropData="05704C65667403A0010470546F700318010A506172616D657465727301010C53000000204E616D653D2255736572436F6465222044617461547970653D226674537472696E67222045787072657373696F6E3D22262336303B534D504F432E262333343B555345525F4944262333343B262336323B220000"/>
    <TfrxUniDACQuery Name="dept" UserName="dept" CloseDataSource="True" FieldAliases.Text="" BCDToCurrency="False" IgnoreDupParams="False" SQL.Text="select * from DEPT_ID (NOLOCK) &#13;&#10;where DEPT_ID=(select STOCK_ID from SM_PO                                                    &#13;&#10;               where SUB_PO_NO=:sub_po_no)  " SpecificOptions.Text="" PropData="05704C65667403A4000470546F700304010A506172616D657465727301010C56000000204E616D653D227375625F706F5F6E6F222044617461547970653D226674537472696E67222045787072657373696F6E3D22262336303B534D504F432E262333343B5355425F504F5F4E4F262333343B262336323B220000"/>
  </TfrxDataPage>
  <TfrxReportPage Name="Page1" Font.Charset="1" Font.Color="0" Font.Height="-13" Font.Name="Arial" Font.Style="1" PaperWidth="210" PaperHeight="297" PaperSize="9" LeftMargin="10" RightMargin="5" TopMargin="10" BottomMargin="10" ColumnWidth="0" ColumnPositions.Text="" HGuides.Text="" VGuides.Text="" OnBeforePrint="Page1OnBeforePrint">
    <TfrxMasterData Name="MasterData1" FillType="ftBrush" FillGap.Top="0" FillGap.Left="0" FillGap.Bottom="0" FillGap.Right="0" Height="26.45671" Left="0" Top="268.34663" Width="737.00835" OnBeforePrint="MasterData1OnBeforePrint" AllowSplit="True" ColumnWidth="0" ColumnGap="0" DataSet="frxDBDataset1" DataSetName="MSIVOC" RowCount="0" Stretched="True">
      <TfrxMemoView Name="Memo5" Left="21.44094" Top="0.67718" Width="45.35436" Height="22.67718" AllowHTMLTags="True" Font.Charset="1" Font.Color="-16777208" Font.Height="-19" Font.Name="AngsanaUPC" Font.Style="0" ParentFont="False" Text="[SMPOC.&#34;WORKING_CODE&#34;]"/>
      <TfrxMemoView Name="Memo7" ShiftMode="smWhenOverlapped" Left="60.01577" Top="0.67718" Width="249.44898" Height="22.67718" StretchMode="smMaxHeight" AllowHTMLTags="True" Font.Charset="1" Font.Color="-16777208" Font.Height="-19" Font.Name="AngsanaUPC" Font.Style="0" ParentFont="False" Text="[TRIM(&#60;SMPOC.&#34;DRUG_NAME&#34;&#62;)]"/>
      <TfrxMemoView Name="Memo8" Left="504.24428" Top="0.01577" Width="41.57483" Height="22.67718" AllowHTMLTags="True" DataSet="frxDBDataset1" DataSetName="MSIVOC" Font.Charset="1" Font.Color="-16777208" Font.Height="-19" Font.Name="AngsanaUPC" Font.Style="0" HAlign="haRight" ParentFont="False" Text="[SMPOC.&#34;SALE_UNIT&#34;]"/>
      <TfrxMemoView Name="Memo9" Left="553.03958" Top="4.01577" Width="49.13389" Height="22.67718" AllowHTMLTags="True" Font.Charset="1" Font.Color="-16777208" Font.Height="-19" Font.Name="AngsanaUPC" Font.Style="0" ParentFont="False" Text="[SMPOC.&#34;LOT_NO&#34;]"/>
      <TfrxMemoView Name="Memo11" Left="450.05535" Top="0.22047" Width="60.47248" Height="22.67718" OnBeforePrint="Memo11OnBeforePrint" StretchMode="smActualHeight" AllowHTMLTags="True" DisplayFormat.FormatStr="%2.0n" DisplayFormat.Kind="fkNumeric" Font.Charset="1" Font.Color="-16777208" Font.Height="-19" Font.Name="AngsanaUPC" Font.Style="1" HAlign="haRight" ParentFont="False" Text="[qty_orderx]"/>
      <TfrxMemoView Name="Line" Left="1.55906" Top="1.45671" Width="26.45671" Height="22.67718" OnBeforePrint="LineOnBeforePrint" DataSet="frxDBDataset1" DataSetName="MSIVOC" Font.Charset="1" Font.Color="0" Font.Height="-19" Font.Name="AngsanaUPC" Font.Style="0" HAlign="haRight" ParentFont="False" Text="[lineno]. "/>
      <TfrxMemoView Name="Memo24" Left="654.84292" Top="0.89765" Width="75.5906" Height="22.67718" DisplayFormat.FormatStr="%2.2n" DisplayFormat.Kind="fkNumeric" Font.Charset="1" Font.Color="0" Font.Height="-19" Font.Name="AngsanaUPC" Font.Style="0" HAlign="haRight" ParentFont="False" Text="[&#60;SMPOC.&#34;VALUE&#34;&#62;]"/>
      <TfrxMemoView Name="SMPOCexpired_date" Left="598.60668" Top="1.67718" Width="68.03154" Height="22.67718" DataSet="frxDBDataset1" DataSetName="MSIVOC" Font.Charset="1" Font.Color="0" Font.Height="-19" Font.Name="AngsanaUPC" Font.Style="0" HAlign="haRight" ParentFont="False" Text="[COPY(&#60;SMPOC.&#34;EXPIRED_DATE&#34;&#62;,7,2)]/[COPY(&#60;SMPOC.&#34;EXPIRED_DATE&#34;&#62;,5,2)]/[COPY(&#60;SMPOC.&#34;EXPIRED_DATE&#34;&#62;,1,4)]"/>
      <TfrxMemoView Name="Memo13" Left="393.07112" Top="0" Width="60.47248" Height="22.67718" OnBeforePrint="Memo11OnBeforePrint" StretchMode="smActualHeight" AllowHTMLTags="True" DataField="QTY_RCV" DataSet="frxDBDataset1" DataSetName="MSIVOC" DisplayFormat.FormatStr="%2.0n" DisplayFormat.Kind="fkNumeric" Font.Charset="1" Font.Color="-16777208" Font.Height="-19" Font.Name="AngsanaUPC" Font.Style="0" HAlign="haRight" ParentFont="False" Text="[SMPOC.&#34;QTY_RCV&#34;]"/>
      <TfrxMemoView Name="Memo22" Left="306.14193" Top="0" Width="49.13389" Height="26.45671" AllowHTMLTags="True" Font.Charset="1" Font.Color="-16777208" Font.Height="-19" Font.Name="AngsanaUPC" Font.Style="0" ParentFont="False" Text="[trunc(&#60;qry_sub.&#34;RATE_DIS&#34;&#62;/&#60;SMPOC.&#34;PACK_RATIO&#34;&#62;)] x [SMPOC.&#34;PACK_RATIO&#34;]">
        <Formats>
          <item/>
          <item/>
        </Formats>
      </TfrxMemoView>
      <TfrxMemoView Name="Memo28" Left="359.05535" Top="0" Width="49.13389" Height="26.45671" AllowHTMLTags="True" Font.Charset="1" Font.Color="-16777208" Font.Height="-19" Font.Name="AngsanaUPC" Font.Style="0" ParentFont="False" Text="[trunc(&#60;qry_sub.&#34;QTY_ON_HAND&#34;&#62;/&#60;SMPOC.&#34;PACK_RATIO&#34;&#62;)] x [SMPOC.&#34;PACK_RATIO&#34;]">
        <Formats>
          <item/>
          <item/>
        </Formats>
      </TfrxMemoView>
    </TfrxMasterData>
    <TfrxPageFooter Name="PageFooter1" FillType="ftBrush" FillGap.Top="0" FillGap.Left="0" FillGap.Bottom="0" FillGap.Right="0" Height="230.55133" Left="0" Top="449.76407" Width="737.00835">
      <TfrxMemoView Name="Memo15" Left="20.01577" Top="73.69295" Width="249.44898" Height="49.13389" Font.Charset="1" Font.Color="0" Font.Height="-21" Font.Name="AngsanaUPC" Font.Style="0" HAlign="haCenter" ParentFont="False" Text="ลงชื่อ............................................(ผู้เบิก)&#13;&#10;([trim(&#60;user.&#34;firstName&#34;&#62;)] [trim(&#60;user.&#34;lastName&#34;&#62;)])"/>
      <TfrxMemoView Name="Memo16" Left="20.01577" Top="164.60637" Width="249.44898" Height="49.13389" Font.Charset="1" Font.Color="0" Font.Height="-21" Font.Name="AngsanaUPC" Font.Style="0" HAlign="haCenter" ParentFont="False" Text="ลงชื่อ............................................(ผู้อนุมัติ)&#13;&#10;([dept.&#34;SUPPLY_OFFICER&#34;])"/>
      <TfrxMemoView Name="Memo25" Left="443.32313" Top="73.69295" Width="249.44898" Height="49.13389" Font.Charset="1" Font.Color="0" Font.Height="-21" Font.Name="AngsanaUPC" Font.Style="0" HAlign="haCenter" ParentFont="False" Text="ลงชื่อ............................................(ผู้จ่าย)&#13;&#10;([dept.&#34;SUPPLY_DIRECTOR&#34;])"/>
      <TfrxMemoView Name="Memo26" Left="443.32313" Top="163.82684" Width="249.44898" Height="49.13389" Font.Charset="1" Font.Color="0" Font.Height="-21" Font.Name="AngsanaUPC" Font.Style="0" HAlign="haCenter" ParentFont="False" Text="ลงชื่อ............................................(ผู้รับ)&#13;&#10;(..............................................................)"/>
    </TfrxPageFooter>
    <TfrxPageHeader Name="PageHeader1" FillType="ftBrush" FillGap.Top="0" FillGap.Left="0" FillGap.Bottom="0" FillGap.Right="0" Height="166.29932" Left="0" Top="18.89765" Width="737.00835">
      <TfrxMemoView Name="Memo2" Left="3.77953" Top="2.33859" Width="718.1107" Height="26.45671" Font.Charset="1" Font.Color="-16777208" Font.Height="-21" Font.Name="AngsanaUPC" Font.Style="1" HAlign="haCenter" ParentFont="False" Text="[hosp_name]"/>
      <TfrxMemoView Name="Memo4" Left="5.55906" Top="29.01577" Width="714.33117" Height="26.45671" Font.Charset="1" Font.Color="-16777208" Font.Height="-21" Font.Name="AngsanaUPC" Font.Style="0" HAlign="haCenter" ParentFont="False" Text="ใบอนุมัติเบิก"/>
      <TfrxMemoView Name="Memo6" Left="6.55906" Top="56.91342" Width="336.37817" Height="75.5906" AllowHTMLTags="True" Font.Charset="222" Font.Color="-16777208" Font.Height="-21" Font.Name="AngsanaUPC" Font.Style="0" ParentFont="False" Text="&#60;b&#62;เลขที่เบิก&#60;/b&#62;  [sub_po_no]      &#13;&#10;&#60;b&#62;หน่วยงานที่ขอเบิก&#60;/b&#62;  [dept_name]&#13;&#10;อนุมัติให้เบิกเวชภัณฑ์ตามรายการต่อไปนี้"/>
      <TfrxMemoView Name="Memo1" Left="597.16574" Top="11.55906" Width="117.16543" Height="26.45671" Font.Charset="1" Font.Color="0" Font.Height="-21" Font.Name="AngsanaUPC" Font.Style="0" HAlign="haRight" ParentFont="False" Text="หน้า [Page#]/[TotalPages#]"/>
      <TfrxMemoView Name="Memo18" Left="445.98454" Top="49.13389" Width="275.90569" Height="79.37013" AllowHTMLTags="True" Font.Charset="222" Font.Color="-16777208" Font.Height="-21" Font.Name="AngsanaUPC" Font.Style="0" HAlign="haRight" ParentFont="False" Text="&#60;b&#62;วันที่อนุมัติ&#60;/b&#62;  [po_date]     &#13;&#10;&#60;b&#62;หน่วยงานที่จ่าย&#60;/b&#62; [stockname]"/>
      <TfrxLineView Name="Line3" Left="1.22047" Top="138.84261" Width="714.33117" Height="0" Color="0" Frame.Color="12632256" Diagonal="True"/>
      <TfrxLineView Name="Line4" Left="0.22047" Top="164.96073" Width="714.33117" Height="0" Color="0" Frame.Color="12632256" Diagonal="True"/>
      <TfrxMemoView Name="Memo12" Left="202.53556" Top="139.28355" Width="83.14966" Height="22.67718" Font.Charset="1" Font.Color="0" Font.Height="-19" Font.Name="AngsanaUPC" Font.Style="0" ParentFont="False" Text="ชื่อเวชภัณฑ์"/>
      <TfrxMemoView Name="Memo14" Left="619.16574" Top="139.06308" Width="41.57483" Height="26.45671" Font.Charset="1" Font.Color="0" Font.Height="-19" Font.Name="AngsanaUPC" Font.Style="0" HAlign="haCenter" ParentFont="False" Text="EXP"/>
      <TfrxMemoView Name="Memo17" Left="666.29963" Top="141.84261" Width="52.91342" Height="22.67718" Font.Charset="1" Font.Color="0" Font.Height="-19" Font.Name="AngsanaUPC" Font.Style="0" HAlign="haCenter" ParentFont="False" Text="รวมมูลค่า"/>
      <TfrxMemoView Name="Memo21" Left="467.05535" Top="138.84261" Width="56.69295" Height="26.45671" Font.Charset="1" Font.Color="0" Font.Height="-19" Font.Name="AngsanaUPC" Font.Style="0" ParentFont="False" Text="จน.อนุมัติ"/>
      <TfrxMemoView Name="Memo3" Left="35.55906" Top="138.84261" Width="49.13389" Height="22.67718" Font.Charset="1" Font.Color="-16777208" Font.Height="-19" Font.Name="AngsanaUPC" Font.Style="0" ParentFont="False" Text="รหัสยา"/>
      <TfrxMemoView Name="Memo19" Left="568.61441" Top="137.84261" Width="45.35436" Height="26.45671" Font.Charset="1" Font.Color="0" Font.Height="-19" Font.Name="AngsanaUPC" Font.Style="0" HAlign="haCenter" ParentFont="False" Text="Lot No."/>
      <TfrxMemoView Name="Memo20" Left="523.37817" Top="138.62214" Width="34.01577" Height="26.45671" Font.Charset="1" Font.Color="0" Font.Height="-19" Font.Name="AngsanaUPC" Font.Style="0" ParentFont="False" Text="หน่วย"/>
      <TfrxMemoView Name="Memo10" Left="411.96877" Top="139.84261" Width="56.69295" Height="26.45671" Font.Charset="1" Font.Color="0" Font.Height="-19" Font.Name="AngsanaUPC" Font.Style="0" ParentFont="False" Text="จน.เบิก"/>
      <TfrxMemoView Name="Memo23" Left="321.26005" Top="139.84261" Width="34.01577" Height="22.67718" Font.Charset="1" Font.Color="0" Font.Height="-19" Font.Name="AngsanaUPC" Font.Style="0" ParentFont="False" Text="Rate"/>
      <TfrxMemoView Name="Memo29" Left="366.61441" Top="139.84261" Width="41.57483" Height="26.45671" Font.Charset="1" Font.Color="0" Font.Height="-19" Font.Name="AngsanaUPC" Font.Style="0" ParentFont="False" Text="คงคลัง"/>
    </TfrxPageHeader>
    <TfrxReportSummary Name="ReportSummary1" FillType="ftBrush" FillGap.Top="0" FillGap.Left="0" FillGap.Bottom="0" FillGap.Right="0" Height="0" Left="0" Top="427.08689" Width="737.00835"/>
    <TfrxGroupHeader Name="GroupHeader1" FillType="ftBrush" FillGap.Top="0" FillGap.Left="0" FillGap.Bottom="0" FillGap.Right="0" Height="0" Left="0" Top="245.66945" Width="737.00835" Condition="SMPOC.&#34;SUB_PO_NO&#34;" KeepTogether="True" StartNewPage="True"/>
    <TfrxGroupFooter Name="GroupFooter1" FillType="ftBrush" FillGap.Top="0" FillGap.Left="0" FillGap.Bottom="0" FillGap.Right="0" Height="49.13389" Left="0" Top="317.48052" Width="737.00835">
      <TfrxMemoView Name="Memo27" Left="121.94496" Top="11.26778" Width="593.38621" Height="30.23624" AllowHTMLTags="True" DisplayFormat.FormatStr="%2.0n" Font.Charset="1" Font.Color="0" Font.Height="-21" Font.Name="AngsanaUPC" Font.Style="0" HAlign="haRight" ParentFont="False" Text="รวมทั้งหมด  &#60;b&#62;[COUNT(MasterData1)]&#60;/b&#62;   รายการ  คิดเป็นมูลค่า &#60;b&#62;[FormatFloat('#,##0.00',SUM(&#60;SMPOC.&#34;VALUE&#34;&#62;,MasterData1))]&#60;/b&#62;  บาท"/>
      <TfrxLineView Name="Line1" Left="3.77953" Top="8.60637" Width="710.55164" Height="0" Color="0" Frame.Color="12632256" Diagonal="True"/>
    </TfrxGroupFooter>
  </TfrxReportPage>
</TfrxReport>
