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

📄 trialbalancereport.pas

📁 功能全面的商业财会系统源码,清晰,很有参考价值.扩展性强.
💻 PAS
📖 第 1 页 / 共 2 页
字号:
unit TrialBalanceReport;

interface

uses
  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  StdCtrls, ExtCtrls, DBTables, DB, quickrpt, Qrctrls, qrprntr;

type
  TrptTrialBalance = class(TForm)
    QuickReport: TQuickRep;
    Title: TQRBand;
    PageHeader: TQRBand;
    Detail: TQRBand;
    PageFooter: TQRBand;
    QRSysData1: TQRSysData;
    QRLabel1: TQRLabel;
    QRLabel2: TQRLabel;
    QRLabel4: TQRLabel;
    PageNumber: TQRSysData;
    QRShape1: TQRShape;
    QRShape2: TQRShape;
    QRShape3: TQRShape;
    qryGLAccnt: TQuery;
    qryGLAccntGLAccount: TStringField;
    qryGLAccntAccountName: TStringField;
    qryGLAccntAccountType: TSmallintField;
    qryGLAccntAccountTypeName: TStringField;
    QRLabel3: TQRLabel;
    QRDateTime: TQRSysData;
    QRLabel5: TQRLabel;
    lblPeriod: TQRLabel;
    QRLabel6: TQRLabel;
    QRLabel7: TQRLabel;
    qryGLAccntGLYear: TSmallintField;
    qryGLAccntActualBudget: TStringField;
    qryGLAccntOpeningBal: TCurrencyField;
    qryGLAccntAmount1: TCurrencyField;
    qryGLAccntAmount2: TCurrencyField;
    qryGLAccntAmount3: TCurrencyField;
    qryGLAccntAmount4: TCurrencyField;
    qryGLAccntAmount5: TCurrencyField;
    qryGLAccntAmount6: TCurrencyField;
    qryGLAccntAmount7: TCurrencyField;
    qryGLAccntAmount8: TCurrencyField;
    qryGLAccntAmount9: TCurrencyField;
    qryGLAccntAmount10: TCurrencyField;
    qryGLAccntAmount11: TCurrencyField;
    qryGLAccntAmount12: TCurrencyField;
    qryGLAccntActualChange: TCurrencyField;
    qryGLAccntActualBalance: TCurrencyField;
    qryGLAccntBudgetChange: TCurrencyField;
    qryGLAccntBudgetBalance: TCurrencyField;
    txtActualChange: TQRDBText;
    txtActualBalance: TQRDBText;
    txtBudgetBalance: TQRDBText;
    txtBudgetChange: TQRDBText;
    QRLabel8: TQRLabel;
    QRLabel9: TQRLabel;
    Footer: TQRBand;
    GLAccount: TQRGroup;
    txtGLAccount: TQRDBText;
    txtAccountName: TQRDBText;
    txtAccountTypeName: TQRDBText;
    lblTotGActualChange: TQRLabel;
    lblTotGActualBalance: TQRLabel;
    lblTotGBudgetChange: TQRLabel;
    lblTotGBudgetBalance: TQRLabel;
    Summary: TQRBand;
    lblTotRActualChange: TQRLabel;
    lblTotRActualBalance: TQRLabel;
    lblTotRBudgetChange: TQRLabel;
    lblTotRBudgetBalance: TQRLabel;
    QRLabel13: TQRLabel;
    QRShape4: TQRShape;
    QRShape5: TQRShape;
    QRShape6: TQRShape;
    QRShape7: TQRShape;
    totRBudgetBalance: TQRExpr;
    totRBudgetChange: TQRExpr;
    totRActualBalance: TQRExpr;
    totRActualChange: TQRExpr;
    totGBudgetBalance: TQRExpr;
    totGBudgetChange: TQRExpr;
    totGActualBalance: TQRExpr;
    totGActualChange: TQRExpr;
    procedure qryGLAccntCalcFields(DataSet: TDataSet);
    procedure FormCreate(Sender: TObject);
    procedure FormClose(Sender: TObject; var Action: TCloseAction);
    procedure GLAccountBeforePrint(Sender: TQRCustomBand;
      var PrintBand: Boolean);
    procedure DetailBeforePrint(Sender: TQRCustomBand;
      var PrintBand: Boolean);
    procedure FooterBeforePrint(Sender: TQRCustomBand;
      var PrintBand: Boolean);
    procedure SummaryBeforePrint(Sender: TQRCustomBand;
      var PrintBand: Boolean);
    procedure QuickReportPreview(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  rptTrialBalance: TrptTrialBalance;

implementation

uses BS1Form, GLReportsForm, PreviewForm;

{$R *.DFM}

procedure TrptTrialBalance.qryGLAccntCalcFields(DataSet: TDataSet);
begin
  case qryGLAccntAccountType.Value of
    1: qryGLAccntAccountTypeName.Value := 'Asset';
    2: qryGLAccntAccountTypeName.Value := 'Liability';
    3: qryGLAccntAccountTypeName.Value := 'Revenue';
    4: qryGLAccntAccountTypeName.Value := 'Expense';
    5: qryGLAccntAccountTypeName.Value := 'Ret. Earnings';
    else qryGLAccntAccountTypeName.Value := '';
  end;

  qryGLAccntActualChange.AsCurrency := 0;
  qryGLAccntActualBalance.AsCurrency := 0;
  qryGLAccntBudgetChange.AsCurrency := 0;
  qryGLAccntBudgetBalance.AsCurrency := 0;

  if qryGLAccntActualBudget.value = 'A' then begin
    case frmGLReports.GLPeriod of
      1: begin
           qryGLAccntActualChange.AsCurrency := qryGLAccntAmount1.AsCurrency;
           qryGLAccntActualBalance.AsCurrency := qryGLAccntOpeningBal.AsCurrency + qryGLAccntAmount1.AsCurrency;
         end;
      2: begin
           qryGLAccntActualChange.AsCurrency := qryGLAccntAmount2.AsCurrency;
           qryGLAccntActualBalance.AsCurrency := qryGLAccntOpeningBal.AsCurrency + qryGLAccntAmount1.AsCurrency
                                                                                 + qryGLAccntAmount2.AsCurrency;
         end;
      3: begin
           qryGLAccntActualChange.AsCurrency := qryGLAccntAmount3.AsCurrency;
           qryGLAccntActualBalance.AsCurrency := qryGLAccntOpeningBal.AsCurrency + qryGLAccntAmount1.AsCurrency
                                                                                 + qryGLAccntAmount2.AsCurrency
                                                                                 + qryGLAccntAmount3.AsCurrency;
         end;
      4: begin
           qryGLAccntActualChange.AsCurrency := qryGLAccntAmount4.AsCurrency;
           qryGLAccntActualBalance.AsCurrency := qryGLAccntOpeningBal.AsCurrency + qryGLAccntAmount1.AsCurrency
                                                                                 + qryGLAccntAmount2.AsCurrency
                                                                                 + qryGLAccntAmount3.AsCurrency
                                                                                 + qryGLAccntAmount4.AsCurrency;
         end;
      5: begin
           qryGLAccntActualChange.AsCurrency := qryGLAccntAmount5.AsCurrency;
           qryGLAccntActualBalance.AsCurrency := qryGLAccntOpeningBal.AsCurrency + qryGLAccntAmount1.AsCurrency
                                                                                 + qryGLAccntAmount2.AsCurrency
                                                                                 + qryGLAccntAmount3.AsCurrency
                                                                                 + qryGLAccntAmount4.AsCurrency
                                                                                 + qryGLAccntAmount5.AsCurrency;
         end;
      6: begin
           qryGLAccntActualChange.AsCurrency := qryGLAccntAmount6.AsCurrency;
           qryGLAccntActualBalance.AsCurrency := qryGLAccntOpeningBal.AsCurrency + qryGLAccntAmount1.AsCurrency
                                                                                 + qryGLAccntAmount2.AsCurrency
                                                                                 + qryGLAccntAmount3.AsCurrency
                                                                                 + qryGLAccntAmount4.AsCurrency
                                                                                 + qryGLAccntAmount5.AsCurrency
                                                                                 + qryGLAccntAmount6.AsCurrency;
         end;
      7: begin
           qryGLAccntActualChange.AsCurrency := qryGLAccntAmount7.AsCurrency;
           qryGLAccntActualBalance.AsCurrency := qryGLAccntOpeningBal.AsCurrency + qryGLAccntAmount1.AsCurrency
                                                                                 + qryGLAccntAmount2.AsCurrency
                                                                                 + qryGLAccntAmount3.AsCurrency
                                                                                 + qryGLAccntAmount4.AsCurrency
                                                                                 + qryGLAccntAmount5.AsCurrency
                                                                                 + qryGLAccntAmount6.AsCurrency
                                                                                 + qryGLAccntAmount7.AsCurrency;
         end;
      8: begin
           qryGLAccntActualChange.AsCurrency := qryGLAccntAmount8.AsCurrency;
           qryGLAccntActualBalance.AsCurrency := qryGLAccntOpeningBal.AsCurrency + qryGLAccntAmount1.AsCurrency
                                                                                 + qryGLAccntAmount2.AsCurrency
                                                                                 + qryGLAccntAmount3.AsCurrency
                                                                                 + qryGLAccntAmount4.AsCurrency
                                                                                 + qryGLAccntAmount5.AsCurrency
                                                                                 + qryGLAccntAmount6.AsCurrency
                                                                                 + qryGLAccntAmount7.AsCurrency
                                                                                 + qryGLAccntAmount8.AsCurrency;
         end;
      9: begin
           qryGLAccntActualChange.AsCurrency := qryGLAccntAmount9.AsCurrency;
           qryGLAccntActualBalance.AsCurrency := qryGLAccntOpeningBal.AsCurrency + qryGLAccntAmount1.AsCurrency
                                                                                 + qryGLAccntAmount2.AsCurrency
                                                                                 + qryGLAccntAmount3.AsCurrency
                                                                                 + qryGLAccntAmount4.AsCurrency
                                                                                 + qryGLAccntAmount5.AsCurrency
                                                                                 + qryGLAccntAmount6.AsCurrency
                                                                                 + qryGLAccntAmount7.AsCurrency
                                                                                 + qryGLAccntAmount8.AsCurrency
                                                                                 + qryGLAccntAmount9.AsCurrency;
         end;
     10: begin
           qryGLAccntActualChange.AsCurrency := qryGLAccntAmount10.AsCurrency;
           qryGLAccntActualBalance.AsCurrency := qryGLAccntOpeningBal.AsCurrency + qryGLAccntAmount1.AsCurrency
                                                                                 + qryGLAccntAmount2.AsCurrency
                                                                                 + qryGLAccntAmount3.AsCurrency
                                                                                 + qryGLAccntAmount4.AsCurrency
                                                                                 + qryGLAccntAmount5.AsCurrency
                                                                                 + qryGLAccntAmount6.AsCurrency

⌨️ 快捷键说明

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