From 01c462c5e0aced0c31c9e3b379403fff4cc06001 Mon Sep 17 00:00:00 2001 From: RaTr66 <144929712+RaTr66@users.noreply.github.com> Date: Thu, 19 Sep 2024 21:16:19 +0200 Subject: [PATCH 1/5] Journal Posting --- .../ConferenceJnlCheckLine.Codeunit.al | 5 --- .../ConferenceJnlPostLine.Codeunit.al | 41 +++++++++++++++++++ app/src/page/ConferenceRegisterList.Page.al | 2 +- app/src/table/ConferenceLedgerEntry.Table.al | 34 +++++++++++++++ 4 files changed, 76 insertions(+), 6 deletions(-) diff --git a/app/src/codeunit/ConferenceJnlCheckLine.Codeunit.al b/app/src/codeunit/ConferenceJnlCheckLine.Codeunit.al index 5a598e9..a844d2a 100644 --- a/app/src/codeunit/ConferenceJnlCheckLine.Codeunit.al +++ b/app/src/codeunit/ConferenceJnlCheckLine.Codeunit.al @@ -55,9 +55,4 @@ codeunit 50000 "Conference Jnl.-Check Line ASD" if LocalQty = 0 then Error(QuantityNotEqualZeroErr); end; - - local procedure GetResource() - begin - - end; } \ No newline at end of file diff --git a/app/src/codeunit/ConferenceJnlPostLine.Codeunit.al b/app/src/codeunit/ConferenceJnlPostLine.Codeunit.al index c529468..8a18f62 100644 --- a/app/src/codeunit/ConferenceJnlPostLine.Codeunit.al +++ b/app/src/codeunit/ConferenceJnlPostLine.Codeunit.al @@ -5,7 +5,11 @@ codeunit 50001 "Conference Jnl.-Post Line ASD" var ConferenceJournalASD: Record "Conference Journal ASD"; ConferenceLineASD: Record "Conference Line ASD"; + ConferenceRegister: Record "Conference Register ASD"; + ConferenceJnlCheckLineASD: Codeunit "Conference Jnl.-Check Line ASD"; + NextEntryNo: Integer; + trigger OnRun() begin @@ -49,6 +53,43 @@ codeunit 50001 "Conference Jnl.-Post Line ASD" local procedure PostJournalToLedger(ConferenceJournalASD: Record "Conference Journal ASD") var ConferenceLedgerEntryASD: Record "Conference Ledger Entry ASD"; + ConferenceASD: Record "Conference ASD"; + begin + if NextEntryNo = 0 then begin + ConferenceLedgerEntryASD.LockTable(); + NextEntryNo := ConferenceLedgerEntryASD.GetLastEntryNo() + 1; + end; + + if ConferenceRegister."No." = 0 then begin + ConferenceRegister.LockTable(); + if (not ConferenceRegister.FindLast()) or (ConferenceRegister."To Entry No." <> 0) then begin + ConferenceRegister.Init(); + ConferenceRegister."No." := ConferenceRegister."No." + 1; + ConferenceRegister."From Entry No." := NextEntryNo; + ConferenceRegister."To Entry No." := NextEntryNo; + ConferenceRegister."Creation Date" := Today(); + ConferenceRegister."Creation Time" := Time(); + ConferenceRegister."Source Code" := ConferenceJournalASD."Source Code"; + ConferenceRegister."Journal Batch Name" := ConferenceJournalASD."Journal Batch Name"; + ConferenceRegister."User ID" := UserId(); + ConferenceRegister.Insert(); + end; + end; + ConferenceRegister."To Entry No." := NextEntryNo; + ConferenceRegister.Modify(); + + ConferenceASD.Get(ConferenceJournalASD."Document No."); + //ConferenceASD.TestField(Blocked, false); + + ConferenceLedgerEntryASD.Init(); + ConferenceLedgerEntryASD.CopyFromConferenceJnlLine(ConferenceJournalASD); + + ConferenceLedgerEntryASD."Total Price" := Round(ConferenceLedgerEntryASD."Total Price"); + ConferenceLedgerEntryASD.Description := ''; + ConferenceLedgerEntryASD."User ID" := UserId(); + ConferenceLedgerEntryASD."Entry No." := NextEntryNo; + ConferenceLedgerEntryASD.Insert(); + NextEntryNo := NextEntryNo + 1; end; } \ No newline at end of file diff --git a/app/src/page/ConferenceRegisterList.Page.al b/app/src/page/ConferenceRegisterList.Page.al index 0762bb4..42e3f2b 100644 --- a/app/src/page/ConferenceRegisterList.Page.al +++ b/app/src/page/ConferenceRegisterList.Page.al @@ -2,7 +2,7 @@ page 50015 "Conference Register List ASD" { ApplicationArea = Jobs; - Caption = 'Resource Registers'; + Caption = 'Conference Register'; Editable = false; PageType = List; SourceTable = "Resource Register"; diff --git a/app/src/table/ConferenceLedgerEntry.Table.al b/app/src/table/ConferenceLedgerEntry.Table.al index 6579ec8..448e2c8 100644 --- a/app/src/table/ConferenceLedgerEntry.Table.al +++ b/app/src/table/ConferenceLedgerEntry.Table.al @@ -98,6 +98,10 @@ table 50010 "Conference Ledger Entry ASD" Caption = 'No. Series'; TableRelation = "No. Series"; } + field(30; Quantity; decimal) + { + Caption = 'Quantity'; + } } keys @@ -107,4 +111,34 @@ table 50010 "Conference Ledger Entry ASD" Clustered = true; } } + + procedure GetLastEntryNo(): Integer; + var + FindRecordManagement: Codeunit "Find Record Management"; + begin + exit(FindRecordManagement.GetLastEntryIntFieldValue(Rec, FieldNo("Entry No."))) + end; + + procedure CopyFromConferenceJnlLine(ConferenceJournalASD: Record "Conference Journal ASD"); + begin + Rec."Entry Type" := ConferenceJournalASD."Entry Type"; + Rec."Document No." := ConferenceJournalASD."Document No."; + Rec."Posting Date" := ConferenceJournalASD."Posting Date"; + Rec."Document Date" := ConferenceJournalASD."Document Date"; + Rec."Document No." := ConferenceJournalASD."Document No."; + Rec.Description := ConferenceJournalASD.Description; + Rec.Quantity := ConferenceJournalASD.Quantity; + Rec."Unit Price" := ConferenceJournalASD."Unit Price"; + Rec."Total Price" := ConferenceJournalASD."Total Price"; + //Rec."Starting Date" := ConferenceJournalASD."Starting Date"; + //Rec."Resource Ledger Entry No." := SeminarJnlLine."Resource Ledger Entry No."; + Rec."Source Code" := ConferenceJournalASD."Source Code"; + Rec."Journal Batch Name" := ConferenceJournalASD."Journal Batch Name"; + Rec."Reason Code" := ConferenceJournalASD."Reason Code"; + // ASD8.03< + //Rec."Global Dimension 1 Code" := SeminarJnlLine."Shortcut Dimension 1 Code"; + //Rec."Global Dimension 2 Code" := SeminarJnlLine."Shortcut Dimension 2 Code"; + //Rec."Dimension Set ID" := SeminarJnlLine."Dimension Set ID"; + // ASD8.03> + end; } \ No newline at end of file From 425a0bcd489f442b90d0624f5b4b4d086176da04 Mon Sep 17 00:00:00 2001 From: RaTr66 <144929712+RaTr66@users.noreply.github.com> Date: Fri, 20 Sep 2024 01:01:36 +0200 Subject: [PATCH 2/5] Conference Ledger Entries --- app/src/page/ConferenceLedgerEntries.Page.al | 118 +++++++++++++++++++ app/src/table/ConferenceRegister.Table.al | 4 +- 2 files changed, 120 insertions(+), 2 deletions(-) create mode 100644 app/src/page/ConferenceLedgerEntries.Page.al diff --git a/app/src/page/ConferenceLedgerEntries.Page.al b/app/src/page/ConferenceLedgerEntries.Page.al new file mode 100644 index 0000000..8895db1 --- /dev/null +++ b/app/src/page/ConferenceLedgerEntries.Page.al @@ -0,0 +1,118 @@ +page 50020 "Conference Ledger Entries ASD" +{ + ApplicationArea = Jobs; + Caption = 'Conference Ledger Entries'; + DataCaptionFields = "Resource No."; + Editable = false; + PageType = List; + SourceTable = "Conference Ledger Entry ASD"; + SourceTableView = Sorting("Description", "Posting Date") order(descending); + UsageCategory = History; + + layout + { + area(content) + { + repeater(Lists) + { + field("Entry Type"; Rec."Entry Type") + { + ToolTip = 'Specifies the value of the Entry Type field.'; + } + field("Document No."; Rec."Document No.") + { + ToolTip = 'Specifies the value of the Document No. field.'; + } + field("Journal Batch Name"; Rec."Journal Batch Name") + { + ToolTip = 'Specifies the value of the Journal Batch Name field.'; + } + field("Resource No."; Rec."Resource No.") + { + ToolTip = 'Specifies the value of the Resource No. field.'; + } + field("Source Code"; Rec."Source Code") + { + ToolTip = 'Specifies the value of the Source Code field.'; + } + field("Unit Price"; Rec."Unit Price") + { + ToolTip = 'Specifies the value of the Unit Price field.'; + } + field("Total Price"; Rec."Total Price") + { + ToolTip = 'Specifies the value of the Total Price field.'; + } + field("Unit of Measure Code"; Rec."Unit of Measure Code") + { + ToolTip = 'Specifies the value of the Unit of Measure Code field.'; + } + field("User ID"; Rec."User ID") + { + ToolTip = 'Specifies the value of the User ID field.'; + } + field("Posting Date"; Rec."Posting Date") + { + ToolTip = 'Specifies the value of the Posting Date field.'; + } + field(Description; Rec.Description) + { + ToolTip = 'Specifies the value of the Description field.'; + } + field("Document Date"; Rec."Document Date") + { + ToolTip = 'Specifies the value of the Document Date field.'; + } + field("Entry No."; Rec."Entry No.") + { + ToolTip = 'Specifies the value of the Entry No. field.'; + } + field("Gen. Bus. Posting Group"; Rec."Gen. Bus. Posting Group") + { + ToolTip = 'Specifies the value of the Gen. Bus. Posting Group field.'; + } + /*field("VAT. Bus. Posting Group"; Rec."VAT. Bus. Posting Group") + { + ToolTip = 'Specifies the value of the VAT. Bus. Posting Group field.'; + }*/ + } + } + + area(factboxes) + { + systempart(Control1900383207; Links) + { + ApplicationArea = RecordLinks; + Visible = false; + } + systempart(Control1905767507; Notes) + { + ApplicationArea = Notes; + Visible = false; + } + } + } + actions + { + area(processing) + { + action("&Navigate") + { + ApplicationArea = Jobs; + Caption = 'Find entries...'; + Image = Navigate; + ShortCutKey = 'Ctrl+Alt+Q'; + ToolTip = 'Find entries and documents that exist for the document number and posting date on the selected document. (Formerly this action was named Navigate.)'; + + trigger OnAction() + begin + Navigate.SetDoc(Rec."Posting Date", Rec."Document No."); + Navigate.SetRec(Rec); + Navigate.Run(); + end; + } + } + } + var + Navigate: Page Navigate; +} \ No newline at end of file diff --git a/app/src/table/ConferenceRegister.Table.al b/app/src/table/ConferenceRegister.Table.al index 0235460..6d473fd 100644 --- a/app/src/table/ConferenceRegister.Table.al +++ b/app/src/table/ConferenceRegister.Table.al @@ -14,12 +14,12 @@ table 50011 "Conference Register ASD" field(2; "From Entry No."; Integer) { Caption = 'From Entry No.'; - TableRelation = "Res. Ledger Entry"; + TableRelation = "Conference Ledger Entry ASD"; } field(3; "To Entry No."; Integer) { Caption = 'To Entry No.'; - TableRelation = "Res. Ledger Entry"; + TableRelation = "Conference Ledger Entry ASD"; } field(4; "Creation Date"; Date) { From bb0e7ba277dec66f64559d55608abbfab4989802 Mon Sep 17 00:00:00 2001 From: RaTr66 <144929712+RaTr66@users.noreply.github.com> Date: Fri, 20 Sep 2024 01:24:49 +0200 Subject: [PATCH 3/5] final version of 20/09/24 --- .../codeunit/ConfRegShowLedger.Codeunit.al | 14 +++++++++++ .../ConferenceJnlPostLine.Codeunit.al | 2 +- app/src/page/ConferenceCard.Page.al | 4 +++ app/src/page/ConferenceRegisterList.Page.al | 25 ++++++------------- app/src/page/Conferencelocationcard.Page.al | 11 +++++++- app/src/page/PostedConferenceCard.Page.al | 4 +++ app/src/table/Conference.Table.al | 4 +++ app/src/table/ConferenceLedgerEntry.Table.al | 2 +- app/src/table/PostedConferenceHeader.Table.al | 4 +++ 9 files changed, 49 insertions(+), 21 deletions(-) create mode 100644 app/src/codeunit/ConfRegShowLedger.Codeunit.al diff --git a/app/src/codeunit/ConfRegShowLedger.Codeunit.al b/app/src/codeunit/ConfRegShowLedger.Codeunit.al new file mode 100644 index 0000000..1f60a86 --- /dev/null +++ b/app/src/codeunit/ConfRegShowLedger.Codeunit.al @@ -0,0 +1,14 @@ +codeunit 50006 "Conf. Reg.-Show Ledger ASD" +{ + TableNo = "Conference Register ASD"; + + trigger OnRun() + begin + ConfLedgEntry.SetRange("Entry No.", Rec."From Entry No.", Rec."To Entry No."); + PAGE.Run(PAGE::"Conference Ledger Entries ASD", ConfLedgEntry); + end; + + var + ConfLedgEntry: Record "Conference Ledger Entry ASD"; +} + diff --git a/app/src/codeunit/ConferenceJnlPostLine.Codeunit.al b/app/src/codeunit/ConferenceJnlPostLine.Codeunit.al index 8a18f62..f4ef936 100644 --- a/app/src/codeunit/ConferenceJnlPostLine.Codeunit.al +++ b/app/src/codeunit/ConferenceJnlPostLine.Codeunit.al @@ -80,7 +80,7 @@ codeunit 50001 "Conference Jnl.-Post Line ASD" ConferenceRegister.Modify(); ConferenceASD.Get(ConferenceJournalASD."Document No."); - //ConferenceASD.TestField(Blocked, false); + ConferenceASD.TestField(Blocked, false); ConferenceLedgerEntryASD.Init(); ConferenceLedgerEntryASD.CopyFromConferenceJnlLine(ConferenceJournalASD); diff --git a/app/src/page/ConferenceCard.Page.al b/app/src/page/ConferenceCard.Page.al index baa39ef..2b5d841 100644 --- a/app/src/page/ConferenceCard.Page.al +++ b/app/src/page/ConferenceCard.Page.al @@ -60,6 +60,10 @@ page 50003 "Conference Card ASD" Editable = true; ToolTip = 'Specifies the value of the Total Price field.', Comment = '%'; } + field(Blocked; Rec.Blocked) + { + ToolTip = 'Specifies the value of the Blocked field.', Comment = '%'; + } } part(ConferenceRegistrationLines; "Conference Lines ASD") diff --git a/app/src/page/ConferenceRegisterList.Page.al b/app/src/page/ConferenceRegisterList.Page.al index 42e3f2b..750e9ed 100644 --- a/app/src/page/ConferenceRegisterList.Page.al +++ b/app/src/page/ConferenceRegisterList.Page.al @@ -5,7 +5,7 @@ page 50015 "Conference Register List ASD" Caption = 'Conference Register'; Editable = false; PageType = List; - SourceTable = "Resource Register"; + SourceTable = "Conference Register ASD"; UsageCategory = History; layout @@ -87,34 +87,23 @@ page 50015 "Conference Register List ASD" { Caption = '&Register'; Image = Register; - action("Resource Ledger") + action("Conference Ledger") { ApplicationArea = Jobs; - Caption = 'Resource Ledger'; - Image = ResourceLedger; - RunObject = Codeunit "Res. Reg.-Show Ledger"; - ToolTip = 'View the ledger entries for the resource.'; + Caption = 'Conference Ledger'; + Image = Ledger; + RunObject = Codeunit "Conf. Reg.-Show Ledger ASD"; + ToolTip = 'View the ledger entries for the Conference.'; } } } - area(processing) - { - action("Delete Empty Resource Registers") - { - ApplicationArea = All; - Caption = 'Delete Empty Resource Registers'; - Image = Delete; - RunObject = Report "Delete Empty Res. Registers"; - ToolTip = 'Find and delete empty resource registers.'; - } - } area(Promoted) { group(Category_Process) { Caption = 'Process'; - actionref("Resource Ledger_Promoted"; "Resource Ledger") + actionref("Conference Ledger_Promoted"; "Conference Ledger") { } } diff --git a/app/src/page/Conferencelocationcard.Page.al b/app/src/page/Conferencelocationcard.Page.al index 6cd2265..5cba4cc 100644 --- a/app/src/page/Conferencelocationcard.Page.al +++ b/app/src/page/Conferencelocationcard.Page.al @@ -88,8 +88,17 @@ page 50002 "Conference Location Card ASD" Image = Create; trigger OnAction(); + var + ConferenceASD: record "Conference ASD"; begin - Message('in progress'); + if Rec."No." <> '' then begin + ConferenceASD.Init(); + ConferenceASD.ConferenceLocation := Rec."No."; + if Rec."Unit Price" <> 0 then + ConferenceASD."Unit Price" := Rec."Unit Price"; + ConferenceASD.Insert(true); + PAGE.Run(Page::"Conference Card ASD", ConferenceASD); + end; end; } } diff --git a/app/src/page/PostedConferenceCard.Page.al b/app/src/page/PostedConferenceCard.Page.al index 0e55d6e..d669a3d 100644 --- a/app/src/page/PostedConferenceCard.Page.al +++ b/app/src/page/PostedConferenceCard.Page.al @@ -54,6 +54,10 @@ page 50012 "Posted Conference Card ASD" { ToolTip = 'Specifies the value of the Total Price field.', Comment = '%'; } + field(Blocked; Rec.Blocked) + { + ToolTip = 'Specifies the value of the Blocked field.', Comment = '%'; + } } group(Booking) { diff --git a/app/src/table/Conference.Table.al b/app/src/table/Conference.Table.al index 2bf2d30..fb4c395 100644 --- a/app/src/table/Conference.Table.al +++ b/app/src/table/Conference.Table.al @@ -122,6 +122,10 @@ table 50002 "Conference ASD" "Total Price" := "Unit Price" * Duration / 3600000; end; } + field(20; Blocked; Boolean) + { + Caption = 'Blocked'; + } } keys diff --git a/app/src/table/ConferenceLedgerEntry.Table.al b/app/src/table/ConferenceLedgerEntry.Table.al index 448e2c8..be9e700 100644 --- a/app/src/table/ConferenceLedgerEntry.Table.al +++ b/app/src/table/ConferenceLedgerEntry.Table.al @@ -125,7 +125,7 @@ table 50010 "Conference Ledger Entry ASD" Rec."Document No." := ConferenceJournalASD."Document No."; Rec."Posting Date" := ConferenceJournalASD."Posting Date"; Rec."Document Date" := ConferenceJournalASD."Document Date"; - Rec."Document No." := ConferenceJournalASD."Document No."; + //document no duplicate insert removed Rec.Description := ConferenceJournalASD.Description; Rec.Quantity := ConferenceJournalASD.Quantity; Rec."Unit Price" := ConferenceJournalASD."Unit Price"; diff --git a/app/src/table/PostedConferenceHeader.Table.al b/app/src/table/PostedConferenceHeader.Table.al index 4decddf..9aaf29c 100644 --- a/app/src/table/PostedConferenceHeader.Table.al +++ b/app/src/table/PostedConferenceHeader.Table.al @@ -115,6 +115,10 @@ table 50008 "Posted Conference Header ASD" Editable = false; TableRelation = "Source Code"; } + field(20; Blocked; Boolean) + { + Caption = 'Blocked'; + } } keys From f05a679a62338350a87ebbfecde0d5fd9900d2d5 Mon Sep 17 00:00:00 2001 From: RaTr66 <144929712+RaTr66@users.noreply.github.com> Date: Fri, 20 Sep 2024 09:15:59 +0200 Subject: [PATCH 4/5] last version in the merge --- app/src/table/ConferenceLedgerEntry.Table.al | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/src/table/ConferenceLedgerEntry.Table.al b/app/src/table/ConferenceLedgerEntry.Table.al index be9e700..75ff5eb 100644 --- a/app/src/table/ConferenceLedgerEntry.Table.al +++ b/app/src/table/ConferenceLedgerEntry.Table.al @@ -131,14 +131,14 @@ table 50010 "Conference Ledger Entry ASD" Rec."Unit Price" := ConferenceJournalASD."Unit Price"; Rec."Total Price" := ConferenceJournalASD."Total Price"; //Rec."Starting Date" := ConferenceJournalASD."Starting Date"; - //Rec."Resource Ledger Entry No." := SeminarJnlLine."Resource Ledger Entry No."; + //Rec."Resource Ledger Entry No." := ConferenceJournalASD."Resource Ledger Entry No."; Rec."Source Code" := ConferenceJournalASD."Source Code"; Rec."Journal Batch Name" := ConferenceJournalASD."Journal Batch Name"; Rec."Reason Code" := ConferenceJournalASD."Reason Code"; // ASD8.03< - //Rec."Global Dimension 1 Code" := SeminarJnlLine."Shortcut Dimension 1 Code"; - //Rec."Global Dimension 2 Code" := SeminarJnlLine."Shortcut Dimension 2 Code"; - //Rec."Dimension Set ID" := SeminarJnlLine."Dimension Set ID"; + //Rec."Global Dimension 1 Code" := ConferenceJournalASD."Shortcut Dimension 1 Code"; + //Rec."Global Dimension 2 Code" := ConferenceJournalASD."Shortcut Dimension 2 Code"; + //Rec."Dimension Set ID" := ConferenceJournalASD."Dimension Set ID"; // ASD8.03> end; } \ No newline at end of file From 0b7a8d4736668fa0236641a2c5c59d52b384dfda Mon Sep 17 00:00:00 2001 From: RaTr66 <144929712+RaTr66@users.noreply.github.com> Date: Fri, 20 Sep 2024 09:22:41 +0200 Subject: [PATCH 5/5] Action Create Conference Document --- app/src/page/Conferencelocationcard.Page.al | 2 +- app/src/page/Conferencelocationlist.Page.al | 13 +++++++++++-- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/app/src/page/Conferencelocationcard.Page.al b/app/src/page/Conferencelocationcard.Page.al index 5cba4cc..6ba3254 100644 --- a/app/src/page/Conferencelocationcard.Page.al +++ b/app/src/page/Conferencelocationcard.Page.al @@ -81,7 +81,7 @@ page 50002 "Conference Location Card ASD" { action(CreateConferenceDocument) { - Caption = 'Create Conference Document (TEST)'; + Caption = 'Create Conference Document'; ToolTip = 'Specifies the Create Conference Document action'; ApplicationArea = All; Scope = Repeater; diff --git a/app/src/page/Conferencelocationlist.Page.al b/app/src/page/Conferencelocationlist.Page.al index 8ac9b31..ed58386 100644 --- a/app/src/page/Conferencelocationlist.Page.al +++ b/app/src/page/Conferencelocationlist.Page.al @@ -36,15 +36,24 @@ page 50000 "Conference Location List ASD" { action(CreateConferenceDocument) { - Caption = 'Create Conference Document (TEST)'; + Caption = 'Create Conference Document'; ToolTip = 'Specifies the Create Conference Document action'; ApplicationArea = All; Scope = Repeater; Image = Create; trigger OnAction(); + var + ConferenceASD: record "Conference ASD"; begin - Message('in progress'); + if Rec."No." <> '' then begin + ConferenceASD.Init(); + ConferenceASD.ConferenceLocation := Rec."No."; + if Rec."Unit Price" <> 0 then + ConferenceASD."Unit Price" := Rec."Unit Price"; + ConferenceASD.Insert(true); + PAGE.Run(Page::"Conference Card ASD", ConferenceASD); + end; end; } }