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

📄 fee_balance_cover_r.pas

📁 县级供电企业电费核算源码, 在客户处正常运行8年以上, Delphi 5开发,数据库为Interbase/Firebird, 深入使用Procedure和Trigger等, 对入门者具有很好的参考价值
💻 PAS
字号:
unit Fee_Balance_Cover_R;

interface

uses Windows, SysUtils, Messages, Classes, Graphics, Controls,
  StdCtrls, ExtCtrls, Forms, Quickrpt, QRCtrls;

type
  TR_Fee_Balance_Cover = class(TQuickRep)
    DetailBand1: TQRBand;
    QRDBText2: TQRDBText;
    QRDBText3: TQRDBText;
    QRDBText1: TQRDBText;
    QRL_Add: TQRLabel;
    QRDBText21: TQRDBText;
    QRLabel45: TQRLabel;
    QRL_Line: TQRLabel;
    QRDBText23: TQRDBText;
    QRL_Ammeter_no1: TQRLabel;
    QRL_Ammeter_No2: TQRLabel;
    QRL_Ammeter_No3: TQRLabel;
    QRL_Last1: TQRLabel;
    QRL_Last2: TQRLabel;
    QRL_Last3: TQRLabel;
    QRL_Count1: TQRLabel;
    QRL_Count2: TQRLabel;
    QRL_Count3: TQRLabel;
    QRDBText7: TQRDBText;
    QRDBText22: TQRDBText;
    QRExpr1: TQRExpr;
    QRDB_Ct: TQRDBText;
    QRDBText6: TQRDBText;
    QRL_Country_Amount1: TQRLabel;
    QRL_Country_Amount2: TQRLabel;
    QRL_Country_Amount3: TQRLabel;
    QRL_Country_Price3: TQRLabel;
    QRL_Country_Price2: TQRLabel;
    QRL_Country_Price1: TQRLabel;
    QRDB_Count: TQRDBText;
    QRDB_Count1: TQRDBText;
    QRDB_Count2: TQRDBText;
    QRDB_Rate2: TQRDBText;
    QRDB_Rate1: TQRDBText;
    QRDBText8: TQRDBText;
    QRL_Comput: TQRLabel;
    QRL_Auditing: TQRLabel;
    QRL_Fee: TQRLabel;
    QRSysData1: TQRSysData;
    QRL_Month: TQRLabel;
    QRM_Note: TQRMemo;
    QRL_Title: TQRLabel;
    QRDB_Rate3: TQRDBText;
    QRDB_Count3: TQRDBText;
    QRL_Country_Price4: TQRLabel;
    QRL_Country_Amount4: TQRLabel;
    QRDB_Arrearage: TQRDBText;
    QRL_Service_Amount1: TQRLabel;
    QRL_Service_Amount2: TQRLabel;
    QRL_Service_Amount3: TQRLabel;
    QRL_Service_Amount4: TQRLabel;
    QRL_Country_Amount: TQRLabel;
    QRL_Amount: TQRLabel;
    QRL_Service_Amount: TQRLabel;
    QRDBText4: TQRDBText;
    procedure DetailBand1BeforePrint(Sender: TQRCustomBand;
      var PrintBand: Boolean);
    procedure QRDB_Rate1Print(sender: TObject; var Value: String);
    procedure QRDB_CtPrint(sender: TObject; var Value: String);
    procedure R_Fee_BalanceAfterPrint(Sender: TObject);
    procedure DetailBand1AfterPrint(Sender: TQRCustomBand;
      BandPrinted: Boolean);
    procedure QuickRepBeforePrint(Sender: TCustomQuickRep;
      var PrintReport: Boolean);
    procedure QRDB_ArrearagePrint(sender: TObject; var Value: String);
    procedure QRDBText4Print(sender: TObject; var Value: String);
  private

  public

  end;

var
  R_Fee_Balance_Cover: TR_Fee_Balance_Cover;

implementation

uses CommSmdljf, Table_DM, Comm;

{$R *.DFM}
var
	nHouseCount:Integer;//户数

procedure TR_Fee_Balance_Cover.DetailBand1BeforePrint(Sender: TQRCustomBand;
  var PrintBand: Boolean);
var //三块表的表号,上次抄表数,本次抄表数
	A_No1, A_No2, A_No3:String;
    A_Last1, A_Last2, A_Last3:Extended;
    A_Count1, A_Count2, A_Count3:Extended;
    //农网维护费,单价
//    V_Service_Fee, V_Service_Price:Extended;
	v_Service_Price1, v_Service_Price2, v_Service_Price3, v_Service_Price4: Extended;
    v_Service_Amount1, v_Service_Amount2, v_Service_Amount3, v_Service_Amount4: Extended;
	v_Service_Amount: Extended;
    //国家价
    v_Country_Price1, v_Country_Price2, v_Country_Price3, v_Country_Price4: Extended;
    v_Country_Amount1, v_Country_Amount2, v_Country_Amount3, v_Country_Amount4: Extended;
	v_Country_Amount: Extended;
    //滞纳金
    v_LateFee: Extended;
    //用户编号
    V_House_No:String;
