Want to add Cess Amount in Balance Field of Ledger Report
Stivan_dsouza21
Member Posts: 218
Want to add Cess Amount in Balance Field of Ledger Report.
I Have added the Following Code:
G/L Entry - OnAfterGetRecord()
IF LocationCode <> '' THEN BEGIN
CLEAR(Cess);
PostedStrOrdrDetails.RESET;
PostedStrOrdrDetails.SETRANGE(PostedStrOrdrDetails.Type,PostedStrOrdrDetails.Type::Sale);
PostedStrOrdrDetails.SETRANGE(PostedStrOrdrDetails."Document Type",PostedStrOrdrDetails."Document Type"::Invoice);
PostedStrOrdrDetails.SETRANGE(PostedStrOrdrDetails."Invoice No.",GLEntry."Document No.");
PostedStrOrdrDetails.SETRANGE(PostedStrOrdrDetails."Tax/Charge Type",PostedStrOrdrDetails."Tax/Charge Type"::Charges);
PostedStrOrdrDetails.SETRANGE(PostedStrOrdrDetails."Tax/Charge Group",'Cess');
IF PostedStrOrdrDetails.FINDFIRST THEN
REPEAT
Cess := Cess + PostedStrOrdrDetails.Amount;
UNTIL PostedStrOrdrDetails.NEXT = 0;
END;
IF Amount>0 THEN
TransDebits := TransDebits + Amount;
IF Amount<0 THEN
TransCredits := TransCredits - Amount + Cess;
Cess Amount gets calculated in balance Field.
But if in G/l Entry they are multiple lines against the one Document then it calculates the Cess Amount Multiple times.
Can somebody help me out...... :-k
I Have added the Following Code:
G/L Entry - OnAfterGetRecord()
IF LocationCode <> '' THEN BEGIN
CLEAR(Cess);
PostedStrOrdrDetails.RESET;
PostedStrOrdrDetails.SETRANGE(PostedStrOrdrDetails.Type,PostedStrOrdrDetails.Type::Sale);
PostedStrOrdrDetails.SETRANGE(PostedStrOrdrDetails."Document Type",PostedStrOrdrDetails."Document Type"::Invoice);
PostedStrOrdrDetails.SETRANGE(PostedStrOrdrDetails."Invoice No.",GLEntry."Document No.");
PostedStrOrdrDetails.SETRANGE(PostedStrOrdrDetails."Tax/Charge Type",PostedStrOrdrDetails."Tax/Charge Type"::Charges);
PostedStrOrdrDetails.SETRANGE(PostedStrOrdrDetails."Tax/Charge Group",'Cess');
IF PostedStrOrdrDetails.FINDFIRST THEN
REPEAT
Cess := Cess + PostedStrOrdrDetails.Amount;
UNTIL PostedStrOrdrDetails.NEXT = 0;
END;
IF Amount>0 THEN
TransDebits := TransDebits + Amount;
IF Amount<0 THEN
TransCredits := TransCredits - Amount + Cess;
Cess Amount gets calculated in balance Field.
But if in G/l Entry they are multiple lines against the one Document then it calculates the Cess Amount Multiple times.
Can somebody help me out...... :-k
Thanks & Regards,
Stivan D'souza
Stivan D'souza
0
Comments
-
If you want it to calculate once, why do you need REPEAT?
try withIF PostedStrOrdrDetails.FINDFIRST THEN Cess := Cess + PostedStrOrdrDetails.Amount;
PS: Dont use REPEAT with FINDFIRST..use FINDSET0 -
Mohana as u said i have done but then too Cess amount is not getting Calculated.Thanks & Regards,
Stivan D'souza0 -
Below are the Details of Report been Generated:
Posting Date Document No. Debit Amount Credit Amount Balance
Opening Balance 2,08,23,965.37 2,08,23,965.37 Cr
31-05-2011 INV/34/AL/11-12/0074 0 28,519.88 20852485.25
31-05-2011 INV/34/AL/11-12/0075 0 8,641.56 20861126.81 AFter this Document No. it adding multiple times the Ces Amount
31-05-2011 INV/34/AL/11-12/0076 0 32,610.64 20894060.34
31-05-2011 INV/34/AL/11-12/0077 0 14,353.37 20908413.71
31-05-2011 INV/34/AL/11-12/0078 0 14,223.97 20922778.52
2,09,21,481.84 2,09,21,481.84 Cr
Below are details of G/L Entry Table:
Entry No. G/L Account No. Posting Date Document No. Amount Transaction No.
2811461 32170100 31-05-2011 INV/34/AL/11-12/0074 -28,237.50 488151
2811557 32170100 31-05-2011 INV/34/AL/11-12/0075 -8,556.00 488164
2812005 32170100 31-05-2011 INV/34/AL/11-12/0076 -5,225.00 488230
2812007 32170100 31-05-2011 INV/34/AL/11-12/0076 -27,062.75 488230
2812120 32170100 31-05-2011 INV/34/AL/11-12/0077 -14,211.25 488245
2814196 32170100 31-05-2011 INV/34/AL/11-12/0078 -7,638.75 488444
2814198 32170100 31-05-2011 INV/34/AL/11-12/0078 -6,444.38 488444Thanks & Regards,
Stivan D'souza0 -
Actual Value of Balance Field in report Should be these:
2,08,52,485.25
2,08,61,126.81
2,08,93,737.45
2,09,08,090.82
2,09,22,314.79Thanks & Regards,
Stivan D'souza0
Categories
- All Categories
- 75 General
- 75 Announcements
- 66.7K Microsoft Dynamics NAV
- 18.8K 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
- 610 NAV Courses, Exams & Certification
- 1.9K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 251 Dynamics CRM
- 103 Dynamics GP
- 6 Dynamics SL
- 1.5K Other
- 991 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 28 Design Patterns (General & Best Practices)
- Architectural Patterns
- 9 Design Patterns
- 4 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1K General Chat
- 1.6K Website
- 77 Testing
- 1.2K Download section
- 23 How Tos section
- 249 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions
