From 1994e13ae0cdecf5ac3004caf07c3ae2d3693411 Mon Sep 17 00:00:00 2001 From: aholstrup1 Date: Fri, 6 Sep 2024 12:27:07 +0200 Subject: [PATCH] Squashing --- .github/AL-Go-Settings.json | 4 +- .github/workflows/CICD.yaml | 139 +- .../DeployReferenceDocumentation.yaml | 41 +- .../workflows/PullPowerPlatformChanges.yaml | 111 + .github/workflows/PullRequestHandler.yaml | 41 +- .../workflows/PushPowerPlatformChanges.yaml | 100 + .github/workflows/Troubleshooting.yaml | 6 +- .../workflows/UpdateGitHubGoSystemFiles.yaml | 24 +- .github/workflows/_BuildALGoProject.yaml | 68 +- .../_BuildPowerPlatformSolution.yaml | 96 + .../SwissQRBillCreateVendBank.Page.al | 4 +- .../CustLedgerEntryHandlerCZZ.Codeunit.al | 21 + .../InstallApplicationCZZ.Codeunit.al | 6 + .../MatchBankPaymentHandlerCZZ.Codeunit.al | 6 +- .../Codeunits/NavigateHandlerCZZ.Codeunit.al | 6 +- .../Codeunits/NonDeductibleVATCZZ.Codeunit.al | 81 + .../PurchAdvLetterManagementCZZ.Codeunit.al | 196 +- .../PurchAdvLetterPostCZZ.Codeunit.al | 179 +- .../PurchPostAdvanceLetterCZZ.Codeunit.al | 16 +- .../Codeunits/PurchPostHandlerCZZ.Codeunit.al | 11 + .../ReportSelectionHandlerCZZ.Codeunit.al | 45 +- .../SalesAdvLetterManagementCZZ.Codeunit.al | 12 + .../SalesAdvLetterPostCZZ.Codeunit.al | 30 +- .../Codeunits/SalesPostHandlerCZZ.Codeunit.al | 4 + .../UpgradeApplicationCZZ.Codeunit.al | 4 +- .../UpgradeTagDefinitionsCZZ.Codeunit.al | 6 + .../VendorLedgEntryHandlerCZZ.Codeunit.al | 21 + .../Src/PageExtensions/JobCardCZZ.PageExt.al | 65 + .../PageExtensions/JobTaskCardCZZ.PageExt.al | 49 + .../JobTaskLinesSubformCZZ.PageExt.al | 40 + .../PurchasesPayablesSetupCZZ.PageExt.al | 11 + .../SalesReceivablesSetupCZZ.PageExt.al | 12 +- .../VATPostingSetupCZZ.PageExt.al | 6 +- .../VATPostingSetupCardCZZ.PageExt.al | 4 + .../Src/PageExtensions/VATSetupCZZ.PageExt.al | 13 + .../Pages/AdvanceLetterApplEditCZZ.Page.al | 19 +- .../Pages/AdvanceLetterApplicationCZZ.Page.al | 10 + .../Pages/AdvanceLetterTemplatesCZZ.Page.al | 5 +- .../Src/Pages/AdvanceUsageFactBoxCZZ.Page.al | 84 +- .../Pages/PurchAdvLetterEntriesCZZ.Page.al | 30 +- .../Src/Pages/SalesAdvanceLetterCZZ.Page.al | 10 + .../Src/Pages/SalesAdvanceLettersCZZ.Page.al | 10 + .../VATCoeffCorrectionCZZ.ReportExt.al | 63 + .../Reports/CreateSalesAdvLetterCZZ.Report.al | 332 ++- .../Src/Reports/PurchAdvanceLettersVAT.rdl | 437 ++- .../PurchAdvanceLettersVATCZZ.Report.al | 21 +- .../SalesAdvanceLettersVATCZZ.Report.al | 3 +- .../Src/TableExtensions/JobCZZ.TableExt.al | 32 + .../JobPlanningLineCZZ.TableExt.al | 136 + .../TableExtensions/JobTaskCZZ.TableExt.al | 68 + .../VATPostingSetupCZZ.TableExt.al | 95 +- .../TableExtensions/VATSetupCZZ.TableExt.al | 20 + .../AdvanceLetterApplicationCZZ.Table.al | 89 +- .../Tables/AdvanceLetterTemplateCZZ.Table.al | 9 +- .../Tables/AdvancePostingBufferCZZ.Table.al | 47 + .../Tables/PurchAdvLetterEntryCZZ.Table.al | 32 + .../Tables/PurchAdvLetterHeaderCZZ.Table.al | 2 + .../Tables/SalesAdvLetterEntryCZZ.Table.al | 13 + .../Tables/SalesAdvLetterHeaderCZZ.Table.al | 55 +- .../Src/Tables/SalesAdvLetterLineCZZ.Table.al | 16 + .../AdvancePaymentsLocalization/app/app.json | 7 + .../Src/LibrarySalesAdvancesCZZ.Codeunit.al | 16 + .../Src/SalesAdvancePaymentsCZZ.Codeunit.al | 169 +- .../GLEntryPostApplicationCZA.Codeunit.al | 22 +- .../app/Src/Pages/ApplyGLEntriesCZA.Page.al | 22 +- .../Codeunits/NavigateHandlerCZB.Codeunit.al | 26 +- .../app/Src/Tables/SearchRuleCZB.Table.al | 23 +- .../app/Src/Tables/SearchRuleLineCZB.Table.al | 36 + .../InstallApplicationCZP.Codeunit.al | 2 - .../Codeunits/NavigateHandlerCZP.Codeunit.al | 14 +- .../app/Src/Tables/CashDeskEventCZP.Table.al | 4 +- .../Src/Tables/CashDocumentLineCZP.Table.al | 7 +- .../Codeunits/NavigateHandlerCZC.Codeunit.al | 14 +- .../Src/Pages/CompensationProposalCZC.Page.al | 2 + .../app/Codeunits/CommonModuleCZ.Codeunit.al | 23 + .../ContosoDemoDataSetupCZ.Codeunit.al | 11 + .../Codeunits/CreateCZGLAccounts.Codeunit.al | 296 ++ .../Codeunits/FixedAssetModuleCZ.Codeunit.al | 1788 ++++++++++++ .../app/ExtensionLogo.png | Bin 0 -> 5446 bytes .../ContosoCoffeeDemoDatasetCZ/app/app.json | 38 + .../CorrectionsPostingMgtCZL.Codeunit.al | 9 +- .../GLEntryasCorrectionCZL.Codeunit.al | 55 + .../GenJnlPostLineHandlerCZL.Codeunit.al | 47 +- .../GenJournalLineHandlerCZL.Codeunit.al | 2 + .../Codeunits/NavigateHandlerCZL.Codeunit.al | 14 +- .../Codeunits/NonDeductibleVATCZL.Codeunit.al | 61 + .../NonDeductibleVATHandlerCZL.Codeunit.al | 6 +- .../PurchaseHeaderHandlerCZL.Codeunit.al | 1 + .../ReconciliationHandlerCZL.Codeunit.al | 12 + .../SalesHeaderHandlerCZL.Codeunit.al | 1 + .../UpgradeApplicationCZL.Codeunit.al | 73 + .../UpgradeTagDefinitionsCZL.Codeunit.al | 18 + .../Codeunits/VATCtrlReportMgtCZL.Codeunit.al | 6 + .../Codeunits/VATDateHandlerCZL.Codeunit.al | 7 +- .../GLEntriesPreviewCZL.PageExt.al | 8 - .../GeneralLedgerSetupCZL.PageExt.al | 4 +- .../PostedPurchCreditMemoCZL.PageExt.al | 24 +- .../PostedPurchaseInvoiceCZL.PageExt.al | 24 +- .../PostedSalesCreditMemoCZL.PageExt.al | 26 + .../PostedSalesInvoiceCZL.PageExt.al | 28 +- .../PurchaseCreditMemoCZL.PageExt.al | 27 +- .../PurchaseInvoiceCZL.PageExt.al | 27 +- .../PurchaseOrderCZL.PageExt.al | 27 +- .../PurchaseReturnOrderCZL.PageExt.al | 24 +- .../SalesCreditMemoCZL.PageExt.al | 29 +- .../PageExtensions/SalesInvoiceCZL.PageExt.al | 29 +- .../PageExtensions/SalesOrderCZL.PageExt.al | 29 +- .../SalesReturnOrderCZL.PageExt.al | 29 +- .../PageExtensions/VATEntriesCZL.PageExt.al | 4 +- .../VATEntriesPreviewCZL.PageExt.al | 4 +- .../VATPostingSetupCardCZL.PageExt.al | 4 +- .../Src/PageExtensions/VATSetupCZL.PageExt.al | 24 +- .../Pages/AccScheduleFileMappingCZL.Page.al | 1 - .../Pages/NonDeductibleVATSetupCZL.Page.al | 8 +- .../app/Src/Pages/VATPeriodsCZL.Page.al | 4 +- .../app/Src/Reports/AdjustExchangeRates.rdl | 2534 +++++++++++++++-- .../Reports/AdjustExchangeRatesCZL.Report.al | 1014 +++++-- .../Reports/InventoryDocumentCZL.Report.al | 3 +- .../OpenCustEntriestoDateCZL.Report.al | 44 +- .../OpenVendEntriestoDateCZL.Report.al | 45 +- .../PostedInventoryReceiptCZL.Report.al | 3 +- .../PostedInventoryShipmentCZL.Report.al | 3 +- .../Reports/VATCoeffCorrectionCZL.Report.al | 10 +- .../EmployeeLedgerEntryCZL.TableExt.al | 23 + .../GenJournalLineCZL.TableExt.al | 8 + .../GeneralLedgerSetupCZL.TableExt.al | 11 + .../PurchCrMemoHdrCZL.TableExt.al | 7 + .../PurchInvHeaderCZL.TableExt.al | 7 + .../PurchaseHeaderCZL.TableExt.al | 100 + .../SalesCrMemoHeaderCZL.TableExt.al | 7 + .../SalesHeaderCZL.TableExt.al | 98 +- .../SalesInvoiceHeaderCZL.TableExt.al | 7 + .../VATPostingSetupCZL.TableExt.al | 12 + .../TableExtensions/VATSetupCZL.TableExt.al | 30 + .../Tables/NonDeductibleVATSetupCZL.Table.al | 2 +- .../test/Src/ForeignCurrenciesCZL.Codeunit.al | 61 +- .../CalcNormalDeprHandlerCZF.Codeunit.al | 12 +- .../FADeprecBookHandlerCZF.Codeunit.al | 9 + .../Reports/FixedAssetBookValue1CZF.Report.al | 7 +- .../src/PostingRestrictionsTests.Codeunit.al | 20 + .../app/src/DigitalVoucherDKImpl.Codeunit.al | 163 +- .../FIKMatchGenJournalLines.Codeunit.al | 6 +- .../OIOUBLServiceHeaderArchive.TableExt.al | 36 + .../OIOUBLServiceLineArchive.TableExt.al | 16 + .../OIOUBLServiceOrderArchive.PageExt.al | 41 + .../app/src/Setup/MTDReportSetup.TableExt.al | 4 + .../Codeunit/GSTStatsManagement.Codeunit.al | 10 + .../src/Codeunit/GSTNavigate.codeunit.al | 10 +- .../Codeunit/GSTPreviewHandler.Codeunit.al | 10 +- .../src/Codeunit/GSTStatistics.Codeunit.al | 8 + .../GSTTaxConfiguration.Codeunit.al | 2 + .../GSTUseCaseLabels.Codeunit.al | 8 + .../GSTJournalLineSubscribers.Codeunit.al | 4 +- .../GSTPurchCustomDutyAvailment.Codeunit.al | 2 +- .../GSTPurchaseNonAvailment.Codeunit.al | 2 +- .../GSTCancCorrPurchInvCredit.Codeunit.al | 20 +- .../GSTFiledServiceContract.PageExt.al | 25 + .../GSTFiledServContrHeader.TableExt.al | 31 + .../GSTTransferOrderShipment.Codeunit.al | 247 +- .../SubcontractingPostBatch.Codeunit.al | 19 +- .../SubcontractingSubscribers.Codeunit.al | 17 + .../app/Translations/India GST.en-GB.xlf | 12 + .../app/Translations/India GST.en-US.xlf | 12 + .../src/GSTStockTransferTests.Codeunit.al | 63 +- .../test/GSTBase/src/LibraryGST.Codeunit.al | 38 + .../GSTSales/src/GSTSalesTests.Codeunit.al | 95 + .../app/src/enum/GSTR1CDNRPerQuery.Query.al | 3 + .../app/src/enum/GSTR1CDNRQuery.Query.al | 4 + .../app/src/report/GSTR1FileFormat.Report.al | 3 +- .../src/codeunit/TCSPostPreview.codeunit.al | 19 +- .../codeunit/TCSSalesSubscribers.Codeunit.al | 25 + .../TDSTaxConfiguration.Codeunit.al | 4 +- .../codeunit/TDSNavigateHandler.Codeunit.al | 18 +- .../ProvisionalEntryHandler.Codeunit.al | 17 +- .../app/Translations/India TDS.en-GB.xlf | 4 +- .../app/Translations/India TDS.en-US.xlf | 4 +- .../app/Translations/India Tax Base.en-US.xlf | 2 +- .../codeunit/CalculateStatistics.Codeunit.al | 9 +- .../demo data/EDocumentModuleIT.Codeunit.al | 41 + .../EDocumentIT/demo data/ExtensionLogo.png | Bin 0 -> 5201 bytes Apps/IT/EDocumentIT/demo data/app.json | 43 + .../app/src/MSYodleeBankServiceSetup.Table.al | 2 + .../app/src/MSYodleeServiceMgt.Codeunit.al | 4 +- .../app/src/Setup/ElecVATSetup.Table.al | 5 +- .../src/Codeunits/InstallSECore.codeunit.al | 2 + .../HybridGPUSObjects.PermissionSet.al | 1 + Apps/US/HybridGP_US/app/app.json | 8 +- .../Codeunits/GPCloudMigrationUS.Codeunit.al | 55 + .../src/Codeunits/GPIRSFormData.Codeunit.al | 279 ++ .../GPPopulateVendor1099Data.Codeunit.al | 76 +- Apps/US/HybridGP_US/test/app.json | 8 +- .../src/MigrationVendor1099Tests.Codeunit.al | 47 +- .../Document/IRS1099FormDocsImpl.Codeunit.al | 3 + .../IRS1099BaseAppSubscribers.Codeunit.al | 25 +- .../src/LibraryIRS1099Document.Codeunit.al | 17 +- .../test/src/IRS1099DocumentTests.Codeunit.al | 257 +- .../app/Tables/AMCBankingSetup.Table.al | 3 + .../app/src/pages/APIV2Attachments.Page.al | 33 +- .../APIV2/app/src/pages/APIV2AutUsers.Page.al | 4 + .../src/pages/APIV2CompanyInformation.Page.al | 22 + .../src/pages/APIV2JobQueueEntries.Page.al | 235 ++ .../src/pages/APIV2JobQueueLogEntries.Page.al | 96 + .../test/src/APIV2AttachmentsE2E.Codeunit.al | 65 +- .../test/src/APIV2CompanyInfoE2E.Codeunit.al | 86 +- .../src/APIV2DocumentAttachE2E.Codeunit.al | 65 +- .../src/APIV2JobQueueEntriesE2E.Codeunit.al | 202 ++ .../APIV2JobQueueLogEntriesE2E.Codeunit.al | 65 + .../AACodesPostingHelper.Codeunit.al | 6 +- .../app/src/BankAccRecAIProposal.Page.al | 2 +- .../app/src/BankAccRecAIProposalSub.Page.al | 9 +- .../src/BankAccReconciliationExt.PageExt.al | 78 +- .../app/src/BankRecAIMatchingImpl.Codeunit.al | 78 +- .../app/src/TransToGLAccAIProposal.Page.al | 5 +- .../src/codeunits/BankDepositPost.Codeunit.al | 4 +- .../codeunits/EntryApplicationMgt.Codeunit.al | 6 +- .../NavigateBankDepositExt.Codeunit.al | 20 +- .../app/src/reports/BankDeposit.Report.al | 2 - .../src/BankDepositPostingTests.Codeunit.al | 192 +- ...CPremiumPartnerSandboxCOHUB.Entitlement.al | 9 + .../ConnectivityAppDefinitions.Codeunit.al | 6 +- .../CreateJobItemJournal.Codeunit.al | 10 +- .../CreateJobItemJnlLines.Codeunit.al | 15 +- .../CreateMfgItemJournalSetup.Codeunit.al | 10 +- .../CreateMfgItemJnlLine.Codeunit.al | 55 +- .../CreateSvcItemJournal.Codeunit.al | 4 +- .../1.Setup Data/CreateSvcSetup.Codeunit.al | 16 +- .../CreateSvcItemJnlLines.Codeunit.al | 15 +- .../CreateWhseLocation.Codeunit.al | 8 + .../Contoso Helpers/ContosoItem.Codeunit.al | 9 + .../ContosoUtilities.Codeunit.al | 8 + .../ItemSubstitutionEntryExt.PageExt.al | 59 + .../app/CreateProductInfoPrompts.Codeunit.al | 62 + .../app/ExtensionLogo.png | Bin 0 -> 5446 bytes .../FunctionsImpl/MagicFunction.Codeunit.al | 44 + .../SuggestSubstitutionsFunction.Codeunit.al | 92 + .../ItemSubstSuggestion.Page.al | 219 ++ .../ItemSubstSuggestion.TableExt.al | 82 + .../ItemSubstSuggestionImpl.Codeunit.al | 154 + .../ItemSubstSuggestionSub.Page.al | 153 + .../app/Search/Search.Codeunit.al | 255 ++ .../app/Search/SearchAPIResponse.Table.al | 33 + .../app/Search/SearchConfidence.Enum.al | 23 + .../app/Search/SearchStyle.Enum.al | 23 + .../CreateProductInfoCapability.EnumExt.al | 15 + .../CreateProductInfoInstall.Codeunit.al | 20 + .../CreateProductInfoUpgrade.Codeunit.al | 36 + .../CreateProductInfoUtility.Codeunit.al | 80 + .../Utilities/NotificationManager.Codeunit.al | 33 + .../app/app.json | 41 + Apps/W1/DataSearch/App/DataSearch.page.al | 4 +- .../App/DataSearchDefaults.Codeunit.al | 24 +- .../App/DataSearchInTable.codeunit.al | 22 +- .../App/DataSearchSetupFieldList.Page.al | 42 +- .../DataSearch/test/TestDataSearch.Table.al | 26 + .../test/TestDataSearch.codeunit.al | 363 +-- .../test/TestDataSearchOnArchives.codeunit.al | 2 +- .../app/src/Pages/HistGenJournalLines.Page.al | 11 +- .../app/src/Pages/HistInventoryTrx.Page.al | 28 + .../src/Pages/HistPayablesDocument.Page.al | 28 + .../app/src/Pages/HistPurchaseRecv.Page.al | 28 + .../src/Pages/HistReceivablesDocument.Page.al | 28 + .../app/src/Pages/HistSalesTrx.Page.al | 28 + .../src/Tables/HistGenJournalLine.Table.al | 3 + .../EDocCoreObjects.PermissionSet.al | 1 + Apps/W1/EDocument/app/app.json | 4 +- .../EDocDataExchangeImpl.Codeunit.al | 92 +- .../e-Doc PEPPOL Cr. Memo Import.xml | 12 + .../e-Doc PEPPOL Invoice Import.xml | 12 + .../e-Doc PEPPOL Sales Cr. Memo Export.xml | 6 +- .../e-Doc PEPPOL Sales Invoice Export.xml | 6 +- ...-Doc PEPPOL Service Cr. Memo Export NO.xml | 6 +- .../e-Doc PEPPOL Service Cr. Memo Export.xml | 6 +- ...e-Doc PEPPOL Service Invoice Export NO.xml | 6 +- .../e-Doc PEPPOL Service Invoice Export.xml | 6 +- .../src/EDocDEDPEPPOLSubscribers.Codeunit.al | 56 +- .../app/src/Document/EDocument.Page.al | 4 +- .../app/src/Document/EDocument.Table.al | 10 + .../app/src/EDocumentInstall.Codeunit.al | 109 +- .../Extensions/EDocPurchaseOrder.PageExt.al | 4 +- .../EDocPurchaseOrderList.PageExt.al | 4 +- .../Format/EDocImportPEPPOLBIS30.Codeunit.al | 122 +- .../src/Format/EDocPEPPOLBIS30.Codeunit.al | 24 +- .../Helpers/EDocumentImportHelper.Codeunit.al | 18 + .../src/Log/EDocumentIntegrationLog.Table.al | 12 + .../src/Log/EDocumentIntegrationLogs.Page.al | 2 +- .../app/src/Log/EDocumentLog.Codeunit.al | 9 +- .../EDocAttachmentProcessor.Codeunit.al | 96 + .../app/src/Processing/EDocImport.Codeunit.al | 6 +- .../Copilot/EDocPOAOAIFunction.Codeunit.al | 7 + .../Copilot/EDocPOCopilotMatching.Codeunit.al | 58 +- .../Copilot/EDocPOCopilotProp.Page.al | 13 +- .../EDocLineMatching.Codeunit.al | 11 - .../EDocOrderLineMatching.Page.al | 11 +- .../src/Setup/EDocumentUpgrade.Codeunit.al | 48 + .../CreateEDocumentTransactions.Codeunit.al | 29 +- Apps/W1/EDocument/test/app.json | 120 +- .../test/src/Copilot/Dataset/accuacy.jsonl | 200 ++ .../src/Copilot/Dataset/accuacysmall.jsonl | 2 + .../Copilot/EDocCopilotPOAccuacy.Codeunit.al | 176 ++ .../EDocCopilotPORedTeaming.Codeunit.al | 119 + .../test/src/LibraryEDocument.Codeunit.al | 4 - .../test/src/Log/EDocLogTest.Codeunit.al | 2 +- .../test/src/Mock/EDocImplState.Codeunit.al | 17 +- .../src/Receive/EDocReceiveFiles.Codeunit.al | 15 + .../src/Receive/EDocReceiveTest.Codeunit.al | 202 ++ .../app/src/Microsoft365Connector.Codeunit.al | 25 +- .../app/src/Microsoft365EmailAccount.Page.al | 2 +- .../app/src/Microsoft365EmailWizard.Page.al | 2 +- .../app/src/EmailOAuthClient.Codeunit.al | 5 +- .../app/src/EmailOutlookAPIClient.Codeunit.al | 331 ++- .../src/EmailOutlookAPIClientv3.Interface.al | 55 + .../app/src/EmailOutlookAPIHelper.Codeunit.al | 274 +- .../DummySMTPAuthentication.Codeunit.al | 3 - .../OAuth2SMTPAuthentication.Codeunit.al | 18 +- .../test/src/SMTPAccountAuthTests.Codeunit.al | 4 +- .../EmailLoggingOAuthClient.Codeunit.al | 2 +- .../src/pages/EmailLoggingSetupWizard.Page.al | 2 + Apps/W1/EnforcedDigitalVouchers/app/app.json | 5 + .../DigitalVoucherEntrySetup.Page.al | 1 + .../DigVouchPstdServCrMemo.PageExt.al | 18 + .../DigVoucherPstdServInv.PageExt.al | 18 + .../DigVoucherPurchRetOrder.PageExt.al | 18 + .../DigVoucherServCrMemo.PageExt.al | 18 + .../DigVoucherServInvoice.PageExt.al | 18 + .../Extensions/DigVoucherServOrder.PageExt.al | 18 + .../DigitalVoucherPurchOrder.PageExt.al | 18 + .../DigitalVoucherImpl.Codeunit.al | 301 +- .../VoucherAttachOrNoteCheck.Codeunit.al | 2 +- .../VoucherAttachmentCheck.Codeunit.al | 15 +- .../test/src/DigitalVouchersTests.Codeunit.al | 742 ++++- .../FixedAsset/FixedAssetAnalysisExcel.xlsx | Bin 58858 -> 61216 bytes .../FixedAsset/FixedAssetDetailsExcel.xlsx | Bin 40885 -> 42423 bytes .../FixedAssetProjectedValueExcel.xlsx | Bin 36198 -> 39390 bytes .../ConsolidatedTrialBalanceExcel.xlsx | Bin 59205 -> 488219 bytes .../TrialBalanceBudgetExcel.xlsx | Bin 43174 -> 393029 bytes .../GeneralLedger/TrialBalanceExcel.xlsx | Bin 65675 -> 468103 bytes .../Purchase/AgedAccountsPayableExcel.xlsx | Bin 61462 -> 61472 bytes .../src/Customer/EXRCustomerTopList.Report.al | 11 +- .../EXRConsolidatedTrialBalance.Report.al | 100 +- .../EXRFixedAssetAnalysisExcel.Report.al | 18 +- .../EXRFixedAssetDetailsExcel.Report.al | 19 +- .../EXRFixedAssetProjected.Report.al | 441 ++- .../EXRTrialBalPrevYearExcel.Report.al | 1 + .../EXRTrialBalanceBudgetExcel.Report.al | 65 +- .../Financials/EXRTrialBalanceBuffer.Table.al | 3 + .../Financials/EXRTrialBalanceExcel.Report.al | 82 +- .../EXRTrialBalbyPeriodExcel.Report.al | 1 + .../src/Financials/TrialBalance.Codeunit.al | 176 +- .../EXRAccountantRoleCenter.PageExt.al | 32 + .../RoleCenters/EXRFinRoleCenter.PageExt.al | 32 + .../app/src/Vendor/EXRVendorTopList.Report.al | 11 +- Apps/W1/ExcelReports/test/ExtensionLogo.png | Bin 0 -> 5446 bytes Apps/W1/ExcelReports/test/app.json | 52 + .../src/FixedAssetExcelReports.Codeunit.al | 43 + .../src/TrialBalanceExcelReports.Codeunit.al | 411 +++ .../app/src/ExternalEventsCategory.EnumExt.al | 10 +- .../app/src/ExternalEventsHelper.Codeunit.al | 8 + .../src/JobQueueExternalEvents.Codeunit.al | 41 + .../app/ExtensionLogo.png | Bin 5446 -> 9374 bytes Apps/W1/FieldServiceIntegration/app/app.json | 4 +- .../FSIntTableSubscriber.Codeunit.al | 3 +- .../src/Codeunits/FSSetupDefaults.Codeunit.al | 15 +- .../app/src/Tables/FSConnectionSetup.Table.al | 2 +- .../test/ExtensionLogo.png | Bin 0 -> 5446 bytes Apps/W1/FieldServiceIntegration/test/app.json | 73 + .../test/src/FSIntegrationTest.Codeunit.al | 777 +++++ .../Permissions/HybridGPEdit.PermissionSet.al | 3 +- .../HybridGPObjects.PermissionSet.al | 3 +- .../Permissions/HybridGPRead.PermissionSet.al | 3 +- .../INTELLIGENTCLOUDHGP.PermissionSetExt.al | 3 +- .../d365basicHGP.permissionsetext.al | 3 +- .../d365basicisvHGP.permissionsetext.al | 3 +- .../d365teammemberHGP.permissionsetext.al | 3 +- .../Customers/GPCustomerMigrator.codeunit.al | 32 +- .../src/Migration/GPTables/GPIV00104.Table.al | 44 + .../GPPopulateCombinedTables.Codeunit.al | 7 +- .../src/Migration/History/GPPM10200.Table.al | 3 + .../src/Migration/History/GPPM30300.Table.al | 3 + .../app/src/Migration/Items/GPItem.table.al | 5 + .../Items/GPItemMigrator.codeunit.al | 101 +- .../Support/HelperFunctions.codeunit.al | 32 +- .../Vendors/GPVendorMigrator.codeunit.al | 28 +- .../codeunits/GPCloudMigration.codeunit.al | 1 + .../pages/GPCompanyAddSettingsList.Page.al | 6 + .../pages/GPCompanyMigrationSettings.Page.al | 12 +- .../pages/GPMigrationConfiguration.Page.al | 37 +- .../app/src/pages/GPUpgradeSettings.Page.al | 17 +- .../GPCompanyAdditionalSettings.table.al | 20 +- .../test/src/GPDataMigrationTests.codeunit.al | 19 + .../HybridGP/test/src/GPItemTests.codeunit.al | 319 ++- .../test/src/GPSettingsTests.codeunit.al | 16 +- .../codeunit/TaxPostingBufferMgmt.Codeunit.al | 17 + .../table/TransactionPostingBuffer.Table.al | 1 - .../TransferShptPostingHandler.Codeunit.al | 20 + .../app/src/pages/ImageAnalyzerWizard.Page.al | 3 +- .../IntrastatCoreObjects.PermissionSet.al | 1 + .../app/src/DefaultCtryCodeItemTrack.Enum.al | 17 + .../app/src/IntrRepLotNoInfo.TableExt.al | 21 + .../app/src/IntrRepLotNoInfoCard.PageExt.al | 40 + .../app/src/IntrRepLotNoInfoList.PageExt.al | 22 + .../app/src/IntrRepPackNoInfoCard.PageExt.al | 28 + .../app/src/IntrRepSerNoInfoCard.PageExt.al | 40 + .../app/src/IntrRepSerNoInfoList.PageExt.al | 22 + .../app/src/IntrRepSerialNoInfo.TableExt.al | 21 + .../app/src/IntrReportItemTrLines.PageExt.al | 42 + .../IntrastatReportItemTracking.Codeunit.al | 90 + .../app/src/IntrastatReportLine.Table.al | 114 +- .../src/IntrastatReportManagement.Codeunit.al | 48 +- .../src/IntrastatReportPurchHead.TableExt.al | 12 +- .../src/IntrastatReportSalesHead.TableExt.al | 12 +- .../src/IntrastatReportServHead.TableExt.al | 12 +- .../app/src/IntrastatReportSetup.Page.al | 7 +- .../app/src/IntrastatReportSetup.Table.al | 40 +- .../src/IntrastatReportSetupWizard.Page.al | 5 + .../test/src/IntrastatReportTest.Codeunit.al | 259 ++ .../test/src/LibraryIntrastat.Codeunit.al | 60 +- .../app/src/LPMachineLearningSetup.Table.al | 3 + .../MasterDataManagement.Codeunit.al | 4 +- .../src/pages/MasterDataSynchTables.Page.al | 19 +- .../src/AddUniversalPrintersWizard.Page.al | 6 +- .../src/UniversalPrintGraphHelper.Codeunit.al | 51 +- ...paypalpaymentsstandard.permissionsetext.al | 2 +- .../tables/MSPayPalStandardAccount.Table.al | 2 + .../src/Support/MSQBODataMigration.Page.al | 37 +- .../src/Support/MigrationQBConfig.Table.al | 11 + .../MigrationQBHelperFunctions.Codeunit.al | 53 +- .../test/src/MigrationQBOTests.Codeunit.al | 5 +- .../ReportLayouts/ReportLayouts.ruleset.json | 50 + Apps/W1/ReportLayouts/app/ExtensionLogo.png | Bin 0 -> 7091 bytes Apps/W1/ReportLayouts/app/app.json | 29 + Apps/W1/ReportLayouts/test/ExtensionLogo.png | Bin 0 -> 5095 bytes Apps/W1/ReportLayouts/test/app.json | 32 + Apps/W1/ReportLayouts/test/appsourcecop.json | 3 + .../src/pages/SalesForecastSetupCard.Page.al | 4 + .../FieldMapper/AttachmentMapping.Table.al | 84 + .../FieldMapper/AttachmentMappingPart.Page.al | 260 ++ .../FieldMapper/ColumnAction.Enum.al | 31 + .../Attachment/FieldMapper/ColumnType.Enum.al | 36 + .../FieldMapper/ItemInfoFromFile.Page.al | 358 +++ .../FieldMapper/MappingCache.Table.al | 33 + .../MappingCacheManagement.Codeunit.al | 72 + .../FileHandlers/CSVHandler.Codeunit.al | 170 ++ .../FileHandlers/FileHandler.Interface.al | 33 + .../FileHandlerFactory.Codeunit.al | 25 + .../FileHandlerResult.Codeunit.al | 221 ++ .../FileHandlers/FileHandlerType.Enum.al | 16 + .../SalesLineAISuggestionsSub.Page.al | 7 + .../SalesLineFromAttachment.Codeunit.al | 97 + .../SalesLineFromAttachment.Page.al | 312 ++ .../SalesInvoiceSubFormExt.PageExt.al | 8 - .../SalesOrderSubFormExt.PageExt.al | 58 +- .../SalesQuoteSubFormExt.PageExt.al | 8 - .../app/SLSPrompts.Codeunit.al | 76 +- .../BlanketSalesOrderLookup.Codeunit.al | 4 +- .../SalesInvoiceLookup.Codeunit.al | 4 +- .../SalesOrderLookup.Codeunit.al | 4 +- .../SalesQuoteLookup.Codeunit.al | 4 +- .../SalesShipmentLookup.Codeunit.al | 4 +- .../DocumentLookupFunction.Codeunit.al | 2 +- .../LookupItemsFromCsvFunction.Codeunit.al | 113 + .../FunctionsImpl/MagicFunction.Codeunit.al | 2 +- .../SearchItemsFunction.Codeunit.al | 2 +- .../SearchItemsWithFiltersFunc.Codeunit.al | 120 +- .../app/SalesLineAISuggestions.Page.al | 36 +- .../app/SalesLineAISuggestions.Table.al | 4 + .../app/SalesLinesSuggestionsImpl.Codeunit.al | 140 +- .../app/Search/Search.Codeunit.al | 38 +- .../PrepareSalesLineForCopying.Codeunit.al | 1 + .../Utilities/SalesLineUtility.Codeunit.al | 13 +- Apps/W1/SalesLinesSuggestions/app/app.json | 2 +- .../Datasets/DocLookupPromptTest.jsonl | 94 + .../test/AI Tests/Datasets/EmptyDataset.jsonl | 1 + .../AI Tests/Datasets/ItemEntitySearch.jsonl | 174 ++ .../Datasets/MagicFunctionPromptTest.jsonl | 13 + .../Datasets/SearchItemWithFilters.jsonl | 68 + .../Datasets/SearchItemWithinDocument.jsonl | 16 + .../SearchSplitItemPromptTestDataset.jsonl | 66 + .../AI Tests/ItemEntitySearch.Codeunit.al | 119 + .../MagicFunctionPromptTest.Codeunit.al | 105 + .../test/AI Tests/SLSPromptTest.Codeunit.al | 263 ++ .../AttachmentDataSizeTest.Codeunit.al | 76 + .../Accuracy_ExtractInfoFromCsvPrompt.jsonl | 400 +++ .../Dataset/ExtractInfoFromCsvPrompt.jsonl | 9 + .../ExtractInfoFromFaultyCsvPrompt.jsonl | 2 + .../Dataset/LoadMappingFromCsv.jsonl | 9 + .../Dataset/LoadSuggestionsFromCsv.jsonl | 9 + .../MagicFunctionAttachmentPrompt.jsonl | 23 + .../ExtractInfoAccuracy.Codeunit.al | 56 + .../ExtractInfoFromCsvPrompt.Codeunit.al | 203 ++ .../LoadMappingsFromCsv.Codeunit.al | 118 + .../LoadSuggestionsFromCsv.Codeunit.al | 91 + .../MagicFunctionAttmtPrompt.Codeunit.al | 37 + .../RedTXPIATests.Codeunit.al | 129 + .../RedTeamingTests.Codeunit.al | 68 + .../SaveFileMappingTest.Codeunit.al | 146 + .../test/DocumentLookupPromptTest.Codeunit.al | 1236 -------- .../ItemSearchInDocPromptTest.Codeunit.al | 264 -- .../test/MagicFunctionPromptTest.Codeunit.al | 597 ---- .../test/SLSTestDemoData.Codeunit.al | 168 ++ .../test/SLSTestUtility.Codeunit.al | 254 +- .../test/SearchItemPromptTest.Codeunit.al | 1197 -------- .../test/SearchItemTest.Codeunit.al | 89 +- .../SearchItemsWithFiltersTest.Codeunit.al | 139 + Apps/W1/SalesLinesSuggestions/test/app.json | 12 +- .../SDServOrderArchive.PageExt.al | 33 + .../ServDeclServHdrArch.TableExt.al | 17 + .../ServDeclServLineArchive.TableExt.al | 25 + Apps/W1/ServiceDeclaration/test/app.json | 6 + .../src/ServiceDeclarationUITests.Codeunit.al | 5 +- Apps/W1/Shopify/app/app.json | 7 +- .../Enums/ShpfyReturnLocationPriority.Enum.al | 16 + .../app/src/Base/Pages/ShpfyShopCard.Page.al | 64 +- .../src/Base/Tables/ShpfyMetafield.Table.al | 103 - .../app/src/Base/Tables/ShpfyShop.Table.al | 19 +- .../src/Catalogs/Pages/ShpfyCatalogs.Page.al | 6 + .../src/Catalogs/Tables/ShpfyCatalog.Table.al | 6 + .../Codeunits/ShpfyCustByBillto.Codeunit.al | 14 +- .../Codeunits/ShpfyCustomerExport.Codeunit.al | 2 +- .../Customers/Tables/ShpfyCustomer.Table.al | 1 + .../ShpfyDocumentLinkMgt.Codeunit.al | 2 + .../ShpfyGQLDraftOrderComplete.Codeunit.al | 27 + .../ShpfyGQLFFOrdersFromOrder.Codeunit.al | 2 +- .../ShpfyGQLFulfillOrder.Codeunit.al | 27 + .../ShpfyGQLGetFulfillments.Codeunit.al | 26 + .../ShpfyGQLGetProductOptions.Codeunit.al | 27 + .../ShpfyGQLMetafieldsSet.Codeunit.al | 27 + .../ShpfyGQLNextFFOrdersFromOrd.Codeunit.al | 2 +- .../ShpfyGQLNextRefundLines.Codeunit.al | 2 +- .../ShpfyGQLNextRevFulfillOrdLns.Codeunit.al | 27 + .../ShpfyGQLNextRevFulfillOrders.Codeunit.al | 28 + .../ShpfyGQLOrderTransactions.Codeunit.al | 27 + .../ShpfyGQLPaymentTerms.Codeunit.al | 28 + .../Codeunits/ShpfyGQLProductById.Codeunit.al | 2 +- .../ShpfyGQLProductMetafieldIds.Codeunit.al | 28 + .../ShpfyGQLProductVariantDelete.Codeunit.al | 27 + .../Codeunits/ShpfyGQLRefundLines.Codeunit.al | 2 +- .../ShpfyGQLRevFulfillOrderLines.Codeunit.al | 27 + .../ShpfyGQLRevFulfillOrders.Codeunit.al | 28 + .../Codeunits/ShpfyGQLShopLocales.Codeunit.al | 15 + .../ShpfyGQLTranslResource.Codeunit.al | 15 + .../ShpfyGQLTranslationsRegister.Codeunit.al | 15 + .../Codeunits/ShpfyGQLVariantById.Codeunit.al | 2 +- .../ShpfyGQLVariantMetafieldIds.Codeunit.al | 28 + .../GraphQL/Enums/ShpfyGraphQLType.Enum.al | 85 + .../ShpfyAuthenticationMgt.Codeunit.al | 2 +- .../Codeunits/ShpfyDraftOrdersAPI.Codeunit.al | 386 +++ .../Codeunits/ShpfyFulfillmentAPI.Codeunit.al | 69 + .../ShpfyPostedInvoiceExport.Codeunit.al | 459 +++ .../ShpfyUpdateSalesInvoice.Codeunit.al | 22 + .../ShpfySalesInvoiceUpdate.PageExt.al | 44 + .../ShpfySyncInvoicesToShpfy.Report.al | 105 + .../Tables/ShpfyInvoiceHeader.Table.al | 27 + .../ShpfyMtfldTypeBoolean.Codeunit.al | 27 + .../ShpfyMtfldTypeCollectRef.Codeunit.al | 29 + .../ShpfyMtfldTypeColor.Codeunit.al | 29 + .../ShpfyMtfldTypeDate.Codeunit.al | 27 + .../ShpfyMtfldTypeDateTime.Codeunit.al | 27 + .../ShpfyMtfldTypeDimension.Codeunit.al | 70 + .../ShpfyMtfldTypeFileRef.Codeunit.al | 29 + .../ShpfyMtfldTypeInteger.Codeunit.al | 37 + .../ShpfyMtfldTypeJson.Codeunit.al | 27 + .../ShpfyMtfldTypeMetaobjRef.Codeunit.al | 29 + .../ShpfyMtfldTypeMixedRef.Codeunit.al | 29 + .../ShpfyMtfldTypeMoney.Codeunit.al | 74 + .../ShpfyMtfldTypeMultiText.Codeunit.al | 30 + .../ShpfyMtfldTypeNumDecimal.Codeunit.al | 30 + .../ShpfyMtfldTypeNumInteger.Codeunit.al | 37 + .../ShpfyMtfldTypePageRef.Codeunit.al | 29 + .../ShpfyMtfldTypeProductRef.Codeunit.al | 29 + .../ShpfyMtfldTypeSingleText.Codeunit.al | 25 + .../ShpfyMtfldTypeString.Codeunit.al | 25 + .../ShpfyMtfldTypeUrl.Codeunit.al | 29 + .../ShpfyMtfldTypeVariantRef.Codeunit.al | 29 + .../ShpfyMtfldTypeVolume.Codeunit.al | 72 + .../ShpfyMtfldTypeWeight.Codeunit.al | 72 + .../ShpfyMetafieldOwnerCustomer.Codeunit.al | 19 + .../ShpfyMetafieldOwnerProduct.Codeunit.al | 42 + .../ShpfyMetafieldOwnerVariant.Codeunit.al | 42 + .../Codeunits/ShpfyMetafieldAPI.Codeunit.al | 237 ++ .../Enums/ShpfyMetafieldDimensionType.Enum.al | 35 + .../Enums/ShpfyMetafieldOwnerType.Enum.al | 24 + .../Enums/ShpfyMetafieldType.Enum.al | 161 ++ .../Enums/ShpfyMetafieldValueType.Enum.al | 3 + .../Enums/ShpfyMetafieldVolumeType.Enum.al | 59 + .../Enums/ShpfyMetafieldWeightType.Enum.al | 26 + .../ShpfyIMetafieldOwnerType.Interface.al | 29 + .../ShpfyIMetafieldType.Interface.al | 35 + .../Pages/ShpfyMetafieldAssistEdit.Page.al | 264 ++ .../Metafields/Pages/ShpfyMetafields.Page.al | 130 + .../Metafields/Tables/ShpfyMetafield.Table.al | 219 ++ .../ShpfyFulfillmentOrdersAPI.Codeunit.al | 1 + .../Tables/ShpfyFulFillmentOrderLine.Table.al | 4 + .../Codeunits/ShpfyRefundsAPI.Codeunit.al | 37 +- .../Tables/ShpfyRefundLine.Table.al | 6 + .../ShpfyCreateSalesDocRefund.Codeunit.al | 18 +- .../Codeunits/ShpfyReturnsAPI.Codeunit.al | 102 +- .../Tables/ShpfyReturnLine.Table.al | 6 + .../Codeunits/ShpfyImportOrder.Codeunit.al | 46 +- .../Codeunits/ShpfyOrderEvents.Codeunit.al | 21 +- .../Codeunits/ShpfyOrderMapping.Codeunit.al | 22 + .../Codeunits/ShpfyOrdersAPI.Codeunit.al | 9 +- .../Codeunits/ShpfyProcessOrder.Codeunit.al | 132 +- .../Order handling/Pages/ShpfyOrder.Page.al | 10 + .../Order handling/Pages/ShpfyOrders.Page.al | 6 + .../Tables/ShpfyOrderHeader.Table.al | 26 + .../ShpfyPaymentTermsAPI.Codeunit.al | 85 + .../Pages/ShpfyPaymentTermsMapping.Page.al | 75 + .../Tables/ShpfyPaymentTerms.Table.al | 78 + .../ShpfyD365BASIC.PermissionSetExt.al | 2 + .../PermissionSets/ShpfyEdit.PermissionSet.al | 4 + .../ShpfyObjects.PermissionSet.al | 42 + .../PermissionSets/ShpfyRead.PermissionSet.al | 4 + .../ShpfyCreateItemAsVariant.Codeunit.al | 110 + .../Codeunits/ShpfyCreateProduct.Codeunit.al | 132 +- .../Codeunits/ShpfyProductAPI.Codeunit.al | 28 +- .../Codeunits/ShpfyProductEvents.Codeunit.al | 83 +- .../Codeunits/ShpfyProductExport.Codeunit.al | 306 +- .../ShpfyProductPriceCalc.Codeunit.al | 29 +- .../Codeunits/ShpfyVariantAPI.Codeunit.al | 43 +- .../src/Products/Pages/ShpfyProducts.Page.al | 18 + .../src/Products/Pages/ShpfyVariants.Page.al | 34 + .../Reports/ShpfyAddItemAsVariant.Report.al | 116 + .../src/Products/Tables/ShpfyProduct.Table.al | 6 + .../src/Products/Tables/ShpfyVariant.Table.al | 6 + .../ShpfyExportShipments.Codeunit.al | 1 + .../Pages/ShpfyShipmentMethodsMapping.Page.al | 21 + .../ShpfyShipmentMethodMapping.Table.al | 52 + .../Codeunits/ShpfyTransactions.Codeunit.al | 157 +- .../Enums/ShpfyTransactionStatus.Enum.al | 9 +- .../Pages/ShpfyTransactions.Page.al | 6 + .../Reports/ShpfySuggestPayments.Report.al | 12 +- .../Tables/ShpfyOrderTransaction.Table.al | 8 + .../ShpfyCreateTranslProduct.Codeunit.al | 30 + .../ShpfyCreateTranslVariant.Codeunit.al | 24 + .../Codeunits/ShpfyTranslationApi.Codeunit.al | 157 + .../Codeunits/ShpfyTranslationMgt.Codeunit.al | 28 + .../Enums/ShpfyResourceType.Enum.al | 20 + .../ShpfyICreateTranslation.Interface.al | 17 + .../Translations/Pages/ShpfyLanguages.Page.al | 58 + .../Tables/ShpfyLanguage.Table.al | 72 + .../Tables/ShpfyTranslation.Table.al | 128 + .../ShpfyCatalogPricesTest.Codeunit.al | 248 ++ .../ShpfyOrdersAPISubscriber.Codeunit.al | 46 + .../ShpfyOrdersAPITest.Codeunit.al | 30 +- .../ShpfyOrderRefundTest.Codeunit.al | 37 +- .../ShpfyOrderRefundsHelper.Codeunit.al | 18 +- .../Products/ShpfyProductInitTest.Codeunit.al | 76 +- .../src/StatisticalAccJournalLine.Table.al | 19 +- .../src/StatisticalAccountsJournal.Page.al | 2 + .../src/StatisticalAccountTest.Codeunit.al | 48 + .../Account/ChartOfSustainAccounts.Page.al | 13 +- .../Account/SustainabilityAccountList.Page.al | 5 + .../SustainabilityCalcMgt.Codeunit.al | 2 +- .../Certificate/SustCertificateArea.Table.al | 31 + .../Certificate/SustCertificateAreas.Page.al | 30 + .../Certificate/SustCertificateCard.Page.al | 60 + .../SustCertificateStandard.Table.al | 31 + .../SustCertificateStandards.Page.al | 30 + .../SustCertificateSubscribers.Codeunit.al | 27 + .../Certificate/SustCertificateType.Enum.al | 16 + .../app/src/Certificate/SustItem.TableExt.al | 65 + .../src/Certificate/SustItemCard.PageExt.al | 38 + .../src/Certificate/SustVendor.TableExt.al | 37 + .../src/Certificate/SustVendorCard.PageExt.al | 25 + .../SustainabilityCertificate.Table.al | 70 + .../SustainabilityCertificates.Page.al | 31 + .../BatchUpdateCarbonEmission.Report.al | 104 + .../app/src/Emission/EmissionFee.Table.al | 100 + .../app/src/Emission/EmissionFees.Page.al | 62 + .../app/src/Emission/EmissionType.Enum.al | 19 + .../AccSchLineMgmtHelper.Codeunit.al | 372 +++ .../AccScheduleLineSubscribers.Codeunit.al | 64 + .../AnalysisViewEntrySubscriber.Codeunit.al | 43 + ...AnalysisViewEntryToSustEntries.Codeunit.al | 173 ++ .../SustAccAnalysisViewMgt.Codeunit.al | 136 + .../SustAccSchAmountType.EnumExt.al | 15 + .../SustAccScheduleLine.TableExt.al | 15 + .../SustAccountAnalysisView.Table.al | 478 ++++ .../SustAccsAnalysisView.Page.al | 290 ++ .../SustAnalysisAccountSource.EnumExt.al | 11 + .../SustAnalysisEntryBuff.TableExt.al | 31 + .../SustAnalysisViewEntries.PageExt.al | 31 + .../SustAnalysisViewEntry.TableExt.al | 37 + .../SustSchLineTotalingType.EnumExt.al | 11 + .../Journal/SustainabilityJnlBatches.Page.al | 25 + .../Journal/SustainabilityJnlDocType.Enum.al | 1 + .../Journal/SustainabilityJnlLine.Table.al | 5 +- .../src/Journal/SustainabilityJournal.Page.al | 8 +- .../SustainabilityJournalMgt.Codeunit.al | 25 +- .../SustainabilityLedgerEntries.Page.al | 10 + .../Ledger/SustainabilityLedgerEntry.Table.al | 13 + .../SustainabilityAdmin.permissionset.al | 18 +- .../SustainabilityObjects.permissionset.al | 50 +- .../SustainabilityRead.permissionset.al | 18 +- .../SustPreviewPostInstance.Codeunit.al | 51 + .../SustPreviewPostSubscriber.Codeunit.al | 55 + .../SustPreviewPostingHandler.Codeunit.al | 17 + .../Posting/SustainabilityPostMgt.Codeunit.al | 65 +- .../Purchase/SustPstdCrMemoSubform.PageExt.al | 58 + .../SustPstdPurchInvSubform.PageExt.al | 58 + .../SustPurchCrMemoHeader.TableExt.al | 48 + .../Purchase/SustPurchCrMemoLine.TableExt.al | 82 + .../Purchase/SustPurchCrMemoStats.PageExt.al | 57 + .../SustPurchCrMemoSubform.PageExt.al | 58 + .../Purchase/SustPurchInvHeader.TableExt.al | 48 + .../src/Purchase/SustPurchInvLine.TableExt.al | 82 + .../Purchase/SustPurchInvSubform.PageExt.al | 58 + .../Purchase/SustPurchInvoiceStats.PageExt.al | 57 + .../Purchase/SustPurchOrderStats.PageExt.al | 84 + .../Purchase/SustPurchOrderSubform.PageExt.al | 58 + .../Purchase/SustPurchRcptLine.TableExt.al | 82 + .../SustPurchRetOrdSubform.PageExt.al | 58 + .../Purchase/SustPurchRetShptLine.TableExt.al | 82 + .../Purchase/SustPurchStatistics.PageExt.al | 72 + .../SustPurchaseCopyDocument.Codeunit.al | 60 + .../SustPurchaseSubscriber.Codeunit.al | 186 ++ .../SustainabilityPurchHeader.TableExt.al | 81 + .../SustainabilityPurchLine.TableExt.al | 286 ++ .../RoleCenters/CH4EmissionRatioChart.Page.al | 41 + .../ComputeSustGoalCue.Codeunit.al | 135 + .../EmissionScopeRatioChart.Page.al | 41 + .../HeadlineSustainabilityRC.Page.al | 108 + .../RoleCenters/N2OEmissionRatioChart.Page.al | 41 + .../RCHeadlinePageSust.Codeunit.al | 62 + .../SustainabilityActivities.Page.al | 153 + .../SustainabilityChartMgmt.Codeunit.al | 122 + .../RoleCenters/SustainabilityCue.Table.al | 106 + .../RoleCenters/SustainabilityGoalCue.Page.al | 104 + .../SustainabilityGoalCue.Table.al | 63 + .../SustainabilityManager.Profile.al | 8 + .../SustainabilityManagerRC.Page.al | 365 +++ .../src/Scorecard/SustainabilityGoal.Table.al | 313 ++ .../src/Scorecard/SustainabilityGoals.Page.al | 290 ++ .../Scorecard/SustainabilityScorecard.Page.al | 62 + .../SustainabilityScorecard.Table.al | 57 + .../SustainabilityScorecards.Page.al | 65 + .../app/src/Setup/SustUserSetup.PageExt.al | 19 + .../app/src/Setup/SustainabilitySetup.Page.al | 17 + .../src/Setup/SustainabilitySetup.Table.al | 4 + .../app/src/Setup/UserSetupTabExt.TableExt.al | 15 + Apps/W1/Sustainability/test/app.json | 8 +- .../src/LibrarySustainability.Codeunit.al | 67 + .../test/src/SustCertificateTest.Codeunit.al | 774 +++++ .../src/SustainabilityCheckTest.Codeunit.al | 87 + .../SustainabilityFinancialTest.Codeunit.al | 582 ++++ .../src/SustainabilityJournalTest.Codeunit.al | 46 + .../src/SustainabilityPostingTest.Codeunit.al | 2332 +++++++++++++++ .../app/src/TransactStorageExport.Codeunit.al | 12 +- .../src/TransactStorageExportData.Codeunit.al | 171 +- .../app/src/TransactionStorageABS.Codeunit.al | 143 +- .../VATGroupCommunication.Codeunit.al | 13 +- .../app/src/Pages/VATGroupSetupGuide.Page.al | 10 + Build/DisabledTests/APIV2.json | 12 +- Build/DisabledTests/EDocumentTests.json | 12 + Build/DisabledTests/FSIntegrationTest.json | 7 + Build/DisabledTests/OrderTakerAgent.json | 7 + .../SalesLinesSuggestionsTests.json | 47 +- .../SalesOrderTakingAgentTests.json | 7 + Build/Packages.json | 2 +- Build/Scripts/NewBcContainer.ps1 | 2 +- .../.AL-Go/PreCompileApp.ps1 | 6 + .../.AL-Go/cloudDevEnv.ps1 | 37 +- .../.AL-Go/localDevEnv.ps1 | 38 +- .../.AL-Go/ImportTestToolkitToBcContainer.ps1 | 12 + .../.AL-Go/cloudDevEnv.ps1 | 37 +- .../.AL-Go/localDevEnv.ps1 | 38 +- CODEOWNERS | 3 + Other/Tests/BCPT-SampleTests/README.md | 21 +- Other/Tests/BCPT-SampleTests/app.json | 39 - .../BCPT-SampleTests/logo/ExtensionLogo.png | Bin 5011 -> 0 bytes .../src/BCPTAdjustCostItemEntries.Codeunit.al | 17 - .../BCPTCalculatePlanWorksheet.Codeunit.al | 21 - .../src/BCPTCreateCustomer.Codeunit.al | 138 - .../src/BCPTCreateItem.Codeunit.al | 99 - .../src/BCPTCreatePOWithNLines.Codeunit.al | 110 - .../src/BCPTCreateSOWithNLines.Codeunit.al | 113 - .../src/BCPTCreateSQWithNLines.Codeunit.al | 109 - .../src/BCPTCreateVendor.Codeunit.al | 137 - .../src/BCPTDetailTrialBalReport.Codeunit.al | 12 - .../src/BCPTMakeWebCall.Codeunit.al | 19 - .../src/BCPTOpenChartOfAccounts.Codeunit.al | 18 - .../src/BCPTOpenCustomerList.Codeunit.al | 18 - .../src/BCPTOpenItemList.Codeunit.al | 18 - .../src/BCPTOpenPurchInvoiceList.Codeunit.al | 18 - .../src/BCPTOpenRoleCenterSOP.Codeunit.al | 13 - .../src/BCPTOpenSalesInvoiceList.Codeunit.al | 18 - .../src/BCPTOpenVendorList.Codeunit.al | 18 - .../src/BCPTPostGLEntries.Codeunit.al | 134 - .../src/BCPTPostItemJournal.Codeunit.al | 117 - .../src/BCPTPostPurchInv.Codeunit.al | 141 - .../src/BCPTPurchPostWithNLines.Codeunit.al | 119 - .../src/BCPTSQLPing.Codeunit.al | 16 - .../src/BCPTSalesPostWithNLines.Codeunit.al | 123 - .../src/BCPTSleep1s.Codeunit.al | 7 - .../src/TestCodeunitsWithParams.Enum.al | 35 - 795 files changed, 43937 insertions(+), 8483 deletions(-) create mode 100644 .github/workflows/PullPowerPlatformChanges.yaml create mode 100644 .github/workflows/PushPowerPlatformChanges.yaml create mode 100644 .github/workflows/_BuildPowerPlatformSolution.yaml create mode 100644 Apps/CZ/AdvancePaymentsLocalization/app/Src/Codeunits/NonDeductibleVATCZZ.Codeunit.al create mode 100644 Apps/CZ/AdvancePaymentsLocalization/app/Src/PageExtensions/JobCardCZZ.PageExt.al create mode 100644 Apps/CZ/AdvancePaymentsLocalization/app/Src/PageExtensions/JobTaskCardCZZ.PageExt.al create mode 100644 Apps/CZ/AdvancePaymentsLocalization/app/Src/PageExtensions/JobTaskLinesSubformCZZ.PageExt.al create mode 100644 Apps/CZ/AdvancePaymentsLocalization/app/Src/PageExtensions/VATSetupCZZ.PageExt.al create mode 100644 Apps/CZ/AdvancePaymentsLocalization/app/Src/ReportExtensions/VATCoeffCorrectionCZZ.ReportExt.al create mode 100644 Apps/CZ/AdvancePaymentsLocalization/app/Src/TableExtensions/JobCZZ.TableExt.al create mode 100644 Apps/CZ/AdvancePaymentsLocalization/app/Src/TableExtensions/JobPlanningLineCZZ.TableExt.al create mode 100644 Apps/CZ/AdvancePaymentsLocalization/app/Src/TableExtensions/JobTaskCZZ.TableExt.al create mode 100644 Apps/CZ/AdvancePaymentsLocalization/app/Src/TableExtensions/VATSetupCZZ.TableExt.al create mode 100644 Apps/CZ/ContosoCoffeeDemoDatasetCZ/app/Codeunits/CommonModuleCZ.Codeunit.al create mode 100644 Apps/CZ/ContosoCoffeeDemoDatasetCZ/app/Codeunits/ContosoDemoDataSetupCZ.Codeunit.al create mode 100644 Apps/CZ/ContosoCoffeeDemoDatasetCZ/app/Codeunits/CreateCZGLAccounts.Codeunit.al create mode 100644 Apps/CZ/ContosoCoffeeDemoDatasetCZ/app/Codeunits/FixedAssetModuleCZ.Codeunit.al create mode 100644 Apps/CZ/ContosoCoffeeDemoDatasetCZ/app/ExtensionLogo.png create mode 100644 Apps/CZ/ContosoCoffeeDemoDatasetCZ/app/app.json create mode 100644 Apps/CZ/CoreLocalizationPack/app/Src/Codeunits/GLEntryasCorrectionCZL.Codeunit.al create mode 100644 Apps/CZ/CoreLocalizationPack/app/Src/TableExtensions/VATSetupCZL.TableExt.al create mode 100644 Apps/DK/OIOUBL/app/src/ServiceInvoice/OIOUBLServiceHeaderArchive.TableExt.al create mode 100644 Apps/DK/OIOUBL/app/src/ServiceInvoice/OIOUBLServiceLineArchive.TableExt.al create mode 100644 Apps/DK/OIOUBL/app/src/ServiceInvoice/OIOUBLServiceOrderArchive.PageExt.al create mode 100644 Apps/IN/INGST/app/GSTService/src/PageExtension/GSTFiledServiceContract.PageExt.al create mode 100644 Apps/IN/INGST/app/GSTService/src/tableextension/GSTFiledServContrHeader.TableExt.al create mode 100644 Apps/IT/EDocumentIT/demo data/EDocumentModuleIT.Codeunit.al create mode 100644 Apps/IT/EDocumentIT/demo data/ExtensionLogo.png create mode 100644 Apps/IT/EDocumentIT/demo data/app.json create mode 100644 Apps/US/HybridGP_US/app/src/Codeunits/GPIRSFormData.Codeunit.al create mode 100644 Apps/W1/APIV2/app/src/pages/APIV2JobQueueEntries.Page.al create mode 100644 Apps/W1/APIV2/app/src/pages/APIV2JobQueueLogEntries.Page.al create mode 100644 Apps/W1/APIV2/test/src/APIV2JobQueueEntriesE2E.Codeunit.al create mode 100644 Apps/W1/APIV2/test/src/APIV2JobQueueLogEntriesE2E.Codeunit.al create mode 100644 Apps/W1/CompanyHub/app/Entitlements/Dynamics365BCPremiumPartnerSandboxCOHUB.Entitlement.al create mode 100644 Apps/W1/CreateProductInformationWithCopilot/app/BaseAppExtensions/ItemSubstitutionEntryExt.PageExt.al create mode 100644 Apps/W1/CreateProductInformationWithCopilot/app/CreateProductInfoPrompts.Codeunit.al create mode 100644 Apps/W1/CreateProductInformationWithCopilot/app/ExtensionLogo.png create mode 100644 Apps/W1/CreateProductInformationWithCopilot/app/SalesAzureOpenAITools/FunctionsImpl/MagicFunction.Codeunit.al create mode 100644 Apps/W1/CreateProductInformationWithCopilot/app/SalesAzureOpenAITools/FunctionsImpl/SuggestSubstitutionsFunction.Codeunit.al create mode 100644 Apps/W1/CreateProductInformationWithCopilot/app/SalesAzureOpenAITools/ItemSubstitutionSuggestion/ItemSubstSuggestion.Page.al create mode 100644 Apps/W1/CreateProductInformationWithCopilot/app/SalesAzureOpenAITools/ItemSubstitutionSuggestion/ItemSubstSuggestion.TableExt.al create mode 100644 Apps/W1/CreateProductInformationWithCopilot/app/SalesAzureOpenAITools/ItemSubstitutionSuggestion/ItemSubstSuggestionImpl.Codeunit.al create mode 100644 Apps/W1/CreateProductInformationWithCopilot/app/SalesAzureOpenAITools/ItemSubstitutionSuggestion/ItemSubstSuggestionSub.Page.al create mode 100644 Apps/W1/CreateProductInformationWithCopilot/app/Search/Search.Codeunit.al create mode 100644 Apps/W1/CreateProductInformationWithCopilot/app/Search/SearchAPIResponse.Table.al create mode 100644 Apps/W1/CreateProductInformationWithCopilot/app/Search/SearchConfidence.Enum.al create mode 100644 Apps/W1/CreateProductInformationWithCopilot/app/Search/SearchStyle.Enum.al create mode 100644 Apps/W1/CreateProductInformationWithCopilot/app/Setup/CreateProductInfoCapability.EnumExt.al create mode 100644 Apps/W1/CreateProductInformationWithCopilot/app/Setup/CreateProductInfoInstall.Codeunit.al create mode 100644 Apps/W1/CreateProductInformationWithCopilot/app/Setup/CreateProductInfoUpgrade.Codeunit.al create mode 100644 Apps/W1/CreateProductInformationWithCopilot/app/Utilities/CreateProductInfoUtility.Codeunit.al create mode 100644 Apps/W1/CreateProductInformationWithCopilot/app/Utilities/NotificationManager.Codeunit.al create mode 100644 Apps/W1/CreateProductInformationWithCopilot/app/app.json create mode 100644 Apps/W1/DataSearch/test/TestDataSearch.Table.al create mode 100644 Apps/W1/EDocument/app/src/Processing/EDocAttachmentProcessor.Codeunit.al create mode 100644 Apps/W1/EDocument/app/src/Setup/EDocumentUpgrade.Codeunit.al create mode 100644 Apps/W1/EDocument/test/src/Copilot/Dataset/accuacy.jsonl create mode 100644 Apps/W1/EDocument/test/src/Copilot/Dataset/accuacysmall.jsonl create mode 100644 Apps/W1/EDocument/test/src/Copilot/EDocCopilotPOAccuacy.Codeunit.al create mode 100644 Apps/W1/EDocument/test/src/Copilot/EDocCopilotPORedTeaming.Codeunit.al create mode 100644 Apps/W1/EDocument/test/src/Receive/EDocReceiveFiles.Codeunit.al create mode 100644 Apps/W1/Email - Outlook REST API/app/src/EmailOutlookAPIClientv3.Interface.al create mode 100644 Apps/W1/EnforcedDigitalVouchers/app/src/Extensions/DigVouchPstdServCrMemo.PageExt.al create mode 100644 Apps/W1/EnforcedDigitalVouchers/app/src/Extensions/DigVoucherPstdServInv.PageExt.al create mode 100644 Apps/W1/EnforcedDigitalVouchers/app/src/Extensions/DigVoucherPurchRetOrder.PageExt.al create mode 100644 Apps/W1/EnforcedDigitalVouchers/app/src/Extensions/DigVoucherServCrMemo.PageExt.al create mode 100644 Apps/W1/EnforcedDigitalVouchers/app/src/Extensions/DigVoucherServInvoice.PageExt.al create mode 100644 Apps/W1/EnforcedDigitalVouchers/app/src/Extensions/DigVoucherServOrder.PageExt.al create mode 100644 Apps/W1/EnforcedDigitalVouchers/app/src/Extensions/DigitalVoucherPurchOrder.PageExt.al create mode 100644 Apps/W1/ExcelReports/test/ExtensionLogo.png create mode 100644 Apps/W1/ExcelReports/test/app.json create mode 100644 Apps/W1/ExcelReports/test/src/FixedAssetExcelReports.Codeunit.al create mode 100644 Apps/W1/ExcelReports/test/src/TrialBalanceExcelReports.Codeunit.al create mode 100644 Apps/W1/ExternalEvents/app/src/JobQueueExternalEvents.Codeunit.al create mode 100644 Apps/W1/FieldServiceIntegration/test/ExtensionLogo.png create mode 100644 Apps/W1/FieldServiceIntegration/test/app.json create mode 100644 Apps/W1/FieldServiceIntegration/test/src/FSIntegrationTest.Codeunit.al create mode 100644 Apps/W1/HybridGP/app/src/Migration/GPTables/GPIV00104.Table.al create mode 100644 Apps/W1/Intrastat/app/src/DefaultCtryCodeItemTrack.Enum.al create mode 100644 Apps/W1/Intrastat/app/src/IntrRepLotNoInfo.TableExt.al create mode 100644 Apps/W1/Intrastat/app/src/IntrRepLotNoInfoCard.PageExt.al create mode 100644 Apps/W1/Intrastat/app/src/IntrRepLotNoInfoList.PageExt.al create mode 100644 Apps/W1/Intrastat/app/src/IntrRepPackNoInfoCard.PageExt.al create mode 100644 Apps/W1/Intrastat/app/src/IntrRepSerNoInfoCard.PageExt.al create mode 100644 Apps/W1/Intrastat/app/src/IntrRepSerNoInfoList.PageExt.al create mode 100644 Apps/W1/Intrastat/app/src/IntrRepSerialNoInfo.TableExt.al create mode 100644 Apps/W1/Intrastat/app/src/IntrReportItemTrLines.PageExt.al create mode 100644 Apps/W1/Intrastat/app/src/IntrastatReportItemTracking.Codeunit.al create mode 100644 Apps/W1/ReportLayouts/ReportLayouts.ruleset.json create mode 100644 Apps/W1/ReportLayouts/app/ExtensionLogo.png create mode 100644 Apps/W1/ReportLayouts/app/app.json create mode 100644 Apps/W1/ReportLayouts/test/ExtensionLogo.png create mode 100644 Apps/W1/ReportLayouts/test/app.json create mode 100644 Apps/W1/ReportLayouts/test/appsourcecop.json create mode 100644 Apps/W1/SalesLinesSuggestions/app/Attachment/FieldMapper/AttachmentMapping.Table.al create mode 100644 Apps/W1/SalesLinesSuggestions/app/Attachment/FieldMapper/AttachmentMappingPart.Page.al create mode 100644 Apps/W1/SalesLinesSuggestions/app/Attachment/FieldMapper/ColumnAction.Enum.al create mode 100644 Apps/W1/SalesLinesSuggestions/app/Attachment/FieldMapper/ColumnType.Enum.al create mode 100644 Apps/W1/SalesLinesSuggestions/app/Attachment/FieldMapper/ItemInfoFromFile.Page.al create mode 100644 Apps/W1/SalesLinesSuggestions/app/Attachment/FieldMapper/MappingCache.Table.al create mode 100644 Apps/W1/SalesLinesSuggestions/app/Attachment/FieldMapper/MappingCacheManagement.Codeunit.al create mode 100644 Apps/W1/SalesLinesSuggestions/app/Attachment/FileHandlers/CSVHandler.Codeunit.al create mode 100644 Apps/W1/SalesLinesSuggestions/app/Attachment/FileHandlers/FileHandler.Interface.al create mode 100644 Apps/W1/SalesLinesSuggestions/app/Attachment/FileHandlers/FileHandlerFactory.Codeunit.al create mode 100644 Apps/W1/SalesLinesSuggestions/app/Attachment/FileHandlers/FileHandlerResult.Codeunit.al create mode 100644 Apps/W1/SalesLinesSuggestions/app/Attachment/FileHandlers/FileHandlerType.Enum.al rename Apps/W1/SalesLinesSuggestions/app/{ => Attachment}/SalesLineAISuggestionsSub.Page.al (94%) create mode 100644 Apps/W1/SalesLinesSuggestions/app/Attachment/SalesLineFromAttachment.Codeunit.al create mode 100644 Apps/W1/SalesLinesSuggestions/app/Attachment/SalesLineFromAttachment.Page.al create mode 100644 Apps/W1/SalesLinesSuggestions/app/SalesAzureOpenAITools/FunctionsImpl/LookupItemsFromCsvFunction.Codeunit.al create mode 100644 Apps/W1/SalesLinesSuggestions/test/AI Tests/Datasets/DocLookupPromptTest.jsonl create mode 100644 Apps/W1/SalesLinesSuggestions/test/AI Tests/Datasets/EmptyDataset.jsonl create mode 100644 Apps/W1/SalesLinesSuggestions/test/AI Tests/Datasets/ItemEntitySearch.jsonl create mode 100644 Apps/W1/SalesLinesSuggestions/test/AI Tests/Datasets/MagicFunctionPromptTest.jsonl create mode 100644 Apps/W1/SalesLinesSuggestions/test/AI Tests/Datasets/SearchItemWithFilters.jsonl create mode 100644 Apps/W1/SalesLinesSuggestions/test/AI Tests/Datasets/SearchItemWithinDocument.jsonl create mode 100644 Apps/W1/SalesLinesSuggestions/test/AI Tests/Datasets/SearchSplitItemPromptTestDataset.jsonl create mode 100644 Apps/W1/SalesLinesSuggestions/test/AI Tests/ItemEntitySearch.Codeunit.al create mode 100644 Apps/W1/SalesLinesSuggestions/test/AI Tests/MagicFunctionPromptTest.Codeunit.al create mode 100644 Apps/W1/SalesLinesSuggestions/test/AI Tests/SLSPromptTest.Codeunit.al create mode 100644 Apps/W1/SalesLinesSuggestions/test/AttachmentHandlerPromptTests/AttachmentDataSizeTest.Codeunit.al create mode 100644 Apps/W1/SalesLinesSuggestions/test/AttachmentHandlerPromptTests/Dataset/Accuracy_ExtractInfoFromCsvPrompt.jsonl create mode 100644 Apps/W1/SalesLinesSuggestions/test/AttachmentHandlerPromptTests/Dataset/ExtractInfoFromCsvPrompt.jsonl create mode 100644 Apps/W1/SalesLinesSuggestions/test/AttachmentHandlerPromptTests/Dataset/ExtractInfoFromFaultyCsvPrompt.jsonl create mode 100644 Apps/W1/SalesLinesSuggestions/test/AttachmentHandlerPromptTests/Dataset/LoadMappingFromCsv.jsonl create mode 100644 Apps/W1/SalesLinesSuggestions/test/AttachmentHandlerPromptTests/Dataset/LoadSuggestionsFromCsv.jsonl create mode 100644 Apps/W1/SalesLinesSuggestions/test/AttachmentHandlerPromptTests/Dataset/MagicFunctionAttachmentPrompt.jsonl create mode 100644 Apps/W1/SalesLinesSuggestions/test/AttachmentHandlerPromptTests/ExtractInfoAccuracy.Codeunit.al create mode 100644 Apps/W1/SalesLinesSuggestions/test/AttachmentHandlerPromptTests/ExtractInfoFromCsvPrompt.Codeunit.al create mode 100644 Apps/W1/SalesLinesSuggestions/test/AttachmentHandlerPromptTests/LoadMappingsFromCsv.Codeunit.al create mode 100644 Apps/W1/SalesLinesSuggestions/test/AttachmentHandlerPromptTests/LoadSuggestionsFromCsv.Codeunit.al create mode 100644 Apps/W1/SalesLinesSuggestions/test/AttachmentHandlerPromptTests/MagicFunctionAttmtPrompt.Codeunit.al create mode 100644 Apps/W1/SalesLinesSuggestions/test/AttachmentHandlerPromptTests/RedTXPIATests.Codeunit.al create mode 100644 Apps/W1/SalesLinesSuggestions/test/AttachmentHandlerPromptTests/RedTeamingTests.Codeunit.al create mode 100644 Apps/W1/SalesLinesSuggestions/test/AttachmentHandlerPromptTests/SaveFileMappingTest.Codeunit.al delete mode 100644 Apps/W1/SalesLinesSuggestions/test/DocumentLookupPromptTest.Codeunit.al delete mode 100644 Apps/W1/SalesLinesSuggestions/test/ItemSearchInDocPromptTest.Codeunit.al delete mode 100644 Apps/W1/SalesLinesSuggestions/test/MagicFunctionPromptTest.Codeunit.al create mode 100644 Apps/W1/SalesLinesSuggestions/test/SLSTestDemoData.Codeunit.al delete mode 100644 Apps/W1/SalesLinesSuggestions/test/SearchItemPromptTest.Codeunit.al create mode 100644 Apps/W1/SalesLinesSuggestions/test/SearchItemsWithFiltersTest.Codeunit.al create mode 100644 Apps/W1/ServiceDeclaration/app/src/ServiceDocuments/SDServOrderArchive.PageExt.al create mode 100644 Apps/W1/ServiceDeclaration/app/src/ServiceDocuments/ServDeclServHdrArch.TableExt.al create mode 100644 Apps/W1/ServiceDeclaration/app/src/ServiceDocuments/ServDeclServLineArchive.TableExt.al create mode 100644 Apps/W1/Shopify/app/src/Base/Enums/ShpfyReturnLocationPriority.Enum.al delete mode 100644 Apps/W1/Shopify/app/src/Base/Tables/ShpfyMetafield.Table.al create mode 100644 Apps/W1/Shopify/app/src/GraphQL/Codeunits/ShpfyGQLDraftOrderComplete.Codeunit.al create mode 100644 Apps/W1/Shopify/app/src/GraphQL/Codeunits/ShpfyGQLFulfillOrder.Codeunit.al create mode 100644 Apps/W1/Shopify/app/src/GraphQL/Codeunits/ShpfyGQLGetFulfillments.Codeunit.al create mode 100644 Apps/W1/Shopify/app/src/GraphQL/Codeunits/ShpfyGQLGetProductOptions.Codeunit.al create mode 100644 Apps/W1/Shopify/app/src/GraphQL/Codeunits/ShpfyGQLMetafieldsSet.Codeunit.al create mode 100644 Apps/W1/Shopify/app/src/GraphQL/Codeunits/ShpfyGQLNextRevFulfillOrdLns.Codeunit.al create mode 100644 Apps/W1/Shopify/app/src/GraphQL/Codeunits/ShpfyGQLNextRevFulfillOrders.Codeunit.al create mode 100644 Apps/W1/Shopify/app/src/GraphQL/Codeunits/ShpfyGQLOrderTransactions.Codeunit.al create mode 100644 Apps/W1/Shopify/app/src/GraphQL/Codeunits/ShpfyGQLPaymentTerms.Codeunit.al create mode 100644 Apps/W1/Shopify/app/src/GraphQL/Codeunits/ShpfyGQLProductMetafieldIds.Codeunit.al create mode 100644 Apps/W1/Shopify/app/src/GraphQL/Codeunits/ShpfyGQLProductVariantDelete.Codeunit.al create mode 100644 Apps/W1/Shopify/app/src/GraphQL/Codeunits/ShpfyGQLRevFulfillOrderLines.Codeunit.al create mode 100644 Apps/W1/Shopify/app/src/GraphQL/Codeunits/ShpfyGQLRevFulfillOrders.Codeunit.al create mode 100644 Apps/W1/Shopify/app/src/GraphQL/Codeunits/ShpfyGQLShopLocales.Codeunit.al create mode 100644 Apps/W1/Shopify/app/src/GraphQL/Codeunits/ShpfyGQLTranslResource.Codeunit.al create mode 100644 Apps/W1/Shopify/app/src/GraphQL/Codeunits/ShpfyGQLTranslationsRegister.Codeunit.al create mode 100644 Apps/W1/Shopify/app/src/GraphQL/Codeunits/ShpfyGQLVariantMetafieldIds.Codeunit.al create mode 100644 Apps/W1/Shopify/app/src/Invoicing/Codeunits/ShpfyDraftOrdersAPI.Codeunit.al create mode 100644 Apps/W1/Shopify/app/src/Invoicing/Codeunits/ShpfyFulfillmentAPI.Codeunit.al create mode 100644 Apps/W1/Shopify/app/src/Invoicing/Codeunits/ShpfyPostedInvoiceExport.Codeunit.al create mode 100644 Apps/W1/Shopify/app/src/Invoicing/Codeunits/ShpfyUpdateSalesInvoice.Codeunit.al create mode 100644 Apps/W1/Shopify/app/src/Invoicing/PageExt/ShpfySalesInvoiceUpdate.PageExt.al create mode 100644 Apps/W1/Shopify/app/src/Invoicing/Reports/ShpfySyncInvoicesToShpfy.Report.al create mode 100644 Apps/W1/Shopify/app/src/Invoicing/Tables/ShpfyInvoiceHeader.Table.al create mode 100644 Apps/W1/Shopify/app/src/Metafields/Codeunits/IMetafieldType/ShpfyMtfldTypeBoolean.Codeunit.al create mode 100644 Apps/W1/Shopify/app/src/Metafields/Codeunits/IMetafieldType/ShpfyMtfldTypeCollectRef.Codeunit.al create mode 100644 Apps/W1/Shopify/app/src/Metafields/Codeunits/IMetafieldType/ShpfyMtfldTypeColor.Codeunit.al create mode 100644 Apps/W1/Shopify/app/src/Metafields/Codeunits/IMetafieldType/ShpfyMtfldTypeDate.Codeunit.al create mode 100644 Apps/W1/Shopify/app/src/Metafields/Codeunits/IMetafieldType/ShpfyMtfldTypeDateTime.Codeunit.al create mode 100644 Apps/W1/Shopify/app/src/Metafields/Codeunits/IMetafieldType/ShpfyMtfldTypeDimension.Codeunit.al create mode 100644 Apps/W1/Shopify/app/src/Metafields/Codeunits/IMetafieldType/ShpfyMtfldTypeFileRef.Codeunit.al create mode 100644 Apps/W1/Shopify/app/src/Metafields/Codeunits/IMetafieldType/ShpfyMtfldTypeInteger.Codeunit.al create mode 100644 Apps/W1/Shopify/app/src/Metafields/Codeunits/IMetafieldType/ShpfyMtfldTypeJson.Codeunit.al create mode 100644 Apps/W1/Shopify/app/src/Metafields/Codeunits/IMetafieldType/ShpfyMtfldTypeMetaobjRef.Codeunit.al create mode 100644 Apps/W1/Shopify/app/src/Metafields/Codeunits/IMetafieldType/ShpfyMtfldTypeMixedRef.Codeunit.al create mode 100644 Apps/W1/Shopify/app/src/Metafields/Codeunits/IMetafieldType/ShpfyMtfldTypeMoney.Codeunit.al create mode 100644 Apps/W1/Shopify/app/src/Metafields/Codeunits/IMetafieldType/ShpfyMtfldTypeMultiText.Codeunit.al create mode 100644 Apps/W1/Shopify/app/src/Metafields/Codeunits/IMetafieldType/ShpfyMtfldTypeNumDecimal.Codeunit.al create mode 100644 Apps/W1/Shopify/app/src/Metafields/Codeunits/IMetafieldType/ShpfyMtfldTypeNumInteger.Codeunit.al create mode 100644 Apps/W1/Shopify/app/src/Metafields/Codeunits/IMetafieldType/ShpfyMtfldTypePageRef.Codeunit.al create mode 100644 Apps/W1/Shopify/app/src/Metafields/Codeunits/IMetafieldType/ShpfyMtfldTypeProductRef.Codeunit.al create mode 100644 Apps/W1/Shopify/app/src/Metafields/Codeunits/IMetafieldType/ShpfyMtfldTypeSingleText.Codeunit.al create mode 100644 Apps/W1/Shopify/app/src/Metafields/Codeunits/IMetafieldType/ShpfyMtfldTypeString.Codeunit.al create mode 100644 Apps/W1/Shopify/app/src/Metafields/Codeunits/IMetafieldType/ShpfyMtfldTypeUrl.Codeunit.al create mode 100644 Apps/W1/Shopify/app/src/Metafields/Codeunits/IMetafieldType/ShpfyMtfldTypeVariantRef.Codeunit.al create mode 100644 Apps/W1/Shopify/app/src/Metafields/Codeunits/IMetafieldType/ShpfyMtfldTypeVolume.Codeunit.al create mode 100644 Apps/W1/Shopify/app/src/Metafields/Codeunits/IMetafieldType/ShpfyMtfldTypeWeight.Codeunit.al create mode 100644 Apps/W1/Shopify/app/src/Metafields/Codeunits/IOwnerType/ShpfyMetafieldOwnerCustomer.Codeunit.al create mode 100644 Apps/W1/Shopify/app/src/Metafields/Codeunits/IOwnerType/ShpfyMetafieldOwnerProduct.Codeunit.al create mode 100644 Apps/W1/Shopify/app/src/Metafields/Codeunits/IOwnerType/ShpfyMetafieldOwnerVariant.Codeunit.al create mode 100644 Apps/W1/Shopify/app/src/Metafields/Codeunits/ShpfyMetafieldAPI.Codeunit.al create mode 100644 Apps/W1/Shopify/app/src/Metafields/Enums/ShpfyMetafieldDimensionType.Enum.al create mode 100644 Apps/W1/Shopify/app/src/Metafields/Enums/ShpfyMetafieldOwnerType.Enum.al create mode 100644 Apps/W1/Shopify/app/src/Metafields/Enums/ShpfyMetafieldType.Enum.al rename Apps/W1/Shopify/app/src/{Base => Metafields}/Enums/ShpfyMetafieldValueType.Enum.al (75%) create mode 100644 Apps/W1/Shopify/app/src/Metafields/Enums/ShpfyMetafieldVolumeType.Enum.al create mode 100644 Apps/W1/Shopify/app/src/Metafields/Enums/ShpfyMetafieldWeightType.Enum.al create mode 100644 Apps/W1/Shopify/app/src/Metafields/Interfaces/ShpfyIMetafieldOwnerType.Interface.al create mode 100644 Apps/W1/Shopify/app/src/Metafields/Interfaces/ShpfyIMetafieldType.Interface.al create mode 100644 Apps/W1/Shopify/app/src/Metafields/Pages/ShpfyMetafieldAssistEdit.Page.al create mode 100644 Apps/W1/Shopify/app/src/Metafields/Pages/ShpfyMetafields.Page.al create mode 100644 Apps/W1/Shopify/app/src/Metafields/Tables/ShpfyMetafield.Table.al create mode 100644 Apps/W1/Shopify/app/src/Payments/Codeunits/ShpfyPaymentTermsAPI.Codeunit.al create mode 100644 Apps/W1/Shopify/app/src/Payments/Pages/ShpfyPaymentTermsMapping.Page.al create mode 100644 Apps/W1/Shopify/app/src/Payments/Tables/ShpfyPaymentTerms.Table.al create mode 100644 Apps/W1/Shopify/app/src/Products/Codeunits/ShpfyCreateItemAsVariant.Codeunit.al create mode 100644 Apps/W1/Shopify/app/src/Products/Reports/ShpfyAddItemAsVariant.Report.al create mode 100644 Apps/W1/Shopify/app/src/Translations/Codeunits/ICreateTranslation/ShpfyCreateTranslProduct.Codeunit.al create mode 100644 Apps/W1/Shopify/app/src/Translations/Codeunits/ICreateTranslation/ShpfyCreateTranslVariant.Codeunit.al create mode 100644 Apps/W1/Shopify/app/src/Translations/Codeunits/ShpfyTranslationApi.Codeunit.al create mode 100644 Apps/W1/Shopify/app/src/Translations/Codeunits/ShpfyTranslationMgt.Codeunit.al create mode 100644 Apps/W1/Shopify/app/src/Translations/Enums/ShpfyResourceType.Enum.al create mode 100644 Apps/W1/Shopify/app/src/Translations/Interfaces/ShpfyICreateTranslation.Interface.al create mode 100644 Apps/W1/Shopify/app/src/Translations/Pages/ShpfyLanguages.Page.al create mode 100644 Apps/W1/Shopify/app/src/Translations/Tables/ShpfyLanguage.Table.al create mode 100644 Apps/W1/Shopify/app/src/Translations/Tables/ShpfyTranslation.Table.al create mode 100644 Apps/W1/Shopify/test/Order Handling/ShpfyOrdersAPISubscriber.Codeunit.al create mode 100644 Apps/W1/Sustainability/app/src/Certificate/SustCertificateArea.Table.al create mode 100644 Apps/W1/Sustainability/app/src/Certificate/SustCertificateAreas.Page.al create mode 100644 Apps/W1/Sustainability/app/src/Certificate/SustCertificateCard.Page.al create mode 100644 Apps/W1/Sustainability/app/src/Certificate/SustCertificateStandard.Table.al create mode 100644 Apps/W1/Sustainability/app/src/Certificate/SustCertificateStandards.Page.al create mode 100644 Apps/W1/Sustainability/app/src/Certificate/SustCertificateSubscribers.Codeunit.al create mode 100644 Apps/W1/Sustainability/app/src/Certificate/SustCertificateType.Enum.al create mode 100644 Apps/W1/Sustainability/app/src/Certificate/SustItem.TableExt.al create mode 100644 Apps/W1/Sustainability/app/src/Certificate/SustItemCard.PageExt.al create mode 100644 Apps/W1/Sustainability/app/src/Certificate/SustVendor.TableExt.al create mode 100644 Apps/W1/Sustainability/app/src/Certificate/SustVendorCard.PageExt.al create mode 100644 Apps/W1/Sustainability/app/src/Certificate/SustainabilityCertificate.Table.al create mode 100644 Apps/W1/Sustainability/app/src/Certificate/SustainabilityCertificates.Page.al create mode 100644 Apps/W1/Sustainability/app/src/Emission/BatchUpdateCarbonEmission.Report.al create mode 100644 Apps/W1/Sustainability/app/src/Emission/EmissionFee.Table.al create mode 100644 Apps/W1/Sustainability/app/src/Emission/EmissionFees.Page.al create mode 100644 Apps/W1/Sustainability/app/src/Emission/EmissionType.Enum.al create mode 100644 Apps/W1/Sustainability/app/src/FinancialReporting/AccSchLineMgmtHelper.Codeunit.al create mode 100644 Apps/W1/Sustainability/app/src/FinancialReporting/AccScheduleLineSubscribers.Codeunit.al create mode 100644 Apps/W1/Sustainability/app/src/FinancialReporting/AnalysisViewEntrySubscriber.Codeunit.al create mode 100644 Apps/W1/Sustainability/app/src/FinancialReporting/AnalysisViewEntryToSustEntries.Codeunit.al create mode 100644 Apps/W1/Sustainability/app/src/FinancialReporting/SustAccAnalysisViewMgt.Codeunit.al create mode 100644 Apps/W1/Sustainability/app/src/FinancialReporting/SustAccSchAmountType.EnumExt.al create mode 100644 Apps/W1/Sustainability/app/src/FinancialReporting/SustAccScheduleLine.TableExt.al create mode 100644 Apps/W1/Sustainability/app/src/FinancialReporting/SustAccountAnalysisView.Table.al create mode 100644 Apps/W1/Sustainability/app/src/FinancialReporting/SustAccsAnalysisView.Page.al create mode 100644 Apps/W1/Sustainability/app/src/FinancialReporting/SustAnalysisAccountSource.EnumExt.al create mode 100644 Apps/W1/Sustainability/app/src/FinancialReporting/SustAnalysisEntryBuff.TableExt.al create mode 100644 Apps/W1/Sustainability/app/src/FinancialReporting/SustAnalysisViewEntries.PageExt.al create mode 100644 Apps/W1/Sustainability/app/src/FinancialReporting/SustAnalysisViewEntry.TableExt.al create mode 100644 Apps/W1/Sustainability/app/src/FinancialReporting/SustSchLineTotalingType.EnumExt.al create mode 100644 Apps/W1/Sustainability/app/src/Posting/SustPreviewPostInstance.Codeunit.al create mode 100644 Apps/W1/Sustainability/app/src/Posting/SustPreviewPostSubscriber.Codeunit.al create mode 100644 Apps/W1/Sustainability/app/src/Posting/SustPreviewPostingHandler.Codeunit.al create mode 100644 Apps/W1/Sustainability/app/src/Purchase/SustPstdCrMemoSubform.PageExt.al create mode 100644 Apps/W1/Sustainability/app/src/Purchase/SustPstdPurchInvSubform.PageExt.al create mode 100644 Apps/W1/Sustainability/app/src/Purchase/SustPurchCrMemoHeader.TableExt.al create mode 100644 Apps/W1/Sustainability/app/src/Purchase/SustPurchCrMemoLine.TableExt.al create mode 100644 Apps/W1/Sustainability/app/src/Purchase/SustPurchCrMemoStats.PageExt.al create mode 100644 Apps/W1/Sustainability/app/src/Purchase/SustPurchCrMemoSubform.PageExt.al create mode 100644 Apps/W1/Sustainability/app/src/Purchase/SustPurchInvHeader.TableExt.al create mode 100644 Apps/W1/Sustainability/app/src/Purchase/SustPurchInvLine.TableExt.al create mode 100644 Apps/W1/Sustainability/app/src/Purchase/SustPurchInvSubform.PageExt.al create mode 100644 Apps/W1/Sustainability/app/src/Purchase/SustPurchInvoiceStats.PageExt.al create mode 100644 Apps/W1/Sustainability/app/src/Purchase/SustPurchOrderStats.PageExt.al create mode 100644 Apps/W1/Sustainability/app/src/Purchase/SustPurchOrderSubform.PageExt.al create mode 100644 Apps/W1/Sustainability/app/src/Purchase/SustPurchRcptLine.TableExt.al create mode 100644 Apps/W1/Sustainability/app/src/Purchase/SustPurchRetOrdSubform.PageExt.al create mode 100644 Apps/W1/Sustainability/app/src/Purchase/SustPurchRetShptLine.TableExt.al create mode 100644 Apps/W1/Sustainability/app/src/Purchase/SustPurchStatistics.PageExt.al create mode 100644 Apps/W1/Sustainability/app/src/Purchase/SustPurchaseCopyDocument.Codeunit.al create mode 100644 Apps/W1/Sustainability/app/src/Purchase/SustPurchaseSubscriber.Codeunit.al create mode 100644 Apps/W1/Sustainability/app/src/Purchase/SustainabilityPurchHeader.TableExt.al create mode 100644 Apps/W1/Sustainability/app/src/Purchase/SustainabilityPurchLine.TableExt.al create mode 100644 Apps/W1/Sustainability/app/src/RoleCenters/CH4EmissionRatioChart.Page.al create mode 100644 Apps/W1/Sustainability/app/src/RoleCenters/ComputeSustGoalCue.Codeunit.al create mode 100644 Apps/W1/Sustainability/app/src/RoleCenters/EmissionScopeRatioChart.Page.al create mode 100644 Apps/W1/Sustainability/app/src/RoleCenters/HeadlineSustainabilityRC.Page.al create mode 100644 Apps/W1/Sustainability/app/src/RoleCenters/N2OEmissionRatioChart.Page.al create mode 100644 Apps/W1/Sustainability/app/src/RoleCenters/RCHeadlinePageSust.Codeunit.al create mode 100644 Apps/W1/Sustainability/app/src/RoleCenters/SustainabilityActivities.Page.al create mode 100644 Apps/W1/Sustainability/app/src/RoleCenters/SustainabilityChartMgmt.Codeunit.al create mode 100644 Apps/W1/Sustainability/app/src/RoleCenters/SustainabilityCue.Table.al create mode 100644 Apps/W1/Sustainability/app/src/RoleCenters/SustainabilityGoalCue.Page.al create mode 100644 Apps/W1/Sustainability/app/src/RoleCenters/SustainabilityGoalCue.Table.al create mode 100644 Apps/W1/Sustainability/app/src/RoleCenters/SustainabilityManager.Profile.al create mode 100644 Apps/W1/Sustainability/app/src/RoleCenters/SustainabilityManagerRC.Page.al create mode 100644 Apps/W1/Sustainability/app/src/Scorecard/SustainabilityGoal.Table.al create mode 100644 Apps/W1/Sustainability/app/src/Scorecard/SustainabilityGoals.Page.al create mode 100644 Apps/W1/Sustainability/app/src/Scorecard/SustainabilityScorecard.Page.al create mode 100644 Apps/W1/Sustainability/app/src/Scorecard/SustainabilityScorecard.Table.al create mode 100644 Apps/W1/Sustainability/app/src/Scorecard/SustainabilityScorecards.Page.al create mode 100644 Apps/W1/Sustainability/app/src/Setup/SustUserSetup.PageExt.al create mode 100644 Apps/W1/Sustainability/app/src/Setup/UserSetupTabExt.TableExt.al create mode 100644 Apps/W1/Sustainability/test/src/SustCertificateTest.Codeunit.al create mode 100644 Apps/W1/Sustainability/test/src/SustainabilityFinancialTest.Codeunit.al create mode 100644 Build/DisabledTests/EDocumentTests.json create mode 100644 Build/DisabledTests/FSIntegrationTest.json create mode 100644 Build/DisabledTests/OrderTakerAgent.json create mode 100644 Build/DisabledTests/SalesOrderTakingAgentTests.json create mode 100644 Build/projects/1st Party Apps Tests (W1)/.AL-Go/ImportTestToolkitToBcContainer.ps1 delete mode 100644 Other/Tests/BCPT-SampleTests/app.json delete mode 100644 Other/Tests/BCPT-SampleTests/logo/ExtensionLogo.png delete mode 100644 Other/Tests/BCPT-SampleTests/src/BCPTAdjustCostItemEntries.Codeunit.al delete mode 100644 Other/Tests/BCPT-SampleTests/src/BCPTCalculatePlanWorksheet.Codeunit.al delete mode 100644 Other/Tests/BCPT-SampleTests/src/BCPTCreateCustomer.Codeunit.al delete mode 100644 Other/Tests/BCPT-SampleTests/src/BCPTCreateItem.Codeunit.al delete mode 100644 Other/Tests/BCPT-SampleTests/src/BCPTCreatePOWithNLines.Codeunit.al delete mode 100644 Other/Tests/BCPT-SampleTests/src/BCPTCreateSOWithNLines.Codeunit.al delete mode 100644 Other/Tests/BCPT-SampleTests/src/BCPTCreateSQWithNLines.Codeunit.al delete mode 100644 Other/Tests/BCPT-SampleTests/src/BCPTCreateVendor.Codeunit.al delete mode 100644 Other/Tests/BCPT-SampleTests/src/BCPTDetailTrialBalReport.Codeunit.al delete mode 100644 Other/Tests/BCPT-SampleTests/src/BCPTMakeWebCall.Codeunit.al delete mode 100644 Other/Tests/BCPT-SampleTests/src/BCPTOpenChartOfAccounts.Codeunit.al delete mode 100644 Other/Tests/BCPT-SampleTests/src/BCPTOpenCustomerList.Codeunit.al delete mode 100644 Other/Tests/BCPT-SampleTests/src/BCPTOpenItemList.Codeunit.al delete mode 100644 Other/Tests/BCPT-SampleTests/src/BCPTOpenPurchInvoiceList.Codeunit.al delete mode 100644 Other/Tests/BCPT-SampleTests/src/BCPTOpenRoleCenterSOP.Codeunit.al delete mode 100644 Other/Tests/BCPT-SampleTests/src/BCPTOpenSalesInvoiceList.Codeunit.al delete mode 100644 Other/Tests/BCPT-SampleTests/src/BCPTOpenVendorList.Codeunit.al delete mode 100644 Other/Tests/BCPT-SampleTests/src/BCPTPostGLEntries.Codeunit.al delete mode 100644 Other/Tests/BCPT-SampleTests/src/BCPTPostItemJournal.Codeunit.al delete mode 100644 Other/Tests/BCPT-SampleTests/src/BCPTPostPurchInv.Codeunit.al delete mode 100644 Other/Tests/BCPT-SampleTests/src/BCPTPurchPostWithNLines.Codeunit.al delete mode 100644 Other/Tests/BCPT-SampleTests/src/BCPTSQLPing.Codeunit.al delete mode 100644 Other/Tests/BCPT-SampleTests/src/BCPTSalesPostWithNLines.Codeunit.al delete mode 100644 Other/Tests/BCPT-SampleTests/src/BCPTSleep1s.Codeunit.al delete mode 100644 Other/Tests/BCPT-SampleTests/src/TestCodeunitsWithParams.Enum.al diff --git a/.github/AL-Go-Settings.json b/.github/AL-Go-Settings.json index 379ec9f4f4..853cc4ea04 100644 --- a/.github/AL-Go-Settings.json +++ b/.github/AL-Go-Settings.json @@ -5,7 +5,7 @@ "runs-on": "windows-latest", "cacheImageName": "", "UsePsSession": false, - "artifact": "https://bcinsider-fvh2ekdjecfjd6gk.b02.azurefd.net/sandbox/25.0.20906.0/base", + "artifact": "https://bcinsider-fvh2ekdjecfjd6gk.b02.azurefd.net/sandbox/25.0.23141.0/base", "country": "base", "useProjectDependencies": true, "repoVersion": "25.0", @@ -58,5 +58,5 @@ ], "UpdateALGoSystemFilesEnvironment": "Official-Build", "PullRequestTrigger": "pull_request", - "templateSha": "0476547896ebcd3ba5455b3e0e59b48c0d4a26ca" + "templateSha": "9308ffb724a39179ea32dd55c838f176903a2a5c" } diff --git a/.github/workflows/CICD.yaml b/.github/workflows/CICD.yaml index bfa1b2868c..2ff586e083 100644 --- a/.github/workflows/CICD.yaml +++ b/.github/workflows/CICD.yaml @@ -14,8 +14,10 @@ defaults: shell: powershell permissions: - contents: read actions: read + contents: read + id-token: write + pages: read env: workflowDepth: 2 @@ -39,31 +41,31 @@ jobs: projects: ${{ steps.determineProjectsToBuild.outputs.ProjectsJson }} projectDependenciesJson: ${{ steps.determineProjectsToBuild.outputs.ProjectDependenciesJson }} buildOrderJson: ${{ steps.determineProjectsToBuild.outputs.BuildOrderJson }} + powerPlatformSolutionFolder: ${{ steps.DeterminePowerPlatformSolutionFolder.outputs.powerPlatformSolutionFolder }} workflowDepth: ${{ steps.DetermineWorkflowDepth.outputs.WorkflowDepth }} steps: - name: Dump Workflow Information - uses: microsoft/AL-Go/Actions/DumpWorkflowInfo@4c5bfbca1adebbf997f63882df4b9074a19aac1d + uses: microsoft/AL-Go/Actions/DumpWorkflowInfo@564c339085ae0ffa74c5bde71c15fea7fe54bbf1 with: shell: powershell - name: Checkout - uses: actions/checkout@v4 + uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 with: lfs: true - name: Initialize the workflow id: init - uses: microsoft/AL-Go/Actions/WorkflowInitialize@4c5bfbca1adebbf997f63882df4b9074a19aac1d + uses: microsoft/AL-Go/Actions/WorkflowInitialize@564c339085ae0ffa74c5bde71c15fea7fe54bbf1 with: shell: powershell - eventId: "DO0091" - name: Read settings id: ReadSettings - uses: microsoft/AL-Go/Actions/ReadSettings@4c5bfbca1adebbf997f63882df4b9074a19aac1d + uses: microsoft/AL-Go/Actions/ReadSettings@564c339085ae0ffa74c5bde71c15fea7fe54bbf1 with: shell: powershell - get: type + get: type, powerPlatformSolutionFolder - name: Determine Workflow Depth id: DetermineWorkflowDepth @@ -72,14 +74,20 @@ jobs: - name: Determine Projects To Build id: determineProjectsToBuild - uses: microsoft/AL-Go/Actions/DetermineProjectsToBuild@4c5bfbca1adebbf997f63882df4b9074a19aac1d + uses: microsoft/AL-Go/Actions/DetermineProjectsToBuild@564c339085ae0ffa74c5bde71c15fea7fe54bbf1 with: shell: powershell maxBuildDepth: ${{ env.workflowDepth }} + - name: Determine PowerPlatform Solution Folder + id: DeterminePowerPlatformSolutionFolder + if: env.type == 'PTE' + run: | + Add-Content -Encoding UTF8 -Path $env:GITHUB_OUTPUT -Value "powerPlatformSolutionFolder=$($env:powerPlatformSolutionFolder)" + - name: Determine Delivery Target Secrets id: DetermineDeliveryTargetSecrets - uses: microsoft/AL-Go/Actions/DetermineDeliveryTargets@4c5bfbca1adebbf997f63882df4b9074a19aac1d + uses: microsoft/AL-Go/Actions/DetermineDeliveryTargets@564c339085ae0ffa74c5bde71c15fea7fe54bbf1 with: shell: powershell projectsJson: '${{ steps.determineProjectsToBuild.outputs.ProjectsJson }}' @@ -87,7 +95,7 @@ jobs: - name: Read secrets id: ReadSecrets - uses: microsoft/AL-Go/Actions/ReadSecrets@4c5bfbca1adebbf997f63882df4b9074a19aac1d + uses: microsoft/AL-Go/Actions/ReadSecrets@564c339085ae0ffa74c5bde71c15fea7fe54bbf1 with: shell: powershell gitHubSecrets: ${{ toJson(secrets) }} @@ -95,7 +103,7 @@ jobs: - name: Determine Delivery Targets id: DetermineDeliveryTargets - uses: microsoft/AL-Go/Actions/DetermineDeliveryTargets@4c5bfbca1adebbf997f63882df4b9074a19aac1d + uses: microsoft/AL-Go/Actions/DetermineDeliveryTargets@564c339085ae0ffa74c5bde71c15fea7fe54bbf1 env: Secrets: '${{ steps.ReadSecrets.outputs.Secrets }}' with: @@ -105,7 +113,7 @@ jobs: - name: Determine Deployment Environments id: DetermineDeploymentEnvironments - uses: microsoft/AL-Go/Actions/DetermineDeploymentEnvironments@4c5bfbca1adebbf997f63882df4b9074a19aac1d + uses: microsoft/AL-Go/Actions/DetermineDeploymentEnvironments@564c339085ae0ffa74c5bde71c15fea7fe54bbf1 env: GITHUB_TOKEN: ${{ github.token }} with: @@ -118,16 +126,16 @@ jobs: runs-on: [ windows-latest ] steps: - name: Checkout - uses: actions/checkout@v4 + uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 - name: Read settings - uses: microsoft/AL-Go/Actions/ReadSettings@4c5bfbca1adebbf997f63882df4b9074a19aac1d + uses: microsoft/AL-Go/Actions/ReadSettings@564c339085ae0ffa74c5bde71c15fea7fe54bbf1 with: shell: powershell get: templateUrl - name: Check for updates to AL-Go system files - uses: microsoft/AL-Go/Actions/CheckForUpdates@4c5bfbca1adebbf997f63882df4b9074a19aac1d + uses: microsoft/AL-Go/Actions/CheckForUpdates@564c339085ae0ffa74c5bde71c15fea7fe54bbf1 with: shell: powershell templateUrl: ${{ env.templateUrl }} @@ -146,7 +154,6 @@ jobs: with: shell: ${{ needs.Initialization.outputs.githubRunnerShell }} runsOn: ${{ needs.Initialization.outputs.githubRunner }} - parentTelemetryScopeJson: ${{ needs.Initialization.outputs.telemetryScopeJson }} project: ${{ matrix.project }} projectName: ${{ matrix.projectName }} buildMode: ${{ matrix.buildMode }} @@ -170,7 +177,6 @@ jobs: with: shell: ${{ needs.Initialization.outputs.githubRunnerShell }} runsOn: ${{ needs.Initialization.outputs.githubRunner }} - parentTelemetryScopeJson: ${{ needs.Initialization.outputs.telemetryScopeJson }} project: ${{ matrix.project }} projectName: ${{ matrix.projectName }} buildMode: ${{ matrix.buildMode }} @@ -181,13 +187,27 @@ jobs: signArtifacts: true useArtifactCache: true + BuildPP: + needs: [ Initialization ] + if: (!failure()) && (!cancelled()) && needs.Initialization.outputs.powerPlatformSolutionFolder != '' + name: Build PowerPlatform Solution + uses: ./.github/workflows/_BuildPowerPlatformSolution.yaml + secrets: inherit + with: + shell: ${{ needs.Initialization.outputs.githubRunnerShell }} + runsOn: ${{ needs.Initialization.outputs.githubRunner }} + parentTelemetryScopeJson: ${{ needs.Initialization.outputs.telemetryScopeJson }} + project: ${{ needs.Initialization.outputs.powerPlatformSolutionFolder }} + projectName: ${{ needs.Initialization.outputs.powerPlatformSolutionFolder }} + publishArtifacts: ${{ github.ref_name == 'main' || startswith(github.ref_name, 'release/') || startswith(github.ref_name, 'releases/') || needs.Initialization.outputs.deliveryTargetsJson != '[]' || needs.Initialization.outputs.environmentCount > 0 }} + DeployALDoc: needs: [ Initialization, Build ] - if: always() && needs.Build.result == 'Success' && needs.Initialization.outputs.generateALDocArtifact == 1 && github.ref_name == 'main' - runs-on: windows-latest + if: (!cancelled()) && needs.Build.result == 'Success' && needs.Initialization.outputs.generateALDocArtifact == 1 && github.ref_name == 'main' + runs-on: [ windows-latest ] name: Deploy Reference Documentation permissions: - contents: write + contents: read actions: read pages: write id-token: write @@ -196,60 +216,64 @@ jobs: url: ${{ steps.deployment.outputs.page_url }} steps: - name: Checkout - uses: actions/checkout@v4 + uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 - name: Download artifacts - uses: actions/download-artifact@v4 + uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8 with: path: '.artifacts' - name: Read settings - uses: microsoft/AL-Go/Actions/ReadSettings@4c5bfbca1adebbf997f63882df4b9074a19aac1d + uses: microsoft/AL-Go/Actions/ReadSettings@564c339085ae0ffa74c5bde71c15fea7fe54bbf1 with: shell: powershell - name: Setup Pages if: needs.Initialization.outputs.deployALDocArtifact == 1 - uses: actions/configure-pages@v4 + uses: actions/configure-pages@983d7736d9b0ae728b81ab479565c72886d7745b # v5.0.0 - name: Build Reference Documentation - uses: microsoft/AL-Go/Actions/BuildReferenceDocumentation@4c5bfbca1adebbf997f63882df4b9074a19aac1d + uses: microsoft/AL-Go/Actions/BuildReferenceDocumentation@564c339085ae0ffa74c5bde71c15fea7fe54bbf1 with: shell: powershell artifacts: '.artifacts' - name: Upload pages artifact - uses: actions/upload-pages-artifact@v3 + uses: actions/upload-pages-artifact@56afc609e74202658d3ffba0e8f6dda462b719fa # v3.0.1 with: path: ".aldoc/_site/" - name: Deploy to GitHub Pages if: needs.Initialization.outputs.deployALDocArtifact == 1 id: deployment - uses: actions/deploy-pages@v4 + uses: actions/deploy-pages@d6db90164ac5ed86f2b6aed7e0febac5b3c0c03e # v4.0.5 Deploy: - needs: [ Initialization, Build ] - if: always() && needs.Build.result == 'Success' && needs.Initialization.outputs.environmentCount > 0 + needs: [ Initialization, Build, BuildPP ] + if: (!cancelled()) && (needs.Build.result == 'success' || needs.Build.result == 'skipped') && (needs.BuildPP.result == 'success' || needs.BuildPP.result == 'skipped') && needs.Initialization.outputs.environmentCount > 0 strategy: ${{ fromJson(needs.Initialization.outputs.environmentsMatrixJson) }} runs-on: ${{ fromJson(matrix.os) }} name: Deploy to ${{ matrix.environment }} + defaults: + run: + shell: ${{ matrix.shell }} environment: name: ${{ matrix.environment }} url: ${{ steps.Deploy.outputs.environmentUrl }} steps: - name: Checkout - uses: actions/checkout@v4 + uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 - name: Download artifacts - uses: actions/download-artifact@v4 + uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8 with: path: '.artifacts' - name: Read settings - uses: microsoft/AL-Go/Actions/ReadSettings@4c5bfbca1adebbf997f63882df4b9074a19aac1d + uses: microsoft/AL-Go/Actions/ReadSettings@564c339085ae0ffa74c5bde71c15fea7fe54bbf1 with: - shell: powershell + shell: ${{ matrix.shell }} + get: type,powerPlatformSolutionFolder - name: EnvName id: envName @@ -260,27 +284,38 @@ jobs: - name: Read secrets id: ReadSecrets - uses: microsoft/AL-Go/Actions/ReadSecrets@4c5bfbca1adebbf997f63882df4b9074a19aac1d + uses: microsoft/AL-Go/Actions/ReadSecrets@564c339085ae0ffa74c5bde71c15fea7fe54bbf1 with: - shell: powershell + shell: ${{ matrix.shell }} gitHubSecrets: ${{ toJson(secrets) }} - getSecrets: '${{ steps.envName.outputs.envName }}-AuthContext,${{ steps.envName.outputs.envName }}_AuthContext,AuthContext,${{ steps.envName.outputs.envName }}-EnvironmentName,${{ steps.envName.outputs.envName }}_EnvironmentName,EnvironmentName,projects' + getSecrets: '${{ steps.envName.outputs.envName }}-AuthContext,${{ steps.envName.outputs.envName }}_AuthContext,AuthContext' - - name: Deploy + - name: Deploy to Business Central id: Deploy - uses: microsoft/AL-Go/Actions/Deploy@4c5bfbca1adebbf997f63882df4b9074a19aac1d + uses: microsoft/AL-Go/Actions/Deploy@564c339085ae0ffa74c5bde71c15fea7fe54bbf1 env: Secrets: '${{ steps.ReadSecrets.outputs.Secrets }}' with: - shell: powershell + shell: ${{ matrix.shell }} environmentName: ${{ matrix.environment }} - artifacts: '.artifacts' + artifactsFolder: '.artifacts' type: 'CD' deploymentEnvironmentsJson: ${{ needs.Initialization.outputs.deploymentEnvironmentsJson }} + - name: Deploy to Power Platform + if: env.type == 'PTE' && env.powerPlatformSolutionFolder != '' + uses: microsoft/AL-Go/Actions/DeployPowerPlatform@564c339085ae0ffa74c5bde71c15fea7fe54bbf1 + env: + Secrets: '${{ steps.ReadSecrets.outputs.Secrets }}' + with: + shell: powershell + environmentName: ${{ matrix.environment }} + artifactsFolder: '.artifacts' + deploymentEnvironmentsJson: ${{ needs.Initialization.outputs.deploymentEnvironmentsJson }} + Deliver: - needs: [ Initialization, Build ] - if: always() && needs.Build.result == 'Success' && needs.Initialization.outputs.deliveryTargetsJson != '[]' + needs: [ Initialization, Build, BuildPP ] + if: (!cancelled()) && (needs.Build.result == 'success' || needs.Build.result == 'skipped') && (needs.BuildPP.result == 'success' || needs.BuildPP.result == 'skipped') && needs.Initialization.outputs.deliveryTargetsJson != '[]' strategy: matrix: deliveryTarget: ${{ fromJson(needs.Initialization.outputs.deliveryTargetsJson) }} @@ -289,28 +324,28 @@ jobs: name: Deliver to ${{ matrix.deliveryTarget }} steps: - name: Checkout - uses: actions/checkout@v4 + uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 - name: Download artifacts - uses: actions/download-artifact@v4 + uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8 with: path: '.artifacts' - name: Read settings - uses: microsoft/AL-Go/Actions/ReadSettings@4c5bfbca1adebbf997f63882df4b9074a19aac1d + uses: microsoft/AL-Go/Actions/ReadSettings@564c339085ae0ffa74c5bde71c15fea7fe54bbf1 with: shell: powershell - name: Read secrets id: ReadSecrets - uses: microsoft/AL-Go/Actions/ReadSecrets@4c5bfbca1adebbf997f63882df4b9074a19aac1d + uses: microsoft/AL-Go/Actions/ReadSecrets@564c339085ae0ffa74c5bde71c15fea7fe54bbf1 with: shell: powershell gitHubSecrets: ${{ toJson(secrets) }} getSecrets: '${{ matrix.deliveryTarget }}Context' - name: Deliver - uses: microsoft/AL-Go/Actions/Deliver@4c5bfbca1adebbf997f63882df4b9074a19aac1d + uses: microsoft/AL-Go/Actions/Deliver@564c339085ae0ffa74c5bde71c15fea7fe54bbf1 env: Secrets: '${{ steps.ReadSecrets.outputs.Secrets }}' with: @@ -321,17 +356,19 @@ jobs: artifacts: '.artifacts' PostProcess: - needs: [ Initialization, Build, Deploy, Deliver, DeployALDoc ] + needs: [ Initialization, Build, BuildPP, Deploy, Deliver, DeployALDoc ] if: (!cancelled()) runs-on: [ windows-latest ] steps: - name: Checkout - uses: actions/checkout@v4 + uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 - name: Finalize the workflow id: PostProcess - uses: microsoft/AL-Go/Actions/WorkflowPostProcess@4c5bfbca1adebbf997f63882df4b9074a19aac1d + uses: microsoft/AL-Go/Actions/WorkflowPostProcess@564c339085ae0ffa74c5bde71c15fea7fe54bbf1 + env: + GITHUB_TOKEN: ${{ github.token }} with: shell: powershell - eventId: "DO0091" telemetryScopeJson: ${{ needs.Initialization.outputs.telemetryScopeJson }} + currentJobContext: ${{ toJson(job) }} diff --git a/.github/workflows/DeployReferenceDocumentation.yaml b/.github/workflows/DeployReferenceDocumentation.yaml index 90e471b173..d848967b4f 100644 --- a/.github/workflows/DeployReferenceDocumentation.yaml +++ b/.github/workflows/DeployReferenceDocumentation.yaml @@ -4,10 +4,10 @@ on: workflow_dispatch: permissions: - contents: write actions: read - pages: write + contents: read id-token: write + pages: write defaults: run: @@ -26,46 +26,55 @@ jobs: url: ${{ steps.deployment.outputs.page_url }} steps: - name: Checkout - uses: actions/checkout@v4 + uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 - name: Initialize the workflow id: init - uses: microsoft/AL-Go/Actions/WorkflowInitialize@4c5bfbca1adebbf997f63882df4b9074a19aac1d + uses: microsoft/AL-Go/Actions/WorkflowInitialize@564c339085ae0ffa74c5bde71c15fea7fe54bbf1 with: shell: powershell - eventId: "DO0097" - + - name: Read settings - uses: microsoft/AL-Go/Actions/ReadSettings@4c5bfbca1adebbf997f63882df4b9074a19aac1d + uses: microsoft/AL-Go/Actions/ReadSettings@564c339085ae0ffa74c5bde71c15fea7fe54bbf1 with: shell: powershell - name: Determine Deployment Environments id: DetermineDeploymentEnvironments - uses: microsoft/AL-Go/Actions/DetermineDeploymentEnvironments@4c5bfbca1adebbf997f63882df4b9074a19aac1d + uses: microsoft/AL-Go/Actions/DetermineDeploymentEnvironments@564c339085ae0ffa74c5bde71c15fea7fe54bbf1 env: GITHUB_TOKEN: ${{ github.token }} with: shell: powershell getEnvironments: 'github-pages' type: 'Publish' - + - name: Setup Pages if: steps.DetermineDeploymentEnvironments.outputs.deployALDocArtifact == 1 - uses: actions/configure-pages@v4 - + uses: actions/configure-pages@983d7736d9b0ae728b81ab479565c72886d7745b # v5.0.0 + - name: Build Reference Documentation - uses: microsoft/AL-Go/Actions/BuildReferenceDocumentation@4c5bfbca1adebbf997f63882df4b9074a19aac1d + uses: microsoft/AL-Go/Actions/BuildReferenceDocumentation@564c339085ae0ffa74c5bde71c15fea7fe54bbf1 with: shell: powershell artifacts: 'latest' - + - name: Upload pages artifact - uses: actions/upload-pages-artifact@v3 + uses: actions/upload-pages-artifact@56afc609e74202658d3ffba0e8f6dda462b719fa # v3.0.1 with: path: ".aldoc/_site/" - + - name: Deploy to GitHub Pages if: steps.DetermineDeploymentEnvironments.outputs.deployALDocArtifact == 1 id: deployment - uses: actions/deploy-pages@v4 + uses: actions/deploy-pages@d6db90164ac5ed86f2b6aed7e0febac5b3c0c03e # v4.0.5 + + - name: Finalize the workflow + if: always() + uses: microsoft/AL-Go/Actions/WorkflowPostProcess@564c339085ae0ffa74c5bde71c15fea7fe54bbf1 + env: + GITHUB_TOKEN: ${{ github.token }} + with: + shell: powershell + telemetryScopeJson: ${{ steps.init.outputs.telemetryScopeJson }} + currentJobContext: ${{ toJson(job) }} diff --git a/.github/workflows/PullPowerPlatformChanges.yaml b/.github/workflows/PullPowerPlatformChanges.yaml new file mode 100644 index 0000000000..5781dc153b --- /dev/null +++ b/.github/workflows/PullPowerPlatformChanges.yaml @@ -0,0 +1,111 @@ +name: ' Pull Power Platform changes' + +on: + workflow_dispatch: + inputs: + environment: + description: Environment to pull changes from + required: true + solutionFolder: + description: Folder name of the Power Platform solution (leave empty to use AL-Go setting) + required: false + directCommit: + description: Direct Commit? + type: boolean + default: false + useGhTokenWorkflow: + description: Use GhTokenWorkflow for PR/Commit? + type: boolean + default: false + +permissions: + actions: read + contents: write + id-token: write + pull-requests: write + +defaults: + run: + shell: powershell + +jobs: + PullChanges: + runs-on: [windows-latest] + name: Pull changes from ${{ inputs.environment }} + steps: + - name: Checkout + uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 + + - name: Initialize the workflow + id: init + uses: microsoft/AL-Go/Actions/WorkflowInitialize@564c339085ae0ffa74c5bde71c15fea7fe54bbf1 + with: + shell: powershell + + - name: EnvName + env: + _environment: ${{ inputs.environment }} + run: | + $errorActionPreference = "Stop"; $ProgressPreference = "SilentlyContinue"; Set-StrictMode -Version 2.0 + $envName = "$env:_environment".Split(' ')[0] + Add-Content -encoding utf8 -Path $env:GITHUB_ENV -Value "envName=$envName" + + - name: Read settings + uses: microsoft/AL-Go/Actions/ReadSettings@564c339085ae0ffa74c5bde71c15fea7fe54bbf1 + with: + shell: powershell + get: powerPlatformSolutionFolder + + - name: Read secrets + id: ReadSecrets + uses: microsoft/AL-Go/Actions/ReadSecrets@564c339085ae0ffa74c5bde71c15fea7fe54bbf1 + with: + shell: powershell + gitHubSecrets: ${{ toJson(secrets) }} + getSecrets: '${{ env.envName }}-AuthContext,${{ env.envName }}_AuthContext,AuthContext,TokenForPush' + useGhTokenWorkflowForPush: '${{ github.event.inputs.useGhTokenWorkflow }}' + + - name: Determine Deployment Environments + id: DetermineDeploymentEnvironments + uses: microsoft/AL-Go/Actions/DetermineDeploymentEnvironments@564c339085ae0ffa74c5bde71c15fea7fe54bbf1 + env: + GITHUB_TOKEN: ${{ github.token }} + with: + shell: powershell + getEnvironments: ${{ inputs.environment }} + type: 'All' + + - name: Set Power Platform solution folder + env: + _solutionFolder: ${{ inputs.solutionFolder }} + run: | + $errorActionPreference = "Stop"; $ProgressPreference = "SilentlyContinue"; Set-StrictMode -Version 2.0 + $solutionFolder = $env:_solutionFolder + if ($solutionFolder -eq '') { + Write-Host "Solution folder is not provided. Taking the folder from AL-Go settings" + $solutionFolder = $env:powerPlatformSolutionFolder + } + Write-Host "Solution folder: $solutionFolder" + Add-Content -encoding utf8 -Path $env:GITHUB_ENV -Value "solutionFolder=$solutionFolder" + + - name: Pull changes from Power Platform environment + uses: microsoft/AL-Go/Actions/PullPowerPlatformChanges@564c339085ae0ffa74c5bde71c15fea7fe54bbf1 + env: + Secrets: '${{ steps.ReadSecrets.outputs.Secrets }}' + with: + shell: powershell + token: ${{ steps.ReadSecrets.outputs.TokenForPush }} + directCommit: ${{ inputs.directCommit }} + environmentName: ${{ inputs.environment }} + solutionFolder: ${{ env.solutionFolder }} + deploymentEnvironmentsJson: ${{ steps.DetermineDeploymentEnvironments.outputs.deploymentEnvironmentsJson }} + + - name: Finalize the workflow + if: always() + uses: microsoft/AL-Go/Actions/WorkflowPostProcess@564c339085ae0ffa74c5bde71c15fea7fe54bbf1 + env: + GITHUB_TOKEN: ${{ github.token }} + with: + shell: powershell + telemetryScopeJson: ${{ steps.init.outputs.telemetryScopeJson }} + currentJobContext: ${{ toJson(job) }} diff --git a/.github/workflows/PullRequestHandler.yaml b/.github/workflows/PullRequestHandler.yaml index 0b377c6d2f..f8cb7637dd 100644 --- a/.github/workflows/PullRequestHandler.yaml +++ b/.github/workflows/PullRequestHandler.yaml @@ -13,8 +13,9 @@ defaults: shell: powershell permissions: - contents: read actions: read + contents: read + id-token: write pull-requests: read env: @@ -25,16 +26,15 @@ env: jobs: PregateCheck: if: (github.event.pull_request.base.repo.full_name != github.event.pull_request.head.repo.full_name) && (github.event_name != 'pull_request') - runs-on: [ windows-latest ] + runs-on: windows-latest steps: - - uses: microsoft/AL-Go/Actions/VerifyPRChanges@4c5bfbca1adebbf997f63882df4b9074a19aac1d + - uses: microsoft/AL-Go/Actions/VerifyPRChanges@564c339085ae0ffa74c5bde71c15fea7fe54bbf1 Initialization: needs: [ PregateCheck ] if: (!failure() && !cancelled()) runs-on: [ windows-latest ] outputs: - telemetryScopeJson: ${{ steps.init.outputs.telemetryScopeJson }} githubRunner: ${{ steps.ReadSettings.outputs.GitHubRunnerJson }} githubRunnerShell: ${{ steps.ReadSettings.outputs.GitHubRunnerShell }} projects: ${{ steps.determineProjectsToBuild.outputs.ProjectsJson }} @@ -42,28 +42,28 @@ jobs: buildOrderJson: ${{ steps.determineProjectsToBuild.outputs.BuildOrderJson }} baselineWorkflowRunId: ${{ steps.determineProjectsToBuild.outputs.BaselineWorkflowRunId }} workflowDepth: ${{ steps.DetermineWorkflowDepth.outputs.WorkflowDepth }} + telemetryScopeJson: ${{ steps.init.outputs.telemetryScopeJson }} steps: - name: Dump Workflow Information - uses: microsoft/AL-Go/Actions/DumpWorkflowInfo@4c5bfbca1adebbf997f63882df4b9074a19aac1d + uses: microsoft/AL-Go/Actions/DumpWorkflowInfo@564c339085ae0ffa74c5bde71c15fea7fe54bbf1 with: shell: powershell - name: Checkout - uses: actions/checkout@v4 + uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 with: lfs: true - ref: refs/pull/${{ github.event.number }}/merge + ref: ${{ github.event_name == 'pull_request' && github.sha || format('refs/pull/{0}/merge', github.event.pull_request.number) }} - name: Initialize the workflow id: init - uses: microsoft/AL-Go/Actions/WorkflowInitialize@4c5bfbca1adebbf997f63882df4b9074a19aac1d + uses: microsoft/AL-Go/Actions/WorkflowInitialize@564c339085ae0ffa74c5bde71c15fea7fe54bbf1 with: shell: powershell - eventId: "DO0104" - name: Read settings id: ReadSettings - uses: microsoft/AL-Go/Actions/ReadSettings@4c5bfbca1adebbf997f63882df4b9074a19aac1d + uses: microsoft/AL-Go/Actions/ReadSettings@564c339085ae0ffa74c5bde71c15fea7fe54bbf1 with: shell: powershell @@ -74,7 +74,7 @@ jobs: - name: Determine Projects To Build id: determineProjectsToBuild - uses: microsoft/AL-Go/Actions/DetermineProjectsToBuild@4c5bfbca1adebbf997f63882df4b9074a19aac1d + uses: microsoft/AL-Go/Actions/DetermineProjectsToBuild@564c339085ae0ffa74c5bde71c15fea7fe54bbf1 with: shell: powershell maxBuildDepth: ${{ env.workflowDepth }} @@ -92,8 +92,7 @@ jobs: with: shell: ${{ needs.Initialization.outputs.githubRunnerShell }} runsOn: ${{ needs.Initialization.outputs.githubRunner }} - checkoutRef: refs/pull/${{ github.event.number }}/merge - parentTelemetryScopeJson: ${{ needs.Initialization.outputs.telemetryScopeJson }} + checkoutRef: ${{ github.event_name == 'pull_request' && github.sha || format('refs/pull/{0}/merge', github.event.pull_request.number) }} project: ${{ matrix.project }} projectName: ${{ matrix.projectName }} buildMode: ${{ matrix.buildMode }} @@ -116,8 +115,7 @@ jobs: with: shell: ${{ needs.Initialization.outputs.githubRunnerShell }} runsOn: ${{ needs.Initialization.outputs.githubRunner }} - checkoutRef: refs/pull/${{ github.event.number }}/merge - parentTelemetryScopeJson: ${{ needs.Initialization.outputs.telemetryScopeJson }} + checkoutRef: ${{ github.event_name == 'pull_request' && github.sha || format('refs/pull/{0}/merge', github.event.pull_request.number) }} project: ${{ matrix.project }} projectName: ${{ matrix.projectName }} buildMode: ${{ matrix.buildMode }} @@ -135,8 +133,19 @@ jobs: steps: - name: Pull Request Status Check id: PullRequestStatusCheck - uses: microsoft/AL-Go/Actions/PullRequestStatusCheck@4c5bfbca1adebbf997f63882df4b9074a19aac1d + uses: microsoft/AL-Go/Actions/PullRequestStatusCheck@564c339085ae0ffa74c5bde71c15fea7fe54bbf1 + env: + GITHUB_TOKEN: ${{ github.token }} + with: + shell: powershell + + - name: Finalize the workflow + id: PostProcess + uses: microsoft/AL-Go/Actions/WorkflowPostProcess@564c339085ae0ffa74c5bde71c15fea7fe54bbf1 + if: success() || failure() env: GITHUB_TOKEN: ${{ github.token }} with: shell: powershell + telemetryScopeJson: ${{ needs.Initialization.outputs.telemetryScopeJson }} + currentJobContext: ${{ toJson(job) }} diff --git a/.github/workflows/PushPowerPlatformChanges.yaml b/.github/workflows/PushPowerPlatformChanges.yaml new file mode 100644 index 0000000000..6c037390eb --- /dev/null +++ b/.github/workflows/PushPowerPlatformChanges.yaml @@ -0,0 +1,100 @@ +name: " Push Power Platform changes" + +on: + workflow_dispatch: + inputs: + environment: + description: Environment to push changes to + required: true + solutionFolder: + description: Folder name of the Power Platform solution (leave empty to use AL-Go setting) + required: false + +permissions: + actions: read + contents: read + id-token: write + +defaults: + run: + shell: powershell + +jobs: + PushChanges: + runs-on: [windows-latest] + name: Push changes to ${{ inputs.environment }} + steps: + - name: Checkout + uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 + + - name: Initialize the workflow + id: init + uses: microsoft/AL-Go/Actions/WorkflowInitialize@564c339085ae0ffa74c5bde71c15fea7fe54bbf1 + with: + shell: powershell + + - name: EnvName + env: + _environment: ${{ inputs.environment }} + run: | + $errorActionPreference = "Stop"; $ProgressPreference = "SilentlyContinue"; Set-StrictMode -Version 2.0 + # Environment names can contains spaces and tags (like (PROD) etc. We need to remove them to get the correct environment name) + $envName = "$env:_environment".Split(' ')[0] + Add-Content -encoding utf8 -Path $env:GITHUB_ENV -Value "envName=$envName" + + - name: Read settings + uses: microsoft/AL-Go/Actions/ReadSettings@564c339085ae0ffa74c5bde71c15fea7fe54bbf1 + with: + shell: powershell + get: powerPlatformSolutionFolder + + - name: Read secrets + id: ReadSecrets + uses: microsoft/AL-Go/Actions/ReadSecrets@564c339085ae0ffa74c5bde71c15fea7fe54bbf1 + with: + shell: powershell + gitHubSecrets: ${{ toJson(secrets) }} + getSecrets: '${{ env.envName }}-AuthContext,${{ env.envName }}_AuthContext,AuthContext' + + - name: Determine Deployment Environments + id: DetermineDeploymentEnvironments + uses: microsoft/AL-Go/Actions/DetermineDeploymentEnvironments@564c339085ae0ffa74c5bde71c15fea7fe54bbf1 + env: + GITHUB_TOKEN: ${{ github.token }} + with: + shell: powershell + getEnvironments: ${{ inputs.environment }} + type: 'All' + + - name: Set Power Platform solution folder + env: + _solutionFolder: ${{ inputs.solutionFolder }} + run: | + $errorActionPreference = "Stop"; $ProgressPreference = "SilentlyContinue"; Set-StrictMode -Version 2.0 + $solutionFolder = $env:_solutionFolder + if ($solutionFolder -eq '') { + Write-Host "Solution folder is not provided. Taking the folder from AL-Go settings" + $solutionFolder = $env:powerPlatformSolutionFolder + } + Write-Host "Solution folder: $solutionFolder" + Add-Content -encoding utf8 -Path $env:GITHUB_ENV -Value "solutionFolder=$solutionFolder" + + - name: Export and push changes to Power Platform + uses: microsoft/AL-Go/Actions/DeployPowerPlatform@564c339085ae0ffa74c5bde71c15fea7fe54bbf1 + env: + Secrets: '${{ steps.ReadSecrets.outputs.Secrets }}' + with: + shell: powershell + environmentName: ${{ inputs.environment }} + solutionFolder: ${{ env.solutionFolder }} + deploymentEnvironmentsJson: ${{ steps.DetermineDeploymentEnvironments.outputs.deploymentEnvironmentsJson }} + + - name: Finalize the workflow + if: always() + uses: microsoft/AL-Go/Actions/WorkflowPostProcess@564c339085ae0ffa74c5bde71c15fea7fe54bbf1 + env: + GITHUB_TOKEN: ${{ github.token }} + with: + shell: powershell + telemetryScopeJson: ${{ steps.init.outputs.telemetryScopeJson }} + currentJobContext: ${{ toJson(job) }} diff --git a/.github/workflows/Troubleshooting.yaml b/.github/workflows/Troubleshooting.yaml index ca8f8f5f20..d9f33a6f7a 100644 --- a/.github/workflows/Troubleshooting.yaml +++ b/.github/workflows/Troubleshooting.yaml @@ -9,8 +9,8 @@ on: default: false permissions: - contents: read actions: read + contents: read defaults: run: @@ -25,12 +25,12 @@ jobs: runs-on: [ windows-latest ] steps: - name: Checkout - uses: actions/checkout@v4 + uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 with: lfs: true - name: Troubleshooting - uses: microsoft/AL-Go/Actions/Troubleshooting@4c5bfbca1adebbf997f63882df4b9074a19aac1d + uses: microsoft/AL-Go/Actions/Troubleshooting@564c339085ae0ffa74c5bde71c15fea7fe54bbf1 with: shell: powershell gitHubSecrets: ${{ toJson(secrets) }} diff --git a/.github/workflows/UpdateGitHubGoSystemFiles.yaml b/.github/workflows/UpdateGitHubGoSystemFiles.yaml index aad5acc4c4..42642df61b 100644 --- a/.github/workflows/UpdateGitHubGoSystemFiles.yaml +++ b/.github/workflows/UpdateGitHubGoSystemFiles.yaml @@ -17,7 +17,9 @@ on: default: false permissions: + actions: read contents: read + id-token: write defaults: run: @@ -29,34 +31,34 @@ env: jobs: UpdateALGoSystemFiles: - needs: [ ] + name: 'Update AL-Go System Files' environment: Official-Build + needs: [ ] runs-on: [ windows-latest ] steps: - name: Dump Workflow Information - uses: microsoft/AL-Go/Actions/DumpWorkflowInfo@4c5bfbca1adebbf997f63882df4b9074a19aac1d + uses: microsoft/AL-Go/Actions/DumpWorkflowInfo@564c339085ae0ffa74c5bde71c15fea7fe54bbf1 with: shell: powershell - name: Checkout - uses: actions/checkout@v4 + uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 - name: Initialize the workflow id: init - uses: microsoft/AL-Go/Actions/WorkflowInitialize@4c5bfbca1adebbf997f63882df4b9074a19aac1d + uses: microsoft/AL-Go/Actions/WorkflowInitialize@564c339085ae0ffa74c5bde71c15fea7fe54bbf1 with: shell: powershell - eventId: "DO0098" - name: Read settings - uses: microsoft/AL-Go/Actions/ReadSettings@4c5bfbca1adebbf997f63882df4b9074a19aac1d + uses: microsoft/AL-Go/Actions/ReadSettings@564c339085ae0ffa74c5bde71c15fea7fe54bbf1 with: shell: powershell get: templateUrl - name: Read secrets id: ReadSecrets - uses: microsoft/AL-Go/Actions/ReadSecrets@4c5bfbca1adebbf997f63882df4b9074a19aac1d + uses: microsoft/AL-Go/Actions/ReadSecrets@564c339085ae0ffa74c5bde71c15fea7fe54bbf1 with: shell: powershell gitHubSecrets: ${{ toJson(secrets) }} @@ -92,7 +94,7 @@ jobs: Add-Content -Encoding UTF8 -Path $env:GITHUB_ENV -Value "downloadLatest=$downloadLatest" - name: Update AL-Go system files - uses: microsoft/AL-Go/Actions/CheckForUpdates@4c5bfbca1adebbf997f63882df4b9074a19aac1d + uses: microsoft/AL-Go/Actions/CheckForUpdates@564c339085ae0ffa74c5bde71c15fea7fe54bbf1 with: shell: powershell token: ${{ fromJson(steps.ReadSecrets.outputs.Secrets).ghTokenWorkflow }} @@ -103,8 +105,10 @@ jobs: - name: Finalize the workflow if: always() - uses: microsoft/AL-Go/Actions/WorkflowPostProcess@4c5bfbca1adebbf997f63882df4b9074a19aac1d + uses: microsoft/AL-Go/Actions/WorkflowPostProcess@564c339085ae0ffa74c5bde71c15fea7fe54bbf1 + env: + GITHUB_TOKEN: ${{ github.token }} with: shell: powershell - eventId: "DO0098" telemetryScopeJson: ${{ steps.init.outputs.telemetryScopeJson }} + currentJobContext: ${{ toJson(job) }} diff --git a/.github/workflows/_BuildALGoProject.yaml b/.github/workflows/_BuildALGoProject.yaml index ebb7055193..4cdec74dc0 100644 --- a/.github/workflows/_BuildALGoProject.yaml +++ b/.github/workflows/_BuildALGoProject.yaml @@ -1,6 +1,6 @@ -name: '_Build AL-GO project' +name: '_Build AL-Go project' -run-name: 'Build project ${{ inputs.project }}' +run-name: 'Build ${{ inputs.project }}' on: workflow_call: @@ -11,13 +11,13 @@ on: default: powershell type: string runsOn: - description: JSON-formatted string og the types of machine to run the build job on + description: JSON-formatted string of the types of machine to run the build job on required: true type: string checkoutRef: description: Ref to checkout required: false - default: ${{ github.ref }} + default: ${{ github.sha }} type: string project: description: Name of the built project @@ -67,10 +67,11 @@ on: description: Flag determining whether to use the Artifacts Cache type: boolean default: false - parentTelemetryScopeJson: - description: Specifies the telemetry scope for the telemetry signal - required: false - type: string + +permissions: + actions: read + contents: read + id-token: write env: ALGoOrgSettings: ${{ vars.ALGoOrgSettings }} @@ -86,13 +87,13 @@ jobs: name: ${{ inputs.projectName }} (${{ inputs.buildMode }}) steps: - name: Checkout - uses: actions/checkout@v4 + uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 with: ref: ${{ inputs.checkoutRef }} lfs: true - name: Read settings - uses: microsoft/AL-Go/Actions/ReadSettings@4c5bfbca1adebbf997f63882df4b9074a19aac1d + uses: microsoft/AL-Go/Actions/ReadSettings@564c339085ae0ffa74c5bde71c15fea7fe54bbf1 with: shell: ${{ inputs.shell }} project: ${{ inputs.project }} @@ -101,30 +102,29 @@ jobs: - name: Read secrets id: ReadSecrets if: github.event_name != 'pull_request' - uses: microsoft/AL-Go/Actions/ReadSecrets@4c5bfbca1adebbf997f63882df4b9074a19aac1d + uses: microsoft/AL-Go/Actions/ReadSecrets@564c339085ae0ffa74c5bde71c15fea7fe54bbf1 with: shell: ${{ inputs.shell }} gitHubSecrets: ${{ toJson(secrets) }} - getSecrets: '${{ inputs.secrets }},appDependencyProbingPathsSecrets' + getSecrets: '${{ inputs.secrets }},appDependencyProbingPathsSecrets,AZURE_CREDENTIALS' - name: Determine ArtifactUrl - uses: microsoft/AL-Go/Actions/DetermineArtifactUrl@4c5bfbca1adebbf997f63882df4b9074a19aac1d + uses: microsoft/AL-Go/Actions/DetermineArtifactUrl@564c339085ae0ffa74c5bde71c15fea7fe54bbf1 id: determineArtifactUrl with: shell: ${{ inputs.shell }} - parentTelemetryScopeJson: ${{ inputs.parentTelemetryScopeJson }} project: ${{ inputs.project }} - name: Cache Business Central Artifacts if: env.useCompilerFolder == 'True' && inputs.useArtifactCache && env.artifactCacheKey - uses: actions/cache@v4 + uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2 with: path: .artifactcache key: ${{ env.artifactCacheKey }} - name: Download Project Dependencies id: DownloadProjectDependencies - uses: microsoft/AL-Go/Actions/DownloadProjectDependencies@4c5bfbca1adebbf997f63882df4b9074a19aac1d + uses: microsoft/AL-Go/Actions/DownloadProjectDependencies@564c339085ae0ffa74c5bde71c15fea7fe54bbf1 env: Secrets: '${{ steps.ReadSecrets.outputs.Secrets }}' with: @@ -135,13 +135,12 @@ jobs: baselineWorkflowRunId: ${{ inputs.baselineWorkflowRunId }} - name: Build - uses: microsoft/AL-Go/Actions/RunPipeline@4c5bfbca1adebbf997f63882df4b9074a19aac1d + uses: microsoft/AL-Go/Actions/RunPipeline@564c339085ae0ffa74c5bde71c15fea7fe54bbf1 env: Secrets: '${{ steps.ReadSecrets.outputs.Secrets }}' BuildMode: ${{ inputs.buildMode }} with: shell: ${{ inputs.shell }} - parentTelemetryScopeJson: ${{ inputs.parentTelemetryScopeJson }} artifact: ${{ env.artifact }} project: ${{ inputs.project }} buildMode: ${{ inputs.buildMode }} @@ -151,16 +150,15 @@ jobs: - name: Sign if: inputs.signArtifacts && env.doNotSignApps == 'False' && env.keyVaultCodesignCertificateName != '' id: sign - uses: microsoft/AL-Go/Actions/Sign@4c5bfbca1adebbf997f63882df4b9074a19aac1d + uses: microsoft/AL-Go/Actions/Sign@564c339085ae0ffa74c5bde71c15fea7fe54bbf1 with: shell: ${{ needs.Initialization.outputs.githubRunnerShell }} - azureCredentialsJson: ${{ secrets.AZURE_CREDENTIALS }} + azureCredentialsJson: '${{ fromJson(steps.ReadSecrets.outputs.Secrets).AZURE_CREDENTIALS }}' pathToFiles: '${{ inputs.project }}/.buildartifacts/Apps/*.app' - parentTelemetryScopeJson: ${{ needs.Initialization.outputs.telemetryScopeJson }} - name: Calculate Artifact names id: calculateArtifactsNames - uses: microsoft/AL-Go/Actions/CalculateArtifactNames@4c5bfbca1adebbf997f63882df4b9074a19aac1d + uses: microsoft/AL-Go/Actions/CalculateArtifactNames@564c339085ae0ffa74c5bde71c15fea7fe54bbf1 if: success() || failure() with: shell: ${{ inputs.shell }} @@ -170,7 +168,7 @@ jobs: - name: Upload thisbuild artifacts - apps if: inputs.publishThisBuildArtifacts - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@50769540e7f4bd5e21e526ee35c689e35e0d6874 # v4.4.0 with: name: ${{ steps.calculateArtifactsNames.outputs.ThisBuildAppsArtifactsName }} path: '${{ inputs.project }}/.buildartifacts/Apps/' @@ -179,7 +177,7 @@ jobs: - name: Upload thisbuild artifacts - dependencies if: inputs.publishThisBuildArtifacts - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@50769540e7f4bd5e21e526ee35c689e35e0d6874 # v4.4.0 with: name: ${{ steps.calculateArtifactsNames.outputs.ThisBuildDependenciesArtifactsName }} path: '${{ inputs.project }}/.buildartifacts/Dependencies/' @@ -188,7 +186,7 @@ jobs: - name: Upload thisbuild artifacts - test apps if: inputs.publishThisBuildArtifacts - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@50769540e7f4bd5e21e526ee35c689e35e0d6874 # v4.4.0 with: name: ${{ steps.calculateArtifactsNames.outputs.ThisBuildTestAppsArtifactsName }} path: '${{ inputs.project }}/.buildartifacts/TestApps/' @@ -196,7 +194,7 @@ jobs: retention-days: 1 - name: Publish artifacts - apps - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@50769540e7f4bd5e21e526ee35c689e35e0d6874 # v4.4.0 if: inputs.publishArtifacts with: name: ${{ steps.calculateArtifactsNames.outputs.AppsArtifactsName }} @@ -204,7 +202,7 @@ jobs: if-no-files-found: ignore - name: Publish artifacts - dependencies - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@50769540e7f4bd5e21e526ee35c689e35e0d6874 # v4.4.0 if: inputs.publishArtifacts && env.generateDependencyArtifact == 'True' with: name: ${{ steps.calculateArtifactsNames.outputs.DependenciesArtifactsName }} @@ -212,7 +210,7 @@ jobs: if-no-files-found: ignore - name: Publish artifacts - test apps - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@50769540e7f4bd5e21e526ee35c689e35e0d6874 # v4.4.0 if: inputs.publishArtifacts with: name: ${{ steps.calculateArtifactsNames.outputs.TestAppsArtifactsName }} @@ -220,7 +218,7 @@ jobs: if-no-files-found: ignore - name: Publish artifacts - build output - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@50769540e7f4bd5e21e526ee35c689e35e0d6874 # v4.4.0 if: (success() || failure()) && (hashFiles(format('{0}/BuildOutput.txt',inputs.project)) != '') with: name: ${{ steps.calculateArtifactsNames.outputs.BuildOutputArtifactsName }} @@ -228,7 +226,7 @@ jobs: if-no-files-found: ignore - name: Publish artifacts - container event log - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@50769540e7f4bd5e21e526ee35c689e35e0d6874 # v4.4.0 if: (failure()) && (hashFiles(format('{0}/ContainerEventLog.evtx',inputs.project)) != '') with: name: ${{ steps.calculateArtifactsNames.outputs.ContainerEventLogArtifactsName }} @@ -236,7 +234,7 @@ jobs: if-no-files-found: ignore - name: Publish artifacts - test results - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@50769540e7f4bd5e21e526ee35c689e35e0d6874 # v4.4.0 if: (success() || failure()) && (hashFiles(format('{0}/TestResults.xml',inputs.project)) != '') with: name: ${{ steps.calculateArtifactsNames.outputs.TestResultsArtifactsName }} @@ -244,7 +242,7 @@ jobs: if-no-files-found: ignore - name: Publish artifacts - bcpt test results - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@50769540e7f4bd5e21e526ee35c689e35e0d6874 # v4.4.0 if: (success() || failure()) && (hashFiles(format('{0}/bcptTestResults.json',inputs.project)) != '') with: name: ${{ steps.calculateArtifactsNames.outputs.BcptTestResultsArtifactsName }} @@ -254,16 +252,14 @@ jobs: - name: Analyze Test Results id: analyzeTestResults if: (success() || failure()) && env.doNotRunTests == 'False' - uses: microsoft/AL-Go/Actions/AnalyzeTests@4c5bfbca1adebbf997f63882df4b9074a19aac1d + uses: microsoft/AL-Go/Actions/AnalyzeTests@564c339085ae0ffa74c5bde71c15fea7fe54bbf1 with: shell: ${{ inputs.shell }} - parentTelemetryScopeJson: ${{ inputs.parentTelemetryScopeJson }} project: ${{ inputs.project }} - name: Cleanup if: always() - uses: microsoft/AL-Go/Actions/PipelineCleanup@4c5bfbca1adebbf997f63882df4b9074a19aac1d + uses: microsoft/AL-Go/Actions/PipelineCleanup@564c339085ae0ffa74c5bde71c15fea7fe54bbf1 with: shell: ${{ inputs.shell }} - parentTelemetryScopeJson: ${{ inputs.parentTelemetryScopeJson }} project: ${{ inputs.project }} diff --git a/.github/workflows/_BuildPowerPlatformSolution.yaml b/.github/workflows/_BuildPowerPlatformSolution.yaml new file mode 100644 index 0000000000..b481af887f --- /dev/null +++ b/.github/workflows/_BuildPowerPlatformSolution.yaml @@ -0,0 +1,96 @@ +name: '_Build PowerPlatform Solution' + +run-name: 'Build PowerPlatform Solution' + +on: + workflow_call: + inputs: + shell: + description: Shell in which you want to run the action (powershell or pwsh) + required: false + default: powershell + type: string + runsOn: + description: JSON-formatted string of the types of machine to run the build job on + required: true + type: string + checkoutRef: + description: Ref to checkout + required: false + default: ${{ github.sha }} + type: string + project: + description: Name of the built project + required: true + type: string + projectName: + description: Friendly name of the built project + required: true + type: string + publishArtifacts: + description: Flag indicating whether the artifacts should be published + type: boolean + default: false + artifactsNameSuffix: + description: Suffix to add to the artifacts names + required: false + default: '' + type: string + parentTelemetryScopeJson: + description: Specifies the telemetry scope for the telemetry signal + required: false + type: string + +env: + ALGoOrgSettings: ${{ vars.ALGoOrgSettings }} + ALGoRepoSettings: ${{ vars.ALGoRepoSettings }} + +jobs: + Build: + needs: [ ] + runs-on: ${{ fromJson(inputs.runsOn) }} + defaults: + run: + shell: ${{ inputs.shell }} + name: '${{ inputs.projectName }}' + steps: + - name: Checkout + uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 + with: + ref: ${{ inputs.checkoutRef }} + lfs: true + + - name: Read settings + uses: microsoft/AL-Go/Actions/ReadSettings@564c339085ae0ffa74c5bde71c15fea7fe54bbf1 + with: + shell: ${{ inputs.shell }} + project: ${{ inputs.project }} + get: type,powerPlatformSolutionFolder,appRevision,appBuild + + - name: Build + uses: microsoft/AL-Go/Actions/BuildPowerPlatform@564c339085ae0ffa74c5bde71c15fea7fe54bbf1 + with: + shell: ${{ inputs.shell }} + solutionFolder: ${{ inputs.project }} + outputFolder: ${{ inputs.project }}/.buildartifacts/_PowerPlatformSolution/ + outputFileName: ${{ inputs.project }} + appRevision: ${{ env.appRevision }} + appBuild: ${{ env.appBuild }} + + - name: Calculate Artifact names + id: calculateArtifactsNames + uses: microsoft/AL-Go/Actions/CalculateArtifactNames@564c339085ae0ffa74c5bde71c15fea7fe54bbf1 + if: success() || failure() + with: + shell: ${{ inputs.shell }} + project: ${{ inputs.project }} + buildMode: 'default' + suffix: ${{ inputs.artifactsNameSuffix }} + + - name: Publish artifacts - Power Platform Solution + uses: actions/upload-artifact@50769540e7f4bd5e21e526ee35c689e35e0d6874 # v4.4.0 + if: inputs.publishArtifacts + with: + name: ${{ steps.calculateArtifactsNames.outputs.PowerPlatformSolutionArtifactsName }} + path: '${{ inputs.project }}/.buildartifacts/_PowerPlatformSolution/' + if-no-files-found: ignore diff --git a/Apps/CH/SwissQRBill/app/src/purchases/SwissQRBillCreateVendBank.Page.al b/Apps/CH/SwissQRBill/app/src/purchases/SwissQRBillCreateVendBank.Page.al index 2faeae0098..10b0bb38d2 100644 --- a/Apps/CH/SwissQRBill/app/src/purchases/SwissQRBillCreateVendBank.Page.al +++ b/Apps/CH/SwissQRBill/app/src/purchases/SwissQRBillCreateVendBank.Page.al @@ -69,14 +69,14 @@ page 11502 "Swiss QR-Bill Create Vend Bank" TestField(Code); end; - internal procedure SetDetails(VendorBankAccount: Record "Vendor Bank Account") + procedure SetDetails(VendorBankAccount: Record "Vendor Bank Account") begin if Delete() then; TransferFields(VendorBankAccount); Insert(); end; - internal procedure GetDetails(var VendorBankAccount: Record "Vendor Bank Account") + procedure GetDetails(var VendorBankAccount: Record "Vendor Bank Account") begin VendorBankAccount := Rec; end; diff --git a/Apps/CZ/AdvancePaymentsLocalization/app/Src/Codeunits/CustLedgerEntryHandlerCZZ.Codeunit.al b/Apps/CZ/AdvancePaymentsLocalization/app/Src/Codeunits/CustLedgerEntryHandlerCZZ.Codeunit.al index cc193019e2..7fca44e17f 100644 --- a/Apps/CZ/AdvancePaymentsLocalization/app/Src/Codeunits/CustLedgerEntryHandlerCZZ.Codeunit.al +++ b/Apps/CZ/AdvancePaymentsLocalization/app/Src/Codeunits/CustLedgerEntryHandlerCZZ.Codeunit.al @@ -43,6 +43,27 @@ codeunit 31004 "Cust. Ledger Entry Handler CZZ" IsHandled := true; end; + [EventSubscriber(ObjectType::Report, Report::"Open Cust. Entries to Date CZL", 'OnBeforeGetReceivablesAccountNo', '', false, false)] + local procedure GetReceivablesAccountNoForOpenCustEntriesToDate(CustLedgerEntry: Record "Cust. Ledger Entry"; var GLAccountNo: Code[20]; var IsHandled: Boolean) + var + AdvanceLetterTemplateCZZ: Record "Advance Letter Template CZZ"; + begin + if IsHandled then + exit; + + if CustLedgerEntry."Advance Letter No. CZZ" = '' then + exit; + + if CustLedgerEntry."Adv. Letter Template Code CZZ" <> '' then begin + AdvanceLetterTemplateCZZ.Get(CustLedgerEntry."Adv. Letter Template Code CZZ"); + GLAccountNo := AdvanceLetterTemplateCZZ."Advance Letter G/L Account"; + IsHandled := true; + end else begin + GLAccountNo := CustLedgerEntry.GetReceivablesAccNoCZL(); + IsHandled := true; + end; + end; + [EventSubscriber(ObjectType::Codeunit, Codeunit::"CustEntry-Apply Posted Entries", 'OnApplyCustEntryFormEntryOnAfterCheckEntryOpen', '', false, false)] local procedure CheckAdvanceOnApplyCustEntryFormEntryOnAfterCheckEntryOpen(ApplyingCustLedgEntry: Record "Cust. Ledger Entry") begin diff --git a/Apps/CZ/AdvancePaymentsLocalization/app/Src/Codeunits/InstallApplicationCZZ.Codeunit.al b/Apps/CZ/AdvancePaymentsLocalization/app/Src/Codeunits/InstallApplicationCZZ.Codeunit.al index ddfd37ee2f..9663a6ed5e 100644 --- a/Apps/CZ/AdvancePaymentsLocalization/app/Src/Codeunits/InstallApplicationCZZ.Codeunit.al +++ b/Apps/CZ/AdvancePaymentsLocalization/app/Src/Codeunits/InstallApplicationCZZ.Codeunit.al @@ -507,6 +507,9 @@ codeunit 31087 "Install Application CZZ" AmtToDeduct: Decimal; Continue: Boolean; begin + if PurchAdvLetterHeaderCZZ.Status = PurchAdvLetterHeaderCZZ.Status::Closed then + exit; + AdvanceLetterLineRelation.SetRange(Type, AdvanceLetterLineRelation.Type::Purchase); AdvanceLetterLineRelation.SetRange("Letter No.", PurchAdvLetterHeaderCZZ."No."); if AdvanceLetterLineRelation.FindSet() then begin @@ -857,6 +860,9 @@ codeunit 31087 "Install Application CZZ" AmtToDeduct: Decimal; Continue: Boolean; begin + if SalesAdvLetterHeaderCZZ.Status = SalesAdvLetterHeaderCZZ.Status::Closed then + exit; + AdvanceLetterLineRelation.SetRange(Type, AdvanceLetterLineRelation.Type::Sale); AdvanceLetterLineRelation.SetRange("Letter No.", SalesAdvLetterHeaderCZZ."No."); if AdvanceLetterLineRelation.FindSet() then begin diff --git a/Apps/CZ/AdvancePaymentsLocalization/app/Src/Codeunits/MatchBankPaymentHandlerCZZ.Codeunit.al b/Apps/CZ/AdvancePaymentsLocalization/app/Src/Codeunits/MatchBankPaymentHandlerCZZ.Codeunit.al index 59aff2de62..329227c8ae 100644 --- a/Apps/CZ/AdvancePaymentsLocalization/app/Src/Codeunits/MatchBankPaymentHandlerCZZ.Codeunit.al +++ b/Apps/CZ/AdvancePaymentsLocalization/app/Src/Codeunits/MatchBankPaymentHandlerCZZ.Codeunit.al @@ -165,10 +165,9 @@ codeunit 31390 "Match Bank Payment Handler CZZ" end; [EventSubscriber(ObjectType::Table, Database::"Search Rule CZB", 'OnAfterInsertRuleLine', '', false, false)] - local procedure AddAdvanceRuleLineOnAfterInsertRuleLine(SearchRuleLineCZB: Record "Search Rule Line CZB"; var LineNo: Integer; Description: Text) + local procedure AddAdvanceRuleLineOnAfterInsertRuleLine(SearchRuleLineCZB: Record "Search Rule Line CZB"; var LineNo: Integer) var AdvanceSearchRuleLineCZB: Record "Search Rule Line CZB"; - DescriptionTxt: Label 'Both, Advance, %1', Comment = '%1 = Line Description'; begin if SearchRuleLineCZB."Banking Transaction Type" <> SearchRuleLineCZB."Banking Transaction Type"::Both then exit; @@ -178,8 +177,7 @@ codeunit 31390 "Match Bank Payment Handler CZZ" LineNo += 10000; AdvanceSearchRuleLineCZB := SearchRuleLineCZB; AdvanceSearchRuleLineCZB."Line No." := LineNo; - AdvanceSearchRuleLineCZB.Validate(Description, CopyStr(StrSubstNo(DescriptionTxt, Description), 1, MaxStrLen(SearchRuleLineCZB.Description))); - AdvanceSearchRuleLineCZB.Validate("Banking Transaction Type", AdvanceSearchRuleLineCZB."Banking Transaction Type"::Both); + AdvanceSearchRuleLineCZB.Description := ''; AdvanceSearchRuleLineCZB.Validate("Search Scope", AdvanceSearchRuleLineCZB."Search Scope"::"Advance CZZ"); AdvanceSearchRuleLineCZB.Insert(true); end; diff --git a/Apps/CZ/AdvancePaymentsLocalization/app/Src/Codeunits/NavigateHandlerCZZ.Codeunit.al b/Apps/CZ/AdvancePaymentsLocalization/app/Src/Codeunits/NavigateHandlerCZZ.Codeunit.al index 00a25a9c48..aa85214925 100644 --- a/Apps/CZ/AdvancePaymentsLocalization/app/Src/Codeunits/NavigateHandlerCZZ.Codeunit.al +++ b/Apps/CZ/AdvancePaymentsLocalization/app/Src/Codeunits/NavigateHandlerCZZ.Codeunit.al @@ -42,8 +42,8 @@ codeunit 31007 "Navigate Handler CZZ" end; end; - [EventSubscriber(ObjectType::Page, Page::Navigate, 'OnAfterNavigateShowRecords', '', true, false)] - local procedure NavigateOnAfterNavigateShowRecords(var TempDocumentEntry: Record "Document Entry"; DocNoFilter: Text; PostingDateFilter: Text) + [EventSubscriber(ObjectType::Page, Page::Navigate, 'OnBeforeShowRecords', '', true, false)] + local procedure NavigateOnBeforeShowRecords(var TempDocumentEntry: Record "Document Entry"; DocNoFilter: Text; PostingDateFilter: Text; var IsHandled: Boolean) var SalesAdvLetterEntryCZZ: Record "Sales Adv. Letter Entry CZZ"; PurchAdvLetterEntryCZZ: Record "Purch. Adv. Letter Entry CZZ"; @@ -54,12 +54,14 @@ codeunit 31007 "Navigate Handler CZZ" SalesAdvLetterEntryCZZ.SetFilter("Document No.", DocNoFilter); SalesAdvLetterEntryCZZ.SetFilter("Posting Date", PostingDateFilter); Page.Run(0, SalesAdvLetterEntryCZZ); + IsHandled := true; end; Database::"Purch. Adv. Letter Entry CZZ": begin PurchAdvLetterEntryCZZ.SetFilter("Document No.", DocNoFilter); PurchAdvLetterEntryCZZ.SetFilter("Posting Date", PostingDateFilter); Page.Run(0, PurchAdvLetterEntryCZZ); + IsHandled := true; end; end; end; diff --git a/Apps/CZ/AdvancePaymentsLocalization/app/Src/Codeunits/NonDeductibleVATCZZ.Codeunit.al b/Apps/CZ/AdvancePaymentsLocalization/app/Src/Codeunits/NonDeductibleVATCZZ.Codeunit.al new file mode 100644 index 0000000000..c122c7d2c4 --- /dev/null +++ b/Apps/CZ/AdvancePaymentsLocalization/app/Src/Codeunits/NonDeductibleVATCZZ.Codeunit.al @@ -0,0 +1,81 @@ +// ------------------------------------------------------------------------------------------------ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// ------------------------------------------------------------------------------------------------ +namespace Microsoft.Finance.AdvancePayments; + +using Microsoft.Finance.Currency; +using Microsoft.Finance.GeneralLedger.Journal; +using Microsoft.Finance.VAT.Calculation; +using Microsoft.Finance.VAT.Setup; +using Microsoft.Foundation.Enums; + +codeunit 31157 "Non-Deductible VAT CZZ" +{ + var + NonDeductibleVATCZL: Codeunit "Non-Deductible VAT CZL"; + + procedure IsNonDeductibleVATEnabled(): Boolean + var + VATSetup: Record "VAT Setup"; + begin + if not NonDeductibleVATCZL.IsNonDeductibleVATEnabled() then + exit(false); + VATSetup.Get(); + exit(VATSetup."Use For Advances CZZ"); + end; + + internal procedure GetNonDeductibleVATPct(AdvancePostingBuffer: Record "Advance Posting Buffer CZZ"; ToDate: Date): Decimal + begin + exit(GetNonDeductibleVATPct( + AdvancePostingBuffer."VAT Bus. Posting Group", + AdvancePostingBuffer."VAT Prod. Posting Group", + "General Posting Type"::Purchase, ToDate)); + end; + + procedure GetNonDeductibleVATPct(VATBusPostGroupCode: Code[20]; VATProdPostGroupCode: Code[20]; GeneralPostingType: Enum "General Posting Type"; ToDate: Date): Decimal + begin + if not IsNonDeductibleVATEnabled() then + exit(0); + exit(NonDeductibleVATCZL.GetNonDeductibleVATPct(VATBusPostGroupCode, VATProdPostGroupCode, GeneralPostingType, ToDate)); + end; + + internal procedure Calculate(var AdvancePostingBufferCZZ: Record "Advance Posting Buffer CZZ") + var + Currency: Record Currency; + begin + if not IsNonDeductibleVATEnabled() then + exit; + Currency.InitRoundingPrecision(); + UpdateNonDeductibleAmounts( + AdvancePostingBufferCZZ."Non-Deductible VAT Base", AdvancePostingBufferCZZ."Non-Deductible VAT Amount", + AdvancePostingBufferCZZ."VAT Base Amount", AdvancePostingBufferCZZ."VAT Amount", + AdvancePostingBufferCZZ."Non-Deductible VAT %", Currency."Amount Rounding Precision"); + UpdateNonDeductibleAmounts( + AdvancePostingBufferCZZ."Non-Deductible VAT Base ACY", AdvancePostingBufferCZZ."Non-Deductible VAT Amount ACY", + AdvancePostingBufferCZZ."VAT Base Amount (ACY)", AdvancePostingBufferCZZ."VAT Amount (ACY)", + AdvancePostingBufferCZZ."Non-Deductible VAT %", Currency."Amount Rounding Precision"); + end; + + local procedure UpdateNonDeductibleAmounts(var NonDeductibleBase: Decimal; var NonDeductibleAmount: Decimal; VATBase: Decimal; VATAmount: Decimal; NonDeductibleVATPct: Decimal; AmountRoundingPrecision: Decimal) + begin + if not IsNonDeductibleVATEnabled() then begin + NonDeductibleBase := 0; + NonDeductibleAmount := 0; + exit; + end; + NonDeductibleBase := + Round(VATBase * NonDeductibleVATPct / 100, AmountRoundingPrecision); + NonDeductibleAmount := + Round(VATAmount * NonDeductibleVATPct / 100, AmountRoundingPrecision); + end; + + internal procedure Copy(var GenJournalLine: Record "Gen. Journal Line"; AdvancePostingBufferCZZ: Record "Advance Posting Buffer CZZ") + begin + GenJournalLine."Non-Deductible VAT %" := AdvancePostingBufferCZZ."Non-Deductible VAT %"; + GenJournalLine."Non-Deductible VAT Base" := AdvancePostingBufferCZZ."Non-Deductible VAT Base"; + GenJournalLine."Non-Deductible VAT Amount" := AdvancePostingBufferCZZ."Non-Deductible VAT Amount"; + GenJournalLine."Non-Deductible VAT Base LCY" := AdvancePostingBufferCZZ."Non-Deductible VAT Base ACY"; + GenJournalLine."Non-Deductible VAT Amount LCY" := AdvancePostingBufferCZZ."Non-Deductible VAT Amount ACY"; + end; +} \ No newline at end of file diff --git a/Apps/CZ/AdvancePaymentsLocalization/app/Src/Codeunits/PurchAdvLetterManagementCZZ.Codeunit.al b/Apps/CZ/AdvancePaymentsLocalization/app/Src/Codeunits/PurchAdvLetterManagementCZZ.Codeunit.al index b9b2628647..af4f8e3f37 100644 --- a/Apps/CZ/AdvancePaymentsLocalization/app/Src/Codeunits/PurchAdvLetterManagementCZZ.Codeunit.al +++ b/Apps/CZ/AdvancePaymentsLocalization/app/Src/Codeunits/PurchAdvLetterManagementCZZ.Codeunit.al @@ -7,6 +7,7 @@ namespace Microsoft.Finance.AdvancePayments; using Microsoft.Finance.Currency; using Microsoft.Finance.GeneralLedger.Journal; using Microsoft.Finance.GeneralLedger.Posting; +using Microsoft.Finance.VAT.Calculation; using Microsoft.Finance.VAT.Ledger; using Microsoft.Finance.VAT.Setup; using Microsoft.Foundation.Enums; @@ -24,6 +25,7 @@ codeunit 31019 "PurchAdvLetterManagement CZZ" PurchAdvLetterEntryCZZGlob: Record "Purch. Adv. Letter Entry CZZ"; TempPurchAdvLetterEntryCZZGlob: Record "Purch. Adv. Letter Entry CZZ" temporary; PurchAdvLetterPostCZZ: Codeunit "Purch. Adv. Letter-Post CZZ"; + PreviewMode: Boolean; DateEmptyErr: Label 'Posting Date and VAT Date cannot be empty.'; DocumentNoOrDatesEmptyErr: Label 'Document No. and Dates cannot be empty.'; ExternalDocumentNoEmptyErr: Label 'External Document No. cannot be empty.'; @@ -32,6 +34,9 @@ codeunit 31019 "PurchAdvLetterManagement CZZ" PostingDateEmptyErr: Label 'Posting Date cannot be empty.'; LaterPostingDateQst: Label 'The linked advance letter %1 is paid after %2. If you continue, the advance letter won''t be deducted.\\Do you want to continue?', Comment = '%1 = advance letter no., %2 = posting date'; ExceededUsageAmountErr: Label 'Post VAT Document higher than usage is not possible.'; + ApplyVATCoefficientQst: Label 'Do you want to apply VAT coefficient?'; + NonDeductVATPostedMsg: Label 'Non-deductible VAT has been successfully posted.'; + VATUsageExistErr: Label 'It''s not possible to post non-deductible VAT when there are already VAT usage entries.'; procedure AdvEntryInit(Preview: Boolean) begin @@ -309,6 +314,11 @@ codeunit 31019 "PurchAdvLetterManagement CZZ" end; #endif + procedure PostAdvancePaymentVAT(var PurchAdvLetterEntryCZZ: Record "Purch. Adv. Letter Entry CZZ") + begin + PostAdvancePaymentVAT(PurchAdvLetterEntryCZZ, 0D); + end; + procedure PostAdvancePaymentVAT(var PurchAdvLetterEntryCZZ: Record "Purch. Adv. Letter Entry CZZ"; PostingDate: Date) var AdvanceLetterTemplateCZZ: Record "Advance Letter Template CZZ"; @@ -319,9 +329,12 @@ codeunit 31019 "PurchAdvLetterManagement CZZ" VendorLedgerEntry: Record "Vendor Ledger Entry"; GenJnlPostLine: Codeunit "Gen. Jnl.-Post Line"; ConfirmManagement: Codeunit "Confirm Management"; + NonDeductibleVATCZL: Codeunit "Non-Deductible VAT CZL"; + NonDeductibleVATCZZ: Codeunit "Non-Deductible VAT CZZ"; VATDocumentCZZ: Page "VAT Document CZZ"; DocumentNo: Code[20]; IsHandled: Boolean; + IsPostNonDeductibleVATConfirmed: Boolean; DocumentDate: Date; VATDate: Date; OriginalDocumentVATDate: Date; @@ -377,6 +390,23 @@ codeunit 31019 "PurchAdvLetterManagement CZZ" VATDocumentCZZ.GetDocument(DocumentNo, PostingDate, DocumentDate, VATDate, OriginalDocumentVATDate, ExternalDocumentNo, TempAdvancePostingBufferCZZ); + if NonDeductibleVATCZZ.IsNonDeductibleVATEnabled() then + if TempAdvancePostingBufferCZZ.IsNonDeductibleVATAllowedInBuffer() then begin + IsPostNonDeductibleVATConfirmed := AdvanceLetterTemplateCZZ."Automatic Post Non-Ded. VAT"; + if not IsPostNonDeductibleVATConfirmed then + IsPostNonDeductibleVATConfirmed := ConfirmManagement.GetResponse(ApplyVATCoefficientQst); + end; + + if IsPostNonDeductibleVATConfirmed then + if NonDeductibleVATCZL.CheckNonDeductibleVATSetupToDate(VATDate, false) then begin + TempAdvancePostingBufferCZZ.FindSet(); + repeat + TempAdvancePostingBufferCZZ."Non-Deductible VAT %" := + NonDeductibleVATCZZ.GetNonDeductibleVATPct(TempAdvancePostingBufferCZZ, VATDate); + TempAdvancePostingBufferCZZ.Modify(); + until TempAdvancePostingBufferCZZ.Next() = 0; + end; + Clear(AdvancePostingParametersCZZ); AdvancePostingParametersCZZ."Document Type" := Enum::"Gen. Journal Document Type"::Invoice; AdvancePostingParametersCZZ."Document No." := DocumentNo; @@ -393,6 +423,63 @@ codeunit 31019 "PurchAdvLetterManagement CZZ" PurchAdvLetterEntryCZZ, TempAdvancePostingBufferCZZ, GenJnlPostLine, AdvancePostingParametersCZZ); end; + internal procedure PostNonDeductibleVAT(PurchAdvLetterEntryCZZ: Record "Purch. Adv. Letter Entry CZZ") + var + AdvancePostingParametersCZZ: Record "Advance Posting Parameters CZZ"; + PurchAdvLetterHeaderCZZ: Record "Purch. Adv. Letter Header CZZ"; + VATUsagePurchAdvLetterEntryCZZ: Record "Purch. Adv. Letter Entry CZZ"; + VATEntry: Record "VAT Entry"; + TempAdvancePostingBufferCZZ: Record "Advance Posting Buffer CZZ" temporary; + GenJnlPostLine: Codeunit "Gen. Jnl.-Post Line"; + NonDeductibleVATCZL: Codeunit "Non-Deductible VAT CZL"; + NonDeductibleVATCZZ: Codeunit "Non-Deductible VAT CZZ"; + SourceCode: Code[10]; + begin + PurchAdvLetterEntryCZZ.TestField("Entry Type", PurchAdvLetterEntryCZZ."Entry Type"::"VAT Payment"); + PurchAdvLetterEntryCZZ.TestField("Non-Deductible VAT %", 0); + PurchAdvLetterEntryCZZ.CheckNonDeductibleVATAllowed(); + NonDeductibleVATCZL.CheckNonDeductibleVATSetupToDate(PurchAdvLetterEntryCZZ."VAT Date"); + + VATUsagePurchAdvLetterEntryCZZ.SetRange("Purch. Adv. Letter No.", PurchAdvLetterEntryCZZ."Purch. Adv. Letter No."); + VATUsagePurchAdvLetterEntryCZZ.SetRange("Entry Type", "Advance Letter Entry Type CZZ"::"VAT Usage"); + VATUsagePurchAdvLetterEntryCZZ.SetRange(Cancelled, false); + if not VATUsagePurchAdvLetterEntryCZZ.IsEmpty() then + Error(VATUsageExistErr); + + TempAdvancePostingBufferCZZ.PrepareForPurchAdvLetterEntry(PurchAdvLetterEntryCZZ); + TempAdvancePostingBufferCZZ.ReverseAmounts(); + TempAdvancePostingBufferCZZ."Non-Deductible VAT %" := + NonDeductibleVATCZZ.GetNonDeductibleVATPct(TempAdvancePostingBufferCZZ, PurchAdvLetterEntryCZZ."VAT Date"); + + PurchAdvLetterHeaderCZZ.Get(PurchAdvLetterEntryCZZ."Purch. Adv. Letter No."); + + // find VAT entry of the VAT document due to source code + SourceCode := ''; + if FindVATEntry(PurchAdvLetterEntryCZZ, VATEntry) then + SourceCode := VATEntry."Source Code"; + + Clear(AdvancePostingParametersCZZ); + AdvancePostingParametersCZZ."Document Type" := Enum::"Gen. Journal Document Type"::Invoice; + AdvancePostingParametersCZZ."Document No." := PurchAdvLetterEntryCZZ."Document No."; + AdvancePostingParametersCZZ."External Document No." := PurchAdvLetterEntryCZZ."External Document No."; + AdvancePostingParametersCZZ."Source Code" := SourceCode; + AdvancePostingParametersCZZ."Posting Description" := PurchAdvLetterHeaderCZZ."Posting Description"; + AdvancePostingParametersCZZ."Posting Date" := PurchAdvLetterEntryCZZ."Posting Date"; + AdvancePostingParametersCZZ."Document Date" := PurchAdvLetterEntryCZZ."Posting Date"; + AdvancePostingParametersCZZ."VAT Date" := PurchAdvLetterEntryCZZ."VAT Date"; + AdvancePostingParametersCZZ."Original Document VAT Date" := PurchAdvLetterEntryCZZ."Original Document VAT Date"; + AdvancePostingParametersCZZ."Currency Code" := PurchAdvLetterEntryCZZ."Currency Code"; + AdvancePostingParametersCZZ."Currency Factor" := PurchAdvLetterEntryCZZ."Currency Factor"; + + PurchAdvLetterPostCZZ.PostNonDeductibleVAT(PurchAdvLetterEntryCZZ, TempAdvancePostingBufferCZZ, GenJnlPostLine, AdvancePostingParametersCZZ); + + PurchAdvLetterEntryCZZ."Non-Deductible VAT %" := TempAdvancePostingBufferCZZ."Non-Deductible VAT %"; + PurchAdvLetterEntryCZZ.Modify(); + + if not PreviewMode then + Message(NonDeductVATPostedMsg); + end; + local procedure InitVATAmountLine(var AdvancePostingBufferCZZ: Record "Advance Posting Buffer CZZ"; PurchAdvanceNo: Code[20]; Amount: Decimal; CurrencyFactor: Decimal) var PurchAdvLetterHeaderCZZ: Record "Purch. Adv. Letter Header CZZ"; @@ -546,9 +633,14 @@ codeunit 31019 "PurchAdvLetterManagement CZZ" AdvanceLetterApplicationCZZ: Record "Advance Letter Application CZZ"; GenJnlPostLine: Codeunit "Gen. Jnl.-Post Line"; UsedOnDocument: Text; + IsHandled: Boolean; UnlinkIsNotPossibleErr: Label 'Unlink is not possible, because %1 entry exists.', Comment = '%1 = Entry type'; UsedOnDocumentQst: Label 'Advance is used on document(s) %1.\Continue?', Comment = '%1 = Advance No. list'; begin + IsHandled := false; + OnBeforeUnlinkAdvancePayment(PurchAdvLetterEntryCZZ, PostingDate, IsHandled); + if IsHandled then + exit; PurchAdvLetterEntryCZZ.TestField("Entry Type", PurchAdvLetterEntryCZZ."Entry Type"::Payment); PurchAdvLetterEntryCZZ.TestField(Cancelled, false); PurchAdvLetterEntryCZZ2.SetRange("Purch. Adv. Letter No.", PurchAdvLetterEntryCZZ."Purch. Adv. Letter No."); @@ -676,40 +768,84 @@ codeunit 31019 "PurchAdvLetterManagement CZZ" PurchAdvLetterEntryCZZ, TempAdvancePostingBufferCZZ, GenJnlPostLine, AdvancePostingParametersCZZ); end; + internal procedure GetDeductionEntries(PurchAdvLetterEntryCZZ: Record "Purch. Adv. Letter Entry CZZ"; var TempPurchAdvLetterEntryCZZ: Record "Purch. Adv. Letter Entry CZZ" temporary) + var + DeductPurchAdvLetterEntryCZZ: Record "Purch. Adv. Letter Entry CZZ"; + DeductPurchAdvLetterEntryCZZ2: Record "Purch. Adv. Letter Entry CZZ"; + begin + if not TempPurchAdvLetterEntryCZZ.IsTemporary() then + exit; + + DeductPurchAdvLetterEntryCZZ.SetRange("Purch. Adv. Letter No.", PurchAdvLetterEntryCZZ."Purch. Adv. Letter No."); + DeductPurchAdvLetterEntryCZZ.SetRange(Cancelled, false); + DeductPurchAdvLetterEntryCZZ.SetFilter("Entry Type", '%1|%2', + DeductPurchAdvLetterEntryCZZ."Entry Type"::Usage, + DeductPurchAdvLetterEntryCZZ."Entry Type"::Close); + + case PurchAdvLetterEntryCZZ."Entry Type" of + PurchAdvLetterEntryCZZ."Entry Type"::Payment: + begin + DeductPurchAdvLetterEntryCZZ.SetRange("Related Entry", PurchAdvLetterEntryCZZ."Entry No."); + if DeductPurchAdvLetterEntryCZZ.FindSet() then + repeat + GetDeductionEntries(DeductPurchAdvLetterEntryCZZ, TempPurchAdvLetterEntryCZZ); + until DeductPurchAdvLetterEntryCZZ.Next() = 0; + end; + PurchAdvLetterEntryCZZ."Entry Type"::"VAT Payment": + begin + DeductPurchAdvLetterEntryCZZ.SetRange("Related Entry", PurchAdvLetterEntryCZZ."Related Entry"); + if DeductPurchAdvLetterEntryCZZ.FindSet() then + repeat + DeductPurchAdvLetterEntryCZZ2.SetRange("Related Entry", DeductPurchAdvLetterEntryCZZ."Entry No."); + DeductPurchAdvLetterEntryCZZ2.SetRange("VAT Bus. Posting Group", PurchAdvLetterEntryCZZ."VAT Bus. Posting Group"); + DeductPurchAdvLetterEntryCZZ2.SetRange("VAT Prod. Posting Group", PurchAdvLetterEntryCZZ."VAT Prod. Posting Group"); + DeductPurchAdvLetterEntryCZZ2.SetFilter("Entry Type", '%1|%2', + DeductPurchAdvLetterEntryCZZ2."Entry Type"::"VAT Usage", + DeductPurchAdvLetterEntryCZZ2."Entry Type"::"VAT Close"); + if DeductPurchAdvLetterEntryCZZ2.FindSet() then + repeat + GetDeductionEntries(DeductPurchAdvLetterEntryCZZ2, TempPurchAdvLetterEntryCZZ); + until DeductPurchAdvLetterEntryCZZ2.Next() = 0; + until DeductPurchAdvLetterEntryCZZ.Next() = 0; + end; + PurchAdvLetterEntryCZZ."Entry Type"::Usage, + PurchAdvLetterEntryCZZ."Entry Type"::Close, + PurchAdvLetterEntryCZZ."Entry Type"::"VAT Usage", + PurchAdvLetterEntryCZZ."Entry Type"::"VAT Close": + begin + TempPurchAdvLetterEntryCZZ.Init(); + TempPurchAdvLetterEntryCZZ := PurchAdvLetterEntryCZZ; + TempPurchAdvLetterEntryCZZ.Insert(); + end; + end; + end; + procedure GetRemAmtPurchAdvPayment(var PurchAdvLetterEntryCZZ: Record "Purch. Adv. Letter Entry CZZ"; BalanceAtDate: Date): Decimal var - PurchAdvLetterEntry2: Record "Purch. Adv. Letter Entry CZZ"; + TempPurchAdvLetterEntryCZZ: Record "Purch. Adv. Letter Entry CZZ" temporary; begin if (PurchAdvLetterEntryCZZ."Posting Date" > BalanceAtDate) and (BalanceAtDate <> 0D) then exit(0); - PurchAdvLetterEntry2.SetRange("Purch. Adv. Letter No.", PurchAdvLetterEntryCZZ."Purch. Adv. Letter No."); - PurchAdvLetterEntry2.SetRange(Cancelled, false); - PurchAdvLetterEntry2.SetFilter("Entry Type", '%1|%2|%3', PurchAdvLetterEntry2."Entry Type"::Payment, - PurchAdvLetterEntry2."Entry Type"::Usage, PurchAdvLetterEntry2."Entry Type"::Close); - PurchAdvLetterEntry2.SetRange("Related Entry", PurchAdvLetterEntryCZZ."Entry No."); + GetDeductionEntries(PurchAdvLetterEntryCZZ, TempPurchAdvLetterEntryCZZ); if BalanceAtDate <> 0D then - PurchAdvLetterEntry2.SetFilter("Posting Date", '..%1', BalanceAtDate); - PurchAdvLetterEntry2.CalcSums(Amount); - exit(PurchAdvLetterEntryCZZ.Amount + PurchAdvLetterEntry2.Amount); + TempPurchAdvLetterEntryCZZ.SetFilter("Posting Date", '..%1', BalanceAtDate); + TempPurchAdvLetterEntryCZZ.CalcSums(Amount); + exit(PurchAdvLetterEntryCZZ.Amount + TempPurchAdvLetterEntryCZZ.Amount); end; procedure GetRemAmtLCYPurchAdvPayment(var PurchAdvLetterEntryCZZ: Record "Purch. Adv. Letter Entry CZZ"; BalanceAtDate: Date): Decimal var - PurchAdvLetterEntry2: Record "Purch. Adv. Letter Entry CZZ"; + TempPurchAdvLetterEntryCZZ: Record "Purch. Adv. Letter Entry CZZ" temporary; begin if (PurchAdvLetterEntryCZZ."Posting Date" > BalanceAtDate) and (BalanceAtDate <> 0D) then exit(0); - PurchAdvLetterEntry2.SetRange("Purch. Adv. Letter No.", PurchAdvLetterEntryCZZ."Purch. Adv. Letter No."); - PurchAdvLetterEntry2.SetRange(Cancelled, false); - PurchAdvLetterEntry2.SetFilter("Entry Type", '%1|%2|%3', PurchAdvLetterEntry2."Entry Type"::Payment, - PurchAdvLetterEntry2."Entry Type"::Usage, PurchAdvLetterEntry2."Entry Type"::Close); - PurchAdvLetterEntry2.SetRange("Related Entry", PurchAdvLetterEntryCZZ."Entry No."); + GetDeductionEntries(PurchAdvLetterEntryCZZ, TempPurchAdvLetterEntryCZZ); if BalanceAtDate <> 0D then - PurchAdvLetterEntry2.SetFilter("Posting Date", '..%1', BalanceAtDate); - PurchAdvLetterEntry2.CalcSums("Amount (LCY)"); - exit(PurchAdvLetterEntryCZZ."Amount (LCY)" + PurchAdvLetterEntry2."Amount (LCY)"); + TempPurchAdvLetterEntryCZZ.SetFilter("Posting Date", '..%1', BalanceAtDate); + TempPurchAdvLetterEntryCZZ.CalcSums("Amount (LCY)"); + exit(PurchAdvLetterEntryCZZ."Amount (LCY)" + TempPurchAdvLetterEntryCZZ."Amount (LCY)"); end; procedure GetRemAmtLCYVATAdjust(var AmountLCY: Decimal; var VATAmountLCY: Decimal; var PurchAdvLetterEntryCZZ: Record "Purch. Adv. Letter Entry CZZ"; BalanceAtDate: Date; VATBusPostGr: Code[20]; VATProdPostGr: Code[20]) @@ -833,9 +969,7 @@ codeunit 31019 "PurchAdvLetterManagement CZZ" // find VAT entry of the VAT document due to source code SourceCode := ''; - VATEntry.SetRange("Document No.", PurchAdvLetterEntryCZZ."Document No."); - VATEntry.SetRange("Posting Date", PurchAdvLetterEntryCZZ."Posting Date"); - if VATEntry.FindFirst() then + if FindVATEntry(PurchAdvLetterEntryCZZ, VATEntry) then SourceCode := VATEntry."Source Code"; PurchAdvLetterEntryCZZ2.SetRange("Purch. Adv. Letter No.", PurchAdvLetterEntryCZZ."Purch. Adv. Letter No."); @@ -1195,6 +1329,21 @@ codeunit 31019 "PurchAdvLetterManagement CZZ" GetPostingDateCZZ.GetValues(PostingDate); exit(true); end; + + local procedure FindVATEntry(PurchAdvLetterEntryCZZ: Record "Purch. Adv. Letter Entry CZZ"; var VATEntry: Record "VAT Entry"): Boolean + begin + if PurchAdvLetterEntryCZZ."VAT Entry No." <> 0 then + exit(VATEntry.Get(PurchAdvLetterEntryCZZ."VAT Entry No.")); + + VATEntry.SetRange("Document No.", PurchAdvLetterEntryCZZ."Document No."); + VATEntry.SetRange("Posting Date", PurchAdvLetterEntryCZZ."Posting Date"); + exit(VATEntry.FindFirst()); + end; + + internal procedure SetPreviewMode(NewPerviewMode: Boolean) + begin + PreviewMode := NewPerviewMode; + end; #if not CLEAN24 #pragma warning disable AL0432 internal procedure RaiseOnBeforePostPaymentRepos(var GenJournalLine: Record "Gen. Journal Line"; var PurchAdvLetterHeaderCZZ: Record "Purch. Adv. Letter Header CZZ"; PostedGenJournalLine: Record "Gen. Journal Line") @@ -1469,4 +1618,9 @@ codeunit 31019 "PurchAdvLetterManagement CZZ" local procedure OnBeforeCheckAdvancePayment(AdvLetterUsageDocTypeCZZ: Enum "Adv. Letter Usage Doc.Type CZZ"; DocumentHeader: Variant; var IsHandled: Boolean); begin end; + + [IntegrationEvent(false, false)] + local procedure OnBeforeUnlinkAdvancePayment(var PurchAdvLetterEntryCZZ: Record "Purch. Adv. Letter Entry CZZ"; PostingDate: Date; var IsHandled: Boolean) + begin + end; } diff --git a/Apps/CZ/AdvancePaymentsLocalization/app/Src/Codeunits/PurchAdvLetterPostCZZ.Codeunit.al b/Apps/CZ/AdvancePaymentsLocalization/app/Src/Codeunits/PurchAdvLetterPostCZZ.Codeunit.al index d6ee9a42a3..9d57b4396b 100644 --- a/Apps/CZ/AdvancePaymentsLocalization/app/Src/Codeunits/PurchAdvLetterPostCZZ.Codeunit.al +++ b/Apps/CZ/AdvancePaymentsLocalization/app/Src/Codeunits/PurchAdvLetterPostCZZ.Codeunit.al @@ -128,8 +128,8 @@ codeunit 31142 "Purch. Adv. Letter-Post CZZ" TempPurchAdvLetterEntryCZZGlob.InitNewEntry(); TempPurchAdvLetterEntryCZZGlob.InitVendorLedgerEntry(VendorLedgerEntryPayment); TempPurchAdvLetterEntryCZZGlob.CopyFromGenJnlLine(GenJournalLine); + TempPurchAdvLetterEntryCZZGlob.CopyFromPurchAdvLetterHeader(PurchAdvLetterHeaderCZZ); TempPurchAdvLetterEntryCZZGlob."Entry Type" := "Advance Letter Entry Type CZZ"::Payment; - TempPurchAdvLetterEntryCZZGlob."Purch. Adv. Letter No." := PurchAdvLetterHeaderCZZ."No."; EntryNo := TempPurchAdvLetterEntryCZZGlob.InsertNewEntry(not AdvancePostingParametersCZZ."Temporary Entries Only"); if not AdvancePostingParametersCZZ."Temporary Entries Only" then @@ -218,8 +218,8 @@ codeunit 31142 "Purch. Adv. Letter-Post CZZ" TempPurchAdvLetterEntryCZZGlob.InitVendorLedgerEntry(VendorLedgerEntry); TempPurchAdvLetterEntryCZZGlob.InitRelatedEntry(PurchAdvLetterEntryCZZ); TempPurchAdvLetterEntryCZZGlob.CopyFromGenJnlLine(GenJournalLine); + TempPurchAdvLetterEntryCZZGlob.CopyFromPurchAdvLetterHeader(PurchAdvLetterHeaderCZZ); TempPurchAdvLetterEntryCZZGlob."Entry Type" := PurchAdvLetterEntryCZZ."Entry Type"; - TempPurchAdvLetterEntryCZZGlob."Purch. Adv. Letter No." := PurchAdvLetterHeaderCZZ."No."; TempPurchAdvLetterEntryCZZGlob.Cancelled := true; TempPurchAdvLetterEntryCZZGlob.InsertNewEntry(not AdvancePostingParametersCZZ."Temporary Entries Only"); @@ -262,7 +262,7 @@ codeunit 31142 "Purch. Adv. Letter-Post CZZ" PurchAdvLetterHeaderCZZ: Record "Purch. Adv. Letter Header CZZ"; VATPostingSetup: Record "VAT Posting Setup"; VendorLedgerEntry: Record "Vendor Ledger Entry"; - GLEntryNo, VATEntryNo : Integer; + EntryNo, GLEntryNo, VATEntryNo : Integer; IsHandled: Boolean; begin IsHandled := false; @@ -335,12 +335,12 @@ codeunit 31142 "Purch. Adv. Letter-Post CZZ" TempPurchAdvLetterEntryCZZGlob.InitNewEntry(); TempPurchAdvLetterEntryCZZGlob.InitRelatedEntry(PurchAdvLetterEntryCZZ); TempPurchAdvLetterEntryCZZGlob.CopyFromGenJnlLine(GenJournalLine); + TempPurchAdvLetterEntryCZZGlob.CopyFromPurchAdvLetterHeader(PurchAdvLetterHeaderCZZ); TempPurchAdvLetterEntryCZZGlob."Entry Type" := "Advance Letter Entry Type CZZ"::"VAT Payment"; - TempPurchAdvLetterEntryCZZGlob."Purch. Adv. Letter No." := PurchAdvLetterHeaderCZZ."No."; TempPurchAdvLetterEntryCZZGlob."VAT Entry No." := VATEntryNo; TempPurchAdvLetterEntryCZZGlob."VAT Identifier" := VATPostingSetup."VAT Identifier"; TempPurchAdvLetterEntryCZZGlob."Auxiliary Entry" := AdvancePostingBufferCZZ."Auxiliary Entry"; - TempPurchAdvLetterEntryCZZGlob.InsertNewEntry(not AdvancePostingParametersCZZ."Temporary Entries Only"); + EntryNo := TempPurchAdvLetterEntryCZZGlob.InsertNewEntry(not AdvancePostingParametersCZZ."Temporary Entries Only"); // Post balance of VAT document AdvancePostingParametersCZZ2.InitNew(AdvancePostingParametersCZZ); @@ -358,6 +358,17 @@ codeunit 31142 "Purch. Adv. Letter-Post CZZ" PurchAdvLetterHeaderCZZ, PurchAdvLetterEntryCZZ, AdvancePostingBufferCZZ, AdvancePostingParametersCZZ, GLEntryNo, GenJnlPostLine, GenJournalLine); end; + + // Post non-deductible VAT + if (not AdvancePostingParametersCZZ."Temporary Entries Only") and + (AdvancePostingBufferCZZ."Non-Deductible VAT %" <> 0) + then begin + PurchAdvLetterEntryCZZ2.Get(EntryNo); // VAT payment entry + PostNonDeductibleVAT( + PurchAdvLetterEntryCZZ2, AdvancePostingBufferCZZ, GenJnlPostLine, AdvancePostingParametersCZZ); + PurchAdvLetterEntryCZZ2."Non-Deductible VAT %" := AdvancePostingBufferCZZ."Non-Deductible VAT %"; + PurchAdvLetterEntryCZZ2.Modify(); + end; until AdvancePostingBufferCZZ.Next() = 0; OnAfterPostAdvancePaymentVAT( @@ -413,8 +424,8 @@ codeunit 31142 "Purch. Adv. Letter-Post CZZ" TempPurchAdvLetterEntryCZZGlob.InitNewEntry(); TempPurchAdvLetterEntryCZZGlob.InitRelatedEntry(PurchAdvLetterEntryCZZ."Related Entry"); TempPurchAdvLetterEntryCZZGlob.CopyFromGenJnlLine(GenJournalLine); + TempPurchAdvLetterEntryCZZGlob.CopyFromPurchAdvLetterHeader(PurchAdvLetterHeaderCZZ); TempPurchAdvLetterEntryCZZGlob."Entry Type" := "Advance Letter Entry Type CZZ"::"VAT Payment"; - TempPurchAdvLetterEntryCZZGlob."Purch. Adv. Letter No." := PurchAdvLetterHeaderCZZ."No."; TempPurchAdvLetterEntryCZZGlob."VAT Entry No." := VATEntryNo; TempPurchAdvLetterEntryCZZGlob."VAT Identifier" := VATPostingSetup."VAT Identifier"; TempPurchAdvLetterEntryCZZGlob."Auxiliary Entry" := AdvancePostingBufferCZZ."Auxiliary Entry"; @@ -638,6 +649,7 @@ codeunit 31142 "Purch. Adv. Letter-Post CZZ" PurchAdvLetterHeaderCZZ.Get(PurchAdvLetterEntryCZZ."Purch. Adv. Letter No."); PurchAdvLetterEntryCZZ2.Reset(); + PurchAdvLetterEntryCZZ2.SetRange("Purch. Adv. Letter No.", PurchAdvLetterHeaderCZZ."No."); PurchAdvLetterEntryCZZ2.SetRange("Document No.", PurchAdvLetterEntryCZZ."Document No."); PurchAdvLetterEntryCZZ2.SetFilter("Entry Type", '%1|%2|%3', PurchAdvLetterEntryCZZ2."Entry Type"::"VAT Adjustment", @@ -738,7 +750,7 @@ codeunit 31142 "Purch. Adv. Letter-Post CZZ" TempAdvancePostingBufferCZZ: Record "Advance Posting Buffer CZZ" temporary; VATPostingSetup: Record "VAT Posting Setup"; ExchRateAmount, ExchRateVATAmount : Decimal; - GLEntryNo, VATEntryNo : Integer; + EntryNo, GLEntryNo, VATEntryNo : Integer; IsHandled: Boolean; begin IsHandled := false; @@ -788,13 +800,13 @@ codeunit 31142 "Purch. Adv. Letter-Post CZZ" TempPurchAdvLetterEntryCZZGlob.InitNewEntry(); TempPurchAdvLetterEntryCZZGlob.InitRelatedEntry(PurchAdvLetterEntryCZZ."Related Entry"); TempPurchAdvLetterEntryCZZGlob.CopyFromGenJnlLine(GenJournalLine); + TempPurchAdvLetterEntryCZZGlob.CopyFromPurchAdvLetterHeader(PurchAdvLetterHeaderCZZ); TempPurchAdvLetterEntryCZZGlob."Entry Type" := "Advance Letter Entry Type CZZ"::"VAT Payment"; - TempPurchAdvLetterEntryCZZGlob."Purch. Adv. Letter No." := PurchAdvLetterHeaderCZZ."No."; TempPurchAdvLetterEntryCZZGlob."VAT Entry No." := VATEntryNo; TempPurchAdvLetterEntryCZZGlob."VAT Identifier" := VATPostingSetup."VAT Identifier"; TempPurchAdvLetterEntryCZZGlob."Auxiliary Entry" := AdvancePostingBufferCZZ."Auxiliary Entry"; TempPurchAdvLetterEntryCZZGlob.Cancelled := true; - TempPurchAdvLetterEntryCZZGlob.InsertNewEntry(not AdvancePostingParametersCZZ."Temporary Entries Only"); + EntryNo := TempPurchAdvLetterEntryCZZGlob.InsertNewEntry(not AdvancePostingParametersCZZ."Temporary Entries Only"); AdvancePostingBufferCZZ.ReverseAmounts(); if GenJournalLine."Currency Code" <> '' then @@ -847,6 +859,15 @@ codeunit 31142 "Purch. Adv. Letter-Post CZZ" PurchAdvLetterHeaderCZZ, PurchAdvLetterEntryCZZ, AdvancePostingBufferCZZ, AdvancePostingParametersCZZ, GLEntryNo, GenJnlPostLine, GenJournalLine); end; + + // Post non-deductible VAT + if (not AdvancePostingParametersCZZ."Temporary Entries Only") and + (AdvancePostingBufferCZZ."Non-Deductible VAT %" <> 0) + then begin + VATDocumentPurchAdvLetterEntryCZZ.Get(EntryNo); // VAT payment entry + PostNonDeductibleVAT( + VATDocumentPurchAdvLetterEntryCZZ, AdvancePostingBufferCZZ, GenJnlPostLine, AdvancePostingParametersCZZ); + end; until AdvancePostingBufferCZZ.Next() = 0; if not AdvancePostingParametersCZZ."Temporary Entries Only" then begin @@ -1025,8 +1046,8 @@ codeunit 31142 "Purch. Adv. Letter-Post CZZ" TempPurchAdvLetterEntryCZZGlob.InitNewEntry(); TempPurchAdvLetterEntryCZZGlob.InitRelatedEntry(PurchAdvLetterEntryCZZ."Related Entry"); TempPurchAdvLetterEntryCZZGlob.CopyFromGenJnlLine(GenJournalLine); + TempPurchAdvLetterEntryCZZGlob.CopyFromPurchAdvLetterHeader(PurchAdvLetterHeaderCZZ); TempPurchAdvLetterEntryCZZGlob."Entry Type" := PurchAdvLetterEntryCZZ."Entry Type"; - TempPurchAdvLetterEntryCZZGlob."Purch. Adv. Letter No." := PurchAdvLetterHeaderCZZ."No."; TempPurchAdvLetterEntryCZZGlob."VAT Entry No." := VATEntryNo; TempPurchAdvLetterEntryCZZGlob."VAT Identifier" := VATPostingSetup."VAT Identifier"; TempPurchAdvLetterEntryCZZGlob."Auxiliary Entry" := AdvancePostingBufferCZZ."Auxiliary Entry"; @@ -1109,8 +1130,8 @@ codeunit 31142 "Purch. Adv. Letter-Post CZZ" TempPurchAdvLetterEntryCZZGlob.InitVendorLedgerEntry(VendorLedgerEntry); TempPurchAdvLetterEntryCZZGlob.InitRelatedEntry(PurchAdvLetterEntryCZZ); TempPurchAdvLetterEntryCZZGlob.CopyFromGenJnlLine(GenJournalLine); + TempPurchAdvLetterEntryCZZGlob.CopyFromPurchAdvLetterHeader(PurchAdvLetterHeaderCZZ); TempPurchAdvLetterEntryCZZGlob."Entry Type" := PurchAdvLetterEntryCZZ."Entry Type"; - TempPurchAdvLetterEntryCZZGlob."Purch. Adv. Letter No." := PurchAdvLetterHeaderCZZ."No."; TempPurchAdvLetterEntryCZZGlob.Cancelled := true; EntryNo := TempPurchAdvLetterEntryCZZGlob.InsertNewEntry(not AdvancePostingParametersCZZ."Temporary Entries Only"); @@ -1181,6 +1202,7 @@ codeunit 31142 "Purch. Adv. Letter-Post CZZ" PurchAdvLetterEntryCZZ.SetRange("Purch. Adv. Letter No.", PurchAdvLetterHeaderCZZ."No."); PurchAdvLetterEntryCZZ.SetRange("Entry Type", PurchAdvLetterEntryCZZ."Entry Type"::Payment); PurchAdvLetterEntryCZZ.SetRange(Cancelled, false); + OnPostAdvanceLetterClosingOnAfterSetPurchAdvLetterEntryFilter(PurchAdvLetterEntryCZZ); if PurchAdvLetterEntryCZZ.FindSet() then repeat PostAdvanceLetterEntryClosing( @@ -1269,8 +1291,8 @@ codeunit 31142 "Purch. Adv. Letter-Post CZZ" TempPurchAdvLetterEntryCZZGlob.InitVendorLedgerEntry(VendorLedgerEntry2); TempPurchAdvLetterEntryCZZGlob.InitRelatedEntry(PurchAdvLetterEntryCZZ); TempPurchAdvLetterEntryCZZGlob.CopyFromGenJnlLine(GenJournalLine); + TempPurchAdvLetterEntryCZZGlob.CopyFromPurchAdvLetterHeader(PurchAdvLetterHeaderCZZ); TempPurchAdvLetterEntryCZZGlob."Entry Type" := "Advance Letter Entry Type CZZ"::Close; - TempPurchAdvLetterEntryCZZGlob."Purch. Adv. Letter No." := PurchAdvLetterHeaderCZZ."No."; TempPurchAdvLetterEntryCZZGlob."Amount (LCY)" := -RemainingAmountLCY; EntryNo := TempPurchAdvLetterEntryCZZGlob.InsertNewEntry(not AdvancePostingParametersCZZ."Temporary Entries Only"); end; @@ -1416,8 +1438,8 @@ codeunit 31142 "Purch. Adv. Letter-Post CZZ" TempPurchAdvLetterEntryCZZGlob.InitVendorLedgerEntry(VendorLedgerEntry2); TempPurchAdvLetterEntryCZZGlob.InitRelatedEntry(PurchAdvLetterEntryCZZ); TempPurchAdvLetterEntryCZZGlob.CopyFromGenJnlLine(GenJournalLine); + TempPurchAdvLetterEntryCZZGlob.CopyFromPurchAdvLetterHeader(PurchAdvLetterHeaderCZZ); TempPurchAdvLetterEntryCZZGlob."Entry Type" := "Advance Letter Entry Type CZZ"::Usage; - TempPurchAdvLetterEntryCZZGlob."Purch. Adv. Letter No." := PurchAdvLetterHeaderCZZ."No."; EntryNo := TempPurchAdvLetterEntryCZZGlob.InsertNewEntry(not AdvancePostingParametersCZZ."Temporary Entries Only"); if PurchAdvLetterHeaderCZZ."Automatic Post VAT Usage" then begin @@ -1462,8 +1484,9 @@ codeunit 31142 "Purch. Adv. Letter-Post CZZ" VATDocumentPurchAdvLetterEntryCZZ: Record "Purch. Adv. Letter Entry CZZ"; VATPostingSetup: Record "VAT Posting Setup"; PurchAdvLetterHeaderCZZ: Record "Purch. Adv. Letter Header CZZ"; + NonDeductibleVATCZZ: Codeunit "Non-Deductible VAT CZZ"; CalcVATAmountLCY, CalcAmountLCY, ExchRateAmount, ExchRateVATAmount, AmountToUse : Decimal; - GLEntryNo, VATEntryNo : Integer; + EntryNo, GLEntryNo, VATEntryNo : Integer; IsHandled: Boolean; begin IsHandled := false; @@ -1540,12 +1563,12 @@ codeunit 31142 "Purch. Adv. Letter-Post CZZ" TempPurchAdvLetterEntryCZZGlob.InitNewEntry(); TempPurchAdvLetterEntryCZZGlob.InitRelatedEntry(RelatedEntryNo); TempPurchAdvLetterEntryCZZGlob.CopyFromGenJnlLine(GenJournalLine); + TempPurchAdvLetterEntryCZZGlob.CopyFromPurchAdvLetterHeader(PurchAdvLetterHeaderCZZ); TempPurchAdvLetterEntryCZZGlob."Entry Type" := EntryType; - TempPurchAdvLetterEntryCZZGlob."Purch. Adv. Letter No." := PurchAdvLetterHeaderCZZ."No."; TempPurchAdvLetterEntryCZZGlob."VAT Entry No." := VATEntryNo; TempPurchAdvLetterEntryCZZGlob."VAT Identifier" := VATPostingSetup."VAT Identifier"; TempPurchAdvLetterEntryCZZGlob."Auxiliary Entry" := AdvancePostingBufferCZZ."Auxiliary Entry"; - TempPurchAdvLetterEntryCZZGlob.InsertNewEntry(not AdvancePostingParametersCZZ."Temporary Entries Only"); + EntryNo := TempPurchAdvLetterEntryCZZGlob.InsertNewEntry(not AdvancePostingParametersCZZ."Temporary Entries Only"); AdvancePostingBufferCZZ.ReverseAmounts(); if GenJournalLine."Currency Code" <> '' then @@ -1589,6 +1612,20 @@ codeunit 31142 "Purch. Adv. Letter-Post CZZ" PurchAdvLetterHeaderCZZ, PurchAdvLetterEntryCZZ, VATPostingSetup, AdvancePostingBufferCZZ, AdvancePostingParametersCZZ, GLEntryNo, GenJnlPostLine, GenJournalLine); end; + + // Post non-deductible VAT + if (not AdvancePostingParametersCZZ."Temporary Entries Only") and + (AdvancePostingBufferCZZ."Non-Deductible VAT %" <> 0) + then begin + VATDocumentPurchAdvLetterEntryCZZ.Get(EntryNo); // VAT usage or VAT close entry + AdvancePostingBufferCZZ."Non-Deductible VAT %" := + NonDeductibleVATCZZ.GetNonDeductibleVATPct( + AdvancePostingBufferCZZ, VATDocumentPurchAdvLetterEntryCZZ."VAT Date"); + PostNonDeductibleVAT( + VATDocumentPurchAdvLetterEntryCZZ, AdvancePostingBufferCZZ, GenJnlPostLine, AdvancePostingParametersCZZ); + VATDocumentPurchAdvLetterEntryCZZ."Non-Deductible VAT %" := AdvancePostingBufferCZZ."Non-Deductible VAT %"; + VATDocumentPurchAdvLetterEntryCZZ.Modify(); + end; until AdvancePostingBufferCZZ.Next() = 0; if not AdvancePostingParametersCZZ."Temporary Entries Only" then @@ -1719,8 +1756,8 @@ codeunit 31142 "Purch. Adv. Letter-Post CZZ" TempPurchAdvLetterEntryCZZGlob.InitNewEntry(); TempPurchAdvLetterEntryCZZGlob.InitRelatedEntry(RelatedEntryNo); TempPurchAdvLetterEntryCZZGlob.CopyFromVATPostingSetup(VATPostingSetup); + TempPurchAdvLetterEntryCZZGlob.CopyFromPurchAdvLetterHeader(PurchAdvLetterHeaderCZZ); TempPurchAdvLetterEntryCZZGlob."Entry Type" := "Advance Letter Entry Type CZZ"::"VAT Rate"; - TempPurchAdvLetterEntryCZZGlob."Purch. Adv. Letter No." := PurchAdvLetterHeaderCZZ."No."; TempPurchAdvLetterEntryCZZGlob."Document No." := AdvancePostingParametersCZZ."Document No."; TempPurchAdvLetterEntryCZZGlob."External Document No." := AdvancePostingParametersCZZ."External Document No."; TempPurchAdvLetterEntryCZZGlob."Posting Date" := AdvancePostingParametersCZZ."Posting Date"; @@ -1816,8 +1853,8 @@ codeunit 31142 "Purch. Adv. Letter-Post CZZ" TempPurchAdvLetterEntryCZZGlob.InitRelatedEntry(RelatedEntryNo); TempPurchAdvLetterEntryCZZGlob.InitDetailedVendorLedgerEntry(RelatedDetEntryNo); TempPurchAdvLetterEntryCZZGlob.CopyFromVATPostingSetup(VATPostingSetup); + TempPurchAdvLetterEntryCZZGlob.CopyFromPurchAdvLetterHeader(PurchAdvLetterHeaderCZZ); TempPurchAdvLetterEntryCZZGlob."Entry Type" := "Advance Letter Entry Type CZZ"::"VAT Adjustment"; - TempPurchAdvLetterEntryCZZGlob."Purch. Adv. Letter No." := PurchAdvLetterHeaderCZZ."No."; TempPurchAdvLetterEntryCZZGlob."Document No." := AdvancePostingParametersCZZ."Document No."; TempPurchAdvLetterEntryCZZGlob."External Document No." := AdvancePostingParametersCZZ."External Document No."; TempPurchAdvLetterEntryCZZGlob."Posting Date" := AdvancePostingParametersCZZ."Posting Date"; @@ -1841,6 +1878,77 @@ codeunit 31142 "Purch. Adv. Letter-Post CZZ" EntryNo, GenJnlPostLine, AdvancePostingParametersCZZ, TempPurchAdvLetterEntryCZZGlob); end; + internal procedure PostNonDeductibleVAT( + PurchAdvLetterEntryCZZ: Record "Purch. Adv. Letter Entry CZZ"; + AdvancePostingBufferCZZ: Record "Advance Posting Buffer CZZ"; + var GenJnlPostLine: Codeunit "Gen. Jnl.-Post Line"; + AdvancePostingParametersCZZ: Record "Advance Posting Parameters CZZ") + var + PurchAdvLetterHeaderCZZ: Record "Purch. Adv. Letter Header CZZ"; + GenJournalLine: Record "Gen. Journal Line"; + VATPostingSetup: Record "VAT Posting Setup"; + NonDeductibleVATCZZ: Codeunit "Non-Deductible VAT CZZ"; + GLEntryNo: Integer; + IsHandled: Boolean; + begin + IsHandled := false; + OnBeforePostNonDeductibleVAT( + PurchAdvLetterEntryCZZ, AdvancePostingBufferCZZ, GenJnlPostLine, AdvancePostingParametersCZZ, IsHandled); + if IsHandled then + exit; + + if AdvancePostingBufferCZZ."Non-Deductible VAT %" = 0 then + exit; + + PurchAdvLetterHeaderCZZ.Get(PurchAdvLetterEntryCZZ."Purch. Adv. Letter No."); + VATPostingSetup.Get(AdvancePostingBufferCZZ."VAT Bus. Posting Group", AdvancePostingBufferCZZ."VAT Prod. Posting Group"); + + InitGenJournalLine(PurchAdvLetterHeaderCZZ, PurchAdvLetterEntryCZZ, AdvancePostingParametersCZZ, GenJournalLine); + GenJournalLine."Account No." := VATPostingSetup.GetPurchAdvLetterAccountCZZ(); + GenJournalLine."Gen. Posting Type" := GenJournalLine."Gen. Posting Type"::Purchase; + GenJournalLine.Correction := true; + GenJournalLine.CopyFromAdvancePostingBufferCZZ(AdvancePostingBufferCZZ); + if (AdvancePostingBufferCZZ."VAT Calculation Type" = AdvancePostingBufferCZZ."VAT Calculation Type"::"Reverse Charge VAT") and + (AdvancePostingBufferCZZ."VAT Amount (ACY)" <> 0) + then + GenJournalLine."VAT Posting" := GenJournalLine."VAT Posting"::"Manual VAT Entry"; + if not AdvancePostingParametersCZZ."Temporary Entries Only" then begin + OnPostNonDeductibleVATOnBeforePost( + PurchAdvLetterHeaderCZZ, PurchAdvLetterEntryCZZ, VATPostingSetup, + AdvancePostingBufferCZZ, AdvancePostingParametersCZZ, GenJnlPostLine, GenJournalLine); + GLEntryNo := RunGenJnlPostLine(GenJournalLine, GenJnlPostLine, true, true, false); + OnPostNonDeductibleVATOnAfterPost( + PurchAdvLetterHeaderCZZ, PurchAdvLetterEntryCZZ, VATPostingSetup, AdvancePostingBufferCZZ, + AdvancePostingParametersCZZ, GLEntryNo, GenJnlPostLine, GenJournalLine); + end; + + InitGenJournalLine(PurchAdvLetterHeaderCZZ, PurchAdvLetterEntryCZZ, AdvancePostingParametersCZZ, GenJournalLine); + GenJournalLine."Account No." := VATPostingSetup.GetPurchAdvLetterNDVATAccountCZZ(); + GenJournalLine."Gen. Posting Type" := GenJournalLine."Gen. Posting Type"::Purchase; + AdvancePostingBufferCZZ.ReverseAmounts(); + GenJournalLine.CopyFromAdvancePostingBufferCZZ(AdvancePostingBufferCZZ); + if (AdvancePostingBufferCZZ."VAT Calculation Type" = AdvancePostingBufferCZZ."VAT Calculation Type"::"Reverse Charge VAT") and + (AdvancePostingBufferCZZ."VAT Amount (ACY)" <> 0) + then begin + NonDeductibleVATCZZ.Calculate(AdvancePostingBufferCZZ); + NonDeductibleVATCZZ.Copy(GenJournalLine, AdvancePostingBufferCZZ); + GenJournalLine."VAT Posting" := GenJournalLine."VAT Posting"::"Manual VAT Entry"; + end else + GenJournalLine.Validate("Non-Deductible VAT %", AdvancePostingBufferCZZ."Non-Deductible VAT %"); + if not AdvancePostingParametersCZZ."Temporary Entries Only" then begin + OnPostNonDeductibleVATOnBeforePostBalance( + PurchAdvLetterHeaderCZZ, PurchAdvLetterEntryCZZ, VATPostingSetup, + AdvancePostingBufferCZZ, AdvancePostingParametersCZZ, GenJnlPostLine, GenJournalLine); + GLEntryNo := RunGenJnlPostLine(GenJournalLine, GenJnlPostLine, true, true, false); + OnPostNonDeductibleVATOnAfterPostBalance( + PurchAdvLetterHeaderCZZ, PurchAdvLetterEntryCZZ, VATPostingSetup, AdvancePostingBufferCZZ, + AdvancePostingParametersCZZ, GLEntryNo, GenJnlPostLine, GenJournalLine); + end; + + OnAfterPostNonDeductibleVAT(PurchAdvLetterHeaderCZZ, PurchAdvLetterEntryCZZ, + AdvancePostingBufferCZZ, GenJnlPostLine, AdvancePostingParametersCZZ); + end; + internal procedure BufferAdvanceVATLines( var PurchAdvLetterEntryCZZ: Record "Purch. Adv. Letter Entry CZZ"; var AdvancePostingBufferCZZ: Record "Advance Posting Buffer CZZ"; @@ -2834,6 +2942,36 @@ codeunit 31142 "Purch. Adv. Letter-Post CZZ" begin end; + [IntegrationEvent(false, false)] + local procedure OnBeforePostNonDeductibleVAT(PurchAdvLetterEntryCZZ: Record "Purch. Adv. Letter Entry CZZ"; var AdvancePostingBufferCZZ: Record "Advance Posting Buffer CZZ"; var GenJnlPostLine: Codeunit "Gen. Jnl.-Post Line"; var AdvancePostingParametersCZZ: Record "Advance Posting Parameters CZZ"; var IsHandled: Boolean) + begin + end; + + [IntegrationEvent(false, false)] + local procedure OnPostNonDeductibleVATOnBeforePost(PurchAdvLetterHeaderCZZ: Record "Purch. Adv. Letter Header CZZ"; PurchAdvLetterEntryCZZ: Record "Purch. Adv. Letter Entry CZZ"; VATPostingSetup: Record "VAT Posting Setup"; var AdvancePostingBufferCZZ: Record "Advance Posting Buffer CZZ"; AdvancePostingParametersCZZ: Record "Advance Posting Parameters CZZ"; var GenJnlPostLine: Codeunit "Gen. Jnl.-Post Line"; var GenJournalLine: Record "Gen. Journal Line") + begin + end; + + [IntegrationEvent(false, false)] + local procedure OnPostNonDeductibleVATOnAfterPost(PurchAdvLetterHeaderCZZ: Record "Purch. Adv. Letter Header CZZ"; PurchAdvLetterEntryCZZ: Record "Purch. Adv. Letter Entry CZZ"; VATPostingSetup: Record "VAT Posting Setup"; var AdvancePostingBufferCZZ: Record "Advance Posting Buffer CZZ"; AdvancePostingParametersCZZ: Record "Advance Posting Parameters CZZ"; GLEntryNo: Integer; var GenJnlPostLine: Codeunit "Gen. Jnl.-Post Line"; var GenJournalLine: Record "Gen. Journal Line") + begin + end; + + [IntegrationEvent(false, false)] + local procedure OnPostNonDeductibleVATOnBeforePostBalance(PurchAdvLetterHeaderCZZ: Record "Purch. Adv. Letter Header CZZ"; PurchAdvLetterEntryCZZ: Record "Purch. Adv. Letter Entry CZZ"; VATPostingSetup: Record "VAT Posting Setup"; var AdvancePostingBufferCZZ: Record "Advance Posting Buffer CZZ"; AdvancePostingParametersCZZ: Record "Advance Posting Parameters CZZ"; var GenJnlPostLine: Codeunit "Gen. Jnl.-Post Line"; var GenJournalLine: Record "Gen. Journal Line") + begin + end; + + [IntegrationEvent(false, false)] + local procedure OnPostNonDeductibleVATOnAfterPostBalance(PurchAdvLetterHeaderCZZ: Record "Purch. Adv. Letter Header CZZ"; PurchAdvLetterEntryCZZ: Record "Purch. Adv. Letter Entry CZZ"; VATPostingSetup: Record "VAT Posting Setup"; var AdvancePostingBufferCZZ: Record "Advance Posting Buffer CZZ"; AdvancePostingParametersCZZ: Record "Advance Posting Parameters CZZ"; GLEntryNo: Integer; var GenJnlPostLine: Codeunit "Gen. Jnl.-Post Line"; var GenJournalLine: Record "Gen. Journal Line") + begin + end; + + [IntegrationEvent(false, false)] + local procedure OnAfterPostNonDeductibleVAT(PurchAdvLetterHeaderCZZ: Record "Purch. Adv. Letter Header CZZ"; PurchAdvLetterEntryCZZ: Record "Purch. Adv. Letter Entry CZZ"; AdvancePostingBufferCZZ: Record "Advance Posting Buffer CZZ"; var GenJnlPostLine: Codeunit "Gen. Jnl.-Post Line"; AdvancePostingParametersCZZ: Record "Advance Posting Parameters CZZ") + begin + end; + [IntegrationEvent(false, false)] local procedure OnPostUnrealizedExchangeRateOnBeforePost(PurchAdvLetterHeaderCZZ: Record "Purch. Adv. Letter Header CZZ"; PurchAdvLetterEntryCZZ: Record "Purch. Adv. Letter Entry CZZ"; VATPostingSetup: Record "VAT Posting Setup"; Amount: Decimal; VATAmount: Decimal; AdvancePostingParametersCZZ: Record "Advance Posting Parameters CZZ"; var GenJnlPostLine: Codeunit "Gen. Jnl.-Post Line"; var GenJournalLine: Record "Gen. Journal Line") begin @@ -2890,4 +3028,9 @@ codeunit 31142 "Purch. Adv. Letter-Post CZZ" local procedure OnUnapplyVendLedgEntryOnBeforeUnapplyVendLedgEntry(var VendorLedgerEntry: Record "Vendor Ledger Entry"; var DetailedVendorLedgEntry: Record "Detailed Vendor Ledg. Entry"; var GenJournalLine: Record "Gen. Journal Line") begin end; + + [IntegrationEvent(false, false)] + local procedure OnPostAdvanceLetterClosingOnAfterSetPurchAdvLetterEntryFilter(var PurchAdvLetterEntryCZZ: Record "Purch. Adv. Letter Entry CZZ") + begin + end; } \ No newline at end of file diff --git a/Apps/CZ/AdvancePaymentsLocalization/app/Src/Codeunits/PurchPostAdvanceLetterCZZ.Codeunit.al b/Apps/CZ/AdvancePaymentsLocalization/app/Src/Codeunits/PurchPostAdvanceLetterCZZ.Codeunit.al index 4974badb47..15a7f62df0 100644 --- a/Apps/CZ/AdvancePaymentsLocalization/app/Src/Codeunits/PurchPostAdvanceLetterCZZ.Codeunit.al +++ b/Apps/CZ/AdvancePaymentsLocalization/app/Src/Codeunits/PurchPostAdvanceLetterCZZ.Codeunit.al @@ -14,15 +14,19 @@ codeunit 31456 "Purch. Post Advance Letter CZZ" trigger OnRun() begin + PurchAdvLetterManagementCZZ.SetPreviewMode(PreviewMode); + case DocumentType of DocumentType::PaymentVAT: - PurchAdvLetterManagementCZZ.PostAdvancePaymentVAT(Rec, 0D); + PurchAdvLetterManagementCZZ.PostAdvancePaymentVAT(Rec); DocumentType::PaymentUsageVAT: PurchAdvLetterManagementCZZ.PostAdvancePaymentUsageVAT(Rec); DocumentType::CreditMemoVAT: PurchAdvLetterManagementCZZ.PostAdvanceCreditMemoVAT(Rec); DocumentType::CancelUsageVAT: PurchAdvLetterManagementCZZ.PostCancelUsageVAT(Rec); + DocumentType::NonDeductibleVAT: + PurchAdvLetterManagementCZZ.PostNonDeductibleVAT(Rec); end; if PreviewMode then @@ -32,7 +36,7 @@ codeunit 31456 "Purch. Post Advance Letter CZZ" var GenJnlPostPreview: Codeunit "Gen. Jnl.-Post Preview"; PurchAdvLetterManagementCZZ: Codeunit "PurchAdvLetterManagement CZZ"; - DocumentType: Option PaymentVAT,PaymentUsageVAT,CreditMemoVAT,CancelUsageVAT; + DocumentType: Option PaymentVAT,PaymentUsageVAT,CreditMemoVAT,CancelUsageVAT,NonDeductibleVAT; PreviewMode: Boolean; procedure PostPaymentVAT(var PurchAdvLetterEntryCZZ: Record "Purch. Adv. Letter Entry CZZ"; Preview: Boolean) @@ -59,6 +63,12 @@ codeunit 31456 "Purch. Post Advance Letter CZZ" Post(PurchAdvLetterEntryCZZ, Preview); end; + procedure PostNonDeductibleVAT(var PurchAdvLetterEntryCZZ: Record "Purch. Adv. Letter Entry CZZ"; Preview: Boolean) + begin + DocumentType := DocumentType::NonDeductibleVAT; + Post(PurchAdvLetterEntryCZZ, Preview); + end; + local procedure Post(var PurchAdvLetterEntryCZZ: Record "Purch. Adv. Letter Entry CZZ"; Preview: Boolean) begin if Preview then begin @@ -73,7 +83,7 @@ codeunit 31456 "Purch. Post Advance Letter CZZ" PreviewMode := NewPreviewMode; end; - procedure SetDocumentType(NewDocumentType: Option PaymentVAT,PaymentUsageVAT,CreditMemoVAT,CancelUsageVAT) + procedure SetDocumentType(NewDocumentType: Option PaymentVAT,PaymentUsageVAT,CreditMemoVAT,CancelUsageVAT,NonDeductibleVAT) begin DocumentType := NewDocumentType; end; diff --git a/Apps/CZ/AdvancePaymentsLocalization/app/Src/Codeunits/PurchPostHandlerCZZ.Codeunit.al b/Apps/CZ/AdvancePaymentsLocalization/app/Src/Codeunits/PurchPostHandlerCZZ.Codeunit.al index ae5fac89c9..5bad4cb07a 100644 --- a/Apps/CZ/AdvancePaymentsLocalization/app/Src/Codeunits/PurchPostHandlerCZZ.Codeunit.al +++ b/Apps/CZ/AdvancePaymentsLocalization/app/Src/Codeunits/PurchPostHandlerCZZ.Codeunit.al @@ -42,6 +42,10 @@ codeunit 31022 "Purch.-Post Handler CZZ" if (not PurchHeader.Invoice) or (not PurchHeader.IsAdvanceLetterDocTypeCZZ()) then exit; + PurchInvHeader.CalcFields("Remaining Amount"); + if PurchInvHeader."Remaining Amount" = 0 then + exit; + AdvLetterUsageDocTypeCZZ := PurchHeader.GetAdvLetterUsageDocTypeCZZ(); VendorLedgerEntry.Get(PurchInvHeader."Vendor Ledger Entry No."); @@ -55,6 +59,8 @@ codeunit 31022 "Purch.-Post Handler CZZ" AdvanceLetterApplicationCZZ.SetRange("Document No.", PurchHeader."No."); AdvanceLetterApplicationCZZ.DeleteAll(true); end; + + OnAfterPurchPostOnAfterFinalizePostingOnBeforeCommit(PurchHeader, PurchInvHeader, GenJnlPostLine); end; [EventSubscriber(ObjectType::Codeunit, Codeunit::"Purch.-Post", 'OnBeforeCreatePrepmtLines', '', false, false)] @@ -68,4 +74,9 @@ codeunit 31022 "Purch.-Post Handler CZZ" begin IsHandled := true; end; + + [IntegrationEvent(false, false)] + local procedure OnAfterPurchPostOnAfterFinalizePostingOnBeforeCommit(var PurchHeader: Record "Purchase Header"; var PurchInvHeader: Record "Purch. Inv. Header"; var GenJnlPostLine: Codeunit "Gen. Jnl.-Post Line") + begin + end; } diff --git a/Apps/CZ/AdvancePaymentsLocalization/app/Src/Codeunits/ReportSelectionHandlerCZZ.Codeunit.al b/Apps/CZ/AdvancePaymentsLocalization/app/Src/Codeunits/ReportSelectionHandlerCZZ.Codeunit.al index b91db5da61..95307916dd 100644 --- a/Apps/CZ/AdvancePaymentsLocalization/app/Src/Codeunits/ReportSelectionHandlerCZZ.Codeunit.al +++ b/Apps/CZ/AdvancePaymentsLocalization/app/Src/Codeunits/ReportSelectionHandlerCZZ.Codeunit.al @@ -109,21 +109,14 @@ codeunit 31420 "Report Selection Handler CZZ" end; end; - [EventSubscriber(ObjectType::Codeunit, Codeunit::"Report Distribution Management", 'OnAfterGetFullDocumentTypeText', '', false, false)] - local procedure AddAdvanceReportsOnAfterGetFullDocumentTypeText(DocumentVariant: Variant; var DocumentTypeText: Text[50]) + [EventSubscriber(ObjectType::Codeunit, Codeunit::"Report Distribution Management", 'OnGetFullDocumentTypeTextElseCase', '', false, false)] + local procedure AddAdvanceReportsOnGetFullDocumentTypeTextElseCase(DocumentRecordRef: RecordRef; var DocumentTypeText: Text[50]) var - DocumentRecordRef: RecordRef; SalesAdvanceLetterLbl: Label 'Sales Advance'; SalesAdvanceVATDocumentLbl: Label 'Sales Advance VAT Document'; PurchaseAdvanceLetterLbl: Label 'Purchase Advance'; PurchaseAdvanceVATDocumentLbl: Label 'Purchase Advance VAT Document'; begin - if DocumentVariant.IsRecord then - DocumentRecordRef.GetTable(DocumentVariant) - else - if DocumentVariant.IsRecordRef then - DocumentRecordRef := DocumentVariant; - case DocumentRecordRef.Number of Database::"Sales Adv. Letter Header CZZ": DocumentTypeText := SalesAdvanceLetterLbl; @@ -136,6 +129,40 @@ codeunit 31420 "Report Selection Handler CZZ" end; end; + [EventSubscriber(ObjectType::Codeunit, Codeunit::"Report Distribution Management", 'OnGetDocumentLanguageCodeCaseElse', '', false, false)] + local procedure GetLanguageCodeFromAdvancesOnGetDocumentLanguageCodeCaseElse(DocumentRecordRef: RecordRef; var LanguageCode: Code[10]) + var + PurchAdvLetterHeaderCZZ: Record "Purch. Adv. Letter Header CZZ"; + PurchAdvLetterEntryCZZ: Record "Purch. Adv. Letter Entry CZZ"; + SalesAdvLetterHeaderCZZ: Record "Sales Adv. Letter Header CZZ"; + SalesAdvLetterEntryCZZ: Record "Sales Adv. Letter Entry CZZ"; + begin + case DocumentRecordRef.Number of + Database::"Sales Adv. Letter Header CZZ": + begin + DocumentRecordRef.SetTable(SalesAdvLetterHeaderCZZ); + LanguageCode := SalesAdvLetterHeaderCZZ."Language Code"; + end; + Database::"Sales Adv. Letter Entry CZZ": + begin + DocumentRecordRef.SetTable(SalesAdvLetterEntryCZZ); + SalesAdvLetterHeaderCZZ.Get(SalesAdvLetterEntryCZZ."Sales Adv. Letter No."); + LanguageCode := SalesAdvLetterHeaderCZZ."Language Code"; + end; + Database::"Purch. Adv. Letter Header CZZ": + begin + DocumentRecordRef.SetTable(PurchAdvLetterHeaderCZZ); + LanguageCode := PurchAdvLetterHeaderCZZ."Language Code"; + end; + Database::"Purch. Adv. Letter Entry CZZ": + begin + DocumentRecordRef.SetTable(PurchAdvLetterEntryCZZ); + PurchAdvLetterHeaderCZZ.Get(PurchAdvLetterEntryCZZ."Purch. Adv. Letter No."); + LanguageCode := PurchAdvLetterHeaderCZZ."Language Code"; + end; + end; + end; + [EventSubscriber(ObjectType::Codeunit, Codeunit::"Email Scenario Mapping", 'OnAfterFromReportSelectionUsage', '', false, false)] local procedure AddSalesAdvanceReportsOnAfterFromReportSelectionUsage(ReportSelectionUsage: Enum "Report Selection Usage"; var EmailScenario: Enum "Email Scenario") begin diff --git a/Apps/CZ/AdvancePaymentsLocalization/app/Src/Codeunits/SalesAdvLetterManagementCZZ.Codeunit.al b/Apps/CZ/AdvancePaymentsLocalization/app/Src/Codeunits/SalesAdvLetterManagementCZZ.Codeunit.al index 3ac27310d0..c174098b0a 100644 --- a/Apps/CZ/AdvancePaymentsLocalization/app/Src/Codeunits/SalesAdvLetterManagementCZZ.Codeunit.al +++ b/Apps/CZ/AdvancePaymentsLocalization/app/Src/Codeunits/SalesAdvLetterManagementCZZ.Codeunit.al @@ -526,6 +526,8 @@ codeunit 31002 "SalesAdvLetterManagement CZZ" AdvanceLetterApplicationCZZ."Posting Date" := TempAdvanceLetterApplicationCZZ."Posting Date"; AdvanceLetterApplicationCZZ."Document Type" := AdvLetterUsageDocTypeCZZ; AdvanceLetterApplicationCZZ."Document No." := DocumentNo; + AdvanceLetterApplicationCZZ."Job No." := TempAdvanceLetterApplicationCZZ."Job No."; + AdvanceLetterApplicationCZZ."Job Task No." := TempAdvanceLetterApplicationCZZ."Job Task No."; AdvanceLetterApplicationCZZ.Amount := TempAdvanceLetterApplicationCZZ.Amount; AdvanceLetterApplicationCZZ."Amount (LCY)" := TempAdvanceLetterApplicationCZZ."Amount (LCY)"; OnLinkAdvanceLetterOnBeforeInsertAdvanceLetterApplication(AdvanceLetterApplicationCZZ, TempAdvanceLetterApplicationCZZ); @@ -579,9 +581,14 @@ codeunit 31002 "SalesAdvLetterManagement CZZ" AdvanceLetterApplicationCZZ: Record "Advance Letter Application CZZ"; GenJnlPostLine: Codeunit "Gen. Jnl.-Post Line"; UsedOnDocument: Text; + IsHandled: Boolean; UnlinkIsNotPossibleErr: Label 'Unlink is not possible, because %1 entry exists.', Comment = '%1 = Entry type'; UsedOnDocumentQst: Label 'Advance is used on document(s) %1.\Continue?', Comment = '%1 = Advance No. list'; begin + IsHandled := false; + OnBeforeUnlinkAdvancePayment(SalesAdvLetterEntryCZZ, PostingDate, IsHandled); + if IsHandled then + exit; SalesAdvLetterEntryCZZ.TestField("Entry Type", SalesAdvLetterEntryCZZ."Entry Type"::Payment); SalesAdvLetterEntryCZZ.TestField(Cancelled, false); SalesAdvLetterEntryCZZ2.SetRange("Sales Adv. Letter No.", SalesAdvLetterEntryCZZ."Sales Adv. Letter No."); @@ -1596,4 +1603,9 @@ codeunit 31002 "SalesAdvLetterManagement CZZ" local procedure OnBeforeCheckAdvancePayment(AdvLetterUsageDocTypeCZZ: Enum "Adv. Letter Usage Doc.Type CZZ"; DocumentHeader: Variant; var IsHandled: Boolean); begin end; + + [IntegrationEvent(false, false)] + local procedure OnBeforeUnlinkAdvancePayment(var SalesAdvLetterEntryCZZ: Record "Sales Adv. Letter Entry CZZ"; PostingDate: Date; var IsHandled: Boolean) + begin + end; } diff --git a/Apps/CZ/AdvancePaymentsLocalization/app/Src/Codeunits/SalesAdvLetterPostCZZ.Codeunit.al b/Apps/CZ/AdvancePaymentsLocalization/app/Src/Codeunits/SalesAdvLetterPostCZZ.Codeunit.al index 9ed4f7ae42..7a35ec02fe 100644 --- a/Apps/CZ/AdvancePaymentsLocalization/app/Src/Codeunits/SalesAdvLetterPostCZZ.Codeunit.al +++ b/Apps/CZ/AdvancePaymentsLocalization/app/Src/Codeunits/SalesAdvLetterPostCZZ.Codeunit.al @@ -125,8 +125,8 @@ codeunit 31143 "Sales Adv. Letter-Post CZZ" TempSalesAdvLetterEntryCZZGlob.InitNewEntry(); TempSalesAdvLetterEntryCZZGlob.InitCustLedgerEntry(CustLedgerEntryPayment); TempSalesAdvLetterEntryCZZGlob.CopyFromGenJnlLine(GenJournalLine); + TempSalesAdvLetterEntryCZZGlob.CopyFromSalesAdvLetterHeader(SalesAdvLetterHeaderCZZ); TempSalesAdvLetterEntryCZZGlob."Entry Type" := "Advance Letter Entry Type CZZ"::Payment; - TempSalesAdvLetterEntryCZZGlob."Sales Adv. Letter No." := SalesAdvLetterHeaderCZZ."No."; EntryNo := TempSalesAdvLetterEntryCZZGlob.InsertNewEntry(not AdvancePostingParametersCZZ."Temporary Entries Only"); if not AdvancePostingParametersCZZ."Temporary Entries Only" then @@ -215,8 +215,8 @@ codeunit 31143 "Sales Adv. Letter-Post CZZ" TempSalesAdvLetterEntryCZZGlob.InitCustLedgerEntry(CustLedgerEntry); TempSalesAdvLetterEntryCZZGlob.InitRelatedEntry(SalesAdvLetterEntryCZZ); TempSalesAdvLetterEntryCZZGlob.CopyFromGenJnlLine(GenJournalLine); + TempSalesAdvLetterEntryCZZGlob.CopyFromSalesAdvLetterHeader(SalesAdvLetterHeaderCZZ); TempSalesAdvLetterEntryCZZGlob."Entry Type" := SalesAdvLetterEntryCZZ."Entry Type"; - TempSalesAdvLetterEntryCZZGlob."Sales Adv. Letter No." := SalesAdvLetterHeaderCZZ."No."; TempSalesAdvLetterEntryCZZGlob.Cancelled := true; TempSalesAdvLetterEntryCZZGlob.InsertNewEntry(not AdvancePostingParametersCZZ."Temporary Entries Only"); @@ -328,8 +328,8 @@ codeunit 31143 "Sales Adv. Letter-Post CZZ" TempSalesAdvLetterEntryCZZGlob.InitNewEntry(); TempSalesAdvLetterEntryCZZGlob.InitRelatedEntry(SalesAdvLetterEntryCZZ); TempSalesAdvLetterEntryCZZGlob.CopyFromGenJnlLine(GenJournalLine); + TempSalesAdvLetterEntryCZZGlob.CopyFromSalesAdvLetterHeader(SalesAdvLetterHeaderCZZ); TempSalesAdvLetterEntryCZZGlob."Entry Type" := "Advance Letter Entry Type CZZ"::"VAT Payment"; - TempSalesAdvLetterEntryCZZGlob."Sales Adv. Letter No." := SalesAdvLetterHeaderCZZ."No."; TempSalesAdvLetterEntryCZZGlob."VAT Entry No." := VATEntryNo; TempSalesAdvLetterEntryCZZGlob."VAT Identifier" := VATPostingSetup."VAT Identifier"; TempSalesAdvLetterEntryCZZGlob."Auxiliary Entry" := AdvancePostingBufferCZZ."Auxiliary Entry"; @@ -406,8 +406,8 @@ codeunit 31143 "Sales Adv. Letter-Post CZZ" TempSalesAdvLetterEntryCZZGlob.InitNewEntry(); TempSalesAdvLetterEntryCZZGlob.InitRelatedEntry(SalesAdvLetterEntryCZZ."Related Entry"); TempSalesAdvLetterEntryCZZGlob.CopyFromGenJnlLine(GenJournalLine); + TempSalesAdvLetterEntryCZZGlob.CopyFromSalesAdvLetterHeader(SalesAdvLetterHeaderCZZ); TempSalesAdvLetterEntryCZZGlob."Entry Type" := "Advance Letter Entry Type CZZ"::"VAT Payment"; - TempSalesAdvLetterEntryCZZGlob."Sales Adv. Letter No." := SalesAdvLetterHeaderCZZ."No."; TempSalesAdvLetterEntryCZZGlob."VAT Entry No." := VATEntryNo; TempSalesAdvLetterEntryCZZGlob."VAT Identifier" := VATPostingSetup."VAT Identifier"; TempSalesAdvLetterEntryCZZGlob."Auxiliary Entry" := AdvancePostingBufferCZZ."Auxiliary Entry"; @@ -672,8 +672,8 @@ codeunit 31143 "Sales Adv. Letter-Post CZZ" TempSalesAdvLetterEntryCZZGlob.InitNewEntry(); TempSalesAdvLetterEntryCZZGlob.InitRelatedEntry(SalesAdvLetterEntryCZZ."Related Entry"); TempSalesAdvLetterEntryCZZGlob.CopyFromGenJnlLine(GenJournalLine); + TempSalesAdvLetterEntryCZZGlob.CopyFromSalesAdvLetterHeader(SalesAdvLetterHeaderCZZ); TempSalesAdvLetterEntryCZZGlob."Entry Type" := "Advance Letter Entry Type CZZ"::"VAT Payment"; - TempSalesAdvLetterEntryCZZGlob."Sales Adv. Letter No." := SalesAdvLetterHeaderCZZ."No."; TempSalesAdvLetterEntryCZZGlob."VAT Entry No." := VATEntryNo; TempSalesAdvLetterEntryCZZGlob."VAT Identifier" := VATPostingSetup."VAT Identifier"; TempSalesAdvLetterEntryCZZGlob."Auxiliary Entry" := AdvancePostingBufferCZZ."Auxiliary Entry"; @@ -899,8 +899,8 @@ codeunit 31143 "Sales Adv. Letter-Post CZZ" TempSalesAdvLetterEntryCZZGlob.InitNewEntry(); TempSalesAdvLetterEntryCZZGlob.InitRelatedEntry(SalesAdvLetterEntryCZZ."Related Entry"); TempSalesAdvLetterEntryCZZGlob.CopyFromGenJnlLine(GenJournalLine); + TempSalesAdvLetterEntryCZZGlob.CopyFromSalesAdvLetterHeader(SalesAdvLetterHeaderCZZ); TempSalesAdvLetterEntryCZZGlob."Entry Type" := SalesAdvLetterEntryCZZ."Entry Type"; - TempSalesAdvLetterEntryCZZGlob."Sales Adv. Letter No." := SalesAdvLetterHeaderCZZ."No."; TempSalesAdvLetterEntryCZZGlob."VAT Entry No." := VATEntryNo; TempSalesAdvLetterEntryCZZGlob."VAT Identifier" := VATPostingSetup."VAT Identifier"; TempSalesAdvLetterEntryCZZGlob."Auxiliary Entry" := AdvancePostingBufferCZZ."Auxiliary Entry"; @@ -983,8 +983,8 @@ codeunit 31143 "Sales Adv. Letter-Post CZZ" TempSalesAdvLetterEntryCZZGlob.InitCustLedgerEntry(CustLedgerEntry); TempSalesAdvLetterEntryCZZGlob.InitRelatedEntry(SalesAdvLetterEntryCZZ); TempSalesAdvLetterEntryCZZGlob.CopyFromGenJnlLine(GenJournalLine); + TempSalesAdvLetterEntryCZZGlob.CopyFromSalesAdvLetterHeader(SalesAdvLetterHeaderCZZ); TempSalesAdvLetterEntryCZZGlob."Entry Type" := SalesAdvLetterEntryCZZ."Entry Type"; - TempSalesAdvLetterEntryCZZGlob."Sales Adv. Letter No." := SalesAdvLetterHeaderCZZ."No."; TempSalesAdvLetterEntryCZZGlob.Cancelled := true; EntryNo := TempSalesAdvLetterEntryCZZGlob.InsertNewEntry(not AdvancePostingParametersCZZ."Temporary Entries Only"); @@ -1055,6 +1055,7 @@ codeunit 31143 "Sales Adv. Letter-Post CZZ" SalesAdvLetterEntryCZZ.SetRange("Sales Adv. Letter No.", SalesAdvLetterHeaderCZZ."No."); SalesAdvLetterEntryCZZ.SetRange("Entry Type", SalesAdvLetterEntryCZZ."Entry Type"::Payment); SalesAdvLetterEntryCZZ.SetRange(Cancelled, false); + OnPostAdvanceLetterClosingOnAfterSetSalesAdvLetterEntryFilter(SalesAdvLetterEntryCZZ); if SalesAdvLetterEntryCZZ.FindSet() then repeat PostAdvanceLetterEntryClosing( @@ -1143,8 +1144,8 @@ codeunit 31143 "Sales Adv. Letter-Post CZZ" TempSalesAdvLetterEntryCZZGlob.InitCustLedgerEntry(CustLedgerEntry2); TempSalesAdvLetterEntryCZZGlob.InitRelatedEntry(SalesAdvLetterEntryCZZ); TempSalesAdvLetterEntryCZZGlob.CopyFromGenJnlLine(GenJournalLine); + TempSalesAdvLetterEntryCZZGlob.CopyFromSalesAdvLetterHeader(SalesAdvLetterHeaderCZZ); TempSalesAdvLetterEntryCZZGlob."Entry Type" := "Advance Letter Entry Type CZZ"::Close; - TempSalesAdvLetterEntryCZZGlob."Sales Adv. Letter No." := SalesAdvLetterHeaderCZZ."No."; TempSalesAdvLetterEntryCZZGlob."Amount (LCY)" := RemainingAmountLCY; EntryNo := TempSalesAdvLetterEntryCZZGlob.InsertNewEntry(not AdvancePostingParametersCZZ."Temporary Entries Only"); end; @@ -1290,8 +1291,8 @@ codeunit 31143 "Sales Adv. Letter-Post CZZ" TempSalesAdvLetterEntryCZZGlob.InitCustLedgerEntry(CustLedgerEntry2); TempSalesAdvLetterEntryCZZGlob.InitRelatedEntry(SalesAdvLetterEntryCZZ); TempSalesAdvLetterEntryCZZGlob.CopyFromGenJnlLine(GenJournalLine); + TempSalesAdvLetterEntryCZZGlob.CopyFromSalesAdvLetterHeader(SalesAdvLetterHeaderCZZ); TempSalesAdvLetterEntryCZZGlob."Entry Type" := "Advance Letter Entry Type CZZ"::Usage; - TempSalesAdvLetterEntryCZZGlob."Sales Adv. Letter No." := SalesAdvLetterHeaderCZZ."No."; EntryNo := TempSalesAdvLetterEntryCZZGlob.InsertNewEntry(not AdvancePostingParametersCZZ."Temporary Entries Only"); if SalesAdvLetterHeaderCZZ."Automatic Post VAT Document" then begin @@ -1401,8 +1402,8 @@ codeunit 31143 "Sales Adv. Letter-Post CZZ" TempSalesAdvLetterEntryCZZGlob.InitNewEntry(); TempSalesAdvLetterEntryCZZGlob.InitRelatedEntry(RelatedEntryNo); TempSalesAdvLetterEntryCZZGlob.CopyFromGenJnlLine(GenJournalLine); + TempSalesAdvLetterEntryCZZGlob.CopyFromSalesAdvLetterHeader(SalesAdvLetterHeaderCZZ); TempSalesAdvLetterEntryCZZGlob."Entry Type" := EntryType; - TempSalesAdvLetterEntryCZZGlob."Sales Adv. Letter No." := SalesAdvLetterHeaderCZZ."No."; TempSalesAdvLetterEntryCZZGlob."VAT Entry No." := VATEntryNo; TempSalesAdvLetterEntryCZZGlob."VAT Identifier" := VATPostingSetup."VAT Identifier"; TempSalesAdvLetterEntryCZZGlob."Auxiliary Entry" := AdvancePostingBufferCZZ."Auxiliary Entry"; @@ -1580,8 +1581,8 @@ codeunit 31143 "Sales Adv. Letter-Post CZZ" TempSalesAdvLetterEntryCZZGlob.InitNewEntry(); TempSalesAdvLetterEntryCZZGlob.InitRelatedEntry(RelatedEntryNo); TempSalesAdvLetterEntryCZZGlob.CopyFromVATPostingSetup(VATPostingSetup); + TempSalesAdvLetterEntryCZZGlob.CopyFromSalesAdvLetterHeader(SalesAdvLetterHeaderCZZ); TempSalesAdvLetterEntryCZZGlob."Entry Type" := "Advance Letter Entry Type CZZ"::"VAT Rate"; - TempSalesAdvLetterEntryCZZGlob."Sales Adv. Letter No." := SalesAdvLetterHeaderCZZ."No."; TempSalesAdvLetterEntryCZZGlob."Document No." := AdvancePostingParametersCZZ."Document No."; TempSalesAdvLetterEntryCZZGlob."Posting Date" := AdvancePostingParametersCZZ."Posting Date"; TempSalesAdvLetterEntryCZZGlob."VAT Date" := AdvancePostingParametersCZZ."VAT Date"; @@ -1675,8 +1676,8 @@ codeunit 31143 "Sales Adv. Letter-Post CZZ" TempSalesAdvLetterEntryCZZGlob.InitRelatedEntry(RelatedEntryNo); TempSalesAdvLetterEntryCZZGlob.InitDetailedCustLedgerEntry(RelatedDetEntryNo); TempSalesAdvLetterEntryCZZGlob.CopyFromVATPostingSetup(VATPostingSetup); + TempSalesAdvLetterEntryCZZGlob.CopyFromSalesAdvLetterHeader(SalesAdvLetterHeaderCZZ); TempSalesAdvLetterEntryCZZGlob."Entry Type" := "Advance Letter Entry Type CZZ"::"VAT Adjustment"; - TempSalesAdvLetterEntryCZZGlob."Sales Adv. Letter No." := SalesAdvLetterHeaderCZZ."No."; TempSalesAdvLetterEntryCZZGlob."Document No." := AdvancePostingParametersCZZ."Document No."; TempSalesAdvLetterEntryCZZGlob."Posting Date" := AdvancePostingParametersCZZ."Posting Date"; TempSalesAdvLetterEntryCZZGlob."VAT Date" := AdvancePostingParametersCZZ."VAT Date"; @@ -2656,4 +2657,9 @@ codeunit 31143 "Sales Adv. Letter-Post CZZ" local procedure OnAfterRunGenJnlPostLine(var GenJnlLine: Record "Gen. Journal Line"; var GenJnlPostLine: Codeunit "Gen. Jnl.-Post Line"; var GLEntryNo: Integer) begin end; + + [IntegrationEvent(false, false)] + local procedure OnPostAdvanceLetterClosingOnAfterSetSalesAdvLetterEntryFilter(var SalesAdvLetterEntryCZZ: Record "Sales Adv. Letter Entry CZZ") + begin + end; } \ No newline at end of file diff --git a/Apps/CZ/AdvancePaymentsLocalization/app/Src/Codeunits/SalesPostHandlerCZZ.Codeunit.al b/Apps/CZ/AdvancePaymentsLocalization/app/Src/Codeunits/SalesPostHandlerCZZ.Codeunit.al index 3ff943641d..6b26c6025d 100644 --- a/Apps/CZ/AdvancePaymentsLocalization/app/Src/Codeunits/SalesPostHandlerCZZ.Codeunit.al +++ b/Apps/CZ/AdvancePaymentsLocalization/app/Src/Codeunits/SalesPostHandlerCZZ.Codeunit.al @@ -42,6 +42,10 @@ codeunit 31008 "Sales-Post Handler CZZ" if (not SalesHeader.Invoice) or (not SalesHeader.IsAdvanceLetterDocTypeCZZ()) then exit; + SalesInvoiceHeader.CalcFields("Remaining Amount"); + if SalesInvoiceHeader."Remaining Amount" = 0 then + exit; + AdvLetterUsageDocTypeCZZ := SalesHeader.GetAdvLetterUsageDocTypeCZZ(); CustLedgerEntry.Get(SalesInvoiceHeader."Cust. Ledger Entry No."); diff --git a/Apps/CZ/AdvancePaymentsLocalization/app/Src/Codeunits/UpgradeApplicationCZZ.Codeunit.al b/Apps/CZ/AdvancePaymentsLocalization/app/Src/Codeunits/UpgradeApplicationCZZ.Codeunit.al index 89f8922b77..e8f90e052f 100644 --- a/Apps/CZ/AdvancePaymentsLocalization/app/Src/Codeunits/UpgradeApplicationCZZ.Codeunit.al +++ b/Apps/CZ/AdvancePaymentsLocalization/app/Src/Codeunits/UpgradeApplicationCZZ.Codeunit.al @@ -86,7 +86,7 @@ codeunit 31088 "Upgrade Application CZZ" var SalesAdvLetterEntry: Record "Sales Adv. Letter Entry CZZ"; begin - if UpgradeTag.HasUpgradeTag(UpgradeTagDefinitionsCZZ.GetSalesAdvLetterEntryCustomerNoUpgradeTag()) then + if UpgradeTag.HasUpgradeTag(UpgradeTagDefinitionsCZZ.GetSalesAdvLetterEntryCustomerNo2UpgradeTag()) then exit; SalesAdvLetterEntry.SetLoadFields("Sales Adv. Letter No."); @@ -97,7 +97,7 @@ codeunit 31088 "Upgrade Application CZZ" SalesAdvLetterEntry.Modify(); until SalesAdvLetterEntry.Next() = 0; - UpgradeTag.SetUpgradeTag(UpgradeTagDefinitionsCZZ.GetSalesAdvLetterEntryCustomerNoUpgradeTag()); + UpgradeTag.SetUpgradeTag(UpgradeTagDefinitionsCZZ.GetSalesAdvLetterEntryCustomerNo2UpgradeTag()); end; local procedure UpgradeAdvanceLetterApplicationAmountLCY() diff --git a/Apps/CZ/AdvancePaymentsLocalization/app/Src/Codeunits/UpgradeTagDefinitionsCZZ.Codeunit.al b/Apps/CZ/AdvancePaymentsLocalization/app/Src/Codeunits/UpgradeTagDefinitionsCZZ.Codeunit.al index 13f89997d8..0a9f4e6bb0 100644 --- a/Apps/CZ/AdvancePaymentsLocalization/app/Src/Codeunits/UpgradeTagDefinitionsCZZ.Codeunit.al +++ b/Apps/CZ/AdvancePaymentsLocalization/app/Src/Codeunits/UpgradeTagDefinitionsCZZ.Codeunit.al @@ -25,6 +25,7 @@ codeunit 31089 "Upgrade Tag Definitions CZZ" PerCompanyUpgradeTags.Add(GetSalesAdvLetterEntryCustomerNoUpgradeTag()); PerCompanyUpgradeTags.Add(GetAdvanceLetterApplicationAmountLCYUpgradeTag()); PerCompanyUpgradeTags.Add(GetPostVATDocForReverseChargeUpgradeTag()); + PerCompanyUpgradeTags.Add(GetSalesAdvLetterEntryCustomerNo2UpgradeTag()); end; procedure GetDataVersion190PerDatabaseUpgradeTag(): Code[250] @@ -71,4 +72,9 @@ codeunit 31089 "Upgrade Tag Definitions CZZ" begin exit('CZZ-494279-PostVATDocForReverseChargeUpgradeTag-20240426'); end; + + procedure GetSalesAdvLetterEntryCustomerNo2UpgradeTag(): Code[250] + begin + exit('CZZ-537960-SalesAdvLetterEntryCustomerNo2UpgradeTag-20240612'); + end; } diff --git a/Apps/CZ/AdvancePaymentsLocalization/app/Src/Codeunits/VendorLedgEntryHandlerCZZ.Codeunit.al b/Apps/CZ/AdvancePaymentsLocalization/app/Src/Codeunits/VendorLedgEntryHandlerCZZ.Codeunit.al index b97097335f..39a968ebe3 100644 --- a/Apps/CZ/AdvancePaymentsLocalization/app/Src/Codeunits/VendorLedgEntryHandlerCZZ.Codeunit.al +++ b/Apps/CZ/AdvancePaymentsLocalization/app/Src/Codeunits/VendorLedgEntryHandlerCZZ.Codeunit.al @@ -43,6 +43,27 @@ codeunit 31021 "Vendor Ledg. Entry Handler CZZ" IsHandled := true; end; + [EventSubscriber(ObjectType::Report, Report::"Open Vend. Entries to Date CZL", 'OnBeforeGetPayablesAccNo', '', false, false)] + local procedure GetPayablesAccNoForOpenVendorEntriesToDate(VendorLedgerEntry: Record "Vendor Ledger Entry"; var GLAccountNo: Code[20]; var IsHandled: Boolean) + var + AdvanceLetterTemplateCZZ: Record "Advance Letter Template CZZ"; + begin + if IsHandled then + exit; + + if VendorLedgerEntry."Advance Letter No. CZZ" = '' then + exit; + + if VendorLedgerEntry."Adv. Letter Template Code CZZ" <> '' then begin + AdvanceLetterTemplateCZZ.Get(VendorLedgerEntry."Adv. Letter Template Code CZZ"); + GLAccountNo := AdvanceLetterTemplateCZZ."Advance Letter G/L Account"; + IsHandled := true; + end else begin + GLAccountNo := VendorLedgerEntry.GetPayablesAccNoCZL(); + IsHandled := true; + end; + end; + [EventSubscriber(ObjectType::Codeunit, Codeunit::"VendEntry-Apply Posted Entries", 'OnApplyVendEntryFormEntryOnAfterCheckEntryOpen', '', false, false)] local procedure CheckAdvanceOnApplyVendEntryFormEntryOnAfterCheckEntryOpen(ApplyingVendLedgEntry: Record "Vendor Ledger Entry") begin diff --git a/Apps/CZ/AdvancePaymentsLocalization/app/Src/PageExtensions/JobCardCZZ.PageExt.al b/Apps/CZ/AdvancePaymentsLocalization/app/Src/PageExtensions/JobCardCZZ.PageExt.al new file mode 100644 index 0000000000..c47bfbe60b --- /dev/null +++ b/Apps/CZ/AdvancePaymentsLocalization/app/Src/PageExtensions/JobCardCZZ.PageExt.al @@ -0,0 +1,65 @@ +pageextension 31245 "Job Card CZZ" extends "Job Card" +{ + layout + { + addlast(factboxes) + { + part(AdvanceUsageFactBoxCZZ; "Advance Usage FactBox CZZ") + { + ApplicationArea = Basic, Suite; + } + } + } + actions + { + addlast("F&unctions") + { + action(CreateAdvanceLetterCZZ) + { + Caption = 'Create Advance Letter'; + ApplicationArea = Basic, Suite; + ToolTip = 'The function creates the advance letter for the project.'; + Image = CreateDocument; + Ellipsis = true; + + trigger OnAction() + var + CreateSalesAdvLetterCZZ: Report "Create Sales Adv. Letter CZZ"; + begin + CreateSalesAdvLetterCZZ.SetJob(Rec); + CreateSalesAdvLetterCZZ.Run(); + end; + } + } + addafter(SalesInvoicesCreditMemos) + { + action(SalesAdvanceLettersCZZ) + { + ApplicationArea = Jobs; + Caption = 'Sales Advance Letters'; + Image = GetSourceDoc; + ToolTip = 'View the sales advance letters that are related to the selected project.'; + + trigger OnAction() + var + TempAdvanceLetterApplicationCZZ: Record "Advance Letter Application CZZ" temporary; + begin + TempAdvanceLetterApplicationCZZ.GetAssignedAdvance(Rec."No.", TempAdvanceLetterApplicationCZZ); + Page.RunModal(Page::"Advance Letter Application CZZ", TempAdvanceLetterApplicationCZZ) + end; + } + } + addafter(SalesInvoicesCreditMemos_Promoted) + { + actionref(SalesAdvanceLetters_PromotedCZZ; SalesAdvanceLettersCZZ) + { + } + } + } + + trigger OnAfterGetCurrRecord() + begin + if GuiAllowed() then + CurrPage.AdvanceUsageFactBoxCZZ.Page.SetDocument(Rec); + end; +} \ No newline at end of file diff --git a/Apps/CZ/AdvancePaymentsLocalization/app/Src/PageExtensions/JobTaskCardCZZ.PageExt.al b/Apps/CZ/AdvancePaymentsLocalization/app/Src/PageExtensions/JobTaskCardCZZ.PageExt.al new file mode 100644 index 0000000000..5075b00e3d --- /dev/null +++ b/Apps/CZ/AdvancePaymentsLocalization/app/Src/PageExtensions/JobTaskCardCZZ.PageExt.al @@ -0,0 +1,49 @@ +pageextension 31247 "Job Task Card CZZ" extends "Job Task Card" +{ + actions + { + addlast(Processing) + { + group("F&unctions CZZ") + { + Caption = 'F&unctions'; + Image = "Action"; + + action(CreateAdvanceLetterCZZ) + { + Caption = 'Create Advance Letter'; + ApplicationArea = Basic, Suite; + ToolTip = 'The function creates the advance letter for the project task.'; + Image = CreateDocument; + Ellipsis = true; + + trigger OnAction() + var + CreateSalesAdvLetterCZZ: Report "Create Sales Adv. Letter CZZ"; + begin + CreateSalesAdvLetterCZZ.SetJobTask(Rec); + CreateSalesAdvLetterCZZ.Run(); + end; + } + } + } + addafter(Dimensions) + { + action(SalesAdvanceLettersCZZ) + { + ApplicationArea = Jobs; + Caption = 'Sales Advance Letters'; + Image = GetSourceDoc; + ToolTip = 'View the sales advance letters that are related to the selected project task.'; + + trigger OnAction() + var + TempAdvanceLetterApplicationCZZ: Record "Advance Letter Application CZZ" temporary; + begin + TempAdvanceLetterApplicationCZZ.GetAssignedAdvance(Rec."Job No.", Rec."Job Task No.", TempAdvanceLetterApplicationCZZ); + Page.RunModal(Page::"Advance Letter Application CZZ", TempAdvanceLetterApplicationCZZ) + end; + } + } + } +} \ No newline at end of file diff --git a/Apps/CZ/AdvancePaymentsLocalization/app/Src/PageExtensions/JobTaskLinesSubformCZZ.PageExt.al b/Apps/CZ/AdvancePaymentsLocalization/app/Src/PageExtensions/JobTaskLinesSubformCZZ.PageExt.al new file mode 100644 index 0000000000..c3280c5c79 --- /dev/null +++ b/Apps/CZ/AdvancePaymentsLocalization/app/Src/PageExtensions/JobTaskLinesSubformCZZ.PageExt.al @@ -0,0 +1,40 @@ +pageextension 31246 "Job Task Lines Subform CZZ" extends "Job Task Lines Subform" +{ + actions + { + addlast(Documents) + { + action(CreateAdvanceLetterCZZ) + { + Caption = 'Create Advance Letter'; + ApplicationArea = Basic, Suite; + ToolTip = 'The function creates the advance letter for the project task.'; + Image = CreateDocument; + Ellipsis = true; + + trigger OnAction() + var + CreateSalesAdvLetterCZZ: Report "Create Sales Adv. Letter CZZ"; + begin + CreateSalesAdvLetterCZZ.SetJobTask(Rec); + CreateSalesAdvLetterCZZ.Run(); + end; + } + action(SalesAdvanceLettersCZZ) + { + ApplicationArea = Jobs; + Caption = 'Sales Advance Letters'; + Image = GetSourceDoc; + ToolTip = 'View the sales advance letters that are related to the selected project task.'; + + trigger OnAction() + var + TempAdvanceLetterApplicationCZZ: Record "Advance Letter Application CZZ" temporary; + begin + TempAdvanceLetterApplicationCZZ.GetAssignedAdvance(Rec."Job No.", Rec."Job Task No.", TempAdvanceLetterApplicationCZZ); + Page.RunModal(Page::"Advance Letter Application CZZ", TempAdvanceLetterApplicationCZZ) + end; + } + } + } +} \ No newline at end of file diff --git a/Apps/CZ/AdvancePaymentsLocalization/app/Src/PageExtensions/PurchasesPayablesSetupCZZ.PageExt.al b/Apps/CZ/AdvancePaymentsLocalization/app/Src/PageExtensions/PurchasesPayablesSetupCZZ.PageExt.al index f2af9790a5..c435ba3f19 100644 --- a/Apps/CZ/AdvancePaymentsLocalization/app/Src/PageExtensions/PurchasesPayablesSetupCZZ.PageExt.al +++ b/Apps/CZ/AdvancePaymentsLocalization/app/Src/PageExtensions/PurchasesPayablesSetupCZZ.PageExt.al @@ -8,6 +8,17 @@ using Microsoft.Purchases.Setup; pageextension 31108 "Purchases & Payables Setup CZZ" extends "Purchases & Payables Setup" { + layout + { + modify("Posted Prepmt. Inv. Nos.") + { + Visible = false; + } + modify("Posted Prepmt. Cr. Memo Nos.") + { + Visible = false; + } + } actions { addlast(navigation) diff --git a/Apps/CZ/AdvancePaymentsLocalization/app/Src/PageExtensions/SalesReceivablesSetupCZZ.PageExt.al b/Apps/CZ/AdvancePaymentsLocalization/app/Src/PageExtensions/SalesReceivablesSetupCZZ.PageExt.al index ef2f598843..a0fdb245b8 100644 --- a/Apps/CZ/AdvancePaymentsLocalization/app/Src/PageExtensions/SalesReceivablesSetupCZZ.PageExt.al +++ b/Apps/CZ/AdvancePaymentsLocalization/app/Src/PageExtensions/SalesReceivablesSetupCZZ.PageExt.al @@ -8,7 +8,17 @@ using Microsoft.Sales.Setup; pageextension 31107 "Sales & Receivables Setup CZZ" extends "Sales & Receivables Setup" { - + layout + { + modify("Posted Prepmt. Inv. Nos.") + { + Visible = false; + } + modify("Posted Prepmt. Cr. Memo Nos.") + { + Visible = false; + } + } actions { addlast(navigation) diff --git a/Apps/CZ/AdvancePaymentsLocalization/app/Src/PageExtensions/VATPostingSetupCZZ.PageExt.al b/Apps/CZ/AdvancePaymentsLocalization/app/Src/PageExtensions/VATPostingSetupCZZ.PageExt.al index af079f7d5c..8359cbbf6e 100644 --- a/Apps/CZ/AdvancePaymentsLocalization/app/Src/PageExtensions/VATPostingSetupCZZ.PageExt.al +++ b/Apps/CZ/AdvancePaymentsLocalization/app/Src/PageExtensions/VATPostingSetupCZZ.PageExt.al @@ -6,7 +6,7 @@ namespace Microsoft.Finance.AdvancePayments; using Microsoft.Finance.VAT.Setup; -pageextension 31025 "VAT Posting Setup CZZ" extends "VAT POsting Setup" +pageextension 31025 "VAT Posting Setup CZZ" extends "VAT Posting Setup" { layout { @@ -35,6 +35,10 @@ pageextension 31025 "VAT Posting Setup CZZ" extends "VAT POsting Setup" ApplicationArea = Basic, Suite; ToolTip = 'Specifies purchase advance letter VAT account.'; } + field("P.Adv.Letter ND VAT Acc. CZZ"; Rec."P.Adv.Letter ND VAT Acc. CZZ") + { + ApplicationArea = Basic, Suite; + } } } } diff --git a/Apps/CZ/AdvancePaymentsLocalization/app/Src/PageExtensions/VATPostingSetupCardCZZ.PageExt.al b/Apps/CZ/AdvancePaymentsLocalization/app/Src/PageExtensions/VATPostingSetupCardCZZ.PageExt.al index 7041c359fe..e7a999ccf6 100644 --- a/Apps/CZ/AdvancePaymentsLocalization/app/Src/PageExtensions/VATPostingSetupCardCZZ.PageExt.al +++ b/Apps/CZ/AdvancePaymentsLocalization/app/Src/PageExtensions/VATPostingSetupCardCZZ.PageExt.al @@ -35,6 +35,10 @@ pageextension 31026 "VAT Posting Setup Card CZZ" extends "VAT Posting Setup Card ApplicationArea = Basic, Suite; ToolTip = 'Specifies purchase advance letter VAT account.'; } + field("P.Adv.Letter ND VAT Acc. CZZ"; Rec."P.Adv.Letter ND VAT Acc. CZZ") + { + ApplicationArea = Basic, Suite; + } } } } diff --git a/Apps/CZ/AdvancePaymentsLocalization/app/Src/PageExtensions/VATSetupCZZ.PageExt.al b/Apps/CZ/AdvancePaymentsLocalization/app/Src/PageExtensions/VATSetupCZZ.PageExt.al new file mode 100644 index 0000000000..562de99cbd --- /dev/null +++ b/Apps/CZ/AdvancePaymentsLocalization/app/Src/PageExtensions/VATSetupCZZ.PageExt.al @@ -0,0 +1,13 @@ +pageextension 31235 "VAT Setup CZZ" extends "VAT Setup" +{ + layout + { + addlast(NonDeductibleVAT) + { + field(UseForAdvanceCZZ; Rec."Use For Advances CZZ") + { + ApplicationArea = Basic, Suite; + } + } + } +} \ No newline at end of file diff --git a/Apps/CZ/AdvancePaymentsLocalization/app/Src/Pages/AdvanceLetterApplEditCZZ.Page.al b/Apps/CZ/AdvancePaymentsLocalization/app/Src/Pages/AdvanceLetterApplEditCZZ.Page.al index 236139c79d..c14835cbc2 100644 --- a/Apps/CZ/AdvancePaymentsLocalization/app/Src/Pages/AdvanceLetterApplEditCZZ.Page.al +++ b/Apps/CZ/AdvancePaymentsLocalization/app/Src/Pages/AdvanceLetterApplEditCZZ.Page.al @@ -37,8 +37,10 @@ page 31175 "Advance Letter Appl. Edit CZZ" begin OnBeforeOnLookupAdvanceLetterNo(Rec, TempAdvanceLetterApplication); - if Page.RunModal(Page::"Advance Letter Application CZZ", TempAdvanceLetterApplication) = Action::LookupOK then + if Page.RunModal(Page::"Advance Letter Application CZZ", TempAdvanceLetterApplication) = Action::LookupOK then begin Rec.CopyFrom(TempAdvanceLetterApplication); + OnAfterOnLookupAdvanceLetterNo(Rec); + end; end; } field("Posting Date"; Rec."Posting Date") @@ -59,6 +61,16 @@ page 31175 "Advance Letter Appl. Edit CZZ" Error(AmountExceededErr, TempAdvanceLetterApplication.Amount); end; } + field("Job No."; Rec."Job No.") + { + ApplicationArea = Basic, Suite; + Visible = false; + } + field("Job Task No."; Rec."Job Task No.") + { + ApplicationArea = Basic, Suite; + Visible = false; + } } } area(FactBoxes) @@ -163,4 +175,9 @@ page 31175 "Advance Letter Appl. Edit CZZ" local procedure OnBeforeOnLookupAdvanceLetterNo(var AdvanceLetterApplicationCZZ: Record "Advance Letter Application CZZ"; var TempAdvanceLetterApplicationCZZ: Record "Advance Letter Application CZZ" temporary) begin end; + + [IntegrationEvent(false, false)] + local procedure OnAfterOnLookupAdvanceLetterNo(var AdvanceLetterApplicationCZZ: Record "Advance Letter Application CZZ") + begin + end; } diff --git a/Apps/CZ/AdvancePaymentsLocalization/app/Src/Pages/AdvanceLetterApplicationCZZ.Page.al b/Apps/CZ/AdvancePaymentsLocalization/app/Src/Pages/AdvanceLetterApplicationCZZ.Page.al index 97c274fef8..8d2e7a6661 100644 --- a/Apps/CZ/AdvancePaymentsLocalization/app/Src/Pages/AdvanceLetterApplicationCZZ.Page.al +++ b/Apps/CZ/AdvancePaymentsLocalization/app/Src/Pages/AdvanceLetterApplicationCZZ.Page.al @@ -35,6 +35,16 @@ page 31174 "Advance Letter Application CZZ" ToolTip = 'Specifies amount.'; MinValue = 0; } + field("Job No."; Rec."Job No.") + { + ApplicationArea = Basic, Suite; + Visible = false; + } + field("Job Task No."; Rec."Job Task No.") + { + ApplicationArea = Basic, Suite; + Visible = false; + } } } area(FactBoxes) diff --git a/Apps/CZ/AdvancePaymentsLocalization/app/Src/Pages/AdvanceLetterTemplatesCZZ.Page.al b/Apps/CZ/AdvancePaymentsLocalization/app/Src/Pages/AdvanceLetterTemplatesCZZ.Page.al index 5ba015d3f2..be821204ef 100644 --- a/Apps/CZ/AdvancePaymentsLocalization/app/Src/Pages/AdvanceLetterTemplatesCZZ.Page.al +++ b/Apps/CZ/AdvancePaymentsLocalization/app/Src/Pages/AdvanceLetterTemplatesCZZ.Page.al @@ -64,10 +64,13 @@ page 31179 "Advance Letter Templates CZZ" ApplicationArea = Basic, Suite; ToolTip = 'Specifies automatic post VAT document.'; } + field("Automatic Post Non-Ded.VAT CZZ"; Rec."Automatic Post Non-Ded. VAT") + { + ApplicationArea = Basic, Suite; + } field("Post VAT Doc. for Rev. Charge"; Rec."Post VAT Doc. for Rev. Charge") { ApplicationArea = Basic, Suite; - ToolTip = 'Specifies whether the VAT document will be posting for reverse charge.'; } #if not CLEAN23 #pragma warning disable AL0432,AS0074 diff --git a/Apps/CZ/AdvancePaymentsLocalization/app/Src/Pages/AdvanceUsageFactBoxCZZ.Page.al b/Apps/CZ/AdvancePaymentsLocalization/app/Src/Pages/AdvanceUsageFactBoxCZZ.Page.al index 776269bc2d..58edb529f0 100644 --- a/Apps/CZ/AdvancePaymentsLocalization/app/Src/Pages/AdvanceUsageFactBoxCZZ.Page.al +++ b/Apps/CZ/AdvancePaymentsLocalization/app/Src/Pages/AdvanceUsageFactBoxCZZ.Page.al @@ -5,6 +5,8 @@ namespace Microsoft.Finance.AdvancePayments; using Microsoft.Finance.VAT.Calculation; +using Microsoft.Projects.Project.Job; +using Microsoft.Projects.Project.Planning; using Microsoft.Purchases.Document; using Microsoft.Purchases.History; using Microsoft.Purchases.Posting; @@ -39,26 +41,28 @@ page 31216 "Advance Usage FactBox CZZ" ApplicationArea = Basic, Suite; Caption = 'Amount to Use'; ToolTip = 'Specifies amount to use of assigned advances.'; + Visible = AmountToUseVisible; } field(AmountToUseLCY; GetAmountToUseLCY()) { ApplicationArea = Basic, Suite; Caption = 'Amount to Use (LCY)'; ToolTip = 'Specifies amount to use (LCY) of assigned advances.'; - Visible = false; + Visible = AmountToUseLCYVisible; } field(AmountUsed; GetAmountUsed()) { ApplicationArea = Basic, Suite; Caption = 'Amount Used'; ToolTip = 'Specifies amount used by the document.'; + Visible = AmountUsedVisible; } field(AmountUsedLCY; GetAmountUsedLCY()) { ApplicationArea = Basic, Suite; Caption = 'Amount Used (LCY)'; ToolTip = 'Specifies amount (LCY) used by the document.'; - Visible = false; + Visible = AmountUsedLCYVisible; } field(TotalAfterDeduction; GetTotalAfterDeduction()) { @@ -66,6 +70,15 @@ page 31216 "Advance Usage FactBox CZZ" Caption = 'Total after Deduction'; ToolTip = 'Specifies total document amount after deduction of used advances.'; Style = Strong; + Visible = TotalAfterDeductionVisible; + } + field(TotalAfterDeductionLCY; GetTotalAfterDeductionLCY()) + { + ApplicationArea = Basic, Suite; + Caption = 'Total after Deduction (LCY)'; + ToolTip = 'Specifies total document amount (LCY) after deduction of used advances.'; + Style = Strong; + Visible = TotalAfterDeductionLCYVisible; } field(AdvanceEntries; GetAdvanceEntriesCount()) { @@ -73,6 +86,7 @@ page 31216 "Advance Usage FactBox CZZ" Caption = 'Advance Entries'; ToolTip = 'Specifies number of advance entries.'; DrillDown = true; + Visible = AdvanceEntriesVisible; trigger OnDrillDown() begin @@ -85,11 +99,22 @@ page 31216 "Advance Usage FactBox CZZ" } } + trigger OnOpenPage() + begin + SetControlAppearance(); + end; + var TempAdvanceLetterApplicationCZZ: Record "Advance Letter Application CZZ" temporary; TempSalesAdvLetterEntryCZZ: Record "Sales Adv. Letter Entry CZZ" temporary; TempPurchAdvLetterEntryCZZ: Record "Purch. Adv. Letter Entry CZZ" temporary; DocumentTotalAmount: Decimal; + AmountToUseVisible, AmountToUseLCYVisible : Boolean; + AmountUsedVisible, AmountUsedLCYVisible : Boolean; + TotalAfterDeductionVisible, TotalAfterDeductionLCYVisible : Boolean; + AdvanceEntriesVisible: Boolean; + JobInLCY: Boolean; + IsJob: Boolean; procedure SetDocument(PurchaseHeader: Record "Purchase Header") begin @@ -127,11 +152,47 @@ page 31216 "Advance Usage FactBox CZZ" CurrPage.Update(); end; + procedure SetDocument(Job: Record Job) + begin + ClearBuffers(); + CollectAssignedAdvances(Job."No."); + DocumentTotalAmount := CalcDocumentTotalAmount(Job); + JobInLCY := Job."Currency Code" = ''; + IsJob := true; + CurrPage.Update(); + end; + + local procedure SetControlAppearance() + begin + AmountToUseVisible := true; + AmountToUseLCYVisible := false; + AmountUsedVisible := true; + AmountUsedLCYVisible := false; + TotalAfterDeductionVisible := true; + TotalAfterDeductionLCYVisible := false; + AdvanceEntriesVisible := true; + + if IsJob then begin + AmountToUseVisible := not JobInLCY; + AmountToUseLCYVisible := JobInLCY; + AmountUsedVisible := not JobInLCY; + AmountUsedLCYVisible := JobInLCY; + TotalAfterDeductionVisible := not JobInLCY; + TotalAfterDeductionLCYVisible := JobInLCY; + AdvanceEntriesVisible := false; + end; + end; + local procedure CollectAssignedAdvances(DocumentType: Enum "Adv. Letter Usage Doc.Type CZZ"; DocumentNo: Code[20]) begin TempAdvanceLetterApplicationCZZ.GetAssignedAdvance(DocumentType, DocumentNo, TempAdvanceLetterApplicationCZZ); end; + local procedure CollectAssignedAdvances(JobNo: Code[20]) + begin + TempAdvanceLetterApplicationCZZ.GetAssignedAdvance(JobNo, TempAdvanceLetterApplicationCZZ); + end; + local procedure CollectPurchAdvLetterEntries(PurchaseHeader: Record "Purchase Header") var PurchAdvLetterManagementCZZ: Codeunit "PurchAdvLetterManagement CZZ"; @@ -232,6 +293,20 @@ page 31216 "Advance Usage FactBox CZZ" exit(SalesInvoiceHeader."Amount Including VAT"); end; + local procedure CalcDocumentTotalAmount(Job: Record Job) TotalAmount: Decimal + var + JobPlanningLine: Record "Job Planning Line"; + begin + JobPlanningLine.SetRange("Job No.", Job."No."); + JobPlanningLine.SetRange("Contract Line", true); + JobPlanningLine.SetFilter(Type, '<>%1', JobPlanningLine.Type::Text); + JobPlanningLine.SetFilter("Line Amount", '<>%1', 0); + if JobPlanningLine.FindSet() then + repeat + TotalAmount += JobPlanningLine.CalcLineAmountIncludingVAT(); + until JobPlanningLine.Next() = 0; + end; + local procedure ClearBuffers() begin TempAdvanceLetterApplicationCZZ.Reset(); @@ -281,4 +356,9 @@ page 31216 "Advance Usage FactBox CZZ" begin exit(DocumentTotalAmount - GetAmountUsed()); end; + + local procedure GetTotalAfterDeductionLCY(): Decimal + begin + exit(DocumentTotalAmount - GetAmountUsedLCY()); + end; } diff --git a/Apps/CZ/AdvancePaymentsLocalization/app/Src/Pages/PurchAdvLetterEntriesCZZ.Page.al b/Apps/CZ/AdvancePaymentsLocalization/app/Src/Pages/PurchAdvLetterEntriesCZZ.Page.al index 34bdf3f9ae..349dc1b1da 100644 --- a/Apps/CZ/AdvancePaymentsLocalization/app/Src/Pages/PurchAdvLetterEntriesCZZ.Page.al +++ b/Apps/CZ/AdvancePaymentsLocalization/app/Src/Pages/PurchAdvLetterEntriesCZZ.Page.al @@ -296,6 +296,32 @@ page 31183 "Purch. Adv. Letter Entries CZZ" PurchPostAdvanceLetterCZZ.PostCancelUsageVAT(Rec, true); end; } + action(PostNonDeductibleVAT) + { + ApplicationArea = Basic, Suite; + Caption = 'Post Non-Deductible VAT'; + Enabled = ("Entry Type" = "Entry Type"::"VAT Payment") and ("Non-Deductible VAT %" = 0) and (not IsClosed) and (not Cancelled) and IsNonDeductVATEnabled; + Image = Post; + ToolTip = 'Post non-deductible VAT.'; + + trigger OnAction() + begin + PurchPostAdvanceLetterCZZ.PostNonDeductibleVAT(Rec, false); + end; + } + action(PostNonDeductibleVATPreview) + { + ApplicationArea = Basic, Suite; + Caption = 'Post Non-Deductible VAT Preview'; + Enabled = ("Entry Type" = "Entry Type"::"VAT Payment") and ("Non-Deductible VAT %" = 0) and (not IsClosed) and (not Cancelled) and IsNonDeductVATEnabled; + Image = ViewPostedOrder; + ToolTip = 'Post non-deductible VAT.'; + + trigger OnAction() + begin + PurchPostAdvanceLetterCZZ.PostNonDeductibleVAT(Rec, true); + end; + } } group(Payment) { @@ -376,13 +402,15 @@ page 31183 "Purch. Adv. Letter Entries CZZ" var PurchAdvLetterHeaderCZZ: Record "Purch. Adv. Letter Header CZZ"; + NonDeductibleVATCZZ: Codeunit "Non-Deductible VAT CZZ"; PurchPostAdvanceLetterCZZ: Codeunit "Purch. Post Advance Letter CZZ"; - IsClosed: Boolean; + IsClosed, IsNonDeductVATEnabled : Boolean; trigger OnAfterGetRecord() begin GetAdvanceLetter(); IsClosed := PurchAdvLetterHeaderCZZ.Status = PurchAdvLetterHeaderCZZ.Status::Closed; + IsNonDeductVATEnabled := NonDeductibleVATCZZ.IsNonDeductibleVATEnabled() and Rec.IsNonDeductibleVATAllowed(); end; local procedure GetAdvanceLetter() diff --git a/Apps/CZ/AdvancePaymentsLocalization/app/Src/Pages/SalesAdvanceLetterCZZ.Page.al b/Apps/CZ/AdvancePaymentsLocalization/app/Src/Pages/SalesAdvanceLetterCZZ.Page.al index 0a10508f99..402a374711 100644 --- a/Apps/CZ/AdvancePaymentsLocalization/app/Src/Pages/SalesAdvanceLetterCZZ.Page.al +++ b/Apps/CZ/AdvancePaymentsLocalization/app/Src/Pages/SalesAdvanceLetterCZZ.Page.al @@ -278,6 +278,16 @@ page 31171 "Sales Advance Letter CZZ" ToolTip = 'Specifies the secondary VAT registration number for the customer.'; Importance = Additional; } + field("Job No."; Rec."Job No.") + { + ApplicationArea = Basic, Suite; + Importance = Additional; + } + field("Job Task No."; Rec."Job Task No.") + { + ApplicationArea = Basic, Suite; + Importance = Additional; + } } group(Payments) { diff --git a/Apps/CZ/AdvancePaymentsLocalization/app/Src/Pages/SalesAdvanceLettersCZZ.Page.al b/Apps/CZ/AdvancePaymentsLocalization/app/Src/Pages/SalesAdvanceLettersCZZ.Page.al index 4b68cf366d..7692355b3c 100644 --- a/Apps/CZ/AdvancePaymentsLocalization/app/Src/Pages/SalesAdvanceLettersCZZ.Page.al +++ b/Apps/CZ/AdvancePaymentsLocalization/app/Src/Pages/SalesAdvanceLettersCZZ.Page.al @@ -165,6 +165,16 @@ page 31170 "Sales Advance Letters CZZ" ToolTip = 'Specifies the code for Shortcut Dimension 2, which is one of two global dimension codes that you set up in the General Ledger Setup window.'; Visible = false; } + field("Job No."; Rec."Job No.") + { + ApplicationArea = Basic, Suite; + Visible = false; + } + field("Job Task No."; Rec."Job Task No.") + { + ApplicationArea = Basic, Suite; + Visible = false; + } } } area(FactBoxes) diff --git a/Apps/CZ/AdvancePaymentsLocalization/app/Src/ReportExtensions/VATCoeffCorrectionCZZ.ReportExt.al b/Apps/CZ/AdvancePaymentsLocalization/app/Src/ReportExtensions/VATCoeffCorrectionCZZ.ReportExt.al new file mode 100644 index 0000000000..fe96822bed --- /dev/null +++ b/Apps/CZ/AdvancePaymentsLocalization/app/Src/ReportExtensions/VATCoeffCorrectionCZZ.ReportExt.al @@ -0,0 +1,63 @@ +reportextension 31007 "VAT Coeff. Correction CZZ" extends "VAT Coeff. Correction CZL" +{ + dataset + { + modify("VAT Entry") + { + trigger OnAfterPreDataItem() + begin + if RecalculateAdvances then + exit; + + "VAT Entry".SetRange("Advance Letter No. CZZ", ''); + end; + } + modify(Loop) + { + trigger OnAfterPostDataItem() + begin + if not RecalculateAdvances or not Post then + exit; + + UpdatePurchAdvLetterEntries(); + end; + } + } + + requestpage + { + layout + { + addlast(Entries) + { + field(RecalculateAdvancesField; RecalculateAdvances) + { + ApplicationArea = Basic, Suite; + Caption = 'Recalculate Advances'; + ToolTip = 'Specifies whether the advances should be recalculated.'; + } + } + } + } + + var + RecalculateAdvances: Boolean; + + [InherentPermissions(PermissionObjectType::TableData, Database::"Purch. Adv. Letter Entry CZZ", 'rm')] + local procedure UpdatePurchAdvLetterEntries() + var + PurchAdvLetterEntryCZZ: Record "Purch. Adv. Letter Entry CZZ"; + NonDeductibleVATSetupCZL: Record "Non-Deductible VAT Setup CZL"; + begin + PurchAdvLetterEntryCZZ.SetRange("VAT Date", FromVATDate, ToVATDate); + PurchAdvLetterEntryCZZ.SetFilter("Non-Deductible VAT %", '<>0'); + if PurchAdvLetterEntryCZZ.FindSet() then + repeat + if NonDeductibleVATSetupCZL.FindToDate(PurchAdvLetterEntryCZZ."VAT Date") then + if PurchAdvLetterEntryCZZ."Non-Deductible VAT %" <> NonDeductibleVATSetupCZL."Settlement Coefficient" then begin + PurchAdvLetterEntryCZZ."Non-Deductible VAT %" := NonDeductibleVATSetupCZL."Settlement Coefficient"; + PurchAdvLetterEntryCZZ.Modify(false); + end; + until PurchAdvLetterEntryCZZ.Next() = 0; + end; +} \ No newline at end of file diff --git a/Apps/CZ/AdvancePaymentsLocalization/app/Src/Reports/CreateSalesAdvLetterCZZ.Report.al b/Apps/CZ/AdvancePaymentsLocalization/app/Src/Reports/CreateSalesAdvLetterCZZ.Report.al index da8b22cdb2..c418bceff6 100644 --- a/Apps/CZ/AdvancePaymentsLocalization/app/Src/Reports/CreateSalesAdvLetterCZZ.Report.al +++ b/Apps/CZ/AdvancePaymentsLocalization/app/Src/Reports/CreateSalesAdvLetterCZZ.Report.al @@ -5,6 +5,8 @@ namespace Microsoft.Finance.AdvancePayments; using Microsoft.Finance.Currency; +using Microsoft.Projects.Project.Job; +using Microsoft.Projects.Project.Planning; using Microsoft.Sales.Document; using Microsoft.Sales.Posting; using System.Utilities; @@ -73,26 +75,33 @@ report 31012 "Create Sales Adv. Letter CZZ" } var - SalesHeader: Record "Sales Header"; - TempSalesLine: Record "Sales Line" temporary; Currency: Record Currency; SalesAdvLetterHeaderCZZ: Record "Sales Adv. Letter Header CZZ"; AdvanceLetterTemplateCZZ: Record "Advance Letter Template CZZ"; SalesAdvLetterLineCZZ: Record "Sales Adv. Letter Line CZZ"; - TempAdvancePostingBufferCZZ: Record "Advance Posting Buffer CZZ" temporary; AdvanceLetterApplicationCZZ: Record "Advance Letter Application CZZ"; SalesPost: Codeunit "Sales-Post"; - AdvanceLetterCode: Code[20]; - AdvancePer: Decimal; - AdvanceAmount: Decimal; TotalAmountInclVAT: Decimal; TotalAmountAdvLetter: Decimal; Coef: Decimal; - SuggestByLine: Boolean; AdvLetterCodeEmptyErr: Label 'Advance Letter Code cannot be empty.'; NothingToSuggestErr: Label 'Nothing to sugget.'; AmountCannotBeGreaterErr: Label 'Amount cannot be greater than %1.', Comment = '%1 = Amount Including VAT'; AmountExceedeErr: Label 'Sum of Advance letters exceeded.'; + DifferentBillCustomersErr: Label 'The %1 must be the same in all project tasks. To create a Advance Letter, use the Create Sales Advance Letter for project task function.', Comment = '%1 = field name'; + JobPostingDescriptionTxt: Label 'Project %1', Comment = '%1 = Job No.'; + + protected var + SourceSalesHeader: Record "Sales Header"; + SourceJob: Record Job; + SourceJobTask: Record "Job Task"; + TempJobPlanningLine: Record "Job Planning Line" temporary; + TempSalesLine: Record "Sales Line" temporary; + AdvanceLetterCode: Code[20]; + AdvancePer: Decimal; + AdvanceAmount: Decimal; + SuggestByLine: Boolean; + SourceType: Option SalesOrder,Job,JobTask; trigger OnPreReport() begin @@ -101,7 +110,18 @@ report 31012 "Create Sales Adv. Letter CZZ" if AdvanceLetterCode = '' then Error(AdvLetterCodeEmptyErr); - SalesAdvLetterHeaderCZZ.SetRange("Order No.", SalesHeader."No."); + case SourceType of + SourceType::SalesOrder: + SalesAdvLetterHeaderCZZ.SetRange("Order No.", SourceSalesHeader."No."); + SourceType::Job: + SalesAdvLetterHeaderCZZ.SetRange("Job No.", SourceJob."No."); + SourceType::JobTask: + begin + SalesAdvLetterHeaderCZZ.SetRange("Job No.", SourceJobTask."Job No."); + SalesAdvLetterHeaderCZZ.SetRange("Job Task No.", SourceJobTask."Job Task No."); + end; + end; + SalesAdvLetterHeaderCZZ.SetAutoCalcFields("Amount Including VAT"); if SalesAdvLetterHeaderCZZ.FindSet() then repeat @@ -120,44 +140,31 @@ report 31012 "Create Sales Adv. Letter CZZ" ConfirmManagement: Codeunit "Confirm Management"; OpenAdvanceLetterQst: Label 'Do you want to open created Advance Letter?'; begin - CreateAdvanceLetterHeader(); - - TempSalesLine.SetFilter(Type, '>%1', TempSalesLine.Type::" "); - TempSalesLine.SetFilter(Amount, '<>0'); - if SuggestByLine then begin - if TempSalesLine.FindSet() then - repeat - CreateAdvanceLetterLine(TempSalesLine.Description, TempSalesLine."VAT Bus. Posting Group", TempSalesLine."VAT Prod. Posting Group", TempSalesLine."Amount Including VAT"); - until TempSalesLine.Next() = 0; - end else begin - if TempSalesLine.FindSet() then - repeat - TempAdvancePostingBufferCZZ.Init(); - TempAdvancePostingBufferCZZ."VAT Bus. Posting Group" := TempSalesLine."VAT Bus. Posting Group"; - TempAdvancePostingBufferCZZ."VAT Prod. Posting Group" := TempSalesLine."VAT Prod. Posting Group"; - if TempAdvancePostingBufferCZZ.Find() then begin - TempAdvancePostingBufferCZZ.Amount += TempSalesLine."Amount Including VAT"; - TempAdvancePostingBufferCZZ.Modify(); - end else begin - TempAdvancePostingBufferCZZ.Amount := TempSalesLine."Amount Including VAT"; - TempAdvancePostingBufferCZZ.Insert(); - end; - until TempSalesLine.Next() = 0; - - if TempAdvancePostingBufferCZZ.FindSet() then - repeat - CreateAdvanceLetterLine('', TempAdvancePostingBufferCZZ."VAT Bus. Posting Group", TempAdvancePostingBufferCZZ."VAT Prod. Posting Group", TempAdvancePostingBufferCZZ.Amount); - until TempAdvancePostingBufferCZZ.Next() = 0; + case SourceType of + SourceType::SalesOrder: + begin + CreateAdvanceLetterHeader(SourceSalesHeader); + CreateAdvanceLetterLine(TempSalesLine); + CreateAdvanceLetterApplication(); + end; + SourceType::Job: + begin + CreateAdvanceLetterHeader(SourceJob); + CreateAdvanceLetterLine(TempJobPlanningLine); + end; + SourceType::JobTask: + begin + CreateAdvanceLetterHeader(SourceJobTask); + CreateAdvanceLetterLine(TempJobPlanningLine); + end; end; - CreateAdvanceLetterApplication(); - if ConfirmManagement.GetResponseOrDefault(OpenAdvanceLetterQst, false) then if GuiAllowed() then Page.Run(Page::"Sales Advance Letter CZZ", SalesAdvLetterHeaderCZZ); end; - local procedure CreateAdvanceLetterHeader() + local procedure CreateAdvanceLetterHeader(SalesHeader: Record "Sales Header") begin SalesAdvLetterHeaderCZZ.Init(); SalesAdvLetterHeaderCZZ.Validate("Advance Letter Code", AdvanceLetterCode); @@ -211,6 +218,152 @@ report 31012 "Create Sales Adv. Letter CZZ" SalesAdvLetterHeaderCZZ.Modify(true); end; + local procedure CreateAdvanceLetterHeader(Job: Record Job) + begin + SalesAdvLetterHeaderCZZ.Init(); + SalesAdvLetterHeaderCZZ.Validate("Advance Letter Code", AdvanceLetterCode); + SalesAdvLetterHeaderCZZ."No." := ''; + SalesAdvLetterHeaderCZZ.Insert(true); + SalesAdvLetterHeaderCZZ.Validate("Bill-to Customer No.", Job."Bill-to Customer No."); + SalesAdvLetterHeaderCZZ."Bill-to Name" := Job."Bill-to Name"; + SalesAdvLetterHeaderCZZ."Bill-to Name 2" := Job."Bill-to Name 2"; + SalesAdvLetterHeaderCZZ."Bill-to Address" := Job."Bill-to Address"; + SalesAdvLetterHeaderCZZ."Bill-to Address 2" := Job."Bill-to Address 2"; + SalesAdvLetterHeaderCZZ."Bill-to City" := Job."Bill-to City"; + SalesAdvLetterHeaderCZZ."Bill-to Contact" := Job."Bill-to Contact"; + SalesAdvLetterHeaderCZZ."Bill-to Contact No." := Job."Bill-to Contact No."; + SalesAdvLetterHeaderCZZ."Bill-to Country/Region Code" := Job."Bill-to Country/Region Code"; + SalesAdvLetterHeaderCZZ."Bill-to County" := Job."Bill-to County"; + SalesAdvLetterHeaderCZZ."Bill-to Post Code" := Job."Bill-to Post Code"; + SalesAdvLetterHeaderCZZ."Posting Description" := StrSubstNo(JobPostingDescriptionTxt, Job."No."); + SalesAdvLetterHeaderCZZ."Payment Method Code" := Job."Payment Method Code"; + SalesAdvLetterHeaderCZZ.Validate("Payment Terms Code", Job."Payment Terms Code"); + SalesAdvLetterHeaderCZZ.Validate("Shortcut Dimension 1 Code", Job."Global Dimension 1 Code"); + SalesAdvLetterHeaderCZZ.Validate("Shortcut Dimension 2 Code", Job."Global Dimension 2 Code"); + SalesAdvLetterHeaderCZZ.Validate("Job No.", Job."No."); + if Job."Currency Code" <> '' then + SalesAdvLetterHeaderCZZ.Validate("Currency Code", Job."Currency Code"); + if Job."Invoice Currency Code" <> '' then + SalesAdvLetterHeaderCZZ.Validate("Currency Code", Job."Invoice Currency Code"); + SalesAdvLetterHeaderCZZ.Modify(true); + end; + + local procedure CreateAdvanceLetterHeader(JobTask: Record "Job Task") + begin + SalesAdvLetterHeaderCZZ.Init(); + SalesAdvLetterHeaderCZZ.Validate("Advance Letter Code", AdvanceLetterCode); + SalesAdvLetterHeaderCZZ."No." := ''; + SalesAdvLetterHeaderCZZ.Insert(true); + SalesAdvLetterHeaderCZZ.Validate("Bill-to Customer No.", JobTask.GetBillToCustomer()."No."); + if JobTask."Bill-to Customer No." <> '' then begin + SalesAdvLetterHeaderCZZ."Bill-to Customer No." := JobTask."Bill-to Customer No."; + SalesAdvLetterHeaderCZZ."Bill-to Name" := JobTask."Bill-to Name"; + SalesAdvLetterHeaderCZZ."Bill-to Name 2" := JobTask."Bill-to Name 2"; + SalesAdvLetterHeaderCZZ."Bill-to Address" := JobTask."Bill-to Address"; + SalesAdvLetterHeaderCZZ."Bill-to Address 2" := JobTask."Bill-to Address 2"; + SalesAdvLetterHeaderCZZ."Bill-to City" := JobTask."Bill-to City"; + SalesAdvLetterHeaderCZZ."Bill-to Contact" := JobTask."Bill-to Contact"; + SalesAdvLetterHeaderCZZ."Bill-to Contact No." := JobTask."Bill-to Contact No."; + SalesAdvLetterHeaderCZZ."Bill-to Country/Region Code" := JobTask."Bill-to Country/Region Code"; + SalesAdvLetterHeaderCZZ."Bill-to County" := JobTask."Bill-to County"; + SalesAdvLetterHeaderCZZ."Bill-to Post Code" := JobTask."Bill-to Post Code"; + end; + SalesAdvLetterHeaderCZZ."Posting Description" := StrSubstNo(JobPostingDescriptionTxt, JobTask."Job No."); + SalesAdvLetterHeaderCZZ."Payment Method Code" := JobTask."Payment Method Code"; + SalesAdvLetterHeaderCZZ.Validate("Payment Terms Code", JobTask."Payment Terms Code"); + SalesAdvLetterHeaderCZZ.Validate("Shortcut Dimension 1 Code", JobTask."Global Dimension 1 Code"); + SalesAdvLetterHeaderCZZ.Validate("Shortcut Dimension 2 Code", JobTask."Global Dimension 2 Code"); + SalesAdvLetterHeaderCZZ.Validate("Job No.", JobTask."Job No."); + SalesAdvLetterHeaderCZZ.Validate("Job Task No.", JobTask."Job Task No."); + if JobTask.GetCurrencyCode() <> '' then + SalesAdvLetterHeaderCZZ.Validate("Currency Code", JobTask.GetCurrencyCode()); + if JobTask."Invoice Currency Code" <> '' then + SalesAdvLetterHeaderCZZ.Validate("Currency Code", JobTask."Invoice Currency Code"); + SalesAdvLetterHeaderCZZ.Modify(true); + end; + + local procedure CreateAdvanceLetterLine(var SalesLine: Record "Sales Line") + var + TempAdvancePostingBufferCZZ: Record "Advance Posting Buffer CZZ" temporary; + begin + SalesLine.SetFilter(Type, '>%1', SalesLine.Type::" "); + SalesLine.SetFilter(Amount, '<>0'); + SalesLine.SetLoadFields(Description, "VAT Bus. Posting Group", "VAT Prod. Posting Group", "Amount Including VAT"); + if SalesLine.FindSet() then + repeat + if SuggestByLine then + CreateAdvanceLetterLine( + SalesLine.Description, + SalesLine."VAT Bus. Posting Group", + SalesLine."VAT Prod. Posting Group", + SalesLine."Amount Including VAT") + else + CreateAdvancePostingBuffer( + SalesLine."VAT Bus. Posting Group", + SalesLine."VAT Prod. Posting Group", + SalesLine."Amount Including VAT", + TempAdvancePostingBufferCZZ); + until SalesLine.Next() = 0; + + if TempAdvancePostingBufferCZZ.FindSet() then + repeat + CreateAdvanceLetterLine('', + TempAdvancePostingBufferCZZ."VAT Bus. Posting Group", + TempAdvancePostingBufferCZZ."VAT Prod. Posting Group", + TempAdvancePostingBufferCZZ.Amount); + until TempAdvancePostingBufferCZZ.Next() = 0; + end; + + local procedure CreateAdvanceLetterLine(var JobPlanningLine: Record "Job Planning Line") + var + TempAdvancePostingBufferCZZ: Record "Advance Posting Buffer CZZ" temporary; + AmountIncludingVAT: Decimal; + begin + JobPlanningLine.SetFilter(Type, '<>%1', JobPlanningLine.Type::Text); + JobPlanningLine.SetFilter("Line Amount", '<>0'); + JobPlanningLine.SetLoadFields("Job No.", "Job Task No.", "Line No.", Type, "No.", Description, "Line Amount"); + if JobPlanningLine.FindSet() then + repeat + AmountIncludingVAT := + Round(JobPlanningLine.CalcLineAmountIncludingVAT() * JobPlanningLine.GetInvoiceCurrencyFactor(), + Currency."Amount Rounding Precision"); + if SuggestByLine then + CreateAdvanceLetterLine( + JobPlanningLine.Description, + JobPlanningLine.GetVATBusPostingGroup(), + JobPlanningLine.GetVATProdPostingGroup(), + AmountIncludingVAT) + else + CreateAdvancePostingBuffer( + JobPlanningLine.GetVATBusPostingGroup(), + JobPlanningLine.GetVATProdPostingGroup(), + AmountIncludingVAT, + TempAdvancePostingBufferCZZ); + until JobPlanningLine.Next() = 0; + + if TempAdvancePostingBufferCZZ.FindSet() then + repeat + CreateAdvanceLetterLine('', + TempAdvancePostingBufferCZZ."VAT Bus. Posting Group", + TempAdvancePostingBufferCZZ."VAT Prod. Posting Group", + TempAdvancePostingBufferCZZ.Amount); + until TempAdvancePostingBufferCZZ.Next() = 0; + end; + + local procedure CreateAdvancePostingBuffer(VATBusPostingGroup: Code[20]; VATProdPostingGroup: Code[20]; AmountIncludingVAT: Decimal; var TempAdvancePostingBufferCZZ: Record "Advance Posting Buffer CZZ" temporary) + begin + TempAdvancePostingBufferCZZ.Init(); + TempAdvancePostingBufferCZZ."VAT Bus. Posting Group" := VATBusPostingGroup; + TempAdvancePostingBufferCZZ."VAT Prod. Posting Group" := VATProdPostingGroup; + if TempAdvancePostingBufferCZZ.Find() then begin + TempAdvancePostingBufferCZZ.Amount += AmountIncludingVAT; + TempAdvancePostingBufferCZZ.Modify(); + end else begin + TempAdvancePostingBufferCZZ.Amount := AmountIncludingVAT; + TempAdvancePostingBufferCZZ.Insert(); + end; + end; + local procedure CreateAdvanceLetterLine(Description: Text[100]; VATBusPostingGroup: Code[20]; VATProdPostingGroup: Code[20]; AmountIncludingVAT: Decimal) begin SalesAdvLetterLineCZZ.Init(); @@ -219,7 +372,9 @@ report 31012 "Create Sales Adv. Letter CZZ" SalesAdvLetterLineCZZ.Description := Description; SalesAdvLetterLineCZZ."VAT Bus. Posting Group" := VATBusPostingGroup; SalesAdvLetterLineCZZ.Validate("VAT Prod. Posting Group", VATProdPostingGroup); + SalesAdvLetterLineCZZ.SuspendJobRelationCheck(true); SalesAdvLetterLineCZZ.Validate("Amount Including VAT", Round(AmountIncludingVAT * Coef, Currency."Amount Rounding Precision")); + SalesAdvLetterLineCZZ.SuspendJobRelationCheck(false); if SalesAdvLetterLineCZZ."Amount Including VAT" <> 0 then SalesAdvLetterLineCZZ.Insert(true); end; @@ -230,7 +385,7 @@ report 31012 "Create Sales Adv. Letter CZZ" AdvanceLetterApplicationCZZ."Advance Letter Type" := AdvanceLetterApplicationCZZ."Advance Letter Type"::Sales; AdvanceLetterApplicationCZZ."Advance Letter No." := SalesAdvLetterHeaderCZZ."No."; AdvanceLetterApplicationCZZ."Document Type" := AdvanceLetterApplicationCZZ."Document Type"::"Sales Order"; - AdvanceLetterApplicationCZZ."Document No." := SalesHeader."No."; + AdvanceLetterApplicationCZZ."Document No." := SourceSalesHeader."No."; SalesAdvLetterHeaderCZZ.CalcFields("Amount Including VAT", "Amount Including VAT (LCY)"); AdvanceLetterApplicationCZZ.Amount := SalesAdvLetterHeaderCZZ."Amount Including VAT"; AdvanceLetterApplicationCZZ."Amount (LCY)" := SalesAdvLetterHeaderCZZ."Amount Including VAT (LCY)"; @@ -240,13 +395,13 @@ report 31012 "Create Sales Adv. Letter CZZ" procedure SetSalesHeader(var NewSalesHeader: Record "Sales Header") begin NewSalesHeader.TestField("Document Type", NewSalesHeader."Document Type"::Order); - SalesHeader := NewSalesHeader; - SalesPost.GetSalesLines(SalesHeader, TempSalesLine, 0); + SourceSalesHeader := NewSalesHeader; + SalesPost.GetSalesLines(SourceSalesHeader, TempSalesLine, 0); TempSalesLine.CalcSums("Amount Including VAT"); TotalAmountInclVAT := TempSalesLine."Amount Including VAT"; AdvanceLetterApplicationCZZ.SetRange("Document Type", AdvanceLetterApplicationCZZ."Document Type"::"Sales Order"); - AdvanceLetterApplicationCZZ.SetRange("Document No.", SalesHeader."No."); + AdvanceLetterApplicationCZZ.SetRange("Document No.", SourceSalesHeader."No."); AdvanceLetterApplicationCZZ.CalcSums(Amount); AdvanceAmount := TotalAmountInclVAT - AdvanceLetterApplicationCZZ.Amount; @@ -255,10 +410,97 @@ report 31012 "Create Sales Adv. Letter CZZ" else AdvanceAmount := 0; - if SalesHeader."Currency Code" = '' then + InitCurrency(SourceSalesHeader."Currency Code"); + SourceType := SourceType::SalesOrder; + end; + + procedure SetJob(var NewJob: Record Job) + begin + SourceJob := NewJob; + CheckJobTasks(SourceJob."No."); + + CollectJobPlanningLine(SourceJob."No."); + + AdvanceAmount := TotalAmountInclVAT; + AdvancePer := 100; + + if SourceJob."Invoice Currency Code" <> '' then + InitCurrency(SourceJob."Invoice Currency Code") + else + InitCurrency(SourceJob."Currency Code"); + SourceType := SourceType::Job; + end; + + procedure SetJobTask(var NewJobTask: Record "Job Task") + begin + SourceJobTask := NewJobTask; + + CollectJobPlanningLine(SourceJobTask."Job No.", SourceJobTask."Job Task No."); + + AdvanceAmount := TotalAmountInclVAT; + AdvancePer := 100; + + if SourceJobTask."Invoice Currency Code" <> '' then + InitCurrency(SourceJobTask."Invoice Currency Code") + else + InitCurrency(SourceJobTask.GetCurrencyCode()); + SourceType := SourceType::JobTask; + end; + + local procedure CollectJobPlanningLine(JobNo: Code[20]) + begin + CollectJobPlanningLine(JobNo, ''); + end; + + local procedure CollectJobPlanningLine(JobNo: Code[20]; JobTaskNo: Code[20]) + var + JobPlanningLine: Record "Job Planning Line"; + begin + TotalAmountInclVAT := 0; + + JobPlanningLine.SetRange("Job No.", JobNo); + if JobTaskNo <> '' then + JobPlanningLine.SetRange("Job Task No.", JobTaskNo); + JobPlanningLine.SetRange("Contract Line", true); + JobPlanningLine.SetFilter(Type, '<>%1', JobPlanningLine.Type::Text); + JobPlanningLine.SetFilter("Line Amount", '<>%1', 0); + if JobPlanningLine.FindSet() then + repeat + JobPlanningLine.CheckVATProdPostingGroup(); + TotalAmountInclVAT += + Round(JobPlanningLine.CalcLineAmountIncludingVAT() * JobPlanningLine.GetInvoiceCurrencyFactor(), + Currency."Amount Rounding Precision"); + + TempJobPlanningLine.Init(); + TempJobPlanningLine := JobPlanningLine; + TempJobPlanningLine.Insert(); + until JobPlanningLine.Next() = 0; + end; + + local procedure CheckJobTasks(JobNo: Code[20]) + var + JobTask: Record "Job Task"; + begin + JobTask.SetLoadFields("Bill-to Customer No.", "Invoice Currency Code"); + JobTask.SetRange("Job No.", JobNo); + JobTask.SetRange("Job Task Type", JobTask."Job Task Type"::Posting); + if not JobTask.FindFirst() then + exit; + JobTask.SetFilter("Bill-to Customer No.", '<>%1', JobTask."Bill-to Customer No."); + if not JobTask.IsEmpty() then + Error(DifferentBillCustomersErr, JobTask.FieldCaption("Bill-to Customer No.")); + JobTask.SetRange("Bill-to Customer No."); + JobTask.SetFilter("Invoice Currency Code", '<>%1', JobTask."Invoice Currency Code"); + if not JobTask.IsEmpty() then + Error(DifferentBillCustomersErr, JobTask.FieldCaption("Invoice Currency Code")); + end; + + local procedure InitCurrency(CurrencyCode: Code[10]) + begin + if CurrencyCode = '' then Currency.InitRoundingPrecision() else begin - Currency.Get(SalesHeader."Currency Code"); + Currency.Get(CurrencyCode); Currency.TestField("Amount Rounding Precision"); end; end; diff --git a/Apps/CZ/AdvancePaymentsLocalization/app/Src/Reports/PurchAdvanceLettersVAT.rdl b/Apps/CZ/AdvancePaymentsLocalization/app/Src/Reports/PurchAdvanceLettersVAT.rdl index eb12940a4f..a2f5db1a3c 100644 --- a/Apps/CZ/AdvancePaymentsLocalization/app/Src/Reports/PurchAdvanceLettersVAT.rdl +++ b/Apps/CZ/AdvancePaymentsLocalization/app/Src/Reports/PurchAdvanceLettersVAT.rdl @@ -45,6 +45,9 @@ 2cm + + 2cm + @@ -351,6 +354,41 @@ + + + + true + true + + + + + =Parameters!NonDeductVATAmountLCYLbl.Value + + + + + + + Textbox4 + + + 2pt + 2pt + 2pt + 2pt + + + + @@ -594,6 +632,41 @@ + + + + true + true + + + + + =Parameters!NonDeductVATAmountLCYLbl.Value + + + + + + + Textbox5 + + + 2pt + 2pt + 2pt + 2pt + + + + @@ -831,6 +904,40 @@ + + + + true + true + + + + + + + + + + + + Textbox15 + + + 2pt + 2pt + 2pt + 2pt + + + + @@ -1067,6 +1174,40 @@ + + + + true + true + + + + + + + + + + + + Textbox16 + + + 2pt + 2pt + 2pt + 2pt + + + + @@ -1366,6 +1507,40 @@ + + + + true + true + + + + + =Fields!NonDeductVATAmountLCY.Value + + + + + + + + + 2pt + 2pt + 2pt + 2pt + + + + @@ -1605,6 +1780,41 @@ + + + + true + true + + + + + =Sum(Fields!NonDeductVATAmountLCY.Value) + + + + + + + + + 2pt + 2pt + 2pt + 2pt + + + + @@ -1904,6 +2114,41 @@ + + + + true + true + + + + + + + + + + + + Textbox19 + + + 2pt + 2pt + 2pt + 2pt + + + + @@ -2142,6 +2387,42 @@ + + + + true + true + + + + + =Sum(Fields!NonDeductVATAmountLCY.Value) + + + + + + + =Sum(Fields!NonDeductVATAmountLCY.Value) + + + 2pt + 2pt + 2pt + 2pt + + + + @@ -2387,6 +2668,41 @@ + + + + true + true + + + + + =Sum(Fields!NonDeductVATAmountLCY.Value) + + + + + + + + + 2pt + 2pt + 2pt + 2pt + + + + @@ -2693,6 +3009,41 @@ + + + + true + true + + + + + + + + + + + + Textbox22 + + + 2pt + 2pt + 2pt + 2pt + + + + @@ -2938,6 +3289,41 @@ + + + + true + true + + + + + =Sum(Fields!NonDeductVATAmountLCY.Value) + + + + + + + + + 2pt + 2pt + 2pt + 2pt + + + + @@ -2953,6 +3339,7 @@ + @@ -3062,7 +3449,7 @@ 4.653cm - 17cm + 19cm @@ -3073,7 +3460,7 @@ 4.653cm - 15.35cm + 15.85cm 0.423cm 3.15cm 1 @@ -3150,7 +3537,7 @@ 0.423cm - 15.35cm + 15.85cm 0.423cm 3.15cm 2 @@ -3267,7 +3654,7 @@ 1.692cm 0.423cm - 18.5cm + 19cm 7 + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + 0.48405cm + + + 1.94313cm + + + 1.41823cm + + + 0.88758cm + + + 1.26931cm + + + 1.16035cm + + + 1.85278cm + + + 2.05301cm + + + 2.03644cm + + + 1.17932cm + + + 2.04328cm + + + 1.92636cm + + + + + 0.35278cm + + + + + true + true + + + + + =Parameters!DocumentTypeCaption.Value + + + + + + + Textbox16 + + + + + + + + true + true + + + + + =Parameters!DocumentNoCaption.Value + + + + + + + Textbox17 + + + + + + + + true + true + + + + + =Parameters!PostingDateCaption.Value + + + + + + + Textbox18 + + + + + + + + true + true + + + + + =Parameters!CurrencyCodeCaption.Value + + + + + + + Textbox19 + + + + + + + + true + true + + + + + =Parameters!OriginalCurrencyCaption.Value + + + + + + + Textbox50 + + + + + + + + true + true + + + + + =Parameters!ModifiedAmtCaption.Value + + + + + + + Textbox21 + + + + + + + + true + true + + + + + =Parameters!RemainingAmtCaption.Value + + + + + + + Textbox22 + + + + + + + + true + true + + + + + =Parameters!RemainingAmtLCYCaption.Value + + + + + + + Textbox51 + + + + + + + + true + true + + + + + =Parameters!ModRemainingAmtLCYCaption.Value + + + + + + + Textbox24 + + + + + + + + true + true + + + + + =Parameters!GainLossCaption.Value + + + + + + + Textbox25 + + + + + + + + true + true + + + + + =Parameters!ModAmountDebitCaption.Value + + + + + + + Textbox26 + + + + + + + + true + true + + + + + =Parameters!ModAmountCreditCaption.Value + + + + + + + Textbox27 + + + + + + + + 0.17638cm + + + + + true + + + + + + + + + + + + + + Bottom + 5pt + + + 12 + + + + + + + + + + + + + + + + + 0.17638cm + + + + + true + true + + + + + + + + + + + 12 + + + + + + + + + + + + + + + + + 0.35278cm + + + + + true + true + + + + + =Fields!VLEDocumentType_Fld.Value + + + + + + + Textbox104 + + + + #cccccc + + Top + 5pt + + + + + + + + true + true + + + + + =Fields!VLEDocumentNo_Fld.Value + + + + + + + Textbox105 + + + + #cccccc + + Top + 5pt + 5pt + + + + + + + + true + true + + + + + =Fields!VLEPostingDate_Fld.Value + + + + + + + Textbox97 + + + + #cccccc + + Top + 5pt + 5pt + + + + + + + + true + true + + + + + =Fields!VLECurrencyCode_Fld.Value + + + + + + + Textbox106 + + + + #cccccc + + Top + 5pt + 5pt + + + + + + + + true + true + + + + + =Fields!VLEOriginalCurrency_Fld.Value + + + + + + + Textbox107 + + + + #cccccc + + Top + 5pt + 5pt + + + + + + + + true + true + + + + + =Fields!VLEModifiedAmt_Fld.Value + + + + + + + Textbox108 + + + + #cccccc + + Top + 5pt + 5pt + + + + + + + + true + true + + + + + =Fields!VLERemainingAmt_Fld.Value + + + + + + + Textbox109 + + + + #cccccc + + Top + 5pt + 5pt + + + + + + + + true + true + + + + + =Fields!VLERemainingAmtLCY_Fld.Value + + + + + + + Textbox110 + + + + #cccccc + + Top + 5pt + 5pt + + + + + + + + true + true + + + + + =Fields!VLEModRemainingAmtLCY_Fld.Value + + + + + + + Textbox101 + + + + #cccccc + + Top + 5pt + 5pt + + + + + + + + true + true + + + + + =Fields!VLEGainLoss_Fld.Value + + + + + + + Textbox111 + + + + #cccccc + + Top + 5pt + 5pt + + + + + + + + true + true + + + + + =Fields!VLEDebitAmount_Fld.Value + + + + + + + Textbox112 + + + + #cccccc + + Top + 5pt + 5pt + + + + + + + + true + true + + + + + =Fields!VLECreditAmount_Fld.Value + + + + + + + Textbox113 + + + + #cccccc + + Top + 5pt + + + + + + + + 0.17638cm + + + + + true + true + + + + + + + + Middle + 5pt + + + + + + + + true + true + + + + + + + + + Textbox63 + + + + + + + + true + true + + + + + + + + + Textbox98 + + + + + + + + true + true + + + + + + + + + Textbox64 + + + + + + + + true + true + + + + + + + + + Textbox75 + + + + + + + + true + true + + + + + + + + + + + + + true + true + + + + + + + + + + + + + true + true + + + + + + + + + + + + + true + true + + + + + + + + + + + + + true + true + + + + + + + + + + + + + true + true + + + + + + + + + + + + + true + true + + + + + + + + + + + + + 0.17638cm + + + + + true + true + + + + + + + + Middle + 5pt + + + + + + + + true + true + + + + + + + + + Textbox53 + + + + + + + + true + true + + + + + + + + + Textbox99 + + + + + + + + true + true + + + + + + + + + Textbox54 + + + + + + + + true + true + + + + + + + + + Textbox55 + + + + + + + + true + true + + + + + + + + + + + + + true + true + + + + + + + + + + + + + true + true + + + + + + + + + + + Middle + 0.0625in + + + + + + + + true + true + + + + + + + + + + + Middle + 0.0625in + + + + + + + + true + true + + + + + + + + + + + Middle + 0.0625in + + + + + + + + true + true + + + + + + + + + + + Middle + 0.0625in + + + + + + + + true + true + + + + + + + + + + + Middle + 0.0625in + + + + + + + + 0.35278cm + + + + + true + true + + + + + =Parameters!TotalCaption.Value + + + + + + + Textbox48 + + + 10 + + + + + + + + + + + + + + + true + true + + + + + =Sum(Fields!VLEDebitAmount_Fld.Value) + + + + + + + Textbox183 + + + Top + 5pt + 5pt + + + + + + + + true + true + + + + + =Sum(Fields!VLECreditAmount_Fld.Value) + + + + + + + Textbox184 + + + Top + 5pt + + + + + + + + + + + + + + + + + + + + + + + + + + + + After + true + true + + + After + true + true + + + After + true + + + + + 1 + + + + + + + + + + + Detail_Collection + Output + true + + + + =(Fields!VLEDebitAmount_Fld.Value=0)AND(Fields!VLECreditAmount_Fld.Value=0) + + + + Before + + + Before + + + Before + true + + + + + + DataSet_Result + + + =Fields!VLETableType_Var.Value + Equal + + 3 + + + + 7.65423cm + 0.00272in + 1.76386cm + 18.25384cm + 7 + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =First(Fields!CustomerFiltersVar.Value, "DataSet_Result") + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =First(Fields!VendorFiltersVar.Value, "DataSet_Result") + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =Parameters!DateCaption.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =First(Fields!EndDateVar.Value, "DataSet_Result") + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =Parameters!EmployeeLdgEntryTableCaption.Value @@ -3534,53 +5537,53 @@ 2pt - + - 0.19057in + 0.48405cm - 0.76501in + 1.94313cm - 0.55836in + 1.41823cm - 0.34944in + 0.88758cm - 0.49973in + 1.26931cm - 0.45683in + 1.16035cm - 0.72944in + 1.85278cm - 0.80827in + 2.05301cm - 0.80175in + 2.03644cm - 0.4643in + 1.17932cm - 0.80444in + 2.04328cm - 0.75841in + 1.92636cm - 0.13889in + 0.35278cm - + true true @@ -3611,7 +5614,7 @@ - + true true @@ -3643,7 +5646,7 @@ - + true true @@ -3675,7 +5678,7 @@ - + true true @@ -3707,7 +5710,7 @@ - + true true @@ -3739,7 +5742,7 @@ - + true true @@ -3771,7 +5774,7 @@ - + true true @@ -3803,7 +5806,7 @@ - + true true @@ -3835,7 +5838,7 @@ - + true true @@ -3867,7 +5870,7 @@ - + true true @@ -3899,7 +5902,7 @@ - + true true @@ -3931,7 +5934,7 @@ - + true true @@ -3963,11 +5966,11 @@ - 0.06944in + 0.17638cm - + true @@ -4015,11 +6018,11 @@ - 0.06944in + 0.17638cm - + true true @@ -4061,18 +6064,18 @@ - 0.13889in + 0.35278cm - + true true - =Fields!VLEDocumentType_Fld.Value + =Fields!EMPLEDocumentType_Fld.Value @@ -4283,18 +6286,18 @@ - + true true - =Fields!VLERemainingAmt_Fld.Value + =Fields!EMPLERemainingAmt_Fld.Value @@ -4320,18 +6323,18 @@ - + true true - =Fields!VLERemainingAmtLCY_Fld.Value + =Fields!EMPLERemainingAmtLCY_Fld.Value @@ -4357,18 +6360,18 @@ - + true true - =Fields!VLEModRemainingAmtLCY_Fld.Value + =Fields!EMPLEModRemainingAmtLCY_Fld.Value @@ -4394,14 +6397,14 @@ - + true true - =Fields!VLEGainLoss_Fld.Value + =Fields!EMPLEGainLoss_Fld.Value @@ -4467,18 +6470,18 @@ - + true true - =Fields!VLECreditAmount_Fld.Value + =Fields!EMPLECreditAmount_Fld.Value @@ -4504,11 +6507,11 @@ - 0.06944in + 0.17638cm - + true true @@ -4535,7 +6538,7 @@ - + true true @@ -4561,7 +6564,7 @@ - + true true @@ -4587,7 +6590,7 @@ - + true true @@ -4613,7 +6616,7 @@ - + true true @@ -4639,7 +6642,7 @@ - + true true @@ -4663,7 +6666,7 @@ - + true true @@ -4687,7 +6690,7 @@ - + true true @@ -4711,7 +6714,7 @@ - + true true @@ -4735,7 +6738,7 @@ - + true true @@ -4759,7 +6762,7 @@ - + true true @@ -4783,7 +6786,7 @@ - + true true @@ -4808,11 +6811,11 @@ - 0.06944in + 0.17638cm - + true true @@ -4839,7 +6842,7 @@ - + true true @@ -4865,7 +6868,7 @@ - + true true @@ -4891,7 +6894,7 @@ - + true true @@ -4917,7 +6920,7 @@ - + true true @@ -4943,7 +6946,7 @@ - + true true @@ -4967,7 +6970,7 @@ - + true true @@ -4991,7 +6994,7 @@ - + true true @@ -5021,7 +7024,7 @@ - + true true @@ -5051,7 +7054,7 @@ - + true true @@ -5081,7 +7084,7 @@ - + true true @@ -5111,7 +7114,7 @@ - + true true @@ -5142,11 +7145,11 @@ - 0.13889in + 0.35278cm - + true true @@ -5187,19 +7190,19 @@ - + true true - =Sum(Fields!VLEDebitAmount_Fld.Value) + =Sum(Fields!EMPLEDebitAmount_Fld.Value) @@ -5222,19 +7225,19 @@ - + true true - =Sum(Fields!VLECreditAmount_Fld.Value) + =Sum(Fields!EMPLECreditAmount_Fld.Value) @@ -5291,14 +7294,14 @@ true - + 1 - + @@ -5310,7 +7313,7 @@ - =(Fields!VLEDebitAmount_Fld.Value=0)AND(Fields!VLECreditAmount_Fld.Value=0) + =(Fields!EMPLEDebitAmount_Fld.Value = 0) And (Fields!EMPLECreditAmount_Fld.Value = 0) @@ -5330,91 +7333,27 @@ DataSet_Result - =Fields!VLETableType_Var.Value + =Fields!EMPLETableType_Var.Value Equal - 3 + 4 - 7.65423cm - 1.76385cm + 10.61395cm + 1.76386cm 18.25384cm - 7 + 14 - - - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - =First(Fields!CustomerFiltersVar.Value, "DataSet_Result") - - - - - - 2pt - 2pt - 2pt - 2pt - - - + true true - =First(Fields!VendorFiltersVar.Value, "DataSet_Result") + =First(Fields!EmployeeFiltersVar.Value, "DataSet_Result") @@ -5424,74 +7363,10 @@ Textbox1 - 7.14507cm + 10.10479cm 0.36804cm 18.26767cm - 10 - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - =Parameters!DateCaption.Value - - - - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - =First(Fields!EndDateVar.Value, "DataSet_Result") - - - - @@ -5503,12 +7378,12 @@ - 9.41808cm + 12.37781cm - 18.30266cm + 18.30958cm 1.3015cm @@ -5532,7 +7407,7 @@ 0.06325cm - 0.08056cm + 0.08747cm 20pt 400pt