begin
	QRL_Title.Caption := StationName;
	QRL_Comput.Caption := Default_Comput;
    QRL_Auditing.Caption := Default_Auditing;
    QRL_Fee.Caption := Default_Fee;
    QRL_Month.Caption := CurrentYear+' 年 '+CurrentMonth+' 月份';
    //通过用户编号得到用户地址和线路
    V_House_No := Dm_Table.V_House['F_House_No'];
    QRL_Add.Caption := F_GetAddress(V_House_No);
    QRL_Line.Caption := F_GetLine(V_House_No);
	//得到指定用户相关表的信息
    P_GetAmmeter(V_House_No,A_No1,A_No2,A_No3,
    			A_Last1,A_Last2,A_Last3,
    			A_Count1,A_Count2,A_Count3);
    QRL_Ammeter_No1.Caption := Trim(A_No1);
    QRL_Last1.Caption := F_FloatToStrF(A_Last1,10,-1);
	If A_Count1 < 0 Then
    	QRL_Count1.Caption := '未抄'
    Else
	    QRL_Count1.Caption := F_FloatToStrF(A_Count1,10,-1);
    QRL_Ammeter_No2.Caption := Trim(A_No2);

	QRL_Last2.Caption := '';
    QRL_Count2.Caption := '';
	QRL_Last3.Caption := '';
    QRL_Count3.Caption := '';
    If Trim(A_No2) <> '' Then
	Begin
        QRL_Last2.Caption := F_FloatToStrF(A_Last2,10,-1);
		If A_Count2 < 0 Then
    		QRL_Count2.Caption := '未抄'
    	Else
		    QRL_Count2.Caption := F_FloatToStrF(A_Count2,10,-1);
    End;
    QRL_Ammeter_No3.Caption := Trim(A_No3);
    If Trim(A_No3) <> '' Then
    Begin
    	QRL_Last3.Caption := F_FloatToStrF(A_Last3,10,-1);
		If A_Count3 < 0 Then
    		QRL_Count3.Caption := '未抄'
    	Else
		    QRL_Count3.Caption := F_FloatToStrF(A_Count3,10,-1);
    End;
	//打印备注栏
   	QRM_Note.Lines.Clear();
    If Dm_Table.V_House['F_Note'] <> Null Then
		QRM_Note.Lines.Add(F_Warp(Dm_Table.V_House['F_Note']))
    Else
    	QRM_Note.Lines.Add('');
    //求农网维护费和国家费
    With Dm_Table Do
    Begin
		p_GetService(V_House['F_House_No'],
        			v_Service_Price1, v_Service_Price2, v_Service_Price3, v_Service_Price4,
        			v_Service_Amount1, v_Service_Amount2, v_Service_Amount3, v_Service_Amount4,
                    v_Service_Amount);
        QRL_Service_Amount1.Caption := F_FloatToStrF(V_Service_Amount1,10,2);
        QRL_Service_Amount2.Caption := F_FloatToStrF(V_Service_Amount2,10,2);
		QRL_Service_Amount3.Caption := F_FloatToStrF(V_Service_Amount3,10,2);
		QRL_Service_Amount4.Caption := F_FloatToStrF(V_Service_Amount4,10,2);
		QRL_Service_Amount.Caption := F_FloatToStrF(V_Service_Amount,10,2);

        p_GetCountry(V_House['F_House_No'],
        			v_Country_Price1, v_Country_Price2, v_Country_Price3, v_Country_Price4,
                    v_Country_Amount1, v_Country_Amount2, v_Country_Amount3, v_Country_Amount4,
                    v_Country_Amount);
		QRL_Country_Price1.Caption := F_FloatToStrF(V_Country_Price1,10,3);
		QRL_Country_Price2.Caption := F_FloatToStrF(V_Country_Price2,10,3);
		QRL_Country_Price3.Caption := F_FloatToStrF(V_Country_Price3,10,3);
		QRL_Country_Price4.Caption := F_FloatToStrF(V_Country_Price4,10,3);
		QRL_Country_Amount1.Caption := F_FloatToStrF(V_Country_Amount1,10,2);
		QRL_Country_Amount2.Caption := F_FloatToStrF(V_Country_Amount2,10,2);
		QRL_Country_Amount3.Caption := F_FloatToStrF(V_Country_Amount3,10,2);
		QRL_Country_Amount4.Caption := F_FloatToStrF(V_Country_Amount4,10,2);
		QRL_Country_Amount.Caption := F_FloatToStrF(V_Country_Amount,10,2);
    End;
    v_LateFee := DM_Table.v_House['f_LateFee'];
    QRL_Amount.Caption := F_FloatToStrF(v_Country_Amount
    								+ v_Service_Amount
                                    + v_LateFee
                                    ,10,2);
end;












procedure TR_Fee_Balance_Cover.QRDB_Rate1Print(sender: TObject;
  var Value: String);
begin
   	Value:= F_FloatToStrF(StrToFloat(Value) * 100, 0, 0);
    If Value <> '' Then
    	Value := Value + ' %'
end;


procedure TR_Fee_Balance_Cover.QRDB_CtPrint(sender: TObject; var Value: String);
begin
	If StrToInt(Value) = 5 Then
    	Value := '';
end;


procedure TR_Fee_Balance_Cover.R_Fee_BalanceAfterPrint(Sender: TObject);
begin
    P_Log('打印: 电费结算单。户数'+IntToStr(nHouseCount));
end;

procedure TR_Fee_Balance_Cover.DetailBand1AfterPrint(Sender: TQRCustomBand;
  BandPrinted: Boolean);
begin
	if BandPrinted Then
    	Inc(nHouseCount);//户数增加
end;

procedure TR_Fee_Balance_Cover.QuickRepBeforePrint(Sender: TCustomQuickRep;
  var PrintReport: Boolean);
begin
	nHouseCount := 0;//户数初始为零
end;

procedure TR_Fee_Balance_Cover.QRDB_ArrearagePrint(sender: TObject;
  var Value: String);
begin
   	Value := F_FloatToStrF(StrToFloat(Value),10,2);
end;

procedure TR_Fee_Balance_Cover.QRDBText4Print(sender: TObject;
  var Value: String);
begin
   	Value := F_FloatToStrF(StrToFloat(Value),10,2);
end;

end.

⌨️ 快捷键说明

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