You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
225 lines
5.8 KiB
225 lines
5.8 KiB
unit urelRecibo;
|
|
|
|
interface
|
|
|
|
uses
|
|
Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants,
|
|
System.Classes, Vcl.Graphics,
|
|
Vcl.Controls, Vcl.Forms, Vcl.Dialogs, umstMaster, RLReport, Data.DB,
|
|
Vcl.ComCtrls, RLRichText, RLFilters, RLPDFFilter, RLPreviewForm, RLPrinters;
|
|
|
|
type
|
|
TrelRecibo = class(TmstMaster)
|
|
dtsReport: TDataSource;
|
|
dtsDevedor: TDataSource;
|
|
dtsTitulos: TDataSource;
|
|
fr_filterpdf: TRLPDFFilter;
|
|
frRecibo: TRLReport;
|
|
frb_header: TRLBand;
|
|
frpnl_logo: TRLPanel;
|
|
frdbimg_logo: TRLDBImage;
|
|
frpnl_headertop: TRLPanel;
|
|
frlbl_headertop: TRLLabel;
|
|
frpnl_headerbot: TRLPanel;
|
|
frlbl_headerbot: TRLLabel;
|
|
frb_header2: TRLBand;
|
|
frlbl_valortot: TRLLabel;
|
|
frlbl_vlextenso: TRLLabel;
|
|
frpnl_nome: TRLPanel;
|
|
frdblbl_cpf: TRLDBText;
|
|
frdblbl_nome: TRLDBText;
|
|
frlbl_recebemos: TRLLabel;
|
|
frpnl_recibo: TRLPanel;
|
|
frdblbl_nrrecibo: TRLDBText;
|
|
frlbl_recibo: TRLLabel;
|
|
frb_footer: TRLBand;
|
|
frpnl_organizasum: TRLPanel;
|
|
fr_time: TRLSystemInfo;
|
|
fr_date: TRLSystemInfo;
|
|
frlbl_empresa: TRLLabel;
|
|
frlbl_usuario: TRLLabel;
|
|
frdbresult_juros: TRLDBResult;
|
|
frdbresult_multa: TRLDBResult;
|
|
frdbresult_principal: TRLDBResult;
|
|
frdbresult_encargos: TRLDBResult;
|
|
frdbresult_descontos: TRLDBResult;
|
|
frdbresult_total: TRLDBResult;
|
|
frdblbl_usuario: TRLDBText;
|
|
frlbl_formarecebimento: TRLLabel;
|
|
frlbl_obscheque: TRLLabel;
|
|
frpnl_cheque: TRLPanel;
|
|
frlbl_nrcheque: TRLLabel;
|
|
frlbl_banco: TRLLabel;
|
|
frlbl_praca: TRLLabel;
|
|
frlbl_obs1: TRLLabel;
|
|
fr_membobs: TRLMemo;
|
|
frb_detail: TRLBand;
|
|
frdblbl_produto: TRLDBText;
|
|
frdblbl_vencimento: TRLDBText;
|
|
frdblbl_juros: TRLDBText;
|
|
frdblbl_multa: TRLDBText;
|
|
frdblbl_principal: TRLDBText;
|
|
frdblbl_encargos: TRLDBText;
|
|
frdblbl_descontos: TRLDBText;
|
|
frdblbl_total: TRLDBText;
|
|
frpnl_headers: TRLPanel;
|
|
frlbl_vencimento: TRLLabel;
|
|
frlbl_principal: TRLLabel;
|
|
frlbl_encargos: TRLLabel;
|
|
frlbl_descontos: TRLLabel;
|
|
frlbl_total: TRLLabel;
|
|
frlbl_juros: TRLLabel;
|
|
frlbl_multa: TRLLabel;
|
|
frlbl_referente: TRLLabel;
|
|
frsubdbnd1: TRLSubDetail;
|
|
frsubdbndmeio: TRLSubDetail;
|
|
frb_detail2v: TRLBand;
|
|
RLDBText8: TRLDBText;
|
|
RLDBText9: TRLDBText;
|
|
RLDBText10: TRLDBText;
|
|
RLDBText11: TRLDBText;
|
|
RLDBText12: TRLDBText;
|
|
RLDBText13: TRLDBText;
|
|
RLDBText14: TRLDBText;
|
|
RLDBText15: TRLDBText;
|
|
RLPanel1: TRLPanel;
|
|
RLLabel4: TRLLabel;
|
|
RLLabel11: TRLLabel;
|
|
RLLabel12: TRLLabel;
|
|
RLLabel13: TRLLabel;
|
|
RLLabel14: TRLLabel;
|
|
RLLabel15: TRLLabel;
|
|
RLLabel16: TRLLabel;
|
|
RLLabel17: TRLLabel;
|
|
frb_footer2v: TRLBand;
|
|
RLPanel3: TRLPanel;
|
|
RLSystemInfo1: TRLSystemInfo;
|
|
RLSystemInfo2: TRLSystemInfo;
|
|
RLLabel18: TRLLabel;
|
|
RLLabel19: TRLLabel;
|
|
RLDBResult7: TRLDBResult;
|
|
RLDBResult8: TRLDBResult;
|
|
RLDBResult9: TRLDBResult;
|
|
RLDBResult10: TRLDBResult;
|
|
RLDBResult11: TRLDBResult;
|
|
RLDBResult12: TRLDBResult;
|
|
RLDBText16: TRLDBText;
|
|
frlbl_formarecebimento2v: TRLLabel;
|
|
frlbl_obscheque2v: TRLLabel;
|
|
frpnl_cheque2v: TRLPanel;
|
|
frlbl_nrcheque2v: TRLLabel;
|
|
frlbl_banco2v: TRLLabel;
|
|
frlbl_praca2v: TRLLabel;
|
|
RLLabel25: TRLLabel;
|
|
fr_membobs2v: TRLMemo;
|
|
frb_header2v: TRLBand;
|
|
RLPanel5: TRLPanel;
|
|
RLDBImage2: TRLDBImage;
|
|
RLPanel6: TRLPanel;
|
|
frlbl_headertop2v: TRLLabel;
|
|
RLPanel7: TRLPanel;
|
|
frlbl_headerbot2v: TRLLabel;
|
|
frb_header22v: TRLBand;
|
|
frlbl_valortot2v: TRLLabel;
|
|
frlbl_vlextenso2v: TRLLabel;
|
|
RLPanel8: TRLPanel;
|
|
frdblbl_cpf2v: TRLDBText;
|
|
frdblbl_nome2v: TRLDBText;
|
|
RLLabel30: TRLLabel;
|
|
RLPanel9: TRLPanel;
|
|
RLDBText19: TRLDBText;
|
|
RLLabel31: TRLLabel;
|
|
frsubdbnd2: TRLSubDetail;
|
|
RLBand5: TRLBand;
|
|
procedure frReciboBeforePrint(Sender: TObject; var PrintIt: Boolean);
|
|
procedure frReciboAfterPrint(Sender: TObject);
|
|
procedure frsubdbnd2BeforePrint(Sender: TObject; var PrintIt: Boolean);
|
|
private
|
|
procedure SalvarReciboPDF;
|
|
{ Private declarations }
|
|
public
|
|
{ Public declarations }
|
|
end;
|
|
|
|
var
|
|
relRecibo: TrelRecibo;
|
|
|
|
meses: array [1 .. 12] of string = (
|
|
'JANEIRO',
|
|
'FEVEREIRO',
|
|
'MARCO',
|
|
'ABRIL',
|
|
'MAIO',
|
|
'JUNHO',
|
|
'JULHO',
|
|
'AGOSTO',
|
|
'SETEMBRO',
|
|
'OUTUBRO',
|
|
'NOVEMBRO',
|
|
'DEZEMBRO'
|
|
);
|
|
|
|
implementation
|
|
|
|
{$R *.dfm}
|
|
|
|
uses udtmSystem, ufrmAtendimento;
|
|
|
|
procedure TrelRecibo.frReciboAfterPrint(Sender: TObject);
|
|
begin
|
|
frmAtendimento.btn_concluir.Enabled := true;
|
|
SalvarReciboPDF;
|
|
end;
|
|
|
|
procedure TrelRecibo.frReciboBeforePrint(Sender: TObject; var PrintIt: Boolean);
|
|
begin
|
|
//dtsReport.dataset.open;
|
|
dtsDevedor.dataset.open;
|
|
dtsTitulos.dataset.open;
|
|
end;
|
|
|
|
procedure TrelRecibo.frsubdbnd2BeforePrint(Sender: TObject;
|
|
var PrintIt: Boolean);
|
|
begin
|
|
//dtsReport.DataSet.Open;
|
|
//dtsReport.DataSet.RecNo := dtsReport.DataSet.RecordCount;
|
|
//dtmSystem.tblConteudoRecibo.RecNo := 1;
|
|
end;
|
|
|
|
procedure TrelRecibo.SalvarReciboPDF;
|
|
var
|
|
path, file_name: string;
|
|
Fmt: TFormatSettings;
|
|
i: Integer;
|
|
begin
|
|
Fmt := TFormatSettings.Create;
|
|
for i := 0 to High(meses) do
|
|
begin
|
|
Fmt.LongMonthNames[i] := meses[i];
|
|
end;
|
|
path := ExtractFilePath(Application.ExeName) + 'RECIBOS';
|
|
if not DirectoryExists(path) then
|
|
begin
|
|
CreateDir(path);
|
|
end;
|
|
path := path + '\' + FormatDateTime('YYYY', Date);
|
|
if not DirectoryExists(path) then
|
|
begin
|
|
CreateDir(path);
|
|
end;
|
|
path := path + '\' + FormatDateTime('mmmm', Date, Fmt);
|
|
if not DirectoryExists(path) then
|
|
begin
|
|
CreateDir(path);
|
|
end;
|
|
path := path + '\' + FormatDateTime('dd', Date);
|
|
if not DirectoryExists(path) then
|
|
begin
|
|
CreateDir(path);
|
|
end;
|
|
file_name := path + '\' + dtmSystem.tblReciboNR_RECIBO.AsString + '.pdf';
|
|
fr_filterpdf.FileName := file_name;
|
|
frRecibo.SaveToFile(file_name);
|
|
end;
|
|
|
|
end.
|