...
END;
END;
// Add the following lines.
PROCEDURE TestILE@5(ILE@1000 : Record 32);
VAR
ItemLedgEntry@1003 : Record 32;
Location@1002 : Record 14;
Include@1001 : Boolean;
BEGIN
WITH ILE DO BEGIN
IF "Entry Type" IN ["Entry Type"::Sale,"Entry Type"::Purchase] THEN BEGIN
ItemLedgEntry.RESET;
ItemLedgEntry.SETCURRENTKEY("Document No.","Document Type");
ItemLedgEntry.SETRANGE("Document No.","Document No.");
ItemLedgEntry.SETRANGE("Item No.","Item No.");
ItemLedgEntry.SETRANGE(Correction,TRUE);
ItemLedgEntry.SETRANGE("Document Type","Document Type"::"Sales Shipment");
IF NOT ItemLedgEntry.ISEMPTY THEN
CurrReport.SKIP;
ItemLedgEntry.SETRANGE("Document Type","Document Type"::"Sales Return Receipt");
IF NOT ItemLedgEntry.ISEMPTY THEN
CurrReport.SKIP;
ItemLedgEntry.SETRANGE("Document Type","Document Type"::"Purchase Receipt");
IF NOT ItemLedgEntry.ISEMPTY THEN
CurrReport.SKIP;
ItemLedgEntry.SETRANGE("Document Type","Document Type"::"Purchase Return Shipment");
IF NOT ItemLedgEntry.ISEMPTY THEN
CurrReport.SKIP;
END;
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
ItemLedgEntry.SETCURRENTKEY("Item No.","Posting Date");
ItemLedgEntry.SETRANGE("Item No.","Item No.");
ItemLedgEntry.SETRANGE("Posting Date","Posting Date");
ItemLedgEntry.SETRANGE("Applies-to Entry","Entry No.");
ItemLedgEntry.FINDFIRST;
END ELSE
ItemLedgEntry.GET("Applies-to Entry");
IF (ItemLedgEntry."Country/Region Code" <> CompanyInfo."Country/Region Code") AND
(ItemLedgEntry."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
ItemLedgEntry.SETRANGE("Transfer Order No.","Transfer Order No.");
ItemLedgEntry.SETFILTER("Country/Region Code",'%1 | %2','',CompanyInfo."Country/Region Code");
IF ItemLedgEntry.FINDSET THEN
REPEAT
Location.GET(ItemLedgEntry."Location Code");
IF Location."Use As In-Transit" THEN
Include := TRUE;
UNTIL Include OR (ItemLedgEntry.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;
END;
END;
PROCEDURE InsertValueEntryLine@6();
VAR
Location@1000 : 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.
}
...