Report 5174 Archived Blanket Purch. Order
- App
- Base Application
- Namespace
- Microsoft.Purchases.Archive
- Versions
- 17-28
Versions171819202122232425262728
Source29
Source in 29
src/Layers/W1/BaseApp/Purchases/Archive/ArchivedBlanketPurchOrder.Report.al1159 lines, Copyright (c) Microsoft Corporation. MIT
// ------------------------------------------------------------------------------------------------
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
// ------------------------------------------------------------------------------------------------
namespace Microsoft.Purchases.Archive;
using Microsoft.CRM.Team;
using Microsoft.Finance.Currency;
using Microsoft.Finance.Dimension;
using Microsoft.Finance.GeneralLedger.Setup;
using Microsoft.Finance.VAT.Calculation;
using Microsoft.Foundation.Address;
using Microsoft.Foundation.Company;
using Microsoft.Foundation.PaymentTerms;
using Microsoft.Foundation.Shipping;
using Microsoft.Inventory.Location;
using Microsoft.Utilities;
using System.Email;
using System.Globalization;
using System.Utilities;
report 5174 "Archived Blanket Purch. Order"
{
Caption = 'Archived Blanket Purch. Order';
WordMergeDataItem = "Purchase Header Archive";
DefaultRenderingLayout = RDLCLayout;
dataset
{
dataitem("Purchase Header Archive"; "Purchase Header Archive")
{
DataItemTableView = sorting("Document Type", "No.") where("Document Type" = const("Blanket Order"));
RequestFilterFields = "No.", "Buy-from Vendor No.", "No. Printed";
RequestFilterHeading = 'Archived Blanket Purchase Order';
column(Purchase_Header_Archive_Document_Type; "Document Type")
{
}
column(Purchase_Header_Archive_No_; "No.")
{
}
column(Purchase_Header_Archive_Doc__No__Occurrence; "Doc. No. Occurrence")
{
}
column(Purchase_Header_Archive_Version_No_; "Version No.")
{
}
dataitem(CopyLoop; "Integer")
{
DataItemTableView = sorting(Number);
dataitem(PageLoop; "Integer")
{
DataItemTableView = sorting(Number) where(Number = const(1));
column(STRSUBSTNO_Text004_CopyText_; StrSubstNo(ReportTitleLbl, CopyText))
{
}
column(CompanyAddr_1_; CompanyAddr[1])
{
}
column(CompanyAddr_2_; CompanyAddr[2])
{
}
column(CompanyAddr_3_; CompanyAddr[3])
{
}
column(CompanyAddr_4_; CompanyAddr[4])
{
}
column(CompanyInfo__Phone_No__; CompanyInfo."Phone No.")
{
}
column(CompanyInfo__Fax_No__; CompanyInfo."Fax No.")
{
}
column(CompanyInfo__VAT_Registration_No__; CompanyInfo."VAT Registration No.")
{
}
column(CompanyInfo__Giro_No__; CompanyInfo."Giro No.")
{
}
column(CompanyInfo__Bank_Name_; CompanyInfo."Bank Name")
{
}
column(CompanyInfo__Bank_Account_No__; CompanyInfo."Bank Account No.")
{
}
column(FORMAT__Purchase_Header_Archive___Document_Date__0_4_; Format("Purchase Header Archive"."Document Date", 0, 4))
{
}
column(VATNoText; VATNoText)
{
}
column(Purchase_Header_Archive___VAT_Registration_No__; "Purchase Header Archive"."VAT Registration No.")
{
}
column(PurchaserText; PurchaserText)
{
}
column(SalesPurchPerson_Name; SalespersonPurchaser.Name)
{
}
column(Purchase_Header_Archive___No__; "Purchase Header Archive"."No.")
{
}
column(ReferenceText; ReferenceText)
{
}
column(Purchase_Header_Archive___Your_Reference_; "Purchase Header Archive"."Your Reference")
{
}
column(CompanyAddr_5_; CompanyAddr[5])
{
}
column(CompanyAddr_6_; CompanyAddr[6])
{
}
column(CompanyAddr_7_; CompanyAddr[7])
{
}
column(CompanyAddr_8_; CompanyAddr[8])
{
}
column(Purchase_Header_Archive___Buy_from_Vendor_No__; "Purchase Header Archive"."Buy-from Vendor No.")
{
}
column(BuyFromAddr_1_; BuyFromAddr[1])
{
}
column(BuyFromAddr_2_; BuyFromAddr[2])
{
}
column(BuyFromAddr_3_; BuyFromAddr[3])
{
}
column(BuyFromAddr_4_; BuyFromAddr[4])
{
}
column(BuyFromAddr_5_; BuyFromAddr[5])
{
}
column(BuyFromAddr_6_; BuyFromAddr[6])
{
}
column(BuyFromAddr_7_; BuyFromAddr[7])
{
}
column(BuyFromAddr_8_; BuyFromAddr[8])
{
}
column(Purchase_Header_Archive___Prices_Including_VAT_; "Purchase Header Archive"."Prices Including VAT")
{
}
column(STRSUBSTNO_Text010__Purchase_Header_Archive___Version_No____Purchase_Header_Archive___No__of_Archived_Versions__; StrSubstNo(VersionLbl, "Purchase Header Archive"."Version No.", "Purchase Header Archive"."No. of Archived Versions"))
{
}
column(OutputNo; OutputNo)
{
}
column(Purchase_Header_Archive___VAT_Base_Discount___; "Purchase Header Archive"."VAT Base Discount %")
{
}
column(PricesInclVATtxt; PricesInclVATtxt)
{
}
column(ShowInternalInfo; ShowInternalInfo)
{
}
column(PageLoop_Number; Number)
{
}
column(CompanyInfo__Phone_No__Caption; CompanyInfo__Phone_No__CaptionLbl)
{
}
column(CompanyInfo__Fax_No__Caption; CompanyInfo__Fax_No__CaptionLbl)
{
}
column(CompanyInfo__VAT_Registration_No__Caption; CompanyInfo__VAT_Registration_No__CaptionLbl)
{
}
column(CompanyInfo__Giro_No__Caption; CompanyInfo__Giro_No__CaptionLbl)
{
}
column(CompanyInfo__Bank_Name_Caption; CompanyInfo__Bank_Name_CaptionLbl)
{
}
column(CompanyInfo__Bank_Account_No__Caption; CompanyInfo__Bank_Account_No__CaptionLbl)
{
}
column(Order_No_Caption; Order_No_CaptionLbl)
{
}
column(Purchase_Header_Archive___Buy_from_Vendor_No__Caption; "Purchase Header Archive".FieldCaption("Buy-from Vendor No."))
{
}
column(Purchase_Header_Archive___Prices_Including_VAT_Caption; "Purchase Header Archive".FieldCaption("Prices Including VAT"))
{
}
column(PageCaption; PageCaptionLbl)
{
}
dataitem(DimensionLoop1; "Integer")
{
DataItemLinkReference = "Purchase Header Archive";
DataItemTableView = sorting(Number) where(Number = filter(1 ..));
column(DimText; DimText)
{
}
column(DimText_Control72; DimText)
{
}
column(DimensionLoop1_Number; Number)
{
}
column(Header_DimensionsCaption; Header_DimensionsCaptionLbl)
{
}
trigger OnAfterGetRecord()
begin
if Number = 1 then begin
if not DimSetEntry.FindSet() then
CurrReport.Break();
end else
if not Continue then
CurrReport.Break();
Clear(DimText);
Continue := false;
repeat
OldDimText := DimText;
if DimText = '' then
DimText := StrSubstNo(
'%1 %2', DimSetEntry."Dimension Code", DimSetEntry."Dimension Value Code")
else
DimText :=
StrSubstNo(
'%1, %2 %3', DimText,
DimSetEntry."Dimension Code", DimSetEntry."Dimension Value Code");
if StrLen(DimText) > MaxStrLen(OldDimText) then begin
DimText := OldDimText;
Continue := true;
exit;
end;
until (DimSetEntry.Next() = 0);
end;
trigger OnPreDataItem()
begin
if not ShowInternalInfo then
CurrReport.Break();
end;
}
dataitem("Purchase Line Archive"; "Purchase Line Archive")
{
DataItemLink = "Document Type" = field("Document Type"), "Document No." = field("No."), "Doc. No. Occurrence" = field("Doc. No. Occurrence"), "Version No." = field("Version No.");
DataItemLinkReference = "Purchase Header Archive";
DataItemTableView = sorting("Document Type", "Document No.", "Doc. No. Occurrence", "Version No.", "Line No.");
trigger OnPreDataItem()
begin
CurrReport.Break();
end;
}
dataitem(RoundLoop; "Integer")
{
DataItemTableView = sorting(Number);
column(PurchLineArch__Line_Amount_; TempPurchLineArchive."Line Amount")
{
AutoFormatExpression = "Purchase Line Archive"."Currency Code";
AutoFormatType = 1;
}
column(Purchase_Line_Archive__Description; "Purchase Line Archive".Description)
{
}
column(Purchase_Line_Archive___Line_No__; "Purchase Line Archive"."Line No.")
{
}
column(AllowInvDisctxt; AllowInvDisctxt)
{
}
column(Purchase_Line_Archive__Type; PurchaseLineArchiveType)
{
}
column(Purchase_Line_Archive___No__; "Purchase Line Archive"."No.")
{
}
column(Purchase_Line_Archive__Description_Control63; "Purchase Line Archive".Description)
{
}
column(Purchase_Line_Archive__Quantity; "Purchase Line Archive".Quantity)
{
}
column(Purchase_Line_Archive___Unit_of_Measure_; "Purchase Line Archive"."Unit of Measure")
{
}
column(Purchase_Line_Archive___Direct_Unit_Cost_; "Purchase Line Archive"."Direct Unit Cost")
{
AutoFormatExpression = "Purchase Header Archive"."Currency Code";
AutoFormatType = 2;
}
column(Purchase_Line_Archive___Line_Discount___; "Purchase Line Archive"."Line Discount %")
{
}
column(Purchase_Line_Archive___Line_Amount_; "Purchase Line Archive"."Line Amount")
{
AutoFormatExpression = "Purchase Header Archive"."Currency Code";
AutoFormatType = 1;
}
column(Purchase_Line_Archive___Allow_Invoice_Disc__; "Purchase Line Archive"."Allow Invoice Disc.")
{
}
column(Purchase_Line_Archive___VAT_Identifier_; "Purchase Line Archive"."VAT Identifier")
{
}
column(PurchLineArch__Line_Amount__Control77; TempPurchLineArchive."Line Amount")
{
AutoFormatExpression = "Purchase Header Archive"."Currency Code";
AutoFormatType = 1;
}
column(PurchLineArch__Inv__Discount_Amount_; -TempPurchLineArchive."Inv. Discount Amount")
{
AutoFormatExpression = "Purchase Line Archive"."Currency Code";
AutoFormatType = 1;
}
column(PurchLineArch__Line_Amount__Control109; TempPurchLineArchive."Line Amount")
{
AutoFormatExpression = "Purchase Header Archive"."Currency Code";
AutoFormatType = 1;
}
column(TotalText; TotalText)
{
}
column(PurchLineArch__Line_Amount__PurchLineArch__Inv__Discount_Amount_; TempPurchLineArchive."Line Amount" - TempPurchLineArchive."Inv. Discount Amount")
{
AutoFormatExpression = "Purchase Header Archive"."Currency Code";
AutoFormatType = 1;
}
column(TotalInclVATText; TotalInclVATText)
{
}
column(VATAmountLine_VATAmountText; TempVATAmountLine.VATAmountText())
{
}
column(VATAmount; VATAmount)
{
AutoFormatExpression = "Purchase Header Archive"."Currency Code";
AutoFormatType = 1;
}
column(PurchLineArch__Line_Amount__PurchLineArch__Inv__Discount_Amount____VATAmount; TempPurchLineArchive."Line Amount" - TempPurchLineArchive."Inv. Discount Amount" + VATAmount)
{
AutoFormatExpression = "Purchase Header Archive"."Currency Code";
AutoFormatType = 1;
}
column(TotalExclVATText; TotalExclVATText)
{
}
column(PurchLineArch__Line_Amount__PurchLineArch__Inv__Discount_Amount__Control147; TempPurchLineArchive."Line Amount" - TempPurchLineArchive."Inv. Discount Amount")
{
AutoFormatExpression = "Purchase Header Archive"."Currency Code";
AutoFormatType = 1;
}
column(VATDiscountAmount; -VATDiscountAmount)
{
AutoFormatExpression = "Purchase Header Archive"."Currency Code";
AutoFormatType = 1;
}
column(VATAmountLine_VATAmountText_Control32; TempVATAmountLine.VATAmountText())
{
}
column(TotalExclVATText_Control51; TotalExclVATText)
{
}
column(TotalInclVATText_Control69; TotalInclVATText)
{
}
column(VATBaseAmount; VATBaseAmount)
{
AutoFormatExpression = "Purchase Header Archive"."Currency Code";
AutoFormatType = 1;
}
column(VATAmount_Control83; VATAmount)
{
AutoFormatExpression = "Purchase Header Archive"."Currency Code";
AutoFormatType = 1;
}
column(TotalAmountInclVAT; TotalAmountInclVAT)
{
AutoFormatExpression = "Purchase Header Archive"."Currency Code";
AutoFormatType = 1;
}
column(RoundLoop_Number; Number)
{
}
column(TotalSubTotal; TotalSubTotal)
{
AutoFormatExpression = "Purchase Header Archive"."Currency Code";
AutoFormatType = 1;
}
column(TotalInvoiceDiscountAmount; TotalInvoiceDiscountAmount)
{
AutoFormatExpression = "Purchase Header Archive"."Currency Code";
AutoFormatType = 1;
}
column(TotalAmount; TotalAmount)
{
AutoFormatExpression = "Purchase Header Archive"."Currency Code";
AutoFormatType = 1;
}
column(Purchase_Line_Archive___No__Caption; "Purchase Line Archive".FieldCaption("No."))
{
}
column(Purchase_Line_Archive__Description_Control63Caption; "Purchase Line Archive".FieldCaption(Description))
{
}
column(Purchase_Line_Archive__QuantityCaption; "Purchase Line Archive".FieldCaption(Quantity))
{
}
column(Purchase_Line_Archive___Unit_of_Measure_Caption; "Purchase Line Archive".FieldCaption("Unit of Measure"))
{
}
column(Direct_Unit_CostCaption; Direct_Unit_CostCaptionLbl)
{
}
column(Purchase_Line_Archive___Line_Discount___Caption; Purchase_Line_Archive___Line_Discount___CaptionLbl)
{
}
column(AmountCaption; AmountCaptionLbl)
{
}
column(Purchase_Line_Archive___Allow_Invoice_Disc__Caption; "Purchase Line Archive".FieldCaption("Allow Invoice Disc."))
{
}
column(Purchase_Line_Archive___VAT_Identifier_Caption; "Purchase Line Archive".FieldCaption("VAT Identifier"))
{
}
column(ContinuedCaption; ContinuedCaptionLbl)
{
}
column(ContinuedCaption_Control76; ContinuedCaption_Control76Lbl)
{
}
column(PurchLineArch__Inv__Discount_Amount_Caption; PurchLineArch__Inv__Discount_Amount_CaptionLbl)
{
}
column(SubtotalCaption; SubtotalCaptionLbl)
{
}
column(VATDiscountAmountCaption; VATDiscountAmountCaptionLbl)
{
}
dataitem(DimensionLoop2; "Integer")
{
DataItemTableView = sorting(Number) where(Number = filter(1 ..));
column(DimText_Control74; DimText)
{
}
column(DimensionLoop2_Number; Number)
{
}
column(Line_DimensionsCaption; Line_DimensionsCaptionLbl)
{
}
trigger OnAfterGetRecord()
begin
if Number = 1 then begin
if not DimSetEntry.FindSet() then
CurrReport.Break();
end else
if not Continue then
CurrReport.Break();
Clear(DimText);
Continue := false;
repeat
OldDimText := DimText;
if DimText = '' then
DimText := StrSubstNo(
'%1 %2', DimSetEntry."Dimension Code", DimSetEntry."Dimension Value Code")
else
DimText :=
StrSubstNo(
'%1, %2 %3', DimText,
DimSetEntry."Dimension Code", DimSetEntry."Dimension Value Code");
if StrLen(DimText) > MaxStrLen(OldDimText) then begin
DimText := OldDimText;
Continue := true;
exit;
end;
until (DimSetEntry.Next() = 0);
end;
trigger OnPreDataItem()
begin
if not ShowInternalInfo then
CurrReport.Break();
DimSetEntry.SetRange("Dimension Set ID", "Purchase Line Archive"."Dimension Set ID");
end;
}
trigger OnAfterGetRecord()
begin
if Number = 1 then
TempPurchLineArchive.Find('-')
else
TempPurchLineArchive.Next();
"Purchase Line Archive" := TempPurchLineArchive;
if not "Purchase Header Archive"."Prices Including VAT" and
(TempPurchLineArchive."VAT Calculation Type" = TempPurchLineArchive."VAT Calculation Type"::"Full VAT")
then
TempPurchLineArchive."Line Amount" := 0;
if (TempPurchLineArchive.Type = TempPurchLineArchive.Type::"G/L Account") and (not ShowInternalInfo) then
"Purchase Line Archive"."No." := '';
AllowInvDisctxt := Format("Purchase Line Archive"."Allow Invoice Disc.");
PurchaseLineArchiveType := "Purchase Line Archive".Type.AsInteger();
TotalSubTotal += "Purchase Line Archive"."Line Amount";
TotalInvoiceDiscountAmount -= "Purchase Line Archive"."Inv. Discount Amount";
TotalAmount += "Purchase Line Archive".Amount;
end;
trigger OnPostDataItem()
begin
TempPurchLineArchive.DeleteAll();
end;
trigger OnPreDataItem()
begin
MoreLines := TempPurchLineArchive.Find('+');
while MoreLines and (TempPurchLineArchive.Description = '') and (TempPurchLineArchive."Description 2" = '') and
(TempPurchLineArchive."No." = '') and (TempPurchLineArchive.Quantity = 0) and
(TempPurchLineArchive.Amount = 0)
do
MoreLines := TempPurchLineArchive.Next(-1) <> 0;
if not MoreLines then
CurrReport.Break();
TempPurchLineArchive.SetRange("Line No.", 0, TempPurchLineArchive."Line No.");
SetRange(Number, 1, TempPurchLineArchive.Count);
end;
}
dataitem(VATCounter; "Integer")
{
DataItemTableView = sorting(Number);
column(VATAmountLine__VAT_Base_; TempVATAmountLine."VAT Base")
{
AutoFormatExpression = "Purchase Header Archive"."Currency Code";
AutoFormatType = 1;
}
column(VATAmountLine__VAT_Amount_; TempVATAmountLine."VAT Amount")
{
AutoFormatExpression = "Purchase Header Archive"."Currency Code";
AutoFormatType = 1;
}
column(VATAmountLine__Line_Amount_; TempVATAmountLine."Line Amount")
{
AutoFormatExpression = "Purchase Header Archive"."Currency Code";
AutoFormatType = 1;
}
column(VATAmountLine__Inv__Disc__Base_Amount_; TempVATAmountLine."Inv. Disc. Base Amount")
{
AutoFormatExpression = "Purchase Header Archive"."Currency Code";
AutoFormatType = 1;
}
column(VATAmountLine__Invoice_Discount_Amount_; TempVATAmountLine."Invoice Discount Amount")
{
AutoFormatExpression = "Purchase Header Archive"."Currency Code";
AutoFormatType = 1;
}
column(VATAmountLine__VAT___; TempVATAmountLine."VAT %")
{
DecimalPlaces = 0 : 5;
}
column(VATAmountLine__VAT_Base__Control99; TempVATAmountLine."VAT Base")
{
AutoFormatExpression = "Purchase Header Archive"."Currency Code";
AutoFormatType = 1;
}
column(VATAmountLine__VAT_Amount__Control100; TempVATAmountLine."VAT Amount")
{
AutoFormatExpression = "Purchase Header Archive"."Currency Code";
AutoFormatType = 1;
}
column(VATAmountLine__VAT_Identifier_; TempVATAmountLine."VAT Identifier")
{
}
column(VATAmountLine__Line_Amount__Control131; TempVATAmountLine."Line Amount")
{
AutoFormatExpression = "Purchase Header Archive"."Currency Code";
AutoFormatType = 1;
}
column(VATAmountLine__Inv__Disc__Base_Amount__Control132; TempVATAmountLine."Inv. Disc. Base Amount")
{
AutoFormatExpression = "Purchase Header Archive"."Currency Code";
AutoFormatType = 1;
}
column(VATAmountLine__Invoice_Discount_Amount__Control133; TempVATAmountLine."Invoice Discount Amount")
{
AutoFormatExpression = "Purchase Header Archive"."Currency Code";
AutoFormatType = 1;
}
column(VATAmountLine__VAT_Base__Control103; TempVATAmountLine."VAT Base")
{
AutoFormatExpression = "Purchase Header Archive"."Currency Code";
AutoFormatType = 1;
}
column(VATAmountLine__VAT_Amount__Control104; TempVATAmountLine."VAT Amount")
{
AutoFormatExpression = "Purchase Header Archive"."Currency Code";
AutoFormatType = 1;
}
column(VATAmountLine__Line_Amount__Control56; TempVATAmountLine."Line Amount")
{
AutoFormatExpression = "Purchase Header Archive"."Currency Code";
AutoFormatType = 1;
}
column(VATAmountLine__Inv__Disc__Base_Amount__Control57; TempVATAmountLine."Inv. Disc. Base Amount")
{
AutoFormatExpression = "Purchase Header Archive"."Currency Code";
AutoFormatType = 1;
}
column(VATAmountLine__Invoice_Discount_Amount__Control58; TempVATAmountLine."Invoice Discount Amount")
{
AutoFormatExpression = "Purchase Header Archive"."Currency Code";
AutoFormatType = 1;
}
column(VATAmountLine__VAT_Base__Control107; TempVATAmountLine."VAT Base")
{
AutoFormatExpression = "Purchase Header Archive"."Currency Code";
AutoFormatType = 1;
}
column(VATAmountLine__VAT_Amount__Control108; TempVATAmountLine."VAT Amount")
{
AutoFormatExpression = "Purchase Header Archive"."Currency Code";
AutoFormatType = 1;
}
column(VATAmountLine__Line_Amount__Control59; TempVATAmountLine."Line Amount")
{
AutoFormatExpression = "Purchase Header Archive"."Currency Code";
AutoFormatType = 1;
}
column(VATAmountLine__Inv__Disc__Base_Amount__Control60; TempVATAmountLine."Inv. Disc. Base Amount")
{
AutoFormatExpression = "Purchase Header Archive"."Currency Code";
AutoFormatType = 1;
}
column(VATAmountLine__Invoice_Discount_Amount__Control61; TempVATAmountLine."Invoice Discount Amount")
{
AutoFormatExpression = "Purchase Header Archive"."Currency Code";
AutoFormatType = 1;
}
column(VATCounter_Number; Number)
{
}
column(VATAmountLine__VAT___Caption; VATAmountLine__VAT___CaptionLbl)
{
}
column(VATAmountLine__VAT_Base__Control99Caption; VATAmountLine__VAT_Base__Control99CaptionLbl)
{
}
column(VATAmountLine__VAT_Amount__Control100Caption; VATAmountLine__VAT_Amount__Control100CaptionLbl)
{
}
column(VAT_Amount_SpecificationCaption; VAT_Amount_SpecificationCaptionLbl)
{
}
column(VATAmountLine__VAT_Identifier_Caption; VATAmountLine__VAT_Identifier_CaptionLbl)
{
}
column(VATAmountLine__Inv__Disc__Base_Amount__Control132Caption; VATAmountLine__Inv__Disc__Base_Amount__Control132CaptionLbl)
{
}
column(VATAmountLine__Line_Amount__Control131Caption; VATAmountLine__Line_Amount__Control131CaptionLbl)
{
}
column(VATAmountLine__Invoice_Discount_Amount__Control133Caption; VATAmountLine__Invoice_Discount_Amount__Control133CaptionLbl)
{
}
column(VATAmountLine__VAT_Base_Caption; VATAmountLine__VAT_Base_CaptionLbl)
{
}
column(VATAmountLine__VAT_Base__Control103Caption; VATAmountLine__VAT_Base__Control103CaptionLbl)
{
}
column(VATAmountLine__VAT_Base__Control107Caption; VATAmountLine__VAT_Base__Control107CaptionLbl)
{
}
trigger OnAfterGetRecord()
begin
TempVATAmountLine.GetLine(Number);
end;
trigger OnPreDataItem()
begin
if VATAmount = 0 then
CurrReport.Break();
SetRange(Number, 1, TempVATAmountLine.Count);
end;
}
dataitem(VATCounterLCY; "Integer")
{
DataItemTableView = sorting(Number);
column(VALExchRate; VALExchRate)
{
}
column(VALSpecLCYHeader; VALSpecLCYHeader)
{
}
column(VALVATAmountLCY; VALVATAmountLCY)
{
AutoFormatType = 1;
}
column(VALVATBaseLCY; VALVATBaseLCY)
{
AutoFormatType = 1;
}
column(VALVATAmountLCY_Control158; VALVATAmountLCY)
{
AutoFormatType = 1;
}
column(VALVATBaseLCY_Control159; VALVATBaseLCY)
{
AutoFormatType = 1;
}
column(VATAmountLine__VAT____Control160; TempVATAmountLine."VAT %")
{
DecimalPlaces = 0 : 5;
}
column(VATAmountLine__VAT_Identifier__Control161; TempVATAmountLine."VAT Identifier")
{
}
column(VALVATAmountLCY_Control162; VALVATAmountLCY)
{
AutoFormatType = 1;
}
column(VALVATBaseLCY_Control163; VALVATBaseLCY)
{
AutoFormatType = 1;
}
column(VALVATAmountLCY_Control165; VALVATAmountLCY)
{
AutoFormatType = 1;
}
column(VALVATBaseLCY_Control166; VALVATBaseLCY)
{
AutoFormatType = 1;
}
column(VATCounterLCY_Number; Number)
{
}
column(VALVATAmountLCY_Control158Caption; VALVATAmountLCY_Control158CaptionLbl)
{
}
column(VALVATBaseLCY_Control159Caption; VALVATBaseLCY_Control159CaptionLbl)
{
}
column(VATAmountLine__VAT____Control160Caption; VATAmountLine__VAT____Control160CaptionLbl)
{
}
column(VATAmountLine__VAT_Identifier__Control161Caption; VATAmountLine__VAT_Identifier__Control161CaptionLbl)
{
}
column(VALVATBaseLCYCaption; VALVATBaseLCYCaptionLbl)
{
}
column(VALVATBaseLCY_Control163Caption; VALVATBaseLCY_Control163CaptionLbl)
{
}
column(VALVATBaseLCY_Control166Caption; VALVATBaseLCY_Control166CaptionLbl)
{
}
trigger OnAfterGetRecord()
begin
TempVATAmountLine.GetLine(Number);
VALVATBaseLCY := Round(CurrExchRate.ExchangeAmtFCYToLCY(
"Purchase Header Archive"."Posting Date", "Purchase Header Archive"."Currency Code",
TempVATAmountLine."VAT Base", "Purchase Header Archive"."Currency Factor"));
VALVATAmountLCY := Round(CurrExchRate.ExchangeAmtFCYToLCY(
"Purchase Header Archive"."Posting Date", "Purchase Header Archive"."Currency Code",
TempVATAmountLine."VAT Amount", "Purchase Header Archive"."Currency Factor"));
end;
trigger OnPreDataItem()
begin
if (not GLSetup."Print VAT specification in LCY") or
("Purchase Header Archive"."Currency Code" = '') or
(TempVATAmountLine.GetTotalVATAmount() = 0)
then
CurrReport.Break();
SetRange(Number, 1, TempVATAmountLine.Count);
Clear(VALVATBaseLCY);
Clear(VALVATAmountLCY);
if GLSetup."LCY Code" = '' then
VALSpecLCYHeader := StrSubstNo(VATAmountSpecTxt, LocalCurrencyTxt)
else
VALSpecLCYHeader := StrSubstNo(VATAmountSpecTxt, Format(GLSetup."LCY Code"));
CurrExchRate.FindCurrency("Purchase Header Archive"."Posting Date", "Purchase Header Archive"."Currency Code", 1);
VALExchRate := StrSubstNo(ExchangeRateTxt, CurrExchRate."Relational Exch. Rate Amount", CurrExchRate."Exchange Rate Amount");
end;
}
dataitem(Total; "Integer")
{
DataItemTableView = sorting(Number) where(Number = const(1));
column(PaymentTerms_Description; PaymentTerms.Description)
{
}
column(ShipmentMethod_Description; ShipmentMethod.Description)
{
}
column(Total_Number; Number)
{
}
column(PaymentTerms_DescriptionCaption; PaymentTerms_DescriptionCaptionLbl)
{
}
column(ShipmentMethod_DescriptionCaption; ShipmentMethod_DescriptionCaptionLbl)
{
}
}
dataitem(Total2; "Integer")
{
DataItemTableView = sorting(Number) where(Number = const(1));
column(Purchase_Header_Archive___Pay_to_Vendor_No__; "Purchase Header Archive"."Pay-to Vendor No.")
{
}
column(VendAddr_8_; VendAddr[8])
{
}
column(VendAddr_7_; VendAddr[7])
{
}
column(VendAddr_6_; VendAddr[6])
{
}
column(VendAddr_5_; VendAddr[5])
{
}
column(VendAddr_4_; VendAddr[4])
{
}
column(VendAddr_3_; VendAddr[3])
{
}
column(VendAddr_2_; VendAddr[2])
{
}
column(VendAddr_1_; VendAddr[1])
{
}
column(Total2_Number; Number)
{
}
column(Payment_DetailsCaption; Payment_DetailsCaptionLbl)
{
}
column(Vendor_No_Caption; Vendor_No_CaptionLbl)
{
}
trigger OnPreDataItem()
begin
if "Purchase Header Archive"."Buy-from Vendor No." = "Purchase Header Archive"."Pay-to Vendor No." then
CurrReport.Break();
end;
}
dataitem(Total3; "Integer")
{
DataItemTableView = sorting(Number) where(Number = const(1));
column(Purchase_Header_Archive___Sell_to_Customer_No__; "Purchase Header Archive"."Sell-to Customer No.")
{
}
column(ShipToAddr_1_; ShipToAddr[1])
{
}
column(ShipToAddr_2_; ShipToAddr[2])
{
}
column(ShipToAddr_3_; ShipToAddr[3])
{
}
column(ShipToAddr_4_; ShipToAddr[4])
{
}
column(ShipToAddr_5_; ShipToAddr[5])
{
}
column(ShipToAddr_6_; ShipToAddr[6])
{
}
column(ShipToAddr_7_; ShipToAddr[7])
{
}
column(ShipToAddr_8_; ShipToAddr[8])
{
}
column(Total3_Number; Number)
{
}
column(Ship_to_AddressCaption; Ship_to_AddressCaptionLbl)
{
}
column(Purchase_Header_Archive___Sell_to_Customer_No__Caption; "Purchase Header Archive".FieldCaption("Sell-to Customer No."))
{
}
trigger OnPreDataItem()
begin
if ("Purchase Header Archive"."Sell-to Customer No." = '') and (ShipToAddr[1] = '') then
CurrReport.Break();
end;
}
}
trigger OnAfterGetRecord()
var
PurchLineArchive: Record "Purchase Line Archive";
begin
Clear(TempPurchLineArchive);
TempPurchLineArchive.DeleteAll();
PurchLineArchive.SetRange("Document Type", "Purchase Header Archive"."Document Type");
PurchLineArchive.SetRange("Document No.", "Purchase Header Archive"."No.");
PurchLineArchive.SetRange("Version No.", "Purchase Header Archive"."Version No.");
if PurchLineArchive.FindSet() then
repeat
TempPurchLineArchive := PurchLineArchive;
TempPurchLineArchive.Insert();
until PurchLineArchive.Next() = 0;
TempVATAmountLine.DeleteAll();
if Number > 1 then begin
CopyText := FormatDocument.GetCOPYText();
OutputNo += 1;
end;
TotalSubTotal := 0;
TotalInvoiceDiscountAmount := 0;
TotalAmount := 0;
end;
trigger OnPostDataItem()
begin
if not IsReportInPreviewMode() then
CODEUNIT.Run(CODEUNIT::"Purch.HeaderArch-Printed", "Purchase Header Archive");
end;
trigger OnPreDataItem()
begin
OutputNo := 1;
NoOfLoops := Abs(NoOfCopies) + 1;
CopyText := '';
SetRange(Number, 1, NoOfLoops);
end;
}
trigger OnAfterGetRecord()
begin
CurrReport.Language := LanguageMgt.GetLanguageIdOrDefault("Language Code");
CurrReport.FormatRegion := LanguageMgt.GetFormatRegionOrDefault("Format Region");
FormatAddr.SetLanguageCode("Language Code");
FormatAddressFields("Purchase Header Archive");
FormatDocumentFields("Purchase Header Archive");
DimSetEntry.SetRange("Dimension Set ID", "Dimension Set ID");
CalcFields("No. of Archived Versions");
end;
}
}
requestpage
{
SaveValues = true;
layout
{
area(content)
{
group(Options)
{
Caption = 'Options';
field(NoOfCopies; NoOfCopies)
{
ApplicationArea = Suite;
Caption = 'No. of Copies';
ToolTip = 'Specifies how many copies of the document to print.';
}
field(ShowInternalInfo; ShowInternalInfo)
{
ApplicationArea = Suite;
Caption = 'Show Internal Information';
ToolTip = 'Specifies if you want the printed report to show information that is only for internal use.';
}
}
}
}
actions
{
}
}
rendering
{
layout(RDLCLayout)
{
Type = RDLC;
LayoutFile = './Purchases/Archive/ArchivedBlanketPurchOrder.rdlc';
Summary = 'Report layout made in the legacy RDLC format. Use an RDLC editor to modify the layout.';
}
}
labels
{
}
trigger OnInitReport()
begin
GLSetup.Get();
CompanyInfo.Get();
end;
var
GLSetup: Record "General Ledger Setup";
CompanyInfo: Record "Company Information";
ShipmentMethod: Record "Shipment Method";
PaymentTerms: Record "Payment Terms";
PrepmtPaymentTerms: Record "Payment Terms";
SalespersonPurchaser: Record "Salesperson/Purchaser";
TempVATAmountLine: Record "VAT Amount Line" temporary;
TempPurchLineArchive: Record "Purchase Line Archive" temporary;
RespCenter: Record "Responsibility Center";
CurrExchRate: Record "Currency Exchange Rate";
DimSetEntry: Record "Dimension Set Entry";
LanguageMgt: Codeunit Language;
FormatAddr: Codeunit "Format Address";
FormatDocument: Codeunit "Format Document";
VendAddr: array[8] of Text[100];
ShipToAddr: array[8] of Text[100];
CompanyAddr: array[8] of Text[100];
BuyFromAddr: array[8] of Text[100];
PurchaserText: Text[50];
VATNoText: Text[80];
ReferenceText: Text[80];
TotalText: Text[50];
TotalInclVATText: Text[50];
TotalExclVATText: Text[50];
MoreLines: Boolean;
NoOfCopies: Integer;
NoOfLoops: Integer;
CopyText: Text[30];
OutputNo: Integer;
DimText: Text[120];
OldDimText: Text[120];
ShowInternalInfo: Boolean;
Continue: Boolean;
VATAmount: Decimal;
VATBaseAmount: Decimal;
VATDiscountAmount: Decimal;
TotalAmountInclVAT: Decimal;
VALVATBaseLCY: Decimal;
VALVATAmountLCY: Decimal;
VALSpecLCYHeader: Text[80];
VALExchRate: Text[50];
PricesInclVATtxt: Text[30];
AllowInvDisctxt: Text[30];
PurchaseLineArchiveType: Integer;
TotalSubTotal: Decimal;
TotalAmount: Decimal;
TotalInvoiceDiscountAmount: Decimal;
ReportTitleLbl: Label 'Archived Blanket Purchase Order %1', Comment = '%1 = Document No.';
VATAmountSpecTxt: Label 'VAT Amount Specification in %1', Comment = '%1 = Currency Code';
LocalCurrencyTxt: Label 'Local Currency';
ExchangeRateTxt: Label 'Exchange rate: %1/%2', Comment = '%1 = exchange rate, %2 = exchange amount';
VersionLbl: Label 'Version %1 of %2 ', Comment = '%1 = current version, %2 = max. version';
CompanyInfo__Phone_No__CaptionLbl: Label 'Phone No.';
CompanyInfo__Fax_No__CaptionLbl: Label 'Fax No.';
CompanyInfo__VAT_Registration_No__CaptionLbl: Label 'VAT Reg. No.';
CompanyInfo__Giro_No__CaptionLbl: Label 'Giro No.';
CompanyInfo__Bank_Name_CaptionLbl: Label 'Bank';
CompanyInfo__Bank_Account_No__CaptionLbl: Label 'Account No.';
Order_No_CaptionLbl: Label 'Blanket Purchase Order No.';
PageCaptionLbl: Label 'Page';
Header_DimensionsCaptionLbl: Label 'Header Dimensions';
Direct_Unit_CostCaptionLbl: Label 'Direct Unit Cost';
Purchase_Line_Archive___Line_Discount___CaptionLbl: Label 'Disc. %';
AmountCaptionLbl: Label 'Amount';
ContinuedCaptionLbl: Label 'Continued';
ContinuedCaption_Control76Lbl: Label 'Continued';
PurchLineArch__Inv__Discount_Amount_CaptionLbl: Label 'Inv. Discount Amount';
SubtotalCaptionLbl: Label 'Subtotal';
VATDiscountAmountCaptionLbl: Label 'Payment Discount on VAT';
Line_DimensionsCaptionLbl: Label 'Line Dimensions';
VATAmountLine__VAT___CaptionLbl: Label 'VAT %', Comment = 'VAT';
VATAmountLine__VAT_Base__Control99CaptionLbl: Label 'VAT Base';
VATAmountLine__VAT_Amount__Control100CaptionLbl: Label 'VAT Amount';
VAT_Amount_SpecificationCaptionLbl: Label 'VAT Amount Specification';
VATAmountLine__VAT_Identifier_CaptionLbl: Label 'VAT Identifier';
VATAmountLine__Inv__Disc__Base_Amount__Control132CaptionLbl: Label 'Inv. Disc. Base Amount';
VATAmountLine__Line_Amount__Control131CaptionLbl: Label 'Line Amount';
VATAmountLine__Invoice_Discount_Amount__Control133CaptionLbl: Label 'Invoice Discount Amount';
VATAmountLine__VAT_Base_CaptionLbl: Label 'Continued';
VATAmountLine__VAT_Base__Control103CaptionLbl: Label 'Continued';
VATAmountLine__VAT_Base__Control107CaptionLbl: Label 'Total';
VALVATAmountLCY_Control158CaptionLbl: Label 'VAT Amount';
VALVATBaseLCY_Control159CaptionLbl: Label 'VAT Base';
VATAmountLine__VAT____Control160CaptionLbl: Label 'VAT %', Comment = 'VAT';
VATAmountLine__VAT_Identifier__Control161CaptionLbl: Label 'VAT Identifier';
VALVATBaseLCYCaptionLbl: Label 'Continued';
VALVATBaseLCY_Control163CaptionLbl: Label 'Continued';
VALVATBaseLCY_Control166CaptionLbl: Label 'Total';
PaymentTerms_DescriptionCaptionLbl: Label 'Payment Terms';
ShipmentMethod_DescriptionCaptionLbl: Label 'Shipment Method';
Payment_DetailsCaptionLbl: Label 'Payment Details';
Vendor_No_CaptionLbl: Label 'Vendor No.';
Ship_to_AddressCaptionLbl: Label 'Ship-to Address';
local procedure IsReportInPreviewMode(): Boolean
var
MailManagement: Codeunit "Mail Management";
begin
exit(CurrReport.Preview or MailManagement.IsHandlingGetEmailBody());
end;
local procedure FormatAddressFields(PurchaseHeaderArchive: Record "Purchase Header Archive")
begin
FormatAddr.GetCompanyAddr(PurchaseHeaderArchive."Responsibility Center", RespCenter, CompanyInfo, CompanyAddr);
FormatAddr.PurchHeaderBuyFromArch(BuyFromAddr, PurchaseHeaderArchive);
if PurchaseHeaderArchive."Buy-from Vendor No." <> PurchaseHeaderArchive."Pay-to Vendor No." then
FormatAddr.PurchHeaderPayToArch(VendAddr, PurchaseHeaderArchive);
FormatAddr.PurchHeaderShipToArch(ShipToAddr, PurchaseHeaderArchive);
end;
local procedure FormatDocumentFields(PurchaseHeaderArchive: Record "Purchase Header Archive")
begin
FormatDocument.SetPurchaser(SalespersonPurchaser, PurchaseHeaderArchive."Purchaser Code", PurchaserText);
FormatDocument.SetPaymentTerms(PaymentTerms, PurchaseHeaderArchive."Payment Terms Code", PurchaseHeaderArchive."Language Code");
FormatDocument.SetPaymentTerms(PrepmtPaymentTerms, PurchaseHeaderArchive."Prepmt. Payment Terms Code", PurchaseHeaderArchive."Language Code");
FormatDocument.SetShipmentMethod(ShipmentMethod, PurchaseHeaderArchive."Shipment Method Code", PurchaseHeaderArchive."Language Code");
ReferenceText := FormatDocument.SetText(PurchaseHeaderArchive."Your Reference" <> '', PurchaseHeaderArchive.FieldCaption("Your Reference"));
VATNoText := FormatDocument.SetText(PurchaseHeaderArchive."VAT Registration No." <> '', PurchaseHeaderArchive.FieldCaption("VAT Registration No."));
PricesInclVATtxt := Format(PurchaseHeaderArchive."Prices Including VAT");
end;
}