mibuso.com

Microsoft Business Solutions online community
It is currently Tue May 21, 2013 9:34 am

All times are UTC + 1 hour [ DST ]




Post new topic Reply to topic  [ 6 posts ] 
Author Message
 Post subject: add total field to report id 109 customer summary ageing
PostPosted: Wed Aug 01, 2012 5:03 pm 
Offline

Joined: Tue Mar 27, 2012 7:38 pm
Posts: 235
Country: Saudi Arabia (sa)
in report id 109 customer summary aging simple in reports default in dynamic nav i found this code written in after get report trigger:

PrintCust := FALSE;
FOR i := 1 TO 5 DO BEGIN
DtldCustLedgEntry.SETCURRENTKEY("Customer No.","Initial Entry Due Date","Posting Date");
DtldCustLedgEntry.SETRANGE("Customer No.","No.");
DtldCustLedgEntry.SETRANGE("Posting Date",0D,StartDate);
DtldCustLedgEntry.SETRANGE("Initial Entry Due Date",PeriodStartDate[i],PeriodStartDate[i + 1] - 1);
DtldCustLedgEntry.CALCSUMS("Amount (LCY)");
CustBalanceDueLCY[i] := DtldCustLedgEntry."Amount (LCY)";
IF CustBalanceDueLCY[i] <> 0 THEN
PrintCust := TRUE;
END;
IF NOT PrintCust THEN
CurrReport.SKIP;
that found before is 0-30,31-60,61-90
what i need is to total variable that consist of amount( debit -credit)
meaning how i write this by coding
total =amount for 0-30+amount for 31-61+amount for 61-91
thanks


Top
 Profile E-mail  
 
 Post subject: Re: add total field to report id 109 customer summary agein
PostPosted: Wed Aug 01, 2012 5:24 pm 
Online
Moderator
MVP Microsoft Dynamics NAV
NAV TechDays 2013 attendee

Joined: Wed Jul 02, 2003 10:13 am
Posts: 7493
Location: Milan
Country: Italy (it)
Code: Select all
TotalAmount := 0; //NEW LINE

PrintCust := FALSE;
FOR i := 1 TO 5 DO BEGIN
  DtldCustLedgEntry.SETCURRENTKEY("Customer No.","Initial Entry Due Date","Posting Date");
  DtldCustLedgEntry.SETRANGE("Customer No.","No.");
  DtldCustLedgEntry.SETRANGE("Posting Date",0D,StartDate);
  DtldCustLedgEntry.SETRANGE("Initial Entry Due Date",PeriodStartDate[i],PeriodStartDate[i + 1] - 1);
  DtldCustLedgEntry.CALCSUMS("Amount (LCY)");
  CustBalanceDueLCY[i] := DtldCustLedgEntry."Amount (LCY)";
 
  TotalAmount += TotalAmount + DtldCustLedgEntry."Amount (LCY)"; //NEW LINE
 
  IF CustBalanceDueLCY[i] <> 0 THEN
    PrintCust := TRUE;
END;
IF NOT PrintCust THEN
  CurrReport.SKIP;

// "TotalAmount" contains the total amount

_________________
Regards,Alain Krikilion
Use the SEARCH,Luke! || No PM,please use the forum. || May the <SOLVED>-attribute be in your title! || Read Forum Rules before making a posting


Top
 Profile  
 
 Post subject: Re: add total field to report id 109 customer summary agein
PostPosted: Thu Aug 02, 2012 12:42 pm 
Offline

Joined: Tue Mar 27, 2012 7:38 pm
Posts: 235
Country: Saudi Arabia (sa)
OK thanks it run but i have another question if i want to calculate debit amount(debit amount(lcy)) from 1 to 5 and total as i make before what the modification that must make in code
meaning
total 0-30 31-60 61-91
debit-credit(already made) debit amount(lcy) debit amount(lcy) debit amount(lcy)
what is the modification i must make to make this formula
please help me.
thanks


Top
 Profile E-mail  
 
 Post subject: Re: add total field to report id 109 customer summary agein
PostPosted: Thu Aug 02, 2012 1:38 pm 
Online
Moderator
MVP Microsoft Dynamics NAV
NAV TechDays 2013 attendee

Joined: Wed Jul 02, 2003 10:13 am
Posts: 7493
Location: Milan
Country: Italy (it)
Instead of using "Amount (LCY)", you can use "Debit Amount (LCY)" and "Credit Amount (LCY)" for debit and credit amounts.

_________________
Regards,Alain Krikilion
Use the SEARCH,Luke! || No PM,please use the forum. || May the <SOLVED>-attribute be in your title! || Read Forum Rules before making a posting


Top
 Profile  
 
 Post subject: Re: add total field to report id 109 customer summary agein
PostPosted: Thu Aug 02, 2012 2:16 pm 
Offline

Joined: Tue Mar 27, 2012 7:38 pm
Posts: 235
Country: Saudi Arabia (sa)
OK I make this code as following :

PrintCust := FALSE;
total:=0;
FOR i := 1 TO 5 DO BEGIN
DtldCustLedgEntry.SETCURRENTKEY("Customer No.","Initial Entry Due Date","Posting Date");
DtldCustLedgEntry.SETRANGE("Customer No.","No.");
DtldCustLedgEntry.SETRANGE("Posting Date",0D,StartDate);
DtldCustLedgEntry.SETRANGE("Initial Entry Due Date",PeriodStartDate[i],PeriodStartDate[i + 1] - 1);
DtldCustLedgEntry.CALCSUMS("Amount (LCY)");
DtldCustLedgEntry.CALCSUMS("Debit Amount (LCY)");
CustBalanceDueLCY[i] :=DtldCustLedgEntry."Debit Amount (LCY)";
CustBalanceDueLCYAm[i] :=DtldCustLedgEntry."Amount (LCY)";
total:=total+DtldCustLedgEntry."Amount (LCY)";
IF CustBalanceDueLCY[i] <> 0 THEN
PrintCust := TRUE;
END;
IF NOT PrintCust THEN
Curr Report.SKIP;
but message error display there are too many dimension the variable defined with little dimension.
why this message display
what i need is display total(debit -credit to all package) and debit amount to every package as following 0-30,31-60,61-90.
thanks


Top
 Profile E-mail  
 
 Post subject: Re: add total field to report id 109 customer summary agein
PostPosted: Thu Aug 02, 2012 4:35 pm 
Online
Moderator
MVP Microsoft Dynamics NAV
NAV TechDays 2013 attendee

Joined: Wed Jul 02, 2003 10:13 am
Posts: 7493
Location: Milan
Country: Italy (it)
You need to give dimensions to your new variable. Check the properties of the old variable to see what I mean.

BTW: you really should take some C/AL courses or have you assisted by a senior C/AL developer. This is very basic stuff!

_________________
Regards,Alain Krikilion
Use the SEARCH,Luke! || No PM,please use the forum. || May the <SOLVED>-attribute be in your title! || Read Forum Rules before making a posting


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 6 posts ] 

All times are UTC + 1 hour [ DST ]


Who is online

Users browsing this forum: Google [Bot] and 28 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum


Search for:
Jump to: