⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 sy_flmxzcx.pas

📁 省级集邮品管理ERP
💻 PAS
📖 第 1 页 / 共 2 页
字号:

{*******************************************************}
{                                                       }
{                     分类明细帐查询                    }
{                                                       }
{            中软金马公司版权所有。2002.12前            }
{                                                       }
{               编制:中软金马项目开发组                }
{                                                       }
{                                                       }
{*******************************************************}
(*
本模块在省级集邮票管理、省级市场购入票管理、省级集邮品管理、省级零枚票管理、省级综合查询、
地市集邮票管理、地市集邮品管理、地市市场购入票管理 八个模块调用
*)
unit SY_FLMXZCX;

interface

uses
  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  SY_SearchBase, Db, DBTables, Grids, DBGrids, StdCtrls, Buttons, ExtCtrls,
  ComCtrls, Spin, DBCtrls, RXCtrls, SqlStrings, RxQuery, Qrctrls, QuickRpt,
  ComboBoxDB, YzppSelect, Menus, DBGridExport;

const
  ArrFieldName: array[0..2] of array[0..2] of string =
    (('XJZJJE', 'XJJSJE', 'XJYE'), ('JJZJJE', 'JJJSJE', 'JJYE'), ('YJZJJE', 'YJJSJE', 'YJYE'));
type
  //邮票信息
  PYPXX = ^TYPXX;
  TYPXX = record
    PPDM, TJC: string;
    JJ: Extended;
  end;
  TfrmY_FLMXZCX = class(TfrmY_SearchBase)
    Qry_YP: TQuery;
    Dso_YP: TDataSource;
    Label1: TLabel;
    SED_Year: TSpinEdit;
    Label5: TLabel;
    RGr_Base: TRadioGroup;
    SqlStrings1: TSqlStrings;
    PPSel_pp: TYzppSelect;
    QRe_jypflmxz: TQuickRep;
    PageHeaderBand1: TQRBand;
    QRLabel7: TQRLabel;
    QRShape12: TQRShape;
    QRShape15: TQRShape;
    QRShape19: TQRShape;
    QRShape20: TQRShape;
    QRShape21: TQRShape;
    QRShape22: TQRShape;
    QRLabel13: TQRLabel;
    QRShape23: TQRShape;
    QRShape24: TQRShape;
    QRShape25: TQRShape;
    QRLabel14: TQRLabel;
    QRLabel15: TQRLabel;
    QRLabel16: TQRLabel;
    QRLabel17: TQRLabel;
    QRLabel18: TQRLabel;
    QRLabel19: TQRLabel;
    QRLabel20: TQRLabel;
    QRLabel21: TQRLabel;
    QRShape34: TQRShape;
    QRLabel25: TQRLabel;
    QRLabel26: TQRLabel;
    QRLabel27: TQRLabel;
    QRLabel28: TQRLabel;
    QRLabel23: TQRLabel;
    QRLabel24: TQRLabel;
    QRShape35: TQRShape;
    QRShape36: TQRShape;
    QRShape37: TQRShape;
    QRShape38: TQRShape;
    QRShape39: TQRShape;
    QRShape40: TQRShape;
    QRLabel29: TQRLabel;
    QRLabel30: TQRLabel;
    QRShape42: TQRShape;
    QRShape43: TQRShape;
    QRShape44: TQRShape;
    QRShape45: TQRShape;
    QRLabel22: TQRLabel;
    QRLabel31: TQRLabel;
    QRLabel32: TQRLabel;
    QRLabel33: TQRLabel;
    QRLabel34: TQRLabel;
    QRLabel35: TQRLabel;
    QRLabel36: TQRLabel;
    QRLabel37: TQRLabel;
    QRL_mx_zh: TQRLabel;
    QRL_mx_mc: TQRLabel;
    QRL_mx_tpms: TQRLabel;
    QRL_mx_fxrq: TQRLabel;
    QRL_mx_xj: TQRLabel;
    QRL_mx_zk: TQRLabel;
    QRL_mx_jj: TQRLabel;
    QRL_mx_tpmz: TQRLabel;
    QRL_mx_nd: TQRLabel;
    QRL_mx_tjrq1: TQRLabel;
    QRL_mx_tjrq2: TQRLabel;
    QRL_mx_tjrq3: TQRLabel;
    QRL_mx_jg1: TQRLabel;
    QRL_mx_jg2: TQRLabel;
    QRL_mx_jg3: TQRLabel;
    QRShape1: TQRShape;
    QRShape2: TQRShape;
    QRShape3: TQRShape;
    QRShape4: TQRShape;
    QRShape5: TQRShape;
    QRShape6: TQRShape;
    QRShape7: TQRShape;
    QRShape8: TQRShape;
    QRShape9: TQRShape;
    QRShape10: TQRShape;
    QRShape13: TQRShape;
    QRLabel2: TQRLabel;
    QRSysData1: TQRSysData;
    QRShape17: TQRShape;
    QRShape18: TQRShape;
    QRShape33: TQRShape;
    QRShape41: TQRShape;
    QRShape49: TQRShape;
    QRShape50: TQRShape;
    QRShape51: TQRShape;
    QRShape52: TQRShape;
    QRShape53: TQRShape;
    QRShape54: TQRShape;
    QRShape55: TQRShape;
    QRShape56: TQRShape;
    QRLabel6: TQRLabel;
    DetailBand1: TQRBand;
    QRShape26: TQRShape;
    QRShape27: TQRShape;
    QRShape28: TQRShape;
    QRShape29: TQRShape;
    QRShape30: TQRShape;
    QRShape31: TQRShape;
    QRShape32: TQRShape;
    QRShape46: TQRShape;
    QRShape47: TQRShape;
    QRShape48: TQRShape;
    QRShape11: TQRShape;
    QRShape14: TQRShape;
    QRL_FSRQ: TQRLabel;
    QRL_DWDM: TQRLabel;
    QRL_CRKDH: TQRLabel;
    QRL_ZY: TQRLabel;
    QRL_ZJSL: TQRLabel;
    QRL_JJZJJE: TQRLabel;
    QRL_JSSL: TQRLabel;
    QRL_JJJSJE: TQRLabel;
    QRL_JCSL: TQRLabel;
    QRL_JJYE: TQRLabel;
    PageFooterBand1: TQRBand;
    QRShape16: TQRShape;
    QRShape57: TQRShape;
    QRShape58: TQRShape;
    QRShape59: TQRShape;
    QRShape60: TQRShape;
    QRShape61: TQRShape;
    QRShape62: TQRShape;
    QRShape63: TQRShape;
    QRShape64: TQRShape;
    QRShape65: TQRShape;
    QRShape66: TQRShape;
    QRShape67: TQRShape;
    QRShape68: TQRShape;
    QRLabel8: TQRLabel;
    Qry_Print: TRxQuery;
    CB_lkc: TCheckBox;
    procedure SED_YearChange(Sender: TObject);
    procedure RGr_BaseClick(Sender: TObject);
    procedure Qry_SearchAfterOpen(DataSet: TDataSet);
    procedure BBt_PrintClick(Sender: TObject);
    procedure QRe_jypflmxzStartPage(Sender: TCustomQuickRep);
    procedure QRe_jypflmxzNeedData(Sender: TObject; var MoreData: Boolean);
    procedure QRe_jypflmxzBeforePrint(Sender: TCustomQuickRep;
      var PrintReport: Boolean);
    procedure CB_lkcClick(Sender: TObject);
  private
    { Private declarations }
  protected
    procedure Init; override;
    procedure DoDisPP;
    procedure YP_GetYPXX;
    procedure Search; override;
  public
    DetailLines, TotalPageCount: integer;
    ZY_temp: string;
    RI: Integer;
    Tao_Print_Flag: Boolean;
  end;

function ShowFLMXZCX(p_typ: TIO_TYPE): Boolean;
var
  frmY_FLMXZCX: TfrmY_FLMXZCX;

implementation

{$R *.DFM}
uses Datas,pub, SJ_DialogAfterPrint;

var
  l_typ: TIO_TYPE;

function ShowFLMXZCX(p_typ: TIO_TYPE): Boolean;
begin
  l_typ := p_typ;
  Application.CreateForm(TfrmY_FLMXZCX, frmY_FLMXZCX);

  with frmY_FLMXZCX do
  try
{$IFDEF qmd}
    Caption := CYZPPTIT;
    DWMC.Caption := '使用单位:' + VG_UnitName;
    panel1.Caption := pCaption[integer(l_typ)] + '分类明细帐校对';
{$ELSE}
    Caption := '邮资票品管理信息系统——' + pCaption[integer(l_typ)] + '业务';
    panel1.Caption := pCaption[integer(l_typ)] + '分类明细帐查询';
{$ENDIF}
    QRLabel7.Caption := pCaption[integer(l_typ)] + ' 分类明细帐';
    Qry_Search.SQL := SqlStrings.FSqlText[l_typ];

    QRe_jypflmxz.Visible := False;
    result := ShowModal = MB_OK;
  finally
    Destroy;
  end;
end;

procedure TfrmY_FLMXZCX.Init;
begin
  inherited Init;
//  RGr_Base.Visible := l_typ <> io_txp;
  DoDisPP;
{  if l_typ = io_txp then
    PPSel_pp.Title_Str := '面值';}
  SED_Year.Value := CurYear;
  YP_GetYPXX;
{  if l_typ = io_txp then
    RGr_Base.ItemIndex := 0
  else}
    RGr_Base.ItemIndex := 1;
  RGr_BaseClick(nil);
end;

procedure TfrmY_FLMXZCX.DoDisPP;
var
  v_s: string;
begin
  PPSel_pp.SQL.Clear;
  if not CB_lkc.Checked then
    v_s := 'and KC.TS>0 ';
  PPSel_pp.SQL.Text := format(SqlStrings1.FSqlText[l_typ].Text, [v_s]);
  PPSel_pp.Open;
end;

procedure TfrmY_FLMXZCX.SED_YearChange(Sender: TObject);
begin
  inherited;
  CurYear := SED_Year.Value;
end;

procedure TfrmY_FLMXZCX.YP_GetYPXX;
begin
end;

procedure TfrmY_FLMXZCX.RGr_BaseClick(Sender: TObject);
begin
  inherited;
  case RGr_Base.ItemIndex of
    0, 1, 2:
      begin
        DBG_Result.Columns[5].FieldName := ArrFieldName[RGr_Base.ItemIndex, 0];
        DBG_Result.Columns[7].FieldName := ArrFieldName[RGr_Base.ItemIndex, 1];
        DBG_Result.Columns[9].FieldName := ArrFieldName[RGr_Base.ItemIndex, 2];
      end;
  end;
end;

procedure TfrmY_FLMXZCX.Search;
begin
  if PPSel_pp.CurrDisText = '' then
  begin
    CHQMsgBox('请选择邮票,再查询');
    Exit;
  end;
  with Qry_Search do
  begin
    Close;
    Params.ParamByName('PPDM').AsString := PPSel_pp.GetFieldVal('TDM');
//    if l_typ <> io_txp then
    Params.ParamByName('JJ').AsFloat := strtofloat(PPSel_pp.GetFieldVal('MC')) * 100;
    Params.ParamByName('RQFrom').Asstring := Sed_year.Text + cmb_From.Text;
    Params.ParamByName('RQEnd').Asstring := Sed_year.Text + cmb_End.Text;
    Open;
  end;
end;

procedure TfrmY_FLMXZCX.Qry_SearchAfterOpen(DataSet: TDataSet);
begin
  inherited;
  with DataSet do
  begin
{    if l_typ <> io_txp then
    begin
      TNumericField(FieldByName('YJZJJE')).DisplayFormat := '#,##0.00##';
      TNumericField(FieldByName('YJJSJE')).DisplayFormat := '#,##0.00##';
      TNumericField(FieldByName('YJYE')).DisplayFormat := '#,##0.00##'; }
      TNumericField(FieldByName('JJZJJE')).DisplayFormat := '#,##0.00##';
      TNumericField(FieldByName('JJJSJE')).DisplayFormat := '#,##0.00##';
      TNumericField(FieldByName('JJYE')).DisplayFormat := '#,##0.00##';
{    end;}
    TNumericField(FieldByName('ZJSL')).DisplayFormat := '#,##0';
    TNumericField(FieldByName('JSSL')).DisplayFormat := '#,##0';
    TNumericField(FieldByName('JCSL')).DisplayFormat := '#,##0';

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -