Bug report NAV 5.0 Italian version

Belias
Member Posts: 2,998
I can't launch (runtime error) vat statement print report (no. 12).
I am quite sure it's caused because of a wrong management of "key/CALCSUM" instruction.
anyone have already experienced it?
I'll give more details about it...
I am quite sure it's caused because of a wrong management of "key/CALCSUM" instruction.
anyone have already experienced it?
I'll give more details about it...
0
Comments
-
here is the code:
VATStmtLine2.Type::"VAT Entry Totaling":
BEGIN
VATEntry.RESET;
IF VATEntry.SETCURRENTKEY(
Type,Closed,"VAT Bus. Posting Group","VAT Prod. Posting Group","Posting Date")
THEN BEGIN VATEntry.SETRANGE("VAT Bus. Posting Group",VATStmtLine2."VAT Bus. Posting Group");
VATEntry.SETRANGE("VAT Prod. Posting Group",VATStmtLine2."VAT Prod. Posting Group");
END ELSE BEGIN
VATEntry.SETCURRENTKEY(
Type,Closed,"VAT Bus. Posting Group","VAT Prod. Posting Group",
"Tax Jurisdiction Code","Use Tax","Tax Liable","VAT Period","Operation Occured Date");
VATEntry.SETRANGE("Tax Jurisdiction Code",VATStmtLine2."Tax Jurisdiction Code");
VATEntry.SETRANGE("Use Tax",VATStmtLine2."Use Tax");
END;
VATEntry.SETRANGE(Type,VATStmtLine2."Gen. Posting Type");
IF (EndDateReq = 0D) AND (StartDate = 0D) THEN
VATEntry.SETRANGE("Operation Occured Date")
ELSE
IF PeriodSelection = PeriodSelection::"Before and Within Period" THEN
VATEntry.SETRANGE("Operation Occured Date",0D,EndDate)
ELSE
VATEntry.SETRANGE("Operation Occured Date",StartDate,EndDate);
CASE Selection OF
Selection::Open:
VATEntry.SETRANGE(Closed,FALSE);
Selection::Closed:
BEGIN
VATEntry.SETRANGE(Closed,TRUE);
IF VATPeriod <> '' THEN BEGIN
VATEntry.SETRANGE("VAT Period",VATPeriod);
VATEntry.SETRANGE("Operation Occured Date");
END;
END;
ELSE
VATEntry.SETRANGE(Closed);
END;
CASE VATStmtLine2."Amount Type" OF
VATStmtLine2."Amount Type"::Amount:
BEGIN
VATEntry.CALCSUMS(Amount,"Additional-Currency Amount");
Amount := ConditionalAdd(0,VATEntry.Amount,VATEntry."Additional-Currency Amount");
END;
look at the bold lines: if setcurrentkey(k1) then...else setcurrentkey(k2)
unfortunately, k1 actually exist, so, k2 will never be used and the filters applied on "operation occured date" field (which is included only in k2 key) will screw the calcsum instruction (underlined)...0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 320 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions