<?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="42239.5970587269" ScriptLanguage="PascalScript" ScriptText.Text="var&#13;&#10;  qty_orderx,total_qtyorder,total_qtyrcv,total_remain: string ;                                                     &#13;&#10;  qty_rcvi,qty_orderi,lineno :integer ;                                                                     &#13;&#10; &#13;&#10;&#13;&#10;procedure MasterData1OnBeforePrint(Sender: TfrxComponent);&#13;&#10;begin&#13;&#10;   qry_invmd.close ;&#13;&#10;   qry_invmd.open ;&#13;&#10;     &#13;&#10;   qry_invmdc.close ;&#13;&#10;   qry_invmdc.open ;&#13;&#10;&#13;&#10;    qty_orderi:=qty_orderi + &#60;SMPOC.&#34;QTY_ORDER&#34;&#62; ; &#13;&#10;     qty_rcvi:=qty_rcvi + &#60;SMPOC.&#34;QTY_RCV&#34;&#62; ;&#13;&#10;&#13;&#10;                                                                                                              &#13;&#10;end;&#13;&#10;&#13;&#10;procedure qty_rcv1OnBeforePrint(Sender: TfrxComponent);&#13;&#10;begin&#13;&#10;&#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;    &#13;&#10;end;&#13;&#10;  &#13;&#10;&#13;&#10;procedure Memo10OnBeforePrint(Sender: TfrxComponent);&#13;&#10;begin&#13;&#10;   &#13;&#10;   if  (qty_orderi mod &#60;SMPOC.&#34;PACK_RATIO&#34;&#62;) &#62; 0 then&#13;&#10;      total_qtyorder:= inttostr(TRUNC(qty_orderi/&#60;SMPOC.&#34;PACK_RATIO&#34;&#62;))&#13;&#10;                      +' x '+ inttostr(&#60;SMPOC.&#34;PACK_RATIO&#34;&#62;)&#13;&#10;                      +' (+'+inttostr( qty_orderi mod &#60;SMPOC.&#34;PACK_RATIO&#34;&#62;)+')'&#13;&#10;   else&#13;&#10;      total_qtyorder:= inttostr(TRUNC(qty_orderi /&#60;SMPOC.&#34;PACK_RATIO&#34;&#62;))&#13;&#10;                      +' x '+ inttostr(&#60;SMPOC.&#34;PACK_RATIO&#34;&#62;);&#13;&#10;&#13;&#10; //*********************************************************************************************************                                                                                                                                                                                                                                  &#13;&#10;      &#13;&#10;     if  ( qty_rcvi mod &#60;SMPOC.&#34;PACK_RATIO&#34;&#62;) &#62; 0 then&#13;&#10;         total_qtyrcv:= inttostr(TRUNC( qty_rcvi/&#60;SMPOC.&#34;PACK_RATIO&#34;&#62;))&#13;&#10;                      +' x '+ inttostr(&#60;SMPOC.&#34;PACK_RATIO&#34;&#62;)&#13;&#10;                      +' (+'+inttostr(  qty_rcvi mod &#60;SMPOC.&#34;PACK_RATIO&#34;&#62;)+')'&#13;&#10;     else&#13;&#10;         total_qtyrcv:= inttostr(TRUNC( qty_rcvi /&#60;SMPOC.&#34;PACK_RATIO&#34;&#62;))&#13;&#10;                      +' x '+ inttostr(&#60;SMPOC.&#34;PACK_RATIO&#34;&#62;);&#13;&#10;&#13;&#10; //**********************************************************************************************************&#13;&#10;&#13;&#10;    if (&#60;SMPOC.&#34;QTY_ON_HAND&#34;&#62; mod &#60;SMPOC.&#34;PACK_RATIO&#34;&#62;) &#62; 0 then&#13;&#10;       total_remain:= inttostr(TRUNC( &#60;SMPOC.&#34;QTY_ON_HAND&#34;&#62;/&#60;SMPOC.&#34;PACK_RATIO&#34;&#62;))&#13;&#10;                      +' x '+ inttostr(&#60;SMPOC.&#34;PACK_RATIO&#34;&#62;)&#13;&#10;                      +' (+'+inttostr( &#60;SMPOC.&#34;QTY_ON_HAND&#34;&#62; mod &#60;SMPOC.&#34;PACK_RATIO&#34;&#62;)+')'&#13;&#10;     else&#13;&#10;         total_remain:= inttostr(TRUNC( &#60;SMPOC.&#34;QTY_ON_HAND&#34;&#62; /&#60;SMPOC.&#34;PACK_RATIO&#34;&#62;))&#13;&#10;                      +' x '+ inttostr(&#60;SMPOC.&#34;PACK_RATIO&#34;&#62;);      &#13;&#10;end;&#13;&#10;&#13;&#10;procedure GroupHeader1OnBeforePrint(Sender: TfrxComponent);&#13;&#10;begin&#13;&#10;   qty_rcvi:=0 ; &#13;&#10;   qty_orderi:=0 ;&#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;     GroupHeader1.visible:=False ;&#13;&#10;     Footer1.visible:=False ;&#13;&#10;             &#13;&#10;   end&#13;&#10;   else&#13;&#10;   begin&#13;&#10;     MasterData1.visible:=True ;&#13;&#10;     GroupHeader1.visible:=True ;&#13;&#10;     Footer1.visible:=True ;&#13;&#10;      lineno:=lineno+1 ;         &#13;&#10;   end;             &#13;&#10;         &#13;&#10;end;&#13;&#10;&#13;&#10;procedure Page1OnBeforePrint(Sender: TfrxComponent);&#13;&#10;begin&#13;&#10;    if &#60;consol_item&#62; = 'Y' then &#13;&#10;  begin &#13;&#10;      GroupHeader2.Condition:='SMPOC.&#34;SUB_PO_NO&#34;';                 &#13;&#10;  end&#13;&#10;  else&#13;&#10;  begin&#13;&#10;      GroupHeader2.Condition:='SMPOC.&#34;LOCATE&#34;';      &#13;&#10;  end;  &#13;&#10;end;&#13;&#10;&#13;&#10;begin            &#13;&#10;end.                                ">
  <Datasets>
    <item DataSet="frxDBDataset1" DataSetName="SMPOC"/>
    <item DataSet="qry_invmdc" DataSetName="invmdc"/>
    <item DataSet="qry_invmd" DataSetName="invmd"/>
  </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_invmdc" UserName="invmdc" CloseDataSource="True" FieldAliases.Text="" BCDToCurrency="False" IgnoreDupParams="False" SQL.Text="select * from INV_MD_C (NOLOCK) where DEPT_ID=:stock_id and TRADE_CODE=:trade_code and EXPIRED_DATE=:expired_date and LOT_NO=:lot_no  " SpecificOptions.Text="" PropData="05704C65667403E0000470546F7003B4000A506172616D657465727301010C54000000204E616D653D2273746F636B5F6964222044617461547970653D226674537472696E67222045787072657373696F6E3D22262336303B534D504F432E262333343B53544F434B5F4944262333343B262336323B2200010C58000000204E616D653D2274726164655F636F6465222044617461547970653D226674537472696E67222045787072657373696F6E3D22262336303B534D504F432E262333343B54524144455F434F4445262333343B262336323B2200010C5C000000204E616D653D22657870697265645F64617465222044617461547970653D226674537472696E67222045787072657373696F6E3D22262336303B534D504F432E262333343B455850495245445F44415445262333343B262336323B2200010C50000000204E616D653D226C6F745F6E6F222044617461547970653D226674537472696E67222045787072657373696F6E3D22262336303B534D504F432E262333343B4C4F545F4E4F262333343B262336323B220000"/>
    <TfrxUniDACQuery Name="qry_invmd" UserName="invmd" CloseDataSource="True" FieldAliases.Text="" BCDToCurrency="False" IgnoreDupParams="False" SQL.Text="select SUM(QTY_ON_HAND) as QTY_ON_HAND from INV_MD (NOLOCK) where DEPT_ID=:stock_id and WORKING_CODE=:trade_code  " SpecificOptions.Text="" PropData="05704C65667403E0000470546F7003FC000A506172616D657465727301010C54000000204E616D653D2273746F636B5F6964222044617461547970653D226674537472696E67222045787072657373696F6E3D22262336303B534D504F432E262333343B53544F434B5F4944262333343B262336323B2200010C5A000000204E616D653D2274726164655F636F6465222044617461547970653D226674537472696E67222045787072657373696F6E3D22262336303B534D504F432E262333343B574F524B494E475F434F4445262333343B262336323B220000"/>
  </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="10" 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="287.24428" Width="718.1107" OnBeforePrint="MasterData1OnBeforePrint" ColumnWidth="0" ColumnGap="0" DataSet="frxDBDataset1" DataSetName="SMPOC" RowCount="0">
      <TfrxMemoView Name="INV_MD_CEXPIRED_DATE" Left="524.953" Top="1.1812" Width="64.25201" Height="22.67718" DataSetName="inv_md_c" Font.Charset="1" Font.Color="0" Font.Height="-19" Font.Name="AngsanaUPC" Font.Style="0" 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="INV_MD_CQTY_ON_HAND" Left="618.94527" Top="1.1812" Width="83.14966" Height="22.67718" DisplayFormat.FormatStr="%2.0n" DisplayFormat.Kind="fkNumeric" Font.Charset="1" Font.Color="0" Font.Height="-19" Font.Name="AngsanaUPC" Font.Style="0" HAlign="haRight" ParentFont="False" Text="[invmd.&#34;QTY_ON_HAND&#34;]"/>
      <TfrxMemoView Name="qty_rcv1" Left="323.75603" Top="1.1812" Width="124.72449" Height="22.67718" OnBeforePrint="qty_rcv1OnBeforePrint" DisplayFormat.FormatStr="%2.0n" DisplayFormat.Kind="fkNumeric" Font.Charset="1" Font.Color="0" Font.Height="-19" Font.Name="AngsanaUPC" Font.Style="0" HAlign="haRight" ParentFont="False" Text="[qty_orderx]"/>
      <TfrxMemoView Name="INV_MD_CLOCATION" Left="585.5436" Top="1.40167" Width="52.91342" Height="22.67718" DataSetName="inv_md_c" Font.Charset="1" Font.Color="-16777208" Font.Height="-19" Font.Name="AngsanaUPC" Font.Style="0" HAlign="haRight" ParentFont="False" Text="[SMPOC.&#34;LOCATE&#34;]"/>
      <TfrxMemoView Name="DRUG_VNTRADE_NAME" Left="38.7953" Top="1.26778" Width="313.70099" Height="22.67718" DataSetName="DRUG_VN" Font.Charset="1" Font.Color="-16777208" Font.Height="-19" Font.Name="AngsanaUPC" Font.Style="0" ParentFont="False" Text="[SMPOC.&#34;TRADE_NAME&#34;]"/>
      <TfrxMemoView Name="SMPOCLOT_NO" Left="448.03958" Top="1.77953" Width="64.25201" Height="22.67718" DataSet="frxDBDataset1" DataSetName="SMPOC" Font.Charset="1" Font.Color="-16777208" Font.Height="-19" Font.Name="AngsanaUPC" Font.Style="0" HAlign="haRight" ParentFont="False" Text="[TRIM(&#60;SMPOC.&#34;LOT_NO&#34;&#62;)]"/>
    </TfrxMasterData>
    <TfrxPageFooter Name="PageFooter1" FillType="ftBrush" FillGap.Top="0" FillGap.Left="0" FillGap.Bottom="0" FillGap.Right="0" Height="0" Left="0" Top="468.66172" Width="718.1107"/>
    <TfrxGroupHeader Name="GroupHeader1" FillType="ftBrush" FillGap.Top="0" FillGap.Left="0" FillGap.Bottom="0" FillGap.Right="0" Height="56.69295" Left="0" Top="207.87415" Width="718.1107" OnBeforePrint="GroupHeader1OnBeforePrint" Condition="SMPOC.&#34;WORKING_CODE&#34;" KeepTogether="True">
      <TfrxMemoView Name="Memo5" Left="39.77953" Top="0.77953" Width="434.64595" Height="30.23624" AllowHTMLTags="True" Font.Charset="1" Font.Color="-16777208" Font.Height="-19" Font.Name="AngsanaUPC" Font.Style="0" ParentFont="False" Text="รหัสยา&#60;b&#62; [SMPOC.&#34;WORKING_CODE&#34;]  &#60;/b&#62;ชื่อยาสามัญ&#60;b&#62; [SMPOC.&#34;DRUG_NAME&#34;]&#60;/b&#62;"/>
      <TfrxMemoView Name="Memo8" Left="468.86642" Top="0.89765" Width="132.28355" Height="30.23624" AllowHTMLTags="True" Font.Charset="1" Font.Color="-16777208" Font.Height="-19" Font.Name="AngsanaUPC" Font.Style="0" ParentFont="False" Text="หน่วยบรรจุ &#60;b&#62; [SMPOC.&#34;SALE_UNIT&#34;]&#60;/b&#62; "/>
      <TfrxMemoView Name="Memo9" Left="604.70903" Top="0.89765" Width="109.60637" Height="30.23624" AllowHTMLTags="True" Font.Charset="1" Font.Color="-16777208" Font.Height="-19" Font.Name="AngsanaUPC" Font.Style="0" ParentFont="False" Text="รูปแบบ &#60;b&#62;[SMPOC.&#34;DOSAGE_FORM&#34;]&#60;/b&#62;"/>
      <TfrxMemoView Name="Line" Left="6.77953" Top="0.55906" Width="30.23624" Height="30.23624" DataSet="frxDBDataset1" DataSetName="SMPOC" Font.Charset="1" Font.Color="0" Font.Height="-19" Font.Name="AngsanaUPC" Font.Style="0" HAlign="haRight" ParentFont="False" Text="[lineno]."/>
      <TfrxLineView Name="Line3" Left="40.57483" Top="30.48825" Width="676.53587" Height="0" Color="0" Frame.Color="12632256" Diagonal="True"/>
      <TfrxLineView Name="Line4" Left="39.7953" Top="55.3859" Width="676.53587" Height="0" Color="0" Frame.Color="12632256" Diagonal="True"/>
      <TfrxMemoView Name="Memo12" Left="98.26778" Top="28.92919" Width="60.47248" Height="22.67718" Font.Charset="1" Font.Color="0" Font.Height="-19" Font.Name="AngsanaUPC" Font.Style="0" ParentFont="False" Text="ชื่อการค้า"/>
      <TfrxMemoView Name="Memo13" Left="395.12616" Top="29.70872" Width="68.03154" 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="525.953" Top="28.70872" Width="64.25201" Height="22.67718" Font.Charset="1" Font.Color="0" Font.Height="-19" Font.Name="AngsanaUPC" Font.Style="0" ParentFont="False" Text="วันหมดอายุ"/>
      <TfrxMemoView Name="Memo15" Left="602.20501" Top="29.92919" Width="37.7953" Height="22.67718" Font.Charset="1" Font.Color="0" Font.Height="-19" Font.Name="AngsanaUPC" Font.Style="0" ParentFont="False" Text="ที่เก็บ"/>
      <TfrxMemoView Name="Memo17" Left="667.29963" Top="28.70872" Width="45.35436" Height="22.67718" Font.Charset="1" Font.Color="0" Font.Height="-19" Font.Name="AngsanaUPC" Font.Style="0" ParentFont="False" Text="คงเหลือ"/>
      <TfrxMemoView Name="Memo3" Left="469.1577" Top="29.47248" Width="49.13389" Height="22.67718" Font.Charset="1" Font.Color="0" Font.Height="-19" Font.Name="AngsanaUPC" Font.Style="0" ParentFont="False" Text="Lot No."/>
    </TfrxGroupHeader>
    <TfrxGroupFooter Name="GroupFooter1" FillType="ftBrush" FillGap.Top="0" FillGap.Left="0" FillGap.Bottom="0" FillGap.Right="0" Height="26.45671" Left="0" Top="359.05535" Width="718.1107">
      <TfrxLineView Name="Line2" Left="1.77953" Top="25.33859" Width="714.33117" Height="0" Color="0" Frame.Style="fsDot" Diagonal="True"/>
      <TfrxMemoView Name="Memo10" Left="39.23624" Top="1.32282" Width="419.52783" Height="22.67718" OnBeforePrint="Memo10OnBeforePrint" AllowHTMLTags="True" 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="&#60;b&#62;จน.ขอเบิก&#60;/b&#62;   [total_qtyorder] &#60;b&#62;   จน.จ่าย&#60;/b&#62;   [total_qtyrcv]  &#60;b&#62;คงเหลือทั้งหมด &#60;/b&#62; [total_remain]"/>
    </TfrxGroupFooter>
    <TfrxPageHeader Name="PageHeader1" FillType="ftBrush" FillGap.Top="0" FillGap.Left="0" FillGap.Bottom="0" FillGap.Right="0" Height="107.26778" Left="0" Top="18.89765" Width="718.1107">
      <TfrxMemoView Name="Memo2" Left="3.77953" Top="3.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="31.01577" Width="714.33117" Height="26.45671" Font.Charset="1" Font.Color="-16777208" Font.Height="-19" Font.Name="AngsanaUPC" Font.Style="0" HAlign="haCenter" ParentFont="False" Text="ใบจัดเวชภัณฑ์ตามใบเบิก"/>
      <TfrxMemoView Name="Memo6" Left="6.55906" Top="56.91342" Width="381.73253" Height="45.35436" AllowHTMLTags="True" Font.Charset="222" Font.Color="-16777208" Font.Height="-19" Font.Name="AngsanaUPC" Font.Style="0" ParentFont="False" Text="&#60;b&#62;เลขที่เบิก&#60;/b&#62;  [sub_po_no]        &#60;b&#62;วันที่เบิก&#60;/b&#62;  [po_date]       &#13;&#10;&#60;b&#62;หน่วยงานที่เบิก&#60;/b&#62;  [dept_name] "/>
      <TfrxLineView Name="Line1" Left="2.33859" Top="103.82684" Width="714.33117" Height="0" Color="0" Frame.Color="12632256" Diagonal="True"/>
      <TfrxMemoView Name="Memo1" Left="423.30736" Top="56.91342" Width="283.46475" Height="41.57483" AllowHTMLTags="True" Font.Charset="222" Font.Color="0" Font.Height="-19" Font.Name="AngsanaUPC" Font.Style="0" HAlign="haRight" ParentFont="False" Text="หน้า [Page#]/[TotalPages#]&#13;&#10;&#60;b&#62;คลังจ่าย&#60;/b&#62; [stockname]"/>
    </TfrxPageHeader>
    <TfrxGroupHeader Name="GroupHeader2" FillType="ftBrush" FillGap.Top="0" FillGap.Left="0" FillGap.Bottom="0" FillGap.Right="0" Height="0" Left="0" Top="185.19697" Width="718.1107" Condition="SMPOC.&#34;LOCATE&#34;" KeepTogether="True" StartNewPage="True"/>
    <TfrxGroupFooter Name="GroupFooter2" FillType="ftBrush" FillGap.Top="0" FillGap.Left="0" FillGap.Bottom="0" FillGap.Right="0" Height="0" Left="0" Top="408.18924" Width="718.1107"/>
    <TfrxFooter Name="Footer1" FillType="ftBrush" FillGap.Top="0" FillGap.Left="0" FillGap.Bottom="0" FillGap.Right="0" Height="0" Left="0" Top="336.37817" Width="718.1107"/>
  </TfrxReportPage>
</TfrxReport>
