📄 jm_rkdrpt.pas
字号:
{*******************************************************}
{ }
{ 营业员分票打印 }
{ }
{ 中软金马公司版权所有。2002.12前 }
{ }
{ 编制:中软金马邮资票品项目开发组 }
{ }
{ }
{*******************************************************}
(*
本模块在地市pub营业员分票模块,地市集邮票管理,地市集邮品管理,地市市场购入票里面调用。
*)
{===============================================================================
邮资票品管理系统 V1.0——集邮门市管理系统,该系统的主要功能完成票品的销售。
其中包括预订销售,零售业务,以及营业员的票品入库,票品退缴,营业员票款上缴。
还包括营业员库存状况查询、销售情况统计等功能。
集邮门市管理子系统与其他子系统的关系:系统管理子系统负责集邮业务管理子系统的
各种数据的初始化工作。预订类型设置、抽奖、新卡数据导入、类代码维护等工作在该
模块中完成,只有完成了以上工作集邮门市管理子系统才能正常工作。集邮门市中营业
员入库票品是通过所谓“后台”的集邮票业务管理子系统、集邮品业务管理子系统、购
入票业务管理子系统的“营业员发票”完成,营业员的缴款、票品退缴都需后台的复核。
本模块功能:营业员入库通知单的打印
问题:
1、不能确定打印纸张的型号,随客户的需求随时可能改变。
2、
徐 申 2001.10.14
更改:1、依照省级打印的入库通知单格式更改
2、更改了所有的控件名称符合规定
徐申 2002.02.25
===============================================================================}
unit JM_RKDRPT;
interface
uses Windows, SysUtils, Messages, Classes, Graphics, Controls,
StdCtrls, ExtCtrls, Forms, Quickrpt, QRCtrls, Dialogs, Db, DBTables;
type
TFrm_RKDRPT = class(TQuickRep)
PageHeaderBand1: TQRBand;
QRLabel1: TQRLabel;
QRLabel6: TQRLabel;
QRLabel8: TQRLabel;
QRLabel25: TQRLabel;
QRLabel4: TQRLabel;
Qry_ckdayin: TQuery;
Qry_bz: TQuery;
QRLabel11: TQRLabel;
QRLabel10: TQRLabel;
PageFooterBand1: TQRBand;
QRLabel13: TQRLabel;
QRRichText1: TQRRichText;
QRRichText11: TQRRichText;
QRLabel14: TQRLabel;
QRLabel15: TQRLabel;
QRLabel2: TQRLabel;
QRLabel26: TQRLabel;
QRLabel27: TQRLabel;
QRLabel28: TQRLabel;
QRSysData1: TQRSysData;
QRLabel29: TQRLabel;
QRLabel30: TQRLabel;
ColumnHeaderBand1: TQRBand;
QRLabel19: TQRLabel;
QRLabel20: TQRLabel;
QRLabel23: TQRLabel;
QRLabel12: TQRLabel;
QRLabel22: TQRLabel;
QRLabel3: TQRLabel;
QRLabel16: TQRLabel;
QRLabel5: TQRLabel;
QRLabel17: TQRLabel;
QRLabel24: TQRLabel;
QRLabel18: TQRLabel;
QRShape1: TQRShape;
QRShape2: TQRShape;
QRShape3: TQRShape;
QRShape4: TQRShape;
QRShape6: TQRShape;
QRShape7: TQRShape;
QRShape8: TQRShape;
QRShape10: TQRShape;
QRShape11: TQRShape;
QRShape12: TQRShape;
QRShape13: TQRShape;
QRShape14: TQRShape;
QRShape15: TQRShape;
QRShape26: TQRShape;
QRShape27: TQRShape;
QRShape28: TQRShape;
QRShape29: TQRShape;
QRShape30: TQRShape;
QRShape31: TQRShape;
QRShape32: TQRShape;
QRShape33: TQRShape;
DetailBand1: TQRBand;
qrrt_zh: TQRRichText;
qrrt_ppmc: TQRRichText;
qrrt_xj: TQRRichText;
qrrt_sl: TQRRichText;
qrrt_zjje: TQRRichText;
qrrt_jj: TQRRichText;
qrrt_jjje: TQRRichText;
qrrt_fxrq: TQRRichText;
QRShape5: TQRShape;
QRShape16: TQRShape;
QRShape17: TQRShape;
QRShape19: TQRShape;
QRShape20: TQRShape;
QRShape21: TQRShape;
QRShape22: TQRShape;
QRShape23: TQRShape;
QRShape24: TQRShape;
QRShape25: TQRShape;
QRLabel7: TQRLabel;
procedure QuickRepNeedData(Sender: TObject; var MoreData: Boolean);
procedure QuickRepBeforePrint(Sender: TCustomQuickRep;
var PrintReport: Boolean);
procedure QuickRepStartPage(Sender: TCustomQuickRep);
private
public
sumzj: double; {总计金额}
sumjsj: double; {进价金额}
DetailLines: Integer; {页内行数}
Tao_Print_Flag: Boolean; {套打标志}
end;
var
Frm_RKDRPT: TFrm_RKDRPT;
implementation
uses pub,jm_data;
{$R *.DFM}
procedure TFrm_RKDRPT.QuickRepNeedData(Sender: TObject;
var MoreData: Boolean);
var
zjje, jsje: double;
begin
{每页限制行数为5行}
if DetailLines = 6 then
DetailLines := 1;
if DetailLines <= 5 then
begin
Inc(DetailLines);
MoreData := True;
end;
if not Qry_ckdayin.Eof then
begin
qrrt_ppmc.Lines.Text := Qry_ckdayin.FieldByName('ppmc').AsString;
{如果票品名称过长,那么设置显示在两行中}
if qrrt_ppmc.Lines.Count > 1 then
begin
qrrt_ppmc.Font.Size := 9;
if qrrt_ppmc.Lines.Count > 1 then
qrrt_ppmc.Top := -2
else qrrt_ppmc.Top := 1;
end
else begin
qrrt_ppmc.Font.Size := 11;
qrrt_ppmc.Top := 1;
end;
{对志号信息做与票品名称信息同样的处理}
qrrt_zh.Lines.Text := Qry_ckdayin.FieldByName('zh').AsString;
if qrrt_zh.Lines.Count > 1 then
begin
qrrt_zh.Font.Size := 9;
if qrrt_zh.Lines.Count > 1 then
qrrt_zh.Top := 1
else qrrt_zh.Top := -2;
end
else begin
qrrt_zh.Font.Size := 11;
qrrt_zh.Top := 1;
end;
qrrt_sl.Lines.Text := FormatFloat('#,##', Qry_ckdayin.fieldbyname('sl').AsFloat);
qrrt_xj.Lines.Text := FormatFloat('#,##0.00', Qry_ckdayin.fieldbyname('xj').AsFloat);
qrrt_zjje.Lines.Text := FormatFloat('#,##0.00', Qry_ckdayin.fieldbyname('zjje').AsFloat);
qrrt_jj.Lines.Text := FormatFloat('#,##0.00', Qry_ckdayin.fieldbyname('JJ').asFloat);
qrrt_jjje.Lines.Text := FormatFloat('#,##0.00', Qry_ckdayin.fieldbyname('jjje').AsFloat);
qrrt_fxrq.Lines.Text := FormatDateTime('YYYY"/"MM"/"DD', Qry_ckdayin.FieldByName('fxrq').AsDateTime);
zjje := Qry_ckdayin.fieldbyname('zjje').asfloat;
jsje := Qry_ckdayin.fieldbyname('jjje').asfloat;
{循环统计总计金额、进价金额}
sumzj := sumzj + zjje;
sumjsj := sumjsj + jsje;
QRRichText1.Lines.Text := FormatFloat('#,##0.00', sumzj);
QRRichText11.Lines.Text := FormatFloat('#,##0.00', sumjsj);
DetailBand1.Height := 28;
end;
{如果票品信息没能把本页显示满,那么显示空白行}
if MoreData and (Qry_ckdayin.Eof) then
begin
qrrt_ppmc.Lines.Text := '';
qrrt_sl.Lines.Text := '';
qrrt_xj.Lines.Text := '';
qrrt_zjje.Lines.Text := '';
qrrt_jj.Lines.Text := '';
qrrt_jjje.Lines.Text := '';
qrrt_fxrq.Lines.Text := '';
qrrt_zh.Lines.text := '';
if DetailLines = 6 then
MoreData := False;
end;
if (not Qry_ckdayin.Eof) then
begin
MoreData := not Qry_ckdayin.eof;
Qry_ckdayin.Next;
end;
end;
procedure TFrm_RKDRPT.QuickRepBeforePrint(Sender: TCustomQuickRep;
var PrintReport: Boolean);
begin
{再次的初始化全局变量}
Qry_ckdayin.First;
sumzj := 0;
sumjsj := 0;
DetailLines := 0;
end;
procedure TFrm_RKDRPT.QuickRepStartPage(Sender: TCustomQuickRep);
var
i: integer;
begin
{设置套打信息}
for I := 0 to PageHeaderBand1.ControlCount - 1 do //设置页头的套打
begin
if PageHeaderBand1.Controls[I] is TQRLabel then
begin
if Tao_Print_Flag then
begin
TQRLabel(PageHeaderBand1.Controls[I]).Enabled := False;
if (PageHeaderBand1.Controls[I].Name = 'QRLabel25') or
(PageHeaderBand1.Controls[I].Name = 'QRLabel11') or
(PageHeaderBand1.Controls[I].Name = 'QRLabel8') or
(PageHeaderBand1.Controls[I].Name = 'QRLabel1') then
TQRLabel(PageHeaderBand1.Controls[I]).Enabled := True;
end
else TQRLabel(PageHeaderBand1.Controls[I]).Enabled := True;
end;
if PageHeaderBand1.Controls[I] is TQRShape then
if Tao_Print_Flag then TQRShape(PageHeaderBand1.Controls[i]).Enabled := False
else TQRShape(PageHeaderBand1.Controls[i]).Enabled := True;
end;
for I := 0 to ColumnHeaderBand1.ControlCount - 1 do //设置表头的套打
begin
if ColumnHeaderBand1.Controls[I] is TQRShape then
begin
if Tao_Print_Flag then
TQRShape(ColumnHeaderBand1.Controls[I]).Enabled := False
else TQRShape(ColumnHeaderBand1.Controls[I]).Enabled := True;
end;
if ColumnHeaderBand1.Controls[I] is TQRLabel then
begin
if Tao_Print_Flag then
TQRLabel(ColumnHeaderBand1.Controls[I]).Enabled := False
else TQRLabel(ColumnHeaderBand1.Controls[I]).Enabled := True;
end;
end;
for I := 0 to DetailBand1.ControlCount - 1 do //设置表内容的套打
begin
if DetailBand1.Controls[I] is TQRShape then
begin
if Tao_Print_Flag then
TQRShape(DetailBand1.Controls[I]).Enabled := False
else TQRShape(DetailBand1.Controls[I]).Enabled := True;
end;
end;
for i := 0 to PageFooterBand1.ControlCount - 1 do //设置页尾的套打
begin
if PageFooterBand1.Controls[I] is TQRLabel then
begin
if Tao_Print_Flag then
begin
TQRLabel(PageFooterBand1.Controls[I]).Enabled := False;
if (PageFooterBand1.Controls[I].Name = 'QRLabel29') then
TQRLabel(PageFooterBand1.Controls[I]).Enabled := True;
end
else TQRLabel(PageFooterBand1.Controls[I]).Enabled := True;
end;
if PageFooterBand1.Controls[I] is TQRShape then
begin
if Tao_Print_Flag then
TQRShape(PageFooterBand1.Controls[I]).enabled := False
else
TQRShape(PageFooterBand1.Controls[I]).Enabled := True;
end;
if PageFooterBand1.Controls[i] is TQRRichText then
begin
if IntToStr(Printer.PageNumber) = QRLabel29.caption then
TQRRichText(PageFooterBand1.Controls[I]).Enabled := True
else TQRRichText(PageFooterBand1.Controls[I]).Enabled := False;
end;
end;
end;
end.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -