Subversion Repositories delphiutils

Compare Revisions

Regard whitespace Rev 79 → Rev 78

/trunk/Zeiterfassung/SQL/TAGE.sql
20,7 → 20,6
[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 = 908
ClientWidth = 852
Color = clBtnFace
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
19,23 → 19,22
object wwDBGrid1: TwwDBGrid
Left = 0
Top = 50
Width = 908
Width = 852
Height = 435
ControlType.Strings = (
'FREIER_TAG;CheckBox;Wahr;Falsch')
Selected.Strings = (
'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')
'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.')
IniAttributes.Delimiter = ';;'
TitleColor = clBtnFace
FixedCols = 0
57,16 → 56,17
object Panel1: TPanel
Left = 0
Top = 0
Width = 908
Width = 852
Height = 50
Align = alTop
TabOrder = 1
ExplicitWidth = 827
DesignSize = (
908
852
50)
object Label1: TLabel
Left = 208
Top = 10
Top = 12
Width = 81
Height = 13
Caption = 'Regelarbeitszeit:'
73,13 → 73,13
end
object Label2: TLabel
Left = 208
Top = 25
Top = 27
Width = 12
Height = 13
Caption = '...'
end
object Button1: TButton
Left = 666
Left = 610
Top = 12
Width = 53
Height = 24
88,9 → 88,10
TabOrder = 0
TabStop = False
OnClick = Button1Click
ExplicitLeft = 585
end
object DBNavigator1: TDBNavigator
Left = 725
Left = 669
Top = 12
Width = 168
Height = 25
98,11 → 99,12
VisibleButtons = [nbFirst, nbLast, nbInsert, nbDelete, nbPost, nbCancel]
Anchors = [akTop, akRight]
TabOrder = 1
ExplicitLeft = 644
end
object ComboBox1: TComboBox
Left = 16
Top = 12
Width = 177
Left = 24
Top = 16
Width = 169
Height = 21
Style = csDropDownList
ItemHeight = 13
209,12 → 211,6
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,7 → 30,6
ComboBox1: TComboBox;
Label1: TLabel;
Label2: TLabel;
ADOTable1BEMERKUNG: TStringField;
procedure ADOTable1NewRecord(DataSet: TDataSet);
procedure FormClose(Sender: TObject; var Action: TCloseAction);
procedure ADOTable1BeforePost(DataSet: TDataSet);
86,7 → 85,7
{$R *.dfm}
 
// TODO: Trennstriche zwischen Wochen oder zwischen Urlauben
// IDEE: Wochenend-Multiplikator
// TODO: Anmerkungen
 
uses
DateUtils, StrUtils, IniFiles;
115,11 → 114,17
end;
end;
 
function MinutenZuHF_Int(min: integer): string;
function MinutenZuHF(f: TField): string;
var
d: integer;
begin
d := min;
if IstLeer(f) then
begin
result := '';
end
else
begin
d := f.AsInteger;
if d < 0 then
begin
result := '-';
131,18 → 136,7
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
202,6 → 196,8
bakEv: TDataSetNotifyEvent;
dead: boolean;
begin
if ADOTable1.ReadOnly then exit;
 
if ADOTable1TAG.IsNull then
begin
baks := '';
213,11 → 209,9
else
DateTimeToString(baks, 'YYYY-MM-DD', ADOTable1TAG.AsDateTime);
end;
ADOTable1.Requery();
 
bakEv := ADOTable1.AfterPost;
ADOTable1.AfterPost := nil;
ADOTable1.DisableControls;
ADOTable1.Requery();
try
ADOTable1.First;
saldo := 0;
243,7 → 237,6
finally
if baks <> '' then ADOTable1.Locate('USERNAME;TAG', VarArrayOf([WUserName, baks]), []);
ADOTable1.AfterPost := bakEv;
ADOTable1.EnableControls;
end;
end;
 
365,7 → 358,7
try
test.Connection := ADOConnection1;
test.Close;
test.SQL.Text := 'select * from TAGE where TAG = ''' + DateToStr(Date) + ''' and USERNAME = ''' + SQL_Escape(ComboBox1.Text) + '''';
test.SQL.Text := 'select * from TAGE where TAG = ''' + DateToStr(Date) + '''';
test.Open;
if test.RecordCount = 0 then
begin
447,9 → 440,6
procedure TForm1.ADOTable1TAGGetText(Sender: TField; var Text: string;
DisplayText: Boolean);
begin
if IstLeer(Sender) then
Text := Sender.AsString
else
Text := DateToStr(EchtesDatum(Sender));
end;
 
515,26 → 505,18
 
procedure TForm1.ComboBox1Change(Sender: TObject);
begin
Label2.Caption := MinutenZuHF_Int(RegelArbeitszeit) + ' Std.';
 
ADOTable1.DisableControls;
 
ADOTable1.Active := false;
ADOTable1.ReadOnly := false;
ADOTable1.ReadOnly := ComboBox1.Text <> WUserName;
ADOTable1.Filter := 'USERNAME = ''' + SQL_Escape(ComboBox1.Text) + '''';
ADOTable1.Filtered := true;
ADOTable1.Active := true;
ADOTable1.Last;
 
ReorgAll;
Button1.Enabled := not ADOTable1.ReadOnly;
 
ADOTable1.Active := false;
ADOTable1.ReadOnly := ComboBox1.Text <> WUserName;
ADOTable1.Active := true;
Label2.Caption := IntToStr(RegelArbeitszeit);
 
ADOTable1.Last;
Button1.Enabled := not ADOTable1.ReadOnly;
 
ADOTable1.EnableControls;
ReorgAll;
end;
 
procedure TForm1.FormClose(Sender: TObject; var Action: TCloseAction);
604,8 → 586,7
begin
if Highlight then exit;
if (Field.FieldName = ADOTable1WOCHENTAG.FieldName) or
(Field.FieldName = ADOTable1BERSTUNDEN.FieldName) or
if (Field.FieldName = ADOTable1BERSTUNDEN.FieldName) or
(Field.FieldName = ADOTable1BERSTUNDEN_SALDO.FieldName) then
begin
ABrush.Color := clBtnFace;