-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathURCCaixa.pas
177 lines (164 loc) · 4.83 KB
/
URCCaixa.pas
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
unit URCCaixa;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, URelPadrao, FMTBcd, RLFilters, RLPDFFilter, DB, SqlExpr, DBClient,
Provider, RLReport, RLXLSFilter, RLParser;
type
TfrmRCCaixa = class(TfrmRelPadrao)
RLLabel3: TRLLabel;
RLLabel4: TRLLabel;
RLLabel5: TRLLabel;
RLLabel6: TRLLabel;
RLLabel7: TRLLabel;
RLLabel8: TRLLabel;
RLLabel9: TRLLabel;
RLGroup1: TRLGroup;
cdsTabCOD_LANCA: TIntegerField;
cdsTabDATA: TDateField;
cdsTabHISTORICO: TStringField;
cdsTabOP: TStringField;
RLBand3: TRLBand;
txtCab: TRLDBText;
RLLabel10: TRLLabel;
RLBand4: TRLBand;
RLDBText2: TRLDBText;
RLDBText3: TRLDBText;
RLDBText4: TRLDBText;
RLDBText5: TRLDBText;
RLDBText6: TRLDBText;
RLBand5: TRLBand;
RLLabel11: TRLLabel;
cdsTabVLR_OPE: TSingleField;
RLDBResult1: TRLDBResult;
RLBand6: TRLBand;
txtSaldo: TRLLabel;
RLLabel12: TRLLabel;
txtEntrada: TRLLabel;
txtSaida: TRLLabel;
RLReport2: TRLReport;
RLBand7: TRLBand;
RLLabel13: TRLLabel;
RLLabel14: TRLLabel;
RLLabel15: TRLLabel;
RLSystemInfo3: TRLSystemInfo;
RLSystemInfo4: TRLSystemInfo;
RLLabel16: TRLLabel;
RLLabel17: TRLLabel;
RLLabel18: TRLLabel;
RLLabel19: TRLLabel;
RLLabel20: TRLLabel;
RLBand8: TRLBand;
RLLabel21: TRLLabel;
RLBand12: TRLBand;
RLLabel24: TRLLabel;
txtSaldo2: TRLLabel;
txtEntrada2: TRLLabel;
txtSaida2: TRLLabel;
RLBand10: TRLBand;
RLDBText7: TRLDBText;
RLDBText8: TRLDBText;
RLDBText9: TRLDBText;
RLDBText10: TRLDBText;
RLDBText11: TRLDBText;
dsRes: TDataSource;
dspRes: TDataSetProvider;
cdsRes: TClientDataSet;
sqlRes: TSQLQuery;
cdsResCOD_TURNO: TIntegerField;
cdsResNUM_CAIXA: TIntegerField;
cdsResDATA: TDateField;
cdsResOP: TStringField;
cdsResHISTORICO: TStringField;
RLReport3: TRLReport;
RLBand9: TRLBand;
RLLabel22: TRLLabel;
RLLabel23: TRLLabel;
RLLabel25: TRLLabel;
RLSystemInfo5: TRLSystemInfo;
RLSystemInfo6: TRLSystemInfo;
RLLabel26: TRLLabel;
RLLabel27: TRLLabel;
RLLabel28: TRLLabel;
RLLabel29: TRLLabel;
RLLabel30: TRLLabel;
RLBand11: TRLBand;
RLLabel31: TRLLabel;
RLBand13: TRLBand;
RLLabel32: TRLLabel;
RLBand14: TRLBand;
RLDBText1: TRLDBText;
RLDBText12: TRLDBText;
RLDBText13: TRLDBText;
RLDBText14: TRLDBText;
RLDBText15: TRLDBText;
RLDBText16: TRLDBText;
RLLabel36: TRLLabel;
txtEntrada3: TRLDBResult;
txtSaida3: TRLDBResult;
RLExpressionParser1: TRLExpressionParser;
RLDBResult2: TRLDBResult;
cdsResVLR_OPE: TSingleField;
procedure RLBand6BeforePrint(Sender: TObject; var PrintIt: Boolean);
procedure RLBand4BeforePrint(Sender: TObject; var PrintIt: Boolean);
procedure txtEntrada3Compute(Sender: TObject; var Value: Variant;
var Text: string; var ComputeIt: Boolean);
procedure txtSaida3Compute(Sender: TObject; var Value: Variant;
var Text: string; var ComputeIt: Boolean);
procedure FormCreate(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
frmRCCaixa: TfrmRCCaixa;
Entrada, Saida, Saldo :Double;
implementation
{$R *.dfm}
procedure TfrmRCCaixa.FormCreate(Sender: TObject);
begin
inherited;
Entrada := 0; Saida := 0;
end;
procedure TfrmRCCaixa.RLBand4BeforePrint(Sender: TObject; var PrintIt: Boolean);
begin
inherited;
if ((cdsTabOP.AsString = 'Entrada') or (cdsTabOP.AsString = 'Recebimento')) then begin
Entrada := Entrada + cdsTabVLR_OPE.AsFloat;
end else if cdsTabOP.AsString = 'Saída' then begin
Saida := Saida + cdsTabVLR_OPE.AsFloat;
end;
end;
procedure TfrmRCCaixa.RLBand6BeforePrint(Sender: TObject;
var PrintIt: Boolean);
begin
inherited;
txtEntrada.Caption := 'Entradas (Recebimentos + Entrada): ' + FormatCurr('R$ #,##0.00', Entrada);
txtSaida.Caption := 'Saídas: ' + FormatCurr('R$ #,##0.00', Saida);
txtSaldo.Caption := 'Saldo: ' + FormatCurr('R$ #,##0.00', Entrada - Saida);
txtEntrada2.Caption := 'Entradas (Recebimentos + Entrada): ' + FormatCurr('R$ #,##0.00', Entrada);
txtSaida2.Caption := 'Saídas: ' + FormatCurr('R$ #,##0.00', Saida);
txtSaldo2.Caption := 'Saldo: ' + FormatCurr('R$ #,##0.00', Entrada - Saida);
end;
procedure TfrmRCCaixa.txtEntrada3Compute(Sender: TObject; var Value: Variant;
var Text: string; var ComputeIt: Boolean);
begin
inherited;
if cdsResOP.AsString = 'Entrada' then begin
ComputeIt := true;
end else begin
ComputeIt := false;
end;
end;
procedure TfrmRCCaixa.txtSaida3Compute(Sender: TObject; var Value: Variant;
var Text: string; var ComputeIt: Boolean);
begin
inherited;
if cdsResOP.AsString = 'Saída' then begin
ComputeIt := true;
end else begin
ComputeIt := false;
end;
end;
end.