From 419d9f34cfb08f215fb014e150623e19566c8957 Mon Sep 17 00:00:00 2001 From: Jesper Schulz-Wedde Date: Tue, 24 Mar 2026 09:28:32 +0100 Subject: [PATCH] Syncing with version 29.0.48074.0 --- .github/AL-Go-Settings.json | 2 +- .../PurchAdvLetterManagementCZZ.Codeunit.al | 11 + .../SalesAdvLetterManagementCZZ.Codeunit.al | 11 + .../CalculateInventHandlerCZA.Codeunit.al | 1 + .../app/Src/Reports/GLEntryApplying.rdl | 223 +++--- .../IssuePaymentOrderCZB.Codeunit.al | 7 +- .../Src/Reports/SuggestPaymentsCZB.Report.al | 2 +- .../Src/Tables/BankStatementLineCZB.Table.al | 6 + .../test/Src/BankingDocumentsCZB.Codeunit.al | 5 +- ...l => AllocationLineHandlerCZP.Codeunit.al} | 0 .../Src/Tables/CashDocumentLineCZP.Table.al | 8 +- .../ContosoPostingSetupCZ.Codeunit.al | 4 + .../InstallApplicationCZL.Codeunit.al | 18 + .../PurchasePostingHandlerCZL.Codeunit.al | 153 +--- .../PurchaseVATDelayPostingCZL.Codeunit.al | 187 +++++ .../RegistrationNoMgtCZL.Codeunit.al | 12 + .../SalesHeaderHandlerCZL.Codeunit.al | 2 +- .../UpgradeApplicationCZL.Codeunit.al | 2 +- .../Codeunits/VATCtrlReportMgtCZL.Codeunit.al | 6 +- ...ace.al => EETCashRegisterCZL.Interface.al} | 0 ...=> VATControlReportExportCZL.Interface.al} | 0 ....al => VATStatementExportCZL.Interface.al} | 0 .../GLEntriesPreviewCZL.PageExt.al | 11 +- .../VATEntriesPreviewCZL.PageExt.al | 9 +- ...ort.PageExt.al => VATReportCZL.PageExt.al} | 0 ....al => VATReportStmtSubformCZL.PageExt.al} | 0 ...t.al => VATReturnPeriodCardCZL.PageExt.al} | 0 ...t.al => VATReturnPeriodListCZL.PageExt.al} | 0 .../CZCorePackObjectsCZL.PermissionSet.al | 1 + .../Reports/DocumentationforVATCZL.Report.al | 30 +- .../OpenCustEntriestoDateCZL.Report.al | 3 +- .../TableExtensions/VATEntryCZL.TableExt.al | 18 - .../FADisposalHandlerCZF.Codeunit.al | 14 +- .../CreateDEDataExportRecord.Codeunit.al | 6 +- .../ExportXRechnungDocument.Codeunit.al | 6 + .../ZUGFeRD/ExportZUGFeRDDocument.Codeunit.al | 2 +- .../ZUGFeRD/ImportZUGFeRDDocument.Codeunit.al | 39 +- .../DE/EDocumentDE/test/.resources/CRONUS.jpg | Bin 15225 -> 0 bytes .../test/.resources/d365businesscentral.bmp | Bin 9354 -> 0 bytes Apps/DE/EDocumentDE/test/app.json | 3 - .../src/XRechnungXMLDocumentTests.Codeunit.al | 48 +- .../ERMPaymentManagementII.Codeunit.al | 1 + .../app/ext/IPCBankAccountCard.PageExt.al | 5 + .../app/ext/IPCCompanyInformation.PageExt.al | 6 + .../ext/IPCContactAltAddressCard.PageExt.al | 5 + .../app/ext/IPCContactCard.PageExt.al | 5 + .../ext/IPCCustomerBankAccountCard.PageExt.al | 5 + .../app/ext/IPCCustomerCard.PageExt.al | 5 + .../app/ext/IPCEmployeeCard.PageExt.al | 5 + .../app/ext/IPCLocationCard.PageExt.al | 5 + .../app/ext/IPCResourceCard.PageExt.al | 5 + .../app/ext/IPCShipToAddress.PageExt.al | 5 + .../app/ext/IPCVendorCard.PageExt.al | 5 + .../src/IPCAddressLookupHelper.Codeunit.al | 3 + .../src/TestIdealPostcodesPages.Codeunit.al | 80 +-- .../src/PageExt/BankAccountCard.PageExt.al | 12 - .../src/PageExt/CompanyInformation.PageExt.al | 12 - .../PageExt/ContactAltAddressCard.PageExt.al | 12 - .../app/src/PageExt/ContactCard.PageExt.al | 12 - .../CustomerBankAccountCard.PageExt.al | 12 - .../app/src/PageExt/CustomerCard.PageExt.al | 12 - .../app/src/PageExt/EmployeeCard.PageExt.al | 12 - .../app/src/PageExt/LocationCard.PageExt.al | 12 - .../app/src/PageExt/ResourceCard.PageExt.al | 12 - .../app/src/PageExt/ShiptoAddress.PageExt.al | 12 - .../app/src/PageExt/VendorCard.PageExt.al | 12 - .../test/src/TestUKPostcode.Codeunit.al | 61 -- .../src/GSTFAReclassJournalTests.Codeunit.al | 2 + .../src/IntrastatReportExpExtIT.Codeunit.al | 11 +- .../test/src/IntrastatITTest.Codeunit.al | 125 +++- .../test/src/DigipoortXML.Codeunit.al | 4 +- .../src/LibraryElecVATSubmission.Codeunit.al | 17 +- Apps/US/HybridSL_US/test/app.json | 2 +- .../src/SLBCVendorLedgerEntryData.XmlPort.al | 3 +- ...ost.al => SLBCVendorNo1099Data.XmlPort.al} | 0 .../src/SLBCVendorWith1099Data.XmlPort.al | 3 +- .../SLMigrationVendor1099Tests.Codeunit.al | 3 - .../Document/IRS1099CreateFormDocs.Report.al | 10 +- .../IRS1099FormDocLineDetails.Page.al | 4 +- .../Document/IRS1099FormDocSubform.Page.al | 4 +- .../src/Document/IRS1099FormDocument.Page.al | 18 +- .../src/Document/IRS1099FormDocuments.Page.al | 4 +- .../Emailing/IRS1099EmailContentSetup.Page.al | 2 +- .../src/Emailing/IRS1099SendEmail.Report.al | 8 +- .../IRS1099GeneralJournal.PageExt.al | 8 +- .../IRS1099PostedPurchCrMemo.PageExt.al | 6 +- .../IRS1099PostedPurchInv.PageExt.al | 6 +- .../IRS1099PstdPCrMemoSub.PageExt.al | 2 +- .../IRS1099PstdPurchInvSub.PageExt.al | 2 +- .../Extensions/IRS1099PurchCrMemo.PageExt.al | 6 +- .../IRS1099PurchCrMemoSub.PageExt.al | 2 +- .../src/Extensions/IRS1099PurchInv.PageExt.al | 6 +- .../IRS1099PurchInvSubform.PageExt.al | 2 +- .../Extensions/IRS1099PurchOrder.PageExt.al | 6 +- .../IRS1099PurchOrderSubform.PageExt.al | 2 +- .../IRS1099PurchRetOrderSub.PageExt.al | 2 +- .../IRS1099PurchaseJournal.PageExt.al | 8 +- .../Extensions/IRS1099VendorCard.PageExt.al | 22 +- .../IRS1099VendorLedgerEntries.PageExt.al | 8 +- .../Extensions/IRS1099VendorList.PageExt.al | 22 +- .../app/src/FIRE/IRS1099FIRE.Report.al | 44 +- .../src/IRIS/CreateTransmissionIRIS.Report.al | 4 +- .../app/src/IRIS/ErrorInformationIRIS.Page.al | 2 +- .../app/src/IRIS/IRS1099FormDocUpdate.Page.al | 2 +- .../app/src/IRIS/SetupIRISUserID.Page.al | 4 +- .../app/src/IRIS/TransmissionIRIS.Page.al | 2 +- .../src/IRIS/TransmissionIRISSubform.Page.al | 2 +- .../src/IRIS/TransmissionIRISUpdate.Page.al | 2 +- .../src/IRIS/TransmissionLogLinesIRIS.Page.al | 2 +- .../app/src/IRIS/TransmissionLogsIRIS.Page.al | 8 +- .../app/src/IRIS/TransmissionsIRIS.Page.al | 2 +- .../Printing/IRS1099FormInstructions.Page.al | 4 +- .../src/Printing/IRS1099FormReports.Page.al | 4 +- .../src/Printing/IRS1099FormStatement.Page.al | 4 +- .../Reporting/IRS1099VendorOverview.Page.al | 4 +- .../src/Setup/IRS1099CopySetupFrom.Report.al | 10 +- .../app/src/Setup/IRS1099FormBoxes.Page.al | 4 +- .../app/src/Setup/IRS1099Forms.Page.al | 4 +- .../app/src/Setup/IRSFormsGuide.Page.al | 10 +- .../app/src/Setup/IRSFormsSetup.Page.al | 8 +- .../app/src/Setup/IRSReportingPeriods.Page.al | 4 +- .../src/Setup/UpgradeIRS1099Data.Report.al | 2 +- .../IRS1099PropagateVendSetup.Report.al | 12 +- .../IRS1099SuggestVendors.Report.al | 4 +- .../IRS1099VendFormBoxAdjmts.Page.al | 4 +- .../IRS1099VendorFormBoxSetup.Page.al | 8 +- .../app/src/BankAccRecTransToAcc.Codeunit.al | 5 + .../app/src/BankRecAIMatchingImpl.Codeunit.al | 12 +- .../CreateCommonUnitOfMeasure.Codeunit.al | 34 +- .../CreateUnitofMeasure.Codeunit.al | 4 +- .../CreateContosoTenantData.Codeunit.al | 3 +- .../2.Master Data/CreateMfgItem.Codeunit.al | 4 + .../CreateMfgLocation.Codeunit.al | 15 + .../ManufacturingModuleSetup.Page.al | 4 + .../ManufacturingModuleSetup.Table.al | 5 + .../ContosoFixedAsset.Codeunit.al | 1 + .../app/src/DriveProcessing.Codeunit.al | 4 +- .../app/src/OutlookProcessing.Codeunit.al | 48 +- .../app/src/OutlookSetup.Table.al | 12 + .../DigitalVoucherImpl.Codeunit.al | 38 +- .../test/src/DigitalVouchersTests.Codeunit.al | 59 ++ .../page/ExciseTaxEntryPermissions.Page.al | 8 +- .../app/src/page/ExciseTaxItemFARates.Page.al | 3 +- .../app/src/page/ExciseTaxTypeCard.Page.al | 8 +- .../app/src/page/ExciseTaxTypes.Page.al | 8 +- .../table/ExciseTaxEntryPermission.Table.al | 2 +- .../src/table/ExciseTaxItemFARate.Table.al | 4 +- .../ExciseJournalLineExt.TableExt.al | 2 +- .../ExciseTaxesTransLogExt.TableExt.al | 2 +- .../Codeunits/FSIntegrationMgt.Codeunit.al | 6 + Apps/W1/HybridBaseDeployment/app/app.json | 5 + .../CustomMigrationProvider.Codeunit.al | 15 +- .../OnPremMigrationHandler.Codeunit.al | 8 +- .../AddCustomMigrationMapping.Page.al | 31 +- .../CloudMigReplicateDataMgt.Codeunit.al | 52 +- .../HybridCloudManagement.Codeunit.al | 53 +- .../pages/CloudMigrationManagement.Page.al | 2 +- .../src/pages/HybridCloudSetupWizard.Page.al | 8 + .../src/pages/IntelligentCloudDetails.Page.al | 22 +- .../pages/IntelligentCloudManagement.Page.al | 2 +- .../src/pages/MigrationTableOverview.Page.al | 20 + .../src/tables/IntelligentCloudSetup.Table.al | 2 +- .../src/ReplicationMgtPageTests.Codeunit.al | 16 +- .../GPPopulateCombinedTables.Codeunit.al | 2 +- .../codeunits/HybridGPManagement.codeunit.al | 12 +- Apps/W1/HybridSL/app/app.json | 5 + .../TaxJsonDeserialization.Codeunit.al | 10 + .../codeunit/UseCaseEntityMgmt.Codeunit.al | 12 + .../UseCaseSymbolsHandler.Codeunit.al | 36 + .../src/codeunits/ReviewGLEntry.Codeunit.al | 1 + .../app/src/codeunits/Upgrade.Codeunit.al | 34 + .../app/src/tables/GLEntryReview.TableExt.al | 2 +- .../src/tables/GLEntryReviewEntry.Table.al | 1 + .../app/src/tables/GLEntryReviewLog.Table.al | 7 +- .../app/src/Setup/SOASetup.Codeunit.al | 44 +- .../src/SustItemChrgAssignTest.Codeunit.al | 671 ++++++++++++++++++ .../test/src/SustValueEntryTest.Codeunit.al | 1 + .../.resources/status_single_submitted.json | 8 + .../test/.resources/test_1.json | 8 + .../test/.resources/test_2.json | 8 + .../test/.resources/test_3.json | 4 + .../test/.resources/test_5.json | 8 + Apps/W1/VATGroupManagement/test/app.json | 4 + .../src/VATGroupHttpMockService.Codeunit.al | 117 +++ .../src/VATGroupMockServiceTest.Codeunit.al | 28 +- .../src/VATGroupSubStatusTest.Codeunit.al | 17 + .../src/VATGroupSubmitToReprTest.Codeunit.al | 14 +- .../src/ERMWithholdingTaxTestsI.Codeunit.al | 1 + .../History/WHTPurchCrMemoHdr.TableExt.al | 7 +- .../WithholdingPurchInvHeader.TableExt.al | 7 +- .../History/WithholdingTaxEntries.Page.al | 5 - .../History/WithholdingTaxEntry.Table.al | 7 +- .../WHTCertificateCreditabletax.Report.al | 6 +- .../WithholdingTaxCertificate.Report.al | 15 +- .../TempWithholdingTaxEntry.Table.al | 7 +- .../WithholdingGenJnlLineExt.TableExt.al | 11 +- .../WithholdingPostedPurchInv.PageExt.al | 24 + .../WithholdingPurchHeaderExt.TableExt.al | 11 +- .../WithholdingPurchaseInvoice.PageExt.al | 23 + .../WithholdingPurchaseOrder.PageExt.al | 23 + .../WithholdingTaxMgmt.Codeunit.al | 26 +- Build/Packages.json | 2 +- 202 files changed, 2346 insertions(+), 1083 deletions(-) rename Apps/CZ/CashDeskLocalization/app/Src/Codeunits/{AllocationLineHandler.Codeunit.al => AllocationLineHandlerCZP.Codeunit.al} (100%) create mode 100644 Apps/CZ/CoreLocalizationPack/app/Src/Codeunits/PurchaseVATDelayPostingCZL.Codeunit.al rename Apps/CZ/CoreLocalizationPack/app/Src/Interfaces/{EETCashRegister.Interface.al => EETCashRegisterCZL.Interface.al} (100%) rename Apps/CZ/CoreLocalizationPack/app/Src/Interfaces/{VATControlReportExport.Interface.al => VATControlReportExportCZL.Interface.al} (100%) rename Apps/CZ/CoreLocalizationPack/app/Src/Interfaces/{VATStatementExport.Interface.al => VATStatementExportCZL.Interface.al} (100%) rename Apps/CZ/CoreLocalizationPack/app/Src/PageExtensions/{VATReport.PageExt.al => VATReportCZL.PageExt.al} (100%) rename Apps/CZ/CoreLocalizationPack/app/Src/PageExtensions/{VATReportStmtSubform.PageExt.al => VATReportStmtSubformCZL.PageExt.al} (100%) rename Apps/CZ/CoreLocalizationPack/app/Src/PageExtensions/{VATReturnPeriodCard.PageExt.al => VATReturnPeriodCardCZL.PageExt.al} (100%) rename Apps/CZ/CoreLocalizationPack/app/Src/PageExtensions/{VATReturnPeriodList.PageExt.al => VATReturnPeriodListCZL.PageExt.al} (100%) delete mode 100644 Apps/DE/EDocumentDE/test/.resources/CRONUS.jpg delete mode 100644 Apps/DE/EDocumentDE/test/.resources/d365businesscentral.bmp rename Apps/US/HybridSL_US/test/src/{SLBCVendorNo1099Data.XmlPost.al => SLBCVendorNo1099Data.XmlPort.al} (100%) create mode 100644 Apps/W1/VATGroupManagement/test/.resources/status_single_submitted.json create mode 100644 Apps/W1/VATGroupManagement/test/.resources/test_1.json create mode 100644 Apps/W1/VATGroupManagement/test/.resources/test_2.json create mode 100644 Apps/W1/VATGroupManagement/test/.resources/test_3.json create mode 100644 Apps/W1/VATGroupManagement/test/.resources/test_5.json create mode 100644 Apps/W1/VATGroupManagement/test/src/VATGroupHttpMockService.Codeunit.al create mode 100644 Apps/W1/WithholdingTax/app/src/Purchase/Transaction/WithholdingPostedPurchInv.PageExt.al create mode 100644 Apps/W1/WithholdingTax/app/src/Purchase/Transaction/WithholdingPurchaseInvoice.PageExt.al create mode 100644 Apps/W1/WithholdingTax/app/src/Purchase/Transaction/WithholdingPurchaseOrder.PageExt.al diff --git a/.github/AL-Go-Settings.json b/.github/AL-Go-Settings.json index ef5482b04e..fabdfafbef 100644 --- a/.github/AL-Go-Settings.json +++ b/.github/AL-Go-Settings.json @@ -6,7 +6,7 @@ "runs-on": "windows-latest", "cacheImageName": "", "UsePsSession": false, - "artifact": "https://bcinsider-fvh2ekdjecfjd6gk.b02.azurefd.net/sandbox/29.0.47162.0/base", + "artifact": "https://bcinsider-fvh2ekdjecfjd6gk.b02.azurefd.net/sandbox/29.0.48074.0/base", "country": "base", "useProjectDependencies": true, "repoVersion": "29.0", diff --git a/Apps/CZ/AdvancePaymentsLocalization/app/Src/Codeunits/PurchAdvLetterManagementCZZ.Codeunit.al b/Apps/CZ/AdvancePaymentsLocalization/app/Src/Codeunits/PurchAdvLetterManagementCZZ.Codeunit.al index 1033ef8ce1..73a9f86a2a 100644 --- a/Apps/CZ/AdvancePaymentsLocalization/app/Src/Codeunits/PurchAdvLetterManagementCZZ.Codeunit.al +++ b/Apps/CZ/AdvancePaymentsLocalization/app/Src/Codeunits/PurchAdvLetterManagementCZZ.Codeunit.al @@ -953,10 +953,16 @@ codeunit 31019 "PurchAdvLetterManagement CZZ" OriginalDocumentVATDate: Date; DocumentDate: Date; PostingDate: Date; + IsHandled: Boolean; begin PurchAdvLetterEntryCZZ.TestField("Entry Type", PurchAdvLetterEntryCZZ."Entry Type"::"VAT Payment"); PurchAdvLetterEntryCZZ.TestField(Cancelled, false); + IsHandled := false; + OnBeforePostAdvanceCreditMemoVAT(PurchAdvLetterEntryCZZ, IsHandled); + if IsHandled then + exit; + PurchAdvLetterHeaderCZZ.Get(PurchAdvLetterEntryCZZ."Purch. Adv. Letter No."); AdvanceLetterTemplateCZZ.Get(PurchAdvLetterHeaderCZZ."Advance Letter Code"); @@ -1348,6 +1354,11 @@ codeunit 31019 "PurchAdvLetterManagement CZZ" begin end; + [IntegrationEvent(false, false)] + local procedure OnBeforePostAdvanceCreditMemoVAT(var PurchAdvLetterEntryCZZ: Record "Purch. Adv. Letter Entry CZZ"; var IsHandled: Boolean) + begin + end; + diff --git a/Apps/CZ/AdvancePaymentsLocalization/app/Src/Codeunits/SalesAdvLetterManagementCZZ.Codeunit.al b/Apps/CZ/AdvancePaymentsLocalization/app/Src/Codeunits/SalesAdvLetterManagementCZZ.Codeunit.al index bcd3e288a1..ffd841e5cf 100644 --- a/Apps/CZ/AdvancePaymentsLocalization/app/Src/Codeunits/SalesAdvLetterManagementCZZ.Codeunit.al +++ b/Apps/CZ/AdvancePaymentsLocalization/app/Src/Codeunits/SalesAdvLetterManagementCZZ.Codeunit.al @@ -955,10 +955,16 @@ codeunit 31002 "SalesAdvLetterManagement CZZ" PostingDate: Date; CurrencyFactor: Decimal; AddCurrencyFactor: Decimal; + IsHandled: Boolean; begin SalesAdvLetterEntryCZZ.TestField("Entry Type", SalesAdvLetterEntryCZZ."Entry Type"::"VAT Payment"); SalesAdvLetterEntryCZZ.TestField(Cancelled, false); + IsHandled := false; + OnBeforePostAdvanceCreditMemoVAT(SalesAdvLetterEntryCZZ, IsHandled); + if IsHandled then + exit; + AdvPaymentCloseDialog.SetValues(SalesAdvLetterEntryCZZ."Posting Date", SalesAdvLetterEntryCZZ."VAT Date", SalesAdvLetterEntryCZZ."Currency Code", SalesAdvLetterEntryCZZ."Currency Factor", '', false); if AdvPaymentCloseDialog.RunModal() = Action::OK then begin AdvPaymentCloseDialog.GetValues(PostingDate, VATDate, CurrencyFactor, AddCurrencyFactor); @@ -1329,6 +1335,11 @@ codeunit 31002 "SalesAdvLetterManagement CZZ" begin end; + [IntegrationEvent(false, false)] + local procedure OnBeforePostAdvanceCreditMemoVAT(var SalesAdvLetterEntryCZZ: Record "Sales Adv. Letter Entry CZZ"; var IsHandled: Boolean) + begin + end; + diff --git a/Apps/CZ/AdvancedLocalizationPack/app/Src/Codeunits/CalculateInventHandlerCZA.Codeunit.al b/Apps/CZ/AdvancedLocalizationPack/app/Src/Codeunits/CalculateInventHandlerCZA.Codeunit.al index 9a6e2cb96e..a1b0c8aaec 100644 --- a/Apps/CZ/AdvancedLocalizationPack/app/Src/Codeunits/CalculateInventHandlerCZA.Codeunit.al +++ b/Apps/CZ/AdvancedLocalizationPack/app/Src/Codeunits/CalculateInventHandlerCZA.Codeunit.al @@ -23,6 +23,7 @@ codeunit 31446 "Calculate Invent. Handler CZA" begin ItemsWithoutChange := ItemsWithoutChangeCZA; UseItemDimensions := UseItemDimensionsCZA; + IsItemWithoutChange := false; end; [EventSubscriber(ObjectType::Report, Report::"Calculate Inventory", 'OnAfterItemOnPreDataItem', '', false, false)] diff --git a/Apps/CZ/AdvancedLocalizationPack/app/Src/Reports/GLEntryApplying.rdl b/Apps/CZ/AdvancedLocalizationPack/app/Src/Reports/GLEntryApplying.rdl index 499970e532..0fc6cf676e 100644 --- a/Apps/CZ/AdvancedLocalizationPack/app/Src/Reports/GLEntryApplying.rdl +++ b/Apps/CZ/AdvancedLocalizationPack/app/Src/Reports/GLEntryApplying.rdl @@ -11,6 +11,97 @@ 6391917f-ce7d-447d-a227-354248d7de49 + + + + DataSource + + + + + COMPANYNAME + + + AccFilter + + + GLEntryFilter + + + GLAccount_No + + + OriginalGLEntry_EntryNo + + + AppliedAmount + + + AppliedAmountFormat + + + OriginalEntry_CreditAmount + + + OriginalEntry_CreditAmountFormat + + + OriginalEntry_DebitAmount + + + OriginalEntry_DebitAmountFormat + + + OriginalEntry_Amount + + + OriginalEntry_AmountFormat + + + OriginalEntry_Description + + + OriginalEntry_PostingDate + + + OriginalEntry_DocumentNo + + + OriginalEntry_EntryNo + + + DetailedGLEntryCZA_Amount + + + DetailedGLEntryCZA_AmountFormat + + + GLEntry_CreditAmount + + + GLEntry_CreditAmountFormat + + + GLEntry_DebitAmount + + + GLEntry_DebitAmountFormat + + + GLEntry_Description + + + GLEntry_PostingDate + + + GLEntry_DocumentNo + + + DetailedGLEntryCZA_GLEntryNo + + + + @@ -31,7 +122,7 @@ 0.423cm - 17.35935cm + 18cm @@ -53,7 +144,7 @@ 0.423cm 0.423cm - 17.35935cm + 18cm 1 - true @@ -1194,7 +1284,7 @@ DataSet_Result 0.846cm 1.86901cm - 17.35937cm + 18.03814cm 2 - 14.20935cm + 14.84435cm 0.423cm 3.15cm 2 @@ -1326,7 +1416,7 @@ 0.423cm - 15.48025cm + 16.11525cm 0.423cm 0.88229cm 4 @@ -1559,95 +1649,4 @@ End Function true Cm 04b31d42-25ec-4159-af20-e77db33ec39b - - - - - COMPANYNAME - - - AccFilter - - - GLEntryFilter - - - GLAccount_No - - - OriginalGLEntry_EntryNo - - - AppliedAmount - - - AppliedAmountFormat - - - OriginalEntry_CreditAmount - - - OriginalEntry_CreditAmountFormat - - - OriginalEntry_DebitAmount - - - OriginalEntry_DebitAmountFormat - - - OriginalEntry_Amount - - - OriginalEntry_AmountFormat - - - OriginalEntry_Description - - - OriginalEntry_PostingDate - - - OriginalEntry_DocumentNo - - - OriginalEntry_EntryNo - - - DetailedGLEntryCZA_Amount - - - DetailedGLEntryCZA_AmountFormat - - - GLEntry_CreditAmount - - - GLEntry_CreditAmountFormat - - - GLEntry_DebitAmount - - - GLEntry_DebitAmountFormat - - - GLEntry_Description - - - GLEntry_PostingDate - - - GLEntry_DocumentNo - - - DetailedGLEntryCZA_GLEntryNo - - - - DataSource - - - - \ No newline at end of file diff --git a/Apps/CZ/BankingDocumentsLocalization/app/Src/Codeunits/IssuePaymentOrderCZB.Codeunit.al b/Apps/CZ/BankingDocumentsLocalization/app/Src/Codeunits/IssuePaymentOrderCZB.Codeunit.al index 7b6e8499aa..415cbe0d61 100644 --- a/Apps/CZ/BankingDocumentsLocalization/app/Src/Codeunits/IssuePaymentOrderCZB.Codeunit.al +++ b/Apps/CZ/BankingDocumentsLocalization/app/Src/Codeunits/IssuePaymentOrderCZB.Codeunit.al @@ -150,13 +150,14 @@ codeunit 31353 "Issue Payment Order CZB" UncVATPayerLinesExistQst: Label 'There are %1 lines with unreliable VAT payer.\\Do you want to continue?', Comment = '%1 = Count of Lines'; UncVATPayerStatusNotCheckedQst: Label 'The unreliable VAT payer status has not been checked.\\Do you want to continue?'; begin - if PaymentOrderHeaderCZB.UnreliablePayerCheckExpired() then - PaymentOrderHeaderCZB.ImportUnreliablePayerStatus(); - SetPaymentOrderLineFilters(PaymentOrderLineCZB, PaymentOrderHeaderCZB); PaymentOrderLineCZB.SetRange(Type, PaymentOrderLineCZB.Type::Vendor); if not PaymentOrderLineCZB.FindSet() then exit; + + if PaymentOrderHeaderCZB.UnreliablePayerCheckExpired() then + PaymentOrderHeaderCZB.ImportUnreliablePayerStatus(); + repeat if PaymentOrderLineCZB.IsUnreliablePayerCheckPossible() then begin UnreliablePayerCheckPossible := true; diff --git a/Apps/CZ/BankingDocumentsLocalization/app/Src/Reports/SuggestPaymentsCZB.Report.al b/Apps/CZ/BankingDocumentsLocalization/app/Src/Reports/SuggestPaymentsCZB.Report.al index 12d3ff8a6a..d07f82b6ed 100644 --- a/Apps/CZ/BankingDocumentsLocalization/app/Src/Reports/SuggestPaymentsCZB.Report.al +++ b/Apps/CZ/BankingDocumentsLocalization/app/Src/Reports/SuggestPaymentsCZB.Report.al @@ -206,7 +206,7 @@ report 31280 "Suggest Payments CZB" DialogOpen := true; if EmplType = EmplType::OnlyPayables then - SetRange(Positive, true); + SetRange(Positive, false); SetRange("Posting Date", 0D, LastDueDateToPayReq); if EmployeeNoFilter <> '' then SetFilter("Employee No.", EmployeeNoFilter); diff --git a/Apps/CZ/BankingDocumentsLocalization/app/Src/Tables/BankStatementLineCZB.Table.al b/Apps/CZ/BankingDocumentsLocalization/app/Src/Tables/BankStatementLineCZB.Table.al index 5f8d9fea2f..9587712d83 100644 --- a/Apps/CZ/BankingDocumentsLocalization/app/Src/Tables/BankStatementLineCZB.Table.al +++ b/Apps/CZ/BankingDocumentsLocalization/app/Src/Tables/BankStatementLineCZB.Table.al @@ -410,5 +410,11 @@ table 31253 "Bank Statement Line CZB" Validate(Amount, BankAccReconciliationLine."Statement Amount"); Description := BankAccReconciliationLine.Description; "Account No." := CopyStr(BankAccReconciliationLine."Related-Party Bank Acc. No.", 1, MaxStrLen("Account No.")); + OnAfterCopyFromBankAccReconLine(Rec, BankAccReconciliationLine); + end; + + [IntegrationEvent(false, false)] + local procedure OnAfterCopyFromBankAccReconLine(var BankStatementLineCZB: Record "Bank Statement Line CZB"; BankAccReconciliationLine: Record "Bank Acc. Reconciliation Line") + begin end; } diff --git a/Apps/CZ/BankingDocumentsLocalization/test/Src/BankingDocumentsCZB.Codeunit.al b/Apps/CZ/BankingDocumentsLocalization/test/Src/BankingDocumentsCZB.Codeunit.al index fe853b7dbd..ef21931a8d 100644 --- a/Apps/CZ/BankingDocumentsLocalization/test/Src/BankingDocumentsCZB.Codeunit.al +++ b/Apps/CZ/BankingDocumentsLocalization/test/Src/BankingDocumentsCZB.Codeunit.al @@ -90,7 +90,6 @@ codeunit 148079 "Banking Documents CZB" end; [Test] - [HandlerFunctions('MessageHandler')] procedure CheckIssuePaymentOrder() var PaymentOrderHeaderCZB: Record "Payment Order Header CZB"; @@ -115,7 +114,7 @@ codeunit 148079 "Banking Documents CZB" end; [Test] - [HandlerFunctions('CopyPaymentOrderHandler,MessageHandler')] + [HandlerFunctions('CopyPaymentOrderHandler')] procedure CopyingPaymentOrderToBankStatement() var BankStatementHeaderCZB: Record "Bank Statement Header CZB"; @@ -239,7 +238,7 @@ codeunit 148079 "Banking Documents CZB" end; [Test] - [HandlerFunctions('RequestPagePaymentOrderHandler,MessageHandler')] + [HandlerFunctions('RequestPagePaymentOrderHandler')] procedure PrintingIssuedPaymentOrder() var PaymentOrderHeaderCZB: Record "Payment Order Header CZB"; diff --git a/Apps/CZ/CashDeskLocalization/app/Src/Codeunits/AllocationLineHandler.Codeunit.al b/Apps/CZ/CashDeskLocalization/app/Src/Codeunits/AllocationLineHandlerCZP.Codeunit.al similarity index 100% rename from Apps/CZ/CashDeskLocalization/app/Src/Codeunits/AllocationLineHandler.Codeunit.al rename to Apps/CZ/CashDeskLocalization/app/Src/Codeunits/AllocationLineHandlerCZP.Codeunit.al diff --git a/Apps/CZ/CashDeskLocalization/app/Src/Tables/CashDocumentLineCZP.Table.al b/Apps/CZ/CashDeskLocalization/app/Src/Tables/CashDocumentLineCZP.Table.al index 5fd867f040..9ea1e24241 100644 --- a/Apps/CZ/CashDeskLocalization/app/Src/Tables/CashDocumentLineCZP.Table.al +++ b/Apps/CZ/CashDeskLocalization/app/Src/Tables/CashDocumentLineCZP.Table.al @@ -1449,6 +1449,8 @@ table 11733 "Cash Document Line CZP" CashDocumentPostCZP: Codeunit "Cash Document-Post CZP"; ManualCrossAppHandlerCZP: Codeunit "Manual Cross App. Handler CZP"; begin + OnBeforeApplyEntries(Rec); + CashDocumentHeaderCZP.Get("Cash Desk No.", "Cash Document No."); if "Account Type" = "Account Type"::Customer then CashDocumentHeaderCZP.TestNotEETCashRegister(); @@ -1857,7 +1859,6 @@ table 11733 "Cash Document Line CZP" PostedGLAccount.Get(FAPostingGroup."Acquisition Cost Account"); end; PostedGLAccount.CheckGLAcc(); - PostedGLAccount.TestField("Gen. Prod. Posting Group"); "Posting Group" := FADepreciationBook."FA Posting Group"; Validate("Gen. Posting Type", PostedGLAccount."Gen. Posting Type"); Validate("VAT Bus. Posting Group", PostedGLAccount."VAT Bus. Posting Group"); @@ -2348,4 +2349,9 @@ table 11733 "Cash Document Line CZP" begin end; + [IntegrationEvent(false, false)] + local procedure OnBeforeApplyEntries(var CashDocumentLineCZP: Record "Cash Document Line CZP") + begin + end; + } \ No newline at end of file diff --git a/Apps/CZ/ContosoCoffeeDemoDatasetCZ/app/DemoTool/Contoso Helpers/ContosoPostingSetupCZ.Codeunit.al b/Apps/CZ/ContosoCoffeeDemoDatasetCZ/app/DemoTool/Contoso Helpers/ContosoPostingSetupCZ.Codeunit.al index ba8d15415a..631cb064a3 100644 --- a/Apps/CZ/ContosoCoffeeDemoDatasetCZ/app/DemoTool/Contoso Helpers/ContosoPostingSetupCZ.Codeunit.al +++ b/Apps/CZ/ContosoCoffeeDemoDatasetCZ/app/DemoTool/Contoso Helpers/ContosoPostingSetupCZ.Codeunit.al @@ -5,6 +5,7 @@ namespace Microsoft.DemoTool.Helpers; +using Microsoft.DemoData.Finance; using Microsoft.Finance.VAT.Clause; using Microsoft.Finance.VAT.Setup; using Microsoft.Foundation.Enums; @@ -18,6 +19,7 @@ codeunit 31219 "Contoso Posting Setup CZ" tabledata "VAT Clause" = rim; var + CreateVatPostingGroups: Codeunit "Create Vat Posting Groups"; VATSetupDescTok: Label 'Setup for %1 / %2', MaxLength = 100, Comment = '%1 is the VAT Bus. Posting Group Code, %2 is the VAT Prod. Posting Group Code'; OverwriteData: Boolean; @@ -71,6 +73,8 @@ codeunit 31219 "Contoso Posting Setup CZ" end; if VATPostingSetup."VAT Calculation Type" = VATPostingSetup."VAT Calculation Type"::"Reverse Charge VAT" then VATPostingSetup.Validate("Reverse Chrg. VAT Acc.", ReverseChargeVATUnrealAcc); + if VATPostingSetup."VAT Bus. Posting Group" = CreateVatPostingGroups.EU() then + VATPostingSetup.Validate("VIES Sales CZL", true); VATPostingSetup.Validate("VAT Rate CZL", VATRate); VATPostingSetup.Validate("VAT Clause Code", VATClauseCode); diff --git a/Apps/CZ/CoreLocalizationPack/app/Src/Codeunits/InstallApplicationCZL.Codeunit.al b/Apps/CZ/CoreLocalizationPack/app/Src/Codeunits/InstallApplicationCZL.Codeunit.al index ce86040593..140e996e13 100644 --- a/Apps/CZ/CoreLocalizationPack/app/Src/Codeunits/InstallApplicationCZL.Codeunit.al +++ b/Apps/CZ/CoreLocalizationPack/app/Src/Codeunits/InstallApplicationCZL.Codeunit.al @@ -255,6 +255,7 @@ codeunit 11748 "Install Application CZL" InitVATCtrlReportSections(); InitStatutoryReportingSetup(); InitSourceCodeSetup(); + InitNonDeductibleVAT(); end; local procedure ModifyData() @@ -470,6 +471,23 @@ codeunit 11748 "Install Application CZL" until AccScheduleLine.Next() = 0; end; + local procedure InitNonDeductibleVAT() + var + VATEntry: Record "VAT Entry"; + begin + VATEntry.SetFilter("Non-Deductible VAT %", '<>%1', 0); + VATEntry.SetLoadFields("Entry No.", Base, Amount, "Non-Deductible VAT Base", "Non-Deductible VAT Amount", "Original VAT Base CZL", "Original VAT Amount CZL", "Original VAT Entry No. CZL", "Additional-Currency Base", "Additional-Currency Amount", "Non-Deductible VAT Base ACY", "Non-Deductible VAT Amount ACY", "Original VAT Base ACY CZL", "Original VAT Amount ACY CZL"); + if VATEntry.FindSet(true) then + repeat + VATEntry."Original VAT Base CZL" := VATEntry.CalcOriginalVATBaseCZL(); + VATEntry."Original VAT Amount CZL" := VATEntry.CalcOriginalVATAmountCZL(); + VATEntry."Original VAT Base ACY CZL" := VATEntry.CalcOriginalVATBaseACYCZL(); + VATEntry."Original VAT Amount ACY CZL" := VATEntry.CalcOriginalVATAmountACYCZL(); + VATEntry."Original VAT Entry No. CZL" := VATEntry."Entry No."; + if VATEntry.Modify(false) then; + until VATEntry.Next() = 0; + end; + local procedure ConvertAccScheduleLineTotalingTypeEnumValues(var AccScheduleLine: Record "Acc. Schedule Line"); begin if AccScheduleLine."Totaling Type" = 14 then //14 = AccScheduleLine.Type::Custom diff --git a/Apps/CZ/CoreLocalizationPack/app/Src/Codeunits/PurchasePostingHandlerCZL.Codeunit.al b/Apps/CZ/CoreLocalizationPack/app/Src/Codeunits/PurchasePostingHandlerCZL.Codeunit.al index 53851d9091..31c09afe95 100644 --- a/Apps/CZ/CoreLocalizationPack/app/Src/Codeunits/PurchasePostingHandlerCZL.Codeunit.al +++ b/Apps/CZ/CoreLocalizationPack/app/Src/Codeunits/PurchasePostingHandlerCZL.Codeunit.al @@ -5,13 +5,11 @@ namespace Microsoft.Purchases.Posting; using Microsoft.Bank; -using Microsoft.Finance.Currency; using Microsoft.Finance.GeneralLedger.Journal; using Microsoft.Finance.GeneralLedger.Posting; using Microsoft.Finance.ReceivablesPayables; using Microsoft.Finance.VAT.Calculation; using Microsoft.Finance.VAT.Setup; -using Microsoft.Foundation.AuditCodes; using Microsoft.Inventory.Intrastat; using Microsoft.Inventory.Journal; using Microsoft.Purchases.Document; @@ -25,163 +23,16 @@ using System.Utilities; codeunit 31039 "Purchase Posting Handler CZL" { var - Currency: Record Currency; - SourceCodeSetup: Record "Source Code Setup"; VATPostingSetup: Record "VAT Posting Setup"; BankOperationsFunctionsCZL: Codeunit "Bank Operations Functions CZL"; - GenJnlLineDocType: Enum "Gen. Journal Document Type"; - GenJnlLineDocNo: Code[20]; - GenJnlLineExtDocNo: Code[35]; - GlobalAmountType: Option Base,VAT; + PurchaseVATDelayPostingCZL: Codeunit "Purchase VAT Delay Posting CZL"; PurchaseAlreadyExistsQst: Label 'Purchase %1 %2 already exists for this vendor.\Do you want to continue?', Comment = '%1 = Document Type; %2 = External Document No.; e.g. Purchase Invoice 123 already exists...'; [EventSubscriber(ObjectType::Codeunit, Codeunit::"Purch. Post Invoice Events", 'OnPostLinesOnAfterGenJnlLinePost', '', false, false)] local procedure PurchasePostVATCurrencyFactorOnPostLinesOnAfterGenJnlLinePost(var GenJnlLine: Record "Gen. Journal Line"; TempInvoicePostingBuffer: Record "Invoice Posting Buffer"; PurchHeader: Record "Purchase Header"; var GenJnlPostLine: Codeunit "Gen. Jnl.-Post Line") - var - RecalcFactor: Decimal; begin - if (PurchHeader."Currency Code" <> '') and (PurchHeader."Currency Factor" <> PurchHeader."VAT Currency Factor CZL") and - ((TempInvoicePostingBuffer."VAT Calculation Type" = TempInvoicePostingBuffer."VAT Calculation Type"::"Reverse Charge VAT") or - (TempInvoicePostingBuffer."VAT Calculation Type" = TempInvoicePostingBuffer."VAT Calculation Type"::"Normal VAT")) - then begin - VATPostingSetup.Get(TempInvoicePostingBuffer."VAT Bus. Posting Group", TempInvoicePostingBuffer."VAT Prod. Posting Group"); - VATPostingSetup.TestField("Purch. VAT Curr. Exch. Acc CZL"); - SourceCodeSetup.Get(); - SourceCodeSetup.TestField("Purchase VAT Delay CZL"); - GenJnlLineDocType := GenJnlLine."Document Type"; - GenJnlLineDocNo := GenJnlLine."Document No."; - GenJnlLineExtDocNo := GenJnlLine."External Document No."; - - RecalcFactor := 1; - if PurchHeader."VAT Currency Factor CZL" <> 0 then - RecalcFactor := PurchHeader."Currency Factor" / PurchHeader."VAT Currency Factor CZL"; - - PostVATDelay(PurchHeader, TempInvoicePostingBuffer, -1, 1, PurchHeader."Currency Factor", true, GenJnlPostLine); - PostVATDelay(PurchHeader, TempInvoicePostingBuffer, 1, RecalcFactor, PurchHeader."VAT Currency Factor CZL", false, GenJnlPostLine); - if TempInvoicePostingBuffer."VAT Calculation Type" = TempInvoicePostingBuffer."VAT Calculation Type"::"Normal VAT" then begin - PostVATDelayDifference(PurchHeader, TempInvoicePostingBuffer, GlobalAmountType::Base, RecalcFactor, GenJnlPostLine); - PostVATDelayDifference(PurchHeader, TempInvoicePostingBuffer, GlobalAmountType::VAT, RecalcFactor, GenJnlPostLine); - end; - end; - end; - - local procedure PostVATDelay(PurchaseHeader: Record "Purchase Header"; TempInvoicePostingBuffer: Record "Invoice Posting Buffer"; Sign: Integer; RecalcFactor: Decimal; CurrFactor: Decimal; IsCorrection: Boolean; var GenJnlPostLine: Codeunit "Gen. Jnl.-Post Line") - var - GenJournalLine: Record "Gen. Journal Line"; - begin - GetCurrency(PurchaseHeader."Currency Code"); - if RecalcFactor = 0 then - RecalcFactor := 1; - - InitGenJournalLine(PurchaseHeader, TempInvoicePostingBuffer, GenJournalLine); - - GenJournalLine."Currency Factor" := CurrFactor; - GenJournalLine.Quantity := Sign * GenJournalLine.Quantity; - GenJournalLine.Amount := - Sign * Round(TempInvoicePostingBuffer.Amount * RecalcFactor, Currency."Amount Rounding Precision"); - GenJournalLine."VAT Amount" := - Sign * Round(TempInvoicePostingBuffer."VAT Amount" * RecalcFactor, Currency."Amount Rounding Precision"); - GenJournalLine."VAT Base Amount" := GenJournalLine.Amount; - GenJournalLine."VAT Difference" := - Sign * Round(TempInvoicePostingBuffer."VAT Difference" * RecalcFactor, Currency."Amount Rounding Precision"); - GenJournalLine."Non-Deductible VAT %" := TempInvoicePostingBuffer."Non-Deductible VAT %"; - GenJournalLine."Non-Deductible VAT Base LCY" := - Sign * Round(TempInvoicePostingBuffer."Non-Deductible VAT Base" * RecalcFactor, Currency."Amount Rounding Precision"); - GenJournalLine."Non-Deductible VAT Amount LCY" := - Sign * Round(TempInvoicePostingBuffer."Non-Deductible VAT Amount" * RecalcFactor, Currency."Amount Rounding Precision"); - GenJournalLine."Non-Deductible VAT Diff." := - Sign * Round(TempInvoicePostingBuffer."Non-Deductible VAT Diff." * RecalcFactor, Currency."Amount Rounding Precision"); - - GenJournalLine.Correction := TempInvoicePostingBuffer."Correction CZL" xor IsCorrection; - GenJournalLine."VAT Bus. Posting Group" := TempInvoicePostingBuffer."VAT Bus. Posting Group"; - GenJournalLine."VAT Prod. Posting Group" := TempInvoicePostingBuffer."VAT Prod. Posting Group"; - GenJournalLine."Gen. Bus. Posting Group" := TempInvoicePostingBuffer."Gen. Bus. Posting Group"; - GenJournalLine."Gen. Prod. Posting Group" := TempInvoicePostingBuffer."Gen. Prod. Posting Group"; - GenJournalLine."EU 3-Party Trade" := PurchaseHeader."EU 3 Party Trade"; - GenJournalLine."EU 3-Party Intermed. Role CZL" := PurchaseHeader."EU 3-Party Intermed. Role CZL"; - - GenJnlPostLine.RunWithCheck(GenJournalLine); - end; - - local procedure PostVATDelayDifference(PurchaseHeader: Record "Purchase Header"; TempInvoicePostingBuffer: Record "Invoice Posting Buffer"; AmountType: Option Base,VAT; RecalcFactor: Decimal; var GenJnlPostLine: Codeunit "Gen. Jnl.-Post Line") - var - GenJournalLine: Record "Gen. Journal Line"; - Amount: Decimal; - begin - GetCurrency(PurchaseHeader."Currency Code"); - if RecalcFactor = 0 then - RecalcFactor := 1; - - case AmountType of - AmountType::Base: - Amount := TempInvoicePostingBuffer.Amount + TempInvoicePostingBuffer."Non-Deductible VAT Amount"; - AmountType::VAT: - Amount := TempInvoicePostingBuffer."VAT Amount" - TempInvoicePostingBuffer."Non-Deductible VAT Amount"; - end; - - InitGenJournalLine(PurchaseHeader, TempInvoicePostingBuffer, GenJournalLine); - GenJournalLine."Gen. Posting Type" := GenJournalLine."Gen. Posting Type"::" "; - if AmountType = AmountType::VAT then - if Amount < 0 then - GenJournalLine."Account No." := Currency."Realized Gains Acc." - else - GenJournalLine."Account No." := Currency."Realized Losses Acc."; - GenJournalLine.Amount := Amount - Round(Amount * RecalcFactor, Currency."Amount Rounding Precision"); - - GenJnlPostLine.RunWithCheck(GenJournalLine); - end; - - local procedure InitGenJournalLine(PurchaseHeader: Record "Purchase Header"; TempInvoicePostingBuffer: Record "Invoice Posting Buffer"; var GenJournalLine: Record "Gen. Journal Line") - begin - GenJournalLine.Init(); - GenJournalLine."Document Type" := GenJnlLineDocType; - GenJournalLine."Document No." := GenJnlLineDocNo; - GenJournalLine."External Document No." := GenJnlLineExtDocNo; - GenJournalLine."Account No." := VATPostingSetup."Purch. VAT Curr. Exch. Acc CZL"; - if TempInvoicePostingBuffer."VAT Calculation Type" = TempInvoicePostingBuffer."VAT Calculation Type"::"Reverse Charge VAT" then - GenJournalLine."Bal. Account No." := VATPostingSetup."Purch. VAT Curr. Exch. Acc CZL"; - GenJournalLine."Posting Date" := PurchaseHeader."Posting Date"; - GenJournalLine."Document Date" := PurchaseHeader."Document Date"; - GenJournalLine."VAT Reporting Date" := PurchaseHeader."VAT Reporting Date"; - GenJournalLine."Original Doc. VAT Date CZL" := PurchaseHeader."Original Doc. VAT Date CZL"; - GenJournalLine.Description := PurchaseHeader."Posting Description"; - GenJournalLine."Reason Code" := PurchaseHeader."Reason Code"; - GenJournalLine."System-Created Entry" := TempInvoicePostingBuffer."System-Created Entry"; - GenJournalLine."Source Currency Code" := PurchaseHeader."Currency Code"; - GenJournalLine.Correction := TempInvoicePostingBuffer."Correction CZL"; - GenJournalLine."Gen. Posting Type" := GenJournalLine."Gen. Posting Type"::Purchase; - GenJournalLine."Tax Area Code" := TempInvoicePostingBuffer."Tax Area Code"; - GenJournalLine."Tax Liable" := TempInvoicePostingBuffer."Tax Liable"; - GenJournalLine."Tax Group Code" := TempInvoicePostingBuffer."Tax Group Code"; - GenJournalLine."Use Tax" := TempInvoicePostingBuffer."Use Tax"; - GenJournalLine."VAT Calculation Type" := TempInvoicePostingBuffer."VAT Calculation Type"; - GenJournalLine."VAT Base Discount %" := PurchaseHeader."VAT Base Discount %"; - GenJournalLine."VAT Posting" := GenJournalLine."VAT Posting"::"Manual VAT Entry"; - GenJournalLine."Shortcut Dimension 1 Code" := TempInvoicePostingBuffer."Global Dimension 1 Code"; - GenJournalLine."Shortcut Dimension 2 Code" := TempInvoicePostingBuffer."Global Dimension 2 Code"; - GenJournalLine."Dimension Set ID" := TempInvoicePostingBuffer."Dimension Set ID"; - GenJournalLine."Job No." := TempInvoicePostingBuffer."Job No."; - GenJournalLine."Source Code" := SourceCodeSetup."Purchase VAT Delay CZL"; - GenJournalLine."Bill-to/Pay-to No." := PurchaseHeader."Pay-to Vendor No."; - GenJournalLine."Source Type" := GenJournalLine."Source Type"::Vendor; - GenJournalLine."Source No." := PurchaseHeader."Pay-to Vendor No."; - GenJournalLine."Posting No. Series" := PurchaseHeader."Posting No. Series"; - GenJournalLine."Country/Region Code" := PurchaseHeader."VAT Country/Region Code"; - GenJournalLine."VAT Registration No." := PurchaseHeader."VAT Registration No."; - GenJournalLine."Registration No. CZL" := PurchaseHeader."Registration No. CZL"; - GenJournalLine.Quantity := TempInvoicePostingBuffer.Quantity; - GenJournalLine."VAT Delay CZL" := true; - end; - - local procedure GetCurrency(CurrencyCode: Code[10]) - begin - if CurrencyCode = '' then - Currency.InitRoundingPrecision() - else begin - Currency.Get(CurrencyCode); - Currency.TestField("Amount Rounding Precision"); - end; + PurchaseVATDelayPostingCZL.PostPurchaseVATDelay(GenJnlLine, TempInvoicePostingBuffer, PurchHeader, GenJnlPostLine); end; [EventSubscriber(ObjectType::Codeunit, Codeunit::"Purch.-Post", 'OnAfterCheckPurchDoc', '', false, false)] diff --git a/Apps/CZ/CoreLocalizationPack/app/Src/Codeunits/PurchaseVATDelayPostingCZL.Codeunit.al b/Apps/CZ/CoreLocalizationPack/app/Src/Codeunits/PurchaseVATDelayPostingCZL.Codeunit.al new file mode 100644 index 0000000000..830ab94875 --- /dev/null +++ b/Apps/CZ/CoreLocalizationPack/app/Src/Codeunits/PurchaseVATDelayPostingCZL.Codeunit.al @@ -0,0 +1,187 @@ +// ------------------------------------------------------------------------------------------------ +// 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.Posting; + +using Microsoft.Finance.Currency; +using Microsoft.Finance.GeneralLedger.Journal; +using Microsoft.Finance.GeneralLedger.Posting; +using Microsoft.Finance.ReceivablesPayables; +using Microsoft.Finance.VAT.Setup; +using Microsoft.Foundation.AuditCodes; +using Microsoft.Purchases.Document; + +codeunit 11760 "Purchase VAT Delay Posting CZL" +{ + var + Currency: Record Currency; + SourceCodeSetup: Record "Source Code Setup"; + VATPostingSetup: Record "VAT Posting Setup"; + GenJnlLineDocType: Enum "Gen. Journal Document Type"; + GenJnlLineDocNo: Code[20]; + GenJnlLineExtDocNo: Code[35]; + GlobalAmountType: Option Base,VAT; + + /// + /// Posts the purchase VAT delay entries for a purchase document when the currency factor differs from the VAT currency factor. + /// This handles the exchange rate difference between the document currency factor and the VAT currency factor + /// by posting corrective VAT entries to the purchase VAT currency exchange account. + /// + /// The general journal line used to retrieve document type, document number, and external document number. + /// The invoice posting buffer containing VAT calculation type, amounts, and posting group information. + /// The purchase header containing currency codes, currency factors, and posting information. + /// The general journal post line codeunit used to post the generated journal lines. + procedure PostPurchaseVATDelay(var GenJnlLine: Record "Gen. Journal Line"; TempInvoicePostingBuffer: Record "Invoice Posting Buffer"; PurchHeader: Record "Purchase Header"; var GenJnlPostLine: Codeunit "Gen. Jnl.-Post Line") + var + RecalcFactor: Decimal; + begin + if (PurchHeader."Currency Code" <> '') and (PurchHeader."Currency Factor" <> PurchHeader."VAT Currency Factor CZL") and + ((TempInvoicePostingBuffer."VAT Calculation Type" = TempInvoicePostingBuffer."VAT Calculation Type"::"Reverse Charge VAT") or + (TempInvoicePostingBuffer."VAT Calculation Type" = TempInvoicePostingBuffer."VAT Calculation Type"::"Normal VAT")) + then begin + VATPostingSetup.Get(TempInvoicePostingBuffer."VAT Bus. Posting Group", TempInvoicePostingBuffer."VAT Prod. Posting Group"); + VATPostingSetup.TestField("Purch. VAT Curr. Exch. Acc CZL"); + SourceCodeSetup.Get(); + SourceCodeSetup.TestField("Purchase VAT Delay CZL"); + GenJnlLineDocType := GenJnlLine."Document Type"; + GenJnlLineDocNo := GenJnlLine."Document No."; + GenJnlLineExtDocNo := GenJnlLine."External Document No."; + + RecalcFactor := 1; + if PurchHeader."VAT Currency Factor CZL" <> 0 then + RecalcFactor := PurchHeader."Currency Factor" / PurchHeader."VAT Currency Factor CZL"; + + PostVATDelay(PurchHeader, TempInvoicePostingBuffer, -1, 1, PurchHeader."Currency Factor", true, GenJnlPostLine); + PostVATDelay(PurchHeader, TempInvoicePostingBuffer, 1, RecalcFactor, PurchHeader."VAT Currency Factor CZL", false, GenJnlPostLine); + if TempInvoicePostingBuffer."VAT Calculation Type" = TempInvoicePostingBuffer."VAT Calculation Type"::"Normal VAT" then begin + PostVATDelayDifference(PurchHeader, TempInvoicePostingBuffer, GlobalAmountType::Base, RecalcFactor, GenJnlPostLine); + PostVATDelayDifference(PurchHeader, TempInvoicePostingBuffer, GlobalAmountType::VAT, RecalcFactor, GenJnlPostLine); + end; + end; + end; + + local procedure PostVATDelay(PurchaseHeader: Record "Purchase Header"; TempInvoicePostingBuffer: Record "Invoice Posting Buffer"; Sign: Integer; RecalcFactor: Decimal; CurrFactor: Decimal; IsCorrection: Boolean; var GenJnlPostLine: Codeunit "Gen. Jnl.-Post Line") + var + GenJournalLine: Record "Gen. Journal Line"; + begin + GetCurrency(PurchaseHeader."Currency Code"); + if RecalcFactor = 0 then + RecalcFactor := 1; + + InitGenJournalLine(PurchaseHeader, TempInvoicePostingBuffer, GenJournalLine); + + GenJournalLine."Currency Factor" := CurrFactor; + GenJournalLine.Quantity := Sign * GenJournalLine.Quantity; + GenJournalLine.Amount := + Sign * Round(TempInvoicePostingBuffer.Amount * RecalcFactor, Currency."Amount Rounding Precision"); + GenJournalLine."VAT Amount" := + Sign * Round(TempInvoicePostingBuffer."VAT Amount" * RecalcFactor, Currency."Amount Rounding Precision"); + GenJournalLine."VAT Base Amount" := GenJournalLine.Amount; + GenJournalLine."VAT Difference" := + Sign * Round(TempInvoicePostingBuffer."VAT Difference" * RecalcFactor, Currency."Amount Rounding Precision"); + GenJournalLine."Non-Deductible VAT %" := TempInvoicePostingBuffer."Non-Deductible VAT %"; + GenJournalLine."Non-Deductible VAT Base LCY" := + Sign * Round(TempInvoicePostingBuffer."Non-Deductible VAT Base" * RecalcFactor, Currency."Amount Rounding Precision"); + GenJournalLine."Non-Deductible VAT Amount LCY" := + Sign * Round(TempInvoicePostingBuffer."Non-Deductible VAT Amount" * RecalcFactor, Currency."Amount Rounding Precision"); + GenJournalLine."Non-Deductible VAT Diff." := + Sign * Round(TempInvoicePostingBuffer."Non-Deductible VAT Diff." * RecalcFactor, Currency."Amount Rounding Precision"); + + GenJournalLine.Correction := TempInvoicePostingBuffer."Correction CZL" xor IsCorrection; + GenJournalLine."VAT Bus. Posting Group" := TempInvoicePostingBuffer."VAT Bus. Posting Group"; + GenJournalLine."VAT Prod. Posting Group" := TempInvoicePostingBuffer."VAT Prod. Posting Group"; + GenJournalLine."Gen. Bus. Posting Group" := TempInvoicePostingBuffer."Gen. Bus. Posting Group"; + GenJournalLine."Gen. Prod. Posting Group" := TempInvoicePostingBuffer."Gen. Prod. Posting Group"; + GenJournalLine."EU 3-Party Trade" := PurchaseHeader."EU 3 Party Trade"; + GenJournalLine."EU 3-Party Intermed. Role CZL" := PurchaseHeader."EU 3-Party Intermed. Role CZL"; + + GenJnlPostLine.RunWithCheck(GenJournalLine); + end; + + local procedure PostVATDelayDifference(PurchaseHeader: Record "Purchase Header"; TempInvoicePostingBuffer: Record "Invoice Posting Buffer"; AmountType: Option Base,VAT; RecalcFactor: Decimal; var GenJnlPostLine: Codeunit "Gen. Jnl.-Post Line") + var + GenJournalLine: Record "Gen. Journal Line"; + Amount: Decimal; + begin + GetCurrency(PurchaseHeader."Currency Code"); + if RecalcFactor = 0 then + RecalcFactor := 1; + + case AmountType of + AmountType::Base: + Amount := TempInvoicePostingBuffer.Amount + TempInvoicePostingBuffer."Non-Deductible VAT Amount"; + AmountType::VAT: + Amount := TempInvoicePostingBuffer."VAT Amount" - TempInvoicePostingBuffer."Non-Deductible VAT Amount"; + end; + + InitGenJournalLine(PurchaseHeader, TempInvoicePostingBuffer, GenJournalLine); + GenJournalLine."Gen. Posting Type" := GenJournalLine."Gen. Posting Type"::" "; + if AmountType = AmountType::VAT then + if Amount < 0 then + GenJournalLine."Account No." := Currency."Realized Gains Acc." + else + GenJournalLine."Account No." := Currency."Realized Losses Acc."; + GenJournalLine.Amount := Amount - Round(Amount * RecalcFactor, Currency."Amount Rounding Precision"); + + GenJnlPostLine.RunWithCheck(GenJournalLine); + end; + + local procedure InitGenJournalLine(PurchaseHeader: Record "Purchase Header"; TempInvoicePostingBuffer: Record "Invoice Posting Buffer"; var GenJournalLine: Record "Gen. Journal Line") + begin + GenJournalLine.Init(); + GenJournalLine."Document Type" := GenJnlLineDocType; + GenJournalLine."Document No." := GenJnlLineDocNo; + GenJournalLine."External Document No." := GenJnlLineExtDocNo; + GenJournalLine."Account No." := VATPostingSetup."Purch. VAT Curr. Exch. Acc CZL"; + if TempInvoicePostingBuffer."VAT Calculation Type" = TempInvoicePostingBuffer."VAT Calculation Type"::"Reverse Charge VAT" then + GenJournalLine."Bal. Account No." := VATPostingSetup."Purch. VAT Curr. Exch. Acc CZL"; + GenJournalLine."Posting Date" := PurchaseHeader."Posting Date"; + GenJournalLine."Document Date" := PurchaseHeader."Document Date"; + GenJournalLine."VAT Reporting Date" := PurchaseHeader."VAT Reporting Date"; + GenJournalLine."Original Doc. VAT Date CZL" := PurchaseHeader."Original Doc. VAT Date CZL"; + GenJournalLine.Description := PurchaseHeader."Posting Description"; + GenJournalLine."Reason Code" := PurchaseHeader."Reason Code"; + GenJournalLine."System-Created Entry" := TempInvoicePostingBuffer."System-Created Entry"; + GenJournalLine."Source Currency Code" := PurchaseHeader."Currency Code"; + GenJournalLine.Correction := TempInvoicePostingBuffer."Correction CZL"; + GenJournalLine."Gen. Posting Type" := GenJournalLine."Gen. Posting Type"::Purchase; + GenJournalLine."Tax Area Code" := TempInvoicePostingBuffer."Tax Area Code"; + GenJournalLine."Tax Liable" := TempInvoicePostingBuffer."Tax Liable"; + GenJournalLine."Tax Group Code" := TempInvoicePostingBuffer."Tax Group Code"; + GenJournalLine."Use Tax" := TempInvoicePostingBuffer."Use Tax"; + GenJournalLine."VAT Calculation Type" := TempInvoicePostingBuffer."VAT Calculation Type"; + GenJournalLine."VAT Base Discount %" := PurchaseHeader."VAT Base Discount %"; + GenJournalLine."VAT Posting" := GenJournalLine."VAT Posting"::"Manual VAT Entry"; + GenJournalLine."Shortcut Dimension 1 Code" := TempInvoicePostingBuffer."Global Dimension 1 Code"; + GenJournalLine."Shortcut Dimension 2 Code" := TempInvoicePostingBuffer."Global Dimension 2 Code"; + GenJournalLine."Dimension Set ID" := TempInvoicePostingBuffer."Dimension Set ID"; + GenJournalLine."Job No." := TempInvoicePostingBuffer."Job No."; + GenJournalLine."Source Code" := SourceCodeSetup."Purchase VAT Delay CZL"; + GenJournalLine."Bill-to/Pay-to No." := PurchaseHeader."Pay-to Vendor No."; + GenJournalLine."Source Type" := GenJournalLine."Source Type"::Vendor; + GenJournalLine."Source No." := PurchaseHeader."Pay-to Vendor No."; + GenJournalLine."Posting No. Series" := PurchaseHeader."Posting No. Series"; + GenJournalLine."Country/Region Code" := PurchaseHeader."VAT Country/Region Code"; + GenJournalLine."VAT Registration No." := PurchaseHeader."VAT Registration No."; + GenJournalLine."Registration No. CZL" := PurchaseHeader."Registration No. CZL"; + GenJournalLine.Quantity := TempInvoicePostingBuffer.Quantity; + GenJournalLine."VAT Delay CZL" := true; + OnAfterInitGenJournalLine(PurchaseHeader, TempInvoicePostingBuffer, GenJournalLine); + end; + + local procedure GetCurrency(CurrencyCode: Code[10]) + begin + if CurrencyCode = '' then + Currency.InitRoundingPrecision() + else begin + Currency.Get(CurrencyCode); + Currency.TestField("Amount Rounding Precision"); + end; + end; + + [IntegrationEvent(false, false)] + local procedure OnAfterInitGenJournalLine(PurchaseHeader: Record "Purchase Header"; TempInvoicePostingBuffer: Record "Invoice Posting Buffer"; var GenJournalLine: Record "Gen. Journal Line") + begin + end; +} \ No newline at end of file diff --git a/Apps/CZ/CoreLocalizationPack/app/Src/Codeunits/RegistrationNoMgtCZL.Codeunit.al b/Apps/CZ/CoreLocalizationPack/app/Src/Codeunits/RegistrationNoMgtCZL.Codeunit.al index 681fe2a408..953d85b7b6 100644 --- a/Apps/CZ/CoreLocalizationPack/app/Src/Codeunits/RegistrationNoMgtCZL.Codeunit.al +++ b/Apps/CZ/CoreLocalizationPack/app/Src/Codeunits/RegistrationNoMgtCZL.Codeunit.al @@ -81,7 +81,14 @@ codeunit 11756 "Registration No. Mgt. CZL" end; local procedure CheckContactDuplicity(RegNo: Text[20]; Number: Code[20]; IsTax: Boolean) + var + IsHandled: Boolean; begin + IsHandled := false; + OnBeforeCheckContactDuplicity(RegNo, Number, IsTax, IsHandled); + if IsHandled then + exit; + if not IsTax then Contact.SetRange("Registration Number", RegNo) else @@ -116,4 +123,9 @@ codeunit 11756 "Registration No. Mgt. CZL" exit(Contact.FieldCaption("Registration Number")); exit(Contact.FieldCaption("Tax Registration No. CZL")); end; + + [IntegrationEvent(false, false)] + local procedure OnBeforeCheckContactDuplicity(RegNo: Text[20]; Number: Code[20]; IsTax: Boolean; var IsHandled: Boolean) + begin + end; } diff --git a/Apps/CZ/CoreLocalizationPack/app/Src/Codeunits/SalesHeaderHandlerCZL.Codeunit.al b/Apps/CZ/CoreLocalizationPack/app/Src/Codeunits/SalesHeaderHandlerCZL.Codeunit.al index 51cc1eb762..42a7a29fcc 100644 --- a/Apps/CZ/CoreLocalizationPack/app/Src/Codeunits/SalesHeaderHandlerCZL.Codeunit.al +++ b/Apps/CZ/CoreLocalizationPack/app/Src/Codeunits/SalesHeaderHandlerCZL.Codeunit.al @@ -96,7 +96,7 @@ codeunit 11743 "Sales Header Handler CZL" [EventSubscriber(ObjectType::Table, Database::"Sales Header", 'OnAfterUpdateShipToAddress', '', false, false)] local procedure UpdateVATCountryRegionCodeOnAfterUpdateShipToAddress(var SalesHeader: Record "Sales Header") begin - if SalesHeader.IsCreditDocType() then + if SalesHeader.IsCreditDocType() and (SalesHeader."No." <> '') then SalesHeader.Validate("VAT Country/Region Code", SalesHeader."Sell-to Country/Region Code"); end; } diff --git a/Apps/CZ/CoreLocalizationPack/app/Src/Codeunits/UpgradeApplicationCZL.Codeunit.al b/Apps/CZ/CoreLocalizationPack/app/Src/Codeunits/UpgradeApplicationCZL.Codeunit.al index ee77e28da5..551fbc7a35 100644 --- a/Apps/CZ/CoreLocalizationPack/app/Src/Codeunits/UpgradeApplicationCZL.Codeunit.al +++ b/Apps/CZ/CoreLocalizationPack/app/Src/Codeunits/UpgradeApplicationCZL.Codeunit.al @@ -653,7 +653,7 @@ codeunit 31017 "Upgrade Application CZL" exit; VATEntry.SetFilter("Non-Deductible VAT %", '<>%1', 0); - VATEntry.SetLoadFields("Entry No.", "Additional-Currency Base", "Additional-Currency Amount", "Non-Deductible VAT Base ACY", "Non-Deductible VAT Amount ACY"); + VATEntry.SetLoadFields("Entry No.", "Additional-Currency Base", "Additional-Currency Amount", "Non-Deductible VAT Base ACY", "Non-Deductible VAT Amount ACY", "Original VAT Base ACY CZL", "Original VAT Amount ACY CZL"); if VATEntry.FindSet() then repeat VATEntry."Original VAT Base ACY CZL" := VATEntry.CalcOriginalVATBaseACYCZL(); diff --git a/Apps/CZ/CoreLocalizationPack/app/Src/Codeunits/VATCtrlReportMgtCZL.Codeunit.al b/Apps/CZ/CoreLocalizationPack/app/Src/Codeunits/VATCtrlReportMgtCZL.Codeunit.al index b46d18dfa7..23ce769d7b 100644 --- a/Apps/CZ/CoreLocalizationPack/app/Src/Codeunits/VATCtrlReportMgtCZL.Codeunit.al +++ b/Apps/CZ/CoreLocalizationPack/app/Src/Codeunits/VATCtrlReportMgtCZL.Codeunit.al @@ -1310,8 +1310,10 @@ codeunit 31102 "VAT Ctrl. Report Mgt. CZL" TempVATEntry.Init(); TempVATEntry := VATEntry; if TempVATEntry."Original VAT Entry No. CZL" <> 0 then begin - TempVATEntry.Base := TempVATEntry.GetOriginalVATBaseCZL(); - TempVATEntry.Amount := TempVATEntry.GetOriginalVATAmountCZL(); + TempVATEntry.Base := TempVATEntry."Original VAT Base CZL"; + TempVATEntry.Amount := TempVATEntry."Original VAT Amount CZL"; + TempVATEntry."Additional-Currency Base" := TempVATEntry."Original VAT Base ACY CZL"; + TempVATEntry."Additional-Currency Amount" := TempVATEntry."Original VAT Amount ACY CZL"; end; OnBeforeInsertTempVATEntryForForPeriod(TempVATEntry); TempVATEntry.Insert(); diff --git a/Apps/CZ/CoreLocalizationPack/app/Src/Interfaces/EETCashRegister.Interface.al b/Apps/CZ/CoreLocalizationPack/app/Src/Interfaces/EETCashRegisterCZL.Interface.al similarity index 100% rename from Apps/CZ/CoreLocalizationPack/app/Src/Interfaces/EETCashRegister.Interface.al rename to Apps/CZ/CoreLocalizationPack/app/Src/Interfaces/EETCashRegisterCZL.Interface.al diff --git a/Apps/CZ/CoreLocalizationPack/app/Src/Interfaces/VATControlReportExport.Interface.al b/Apps/CZ/CoreLocalizationPack/app/Src/Interfaces/VATControlReportExportCZL.Interface.al similarity index 100% rename from Apps/CZ/CoreLocalizationPack/app/Src/Interfaces/VATControlReportExport.Interface.al rename to Apps/CZ/CoreLocalizationPack/app/Src/Interfaces/VATControlReportExportCZL.Interface.al diff --git a/Apps/CZ/CoreLocalizationPack/app/Src/Interfaces/VATStatementExport.Interface.al b/Apps/CZ/CoreLocalizationPack/app/Src/Interfaces/VATStatementExportCZL.Interface.al similarity index 100% rename from Apps/CZ/CoreLocalizationPack/app/Src/Interfaces/VATStatementExport.Interface.al rename to Apps/CZ/CoreLocalizationPack/app/Src/Interfaces/VATStatementExportCZL.Interface.al diff --git a/Apps/CZ/CoreLocalizationPack/app/Src/PageExtensions/GLEntriesPreviewCZL.PageExt.al b/Apps/CZ/CoreLocalizationPack/app/Src/PageExtensions/GLEntriesPreviewCZL.PageExt.al index 2a36dd90ad..7b2f7e15d2 100644 --- a/Apps/CZ/CoreLocalizationPack/app/Src/PageExtensions/GLEntriesPreviewCZL.PageExt.al +++ b/Apps/CZ/CoreLocalizationPack/app/Src/PageExtensions/GLEntriesPreviewCZL.PageExt.al @@ -10,15 +10,24 @@ pageextension 11760 "G/L Entries Preview CZL" extends "G/L Entries Preview" { layout { + modify("VAT Date") + { + Visible = VATDateEnabled; + } +#if not CLEAN29 addafter("Posting Date") { field("VAT Reporting Date CZL"; Rec."VAT Reporting Date") { ApplicationArea = Basic, Suite; ToolTip = 'Specifies the date used to include entries on VAT reports in a VAT period. This is either the date that the document was created or posted, depending on your setting on the General Ledger Setup page.'; - Visible = VATDateEnabled; + Visible = false; + ObsoleteState = Pending; + ObsoleteTag = '29.0'; + ObsoleteReason = 'The field is duplicated with "VAT Date" field. Use the "VAT Date" field instead.'; } } +#endif addafter("FA Entry No.") { diff --git a/Apps/CZ/CoreLocalizationPack/app/Src/PageExtensions/VATEntriesPreviewCZL.PageExt.al b/Apps/CZ/CoreLocalizationPack/app/Src/PageExtensions/VATEntriesPreviewCZL.PageExt.al index 6a1b7b5b25..100fdf63af 100644 --- a/Apps/CZ/CoreLocalizationPack/app/Src/PageExtensions/VATEntriesPreviewCZL.PageExt.al +++ b/Apps/CZ/CoreLocalizationPack/app/Src/PageExtensions/VATEntriesPreviewCZL.PageExt.al @@ -10,14 +10,19 @@ pageextension 11759 "VAT Entries Preview CZL" extends "VAT Entries Preview" { layout { - addafter("Posting Date") + addafter("VAT Date") { +#if not CLEAN29 field("VAT Reporting Date CZL"; Rec."VAT Reporting Date") { ApplicationArea = Basic, Suite; ToolTip = 'Specifies the date used to include entries on VAT reports in a VAT period. This is either the date that the document was created or posted, depending on your setting on the General Ledger Setup page.'; - Visible = VATDateEnabled; + Visible = false; + ObsoleteState = Pending; + ObsoleteTag = '29.0'; + ObsoleteReason = 'The field is duplicated with "VAT Reporting Date" field. Use the "VAT Reporting Date" field instead.'; } +#endif field("Original Doc. VAT Date CZL"; Rec."Original Doc. VAT Date CZL") { ApplicationArea = Basic, Suite; diff --git a/Apps/CZ/CoreLocalizationPack/app/Src/PageExtensions/VATReport.PageExt.al b/Apps/CZ/CoreLocalizationPack/app/Src/PageExtensions/VATReportCZL.PageExt.al similarity index 100% rename from Apps/CZ/CoreLocalizationPack/app/Src/PageExtensions/VATReport.PageExt.al rename to Apps/CZ/CoreLocalizationPack/app/Src/PageExtensions/VATReportCZL.PageExt.al diff --git a/Apps/CZ/CoreLocalizationPack/app/Src/PageExtensions/VATReportStmtSubform.PageExt.al b/Apps/CZ/CoreLocalizationPack/app/Src/PageExtensions/VATReportStmtSubformCZL.PageExt.al similarity index 100% rename from Apps/CZ/CoreLocalizationPack/app/Src/PageExtensions/VATReportStmtSubform.PageExt.al rename to Apps/CZ/CoreLocalizationPack/app/Src/PageExtensions/VATReportStmtSubformCZL.PageExt.al diff --git a/Apps/CZ/CoreLocalizationPack/app/Src/PageExtensions/VATReturnPeriodCard.PageExt.al b/Apps/CZ/CoreLocalizationPack/app/Src/PageExtensions/VATReturnPeriodCardCZL.PageExt.al similarity index 100% rename from Apps/CZ/CoreLocalizationPack/app/Src/PageExtensions/VATReturnPeriodCard.PageExt.al rename to Apps/CZ/CoreLocalizationPack/app/Src/PageExtensions/VATReturnPeriodCardCZL.PageExt.al diff --git a/Apps/CZ/CoreLocalizationPack/app/Src/PageExtensions/VATReturnPeriodList.PageExt.al b/Apps/CZ/CoreLocalizationPack/app/Src/PageExtensions/VATReturnPeriodListCZL.PageExt.al similarity index 100% rename from Apps/CZ/CoreLocalizationPack/app/Src/PageExtensions/VATReturnPeriodList.PageExt.al rename to Apps/CZ/CoreLocalizationPack/app/Src/PageExtensions/VATReturnPeriodListCZL.PageExt.al diff --git a/Apps/CZ/CoreLocalizationPack/app/Src/Permissions/CZCorePackObjectsCZL.PermissionSet.al b/Apps/CZ/CoreLocalizationPack/app/Src/Permissions/CZCorePackObjectsCZL.PermissionSet.al index 751d43b738..f506eab7e8 100644 --- a/Apps/CZ/CoreLocalizationPack/app/Src/Permissions/CZCorePackObjectsCZL.PermissionSet.al +++ b/Apps/CZ/CoreLocalizationPack/app/Src/Permissions/CZCorePackObjectsCZL.PermissionSet.al @@ -82,6 +82,7 @@ permissionset 11732 "CZ Core Pack - Objects CZL" codeunit "Purchase Header Handler CZL" = X, codeunit "Purchase Line Handler CZL" = X, codeunit "Purchase Posting Handler CZL" = X, + codeunit "Purchase VAT Delay Posting CZL" = X, codeunit "Reconciliation Handler CZL" = X, codeunit "Registration Log Mgt. CZL" = X, codeunit "Registration No. Mgt. CZL" = X, diff --git a/Apps/CZ/CoreLocalizationPack/app/Src/Reports/DocumentationforVATCZL.Report.al b/Apps/CZ/CoreLocalizationPack/app/Src/Reports/DocumentationforVATCZL.Report.al index 23b70ae502..82d694e99d 100644 --- a/Apps/CZ/CoreLocalizationPack/app/Src/Reports/DocumentationforVATCZL.Report.al +++ b/Apps/CZ/CoreLocalizationPack/app/Src/Reports/DocumentationforVATCZL.Report.al @@ -222,8 +222,8 @@ report 11757 "Documentation for VAT CZL" CountrySubTotalAmt[1] += "VAT Entry".Base; CountrySubTotalAmt[2] += "VAT Entry".Amount; - CountrySubTotalAmt[3] += "VAT Entry".GetOriginalVATBaseCZL(); - CountrySubTotalAmt[4] += "VAT Entry".GetOriginalVATAmountCZL(); + CountrySubTotalAmt[3] += "VAT Entry"."Original VAT Base CZL"; + CountrySubTotalAmt[4] += "VAT Entry"."Original VAT Amount CZL"; CountrySubTotalAmt[5] += "VAT Entry".CalcDeductibleVATBaseCZL(); SetRange(Number, 0); @@ -242,8 +242,8 @@ report 11757 "Documentation for VAT CZL" begin VATEntrySubtotalAmt[1] += Base; VATEntrySubtotalAmt[2] += Amount; - VATEntrySubtotalAmt[3] += GetOriginalVATBaseCZL(); - VATEntrySubtotalAmt[4] += GetOriginalVATAmountCZL(); + VATEntrySubtotalAmt[3] += "Original VAT Base CZL"; + VATEntrySubtotalAmt[4] += "Original VAT Amount CZL"; VATEntrySubtotalAmt[5] += CalcDeductibleVATBaseCZL(); case "VAT Posting Setup"."VAT Calculation Type" of @@ -377,6 +377,10 @@ report 11757 "Documentation for VAT CZL" if UseAmtsInAddCurr then begin VATEntry.Base := VATEntry."Additional-Currency Base"; VATEntry.Amount := VATEntry."Additional-Currency Amount"; + VATEntry."Non-Deductible VAT Base" := VATEntry."Non-Deductible VAT Base ACY"; + VATEntry."Non-Deductible VAT Amount" := VATEntry."Non-Deductible VAT Amount ACY"; + VATEntry."Original VAT Base CZL" := VATEntry."Original VAT Base ACY CZL"; + VATEntry."Original VAT Amount CZL" := VATEntry."Original VAT Amount ACY CZL"; end; if MergeByDocumentNo then begin @@ -399,8 +403,6 @@ report 11757 "Documentation for VAT CZL" "VAT Entry"."Non-Deductible VAT Amount" += VATEntry."Non-Deductible VAT Amount"; "VAT Entry"."Original VAT Base CZL" += VATEntry."Original VAT Base CZL"; "VAT Entry"."Original VAT Amount CZL" += VATEntry."Original VAT Amount CZL"; - "VAT Entry"."Original VAT Base ACY CZL" += VATEntry."Original VAT Base ACY CZL"; - "VAT Entry"."Original VAT Amount ACY CZL" += VATEntry."Original VAT Amount ACY CZL"; "VAT Entry".Modify(); end; until VATEntry.Next() = 0; @@ -609,15 +611,15 @@ report 11757 "Documentation for VAT CZL" begin VATBasePurchTotal[1] += VATEntry.Base; VATAmountPurchTotal[1] += VATEntry.Amount; - VATBasePurchTotal[2] += VATEntry.GetOriginalVATBaseCZL(); - VATAmountPurchTotal[2] += VATEntry.GetOriginalVATAmountCZL(); + VATBasePurchTotal[2] += VATEntry."Original VAT Base CZL"; + VATAmountPurchTotal[2] += VATEntry."Original VAT Amount CZL"; VATBasePurchTotal[3] += VATEntry.CalcDeductibleVATBaseCZL(); if VATEntry."VAT Calculation Type" = VATEntry."VAT Calculation Type"::"Reverse Charge VAT" then begin - VATBaseReverseChargeVATTotal[1] -= VATEntry.GetOriginalVATBaseCZL(); - VATAmountReverseChargeVATTotal[1] -= VATEntry.GetOriginalVATAmountCZL(); - VATBaseReverseChargeVATTotal[2] -= VATEntry.GetOriginalVATBaseCZL(); - VATAmountReverseChargeVATTotal[2] -= VATEntry.GetOriginalVATAmountCZL(); + VATBaseReverseChargeVATTotal[1] -= VATEntry."Original VAT Base CZL"; + VATAmountReverseChargeVATTotal[1] -= VATEntry."Original VAT Amount CZL"; + VATBaseReverseChargeVATTotal[2] -= VATEntry."Original VAT Base CZL"; + VATAmountReverseChargeVATTotal[2] -= VATEntry."Original VAT Amount CZL"; VATBaseReverseChargeVATTotal[3] -= VATEntry.CalcDeductibleVATBaseCZL(); end; end; @@ -625,8 +627,8 @@ report 11757 "Documentation for VAT CZL" begin VATBaseSaleTotal[1] += VATEntry.Base; VATAmountSaleTotal[1] += VATEntry.Amount; - VATBaseSaleTotal[2] += VATEntry.GetOriginalVATBaseCZL(); - VATAmountSaleTotal[2] += VATEntry.GetOriginalVATAmountCZL(); + VATBaseSaleTotal[2] += VATEntry."Original VAT Base CZL"; + VATAmountSaleTotal[2] += VATEntry."Original VAT Amount CZL"; VATBaseSaleTotal[3] += VATEntry.CalcDeductibleVATBaseCZL(); end; end; diff --git a/Apps/CZ/CoreLocalizationPack/app/Src/Reports/OpenCustEntriestoDateCZL.Report.al b/Apps/CZ/CoreLocalizationPack/app/Src/Reports/OpenCustEntriestoDateCZL.Report.al index b8919dae84..e6a41b5672 100644 --- a/Apps/CZ/CoreLocalizationPack/app/Src/Reports/OpenCustEntriestoDateCZL.Report.al +++ b/Apps/CZ/CoreLocalizationPack/app/Src/Reports/OpenCustEntriestoDateCZL.Report.al @@ -518,11 +518,10 @@ report 11715 "Open Cust. Entries to Date CZL" trigger OnPreDataItem() var lin: Integer; - LimitDateTok: Label '+<%1>', Locked = true; begin if not SkipBalance then for lin := 1 to 5 do - Days[lin] := (CalcDate(StrSubstNo(LimitDateTok, Format(LimitDate[lin])), Today()) - Today()); + Days[lin] := (CalcDate(LimitDate[lin], Today()) - Today()); end; } } diff --git a/Apps/CZ/CoreLocalizationPack/app/Src/TableExtensions/VATEntryCZL.TableExt.al b/Apps/CZ/CoreLocalizationPack/app/Src/TableExtensions/VATEntryCZL.TableExt.al index 2b4bbaa0c8..fd8cb2ec02 100644 --- a/Apps/CZ/CoreLocalizationPack/app/Src/TableExtensions/VATEntryCZL.TableExt.al +++ b/Apps/CZ/CoreLocalizationPack/app/Src/TableExtensions/VATEntryCZL.TableExt.al @@ -283,11 +283,7 @@ tableextension 11737 "VAT Entry CZL" extends "VAT Entry" end; procedure CalcDeductibleVATBaseCZL(): Decimal - var - GeneralLedgerSetup: Record "General Ledger Setup"; begin - if GeneralLedgerSetup.IsAdditionalCurrencyEnabledCZL() then - exit("Original VAT Base ACY CZL" + "Non-Deductible VAT Base ACY"); exit("Original VAT Base CZL" + "Non-Deductible VAT Amount"); end; @@ -311,20 +307,6 @@ tableextension 11737 "VAT Entry CZL" extends "VAT Entry" exit("Additional-Currency Amount" + "Non-Deductible VAT Amount ACY"); end; - internal procedure GetOriginalVATBaseCZL(): Decimal - var - GeneralLedgerSetup: Record "General Ledger Setup"; - begin - exit(GeneralLedgerSetup.IsAdditionalCurrencyEnabledCZL() ? "Original VAT Base ACY CZL" : "Original VAT Base CZL"); - end; - - internal procedure GetOriginalVATAmountCZL(): Decimal - var - GeneralLedgerSetup: Record "General Ledger Setup"; - begin - exit(GeneralLedgerSetup.IsAdditionalCurrencyEnabledCZL() ? "Original VAT Amount ACY CZL" : "Original VAT Amount CZL"); - end; - internal procedure GetAdditionalReportingCurrency(): Code[10] begin GeneralLedgerSetup.GetRecordOnce(); diff --git a/Apps/CZ/FixedAssetLocalization/app/Src/Codeunits/FADisposalHandlerCZF.Codeunit.al b/Apps/CZ/FixedAssetLocalization/app/Src/Codeunits/FADisposalHandlerCZF.Codeunit.al index f61769fbcb..eb08a78645 100644 --- a/Apps/CZ/FixedAssetLocalization/app/Src/Codeunits/FADisposalHandlerCZF.Codeunit.al +++ b/Apps/CZ/FixedAssetLocalization/app/Src/Codeunits/FADisposalHandlerCZF.Codeunit.al @@ -40,7 +40,8 @@ codeunit 31235 "FA Disposal Handler CZF" case FALedgerEntry."FA Posting Type" of FALedgerEntry."FA Posting Type"::"Acquisition Cost": GLAccNo := FAPostingGroup.GetAcquisitionCostAccount(); - FALedgerEntry."FA Posting Type"::Depreciation: + FALedgerEntry."FA Posting Type"::Depreciation, + FALedgerEntry."FA Posting Type"::"Bonus Depreciation": GLAccNo := FAPostingGroup.GetAccumDepreciationAccount(); FALedgerEntry."FA Posting Type"::"Write-Down": GLAccNo := FAPostingGroup.GetWriteDownAccount(); @@ -65,7 +66,8 @@ codeunit 31235 "FA Disposal Handler CZF" case FALedgerEntry."FA Posting Type" of FALedgerEntry."FA Posting Type"::"Acquisition Cost": GLAccNo := FAPostingGroup.GetAcquisitionCostAccountOnDisposal(); - FALedgerEntry."FA Posting Type"::Depreciation: + FALedgerEntry."FA Posting Type"::Depreciation, + FALedgerEntry."FA Posting Type"::"Bonus Depreciation": begin if FAPostingGroup.UseStandardDisposalCZF(FALedgerEntry."Reason Code") then FAPostingGroup.TestField("Accum. Depr. Acc. on Disposal"); @@ -926,14 +928,20 @@ codeunit 31235 "FA Disposal Handler CZF" local procedure OnGetBalAccAfterSaveGenJnlLineFields(FromGenJnlLine: Record "Gen. Journal Line"; var SkipInsert: Boolean; var sender: Codeunit "FA Insert G/L Account") var FAInsertGLAccHandlerCZF: Codeunit "FA Insert G/L Acc. Handler CZF"; + FAPostingGroupAccountType: Enum "FA Posting Group Account Type"; begin FAInsertGLAccHandlerCZF.SetReasonMaintenanceCode(FromGenJnlLine."Reason Code"); if FromGenJnlLine."FA Posting Type" = FromGenJnlLine."FA Posting Type"::Maintenance then FAInsertGLAccHandlerCZF.SetReasonMaintenanceCode(FromGenJnlLine."Maintenance Code"); + if FromGenJnlLine."FA Posting Type" = FromGenJnlLine."FA Posting Type"::"Bonus Depreciation" then + FAPostingGroupAccountType := "FA Posting Group Account Type"::Depreciation + else + FAPostingGroupAccountType := "FA Posting Group Account Type".FromInteger(FromGenJnlLine."FA Posting Type".AsInteger() - 1); + BindSubscription(FAInsertGLAccHandlerCZF); sender.InsertBufferBalAcc( - "FA Posting Group Account Type".FromInteger(FromGenJnlLine."FA Posting Type".AsInteger() - 1), -FromGenJnlLine.Amount, + FAPostingGroupAccountType, -FromGenJnlLine.Amount, FromGenJnlLine."Depreciation Book Code", FromGenJnlLine."Posting Group", FromGenJnlLine."Shortcut Dimension 1 Code", FromGenJnlLine."Shortcut Dimension 2 Code", FromGenJnlLine."Dimension Set ID", false, false); diff --git a/Apps/DE/ContosoCoffeeDemoDatasetDE/app/DemoData/Finance/2. Master data/CreateDEDataExportRecord.Codeunit.al b/Apps/DE/ContosoCoffeeDemoDatasetDE/app/DemoData/Finance/2. Master data/CreateDEDataExportRecord.Codeunit.al index c95f3443c5..c2e5e935d9 100644 --- a/Apps/DE/ContosoCoffeeDemoDatasetDE/app/DemoData/Finance/2. Master data/CreateDEDataExportRecord.Codeunit.al +++ b/Apps/DE/ContosoCoffeeDemoDatasetDE/app/DemoData/Finance/2. Master data/CreateDEDataExportRecord.Codeunit.al @@ -107,6 +107,7 @@ codeunit 11125 "Create DE Data Export Record" local procedure CreateDataExportRecordField() var + GLRegister: Record "G/L Register"; CreateDEDataExport: Codeunit "Create DE Data Export"; CreateDEDataExpRecType: Codeunit "Create DE Data Exp. Rec. Type"; ContosoDEDigitalAudit: Codeunit "Contoso DE Digital Audit"; @@ -376,7 +377,10 @@ codeunit 11125 "Create DE Data Export Record" ContosoDEDigitalAudit.InsertDataExportRecordField(CreateDEDataExport.GLAccountData(), CreateDEDataExpRecType.GLAccountData(), 90000, Database::"Detailed Vendor Ledg. Entry", 36, 100000, 0); ContosoDEDigitalAudit.InsertDataExportRecordField(CreateDEDataExport.GLAccountData(), CreateDEDataExpRecType.GLAccountData(), 100000, Database::"G/L Register", 2, 10000, 0); ContosoDEDigitalAudit.InsertDataExportRecordField(CreateDEDataExport.GLAccountData(), CreateDEDataExpRecType.GLAccountData(), 100000, Database::"G/L Register", 3, 20000, 0); - ContosoDEDigitalAudit.InsertDataExportRecordField(CreateDEDataExport.GLAccountData(), CreateDEDataExpRecType.GLAccountData(), 100000, Database::"G/L Register", 4, 30000, 0); + + //Not using FieldId directly as its a system field + ContosoDEDigitalAudit.InsertDataExportRecordField(CreateDEDataExport.GLAccountData(), CreateDEDataExpRecType.GLAccountData(), 100000, Database::"G/L Register", GLRegister.FieldNo(SystemCreatedAt), 30000, 0); + ContosoDEDigitalAudit.InsertDataExportRecordField(CreateDEDataExport.GLAccountData(), CreateDEDataExpRecType.GLAccountData(), 100000, Database::"G/L Register", 6, 40000, 0); ContosoDEDigitalAudit.InsertDataExportRecordField(CreateDEDataExport.GLAccountData(), CreateDEDataExpRecType.GLAccountData(), 110000, Database::"General Ledger Setup", 71, 10000, 0); ContosoDEDigitalAudit.InsertDataExportRecordField(CreateDEDataExport.GLAccountData(), CreateDEDataExpRecType.GLAccountData(), 120000, Database::"VAT Entry", 1, 10000, 0); diff --git a/Apps/DE/EDocumentDE/app/src/XRechnung/ExportXRechnungDocument.Codeunit.al b/Apps/DE/EDocumentDE/app/src/XRechnung/ExportXRechnungDocument.Codeunit.al index 8ccad4abd9..59f8b2dd05 100644 --- a/Apps/DE/EDocumentDE/app/src/XRechnung/ExportXRechnungDocument.Codeunit.al +++ b/Apps/DE/EDocumentDE/app/src/XRechnung/ExportXRechnungDocument.Codeunit.al @@ -1599,6 +1599,12 @@ codeunit 13916 "Export XRechnung Document" begin end; + /// + /// Allows subscribers to add additional filters on the Document Attachment record after the default filters are set. + /// + /// The table ID being filtered. + /// The document number being filtered. + /// The Document Attachment record to filter. [IntegrationEvent(false, false)] local procedure OnInsertAttachmentOnAfterSetFilters(TableNo: Integer; DocumentNo: Code[20]; var DocumentAttachment: Record "Document Attachment") begin diff --git a/Apps/DE/EDocumentDE/app/src/ZUGFeRD/ExportZUGFeRDDocument.Codeunit.al b/Apps/DE/EDocumentDE/app/src/ZUGFeRD/ExportZUGFeRDDocument.Codeunit.al index 55ba7f8931..41102bcbbc 100644 --- a/Apps/DE/EDocumentDE/app/src/ZUGFeRD/ExportZUGFeRDDocument.Codeunit.al +++ b/Apps/DE/EDocumentDE/app/src/ZUGFeRD/ExportZUGFeRDDocument.Codeunit.al @@ -146,7 +146,7 @@ codeunit 13917 "Export ZUGFeRD Document" DescriptionLbl: Label 'This is the e-invoicing xml document'; begin PDFDocument.Initialize(); - Name := 'factur-x.xml'; + Name := 'xrechnung.xml'; DataType := Enum::"PDF Attach. Data Relationship"::Alternative; MimeType := 'text/xml'; Description := DescriptionLbl; diff --git a/Apps/DE/EDocumentDE/app/src/ZUGFeRD/ImportZUGFeRDDocument.Codeunit.al b/Apps/DE/EDocumentDE/app/src/ZUGFeRD/ImportZUGFeRDDocument.Codeunit.al index e20c3bdcb8..8ca3875910 100644 --- a/Apps/DE/EDocumentDE/app/src/ZUGFeRD/ImportZUGFeRDDocument.Codeunit.al +++ b/Apps/DE/EDocumentDE/app/src/ZUGFeRD/ImportZUGFeRDDocument.Codeunit.al @@ -34,6 +34,7 @@ codeunit 13919 "Import ZUGFeRD Document" DocumentNamespace: Text; PDFInStream: InStream; PdfAttachmentStream: InStream; + BasicInfoParsed: Boolean; DocumentElementLbl: Label '%1:%2', Comment = '%1 = Namespace, %2 = Document', Locked = true; NoXMLFileErr: Label 'No invoice attachment found in the PDF file. Please check the PDF file.'; CrossIndustryInvoiceLbl: Label 'CrossIndustryInvoice', Locked = true; @@ -52,22 +53,25 @@ codeunit 13919 "Import ZUGFeRD Document" DocumentNamespace := GetNamespace(TempXMLBuffer); DocumentType := GetDocumentType(TempXMLBuffer, DocumentNamespace); - case UpperCase(DocumentType) of - '380', '384', '751', '877': - if DocumentNamespace <> '' then - ParseInvoiceBasicInfo(EDocument, TempXMLBuffer, StrSubstNo(DocumentElementLbl, DocumentNamespace, CrossIndustryInvoiceLbl), PdfInStream) - else - ParseInvoiceBasicInfo(EDocument, TempXMLBuffer, CrossIndustryInvoiceLbl, PdfInStream); - '381', '261': - if DocumentNamespace <> '' then - ParseCreditMemoBasicInfo(EDocument, TempXMLBuffer, StrSubstNo(DocumentElementLbl, DocumentNamespace, CrossIndustryInvoiceLbl), PdfInStream) - else - ParseCreditMemoBasicInfo(EDocument, TempXMLBuffer, CrossIndustryInvoiceLbl, PdfInStream) - else begin - FeatureTelemetry.LogUsage('0000EXE', FeatureNameTok, StrSubstNo(UnsupportedDocumentTypeErr, DocumentType)); - Error(UnsupportedDocumentTypeErr, DocumentType); + BasicInfoParsed := false; + OnParseBasicInfoOnBeforeDocumentTypeCheck(DocumentType, EDocument, TempXMLBuffer, DocumentNamespace, CrossIndustryInvoiceLbl, PdfInStream, BasicInfoParsed); + if not BasicInfoParsed then + case UpperCase(DocumentType) of + '380', '384', '751', '877': + if DocumentNamespace <> '' then + ParseInvoiceBasicInfo(EDocument, TempXMLBuffer, StrSubstNo(DocumentElementLbl, DocumentNamespace, CrossIndustryInvoiceLbl), PdfInStream) + else + ParseInvoiceBasicInfo(EDocument, TempXMLBuffer, CrossIndustryInvoiceLbl, PdfInStream); + '381', '261': + if DocumentNamespace <> '' then + ParseCreditMemoBasicInfo(EDocument, TempXMLBuffer, StrSubstNo(DocumentElementLbl, DocumentNamespace, CrossIndustryInvoiceLbl), PdfInStream) + else + ParseCreditMemoBasicInfo(EDocument, TempXMLBuffer, CrossIndustryInvoiceLbl, PdfInStream) + else begin + FeatureTelemetry.LogUsage('0000EXE', FeatureNameTok, StrSubstNo(UnsupportedDocumentTypeErr, DocumentType)); + Error(UnsupportedDocumentTypeErr, DocumentType); + end; end; - end; end; procedure ParseCompleteInfo(var EDocument: Record "E-Document"; var PurchaseHeader: Record "Purchase Header" temporary; var PurchaseLine: Record "Purchase Line" temporary; var TempBlob: Codeunit "Temp Blob") @@ -590,4 +594,9 @@ codeunit 13919 "Import ZUGFeRD Document" internal procedure OnAfterParseCreditMemo(EDocument: Record "E-Document"; var PurchaseHeader: Record "Purchase Header" temporary; var PurchaseLine: Record "Purchase Line" temporary; DocumentAttachment: Record "Document Attachment"; DocumentAttachmentData: Codeunit "Temp Blob"; TempXMLBuffer: Record "XML Buffer" temporary) begin end; + + [IntegrationEvent(false, false)] + internal procedure OnParseBasicInfoOnBeforeDocumentTypeCheck(var DocumentType: Text; var EDocument: Record "E-Document"; var TempXMLBuffer: Record "XML Buffer" temporary; DocumentNamespace: Text; CrossIndustryInvoiceLbl: Text; PdfInStream: InStream; var BasicInfoParsed: Boolean) + begin + end; } \ No newline at end of file diff --git a/Apps/DE/EDocumentDE/test/.resources/CRONUS.jpg b/Apps/DE/EDocumentDE/test/.resources/CRONUS.jpg deleted file mode 100644 index e562b8d54e54f410935b89d32ccdfb7110b27b18..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 15225 zcmeHtWk8f&*Y1#m!z}C_nE1JP0K(5@6|h;Z_O zruJ{l0H%$%cQ9_I0UrUFe+kxY3k&QF#dM;&)-3S+kV`392@TrJ~k%7?ce~vhk;89 zyhnz|3njm!Vtn7#myfxO0x2Zy_+0f3WjU3gR%A*^6Jli4g_`Do{|k!~eE5Z$Us{xg z*#oJ&r2qC8H&Xz@+wNeJVvz!#0vcNXn49X)Wei#9>_Rq7#TQ* zgrKhwq@5m?#!#zKg9uA3iyZ7dp6FaN9{G9>#ND2Nh=blbQ`2Sd#4Lu{B6lmgFFp28 z2dC1rKX0tP;Be|;10Khd8lO^7R<;4Tjq7F{YuZp(mfuJ8IKK#5SwbZW#C3KB#tLZz zi4SC;_O6!|Gi+>m6D@S?mdn{Tc1t=e77oAzE5A?OrSVVbObR;f%W?7Xsltq!`dGpp zha%f&rTM?RV-)2_V6fdwn9ie5l|$1}L98<>13{hJy{F_Nr~}p^SpprIy}`{*Hh#O2 z{k|fHt+wFx=hIX&uMHKjO!=Vd)FMfX!ah1{zB!iYK#&p`^V$D&j@!hh-xqXLv^=iT zox8}LCsdE@@1JN>@AcgqeXmM=oN}@OFMOH+EYn*PDKZIRXr}MLO2Kx-rl9JnIFG9h z#A@A#?DJ`9=^DA1c9b8L*M@tXRw1M4x%L-I_oztqP18AT$K#~5w0j2FiC*4o*D*<$LQgpVhCZ6Wr6PD4X7_RXm}H;nxrY6$hcETp>D+(H11 zIwPHf&nbicXW~-ZK%3sn8{ZGnI|fV4eQ#OD=rxG|U914kVkA1?n0 z?%PxpbwDI7%6*-ap@_6_2skM(EBgZLkws2wT4s}J z#B`_$4Q}6yP@l3BuWhH9!lMntE^myfvfkdszy{RV7;NfT&C2X(rY;N~b>^|rPcBBd z2~#EL5GRGvddcwj_c-4G+>r(wPCH9@8}l~qi6d`FY)ajiKf_+Fk&PcQS{7g@+CoMY z@LomHD~#U&-W0cY*~jJ*2&g77BT$)-U8^oJqWf@w@fv4cUZ0L9xdnv2GK-fgyilQh zLFb;F&N6r5ipnOXWNg*yKGH!heDmR!g3MM1y~UR!d7BI=;va=#IhLw5TI6{ zlguHZ>NTPZlyoA=ycUe%_rPHKn0ke^jGkP*grV!@f16&oWH*LK;Rr z*Ir)do8|-E4Kt0+SKO8NEJn*h9nu{*A_FHqU6#7&Ce~_-{Th?YYlWBtx!UrzS$Hov zYliten1CwuNmNo;bF>Fi*_asgFfj>~Cv)+8>?Vwn(T6D7Na!;4>=cc7cnlA8M?9QfEW&j3FUJeM3*)Um z+97$^ks|4EBS6RU!T{4}M6xB~b4a1V?EYpHaEq7ODzOU1>m;zRhd@U=0c zLZym;CKB|*JmQ~UMC2>JGafRBlPS#dF*Z=9JReP&p*U5;akbl;yWzRs?Fa29v zA(^>vQ$MIS%W--zQ!u8mmX)97?nw{CYIXB#^lN1pr4Rmhl_UoLAc8-v7vYY%SP5+_ zmD>917q{Td1mDAET6tu($^M3XNJCN!gEiH{V3H<#m%fk10ebRxe|fRZC3xj-TvV8q zLWZ~xAuDBC5_4W>)`viko8Fgdyy||Z+eY;22+RzB95igj z!fpE$7S~?A?_fer@O>Q&z(OMY0bwP`-pBc8pY`^w`BIWL^x+uI-_%>YSN=AK#d?$Pa7N2~9WkO>X-Q9HP0O`c$rAO1Im$EBK^OBQU&`srY* z8|rOKkn1;XR;-2r>0V~W&4?OZfIk}rO0?zMrG0BrhR3)C_Fj1$(*~o63R6<2X55eY z67!|O?T73n#Fh`Ujo}i{7MMf6p^~E9FyYu{HCfdjE2VvLd$^L(C{_7smud|S9_yKL zdFHsG4FJF|<+29kBv{in)uqm!Uny53X^k72mzpT&@$3ZHzLvBO(H`R zuVuhoBl~O(+246TofmivnWw0m@}{8V{#Ay`_$6ri;q=X~UF^{f^6c5enf{c5stV6) ztnVyS{{EVlBi&B+m`h3d~vl$p15H9 znU^WrQa}UsnVl(~5SRiSekhu3vLuI%K{OyET^ibIocgb_w5=X^rbo6CVZgr2isJ@7 z#ir3EnAcyO&SCNsySG1dQUptJKNb1NRBHR_SfMMMoy|t~>J9wb zGNR%Ue>^==X3@tlHvqxRPw7ye<&GxO2r=5@CY(Xz$wc-l;ngCp=AzMW4}?5I+A8%o z($_yN>(h@+ygn1Astd#DbKrEq2KkjSF=cb}d7aGmW%Qj5&sO}{9Ra1*Ol)o0sgIJF z=nCZL5L(anq8*7A;N=bDZt6+xz2U#|4QG=}lsIQE=Qt;3#kcyZrhT1z3N&{##*hLU z`zGHgrAKno4(Ynb4_7@H@$XQMWf@c@HmPeYOlW`w?NOhNF3sq}-8QC09B>*G-q^vpF;ahyzm9qGF93|{p_|bth6?t zKP6@5@oJY+ojezfd!Q!p>KwNuR)(4AQ-PzX`w(tR3 z3%Np)VP$ydT>AH3`cJ*rWt$CI-Dj+uXU;@T<(htO6PFS~boewnkG@m3dFA8d$GF$l zU*A<8AL~)B@g!i=qRk#sF*Q;3gf{pcO?t4@b`e!|@<-a<8$kYE&WF%%jMuLlYM$Ky zv}aX6(D6w~JmL5-n>=}pU65OCbYa_$a#J5iPwb9CqPZ`IP&eS4=Y*7lJ=!Hb%jxYlpYS0H$@7^+X<6p0t zdCaa~w3sNp;g|D4j@Y~>az%LdSzd=dnvUqT1I(&mOii_uevVW8pgK!swhhPUiF}i5gtNsHFKwNftD-k@pZcqY#krL`_MCO_1#m^N#l}emW$l zmj7wFs;stMPF5Jf`N!dNCT@1Jax(QLEA=DfcKr zA-s)Wo{=|RiOgXbV}GIwW478&dZGQ&(~!gR>Kjwb$?r1-Bk9~3En7)+ z?s%FX&26D}Wu|gJ3!;r-jj%^{LUG&_fo?G)UBdPYj@a)&4m5$W=NhlQILeP~%Sz?g za7%l_(W*17J7}rlQmE?j4FJx3jd#Bfg@%=y3)U#C&1zVnlxH8kDX184zI+#Cz-r8i zc!Z@l(oy`8E|e)NT)L==u)*4a)bhVif(+o6Xq{><@$aRL_6-A!;;ttvMxb$>)h4f?Bo)&uXOXU zID>bH1f;%uE6N`++PnuLr%JN=R%ln;?k@H*oPNgFSFZ^;ZCf#8PkB;NBUzuh4J(Rz z@xm_s)A4{n*uuCpg>gUZ(+QAfqat^@on4iHy05 zrZ1D$CDW_bzrf7{PFaYU%)6H?!J6fL5FTVSPDvR|46Y8Agw$ zA?6}7zL#1b{c&R|NSa}h*~O%RvX>}f=iJjAYFS}u6FoS~aUS>Dx{3l}G2eqXp=~~Xc|RaHwVgcr73ipS4>~qZs;e0N=oJm6_s&s~^1AxkYLED2 z7TSSb%->~UVIR*BaMKC#YSFxU-mHF7 zPE)Dex~5r;5)0MYXzwpeE1To;cDOWo$^&kq1I9j+JL3J&H=XQ$eGm7Bp!*qlTVvUf znG*}RqO-|)#w54<(vKXF?QdgCy>CC!zvmhI;aXpm==lxc8!%K%*^aSd{;fMnO-xbl zOTQ7Pvh4@s3nF%lD~b+fOM;Vo5J%}70G|n+w<6x@;sAS(iCwM8cL+51!J*xrNj=T! zwgbP_xrSaLf>iP)T6kno71G)w{i<1s#Strc|Dl$cmPl&=7nIXgKGo~zyr=CG=;vkR z8KG2uQp)NiMSn_KHef?vvAtC1Q~dO92dQ~-n5|S0Yx)z__$ZUl12xpWFe*O|$6-y0 zl-UL00EEOlZ0bCrqqZ%jyII-!#e^^iCjZ*q%rZ0zzjP4d)}?np!czWY%8iLKYW6iLb&-1!T@Lpo^K%j}5yh-DN@sqoQkJ4cZ%D}_iM8fpVqDR(BZFu)H>yhLH z>BL|5y%fy(gR9p{cI$aA=D(V%U@X-(gs@rs@U@InzQe^-A$X;TeZ;$1$~9}7NPxWP zW4KpYHO9dICJpP?RCMCZuw_bIs+Kj&uvp!`qvJ{Pz6Bmn%)!ZVIo+zX0)xlrCN=kp z>hLl%XWwFdwpqHCsrxxZEM+R~LV-NzmHPOEQ}9IbnHzwc>(ig@SH}V}k4TWoXScra z4t>juZE)>}NSq>P=E1fySOK!8t2T;E$zPtm!GveM`p`R?r$$;+gDR$Gqp7j{Gd7J3 z>-+;i1ox9Z)6(UNDeEUsEmBK#*y6jStt!$LI>9XS7Qgr{xetOaX3&@z*c2eY-q`n#U2DwlHRnSL)4GN1JPMv$ zblF5|FPP{%dFqJ~!eth204>ZxOCal{RAOto4to(-s99S{&-+;UvlqHJ^#gW+iXK~5 z49uZ^`hc-k$A{1eyn4p~Q#y~>7567QKy2M__#%xyXltJ<>u#)%68suS|Lc<_*C1uY(6YnTg+jc z2wy7OSiq~qhrM?N7%p|{3v~SSTghN)jCEXHR~>izWc;j5v9YN;JiXi9U^BOXcx!Xe z>h3k3_=hHFmG`t)g3*&bo%$RyJhe5LTVBOUoxbF&qX{R%#387I{p#}$`PUdXfH^gu zWHcD}?Is#jygt2MPVK6aR<_Yxv?DM7 z%(h~)#`P#p&QIRaEcC2L6~Yuq<2KgvfL|a zAIkf#1OR~3lc$9;catl3?0Of)ykwQ=wI0(_X{`8in2mU{Q(=I6=Aa&IlC3fC8)#?IsB)g}H zo?dHG#AKS<`sBLo1FNEmnSw-0q>RMP@Em2O0Z#FHJ?mU~qO`Vy&9WNK@h)}xg>h?o z#`ILQ0d4FMZrHVc);preh`%Ba{oj$t;A^26*E_PYr`*!+g}!BKySwlPCf_1U4v6HC zGIVRrGLKKl;LLgoWaIAR1J8Xw$=mt(?1Sx5{qwCFVguXH4zx#2u#`mYJE9KsCn{m1 z6fAJH6IsnmuG|V8iz#&VdB?LCi==LVWYSIndB80D}0WvwzHZhB_ONmfcR zsX`bh;?v`5&r^!bH-IH2;uG4Y8$f%I2!X=*@*9+{z3aO!TePQy9%Q`cBQa+Tew^E< z`!PapBHp zhtIS%LhcotQFVKc^S`fL(R^1@z&SOkMyW60lZd~8A!OZ+TH zU&*Czv~*fpvn6eT46={VOdNbc{fxOd!ZSkCGjY9oz%yj-NPb2!{YxuCDFbNJ%uiQH z5IJ2+r`~U!V~SZCMMk57Au3DWVN488^h=?C2DKG9Zqrc0Q72vx$Q0}$xaM>xw*2+n z@9ZzI^amo-tGB3ptBW$vO0%h_Zden{1(r!Og7|1r^#=4}mcGj^fmttUx3?$!cur1D zLRjZRzm=#zt6kwaeaTn9hg~n$@JNRyQbS}bix(pWbaK)TxI?N%C{wvB5j`$C8RjV zD2HBzT4mo(?cIp zKR0Z(bJ#bHkn0HdFT964dYcLDE88WvxSlDzoPesbaVm9N@5Vb`_qc7-zP!6|tLA^1 z_+P(GeE**|{=r{1p0a7}%eiIp`S94O)hO+5@|Qa5>rFwWIpKP%mvm~kJGWhI@{GSG zadrL%prz=ijAQ`)ODtQ}LjjX!;g^~;j?O@|9?+v9Ezi+djc~E&MDO2?Y{=i6s%e{d za*gX#@tUgnh|tu_Kl#izx?JR0oka5qRd?d2s?7v!u~_|5EU~CPmrk+;oh`QQ8aV6U z>KUJ36S9$7K?9$7nyE(!DvvakNsV-|dvUsRN-W}}?`Xw&L+xS$S{lBtxLtiHAur1# zRDh#+CroowMqdcor8k=l5|h>@S96d!@bvY!TksPS+)wK|?1{JmR934rdsZTYfHP0)TKbOA;d@#%^b614?jZB*DNAb9}{37bzcqZc+J$l9|76C|E^y>9|qh)Elt=)Kk>LdyLGOJq$cbN`6ffMkY)nsB1~&fdbk8$`G>8JKzl8|L(pM~ z=~SJ!%sf0pd}^QKz_xyPf?oF|FHu(8!9V@V08GT_e-CS@K-UE-iN_lLf-0v-LTjgw zgZ3Eel2hnG`(BO~KQ8MmvPCBR)XJS{N)m_SNBMQ?E@Msfye{5jrOODNq^S96!R4!% z{c(XH?m7$%90!l|>nRI~lk#hwa@-mVmVK$G?-ahAhjGV6;*S0a(nkIP(x!hQ$=v>k zYYuJzXMgE+Tg@_u!%pUbg1{|JTm0SksQZX^yu4zvi|e5ez%`0Ckm-2qx1sh*Soky2 zA>QzTgX{yJi4oM6Y8hB^l1zW@F6obX6%MvG3GmR*;mS>R>y*u5?T2AI37>VsbA=3h z)Ur7Mqv$sv<-PJ?u-;_;0L3{e0}6|^KBcLx!J_O#eB#7`|csfxe=3P9Cj@+CS##huS@0dJ)=|06A)^n?UN?12_4ZbDl_g( z>&mxC%$Z_)Ukr*IEseF@uwx2;H!a`-5Bs`_?xP=N3Sl$oqFWo z!k-g1C-R_WqyeTM?uv)Ye}Ycje&p{WIfvw-sbtL5pD0#oHm_Em@;{mw4>d3=>+U{k zCl*D?EIJ#x9W#x203&3WkTDT1z!KcC>xcHXxIcGdm}BwV2N23?d_(cWvB&b1CtZS- z$fnj2AHe+x++WTqxE;TDC}i>&GMoGA%4?ISM&X5(t(c0PAnF_So;h8CZtLkxR{8I@D_e5AP4o;kP;${pK8|_n;5o@m>w@B-J{; z9}N=Bgc?3EAJ5Vg)vF#C5DuY|eOu^Z2>|?Hl-vRNd@V?I+bF3CWS8dXw%YAyG*C}{t9d}l~e0H5!?a7d8-Z&t?3$Q>OSHYTxC^O+GfwZ z>agQRl%}o+&a74TX;E{Ar9>vYNeFcVO`34J1H=4*&!DAmW9k*OBTmZ0RmSChggtzR znzT&!j=Q+8^19tGhebfcDby1%QjASLi|x2Y;$kPvS~35o!;AvGz0JrGeF+qei4Kga z_SxR;+#?coz?i)RQC?{{RiQOdi@Jtt+6L=D(FzYkme#PA{w4jQX1K2NX{{D2WR~mB z7qq-{MiuW;n`4g0`@tSMf}eNmX7oBB=|XDRq8N<_caZfA7RwD$Oi! z8rn!zoo)dIA}MH#PrZsYW}oasZUA%v-+7irAHmsGdy@|YLCh< z0cXh}*(^^LW@XmFkhOW_MfF{F)hLn@zPJQ<~?#{m^-c=cUiqCP}qTSTd}lX`f+?*K!hS`&6Mw8>Okia$u# zyms{)Q6&vh4gMCTZ?%|~WrU@cUsfH;*bOfg8tH8yM53YoI|7`&_T^&{Lt}3t5%ppk z%%+j~o;hzK_~deM(=it&e1{sl=S}@{|Bd8@8qH~cc&DrN;RX<9@We7mP~tXuihsE` zfggH4`S@&tt0%_GX0dm6l3LhUvAoyku!P5442PehWRI!aiYlz7=IyU1tJbvaf<@(Bmo$Xq2-04Q z=xqIPzh>|Ptlef$9vtU|eDy+5Rob9*xzz>E#USl5yS91u60FU^=1SNFKQm=%V0scp z$(N6hK7O*Vc(wt-pS$jZ`Je);Y@Ge=7=VBXCK&Bl@Ha& zo(1?fr;fc{qc4o_u7JT2lrYol=SFCo zI>P48s}OoivMgs&49L+j%5s4d=i5UuV`H72mX^lG2w9ehfRfK9P%hY~L4a@+os6?} zabVUgqSQo4`0Gp$Q^Y*X1NUPoDpwFgj{eT5+RJvy#-mtZT>}kv{(oaIPMOM|K5D42 z?KtP0&$k2_zQe@CUpSV%LJoRvT3wb~5xI#e%l3b+KdE8er#BS3Pm~j35t@^WNpQ4bUGP)vVGHkd#_Z?dc-sDw zVE2Nr*JtbOM(MRG&#|5RASCxfb3#)}Vru;!`1Wx*I$&7#!3@Uh!bnUSVR|FkOlKfv z6R*BGqVmZeib>+-)w7@G0m3tv?vGiB^KvxwJUMz5K2 zFI5)mhk4gOIz?gA><^Zf&*Ip3Lc1+ED|ICtJ!w=VRdD1pOjzGiC*|96dWQkRI2}eo zKVA9ruS4c79zEiy7I3dO=GS@H%)M_0whwm3K@PxbAEy+e+!eV-LcY$mk~LufHTqzm z$*&#e$Qk~fb9tB%{1ypz2&ClL_EmL`M&OOccCwiLih3A zhE>djK3Q=(4+B`t=oM@zQlAOKE_lo0(M48-k{8N0C96F_nr{*~mNX~_QHk&Cmz^3a z?!GrBJoaJ$GCceksaC$MxK4aRo`ZdNtGz>;;YFxvs*or=clMH}8(7+vvxYE2Gc2w3 zwTyIo;oVmyY$y?YJUzE=A{7~aU`zfhvM3=TvJJpR-!XXZRJI6x+xgq~{fjW~tLlp_ zNyzM;N`WKAPHg8s_2;!ZeND4ouNXhtpvM?Vd?Y{=BO%T2*%F5qfJDw-$ITFh^|Ct@ zG?&U+SB+HnCl^|9rxj%ZrACJalF6j@efysDOrbFcsY@_`u4Q|gOUpxoiA_nSuENv< z#KN}cI^E{Du15iF>{5y8V5iM@wT6#z^tX0(-E)anDK*NvRG6@8;-rN)50Wo=8|K&n zH-J5X2Jun4sQ*k`6Fbg`zsjsfyZ9%Y)I9Y)*si^u)amq>uj`AC`=*08HYt zYm28=@2rBSg4i}TSMu`mB8!KIn_E~AUH6DgsK?=Y>twfwQVyhog)vP&n*d1=a-t}IyvFLkP@s}hRPlGpS#k~PIL$& za6gibVc;%K+n>4ldRALqrpqv8#VHZT{RRhKzrjHe{{!YxsVgG~N$F2^Yg*=&jRJ5q zxIa}+iU{w_a@BJQT-W!@$M2qoOXZk`Dd~uOolv_pxrfdMjXd^8%bs0X3PR7Ygq6!H zWux~E4*Ug;g?BmD`RdjvdmlFE)S^c@3hw9D;D8u!s? z&4QxR(elYm9lGw}&J&N6bkBhB>?n}16|?2K!;>BZI&mFN!D*u0Nt3dn4m+fF&b^d! z-9=hy9EgBzF!filxOM@IEodjxV$sEQ5?i^3w*4sSjBUBkotzak($P9@0c!2LgeUru zv@|dMr>ah+yewk&k;TlCB=a}ILW_q>pG0&gC)+Y`otr9-?@mv@kD^|sOLKwZRxFBr zjE3N#jxG=uxPEHM0E`)s+sD670shsXzH+L_vv>PIA5Ss!UNhuTX{Y>BKu)^6(mncm zPJzRi9_%=<$TCdvJ7fq)VXrc3XDu~zxpX>&z;XqaM9dq*yUQCkr>SSj{DEiB!bNy* z&0|UVh39^3mZql2PqwqZ*oixd14K%a= z4Aari-^<9d^YLvOQEdOxQ4Cf#+j-F=luH<#`oPeZii7xDhqjg7xy57p@$HTnv9}|# zt_ePy+xKwbHc2rI<3<`4JAqF7r=H)uD|^5S5(S?HuUFo4{cXR?;~;3MB2!zxespOQZeW`fT4bn}Px}vDeH8_hW;25?qFGJZ}KV zx!dG7=|RJ;-iKzUFJ3IplvT45`$SaBrjubp@5)DX^0L7%Y#>Q8+_^^9dg4~@)5#;@ zNcfoYZ@lz;_i97lFwC(*ROTt{WW`MSvlQ}FToo1 zNGoZ<9?=hH#FT|`TMQ5ZQ+TX?9oFcRVsfBt5CCvK`Q++9}quB{p>JQiqomlCF zJ>ZvKLoapbu8~O;r6PGF)rg1kZAeD^5?9EoZ?T%QOUY2Z%jlfiM?*)B)E1-6c1{fn zN{87#<@e!nj%+Y-JTqF1#;xag3cp4?2YyQ5a$n_+Hvl}inX}fAf#=8*&uFu6<{Cx~ zD)afcBMJ(Z5GhSLtK_7FU*e?1`uCZA(dtyUSy%Yu)4<|tMwNI4h02S%rD>Du7a!7U zL@Tz;LDV^^*`d8Z@K)S-`H6%r;DrrS_8tvE7lvnrPZvREeIJizXC<=cI2&fH`(1)( z3fx1-qEC?mQZ<`oCHXLUlfy?}XT1uKKzebQ#6{m0UuP~ZYrT3ZSfaY}b!>|pf7LSI zUcep@2x)}Vca$`W6j>5m`@m$FC@5BI6V=f{dDdLhG;yk9(`H-cl6t98TO3;(r$h}C0G9yuimv+??Qsm?|gt2J3w)?IL@vBafi8}`{m5<7uQZbb;wd~Y0~ z&xk~68Ft4!JKLNzgHHE(#UlgZjkTBUj`Xa|a01!x;&-|M=#?v2$ncQKNi4^k28QBc zN$P;G&~geV)y5%ug)@`4JPYGzuGkbww@cLb&n5EfxKgkeI%LHEHP-R-KEY5MC;w|+ z8@o0&<_FoOQ`s92<2XGSE-h%tzt27sC7YE>!G+A%g|wmqr+=KC^X6Ag7qnND;h7PO8WKibST zI%repcGwxM^EulP14-po#_ns5f0756lj*%duWVUxRpbVUJ-Z`bkhcy-c`DGJGi|Ha zk)Nt*bNdtb7`|Q@-m~lzAR6?3KT?9aEQdxN+H>0F^3gEgeP!3@54~r9-M6*>>VVdL zOWO`oMEj1w<&^3B6?9e0cX>=8)@!NvF>ESG#hE{w4 diff --git a/Apps/DE/EDocumentDE/test/.resources/d365businesscentral.bmp b/Apps/DE/EDocumentDE/test/.resources/d365businesscentral.bmp deleted file mode 100644 index 2f6e69fd2923fd0f9789eb657feeb5cd7777c22d..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 9354 zcmeH}e@qi+9L6yUw18OX6$(QjgDL3T1a#BsHgtb%)9BEVg&7u65uMY_xoo^kh zbtPC9ocY(Jn3x!8N=nKM+T2P?O2lt_3`~wl%#R*<*>;-pXh*mf91t8391t8391t83 z91t9MCJq#(OpPnpC}t0?7h7}IiiWcjMeLpgQS37r+{uF|wtA%>`P>7CQaq5iUQDQd zWF?BQ_fruv;@#4n{Q0LEzI3}+?6Ga0q5`+4Wy$Nn)PrMt7l09Bn zhVt#6EY*+VEgpo|pT9vw4kU>QuRm)IWmxS>^6B|vHuFL`TAJt_INhu1J=$65(S^pzebFGvta0c1>H44HvOH)<ZLs#-T}E_&E+K|H@51!^B4WO| zfS7N@5VK`2OorLecZ8#fW}rDOC)zUsXf5+YizN!}=14n(BL}rVF;fOUhY<#=6C{rs zQe#aY)(&li_U>}<40@V{iDqH`Z6Pc-=7VRr))N8tXMgma4QLFhag0L`x-qIEEu zGDQ5xV9P-r0LutN*9n>P_1{0nYOTA8b|{(j+*^*`KbC-JFy2~385Y1Y_y%-ck!Y(7 zguX5W#`+L&s_D@6$Ai1Qf-=OQ-4a1KLpbTvh7!ko;B%n04$Z0=Xgc>YI-4V*)6w?_8fQyK8Mpg{ZK*o`={vs`P`1FsQ%s?mv&Dhjk!K( zE0&_Cl0kp1^K1NZTF1KQs3pyCI?9tgaXeX!)7z&)`Q0>J$nZsdjxW@QrKGEZfnMpy zuQg6zW5&`t)_n&-0Fp@Z@i&Om5}P)Qo4U*&{W8fwo(S%DTYkM8abZM@t#$eElaEX(hFz4^(M+x z34Y1&K~1IGXDcg|m{JrIq>J{D-91t8391t8391t839QZ#u F@Go?jtt0>d diff --git a/Apps/DE/EDocumentDE/test/app.json b/Apps/DE/EDocumentDE/test/app.json index 14374e709e..8c60e454b8 100644 --- a/Apps/DE/EDocumentDE/test/app.json +++ b/Apps/DE/EDocumentDE/test/app.json @@ -70,8 +70,5 @@ "allowDownloadingSource": true, "includeSourceInSymbolFile": true }, - "resourceFolders": [ - ".resources" - ], "application": "29.0.0.0" } diff --git a/Apps/DE/EDocumentDE/test/src/XRechnungXMLDocumentTests.Codeunit.al b/Apps/DE/EDocumentDE/test/src/XRechnungXMLDocumentTests.Codeunit.al index 3b41cbbe89..15f7228733 100644 --- a/Apps/DE/EDocumentDE/test/src/XRechnungXMLDocumentTests.Codeunit.al +++ b/Apps/DE/EDocumentDE/test/src/XRechnungXMLDocumentTests.Codeunit.al @@ -1394,7 +1394,6 @@ codeunit 13918 "XRechnung XML Document Tests" end; #endregion - #region DocumentAttachmentFiltering [Test] procedure ExportPostedSalesInvoiceInXRechnungFormatVerifyUnsupportedAttachmentIsSkipped(); var @@ -1422,39 +1421,6 @@ codeunit 13918 "XRechnung XML Document Tests" VerifyCSVAttachmentInXML(TempXMLBuffer, 'data.csv', 'text/csv', CSVText); end; - [Test] - procedure ExportPostedSalesInvoiceInXRechnungFormatVerifyUnsupportedImageExtensionIsSkipped(); - var - DocumentAttachment: Record "Document Attachment"; - SalesInvoiceHeader: Record "Sales Invoice Header"; - TempXMLBuffer: Record "XML Buffer" temporary; - Base64Convert: Codeunit "Base64 Convert"; - TempBlob: Codeunit "Temp Blob"; - RecRef: RecordRef; - begin - // [SCENARIO] Image attachments with unsupported extensions (e.g. bmp) are skipped; supported ones (jpg) are exported - Initialize(); - - // [GIVEN] Create and Post Sales Invoice - SalesInvoiceHeader.Get(CreateAndPostSalesDocument("Sales Document Type"::Invoice, "Sales Line Type"::Item, false)); - RecRef.GetTable(SalesInvoiceHeader); - - // [GIVEN] Create one unsupported BMP image and one supported JGP image attachment - LoadFileFromResourceFolders('d365businesscentral.bmp', TempBlob); - DocumentAttachment.SaveAttachment(RecRef, 'd365businesscentral.bmp', TempBlob); - LoadFileFromResourceFolders('CRONUS.jpg', TempBlob); - Clear(DocumentAttachment); - DocumentAttachment.SaveAttachment(RecRef, 'CRONUS.jpg', TempBlob); - - // [WHEN] Export XRechnung Electronic Document - ExportInvoice(SalesInvoiceHeader, TempXMLBuffer); - - // [THEN] Only the JPG attachment (supported) is present; BMP is skipped - VerifyAdditionalDocumentReferenceCount(TempXMLBuffer, 1); - VerifyAttachmentInXML(TempXMLBuffer, 'CRONUS.jpg', 'image/jpeg', ''); - end; - #endregion - local procedure CreateAndPostSalesDocument(DocumentType: Enum "Sales Document Type"; LineType: Enum "Sales Line Type"; InvoiceDiscount: Boolean): Code[20]; var SalesHeader: Record "Sales Header"; @@ -2497,20 +2463,19 @@ codeunit 13918 "XRechnung XML Document Tests" Assert.AreEqual(ExpectedCount, TempXMLBuffer.Count, 'Incorrect number of AdditionalDocumentReference nodes'); end; - local procedure VerifyCSVAttachmentInXML(var TempXMLBuffer: Record "XML Buffer" temporary; AttachmentID: Text; ExpectedMIMEType: Text; ExpectedCSVText: Text) var Base64Convert: Codeunit "Base64 Convert"; Base64EncodedContent: Text; begin Base64EncodedContent := Base64Convert.ToBase64(ExpectedCSVText); + VerifyAttachmentInXML(TempXMLBuffer, AttachmentID, ExpectedMIMEType, Base64EncodedContent); end; local procedure VerifyAttachmentInXML(var TempXMLBuffer: Record "XML Buffer" temporary; AttachmentID: Text; ExpectedMIMEType: Text; ExpectedBase64Content: Text) var TempXMLBufferAttachment: Record "XML Buffer" temporary; TempXMLBufferChild: Record "XML Buffer" temporary; - DecodedText: Text; EncodedContent: Text; ExpectedDescription: Text; AttachmentEntryNo: Integer; @@ -2846,17 +2811,6 @@ codeunit 13918 "XRechnung XML Document Tests" DocumentAttachment.SaveAttachment(RecRef, FileName, TempBlob); end; - local procedure LoadFileFromResourceFolders(FilePath: Text; var TempBlob: Codeunit "Temp Blob") - var - ImageOutStream: OutStream; - FileInStream: InStream; - begin - Clear(TempBlob); - NavApp.GetResource(FilePath, FileInStream); - ImageOutStream := TempBlob.CreateOutStream(); - CopyStream(ImageOutStream, FileInStream); - end; - local procedure GetCurrencyCode(DocumentCurrencyCode: Code[10]; var Currency: Record Currency): Code[10] begin if DocumentCurrencyCode = '' then begin diff --git a/Apps/FR/PaymentManagementFR/test/src/RegularTests/ERMPaymentManagementII.Codeunit.al b/Apps/FR/PaymentManagementFR/test/src/RegularTests/ERMPaymentManagementII.Codeunit.al index 75feb99251..42d7019108 100644 --- a/Apps/FR/PaymentManagementFR/test/src/RegularTests/ERMPaymentManagementII.Codeunit.al +++ b/Apps/FR/PaymentManagementFR/test/src/RegularTests/ERMPaymentManagementII.Codeunit.al @@ -417,6 +417,7 @@ codeunit 144017 "ERM Payment Management II" PaymentClassCode: Text[30]; SummarizePer: Option " ",Vendor,"Due date"; begin + // [FEATURE] [AI TEST] // [SCENARIO 623072] Blocked vendor with Blocked = Payment is excluded from Suggest Vendor Payments report. // [GIVEN] A vendor with a posted purchase invoice, then set as Blocked = Payment. diff --git a/Apps/GB/IdealPostcodes/app/ext/IPCBankAccountCard.PageExt.al b/Apps/GB/IdealPostcodes/app/ext/IPCBankAccountCard.PageExt.al index ec6f21dfc7..9dd5628985 100644 --- a/Apps/GB/IdealPostcodes/app/ext/IPCBankAccountCard.PageExt.al +++ b/Apps/GB/IdealPostcodes/app/ext/IPCBankAccountCard.PageExt.al @@ -10,6 +10,7 @@ pageextension 9402 "IPC Bank Account Card" extends "Bank Account Card" { trigger OnBeforeValidate() begin + HandleAddressLookupVisibility(); IPCAddressLookupHelper.NotifyUserAboutAddressProviderCapabilities(); end; } @@ -17,7 +18,9 @@ pageextension 9402 "IPC Bank Account Card" extends "Bank Account Card" { trigger OnBeforeValidate() begin + HandleAddressLookupVisibility(); IPCAddressLookupHelper.NotifyUserAboutAddressProviderCapabilities(); + ShowPostcodeLookup(true); end; } modify("Country/Region Code") @@ -89,6 +92,8 @@ pageextension 9402 "IPC Bank Account Card" extends "Bank Account Card" BankAccount: Record "Bank Account"; RecRef: RecordRef; begin + if Rec."Post Code" = '' then + exit; if not IPCAddressLookupHelper.ConfiguredAndSupportedForRecord(Rec."Country/Region Code") then exit; diff --git a/Apps/GB/IdealPostcodes/app/ext/IPCCompanyInformation.PageExt.al b/Apps/GB/IdealPostcodes/app/ext/IPCCompanyInformation.PageExt.al index 42d5556063..0652c247e9 100644 --- a/Apps/GB/IdealPostcodes/app/ext/IPCCompanyInformation.PageExt.al +++ b/Apps/GB/IdealPostcodes/app/ext/IPCCompanyInformation.PageExt.al @@ -10,6 +10,7 @@ pageextension 9403 "IPC Company Information" extends "Company Information" { trigger OnBeforeValidate() begin + HandleAddressLookupVisibility(); IPCAddressLookupHelper.NotifyUserAboutAddressProviderCapabilities(); end; } @@ -17,6 +18,7 @@ pageextension 9403 "IPC Company Information" extends "Company Information" { trigger OnBeforeValidate() begin + HandleAddressLookupVisibility(); IPCAddressLookupHelper.NotifyUserAboutAddressProviderCapabilities(); ShowPostcodeLookupForAddress(false); end; @@ -145,6 +147,8 @@ pageextension 9403 "IPC Company Information" extends "Company Information" CompanyInformation: Record "Company Information"; RecRef: RecordRef; begin + if Rec."Post Code" = '' then + exit; if not IPCAddressLookupHelper.ConfiguredAndSupportedForRecord(Rec."Country/Region Code") then exit; @@ -164,6 +168,8 @@ pageextension 9403 "IPC Company Information" extends "Company Information" var RecRef: RecordRef; begin + if Rec."Ship-to Post Code" = '' then + exit; if not IPCAddressLookupHelper.ConfiguredAndSupportedForRecord(Rec."Ship-to Country/Region Code") then exit; CurrPage.SaveRecord(); diff --git a/Apps/GB/IdealPostcodes/app/ext/IPCContactAltAddressCard.PageExt.al b/Apps/GB/IdealPostcodes/app/ext/IPCContactAltAddressCard.PageExt.al index 69c1346e35..b1917877c5 100644 --- a/Apps/GB/IdealPostcodes/app/ext/IPCContactAltAddressCard.PageExt.al +++ b/Apps/GB/IdealPostcodes/app/ext/IPCContactAltAddressCard.PageExt.al @@ -10,6 +10,7 @@ pageextension 9404 "IPC Contact Alt. Address Card" extends "Contact Alt. Address { trigger OnBeforeValidate() begin + HandleAddressLookupVisibility(); IPCAddressLookupHelper.NotifyUserAboutAddressProviderCapabilities(); end; } @@ -17,7 +18,9 @@ pageextension 9404 "IPC Contact Alt. Address Card" extends "Contact Alt. Address { trigger OnBeforeValidate() begin + HandleAddressLookupVisibility(); IPCAddressLookupHelper.NotifyUserAboutAddressProviderCapabilities(); + ShowPostcodeLookup(true); end; } modify("Country/Region Code") @@ -89,6 +92,8 @@ pageextension 9404 "IPC Contact Alt. Address Card" extends "Contact Alt. Address ContactAltAddress: Record "Contact Alt. Address"; RecRef: RecordRef; begin + if Rec."Post Code" = '' then + exit; if not IPCAddressLookupHelper.ConfiguredAndSupportedForRecord(Rec."Country/Region Code") then exit; diff --git a/Apps/GB/IdealPostcodes/app/ext/IPCContactCard.PageExt.al b/Apps/GB/IdealPostcodes/app/ext/IPCContactCard.PageExt.al index 81ec1d9f56..6f953af4ca 100644 --- a/Apps/GB/IdealPostcodes/app/ext/IPCContactCard.PageExt.al +++ b/Apps/GB/IdealPostcodes/app/ext/IPCContactCard.PageExt.al @@ -10,6 +10,7 @@ pageextension 9405 "IPC Contact Card" extends "Contact Card" { trigger OnBeforeValidate() begin + HandleAddressLookupVisibility(); IPCAddressLookupHelper.NotifyUserAboutAddressProviderCapabilities(); end; } @@ -17,7 +18,9 @@ pageextension 9405 "IPC Contact Card" extends "Contact Card" { trigger OnBeforeValidate() begin + HandleAddressLookupVisibility(); IPCAddressLookupHelper.NotifyUserAboutAddressProviderCapabilities(); + ShowPostcodeLookup(true); end; } modify("Country/Region Code") @@ -89,6 +92,8 @@ pageextension 9405 "IPC Contact Card" extends "Contact Card" Contact: Record Contact; RecRef: RecordRef; begin + if Rec."Post Code" = '' then + exit; if not IPCAddressLookupHelper.ConfiguredAndSupportedForRecord(Rec."Country/Region Code") then exit; diff --git a/Apps/GB/IdealPostcodes/app/ext/IPCCustomerBankAccountCard.PageExt.al b/Apps/GB/IdealPostcodes/app/ext/IPCCustomerBankAccountCard.PageExt.al index de9eb20ed8..771b9c6562 100644 --- a/Apps/GB/IdealPostcodes/app/ext/IPCCustomerBankAccountCard.PageExt.al +++ b/Apps/GB/IdealPostcodes/app/ext/IPCCustomerBankAccountCard.PageExt.al @@ -10,6 +10,7 @@ pageextension 9406 "IPC Customer Bank Account Card" extends "Customer Bank Accou { trigger OnBeforeValidate() begin + HandleAddressLookupVisibility(); IPCAddressLookupHelper.NotifyUserAboutAddressProviderCapabilities(); end; } @@ -17,7 +18,9 @@ pageextension 9406 "IPC Customer Bank Account Card" extends "Customer Bank Accou { trigger OnBeforeValidate() begin + HandleAddressLookupVisibility(); IPCAddressLookupHelper.NotifyUserAboutAddressProviderCapabilities(); + ShowPostcodeLookup(true); end; } modify("Country/Region Code") @@ -90,6 +93,8 @@ pageextension 9406 "IPC Customer Bank Account Card" extends "Customer Bank Accou CustomerBankAccount: Record "Customer Bank Account"; RecRef: RecordRef; begin + if Rec."Post Code" = '' then + exit; if not IPCAddressLookupHelper.ConfiguredAndSupportedForRecord(Rec."Country/Region Code") then exit; diff --git a/Apps/GB/IdealPostcodes/app/ext/IPCCustomerCard.PageExt.al b/Apps/GB/IdealPostcodes/app/ext/IPCCustomerCard.PageExt.al index ca4afd55a4..f7d4f60230 100644 --- a/Apps/GB/IdealPostcodes/app/ext/IPCCustomerCard.PageExt.al +++ b/Apps/GB/IdealPostcodes/app/ext/IPCCustomerCard.PageExt.al @@ -10,6 +10,7 @@ pageextension 9407 "IPC Customer Card" extends "Customer Card" { trigger OnBeforeValidate() begin + HandleAddressLookupVisibility(); IPCAddressLookupHelper.NotifyUserAboutAddressProviderCapabilities(); end; } @@ -17,7 +18,9 @@ pageextension 9407 "IPC Customer Card" extends "Customer Card" { trigger OnBeforeValidate() begin + HandleAddressLookupVisibility(); IPCAddressLookupHelper.NotifyUserAboutAddressProviderCapabilities(); + ShowPostcodeLookup(true); end; } modify("Country/Region Code") @@ -88,6 +91,8 @@ pageextension 9407 "IPC Customer Card" extends "Customer Card" Customer: Record Customer; RecRef: RecordRef; begin + if Rec."Post Code" = '' then + exit; if not IPCAddressLookupHelper.ConfiguredAndSupportedForRecord(Rec."Country/Region Code") then exit; diff --git a/Apps/GB/IdealPostcodes/app/ext/IPCEmployeeCard.PageExt.al b/Apps/GB/IdealPostcodes/app/ext/IPCEmployeeCard.PageExt.al index 8766e4c505..c270e8aa5a 100644 --- a/Apps/GB/IdealPostcodes/app/ext/IPCEmployeeCard.PageExt.al +++ b/Apps/GB/IdealPostcodes/app/ext/IPCEmployeeCard.PageExt.al @@ -10,6 +10,7 @@ pageextension 9408 "IPC Employee Card" extends "Employee Card" { trigger OnBeforeValidate() begin + HandleAddressLookupVisibility(); IPCAddressLookupHelper.NotifyUserAboutAddressProviderCapabilities(); end; } @@ -17,7 +18,9 @@ pageextension 9408 "IPC Employee Card" extends "Employee Card" { trigger OnBeforeValidate() begin + HandleAddressLookupVisibility(); IPCAddressLookupHelper.NotifyUserAboutAddressProviderCapabilities(); + ShowPostcodeLookup(true); end; } modify("Country/Region Code") @@ -88,6 +91,8 @@ pageextension 9408 "IPC Employee Card" extends "Employee Card" Employee: Record Employee; RecRef: RecordRef; begin + if Rec."Post Code" = '' then + exit; if not IPCAddressLookupHelper.ConfiguredAndSupportedForRecord(Rec."Country/Region Code") then exit; diff --git a/Apps/GB/IdealPostcodes/app/ext/IPCLocationCard.PageExt.al b/Apps/GB/IdealPostcodes/app/ext/IPCLocationCard.PageExt.al index 33fb481a66..85951dfed0 100644 --- a/Apps/GB/IdealPostcodes/app/ext/IPCLocationCard.PageExt.al +++ b/Apps/GB/IdealPostcodes/app/ext/IPCLocationCard.PageExt.al @@ -10,6 +10,7 @@ pageextension 9409 "IPC Location Card" extends "Location Card" { trigger OnBeforeValidate() begin + HandleAddressLookupVisibility(); IPCAddressLookupHelper.NotifyUserAboutAddressProviderCapabilities(); end; } @@ -17,7 +18,9 @@ pageextension 9409 "IPC Location Card" extends "Location Card" { trigger OnBeforeValidate() begin + HandleAddressLookupVisibility(); IPCAddressLookupHelper.NotifyUserAboutAddressProviderCapabilities(); + ShowPostcodeLookup(true); end; } modify("Country/Region Code") @@ -89,6 +92,8 @@ pageextension 9409 "IPC Location Card" extends "Location Card" Location: Record Location; RecRef: RecordRef; begin + if Rec."Post Code" = '' then + exit; if not IPCAddressLookupHelper.ConfiguredAndSupportedForRecord(Rec."Country/Region Code") then exit; diff --git a/Apps/GB/IdealPostcodes/app/ext/IPCResourceCard.PageExt.al b/Apps/GB/IdealPostcodes/app/ext/IPCResourceCard.PageExt.al index a240fc62d9..4a8041ca42 100644 --- a/Apps/GB/IdealPostcodes/app/ext/IPCResourceCard.PageExt.al +++ b/Apps/GB/IdealPostcodes/app/ext/IPCResourceCard.PageExt.al @@ -10,6 +10,7 @@ pageextension 9410 "IPC Resource Card" extends "Resource Card" { trigger OnBeforeValidate() begin + HandleAddressLookupVisibility(); IPCAddressLookupHelper.NotifyUserAboutAddressProviderCapabilities(); end; } @@ -17,7 +18,9 @@ pageextension 9410 "IPC Resource Card" extends "Resource Card" { trigger OnBeforeValidate() begin + HandleAddressLookupVisibility(); IPCAddressLookupHelper.NotifyUserAboutAddressProviderCapabilities(); + ShowPostcodeLookup(true); end; } modify("Country/Region Code") @@ -88,6 +91,8 @@ pageextension 9410 "IPC Resource Card" extends "Resource Card" Resource: Record Resource; RecRef: RecordRef; begin + if Rec."Post Code" = '' then + exit; if not IPCAddressLookupHelper.ConfiguredAndSupportedForRecord(Rec."Country/Region Code") then exit; diff --git a/Apps/GB/IdealPostcodes/app/ext/IPCShipToAddress.PageExt.al b/Apps/GB/IdealPostcodes/app/ext/IPCShipToAddress.PageExt.al index 4f8fa3dddd..7fa829d0b7 100644 --- a/Apps/GB/IdealPostcodes/app/ext/IPCShipToAddress.PageExt.al +++ b/Apps/GB/IdealPostcodes/app/ext/IPCShipToAddress.PageExt.al @@ -10,6 +10,7 @@ pageextension 9411 "IPC Ship-to Address" extends "Ship-to Address" { trigger OnBeforeValidate() begin + HandleAddressLookupVisibility(); IPCAddressLookupHelper.NotifyUserAboutAddressProviderCapabilities(); end; } @@ -17,7 +18,9 @@ pageextension 9411 "IPC Ship-to Address" extends "Ship-to Address" { trigger OnBeforeValidate() begin + HandleAddressLookupVisibility(); IPCAddressLookupHelper.NotifyUserAboutAddressProviderCapabilities(); + ShowPostcodeLookup(true); end; } modify("Country/Region Code") @@ -88,6 +91,8 @@ pageextension 9411 "IPC Ship-to Address" extends "Ship-to Address" ShipToAddress: Record "Ship-to Address"; RecRef: RecordRef; begin + if Rec."Post Code" = '' then + exit; if not IPCAddressLookupHelper.ConfiguredAndSupportedForRecord(Rec."Country/Region Code") then exit; diff --git a/Apps/GB/IdealPostcodes/app/ext/IPCVendorCard.PageExt.al b/Apps/GB/IdealPostcodes/app/ext/IPCVendorCard.PageExt.al index 9d16acbc1a..bf7f384510 100644 --- a/Apps/GB/IdealPostcodes/app/ext/IPCVendorCard.PageExt.al +++ b/Apps/GB/IdealPostcodes/app/ext/IPCVendorCard.PageExt.al @@ -10,6 +10,7 @@ pageextension 9401 "IPC Vendor Card" extends "Vendor Card" { trigger OnBeforeValidate() begin + HandleAddressLookupVisibility(); IPCAddressLookupHelper.NotifyUserAboutAddressProviderCapabilities(); end; } @@ -17,7 +18,9 @@ pageextension 9401 "IPC Vendor Card" extends "Vendor Card" { trigger OnBeforeValidate() begin + HandleAddressLookupVisibility(); IPCAddressLookupHelper.NotifyUserAboutAddressProviderCapabilities(); + ShowPostcodeLookup(true); end; } modify("Country/Region Code") @@ -88,6 +91,8 @@ pageextension 9401 "IPC Vendor Card" extends "Vendor Card" Vendor: Record Vendor; RecRef: RecordRef; begin + if Rec."Post Code" = '' then + exit; if not IPCAddressLookupHelper.ConfiguredAndSupportedForRecord(Rec."Country/Region Code") then exit; diff --git a/Apps/GB/IdealPostcodes/app/src/IPCAddressLookupHelper.Codeunit.al b/Apps/GB/IdealPostcodes/app/src/IPCAddressLookupHelper.Codeunit.al index 0e9e261bc2..f09ce5d234 100644 --- a/Apps/GB/IdealPostcodes/app/src/IPCAddressLookupHelper.Codeunit.al +++ b/Apps/GB/IdealPostcodes/app/src/IPCAddressLookupHelper.Codeunit.al @@ -144,6 +144,9 @@ codeunit 9401 "IPC Address Lookup Helper" PostCodeServiceManager: Codeunit "Postcode Service Manager"; IsConfigured: Boolean; begin + if not GuiAllowed() then + exit(false); + if not SupportedCountryOrRegionCode(CountryOrRegionCode) then exit(false); diff --git a/Apps/GB/IdealPostcodes/test/src/TestIdealPostcodesPages.Codeunit.al b/Apps/GB/IdealPostcodes/test/src/TestIdealPostcodesPages.Codeunit.al index 2ed9b5f3a8..74c2fbf145 100644 --- a/Apps/GB/IdealPostcodes/test/src/TestIdealPostcodesPages.Codeunit.al +++ b/Apps/GB/IdealPostcodes/test/src/TestIdealPostcodesPages.Codeunit.al @@ -133,9 +133,9 @@ codeunit 148121 "Test IdealPostcodes Pages" // [WHEN] we assume successful process, copying fields BankAccountCard.OpenEdit(); BankAccountCard."Country/Region Code".Value(''); + // [WHEN] trigger postcode search + // PostcodeSearchScenario page handler takes over and inputs postcode BankAccountCard."Post Code".Value('TESTPOSTCODE'); - BankAccountCard.LookupAddress_IdealPostcodes.DrillDown(); // trigger postcode search - // PostcodeSearchScenario page handler takes over and inputs postcode // [THEN] we should get our data Assert.AreEqual('ADDRESS', BankAccountCard.Address.Value, RetrievedInvalidValueTok); @@ -173,11 +173,9 @@ codeunit 148121 "Test IdealPostcodes Pages" BankAccountCard."Address 2".Value(''); BankAccountCard.City.Value(''); BankAccountCard."Country/Region Code".Value(''); - BankAccountCard."Post Code".Value('TESTPOSTCODE'); - // [WHEN] trigger postcode search - BankAccountCard.LookupAddress_IdealPostcodes.DrillDown(); // PostcodeSearch cancel page handler takes over and cancels the process + BankAccountCard."Post Code".Value('TESTPOSTCODE'); // [THEN] address fields should stay blank Assert.AreEqual('', BankAccountCard.Address.Value, RetrievedInvalidValueTok); @@ -292,9 +290,9 @@ codeunit 148121 "Test IdealPostcodes Pages" // [WHEN] we assume successful process, copying fields CustomerCard.OpenEdit(); CustomerCard."Country/Region Code".Value(''); + // [WHEN] trigger postcode search + // PostcodeSearchScenario page handler takes over and inputs postcode CustomerCard."Post Code".Value('TESTPOSTCODE'); - CustomerCard.LookupAddress_IdealPostcodes.DrillDown(); // trigger postcode search - // PostcodeSearchScenario page handler takes over and inputs postcode // [THEN] we should get our data Assert.AreEqual('ADDRESS', CustomerCard.Address.Value, RetrievedInvalidValueTok); @@ -333,11 +331,9 @@ codeunit 148121 "Test IdealPostcodes Pages" CustomerCard."Address 2".Value(''); CustomerCard.City.Value(''); CustomerCard."Country/Region Code".Value(''); - CustomerCard."Post Code".Value('TESTPOSTCODE'); - // [WHEN] trigger postcode search - CustomerCard.LookupAddress_IdealPostcodes.DrillDown(); // PostcodeSearch cancel page handler takes over and cancels the process + CustomerCard."Post Code".Value('TESTPOSTCODE'); // [THEN] address fields should stay blank Assert.AreEqual('', CustomerCard.Address.Value, RetrievedInvalidValueTok); @@ -454,9 +450,9 @@ codeunit 148121 "Test IdealPostcodes Pages" // [WHEN] we assume successful process, copying fields EmployeeCard.OpenEdit(); EmployeeCard."Country/Region Code".Value(''); - EmployeeCard."Post Code".Value('TESTPOSTCODE'); - EmployeeCard.LookupAddress_IdealPostcodes.DrillDown(); // trigger postcode search + // [WHEN] trigger postcode search // PostcodeSearchScenario page handler takes over and inputs postcode + EmployeeCard."Post Code".Value('TESTPOSTCODE'); // [THEN] we should get our data Assert.AreEqual('ADDRESS', EmployeeCard.Address.Value, RetrievedInvalidValueTok); @@ -500,9 +496,8 @@ codeunit 148121 "Test IdealPostcodes Pages" EmployeeCard."Country/Region Code".Value(''); // [WHEN] trigger postcode search via validate - EmployeeCard."Post Code".Value('TESTPOSTCODE'); - EmployeeCard.LookupAddress_IdealPostcodes.DrillDown(); // PostcodeSearch cancel page handler takes over and cancels the process + EmployeeCard."Post Code".Value('TESTPOSTCODE'); // [THEN] address fields should stay blank Assert.AreEqual('', EmployeeCard.Address.Value, RetrievedInvalidValueTok); @@ -635,9 +630,9 @@ codeunit 148121 "Test IdealPostcodes Pages" ShiptoAddress.OpenEdit(); ShiptoAddress.GoToRecord(ShipToAddressRec); ShiptoAddress."Country/Region Code".Value(''); + // [WHEN] trigger postcode search + // PostcodeSearchScenario page handler takes over and inputs postcode ShiptoAddress."Post Code".Value('TESTPOSTCODE'); - ShiptoAddress.LookupAddress_IdealPostcodes.DrillDown(); // trigger postcode search - // PostcodeSearchScenario page handler takes over and inputs postcode // [THEN] we should get our data Assert.AreEqual('ADDRESS', ShiptoAddress.Address.Value, RetrievedInvalidValueTok); @@ -680,11 +675,9 @@ codeunit 148121 "Test IdealPostcodes Pages" ShiptoAddress."Address 2".Value(''); ShiptoAddress.City.Value(''); ShiptoAddress."Country/Region Code".Value(''); - ShiptoAddress."Post Code".Value('TESTPOSTCODE'); - // [WHEN] trigger postcode search - ShiptoAddress.LookupAddress_IdealPostcodes.DrillDown(); // PostcodeSearch cancel page handler takes over and cancels the process + ShiptoAddress."Post Code".Value('TESTPOSTCODE'); // [THEN] address fields should stay blank Assert.AreEqual('', ShiptoAddress.Address.Value, RetrievedInvalidValueTok); @@ -806,9 +799,9 @@ codeunit 148121 "Test IdealPostcodes Pages" LocationCard.New(); LocationCard.Code.Value(LibraryRandom.RandText(10)); LocationCard."Country/Region Code".Value(''); + // [WHEN] trigger postcode search + // PostcodeSearchScenario page handler takes over and inputs postcode LocationCard."Post Code".Value('TESTPOSTCODE'); - LocationCard.LookupAddress_IdealPostcodes.DrillDown(); // trigger postcode search - // PostcodeSearchScenario page handler takes over and inputs postcode // [THEN] we should get our data Assert.AreEqual('ADDRESS', LocationCard.Address.Value, RetrievedInvalidValueTok); @@ -852,11 +845,9 @@ codeunit 148121 "Test IdealPostcodes Pages" LocationCard."Address 2".Value(''); LocationCard.City.Value(''); LocationCard."Country/Region Code".Value(''); - LocationCard."Post Code".Value('TESTPOSTCODE'); - // [WHEN] trigger postcode search - LocationCard.LookupAddress_IdealPostcodes.DrillDown(); // PostcodeSearch cancel page handler takes over and cancels the process + LocationCard."Post Code".Value('TESTPOSTCODE'); // [THEN] address fields should stay blank Assert.AreEqual('', LocationCard.Address.Value, RetrievedInvalidValueTok); @@ -954,9 +945,9 @@ codeunit 148121 "Test IdealPostcodes Pages" ResourceCard.OpenEdit(); ResourceCard.New(); ResourceCard."Country/Region Code".Value(''); + // [WHEN] trigger postcode search + // PostcodeSearchScenario page handler takes over and inputs postcode ResourceCard."Post Code".Value('TESTPOSTCODE'); - ResourceCard.LookupAddress_IdealPostcodes.DrillDown(); // trigger postcode search - // PostcodeSearchScenario page handler takes over and inputs postcode // [THEN] we should get our data Assert.AreEqual('ADDRESS', ResourceCard.Address.Value, RetrievedInvalidValueTok); @@ -998,11 +989,9 @@ codeunit 148121 "Test IdealPostcodes Pages" ResourceCard."Address 2".Value(''); ResourceCard.City.Value(''); ResourceCard."Country/Region Code".Value(''); - ResourceCard."Post Code".Value('TESTPOSTCODE'); - // [WHEN] trigger postcode search - ResourceCard.LookupAddress_IdealPostcodes.DrillDown(); // PostcodeSearch cancel page handler takes over and cancels the process + ResourceCard."Post Code".Value('TESTPOSTCODE'); // [THEN] address fields should stay blank Assert.AreEqual('', ResourceCard.Address.Value, RetrievedInvalidValueTok); @@ -1126,9 +1115,9 @@ codeunit 148121 "Test IdealPostcodes Pages" ContactCard.OpenEdit(); ContactCard.New(); ContactCard."Country/Region Code".Value(''); + // [WHEN] trigger postcode search + // PostcodeSearchScenario page handler takes over and inputs postcode ContactCard."Post Code".Value('TESTPOSTCODE'); - ContactCard.LookupAddress_IdealPostcodes.DrillDown(); // trigger postcode search - // PostcodeSearchScenario page handler takes over and inputs postcode // [THEN] we should get our data Assert.AreEqual('ADDRESS', ContactCard.Address.Value, RetrievedInvalidValueTok); @@ -1168,11 +1157,9 @@ codeunit 148121 "Test IdealPostcodes Pages" ContactCard."Address 2".Value(''); ContactCard.City.Value(''); ContactCard."Country/Region Code".Value(''); - ContactCard."Post Code".Value('TESTPOSTCODE'); - // [WHEN] trigger postcode search - ContactCard.LookupAddress_IdealPostcodes.DrillDown(); // PostcodeSearch cancel page handler takes over and cancels the process + ContactCard."Post Code".Value('TESTPOSTCODE'); // [THEN] address fields should stay blank Assert.AreEqual('', ContactCard.Address.Value, RetrievedInvalidValueTok); @@ -1294,9 +1281,9 @@ codeunit 148121 "Test IdealPostcodes Pages" ContactAltAddressCard.New(); ContactAltAddressCard.Code.Value(LibraryRandom.RandText(10)); ContactAltAddressCard."Country/Region Code".Value(''); + // [WHEN] trigger postcode search + // PostcodeSearchScenario page handler takes over and inputs postcode ContactAltAddressCard."Post Code".Value('TESTPOSTCODE'); - ContactAltAddressCard.LookupAddress_IdealPostcodes.DrillDown(); // trigger postcode search - // PostcodeSearchScenario page handler takes over and inputs postcode // [THEN] we should get our data Assert.AreEqual('ADDRESS', ContactAltAddressCard.Address.Value, RetrievedInvalidValueTok); @@ -1336,11 +1323,9 @@ codeunit 148121 "Test IdealPostcodes Pages" ContactAltAddressCard."Address 2".Value(''); ContactAltAddressCard.City.Value(''); ContactAltAddressCard."Country/Region Code".Value(''); - ContactAltAddressCard."Post Code".Value('TESTPOSTCODE'); - // [WHEN] trigger postcode search - ContactAltAddressCard.LookupAddress_IdealPostcodes.DrillDown(); // PostcodeSearch cancel page handler takes over and cancels the process + ContactAltAddressCard."Post Code".Value('TESTPOSTCODE'); // [THEN] address fields should stay blank Assert.AreEqual('', ContactAltAddressCard.Address.Value, RetrievedInvalidValueTok); @@ -1532,9 +1517,10 @@ codeunit 148121 "Test IdealPostcodes Pages" // [WHEN] we assume successful process, copying fields CompanyInformation.OpenEdit(); CompanyInformation."Ship-to Country/Region Code".Value(''); + // [WHEN] trigger postcode search + // PostcodeSearchScenario page handler takes over and inputs postcode CompanyInformation."Ship-to Post Code".Value('TESTPOSTCODE'); - CompanyInformation.LookupShipToAddress_IdealPostcodes.DrillDown(); // trigger postcode search - // PostcodeSearchScenario page handler takes over and inputs postcode + CompanyInformation.LookupShipToAddress_IdealPostcodes.Drilldown(); // [THEN] we should get our data Assert.AreEqual('ADDRESS', CompanyInformation."Ship-to Address".Value, RetrievedInvalidValueTok); @@ -1572,11 +1558,9 @@ codeunit 148121 "Test IdealPostcodes Pages" CompanyInformation."Ship-to Address 2".Value(''); CompanyInformation."Ship-to City".Value(''); CompanyInformation."Ship-to Country/Region Code".Value(''); - CompanyInformation."Ship-to Post Code".Value('TESTPOSTCODE'); - // [WHEN] trigger postcode search - CompanyInformation.LookupShipToAddress_IdealPostcodes.DrillDown(); // PostcodeSearch cancel page handler takes over and cancels the process + CompanyInformation."Ship-to Post Code".Value('TESTPOSTCODE'); // [THEN] address fields should stay blank Assert.AreEqual('', CompanyInformation."Ship-to Address".Value, RetrievedInvalidValueTok); @@ -1690,9 +1674,9 @@ codeunit 148121 "Test IdealPostcodes Pages" // [WHEN] we assume successful process, copying fields VendorCard.OpenEdit(); VendorCard."Country/Region Code".Value(''); + // [WHEN] trigger postcode search + // PostcodeSearchScenario page handler takes over and inputs postcode VendorCard."Post Code".Value('TESTPOSTCODE'); - VendorCard.LookupAddress_IdealPostcodes.DrillDown(); // trigger postcode search - // PostcodeSearchScenario page handler takes over and inputs postcode // [THEN] we should get our data Assert.AreEqual('ADDRESS', VendorCard.Address.Value, RetrievedInvalidValueTok); @@ -1731,11 +1715,9 @@ codeunit 148121 "Test IdealPostcodes Pages" VendorCard."Address 2".Value(''); VendorCard.City.Value(''); VendorCard."Country/Region Code".Value(''); - VendorCard."Post Code".Value('TESTPOSTCODE'); - // [WHEN] trigger postcode search - VendorCard.LookupAddress_IdealPostcodes.DrillDown(); // PostcodeSearch cancel page handler takes over and cancels the process + VendorCard."Post Code".Value('TESTPOSTCODE'); // [THEN] address fields should stay blank Assert.AreEqual('', VendorCard.Address.Value, RetrievedInvalidValueTok); diff --git a/Apps/GB/UKPostcodeGetAddressIO/app/src/PageExt/BankAccountCard.PageExt.al b/Apps/GB/UKPostcodeGetAddressIO/app/src/PageExt/BankAccountCard.PageExt.al index 12911011bb..4371dccf58 100644 --- a/Apps/GB/UKPostcodeGetAddressIO/app/src/PageExt/BankAccountCard.PageExt.al +++ b/Apps/GB/UKPostcodeGetAddressIO/app/src/PageExt/BankAccountCard.PageExt.al @@ -12,22 +12,10 @@ pageextension 50000 "Bank Account Card" extends "Bank Account Card" { layout { - modify(Address) - { - trigger OnBeforeValidate() - var - PostcodeBusinessLogic: Codeunit "Postcode Business Logic GB"; - begin - PostcodeBusinessLogic.ShowDiscoverabilityNotificationIfNeccessary(); - end; - } modify("Post Code") { trigger OnBeforeValidate() - var - PostcodeBusinessLogic: Codeunit "Postcode Business Logic GB"; begin - PostcodeBusinessLogic.ShowDiscoverabilityNotificationIfNeccessary(); ShowPostcodeLookup(false); end; } diff --git a/Apps/GB/UKPostcodeGetAddressIO/app/src/PageExt/CompanyInformation.PageExt.al b/Apps/GB/UKPostcodeGetAddressIO/app/src/PageExt/CompanyInformation.PageExt.al index f2938d0c14..e07f1f98ae 100644 --- a/Apps/GB/UKPostcodeGetAddressIO/app/src/PageExt/CompanyInformation.PageExt.al +++ b/Apps/GB/UKPostcodeGetAddressIO/app/src/PageExt/CompanyInformation.PageExt.al @@ -12,22 +12,10 @@ pageextension 50003 "Company Information" extends "Company Information" { layout { - modify(Address) - { - trigger OnBeforeValidate() - var - PostcodeBusinessLogic: Codeunit "Postcode Business Logic GB"; - begin - PostcodeBusinessLogic.ShowDiscoverabilityNotificationIfNeccessary(); - end; - } modify("Post Code") { trigger OnBeforeValidate() - var - PostcodeBusinessLogic: Codeunit "Postcode Business Logic GB"; begin - PostcodeBusinessLogic.ShowDiscoverabilityNotificationIfNeccessary(); ShowPostcodeLookup(false, AddressTok); end; } diff --git a/Apps/GB/UKPostcodeGetAddressIO/app/src/PageExt/ContactAltAddressCard.PageExt.al b/Apps/GB/UKPostcodeGetAddressIO/app/src/PageExt/ContactAltAddressCard.PageExt.al index f0e2798ae3..bb65c5fe18 100644 --- a/Apps/GB/UKPostcodeGetAddressIO/app/src/PageExt/ContactAltAddressCard.PageExt.al +++ b/Apps/GB/UKPostcodeGetAddressIO/app/src/PageExt/ContactAltAddressCard.PageExt.al @@ -12,22 +12,10 @@ pageextension 50001 "Contact Alt. Address Card" extends "Contact Alt. Address Ca { layout { - modify(Address) - { - trigger OnBeforeValidate() - var - PostcodeBusinessLogic: Codeunit "Postcode Business Logic GB"; - begin - PostcodeBusinessLogic.ShowDiscoverabilityNotificationIfNeccessary(); - end; - } modify("Post Code") { trigger OnBeforeValidate() - var - PostcodeBusinessLogic: Codeunit "Postcode Business Logic GB"; begin - PostcodeBusinessLogic.ShowDiscoverabilityNotificationIfNeccessary(); ShowPostcodeLookup(false); end; } diff --git a/Apps/GB/UKPostcodeGetAddressIO/app/src/PageExt/ContactCard.PageExt.al b/Apps/GB/UKPostcodeGetAddressIO/app/src/PageExt/ContactCard.PageExt.al index 6c670e62b6..3de45d61e7 100644 --- a/Apps/GB/UKPostcodeGetAddressIO/app/src/PageExt/ContactCard.PageExt.al +++ b/Apps/GB/UKPostcodeGetAddressIO/app/src/PageExt/ContactCard.PageExt.al @@ -12,22 +12,10 @@ pageextension 50002 "Contact Card" extends "Contact Card" { layout { - modify(Address) - { - trigger OnBeforeValidate() - var - PostcodeBusinessLogic: Codeunit "Postcode Business Logic GB"; - begin - PostcodeBusinessLogic.ShowDiscoverabilityNotificationIfNeccessary(); - end; - } modify("Post Code") { trigger OnBeforeValidate() - var - PostcodeBusinessLogic: Codeunit "Postcode Business Logic GB"; begin - PostcodeBusinessLogic.ShowDiscoverabilityNotificationIfNeccessary(); ShowPostcodeLookup(false); end; } diff --git a/Apps/GB/UKPostcodeGetAddressIO/app/src/PageExt/CustomerBankAccountCard.PageExt.al b/Apps/GB/UKPostcodeGetAddressIO/app/src/PageExt/CustomerBankAccountCard.PageExt.al index 909cb8da64..6e519d6968 100644 --- a/Apps/GB/UKPostcodeGetAddressIO/app/src/PageExt/CustomerBankAccountCard.PageExt.al +++ b/Apps/GB/UKPostcodeGetAddressIO/app/src/PageExt/CustomerBankAccountCard.PageExt.al @@ -12,22 +12,10 @@ pageextension 50007 "Customer Bank Account Card" extends "Customer Bank Account { layout { - modify(Address) - { - trigger OnBeforeValidate() - var - PostcodeBusinessLogic: Codeunit "Postcode Business Logic GB"; - begin - PostcodeBusinessLogic.ShowDiscoverabilityNotificationIfNeccessary(); - end; - } modify("Post Code") { trigger OnBeforeValidate() - var - PostcodeBusinessLogic: Codeunit "Postcode Business Logic GB"; begin - PostcodeBusinessLogic.ShowDiscoverabilityNotificationIfNeccessary(); ShowPostcodeLookup(false); end; } diff --git a/Apps/GB/UKPostcodeGetAddressIO/app/src/PageExt/CustomerCard.PageExt.al b/Apps/GB/UKPostcodeGetAddressIO/app/src/PageExt/CustomerCard.PageExt.al index 9f8cb93295..ef62d1de40 100644 --- a/Apps/GB/UKPostcodeGetAddressIO/app/src/PageExt/CustomerCard.PageExt.al +++ b/Apps/GB/UKPostcodeGetAddressIO/app/src/PageExt/CustomerCard.PageExt.al @@ -12,22 +12,10 @@ pageextension 50008 "Customer Card" extends "Customer Card" { layout { - modify(Address) - { - trigger OnBeforeValidate() - var - PostcodeBusinessLogic: Codeunit "Postcode Business Logic GB"; - begin - PostcodeBusinessLogic.ShowDiscoverabilityNotificationIfNeccessary(); - end; - } modify("Post Code") { trigger OnBeforeValidate() - var - PostcodeBusinessLogic: Codeunit "Postcode Business Logic GB"; begin - PostcodeBusinessLogic.ShowDiscoverabilityNotificationIfNeccessary(); ShowPostcodeLookup(false); end; } diff --git a/Apps/GB/UKPostcodeGetAddressIO/app/src/PageExt/EmployeeCard.PageExt.al b/Apps/GB/UKPostcodeGetAddressIO/app/src/PageExt/EmployeeCard.PageExt.al index 8e5d3d8910..0cb594ade0 100644 --- a/Apps/GB/UKPostcodeGetAddressIO/app/src/PageExt/EmployeeCard.PageExt.al +++ b/Apps/GB/UKPostcodeGetAddressIO/app/src/PageExt/EmployeeCard.PageExt.al @@ -12,22 +12,10 @@ pageextension 50004 "Employee Card" extends "Employee Card" { layout { - modify(Address) - { - trigger OnBeforeValidate() - var - PostcodeBusinessLogic: Codeunit "Postcode Business Logic GB"; - begin - PostcodeBusinessLogic.ShowDiscoverabilityNotificationIfNeccessary(); - end; - } modify("Post Code") { trigger OnBeforeValidate() - var - PostcodeBusinessLogic: Codeunit "Postcode Business Logic GB"; begin - PostcodeBusinessLogic.ShowDiscoverabilityNotificationIfNeccessary(); ShowPostcodeLookup(false); end; } diff --git a/Apps/GB/UKPostcodeGetAddressIO/app/src/PageExt/LocationCard.PageExt.al b/Apps/GB/UKPostcodeGetAddressIO/app/src/PageExt/LocationCard.PageExt.al index b2eff7b7ef..fe9ea5bb79 100644 --- a/Apps/GB/UKPostcodeGetAddressIO/app/src/PageExt/LocationCard.PageExt.al +++ b/Apps/GB/UKPostcodeGetAddressIO/app/src/PageExt/LocationCard.PageExt.al @@ -12,22 +12,10 @@ pageextension 50010 "Location Card" extends "Location Card" { layout { - modify(Address) - { - trigger OnBeforeValidate() - var - PostcodeBusinessLogic: Codeunit "Postcode Business Logic GB"; - begin - PostcodeBusinessLogic.ShowDiscoverabilityNotificationIfNeccessary(); - end; - } modify("Post Code") { trigger OnBeforeValidate() - var - PostcodeBusinessLogic: Codeunit "Postcode Business Logic GB"; begin - PostcodeBusinessLogic.ShowDiscoverabilityNotificationIfNeccessary(); ShowPostcodeLookup(false); end; } diff --git a/Apps/GB/UKPostcodeGetAddressIO/app/src/PageExt/ResourceCard.PageExt.al b/Apps/GB/UKPostcodeGetAddressIO/app/src/PageExt/ResourceCard.PageExt.al index 03bc0473ea..e7c234914b 100644 --- a/Apps/GB/UKPostcodeGetAddressIO/app/src/PageExt/ResourceCard.PageExt.al +++ b/Apps/GB/UKPostcodeGetAddressIO/app/src/PageExt/ResourceCard.PageExt.al @@ -13,22 +13,10 @@ pageextension 50005 "Resource Card" extends "Resource Card" layout { - modify(Address) - { - trigger OnBeforeValidate() - var - PostcodeBusinessLogic: Codeunit "Postcode Business Logic GB"; - begin - PostcodeBusinessLogic.ShowDiscoverabilityNotificationIfNeccessary(); - end; - } modify("Post Code") { trigger OnBeforeValidate() - var - PostcodeBusinessLogic: Codeunit "Postcode Business Logic GB"; begin - PostcodeBusinessLogic.ShowDiscoverabilityNotificationIfNeccessary(); ShowPostcodeLookup(false); end; } diff --git a/Apps/GB/UKPostcodeGetAddressIO/app/src/PageExt/ShiptoAddress.PageExt.al b/Apps/GB/UKPostcodeGetAddressIO/app/src/PageExt/ShiptoAddress.PageExt.al index 2d52171d94..0851886300 100644 --- a/Apps/GB/UKPostcodeGetAddressIO/app/src/PageExt/ShiptoAddress.PageExt.al +++ b/Apps/GB/UKPostcodeGetAddressIO/app/src/PageExt/ShiptoAddress.PageExt.al @@ -12,22 +12,10 @@ pageextension 50009 "Ship-to Address" extends "Ship-to Address" { layout { - modify(Address) - { - trigger OnBeforeValidate() - var - PostcodeBusinessLogic: Codeunit "Postcode Business Logic GB"; - begin - PostcodeBusinessLogic.ShowDiscoverabilityNotificationIfNeccessary(); - end; - } modify("Post Code") { trigger OnBeforeValidate() - var - PostcodeBusinessLogic: Codeunit "Postcode Business Logic GB"; begin - PostcodeBusinessLogic.ShowDiscoverabilityNotificationIfNeccessary(); ShowPostcodeLookup(false); end; } diff --git a/Apps/GB/UKPostcodeGetAddressIO/app/src/PageExt/VendorCard.PageExt.al b/Apps/GB/UKPostcodeGetAddressIO/app/src/PageExt/VendorCard.PageExt.al index 1236cd4738..89e34b468c 100644 --- a/Apps/GB/UKPostcodeGetAddressIO/app/src/PageExt/VendorCard.PageExt.al +++ b/Apps/GB/UKPostcodeGetAddressIO/app/src/PageExt/VendorCard.PageExt.al @@ -12,22 +12,10 @@ pageextension 50006 "Vendor Card" extends "Vendor Card" { layout { - modify(Address) - { - trigger OnBeforeValidate() - var - PostcodeBusinessLogic: Codeunit "Postcode Business Logic GB"; - begin - PostcodeBusinessLogic.ShowDiscoverabilityNotificationIfNeccessary(); - end; - } modify("Post Code") { trigger OnBeforeValidate() - var - PostcodeBusinessLogic: Codeunit "Postcode Business Logic GB"; begin - PostcodeBusinessLogic.ShowDiscoverabilityNotificationIfNeccessary(); ShowPostcodeLookup(false); end; } diff --git a/Apps/GB/UKPostcodeGetAddressIO/test/src/TestUKPostcode.Codeunit.al b/Apps/GB/UKPostcodeGetAddressIO/test/src/TestUKPostcode.Codeunit.al index 679c13bf2c..ee768e3460 100644 --- a/Apps/GB/UKPostcodeGetAddressIO/test/src/TestUKPostcode.Codeunit.al +++ b/Apps/GB/UKPostcodeGetAddressIO/test/src/TestUKPostcode.Codeunit.al @@ -170,57 +170,6 @@ codeunit 139500 "Test UK Postcode" DeleteConfiguration(); end; - [Test] - [Scope('OnPrem')] - procedure TestNotificationDontShowAgain() - var -#if not CLEAN28 - PostcodeNotificationMemory: Record "Postcode Notification Memory"; -#else - PostcodeNotificationMemory: Record "Postcode Notif. Memory"; -#endif - PostcodeBusinessLogic: Codeunit "Postcode Business Logic GB"; - DummyNotification: Notification; - begin - // [GIVEN] basic user, that hasn't had any interaction with postcode notificaitons - LibraryLowerPermissions.SetO365Basic(); - Assert.RecordIsEmpty(PostcodeNotificationMemory); - - // [WHEN] user clicks "don't show again" - PostcodeBusinessLogic.NotificationOnDontShowAgain(DummyNotification); - - // [THEN] no window opens, record is present NOT to show notification again - Assert.RecordCount(PostcodeNotificationMemory, 1); - - PostcodeNotificationMemory.DeleteAll(); // Cleanup - end; - - [Test] - [HandlerFunctions('PostcodeConfigurationPageHandler')] - [Scope('OnPrem')] - procedure TestNotificationConfigure() - var -#if not CLEAN28 - PostcodeNotificationMemory: Record "Postcode Notification Memory"; -#else - PostcodeNotificationMemory: Record "Postcode Notif. Memory"; -#endif - PostcodeBusinessLogic: Codeunit "Postcode Business Logic GB"; - DummyNotification: Notification; - begin - // [GIVEN] basic user, that hasn't had any interaction with postcode notificaitons - LibraryLowerPermissions.SetO365BusFull(); - Assert.RecordIsEmpty(PostcodeNotificationMemory); - - // [WHEN] User clicks configure - PostcodeBusinessLogic.NotificationOnConfigure(DummyNotification); - - // [THEN] service config window opens, record is present NOT to show notification again - Assert.RecordCount(PostcodeNotificationMemory, 1); - - PostcodeNotificationMemory.DeleteAll(); // Cleanup - end; - local procedure Initialize() var PostcodeServiceConfig: Record "Postcode Service Config"; @@ -322,15 +271,5 @@ codeunit 139500 "Test UK Postcode" Assert.AreEqual('DELIVERYPOINT', PostcodeSearch.DeliveryPoint.Value, 'Delivery point is not correctly passed into a page.'); end; - [PageHandler] - [Scope('OnPrem')] -#if not CLEAN28 - procedure PostcodeConfigurationPageHandler(var PostcodeConfigurationPage: TestPage "Postcode Configuration Page") -#else - procedure PostcodeConfigurationPageHandler(var PostcodeConfigurationPage: TestPage "Postcode Configuration Page GB") -#endif - begin - PostcodeConfigurationPage.Cancel().Invoke(); - end; } #endif diff --git a/Apps/IN/INGST/test/GSTBase/src/GSTFAReclassJournalTests.Codeunit.al b/Apps/IN/INGST/test/GSTBase/src/GSTFAReclassJournalTests.Codeunit.al index 7d1675fb0e..20c3ffa32c 100644 --- a/Apps/IN/INGST/test/GSTBase/src/GSTFAReclassJournalTests.Codeunit.al +++ b/Apps/IN/INGST/test/GSTBase/src/GSTFAReclassJournalTests.Codeunit.al @@ -43,6 +43,7 @@ codeunit 18488 "GST FA Reclass Journal Tests" DocumentNo: Code[20]; FAExempted: Boolean; begin + // [FEATURE] [AI TEST] // Check GL Entries after posting FA Reclass Journals. // 1. Setup: Create GST Setup, Locations, create and modify Depreciation Book, create FA Posting Group, create two Fixed Assets. @@ -87,6 +88,7 @@ codeunit 18488 "GST FA Reclass Journal Tests" DocumentNo: Code[20]; FAExempted: Boolean; begin + // [FEATURE] [AI TEST] // Check GL Entries after posting FA Reclass Journals. // 1. Setup: Create GST Setup, Locations, create and modify Depreciation Book, create FA Posting Group, create two Fixed Assets. diff --git a/Apps/IT/IntrastatIT/app/src/IntrastatReportExpExtIT.Codeunit.al b/Apps/IT/IntrastatIT/app/src/IntrastatReportExpExtIT.Codeunit.al index f19e3bfb4c..0fdcb43e39 100644 --- a/Apps/IT/IntrastatIT/app/src/IntrastatReportExpExtIT.Codeunit.al +++ b/Apps/IT/IntrastatIT/app/src/IntrastatReportExpExtIT.Codeunit.al @@ -89,7 +89,6 @@ codeunit 148122 "Intrastat Report Exp. Ext. IT" var IntrastatReportLine: Record "Intrastat Report Line"; OutText: Text; - Length: Integer; Amount, LineCount : Integer; begin IntrastatReportMgtIT.GetTotals(Amount, LineCount); @@ -109,14 +108,10 @@ codeunit 148122 "Intrastat Report Exp. Ext. IT" OutText += Format(LineCount).PadLeft(5, '0'); OutText += Format(Amount).PadLeft(13, '0'); - if IntrastatReportHeader.Type = IntrastatReportHeader.Type::Purchases then - Length := 49 - else - Length := 54; - - OutText += Format('').PadLeft(Length, '0'); + OutText += Format('').PadLeft(54, '0'); end; - OutText += Format('').PadLeft(5, '0'); + if IntrastatReportHeader.Type = IntrastatReportHeader.Type::Sales then + OutText += Format('').PadLeft(5, '0'); exit(OutText); end; diff --git a/Apps/IT/IntrastatIT/test/src/IntrastatITTest.Codeunit.al b/Apps/IT/IntrastatIT/test/src/IntrastatITTest.Codeunit.al index f7600a1da8..6795bc78ec 100644 --- a/Apps/IT/IntrastatIT/test/src/IntrastatITTest.Codeunit.al +++ b/Apps/IT/IntrastatIT/test/src/IntrastatITTest.Codeunit.al @@ -2268,6 +2268,73 @@ codeunit 139511 "Intrastat IT Test" UnbindSubscription(LibraryIntrastat); end; + [Test] + [HandlerFunctions('IntrastatReportGetLinesPageHandler')] + procedure E2EIntrastatReportITCorrPurchHeaderNoExtraZeros() + var + PurchaseLine: Record "Purchase Line"; + DataExch: Record "Data Exch."; + FileMgt: Codeunit "File Management"; + LibraryTextFileValidation: Codeunit "Library - Text File Validation"; + TempBlob: Codeunit "Temp Blob"; + IntrastatReportPage: TestPage "Intrastat Report"; + InvoiceDate: Date; + IntrastatReportNo: Code[20]; + FileName: Text; + Header: Text; + HeaderTotalsSection: Text; + ExpectedTotalsLength: Integer; + TotalsStartPos: Integer; + begin + BindSubscription(LibraryIntrastat); + // [FEATURE] [AI test 0.3] + // [SCENARIO 624090] Corrective Purchase export header must not contain extra trailing zeros + // [GIVEN] Posted Purchase Order and corrective Credit Memo for intrastat + Initialize(); + InvoiceDate := CalcDate('<7Y>'); + WorkDate(InvoiceDate); + CreateAndPostCorrectivePurchCrMemo(LibraryIntrastat.CreateAndPostPurchaseOrderWithInvoice(PurchaseLine, InvoiceDate), CalcDate('<+1M>', InvoiceDate)); + WorkDate(Today); + CreateIntrastatReportAndSuggestLines(CalcDate('<+1M>', InvoiceDate), IntrastatReportNo, Periodicity::Month, Type::Purchase, true, '999', false); + Commit(); + + // [GIVEN] A Intrastat Report with validated fields + EnsureLookupRecordsExist(); + IntrastatReportPage.OpenEdit(); + IntrastatReportPage.Filter.SetFilter("No.", IntrastatReportNo); + ValidateMissingFields(IntrastatReportPage); + IntrastatReportPage.ChecklistReport.Invoke(); + IntrastatReportPage.ErrorMessagesPart."Field Name".AssertEquals(''); + + // [WHEN] Running Create File for corrective purchase + IntrastatReportPage.CreateFile.Invoke(); + + // [THEN] Verify header totals section has correct length (72 chars: 18+5+13+36) without extra 5 trailing zeros + DataExch.FindLast(); + Assert.IsTrue(DataExch."File Content".HasValue(), DataExchFileContentMissingErr); + DataExch.CalcFields("File Content"); + TempBlob.FromRecord(DataExch, DataExch.FieldNo("File Content")); + FileName := FileMgt.ServerTempFileName('txt'); + FileMgt.BLOBExportToServerFile(TempBlob, FileName); + Header := LibraryTextFileValidation.ReadLine(FileName, 1); + + // Header structure before totals: EUROX(5) + VAT(11) + FileDiskNo(6) + 000000(6) + Type(1) + Period(2) + Periodicity(1) + Month(2) + CompanyVAT(11) + 00(2) + TaxRepVAT(11) = 58 chars + TotalsStartPos := 59; + // Corrective purchase totals: 18 zeros + LineCount(5) + Amount(13) + 36 zeros = 72 chars. No trailing 5 zeros. + ExpectedTotalsLength := 72; + HeaderTotalsSection := LibraryTextFileValidation.ReadValue(Header, TotalsStartPos, ExpectedTotalsLength); + Assert.AreEqual(ExpectedTotalsLength, StrLen(HeaderTotalsSection), 'Corrective purchase header totals section has incorrect length.'); + + // Verify the trailing part is exactly 36 zeros (not 41) + Assert.AreEqual(Format('').PadLeft(36, '0'), LibraryTextFileValidation.ReadValue(Header, TotalsStartPos + 36, 36), 'Corrective purchase header should have exactly 36 trailing zeros, not 41.'); + + // Verify total header length: 58 (common header) + 72 (corrective purchase totals) = 130 + Assert.AreEqual(130, StrLen(Header), 'Corrective purchase header total length is incorrect - extra trailing zeros detected.'); + + IntrastatReportPage.Close(); + UnbindSubscription(LibraryIntrastat); + end; + [Test] [Scope('OnPrem')] [HandlerFunctions('IntrastatReportGetLinesPageHandler')] @@ -3789,6 +3856,9 @@ codeunit 139511 "Intrastat IT Test" Assert.AreEqual(Format(Round(DecVar, 1)).PadLeft(13, '0'), LibraryTextFileValidation.ReadValue(Header, ReadFromPosition, 13), IntrastatFileOutputErr); ReadFromPosition += 13; Assert.AreEqual(Format('').PadLeft(54, '0'), LibraryTextFileValidation.ReadValue(Header, ReadFromPosition, 54), IntrastatFileOutputErr); + ReadFromPosition += 54; + if FileType = 'C' then + Assert.AreEqual(Format('').PadLeft(5, '0'), LibraryTextFileValidation.ReadValue(Header, ReadFromPosition, 5), IntrastatFileOutputErr); // Verify Line Line1 := LibraryTextFileValidation.ReadLine(FileName, 2); @@ -3906,7 +3976,10 @@ codeunit 139511 "Intrastat IT Test" Evaluate(DecVar, IntrastatReportPage.IntrastatLines.Amount.Value); Assert.AreEqual(ConvertLastDigit(Format(Round(Abs(DecVar), 1)).PadLeft(13, '0')), LibraryTextFileValidation.ReadValue(Header, ReadFromPosition, 13), IntrastatFileOutputErr); ReadFromPosition += 13; - Assert.AreEqual(Format('').PadLeft(41, '0'), LibraryTextFileValidation.ReadValue(Header, ReadFromPosition, 41), IntrastatFileOutputErr); + Assert.AreEqual(Format('').PadLeft(36, '0'), LibraryTextFileValidation.ReadValue(Header, ReadFromPosition, 36), IntrastatFileOutputErr); + ReadFromPosition += 36; + if FileType = 'C' then + Assert.AreEqual(Format('').PadLeft(5, '0'), LibraryTextFileValidation.ReadValue(Header, ReadFromPosition, 5), IntrastatFileOutputErr); // Verify Line Line1 := LibraryTextFileValidation.ReadLine(FileName, 2); @@ -3970,6 +4043,56 @@ codeunit 139511 "Intrastat IT Test" Choice := 2; end; + local procedure EnsureLookupRecordsExist() + var + "Area": Record "Area"; + CountryRegion: Record "Country/Region"; + EntryExitPoint: Record "Entry/Exit Point"; + ShipmentMethod: Record "Shipment Method"; + TransactionType: Record "Transaction Type"; + TransactionSpecification: Record "Transaction Specification"; + TransportMethod: Record "Transport Method"; + begin + if TransactionType.IsEmpty() then begin + TransactionType.Init(); + TransactionType.Code := CopyStr(LibraryRandom.RandText(MaxStrLen(TransactionType.Code)), 1, MaxStrLen(TransactionType.Code)); + TransactionType.Insert(); + end; + if "Area".IsEmpty() then begin + "Area".Init(); + "Area".Code := CopyStr(LibraryRandom.RandText(MaxStrLen("Area".Code)), 1, MaxStrLen("Area".Code)); + "Area".Insert(); + end; + if TransactionSpecification.IsEmpty() then begin + TransactionSpecification.Init(); + TransactionSpecification.Code := CopyStr(LibraryRandom.RandText(MaxStrLen(TransactionSpecification.Code)), 1, MaxStrLen(TransactionSpecification.Code)); + TransactionSpecification.Insert(); + end; + TransactionSpecification.FindFirst(); + CountryRegion.SetRange("EU Country/Region Code", TransactionSpecification.Code); + if CountryRegion.IsEmpty() then begin + CountryRegion.Init(); + CountryRegion.Code := CopyStr(LibraryUtility.GenerateRandomCode(CountryRegion.FieldNo(Code), Database::"Country/Region"), 1, MaxStrLen(CountryRegion.Code)); + CountryRegion."EU Country/Region Code" := TransactionSpecification.Code; + CountryRegion.Insert(true); + end; + if TransportMethod.IsEmpty() then begin + TransportMethod.Init(); + TransportMethod.Code := CopyStr(LibraryRandom.RandText(MaxStrLen(TransportMethod.Code)), 1, MaxStrLen(TransportMethod.Code)); + TransportMethod.Insert(); + end; + if EntryExitPoint.IsEmpty() then begin + EntryExitPoint.Init(); + EntryExitPoint.Code := CopyStr(LibraryRandom.RandText(MaxStrLen(EntryExitPoint.Code)), 1, MaxStrLen(EntryExitPoint.Code)); + EntryExitPoint.Insert(); + end; + if ShipmentMethod.IsEmpty() then begin + ShipmentMethod.Init(); + ShipmentMethod.Code := CopyStr(LibraryRandom.RandText(MaxStrLen(ShipmentMethod.Code)), 1, MaxStrLen(ShipmentMethod.Code)); + ShipmentMethod.Insert(); + end; + end; + local procedure CreateAndPostCorrectiveSalesCrMemo(PostedSalesInvoiceCode: Code[20]; PostingDate: Date): Code[20] var SalesHeader: Record "Sales Header"; diff --git a/Apps/NL/NLDigitalTaxDeclaration/test/src/DigipoortXML.Codeunit.al b/Apps/NL/NLDigitalTaxDeclaration/test/src/DigipoortXML.Codeunit.al index 3e35aec8bc..2db0fbe63c 100644 --- a/Apps/NL/NLDigitalTaxDeclaration/test/src/DigipoortXML.Codeunit.al +++ b/Apps/NL/NLDigitalTaxDeclaration/test/src/DigipoortXML.Codeunit.al @@ -21,8 +21,8 @@ codeunit 148000 "Digipoort XML" XbrliXbrlTok: Label 'xbrli:xbrl'; AttrBdITok: Label 'xmlns:bd-i'; AttrBdObTok: Label 'xmlns:bd-ob'; - BDDataEndpointTxt: Label 'https://www.nltaxonomie.nl/nt19/bd/20241211/dictionary/bd-data', Locked = true; - VATDeclarationSchemaEndpointTxt: Label 'http://www.nltaxonomie.nl/nt19/bd/20241211/entrypoints/bd-rpt-ob-aangifte-2025.xsd', Locked = true; + BDDataEndpointTxt: Label 'http://www.nltaxonomie.nl/nt20/bd/20251210/dictionary/bd-data', Locked = true; + VATDeclarationSchemaEndpointTxt: Label 'http://www.nltaxonomie.nl/nt20/bd/20251210/entrypoints/bd-rpt-ob-aangifte-2026.xsd', Locked = true; IncorrectNumberOfNodesErr: Label 'Incorrect number of node %1', Comment = '%1 = the name of the node'; [Test] diff --git a/Apps/NO/ElectronicVATSubmission/test/src/LibraryElecVATSubmission.Codeunit.al b/Apps/NO/ElectronicVATSubmission/test/src/LibraryElecVATSubmission.Codeunit.al index a18083561c..faf5af8331 100644 --- a/Apps/NO/ElectronicVATSubmission/test/src/LibraryElecVATSubmission.Codeunit.al +++ b/Apps/NO/ElectronicVATSubmission/test/src/LibraryElecVATSubmission.Codeunit.al @@ -161,12 +161,17 @@ codeunit 148130 "Library - Elec. VAT Submission" local procedure SetOAuthSetupTestTokens(var OAuth20Setup: Record "OAuth 2.0 Setup") begin - with OAuth20Setup do begin - SetToken("Client ID", 'Dummy Test Client ID'); - SetToken("Client Secret", 'Dummy Test Client Secret'); - SetToken("Access Token", 'Dummy Test Access Token'); - SetToken("Refresh Token", 'Dummy Test Refresh Token'); - end; + SetIsolatedStorageToken(OAuth20Setup, OAuth20Setup."Client ID", 'Dummy Test Client ID'); + SetIsolatedStorageToken(OAuth20Setup, OAuth20Setup."Client Secret", 'Dummy Test Client Secret'); + SetIsolatedStorageToken(OAuth20Setup, OAuth20Setup."Access Token", 'Dummy Test Access Token'); + SetIsolatedStorageToken(OAuth20Setup, OAuth20Setup."Refresh Token", 'Dummy Test Refresh Token'); + end; + + local procedure SetIsolatedStorageToken(var OAuth20Setup: Record "OAuth 2.0 Setup"; var TokenKey: Guid; TokenValue: Text) + begin + if IsNullGuid(TokenKey) then + TokenKey := CreateGuid(); + IsolatedStorage.Set(TokenKey, TokenValue, OAuth20Setup.GetTokenDataScope()); end; local procedure CreateVATSpecification(): Code[50] diff --git a/Apps/US/HybridSL_US/test/app.json b/Apps/US/HybridSL_US/test/app.json index 373d67e633..2fc6d44e46 100644 --- a/Apps/US/HybridSL_US/test/app.json +++ b/Apps/US/HybridSL_US/test/app.json @@ -24,7 +24,7 @@ "version": "29.0.0.0" }, { - "id": "2c75580e-ca19-49be-899b-d0b59fc3f2f3", + "id": "40f34440-fcff-4601-a664-69ad316f4324", "publisher": "Microsoft", "name": "Dynamics SL Migration - US", "version": "29.0.0.0" diff --git a/Apps/US/HybridSL_US/test/src/SLBCVendorLedgerEntryData.XmlPort.al b/Apps/US/HybridSL_US/test/src/SLBCVendorLedgerEntryData.XmlPort.al index ea03ec9c38..e6570afd6a 100644 --- a/Apps/US/HybridSL_US/test/src/SLBCVendorLedgerEntryData.XmlPort.al +++ b/Apps/US/HybridSL_US/test/src/SLBCVendorLedgerEntryData.XmlPort.al @@ -101,12 +101,11 @@ xmlport 147661 "SL BC Vendor Ledger Entry Data" procedure GetExpectedVendorLedgerEntries(var NewTempVendorLedgerEntry: Record "Vendor Ledger Entry" temporary) begin - if TempVendorLedgerEntry.FindSet() then begin + if TempVendorLedgerEntry.FindSet() then repeat NewTempVendorLedgerEntry.Copy(TempVendorLedgerEntry); NewTempVendorLedgerEntry.Insert(); until TempVendorLedgerEntry.Next() = 0; - end; end; var diff --git a/Apps/US/HybridSL_US/test/src/SLBCVendorNo1099Data.XmlPost.al b/Apps/US/HybridSL_US/test/src/SLBCVendorNo1099Data.XmlPort.al similarity index 100% rename from Apps/US/HybridSL_US/test/src/SLBCVendorNo1099Data.XmlPost.al rename to Apps/US/HybridSL_US/test/src/SLBCVendorNo1099Data.XmlPort.al diff --git a/Apps/US/HybridSL_US/test/src/SLBCVendorWith1099Data.XmlPort.al b/Apps/US/HybridSL_US/test/src/SLBCVendorWith1099Data.XmlPort.al index a58f1d58c1..f459b5a92e 100644 --- a/Apps/US/HybridSL_US/test/src/SLBCVendorWith1099Data.XmlPort.al +++ b/Apps/US/HybridSL_US/test/src/SLBCVendorWith1099Data.XmlPort.al @@ -145,12 +145,11 @@ xmlport 147657 "SL BC Vendor With 1099 Data" procedure GetExpectedVendors(var NewTempVendor: Record Vendor temporary) begin - if TempVendor.FindSet() then begin + if TempVendor.FindSet() then repeat NewTempVendor.Copy(TempVendor); NewTempVendor.Insert(); until TempVendor.Next() = 0; - end; end; var diff --git a/Apps/US/HybridSL_US/test/src/SLMigrationVendor1099Tests.Codeunit.al b/Apps/US/HybridSL_US/test/src/SLMigrationVendor1099Tests.Codeunit.al index ac2392d139..fa454bd360 100644 --- a/Apps/US/HybridSL_US/test/src/SLMigrationVendor1099Tests.Codeunit.al +++ b/Apps/US/HybridSL_US/test/src/SLMigrationVendor1099Tests.Codeunit.al @@ -72,7 +72,6 @@ codeunit 147650 "SL Migration Vendor 1099 Tests" procedure TestMappingCreated() var SLCompanyAdditionalSettings: Record "SL Company Additional Settings"; - SLSupportedTaxYear: Record "SL Supported Tax Year"; TempSL1099BoxMapping: Record "SL 1099 Box Mapping" temporary; TempSLSupportedTaxYear: Record "SL Supported Tax Year" temporary; SLCloudMigrationUS: Codeunit "SL Cloud Migration US"; @@ -179,8 +178,6 @@ codeunit 147650 "SL Migration Vendor 1099 Tests" var SLAPBalances: Record "SL AP_Balances"; SLAPSetup: Record "SL APSetup"; - SLCompanyAdditionalSettings: Record "SL Company Additional Settings"; - SLCompanyMigrationSettings: Record "SL Company Migration Settings"; SLVendor: Record "SL Vendor"; begin diff --git a/Apps/US/IRSForms/app/src/Document/IRS1099CreateFormDocs.Report.al b/Apps/US/IRSForms/app/src/Document/IRS1099CreateFormDocs.Report.al index b3bc2f52b3..e0295c20ad 100644 --- a/Apps/US/IRSForms/app/src/Document/IRS1099CreateFormDocs.Report.al +++ b/Apps/US/IRSForms/app/src/Document/IRS1099CreateFormDocs.Report.al @@ -12,7 +12,7 @@ report 10035 "IRS 1099 Create Form Docs" { Caption = 'IRS 1099 Create Form Documents'; ProcessingOnly = true; - ApplicationArea = BasicUS; + ApplicationArea = BasicCA, BasicUS; requestpage { @@ -25,7 +25,7 @@ report 10035 "IRS 1099 Create Form Docs" Caption = 'Options'; field(Period; PeriodNo) { - ApplicationArea = BasicUS; + ApplicationArea = BasicCA, BasicUS; Caption = 'Period'; ToolTip = 'Specifies the period to create a form document for'; TableRelation = "IRS Reporting Period"; @@ -37,14 +37,14 @@ report 10035 "IRS 1099 Create Form Docs" } field(Vendor; VendorNo) { - ApplicationArea = BasicUS; + ApplicationArea = BasicCA, BasicUS; Caption = 'Vendor No.'; ToolTip = 'Specifies the vendor to create a form document for. If this field is empty then forms will be created for all vendors.'; TableRelation = Vendor; } field(Form; FormNo) { - ApplicationArea = BasicUS; + ApplicationArea = BasicCA, BasicUS; Caption = 'Form No.'; ToolTip = 'Specifies the form to create a form document for. If this field is empty then forms will be created for all forms.'; TableRelation = "IRS 1099 Form"."No."; @@ -77,7 +77,7 @@ report 10035 "IRS 1099 Create Form Docs" } field(ReplaceControl; Replace) { - ApplicationArea = BasicUS; + ApplicationArea = BasicCA, BasicUS; Caption = 'Replace'; ToolTip = 'Specifies whether the newly created forms will replace the existing ones. If this option is not selected then only new forms will be created and the existing ones remain the same.'; } diff --git a/Apps/US/IRSForms/app/src/Document/IRS1099FormDocLineDetails.Page.al b/Apps/US/IRSForms/app/src/Document/IRS1099FormDocLineDetails.Page.al index 622734ec2b..4ac2f7992a 100644 --- a/Apps/US/IRSForms/app/src/Document/IRS1099FormDocLineDetails.Page.al +++ b/Apps/US/IRSForms/app/src/Document/IRS1099FormDocLineDetails.Page.al @@ -1,4 +1,4 @@ -// ------------------------------------------------------------------------------------------------ +// ------------------------------------------------------------------------------------------------ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // ------------------------------------------------------------------------------------------------ @@ -8,7 +8,7 @@ page 10049 "IRS 1099 Form Doc Line Details" { PageType = List; SourceTable = "IRS 1099 Form Doc. Line Detail"; - ApplicationArea = BasicUS; + ApplicationArea = BasicCA, BasicUS; Editable = false; layout diff --git a/Apps/US/IRSForms/app/src/Document/IRS1099FormDocSubform.Page.al b/Apps/US/IRSForms/app/src/Document/IRS1099FormDocSubform.Page.al index 0bb1c706ef..ceda4ddad5 100644 --- a/Apps/US/IRSForms/app/src/Document/IRS1099FormDocSubform.Page.al +++ b/Apps/US/IRSForms/app/src/Document/IRS1099FormDocSubform.Page.al @@ -1,4 +1,4 @@ -// ------------------------------------------------------------------------------------------------ +// ------------------------------------------------------------------------------------------------ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // ------------------------------------------------------------------------------------------------ @@ -13,7 +13,7 @@ page 10047 "IRS 1099 Form Doc. Subform" MultipleNewLines = true; PageType = ListPart; SourceTable = "IRS 1099 Form Doc. Line"; - ApplicationArea = BasicUS; + ApplicationArea = BasicCA, BasicUS; layout { diff --git a/Apps/US/IRSForms/app/src/Document/IRS1099FormDocument.Page.al b/Apps/US/IRSForms/app/src/Document/IRS1099FormDocument.Page.al index f477616647..f69952b5ef 100644 --- a/Apps/US/IRSForms/app/src/Document/IRS1099FormDocument.Page.al +++ b/Apps/US/IRSForms/app/src/Document/IRS1099FormDocument.Page.al @@ -1,4 +1,4 @@ -// ------------------------------------------------------------------------------------------------ +// ------------------------------------------------------------------------------------------------ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // ------------------------------------------------------------------------------------------------ @@ -8,7 +8,7 @@ page 10037 "IRS 1099 Form Document" { PageType = Card; SourceTable = "IRS 1099 Form Doc. Header"; - ApplicationArea = BasicUS; + ApplicationArea = BasicCA, BasicUS; layout { @@ -81,7 +81,7 @@ page 10037 "IRS 1099 Form Document" } part(FormLines; "IRS 1099 Form Doc. Subform") { - ApplicationArea = BasicUS; + ApplicationArea = BasicCA, BasicUS; SubPageLink = "Document ID" = field(ID), "Period No." = field("Period No."), "Vendor No." = field("Vendor No."), "Form No." = field("Form No."); Editable = IsLinesEditable; Enabled = IsLinesEditable; @@ -115,7 +115,7 @@ page 10037 "IRS 1099 Form Document" Image = ReleaseDoc; action(Release) { - ApplicationArea = BasicUS; + ApplicationArea = BasicCA, BasicUS; Caption = 'Re&lease'; Enabled = Rec.Status = Rec.Status::Open; Image = ReleaseDoc; @@ -131,7 +131,7 @@ page 10037 "IRS 1099 Form Document" } action(Reopen) { - ApplicationArea = BasicUS; + ApplicationArea = BasicCA, BasicUS; Caption = 'Re&open'; Enabled = Rec.Status <> Rec.Status::Open; Image = ReOpen; @@ -161,7 +161,7 @@ page 10037 "IRS 1099 Form Document" } action(AllowCorrection) { - ApplicationArea = BasicUS; + ApplicationArea = BasicCA, BasicUS; Caption = 'Allow Correction'; Image = ResetStatus; ToolTip = 'Allows the form to be reopened for correction. After the correction is done, the form must be released again.'; @@ -175,7 +175,7 @@ page 10037 "IRS 1099 Form Document" } action(Print) { - ApplicationArea = BasicUS; + ApplicationArea = BasicCA, BasicUS; Caption = 'Print'; Ellipsis = true; Image = PrintAcknowledgement; @@ -190,7 +190,7 @@ page 10037 "IRS 1099 Form Document" } action(Reports) { - ApplicationArea = BasicUS; + ApplicationArea = BasicCA, BasicUS; Caption = 'Reports'; Ellipsis = true; Image = Report; @@ -200,7 +200,7 @@ page 10037 "IRS 1099 Form Document" } action(SendEmail) { - ApplicationArea = BasicUS; + ApplicationArea = BasicCA, BasicUS; Caption = 'Send Email'; Ellipsis = true; Image = Email; diff --git a/Apps/US/IRSForms/app/src/Document/IRS1099FormDocuments.Page.al b/Apps/US/IRSForms/app/src/Document/IRS1099FormDocuments.Page.al index f2b0ccbd08..dbf966e23d 100644 --- a/Apps/US/IRSForms/app/src/Document/IRS1099FormDocuments.Page.al +++ b/Apps/US/IRSForms/app/src/Document/IRS1099FormDocuments.Page.al @@ -1,4 +1,4 @@ -// ------------------------------------------------------------------------------------------------ +// ------------------------------------------------------------------------------------------------ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // ------------------------------------------------------------------------------------------------ @@ -11,7 +11,7 @@ page 10036 "IRS 1099 Form Documents" PageType = List; SourceTable = "IRS 1099 Form Doc. Header"; CardPageId = "IRS 1099 Form Document"; - ApplicationArea = BasicUS; + ApplicationArea = BasicCA, BasicUS; UsageCategory = Administration; RefreshOnActivate = true; Editable = false; diff --git a/Apps/US/IRSForms/app/src/Emailing/IRS1099EmailContentSetup.Page.al b/Apps/US/IRSForms/app/src/Emailing/IRS1099EmailContentSetup.Page.al index d6fbdf36c3..0a253ca666 100644 --- a/Apps/US/IRSForms/app/src/Emailing/IRS1099EmailContentSetup.Page.al +++ b/Apps/US/IRSForms/app/src/Emailing/IRS1099EmailContentSetup.Page.al @@ -7,7 +7,7 @@ namespace Microsoft.Finance.VAT.Reporting; page 10055 "IRS 1099 Email Content Setup" { PageType = Card; - ApplicationArea = BasicUS; + ApplicationArea = BasicCA, BasicUS; layout { diff --git a/Apps/US/IRSForms/app/src/Emailing/IRS1099SendEmail.Report.al b/Apps/US/IRSForms/app/src/Emailing/IRS1099SendEmail.Report.al index 9e70cc6373..b60bfbef59 100644 --- a/Apps/US/IRSForms/app/src/Emailing/IRS1099SendEmail.Report.al +++ b/Apps/US/IRSForms/app/src/Emailing/IRS1099SendEmail.Report.al @@ -1,4 +1,4 @@ -// ------------------------------------------------------------------------------------------------ +// ------------------------------------------------------------------------------------------------ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // ------------------------------------------------------------------------------------------------ @@ -8,7 +8,7 @@ using System.Threading; report 10033 "IRS 1099 Send Email" { - ApplicationArea = BasicUS; + ApplicationArea = BasicCA, BasicUS; ProcessingOnly = true; dataset @@ -32,7 +32,7 @@ report 10033 "IRS 1099 Send Email" ShowCaption = false; field(ReportTypeField; ReportType) { - ApplicationArea = BasicUS; + ApplicationArea = BasicCA, BasicUS; Caption = 'Report Type'; ToolTip = 'Specifies the 1099 report type to send in the email. Note that only documents with status Submitted will be processed.'; @@ -43,7 +43,7 @@ report 10033 "IRS 1099 Send Email" } field(ResendEmailField; ResendEmail) { - ApplicationArea = BasicUS; + ApplicationArea = BasicCA, BasicUS; Visible = ResendEmailVisible; Caption = 'Resend Email'; #pragma warning disable AA0219 diff --git a/Apps/US/IRSForms/app/src/Extensions/IRS1099GeneralJournal.PageExt.al b/Apps/US/IRSForms/app/src/Extensions/IRS1099GeneralJournal.PageExt.al index 67e99b0d98..1eaad429e2 100644 --- a/Apps/US/IRSForms/app/src/Extensions/IRS1099GeneralJournal.PageExt.al +++ b/Apps/US/IRSForms/app/src/Extensions/IRS1099GeneralJournal.PageExt.al @@ -1,4 +1,4 @@ -// ------------------------------------------------------------------------------------------------ +// ------------------------------------------------------------------------------------------------ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // ------------------------------------------------------------------------------------------------ @@ -14,18 +14,18 @@ pageextension 10063 "IRS 1099 General Journal" extends "General Journal" { field("IRS 1099 Reporting Period"; Rec."IRS 1099 Reporting Period") { - ApplicationArea = BasicUS; + ApplicationArea = BasicCA, BasicUS; Tooltip = 'Specifies the IRS reporting period for the document.'; } field("IRS 1099 Form No."; Rec."IRS 1099 Form No.") { - ApplicationArea = BasicUS; + ApplicationArea = BasicCA, BasicUS; Tooltip = 'Specifies the IRS form number for the document.'; Editable = NewFieldsAreEditable; } field("IRS 1099 Form Box No."; Rec."IRS 1099 Form Box No.") { - ApplicationArea = BasicUS; + ApplicationArea = BasicCA, BasicUS; Tooltip = 'Specifies the IRS form box number for the vendor ledger entry.'; Editable = NewFieldsAreEditable; } diff --git a/Apps/US/IRSForms/app/src/Extensions/IRS1099PostedPurchCrMemo.PageExt.al b/Apps/US/IRSForms/app/src/Extensions/IRS1099PostedPurchCrMemo.PageExt.al index 25c4c8d084..6f5702eef2 100644 --- a/Apps/US/IRSForms/app/src/Extensions/IRS1099PostedPurchCrMemo.PageExt.al +++ b/Apps/US/IRSForms/app/src/Extensions/IRS1099PostedPurchCrMemo.PageExt.al @@ -14,18 +14,18 @@ pageextension 10061 "IRS 1099 Posted Purch. Cr.Memo" extends "Posted Purchase Cr { field("IRS 1099 Reporting Period"; Rec."IRS 1099 Reporting Period") { - ApplicationArea = BasicUS; + ApplicationArea = BasicCA, BasicUS; Tooltip = 'Specifies the IRS reporting period for the document.'; } field("IRS 1099 Form No."; Rec."IRS 1099 Form No.") { - ApplicationArea = BasicUS; + ApplicationArea = BasicCA, BasicUS; Tooltip = 'Specifies the IRS form number for the document.'; Editable = false; } field("IRS 1099 Form Box No."; Rec."IRS 1099 Form Box No.") { - ApplicationArea = BasicUS; + ApplicationArea = BasicCA, BasicUS; Tooltip = 'Specifies the IRS form box number for the vendor ledger entry.'; Editable = false; } diff --git a/Apps/US/IRSForms/app/src/Extensions/IRS1099PostedPurchInv.PageExt.al b/Apps/US/IRSForms/app/src/Extensions/IRS1099PostedPurchInv.PageExt.al index 8e91a42dba..1d7832af30 100644 --- a/Apps/US/IRSForms/app/src/Extensions/IRS1099PostedPurchInv.PageExt.al +++ b/Apps/US/IRSForms/app/src/Extensions/IRS1099PostedPurchInv.PageExt.al @@ -14,18 +14,18 @@ pageextension 10055 "IRS 1099 Posted Purch. Inv." extends "Posted Purchase Invoi { field("IRS 1099 Reporting Period"; Rec."IRS 1099 Reporting Period") { - ApplicationArea = BasicUS; + ApplicationArea = BasicCA, BasicUS; Tooltip = 'Specifies the IRS reporting period for the document.'; } field("IRS 1099 Form No."; Rec."IRS 1099 Form No.") { - ApplicationArea = BasicUS; + ApplicationArea = BasicCA, BasicUS; Tooltip = 'Specifies the IRS form number for the document.'; Editable = false; } field("IRS 1099 Form Box No."; Rec."IRS 1099 Form Box No.") { - ApplicationArea = BasicUS; + ApplicationArea = BasicCA, BasicUS; Tooltip = 'Specifies the IRS form box number for the vendor ledger entry.'; Editable = false; } diff --git a/Apps/US/IRSForms/app/src/Extensions/IRS1099PstdPCrMemoSub.PageExt.al b/Apps/US/IRSForms/app/src/Extensions/IRS1099PstdPCrMemoSub.PageExt.al index 14429f1f7b..d7b2a300d7 100644 --- a/Apps/US/IRSForms/app/src/Extensions/IRS1099PstdPCrMemoSub.PageExt.al +++ b/Apps/US/IRSForms/app/src/Extensions/IRS1099PstdPCrMemoSub.PageExt.al @@ -14,7 +14,7 @@ pageextension 10068 "IRS 1099 Pstd. P. CrMemo Sub." extends "Posted Purch. Cr. M { field("1099 Liable"; Rec."1099 Liable") { - ApplicationArea = BasicUS; + ApplicationArea = BasicCA, BasicUS; Visible = false; } } diff --git a/Apps/US/IRSForms/app/src/Extensions/IRS1099PstdPurchInvSub.PageExt.al b/Apps/US/IRSForms/app/src/Extensions/IRS1099PstdPurchInvSub.PageExt.al index 57e5b59141..b8d37fcac7 100644 --- a/Apps/US/IRSForms/app/src/Extensions/IRS1099PstdPurchInvSub.PageExt.al +++ b/Apps/US/IRSForms/app/src/Extensions/IRS1099PstdPurchInvSub.PageExt.al @@ -14,7 +14,7 @@ pageextension 10067 "IRS 1099 Pstd. Purch.Inv. Sub." extends "Posted Purch. Invo { field("1099 Liable"; Rec."1099 Liable") { - ApplicationArea = BasicUS; + ApplicationArea = BasicCA, BasicUS; Visible = false; } } diff --git a/Apps/US/IRSForms/app/src/Extensions/IRS1099PurchCrMemo.PageExt.al b/Apps/US/IRSForms/app/src/Extensions/IRS1099PurchCrMemo.PageExt.al index ae99672c5e..7eff32fac6 100644 --- a/Apps/US/IRSForms/app/src/Extensions/IRS1099PurchCrMemo.PageExt.al +++ b/Apps/US/IRSForms/app/src/Extensions/IRS1099PurchCrMemo.PageExt.al @@ -14,18 +14,18 @@ pageextension 10059 "IRS 1099 Purch. Cr. Memo" extends "Purchase Credit Memo" { field("IRS 1099 Reporting Period"; Rec."IRS 1099 Reporting Period") { - ApplicationArea = BasicUS; + ApplicationArea = BasicCA, BasicUS; Tooltip = 'Specifies the IRS reporting period for the document.'; } field("IRS 1099 Form No."; Rec."IRS 1099 Form No.") { - ApplicationArea = BasicUS; + ApplicationArea = BasicCA, BasicUS; Tooltip = 'Specifies the IRS form number for the document.'; Editable = NewFieldsAreEditable; } field("IRS 1099 Form Box No."; Rec."IRS 1099 Form Box No.") { - ApplicationArea = BasicUS; + ApplicationArea = BasicCA, BasicUS; Tooltip = 'Specifies the IRS form box number for the vendor ledger entry.'; Editable = NewFieldsAreEditable; } diff --git a/Apps/US/IRSForms/app/src/Extensions/IRS1099PurchCrMemoSub.PageExt.al b/Apps/US/IRSForms/app/src/Extensions/IRS1099PurchCrMemoSub.PageExt.al index 8f2e191467..b388f7f2b7 100644 --- a/Apps/US/IRSForms/app/src/Extensions/IRS1099PurchCrMemoSub.PageExt.al +++ b/Apps/US/IRSForms/app/src/Extensions/IRS1099PurchCrMemoSub.PageExt.al @@ -14,7 +14,7 @@ pageextension 10066 "IRS 1099 Purch. Cr.Memo Sub." extends "Purch. Cr. Memo Subf { field("1099 Liable"; Rec."1099 Liable") { - ApplicationArea = BasicUS; + ApplicationArea = BasicCA, BasicUS; Visible = false; } } diff --git a/Apps/US/IRSForms/app/src/Extensions/IRS1099PurchInv.PageExt.al b/Apps/US/IRSForms/app/src/Extensions/IRS1099PurchInv.PageExt.al index 113e7a1314..db0d485573 100644 --- a/Apps/US/IRSForms/app/src/Extensions/IRS1099PurchInv.PageExt.al +++ b/Apps/US/IRSForms/app/src/Extensions/IRS1099PurchInv.PageExt.al @@ -14,18 +14,18 @@ pageextension 10052 "IRS 1099 Purch. Inv." extends "Purchase Invoice" { field("IRS 1099 Reporting Period"; Rec."IRS 1099 Reporting Period") { - ApplicationArea = BasicUS; + ApplicationArea = BasicCA, BasicUS; Tooltip = 'Specifies the IRS reporting period for the document.'; } field("IRS 1099 Form No."; Rec."IRS 1099 Form No.") { - ApplicationArea = BasicUS; + ApplicationArea = BasicCA, BasicUS; Tooltip = 'Specifies the IRS form number for the document.'; Editable = NewFieldsAreEditable; } field("IRS 1099 Form Box No."; Rec."IRS 1099 Form Box No.") { - ApplicationArea = BasicUS; + ApplicationArea = BasicCA, BasicUS; Tooltip = 'Specifies the IRS form box number.'; Editable = NewFieldsAreEditable; } diff --git a/Apps/US/IRSForms/app/src/Extensions/IRS1099PurchInvSubform.PageExt.al b/Apps/US/IRSForms/app/src/Extensions/IRS1099PurchInvSubform.PageExt.al index 499b2a004d..932be16c10 100644 --- a/Apps/US/IRSForms/app/src/Extensions/IRS1099PurchInvSubform.PageExt.al +++ b/Apps/US/IRSForms/app/src/Extensions/IRS1099PurchInvSubform.PageExt.al @@ -14,7 +14,7 @@ pageextension 10065 "IRS 1099 Purch. Inv. Subform" extends "Purch. Invoice Subfo { field("1099 Liable"; Rec."1099 Liable") { - ApplicationArea = BasicUS; + ApplicationArea = BasicCA, BasicUS; Visible = false; } } diff --git a/Apps/US/IRSForms/app/src/Extensions/IRS1099PurchOrder.PageExt.al b/Apps/US/IRSForms/app/src/Extensions/IRS1099PurchOrder.PageExt.al index 5d1e6a1243..975b9dbb76 100644 --- a/Apps/US/IRSForms/app/src/Extensions/IRS1099PurchOrder.PageExt.al +++ b/Apps/US/IRSForms/app/src/Extensions/IRS1099PurchOrder.PageExt.al @@ -14,18 +14,18 @@ pageextension 10058 "IRS 1099 Purch. Order" extends "Purchase Order" { field("IRS 1099 Reporting Period"; Rec."IRS 1099 Reporting Period") { - ApplicationArea = BasicUS; + ApplicationArea = BasicCA, BasicUS; Tooltip = 'Specifies the IRS reporting period for the document.'; } field("IRS 1099 Form No."; Rec."IRS 1099 Form No.") { - ApplicationArea = BasicUS; + ApplicationArea = BasicCA, BasicUS; Tooltip = 'Specifies the IRS form number for the document.'; Editable = NewFieldsAreEditable; } field("IRS 1099 Form Box No."; Rec."IRS 1099 Form Box No.") { - ApplicationArea = BasicUS; + ApplicationArea = BasicCA, BasicUS; Tooltip = 'Specifies the IRS form box number for the vendor ledger entry.'; Editable = NewFieldsAreEditable; } diff --git a/Apps/US/IRSForms/app/src/Extensions/IRS1099PurchOrderSubform.PageExt.al b/Apps/US/IRSForms/app/src/Extensions/IRS1099PurchOrderSubform.PageExt.al index 3a35b736eb..a1aeafe118 100644 --- a/Apps/US/IRSForms/app/src/Extensions/IRS1099PurchOrderSubform.PageExt.al +++ b/Apps/US/IRSForms/app/src/Extensions/IRS1099PurchOrderSubform.PageExt.al @@ -14,7 +14,7 @@ pageextension 10064 "IRS 1099 Purch. Order Subform" extends "Purchase Order Subf { field("1099 Liable"; Rec."1099 Liable") { - ApplicationArea = BasicUS; + ApplicationArea = BasicCA, BasicUS; Visible = false; } } diff --git a/Apps/US/IRSForms/app/src/Extensions/IRS1099PurchRetOrderSub.PageExt.al b/Apps/US/IRSForms/app/src/Extensions/IRS1099PurchRetOrderSub.PageExt.al index 87a286e1ab..0dce7cf47b 100644 --- a/Apps/US/IRSForms/app/src/Extensions/IRS1099PurchRetOrderSub.PageExt.al +++ b/Apps/US/IRSForms/app/src/Extensions/IRS1099PurchRetOrderSub.PageExt.al @@ -14,7 +14,7 @@ pageextension 10069 "IRS 1099 Purch. Ret.Order Sub." extends "Purchase Return Or { field("1099 Liable"; Rec."1099 Liable") { - ApplicationArea = BasicUS; + ApplicationArea = BasicCA, BasicUS; Visible = false; } } diff --git a/Apps/US/IRSForms/app/src/Extensions/IRS1099PurchaseJournal.PageExt.al b/Apps/US/IRSForms/app/src/Extensions/IRS1099PurchaseJournal.PageExt.al index c65d54305d..c9e62bc0a5 100644 --- a/Apps/US/IRSForms/app/src/Extensions/IRS1099PurchaseJournal.PageExt.al +++ b/Apps/US/IRSForms/app/src/Extensions/IRS1099PurchaseJournal.PageExt.al @@ -1,4 +1,4 @@ -// ------------------------------------------------------------------------------------------------ +// ------------------------------------------------------------------------------------------------ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // ------------------------------------------------------------------------------------------------ @@ -14,17 +14,17 @@ pageextension 10062 "IRS 1099 Purchase Journal" extends "Purchase Journal" { field("IRS 1099 Reporting Period"; Rec."IRS 1099 Reporting Period") { - ApplicationArea = BasicUS; + ApplicationArea = BasicCA, BasicUS; Tooltip = 'Specifies the IRS reporting period for the document.'; } field("IRS 1099 Form No."; Rec."IRS 1099 Form No.") { - ApplicationArea = BasicUS; + ApplicationArea = BasicCA, BasicUS; Tooltip = 'Specifies the IRS form number for the document.'; } field("IRS 1099 Form Box No."; Rec."IRS 1099 Form Box No.") { - ApplicationArea = BasicUS; + ApplicationArea = BasicCA, BasicUS; Tooltip = 'Specifies the IRS form box number.'; } } diff --git a/Apps/US/IRSForms/app/src/Extensions/IRS1099VendorCard.PageExt.al b/Apps/US/IRSForms/app/src/Extensions/IRS1099VendorCard.PageExt.al index 28e0644781..408f61b6ed 100644 --- a/Apps/US/IRSForms/app/src/Extensions/IRS1099VendorCard.PageExt.al +++ b/Apps/US/IRSForms/app/src/Extensions/IRS1099VendorCard.PageExt.al @@ -1,4 +1,4 @@ -// ------------------------------------------------------------------------------------------------ +// ------------------------------------------------------------------------------------------------ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // ------------------------------------------------------------------------------------------------ @@ -16,7 +16,7 @@ pageextension 10053 "IRS 1099 Vendor Card" extends "Vendor Card" #pragma warning disable AL0432 field("IRS Reporting Period"; Rec."IRS Reporting Period") { - ApplicationArea = BasicUS; + ApplicationArea = BasicCA, BasicUS; ToolTip = 'Specifies the last IRS reporting period where the vendor has a vendor form box setup'; Visible = false; ObsoleteState = Pending; @@ -25,7 +25,7 @@ pageextension 10053 "IRS 1099 Vendor Card" extends "Vendor Card" } field("IRS 1099 Form No."; Rec."IRS 1099 Form No.") { - ApplicationArea = BasicUS; + ApplicationArea = BasicCA, BasicUS; ToolTip = 'Specifies the IRS form number where the vendor has a vendor form box setup'; Visible = false; ObsoleteState = Pending; @@ -34,7 +34,7 @@ pageextension 10053 "IRS 1099 Vendor Card" extends "Vendor Card" } field("IRS 1099 Form Box No."; Rec."IRS 1099 Form Box No.") { - ApplicationArea = BasicUS; + ApplicationArea = BasicCA, BasicUS; ToolTip = 'Specifies the IRS form box number where the vendor has a vendor form box setup'; Visible = false; ObsoleteState = Pending; @@ -45,21 +45,21 @@ pageextension 10053 "IRS 1099 Vendor Card" extends "Vendor Card" #endif field(IRSReportingPeriodNoField; IRSReportingPeriodNo) { - ApplicationArea = BasicUS; + ApplicationArea = BasicCA, BasicUS; Caption = 'IRS Reporting Period'; ToolTip = 'Specifies the current IRS reporting period where the vendor has a vendor form box setup'; Editable = false; } field(IRS1099FormNoField; IRS1099FormNo) { - ApplicationArea = BasicUS; + ApplicationArea = BasicCA, BasicUS; Caption = 'IRS 1099 Form No.'; ToolTip = 'Specifies the current IRS form number where the vendor has a vendor form box setup'; Editable = false; } field(IRS1099FormBoxNoField; IRS1099FormBoxNo) { - ApplicationArea = BasicUS; + ApplicationArea = BasicCA, BasicUS; Caption = 'IRS 1099 Form Box No.'; ToolTip = 'Specifies the current IRS form box number where the vendor has a vendor form box setup'; Editable = false; @@ -71,19 +71,19 @@ pageextension 10053 "IRS 1099 Vendor Card" extends "Vendor Card" } field("Receive Elec. IRS Forms"; Rec."Receiving 1099 E-Form Consent") { - ApplicationArea = BasicUS; + ApplicationArea = BasicCA, BasicUS; #pragma warning disable AA0219 Tooltip = 'By selecting this field, you acknowledge that your vendor has provided signed consent to receive their 1099 form electronically.'; #pragma warning restore AA0219 } field("E-Mail For IRS"; Rec."E-Mail For IRS") { - ApplicationArea = BasicUS; + ApplicationArea = BasicCA, BasicUS; ToolTip = 'Specifies the email address of the vendor to receive the IRS 1099 form.'; } field("FATCA Requirement"; Rec."FATCA Requirement") { - ApplicationArea = BasicUS; + ApplicationArea = BasicCA, BasicUS; ToolTip = 'Specifies if the vendor is set up to require FATCA filing.'; } } @@ -96,7 +96,7 @@ pageextension 10053 "IRS 1099 Vendor Card" extends "Vendor Card" action(IRS1099Setup) { Caption = 'IRS 1099 Setup'; - ApplicationArea = BasicUS; + ApplicationArea = BasicCA, BasicUS; Image = Vendor; Scope = Repeater; ToolTip = 'Specifies the setup for a vendor to be reported in IRS 1099 form in this period.'; diff --git a/Apps/US/IRSForms/app/src/Extensions/IRS1099VendorLedgerEntries.PageExt.al b/Apps/US/IRSForms/app/src/Extensions/IRS1099VendorLedgerEntries.PageExt.al index e73bb6fbb7..a7b7a2853b 100644 --- a/Apps/US/IRSForms/app/src/Extensions/IRS1099VendorLedgerEntries.PageExt.al +++ b/Apps/US/IRSForms/app/src/Extensions/IRS1099VendorLedgerEntries.PageExt.al @@ -14,22 +14,22 @@ pageextension 10048 "IRS 1099 Vendor Ledger Entries" extends "Vendor Ledger Entr { field("IRS 1099 Reporting Period"; Rec."IRS 1099 Reporting Period") { - ApplicationArea = BasicUS; + ApplicationArea = BasicCA, BasicUS; Tooltip = 'Specifies the IRS reporting period for the vendor ledger entry.'; } field("IRS 1099 Form No."; Rec."IRS 1099 Form No.") { - ApplicationArea = BasicUS; + ApplicationArea = BasicCA, BasicUS; Tooltip = 'Specifies the IRS form number for the vendor ledger entry.'; } field("IRS 1099 Form Box No."; Rec."IRS 1099 Form Box No.") { - ApplicationArea = BasicUS; + ApplicationArea = BasicCA, BasicUS; Tooltip = 'Specifies the IRS form box number for the vendor ledger entry.'; } field("IRS 1099 Reporting Amount"; Rec."IRS 1099 Reporting Amount") { - ApplicationArea = BasicUS; + ApplicationArea = BasicCA, BasicUS; Tooltip = 'Specifies the IRS reporting amount for the vendor ledger entry.'; } } diff --git a/Apps/US/IRSForms/app/src/Extensions/IRS1099VendorList.PageExt.al b/Apps/US/IRSForms/app/src/Extensions/IRS1099VendorList.PageExt.al index b79b2450f1..fe544abbd6 100644 --- a/Apps/US/IRSForms/app/src/Extensions/IRS1099VendorList.PageExt.al +++ b/Apps/US/IRSForms/app/src/Extensions/IRS1099VendorList.PageExt.al @@ -1,4 +1,4 @@ -// ------------------------------------------------------------------------------------------------ +// ------------------------------------------------------------------------------------------------ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // ------------------------------------------------------------------------------------------------ @@ -14,21 +14,21 @@ pageextension 10050 "IRS 1099 Vendor List" extends "Vendor List" { field(IRSReportingPeriodNoField; IRSReportingPeriodNo) { - ApplicationArea = BasicUS; + ApplicationArea = BasicCA, BasicUS; Caption = 'IRS Reporting Period'; ToolTip = 'Specifies the current IRS reporting period where the vendor has a vendor form box setup'; Editable = false; } field(IRS1099FormNoField; IRS1099FormNo) { - ApplicationArea = BasicUS; + ApplicationArea = BasicCA, BasicUS; Caption = 'IRS 1099 Form No.'; ToolTip = 'Specifies the current IRS form number where the vendor has a vendor form box setup'; Editable = false; } field(IRS1099FormBoxNoField; IRS1099FormBoxNo) { - ApplicationArea = BasicUS; + ApplicationArea = BasicCA, BasicUS; Caption = 'IRS 1099 Form Box No.'; ToolTip = 'Specifies the current IRS form box number where the vendor has a vendor form box setup'; Editable = false; @@ -42,7 +42,7 @@ pageextension 10050 "IRS 1099 Vendor List" extends "Vendor List" #pragma warning disable AL0432 field("IRS Reporting Period"; Rec."IRS Reporting Period") { - ApplicationArea = BasicUS; + ApplicationArea = BasicCA, BasicUS; ToolTip = 'Specifies the last IRS reporting period where the vendor has a vendor form box setup'; Visible = false; ObsoleteState = Pending; @@ -53,14 +53,14 @@ pageextension 10050 "IRS 1099 Vendor List" extends "Vendor List" #endif field("E-Mail For IRS"; Rec."E-Mail For IRS") { - ApplicationArea = BasicUS; + ApplicationArea = BasicCA, BasicUS; ToolTip = 'Specifies the email address of the vendor to receive the IRS 1099 form.'; } #if not CLEAN28 #pragma warning disable AL0432 field("IRS 1099 Form No."; Rec."IRS 1099 Form No.") { - ApplicationArea = BasicUS; + ApplicationArea = BasicCA, BasicUS; ToolTip = 'Specifies the IRS form number where the vendor has a vendor form box setup'; Visible = false; ObsoleteState = Pending; @@ -69,7 +69,7 @@ pageextension 10050 "IRS 1099 Vendor List" extends "Vendor List" } field("IRS 1099 Form Box No."; Rec."IRS 1099 Form Box No.") { - ApplicationArea = BasicUS; + ApplicationArea = BasicCA, BasicUS; ToolTip = 'Specifies the IRS form box number where the vendor has a vendor form box setup'; Visible = false; ObsoleteState = Pending; @@ -80,7 +80,7 @@ pageextension 10050 "IRS 1099 Vendor List" extends "Vendor List" #endif field("Receive Elec. IRS Forms"; Rec."Receiving 1099 E-Form Consent") { - ApplicationArea = BasicUS; + ApplicationArea = BasicCA, BasicUS; Tooltip = 'Specifies that your vendor has provided signed consent to receive their 1099 form electronically.'; } } @@ -92,7 +92,7 @@ pageextension 10050 "IRS 1099 Vendor List" extends "Vendor List" action(IRS1099Setup) { Caption = 'IRS 1099 Setup'; - ApplicationArea = BasicUS; + ApplicationArea = BasicCA, BasicUS; Image = Vendor; Scope = Repeater; ToolTip = 'Specifies the setup for a vendor to be reported in IRS 1099 form'; @@ -102,7 +102,7 @@ pageextension 10050 "IRS 1099 Vendor List" extends "Vendor List" action(Adjustments) { Caption = 'Adjustments'; - ApplicationArea = BasicUS; + ApplicationArea = BasicCA, BasicUS; Image = AdjustEntries; Scope = Repeater; ToolTip = 'Specifies the adjustment amount for certain form boxes for this vendor'; diff --git a/Apps/US/IRSForms/app/src/FIRE/IRS1099FIRE.Report.al b/Apps/US/IRSForms/app/src/FIRE/IRS1099FIRE.Report.al index 7d431d1a0e..a54779e88a 100644 --- a/Apps/US/IRSForms/app/src/FIRE/IRS1099FIRE.Report.al +++ b/Apps/US/IRSForms/app/src/FIRE/IRS1099FIRE.Report.al @@ -17,7 +17,7 @@ using System.Utilities; report 10039 "IRS 1099 FIRE" { - ApplicationArea = BasicUS; + ApplicationArea = BasicCA, BasicUS; Caption = 'IRS 1099 FIRE'; ProcessingOnly = true; UsageCategory = ReportsAndAnalysis; @@ -247,7 +247,7 @@ report 10039 "IRS 1099 FIRE" Caption = 'Options'; field(YearField; Year) { - ApplicationArea = BasicUS; + ApplicationArea = BasicCA, BasicUS; Caption = 'Calendar Year'; ToolTip = 'Specifies the tax year for the 1099 forms that you want to print. The default is the work date year. The taxes may apply to the previous calendar year so you may want to change this date if nothing prints.'; @@ -259,7 +259,7 @@ report 10039 "IRS 1099 FIRE" } field(TCCField; TCC) { - ApplicationArea = BasicUS; + ApplicationArea = BasicCA, BasicUS; Caption = 'Transmitter Control Code'; ToolTip = 'Specifies the control code of the transmitter that is used to electronically file 1099 forms.'; @@ -274,43 +274,43 @@ report 10039 "IRS 1099 FIRE" Caption = 'Transmitter Information'; field(TransmitterInfoName; TransmitterInfo.Name) { - ApplicationArea = BasicUS; + ApplicationArea = BasicCA, BasicUS; Caption = 'Transmitter Name'; ToolTip = 'Specifies the name of the transmitter that is used to electronically file 1099 forms.'; } field(TransmitterInfoAddress; TransmitterInfo.Address) { - ApplicationArea = BasicUS; + ApplicationArea = BasicCA, BasicUS; Caption = 'Street Address'; ToolTip = 'Specifies the address of the vendor.'; } field(TransmitterInfoCity; TransmitterInfo.City) { - ApplicationArea = BasicUS; + ApplicationArea = BasicCA, BasicUS; Caption = 'City'; ToolTip = 'Specifies the city in the vendor''s address.'; } field(TransmitterInfoCounty; TransmitterInfo.County) { - ApplicationArea = BasicUS; + ApplicationArea = BasicCA, BasicUS; Caption = 'State'; ToolTip = 'Specifies the state as a part of the address.'; } field(TransmitterInfoPostCode; TransmitterInfo."Post Code") { - ApplicationArea = BasicUS; + ApplicationArea = BasicCA, BasicUS; Caption = 'ZIP Code'; ToolTip = 'Specifies the vendor''s ZIP code as a part of the address.'; } field(TransmitterInfoFederalIDNo; TransmitterInfo."Federal ID No.") { - ApplicationArea = BasicUS; + ApplicationArea = BasicCA, BasicUS; Caption = 'Employer ID'; ToolTip = 'Specifies the employer at the vendor.'; } field(ContactNameField; ContactName) { - ApplicationArea = BasicUS; + ApplicationArea = BasicCA, BasicUS; Caption = 'Contact Name'; ToolTip = 'Specifies the name of the contact at the vendor.'; Visible = not ContactInformationTakenFromAKV; @@ -323,7 +323,7 @@ report 10039 "IRS 1099 FIRE" } field(ContactPhoneNoField; ContactPhoneNo) { - ApplicationArea = BasicUS; + ApplicationArea = BasicCA, BasicUS; Caption = 'Contact Phone No.'; ToolTip = 'Specifies the phone number of the contact at the vendor.'; Visible = not ContactInformationTakenFromAKV; @@ -336,7 +336,7 @@ report 10039 "IRS 1099 FIRE" } field(ContactEmailField; ContactEmail) { - ApplicationArea = BasicUS; + ApplicationArea = BasicCA, BasicUS; Caption = 'Contact E-Mail'; ToolTip = 'Specifies the email address of the contact at the vendor.'; Visible = not ContactInformationTakenFromAKV; @@ -344,7 +344,7 @@ report 10039 "IRS 1099 FIRE" } field(bTestFileField; bTestFile) { - ApplicationArea = BasicUS; + ApplicationArea = BasicCA, BasicUS; Caption = 'Test File'; ToolTip = 'Specifies you want to print a test file of the information that will be filed electronically.'; @@ -358,14 +358,14 @@ report 10039 "IRS 1099 FIRE" Caption = 'Vendor Information'; field(VendIndicatorField; VendIndicator) { - ApplicationArea = BasicUS; + ApplicationArea = BasicCA, BasicUS; Caption = 'Vendor Indicator'; OptionCaption = 'Vendor Software,In-House Software'; ToolTip = 'Specifies the type of vendor indicator that you want to use, including Vendor Software and In-House Software.'; } field(VendorInfoName; TempVendorInfo.Name) { - ApplicationArea = BasicUS; + ApplicationArea = BasicCA, BasicUS; Caption = 'Vendor Name'; ToolTip = 'Specifies the vendor''s name.'; @@ -377,7 +377,7 @@ report 10039 "IRS 1099 FIRE" } field(VendorInfoAddress; TempVendorInfo.Address) { - ApplicationArea = BasicUS; + ApplicationArea = BasicCA, BasicUS; Caption = 'Vendor Street Address'; ToolTip = 'Specifies the vendor''s address.'; @@ -389,7 +389,7 @@ report 10039 "IRS 1099 FIRE" } field(VendorInfoCity; TempVendorInfo.City) { - ApplicationArea = BasicUS; + ApplicationArea = BasicCA, BasicUS; Caption = 'Vendor City'; ToolTip = 'Specifies the vendors city as a part of the address.'; @@ -401,7 +401,7 @@ report 10039 "IRS 1099 FIRE" } field(VendorInfoCounty; TempVendorInfo.County) { - ApplicationArea = BasicUS; + ApplicationArea = BasicCA, BasicUS; Caption = 'Vendor State'; ToolTip = 'Specifies the vendor''s state as a part of the address.'; @@ -413,7 +413,7 @@ report 10039 "IRS 1099 FIRE" } field(VendorInfoPostCode; TempVendorInfo."Post Code") { - ApplicationArea = BasicUS; + ApplicationArea = BasicCA, BasicUS; Caption = 'Vendor ZIP Code'; ToolTip = 'Specifies the vendor''s ZIP code as a part of the address.'; @@ -425,7 +425,7 @@ report 10039 "IRS 1099 FIRE" } field(VendContactNameField; VendContactName) { - ApplicationArea = BasicUS; + ApplicationArea = BasicCA, BasicUS; Caption = 'Vendor Contact Name'; ToolTip = 'Specifies the name of the contact at the vendor.'; @@ -437,7 +437,7 @@ report 10039 "IRS 1099 FIRE" } field(VendContactPhoneNoField; VendContactPhoneNo) { - ApplicationArea = BasicUS; + ApplicationArea = BasicCA, BasicUS; Caption = 'Vendor Contact Phone No.'; ToolTip = 'Specifies the phone number of the contact at the vendor.'; @@ -449,7 +449,7 @@ report 10039 "IRS 1099 FIRE" } field(VendorInfoEmail; TempVendorInfo."E-Mail") { - ApplicationArea = BasicUS; + ApplicationArea = BasicCA, BasicUS; Caption = 'Vendor E-Mail'; ToolTip = 'Specifies the vendor''s email address.'; diff --git a/Apps/US/IRSForms/app/src/IRIS/CreateTransmissionIRIS.Report.al b/Apps/US/IRSForms/app/src/IRIS/CreateTransmissionIRIS.Report.al index cb5eabbc25..5a98197134 100644 --- a/Apps/US/IRSForms/app/src/IRIS/CreateTransmissionIRIS.Report.al +++ b/Apps/US/IRSForms/app/src/IRIS/CreateTransmissionIRIS.Report.al @@ -8,7 +8,7 @@ using System.Utilities; report 10034 "Create Transmission IRIS" { - ApplicationArea = BasicUS; + ApplicationArea = BasicCA, BasicUS; ProcessingOnly = true; requestpage @@ -24,7 +24,7 @@ report 10034 "Create Transmission IRIS" ShowCaption = false; field(PeriodNoField; PeriodNo) { - ApplicationArea = BasicUS; + ApplicationArea = BasicCA, BasicUS; Caption = 'Reporting Period'; ToolTip = 'Specifies the period for which the 1099 forms will be submitted.'; TableRelation = "IRS Reporting Period"."No."; diff --git a/Apps/US/IRSForms/app/src/IRIS/ErrorInformationIRIS.Page.al b/Apps/US/IRSForms/app/src/IRIS/ErrorInformationIRIS.Page.al index 12e4c1996a..0eb4e6060a 100644 --- a/Apps/US/IRSForms/app/src/IRIS/ErrorInformationIRIS.Page.al +++ b/Apps/US/IRSForms/app/src/IRIS/ErrorInformationIRIS.Page.al @@ -7,7 +7,7 @@ namespace Microsoft.Finance.VAT.Reporting; page 10070 "Error Information IRIS" { PageType = List; - ApplicationArea = BasicUS; + ApplicationArea = BasicCA, BasicUS; Caption = 'Error Information'; SourceTable = "Error Information IRIS"; Editable = false; diff --git a/Apps/US/IRSForms/app/src/IRIS/IRS1099FormDocUpdate.Page.al b/Apps/US/IRSForms/app/src/IRIS/IRS1099FormDocUpdate.Page.al index acacfc002c..a0e707bf88 100644 --- a/Apps/US/IRSForms/app/src/IRIS/IRS1099FormDocUpdate.Page.al +++ b/Apps/US/IRSForms/app/src/IRIS/IRS1099FormDocUpdate.Page.al @@ -7,7 +7,7 @@ namespace Microsoft.Finance.VAT.Reporting; page 10067 "IRS 1099 Form Doc. Update" { PageType = ListPlus; - ApplicationArea = BasicUS; + ApplicationArea = BasicCA, BasicUS; Caption = 'Update 1099 Form Documents'; InsertAllowed = false; DeleteAllowed = false; diff --git a/Apps/US/IRSForms/app/src/IRIS/SetupIRISUserID.Page.al b/Apps/US/IRSForms/app/src/IRIS/SetupIRISUserID.Page.al index 4e7ec95d58..ea570f5b6b 100644 --- a/Apps/US/IRSForms/app/src/IRIS/SetupIRISUserID.Page.al +++ b/Apps/US/IRSForms/app/src/IRIS/SetupIRISUserID.Page.al @@ -9,7 +9,7 @@ using System.Telemetry; page 10068 "Setup IRIS User ID" { PageType = Card; - ApplicationArea = BasicUS; + ApplicationArea = BasicCA, BasicUS; Extensible = false; InsertAllowed = false; DeleteAllowed = false; @@ -80,7 +80,7 @@ page 10068 "Setup IRIS User ID" { action(OpenIRSConsentApp) { - ApplicationArea = BasicUS; + ApplicationArea = BasicCA, BasicUS; Caption = 'Open IRS Consent App'; Image = LinkWeb; ToolTip = 'Opens the IRS Consent App in the default web browser.'; diff --git a/Apps/US/IRSForms/app/src/IRIS/TransmissionIRIS.Page.al b/Apps/US/IRSForms/app/src/IRIS/TransmissionIRIS.Page.al index 17f069c871..5c0907e081 100644 --- a/Apps/US/IRSForms/app/src/IRIS/TransmissionIRIS.Page.al +++ b/Apps/US/IRSForms/app/src/IRIS/TransmissionIRIS.Page.al @@ -13,7 +13,7 @@ page 10058 "Transmission IRIS" PageType = Card; InsertAllowed = false; Caption = 'IRIS Transmission'; - ApplicationArea = BasicUS; + ApplicationArea = BasicCA, BasicUS; SourceTable = "Transmission IRIS"; Permissions = tabledata "User Params IRIS" = M; diff --git a/Apps/US/IRSForms/app/src/IRIS/TransmissionIRISSubform.Page.al b/Apps/US/IRSForms/app/src/IRIS/TransmissionIRISSubform.Page.al index 9a3a8fba59..8d6f04ae33 100644 --- a/Apps/US/IRSForms/app/src/IRIS/TransmissionIRISSubform.Page.al +++ b/Apps/US/IRSForms/app/src/IRIS/TransmissionIRISSubform.Page.al @@ -7,7 +7,7 @@ namespace Microsoft.Finance.VAT.Reporting; page 10059 "Transmission IRIS Subform" { PageType = ListPart; - ApplicationArea = BasicUS; + ApplicationArea = BasicCA, BasicUS; Caption = 'Documents'; SourceTable = "IRS 1099 Form Doc. Header"; InsertAllowed = false; diff --git a/Apps/US/IRSForms/app/src/IRIS/TransmissionIRISUpdate.Page.al b/Apps/US/IRSForms/app/src/IRIS/TransmissionIRISUpdate.Page.al index f1bad4ea06..0c05edf4c6 100644 --- a/Apps/US/IRSForms/app/src/IRIS/TransmissionIRISUpdate.Page.al +++ b/Apps/US/IRSForms/app/src/IRIS/TransmissionIRISUpdate.Page.al @@ -9,7 +9,7 @@ using System.Telemetry; page 10066 "Transmission IRIS Update" { PageType = Card; - ApplicationArea = BasicUS; + ApplicationArea = BasicCA, BasicUS; Extensible = false; InsertAllowed = false; DeleteAllowed = false; diff --git a/Apps/US/IRSForms/app/src/IRIS/TransmissionLogLinesIRIS.Page.al b/Apps/US/IRSForms/app/src/IRIS/TransmissionLogLinesIRIS.Page.al index 631ba7125e..2613bc15a1 100644 --- a/Apps/US/IRSForms/app/src/IRIS/TransmissionLogLinesIRIS.Page.al +++ b/Apps/US/IRSForms/app/src/IRIS/TransmissionLogLinesIRIS.Page.al @@ -7,7 +7,7 @@ namespace Microsoft.Finance.VAT.Reporting; page 10069 "Transmission Log Lines IRIS" { PageType = List; - ApplicationArea = BasicUS; + ApplicationArea = BasicCA, BasicUS; Caption = 'Transmission History Lines'; SourceTable = "Transmission Log Line IRIS"; Editable = false; diff --git a/Apps/US/IRSForms/app/src/IRIS/TransmissionLogsIRIS.Page.al b/Apps/US/IRSForms/app/src/IRIS/TransmissionLogsIRIS.Page.al index 13c5987eff..02d01b2cc6 100644 --- a/Apps/US/IRSForms/app/src/IRIS/TransmissionLogsIRIS.Page.al +++ b/Apps/US/IRSForms/app/src/IRIS/TransmissionLogsIRIS.Page.al @@ -7,7 +7,7 @@ namespace Microsoft.Finance.VAT.Reporting; page 10065 "Transmission Logs IRIS" { PageType = List; - ApplicationArea = BasicUS; + ApplicationArea = BasicCA, BasicUS; Caption = 'Transmission History'; SourceTable = "Transmission Log IRIS"; Editable = false; @@ -69,7 +69,7 @@ page 10065 "Transmission Logs IRIS" { action(DownloadTransmContent) { - ApplicationArea = BasicUS; + ApplicationArea = BasicCA, BasicUS; Caption = 'Download Transmission Content'; Image = Download; ToolTip = 'Downloads the transmission content as an XML file.'; @@ -80,7 +80,7 @@ page 10065 "Transmission Logs IRIS" } action(DownloadRespContent) { - ApplicationArea = BasicUS; + ApplicationArea = BasicCA, BasicUS; Caption = 'Download Response Content'; Image = Download; ToolTip = 'Downloads the response content as an XML or JSON file.'; @@ -91,7 +91,7 @@ page 10065 "Transmission Logs IRIS" } action(DownloadAcknowledgContent) { - ApplicationArea = BasicUS; + ApplicationArea = BasicCA, BasicUS; Caption = 'Download Acknowledgement Content'; Image = Download; ToolTip = 'Downloads the acknowledgement content as an XML or JSON file.'; diff --git a/Apps/US/IRSForms/app/src/IRIS/TransmissionsIRIS.Page.al b/Apps/US/IRSForms/app/src/IRIS/TransmissionsIRIS.Page.al index 18166151e7..2eb99c8fae 100644 --- a/Apps/US/IRSForms/app/src/IRIS/TransmissionsIRIS.Page.al +++ b/Apps/US/IRSForms/app/src/IRIS/TransmissionsIRIS.Page.al @@ -13,7 +13,7 @@ page 10061 "Transmissions IRIS" RefreshOnActivate = true; AnalysisModeEnabled = false; InsertAllowed = false; - ApplicationArea = BasicUS; + ApplicationArea = BasicCA, BasicUS; UsageCategory = Documents; SourceTable = "Transmission IRIS"; diff --git a/Apps/US/IRSForms/app/src/Printing/IRS1099FormInstructions.Page.al b/Apps/US/IRSForms/app/src/Printing/IRS1099FormInstructions.Page.al index 2ed2b552af..d6f1642663 100644 --- a/Apps/US/IRSForms/app/src/Printing/IRS1099FormInstructions.Page.al +++ b/Apps/US/IRSForms/app/src/Printing/IRS1099FormInstructions.Page.al @@ -1,4 +1,4 @@ -// ------------------------------------------------------------------------------------------------ +// ------------------------------------------------------------------------------------------------ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // ------------------------------------------------------------------------------------------------ @@ -8,7 +8,7 @@ page 10050 "IRS 1099 Form Instructions" { PageType = List; SourceTable = "IRS 1099 Form Instruction"; - ApplicationArea = BasicUS; + ApplicationArea = BasicCA, BasicUS; DelayedInsert = true; layout diff --git a/Apps/US/IRSForms/app/src/Printing/IRS1099FormReports.Page.al b/Apps/US/IRSForms/app/src/Printing/IRS1099FormReports.Page.al index 389135ab40..3c6b106f50 100644 --- a/Apps/US/IRSForms/app/src/Printing/IRS1099FormReports.Page.al +++ b/Apps/US/IRSForms/app/src/Printing/IRS1099FormReports.Page.al @@ -1,4 +1,4 @@ -// ------------------------------------------------------------------------------------------------ +// ------------------------------------------------------------------------------------------------ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // ------------------------------------------------------------------------------------------------ @@ -8,7 +8,7 @@ page 10048 "IRS 1099 Form Reports" { PageType = List; SourceTable = "IRS 1099 Form Report"; - ApplicationArea = BasicUS; + ApplicationArea = BasicCA, BasicUS; Editable = true; layout { diff --git a/Apps/US/IRSForms/app/src/Printing/IRS1099FormStatement.Page.al b/Apps/US/IRSForms/app/src/Printing/IRS1099FormStatement.Page.al index ff565f2932..d6c7267c53 100644 --- a/Apps/US/IRSForms/app/src/Printing/IRS1099FormStatement.Page.al +++ b/Apps/US/IRSForms/app/src/Printing/IRS1099FormStatement.Page.al @@ -1,4 +1,4 @@ -// ------------------------------------------------------------------------------------------------ +// ------------------------------------------------------------------------------------------------ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // ------------------------------------------------------------------------------------------------ @@ -6,7 +6,7 @@ namespace Microsoft.Finance.VAT.Reporting; page 10051 "IRS 1099 Form Statement" { - ApplicationArea = BasicUS; + ApplicationArea = BasicCA, BasicUS; AutoSplitKey = true; MultipleNewLines = true; PageType = List; diff --git a/Apps/US/IRSForms/app/src/Reporting/IRS1099VendorOverview.Page.al b/Apps/US/IRSForms/app/src/Reporting/IRS1099VendorOverview.Page.al index 3a6de179c8..3461c28357 100644 --- a/Apps/US/IRSForms/app/src/Reporting/IRS1099VendorOverview.Page.al +++ b/Apps/US/IRSForms/app/src/Reporting/IRS1099VendorOverview.Page.al @@ -11,7 +11,7 @@ page 10072 "IRS 1099 Vendor Overview" PageType = List; SourceTable = "IRS 1099 Vend. Form Box Buffer"; SourceTableTemporary = true; - ApplicationArea = BasicUS; + ApplicationArea = BasicCA, BasicUS; UsageCategory = ReportsAndAnalysis; InsertAllowed = false; DeleteAllowed = false; @@ -27,7 +27,7 @@ page 10072 "IRS 1099 Vendor Overview" { Caption = 'Reporting Period No.'; ToolTip = 'Specifies the reporting period to filter the data.'; - ApplicationArea = BasicUS; + ApplicationArea = BasicCA, BasicUS; TableRelation = "IRS Reporting Period"; ShowMandatory = true; diff --git a/Apps/US/IRSForms/app/src/Setup/IRS1099CopySetupFrom.Report.al b/Apps/US/IRSForms/app/src/Setup/IRS1099CopySetupFrom.Report.al index 36fe730721..4ed0ac616e 100644 --- a/Apps/US/IRSForms/app/src/Setup/IRS1099CopySetupFrom.Report.al +++ b/Apps/US/IRSForms/app/src/Setup/IRS1099CopySetupFrom.Report.al @@ -1,4 +1,4 @@ -// ------------------------------------------------------------------------------------------------ +// ------------------------------------------------------------------------------------------------ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // ------------------------------------------------------------------------------------------------ @@ -10,7 +10,7 @@ report 10037 "IRS 1099 Copy Setup From" { Caption = 'IRS 1099 Copy Setup'; ProcessingOnly = true; - ApplicationArea = BasicUS; + ApplicationArea = BasicCA, BasicUS; requestpage { @@ -23,7 +23,7 @@ report 10037 "IRS 1099 Copy Setup From" Caption = 'Options'; field(FromPeriod; FromPeriodNo) { - ApplicationArea = BasicUS; + ApplicationArea = BasicCA, BasicUS; Caption = 'From Period'; ToolTip = 'Specifies the period to copy from'; TableRelation = "IRS Reporting Period"; @@ -50,7 +50,7 @@ report 10037 "IRS 1099 Copy Setup From" } field(ToPeriod; ToPeriodNo) { - ApplicationArea = BasicUS; + ApplicationArea = BasicCA, BasicUS; Caption = 'To Period'; ToolTip = 'Specifies the period to copy to.'; TableRelation = "IRS Reporting Period"; @@ -82,7 +82,7 @@ report 10037 "IRS 1099 Copy Setup From" } field(CompaniesSelectionOption; CompaniesSelection) { - ApplicationArea = BasicUS; + ApplicationArea = BasicCA, BasicUS; Caption = 'Companies'; ToolTip = 'Specifies the companies to copy the setup for.'; Editable = false; diff --git a/Apps/US/IRSForms/app/src/Setup/IRS1099FormBoxes.Page.al b/Apps/US/IRSForms/app/src/Setup/IRS1099FormBoxes.Page.al index 4340c22154..d5a47b0e80 100644 --- a/Apps/US/IRSForms/app/src/Setup/IRS1099FormBoxes.Page.al +++ b/Apps/US/IRSForms/app/src/Setup/IRS1099FormBoxes.Page.al @@ -1,4 +1,4 @@ -// ------------------------------------------------------------------------------------------------ +// ------------------------------------------------------------------------------------------------ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // ------------------------------------------------------------------------------------------------ @@ -8,7 +8,7 @@ page 10034 "IRS 1099 Form Boxes" { PageType = List; SourceTable = "IRS 1099 Form Box"; - ApplicationArea = BasicUS; + ApplicationArea = BasicCA, BasicUS; DelayedInsert = true; AnalysisModeEnabled = false; diff --git a/Apps/US/IRSForms/app/src/Setup/IRS1099Forms.Page.al b/Apps/US/IRSForms/app/src/Setup/IRS1099Forms.Page.al index 52eaca9da8..5fdfdeca94 100644 --- a/Apps/US/IRSForms/app/src/Setup/IRS1099Forms.Page.al +++ b/Apps/US/IRSForms/app/src/Setup/IRS1099Forms.Page.al @@ -1,4 +1,4 @@ -// ------------------------------------------------------------------------------------------------ +// ------------------------------------------------------------------------------------------------ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // ------------------------------------------------------------------------------------------------ @@ -8,7 +8,7 @@ page 10033 "IRS 1099 Forms" { PageType = List; SourceTable = "IRS 1099 Form"; - ApplicationArea = BasicUS; + ApplicationArea = BasicCA, BasicUS; DelayedInsert = true; RefreshOnActivate = true; diff --git a/Apps/US/IRSForms/app/src/Setup/IRSFormsGuide.Page.al b/Apps/US/IRSForms/app/src/Setup/IRSFormsGuide.Page.al index 7b0490998b..1a2be393dc 100644 --- a/Apps/US/IRSForms/app/src/Setup/IRSFormsGuide.Page.al +++ b/Apps/US/IRSForms/app/src/Setup/IRSFormsGuide.Page.al @@ -13,7 +13,7 @@ page 10032 "IRS Forms Guide" { PageType = NavigatePage; RefreshOnActivate = true; - ApplicationArea = BasicUS; + ApplicationArea = BasicCA, BasicUS; SourceTable = "IRS Forms Setup"; layout @@ -56,6 +56,7 @@ page 10032 "IRS Forms Guide" field(ReportingYearControl; Rec."Init Reporting Year") { + ApplicationArea = BasicCA, BasicUS; Caption = 'Reporting Year'; ShowMandatory = true; BlankZero = true; @@ -237,18 +238,22 @@ page 10032 "IRS Forms Guide" InstructionalText = 'Specify how the IRS Forms feature will be used in your company.'; field("Collect Details For Line"; Rec."Collect Details For Line") { + ApplicationArea = BasicCA, BasicUS; ToolTip = 'Specifies if the mapping between the IRS 1099 Form Line and associated vendor ledger entries must be kept. That will allow you to drill-down into the Amount field, but requires an extra space in the database.'; } field("Protect TIN"; Rec."Protect TIN") { + ApplicationArea = BasicCA, BasicUS; ToolTip = 'Specifies if the TIN of the vendor/company must be protected when printing reports.'; } field("Business Name Control"; Rec."Business Name Control") { + ApplicationArea = BasicCA, BasicUS; ToolTip = 'Specifies the business name control that must match the one in the IRS''s National Account Profile (NAP) database. Generally, it can be up to the first four alphanumeric characters of the business''s legal name.'; } field("API Client ID"; Rec."IRIS API Client ID") { + ApplicationArea = BasicCA, BasicUS; ToolTip = 'Specifies the GUID that is used to authenticate and authorize access to the IRS''s Information Returns Intake System (IRIS) API.'; } } @@ -371,6 +376,7 @@ page 10032 "IRS Forms Guide" ReviewDataLinkTok: Label 'Review affected data'; #endif SetupNotCompletedQst: Label 'Set up of IRS Forms has not been completed.\\Are you sure that you want to exit?'; + ReportingYearMustBeSpecifiedErr: Label 'You must specify the reporting year.'; IRSFormsTok: Label 'IRS Forms', Locked = true; local procedure EnableControls(); @@ -393,6 +399,8 @@ page 10032 "IRS Forms Guide" var GuidedExperience: Codeunit "Guided Experience"; begin + if Rec."Init Reporting Year" = 0 then + Error(ReportingYearMustBeSpecifiedErr); SetupCompleted := true; Commit(); IRSFormsData.AddReportingPeriodsWithForms(Rec."Init Reporting Year"); diff --git a/Apps/US/IRSForms/app/src/Setup/IRSFormsSetup.Page.al b/Apps/US/IRSForms/app/src/Setup/IRSFormsSetup.Page.al index 57e982fd9f..d493a4f8d1 100644 --- a/Apps/US/IRSForms/app/src/Setup/IRSFormsSetup.Page.al +++ b/Apps/US/IRSForms/app/src/Setup/IRSFormsSetup.Page.al @@ -1,4 +1,4 @@ -// ------------------------------------------------------------------------------------------------ +// ------------------------------------------------------------------------------------------------ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // ------------------------------------------------------------------------------------------------ @@ -8,7 +8,7 @@ page 10030 "IRS Forms Setup" { PageType = Card; SourceTable = "IRS Forms Setup"; - ApplicationArea = BasicUS; + ApplicationArea = BasicCA, BasicUS; UsageCategory = Administration; DeleteAllowed = false; InsertAllowed = false; @@ -56,7 +56,7 @@ page 10030 "IRS Forms Setup" { action(EmailContentSetup) { - ApplicationArea = BasicUS; + ApplicationArea = BasicCA, BasicUS; Caption = 'Email Content Setup'; Image = Email; ToolTip = 'Setup the subject and the body of the email with 1099 form that is sent to the vendor.'; @@ -76,7 +76,7 @@ page 10030 "IRS Forms Setup" } action(SetupIRISUserID) { - ApplicationArea = BasicUS; + ApplicationArea = BasicCA, BasicUS; Caption = 'Setup IRIS User ID'; Image = UserCertificate; ToolTip = 'Obtain and set the IRIS User ID which is used to authenticate and authorize access to the IRS''s Information Returns Intake System (IRIS) API.'; diff --git a/Apps/US/IRSForms/app/src/Setup/IRSReportingPeriods.Page.al b/Apps/US/IRSForms/app/src/Setup/IRSReportingPeriods.Page.al index c71c454873..33144c8e3a 100644 --- a/Apps/US/IRSForms/app/src/Setup/IRSReportingPeriods.Page.al +++ b/Apps/US/IRSForms/app/src/Setup/IRSReportingPeriods.Page.al @@ -1,4 +1,4 @@ -// ------------------------------------------------------------------------------------------------ +// ------------------------------------------------------------------------------------------------ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // ------------------------------------------------------------------------------------------------ @@ -8,7 +8,7 @@ page 10031 "IRS Reporting Periods" { PageType = List; SourceTable = "IRS Reporting Period"; - ApplicationArea = BasicUS; + ApplicationArea = BasicCA, BasicUS; UsageCategory = Administration; AboutTitle = 'About reporting periods'; AboutText = 'Here you can set up the different periods and form boxes, vendor mapping, and statement for reporting per period.'; diff --git a/Apps/US/IRSForms/app/src/Setup/UpgradeIRS1099Data.Report.al b/Apps/US/IRSForms/app/src/Setup/UpgradeIRS1099Data.Report.al index 412d39956d..d681f839b2 100644 --- a/Apps/US/IRSForms/app/src/Setup/UpgradeIRS1099Data.Report.al +++ b/Apps/US/IRSForms/app/src/Setup/UpgradeIRS1099Data.Report.al @@ -26,7 +26,7 @@ report 10063 "Upgrade IRS 1099 Data" Caption = 'Options'; field(IRSReportingPeriodCodeField; IRSReportingPeriodCode) { - ApplicationArea = BasicUS; + ApplicationArea = BasicCA, BasicUS; Caption = 'Reporting Period Code'; ToolTip = 'Specifies the code of the tax reporting period to upgrade the data from the old IRS 1099 feature to the new one.'; TableRelation = "IRS Reporting Period"; diff --git a/Apps/US/IRSForms/app/src/VendorFormBox/IRS1099PropagateVendSetup.Report.al b/Apps/US/IRSForms/app/src/VendorFormBox/IRS1099PropagateVendSetup.Report.al index 9d2f25e6e1..8898bd14c8 100644 --- a/Apps/US/IRSForms/app/src/VendorFormBox/IRS1099PropagateVendSetup.Report.al +++ b/Apps/US/IRSForms/app/src/VendorFormBox/IRS1099PropagateVendSetup.Report.al @@ -1,4 +1,4 @@ -// ------------------------------------------------------------------------------------------------ +// ------------------------------------------------------------------------------------------------ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // ------------------------------------------------------------------------------------------------ @@ -12,7 +12,7 @@ report 10038 "IRS 1099 Propagate Vend. Setup" { Caption = 'IRS 1099 Propagate Vendor Form Box Setup'; ProcessingOnly = true; - ApplicationArea = BasicUS; + ApplicationArea = BasicCA, BasicUS; Permissions = TableData "Vendor Ledger Entry" = rm, tabledata "Purch. Inv. Header" = rm; dataset @@ -46,7 +46,7 @@ report 10038 "IRS 1099 Propagate Vend. Setup" Caption = 'Options'; field(StartingDateControl; StartingDate) { - ApplicationArea = BasicUS; + ApplicationArea = BasicCA, BasicUS; Caption = 'Starting Date'; ToolTip = 'Specifies the starting posting date of the vendor ledger entries to be included in propagation process.'; @@ -58,7 +58,7 @@ report 10038 "IRS 1099 Propagate Vend. Setup" } field(EndingDateControl; EndingDate) { - ApplicationArea = BasicUS; + ApplicationArea = BasicCA, BasicUS; Caption = 'Ending Date'; ToolTip = 'Specifies the ending posting date of the vendor ledger entries to be included in propagation process.'; @@ -70,13 +70,13 @@ report 10038 "IRS 1099 Propagate Vend. Setup" } field(PurchaseDocumentsControl; PurchaseDocuments) { - ApplicationArea = BasicUS; + ApplicationArea = BasicCA, BasicUS; Caption = 'Purchase Documents'; ToolTip = 'Specifies whether to include purchase documents in the propagation process.'; } field(VendorLedgerEntriesControl; VendorLedgerEntries) { - ApplicationArea = BasicUS; + ApplicationArea = BasicCA, BasicUS; Caption = 'Vendor Ledger Entries'; ToolTip = 'Specifies whether to include vendor ledger entries in the propagation process.'; diff --git a/Apps/US/IRSForms/app/src/VendorFormBox/IRS1099SuggestVendors.Report.al b/Apps/US/IRSForms/app/src/VendorFormBox/IRS1099SuggestVendors.Report.al index b7ce97116a..bba1dd7995 100644 --- a/Apps/US/IRSForms/app/src/VendorFormBox/IRS1099SuggestVendors.Report.al +++ b/Apps/US/IRSForms/app/src/VendorFormBox/IRS1099SuggestVendors.Report.al @@ -1,4 +1,4 @@ -// ------------------------------------------------------------------------------------------------ +// ------------------------------------------------------------------------------------------------ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // ------------------------------------------------------------------------------------------------ @@ -9,7 +9,7 @@ using Microsoft.Purchases.Vendor; report 10036 "IRS 1099 Suggest Vendors" { ProcessingOnly = true; - ApplicationArea = BasicUS; + ApplicationArea = BasicCA, BasicUS; dataset { diff --git a/Apps/US/IRSForms/app/src/VendorFormBox/IRS1099VendFormBoxAdjmts.Page.al b/Apps/US/IRSForms/app/src/VendorFormBox/IRS1099VendFormBoxAdjmts.Page.al index 2381ea35fd..415818b2a5 100644 --- a/Apps/US/IRSForms/app/src/VendorFormBox/IRS1099VendFormBoxAdjmts.Page.al +++ b/Apps/US/IRSForms/app/src/VendorFormBox/IRS1099VendFormBoxAdjmts.Page.al @@ -1,4 +1,4 @@ -// ------------------------------------------------------------------------------------------------ +// ------------------------------------------------------------------------------------------------ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // ------------------------------------------------------------------------------------------------ @@ -9,7 +9,7 @@ page 10054 "IRS 1099 Vend. Form Box Adjmts" Caption = 'IRS 1099 Vendor Form Box Adjustments'; PageType = List; SourceTable = "IRS 1099 Vendor Form Box Adj."; - ApplicationArea = BasicUS; + ApplicationArea = BasicCA, BasicUS; UsageCategory = Administration; DelayedInsert = true; diff --git a/Apps/US/IRSForms/app/src/VendorFormBox/IRS1099VendorFormBoxSetup.Page.al b/Apps/US/IRSForms/app/src/VendorFormBox/IRS1099VendorFormBoxSetup.Page.al index fd5c17e291..4ee50d90dd 100644 --- a/Apps/US/IRSForms/app/src/VendorFormBox/IRS1099VendorFormBoxSetup.Page.al +++ b/Apps/US/IRSForms/app/src/VendorFormBox/IRS1099VendorFormBoxSetup.Page.al @@ -1,4 +1,4 @@ -// ------------------------------------------------------------------------------------------------ +// ------------------------------------------------------------------------------------------------ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // ------------------------------------------------------------------------------------------------ @@ -8,7 +8,7 @@ page 10035 "IRS 1099 Vendor Form Box Setup" { PageType = List; SourceTable = "IRS 1099 Vendor Form Box Setup"; - ApplicationArea = BasicUS; + ApplicationArea = BasicCA, BasicUS; UsageCategory = Administration; AboutTitle = 'About the setup of form boxes for vendors'; AboutText = 'Here you can map the form boxes to vendor in the certain period. When you create a document for a certain vendor, the system will use this setup to fill in the form boxes.'; @@ -54,7 +54,7 @@ page 10035 "IRS 1099 Vendor Form Box Setup" { action(SuggestVendors) { - ApplicationArea = BasicUS; + ApplicationArea = BasicCA, BasicUS; Caption = 'Suggest'; Image = Suggest; ToolTip = 'Suggest vendors for the selected period'; @@ -74,7 +74,7 @@ page 10035 "IRS 1099 Vendor Form Box Setup" } action(Propagate) { - ApplicationArea = BasicUS; + ApplicationArea = BasicCA, BasicUS; Caption = 'Propagate'; Image = CopyBudget; ToolTip = 'Propagate the vendor form box setup to the existing opened purchase documents vendor ledger entries.'; diff --git a/Apps/W1/BankAccRecWithAI/app/src/BankAccRecTransToAcc.Codeunit.al b/Apps/W1/BankAccRecWithAI/app/src/BankAccRecTransToAcc.Codeunit.al index 716a2494e8..db0df01e20 100644 --- a/Apps/W1/BankAccRecWithAI/app/src/BankAccRecTransToAcc.Codeunit.al +++ b/Apps/W1/BankAccRecWithAI/app/src/BankAccRecTransToAcc.Codeunit.al @@ -27,6 +27,7 @@ codeunit 7251 "Bank Acc. Rec. Trans. to Acc." AOAIDeployments: Codeunit "AOAI Deployments"; AOAIOperationResponse: Codeunit "AOAI Operation Response"; AOAIChatCompletionParams: Codeunit "AOAI Chat Completion Params"; + AOAIPolicyParams: Codeunit "AOAI Policy Params"; AOAIChatMessages: Codeunit "AOAI Chat Messages"; BankRecAIMatchingImpl: Codeunit "Bank Rec. AI Matching Impl."; FeatureTelemetry: Codeunit "Feature Telemetry"; @@ -76,8 +77,11 @@ codeunit 7251 "Bank Acc. Rec. Trans. to Acc." if not BankAccReconciliationLine.IsEmpty() then begin AzureOpenAI.SetAuthorization(Enum::"AOAI Model Type"::"Chat Completions", AOAIDeployments.GetGPT41Latest()); AzureOpenAI.SetCopilotCapability(Enum::"Copilot Capability"::"Bank Account Reconciliation"); + AOAIPolicyParams.SetXPIADetection(true); + AOAIPolicyParams.SetHarmsSeverity(Enum::"AOAI Policy Harms Severity"::Medium); AOAIChatCompletionParams.SetMaxTokens(BankRecAIMatchingImpl.MaxTokens()); AOAIChatCompletionParams.SetTemperature(0); + AOAIChatCompletionParams.SetAOAIPolicyParams(AOAIPolicyParams); InputWithReservedWordsFound := false; GetCompletionResponse(AOAIChatMessages, BankAccReconciliationLine, TempBankStatementMatchingBuffer, GLAccount, AzureOpenAI, AOAIChatCompletionParams, AOAIOperationResponse); if AOAIOperationResponse.IsSuccess() then @@ -101,6 +105,7 @@ codeunit 7251 "Bank Acc. Rec. Trans. to Acc." begin SysMsg := BuildMostAppropriateGLAccountPromptTask().Unwrap(); UserMsg := BuildBankRecPromptUserMessage(BuildBankRecStatementLines(BankAccReconciliationLine, TempBankStatementMatchingBuffer), BuildGLAccounts(GLAccount)).Unwrap(); + AOAIChatMessages.AddXPIADetectionTags(UserMsg); AOAIChatMessages.AddSystemMessage(SysMsg); AOAIChatMessages.AddUserMessage(UserMsg); AzureOpenAI.GenerateChatCompletion(AOAIChatMessages, AOAIChatCompletionParams, AOAIOperationResponse); diff --git a/Apps/W1/BankAccRecWithAI/app/src/BankRecAIMatchingImpl.Codeunit.al b/Apps/W1/BankAccRecWithAI/app/src/BankRecAIMatchingImpl.Codeunit.al index 92c510aca7..93839f378e 100644 --- a/Apps/W1/BankAccRecWithAI/app/src/BankRecAIMatchingImpl.Codeunit.al +++ b/Apps/W1/BankAccRecWithAI/app/src/BankRecAIMatchingImpl.Codeunit.al @@ -327,10 +327,12 @@ codeunit 7250 "Bank Rec. AI Matching Impl." AOAIDeployments: Codeunit "AOAI Deployments"; AOAIOperationResponse: Codeunit "AOAI Operation Response"; AOAIChatCompletionParams: Codeunit "AOAI Chat Completion Params"; + AOAIPolicyParams: Codeunit "AOAI Policy Params"; AOAIChatMessages: Codeunit "AOAI Chat Messages"; CompletionAnswerTxt: Text; NumberOfFoundMatches: Integer; NewLineChar: Char; + UserMessageWithXPIADetectionTagsTxt: Text; begin NewLineChar := 10; NumberOfFoundMatches := 0; @@ -341,11 +343,17 @@ codeunit 7250 "Bank Rec. AI Matching Impl." // Generate OpenAI Completion AzureOpenAI.SetAuthorization(Enum::"AOAI Model Type"::"Chat Completions", AOAIDeployments.GetGPT41Latest()); AzureOpenAI.SetCopilotCapability(Enum::"Copilot Capability"::"Bank Account Reconciliation"); + AOAIPolicyParams.SetXPIADetection(true); + AOAIPolicyParams.SetHarmsSeverity(Enum::"AOAI Policy Harms Severity"::Medium); AOAIChatCompletionParams.SetMaxTokens(MaxTokens()); AOAIChatCompletionParams.SetTemperature(0); + AOAIChatCompletionParams.SetAOAIPolicyParams(AOAIPolicyParams); AOAIChatMessages.AddSystemMessage(CompletionTaskTxt.Unwrap().Replace('\n', NewLineChar)); - if not UserMessageTxt.IsEmpty() then - AOAIChatMessages.AddUserMessage(UserMessageTxt.Unwrap().Replace('\n', NewLineChar)); + if not UserMessageTxt.IsEmpty() then begin + UserMessageWithXPIADetectionTagsTxt := UserMessageTxt.Unwrap().Replace('\n', NewLineChar); + AOAIChatMessages.AddXPIADetectionTags(UserMessageWithXPIADetectionTagsTxt); + AOAIChatMessages.AddUserMessage(UserMessageWithXPIADetectionTagsTxt); + end; AzureOpenAI.GenerateChatCompletion(AOAIChatMessages, AOAIChatCompletionParams, AOAIOperationResponse); if AOAIOperationResponse.IsSuccess() then CompletionAnswerTxt := AOAIOperationResponse.GetResult() diff --git a/Apps/W1/ContosoCoffeeDemoDataset/app/DemoData/Common/1.Setup Data/CreateCommonUnitOfMeasure.Codeunit.al b/Apps/W1/ContosoCoffeeDemoDataset/app/DemoData/Common/1.Setup Data/CreateCommonUnitOfMeasure.Codeunit.al index 98a97a0dbb..49effe19d6 100644 --- a/Apps/W1/ContosoCoffeeDemoDataset/app/DemoData/Common/1.Setup Data/CreateCommonUnitOfMeasure.Codeunit.al +++ b/Apps/W1/ContosoCoffeeDemoDataset/app/DemoData/Common/1.Setup Data/CreateCommonUnitOfMeasure.Codeunit.al @@ -23,7 +23,7 @@ codeunit 5130 "Create Common Unit Of Measure" ContosoUnitOfMeasure.InsertUnitOfMeasure(Box(), BoxLbl, 'BX'); ContosoUnitOfMeasure.InsertUnitOfMeasure(Pallet(), PalletLbl, 'PF'); ContosoUnitOfMeasure.InsertUnitOfMeasure(Pack(), PackLbl, 'PK'); - ContosoUnitOfMeasure.InsertUnitOfMeasure(Miles(), MilesLbl, '1A'); + ContosoUnitOfMeasure.InsertUnitOfMeasure(Miles(), MilesLbl, 'SMI'); ContosoUnitOfMeasure.InsertUnitOfMeasure(KM(), KilometerLbl, 'KMT'); ContosoUnitOfMeasure.InsertUnitOfMeasure(KG(), KiloLbl, 'KGM'); ContosoUnitOfMeasure.InsertUnitOfMeasure(Set(), SetLbl, 'SET'); @@ -36,40 +36,40 @@ codeunit 5130 "Create Common Unit Of Measure" end; var - HourLbl: Label 'Hour', MaxLength = 10; + HourLbl: Label 'Hour', MaxLength = 50; HourTok: Label 'HOUR', MaxLength = 10; - DayLbl: Label 'Day', MaxLength = 10; + DayLbl: Label 'Day', MaxLength = 50; DayTok: Label 'DAY', MaxLength = 10; - PieceLbl: Label 'Piece', MaxLength = 10; + PieceLbl: Label 'Piece', MaxLength = 50; PieceTok: Label 'PCS', MaxLength = 10; - CanLbl: Label 'Can', MaxLength = 10; + CanLbl: Label 'Can', MaxLength = 50; CanTok: Label 'CAN', MaxLength = 10; - BoxLbl: Label 'Box', MaxLength = 10; + BoxLbl: Label 'Box', MaxLength = 50; BoxTok: Label 'BOX', MaxLength = 10; - PalletLbl: Label 'Pallet', MaxLength = 10; + PalletLbl: Label 'Pallet', MaxLength = 50; PalletTok: Label 'PALLET', MaxLength = 10; - PackLbl: Label 'Pack', MaxLength = 10; + PackLbl: Label 'Pack', MaxLength = 50; PackTok: Label 'PACK', MaxLength = 10; - MilesLbl: Label 'Miles', MaxLength = 10; + MilesLbl: Label 'Miles', MaxLength = 50; MilesTok: Label 'MILES', MaxLength = 10; - KilometerLbl: Label 'Kilometer', MaxLength = 10; + KilometerLbl: Label 'Kilometer', MaxLength = 50; KMLbl: Label 'KM', MaxLength = 10; KGLbl: Label 'KG', MaxLength = 10; - KiloLbl: Label 'Kilo', MaxLength = 10; + KiloLbl: Label 'Kilogram', MaxLength = 50; SetTok: Label 'SET', MaxLength = 10; - SetLbl: Label 'Set', MaxLength = 10; + SetLbl: Label 'Set', MaxLength = 50; BagTok: Label 'BAG', MaxLength = 10; BagLbl: Label 'Bag', MaxLength = 10; GRTok: Label 'GR', MaxLength = 10; - GramTok: Label 'Gram', MaxLength = 10; + GramTok: Label 'Gram', MaxLength = 50; LTok: Label 'L', MaxLength = 10; - LiterTok: Label 'Liter', MaxLength = 10; + LiterTok: Label 'Liter', MaxLength = 50; MLTok: Label 'ML', MaxLength = 10; - MilliliterTok: Label 'Milliliter', MaxLength = 10; + MilliliterTok: Label 'Milliliter', MaxLength = 50; TTok: Label 'T', MaxLength = 10; - TonneLbl: Label 'Tonne', MaxLength = 10; + TonneLbl: Label 'Tonne', MaxLength = 50; KWHTok: Label 'KWH', MaxLength = 10; - KWHLbl: Label 'KW Hour', MaxLength = 10; + KWHLbl: Label 'KW Hour', MaxLength = 50; procedure Bag(): Code[10] begin diff --git a/Apps/W1/ContosoCoffeeDemoDataset/app/DemoData/Foundation/1.Setup data/CreateUnitofMeasure.Codeunit.al b/Apps/W1/ContosoCoffeeDemoDataset/app/DemoData/Foundation/1.Setup data/CreateUnitofMeasure.Codeunit.al index 2b09560e40..0399d40e02 100644 --- a/Apps/W1/ContosoCoffeeDemoDataset/app/DemoData/Foundation/1.Setup data/CreateUnitofMeasure.Codeunit.al +++ b/Apps/W1/ContosoCoffeeDemoDataset/app/DemoData/Foundation/1.Setup data/CreateUnitofMeasure.Codeunit.al @@ -29,7 +29,7 @@ codeunit 5248 "Create Unit of Measure" ContosoUnitOfMeasure.InsertUnitOfMeasure(Box(), BoxLbl, 'BX'); ContosoUnitOfMeasure.InsertUnitOfMeasure(Pallet(), PalletLbl, 'PF'); ContosoUnitOfMeasure.InsertUnitOfMeasure(Pack(), PackLbl, 'PK'); - ContosoUnitOfMeasure.InsertUnitOfMeasure(Miles(), MilesLbl, '1A'); + ContosoUnitOfMeasure.InsertUnitOfMeasure(Miles(), MilesLbl, 'SMI'); ContosoUnitOfMeasure.InsertUnitOfMeasure(KM(), KilometerLbl, 'KMT'); ContosoUnitOfMeasure.InsertUnitOfMeasure(KG(), KiloLbl, 'KGM'); ContosoUnitOfMeasure.InsertUnitOfMeasure(Set(), SetLbl, 'SET'); @@ -163,7 +163,7 @@ codeunit 5248 "Create Unit of Measure" KilometerLbl: Label 'Kilometer', MaxLength = 50; KMLbl: Label 'KM', MaxLength = 10; KGLbl: Label 'KG', MaxLength = 10; - KiloLbl: Label 'Kilo', MaxLength = 10; + KiloLbl: Label 'Kilogram', MaxLength = 50; SetTok: Label 'SET', MaxLength = 10; SetLbl: Label 'Set', MaxLength = 50; BagTok: Label 'BAG', MaxLength = 10; diff --git a/Apps/W1/ContosoCoffeeDemoDataset/app/DemoData/Foundation/TenantData/CreateContosoTenantData.Codeunit.al b/Apps/W1/ContosoCoffeeDemoDataset/app/DemoData/Foundation/TenantData/CreateContosoTenantData.Codeunit.al index c5f13ddd1c..250481b008 100644 --- a/Apps/W1/ContosoCoffeeDemoDataset/app/DemoData/Foundation/TenantData/CreateContosoTenantData.Codeunit.al +++ b/Apps/W1/ContosoCoffeeDemoDataset/app/DemoData/Foundation/TenantData/CreateContosoTenantData.Codeunit.al @@ -125,7 +125,8 @@ codeunit 5691 "Create Contoso Tenant Data" begin if FeatureKey.ID in ['PowerAutomateCopilot', 'FullTextSearch', - 'AdvancedTellMe'] + 'AdvancedTellMe', + 'SemanticMetadataSearch'] then exit(true); diff --git a/Apps/W1/ContosoCoffeeDemoDataset/app/DemoData/Manufacturing/2.Master Data/CreateMfgItem.Codeunit.al b/Apps/W1/ContosoCoffeeDemoDataset/app/DemoData/Manufacturing/2.Master Data/CreateMfgItem.Codeunit.al index 1928c05199..e3c49db049 100644 --- a/Apps/W1/ContosoCoffeeDemoDataset/app/DemoData/Manufacturing/2.Master Data/CreateMfgItem.Codeunit.al +++ b/Apps/W1/ContosoCoffeeDemoDataset/app/DemoData/Manufacturing/2.Master Data/CreateMfgItem.Codeunit.al @@ -58,6 +58,10 @@ codeunit 4770 "Create Mfg Item" ContosoPostingSetup.InsertInventoryPostingSetup(ManufacturingModuleSetup."Manufacturing Location", CreateCommonPostingGroup.RawMaterial(), CommonGLAccount.RawMaterials(), '', CreateMfgGLAccount.WIPAccountFinishedGoods(), '', '', '', '', ''); ContosoPostingSetup.InsertInventoryPostingSetup(ManufacturingModuleSetup."Manufacturing Location", CreateCommonPostingGroup.Resale(), CommonGLAccount.Resale(), CommonGLAccount.ResaleInterim()); + + ContosoPostingSetup.InsertInventoryPostingSetup(ManufacturingModuleSetup."Subcontracting Location", CreateMfgPostingGroup.Finished(), CreateMfgGLAccount.FinishedGoods(), '', CreateMfgGLAccount.WIPAccountFinishedGoods(), CreateMfgGLAccount.MaterialVariance(), CreateMfgGLAccount.CapacityVariance(), CreateMfgGLAccount.SubcontractedVariance(), CreateMfgGLAccount.CapOverheadVariance(), CreateMfgGLAccount.MfgOverheadVariance(), CreateMfgGLAccount.MaterialNonInvVariance()); + ContosoPostingSetup.InsertInventoryPostingSetup(ManufacturingModuleSetup."Subcontracting Location", CreateCommonPostingGroup.RawMaterial(), CommonGLAccount.RawMaterials(), '', CreateMfgGLAccount.WIPAccountFinishedGoods(), '', '', '', '', ''); + ContosoPostingSetup.InsertInventoryPostingSetup(ManufacturingModuleSetup."Subcontracting Location", CreateCommonPostingGroup.Resale(), CommonGLAccount.Resale(), CommonGLAccount.ResaleInterim()); end; local procedure CreateBOMAndRoutingItems() diff --git a/Apps/W1/ContosoCoffeeDemoDataset/app/DemoData/Manufacturing/2.Master Data/CreateMfgLocation.Codeunit.al b/Apps/W1/ContosoCoffeeDemoDataset/app/DemoData/Manufacturing/2.Master Data/CreateMfgLocation.Codeunit.al index 54809afa9b..c4f395bfd3 100644 --- a/Apps/W1/ContosoCoffeeDemoDataset/app/DemoData/Manufacturing/2.Master Data/CreateMfgLocation.Codeunit.al +++ b/Apps/W1/ContosoCoffeeDemoDataset/app/DemoData/Manufacturing/2.Master Data/CreateMfgLocation.Codeunit.al @@ -6,6 +6,7 @@ namespace Microsoft.DemoData.Manufacturing; using Microsoft.DemoData.Common; +using Microsoft.DemoTool.Helpers; codeunit 4764 "Create Mfg Location" { @@ -16,12 +17,26 @@ codeunit 4764 "Create Mfg Location" var ManufacturingDemoDataSetup: Record "Manufacturing Module Setup"; CommonLocation: Codeunit "Create Common Location"; + ContosoWarehouse: Codeunit "Contoso Warehouse"; begin ManufacturingDemoDataSetup.Get(); if ManufacturingDemoDataSetup."Manufacturing Location" = '' then ManufacturingDemoDataSetup.Validate("Manufacturing Location", CommonLocation.MainLocation()); + ContosoWarehouse.InsertLocation(SubcontractingLocation(), SubcontractingLocationNameLbl, '', false); + + if ManufacturingDemoDataSetup."Subcontracting Location" = '' then + ManufacturingDemoDataSetup.Validate("Subcontracting Location", SubcontractingLocation()); + ManufacturingDemoDataSetup.Modify(); end; + + var + SubcontractingLocationNameLbl: Label 'Subcontracting', MaxLength = 100; + + procedure SubcontractingLocation(): Code[10] + begin + exit('82000'); + end; } diff --git a/Apps/W1/ContosoCoffeeDemoDataset/app/DemoData/Manufacturing/ManufacturingModuleSetup.Page.al b/Apps/W1/ContosoCoffeeDemoDataset/app/DemoData/Manufacturing/ManufacturingModuleSetup.Page.al index cc5d96b911..e872735c0a 100644 --- a/Apps/W1/ContosoCoffeeDemoDataset/app/DemoData/Manufacturing/ManufacturingModuleSetup.Page.al +++ b/Apps/W1/ContosoCoffeeDemoDataset/app/DemoData/Manufacturing/ManufacturingModuleSetup.Page.al @@ -25,6 +25,10 @@ page 4765 "Manufacturing Module Setup" { ToolTip = 'Specifies a new or an existing location that you want to use for production operations.'; } + field("Subcontracting Location"; Rec."Subcontracting Location") + { + ToolTip = 'Specifies a new or an existing location that you want to use for subcontracting operations.'; + } } } } diff --git a/Apps/W1/ContosoCoffeeDemoDataset/app/DemoData/Manufacturing/ManufacturingModuleSetup.Table.al b/Apps/W1/ContosoCoffeeDemoDataset/app/DemoData/Manufacturing/ManufacturingModuleSetup.Table.al index abd171d89a..6e3ad568ff 100644 --- a/Apps/W1/ContosoCoffeeDemoDataset/app/DemoData/Manufacturing/ManufacturingModuleSetup.Table.al +++ b/Apps/W1/ContosoCoffeeDemoDataset/app/DemoData/Manufacturing/ManufacturingModuleSetup.Table.al @@ -27,6 +27,11 @@ table 4766 "Manufacturing Module Setup" DataClassification = CustomerContent; TableRelation = "Location" where("Use As In-Transit" = const(false)); } + field(3; "Subcontracting Location"; Code[10]) + { + DataClassification = CustomerContent; + TableRelation = "Location" where("Use As In-Transit" = const(false)); + } } keys diff --git a/Apps/W1/ContosoCoffeeDemoDataset/app/DemoTool/Contoso Helpers/ContosoFixedAsset.Codeunit.al b/Apps/W1/ContosoCoffeeDemoDataset/app/DemoTool/Contoso Helpers/ContosoFixedAsset.Codeunit.al index db578661a2..15bd5b9c70 100644 --- a/Apps/W1/ContosoCoffeeDemoDataset/app/DemoTool/Contoso Helpers/ContosoFixedAsset.Codeunit.al +++ b/Apps/W1/ContosoCoffeeDemoDataset/app/DemoTool/Contoso Helpers/ContosoFixedAsset.Codeunit.al @@ -63,6 +63,7 @@ codeunit 4776 "Contoso Fixed Asset" DepreciationBook.Validate(Description, Description); DepreciationBook.Validate("G/L Integration - Acq. Cost", AcqCost); DepreciationBook.Validate("G/L Integration - Depreciation", Depreciation); + DepreciationBook.Validate("G/L Integration - Bonus Depr.", Depreciation); DepreciationBook.Validate("G/L Integration - Write-Down", WriteDown); DepreciationBook.Validate("G/L Integration - Appreciation", Appreciation); DepreciationBook.Validate("G/L Integration - Custom 1", Custom1); diff --git a/Apps/W1/EDocumentConnectors/Microsoft365/app/src/DriveProcessing.Codeunit.al b/Apps/W1/EDocumentConnectors/Microsoft365/app/src/DriveProcessing.Codeunit.al index 711b0ba96b..214705f020 100644 --- a/Apps/W1/EDocumentConnectors/Microsoft365/app/src/DriveProcessing.Codeunit.al +++ b/Apps/W1/EDocumentConnectors/Microsoft365/app/src/DriveProcessing.Codeunit.al @@ -184,8 +184,8 @@ codeunit 6381 "Drive Processing" internal procedure SizeThreshold(): Integer begin - // 5 MB - exit(5242880) + // 20 MB + exit(20971520) end; procedure DownloadDocument(var EDocument: Record "E-Document"; var EDocumentService: Record "E-Document Service"; DocumentMetadataBlob: Codeunit "Temp Blob"; ReceiveContext: Codeunit ReceiveContext) diff --git a/Apps/W1/EDocumentConnectors/Microsoft365/app/src/OutlookProcessing.Codeunit.al b/Apps/W1/EDocumentConnectors/Microsoft365/app/src/OutlookProcessing.Codeunit.al index 5ef181d58c..67331ccf61 100644 --- a/Apps/W1/EDocumentConnectors/Microsoft365/app/src/OutlookProcessing.Codeunit.al +++ b/Apps/W1/EDocumentConnectors/Microsoft365/app/src/OutlookProcessing.Codeunit.al @@ -48,45 +48,7 @@ codeunit 6385 "Outlook Processing" Email.MarkAsRead(OutlookSetup."Email Account ID", OutlookSetup."Email Connector", EDocument."Outlook Mail Message Id"); - Email.ApplyEmailCategory(OutlookSetup."Email Account ID", OutlookSetup."Email Connector", EDocument."Outlook Mail Message Id", RetrieveOrCreateOutlookCategory(OutlookSetup, EDocumentService)); - end; - - /// - /// Retrieves the display name of the Outlook category associated to the processing by this E-Document Service. If the category does not exist, it is created. - /// - /// - /// - /// The display name of the Outlook category as needed by AddCategoryFilter. This name is guaranteed to exist in Outlook after the procedure completes. - local procedure RetrieveOrCreateOutlookCategory(var OutlookSetup: Record "Outlook Setup"; EDocumentService: Record "E-Document Service"): Text - var - TempEmailCategories: Record "Email Categories" temporary; - Email: Codeunit Email; - RedCategoryTok: Label 'Preset0', Locked = true; - CategoryFound: Boolean; - begin - Email.GetEmailCategories(OutlookSetup."Email Account ID", OutlookSetup."Email Connector", TempEmailCategories); - // We try to find the category used to tag the outlook emails by id - if OutlookSetup."Outlook Category Id" <> '' then begin - TempEmailCategories.SetRange("Id", OutlookSetup."Outlook Category Id"); - CategoryFound := TempEmailCategories.FindFirst(); - TempEmailCategories.SetRange("Id"); - end; - // If we cannot find the category by id, we try to find it by name - if not CategoryFound then begin - TempEmailCategories.SetRange("Display Name", GetOutlookCategoryDescription(EDocumentService)); - CategoryFound := TempEmailCategories.FindFirst(); - if CategoryFound then begin - OutlookSetup."Outlook Category Id" := TempEmailCategories.Id; // we update the setup with the id of the category we found to avoid having to do this search again - OutlookSetup.Modify(); - end; - TempEmailCategories.SetRange("Display Name"); - end; - // If we cannot find the category by id nor by name, we create it and assign it to the setup - if not CategoryFound then begin - OutlookSetup."Outlook Category Id" := CopyStr(Email.CreateEmailCategory(OutlookSetup."Email Account ID", OutlookSetup."Email Connector", GetOutlookCategoryDescription(EDocumentService), RedCategoryTok), 1, MaxStrLen(OutlookSetup."Outlook Category Id")); - OutlookSetup.Modify(); - end; - exit(CategoryFound ? TempEmailCategories."Display Name" : GetOutlookCategoryDescription(EDocumentService)); + Email.ApplyEmailCategory(OutlookSetup."Email Account ID", OutlookSetup."Email Connector", EDocument."Outlook Mail Message Id", GetOutlookCategoryDescription(EDocumentService)); end; procedure ReceiveDocuments(var EDocumentService: Record "E-Document Service"; Documents: Codeunit "Temp Blob List"; ReceiveContext: Codeunit ReceiveContext) @@ -96,7 +58,6 @@ codeunit 6385 "Outlook Processing" OutlookProcessing: Codeunit "Outlook Processing"; FeatureTelemetry: Codeunit "Feature Telemetry"; DocumentsArray: JsonArray; - CategoryDescription: Text; begin CheckSetupEnabled(OutlookSetup); if DailyEmailLimitReached(EDocumentService) then begin @@ -108,14 +69,13 @@ codeunit 6385 "Outlook Processing" Session.LogMessage('0000QJ1', 'Daily limit for e-mail attachments received has been reached.', Verbosity::Warning, DataClassification::SystemMetadata, TelemetryScope::All, 'Category', FeatureName()); exit; end; - CategoryDescription := RetrieveOrCreateOutlookCategory(OutlookSetup, EDocumentService); FeatureTelemetry.LogUptake('0000OGS', FeatureName(), Enum::"Feature Uptake Status"::Used); FeatureTelemetry.LogUsage('0000OGV', FeatureName(), Format(EDocumentService."Service Integration V2")); TempFilters."Load Attachments" := true; TempFilters."Max No. of Emails" := GetMaxNoOfEmails(); TempFilters."Earliest Email" := OutlookSetup."Last Sync At"; TempFilters."Category Filter Type" := TempFilters."Category Filter Type"::Exclude; - TempFilters.AddCategoryFilter(CategoryDescription); + TempFilters.AddCategoryFilter(GetOutlookCategoryDescription(EDocumentService)); OutlookProcessing.ConfigureForEmailRetrieval(TempFilters); Commit(); if not OutlookProcessing.Run() then begin // Email.RetrieveEmails() called this way to "catch" and recover @@ -458,7 +418,7 @@ codeunit 6385 "Outlook Processing" EDocM365ConnEvents: Codeunit "E-Doc. M365 Conn. Events"; CategoryDescription: Text; begin - CategoryDescription := OutlookCategoryTxt; + CategoryDescription := OutlookCategoryTok; EDocM365ConnEvents.OnGetOutlookCategoryDescription(EDocumentService, CategoryDescription); exit(CategoryDescription); end; @@ -476,5 +436,5 @@ codeunit 6385 "Outlook Processing" ProcessingEmailTxt: label 'Processing email.', Locked = true; PageCountExceededTelemetryTxt: label 'PDF Attachment ignored because it exceeds page count of %1.', Locked = true; PageCountCallFailedTelemetryTxt: label 'Unable to calculate page count for PDF Attachment.', Locked = true; - OutlookCategoryTxt: Label 'Processed by Business Central'; + OutlookCategoryTok: Label 'Processed by Business Central', Locked = true; } \ No newline at end of file diff --git a/Apps/W1/EDocumentConnectors/Microsoft365/app/src/OutlookSetup.Table.al b/Apps/W1/EDocumentConnectors/Microsoft365/app/src/OutlookSetup.Table.al index 89457c2476..6faf98517c 100644 --- a/Apps/W1/EDocumentConnectors/Microsoft365/app/src/OutlookSetup.Table.al +++ b/Apps/W1/EDocumentConnectors/Microsoft365/app/src/OutlookSetup.Table.al @@ -73,12 +73,24 @@ table 6383 "Outlook Setup" ToolTip = 'Specifies whether the customer has given consent to the privacy notice.'; DataClassification = SystemMetadata; } +#if not CLEANSCHEMA31 field(6; "Outlook Category Id"; Text[2048]) { Caption = 'Outlook Category'; ToolTip = 'Specifies the Outlook category that will be set when an email has been processed by the connector.'; DataClassification = CustomerContent; + ObsoleteReason = 'Never used field.'; +#pragma warning disable AS0072 +#if not CLEAN28 + ObsoleteState = Pending; + ObsoleteTag = '28.0'; +#else + ObsoleteState = Removed; + ObsoleteTag = '31.0'; +#endif +#pragma warning restore AS0072 } +#endif field(16; "Enabled At"; DateTime) { Caption = 'Enabled At'; diff --git a/Apps/W1/EnforcedDigitalVouchers/app/src/Implementation/DigitalVoucherImpl.Codeunit.al b/Apps/W1/EnforcedDigitalVouchers/app/src/Implementation/DigitalVoucherImpl.Codeunit.al index 6efab7c33c..1028e5eb70 100644 --- a/Apps/W1/EnforcedDigitalVouchers/app/src/Implementation/DigitalVoucherImpl.Codeunit.al +++ b/Apps/W1/EnforcedDigitalVouchers/app/src/Implementation/DigitalVoucherImpl.Codeunit.al @@ -338,6 +338,36 @@ codeunit 5579 "Digital Voucher Impl." exit(InvIncomingDocumentAttachment."Incoming Document Entry No."); end; + local procedure CopyIncomingDocForPrepmtDoc(PurchHeader: Record "Purchase Header"; PostedDocNo: Code[20]; PostedPostingDate: Date) + var + DigitalVoucherEntrySetup: Record "Digital Voucher Entry Setup"; + SourceIncomingDocument: Record "Incoming Document"; + TargetIncomingDocument: Record "Incoming Document"; + SourceIncomingDocAttach: Record "Incoming Document Attachment"; + TargetIncomingDocAttach: Record "Incoming Document Attachment"; + begin + if not GetDigitalVoucherEntrySetup(DigitalVoucherEntrySetup, "Digital Voucher Entry Type"::"Purchase Document") then + exit; + if DigitalVoucherEntrySetup."Generate Automatically" then + exit; + if PurchHeader."Incoming Document Entry No." = 0 then + exit; + if not SourceIncomingDocument.Get(PurchHeader."Incoming Document Entry No.") then + exit; + SourceIncomingDocAttach.SetRange("Incoming Document Entry No.", SourceIncomingDocument."Entry No."); + if not SourceIncomingDocAttach.FindSet() then + exit; + TargetIncomingDocument.Init(); + TargetIncomingDocument."Document No." := PostedDocNo; + TargetIncomingDocument."Posting Date" := PostedPostingDate; + TargetIncomingDocument.Insert(true); + repeat + TargetIncomingDocAttach := SourceIncomingDocAttach; + TargetIncomingDocAttach."Incoming Document Entry No." := TargetIncomingDocument."Entry No."; + TargetIncomingDocAttach.Insert(true); + until SourceIncomingDocAttach.Next() = 0; + end; + local procedure IsPaymentReconciliationJournal(DigitalVoucherEntryType: Enum "Digital Voucher Entry Type"; RecRef: RecordRef): Boolean var SourceCodeSetup: Record "Source Code Setup"; @@ -593,10 +623,14 @@ codeunit 5579 "Digital Voucher Impl." begin if not DigitalVoucherFeature.IsFeatureEnabled() then exit; - if PurchInvHeader."No." <> '' then + if PurchInvHeader."No." <> '' then begin + CopyIncomingDocForPrepmtDoc(PurchHeader, PurchInvHeader."No.", PurchInvHeader."Posting Date"); HandleDigitalVoucherForPostedDocument("Digital Voucher Entry Type"::"Purchase Document", PurchInvHeader); - if PurchCrMemoHdr."No." <> '' then + end; + if PurchCrMemoHdr."No." <> '' then begin + CopyIncomingDocForPrepmtDoc(PurchHeader, PurchCrMemoHdr."No.", PurchCrMemoHdr."Posting Date"); HandleDigitalVoucherForPostedDocument("Digital Voucher Entry Type"::"Purchase Document", PurchCrMemoHdr); + end; end; [EventSubscriber(ObjectType::Codeunit, Codeunit::"Gen. Jnl.-Post Batch", 'OnProcessLinesOnAfterPostGenJnlLines', '', true, true)] diff --git a/Apps/W1/EnforcedDigitalVouchers/test/src/DigitalVouchersTests.Codeunit.al b/Apps/W1/EnforcedDigitalVouchers/test/src/DigitalVouchersTests.Codeunit.al index 901747d572..d0c1c97a0f 100644 --- a/Apps/W1/EnforcedDigitalVouchers/test/src/DigitalVouchersTests.Codeunit.al +++ b/Apps/W1/EnforcedDigitalVouchers/test/src/DigitalVouchersTests.Codeunit.al @@ -1536,6 +1536,65 @@ codeunit 139515 "Digital Vouchers Tests" UnbindSubscription(DigVouchersDisableEnforce); end; + [Test] + procedure PartialPurchaseOrderInvoicingPreservesIncomingDocuments() + var + IncomingDocumentAttachment: Record "Incoming Document Attachment"; + PurchaseHeader: Record "Purchase Header"; + PurchaseLine: Record "Purchase Line"; + Vendor: Record Vendor; + FirstIncomingDocEntryNo: Integer; + SecondIncomingDocEntryNo: Integer; + begin + // [FEATURE] [AI TEST] + // [SCENARIO 623756] Partial purchase order invoicing should preserve incoming documents for each posted invoice + Initialize(); + EnableDigitalVoucherFeature(); + + // [GIVEN] Digital voucher entry setup for Purchase Document is "Attachment" + InitSetupCheckOnly("Digital Voucher Entry Type"::"Purchase Document", "Digital Voucher Check Type"::Attachment); + + // [GIVEN] Create a Purchase Order with one item, quantity = 2 + LibraryPurchase.CreateVendor(Vendor); + LibraryPurchase.CreatePurchHeader(PurchaseHeader, PurchaseHeader."Document Type"::Order, Vendor."No."); + LibraryPurchase.CreatePurchaseLine( + PurchaseLine, PurchaseHeader, PurchaseLine.Type::Item, LibraryInventory.CreateItemNo(), 2); + + // [GIVEN] Attach an incoming document with attachment to the purchase order + PurchaseHeader.Validate("Incoming Document Entry No.", MockIncomingDocument(PurchaseHeader."Posting Date", PurchaseHeader."No.")); + PurchaseHeader.Modify(true); + FirstIncomingDocEntryNo := PurchaseHeader."Incoming Document Entry No."; + + // [GIVEN] Set Qty to Receive = 1 and post first partial invoice + PurchaseLine.Validate("Qty. to Receive", 1); + PurchaseLine.Validate("Qty. to Invoice", 1); + PurchaseLine.Modify(true); + + // [WHEN] Post first partial invoice + LibraryPurchase.PostPurchaseDocument(PurchaseHeader, true, true); + + // [GIVEN] Get the purchase order again and set a new vendor invoice number + PurchaseHeader.Get(PurchaseHeader."Document Type"::Order, PurchaseHeader."No."); + PurchaseHeader.Validate("Vendor Invoice No.", LibraryUtility.GenerateRandomCode(PurchaseHeader.FieldNo("Vendor Invoice No."), DATABASE::"Purchase Header")); + PurchaseHeader.Modify(true); + + // [GIVEN] Upload a new incoming document attachment + PurchaseHeader.Validate("Incoming Document Entry No.", MockIncomingDocument(PurchaseHeader."Posting Date", PurchaseHeader."No.")); + PurchaseHeader.Modify(true); + SecondIncomingDocEntryNo := PurchaseHeader."Incoming Document Entry No."; + + // [WHEN] Post second partial invoice (remaining quantity) + LibraryPurchase.PostPurchaseDocument(PurchaseHeader, true, true); + + // Verify first incoming document still has attachment + IncomingDocumentAttachment.SetRange("Incoming Document Entry No.", FirstIncomingDocEntryNo); + Assert.IsTrue(IncomingDocumentAttachment.Count() > 0, 'First incoming document attachment not found'); + + // [THEN] Verify the second incoming document has attachments + IncomingDocumentAttachment.SetRange("Incoming Document Entry No.", SecondIncomingDocEntryNo); + Assert.IsTrue(IncomingDocumentAttachment.Count() > 0, 'Second incoming document should have attachments'); + end; + local procedure Initialize() var CompanyInformation: Record "Company Information"; diff --git a/Apps/W1/ExciseTaxes/app/src/page/ExciseTaxEntryPermissions.Page.al b/Apps/W1/ExciseTaxes/app/src/page/ExciseTaxEntryPermissions.Page.al index e219e00908..7188d4e41f 100644 --- a/Apps/W1/ExciseTaxes/app/src/page/ExciseTaxEntryPermissions.Page.al +++ b/Apps/W1/ExciseTaxes/app/src/page/ExciseTaxEntryPermissions.Page.al @@ -12,7 +12,7 @@ page 7413 "Excise Tax Entry Permissions" ApplicationArea = All; SourceTable = "Excise Tax Entry Permission"; DataCaptionExpression = GetCaption(); - Caption = 'Excise Tax Entry Permissions'; + Caption = 'Excise Tax Entry Types'; layout { @@ -45,8 +45,8 @@ page 7413 "Excise Tax Entry Permissions" action("Setup Default Permissions") { ApplicationArea = All; - Caption = 'Setup Default Permissions'; - ToolTip = 'Create default permissions for all entry types.'; + Caption = 'Setup Default Entry Types'; + ToolTip = 'Create default entry types for all tax types.'; Image = Setup; trigger OnAction() @@ -65,7 +65,7 @@ page 7413 "Excise Tax Entry Permissions" var ConfirmManagement: Codeunit "Confirm Management"; - ConfirmForInsertMsg: Label 'Are you sure you want to Setup all default permissions for tax type %1?', Comment = '%1 = Excise Tax Type Code'; + ConfirmForInsertMsg: Label 'Are you sure you want to setup all default entry types for tax type %1?', Comment = '%1 = Excise Tax Type Code'; EntryPermissionsCaptionLbl: Label '%1 for Tax Type: %2', Comment = '%1=Current Rec TableCaption, %2=Excise Tax Type Code'; local procedure GetCaption(): Text[100] diff --git a/Apps/W1/ExciseTaxes/app/src/page/ExciseTaxItemFARates.Page.al b/Apps/W1/ExciseTaxes/app/src/page/ExciseTaxItemFARates.Page.al index ef672aba65..e6c6c64f74 100644 --- a/Apps/W1/ExciseTaxes/app/src/page/ExciseTaxItemFARates.Page.al +++ b/Apps/W1/ExciseTaxes/app/src/page/ExciseTaxItemFARates.Page.al @@ -10,7 +10,7 @@ page 7412 "Excise Tax Item/FA Rates" ApplicationArea = All; SourceTable = "Excise Tax Item/FA Rate"; DataCaptionExpression = GetCaption(); - Caption = 'Excise Tax Item/FA Rates'; + Caption = 'Excise Duty Rates'; DelayedInsert = true; layout @@ -31,6 +31,7 @@ page 7412 "Excise Tax Item/FA Rates" } field("Source No."; Rec."Source No.") { + Visible = false; ToolTip = 'Specifies the Item or Fixed Asset number.'; } field("Excise Duty"; Rec."Excise Duty") diff --git a/Apps/W1/ExciseTaxes/app/src/page/ExciseTaxTypeCard.Page.al b/Apps/W1/ExciseTaxes/app/src/page/ExciseTaxTypeCard.Page.al index 168d88027f..272c5287b0 100644 --- a/Apps/W1/ExciseTaxes/app/src/page/ExciseTaxTypeCard.Page.al +++ b/Apps/W1/ExciseTaxes/app/src/page/ExciseTaxTypeCard.Page.al @@ -52,16 +52,16 @@ page 7415 "Excise Tax Type Card" { action("Configure Rates") { - Caption = 'Configure Entry Permissions'; - ToolTip = 'Configure entry type permissions for this tax type.'; + Caption = 'Configure Entry Types'; + ToolTip = 'Configure entry types for this tax type.'; Image = Setup; RunObject = Page "Excise Tax Entry Permissions"; RunPageLink = "Excise Tax Type Code" = field(Code); } action("Item/FA Rates") { - Caption = 'Item/FA Rates'; - ToolTip = 'Configure tax rates for specific items and fixed assets.'; + Caption = 'Excise Duty Rates'; + ToolTip = 'Configure excise duty rates for specific items and fixed assets.'; Image = Setup; RunObject = Page "Excise Tax Item/FA Rates"; RunPageLink = "Excise Tax Type Code" = field(Code); diff --git a/Apps/W1/ExciseTaxes/app/src/page/ExciseTaxTypes.Page.al b/Apps/W1/ExciseTaxes/app/src/page/ExciseTaxTypes.Page.al index 4faa490835..374e57f7d5 100644 --- a/Apps/W1/ExciseTaxes/app/src/page/ExciseTaxTypes.Page.al +++ b/Apps/W1/ExciseTaxes/app/src/page/ExciseTaxTypes.Page.al @@ -42,16 +42,16 @@ page 7414 "Excise Tax Types" { action("Entry Permissions") { - Caption = 'Configure Entry Permissions'; - ToolTip = 'Configure entry type permissions for this tax type.'; + Caption = 'Configure Entry Types'; + ToolTip = 'Configure entry types for this tax type.'; Image = Setup; RunObject = Page "Excise Tax Entry Permissions"; RunPageLink = "Excise Tax Type Code" = field(Code); } action("Item/FA Rates") { - Caption = 'Item/FA Rates'; - ToolTip = 'Configure tax rates for specific items and fixed assets.'; + Caption = 'Excise Duty Rates'; + ToolTip = 'Configure excise duty rates for specific items and fixed assets.'; Image = Setup; RunObject = Page "Excise Tax Item/FA Rates"; RunPageLink = "Excise Tax Type Code" = field(Code); diff --git a/Apps/W1/ExciseTaxes/app/src/table/ExciseTaxEntryPermission.Table.al b/Apps/W1/ExciseTaxes/app/src/table/ExciseTaxEntryPermission.Table.al index 732ddfb3e7..a70717dd91 100644 --- a/Apps/W1/ExciseTaxes/app/src/table/ExciseTaxEntryPermission.Table.al +++ b/Apps/W1/ExciseTaxes/app/src/table/ExciseTaxEntryPermission.Table.al @@ -6,7 +6,7 @@ namespace Microsoft.ExciseTaxes; table 7414 "Excise Tax Entry Permission" { - Caption = 'Excise Tax Entry Permission'; + Caption = 'Excise Tax Entry Type'; DataClassification = CustomerContent; LookupPageId = "Excise Tax Entry Permissions"; DrillDownPageId = "Excise Tax Entry Permissions"; diff --git a/Apps/W1/ExciseTaxes/app/src/table/ExciseTaxItemFARate.Table.al b/Apps/W1/ExciseTaxes/app/src/table/ExciseTaxItemFARate.Table.al index 306227884a..e43d202e81 100644 --- a/Apps/W1/ExciseTaxes/app/src/table/ExciseTaxItemFARate.Table.al +++ b/Apps/W1/ExciseTaxes/app/src/table/ExciseTaxItemFARate.Table.al @@ -10,7 +10,7 @@ using Microsoft.Sustainability.ExciseTax; table 7413 "Excise Tax Item/FA Rate" { - Caption = 'Excise Tax Item/FA Rate'; + Caption = 'Excise Duty Rate'; DataClassification = CustomerContent; LookupPageId = "Excise Tax Item/FA Rates"; DrillDownPageId = "Excise Tax Item/FA Rates"; @@ -54,7 +54,7 @@ table 7413 "Excise Tax Item/FA Rate" field(4; "Excise Duty"; Decimal) { AutoFormatType = 0; - Caption = 'Excise Duty'; + Caption = 'Excise Duty Rate'; DecimalPlaces = 2 : 5; MinValue = 0; } diff --git a/Apps/W1/ExciseTaxes/app/src/tableextension/ExciseJournalLineExt.TableExt.al b/Apps/W1/ExciseTaxes/app/src/tableextension/ExciseJournalLineExt.TableExt.al index d55d41e759..aaac5c5907 100644 --- a/Apps/W1/ExciseTaxes/app/src/tableextension/ExciseJournalLineExt.TableExt.al +++ b/Apps/W1/ExciseTaxes/app/src/tableextension/ExciseJournalLineExt.TableExt.al @@ -68,7 +68,7 @@ tableextension 7413 "Excise Journal Line Ext" extends "Sust. Excise Jnl. Line" field(7416; "Excise Duty"; Decimal) { AutoFormatType = 0; - Caption = 'Excise Duty'; + Caption = 'Excise Duty Rate'; DecimalPlaces = 2 : 5; MinValue = 0; DataClassification = CustomerContent; diff --git a/Apps/W1/ExciseTaxes/app/src/tableextension/ExciseTaxesTransLogExt.TableExt.al b/Apps/W1/ExciseTaxes/app/src/tableextension/ExciseTaxesTransLogExt.TableExt.al index 26509675e1..1bfe85427e 100644 --- a/Apps/W1/ExciseTaxes/app/src/tableextension/ExciseTaxesTransLogExt.TableExt.al +++ b/Apps/W1/ExciseTaxes/app/src/tableextension/ExciseTaxesTransLogExt.TableExt.al @@ -43,7 +43,7 @@ tableextension 7414 "Excise Taxes Trans. Log Ext" extends "Sust. Excise Taxes Tr field(7416; "Excise Duty"; Decimal) { AutoFormatType = 0; - Caption = 'Excise Duty'; + Caption = 'Excise Duty Rate'; DecimalPlaces = 2 : 5; MinValue = 0; DataClassification = CustomerContent; diff --git a/Apps/W1/FieldServiceIntegration/app/src/Codeunits/FSIntegrationMgt.Codeunit.al b/Apps/W1/FieldServiceIntegration/app/src/Codeunits/FSIntegrationMgt.Codeunit.al index a62c8b2186..3db5425b2c 100644 --- a/Apps/W1/FieldServiceIntegration/app/src/Codeunits/FSIntegrationMgt.Codeunit.al +++ b/Apps/W1/FieldServiceIntegration/app/src/Codeunits/FSIntegrationMgt.Codeunit.al @@ -372,6 +372,7 @@ codeunit 6615 "FS Integration Mgt." EmptyGuid: Guid; begin FSBookingStatus.SetRange(FieldServiceStatus, FSBookingStatus.FieldServiceStatus::Completed); + OnGetBookingStatusCompletedOnSetFilterForFSBookingStatus(FSBookingStatus); if not FSBookingStatus.FindFirst() then exit(EmptyGuid); @@ -418,4 +419,9 @@ codeunit 6615 "FS Integration Mgt." ServiceConnection.InsertServiceConnectionExtended( ServiceConnection, RecRef.RecordId, FSConnectionSetup.TableCaption(), FSConnectionSetup."Server Address", Page::"FS Connection Setup", Page::"FS Connection Setup Wizard"); end; + + [IntegrationEvent(false, false)] + local procedure OnGetBookingStatusCompletedOnSetFilterForFSBookingStatus(var FSBookingStatus: Record "FS Booking Status") + begin + end; } \ No newline at end of file diff --git a/Apps/W1/HybridBaseDeployment/app/app.json b/Apps/W1/HybridBaseDeployment/app/app.json index bf123f7869..4d688400fa 100644 --- a/Apps/W1/HybridBaseDeployment/app/app.json +++ b/Apps/W1/HybridBaseDeployment/app/app.json @@ -57,6 +57,11 @@ "id": "82acac14-8067-499b-8cf0-f068448dff34", "name": "Dynamics GP Intelligent Cloud Tests", "publisher": "Microsoft" + }, + { + "id": "a1b2c3d4-5678-9012-abcd-ef1234567890", + "name": "BC14 Reimplementation Tool Tests", + "publisher": "Microsoft" } ] } diff --git a/Apps/W1/HybridBaseDeployment/app/src/CustomMigration/CustomMigrationProvider.Codeunit.al b/Apps/W1/HybridBaseDeployment/app/src/CustomMigration/CustomMigrationProvider.Codeunit.al index d569ed3a35..db6ad6cce8 100644 --- a/Apps/W1/HybridBaseDeployment/app/src/CustomMigration/CustomMigrationProvider.Codeunit.al +++ b/Apps/W1/HybridBaseDeployment/app/src/CustomMigration/CustomMigrationProvider.Codeunit.al @@ -87,20 +87,11 @@ codeunit 40034 "Custom Migration Provider" implements "Custom Migration Provider [EventSubscriber(ObjectType::Page, Page::"Intelligent Cloud Management", 'OnOpenNewUI', '', false, false)] local procedure HandleOnOpenNewUI(var OpenNewUI: Boolean) - begin - if GetCustomMigrationEnabled() then - OpenNewUI := true; - end; - - local procedure GetCustomMigrationEnabled(): Boolean var - IntelligentCloudSetup: Record "Intelligent Cloud Setup"; + HybridCloudManagement: Codeunit "Hybrid Cloud Management"; begin - if not IntelligentCloudSetup.Get() then - exit(false); - - exit(IntelligentCloudSetup."Custom Migration Enabled" and - (IntelligentCloudSetup."Custom Migration Provider" = IntelligentCloudSetup."Custom Migration Provider"::"Custom Migration Provider")); + if HybridCloudManagement.IsCustomMigrationEnabled() then + OpenNewUI := true; end; [IntegrationEvent(false, false)] diff --git a/Apps/W1/HybridBaseDeployment/app/src/CustomMigration/OnPremMigrationHandler.Codeunit.al b/Apps/W1/HybridBaseDeployment/app/src/CustomMigration/OnPremMigrationHandler.Codeunit.al index c1bbcd2a52..6c3b43b0d1 100644 --- a/Apps/W1/HybridBaseDeployment/app/src/CustomMigration/OnPremMigrationHandler.Codeunit.al +++ b/Apps/W1/HybridBaseDeployment/app/src/CustomMigration/OnPremMigrationHandler.Codeunit.al @@ -13,6 +13,7 @@ codeunit 40035 "OnPrem Migration Handler" InherentEntitlements = X; InherentPermissions = X; Access = Internal; + EventSubscriberInstance = Manual; var GlobalProductId: Text; @@ -61,12 +62,9 @@ codeunit 40035 "OnPrem Migration Handler" local procedure CanHandle(): Boolean var - HybridDeploymentSetup: Record "Hybrid Deployment Setup"; + EnvironmentInformation: Codeunit "Environment Information"; begin - if HybridDeploymentSetup.Get() then - exit(HybridDeploymentSetup."Handler Codeunit ID" = Codeunit::"OnPrem Migration Handler"); - - exit(false); + exit(not EnvironmentInformation.IsSaaSInfrastructure()); end; [Scope('OnPrem')] diff --git a/Apps/W1/HybridBaseDeployment/app/src/CustomMigration/TableMappings/AddCustomMigrationMapping.Page.al b/Apps/W1/HybridBaseDeployment/app/src/CustomMigration/TableMappings/AddCustomMigrationMapping.Page.al index fdda9c7851..e03d5327cf 100644 --- a/Apps/W1/HybridBaseDeployment/app/src/CustomMigration/TableMappings/AddCustomMigrationMapping.Page.al +++ b/Apps/W1/HybridBaseDeployment/app/src/CustomMigration/TableMappings/AddCustomMigrationMapping.Page.al @@ -13,7 +13,9 @@ page 40016 "Add Custom Migration Mapping" ApplicationArea = All; PageType = List; SourceTable = "AllObj"; - Permissions = tabledata "NAV App Installed App" = r, tabledata AllObj = r, tabledata "Published Application" = r; + Permissions = tabledata "NAV App Installed App" = r, + tabledata AllObj = r, + tabledata "Published Application" = r; InsertAllowed = false; DeleteAllowed = false; ModifyAllowed = false; @@ -167,6 +169,11 @@ page 40016 "Add Custom Migration Mapping" ApplicationArea = All; ToolTip = 'Specifies the name of the destination table in the cloud database. Use underscores in place of special characters, similar to how table names appear in SQL Server Management Studio.'; Caption = 'Destination table name'; + + trigger OnValidate() + begin + ValidateTargetTable(); + end; } } } @@ -183,6 +190,9 @@ page 40016 "Add Custom Migration Mapping" if not (CloseAction in [Action::OK, Action::LookupOK]) then exit(true); + if TargetTableName = '' then + exit(Confirm(TheDestinationTableIsEmptyContinueQst)); + if AllCompanies then begin HybridCompany.SetRange(Replicate, true); HybridCompany.SetFilter(Name, '<>%1', ''); @@ -197,6 +207,9 @@ page 40016 "Add Custom Migration Mapping" until HybridCompany.Next() = 0; end else CustomMigrationTableBuffer.SaveMigrationTableMapping(MappingType, SourceTableName, DestinationTableName, TargetTableName, CompanyName, DataPerCompany, GlobalPreserveCloudData); + + // Validate and enable replication for all custom migration tables + ValidateTargetTable(); exit(true); end; @@ -218,6 +231,19 @@ page 40016 "Add Custom Migration Mapping" end; end; + local procedure ValidateTargetTable() + var + CloudMigReplicateDataMgt: Codeunit "Cloud Mig. Replicate Data Mgt."; + CannotEnableTable: Boolean; + TableDoesNotExist: Boolean; + begin + CloudMigReplicateDataMgt.ValidateAndEnableTableReplication(DestinationTableName, CannotEnableTable, TableDoesNotExist); + if CannotEnableTable then + Error(TargetTableCannotBeEnabledErr, DestinationTableName); + if TableDoesNotExist then + Error(TargetTableDoesNotExistErr, DestinationTableName); + end; + var TableMetadata: Record "Table Metadata"; MappingType: Enum "Migration Mapping Type"; @@ -237,4 +263,7 @@ page 40016 "Add Custom Migration Mapping" AllCompanies: Boolean; UpdateTableNamesWithAllCompaniesTokMsg: Label 'The %1 token in the source table and destination table name will be replaced with the name of the company that is selected for migration. Update the source and destination table names accordingly.', Comment = '%1 is this value that is not translated {$AllCompanies$}'; CompanyNameMustBeSpecifiedErr: Label 'Company Name must be specified when Data Per Company is selected.', Comment = 'Error message shown when trying to select a table mapping that is per company without specifying a company name.'; + TargetTableCannotBeEnabledErr: Label 'The destination table %1 cannot be enabled for replication. Please ensure the table exists and is not a system table.', Comment = '%1 is the name of the destination table that cannot be enabled for replication.'; + TargetTableDoesNotExistErr: Label 'The destination table %1 does not exist. Please ensure the table name is correct.', Comment = '%1 is the name of the destination table that was not found.'; + TheDestinationTableIsEmptyContinueQst: Label 'The destination table name is empty, the mapping will not be saved. Do you want to continue?'; } \ No newline at end of file diff --git a/Apps/W1/HybridBaseDeployment/app/src/codeunits/CloudMigReplicateDataMgt.Codeunit.al b/Apps/W1/HybridBaseDeployment/app/src/codeunits/CloudMigReplicateDataMgt.Codeunit.al index e72646aadd..31e273d0d9 100644 --- a/Apps/W1/HybridBaseDeployment/app/src/codeunits/CloudMigReplicateDataMgt.Codeunit.al +++ b/Apps/W1/HybridBaseDeployment/app/src/codeunits/CloudMigReplicateDataMgt.Codeunit.al @@ -510,36 +510,29 @@ codeunit 40021 "Cloud Mig. Replicate Data Mgt." begin end; - internal procedure ValidateAndEnableReplicationForMappedTables() + internal procedure ValidateCustomMigrationTables() var - IntelligentCloudStatus: Record "Intelligent Cloud Status"; IncludedMappingTableNames: Dictionary of [Text[128], Boolean]; - MissingTables: Text; - TablesCannotBeEnabled: Text; + MissingTables: TextBuilder; + TablesCannotBeEnabled: TextBuilder; + CannotEnableTable: Boolean; + TableDoesNotExist: Boolean; TableName: Text[128]; + TableSeparatorTok: Label ', ', Locked = true; begin LoadIncludedTableNamesFromMappings(IncludedMappingTableNames); foreach TableName in IncludedMappingTableNames.Keys() do begin - IntelligentCloudStatus.SetRange("Table Name", TableName); - if IntelligentCloudStatus.FindSet() then - repeat - if not IntelligentCloudStatus."Replicate Data" then - if not EnableReplicateDataForTable(IntelligentCloudStatus) then begin - if TablesCannotBeEnabled <> '' then - TablesCannotBeEnabled += ', '; - TablesCannotBeEnabled += TableName; - end; - until IntelligentCloudStatus.Next() = 0 - else begin - if MissingTables <> '' then - MissingTables += ', '; - MissingTables += TableName; - end; + ValidateAndEnableTableReplication(TableName, CannotEnableTable, TableDoesNotExist); + if CannotEnableTable then + TablesCannotBeEnabled.Append(TableName + TableSeparatorTok); + + if TableDoesNotExist then + MissingTables.Append(TableName + TableSeparatorTok); end; - if (TablesCannotBeEnabled <> '') or (MissingTables <> '') then - Error(TableMappingsIncorrectErr, GetTablesCannotBeEnabledErrorPart(TablesCannotBeEnabled), GetMissingTablesErrorPart(MissingTables)); + if (TablesCannotBeEnabled.Length() > 0) or (MissingTables.Length() > 0) then + Error(TableMappingsIncorrectErr, GetTablesCannotBeEnabledErrorPart(TablesCannotBeEnabled.ToText().TrimEnd(TableSeparatorTok)), GetMissingTablesErrorPart(MissingTables.ToText().TrimEnd(TableSeparatorTok))); end; local procedure LoadIncludedTableNamesFromMappings(var IncludedMappingTableNames: Dictionary of [Text[128], Boolean]) @@ -576,6 +569,23 @@ codeunit 40021 "Cloud Mig. Replicate Data Mgt." exit(true); end; + internal procedure ValidateAndEnableTableReplication(TableName: Text[128]; var CannotEnableTable: Boolean; var TableDoesNotExist: Boolean) + var + IntelligentCloudStatus: Record "Intelligent Cloud Status"; + begin + IntelligentCloudStatus.SetRange("Table Name", TableName); + if not IntelligentCloudStatus.FindSet() then begin + TableDoesNotExist := true; + exit; + end; + + repeat + if not IntelligentCloudStatus."Replicate Data" then + if not EnableReplicateDataForTable(IntelligentCloudStatus) then + CannotEnableTable := true; + until IntelligentCloudStatus.Next() = 0; + end; + local procedure GetTablesCannotBeEnabledErrorPart(TablesCannotBeEnabled: Text): Text begin if TablesCannotBeEnabled = '' then diff --git a/Apps/W1/HybridBaseDeployment/app/src/codeunits/HybridCloudManagement.Codeunit.al b/Apps/W1/HybridBaseDeployment/app/src/codeunits/HybridCloudManagement.Codeunit.al index 9b48c669e9..094ff50e2e 100644 --- a/Apps/W1/HybridBaseDeployment/app/src/codeunits/HybridCloudManagement.Codeunit.al +++ b/Apps/W1/HybridBaseDeployment/app/src/codeunits/HybridCloudManagement.Codeunit.al @@ -452,27 +452,11 @@ codeunit 4001 "Hybrid Cloud Management" procedure RepairCompanionTables() var - AllObj: Record AllObj; - PublishedApplication: Record "Published Application"; CompanionTableRecordConsistencyRepair: DotNet CompanionTableRecordConsistencyRepair; begin Session.LogMessage('0000FJ1', 'Companion table repair started.', Verbosity::Normal, DataClassification::SystemMetadata, TelemetryScope::All, 'Category', GetTelemetryCategory()); CompanionTableRecordConsistencyRepair := CompanionTableRecordConsistencyRepair.CompanionTableRecordConsistencyRepair(); - AllObj.SetRange("Object Type", AllObj."Object Type"::"TableExtension"); - PublishedApplication.SetRange(Installed, true); - if PublishedApplication.FindSet() then - repeat - AllObj.SetRange("App Runtime Package ID", PublishedApplication."Runtime Package ID"); - if not AllObj.IsEmpty() then begin -#pragma warning disable AA0217 - Session.LogMessage('0000FJ2', StrSubstNo('Starting Repair of Companion Tables for Package ID %1', PublishedApplication."Package ID"), Verbosity::Normal, DataClassification::SystemMetadata, TelemetryScope::ExtensionPublisher, 'Category', GetTelemetryCategory()); - CompanionTableRecordConsistencyRepair.UpdateCompanionTablesInAppWithMissingRecords(PublishedApplication."Runtime Package ID"); - Commit(); - Session.LogMessage('0000FJ3', StrSubstNo('Completed Repair of Companion Tables for Package ID %1', PublishedApplication."Package ID"), Verbosity::Normal, DataClassification::SystemMetadata, TelemetryScope::ExtensionPublisher, 'Category', GetTelemetryCategory()); -#pragma warning restore - end; - until PublishedApplication.Next() = 0; - + CompanionTableRecordConsistencyRepair.UpdateCompanionTablesInAppWithMissingRecords(true); Session.LogMessage('0000FJ4', 'Companion table repair completed successfully.', Verbosity::Normal, DataClassification::SystemMetadata, TelemetryScope::All, 'Category', GetTelemetryCategory()); end; @@ -878,11 +862,10 @@ codeunit 4001 "Hybrid Cloud Management" HybridDeployment.ResetCloudData(); MarkTablesAsReplaceData(); + ValidateCustomMigrationTables(); OnHandleRunReplication(Handled, RunId, ReplicationType); - if not Handled then begin - PrepareTablesForCustomMigration(); + if not Handled then HybridDeployment.RunReplication(RunId, ReplicationType); - end; HybridReplicationSummary.CreateInProgressRecord(RunId, ReplicationType); if HybridReplicationSummary.FindLast() then; @@ -909,19 +892,18 @@ codeunit 4001 "Hybrid Cloud Management" exit(''); end; - internal procedure PrepareTablesForCustomMigration() + internal procedure ValidateCustomMigrationTables() var CloudMigReplicateDataMgt: Codeunit "Cloud Mig. Replicate Data Mgt."; begin - CloudMigReplicateDataMgt.CheckCanChangeAllIntelligentCloudStatus(); - - if not IsCustomMigrationEnabled() then + if not IsNoCodeMigrationEnabled() then exit; - CloudMigReplicateDataMgt.ValidateAndEnableReplicationForMappedTables(); + CloudMigReplicateDataMgt.CheckCanChangeAllIntelligentCloudStatus(); + CloudMigReplicateDataMgt.ValidateCustomMigrationTables(); end; - local procedure IsCustomMigrationEnabled(): Boolean + local procedure IsNoCodeMigrationEnabled(): Boolean var IntelligentCloudSetup: Record "Intelligent Cloud Setup"; begin @@ -1272,12 +1254,13 @@ codeunit 4001 "Hybrid Cloud Management" Message(SettingForUserPermissionsMsg, IntelligentCloudSetup."Keep User Permissions"); end; - internal procedure EnableDisableCustomMigration() + internal procedure EnableDisableNoCodeMigration() var IntelligentCloudSetup: Record "Intelligent Cloud Setup"; begin GetIntelligentCloudSetupSafe(IntelligentCloudSetup); IntelligentCloudSetup."Custom Migration Enabled" := not IntelligentCloudSetup."Custom Migration Enabled"; + IntelligentCloudSetup."Custom Migration Provider" := IntelligentCloudSetup."Custom Migration Provider"::"Custom Migration Provider"; IntelligentCloudSetup.Modify(); Message(CustomMigrationSettingMsg, IntelligentCloudSetup."Custom Migration Enabled"); end; @@ -1863,6 +1846,11 @@ codeunit 4001 "Hybrid Cloud Management" [EventSubscriber(ObjectType::Codeunit, Codeunit::"Guided Experience", 'OnRegisterAssistedSetup', '', false, false)] local procedure AddIntelligentCloudToAssistedSetup() + begin + AddCloudMigrationWizardToAssistedSetup(); + end; + + internal procedure AddCloudMigrationWizardToAssistedSetup() var GuidedExperience: Codeunit "Guided Experience"; PermissionManager: Codeunit "Permission Manager"; @@ -2306,6 +2294,17 @@ codeunit 4001 "Hybrid Cloud Management" exit(not IntelligentCloudStatus.IsEmpty()); end; + internal procedure IsCustomMigrationEnabled(): Boolean + var + IntelligentCloudSetup: Record "Intelligent Cloud Setup"; + begin + if not IntelligentCloudSetup.Get() then + exit(false); + + exit(IntelligentCloudSetup."Custom Migration Provider".AsInteger() <> 0); + end; + + [EventSubscriber(ObjectType::Codeunit, Codeunit::User, 'OnAfterRenameUser', '', false, false)] local procedure RenameRecordLinkUsers(OldUserName: Code[50]; NewUserName: Code[50]) var diff --git a/Apps/W1/HybridBaseDeployment/app/src/pages/CloudMigrationManagement.Page.al b/Apps/W1/HybridBaseDeployment/app/src/pages/CloudMigrationManagement.Page.al index 6120a78af5..79120bc2aa 100644 --- a/Apps/W1/HybridBaseDeployment/app/src/pages/CloudMigrationManagement.Page.al +++ b/Apps/W1/HybridBaseDeployment/app/src/pages/CloudMigrationManagement.Page.al @@ -611,7 +611,7 @@ page 40063 "Cloud Migration Management" var HybridCloudManagement: Codeunit "Hybrid Cloud Management"; begin - HybridCloudManagement.EnableDisableCustomMigration(); + HybridCloudManagement.EnableDisableNoCodeMigration(); end; } action(ManageTableMappings) diff --git a/Apps/W1/HybridBaseDeployment/app/src/pages/HybridCloudSetupWizard.Page.al b/Apps/W1/HybridBaseDeployment/app/src/pages/HybridCloudSetupWizard.Page.al index b17c492cc0..2206eeec5c 100644 --- a/Apps/W1/HybridBaseDeployment/app/src/pages/HybridCloudSetupWizard.Page.al +++ b/Apps/W1/HybridBaseDeployment/app/src/pages/HybridCloudSetupWizard.Page.al @@ -583,8 +583,15 @@ page 4000 "Hybrid Cloud Setup Wizard" var HybridReplicationSummary: Record "Hybrid Replication Summary"; FeatureTelemetry: Codeunit "Feature Telemetry"; + GuidedExperience: Codeunit "Guided Experience"; SkipShowLiveCompaniesWarning: Boolean; begin + if HybridCloudManagement.IsOnPremDevelopmentEnabled() then + if BindSubscription(OnPremMigrationHandler) then; + + if not GuidedExperience.Exists("Guided Experience Type"::"Assisted Setup", ObjectType::Page, Page::"Hybrid Cloud Setup Wizard") then + HybridCloudManagement.AddCloudMigrationWizardToAssistedSetup(); + FeatureTelemetry.LogUptake('0000JMS', HybridCloudManagement.GetFeatureTelemetryName(), Enum::"Feature Uptake Status"::Discovered); IsCloudMigrationSupported := HybridCloudManagement.IsCloudMigrationUISupported(); @@ -673,6 +680,7 @@ page 4000 "Hybrid Cloud Setup Wizard" MediaResources_Done: Record "Media Resources"; ClientTypeManagement: Codeunit "Client Type Management"; HybridCloudManagement: Codeunit "Hybrid Cloud Management"; + OnPremMigrationHandler: Codeunit "OnPrem Migration Handler"; IsChanged: Boolean; TopBannerVisible: Boolean; IntroVisible: Boolean; diff --git a/Apps/W1/HybridBaseDeployment/app/src/pages/IntelligentCloudDetails.Page.al b/Apps/W1/HybridBaseDeployment/app/src/pages/IntelligentCloudDetails.Page.al index 084f0c2e0f..e291b0bf55 100644 --- a/Apps/W1/HybridBaseDeployment/app/src/pages/IntelligentCloudDetails.Page.al +++ b/Apps/W1/HybridBaseDeployment/app/src/pages/IntelligentCloudDetails.Page.al @@ -125,7 +125,7 @@ page 4006 "Intelligent Cloud Details" ApplicationArea = Basic, Suite; Caption = 'Records Migrated Last run'; ToolTip = 'Specifies the number of records in the table that have been migrated in the last replication run.'; - Visible = ShowRecordCounts; + Visible = ShowRecordCounts or CustomMigration; BlankZero = true; } field("Total Records"; Rec."Total Records") @@ -285,6 +285,7 @@ page 4006 "Intelligent Cloud Details" IntelligentCloudStatus.SetRange(Blocked, true); UnblockTableVisible := not IntelligentCloudStatus.IsEmpty(); CompanyFilterDisplayName := HybridReplicationStatistics.GetAllCompaniesLbl(); + ShowRecordCounts := GetShowRecordCounts(); end; trigger OnAfterGetRecord() @@ -326,11 +327,8 @@ page 4006 "Intelligent Cloud Details" local procedure UpdateRecordCountStatistics() begin - // if any tables have "Records Copied" > 0, then we show the field. - if not ShowRecordCounts then begin - ShowRecordCounts := Rec."Records Copied" > 0; + if not ShowRecordCounts then exit; - end; if not Rec.GetCountOfRecordsInTheTableSafe(Rec, TotalRecordsTargetTable) then begin TotalRecordsTargetTable := 0; @@ -346,9 +344,23 @@ page 4006 "Intelligent Cloud Details" DifferenceInRecords := TotalRecordsTargetTable - Rec."Total Records"; end; + local procedure GetShowRecordCounts(): Boolean + var + HybridReplicationDetail: Record "Hybrid Replication Detail"; + HybridCloudManagement: Codeunit "Hybrid Cloud Management"; + begin + CustomMigration := HybridCloudManagement.IsCustomMigrationEnabled(); + if CustomMigration then + exit(false); + + HybridReplicationDetail.SetFilter("Records Copied", '>0'); + exit(not HybridReplicationDetail.IsEmpty()); + end; + var StatusExpr: Text; ShowRecordCounts: Boolean; + CustomMigration: Boolean; TotalRecordsTargetTable: Integer; DifferenceInRecords: Integer; CompanyFilterDisplayName: Text; diff --git a/Apps/W1/HybridBaseDeployment/app/src/pages/IntelligentCloudManagement.Page.al b/Apps/W1/HybridBaseDeployment/app/src/pages/IntelligentCloudManagement.Page.al index d3e6d7f46e..4f824c9ab6 100644 --- a/Apps/W1/HybridBaseDeployment/app/src/pages/IntelligentCloudManagement.Page.al +++ b/Apps/W1/HybridBaseDeployment/app/src/pages/IntelligentCloudManagement.Page.al @@ -409,7 +409,7 @@ page 4003 "Intelligent Cloud Management" var HybridCloudManagement: Codeunit "Hybrid Cloud Management"; begin - HybridCloudManagement.EnableDisableCustomMigration(); + HybridCloudManagement.EnableDisableNoCodeMigration(); end; } action(EnableDisableOnPremDevelopment) diff --git a/Apps/W1/HybridBaseDeployment/app/src/pages/MigrationTableOverview.Page.al b/Apps/W1/HybridBaseDeployment/app/src/pages/MigrationTableOverview.Page.al index f8a44e19e3..bafb312e5b 100644 --- a/Apps/W1/HybridBaseDeployment/app/src/pages/MigrationTableOverview.Page.al +++ b/Apps/W1/HybridBaseDeployment/app/src/pages/MigrationTableOverview.Page.al @@ -100,6 +100,7 @@ page 40034 "Migration Table Overview" Caption = 'Total records - Source table'; BlankZero = true; Editable = false; + Visible = ShowRecordCounts; } field("Total records - Target table"; Rec."Total records - Target Table") { @@ -107,6 +108,7 @@ page 40034 "Migration Table Overview" Caption = 'Total records - Target table'; BlankZero = true; Editable = false; + Visible = ShowRecordCounts; } field("Target difference to Source"; Rec."Target difference to Source") { @@ -114,6 +116,7 @@ page 40034 "Migration Table Overview" Caption = 'Difference between target and source'; BlankZero = true; Editable = false; + Visible = ShowRecordCounts; } field("Number of replications"; Rec."Replication Count") @@ -144,6 +147,9 @@ page 40034 "Migration Table Overview" if Rec.Status = Rec.Status::Failed then StatusExpr := 'Unfavorable'; + if not ShowRecordCounts then + exit; + HybridReplicationDetail.SetRange("Company Name", Rec."Company Name"); HybridReplicationDetail.SetRange("Table Name", Rec."Table Name"); HybridReplicationDetail.SetFilter("Total Records", '>0'); @@ -172,6 +178,7 @@ page 40034 "Migration Table Overview" if CompanyFilterDisplayName = '' then CompanyFilterDisplayName := HybridReplicationStatistics.GetAllCompaniesLbl(); + ShowRecordCounts := GetShowRecordCounts(); if Rec.FindFirst() then; end; @@ -186,10 +193,23 @@ page 40034 "Migration Table Overview" Rec.SetRange("Company Name", CompanyFilterDisplayName); end; + local procedure GetShowRecordCounts(): Boolean + var + HybridReplicationDetail: Record "Hybrid Replication Detail"; + HybridCloudManagement: Codeunit "Hybrid Cloud Management"; + begin + if HybridCloudManagement.IsCustomMigrationEnabled() then + exit(false); + + HybridReplicationDetail.SetFilter("Records Copied", '>0'); + exit(not HybridReplicationDetail.IsEmpty()); + end; + var AllObj: Record AllObj; CouldNotReadTargetTableCountLbl: Label 'The total of records in the target table is unavailable since the table is protected, so it isn''t possible to calculate if there is a difference to the source table. Instead, check the number of records that were migrated in the last run.'; CompanyFilterDisplayName: Text; TableNameFilter: Text; StatusExpr: Text; + ShowRecordCounts: Boolean; } \ No newline at end of file diff --git a/Apps/W1/HybridBaseDeployment/app/src/tables/IntelligentCloudSetup.Table.al b/Apps/W1/HybridBaseDeployment/app/src/tables/IntelligentCloudSetup.Table.al index 8e21e31f7e..5240ae48ce 100644 --- a/Apps/W1/HybridBaseDeployment/app/src/tables/IntelligentCloudSetup.Table.al +++ b/Apps/W1/HybridBaseDeployment/app/src/tables/IntelligentCloudSetup.Table.al @@ -161,7 +161,7 @@ table 4003 "Intelligent Cloud Setup" } field(27; "Custom Migration Enabled"; Boolean) { - Description = 'Specifies if custom migration is enabled.'; + Description = 'Specifies if custom migration is enabled. This is a no-code migration.'; DataClassification = SystemMetadata; } field(28; "Custom Migration Provider"; Enum "Custom Migration Provider") diff --git a/Apps/W1/HybridBaseDeployment/test/src/ReplicationMgtPageTests.Codeunit.al b/Apps/W1/HybridBaseDeployment/test/src/ReplicationMgtPageTests.Codeunit.al index 3c17dea12c..ca86343da7 100644 --- a/Apps/W1/HybridBaseDeployment/test/src/ReplicationMgtPageTests.Codeunit.al +++ b/Apps/W1/HybridBaseDeployment/test/src/ReplicationMgtPageTests.Codeunit.al @@ -97,7 +97,7 @@ codeunit 139653 "Replication Mgt Page Tests" end; // [WHEN] Validate the tables for migration - HybridCloudManagement.PrepareTablesForCustomMigration(); + HybridCloudManagement.ValidateCustomMigrationTables(); // [THEN] Validate successfully without any error. end; @@ -138,7 +138,7 @@ codeunit 139653 "Replication Mgt Page Tests" end; // [WHEN] Prepare tables for custom migration - HybridCloudManagement.PrepareTablesForCustomMigration(); + HybridCloudManagement.ValidateCustomMigrationTables(); // [THEN] Validation succeeds and Replicate Data is automatically set to true for the Customer table IntelligentCloudStatus.SetRange("Table Name", 'Customer'); @@ -184,7 +184,7 @@ codeunit 139653 "Replication Mgt Page Tests" end; // [WHEN] Validate the tables for migration - asserterror HybridCloudManagement.PrepareTablesForCustomMigration(); + asserterror HybridCloudManagement.ValidateCustomMigrationTables(); // [THEN] An error is thrown indicating the internal table cannot be replicated Assert.ExpectedError('The replication properties of the following tables cannot be changed because they are internal. Changing the replication of the sensitive tables is not allowed: Access Control'); @@ -213,7 +213,7 @@ codeunit 139653 "Replication Mgt Page Tests" ReplicationTableMapping.Insert(); // [WHEN] Validate the tables for migration - asserterror HybridCloudManagement.PrepareTablesForCustomMigration(); + asserterror HybridCloudManagement.ValidateCustomMigrationTables(); // [THEN] An error is thrown because the table does not exist and its replication properties cannot be changed Assert.ExpectedError('The following tables do not exist in SaaS: NonExistingTable'); @@ -258,7 +258,7 @@ codeunit 139653 "Replication Mgt Page Tests" end; // [WHEN] Prepare tables for custom migration - HybridCloudManagement.PrepareTablesForCustomMigration(); + HybridCloudManagement.ValidateCustomMigrationTables(); // [THEN] Validation succeeds without any error end; @@ -302,7 +302,7 @@ codeunit 139653 "Replication Mgt Page Tests" end; // [WHEN] Prepare tables for custom migration - HybridCloudManagement.PrepareTablesForCustomMigration(); + HybridCloudManagement.ValidateCustomMigrationTables(); // [THEN] Validation succeeds and Replicate Data is automatically set to true for the Customer table IntelligentCloudStatus.SetRange("Table Name", 'Customer'); @@ -350,7 +350,7 @@ codeunit 139653 "Replication Mgt Page Tests" end; // [WHEN] Validate the tables for migration - asserterror HybridCloudManagement.PrepareTablesForCustomMigration(); + asserterror HybridCloudManagement.ValidateCustomMigrationTables(); // [THEN] An error is thrown indicating the internal table cannot be replicated Assert.ExpectedError('The replication properties of the following tables cannot be changed because they are internal. Changing the replication of the sensitive tables is not allowed: Access Control'); @@ -379,7 +379,7 @@ codeunit 139653 "Replication Mgt Page Tests" MigrationSetupMapping.Insert(); // [WHEN] Validate the tables for migration - asserterror HybridCloudManagement.PrepareTablesForCustomMigration(); + asserterror HybridCloudManagement.ValidateCustomMigrationTables(); // [THEN] An error is thrown because the table does not exist and its replication properties cannot be changed Assert.ExpectedError('The following tables do not exist in SaaS: NonExistingTable'); diff --git a/Apps/W1/HybridGP/app/src/Migration/GPTables/GPPopulateCombinedTables.Codeunit.al b/Apps/W1/HybridGP/app/src/Migration/GPTables/GPPopulateCombinedTables.Codeunit.al index a9971509a3..c64278eaf6 100644 --- a/Apps/W1/HybridGP/app/src/Migration/GPTables/GPPopulateCombinedTables.Codeunit.al +++ b/Apps/W1/HybridGP/app/src/Migration/GPTables/GPPopulateCombinedTables.Codeunit.al @@ -333,7 +333,7 @@ codeunit 40125 "GP Populate Combined Tables" begin GPRM00101.SetRange(INACTIVE, false); if GPCompanyAdditionalSettings.GetMigrateInactiveCustomers() then - GPRM00101.SetRange(INACTIVE); + GPRM00101.SetRange(INACTIVE); if not GPRM00101.FindSet() then exit; diff --git a/Apps/W1/HybridGP/app/src/codeunits/HybridGPManagement.codeunit.al b/Apps/W1/HybridGP/app/src/codeunits/HybridGPManagement.codeunit.al index ef22fceb96..d709ce6e45 100644 --- a/Apps/W1/HybridGP/app/src/codeunits/HybridGPManagement.codeunit.al +++ b/Apps/W1/HybridGP/app/src/codeunits/HybridGPManagement.codeunit.al @@ -15,7 +15,7 @@ codeunit 4016 "Hybrid GP Management" GPSettingUpgradePendingOnReplicationRunCompletedMsg: Label 'Setting upgrade pending on Replication Run Completed.', Locked = true; GPCloudMigrationReplicationErrorsMsg: Label 'Errors occured during GP Cloud Migration. Error message: %1.', Locked = true; SqlCompatibilityErr: Label 'SQL database must be at compatibility level 130 or higher.'; - StartingHandleInitializationofGPSynchronizationTelemetryMsg: Label 'Starting HandleInitializationofGPSynchronization', Locked = true; + StartingHandleInitializationOfGPSynchronizationTelemetryMsg: Label 'Starting HandleInitializationofGPSynchronization', Locked = true; UpgradeWasScheduledMsg: Label 'Upgrade was succesfully scheduled'; GPCloudMigrationDoesNotSupportNewUIMsg: Label 'GP Cloud migration does not support the new UI, please switch back to the previous UI page.'; CannotContinueUpgradeFailedMsg: Label 'Previous data upgrade has failed. You need to delete the failed companies and to migrate them again.'; @@ -36,7 +36,7 @@ codeunit 4016 "Hybrid GP Management" exit; UpdateStatusOnHybridReplicationCompleted(RunId, NotificationText); - HandleInitializationofGPSynchronization(RunId, SubscriptionId, NotificationText); + HandleInitializationOfGPSynchronization(RunId, SubscriptionId, NotificationText); TriggerUpgradeIfOneStepEnabled(RunId); end; @@ -223,7 +223,7 @@ codeunit 4016 "Hybrid GP Management" end; end; - local procedure HandleInitializationofGPSynchronization(RunId: Text[50]; SubscriptionId: Text; NotificationText: Text) + local procedure HandleInitializationOfGPSynchronization(RunId: Text[50]; SubscriptionId: Text; NotificationText: Text) var HybridReplicationSummary: Record "Hybrid Replication Summary"; HybridCompanyStatus: Record "Hybrid Company Status"; @@ -238,7 +238,7 @@ codeunit 4016 "Hybrid GP Management" JsonManagement.InitializeObject(NotificationText); JsonManagement.GetStringPropertyValueByName('ServiceType', ServiceType); - Session.LogMessage('0000FXA', StartingHandleInitializationofGPSynchronizationTelemetryMsg, Verbosity::Normal, DataClassification::SystemMetadata, TelemetryScope::ExtensionPublisher, 'Category', HelperFunctions.GetTelemetryCategory()); + Session.LogMessage('0000FXA', StartingHandleInitializationOfGPSynchronizationTelemetryMsg, Verbosity::Normal, DataClassification::SystemMetadata, TelemetryScope::ExtensionPublisher, 'Category', HelperFunctions.GetTelemetryCategory()); if ServiceType = ReplicationCompletedServiceTypeTxt then begin Session.LogMessage('0000FVN', GPSettingUpgradePendingOnReplicationRunCompletedMsg, Verbosity::Warning, DataClassification::SystemMetadata, TelemetryScope::ExtensionPublisher, 'Category', HelperFunctions.GetTelemetryCategory()); @@ -362,7 +362,7 @@ codeunit 4016 "Hybrid GP Management" procedure InvokeCompanyUpgrade(var HybridReplicationSummary: Record "Hybrid Replication Summary"; CompanyName: Text[50]; DelayDuration: Duration) var CreateSession: Boolean; - SesssionID: Integer; + SessionID: Integer; begin CreateSession := true; OnCreateSessionForUpgrade(CreateSession); @@ -378,7 +378,7 @@ codeunit 4016 "Hybrid GP Management" TaskScheduler.CreateTask( Codeunit::"GP Cloud Migration", Codeunit::"Hybrid Handle GP Upgrade Error", true, CompanyName, CurrentDateTime() + DelayDuration, HybridReplicationSummary.RecordId, GetDefaultJobTimeout()) else - Session.StartSession(SesssionID, Codeunit::"GP Cloud Migration", CompanyName, HybridReplicationSummary, GetDefaultJobTimeout()) + Session.StartSession(SessionID, Codeunit::"GP Cloud Migration", CompanyName, HybridReplicationSummary, GetDefaultJobTimeout()) end; internal procedure GetDefaultJobTimeout(): Duration diff --git a/Apps/W1/HybridSL/app/app.json b/Apps/W1/HybridSL/app/app.json index 1557a1a502..ff4d4ef21b 100644 --- a/Apps/W1/HybridSL/app/app.json +++ b/Apps/W1/HybridSL/app/app.json @@ -19,6 +19,11 @@ "id": "c9b38161-dd8d-40a9-8920-60ccbf8d7a59", "name": "Dynamics SL Migration Tests", "publisher": "Microsoft" + }, + { + "id": "5f85a491-a6f4-4303-88ed-95a577849f91", + "name": "Dynamics SL Migration - US Tests", + "publisher": "Microsoft" } ], "dependencies": [ diff --git a/Apps/W1/INTaxEngine/app/TaxEngine-JsonExchange/src/ExportImport/TaxJsonDeserialization.Codeunit.al b/Apps/W1/INTaxEngine/app/TaxEngine-JsonExchange/src/ExportImport/TaxJsonDeserialization.Codeunit.al index d93b92eba1..4babefabcb 100644 --- a/Apps/W1/INTaxEngine/app/TaxEngine-JsonExchange/src/ExportImport/TaxJsonDeserialization.Codeunit.al +++ b/Apps/W1/INTaxEngine/app/TaxEngine-JsonExchange/src/ExportImport/TaxJsonDeserialization.Codeunit.al @@ -534,7 +534,12 @@ codeunit 20361 "Tax Json Deserialization" MinorVersion: Integer; OldMajorVersion: Integer; OldMinorVersion: Integer; + IsHandled: Boolean; begin + OnBeforeReadUseCase(JObject, IsHandled); + if IsHandled then + exit; + UseCaseID := GetGuidPropertyValue(JObject, 'CaseID'); TaxType := GetCode20PropertyValue(JObject, 'TaxType'); Description := GetText250PropertyValue(JObject, 'Description'); @@ -2818,6 +2823,11 @@ codeunit 20361 "Tax Json Deserialization" exit(GetText250PropertyValue(Token.AsObject(), TaxType)); end; + [IntegrationEvent(false, false)] + local procedure OnBeforeReadUseCase(JObject: JsonObject; var IsHandled: Boolean) + begin + end; + var GlobalUseCase: Record "Tax Use Case"; UseCaseMgmt: Codeunit "Use Case Mgmt."; diff --git a/Apps/W1/INTaxEngine/app/TaxEngine-UseCaseBuilder/src/UseCase/codeunit/UseCaseEntityMgmt.Codeunit.al b/Apps/W1/INTaxEngine/app/TaxEngine-UseCaseBuilder/src/UseCase/codeunit/UseCaseEntityMgmt.Codeunit.al index db39b0fc83..95107a37d2 100644 --- a/Apps/W1/INTaxEngine/app/TaxEngine-UseCaseBuilder/src/UseCase/codeunit/UseCaseEntityMgmt.Codeunit.al +++ b/Apps/W1/INTaxEngine/app/TaxEngine-UseCaseBuilder/src/UseCase/codeunit/UseCaseEntityMgmt.Codeunit.al @@ -179,10 +179,12 @@ codeunit 20292 "Use Case Entity Mgmt." UseCaseMgmt: Codeunit "Use Case Mgmt."; begin TaxUseCase.SetRange("Tax Type", TaxTypeCode); + OnFindDisableSelectedUseCases(TaxUseCase); UseCaseMgmt.DisableSelectedUseCases(TaxUseCase); TaxUseCase.Reset(); TaxUseCase.SetRange("Tax Type", TaxTypeCode); + OnFindDeleteSelectedUseCases(TaxUseCase); if not TaxUseCase.IsEmpty() then TaxUseCase.DeleteAll(true); end; @@ -208,6 +210,16 @@ codeunit 20292 "Use Case Entity Mgmt." ValidateUseCase(Rec, xRec); end; + [IntegrationEvent(false, false)] + local procedure OnFindDisableSelectedUseCases(var TaxUseCase: Record "Tax Use Case") + begin + end; + + [IntegrationEvent(false, false)] + local procedure OnFindDeleteSelectedUseCases(var TaxUseCase: Record "Tax Use Case") + begin + end; + var CannotChangeReleasedUseCaseErr: Label 'You cannot change configuration on Released use case : %1', Comment = '%1 = use case name'; EmptyGuid: Guid; diff --git a/Apps/W1/INTaxEngine/app/TaxEngine-UseCaseBuilder/src/UseCase/codeunit/UseCaseSymbolsHandler.Codeunit.al b/Apps/W1/INTaxEngine/app/TaxEngine-UseCaseBuilder/src/UseCase/codeunit/UseCaseSymbolsHandler.Codeunit.al index ac6e4a5019..b530bba425 100644 --- a/Apps/W1/INTaxEngine/app/TaxEngine-UseCaseBuilder/src/UseCase/codeunit/UseCaseSymbolsHandler.Codeunit.al +++ b/Apps/W1/INTaxEngine/app/TaxEngine-UseCaseBuilder/src/UseCase/codeunit/UseCaseSymbolsHandler.Codeunit.al @@ -153,10 +153,12 @@ codeunit 20297 "Use Case Symbols Handler" ScriptSymbolLookup.SetFilter("Source Type", '%1|%2', ScriptSymbolLookup."Source Type"::"Attribute Table", ScriptSymbolLookup."Source Type"::"Tax Attributes"); ScriptSymbolLookup.SetRange("Source Field ID", Rec.ID); + OnFindScriptSymbolLookupOnBeforeTaxAttributeDeleteEvent(ScriptSymbolLookup, Rec); if ScriptSymbolLookup.FindFirst() then ThrowAttributeInUseError(Rec."Tax Type", Rec.Name, ScriptSymbolLookup."Case ID"); UseCaseAttributeMapping.SetRange("Attribtue ID", Rec.ID); + OnFindUseCaseAttributeMappingOnBeforeTaxAttributeDeleteEvent(UseCaseAttributeMapping, Rec); if UseCaseAttributeMapping.FindFirst() then ThrowAttributeInUseError(Rec."Tax Type", Rec.Name, UseCaseAttributeMapping."Case ID"); end; @@ -179,18 +181,22 @@ codeunit 20297 "Use Case Symbols Handler" ScriptSymbolLookup.SetFilter("Source Type", '%1|%2', ScriptSymbolLookup."Source Type"::Component, ScriptSymbolLookup."Source Type"::"Component Percent"); ScriptSymbolLookup.SetRange("Source Field ID", Rec.ID); + OnFindScriptSymbolLookupOnBeforeTaxComponentDeleteEvent(ScriptSymbolLookup, Rec); if ScriptSymbolLookup.FindFirst() then ThrowComponentInUseError(Rec."Tax Type", Rec.Name, ScriptSymbolLookup."Case ID"); UseCaseComponentCalculation.SetRange("Component ID", Rec.ID); + OnFindUseCaseComponentCalculationOnBeforeTaxComponentDeleteEvent(UseCaseComponentCalculation, Rec); if UseCaseComponentCalculation.FindFirst() then ThrowComponentInUseError(Rec."Tax Type", Rec.Name, UseCaseComponentCalculation."Case ID"); ScriptSymbolLookup.SetFilter("Source Type", '%1|%2', ScriptSymbolLookup."Source Type"::Component, ScriptSymbolLookup."Source Type"::"Component Percent"); ScriptSymbolLookup.SetRange("Source Field ID", Rec.ID); + OnFindScriptSymbolLookupForPostingOnBeforeTaxComponentDeleteEvent(ScriptSymbolLookup, Rec); if ScriptSymbolLookup.FindFirst() then ThrowComponentInUseError(Rec."Tax Type", Rec.Name, ScriptSymbolLookup."Case ID"); UseCaseComponentCalculation.SetRange("Component ID", Rec.ID); + OnFindUseCaseComponentCalculationForPostingOnBeforeTaxComponentDeleteEvent(UseCaseComponentCalculation, Rec); if UseCaseComponentCalculation.FindFirst() then ThrowComponentInUseError(Rec."Tax Type", Rec.Name, UseCaseComponentCalculation."Case ID"); end; @@ -478,6 +484,36 @@ codeunit 20297 "Use Case Symbols Handler" error(ComponentUsedInUseCaseErr, ComponentName, UseCase.Description); end; + [IntegrationEvent(false, false)] + local procedure OnFindScriptSymbolLookupOnBeforeTaxAttributeDeleteEvent(var ScriptSymbolLookup: Record "Script Symbol Lookup"; TaxAttribute: Record "Tax Attribute") + begin + end; + + [IntegrationEvent(false, false)] + local procedure OnFindUseCaseAttributeMappingOnBeforeTaxAttributeDeleteEvent(var UseCaseAttributeMapping: Record "Use Case Attribute Mapping"; TaxAttribute: Record "Tax Attribute") + begin + end; + + [IntegrationEvent(false, false)] + local procedure OnFindScriptSymbolLookupOnBeforeTaxComponentDeleteEvent(var ScriptSymbolLookup: Record "Script Symbol Lookup"; TaxComponent: Record "Tax Component") + begin + end; + + [IntegrationEvent(false, false)] + local procedure OnFindScriptSymbolLookupForPostingOnBeforeTaxComponentDeleteEvent(var ScriptSymbolLookup: Record "Script Symbol Lookup"; TaxComponent: Record "Tax Component") + begin + end; + + [IntegrationEvent(false, false)] + local procedure OnFindUseCaseComponentCalculationOnBeforeTaxComponentDeleteEvent(var UseCaseComponentCalculation: Record "Use Case Component Calculation"; TaxComponent: Record "Tax Component") + begin + end; + + [IntegrationEvent(false, false)] + local procedure OnFindUseCaseComponentCalculationForPostingOnBeforeTaxComponentDeleteEvent(var UseCaseComponentCalculation: Record "Use Case Component Calculation"; TaxComponent: Record "Tax Component") + begin + end; + var DataTypeMgmg: Codeunit "Use Case Data Type Mgmt."; UseCaseDataTypeMgmt: Codeunit "Use Case Data Type Mgmt."; diff --git a/Apps/W1/ReviewGLEntries/app/src/codeunits/ReviewGLEntry.Codeunit.al b/Apps/W1/ReviewGLEntries/app/src/codeunits/ReviewGLEntry.Codeunit.al index 258750e81c..2ee436c3f3 100644 --- a/Apps/W1/ReviewGLEntries/app/src/codeunits/ReviewGLEntry.Codeunit.al +++ b/Apps/W1/ReviewGLEntries/app/src/codeunits/ReviewGLEntry.Codeunit.al @@ -49,6 +49,7 @@ codeunit 22200 "Review G/L Entry" implements "G/L Entry Reviewer" else GLEntryReviewLog."Reviewed Amount" := GLEntry."Amount to Review"; GLEntryReviewLog."G/L Account No." := GLEntry."G/L Account No."; + GLEntryReviewLog."Reviewed At" := CurrentDateTime(); GLEntryReviewLog.Insert(true); GLEntry."Amount to Review" := 0; diff --git a/Apps/W1/ReviewGLEntries/app/src/codeunits/Upgrade.Codeunit.al b/Apps/W1/ReviewGLEntries/app/src/codeunits/Upgrade.Codeunit.al index 629f872a20..a5c8551cf8 100644 --- a/Apps/W1/ReviewGLEntries/app/src/codeunits/Upgrade.Codeunit.al +++ b/Apps/W1/ReviewGLEntries/app/src/codeunits/Upgrade.Codeunit.al @@ -12,6 +12,7 @@ codeunit 22201 "Upgrade" begin MovetoGLEntryReviewLog(); FixGLEntryReviewLogWithReviewAmountZeroWithDataTransfer(); + FixGLEntryReviewLogSetReviewedAt(); end; local procedure FixGLEntryReviewLogWithReviewAmountZeroWithDataTransfer() @@ -32,6 +33,32 @@ codeunit 22201 "Upgrade" UpgradeTag.SetUpgradeTag(UpgradeFixGLEntryReviewLogWithReviewedAmountZeroWithDataTransferTag()); end; + local procedure FixGLEntryReviewLogSetReviewedAt() + var + GLEntryReviewLog: Record "G/L Entry Review Log"; + GLEntryReviewEntry: Record "G/L Entry Review Entry"; + UpgradeTag: Codeunit "Upgrade Tag"; + GLEntryReviewDataTransfer, GLEntryReviewLogDataTransfer : DataTransfer; + begin + if UpgradeTag.HasUpgradeTag(UpgradeFixGLEntryReviewLogSetReviewedAtTag()) then + exit; + + // Pass 1: initialize Reviewed At for all new-table rows + // This covers rows created by the new review mechanism (27.x). + GLEntryReviewLogDataTransfer.SetTables(Database::"G/L Entry Review Log", Database::"G/L Entry Review Log"); + GLEntryReviewLogDataTransfer.AddFieldValue(GLEntryReviewLog.FieldNo(SystemCreatedAt), GLEntryReviewLog.FieldNo("Reviewed At")); + GLEntryReviewLogDataTransfer.CopyFields(); + + // Pass 2: overwrite with authoritative legacy review (pre-27.0) timestamps, if they exist + // Legacy values are expected to be earlier and correct. + GLEntryReviewDataTransfer.SetTables(Database::"G/L Entry Review Entry", Database::"G/L Entry Review Log"); + GLEntryReviewDataTransfer.AddJoin(GLEntryReviewEntry.FieldNo("G/L Entry No."), GLEntryReviewLog.FieldNo("G/L Entry No.")); + GLEntryReviewDataTransfer.AddFieldValue(GLEntryReviewEntry.FieldNo(SystemCreatedAt), GLEntryReviewLog.FieldNo("Reviewed At")); + GLEntryReviewDataTransfer.CopyFields(); + + UpgradeTag.SetUpgradeTag(UpgradeFixGLEntryReviewLogSetReviewedAtTag()); + end; + local procedure MovetoGLEntryReviewLog() var GLEntryReviewEntry: Record "G/L Entry Review Entry"; @@ -47,6 +74,7 @@ codeunit 22201 "Upgrade" GLEntryReviewDataTransfer.AddFieldValue(GLEntryReviewEntry.FieldNo("G/L Entry No."), GLEntryReviewLog.FieldNo("G/L Entry No.")); GLEntryReviewDataTransfer.AddFieldValue(GLEntryReviewEntry.FieldNo("Reviewed Identifier"), GLEntryReviewLog.FieldNo("Reviewed Identifier")); GLEntryReviewDataTransfer.AddFieldValue(GLEntryReviewEntry.FieldNo("Reviewed By"), GLEntryReviewLog.FieldNo("Reviewed By")); + GLEntryReviewDataTransfer.AddFieldValue(GLEntryReviewEntry.FieldNo(SystemCreatedAt), GLEntryReviewLog.FieldNo("Reviewed At")); GLEntryReviewDataTransfer.CopyRows(); GLEntryDataTransfer.SetTables(Database::"G/L Entry", Database::"G/L Entry Review Log"); GLEntryDataTransfer.AddJoin(GLEntry.FieldNo("Entry No."), GLEntryReviewLog.FieldNo("G/L Entry No.")); @@ -62,6 +90,7 @@ codeunit 22201 "Upgrade" begin PerCompanyUpgradeTags.Add(UpgradeReviewGLEntryTag()); PerCompanyUpgradeTags.Add(UpgradeFixGLEntryReviewLogWithReviewedAmountZeroWithDataTransferTag()); + PerCompanyUpgradeTags.Add(UpgradeFixGLEntryReviewLogSetReviewedAtTag()); end; local procedure UpgradeReviewGLEntryTag(): Code[250] @@ -74,4 +103,9 @@ codeunit 22201 "Upgrade" exit('MS-621701-UpgradeFixGLEntryReviewLogWithReviewedAmountZero-20260212'); end; + local procedure UpgradeFixGLEntryReviewLogSetReviewedAtTag(): Code[250] + begin + exit('MS-624894-UpgradeFixGLEntryReviewLogSetReviewedAt-20260311'); + end; + } \ No newline at end of file diff --git a/Apps/W1/ReviewGLEntries/app/src/tables/GLEntryReview.TableExt.al b/Apps/W1/ReviewGLEntries/app/src/tables/GLEntryReview.TableExt.al index e68b7348e6..a459b242e4 100644 --- a/Apps/W1/ReviewGLEntries/app/src/tables/GLEntryReview.TableExt.al +++ b/Apps/W1/ReviewGLEntries/app/src/tables/GLEntryReview.TableExt.al @@ -26,7 +26,7 @@ tableextension 22211 "G/L Entry Review" extends "G/L Entry" { Caption = 'Reviewed Date'; FieldClass = FlowField; - CalcFormula = lookup("G/L Entry Review Log".SystemCreatedAt where("G/L Entry No." = field("Entry No."))); + CalcFormula = lookup("G/L Entry Review Log"."Reviewed At" where("G/L Entry No." = field("Entry No."))); ToolTip = 'Specifies the date and time when the G/L entry was reviewed.'; } field(22215; "Reviewed Identifier"; Integer) diff --git a/Apps/W1/ReviewGLEntries/app/src/tables/GLEntryReviewEntry.Table.al b/Apps/W1/ReviewGLEntries/app/src/tables/GLEntryReviewEntry.Table.al index 8e03499b0f..d4c27af163 100644 --- a/Apps/W1/ReviewGLEntries/app/src/tables/GLEntryReviewEntry.Table.al +++ b/Apps/W1/ReviewGLEntries/app/src/tables/GLEntryReviewEntry.Table.al @@ -52,6 +52,7 @@ table 22216 "G/L Entry Review Entry" GLEntryReviewLog."G/L Account No." := GlEntry."G/L Account No."; GLEntryReviewLog."Reviewed Amount" := GlEntry.Amount; end; + GLEntryReviewLog."Reviewed At" := CurrentDateTime(); GLEntryReviewLog.Insert(true); end; diff --git a/Apps/W1/ReviewGLEntries/app/src/tables/GLEntryReviewLog.Table.al b/Apps/W1/ReviewGLEntries/app/src/tables/GLEntryReviewLog.Table.al index 5d5e5d5dab..05365ba88e 100644 --- a/Apps/W1/ReviewGLEntries/app/src/tables/GLEntryReviewLog.Table.al +++ b/Apps/W1/ReviewGLEntries/app/src/tables/GLEntryReviewLog.Table.al @@ -40,6 +40,11 @@ table 22218 "G/L Entry Review Log" DataClassification = CustomerContent; ToolTip = 'Specifies the G/L account number associated with the G/L entry.'; } + field(7; "Reviewed At"; DateTime) + { + DataClassification = CustomerContent; + ToolTip = 'Specifies the date and time when the G/L entry was reviewed.'; + } } keys @@ -50,7 +55,7 @@ table 22218 "G/L Entry Review Log" } key(GLEntryNo; "G/L Entry No.") { - IncludedFields = "Reviewed Amount"; + IncludedFields = "Reviewed Amount", "Reviewed At"; } key(ReviewedAmount; "Reviewed Amount") { diff --git a/Apps/W1/SalesOrderAgent/app/src/Setup/SOASetup.Codeunit.al b/Apps/W1/SalesOrderAgent/app/src/Setup/SOASetup.Codeunit.al index acf3f2209c..c655cf1102 100644 --- a/Apps/W1/SalesOrderAgent/app/src/Setup/SOASetup.Codeunit.al +++ b/Apps/W1/SalesOrderAgent/app/src/Setup/SOASetup.Codeunit.al @@ -447,6 +447,7 @@ codeunit 4400 "SOA Setup" begin if (AgentTaskUserInterventionRequestDetails."Page ID" = Page::"Sales Quote") then begin AgentTaskUserInterventionSuggestion.Init(); + AgentTaskUserInterventionSuggestion.Code := GetUpdatedQuoteInterventionSuggestionCode(); AgentTaskUserInterventionSuggestion.Summary := StrSubstNo(SOAInterventionSuggestionSummaryLbl, SOAInterventionSuggestionQuoteLbl); AgentTaskUserInterventionSuggestion.Description := StrSubstNo(SOAInterventionSuggestionDescriptionLbl, SOAInterventionSuggestionQuoteLockedLbl); AgentTaskUserInterventionSuggestion.Instructions := StrSubstNo(SOAInterventionSuggestionInstructionsLbl, SOAInterventionSuggestionQuoteLockedLbl); @@ -455,6 +456,7 @@ codeunit 4400 "SOA Setup" if (AgentTaskUserInterventionRequestDetails."Page ID" = Page::"Sales Order") then begin AgentTaskUserInterventionSuggestion.Init(); + AgentTaskUserInterventionSuggestion.Code := GetUpdatedOrderInterventionSuggestionCode(); AgentTaskUserInterventionSuggestion.Summary := StrSubstNo(SOAInterventionSuggestionSummaryLbl, SOAInterventionSuggestionOrderLbl); AgentTaskUserInterventionSuggestion.Description := StrSubstNo(SOAInterventionSuggestionDescriptionLbl, SOAInterventionSuggestionOrderLockedLbl); AgentTaskUserInterventionSuggestion.Instructions := StrSubstNo(SOAInterventionSuggestionInstructionsLbl, SOAInterventionSuggestionOrderLockedLbl); @@ -465,6 +467,7 @@ codeunit 4400 "SOA Setup" begin if AgentTaskUserInterventionRequestDetails."Page ID" = Page::"SOA Multi Items Availability" then begin AgentTaskUserInterventionSuggestion.Init(); + AgentTaskUserInterventionSuggestion.Code := SOAItemAvailabilityInterventionSuggestionCodeLbl; AgentTaskUserInterventionSuggestion.Summary := SOAItemAvailabilityInterventionSuggestionSummaryLbl; AgentTaskUserInterventionSuggestion.Description := SOAItemAvailabilityInterventionSuggestionDescriptionLbl; AgentTaskUserInterventionSuggestion.Instructions := SOAItemAvailabilityInterventionSuggestionInstructionsLbl; @@ -473,12 +476,14 @@ codeunit 4400 "SOA Setup" if AgentTaskUserInterventionRequestDetails."Page ID" = Page::"Customer List" then begin AgentTaskUserInterventionSuggestion.Init(); + AgentTaskUserInterventionSuggestion.Code := SOACustomerInterventionSuggestionCodeLbl; AgentTaskUserInterventionSuggestion.Summary := SOACustomerInterventionSuggestionSummaryLbl; AgentTaskUserInterventionSuggestion.Description := SOACustomerInterventionSuggestionDescriptionLbl; AgentTaskUserInterventionSuggestion.Instructions := SOACustomerInterventionSuggestionInstructionsLbl; AgentTaskUserInterventionSuggestion.Insert(); AgentTaskUserInterventionSuggestion.Init(); + AgentTaskUserInterventionSuggestion.Code := SOAContactInterventionSuggestionCodeLbl; AgentTaskUserInterventionSuggestion.Summary := SOAContactInterventionSuggestionSummaryLbl; AgentTaskUserInterventionSuggestion.Description := SOAContactInterventionSuggestionDescriptionLbl; AgentTaskUserInterventionSuggestion.Instructions := SOAContactInterventionSuggestionInstructionsLbl; @@ -487,6 +492,7 @@ codeunit 4400 "SOA Setup" if AgentTaskUserInterventionRequestDetails."Page ID" = Page::"Contact List" then begin AgentTaskUserInterventionSuggestion.Init(); + AgentTaskUserInterventionSuggestion.Code := SOAContactInterventionSuggestionCodeLbl; AgentTaskUserInterventionSuggestion.Summary := SOAContactInterventionSuggestionSummaryLbl; AgentTaskUserInterventionSuggestion.Description := SOAContactInterventionSuggestionDescriptionLbl; AgentTaskUserInterventionSuggestion.Instructions := SOAContactInterventionSuggestionInstructionsLbl; @@ -744,6 +750,16 @@ codeunit 4400 "SOA Setup" exit('Sales Order Agent'); end; + internal procedure GetUpdatedQuoteInterventionSuggestionCode(): Code[20] + begin + exit(StrSubstNo(SOAInterventionSuggestionCodeLbl, SOAInterventionSuggestionQuoteLockedLbl)); + end; + + internal procedure GetUpdatedOrderInterventionSuggestionCode(): Code[20] + begin + exit(StrSubstNo(SOAInterventionSuggestionCodeLbl, SOAInterventionSuggestionOrderLockedLbl)); + end; + var SOAImpl: Codeunit "SOA Impl"; Agent: Codeunit Agent; @@ -755,22 +771,26 @@ codeunit 4400 "SOA Setup" SalesOrderAgentInitialLbl: Label 'SO', MaxLength = 4; SOASummaryLbl: Label 'Monitors incoming emails for sales inquiries, matches senders to customers, checks inventory, and creates quotes. When processing replies, the agent converts accepted quotes into orders.'; DelegateAdminErr: Label 'Delegated admin and helpdesk users are not allowed to update the agent.'; - SOAInterventionSuggestionSummaryLbl: Label 'I have updated the %1', Comment = '%1 = Sales Document Type'; - SOAInterventionSuggestionDescriptionLbl: Label 'Used to indicate that a user has done some manual updates to a sales %1 as part of reviewing it before sending it to a customer.', Comment = '%1 = Sales Document Type', Locked = true; - SOAInterventionSuggestionInstructionsLbl: Label 'I have updated the sales %1. Make sure to download the PDF again before including the %1 information in any outgoing communication.', Comment = '%1 = Sales Document Type', Locked = true; + SOAInterventionSuggestionCodeLbl: Label 'SOA-UPDATE-%1', Locked = true, Comment = '%1 = Sales Document Type'; + SOAInterventionSuggestionSummaryLbl: Label 'I have updated the %1', Comment = '%1 = Sales Document Type', MaxLength = 100; + SOAInterventionSuggestionDescriptionLbl: Label 'Used to indicate that a user has done some manual updates to a sales %1 as part of reviewing it before sending it to a customer.', Comment = '%1 = Sales Document Type', Locked = true, MaxLength = 1024; + SOAInterventionSuggestionInstructionsLbl: Label 'I have updated the sales %1. Make sure to download the PDF again before including the %1 information in any outgoing communication.', Comment = '%1 = Sales Document Type', Locked = true, MaxLength = 1024; SOAInterventionSuggestionQuoteLbl: Label 'quote'; SOAInterventionSuggestionOrderLbl: Label 'order'; SOAInterventionSuggestionQuoteLockedLbl: Label 'quote', Locked = true; SOAInterventionSuggestionOrderLockedLbl: Label 'order', Locked = true; - SOAItemAvailabilityInterventionSuggestionSummaryLbl: Label 'I have made the items available'; - SOAItemAvailabilityInterventionSuggestionDescriptionLbl: Label 'Used to indicate that a user has done some manual updates to the item availability. Rerun the item availability check', Locked = true; - SOAItemAvailabilityInterventionSuggestionInstructionsLbl: Label 'I have updated the item availability. Make sure to recheck the item availability and proceed further.', Locked = true; - SOACustomerInterventionSuggestionSummaryLbl: Label 'I have added the customer'; - SOACustomerInterventionSuggestionDescriptionLbl: Label 'Used to indicate that a user has done some manual updates to add the customer information. Rerun the customer information check', Locked = true; - SOACustomerInterventionSuggestionInstructionsLbl: Label 'I have updated the customer information. Rerun the customer information check and proceed further.', Locked = true; - SOAContactInterventionSuggestionSummaryLbl: Label 'I have added the contact'; - SOAContactInterventionSuggestionDescriptionLbl: Label 'Used to indicate that a user has done some manual updates to add the contact information. Rerun the contact information check', Locked = true; - SOAContactInterventionSuggestionInstructionsLbl: Label 'I have updated the contact information. Rerun the contact information check on the contact list page and proceed further.', Locked = true; + SOAItemAvailabilityInterventionSuggestionCodeLbl: Label 'SOA-ITEM-AVAILABLE', Locked = true; + SOAItemAvailabilityInterventionSuggestionSummaryLbl: Label 'I have made the items available', MaxLength = 100; + SOAItemAvailabilityInterventionSuggestionDescriptionLbl: Label 'Used to indicate that a user has done some manual updates to the item availability. Rerun the item availability check', Locked = true, MaxLength = 1024; + SOAItemAvailabilityInterventionSuggestionInstructionsLbl: Label 'I have updated the item availability. Make sure to recheck the item availability and proceed further.', Locked = true, MaxLength = 1024; + SOACustomerInterventionSuggestionCodeLbl: Label 'SOA-CUSTOMER-ADDED', Locked = true; + SOACustomerInterventionSuggestionSummaryLbl: Label 'I have added the customer', MaxLength = 100; + SOACustomerInterventionSuggestionDescriptionLbl: Label 'Used to indicate that a user has done some manual updates to add the customer information. Rerun the customer information check', Locked = true, MaxLength = 1024; + SOACustomerInterventionSuggestionInstructionsLbl: Label 'I have updated the customer information. Rerun the customer information check and proceed further.', Locked = true, MaxLength = 1024; + SOAContactInterventionSuggestionCodeLbl: Label 'SOA-CONTACT-ADDED', Locked = true; + SOAContactInterventionSuggestionSummaryLbl: Label 'I have added the contact', MaxLength = 100; + SOAContactInterventionSuggestionDescriptionLbl: Label 'Used to indicate that a user has done some manual updates to add the contact information. Rerun the contact information check', Locked = true, MaxLength = 1024; + SOAContactInterventionSuggestionInstructionsLbl: Label 'I have updated the contact information. Rerun the contact information check on the contact list page and proceed further.', Locked = true, MaxLength = 1024; NewEmailsSinceDeactivationLbl: Label 'New e-mails (%1) have arrived since %2 but haven''t been processed yet. Should Sales Order Agent also process these?', Comment = '%1 - Number of emails, %2 - Date and time of deactivation.'; SOAAttemptedConnectionFailedErr: Label 'The agent can''t be activated because the connection to the selected Microsoft 365 mailbox failed. Ask your Microsoft 365 administrator to check if the user configuring the agent has permission to access the mailbox.'; SOAAttemptedConnectionHttpRequestFailedErr: Label 'The agent can''t be activated because its settings don''t allow Http Requests. Ask your administrator to update this setting and try again.'; diff --git a/Apps/W1/Sustainability/test/src/SustItemChrgAssignTest.Codeunit.al b/Apps/W1/Sustainability/test/src/SustItemChrgAssignTest.Codeunit.al index 774349e0cf..aec9a22cfc 100644 --- a/Apps/W1/Sustainability/test/src/SustItemChrgAssignTest.Codeunit.al +++ b/Apps/W1/Sustainability/test/src/SustItemChrgAssignTest.Codeunit.al @@ -1,5 +1,6 @@ namespace Microsoft.Test.Sustainability; +using Microsoft.Foundation.AuditCodes; using Microsoft.Inventory.Item; using Microsoft.Inventory.Setup; using Microsoft.Purchases.Document; @@ -27,6 +28,7 @@ codeunit 148210 "Sust. Item Chrg Assign. Test" LibraryInventory: Codeunit "Library - Inventory"; LibrarySustainability: Codeunit "Library - Sustainability"; LibraryTestInitialize: Codeunit "Library - Test Initialize"; + LibraryERM: Codeunit "Library - ERM"; IsInitialized: Boolean; AccountCodeLbl: Label 'AccountCode%1', Locked = true, Comment = '%1 = Number'; CategoryCodeLbl: Label 'CategoryCode%1', Locked = true, Comment = '%1 = Number'; @@ -1012,6 +1014,665 @@ codeunit 148210 "Sust. Item Chrg Assign. Test" StrSubstNo(ValueMustBeEqualErr, SustainabilityLedgerEntry.FieldCaption("CO2e Emission"), ExpectedCO2eEmission, SustainabilityLedgerEntry.TableCaption())); end; + [Test] + procedure VerifyCancelledPurchOrderCreatesNegativeEmissionInSustainabilityLedgerEntry() + var + SustainabilityLedgerEntry: Record "Sustainability Ledger Entry"; + SustainabilityAccount: Record "Sustainability Account"; + PurchaseHeader: Record "Purchase Header"; + PurchaseLine: Record "Purchase Line"; + PurchaseInvoiceHeader: Record "Purch. Inv. Header"; + CorrectPostedPurchInvoice: Codeunit "Correct Posted Purch. Invoice"; + EmissionCO2: Decimal; + EmissionCH4: Decimal; + EmissionN2O: Decimal; + CategoryCode: Code[20]; + SubcategoryCode: Code[20]; + AccountCode: Code[20]; + PostedInvoiceNo: Code[20]; + begin + // [SCENARIO 581746] Verify cancelled Purchase Order creates negative emission in Sustainability Ledger Entry. + LibrarySustainability.CleanUpBeforeTesting(); + + // [GIVEN] Create a Sustainability Account. + CreateSustainabilityAccount(AccountCode, CategoryCode, SubcategoryCode, LibraryRandom.RandInt(10)); + SustainabilityAccount.Get(AccountCode); + + // [GIVEN] Generate Emission. + EmissionCO2 := LibraryRandom.RandInt(20); + EmissionCH4 := LibraryRandom.RandInt(5); + EmissionN2O := LibraryRandom.RandInt(5); + + // [GIVEN] Create a Purchase Header. + LibraryPurchase.CreatePurchHeader(PurchaseHeader, "Purchase Document Type"::Order, LibraryPurchase.CreateVendorNo()); + + // [GIVEN] Create a Purchase Line. + LibraryPurchase.CreatePurchaseLine( + PurchaseLine, + PurchaseHeader, + "Purchase Line Type"::Item, + LibraryInventory.CreateItemNo(), + LibraryRandom.RandInt(10)); + + // [GIVEN] Update Sustainability Account No., Emission CO2, Emission CH4, Emission N2O. + PurchaseLine.Validate("Direct Unit Cost", LibraryRandom.RandIntInRange(10, 200)); + PurchaseLine.Validate("Sust. Account No.", AccountCode); + PurchaseLine.Validate("Emission CO2", EmissionCO2); + PurchaseLine.Validate("Emission CH4", EmissionCH4); + PurchaseLine.Validate("Emission N2O", EmissionN2O); + PurchaseLine.Modify(); + + // [GIVEN] Update Reason Code in Purchase Header. + UpdateReasonCodeinPurchaseHeader(PurchaseHeader); + + // [GIVEN] Post Purchase Document. + PostedInvoiceNo := LibraryPurchase.PostPurchaseDocument(PurchaseHeader, true, true); + + // [WHEN] Cancel Posted Purchase Invoice. + PurchaseInvoiceHeader.Get(PostedInvoiceNo); + CorrectPostedPurchInvoice.CancelPostedInvoice(PurchaseInvoiceHeader); + + // [THEN] Verify the cancellation Sustainability Ledger Entry has negative emission values. + SustainabilityLedgerEntry.SetRange("Account No.", AccountCode); + SustainabilityLedgerEntry.FindLast(); + Assert.AreEqual( + -EmissionCO2, + SustainabilityLedgerEntry."Emission CO2", + StrSubstNo(ValueMustBeEqualErr, SustainabilityLedgerEntry.FieldCaption("Emission CO2"), -EmissionCO2, SustainabilityLedgerEntry.TableCaption())); + Assert.AreEqual( + -EmissionCH4, + SustainabilityLedgerEntry."Emission CH4", + StrSubstNo(ValueMustBeEqualErr, SustainabilityLedgerEntry.FieldCaption("Emission CH4"), -EmissionCH4, SustainabilityLedgerEntry.TableCaption())); + Assert.AreEqual( + -EmissionN2O, + SustainabilityLedgerEntry."Emission N2O", + StrSubstNo(ValueMustBeEqualErr, SustainabilityLedgerEntry.FieldCaption("Emission N2O"), -EmissionN2O, SustainabilityLedgerEntry.TableCaption())); + end; + + [Test] + procedure VerifyCorrectedPurchaseOrderCreatesNegativeEmissionInSustainabilityLedgerEntry() + var + SustainabilityLedgerEntry: Record "Sustainability Ledger Entry"; + SustainabilityAccount: Record "Sustainability Account"; + PurchaseHeader: Record "Purchase Header"; + PurchaseLine: Record "Purchase Line"; + PurchaseInvoiceHeader: Record "Purch. Inv. Header"; + CorrectPostedPurchInvoice: Codeunit "Correct Posted Purch. Invoice"; + EmissionCO2: Decimal; + EmissionCH4: Decimal; + EmissionN2O: Decimal; + CategoryCode: Code[20]; + SubcategoryCode: Code[20]; + AccountCode: Code[20]; + PostedInvoiceNo: Code[20]; + begin + // [SCENARIO 581746] Verify corrective credit memo for Purchase Order creates negative emission in Sustainability Ledger Entry. + LibrarySustainability.CleanUpBeforeTesting(); + + // [GIVEN] Create a Sustainability Account. + CreateSustainabilityAccount(AccountCode, CategoryCode, SubcategoryCode, LibraryRandom.RandInt(10)); + SustainabilityAccount.Get(AccountCode); + + // [GIVEN] Generate Emission. + EmissionCO2 := LibraryRandom.RandInt(20); + EmissionCH4 := LibraryRandom.RandInt(5); + EmissionN2O := LibraryRandom.RandInt(5); + + // [GIVEN] Create a Purchase Header. + LibraryPurchase.CreatePurchHeader(PurchaseHeader, "Purchase Document Type"::Order, LibraryPurchase.CreateVendorNo()); + + // [GIVEN] Create a Purchase Line. + LibraryPurchase.CreatePurchaseLine( + PurchaseLine, + PurchaseHeader, + "Purchase Line Type"::Item, + LibraryInventory.CreateItemNo(), + LibraryRandom.RandInt(10)); + + // [GIVEN] Update Sustainability Account No., Emission CO2, Emission CH4, Emission N2O. + PurchaseLine.Validate("Direct Unit Cost", LibraryRandom.RandIntInRange(10, 200)); + PurchaseLine.Validate("Sust. Account No.", AccountCode); + PurchaseLine.Validate("Emission CO2", EmissionCO2); + PurchaseLine.Validate("Emission CH4", EmissionCH4); + PurchaseLine.Validate("Emission N2O", EmissionN2O); + PurchaseLine.Modify(); + + // [GIVEN] Update Reason Code in Purchase Header. + UpdateReasonCodeinPurchaseHeader(PurchaseHeader); + + // [GIVEN] Post Purchase Document. + PostedInvoiceNo := LibraryPurchase.PostPurchaseDocument(PurchaseHeader, true, true); + PurchaseInvoiceHeader.Get(PostedInvoiceNo); + + // [WHEN] Create and Post Corrective Credit Memo. + CorrectPostedPurchInvoice.CreateCreditMemoCopyDocument(PurchaseInvoiceHeader, PurchaseHeader); + PurchaseHeader.Validate("Vendor Cr. Memo No.", LibraryRandom.RandText(10)); + PurchaseHeader.Modify(); + LibraryPurchase.PostPurchaseDocument(PurchaseHeader, true, true); + + // [THEN] Verify the corrective Sustainability Ledger Entry has negative emission values. + SustainabilityLedgerEntry.SetRange("Account No.", AccountCode); + SustainabilityLedgerEntry.FindLast(); + Assert.AreEqual( + -EmissionCO2, + SustainabilityLedgerEntry."Emission CO2", + StrSubstNo(ValueMustBeEqualErr, SustainabilityLedgerEntry.FieldCaption("Emission CO2"), -EmissionCO2, SustainabilityLedgerEntry.TableCaption())); + Assert.AreEqual( + -EmissionCH4, + SustainabilityLedgerEntry."Emission CH4", + StrSubstNo(ValueMustBeEqualErr, SustainabilityLedgerEntry.FieldCaption("Emission CH4"), -EmissionCH4, SustainabilityLedgerEntry.TableCaption())); + Assert.AreEqual( + -EmissionN2O, + SustainabilityLedgerEntry."Emission N2O", + StrSubstNo(ValueMustBeEqualErr, SustainabilityLedgerEntry.FieldCaption("Emission N2O"), -EmissionN2O, SustainabilityLedgerEntry.TableCaption())); + end; + + [Test] + procedure VerifySustainabilityLedgerEntryRemovedWhenPurchInvoiceIsCancelled() + var + SustainabilityLedgerEntry: Record "Sustainability Ledger Entry"; + SustainabilityAccount: Record "Sustainability Account"; + PurchaseHeader: Record "Purchase Header"; + PurchaseLine: Record "Purchase Line"; + PurchaseInvoiceHeader: Record "Purch. Inv. Header"; + CorrectPostedPurchInvoice: Codeunit "Correct Posted Purch. Invoice"; + EmissionCO2: Decimal; + EmissionCH4: Decimal; + EmissionN2O: Decimal; + CategoryCode: Code[20]; + SubcategoryCode: Code[20]; + AccountCode: Code[20]; + PostedInvoiceNo: Code[20]; + begin + // [SCENARIO 581746] Verify Sustainability Ledger Entry should be removed when Posted Purchase Invoice is cancelled. + LibrarySustainability.CleanUpBeforeTesting(); + + // [GIVEN] Create a Sustainability Account. + CreateSustainabilityAccount(AccountCode, CategoryCode, SubcategoryCode, LibraryRandom.RandInt(10)); + SustainabilityAccount.Get(AccountCode); + + // [GIVEN] Generate Emission. + EmissionCO2 := LibraryRandom.RandInt(20); + EmissionCH4 := LibraryRandom.RandInt(5); + EmissionN2O := LibraryRandom.RandInt(5); + + // [GIVEN] Create a Purchase Invoice. + LibraryPurchase.CreatePurchHeader(PurchaseHeader, "Purchase Document Type"::Invoice, LibraryPurchase.CreateVendorNo()); + + // [GIVEN] Create a Purchase Line. + LibraryPurchase.CreatePurchaseLine( + PurchaseLine, + PurchaseHeader, + "Purchase Line Type"::Item, + LibraryInventory.CreateItemNo(), + LibraryRandom.RandInt(10)); + + // [GIVEN] Update Sustainability Account No., Emission CO2, Emission CH4, Emission N2O. + PurchaseLine.Validate("Direct Unit Cost", LibraryRandom.RandIntInRange(10, 200)); + PurchaseLine.Validate("Sust. Account No.", AccountCode); + PurchaseLine.Validate("Emission CO2", EmissionCO2); + PurchaseLine.Validate("Emission CH4", EmissionCH4); + PurchaseLine.Validate("Emission N2O", EmissionN2O); + PurchaseLine.Modify(); + + // [GIVEN] Update Reason Code in Purchase Header. + UpdateReasonCodeinPurchaseHeader(PurchaseHeader); + + // [GIVEN] Post Purchase Invoice. + PostedInvoiceNo := LibraryPurchase.PostPurchaseDocument(PurchaseHeader, true, true); + + // [WHEN] Cancel Posted Purchase Invoice. + PurchaseInvoiceHeader.Get(PostedInvoiceNo); + CorrectPostedPurchInvoice.CancelPostedInvoice(PurchaseInvoiceHeader); + + // [THEN] Verify Sustainability Ledger Entry emissions are removed. + SustainabilityLedgerEntry.SetRange("Account No.", AccountCode); + SustainabilityLedgerEntry.CalcSums("Emission CO2", "Emission CH4", "Emission N2O"); + Assert.AreEqual( + 0, + SustainabilityLedgerEntry."Emission CO2", + StrSubstNo(ValueMustBeEqualErr, SustainabilityLedgerEntry.FieldCaption("Emission CO2"), 0, SustainabilityLedgerEntry.TableCaption())); + Assert.AreEqual( + 0, + SustainabilityLedgerEntry."Emission CH4", + StrSubstNo(ValueMustBeEqualErr, SustainabilityLedgerEntry.FieldCaption("Emission CH4"), 0, SustainabilityLedgerEntry.TableCaption())); + Assert.AreEqual( + 0, + SustainabilityLedgerEntry."Emission N2O", + StrSubstNo(ValueMustBeEqualErr, SustainabilityLedgerEntry.FieldCaption("Emission N2O"), 0, SustainabilityLedgerEntry.TableCaption())); + end; + + [Test] + procedure VerifySustainabilityLedgerEntryRemovedWhenPurchInvoiceIsCorrected() + var + SustainabilityLedgerEntry: Record "Sustainability Ledger Entry"; + SustainabilityAccount: Record "Sustainability Account"; + PurchaseHeader: Record "Purchase Header"; + PurchaseLine: Record "Purchase Line"; + PurchaseInvoiceHeader: Record "Purch. Inv. Header"; + CorrectPostedPurchInvoice: Codeunit "Correct Posted Purch. Invoice"; + EmissionCO2: Decimal; + EmissionCH4: Decimal; + EmissionN2O: Decimal; + CategoryCode: Code[20]; + SubcategoryCode: Code[20]; + AccountCode: Code[20]; + PostedInvoiceNo: Code[20]; + begin + // [SCENARIO 581746] Verify Sustainability Ledger Entry should be removed when corrective credit memo for Purchase Invoice is posted. + LibrarySustainability.CleanUpBeforeTesting(); + + // [GIVEN] Create a Sustainability Account. + CreateSustainabilityAccount(AccountCode, CategoryCode, SubcategoryCode, LibraryRandom.RandInt(10)); + SustainabilityAccount.Get(AccountCode); + + // [GIVEN] Generate Emission. + EmissionCO2 := LibraryRandom.RandInt(20); + EmissionCH4 := LibraryRandom.RandInt(5); + EmissionN2O := LibraryRandom.RandInt(5); + + // [GIVEN] Create a Purchase Invoice. + LibraryPurchase.CreatePurchHeader(PurchaseHeader, "Purchase Document Type"::Invoice, LibraryPurchase.CreateVendorNo()); + + // [GIVEN] Create a Purchase Line. + LibraryPurchase.CreatePurchaseLine( + PurchaseLine, + PurchaseHeader, + "Purchase Line Type"::Item, + LibraryInventory.CreateItemNo(), + LibraryRandom.RandInt(10)); + + // [GIVEN] Update Sustainability Account No., Emission CO2, Emission CH4, Emission N2O. + PurchaseLine.Validate("Direct Unit Cost", LibraryRandom.RandIntInRange(10, 200)); + PurchaseLine.Validate("Sust. Account No.", AccountCode); + PurchaseLine.Validate("Emission CO2", EmissionCO2); + PurchaseLine.Validate("Emission CH4", EmissionCH4); + PurchaseLine.Validate("Emission N2O", EmissionN2O); + PurchaseLine.Modify(); + + // [GIVEN] Update Reason Code in Purchase Header. + UpdateReasonCodeinPurchaseHeader(PurchaseHeader); + + // [GIVEN] Post Purchase Invoice. + PostedInvoiceNo := LibraryPurchase.PostPurchaseDocument(PurchaseHeader, true, true); + PurchaseInvoiceHeader.Get(PostedInvoiceNo); + + // [WHEN] Create and Post Corrective Credit Memo. + CorrectPostedPurchInvoice.CreateCreditMemoCopyDocument(PurchaseInvoiceHeader, PurchaseHeader); + PurchaseHeader.Validate("Vendor Cr. Memo No.", LibraryRandom.RandText(10)); + PurchaseHeader.Modify(); + LibraryPurchase.PostPurchaseDocument(PurchaseHeader, true, true); + + // [THEN] Verify Sustainability Ledger Entry emissions are removed. + SustainabilityLedgerEntry.SetRange("Account No.", AccountCode); + SustainabilityLedgerEntry.CalcSums("Emission CO2", "Emission CH4", "Emission N2O"); + Assert.AreEqual( + 0, + SustainabilityLedgerEntry."Emission CO2", + StrSubstNo(ValueMustBeEqualErr, SustainabilityLedgerEntry.FieldCaption("Emission CO2"), 0, SustainabilityLedgerEntry.TableCaption())); + Assert.AreEqual( + 0, + SustainabilityLedgerEntry."Emission CH4", + StrSubstNo(ValueMustBeEqualErr, SustainabilityLedgerEntry.FieldCaption("Emission CH4"), 0, SustainabilityLedgerEntry.TableCaption())); + Assert.AreEqual( + 0, + SustainabilityLedgerEntry."Emission N2O", + StrSubstNo(ValueMustBeEqualErr, SustainabilityLedgerEntry.FieldCaption("Emission N2O"), 0, SustainabilityLedgerEntry.TableCaption())); + end; + + [Test] + procedure VerifyPositiveEmissionForChargeItemOnPostedPurchaseOrder() + var + SustainabilityLedgerEntry: Record "Sustainability Ledger Entry"; + SustainabilityAccount: Record "Sustainability Account"; + PurchaseHeader: Record "Purchase Header"; + PurchaseHeader2: Record "Purchase Header"; + PurchaseLine: Record "Purchase Line"; + PurchaseLine2: Record "Purchase Line"; + PurchRcptLine: Record "Purch. Rcpt. Line"; + ItemChargeAssignmentPurch: Record "Item Charge Assignment (Purch)"; + EmissionCO2: Decimal; + EmissionCH4: Decimal; + EmissionN2O: Decimal; + CategoryCode: Code[20]; + SubcategoryCode: Code[20]; + AccountCode: Code[20]; + PostedInvoiceNo: Code[20]; + ItemNo: Code[20]; + begin + // [SCENARIO 581746] Verify Sustainability Ledger Entry has positive emission when charge item is assigned to Purchase Receipt. + LibrarySustainability.CleanUpBeforeTesting(); + + // [GIVEN] Create a Sustainability Account. + CreateSustainabilityAccount(AccountCode, CategoryCode, SubcategoryCode, LibraryRandom.RandInt(10)); + SustainabilityAccount.Get(AccountCode); + + // [GIVEN] Generate Emission. + EmissionCO2 := LibraryRandom.RandInt(20); + EmissionCH4 := LibraryRandom.RandInt(5); + EmissionN2O := LibraryRandom.RandInt(5); + + // [GIVEN] Create Purchase Order with Item. + ItemNo := LibraryInventory.CreateItemNo(); + LibraryPurchase.CreatePurchHeader(PurchaseHeader, "Purchase Document Type"::Order, LibraryPurchase.CreateVendorNo()); + LibraryPurchase.CreatePurchaseLine(PurchaseLine, PurchaseHeader, "Purchase Line Type"::Item, ItemNo, LibraryRandom.RandInt(10)); + PurchaseLine.Validate("Direct Unit Cost", LibraryRandom.RandIntInRange(10, 200)); + PurchaseLine.Modify(); + + // [GIVEN] Post Purchase Order. + LibraryPurchase.PostPurchaseDocument(PurchaseHeader, true, true); + + // [GIVEN] Find Purchase Receipt Line. + PurchRcptLine.SetRange("Order No.", PurchaseHeader."No."); + PurchRcptLine.SetRange("No.", ItemNo); + PurchRcptLine.FindFirst(); + + // [GIVEN] Create Purchase Order with Charge Item and Sustainability. + LibraryPurchase.CreatePurchHeader(PurchaseHeader2, "Purchase Document Type"::Order, PurchaseHeader."Buy-from Vendor No."); + LibraryPurchase.CreatePurchaseLine(PurchaseLine2, PurchaseHeader2, "Purchase Line Type"::"Charge (Item)", LibraryInventory.CreateItemChargeNo(), LibraryRandom.RandInt(10)); + PurchaseLine2.Validate("Direct Unit Cost", LibraryRandom.RandIntInRange(10, 200)); + PurchaseLine2.Validate("Sust. Account No.", AccountCode); + PurchaseLine2.Validate("Emission CO2", EmissionCO2); + PurchaseLine2.Validate("Emission CH4", EmissionCH4); + PurchaseLine2.Validate("Emission N2O", EmissionN2O); + PurchaseLine2.Modify(); + + // [GIVEN] Assign Item Charge to Purchase Receipt. + LibraryInventory.CreateItemChargeAssignPurchase( + ItemChargeAssignmentPurch, PurchaseLine2, + ItemChargeAssignmentPurch."Applies-to Doc. Type"::Receipt, + PurchRcptLine."Document No.", PurchRcptLine."Line No.", PurchRcptLine."No."); + + // [WHEN] Post Purchase Order with Charge Item. + PostedInvoiceNo := LibraryPurchase.PostPurchaseDocument(PurchaseHeader2, true, true); + + // [THEN] Verify Sustainability Ledger Entry has positive emission. + SustainabilityLedgerEntry.SetRange("Document No.", PostedInvoiceNo); + SustainabilityLedgerEntry.SetRange("Account No.", AccountCode); + SustainabilityLedgerEntry.FindFirst(); + Assert.AreEqual( + EmissionCO2, + SustainabilityLedgerEntry."Emission CO2", + StrSubstNo(ValueMustBeEqualErr, SustainabilityLedgerEntry.FieldCaption("Emission CO2"), EmissionCO2, SustainabilityLedgerEntry.TableCaption())); + Assert.AreEqual( + EmissionCH4, + SustainabilityLedgerEntry."Emission CH4", + StrSubstNo(ValueMustBeEqualErr, SustainabilityLedgerEntry.FieldCaption("Emission CH4"), EmissionCH4, SustainabilityLedgerEntry.TableCaption())); + Assert.AreEqual( + EmissionN2O, + SustainabilityLedgerEntry."Emission N2O", + StrSubstNo(ValueMustBeEqualErr, SustainabilityLedgerEntry.FieldCaption("Emission N2O"), EmissionN2O, SustainabilityLedgerEntry.TableCaption())); + end; + + [Test] + procedure VerifyNegativeEmissionForChargeItemOnPostedPurchaseReturnOrder() + var + SustainabilityLedgerEntry: Record "Sustainability Ledger Entry"; + SustainabilityAccount: Record "Sustainability Account"; + PurchaseHeader: Record "Purchase Header"; + PurchaseHeader2: Record "Purchase Header"; + PurchaseLine: Record "Purchase Line"; + PurchaseLine2: Record "Purchase Line"; + ReturnShipmentLine: Record "Return Shipment Line"; + ItemChargeAssignmentPurch: Record "Item Charge Assignment (Purch)"; + EmissionCO2: Decimal; + EmissionCH4: Decimal; + EmissionN2O: Decimal; + CategoryCode: Code[20]; + SubcategoryCode: Code[20]; + AccountCode: Code[20]; + PostedCrMemoNo: Code[20]; + ItemNo: Code[20]; + begin + // [SCENARIO 581746] Verify Sustainability Ledger Entry has negative emission when charge item is assigned to Return Shipment via Purchase Return Order. + LibrarySustainability.CleanUpBeforeTesting(); + + // [GIVEN] Create a Sustainability Account. + CreateSustainabilityAccount(AccountCode, CategoryCode, SubcategoryCode, LibraryRandom.RandInt(10)); + SustainabilityAccount.Get(AccountCode); + + // [GIVEN] Generate Emission. + EmissionCO2 := LibraryRandom.RandInt(20); + EmissionCH4 := LibraryRandom.RandInt(5); + EmissionN2O := LibraryRandom.RandInt(5); + + // [GIVEN] Create and Post Purchase Return Order with Item. + ItemNo := LibraryInventory.CreateItemNo(); + LibraryPurchase.CreatePurchHeader(PurchaseHeader, "Purchase Document Type"::"Return Order", LibraryPurchase.CreateVendorNo()); + LibraryPurchase.CreatePurchaseLine(PurchaseLine, PurchaseHeader, "Purchase Line Type"::Item, ItemNo, LibraryRandom.RandInt(10)); + PurchaseLine.Validate("Direct Unit Cost", LibraryRandom.RandIntInRange(10, 200)); + PurchaseLine.Modify(); + LibraryPurchase.PostPurchaseDocument(PurchaseHeader, true, true); + + // [GIVEN] Find Return Shipment Line. + ReturnShipmentLine.SetRange("Return Order No.", PurchaseHeader."No."); + ReturnShipmentLine.SetRange("No.", ItemNo); + ReturnShipmentLine.FindFirst(); + + // [GIVEN] Create Purchase Return Order with Charge Item and Sustainability. + LibraryPurchase.CreatePurchHeader(PurchaseHeader2, "Purchase Document Type"::"Return Order", PurchaseHeader."Buy-from Vendor No."); + LibraryPurchase.CreatePurchaseLine(PurchaseLine2, PurchaseHeader2, "Purchase Line Type"::"Charge (Item)", LibraryInventory.CreateItemChargeNo(), LibraryRandom.RandInt(10)); + PurchaseLine2.Validate("Direct Unit Cost", LibraryRandom.RandIntInRange(10, 200)); + PurchaseLine2.Validate("Sust. Account No.", AccountCode); + PurchaseLine2.Validate("Emission CO2", EmissionCO2); + PurchaseLine2.Validate("Emission CH4", EmissionCH4); + PurchaseLine2.Validate("Emission N2O", EmissionN2O); + PurchaseLine2.Modify(); + + // [GIVEN] Assign Item Charge to Return Shipment. + LibraryInventory.CreateItemChargeAssignPurchase( + ItemChargeAssignmentPurch, PurchaseLine2, + ItemChargeAssignmentPurch."Applies-to Doc. Type"::"Return Shipment", + ReturnShipmentLine."Document No.", ReturnShipmentLine."Line No.", ReturnShipmentLine."No."); + + // [WHEN] Post Purchase Return Order with Charge Item. + PostedCrMemoNo := LibraryPurchase.PostPurchaseDocument(PurchaseHeader2, true, true); + + // [THEN] Verify Sustainability Ledger Entry has negative emission. + SustainabilityLedgerEntry.SetRange("Document No.", PostedCrMemoNo); + SustainabilityLedgerEntry.SetRange("Account No.", AccountCode); + SustainabilityLedgerEntry.FindFirst(); + Assert.AreEqual( + -EmissionCO2, + SustainabilityLedgerEntry."Emission CO2", + StrSubstNo(ValueMustBeEqualErr, SustainabilityLedgerEntry.FieldCaption("Emission CO2"), -EmissionCO2, SustainabilityLedgerEntry.TableCaption())); + Assert.AreEqual( + -EmissionCH4, + SustainabilityLedgerEntry."Emission CH4", + StrSubstNo(ValueMustBeEqualErr, SustainabilityLedgerEntry.FieldCaption("Emission CH4"), -EmissionCH4, SustainabilityLedgerEntry.TableCaption())); + Assert.AreEqual( + -EmissionN2O, + SustainabilityLedgerEntry."Emission N2O", + StrSubstNo(ValueMustBeEqualErr, SustainabilityLedgerEntry.FieldCaption("Emission N2O"), -EmissionN2O, SustainabilityLedgerEntry.TableCaption())); + end; + + [Test] + procedure VerifyEmissionRemovedForChargeItemWhenPurchInvoiceIsCancelled() + var + SustainabilityLedgerEntry: Record "Sustainability Ledger Entry"; + SustainabilityAccount: Record "Sustainability Account"; + PurchaseHeader: Record "Purchase Header"; + PurchaseHeader2: Record "Purchase Header"; + PurchaseLine: Record "Purchase Line"; + PurchaseLine2: Record "Purchase Line"; + PurchRcptLine: Record "Purch. Rcpt. Line"; + PurchaseInvoiceHeader: Record "Purch. Inv. Header"; + ItemChargeAssignmentPurch: Record "Item Charge Assignment (Purch)"; + CorrectPostedPurchInvoice: Codeunit "Correct Posted Purch. Invoice"; + EmissionCO2: Decimal; + EmissionCH4: Decimal; + EmissionN2O: Decimal; + CategoryCode: Code[20]; + SubcategoryCode: Code[20]; + AccountCode: Code[20]; + PostedInvoiceNo: Code[20]; + ItemNo: Code[20]; + begin + // [SCENARIO 581746] Verify Sustainability Ledger Entry emissions are removed when Purchase Invoice with charge item is cancelled. + LibrarySustainability.CleanUpBeforeTesting(); + + // [GIVEN] Create a Sustainability Account. + CreateSustainabilityAccount(AccountCode, CategoryCode, SubcategoryCode, LibraryRandom.RandInt(10)); + SustainabilityAccount.Get(AccountCode); + + // [GIVEN] Generate Emission. + EmissionCO2 := LibraryRandom.RandInt(20); + EmissionCH4 := LibraryRandom.RandInt(5); + EmissionN2O := LibraryRandom.RandInt(5); + + // [GIVEN] Create Purchase Order with Item. + ItemNo := LibraryInventory.CreateItemNo(); + LibraryPurchase.CreatePurchHeader(PurchaseHeader, "Purchase Document Type"::Order, LibraryPurchase.CreateVendorNo()); + LibraryPurchase.CreatePurchaseLine(PurchaseLine, PurchaseHeader, "Purchase Line Type"::Item, ItemNo, LibraryRandom.RandInt(10)); + PurchaseLine.Validate("Direct Unit Cost", LibraryRandom.RandIntInRange(10, 200)); + PurchaseLine.Modify(); + + // [GIVEN] Post Purchase Order. + LibraryPurchase.PostPurchaseDocument(PurchaseHeader, true, true); + + // [GIVEN] Find Purchase Receipt Line. + PurchRcptLine.SetRange("Order No.", PurchaseHeader."No."); + PurchRcptLine.SetRange("No.", ItemNo); + PurchRcptLine.FindFirst(); + + // [GIVEN] Create Purchase Order with Charge Item and Sustainability. + LibraryPurchase.CreatePurchHeader(PurchaseHeader2, "Purchase Document Type"::Order, PurchaseHeader."Buy-from Vendor No."); + LibraryPurchase.CreatePurchaseLine(PurchaseLine2, PurchaseHeader2, "Purchase Line Type"::"Charge (Item)", LibraryInventory.CreateItemChargeNo(), LibraryRandom.RandInt(10)); + PurchaseLine2.Validate("Direct Unit Cost", LibraryRandom.RandIntInRange(10, 200)); + PurchaseLine2.Validate("Sust. Account No.", AccountCode); + PurchaseLine2.Validate("Emission CO2", EmissionCO2); + PurchaseLine2.Validate("Emission CH4", EmissionCH4); + PurchaseLine2.Validate("Emission N2O", EmissionN2O); + PurchaseLine2.Modify(); + + // [GIVEN] Assign Item Charge to Purchase Receipt. + LibraryInventory.CreateItemChargeAssignPurchase( + ItemChargeAssignmentPurch, PurchaseLine2, + ItemChargeAssignmentPurch."Applies-to Doc. Type"::Receipt, + PurchRcptLine."Document No.", PurchRcptLine."Line No.", PurchRcptLine."No."); + + // [GIVEN] Update Reason Code in Purchase Header. + UpdateReasonCodeinPurchaseHeader(PurchaseHeader2); + + // [GIVEN] Post Purchase Order with Charge Item. + PostedInvoiceNo := LibraryPurchase.PostPurchaseDocument(PurchaseHeader2, true, true); + + // [WHEN] Cancel Posted Purchase Invoice. + PurchaseInvoiceHeader.Get(PostedInvoiceNo); + CorrectPostedPurchInvoice.CancelPostedInvoice(PurchaseInvoiceHeader); + + // [THEN] Verify Sustainability Ledger Entry emissions are removed. + SustainabilityLedgerEntry.SetRange("Account No.", AccountCode); + SustainabilityLedgerEntry.CalcSums("Emission CO2", "Emission CH4", "Emission N2O"); + Assert.AreEqual( + 0, + SustainabilityLedgerEntry."Emission CO2", + StrSubstNo(ValueMustBeEqualErr, SustainabilityLedgerEntry.FieldCaption("Emission CO2"), 0, SustainabilityLedgerEntry.TableCaption())); + Assert.AreEqual( + 0, + SustainabilityLedgerEntry."Emission CH4", + StrSubstNo(ValueMustBeEqualErr, SustainabilityLedgerEntry.FieldCaption("Emission CH4"), 0, SustainabilityLedgerEntry.TableCaption())); + Assert.AreEqual( + 0, + SustainabilityLedgerEntry."Emission N2O", + StrSubstNo(ValueMustBeEqualErr, SustainabilityLedgerEntry.FieldCaption("Emission N2O"), 0, SustainabilityLedgerEntry.TableCaption())); + end; + + [Test] + procedure VerifyEmissionRemovedForChargeItemWhenCorrectiveCrMemoIsPosted() + var + SustainabilityLedgerEntry: Record "Sustainability Ledger Entry"; + SustainabilityAccount: Record "Sustainability Account"; + PurchaseHeader: Record "Purchase Header"; + PurchaseHeader2: Record "Purchase Header"; + PurchaseLine: Record "Purchase Line"; + PurchaseLine2: Record "Purchase Line"; + PurchRcptLine: Record "Purch. Rcpt. Line"; + PurchaseInvoiceHeader: Record "Purch. Inv. Header"; + ItemChargeAssignmentPurch: Record "Item Charge Assignment (Purch)"; + CorrectPostedPurchInvoice: Codeunit "Correct Posted Purch. Invoice"; + EmissionCO2: Decimal; + EmissionCH4: Decimal; + EmissionN2O: Decimal; + CategoryCode: Code[20]; + SubcategoryCode: Code[20]; + AccountCode: Code[20]; + PostedInvoiceNo: Code[20]; + ItemNo: Code[20]; + begin + // [SCENARIO 581746] Verify Sustainability Ledger Entry emissions are removed when corrective credit memo for Purchase Invoice with charge item is posted. + LibrarySustainability.CleanUpBeforeTesting(); + + // [GIVEN] Create a Sustainability Account. + CreateSustainabilityAccount(AccountCode, CategoryCode, SubcategoryCode, LibraryRandom.RandInt(10)); + SustainabilityAccount.Get(AccountCode); + + // [GIVEN] Generate Emission. + EmissionCO2 := LibraryRandom.RandInt(20); + EmissionCH4 := LibraryRandom.RandInt(5); + EmissionN2O := LibraryRandom.RandInt(5); + + // [GIVEN] Create Purchase Order with Item. + ItemNo := LibraryInventory.CreateItemNo(); + LibraryPurchase.CreatePurchHeader(PurchaseHeader, "Purchase Document Type"::Order, LibraryPurchase.CreateVendorNo()); + LibraryPurchase.CreatePurchaseLine(PurchaseLine, PurchaseHeader, "Purchase Line Type"::Item, ItemNo, LibraryRandom.RandInt(10)); + PurchaseLine.Validate("Direct Unit Cost", LibraryRandom.RandIntInRange(10, 200)); + PurchaseLine.Modify(); + + // [GIVEN] Post Purchase Order. + LibraryPurchase.PostPurchaseDocument(PurchaseHeader, true, true); + + // [GIVEN] Find Purchase Receipt Line. + PurchRcptLine.SetRange("Order No.", PurchaseHeader."No."); + PurchRcptLine.SetRange("No.", ItemNo); + PurchRcptLine.FindFirst(); + + // [GIVEN] Create Purchase Order with Charge Item and Sustainability. + LibraryPurchase.CreatePurchHeader(PurchaseHeader2, "Purchase Document Type"::Order, PurchaseHeader."Buy-from Vendor No."); + LibraryPurchase.CreatePurchaseLine(PurchaseLine2, PurchaseHeader2, "Purchase Line Type"::"Charge (Item)", LibraryInventory.CreateItemChargeNo(), LibraryRandom.RandInt(10)); + PurchaseLine2.Validate("Direct Unit Cost", LibraryRandom.RandIntInRange(10, 200)); + PurchaseLine2.Validate("Sust. Account No.", AccountCode); + PurchaseLine2.Validate("Emission CO2", EmissionCO2); + PurchaseLine2.Validate("Emission CH4", EmissionCH4); + PurchaseLine2.Validate("Emission N2O", EmissionN2O); + PurchaseLine2.Modify(); + + // [GIVEN] Assign Item Charge to Purchase Receipt. + LibraryInventory.CreateItemChargeAssignPurchase( + ItemChargeAssignmentPurch, PurchaseLine2, + ItemChargeAssignmentPurch."Applies-to Doc. Type"::Receipt, + PurchRcptLine."Document No.", PurchRcptLine."Line No.", PurchRcptLine."No."); + + // [GIVEN] Update Reason Code in Purchase Header. + UpdateReasonCodeinPurchaseHeader(PurchaseHeader2); + + // [GIVEN] Post Purchase Order with Charge Item. + PostedInvoiceNo := LibraryPurchase.PostPurchaseDocument(PurchaseHeader2, true, true); + PurchaseInvoiceHeader.Get(PostedInvoiceNo); + + // [WHEN] Create and Post Corrective Credit Memo. + CorrectPostedPurchInvoice.CreateCreditMemoCopyDocument(PurchaseInvoiceHeader, PurchaseHeader2); + PurchaseHeader2.Validate("Vendor Cr. Memo No.", LibraryRandom.RandText(10)); + PurchaseHeader2.Modify(); + LibraryPurchase.PostPurchaseDocument(PurchaseHeader2, true, true); + + // [THEN] Verify Sustainability Ledger Entry emissions are removed. + SustainabilityLedgerEntry.SetRange("Account No.", AccountCode); + SustainabilityLedgerEntry.CalcSums("Emission CO2", "Emission CH4", "Emission N2O"); + Assert.AreEqual( + 0, + SustainabilityLedgerEntry."Emission CO2", + StrSubstNo(ValueMustBeEqualErr, SustainabilityLedgerEntry.FieldCaption("Emission CO2"), 0, SustainabilityLedgerEntry.TableCaption())); + Assert.AreEqual( + 0, + SustainabilityLedgerEntry."Emission CH4", + StrSubstNo(ValueMustBeEqualErr, SustainabilityLedgerEntry.FieldCaption("Emission CH4"), 0, SustainabilityLedgerEntry.TableCaption())); + Assert.AreEqual( + 0, + SustainabilityLedgerEntry."Emission N2O", + StrSubstNo(ValueMustBeEqualErr, SustainabilityLedgerEntry.FieldCaption("Emission N2O"), 0, SustainabilityLedgerEntry.TableCaption())); + end; + local procedure Initialize() var InventorySetup: Record "Inventory Setup"; @@ -1313,4 +1974,14 @@ codeunit 148210 "Sust. Item Chrg Assign. Test" CategoryCode, CategoryCode, Enum::"Emission Scope"::"Scope 1", Enum::"Calculation Foundation"::"Fuel/Electricity", true, true, true, '', false); end; + + local procedure UpdateReasonCodeinPurchaseHeader(var PurchaseHeader: Record "Purchase Header") + var + ReasonCode: Record "Reason Code"; + begin + LibraryERM.CreateReasonCode(ReasonCode); + + PurchaseHeader.Validate("Reason Code", ReasonCode.Code); + PurchaseHeader.Modify(); + end; } diff --git a/Apps/W1/Sustainability/test/src/SustValueEntryTest.Codeunit.al b/Apps/W1/Sustainability/test/src/SustValueEntryTest.Codeunit.al index 0899328a9e..43b2d1dc8e 100644 --- a/Apps/W1/Sustainability/test/src/SustValueEntryTest.Codeunit.al +++ b/Apps/W1/Sustainability/test/src/SustValueEntryTest.Codeunit.al @@ -4108,6 +4108,7 @@ codeunit 148190 "Sust. Value Entry Test" ExternalDocNo: Code[35]; SubcategoryCode: Code[20]; begin + // [FEATURE] [AI TEST] // [SCENARIO 620888] Verify Find Entries returns correct results when searching posted invoices by External Document No. LibrarySustainability.CleanUpBeforeTesting(); diff --git a/Apps/W1/VATGroupManagement/test/.resources/status_single_submitted.json b/Apps/W1/VATGroupManagement/test/.resources/status_single_submitted.json new file mode 100644 index 0000000000..6b426140c2 --- /dev/null +++ b/Apps/W1/VATGroupManagement/test/.resources/status_single_submitted.json @@ -0,0 +1,8 @@ +{ + "value": [ + { + "no": "TEST_NO_5", + "status": "Submitted" + } + ] +} \ No newline at end of file diff --git a/Apps/W1/VATGroupManagement/test/.resources/test_1.json b/Apps/W1/VATGroupManagement/test/.resources/test_1.json new file mode 100644 index 0000000000..72648d7234 --- /dev/null +++ b/Apps/W1/VATGroupManagement/test/.resources/test_1.json @@ -0,0 +1,8 @@ +{ + "value": [ + { + "no": "TEST_NO_1", + "status": "Rejected" + } + ] +} \ No newline at end of file diff --git a/Apps/W1/VATGroupManagement/test/.resources/test_2.json b/Apps/W1/VATGroupManagement/test/.resources/test_2.json new file mode 100644 index 0000000000..f61366d07d --- /dev/null +++ b/Apps/W1/VATGroupManagement/test/.resources/test_2.json @@ -0,0 +1,8 @@ +{ + "value": [ + { + "no": "TEST_NO_2", + "status": "Canceled" + } + ] +} \ No newline at end of file diff --git a/Apps/W1/VATGroupManagement/test/.resources/test_3.json b/Apps/W1/VATGroupManagement/test/.resources/test_3.json new file mode 100644 index 0000000000..c6269ef20f --- /dev/null +++ b/Apps/W1/VATGroupManagement/test/.resources/test_3.json @@ -0,0 +1,4 @@ +{ + "value": [ + ] +} \ No newline at end of file diff --git a/Apps/W1/VATGroupManagement/test/.resources/test_5.json b/Apps/W1/VATGroupManagement/test/.resources/test_5.json new file mode 100644 index 0000000000..6b426140c2 --- /dev/null +++ b/Apps/W1/VATGroupManagement/test/.resources/test_5.json @@ -0,0 +1,8 @@ +{ + "value": [ + { + "no": "TEST_NO_5", + "status": "Submitted" + } + ] +} \ No newline at end of file diff --git a/Apps/W1/VATGroupManagement/test/app.json b/Apps/W1/VATGroupManagement/test/app.json index 3c2564a34f..606c0e29f9 100644 --- a/Apps/W1/VATGroupManagement/test/app.json +++ b/Apps/W1/VATGroupManagement/test/app.json @@ -46,6 +46,10 @@ { "from": 139740, "to": 139741 + }, + { + "from": 139747, + "to": 139747 } ], "contextSensitiveHelpUrl": "https://go.microsoft.com/fwlink/?linkid=2141039", diff --git a/Apps/W1/VATGroupManagement/test/src/VATGroupHttpMockService.Codeunit.al b/Apps/W1/VATGroupManagement/test/src/VATGroupHttpMockService.Codeunit.al new file mode 100644 index 0000000000..48757307d2 --- /dev/null +++ b/Apps/W1/VATGroupManagement/test/src/VATGroupHttpMockService.Codeunit.al @@ -0,0 +1,117 @@ +codeunit 139747 "VAT Group Http Mock Service" +{ + + procedure HandleRequest(Request: TestHttpRequestMessage; var Response: TestHttpResponseMessage) + var + filterValue: Text; + begin + + if Request.QueryParameters.ContainsKey('$filter') then begin + filterValue := Request.QueryParameters.Get('$filter'); + + if filterValue.Contains('TEST_NO_1') then begin + Handle('test_1.json', Response, 200); + exit; + end; + + if filterValue.Contains('TEST_NO_2') then begin + Handle('test_2.json', Response, 200); + exit; + end; + + if filterValue.Contains('TEST_NO_3') then begin + Handle('test_3.json', Response, 200); + exit; + end; + + if filterValue.Contains('TEST_NO_4') then begin + Handle('test_3.json', Response, 200); + exit; + end; + + if filterValue.Contains('TEST_NO_5') then begin + + if filterValue.Contains('00000000-0000-0000-0000-000000000001') then begin + Handle('test_5.json', Response, 200); + exit; + end; + + Handle('test_3.json', Response, 200); + exit; + end; + + end; + + + if Request.Path.Contains('wrong') then begin + Response.HttpStatusCode := 404; + exit; + end; + + if Request.Path.Contains('/api/microsoft/vatgroup/v1.0/companies(name=''VAT%20Group%20Repr%20Test%20Company'')/vatGroupSubmissionStatus') then begin + Handle('status_single_released.json', Response, 200); + exit; + end; + + if Request.Path.Contains('/api/v1.0/companies(name=''VAT%20Group%20Repr%20Test%20Company'')/vatGroupSubmissionStatus') then begin + Handle('status_single_released.json', Response, 200); + exit; + end; + + if Request.Path.Contains('/OData/Company(''VAT%20Group%20Repr%20Test%20Company'')/vatGroupSubmissionStatus') then begin + Handle('status_single_released.json', Response, 200); + exit; + end; + + if Request.Path.Contains('/api/v1.0/$batch') then begin + Handle('status_batch_released.json', Response, 200); + exit; + end; + + if Request.Path.Contains('/api/microsoft/vatgroup/v1.0/$batch') then begin + Handle('status_batch_released.json', Response, 200); + exit; + end; + + if Request.Path.Contains('/OData/$batch') then begin + Handle('status_batch_released.json', Response, 200); + exit; + end; + + if Request.Path.Contains('/api/microsoft/vatgroup/v1.0/companies(name=''VAT%20Group%20Repr%20Test%20Company'')/vatGroupSubmissions') then begin + Handle('200_blanked.json', Response, 200); + exit; + end; + + if Request.Path.Contains('/api/v1.0/companies(name=''VAT%20Group%20Repr%20Test%20Company'')/vatGroupSubmissions') then begin + Handle('200_blanked.json', Response, 200); + exit; + end; + + if Request.Path.Contains('/OData/Company(''VAT%20Group%20Repr%20Test%20Company'')/vatGroupSubmissions') then begin + Handle('200_blanked.json', Response, 200); + exit; + end; + + if Request.Path.Contains('/api/microsoft/vatgroup/v1.0/companies(name=''GU00000000'')/vatGroupSubmissions') then begin + Response.HttpStatusCode := 404; + exit; + end; + + if Request.Path.Contains('/api/microsoft/vatgroup/v1.0/companies(name=''CRONUS%20International%20Ltd.'')/vatGroupSubmissions') then begin + Handle('status_single_submitted.json', Response, 200); + exit; + end; + + // Default response for unhandled requests + Response.HttpStatusCode := 404; + end; + + + local procedure Handle(ResourceText: Text; var Response: TestHttpResponseMessage; StatusCode: Integer) + begin + Response.Content.WriteFrom(NavApp.GetResourceAsText(ResourceText, TextEncoding::UTF8)); + Response.HttpStatusCode := StatusCode; + end; + +} \ No newline at end of file diff --git a/Apps/W1/VATGroupManagement/test/src/VATGroupMockServiceTest.Codeunit.al b/Apps/W1/VATGroupManagement/test/src/VATGroupMockServiceTest.Codeunit.al index 9d9dda9932..1742e73793 100644 --- a/Apps/W1/VATGroupManagement/test/src/VATGroupMockServiceTest.Codeunit.al +++ b/Apps/W1/VATGroupManagement/test/src/VATGroupMockServiceTest.Codeunit.al @@ -217,33 +217,11 @@ codeunit 139526 "VAT Group Mock Service Test" [HttpClientHandler] - procedure VATGroupHttpClientHandler(Request: TestHttpRequestMessage; var Response: TestHttpResponseMessage): Boolean + internal procedure VATGroupHttpClientHandler(Request: TestHttpRequestMessage; var Response: TestHttpResponseMessage): Boolean var - InStream: InStream; - ResourceName: Text; + VATGroupHttpMockService: Codeunit "VAT Group Http Mock Service"; begin - case Request.Path of - URLTxt + '/api/microsoft/vatgroup/v1.0/companies(name=''VAT%20Group%20Repr%20Test%20Company'')/vatGroupSubmissionStatus', - URLTxt + '/api/v1.0/companies(name=''VAT%20Group%20Repr%20Test%20Company'')/vatGroupSubmissionStatus', - URLTxt + '/OData/Company(''VAT%20Group%20Repr%20Test%20Company'')/vatGroupSubmissionStatus': - if Request.RequestType = HttpRequestType::Get then - ResourceName := 'status_single_released.json'; - - URLTxt + '/api/v1.0/$batch', - URLTxt + '/api/microsoft/vatgroup/v1.0/$batch', - URLTxt + '/OData/$batch': - if Request.RequestType = HttpRequestType::Post then - ResourceName := 'status_batch_released.json'; - URLTxt + '/api/microsoft/vatgroup/v1.0/companies(name=''VAT%20Group%20Repr%20Test%20Company'')/vatGroupSubmissions', - URLTxt + '/api/v1.0/companies(name=''VAT%20Group%20Repr%20Test%20Company'')/vatGroupSubmissions', - URLTxt + '/OData/Company(''VAT%20Group%20Repr%20Test%20Company'')/vatGroupSubmissions': - if Request.RequestType = HttpRequestType::Post then - ResourceName := '200_blanked.json'; - end; - - NavApp.GetResource(ResourceName, InStream); - Response.Content.WriteFrom(InStream); - Response.HttpStatusCode := 200; + VATGroupHttpMockService.HandleRequest(Request, Response); exit(false); end; } diff --git a/Apps/W1/VATGroupManagement/test/src/VATGroupSubStatusTest.Codeunit.al b/Apps/W1/VATGroupManagement/test/src/VATGroupSubStatusTest.Codeunit.al index fe76cbb10b..3da6300056 100644 --- a/Apps/W1/VATGroupManagement/test/src/VATGroupSubStatusTest.Codeunit.al +++ b/Apps/W1/VATGroupManagement/test/src/VATGroupSubStatusTest.Codeunit.al @@ -10,6 +10,7 @@ codeunit 139741 "VAT Group Sub. Status Test" DummyGuid: Guid; [Test] + [HandlerFunctions('HttpClientHandler')] procedure TestQueryAPIEndpoint() var VATReportSetup: Record "VAT Report Setup"; @@ -146,6 +147,7 @@ codeunit 139741 "VAT Group Sub. Status Test" end; [Test] + [HandlerFunctions('HttpClientHandler')] procedure TestVATGroupSubmissionStatusBatchRequest() var VATReportHeader: Record "VAT Report Header"; @@ -245,6 +247,7 @@ codeunit 139741 "VAT Group Sub. Status Test" end; [Test] + [HandlerFunctions('HttpClientHandler')] procedure TestVATGroupSubmissionStatusWrongBatchEndpoint() var VATGroupSubmissionStatus: Codeunit "VAT Group Submission Status"; @@ -265,7 +268,9 @@ codeunit 139741 "VAT Group Sub. Status Test" Assert.ExpectedError('Not Found: cannot locate the requested resource.'); end; + [Test] + [HandlerFunctions('HttpClientHandler')] procedure TestVATGroupSubmissionStatusErrorSingleGETRequestInBatch() var VATReportHeader: Record "VAT Report Header"; @@ -366,6 +371,7 @@ codeunit 139741 "VAT Group Sub. Status Test" end; [Test] + [HandlerFunctions('HttpClientHandler')] procedure TestUpdateSingleVATReportStatus() var VATReportHeader: Record "VAT Report Header"; @@ -491,6 +497,7 @@ codeunit 139741 "VAT Group Sub. Status Test" end; [Test] + [HandlerFunctions('HttpClientHandler')] procedure TestUpdateSingleVATReportStatusError() var VATGroupSubmissionStatus: Codeunit "VAT Group Submission Status"; @@ -552,6 +559,7 @@ codeunit 139741 "VAT Group Sub. Status Test" end; [Test] + [HandlerFunctions('HttpClientHandler')] procedure TestButtonUpdateStatusVATReportPage() var VATReportHeader: Record "VAT Report Header"; @@ -849,4 +857,13 @@ codeunit 139741 "VAT Group Sub. Status Test" begin exit('CDEF7890-ABCD-0123-0005-100890ABCDEA'); end; + + [HttpClientHandler] + internal procedure HttpClientHandler(Request: TestHttpRequestMessage; var Response: TestHttpResponseMessage): Boolean + var + VATGroupHttpMockService: Codeunit "VAT Group Http Mock Service"; + begin + VATGroupHttpMockService.HandleRequest(Request, Response); + exit(false); + end; } diff --git a/Apps/W1/VATGroupManagement/test/src/VATGroupSubmitToReprTest.Codeunit.al b/Apps/W1/VATGroupManagement/test/src/VATGroupSubmitToReprTest.Codeunit.al index c5f4c13f65..eb67fa7b10 100644 --- a/Apps/W1/VATGroupManagement/test/src/VATGroupSubmitToReprTest.Codeunit.al +++ b/Apps/W1/VATGroupManagement/test/src/VATGroupSubmitToReprTest.Codeunit.al @@ -30,7 +30,7 @@ codeunit 139740 "VAT Group Submit To Repr. Test" end; [Test] - [HandlerFunctions('MessageHandler')] + [HandlerFunctions('MessageHandler,HttpClientHandler')] procedure TestFailureInSend() var VATReportHeader: Record "VAT Report Header"; @@ -50,7 +50,7 @@ codeunit 139740 "VAT Group Submit To Repr. Test" end; [Test] - [HandlerFunctions('MessageHandler')] + [HandlerFunctions('MessageHandler,HttpClientHandler')] procedure TestFailureInSendMissingApprovedMember() var VATReportHeader: Record "VAT Report Header"; @@ -74,6 +74,7 @@ codeunit 139740 "VAT Group Submit To Repr. Test" end; [Test] + [HandlerFunctions('HttpClientHandler')] procedure TestSuccessfulSend() var VATReportHeader: Record "VAT Report Header"; @@ -147,4 +148,13 @@ codeunit 139740 "VAT Group Submit To Repr. Test" begin LibraryVariableStorage.Enqueue(Message); end; + + [HttpClientHandler] + internal procedure HttpClientHandler(Request: TestHttpRequestMessage; var Response: TestHttpResponseMessage): Boolean + var + VATGroupHttpMockService: Codeunit "VAT Group Http Mock Service"; + begin + VATGroupHttpMockService.HandleRequest(Request, Response); + exit(false); + end; } diff --git a/Apps/W1/WithholdingTax/Test/src/ERMWithholdingTaxTestsI.Codeunit.al b/Apps/W1/WithholdingTax/Test/src/ERMWithholdingTaxTestsI.Codeunit.al index e853be9d35..4349242e6c 100644 --- a/Apps/W1/WithholdingTax/Test/src/ERMWithholdingTaxTestsI.Codeunit.al +++ b/Apps/W1/WithholdingTax/Test/src/ERMWithholdingTaxTestsI.Codeunit.al @@ -1796,6 +1796,7 @@ codeunit 148321 "ERM Withholding Tax Tests I" PostedDocumentNo: Code[20]; UnrealizedBase: Decimal; begin + // [FEATURE] [AI TEST] // [SCENARIO 285194] - Test to verify after Posting Purchase Invoice with WHT, WHT Entry - External Document No. is populated with Vendor Invoice No. and Unrealized Base is correctly calculated. Initialize(); diff --git a/Apps/W1/WithholdingTax/app/src/Purchase/History/WHTPurchCrMemoHdr.TableExt.al b/Apps/W1/WithholdingTax/app/src/Purchase/History/WHTPurchCrMemoHdr.TableExt.al index 674801d9f6..17724ce62b 100644 --- a/Apps/W1/WithholdingTax/app/src/Purchase/History/WHTPurchCrMemoHdr.TableExt.al +++ b/Apps/W1/WithholdingTax/app/src/Purchase/History/WHTPurchCrMemoHdr.TableExt.al @@ -48,13 +48,8 @@ tableextension 6799 "WHT Purch. Cr. Memo Hdr." extends "Purch. Cr. Memo Hdr." } field(6793; "WHT Actual Vendor No."; Code[20]) { - Caption = 'Actual Vendor No.'; + Caption = 'Withholding Actual Vendor No.'; DataClassification = CustomerContent; -#if not CLEAN29 - ObsoleteState = Pending; - ObsoleteTag = '29.0'; - ObsoleteReason = 'This field has been removed and is no longer required.'; -#endif } field(6794; "WHT Printed Tax Document"; Boolean) { diff --git a/Apps/W1/WithholdingTax/app/src/Purchase/History/WithholdingPurchInvHeader.TableExt.al b/Apps/W1/WithholdingTax/app/src/Purchase/History/WithholdingPurchInvHeader.TableExt.al index 2c61f324de..1e662c961b 100644 --- a/Apps/W1/WithholdingTax/app/src/Purchase/History/WithholdingPurchInvHeader.TableExt.al +++ b/Apps/W1/WithholdingTax/app/src/Purchase/History/WithholdingPurchInvHeader.TableExt.al @@ -48,13 +48,8 @@ tableextension 6798 "Withholding Purch. Inv. Header" extends "Purch. Inv. Header } field(6793; "WHT Actual Vendor No."; Code[20]) { - Caption = 'Actual Vendor No.'; + Caption = 'Withholding Actual Vendor No.'; DataClassification = CustomerContent; -#if not CLEAN29 - ObsoleteState = Pending; - ObsoleteTag = '29.0'; - ObsoleteReason = 'This field has been removed and is no longer required.'; -#endif } field(6794; "WHT Printed Tax Document"; Boolean) { diff --git a/Apps/W1/WithholdingTax/app/src/Purchase/History/WithholdingTaxEntries.Page.al b/Apps/W1/WithholdingTax/app/src/Purchase/History/WithholdingTaxEntries.Page.al index 0a7c031b59..ab7cfa5888 100644 --- a/Apps/W1/WithholdingTax/app/src/Purchase/History/WithholdingTaxEntries.Page.al +++ b/Apps/W1/WithholdingTax/app/src/Purchase/History/WithholdingTaxEntries.Page.al @@ -213,17 +213,12 @@ page 6788 "Withholding Tax Entries" ApplicationArea = Basic, Suite; ToolTip = 'Specifies the Document Date from the applied Withholding Tax Entry is stored for applying the Withholding Tax Entry table.'; } -#if not CLEAN29 field("Actual Vendor No."; Rec."Actual Vendor No.") { ApplicationArea = Basic, Suite; Visible = false; ToolTip = 'Specifies the Actual Vendor No. from which Invoices or Journals is copied.'; - ObsoleteState = Pending; - ObsoleteTag = '29.0'; - ObsoleteReason = 'This field has been removed and is no longer required.'; } -#endif field("Withholding Certificate No."; Rec."Wthldg. Tax Certificate No.") { ApplicationArea = Basic, Suite; diff --git a/Apps/W1/WithholdingTax/app/src/Purchase/History/WithholdingTaxEntry.Table.al b/Apps/W1/WithholdingTax/app/src/Purchase/History/WithholdingTaxEntry.Table.al index ba6e07d47b..910f9d8072 100644 --- a/Apps/W1/WithholdingTax/app/src/Purchase/History/WithholdingTaxEntry.Table.al +++ b/Apps/W1/WithholdingTax/app/src/Purchase/History/WithholdingTaxEntry.Table.al @@ -266,13 +266,8 @@ table 6788 "Withholding Tax Entry" } field(44; "Actual Vendor No."; Code[20]) { - Caption = 'Actual Vendor No.'; + Caption = 'Withholding Actual Vendor No.'; DataClassification = CustomerContent; -#if not CLEAN29 - ObsoleteState = Pending; - ObsoleteTag = '29.0'; - ObsoleteReason = 'This field has been removed and is no longer required.'; -#endif } field(45; "Wthldg. Tax Certificate No."; Code[20]) { diff --git a/Apps/W1/WithholdingTax/app/src/Purchase/Report/WHTCertificateCreditabletax.Report.al b/Apps/W1/WithholdingTax/app/src/Purchase/Report/WHTCertificateCreditabletax.Report.al index 364fa703bc..5df138f266 100644 --- a/Apps/W1/WithholdingTax/app/src/Purchase/Report/WHTCertificateCreditabletax.Report.al +++ b/Apps/W1/WithholdingTax/app/src/Purchase/Report/WHTCertificateCreditabletax.Report.al @@ -207,7 +207,11 @@ report 6786 "WHT Certificate Creditable tax" SecondMonth := 0; ThirdMonth := 0; - Vend.Get("Bill-to/Pay-to No."); + if "Actual Vendor No." <> '' then + Vend.Get("Actual Vendor No.") + else + Vend.Get("Bill-to/Pay-to No."); + VendName := Vend.Name; VendTIN := Vend."VAT Registration No."; VendAddress := Vend.Address; diff --git a/Apps/W1/WithholdingTax/app/src/Purchase/Report/WithholdingTaxCertificate.Report.al b/Apps/W1/WithholdingTax/app/src/Purchase/Report/WithholdingTaxCertificate.Report.al index fa3bd62e60..76a59614dd 100644 --- a/Apps/W1/WithholdingTax/app/src/Purchase/Report/WithholdingTaxCertificate.Report.al +++ b/Apps/W1/WithholdingTax/app/src/Purchase/Report/WithholdingTaxCertificate.Report.al @@ -213,10 +213,14 @@ report 6790 "Withholding Tax Certificate" trigger OnAfterGetRecord() begin - if "Bill-to/Pay-to No." <> '' then begin - Vendor.Get("Bill-to/Pay-to No."); - PrintPayToVendor := false; - end; + if "Actual Vendor No." <> '' then + if "Actual Vendor No." <> "Bill-to/Pay-to No." then begin + Vendor.Get("Actual Vendor No."); + PrintPayToVendor := true; + end else begin + Vendor.Get("Bill-to/Pay-to No."); + PrintPayToVendor := false; + end; if "Transaction Type" = "Transaction Type"::Purchase then PayToVendor.Get("Bill-to/Pay-to No.") @@ -357,7 +361,8 @@ report 6790 "Withholding Tax Certificate" trigger OnPreReport() begin if ("WHT Entry".GetFilter("Original Document No.") = '') or - ("WHT Entry".GetFilter("Bill-to/Pay-to No.") = '') + (("WHT Entry".GetFilter("Bill-to/Pay-to No.") = '') and + ("WHT Entry".GetFilter("Actual Vendor No.") = '')) then Error(BillToVendorLbl); end; diff --git a/Apps/W1/WithholdingTax/app/src/Purchase/Transaction/TempWithholdingTaxEntry.Table.al b/Apps/W1/WithholdingTax/app/src/Purchase/Transaction/TempWithholdingTaxEntry.Table.al index a1190db6fc..d7fbcdb562 100644 --- a/Apps/W1/WithholdingTax/app/src/Purchase/Transaction/TempWithholdingTaxEntry.Table.al +++ b/Apps/W1/WithholdingTax/app/src/Purchase/Transaction/TempWithholdingTaxEntry.Table.al @@ -300,13 +300,8 @@ table 6790 "Temp Withholding Tax Entry" } field(44; "Actual Vendor No."; Code[20]) { - Caption = 'Actual Vendor No.'; + Caption = 'Withholding Actual Vendor No.'; DataClassification = CustomerContent; -#if not CLEAN29 - ObsoleteState = Pending; - ObsoleteTag = '29.0'; - ObsoleteReason = 'This field has been removed and is no longer required.'; -#endif } field(45; "Wthldg. Tax Certificate No."; Code[20]) { diff --git a/Apps/W1/WithholdingTax/app/src/Purchase/Transaction/WithholdingGenJnlLineExt.TableExt.al b/Apps/W1/WithholdingTax/app/src/Purchase/Transaction/WithholdingGenJnlLineExt.TableExt.al index 3ab1c376e6..b5b24dda31 100644 --- a/Apps/W1/WithholdingTax/app/src/Purchase/Transaction/WithholdingGenJnlLineExt.TableExt.al +++ b/Apps/W1/WithholdingTax/app/src/Purchase/Transaction/WithholdingGenJnlLineExt.TableExt.al @@ -6,9 +6,7 @@ namespace Microsoft.WithholdingTax; using Microsoft.Finance.GeneralLedger.Journal; using Microsoft.Finance.GeneralLedger.Setup; -#if not CLEAN29 using Microsoft.Purchases.Vendor; -#endif tableextension 6793 "Withholding Gen. Jnl. Line Ext" extends "Gen. Journal Line" { @@ -155,16 +153,9 @@ tableextension 6793 "Withholding Gen. Jnl. Line Ext" extends "Gen. Journal Line" } field(6803; "WHT Actual Vendor No."; Code[20]) { - Caption = 'Actual Vendor No.'; -#if not CLEAN29 + Caption = 'Withholding Actual Vendor No.'; TableRelation = Vendor; -#endif DataClassification = CustomerContent; -#if not CLEAN29 - ObsoleteState = Pending; - ObsoleteTag = '29.0'; - ObsoleteReason = 'This field has been removed and is no longer required.'; -#endif } } diff --git a/Apps/W1/WithholdingTax/app/src/Purchase/Transaction/WithholdingPostedPurchInv.PageExt.al b/Apps/W1/WithholdingTax/app/src/Purchase/Transaction/WithholdingPostedPurchInv.PageExt.al new file mode 100644 index 0000000000..49150147c9 --- /dev/null +++ b/Apps/W1/WithholdingTax/app/src/Purchase/Transaction/WithholdingPostedPurchInv.PageExt.al @@ -0,0 +1,24 @@ +// ------------------------------------------------------------------------------------------------ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// ------------------------------------------------------------------------------------------------ +namespace Microsoft.WithholdingTax; + +using Microsoft.Purchases.History; + +pageextension 6798 "Withholding Posted Purch Inv" extends "Posted Purchase Invoice" +{ + layout + { + addlast("Shipping and Payment") + { + field("WHT Actual Vendor No."; Rec."WHT Actual Vendor No.") + { + ApplicationArea = Basic, Suite; + Editable = false; + ToolTip = 'Specifies the number of the Withholding Actual Vendor who delivers the products.'; + Importance = Additional; + } + } + } +} \ No newline at end of file diff --git a/Apps/W1/WithholdingTax/app/src/Purchase/Transaction/WithholdingPurchHeaderExt.TableExt.al b/Apps/W1/WithholdingTax/app/src/Purchase/Transaction/WithholdingPurchHeaderExt.TableExt.al index a4743b3a1a..64f9f2e7da 100644 --- a/Apps/W1/WithholdingTax/app/src/Purchase/Transaction/WithholdingPurchHeaderExt.TableExt.al +++ b/Apps/W1/WithholdingTax/app/src/Purchase/Transaction/WithholdingPurchHeaderExt.TableExt.al @@ -5,9 +5,7 @@ namespace Microsoft.WithholdingTax; using Microsoft.Purchases.Document; -#if not CLEAN29 using Microsoft.Purchases.Vendor; -#endif tableextension 6788 "Withholding Purch. Header Ext" extends "Purchase Header" { @@ -29,16 +27,9 @@ tableextension 6788 "Withholding Purch. Header Ext" extends "Purchase Header" } field(6793; "WHT Actual Vendor No."; Code[20]) { - Caption = 'Actual Vendor No.'; -#if not CLEAN29 + Caption = 'Withholding Actual Vendor No.'; TableRelation = Vendor; -#endif DataClassification = CustomerContent; -#if not CLEAN29 - ObsoleteState = Pending; - ObsoleteTag = '29.0'; - ObsoleteReason = 'This field has been removed and is no longer required.'; -#endif } } } \ No newline at end of file diff --git a/Apps/W1/WithholdingTax/app/src/Purchase/Transaction/WithholdingPurchaseInvoice.PageExt.al b/Apps/W1/WithholdingTax/app/src/Purchase/Transaction/WithholdingPurchaseInvoice.PageExt.al new file mode 100644 index 0000000000..41303bd78d --- /dev/null +++ b/Apps/W1/WithholdingTax/app/src/Purchase/Transaction/WithholdingPurchaseInvoice.PageExt.al @@ -0,0 +1,23 @@ +// ------------------------------------------------------------------------------------------------ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// ------------------------------------------------------------------------------------------------ +namespace Microsoft.WithholdingTax; + +using Microsoft.Purchases.Document; + +pageextension 6797 "Withholding Purchase Invoice" extends "Purchase Invoice" +{ + layout + { + addlast("Shipping and Payment") + { + field("WHT Actual Vendor No."; Rec."WHT Actual Vendor No.") + { + ApplicationArea = Basic, Suite; + ToolTip = 'Specifies the number of the Withholding Actual Vendor who delivers the products.'; + Importance = Additional; + } + } + } +} \ No newline at end of file diff --git a/Apps/W1/WithholdingTax/app/src/Purchase/Transaction/WithholdingPurchaseOrder.PageExt.al b/Apps/W1/WithholdingTax/app/src/Purchase/Transaction/WithholdingPurchaseOrder.PageExt.al new file mode 100644 index 0000000000..c1a13d3951 --- /dev/null +++ b/Apps/W1/WithholdingTax/app/src/Purchase/Transaction/WithholdingPurchaseOrder.PageExt.al @@ -0,0 +1,23 @@ +// ------------------------------------------------------------------------------------------------ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// ------------------------------------------------------------------------------------------------ +namespace Microsoft.WithholdingTax; + +using Microsoft.Purchases.Document; + +pageextension 6796 "Withholding Purchase Order" extends "Purchase Order" +{ + layout + { + addlast("Shipping and Payment") + { + field("WHT Actual Vendor No."; Rec."WHT Actual Vendor No.") + { + ApplicationArea = Basic, Suite; + ToolTip = 'Specifies the number of the Withholding Actual Vendor who delivers the products.'; + Importance = Additional; + } + } + } +} \ No newline at end of file diff --git a/Apps/W1/WithholdingTax/app/src/Purchase/Transaction/WithholdingTaxMgmt.Codeunit.al b/Apps/W1/WithholdingTax/app/src/Purchase/Transaction/WithholdingTaxMgmt.Codeunit.al index de9ba6725f..1b8e048828 100644 --- a/Apps/W1/WithholdingTax/app/src/Purchase/Transaction/WithholdingTaxMgmt.Codeunit.al +++ b/Apps/W1/WithholdingTax/app/src/Purchase/Transaction/WithholdingTaxMgmt.Codeunit.al @@ -56,6 +56,7 @@ codeunit 6785 "Withholding Tax Mgmt." CountryRegionCode: Code[10]; GenBusPostGrp: Code[20]; GenProdPostGrp: Code[20]; + ActualVendorNo: Code[20]; OnesText: array[20] of Text[30]; TensText: array[10] of Text[30]; ExponentText: array[5] of Text[30]; @@ -445,6 +446,7 @@ codeunit 6785 "Withholding Tax Mgmt." GenBusPostGrp := PurchCrMemoLine."Gen. Bus. Posting Group"; GenProdPostGrp := PurchCrMemoLine."Gen. Prod. Posting Group"; TransType := TransType::Purchase; + ActualVendorNo := PurchCreditHeader."WHT Actual Vendor No."; ExtDocNo := PurchCreditHeader."Vendor Cr. Memo No."; CountryRegionCode := PurchCreditHeader."Pay-to Country/Region Code"; PostingDate := PurchCreditHeader."Posting Date"; @@ -534,6 +536,7 @@ codeunit 6785 "Withholding Tax Mgmt." PayToVendCustNo := GenJnlLine."Account No."; BuyFromAccType := BuyFromAccType::Vendor; BuyFromVendCustNo := GenJnlLine."Account No."; + ActualVendorNo := GenJnlLine."WHT Actual Vendor No."; ApplyDocType := GenJnlLine."Applies-to Doc. Type"; ApplyDocNo := GenJnlLine."Applies-to Doc. No."; "Applies-toID" := GenJnlLine."Applies-to ID"; @@ -2187,6 +2190,7 @@ codeunit 6785 "Withholding Tax Mgmt." PayToAccType := PayToAccType::Vendor; PayToVendCustNo := PurchInvHeader."Pay-to Vendor No."; BuyFromAccType := BuyFromAccType::Vendor; + ActualVendorNo := PurchInvHeader."WHT Actual Vendor No."; GenBusPostGrp := PurchLine."Gen. Bus. Posting Group"; GenProdPostGrp := PurchLine."Gen. Prod. Posting Group"; TransType := TransType::Purchase; @@ -2262,6 +2266,7 @@ codeunit 6785 "Withholding Tax Mgmt." PayToAccType := PayToAccType::Vendor; PayToVendCustNo := PurchHeader."Pay-to Vendor No."; BuyFromAccType := BuyFromAccType::Vendor; + ActualVendorNo := PurchHeader."WHT Actual Vendor No."; GenBusPostGrp := PurchLine."Gen. Bus. Posting Group"; GenProdPostGrp := PurchLine."Gen. Prod. Posting Group"; TransType := TransType::Purchase; @@ -2342,6 +2347,7 @@ codeunit 6785 "Withholding Tax Mgmt." else WithholdingTaxEntry."Transaction Type" := WithholdingTaxEntry."Transaction Type"::Sale; + WithholdingTaxEntry."Actual Vendor No." := ActualVendorNo; WithholdingTaxEntry."Source Code" := SourceCode; WithholdingTaxEntry."Bill-to/Pay-to No." := PayToVendCustNo; WithholdingTaxEntry."User ID" := UserId; @@ -3599,6 +3605,7 @@ codeunit 6785 "Withholding Tax Mgmt." VendorArray: array[1000] of Code[20]; DocumentArray: array[1000] of Code[20]; WHTSlipNo: Code[20]; + ActualVendorExists: Boolean; begin x := 0; GLRegFilter := GLReg.GetFilters(); @@ -3629,7 +3636,12 @@ codeunit 6785 "Withholding Tax Mgmt." x := x + 1; - VendorArray[x] := WithholdingTaxEntry."Bill-to/Pay-to No."; + if WithholdingTaxEntry."Actual Vendor No." <> '' then begin + VendorArray[x] := WithholdingTaxEntry."Actual Vendor No."; + ActualVendorExists := true; + end else + VendorArray[x] := WithholdingTaxEntry."Bill-to/Pay-to No."; + DocumentArray[x] := WithholdingTaxEntry."Original Document No."; until WithholdingTaxEntry.Next() = 0; @@ -3666,7 +3678,10 @@ codeunit 6785 "Withholding Tax Mgmt." WithholdingTaxEntry.Reset(); WithholdingTaxEntry.SetCurrentKey("Bill-to/Pay-to No.", "Original Document No.", "Withholding Tax Revenue Type"); - WithholdingTaxEntry.SetRange("Bill-to/Pay-to No.", VendorArray[PrintSlips]); + if ActualVendorExists then + WithholdingTaxEntry.SetRange("Actual Vendor No.", VendorArray[PrintSlips]) + else + WithholdingTaxEntry.SetRange("Bill-to/Pay-to No.", VendorArray[PrintSlips]); WithholdingTaxEntry.SetRange("Original Document No.", DocumentArray[PrintSlips]); if WithholdingTaxEntry.FindSet() then repeat @@ -3686,7 +3701,10 @@ codeunit 6785 "Withholding Tax Mgmt." WithholdingTaxEntry.Reset(); WithholdingTaxEntry.SetCurrentKey("Bill-to/Pay-to No.", "Original Document No.", "Withholding Tax Revenue Type"); - WithholdingTaxEntry.SetRange("Bill-to/Pay-to No.", VendorArray[PrintSlips]); + if ActualVendorExists then + WithholdingTaxEntry.SetRange("Actual Vendor No.", VendorArray[PrintSlips]) + else + WithholdingTaxEntry.SetRange("Bill-to/Pay-to No.", VendorArray[PrintSlips]); WithholdingTaxEntry.SetRange("Original Document No.", DocumentArray[PrintSlips]); WithholdingTaxEntry.SetRange("Wthldg. Tax Certificate No.", WHTSlipNo); if WithholdingTaxEntry.FindSet() then @@ -4092,6 +4110,7 @@ codeunit 6785 "Withholding Tax Mgmt." WithholdingTaxEntry2."Applies-to Entry No." := WithholdingTaxEntry."Entry No."; WithholdingTaxEntry2."User ID" := UserId; WithholdingTaxEntry2."External Document No." := GenJnlLine."External Document No."; + WithholdingTaxEntry2."Actual Vendor No." := GenJnlLine."WHT Actual Vendor No."; WithholdingTaxEntry2."Original Document No." := GenJnlLine."Document No."; WithholdingTaxEntry2."Source Code" := GenJnlLine."Source Code"; WithholdingTaxEntry2."Transaction No." := TransactionNo; @@ -4873,6 +4892,7 @@ codeunit 6785 "Withholding Tax Mgmt." WithholdingTaxEntry2."Applies-to Entry No." := WithholdingTaxEntry."Entry No."; WithholdingTaxEntry2."User ID" := UserId; WithholdingTaxEntry2."External Document No." := GenJnlLine."External Document No."; + WithholdingTaxEntry2."Actual Vendor No." := GenJnlLine."WHT Actual Vendor No."; WithholdingTaxEntry2."Original Document No." := GenJnlLine."Document No."; WithholdingTaxEntry2."Source Code" := GenJnlLine."Source Code"; WithholdingTaxEntry2."Transaction No." := TransactionNo; diff --git a/Build/Packages.json b/Build/Packages.json index 48eb6f8f89..9b235aeb4f 100644 --- a/Build/Packages.json +++ b/Build/Packages.json @@ -4,7 +4,7 @@ "Source": "NuGet.org" }, "AppBaselines-BCArtifacts": { - "Version": "28.0.46628", + "Version": "28.1.47968", "Source": "BCArtifacts", "_comment": "Used to fetch app baselines from BC artifacts" }