Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion .github/AL-Go-Settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"runs-on": "windows-latest",
"cacheImageName": "",
"UsePsSession": false,
"artifact": "https://bcinsider-fvh2ekdjecfjd6gk.b02.azurefd.net/sandbox/27.0.36203.0/base",
"artifact": "https://bcinsider-fvh2ekdjecfjd6gk.b02.azurefd.net/sandbox/27.0.36535.0/base",
"country": "base",
"useProjectDependencies": true,
"repoVersion": "27.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ codeunit 11180 "Create Currency AT"
UpdateCurrency(CreateCurrency.CZK(), CreateATGLAccount.FCYRealizedExchangeGains(), CreateATGLAccount.FCYRealizedExchangeLosses());
UpdateCurrency(CreateCurrency.DKK(), CreateATGLAccount.FCYRealizedExchangeGains(), CreateATGLAccount.FCYRealizedExchangeLosses());
UpdateCurrency(CreateCurrency.DZD(), CreateATGLAccount.FCYRealizedExchangeGains(), CreateATGLAccount.FCYRealizedExchangeLosses());
UpdateCurrency(CreateCurrency.EUR(), CreateATGLAccount.FCYRealizedExchangeGains(), CreateATGLAccount.FCYRealizedExchangeLosses());
UpdateCurrency(CreateCurrency.FJD(), CreateATGLAccount.FCYRealizedExchangeGains(), CreateATGLAccount.FCYRealizedExchangeLosses());
UpdateCurrency(CreateCurrency.GBP(), CreateATGLAccount.FCYRealizedExchangeGains(), CreateATGLAccount.FCYRealizedExchangeLosses());
UpdateCurrency(CreateCurrency.HKD(), CreateATGLAccount.FCYRealizedExchangeGains(), CreateATGLAccount.FCYRealizedExchangeLosses());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ codeunit 11629 "Create CH Currency"
CreateCurrency.CZK(),
CreateCurrency.DKK(),
CreateCurrency.DZD(),
CreateCurrency.EUR(),
CreateCurrency.FJD(),
CreateCurrency.HKD(),
CreateCurrency.HRK(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -332,6 +332,8 @@ codeunit 31142 "Purch. Adv. Letter-Post CZZ"
InitGenJournalLine(PurchAdvLetterHeaderCZZ, PurchAdvLetterEntryCZZ, AdvancePostingParametersCZZ2, GenJournalLine);
GenJournalLine."Account No." := VATPostingSetup.GetPurchAdvLetterAccountCZZ();
AdvancePostingBufferCZZ.ReverseAmounts();
AdvancePostingBufferCZZ."VAT Amount" := 0;
AdvancePostingBufferCZZ."VAT Base Amount" := 0;
GenJournalLine.CopyFromAdvancePostingBufferAmountsCZZ(AdvancePostingBufferCZZ);
if not AdvancePostingParametersCZZ."Temporary Entries Only" and not AdvancePostingBufferCZZ."Auxiliary Entry" then begin
OnPostAdvancePaymentVATOnBeforePostBalance(
Expand Down Expand Up @@ -652,6 +654,7 @@ codeunit 31142 "Purch. Adv. Letter-Post CZZ"
PurchAdvLetterEntryCZZ2."Entry Type"::"VAT Usage":
begin
AdvancePostingParametersCZZ2.InitNew(AdvancePostingParametersCZZ);
AdvancePostingParametersCZZ2."External Document No." := PurchAdvLetterEntryCZZ2."External Document No.";
AdvancePostingParametersCZZ2."Currency Code" := PurchAdvLetterEntryCZZ2."Currency Code";
AdvancePostingParametersCZZ2."Currency Factor" := PurchAdvLetterEntryCZZ2."Currency Factor";

Expand Down Expand Up @@ -1561,6 +1564,8 @@ codeunit 31142 "Purch. Adv. Letter-Post CZZ"
AdvancePostingParametersCZZ2."Document Type" := "Gen. Journal Document Type"::" ";
InitGenJournalLine(PurchAdvLetterHeaderCZZ, PurchAdvLetterEntryCZZ, AdvancePostingParametersCZZ2, GenJournalLine);
GenJournalLine."Account No." := VATPostingSetup.GetPurchAdvLetterAccountCZZ();
AdvancePostingBufferCZZ."VAT Amount" := 0;
AdvancePostingBufferCZZ."VAT Base Amount" := 0;
GenJournalLine.CopyFromAdvancePostingBufferAmountsCZZ(AdvancePostingBufferCZZ);
if not AdvancePostingParametersCZZ."Temporary Entries Only" and not AdvancePostingBufferCZZ."Auxiliary Entry" then begin
OnReverseAdvancePaymentVATOnBeforePostBalance(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -325,6 +325,8 @@ codeunit 31143 "Sales Adv. Letter-Post CZZ"
InitGenJournalLine(SalesAdvLetterHeaderCZZ, SalesAdvLetterEntryCZZ, AdvancePostingParametersCZZ2, GenJournalLine);
GenJournalLine."Account No." := VATPostingSetup.GetSalesAdvLetterAccountCZZ();
AdvancePostingBufferCZZ.ReverseAmounts();
AdvancePostingBufferCZZ."VAT Amount" := 0;
AdvancePostingBufferCZZ."VAT Base Amount" := 0;
GenJournalLine.CopyFromAdvancePostingBufferAmountsCZZ(AdvancePostingBufferCZZ);
if not AdvancePostingParametersCZZ."Temporary Entries Only" and not AdvancePostingBufferCZZ."Auxiliary Entry" then begin
OnPostAdvancePaymentVATOnBeforePostBalance(
Expand Down Expand Up @@ -1396,6 +1398,8 @@ codeunit 31143 "Sales Adv. Letter-Post CZZ"
AdvancePostingParametersCZZ2."Document Type" := "Gen. Journal Document Type"::" ";
InitGenJournalLine(SalesAdvLetterHeaderCZZ, SalesAdvLetterEntryCZZ, AdvancePostingParametersCZZ2, GenJournalLine);
GenJournalLine."Account No." := VATPostingSetup.GetSalesAdvLetterAccountCZZ();
AdvancePostingBufferCZZ."VAT Amount" := 0;
AdvancePostingBufferCZZ."VAT Base Amount" := 0;
GenJournalLine.CopyFromAdvancePostingBufferAmountsCZZ(AdvancePostingBufferCZZ);
if not AdvancePostingParametersCZZ."Temporary Entries Only" and not AdvancePostingBufferCZZ."Auxiliary Entry" then begin
OnReverseAdvancePaymentVATOnBeforePostBalance(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
namespace Microsoft.Bank;

using Microsoft.Purchases.Document;
using Microsoft.Purchases.History;
using Microsoft.Purchases.Payables;
using Microsoft.Sales.Document;
using Microsoft.Sales.FinanceCharge;
using Microsoft.Sales.History;
Expand Down Expand Up @@ -135,6 +137,18 @@ codeunit 31447 "Company Bank Acc. Handler CZL"
(SalesInvoiceHeader."Constant Symbol CZL" <> xSalesInvoiceHeader."Constant Symbol CZL");
end;

[EventSubscriber(ObjectType::Page, Page::"Posted Purch. Invoice - Update", 'OnAfterRecordChanged', '', false, false)]
local procedure PurchInvoiceChangedOnAfterRecordChanged(var PurchInvHeader: Record "Purch. Inv. Header"; xPurchInvHeaderGlobal: Record "Purch. Inv. Header"; var IsChanged: Boolean)
begin
IsChanged := IsChanged or
(PurchInvHeader."Due Date" <> xPurchInvHeaderGlobal."Due Date") or
(PurchInvHeader."Bank Account Code CZL" <> xPurchInvHeaderGlobal."Bank Account Code CZL") or
(PurchInvHeader."Vendor Invoice No." <> xPurchInvHeaderGlobal."Vendor Invoice No.") or
(PurchInvHeader."Specific Symbol CZL" <> xPurchInvHeaderGlobal."Specific Symbol CZL") or
(PurchInvHeader."Variable Symbol CZL" <> xPurchInvHeaderGlobal."Variable Symbol CZL") or
(PurchInvHeader."Constant Symbol CZL" <> xPurchInvHeaderGlobal."Constant Symbol CZL");
end;

[EventSubscriber(ObjectType::Page, Page::"Posted Service Inv. - Update", 'OnAfterRecordChanged', '', false, false)]
local procedure ServiceInvoiceChangedOnAfterRecordChanged(var ServiceInvoiceHeader: Record "Service Invoice Header"; xServiceInvoiceHeader: Record "Service Invoice Header"; var IsChanged: Boolean)
begin
Expand All @@ -152,8 +166,6 @@ codeunit 31447 "Company Bank Acc. Handler CZL"
SalesInvoiceHeader.Validate("Specific Symbol CZL", SalesInvoiceHeaderRec."Specific Symbol CZL");
SalesInvoiceHeader.Validate("Variable Symbol CZL", SalesInvoiceHeaderRec."Variable Symbol CZL");
SalesInvoiceHeader.Validate("Constant Symbol CZL", SalesInvoiceHeaderRec."Constant Symbol CZL");
CustLedgerEntryEdit(SalesInvoiceHeader."No.", SalesInvoiceHeader."Bill-to Customer No.",
SalesInvoiceHeader."Bank Account Code CZL", SalesInvoiceHeader."Specific Symbol CZL", SalesInvoiceHeader."Variable Symbol CZL", SalesInvoiceHeader."Constant Symbol CZL");
end;

[EventSubscriber(ObjectType::Codeunit, Codeunit::"Sales Inv. Header - Edit", 'OnRunOnBeforeAssignValues', '', false, false)]
Expand All @@ -163,6 +175,19 @@ codeunit 31447 "Company Bank Acc. Handler CZL"
SalesInvoiceHeader.Validate("Bank Account Code CZL", SalesInvoiceHeaderRec."Company Bank Account Code");
end;

[EventSubscriber(ObjectType::Codeunit, Codeunit::"Sales Inv. Header - Edit", 'OnBeforeUpdateCustLedgerEntryAfterSetValues', '', false, false)]
local procedure SalesInvoiceEditOnBeforeUpdateCustLedgerEntryAfterSetValues(var CustLedgerEntry: Record "Cust. Ledger Entry"; SalesInvoiceHeader: Record "Sales Invoice Header")
begin
CustLedgerEntry."Bank Account Code CZL" := SalesInvoiceHeader."Bank Account Code CZL";
CustLedgerEntry."Bank Account No. CZL" := SalesInvoiceHeader."Bank Account No. CZL";
CustLedgerEntry."Transit No. CZL" := SalesInvoiceHeader."Transit No. CZL";
CustLedgerEntry."IBAN CZL" := SalesInvoiceHeader."IBAN CZL";
CustLedgerEntry."SWIFT Code CZL" := SalesInvoiceHeader."SWIFT Code CZL";
CustLedgerEntry."Specific Symbol CZL" := SalesInvoiceHeader."Specific Symbol CZL";
CustLedgerEntry."Variable Symbol CZL" := SalesInvoiceHeader."Variable Symbol CZL";
CustLedgerEntry."Constant Symbol CZL" := SalesInvoiceHeader."Constant Symbol CZL";
end;

[EventSubscriber(ObjectType::Codeunit, Codeunit::"Service Inv. Header - Edit", 'OnOnRunOnBeforeTestFieldNo', '', false, false)]
local procedure ServiceInvoiceEditOnRunOnBeforeTestFieldNo(var ServiceInvoiceHeader: Record "Service Invoice Header"; ServiceInvoiceHeaderRec: Record "Service Invoice Header")
begin
Expand Down Expand Up @@ -196,5 +221,31 @@ codeunit 31447 "Company Bank Acc. Handler CZL"
Codeunit.Run(Codeunit::"Cust. Entry-Edit", CustLedgerEntry);
end;
end;

[EventSubscriber(ObjectType::Codeunit, Codeunit::"Purch. Inv. Header - Edit", 'OnBeforePurchInvHeaderModify', '', false, false)]
local procedure PurchInvoiceEditOnBeforePurchInvHeaderModify(var PurchInvHeader: Record "Purch. Inv. Header"; PurchInvHeaderRec: Record "Purch. Inv. Header")
begin
PurchInvHeader.Validate("Due Date", PurchInvHeaderRec."Due Date");
PurchInvHeader.Validate("Bank Account Code CZL", PurchInvHeaderRec."Bank Account Code CZL");
PurchInvHeader.Validate("Vendor Invoice No.", PurchInvHeaderRec."Vendor Invoice No.");
PurchInvHeader.Validate("Specific Symbol CZL", PurchInvHeaderRec."Specific Symbol CZL");
PurchInvHeader.Validate("Variable Symbol CZL", PurchInvHeaderRec."Variable Symbol CZL");
PurchInvHeader.Validate("Constant Symbol CZL", PurchInvHeaderRec."Constant Symbol CZL");
end;

[EventSubscriber(ObjectType::Codeunit, Codeunit::"Purch. Inv. Header - Edit", 'OnBeforeUpdateVendorLedgerEntryAfterSetValues', '', false, false)]
local procedure PurchInvoiceEditOnBeforeUpdateVendorLedgerEntryAfterSetValues(var VendorLedgerEntry: Record "Vendor Ledger Entry"; PurchInvHeader: Record "Purch. Inv. Header")
begin
VendorLedgerEntry."Due Date" := PurchInvHeader."Due Date";
VendorLedgerEntry."Bank Account Code CZL" := PurchInvHeader."Bank Account Code CZL";
VendorLedgerEntry."Bank Account No. CZL" := PurchInvHeader."Bank Account No. CZL";
VendorLedgerEntry."Transit No. CZL" := PurchInvHeader."Transit No. CZL";
VendorLedgerEntry."IBAN CZL" := PurchInvHeader."IBAN CZL";
VendorLedgerEntry."SWIFT Code CZL" := PurchInvHeader."SWIFT Code CZL";
VendorLedgerEntry."External Document No." := PurchInvHeader."Vendor Invoice No.";
VendorLedgerEntry."Specific Symbol CZL" := PurchInvHeader."Specific Symbol CZL";
VendorLedgerEntry."Variable Symbol CZL" := PurchInvHeader."Variable Symbol CZL";
VendorLedgerEntry."Constant Symbol CZL" := PurchInvHeader."Constant Symbol CZL";
end;
#endregion edit posted documents
}
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ codeunit 11742 "VAT Date Handler CZL"
local procedure FillVATReportingDateOnBeforeGLLedgEntryModify(var GLEntry: Record "G/L Entry"; FromGLEntry: Record "G/L Entry")
begin
GLEntry."VAT Reporting Date" := FromGLEntry."VAT Reporting Date";
GLEntry."External Document No." := FromGLEntry."External Document No.";
end;

procedure VATPeriodCZLCheck(VATDate: Date)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,5 +40,6 @@ codeunit 11741 "VAT Entry Handler CZL"
local procedure EditEU3PartyIntermedRoleOnBeforeVATEntryModify(var VATEntry: Record "VAT Entry"; FromVATEntry: Record "VAT Entry")
begin
VATEntry."EU 3-Party Intermed. Role CZL" := FromVATEntry."EU 3-Party Intermed. Role CZL";
VATEntry."External Document No." := FromVATEntry."External Document No.";
end;
}
Original file line number Diff line number Diff line change
@@ -1,12 +1,22 @@
namespace Microsoft.Purchases.Payables;

using Microsoft.Finance.VAT.Ledger;
using Microsoft.Finance.GeneralLedger.Ledger;

codeunit 31135 "Vend. Entry-Edit Handler CZL"
{
Access = Internal;

var
VATEntryInVATCtrlReportErr: Label 'The VAT Entries are already included in the VAT Control Report.';
VATEntryClosedErr: Label 'The VAT Entries are already closed.';

[EventSubscriber(ObjectType::Codeunit, Codeunit::"Vend. Entry-Edit", 'OnBeforeVendLedgEntryModify', '', false, false)]
local procedure UpdateEntryOnBeforeVendLedgEntryModify(var VendLedgEntry: Record "Vendor Ledger Entry"; FromVendLedgEntry: Record "Vendor Ledger Entry")
begin
if VendLedgEntry."External Document No." <> FromVendLedgEntry."External Document No." then
CheckVATEntries(VendLedgEntry);

VendLedgEntry."Specific Symbol CZL" := FromVendLedgEntry."Specific Symbol CZL";
VendLedgEntry."Variable Symbol CZL" := FromVendLedgEntry."Variable Symbol CZL";
VendLedgEntry."Constant Symbol CZL" := FromVendLedgEntry."Constant Symbol CZL";
Expand All @@ -16,5 +26,62 @@ codeunit 31135 "Vend. Entry-Edit Handler CZL"
VendLedgEntry."IBAN CZL" := FromVendLedgEntry."IBAN CZL";
VendLedgEntry."SWIFT Code CZL" := FromVendLedgEntry."SWIFT Code CZL";
VendLedgEntry."VAT Date CZL" := FromVendLedgEntry."VAT Date CZL";
VendLedgEntry."External Document No." := FromVendLedgEntry."External Document No.";
end;

[EventSubscriber(ObjectType::Codeunit, Codeunit::"Vend. Entry-Edit", 'OnRunOnAfterVendLedgEntryMofidy', '', false, false)]
local procedure UpdateEntriesOnRunOnAfterVendLedgEntryMofidy(var VendorLedgerEntry: Record "Vendor Ledger Entry")
begin
UpdateVATEntries(VendorLedgerEntry);
UpdateGLEntries(VendorLedgerEntry);
end;

local procedure CheckVATEntries(VendLedgEntry: Record "Vendor Ledger Entry")
var
VATEntry: Record "VAT Entry";
begin
VATEntry.SetCurrentKey("Document No.", "Posting Date");
VATEntry.SetRange("Document No.", VendLedgEntry."Document No.");
VATEntry.SetRange("Posting Date", VendLedgEntry."Posting Date");
VATEntry.SetFilter("VAT Ctrl. Report No. CZL", '<>%1', '');
if not VATEntry.IsEmpty() then
Error(VATEntryInVATCtrlReportErr);

VATEntry.SetRange("VAT Ctrl. Report No. CZL");
VATEntry.SetRange(Closed, true);
if not VATEntry.IsEmpty() then
Error(VATEntryClosedErr);
end;

local procedure UpdateVATEntries(VendLedgEntry: Record "Vendor Ledger Entry")
var
VATEntry: Record "VAT Entry";
begin
VATEntry.SetCurrentKey("Document No.", "Posting Date");
VATEntry.SetRange("Document No.", VendLedgEntry."Document No.");
VATEntry.SetRange("Posting Date", VendLedgEntry."Posting Date");
VATEntry.SetRange(Closed, false);
VATEntry.SetRange("VAT Ctrl. Report No. CZL", '');
VATEntry.SetFilter("External Document No.", '<>%1', VendLedgEntry."External Document No.");
if VATEntry.FindSet() then
repeat
VATEntry."External Document No." := VendLedgEntry."External Document No.";
Codeunit.Run(Codeunit::"VAT Entry - Edit", VATEntry);
until VATEntry.Next() = 0;
end;

local procedure UpdateGLEntries(VendLedgEntry: Record "Vendor Ledger Entry")
var
GLEntry: Record "G/L Entry";
begin
GLEntry.SetCurrentKey("Document No.", "Posting Date");
GLEntry.SetRange("Document No.", VendLedgEntry."Document No.");
GLEntry.SetRange("Posting Date", VendLedgEntry."Posting Date");
GLEntry.SetFilter("External Document No.", '<>%1', VendLedgEntry."External Document No.");
if GLEntry.FindSet() then
repeat
GLEntry."External Document No." := VendLedgEntry."External Document No.";
Codeunit.Run(Codeunit::"G/L Entry-Edit", GLEntry);
until GLEntry.Next() = 0;
end;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
// ------------------------------------------------------------------------------------------------
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
// ------------------------------------------------------------------------------------------------
namespace Microsoft.Purchases.History;

pageextension 31144 "Posted Purch. Inv. Update CZL" extends "Posted Purch. Invoice - Update"
{
layout
{
addafter(Shipping)
{
group("Payment Details CZL")
{
Caption = 'Payment Details';

field("Due Date CZL"; Rec."Due Date")
{
ApplicationArea = Basic, Suite;
Editable = true;
ToolTip = 'Specifies the date on which the invoice is due for payment.';
}
field("Bank Account Code CZL"; Rec."Bank Account Code CZL")
{
ApplicationArea = Basic, Suite;
ToolTip = 'Specifies a code to identify bank account of company.';
Editable = true;
}
field("Vendor Invoice No. CZL"; Rec."Vendor Invoice No.")
{
ApplicationArea = Basic, Suite;
ToolTip = 'Specifies the vendor''s own invoice number.';
}
field("Variable Symbol CZL"; Rec."Variable Symbol CZL")
{
ApplicationArea = Basic, Suite;
ToolTip = 'Specifies the detail information for payment.';
Importance = Promoted;
Editable = true;
}
field("Constant Symbol CZL"; Rec."Constant Symbol CZL")
{
ApplicationArea = Basic, Suite;
ToolTip = 'Specifies the additional symbol of bank payments.';
Importance = Additional;
Editable = true;
}
field("Specific Symbol CZL"; Rec."Specific Symbol CZL")
{
ApplicationArea = Basic, Suite;
ToolTip = 'Specifies the additional symbol of bank payments.';
Importance = Additional;
Editable = true;
}
}
}
}
}
Loading
Loading