<?xml version="1.0" encoding="utf-8" standalone="no"?>
<TfrxReport Version="6.9.2" DotMatrixReport="False" EngineOptions.SilentMode="True" EngineOptions.NewSilentMode="simSilent" IniFile="\Software\Fast Reports" PreviewOptions.Buttons="12287" PreviewOptions.Modal="False" PreviewOptions.Zoom="1" PrintOptions.Printer="Default" PrintOptions.PrintOnSheet="0" ReportOptions.CreateDate="41546.6611873611" ReportOptions.Description.Text="" ReportOptions.LastChange="45638.6076631944" ScriptLanguage="PascalScript" ScriptText.Text="var&#13;&#10;  m0,y0,ym_fw,ym1,ym2 : string ;&#13;&#10;  aic1,aic2,aic3,aic4,aic5,aic6,aic7: string ;&#13;&#10;  i: integer ;&#13;&#10;&#13;&#10;procedure DialogPage1OnActivate(Sender: TfrxComponent);&#13;&#10;begin&#13;&#10;&#13;&#10;  qry_stock.close ;&#13;&#10;  qry_stock.open ;&#13;&#10;&#13;&#10;&#13;&#10;  cbb_stock.keyvalue:= &#60;MY_STOCK_CODE&#62; ;&#13;&#10;&#13;&#10;  m1.Text:=COPY( DATEtoYMD(&#60;Date&#62;),5,2) ;&#13;&#10;   m2.Text:=COPY( DATEtoYMD(&#60;Date&#62;),5,2);&#13;&#10;    y1.Text:=COPY( DATEtoYMD(&#60;Date&#62;),1,4) ;&#13;&#10;     y2.Text:=COPY( DATEtoYMD(&#60;Date&#62;),1,4) ;&#13;&#10;&#13;&#10;end;&#13;&#10;&#13;&#10;procedure DialogPage1OnShow(Sender: TfrxComponent);&#13;&#10;begin&#13;&#10;  i:= 0 ;&#13;&#10;end;&#13;&#10;&#13;&#10;procedure OnClick(Sender: TfrxComponent);&#13;&#10;begin&#13;&#10;&#13;&#10;  if   strtoint(m1.text) = 1 then&#13;&#10;  begin&#13;&#10;    m0:='12' ;&#13;&#10;    y0:=inttostr(strtoint(y1.text)-1-543) ;&#13;&#10;  end&#13;&#10;  else&#13;&#10;  begin&#13;&#10;&#13;&#10;    if   length(inttostr(strtoint(m1.text)-1)) = 1 then&#13;&#10;    m0:= '0'+inttostr(strtoint(m1.text)-1) else  m0:=inttostr(strtoint(m1.text)-1);&#13;&#10;&#13;&#10;    y0:=inttostr(strtoint(y1.text)-543) ;&#13;&#10;&#13;&#10;  end;&#13;&#10;&#13;&#10;   ym_fw:=y0+m0 ;&#13;&#10;&#13;&#10;&#13;&#10;&#13;&#10;&#13;&#10;  if length(m1.text)=1 then&#13;&#10;  begin&#13;&#10;    ym1:=inttostr(strtoint(y1.text)-543)+'0'+m1.text ;&#13;&#10;  end&#13;&#10;  else&#13;&#10;  begin&#13;&#10;    ym1:=inttostr(strtoint(y1.text)-543)+m1.text ;&#13;&#10;  end;&#13;&#10;&#13;&#10;&#13;&#10;  if length(m2.text)=1 then&#13;&#10;  begin&#13;&#10;    ym2:=inttostr(strtoint(y2.text)-543)+'0'+m2.text ;&#13;&#10;  end&#13;&#10;  else&#13;&#10;  begin&#13;&#10;    ym2:=inttostr(strtoint(y2.text)-543)+m2.text ;&#13;&#10;  end;&#13;&#10;&#13;&#10;&#13;&#10;end;&#13;&#10;&#13;&#10;&#13;&#10;&#13;&#10;&#13;&#10;procedure MasterData3OnBeforePrint(Sender: TfrxComponent);&#13;&#10;begin&#13;&#10;    i:=i+1 ;&#13;&#10;&#13;&#10;   if i = 1 then&#13;&#10;   begin&#13;&#10;      aic1:='ลงชื่อ ...............................................'+#13&#13;&#10;            +'('+&#60;qry_aic.&#34;TITLE_NAME&#34;&#62;+&#60;qry_aic.&#34;AIC_NAME&#34;&#62;+')'+#13&#13;&#10;            +&#60;qry_aic.&#34;PRESI&#34;&#62; ;&#13;&#10;   end&#13;&#10;   else if i=2 then&#13;&#10;   begin&#13;&#10;      aic2:='ลงชื่อ ...............................................'+#13&#13;&#10;            +'('+&#60;qry_aic.&#34;TITLE_NAME&#34;&#62;+&#60;qry_aic.&#34;AIC_NAME&#34;&#62;+')'+#13&#13;&#10;            +&#60;qry_aic.&#34;PRESI&#34;&#62; ;&#13;&#10;   end&#13;&#10;   else if i=3 then&#13;&#10;   begin&#13;&#10;      aic3:='ลงชื่อ ...............................................'+#13&#13;&#10;            +'('+&#60;qry_aic.&#34;TITLE_NAME&#34;&#62;+&#60;qry_aic.&#34;AIC_NAME&#34;&#62;+')'+#13&#13;&#10;            +&#60;qry_aic.&#34;PRESI&#34;&#62;;&#13;&#10;   end&#13;&#10;   else if i=4 then&#13;&#10;   begin&#13;&#10;      aic4:='ลงชื่อ ...............................................'+#13&#13;&#10;            +'('+&#60;qry_aic.&#34;TITLE_NAME&#34;&#62;+&#60;qry_aic.&#34;AIC_NAME&#34;&#62;+')'+#13&#13;&#10;            +&#60;qry_aic.&#34;PRESI&#34;&#62; ;&#13;&#10;   end&#13;&#10;   else if i=5 then&#13;&#10;   begin&#13;&#10;      aic5:='ลงชื่อ ...............................................'+#13&#13;&#10;            +'('+&#60;qry_aic.&#34;TITLE_NAME&#34;&#62;+&#60;qry_aic.&#34;AIC_NAME&#34;&#62;+')'+#13&#13;&#10;            +&#60;qry_aic.&#34;PRESI&#34;&#62; ;&#13;&#10;   end&#13;&#10;   else if i=6 then&#13;&#10;   begin&#13;&#10;      aic6:='ลงชื่อ ...............................................'+#13&#13;&#10;            +'('+&#60;qry_aic.&#34;TITLE_NAME&#34;&#62;+&#60;qry_aic.&#34;AIC_NAME&#34;&#62;+')'+#13&#13;&#10;            +&#60;qry_aic.&#34;PRESI&#34;&#62; ;&#13;&#10;   end&#13;&#10;   else if i=7 then&#13;&#10;   begin&#13;&#10;      aic7:='ลงชื่อ ...............................................'+#13&#13;&#10;            +'('+&#60;qry_aic.&#34;TITLE_NAME&#34;&#62;+&#60;qry_aic.&#34;AIC_NAME&#34;&#62;+')'+#13&#13;&#10;            +&#60;qry_aic.&#34;PRESI&#34;&#62; ;&#13;&#10;   end ;&#13;&#10;end;&#13;&#10;&#13;&#10;procedure Memo20OnBeforePrint(Sender: TfrxComponent);&#13;&#10;begin&#13;&#10;&#13;&#10;  if &#60;sum_inv.&#34;RM_QTY&#34;&#62; = 0 then&#13;&#10;  begin&#13;&#10;&#13;&#10;     qry_last_cost.close ;&#13;&#10;     qry_last_cost.ParamByName('wk').value:=qry_sum_inv.FieldByName('WORKING_CODE').asstring;&#13;&#10;     qry_last_cost.open ;&#13;&#10;&#13;&#10;  end;&#13;&#10;&#13;&#10;end;&#13;&#10;&#13;&#10;begin&#13;&#10;&#13;&#10;end." OnReportPrint="DialogPage1OnActivate">
  <Datasets>
    <item DataSet="qry_sum_inv" DataSetName="sum_inv"/>
    <item DataSet="qry_stock" DataSetName="stock"/>
    <item DataSet="qry_aic" DataSetName="qry_aic"/>
    <item DataSet="qry_last_cost" DataSetName="last_cost"/>
    <item DataSet="qry_overall" DataSetName="overall"/>
  </Datasets>
  <Variables>
    <item Name="MY_STOCK_CODE"/>
    <item Name="MY_STOCK_NAME"/>
    <item Name="hosp_name"/>
  </Variables>
  <TfrxDataPage Name="Data" HGuides.Text="" VGuides.Text="" Height="1000" Left="0" Top="0" Width="1000">
    <TfrxUniDACQuery Name="qry_sum_inv" UserName="sum_inv" CloseDataSource="True" FieldAliases.Text="" BCDToCurrency="False" IgnoreDupParams="False" SQL.Text="{IF SQLSERVER}&#13;&#10;select * from (&#13;&#10;select i.WORKING_CODE,g.DRUG_NAME, i.LAST_PACK_RATIO,  dbo.IS_ED(g.IS_ED) as NLEM,                                          &#13;&#10;&#13;&#10;(select top 1 c.REMAIN_QTY from  CARD c  (NOLOCK)        &#13;&#10;        where &#13;&#10;        left(c.R_S_DATE,6) &#60;= :ym_fw                                  &#13;&#10;        and c.WORKING_CODE=i.WORKING_CODE &#13;&#10;        and c.STOCK_ID=i.DEPT_ID order by /*c.R_S_DATE DESC,*/c.OPERATE_DATE DESC,c.RECORD_NUMBER DESC ) as FW_QTY,&#13;&#10;          &#13;&#10;Cx.RCV_QTY,Cx.DIS_QTY ,Cx.DIS_VALUE,&#13;&#10;      &#13;&#10;isnull((select top 1 c.REMAIN_QTY from  CARD c (NOLOCK)       &#13;&#10;        where &#13;&#10;        left(c.R_S_DATE,6) &#60;= :ym2                    &#13;&#10;        and c.WORKING_CODE=i.WORKING_CODE &#13;&#10;        and c.STOCK_ID=i.DEPT_ID order by c.OPERATE_DATE DESC ),0) as RM_QTY,i.QTY_ON_HAND,&#13;&#10;(select top 1 c.REMAIN_VALUE from  CARD c (NOLOCK)       &#13;&#10;        where &#13;&#10;        left(c.R_S_DATE,6) &#60;= :ym2              &#13;&#10;        and c.WORKING_CODE=i.WORKING_CODE &#13;&#10;        and c.STOCK_ID=i.DEPT_ID order by c.OPERATE_DATE DESC ) as RM_VALUE            &#13;&#10;from INV_MD  i (NOLOCK)     &#13;&#10;left join DRUG_GN g (NOLOCK) on (i.WORKING_CODE=g.WORKING_CODE)&#13;&#10;left join  (select c1.WORKING_CODE,c1.STOCK_ID,&#13;&#10;SUM(CASE when c1.R_S_STATUS in ('R','I','G','A','U') then c1.ACTIVE_QTY &#13;&#10;         when c1.R_S_STATUS in ('B') then c1.ACTIVE_QTY*-1 else NULL end&#13;&#10;) as RCV_QTY,          &#13;&#10;						SUM(CASE when c1.R_S_STATUS in ('D','T','S')  then c1.ACTIVE_QTY &#13;&#10;										 when (c1.R_S_STATUS='C') then c1.ACTIVE_QTY*-1 else NULL end) as DIS_QTY,&#13;&#10;						SUM(CASE when c1.R_S_STATUS in ('D','T','S')  then c1.[VALUE] &#13;&#10;										 when (c1.R_S_STATUS='C') then c1.[VALUE]*-1 else NULL end) as DIS_VALUE&#13;&#10;						from CARD c1  (NOLOCK)  &#13;&#10;            where  c1.STOCK_ID=:stock1                            &#13;&#10;            and    left(c1.R_S_DATE,6) between :ym1 and  :ym2&#13;&#10;            group by c1.WORKING_CODE,c1.STOCK_ID ) as Cx on (Cx.WORKING_CODE = i.WORKING_CODE  and Cx.STOCK_ID=i.DEPT_ID)   &#13;&#10;where  i.DEPT_ID=:stock2 and   g.WORKING_CODE is not null            &#13;&#10;) as T&#13;&#10;where (isnull(T.FW_QTY,0)+isnull(T.RCV_QTY,0)+isnull(T.DIS_QTY,0)+ isnull(T.RM_QTY,0)) &#62; 0                                                                                                                                                 &#13;&#10;ORDER BY T.DRUG_NAME&#13;&#10;&#13;&#10;{ELSE}&#13;&#10;&#13;&#10;select * from (  &#13;&#10;select i.WORKING_CODE,g.DRUG_NAME, i.LAST_PACK_RATIO,   IS_ED(g.IS_ED) as NLEM,                                          &#13;&#10;(select   c.REMAIN_QTY from  CARD c         &#13;&#10;        where &#13;&#10;        left(c.R_S_DATE,6) &#60;= :ym_fw                                  &#13;&#10;        and c.WORKING_CODE=i.WORKING_CODE &#13;&#10;        and c.STOCK_ID=i.DEPT_ID order by /*c.R_S_DATE DESC,*/c.OPERATE_DATE DESC,c.RECORD_NUMBER DESC limit 1) as FW_QTY,&#13;&#10;          &#13;&#10;Cx.RCV_QTY,Cx.DIS_QTY ,Cx.DIS_VALUE,&#13;&#10;      &#13;&#10;ifnull((select  c.REMAIN_QTY from  CARD c        &#13;&#10;        where &#13;&#10;        left(c.R_S_DATE,6) &#60;= :ym2                    &#13;&#10;        and c.WORKING_CODE=i.WORKING_CODE &#13;&#10;        and c.STOCK_ID=i.DEPT_ID order by c.OPERATE_DATE DESC  limit 1),0) as RM_QTY,i.QTY_ON_HAND,&#13;&#10;(select   c.REMAIN_VALUE from  CARD c        &#13;&#10;        where &#13;&#10;        left(c.R_S_DATE,6) &#60;= :ym2              &#13;&#10;        and c.WORKING_CODE=i.WORKING_CODE &#13;&#10;        and c.STOCK_ID=i.DEPT_ID order by c.OPERATE_DATE DESC limit 1 ) as RM_VALUE            &#13;&#10;from INV_MD  i      &#13;&#10;left join DRUG_GN g  on (i.WORKING_CODE=g.WORKING_CODE)&#13;&#10;left join  (select c1.WORKING_CODE,c1.STOCK_ID,&#13;&#10;SUM(CASE when c1.R_S_STATUS in ('R','I','G','A','U') then c1.ACTIVE_QTY &#13;&#10;         when c1.R_S_STATUS in ('B') then c1.ACTIVE_QTY*-1 else NULL end&#13;&#10;) as RCV_QTY,          &#13;&#10;SUM(CASE when c1.R_S_STATUS in ('D','T','S')  then c1.ACTIVE_QTY &#13;&#10;when (c1.R_S_STATUS='C') then c1.ACTIVE_QTY*-1 else NULL end) as DIS_QTY,&#13;&#10;SUM(CASE when c1.R_S_STATUS in ('D','T','S')  then c1. VALUE  &#13;&#10;when (c1.R_S_STATUS='C') then c1. VALUE *-1 else NULL end) as DIS_VALUE&#13;&#10;from CARD c1    &#13;&#10;            where  c1.STOCK_ID=:stock1                            &#13;&#10;            and    left(c1.R_S_DATE,6) between :ym1 and  :ym2&#13;&#10;            group by c1.WORKING_CODE,c1.STOCK_ID ) as Cx on (Cx.WORKING_CODE = i.WORKING_CODE  and Cx.STOCK_ID=i.DEPT_ID)   &#13;&#10;where  i.DEPT_ID=:stock2 and   g.WORKING_CODE is not null            &#13;&#10;) as T&#13;&#10;where (ifnull(T.FW_QTY,0)+ifnull(T.RCV_QTY,0)+ifnull(T.DIS_QTY,0)+ ifnull(T.RM_QTY,0)) &#62; 0                                                                                                                                                 &#13;&#10;ORDER BY T.DRUG_NAME  &#13;&#10;  &#13;&#10;{ENDIF}                " SpecificOptions.Text="" PropData="05704C65667402480470546F70021C0A506172616D657465727301010634204E616D653D22796D5F6677222044617461547970653D226674537472696E67222045787072657373696F6E3D22796D5F66772200010630204E616D653D22796D32222044617461547970653D226674537472696E67222045787072657373696F6E3D22796D322200010630204E616D653D22796D32222044617461547970653D226674537472696E67222045787072657373696F6E3D22796D322200010642204E616D653D2273746F636B31222044617461547970653D226674537472696E67222045787072657373696F6E3D226362625F73746F636B2E6B657976616C75652200010630204E616D653D22796D31222044617461547970653D226674537472696E67222045787072657373696F6E3D22796D312200010630204E616D653D22796D32222044617461547970653D226674537472696E67222045787072657373696F6E3D22796D322200010642204E616D653D2273746F636B32222044617461547970653D226674537472696E67222045787072657373696F6E3D226362625F73746F636B2E6B657976616C75652200010634204E616D653D22796D5F6677222044617461547970653D226674537472696E67222045787072657373696F6E3D22796D5F66772200010630204E616D653D22796D32222044617461547970653D226674537472696E67222045787072657373696F6E3D22796D322200010630204E616D653D22796D32222044617461547970653D226674537472696E67222045787072657373696F6E3D22796D322200010642204E616D653D2273746F636B31222044617461547970653D226674537472696E67222045787072657373696F6E3D226362625F73746F636B2E6B657976616C75652200010630204E616D653D22796D31222044617461547970653D226674537472696E67222045787072657373696F6E3D22796D312200010630204E616D653D22796D32222044617461547970653D226674537472696E67222045787072657373696F6E3D22796D322200010642204E616D653D2273746F636B32222044617461547970653D226674537472696E67222045787072657373696F6E3D226362625F73746F636B2E6B657976616C7565220000"/>
    <TfrxUniDACQuery Name="qry_stock" UserName="stock" CloseDataSource="True" FieldAliases.Text="" BCDToCurrency="False" IgnoreDupParams="False" SQL.Text="{IF SQLSERVER}                             &#13;&#10;select * from DEPT_ID (NOLOCK) where (HIDE='' or HIDE is null or HIDE='N') and (DEPT_TYPE = 2 or DEPT_TYPE=3)&#13;&#10;order by DEPT_NAME&#13;&#10;{ELSE}&#13;&#10;select * from DEPT_ID  where (HIDE='' or HIDE is null or HIDE='N') and (DEPT_TYPE = 2 or DEPT_TYPE=3)&#13;&#10;order by DEPT_NAME&#13;&#10;{ENDIF}                " SpecificOptions.Text="" PropData="05704C65667402480470546F7002780A506172616D65746572730100"/>
    <TfrxUniDACQuery Name="qry_aic" UserName="qry_aic" CloseDataSource="True" FieldAliases.Text="" BCDToCurrency="False" IgnoreDupParams="False" SQL.Text="{IF SQLSERVER}                             &#13;&#10;select a.*,CASE when a.PRESID_FLAG='Y' then 'ประธานกรรมการ'  else   'กรรมการ'  end as PRESI ,n.[POSITION] ,n.TITLE_NAME&#13;&#10;from AIC a&#13;&#10;left join AIC_NAME n on a.AIC_CODE=n.AIC_CODE&#13;&#10;where a.REF_NO=:ref_no&#13;&#10;order by a.PRESID_FLAG DESC,a.AIC_CODE ASC&#13;&#10;{ELSE}&#13;&#10;select a.*,CASE when a.PRESID_FLAG='Y' then 'ประธานกรรมการ'  else   'กรรมการ'  end as PRESI ,n.POSITION ,n.TITLE_NAME&#13;&#10;from AIC a&#13;&#10;left join AIC_NAME n on a.AIC_CODE=n.AIC_CODE&#13;&#10;where a.REF_NO=:ref_no&#13;&#10;order by a.PRESID_FLAG DESC,a.AIC_CODE ASC  &#13;&#10;{ENDIF}                &#13;&#10;  " SpecificOptions.Text="" PropData="05704C656674023A0470546F7003C7000A506172616D657465727301010642204E616D653D227265665F6E6F222044617461547970653D226674537472696E67222045787072657373696F6E3D226362625F73746F636B2E6B657976616C75652200010642204E616D653D227265665F6E6F222044617461547970653D226674537472696E67222045787072657373696F6E3D226362625F73746F636B2E6B657976616C7565220000"/>
    <TfrxUniDACQuery Name="qry_last_cost" UserName="last_cost" CloseDataSource="True" FieldAliases.Text="" BCDToCurrency="False" Master="qry_sum_inv" IgnoreDupParams="False" SQL.Text="{IF SQLSERVER}                             &#13;&#10;select top 1 LAST_BUY_COST,LAST_PACK_RATIO from DRUG_VN (NOLOCK)&#13;&#10;where WORKING_CODE=:wk&#13;&#10;and LAST_PACK_RATIO &#62; 0 &#13;&#10;order by LAST_BUY DESC&#13;&#10;{ELSE}&#13;&#10;select  LAST_BUY_COST,LAST_PACK_RATIO from DRUG_VN &#13;&#10;where WORKING_CODE=:wk&#13;&#10;and LAST_PACK_RATIO &#62; 0 &#13;&#10;order by LAST_BUY DESC  limit 1                 &#13;&#10;{ENDIF}                &#13;&#10;  " SpecificOptions.Text="" PropData="05704C656674023F0470546F700309010A506172616D65746572730101061E204E616D653D22776B222044617461547970653D226674537472696E67220001061E204E616D653D22776B222044617461547970653D226674537472696E67220000"/>
    <TfrxUniDACQuery Name="qry_overall" UserName="overall" CloseDataSource="True" FieldAliases.Text="" BCDToCurrency="False" IgnoreDupParams="False" SQL.Text="{IF SQLSERVER}                             &#13;&#10;select T.IS_ED,T.NLEM,SUM(T.FW_VALUE) as FW,SUM(RCV_VALUE) as  RCV,SUM(T.DIS_VALUE) as DIS,SUM(RM_VALUE) as RM from (&#13;&#10;select dbo.NLEM(g.IS_ED) as NLEM,g.IS_ED,                                                &#13;&#10;&#13;&#10;(select top 1 c.REMAIN_VALUE from  CARD c  (NOLOCK)        &#13;&#10;        where &#13;&#10;        left(c.R_S_DATE,6) &#60;= :ym_fw                                  &#13;&#10;        and c.WORKING_CODE=i.WORKING_CODE &#13;&#10;        and c.STOCK_ID=i.DEPT_ID order by c.OPERATE_DATE DESC,c.RECORD_NUMBER DESC  ) as FW_VALUE,&#13;&#10;          &#13;&#10;isnull(Cx.RCV_VALUE,0) AS RCV_VALUE,isnull(Cx.DIS_VALUE,0) as DIS_VALUE ,&#13;&#10;   &#13;&#10;(select top 1 c.REMAIN_VALUE from  CARD c (NOLOCK)       &#13;&#10;        where &#13;&#10;        left(c.R_S_DATE,6) &#60;= :ym2              &#13;&#10;        and c.WORKING_CODE=i.WORKING_CODE &#13;&#10;        and c.STOCK_ID=i.DEPT_ID order by c.OPERATE_DATE DESC ) as RM_VALUE            &#13;&#10;from INV_MD  i (NOLOCK)     &#13;&#10;left join DRUG_GN g (NOLOCK) on (i.WORKING_CODE=g.WORKING_CODE)&#13;&#10;left join  (select c1.WORKING_CODE,c1.STOCK_ID,&#13;&#10;         SUM(CASE when c1.R_S_STATUS in ('R','I','G','A') then c1.VALUE         &#13;&#10;         when c1.R_S_STATUS in ('B') then c1.VALUE*-1 else NULL end) as RCV_VALUE,&#13;&#10;           &#13;&#10;       						SUM(CASE when c1.R_S_STATUS in ('T','S')  then c1.[VALUE]&#13;&#10;	      									 when (c1.R_S_STATUS='C') then c1.[VALUE]*-1 else NULL end) as DIS_VALUE&#13;&#10;   						from CARD c1  (NOLOCK)  &#13;&#10;            where  c1.STOCK_ID=:stock                          &#13;&#10;            and    left(c1.R_S_DATE,6) between :ym1 and  :ym2&#13;&#10;            group by c1.WORKING_CODE,c1.STOCK_ID ) as Cx on (Cx.WORKING_CODE = i.WORKING_CODE  and Cx.STOCK_ID=i.DEPT_ID)   &#13;&#10;where  i.DEPT_ID=:stock and g.WORKING_CODE is not null            &#13;&#10;) as T&#13;&#10;group by T.NLEM ,T.IS_ED       &#13;&#10;HAVING (SUM(T.FW_VALUE)+ SUM(RCV_VALUE)+ SUM(T.DIS_VALUE)+SUM(RM_VALUE) &#62; 0 )&#13;&#10;order by  T.IS_ED&#13;&#10;&#13;&#10;{ELSE}&#13;&#10;&#13;&#10;select T.IS_ED,T.NLEM,SUM(T.FW_VALUE) as FW,SUM(RCV_VALUE) as  RCV,SUM(T.DIS_VALUE) as DIS,SUM(RM_VALUE) as RM from (    &#13;&#10;select  NLEM(g.IS_ED) as NLEM,g.IS_ED,                                                &#13;&#10;&#13;&#10;(select  c.REMAIN_VALUE from  CARD c           &#13;&#10;        where &#13;&#10;        left(c.R_S_DATE,6) &#60;= :ym_fw                                  &#13;&#10;        and c.WORKING_CODE=i.WORKING_CODE &#13;&#10;        and c.STOCK_ID=i.DEPT_ID order by c.OPERATE_DATE DESC,c.RECORD_NUMBER DESC limit 1  ) as FW_VALUE,&#13;&#10;          &#13;&#10;ifnull(Cx.RCV_VALUE,0) AS RCV_VALUE,ifnull(Cx.DIS_VALUE,0) as DIS_VALUE ,&#13;&#10;   &#13;&#10;(select   c.REMAIN_VALUE from  CARD c         &#13;&#10;        where &#13;&#10;        left(c.R_S_DATE,6) &#60;= :ym2              &#13;&#10;        and c.WORKING_CODE=i.WORKING_CODE &#13;&#10;        and c.STOCK_ID=i.DEPT_ID order by c.OPERATE_DATE DESC limit 1 ) as RM_VALUE            &#13;&#10;from INV_MD  i       &#13;&#10;left join DRUG_GN g   on (i.WORKING_CODE=g.WORKING_CODE)&#13;&#10;left join  (select c1.WORKING_CODE,c1.STOCK_ID,&#13;&#10;         SUM(CASE when c1.R_S_STATUS in ('R','I','G','A') then c1.VALUE         &#13;&#10;         when c1.R_S_STATUS in ('B') then c1.VALUE*-1 else NULL end) as RCV_VALUE,&#13;&#10;           &#13;&#10; SUM(CASE when c1.R_S_STATUS in ('T','S')  then c1. VALUE &#13;&#10; when (c1.R_S_STATUS='C') then c1. VALUE *-1 else NULL end) as DIS_VALUE&#13;&#10;from CARD c1     &#13;&#10;            where  c1.STOCK_ID=:stock                          &#13;&#10;            and    left(c1.R_S_DATE,6) between :ym1 and  :ym2&#13;&#10;            group by c1.WORKING_CODE,c1.STOCK_ID ) as Cx on (Cx.WORKING_CODE = i.WORKING_CODE  and Cx.STOCK_ID=i.DEPT_ID)   &#13;&#10;where  i.DEPT_ID=:stock and g.WORKING_CODE is not null            &#13;&#10;) as T&#13;&#10;group by T.NLEM ,T.IS_ED       &#13;&#10;HAVING (SUM(T.FW_VALUE)+ SUM(RCV_VALUE)+ SUM(T.DIS_VALUE)+SUM(RM_VALUE) &#62; 0 )&#13;&#10;order by  T.IS_ED&#13;&#10;&#13;&#10;{ENDIF}                " SpecificOptions.Text="" PropData="05704C656674024A0470546F700347010A506172616D657465727301010634204E616D653D22796D5F6677222044617461547970653D226674537472696E67222045787072657373696F6E3D22796D5F66772200010630204E616D653D22796D32222044617461547970653D226674537472696E67222045787072657373696F6E3D22796D322200010641204E616D653D2273746F636B222044617461547970653D226674537472696E67222045787072657373696F6E3D226362625F73746F636B2E6B657976616C75652200010630204E616D653D22796D31222044617461547970653D226674537472696E67222045787072657373696F6E3D22796D312200010630204E616D653D22796D32222044617461547970653D226674537472696E67222045787072657373696F6E3D22796D322200010641204E616D653D2273746F636B222044617461547970653D226674537472696E67222045787072657373696F6E3D226362625F73746F636B2E6B657976616C75652200010634204E616D653D22796D5F6677222044617461547970653D226674537472696E67222045787072657373696F6E3D22796D5F66772200010630204E616D653D22796D32222044617461547970653D226674537472696E67222045787072657373696F6E3D22796D322200010641204E616D653D2273746F636B222044617461547970653D226674537472696E67222045787072657373696F6E3D226362625F73746F636B2E6B657976616C75652200010630204E616D653D22796D31222044617461547970653D226674537472696E67222045787072657373696F6E3D22796D312200010630204E616D653D22796D32222044617461547970653D226674537472696E67222045787072657373696F6E3D22796D322200010641204E616D653D2273746F636B222044617461547970653D226674537472696E67222045787072657373696F6E3D226362625F73746F636B2E6B657976616C7565220000"/>
  </TfrxDataPage>
  <TfrxReportPage Name="Page1" HGuides.Text="" VGuides.Text="" Orientation="poLandscape" PaperWidth="297" PaperHeight="210" PaperSize="9" LeftMargin="10" RightMargin="10" TopMargin="10" BottomMargin="10" ColumnWidth="0" ColumnPositions.Text="" Frame.Typ="0" MirrorMode="0">
    <TfrxMasterData Name="MasterData1" FillType="ftBrush" FillGap.Top="0" FillGap.Left="0" FillGap.Bottom="0" FillGap.Right="0" Frame.Typ="0" Height="26.45671" Left="0" Top="359.05535" Width="1046.92981" ColumnWidth="0" ColumnGap="0" DataSet="qry_sum_inv" DataSetName="sum_inv" RowCount="0" Stretched="True">
      <TfrxMemoView Name="sum_invDRUG_NAME" AllowVectorExport="True" Left="59.91342" Top="1.77953" Width="347.71676" Height="22.67718" StretchMode="smActualHeight" DataField="DRUG_NAME" DataSet="qry_sum_inv" DataSetName="sum_inv" Font.Charset="1" Font.Color="-16777208" Font.Height="-19" Font.Name="TH SarabunPSK" Font.Style="0" Frame.Typ="0" ParentFont="False" Text="[sum_inv.&#34;DRUG_NAME&#34;]"/>
      <TfrxMemoView Name="sum_invFIRST_PACK_RATIO" AllowVectorExport="True" Left="402.93723" Top="2" Width="56.69295" Height="22.67718" DataSet="qry_sum_inv" DataSetName="sum_inv" Font.Charset="1" Font.Color="-16777208" Font.Height="-19" Font.Name="TH SarabunPSK" Font.Style="0" Frame.Typ="0" HAlign="haRight" ParentFont="False" Text="[sum_inv.&#34;LAST_PACK_RATIO&#34;]"/>
      <TfrxMemoView Name="sum_invQTY_ON_HAND" AllowVectorExport="True" Left="463.40971" Top="1.22047" Width="68.03154" Height="22.67718" DataSet="qry_sum_inv" DataSetName="sum_inv" DisplayFormat.FormatStr="%2.0n" DisplayFormat.Kind="fkNumeric" Font.Charset="1" Font.Color="-16777208" Font.Height="-19" Font.Name="TH SarabunPSK" Font.Style="0" Frame.Typ="0" HAlign="haRight" ParentFont="False" Text="[sum_inv.&#34;FW_QTY&#34;]"/>
      <TfrxMemoView Name="sum_invRCV_QUAN" AllowVectorExport="True" Left="526.44125" Top="0.22047" Width="64.25201" Height="22.67718" DataSet="qry_sum_inv" DataSetName="sum_inv" DisplayFormat.FormatStr="%2.0n" DisplayFormat.Kind="fkNumeric" Font.Charset="1" Font.Color="-16777208" Font.Height="-19" Font.Name="TH SarabunPSK" Font.Style="0" Frame.Typ="0" HAlign="haRight" ParentFont="False" Text="[sum_inv.&#34;RCV_QTY&#34;]"/>
      <TfrxMemoView Name="Memo3" AllowVectorExport="True" Left="587.57514" Top="0.37795276" Width="64.25201" Height="22.67718" DataSet="qry_sum_inv" DataSetName="sum_inv" DisplayFormat.FormatStr="%2.0n" DisplayFormat.Kind="fkNumeric" Font.Charset="1" Font.Color="-16777208" Font.Height="-19" Font.Name="TH SarabunPSK" Font.Style="0" Frame.Typ="0" HAlign="haRight" ParentFont="False" Text="[&#60;sum_inv.&#34;FW_QTY&#34;&#62;+&#60;sum_inv.&#34;RCV_QTY&#34;&#62;]"/>
      <TfrxMemoView Name="Memo12" AllowVectorExport="True" Left="646.38621" Top="1" Width="68.03154" Height="22.67718" DataSet="qry_sum_inv" DataSetName="sum_inv" DisplayFormat.FormatStr="%2.0n" DisplayFormat.Kind="fkNumeric" Font.Charset="1" Font.Color="-16777208" Font.Height="-19" Font.Name="TH SarabunPSK" Font.Style="0" Frame.Typ="0" HAlign="haRight" ParentFont="False" Text="[sum_inv.&#34;DIS_QTY&#34;]"/>
      <TfrxMemoView Name="Memo14" AllowVectorExport="True" Left="711.63822" Top="1" Width="79.37013" Height="22.67718" DataSet="qry_sum_inv" DataSetName="sum_inv" DisplayFormat.FormatStr="%2.2n" DisplayFormat.Kind="fkNumeric" Font.Charset="1" Font.Color="-16777208" Font.Height="-19" Font.Name="TH SarabunPSK" Font.Style="0" Frame.Typ="0" HAlign="haRight" ParentFont="False" Text="[sum_inv.&#34;DIS_VALUE&#34;]"/>
      <TfrxMemoView Name="Memo19" AllowVectorExport="True" Left="788.95331" Top="2" Width="68.03154" Height="22.67718" DataSet="qry_sum_inv" DataSetName="sum_inv" DisplayFormat.FormatStr="%2.0n" DisplayFormat.Kind="fkNumeric" Font.Charset="1" Font.Color="-16777208" Font.Height="-19" Font.Name="TH SarabunPSK" Font.Style="0" Frame.Typ="0" HAlign="haRight" ParentFont="False" Text="[sum_inv.&#34;RM_QTY&#34;]"/>
      <TfrxMemoView Name="Memo20" AllowVectorExport="True" Left="853.76438" Top="2" Width="71.81107" Height="22.67718" OnBeforePrint="Memo20OnBeforePrint" DataSet="qry_sum_inv" DataSetName="sum_inv" DisplayFormat.FormatStr="%2.2n" DisplayFormat.Kind="fkNumeric" Font.Charset="1" Font.Color="-16777208" Font.Height="-19" Font.Name="TH SarabunPSK" Font.Style="0" Frame.Typ="0" HAlign="haRight" ParentFont="False" Text="[IIF(&#60;sum_inv.&#34;RM_QTY&#34;&#62; &#62; 0,&#60;sum_inv.&#34;RM_VALUE&#34;&#62;/&#60;sum_inv.&#34;RM_QTY&#34;&#62;,&#60;last_cost.&#34;LAST_BUY_COST&#34;&#62;/&#60;last_cost.&#34;LAST_PACK_RATIO&#34;&#62;)]"/>
      <TfrxMemoView Name="Memo21" AllowVectorExport="True" Left="926.45733" Top="1.55906" Width="71.81107" Height="22.67718" DataSet="qry_sum_inv" DataSetName="sum_inv" DisplayFormat.FormatStr="%2.2n" DisplayFormat.Kind="fkNumeric" Font.Charset="1" Font.Color="-16777208" Font.Height="-19" Font.Name="TH SarabunPSK" Font.Style="0" Frame.Typ="0" HAlign="haRight" ParentFont="False" Text="[sum_inv.&#34;RM_VALUE&#34;]"/>
      <TfrxMemoView Name="Memo23" AllowVectorExport="True" Left="0" Top="1.77953" Width="56.69295" Height="22.67718" Font.Charset="1" Font.Color="-16777208" Font.Height="-19" Font.Name="TH SarabunPSK" Font.Style="0" Frame.Typ="0" HAlign="haRight" ParentFont="False" Text="[sum_inv.&#34;WORKING_CODE&#34;] "/>
    </TfrxMasterData>
    <TfrxPageFooter Name="PageFooter1" FillType="ftBrush" FillGap.Top="0" FillGap.Left="0" FillGap.Bottom="0" FillGap.Right="0" Frame.Typ="0" Height="135.51979" Left="0" Top="445.98454" Width="1046.92981">
      <TfrxMemoView Name="Memo25" AllowVectorExport="True" Left="7.55906" Top="28.77953" Width="241.88992" Height="56.69295" Font.Charset="1" Font.Color="-16777208" Font.Height="-16" Font.Name="TH SarabunPSK" Font.Style="0" Frame.Typ="0" HAlign="haCenter" ParentFont="False" Text="[aic1]"/>
      <TfrxMemoView Name="Memo26" AllowVectorExport="True" Left="270.5671" Top="28.77953" Width="241.88992" Height="56.69295" Font.Charset="1" Font.Color="-16777208" Font.Height="-16" Font.Name="TH SarabunPSK" Font.Style="0" Frame.Typ="0" HAlign="haCenter" ParentFont="False" Text="[aic2]"/>
      <TfrxMemoView Name="Memo27" AllowVectorExport="True" Left="534.47279" Top="28.77953" Width="241.88992" Height="56.69295" Font.Charset="1" Font.Color="-16777208" Font.Height="-16" Font.Name="TH SarabunPSK" Font.Style="0" Frame.Typ="0" HAlign="haCenter" ParentFont="False" Text="[aic3]"/>
      <TfrxMemoView Name="Memo28" AllowVectorExport="True" Left="797.48083" Top="28.77953" Width="241.88992" Height="56.69295" Font.Charset="1" Font.Color="-16777208" Font.Height="-16" Font.Name="TH SarabunPSK" Font.Style="0" Frame.Typ="0" HAlign="haCenter" ParentFont="False" Text="[aic4]"/>
      <TfrxMemoView Name="Memo29" AllowVectorExport="True" Left="113.3859" Top="81.14966" Width="241.88992" Height="52.91342" Font.Charset="1" Font.Color="-16777208" Font.Height="-16" Font.Name="TH SarabunPSK" Font.Style="0" Frame.Typ="0" HAlign="haCenter" ParentFont="False" Text="[aic5]"/>
      <TfrxMemoView Name="Memo30" AllowVectorExport="True" Left="389.29159" Top="81.14966" Width="241.88992" Height="52.91342" Font.Charset="1" Font.Color="-16777208" Font.Height="-16" Font.Name="TH SarabunPSK" Font.Style="0" Frame.Typ="0" HAlign="haCenter" ParentFont="False" Text="[aic6]"/>
      <TfrxMemoView Name="Memo31" AllowVectorExport="True" Left="680.3154" Top="81.14966" Width="241.88992" Height="52.91342" Font.Charset="1" Font.Color="-16777208" Font.Height="-16" Font.Name="TH SarabunPSK" Font.Style="0" Frame.Typ="0" HAlign="haCenter" ParentFont="False" Text="[aic7]"/>
      <TfrxLineView Name="Line6" AllowVectorExport="True" Left="4" Top="2.67718" Width="1039.37075" Height="0" Color="0" Frame.Color="12632256" Frame.Typ="0" Diagonal="True"/>
    </TfrxPageFooter>
    <TfrxPageHeader Name="PageHeader1" FillType="ftBrush" FillGap.Top="0" FillGap.Left="0" FillGap.Bottom="0" FillGap.Right="0" Frame.Typ="0" Height="170.07885" Left="0" Top="18.89765" Width="1046.92981">
      <TfrxMemoView Name="Memo1" AllowVectorExport="True" Left="937.32344" Top="8.55906" Width="105.82684" Height="22.67718" Font.Charset="1" Font.Color="0" Font.Height="-19" Font.Name="TH SarabunPSK" Font.Style="0" Frame.Typ="0" HAlign="haRight" ParentFont="False" Text="แผ่นที่ [Page#]"/>
      <TfrxMemoView Name="Memo2" AllowVectorExport="True" Left="2" Top="2" Width="1039.37075" Height="102.04731" Font.Charset="1" Font.Color="0" Font.Height="-21" Font.Name="TH SarabunPSK" Font.Style="1" Frame.Typ="0" HAlign="haCenter" ParentFont="False" Text="รายงานการรับ-จ่ายพัสดุ&#13;&#10;ตามระเบียบสำนักนายกรัฐมนตรีว่าด้วยการพัสดุ พ.ศ. 2560 &#13;&#10;ตั้งแต่เดือน [MonthThai(strtoint(m1.text),True)]  [y1.text] ถึง [MonthThai(strtoint(m2.text),True)]  [y2.text] &#13;&#10;คลัง:  [TRIM(cbb_stock.text)]  [hosp_name]">
        <Formats>
          <item/>
          <item/>
          <item/>
          <item/>
          <item/>
          <item/>
        </Formats>
      </TfrxMemoView>
      <TfrxLineView Name="Line1" AllowVectorExport="True" Left="3.77953" Top="106.47248" Width="1039.37075" Height="0" Color="0" Frame.Color="12632256" Frame.Typ="0" Diagonal="True"/>
      <TfrxLineView Name="Line2" AllowVectorExport="True" Left="2.77953" Top="162.14966" Width="1039.37075" Height="0" Color="0" Frame.Color="12632256" Frame.Typ="0" Diagonal="True"/>
      <TfrxMemoView Name="Memo4" AllowVectorExport="True" Left="92.48825" Top="121.91342" Width="37.7953" Height="22.67718" Font.Charset="1" Font.Color="0" Font.Height="-19" Font.Name="TH SarabunPSK" Font.Style="0" Frame.Typ="0" HAlign="haCenter" ParentFont="False" Text="ชื่อยา"/>
      <TfrxMemoView Name="Memo5" AllowVectorExport="True" Left="474.32313" Top="138.69295" Width="71.81107" Height="18.89765" Font.Charset="1" Font.Color="0" Font.Height="-19" Font.Name="TH SarabunPSK" Font.Style="0" Frame.Typ="0" HAlign="haCenter" ParentFont="False" VAlign="vaBottom" Text="คงเหลือยกมา"/>
      <TfrxMemoView Name="Memo6" AllowVectorExport="True" Left="542.91373" Top="139.25201" Width="64.25201" Height="18.89765" Font.Charset="1" Font.Color="0" Font.Height="-19" Font.Name="TH SarabunPSK" Font.Style="0" Frame.Typ="0" HAlign="haCenter" ParentFont="False" VAlign="vaBottom" Text="รับใหม่"/>
      <TfrxMemoView Name="Memo7" AllowVectorExport="True" Left="604.60668" Top="138.69295" Width="56.69295" Height="18.89765" Font.Charset="1" Font.Color="0" Font.Height="-19" Font.Name="TH SarabunPSK" Font.Style="0" Frame.Typ="0" HAlign="haCenter" ParentFont="False" VAlign="vaBottom" Text="รวม"/>
      <TfrxMemoView Name="Memo8" AllowVectorExport="True" Left="397.953" Top="108.01577" Width="68.03154" Height="49.13389" Font.Charset="1" Font.Color="0" Font.Height="-19" Font.Name="TH SarabunPSK" Font.Style="0" Frame.Typ="0" HAlign="haCenter" ParentFont="False" Text="ขนาด&#13;&#10;หีบห่อบรรจุ"/>
      <TfrxLineView Name="Line3" AllowVectorExport="True" Left="466.07112" Top="136.26778" Width="181.41744" Height="0" Color="0" Frame.Color="12632256" Frame.Typ="0" Diagonal="True"/>
      <TfrxMemoView Name="Memo9" AllowVectorExport="True" Left="467.85065" Top="108.14966" Width="196.53556" Height="26.45671" Font.Charset="1" Font.Color="0" Font.Height="-19" Font.Name="TH SarabunPSK" Font.Style="0" Frame.Typ="0" HAlign="haCenter" ParentFont="False" Text="จำนวนรับในปีงบประมาณ"/>
      <TfrxMemoView Name="Memo10" AllowVectorExport="True" Left="649.06339" Top="139.91342" Width="71.81107" Height="18.89765" Font.Charset="1" Font.Color="0" Font.Height="-19" Font.Name="TH SarabunPSK" Font.Style="0" Frame.Typ="0" HAlign="haCenter" ParentFont="False" VAlign="vaBottom" Text="จำนวน"/>
      <TfrxMemoView Name="Memo11" AllowVectorExport="True" Left="719.65399" Top="138.47248" Width="71.81107" Height="18.89765" Font.Charset="1" Font.Color="0" Font.Height="-19" Font.Name="TH SarabunPSK" Font.Style="0" Frame.Typ="0" HAlign="haCenter" ParentFont="False" VAlign="vaBottom" Text="บาท"/>
      <TfrxLineView Name="Line4" AllowVectorExport="True" Left="654.14997" Top="135.48825" Width="147.40167" Height="0" Color="0" Frame.Color="12632256" Frame.Typ="0" Diagonal="True"/>
      <TfrxMemoView Name="Memo13" AllowVectorExport="True" Left="648.37044" Top="108.37013" Width="147.40167" Height="26.45671" Font.Charset="1" Font.Color="0" Font.Height="-19" Font.Name="TH SarabunPSK" Font.Style="0" Frame.Typ="0" HAlign="haCenter" ParentFont="False" Text="จำนวนจ่ายในปีงบประมาณ"/>
      <TfrxMemoView Name="Memo15" AllowVectorExport="True" Left="792.30767" Top="138.69295" Width="71.81107" Height="18.89765" Font.Charset="1" Font.Color="0" Font.Height="-19" Font.Name="TH SarabunPSK" Font.Style="0" Frame.Typ="0" HAlign="haCenter" ParentFont="False" VAlign="vaBottom" Text="จำนวน"/>
      <TfrxMemoView Name="Memo16" AllowVectorExport="True" Left="864.6778" Top="135.25201" Width="79.37013" Height="26.45671" Font.Charset="1" Font.Color="0" Font.Height="-19" Font.Name="TH SarabunPSK" Font.Style="0" Frame.Typ="0" HAlign="haCenter" ParentFont="False" Text="มูลค่าต่อหน่วย"/>
      <TfrxMemoView Name="Memo17" AllowVectorExport="True" Left="943.2684" Top="138.47248" Width="56.69295" Height="18.89765" Font.Charset="1" Font.Color="0" Font.Height="-19" Font.Name="TH SarabunPSK" Font.Style="0" Frame.Typ="0" HAlign="haCenter" ParentFont="False" VAlign="vaBottom" Text="รวม"/>
      <TfrxLineView Name="Line5" AllowVectorExport="True" Left="803.17378" Top="135.26778" Width="188.9765" Height="0" Color="0" Frame.Color="12632256" Frame.Typ="0" Diagonal="True"/>
      <TfrxMemoView Name="Memo18" AllowVectorExport="True" Left="800.95331" Top="108.14966" Width="196.53556" Height="26.45671" Font.Charset="1" Font.Color="0" Font.Height="-19" Font.Name="TH SarabunPSK" Font.Style="0" Frame.Typ="0" HAlign="haCenter" ParentFont="False" Text="คงเหลือเมื่อสิ้นเดือน [MonthThai(strtoint(m2.text),True)]"/>
      <TfrxMemoView Name="Memo22" AllowVectorExport="True" Left="994.01639" Top="120.26778" Width="52.91342" Height="26.45671" Font.Charset="1" Font.Color="0" Font.Height="-19" Font.Name="TH SarabunPSK" Font.Style="0" Frame.Typ="0" HAlign="haCenter" ParentFont="False" Text="หมายเหตุ"/>
      <TfrxMemoView Name="Memo44" AllowVectorExport="True" Left="7.55906" Top="124.72449" Width="37.7953" Height="22.67718" Font.Charset="1" Font.Color="0" Font.Height="-19" Font.Name="TH SarabunPSK" Font.Style="0" Frame.Typ="0" HAlign="haCenter" ParentFont="False" Text="รหัสยา"/>
    </TfrxPageHeader>
    <TfrxMasterData Name="MasterData2" FillType="ftBrush" FillGap.Top="0" FillGap.Left="0" FillGap.Bottom="0" FillGap.Right="0" Frame.Typ="0" Height="64.25201" Left="0" Top="272.12616" Visible="False" Width="1046.92981" Columns="4" ColumnWidth="245.669291338583" ColumnGap="18.8976377952756" DataSet="qry_aic" DataSetName="qry_aic" RowCount="0">
      <TfrxMemoView Name="Memo24" AllowVectorExport="True" Left="1" Top="2.77953" Width="241.88992" Height="60.47248" Font.Charset="1" Font.Color="-16777208" Font.Height="-19" Font.Name="TH SarabunPSK" Font.Style="0" Frame.Typ="0" HAlign="haCenter" ParentFont="False" Text="ลงชื่อ ...............................................&#13;&#10;([qry_aic.&#34;TITLE_NAME&#34;][qry_aic.&#34;AIC_NAME&#34;])&#13;&#10;[qry_aic.&#34;PRESI&#34;]"/>
    </TfrxMasterData>
    <TfrxMasterData Name="MasterData3" FillType="ftBrush" FillGap.Top="0" FillGap.Left="0" FillGap.Bottom="0" FillGap.Right="0" Frame.Typ="0" Height="0" Left="0" Top="249.44898" Width="1046.92981" OnBeforePrint="MasterData3OnBeforePrint" ColumnWidth="0" ColumnGap="0" DataSet="qry_aic" DataSetName="qry_aic" RowCount="0"/>
  </TfrxReportPage>
  <TfrxReportPage Name="Page2" HGuides.Text="" VGuides.Text="" Orientation="poLandscape" PaperWidth="297" PaperHeight="210" PaperSize="9" LeftMargin="10" RightMargin="10" TopMargin="10" BottomMargin="10" ColumnWidth="0" ColumnPositions.Text="" Frame.Typ="0" MirrorMode="0">
    <TfrxPageHeader Name="PageHeader2" FillType="ftBrush" FillGap.Top="0" FillGap.Left="0" FillGap.Bottom="0" FillGap.Right="0" Frame.Typ="0" Height="222.99227" Left="0" Top="18.89765" Width="1046.92981">
      <TfrxMemoView Name="Memo32" AllowVectorExport="True" Left="2" Top="10" Width="1043.15028" Height="120.94496" Font.Charset="1" Font.Color="0" Font.Height="-27" Font.Name="TH SarabunPSK" Font.Style="1" Frame.Typ="0" HAlign="haCenter" ParentFont="False" Text="สรุปผลการตรวจรับ-จ่ายพัสดุ &#13;&#10;ตามระเบียบสำนักนายกรัฐมนตรีว่าด้วยการพัสดุ พ.ศ. 2560 &#13;&#10;ตั้งแต่เดือน [MonthThai(strtoint(m1.text),True)]  [y1.text] ถึง [MonthThai(strtoint(m2.text),True)]  [y2.text] &#13;&#10;คลัง:  [TRIM(cbb_stock.text)] กลุ่มงานเภสัชกรรม [hosp_name]">
        <Formats>
          <item/>
          <item/>
          <item/>
          <item/>
          <item/>
          <item/>
        </Formats>
      </TfrxMemoView>
      <TfrxLineView Name="Line7" AllowVectorExport="True" Left="78.41713" Top="138.82684" Width="903.30767" Height="0" Color="0" Frame.Color="8421504" Frame.Typ="0" Diagonal="True"/>
      <TfrxLineView Name="Line8" AllowVectorExport="True" Left="75.5906" Top="219.84261" Width="907.0872" Height="0" Color="0" Frame.Color="8421504" Frame.Typ="0" Diagonal="True"/>
      <TfrxMemoView Name="Memo33" AllowVectorExport="True" Left="161.29932" Top="163.04731" Width="136.06308" Height="34.01577" Font.Charset="1" Font.Color="0" Font.Height="-27" Font.Name="TH SarabunPSK" Font.Style="0" Frame.Typ="0" HAlign="haCenter" ParentFont="False" Text="ประเภทบัญชียา"/>
      <TfrxMemoView Name="Memo34" AllowVectorExport="True" Left="642.38621" Top="142.26778" Width="83.14966" Height="34.01577" Font.Charset="1" Font.Color="0" Font.Height="-27" Font.Name="TH SarabunPSK" Font.Style="0" Frame.Typ="0" HAlign="haCenter" ParentFont="False" Text="มูลค่า"/>
      <TfrxMemoView Name="Memo35" AllowVectorExport="True" Left="411.52783" Top="183.50402" Width="86.92919" Height="26.45671" Font.Charset="1" Font.Color="0" Font.Height="-27" Font.Name="TH SarabunPSK" Font.Style="0" Frame.Typ="0" HAlign="haCenter" ParentFont="False" Text="ยอดยกมา"/>
      <TfrxMemoView Name="Memo36" AllowVectorExport="True" Left="555.14997" Top="183.50402" Width="86.92919" Height="26.45671" Font.Charset="1" Font.Color="0" Font.Height="-27" Font.Name="TH SarabunPSK" Font.Style="0" Frame.Typ="0" HAlign="haCenter" ParentFont="False" Text="รับเข้าคลัง"/>
      <TfrxMemoView Name="Memo37" AllowVectorExport="True" Left="694.99258" Top="183.50402" Width="120.94496" Height="26.45671" Font.Charset="1" Font.Color="0" Font.Height="-27" Font.Name="TH SarabunPSK" Font.Style="0" Frame.Typ="0" HAlign="haCenter" ParentFont="False" Text="จ่ายออกจากคลัง"/>
      <TfrxMemoView Name="Memo38" AllowVectorExport="True" Left="857.51237" Top="182.50402" Width="109.60637" Height="34.01577" Font.Charset="1" Font.Color="0" Font.Height="-27" Font.Name="TH SarabunPSK" Font.Style="0" Frame.Typ="0" HAlign="haCenter" ParentFont="False" Text="มูลค่าคงเหลือ"/>
      <TfrxLineView Name="Line9" AllowVectorExport="True" Left="381.73253" Top="176.72449" Width="600.94527" Height="0" Color="0" Frame.Color="8421504" Frame.Typ="0" Diagonal="True"/>
    </TfrxPageHeader>
    <TfrxPageFooter Name="PageFooter2" FillType="ftBrush" FillGap.Top="0" FillGap.Left="0" FillGap.Bottom="0" FillGap.Right="0" Frame.Typ="0" Height="22.67718" Left="0" Top="487.55937" Width="1046.92981"/>
    <TfrxMasterData Name="MasterData4" FillType="ftBrush" FillGap.Top="0" FillGap.Left="0" FillGap.Bottom="0" FillGap.Right="0" Frame.Typ="0" Height="36.01577" Left="0" Top="302.3624" Width="1046.92981" ColumnWidth="0" ColumnGap="0" DataSet="qry_overall" DataSetName="overall" RowCount="0">
      <TfrxMemoView Name="overallNLEM" AllowVectorExport="True" Left="79.37013" Top="2" Width="298.58287" Height="34.01577" DataField="NLEM" DataSet="qry_overall" DataSetName="overall" Font.Charset="1" Font.Color="-16777208" Font.Height="-27" Font.Name="TH SarabunPSK" Font.Style="0" Frame.Typ="0" ParentFont="False" Text="[overall.&#34;NLEM&#34;]"/>
      <TfrxMemoView Name="overallFW" AllowVectorExport="True" Left="380.85065" Top="0.55906" Width="128.50402" Height="34.01577" DataField="FW" DataSet="qry_overall" DataSetName="overall" DisplayFormat.FormatStr="%2.2n" DisplayFormat.Kind="fkNumeric" Font.Charset="1" Font.Color="-16777208" Font.Height="-27" Font.Name="TH SarabunPSK" Font.Style="0" Frame.Typ="0" HAlign="haRight" ParentFont="False" Text="[overall.&#34;FW&#34;]"/>
      <TfrxMemoView Name="overallRCV" AllowVectorExport="True" Left="519.37044" Top="1.77953" Width="124.72449" Height="30.23624" DataField="RCV" DataSet="qry_overall" DataSetName="overall" DisplayFormat.FormatStr="%2.2n" DisplayFormat.Kind="fkNumeric" Font.Charset="1" Font.Color="-16777208" Font.Height="-27" Font.Name="TH SarabunPSK" Font.Style="0" Frame.Typ="0" HAlign="haRight" ParentFont="False" Text="[overall.&#34;RCV&#34;]"/>
      <TfrxMemoView Name="overallDIS" AllowVectorExport="True" Left="685.1107" Top="1.77953" Width="132.28355" Height="30.23624" DataSet="qry_overall" DataSetName="overall" DisplayFormat.FormatStr="%2.2n" DisplayFormat.Kind="fkNumeric" Font.Charset="1" Font.Color="-16777208" Font.Height="-27" Font.Name="TH SarabunPSK" Font.Style="0" Frame.Typ="0" HAlign="haRight" ParentFont="False" Text="[&#60;overall.&#34;FW&#34;&#62;+&#60;overall.&#34;RCV&#34;&#62;-&#60;overall.&#34;RM&#34;&#62;]"/>
      <TfrxMemoView Name="overallRM" AllowVectorExport="True" Left="849.83519" Top="2.77953" Width="117.16543" Height="30.23624" DataField="RM" DataSet="qry_overall" DataSetName="overall" DisplayFormat.FormatStr="%2.2n" DisplayFormat.Kind="fkNumeric" Font.Charset="1" Font.Color="-16777208" Font.Height="-27" Font.Name="TH SarabunPSK" Font.Style="0" Frame.Typ="0" HAlign="haRight" ParentFont="False" Text="[overall.&#34;RM&#34;]"/>
    </TfrxMasterData>
    <TfrxReportSummary Name="ReportSummary1" FillType="ftBrush" FillGap.Top="0" FillGap.Left="0" FillGap.Bottom="0" FillGap.Right="0" Frame.Typ="0" Height="64.25201" Left="0" Top="400.63018" Width="1046.92981">
      <TfrxMemoView Name="Memo39" AllowVectorExport="True" Left="377.953" Top="15.77953" Width="132.28355" Height="30.23624" DataSet="qry_overall" DataSetName="overall" DisplayFormat.FormatStr="%2.2n" DisplayFormat.Kind="fkNumeric" Font.Charset="1" Font.Color="-16777208" Font.Height="-27" Font.Name="TH SarabunPSK" Font.Style="0" Frame.Typ="0" HAlign="haRight" ParentFont="False" Text="[SUM(&#60;overall.&#34;FW&#34;&#62;,MasterData4)]"/>
      <TfrxMemoView Name="Memo40" AllowVectorExport="True" Left="522.79561" Top="15.77953" Width="120.94496" Height="30.23624" DataSet="qry_overall" DataSetName="overall" DisplayFormat.FormatStr="%2.2n" DisplayFormat.Kind="fkNumeric" Font.Charset="1" Font.Color="-16777208" Font.Height="-27" Font.Name="TH SarabunPSK" Font.Style="0" Frame.Typ="0" HAlign="haRight" ParentFont="False" Text="[SUM(&#60;overall.&#34;RCV&#34;&#62;,MasterData4)]"/>
      <TfrxMemoView Name="Memo41" AllowVectorExport="True" Left="696.65399" Top="15.77953" Width="124.72449" Height="30.23624" DataSet="qry_overall" DataSetName="overall" DisplayFormat.FormatStr="%2.2n" DisplayFormat.Kind="fkNumeric" Font.Charset="1" Font.Color="-16777208" Font.Height="-27" Font.Name="TH SarabunPSK" Font.Style="0" Frame.Typ="0" HAlign="haRight" ParentFont="False" Text="[SUM(&#60;overall.&#34;FW&#34;&#62;+&#60;overall.&#34;RCV&#34;&#62;-&#60;overall.&#34;RM&#34;&#62;,MasterData4)]"/>
      <TfrxMemoView Name="Memo42" AllowVectorExport="True" Left="850.39425" Top="15.77953" Width="117.16543" Height="30.23624" DataSet="qry_overall" DataSetName="overall" DisplayFormat.FormatStr="%2.2n" DisplayFormat.Kind="fkNumeric" Font.Charset="1" Font.Color="-16777208" Font.Height="-27" Font.Name="TH SarabunPSK" Font.Style="0" Frame.Typ="0" HAlign="haRight" ParentFont="False" Text="[SUM(&#60;overall.&#34;RM&#34;&#62;,MasterData4)]"/>
      <TfrxMemoView Name="Memo43" AllowVectorExport="True" Left="187.5906" Top="17.77953" Width="68.03154" Height="30.23624" Font.Charset="1" Font.Color="0" Font.Height="-27" Font.Name="TH SarabunPSK" Font.Style="0" Frame.Typ="0" HAlign="haCenter" ParentFont="False" Text="รวม"/>
      <TfrxLineView Name="Line10" AllowVectorExport="True" Left="75.5906" Top="11" Width="907.0872" Height="0" Color="0" Frame.Color="8421504" Frame.Typ="0" Diagonal="True"/>
      <TfrxLineView Name="Line11" AllowVectorExport="True" Left="75.5906" Top="52.35436" Width="907.0872" Height="0" Color="0" Frame.Color="8421504" Frame.Typ="0" Diagonal="True"/>
    </TfrxReportSummary>
    <TfrxMemoView Name="sum_invNLEM_GR_NAME" AllowVectorExport="True" Left="0" Top="249.44898" Width="480.00031" Height="22.67718" DataSet="qry_sum_inv" DataSetName="sum_inv" Font.Charset="1" Font.Color="-16777208" Font.Height="-19" Font.Name="TH SarabunPSK" Font.Style="2" Frame.Typ="0" ParentFont="False" Text="[sum_inv.&#34;NLEM_GR_NAME&#34;] ([sum_inv.&#34;GROUP_CODE&#34;])"/>
  </TfrxReportPage>
  <TfrxDialogPage Name="DialogPage1" Font.Charset="1" Font.Color="-16777208" Font.Height="-13" Font.Name="Arial" Font.Style="0" HGuides.Text="" VGuides.Text="" DoubleBuffered="False" Height="340" ClientHeight="308" Left="371" Top="208" Width="521" Scaled="True" ClientWidth="515" OnActivate="DialogPage1OnActivate">
    <TfrxDBLookupComboBox Name="cbb_stock" Left="130" Top="149" Width="333" Height="37" Font.Charset="0" Font.Color="-16777208" Font.Height="-21" Font.Name="AngsanaUPC" Font.Style="0" ParentFont="False" ShowHint="True" DataSet="qry_stock" DataSetName="stock" ListField="DEPT_NAME" KeyField="DEPT_ID" DropDownWidth="0" DropDownRows="7"/>
    <TfrxBitBtnControl Name="" Left="216" Top="224" 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" OnClick="OnClick"/>
    <TfrxLabelControl Name="Label1" Left="54" Top="58" Width="31" Height="29" Font.Charset="0" Font.Color="-16777208" Font.Height="-21" Font.Name="AngsanaUPC" Font.Style="0" ParentFont="False" ShowHint="True" Caption="ตั้งแต่" Color="16768462"/>
    <TfrxLabelControl Name="Label3" Left="70" Top="151" Width="51" Height="29" Font.Charset="0" Font.Color="-16777208" Font.Height="-21" Font.Name="AngsanaUPC" Font.Style="0" ParentFont="False" ShowHint="True" Caption="เลือกคลัง" Color="16768462"/>
    <TfrxLabelControl Name="Label4" Left="70" Top="103" Width="15" Height="29" Font.Charset="0" Font.Color="-16777208" Font.Height="-21" Font.Name="AngsanaUPC" Font.Style="0" ParentFont="False" ShowHint="True" Caption="ถึง" Color="16768462"/>
    <TfrxEditControl Name="m1" Left="130" Top="60" Width="61" Height="25" ShowHint="True" Color="-16777211" MaxLength="0" PasswordChar="0" Text="02"/>
    <TfrxLabelControl Name="Label2" Left="94" Top="58" Width="30" Height="29" Font.Charset="0" Font.Color="-16777208" Font.Height="-21" Font.Name="AngsanaUPC" Font.Style="0" ParentFont="False" ShowHint="True" Caption="เดือน" Color="16768462"/>
    <TfrxLabelControl Name="Label5" Left="94" Top="103" Width="30" Height="29" Font.Charset="0" Font.Color="-16777208" Font.Height="-21" Font.Name="AngsanaUPC" Font.Style="0" ParentFont="False" ShowHint="True" Caption="เดือน" Color="16768462"/>
    <TfrxLabelControl Name="Label6" Left="214" Top="62" Width="9" Height="29" Font.Charset="0" Font.Color="-16777208" Font.Height="-21" Font.Name="AngsanaUPC" Font.Style="0" ParentFont="False" ShowHint="True" Caption="ปี" Color="16768462"/>
    <TfrxEditControl Name="m2" Left="130" Top="105" Width="61" Height="25" ShowHint="True" Color="-16777211" MaxLength="0" PasswordChar="0" Text="02"/>
    <TfrxEditControl Name="y1" Left="234" Top="60" Width="81" Height="25" ShowHint="True" Color="-16777211" MaxLength="0" PasswordChar="0" Text="2557"/>
    <TfrxLabelControl Name="Label7" Left="214" Top="107" Width="9" Height="29" Font.Charset="0" Font.Color="-16777208" Font.Height="-21" Font.Name="AngsanaUPC" Font.Style="0" ParentFont="False" ShowHint="True" Caption="ปี" Color="16768462"/>
    <TfrxEditControl Name="y2" Left="234" Top="105" Width="81" Height="25" ShowHint="True" Color="-16777211" MaxLength="0" PasswordChar="0" Text="2557"/>
  </TfrxDialogPage>
</TfrxReport>
