...
IntrastatJnlBatch2.SETRANGE(Type,IntrastatJnlBatch.Type);
END;
// Delete the following line.
BEGIN
END.
}
RDLDATA
...
...
IntrastatJnlBatch2.SETRANGE(Type,IntrastatJnlBatch.Type);
END;
// Add the following lines.
PROCEDURE TestILE@1130001(ItemLedgEntry@1130000 : Record 32);
VAR
Location@1130001 : Record 14;
ItemLedgEntry2@1130002 : Record 32;
Include@1130003 : Boolean;
SalesShipmentHeader@1130004 : Record 110;
SalesShipmentLine@1130005 : Record 111;
PurchRcptLine@1130006 : Record 121;
ReturnReceiptLine@1130007 : Record 6661;
ReturnShipmentLine@1130008 : Record 6651;
ServiceShipmentLine@1130009 : Record 5991;
ServiceCrMemoLine@1130010 : Record 5995;
BEGIN
WITH ItemLedgEntry DO BEGIN
CASE TRUE OF
"Drop Shipment":
BEGIN
IF ("Country/Region Code" = CompanyInfo."Country/Region Code") OR
("Country/Region Code" = '')
THEN
CurrReport.SKIP;
IF "Applies-to Entry" = 0 THEN BEGIN
ItemLedgEntry2.SETCURRENTKEY("Item No.","Posting Date");
ItemLedgEntry2.SETRANGE("Item No.","Item No.");
ItemLedgEntry2.SETRANGE("Posting Date","Posting Date");
ItemLedgEntry2.SETRANGE("Applies-to Entry","Entry No.");
ItemLedgEntry2.FINDFIRST;
END ELSE
ItemLedgEntry2.GET("Applies-to Entry");
IF (ItemLedgEntry2."Country/Region Code" <> CompanyInfo."Country/Region Code") AND
(ItemLedgEntry2."Country/Region Code" <> '')
THEN
CurrReport.SKIP;
END;
"Entry Type" = "Entry Type"::Transfer:
BEGIN
IF ("Country/Region Code" = CompanyInfo."Country/Region Code") OR
("Country/Region Code" = '')
THEN
CurrReport.SKIP;
IF "Transfer Order No." = '' THEN BEGIN
Location.GET("Location Code");
IF (Location."Country/Region Code" <> '') AND
(Location."Country/Region Code" <> CompanyInfo."Country/Region Code")
THEN
CurrReport.SKIP;
END ELSE BEGIN
ItemLedgEntry2.SETRANGE("Transfer Order No.","Transfer Order No.");
ItemLedgEntry2.SETFILTER("Country/Region Code",'%1 | %2','',CompanyInfo."Country/Region Code");
IF ItemLedgEntry2.FINDSET THEN
REPEAT
Location.GET(ItemLedgEntry2."Location Code");
IF Location."Use As In-Transit" THEN
Include := TRUE;
UNTIL Include OR (ItemLedgEntry2.NEXT = 0);
IF NOT Include THEN
CurrReport.SKIP;
END;
END;
"Location Code" <> '':
BEGIN
Location.GET("Location Code");
CheckILE(Location."Country/Region Code");
END;
ELSE BEGIN
IF "Entry Type" = "Entry Type"::Purchase THEN
CheckILE(CompanyInfo."Ship-to Country/Region Code");
IF "Entry Type" = "Entry Type"::Sale THEN
CheckILE(CompanyInfo."Country/Region Code");
END;
END;
CASE TRUE OF
"Document Type" = "Document Type"::"Sales Shipment":
IF SalesShipmentLine.GET("Document No.","Document Line No.") THEN
IF VATPostingSetup.GET(SalesShipmentLine."VAT Bus. Posting Group",SalesShipmentLine."VAT Prod. Posting Group") THEN;
("Document Type" = "Document Type"::"Sales Return Receipt") OR ("Document Type" = "Document Type"::"Sales Credit Memo"):
IF ReturnReceiptLine.GET("Document No.","Document Line No.") THEN
IF VATPostingSetup.GET(ReturnReceiptLine."VAT Bus. Posting Group",ReturnReceiptLine."VAT Prod. Posting Group") THEN;
"Document Type" = "Document Type"::"Purchase Receipt":
IF PurchRcptLine.GET("Document No.","Document Line No.") THEN
IF VATPostingSetup.GET(PurchRcptLine."VAT Bus. Posting Group",PurchRcptLine."VAT Prod. Posting Group") THEN;
("Document Type" = "Document Type"::"Purchase Return Shipment") OR ("Document Type" = "Document Type"::"Purchase Credit Memo"):
IF ReturnShipmentLine.GET("Document No.","Document Line No.") THEN
IF VATPostingSetup.GET(ReturnShipmentLine."VAT Bus. Posting Group",ReturnShipmentLine."VAT Prod. Posting Group") THEN;
"Document Type" = "Document Type"::"Service Shipment":
IF ServiceShipmentLine.GET("Document No.","Document Line No.") THEN
IF VATPostingSetup.GET(ServiceShipmentLine."VAT Bus. Posting Group",ServiceShipmentLine."VAT Prod. Posting Group") THEN;
"Document Type" = "Document Type"::"Service Credit Memo":
IF ServiceCrMemoLine.GET("Document No.","Document Line No.") THEN
IF VATPostingSetup.GET(ServiceCrMemoLine."VAT Bus. Posting Group",ServiceCrMemoLine."VAT Prod. Posting Group") THEN;
END;
IF VATPostingSetup."EU Service" THEN
CurrReport.SKIP;
IF ("Entry Type" = "Entry Type"::Sale) AND
(SalesShipmentHeader.GET("Document No.")) AND
(CompanyInfo."Country/Region Code" = SalesShipmentHeader."Bill-to Country/Region Code")
THEN
CurrReport.SKIP;
END;
END;
PROCEDURE InsertValueEntryLine@1130002();
VAR
Location@1130000 : Record 14;
BEGIN
GetGLSetup;
WITH IntrastatJnlLine DO BEGIN
INIT;
"Line No." := "Line No." + 10000;
Date := "Value Entry"."Posting Date";
"Country/Region Code" := "Item Ledger Entry"."Country/Region Code";
"Transaction Type" := "Item Ledger Entry"."Transaction Type";
"Transport Method" := "Item Ledger Entry"."Transport Method";
"Source Entry No." := "Item Ledger Entry"."Entry No.";
Quantity := "Item Ledger Entry".Quantity;
"Document No." := "Value Entry"."Document No.";
"Item No." := "Item Ledger Entry"."Item No.";
"Entry/Exit Point" := "Item Ledger Entry"."Entry/Exit Point";
Area := "Item Ledger Entry".Area;
"Transaction Specification" := "Item Ledger Entry"."Transaction Specification";
Amount := ROUND(ABS("Value Entry"."Sales Amount (Actual)"),1);
IF Quantity < 0 THEN
Type := Type::Shipment
ELSE
Type := Type::Receipt;
IF ("Country/Region Code" = '') OR
("Country/Region Code" = CompanyInfo."Country/Region Code")
THEN BEGIN
IF "Item Ledger Entry"."Location Code" = '' THEN
"Country/Region Code" := CompanyInfo."Ship-to Country/Region Code"
ELSE BEGIN
Location.GET("Item Ledger Entry"."Location Code");
"Country/Region Code" := Location."Country/Region Code"
END;
END;
VALIDATE("Item No.");
"Source Type" := "Source Type"::"Item entry";
VALIDATE(Quantity,ROUND(ABS(Quantity),0.00001));
VALIDATE("Cost Regulation %",IndirectCostPctReq);
INSERT;
END;
END;
// End of the lines.
BEGIN
END.
}
RDLDATA
...