Subversion Repositories delphiutils

Compare Revisions

Regard whitespace Rev 78 → Rev 79

/trunk/Zeiterfassung/SQL/TAGE.sql
20,6 → 20,7
[ZUHAUSE] [time](0) NULL,
[ÜBERSTUNDEN] [int] NULL,
[ÜBERSTUNDEN_SALDO] [int] NULL,
[BEMERKUNG] [varchar](100) NOT NULL,
CONSTRAINT [PK_KOPF] PRIMARY KEY CLUSTERED
(
[TAG] ASC,
/trunk/Zeiterfassung/Zeiterfassung.exe
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/trunk/Zeiterfassung/ZeiterfassungMain.dfm
3,7 → 3,7
Top = 0
Caption = 'Digitale Zeiterfassung'
ClientHeight = 485
ClientWidth = 852
ClientWidth = 908
Color = clBtnFace
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
19,22 → 19,23
object wwDBGrid1: TwwDBGrid
Left = 0
Top = 50
Width = 852
Width = 908
Height = 435
ControlType.Strings = (
'FREIER_TAG;CheckBox;Wahr;Falsch')
Selected.Strings = (
'WOCHENTAG'#9'2'#9' '
'TAG'#9'10'#9'TAG'
'FREIER_TAG'#9'6'#9'Frei'
'KOMMEN'#9'8'#9'Kommen'
'PAUSE_START'#9'8'#9'Pause'
'PAUSE_ENDE'#9'8'#9'Ende'
'GEHEN'#9'9'#9'Gehen'
'SONSTIGER_ABZUG'#9'10'#9'Sonst. Abzug'
'ZUHAUSE'#9'11'#9'Arb. zuhause'
#220'BERSTUNDEN'#9'15'#9#220'berstunden heute'
#220'BERSTUNDEN_SALDO'#9'16'#9#220'berstunden ges.')
'WOCHENTAG'#9'2'#9' '#9'T'#9
'TAG'#9'10'#9'TAG'#9#9
'FREIER_TAG'#9'6'#9'Frei'#9#9
'KOMMEN'#9'8'#9'Kommen'#9#9
'PAUSE_START'#9'8'#9'Pause'#9#9
'PAUSE_ENDE'#9'8'#9'Ende'#9#9
'GEHEN'#9'9'#9'Gehen'#9#9
'SONSTIGER_ABZUG'#9'10'#9'Sonst. Abzug'#9#9
'ZUHAUSE'#9'11'#9'Arb. zuhause'#9#9
#220'BERSTUNDEN'#9'15'#9#220'berstunden heute'#9'T'#9
#220'BERSTUNDEN_SALDO'#9'16'#9#220'berstunden ges.'#9'T'#9
'BEMERKUNG'#9'30'#9'Bemerkung'#9'F')
IniAttributes.Delimiter = ';;'
TitleColor = clBtnFace
FixedCols = 0
56,17 → 57,16
object Panel1: TPanel
Left = 0
Top = 0
Width = 852
Width = 908
Height = 50
Align = alTop
TabOrder = 1
ExplicitWidth = 827
DesignSize = (
852
908
50)
object Label1: TLabel
Left = 208
Top = 12
Top = 10
Width = 81
Height = 13
Caption = 'Regelarbeitszeit:'
73,13 → 73,13
end
object Label2: TLabel
Left = 208
Top = 27
Top = 25
Width = 12
Height = 13
Caption = '...'
end
object Button1: TButton
Left = 610
Left = 666
Top = 12
Width = 53
Height = 24
88,10 → 88,9
TabOrder = 0
TabStop = False
OnClick = Button1Click
ExplicitLeft = 585
end
object DBNavigator1: TDBNavigator
Left = 669
Left = 725
Top = 12
Width = 168
Height = 25
99,12 → 98,11
VisibleButtons = [nbFirst, nbLast, nbInsert, nbDelete, nbPost, nbCancel]
Anchors = [akTop, akRight]
TabOrder = 1
ExplicitLeft = 644
end
object ComboBox1: TComboBox
Left = 24
Top = 16
Width = 169
Left = 16
Top = 12
Width = 177
Height = 21
Style = csDropDownList
ItemHeight = 13
211,6 → 209,12
FieldName = #220'BERSTUNDEN_SALDO'
OnGetText = ADOTable1BERSTUNDEN_SALDOGetText
end
object ADOTable1BEMERKUNG: TStringField
DisplayLabel = 'Bemerkung'
DisplayWidth = 30
FieldName = 'BEMERKUNG'
Size = 100
end
object ADOTable1USERNAME: TStringField
FieldName = 'USERNAME'
Visible = False
/trunk/Zeiterfassung/ZeiterfassungMain.pas
30,6 → 30,7
ComboBox1: TComboBox;
Label1: TLabel;
Label2: TLabel;
ADOTable1BEMERKUNG: TStringField;
procedure ADOTable1NewRecord(DataSet: TDataSet);
procedure FormClose(Sender: TObject; var Action: TCloseAction);
procedure ADOTable1BeforePost(DataSet: TDataSet);
85,7 → 86,7
{$R *.dfm}
 
// TODO: Trennstriche zwischen Wochen oder zwischen Urlauben
// TODO: Anmerkungen
// IDEE: Wochenend-Multiplikator
 
uses
DateUtils, StrUtils, IniFiles;
114,17 → 115,11
end;
end;
 
function MinutenZuHF(f: TField): string;
function MinutenZuHF_Int(min: integer): string;
var
d: integer;
begin
if IstLeer(f) then
begin
result := '';
end
else
begin
d := f.AsInteger;
d := min;
if d < 0 then
begin
result := '-';
136,7 → 131,18
end;
result := result + Format('%.2d:%.2d', [d div 60, d mod 60]);
end;
 
function MinutenZuHF(f: TField): string;
begin
if IstLeer(f) then
begin
result := '';
end
else
begin
result := MinutenZuHF_Int(f.AsInteger);
end;
end;
 
function EchtesDatum(f: TField): TDate;
begin
196,8 → 202,6
bakEv: TDataSetNotifyEvent;
dead: boolean;
begin
if ADOTable1.ReadOnly then exit;
 
if ADOTable1TAG.IsNull then
begin
baks := '';
209,9 → 213,11
else
DateTimeToString(baks, 'YYYY-MM-DD', ADOTable1TAG.AsDateTime);
end;
ADOTable1.Requery();
 
bakEv := ADOTable1.AfterPost;
ADOTable1.AfterPost := nil;
ADOTable1.Requery();
ADOTable1.DisableControls;
try
ADOTable1.First;
saldo := 0;
237,6 → 243,7
finally
if baks <> '' then ADOTable1.Locate('USERNAME;TAG', VarArrayOf([WUserName, baks]), []);
ADOTable1.AfterPost := bakEv;
ADOTable1.EnableControls;
end;
end;
 
358,7 → 365,7
try
test.Connection := ADOConnection1;
test.Close;
test.SQL.Text := 'select * from TAGE where TAG = ''' + DateToStr(Date) + '''';
test.SQL.Text := 'select * from TAGE where TAG = ''' + DateToStr(Date) + ''' and USERNAME = ''' + SQL_Escape(ComboBox1.Text) + '''';
test.Open;
if test.RecordCount = 0 then
begin
440,6 → 447,9
procedure TForm1.ADOTable1TAGGetText(Sender: TField; var Text: string;
DisplayText: Boolean);
begin
if IstLeer(Sender) then
Text := Sender.AsString
else
Text := DateToStr(EchtesDatum(Sender));
end;
 
505,18 → 515,26
 
procedure TForm1.ComboBox1Change(Sender: TObject);
begin
Label2.Caption := MinutenZuHF_Int(RegelArbeitszeit) + ' Std.';
 
ADOTable1.DisableControls;
 
ADOTable1.Active := false;
ADOTable1.ReadOnly := ComboBox1.Text <> WUserName;
ADOTable1.ReadOnly := false;
ADOTable1.Filter := 'USERNAME = ''' + SQL_Escape(ComboBox1.Text) + '''';
ADOTable1.Filtered := true;
ADOTable1.Active := true;
 
ReorgAll;
 
ADOTable1.Active := false;
ADOTable1.ReadOnly := ComboBox1.Text <> WUserName;
ADOTable1.Active := true;
 
ADOTable1.Last;
 
Button1.Enabled := not ADOTable1.ReadOnly;
 
Label2.Caption := IntToStr(RegelArbeitszeit);
 
ReorgAll;
ADOTable1.EnableControls;
end;
 
procedure TForm1.FormClose(Sender: TObject; var Action: TCloseAction);
586,7 → 604,8
begin
if Highlight then exit;
if (Field.FieldName = ADOTable1BERSTUNDEN.FieldName) or
if (Field.FieldName = ADOTable1WOCHENTAG.FieldName) or
(Field.FieldName = ADOTable1BERSTUNDEN.FieldName) or
(Field.FieldName = ADOTable1BERSTUNDEN_SALDO.FieldName) then
begin
ABrush.Color := clBtnFace;