9. September 2009 12:56
9. September 2009 13:01
9. September 2009 13:12
OBJECT Form 50256 Work Time Registration Day MA
{
OBJECT-PROPERTIES
{
Date=09.09.09;
Time=13:04:46;
Modified=Yes;
Version List=NV01;
}
PROPERTIES
{
Width=20350;
Height=11550;
CaptionML=DEA=Arbeitszeiterfassung;
SourceTable=Table50202;
UpdateOnActivate=Yes;
OnOpenForm=VAR
dateitem@1000000000 : Date;
dateitem2@1000000001 : Date;
ltxUserID@1000000002 : Text[30];
BEGIN
// -ROM20090821
FILTERGROUP(2);
SETRANGE("Resource No.",getResourceNo(FORMAT(USERID)));
FILTERGROUP(0);
SETRANGE("Document closed",FALSE);
// +ROM20090821
dateitem := 311207D;
dateitem2 := 0D;
//SETFILTER("Posting Date",'>%1|%2',dateitem,dateitem2);
gbodelete:=FALSE;
END;
OnCloseForm=BEGIN
grcWorkTimeRegistrationSplitt.RESET;
grcWorkTimeRegistrationSplitt.SETRANGE("Resource No.","Resource No.");
grcWorkTimeRegistrationSplitt.SETRANGE("Posting Date","Posting Date");
grcWorkTimeRegistrationSplitt.SETRANGE("Line No.","Line No.");
IF grcWorkTimeRegistrationSplitt.FINDFIRST THEN BEGIN
IF grcWorkTimeRegistrationSplitt."Subline No." <> 0 THEN
grcWorkTimeRegistrationSplitt.TESTFIELD("Work Type Code");
END;
END;
OnQueryCloseForm=VAR
lreWorkTimeRegSplit@1000000000 : Record 50203;
ldeQuantitySplit@1000000001 : Decimal;
lreEmployee@1000000002 : Record 5200;
BEGIN
lreWorkTimeRegSplit.RESET;
lreWorkTimeRegSplit.SETRANGE("Resource No.","Resource No.");
lreWorkTimeRegSplit.SETRANGE("Posting Date","Posting Date");
lreWorkTimeRegSplit.SETRANGE("Line No.","Line No.");
IF lreWorkTimeRegSplit.FINDFIRST THEN BEGIN
REPEAT
ldeQuantitySplit += lreWorkTimeRegSplit."Quantity (splitted)";
UNTIL lreWorkTimeRegSplit.NEXT = 0;
END;
lreEmployee.RESET;
lreEmployee.SETRANGE("No.","Resource No.");
IF lreEmployee.FINDFIRST THEN;
IF NOT lreEmployee."No Post Job" THEN BEGIN
IF Quantity <> ldeQuantitySplit THEN
ERROR('Es wurden die Arbeitszeitmengen nicht richtig verteilt! BITTE PRšFEN!');
END;
END;
OnNextRecord=VAR
lreWorkTimeRegSplit@1000000000 : Record 50203;
ldeQuantitySplit@1000000001 : Decimal;
BEGIN
END;
OnAfterGetRecord=VAR
lboFields@1000000000 : Boolean;
lrcEmployee@1000000001 : Record 5200;
BEGIN
IF NOT grcResource.GET("Resource No.") THEN
grcResource.INIT;
lrcEmployee.RESET;
lrcEmployee.SETRANGE(lrcEmployee."Resource No.","Resource No.");
IF lrcEmployee.FINDFIRST THEN BEGIN
IF NOT lrcEmployee."Extra Work Time" THEN BEGIN
CurrForm."Limit Over Time Cat.1".VISIBLE(TRUE);
CurrForm."Extra Work Time".VISIBLE(FALSE);
END;
IF lrcEmployee."Extra Work Time" THEN BEGIN
CurrForm."Limit Over Time Cat.1".VISIBLE(FALSE);
CurrForm."Extra Work Time".VISIBLE(TRUE);
END;
END;
// +ROM20090323
gbodelete:=FALSE;
END;
OnNewRecord=BEGIN
RESET;
IF NOT gbodelete THEN BEGIN
gtxString := USERID;
greEmployee.SETFILTER(Initials,LOWERCASE(gtxString));
IF greEmployee.FINDFIRST THEN BEGIN
VALIDATE("Resource No.",greEmployee."Resource No.");
END;
END;
CurrForm."Resource No.".ACTIVATE;
END;
OnModifyRecord=BEGIN
showWeekDay;
END;
OnDeleteRecord=BEGIN
gbodelete := TRUE;
END;
}
CONTROLS
{
{ 1160000;TabControl;220 ;220 ;20020;5830 ;HorzGlue=Both;
VertGlue=Top;
Editable=Yes;
PageNamesML=[ENU=General;
DEA=Allgemein] }
{ 1140002;TextBox ;4070 ;2090 ;1700 ;440 ;ParentControl=1160000;
InPage=0;
SourceExpr="Posting Date";
OnValidate=BEGIN
IF gboNotInserted THEN BEGIN
INSERT;
gboNotInserted := FALSE;
END;
END;
OnAfterValidate=BEGIN
//showWeekDay();
//CurrForm.UPDATECONTROLS;
//CurrForm.UPDATE;
END;
}
{ 1140003;Label ;660 ;2090 ;3300 ;440 ;ParentControl=1140002 }
{ 1140005;TextBox ;4070 ;3190 ;5500 ;440 ;ParentControl=1160000;
InPage=0;
SourceExpr=Description }
{ 1140006;Label ;660 ;3190 ;3300 ;440 ;ParentControl=1140005 }
{ 1140007;TextBox ;4070 ;5390 ;2750 ;440 ;Editable=No;
ParentControl=1160000;
InPage=0;
SourceExpr=Quantity }
{ 1140008;Label ;660 ;5390 ;3300 ;440 ;ParentControl=1140007 }
{ 1140010;TextBox ;4070 ;3740 ;1700 ;440 ;ParentControl=1160000;
InPage=0;
SourceExpr="Work Time from" }
{ 1140011;Label ;660 ;3740 ;3300 ;440 ;ParentControl=1140010 }
{ 1140012;TextBox ;4070 ;4290 ;1700 ;440 ;ParentControl=1160000;
InPage=0;
SourceExpr="Work Time to" }
{ 1140013;Label ;660 ;4290 ;3300 ;440 ;ParentControl=1140012 }
{ 1140014;TextBox ;4070 ;4840 ;2750 ;440 ;ParentControl=1160000;
InPage=0;
SourceExpr="Work Time break" }
{ 1140015;Label ;660 ;4840 ;3300 ;440 ;ParentControl=1140014 }
{ 1140016;TextBox ;16060;990 ;2750 ;440 ;ParentControl=1160000;
InPage=0;
SourceExpr="km with privat car" }
{ 1140017;Label ;12650;990 ;3300 ;440 ;ParentControl=1140016 }
{ 1140018;TextBox ;16060;2090 ;2750 ;440 ;ParentControl=1160000;
InPage=0;
SourceExpr="subsistence costs" }
{ 1140019;Label ;12650;2090 ;3300 ;440 ;ParentControl=1140018 }
{ 1140022;TextBox ;16060;1540 ;2750 ;440 ;ParentControl=1160000;
InPage=0;
SourceExpr="kilometer allowance" }
{ 1140023;Label ;12650;1540 ;3300 ;440 ;ParentControl=1140022 }
{ 1140000;CheckBox ;16060;3190 ;440 ;440 ;ParentControl=1160000;
InPage=0;
ShowCaption=No;
SourceExpr="Document closed" }
{ 1140001;Label ;12650;3190 ;3300 ;440 ;ParentControl=1140000 }
{ 1000000003;TextBox;10890;3740 ;1540 ;440 ;Editable=No;
ParentControl=1160000;
InPage=0;
SourceExpr="Limit Over Time Cat.1";
OnActivate=VAR
lrcEmployee@1000000000 : Record 5200;
BEGIN
END;
}
{ 1000000005;Label ;7700 ;3740 ;3080 ;440 ;ParentControl=1000000003;
CaptionML=DEA=šberstunden 50% }
{ 1000000006;TextBox;10890;4290 ;1540 ;440 ;Editable=No;
ParentControl=1160000;
InPage=0;
SourceExpr="Limit Over Time Cat. 2" }
{ 1000000007;Label ;7700 ;4290 ;3080 ;440 ;ParentControl=1000000006;
CaptionML=DEA=šberstunden Block }
{ 1000000008;TextBox;10890;4840 ;1540 ;440 ;Editable=No;
ParentControl=1160000;
InPage=0;
SourceExpr="Limit Over Time Cat. 3" }
{ 1000000009;Label ;7700 ;4840 ;3080 ;440 ;ParentControl=1000000008;
CaptionML=DEA=šberstunden 100% }
{ 1000000000;TextBox;4070 ;990 ;2750 ;440 ;ParentControl=1160000;
InPage=0;
SourceExpr="Resource No.";
OnValidate=VAR
lrcEmployee@1000000000 : Record 5200;
BEGIN
CurrForm.SAVERECORD;
END;
OnAfterValidate=VAR
lrcEmployee@1000000000 : Record 5200;
BEGIN
INSERT;
UpdateForm;
END;
}
{ 1000000001;Label ;660 ;990 ;3300 ;440 ;ParentControl=1000000000 }
{ 1000000010;TextBox;4070 ;1540 ;5500 ;440 ;Editable=No;
ParentControl=1160000;
InPage=0;
SourceExpr="Resource Name" }
{ 1000000011;Label ;660 ;1540 ;3300 ;440 ;ParentControl=1000000010 }
{ 1000000012;TextBox;16060;5390 ;2750 ;440 ;Editable=No;
ParentControl=1160000;
InPage=0;
SourceExpr="Quantity (splitted)" }
{ 1000000013;Label ;12650;5390 ;3300 ;440 ;ParentControl=1000000012 }
{ 1000000014;TextBox;16060;2640 ;2750 ;440 ;ParentControl=1160000;
InPage=0;
SourceExpr="constr. allowance" }
{ 1000000015;Label ;12650;2640 ;3300 ;440 ;ParentControl=1000000014 }
{ 1000000017;TextBox;5830 ;2090 ;2200 ;440 ;Editable=No;
ParentControl=1160000;
InPage=0;
SourceExpr=Weekday2 }
{ 1000000016;TextBox;4070 ;2640 ;2750 ;440 ;ParentControl=1160000;
InPage=0;
SourceExpr="Comp Time";
OnActivate=BEGIN
IF ("Comp Time" <> "Comp Time"::" ") AND ("Comp Time" <> "Comp Time"::Zeitausgleich) THEN BEGIN
CurrForm."Work Time from".EDITABLE(FALSE);
CurrForm."Work Time to".EDITABLE(FALSE);
CurrForm."Work Time break".EDITABLE(FALSE);
CurrForm.SubForm.ENABLED(FALSE);
END ELSE BEGIN
CurrForm."Work Time from".EDITABLE(TRUE);
CurrForm."Work Time to".EDITABLE(TRUE);
CurrForm."Work Time break".EDITABLE(TRUE);
CurrForm.SubForm.ENABLED(TRUE);
END;
END;
OnAfterValidate=BEGIN
IF (FormEditable = FALSE) THEN BEGIN
CurrForm.Description.EDITABLE(FALSE);
CurrForm."Work Time from".EDITABLE(FALSE);
CurrForm."Work Time to".EDITABLE(FALSE);
CurrForm."Work Time break".EDITABLE(FALSE);
CurrForm.Quantity.EDITABLE(FALSE);
END;
END;
}
{ 1000000018;Label ;660 ;2640 ;3300 ;440 ;ParentControl=1000000016;
CaptionML=DEA=Anwesenheit }
{ 1000000019;CheckBox;6930;4840 ;550 ;440 ;ParentControl=1160000;
InPage=0;
ShowCaption=No;
ToolTipML=[ENU=Is Break allowance binding!;
DEA=Ist Pause di„tenpflichtig!];
SourceExpr="Allow. binding";
OnAfterValidate=BEGIN
IF "Quantity (splitted)" <> 0 THEN
//CurrForm.SubForm.FORM.updateForm;
CurrForm."subsistence costs".UPDATE;
END;
}
{ 1000000020;TextBox;10890;3740 ;1540 ;440 ;Editable=No;
ParentControl=1160000;
InPage=0;
SourceExpr="Extra Work Time" }
{ 1000000021;Label ;7700 ;3740 ;3080 ;440 ;ParentControl=1000000020;
CaptionML=[ENU=Extra Work Time;
DEA=Mehrstunden] }
{ 1000000022;CommandButton;10890;5390;1540;440;
ParentControl=1160000;
InPage=0;
CaptionML=[ENU=Update;
DEA=Aktualisieren];
OnPush=BEGIN
UpdateForm;
END;
}
{ 1000000023;CheckBox;10450;990 ;440 ;440 ;ParentControl=1160000;
InPage=0;
ShowCaption=No;
SourceExpr="layed Overtime";
OnValidate=BEGIN
CheckOverTime;
END;
}
{ 1000000024;Label ;7040 ;990 ;3300 ;440 ;ParentControl=1000000023;
CaptionML=[ENU=Layed Overtime;
DEA=angeordnete šberstunden] }
{ 1160006;SubForm ;220 ;6490 ;20020;4070 ;Name=SubForm;
HorzGlue=Both;
VertGlue=Both;
Border=No;
SubFormID=Form50210;
SubFormLink=Resource No.=FIELD(Resource No.),
Line No.=FIELD(Line No.) }
{ 1160014;MenuButton;15730;10780;2200 ;550 ;HorzGlue=Right;
VertGlue=Bottom;
CaptionML=[ENU=Work Time &Document;
DEA=Arbeitszeit&dokument];
Menu=MENUITEMS
{
{ ID=1160023;
PushAction=LookupTable;
ShortCutKey=F5;
CaptionML=[ENU=&List;
DEA=&šbersicht] }
{ ID=1160016;
Visible=No;
ShortCutKey=F11;
CaptionML=[ENU=&Post;
DEA=&Buchen];
OnPush=BEGIN
// -ANC20081006
TESTFIELD("Approval Status Responsible","Approval Status Responsible"::Released);
// +ANC20081006
//NewVision02.crtJobJnlOfWorkTimeDocument(Rec);
END;
}
{ ID=1000000002;
Visible=No;
CaptionML=DEA=&Genehmigungen;
OnPush=VAR
lrcApprovalEntry@1000000001 : Record 454;
BEGIN
{
ApprovalEntries.Setfilters(DATABASE::"Work time registration Header",lrcApprovalEntry."Document Type"::Order,"Work Time Doc. No.")
;
ApprovalEntries.RUN;
}
END;
}
}
}
{ 1160015;CommandButton;18040;10780;2200;550;HorzGlue=Right;
VertGlue=Bottom;
PushAction=FormHelp }
{ 1160017;MenuButton;11110;10780;2200 ;550 ;HorzGlue=Right;
VertGlue=Bottom;
Visible=No;
CaptionML=[ENU=&Line;
DEA=&Zeile];
Menu=MENUITEMS
{
{ ID=1160022;
Visible=No;
ShortCutKey=Strg+F5;
CaptionML=DEA=&Belege;
OnPush=BEGIN
//CurrForm.SubForm.FORM.DrillDownReceipts;
END;
}
}
}
{ 1000000004;MenuButton;13420;10780;2200;550;HorzGlue=Right;
VertGlue=Bottom;
Visible=Yes;
CaptionML=[DEU=F&unktion;
ENU=F&unctions];
Menu=MENUITEMS
{
{ ID=1000000026;
Visible=No;
CaptionML=[DEU=&Genehmigungsanforderung senden;
ENU=Send A&pproval Request;
DEA=<&Genehmigungsanforderung senden>];
OnPush=VAR
"Release Sales Document"@1002 : Codeunit 414;
BEGIN
//IF ApprovalMgt.SendWTDApprovalRequest(Rec) THEN;
{
// -ANC20080926
TESTFIELD("Document closed",TRUE)
IF greUserWorkflow.GET(USERID) THEN BEGIN
RecRefWorkflow.GETTABLE(Rec);
gcuWorkflow."Workflow aktivieren"('WF0008',RecRefWorkflow.RECORDID,USERID,USERID,greUserWorkflow.VorgesetzterID,"No.",'<+0D>');
END;
// +ANC20080927
}
END;
}
{ ID=1000000027;
Visible=No;
CaptionML=[DEU=&Genehmigungsanforderung stornieren;
ENU=Cancel Approval Re?
DEA=<&Genehmigungsanforderung stornieren>];
OnPush=VAR
"Release Sales Document"@1002 : Codeunit 414;
BEGIN
//IF ApprovalMgt.CancelWTDApprovalRequest(Rec,TRUE,TRUE) THEN;
END;
}
{ ID=1000000028;
Visible=No;
MenuItemType=Separator }
{ ID=1000000029;
Visible=No;
ShortCutKey=Strg+F11;
CaptionML=[DEU=Freigeben;
ENU=Re&lease;
DEA=<Freigeben>];
OnPush=VAR
ReleaseSalesDoc@1000 : Codeunit 414;
BEGIN
//MESSAGE(Text001);
//Status := Status::Released;
//MODIFY;
END;
}
{ ID=1000000030;
Visible=No;
CaptionML=[DEU=Stat&us zurcksetzen;
ENU=Re&open;
DEA=<Stat&us zurcksetzen>];
OnPush=VAR
ReleaseSalesDoc@1001 : Codeunit 414;
BEGIN
//reopen();
END;
}
{ ID=1000000025;
CaptionML=DEA=šberstunden buchen;
OnPush=BEGIN
greWorktimebalance.PostEntry("Resource No.");
END;
}
{ ID=1000000031;
PushAction=RunObject;
CaptionML=DEA=ausgezahlte šberstunden;
RunObject=Form 50218 }
}
}
}
CODE
{
VAR
NewVision02@1160000 : Codeunit 51001;
grcResource@1160001 : Record 156;
Text001@1000000000 : TextConst 'DEA=Die Freigabe muss ber den Genehmigungsprozess erfolgen!';
Weekday2@1000000001 : Text[30];
Weekday@1000000002 : Integer;
grcWorkTimeRegistrationLine@1000000003 : Record 50202;
grcWorkTimeRegistrationSplitt@1000000004 : Record 50203;
gcoUser@1000000005 : Code[20];
greWorktimebalance@1000000006 : Record 50206;
gtxString@1000000007 : Text[30];
greEmployee@1000000008 : Record 5200;
gbodelete@1000000009 : Boolean;
gboNotInserted@1000000010 : Boolean;
PROCEDURE showWeekDay@1000000000();
BEGIN
//ROM20081205
Weekday2 := '';
//grcWorkTimeRegistrationLine.SETRANGE("Line No.");
//IF grcWorkTimeRegistrationLine.GET("Resource No.") THEN;
IF NOT ("Posting Date" = 0D) THEN BEGIN
Weekday := DATE2DWY("Posting Date",1);
CASE Weekday OF
1:BEGIN
Weekday2 := 'Montag';
"Week Day" := 'Montag';
END;
2:BEGIN
Weekday2 := 'Dienstag';
"Week Day" := 'Dienstag';
END;
3:BEGIN
Weekday2 := 'Mittwoch';
"Week Day" := 'Mittwoch';
END;
4:BEGIN
Weekday2 := 'Donnerstag';
"Week Day" := 'Donnerstag';
END;
5:BEGIN
Weekday2 := 'Freitag';
"Week Day" := 'Freitag';
END;
6:BEGIN
Weekday2 := 'Samstag';
"Week Day" := 'Samstag';
END;
7:BEGIN
Weekday2 := 'Sonntag';
"Week Day" := 'Sonntag';
END;
END;
END;
END;
PROCEDURE updateFlowField@1000000001();
BEGIN
CurrForm."subsistence costs".ACTIVATE;
CurrForm."Allow. binding".ACTIVATE;
END;
PROCEDURE updateOverTime@1000000002();
BEGIN
CurrForm.UPDATE(FALSE);
END;
PROCEDURE UpdateForm@1000000003();
BEGIN
CurrForm."Limit Over Time Cat.1".ACTIVATE;
CurrForm."Limit Over Time Cat. 2".ACTIVATE;
CurrForm."Limit Over Time Cat. 3".ACTIVATE;
CurrForm."Extra Work Time".ACTIVATE;
END;
PROCEDURE getResourceNo@1000000004(pTxtuserid@1000000000 : Text[30]) rCoResourceNo : Code[20];
VAR
lreEmployee@1000000001 : Record 5200;
BEGIN
lreEmployee.RESET;
lreEmployee.SETRANGE(Initials,LOWERCASE(pTxtuserid));
IF lreEmployee.FINDFIRST THEN BEGIN
rCoResourceNo := lreEmployee."Resource No.";
END;
END;
}
}
9. September 2009 13:14
9. September 2009 13:18
9. September 2009 13:20
9. September 2009 13:39
9. September 2009 13:43
rom hat geschrieben:Danke für die Information, sind das die beiden einzigen Trigger die so arbeiten oder es da noch mehr solcher kleine feinen Fallen....
9. September 2009 13:43
rom hat geschrieben:Danke für die Information, sind das die beiden einzigen Trigger die so arbeiten oder es da noch mehr solcher kleine feinen Fallen....
9. September 2009 13:44
Natalie hat geschrieben:...dafür reicht schon das alleinige anlegen einer lokalen Variable aus), so wird nicht mehr das Systemverhalten herangezogen, sondern das, was in dem Trigger steht. Und wenn wie hier im OnNextRecord-Trigger nichts steht, dann passiert auch nichts ... kein Blättern möglich
9. September 2009 13:45
mikka hat geschrieben:Mensch Natalie, ich weiß schon warum du unsere "Perle" bist
9. September 2009 13:48
Natalie hat geschrieben:mikka hat geschrieben:Mensch Natalie, ich weiß schon warum du unsere "Perle" bist
Aber der Timo hats bestimmt auch gewusst!
9. September 2009 13:48
Natalie hat geschrieben:mikka hat geschrieben:Mensch Natalie, ich weiß schon warum du unsere "Perle" bist
Aber der Timo hats bestimmt auch gewusst!