Skip to content

Commit

Permalink
Merge pull request #51 from fluxxus-nl/Version_3_2_Adj
Browse files Browse the repository at this point in the history
Version 3.2
  • Loading branch information
lvanvugt authored Oct 1, 2024
2 parents 90f75a4 + ddb6cd9 commit bd1e353
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 7 deletions.
4 changes: 2 additions & 2 deletions app/src/codeunit/ConferenceJnlPostLine.Codeunit.al
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,9 @@ codeunit 50001 "Conference Jnl.-Post Line ASD"
ConferenceJournalASD."Source Code" := ConferenceASD."Source Code";
ConferenceJournalASD."Line Discount" := ConferenceLineASD."Line Discount %";
ConferenceJournalASD."Gen. Prod. Posting Group" := LocalConferenceLineASD."Gen. Prod. Posting Group";
ConferenceJournalASD."Gen. Bus. Posting Group" := LocalConferenceLineASD."Gen. Bus. Posting Group";
ConferenceJournalASD."VAT Prod. Posting Group" := LocalConferenceLineASD."VAT Prod. Posting Group";
ConferenceJournalASD."Gen. Bus. Posting Group" := ConferenceASD."Gen. Bus. Posting Group";
ConferenceJournalASD."VAT Bus. Posting Group" := ConferenceASD."VAT Bus. Posting Group";
end;

local procedure PostConferenceLocationToJournal(ConferenceASD: Record "Conference ASD"; LocalConferenceLineASD: Record "Conference Line ASD")
Expand Down Expand Up @@ -167,7 +168,6 @@ codeunit 50001 "Conference Jnl.-Post Line ASD"
ConferenceLedgerEntryASD.CopyFromConferenceJnlLine(ConferenceJournalASD);

ConferenceLedgerEntryASD."Total Price" := Round(ConferenceLedgerEntryASD."Total Price");
ConferenceLedgerEntryASD.Description := '';
ConferenceLedgerEntryASD."User ID" := UserId();
ConferenceLedgerEntryASD."Entry No." := NextEntryNo;
ConferenceLedgerEntryASD.Insert();
Expand Down
10 changes: 10 additions & 0 deletions app/src/table/Conference.Table.al
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,14 @@ table 50002 "Conference ASD"
trigger OnValidate()
var
Customer: record Customer;
CustomerIsBlockedErr: Label 'You cannot create this type of document when %1 is blocked with type Invoice or with type Invoice and Ship', Comment = '%1=Customer No';
begin
if Rec.Customer <> '' then begin
Customer.Get(Rec.Customer);

if (Customer.Blocked = Customer.Blocked::Invoice) or (Customer.Blocked = Customer.Blocked::All) then
Error(CustomerIsBlockedErr, Rec.Customer);

Rec.CustomerName := Customer.Name;
Rec."VAT Bus. Posting Group" := Customer."VAT Bus. Posting Group";
Rec."Gen. Bus. Posting Group" := Customer."Gen. Bus. Posting Group";
Expand All @@ -35,9 +40,14 @@ table 50002 "Conference ASD"
trigger OnValidate()
var
ConferenceLocationASD: record "Conference Location ASD";
ConfLocationBlockedErr: Label 'You cannot create this type of document when %1 is blocked', Comment = '%1=Conference Location No';
begin
if ConferenceLocation <> '' then begin
ConferenceLocationASD.Get(ConferenceLocation);

if ConferenceLocationASD.Blocked then
Error(ConfLocationBlockedErr, ConferenceLocation);

"Unit Price" := ConferenceLocationASD."Unit Price";
end
else begin
Expand Down
5 changes: 5 additions & 0 deletions app/src/table/ConferenceJournal.Table.al
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,11 @@ table 50006 "Conference Journal ASD"
{
Caption = 'Line Discount';
}
field(26; "VAT Bus. Posting Group"; Code[20])
{
Caption = 'VAT Bus. Posting Group';
TableRelation = "VAT Business Posting Group";
}
}

keys
Expand Down
8 changes: 3 additions & 5 deletions app/src/table/ConferenceLedgerEntry.Table.al
Original file line number Diff line number Diff line change
Expand Up @@ -131,16 +131,14 @@ table 50010 "Conference Ledger Entry ASD"
Rec."Document Date" := ConferenceJournalASD."Document Date";
Rec."Resource No." := ConferenceJournalASD.No;
Rec.Description := ConferenceJournalASD.Description;
Rec."Gen. Prod. Posting Group" := ConferenceJournalASD."Gen. Prod. Posting Group";
Rec."Gen. Bus. Posting Group" := ConferenceJournalASD."Gen. Bus. Posting Group";
Rec."VAT. Bus. Posting Group" := ConferenceJournalASD."VAT Bus. Posting Group";
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." := 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";
//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";
end;
}
10 changes: 10 additions & 0 deletions app/src/table/ConferenceLine.Table.al
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,8 @@ table 50003 "Conference Line ASD"
var
Item: Record Item;
Resource: Record Resource;
ResourceIsBlockedErr: Label 'You cannot create this type of document when %1 is blocked', Comment = '%1=Resource No';
ItemIsBlockedErr: Label 'You cannot create this type of document when %1 is blocked', Comment = '%1=Item No';
begin
if Rec."No." <> xrec."No." then begin
Rec."Unit of Measure Code" := '';
Expand All @@ -81,6 +83,10 @@ table 50003 "Conference Line ASD"
Rec.Type::Item:
begin
Item.Get(Rec."No.");

if Item.Blocked then
Error(ItemIsBlockedErr, Item."No.");

rec.Description := Item.Description;
rec."Unit Price" := Item."Unit Price";
rec."Unit of Measure Code" := item."Base Unit of Measure";
Expand All @@ -90,6 +96,10 @@ table 50003 "Conference Line ASD"
Rec.Type::Resource:
begin
Resource.Get(Rec."No.");

if Resource.Blocked then
Error(ResourceIsBlockedErr, Resource."No.");

rec.Description := Resource.Name;
rec."Unit Price" := Resource."Unit Price";
rec."Unit of Measure Code" := Resource."Base Unit of Measure";
Expand Down

0 comments on commit bd1e353

Please sign in to comment.