How to Display Finance Charge Memo Amount on Report

kolaboykolaboy Member Posts: 446
Hi Experts;
I am designing a report that Should Display finance Charge amount in a report for finance charges that are already applied.
Here are my Codes:
 IF "Finance Charge Memo" <> 0
 THEN BEGIN
 Int := "Cust. Ledger Entry". Amount;
END;
IF "Document Type" = "Finance Charge Memo"
   THEN BEGIN
  Int :=  Amt;
END;

I guess the second one is better,but is displaying only one leaving the rest out.So is not working. I am using the Detailed cust. Ledg. Entry table to pick these informatioms.
Is anything wrong with my Code? I would like to see your code that you think will solve my problem please.
Thanks

Comments

  • SavatageSavatage Member Posts: 7,142
    If you just want Finace Charge info to appear why not

    View The Properties of the Dataitem
    Set DataItemtableView to WHERE(Document Type=FILTER(Finance Charge Memo))

    Then only these will appear on your report.

    *ps also you might want to look up CASE in the c/side help when dealing with options like document type in the future.
    Int := "Cust. Ledger Entry". Amount;
    
    If you're not calculating anything why move it to a variable?

    I thought you said you were working with Detailed Cust Ledger Entries?
    ["Detailed Cust. Ledg. Entry".Amount]
  • kolaboykolaboy Member Posts: 446
    Hi savatage;
    Thank you for your suggestion. The code is displaying only one finance charge Memo amount leaving the others. It is also displaying it under the amount column, when i created a separate column for the interest. The interest should display under the interest column.

    I have tried this some time ago, but this is the situation. I have use these codes:
    IF "Document Type" = "Finance Charge Memo"
    THEN BEGIN
     Int :=  "Detailed Cust. Ledg. Entry".Amount;
    END;
    
    And
    Int :=  "Detailed Cust. Ledg. Entry".Amount;
    
    Any problem with them. May i see a good one that i can learn from.
    Thanks.
  • SavatageSavatage Member Posts: 7,142
    OK lets start at the beginning. Now assuming you have more than 1 Financial charge I can guess that you are putting the field in your report in the Header or Footer Section.

    So you need to read the Application Designers Guide on the product CD to learn how to make reports.

    Here are the basic steps to get you started:::
    Object Designer-> Report-> NEW
    Enter in the table field:: 379
    Select "Create a report using Wizard"
    You Would Probably use "Tabular Type" - Click OK!

    Now add the field you want to show on the report (don't worry if you screw up the order they need to appear in you can drag them around later if needed)
    Click next to add some sorting & grouping of a field.
    When you finally get to FINISH goto-> View-> Properties
    Set DataItemtableView to WHERE(Document Type=FILTER(Finance Charge Memo))

    Now save it in the 50000+ range with a unique name.
    Run the report without any filters to make sure your getting all the finance charge memos. Once this has happened you can adjust the report fields n such to make it look they way you would like.
  • kolaboykolaboy Member Posts: 446
    Hi savatge,
    I am not creating a new report. I am modifying an existing report by adding to more columns to the report. The columns are : Arrears and Interest. The values under the arrears column are coming fine, but the values under the interest column are the one not coming fine. the interest values are suppose to be the Finance charge values before they are applied on the payment amount.

    I am using the detailed cust. Ledger entry table to pick these Finance Charge Memos, by referencing to the Document type called Finance charge Memo and then pick the amount and display it under the interest column which i created.
    The reply you sent me was putting the Finance charge Memo values under the amount column replacing the amounts. The amounts are suppose to be there.
    The finance charge amounts are suppose to be under the interest column i created.
    The setting is already there for the amount which i don't want to tamper with.
    I think i need a code to display the values under the interest column.
    I hope you will understand this.
    Thanks.
  • SavatageSavatage Member Posts: 7,142
    Case "Document Type" of 
          "Document Type"::"Finance Charge Memo": 
               BEGIN 
                    {Your Code Here} 
               END;
    
  • kolaboykolaboy Member Posts: 446
    Hi Savatage;
    Thanks for the code, but it still could not display the finance charge amounts under the interest column. Here is your code with mine, maybe i made some mistake. You can look at it:
     CASE "Document Type" OF
          "Document Type"::"Finance Charge Memo":
          BEGIN
             Int := "Detailed Cust. Ledg. Entry".Amount;
            END ELSE
            Int := 0;
            END;
    
    The above code gives me zeros under the interest column.
    Is there anything i am missing?
    Thanks.
  • girish.joshigirish.joshi Member Posts: 407
    Export the object as text. Post the text here on the forum.
  • kolaboykolaboy Member Posts: 446
    Hi Experts,

    Here is the Object as text:
    OBJECT Report 50008 Cust. Arrears Report3
    {
      OBJECT-PROPERTIES
      {
        Date=16/07/07;
        Time=[ 2:23:42];
        Modified=Yes;
        Version List=NAVW14MLS;
      }
      PROPERTIES
      {
        CaptionML=ENU=Customer - Balance to Date;
        OnPreReport=BEGIN
                      CustFilter := Customer.GETFILTERS;
                      CustDateFilter := Customer.GETFILTER("Date Filter");
                      CompanyInformation.GET;
                      CompanyInformation.CALCFIELDS(Picture);
                    END;
    
      }
      DATAITEMS
      {
        { PROPERTIES
          {
            DataItemTable=Table18;
            DataItemTableView=SORTING(No.);
            PrintOnlyIfDetail=Yes;
            OnPreDataItem=BEGIN
                            CurrReport.NEWPAGEPERRECORD := PrintOnePrPage;
                          END;
    
            OnAfterGetRecord=BEGIN
                               MaxDate := GETRANGEMAX("Date Filter");
                               SETRANGE("Date Filter",0D,MaxDate);
                               CALCFIELDS("Net Change (LCY)","Net Change");
    
                               IF ((PrintAmountInLCY AND (Customer."Net Change (LCY)" = 0))  OR
                                  ((NOT PrintAmountInLCY) AND (Customer."Net Change" = 0)))
                               THEN
                                 CurrReport.SKIP;
                                  MonInst := Cust."Monthly Install";
                                  Int := DtldCustLedgEntry. Amount;
                             END;
    
            ReqFilterFields=No.,Search Name,Blocked,Date Filter;
          }
          SECTIONS
          {
            { PROPERTIES
              {
                SectionType=Header;
                PrintOnEveryPage=Yes;
                SectionWidth=18150;
                SectionHeight=4653;
              }
              CONTROLS
              {
                { 1   ;Label        ;0    ;0    ;7500 ;423  ;FontSize=8;
                                                             FontBold=Yes;
                                                             CaptionML=ENU=Arrears Report }
                { 2   ;TextBox      ;15000;0    ;3150 ;423  ;HorzAlign=Right;
                                                             SourceExpr=FORMAT(TODAY,0,4) }
                { 3   ;TextBox      ;0    ;423  ;7500 ;423  ;SourceExpr=STRSUBSTNO(Text000,FORMAT(Customer.GETRANGEMAX("Date Filter"))) }
                { 4   ;Label        ;16950;423  ;750  ;423  ;ParentControl=5 }
                { 5   ;TextBox      ;17700;423  ;450  ;423  ;CaptionML=ENU=Page;
                                                             SourceExpr=CurrReport.PAGENO }
                { 6   ;TextBox      ;0    ;846  ;7500 ;423  ;SourceExpr=COMPANYNAME }
                { 7   ;TextBox      ;15900;846  ;2250 ;423  ;HorzAlign=Right;
                                                             SourceExpr=USERID }
                { 1000000000;PictureBox;8250;0  ;5400 ;3807 ;SourceExpr=CompanyInformation.Picture }
                { 22  ;TextBox      ;2550 ;1692 ;1500 ;423  ;HorzAlign=Left;
                                                             FontBold=Yes;
                                                             SourceExpr="No." }
                { 23  ;TextBox      ;2550 ;2115 ;4500 ;423  ;FontSize=8;
                                                             FontBold=Yes;
                                                             SourceExpr=Name }
                { 1000000015;Label  ;0    ;1692 ;2550 ;423  ;CaptionML=ENU=Customer No: }
                { 1000000016;Label  ;0    ;2115 ;2550 ;423  ;CaptionML=ENU=Customer Name: }
                { 1000000017;Label  ;0    ;2538 ;2550 ;423  ;CaptionML=ENU=Plot No. }
                { 1000000018;TextBox;2550 ;2538 ;2850 ;423  ;SourceExpr=Customer."No." }
                { 1000000019;Label  ;0    ;2961 ;2550 ;423  ;CaptionML=ENU=Plot Cost }
                { 1000000020;TextBox;2550 ;2961 ;2850 ;423  ;SourceExpr=Customer."Loan Amount" }
                { 1000000021;Label  ;0    ;3384 ;2550 ;423  ;CaptionML=ENU=Down Payment }
                { 1000000022;TextBox;2550 ;3384 ;2850 ;423  ;SourceExpr=Customer."Down Payment" }
                { 1000000031;Label  ;0    ;3807 ;2550 ;423  ;CaptionML=ENU=Monthly Installment }
                { 1000000032;TextBox;2550 ;3807 ;3150 ;423  ;SourceExpr=Customer."Monthly Install" }
                { 1000000033;Label  ;0    ;4230 ;2550 ;423  ;CaptionML=ENU=Interest Rate }
                { 1000000034;TextBox;2550 ;4230 ;3150 ;423  ;SourceExpr=Customer."Interest Rate" }
              }
               }
            { PROPERTIES
              {
                SectionType=Header;
                PrintOnEveryPage=Yes;
                SectionWidth=18150;
                SectionHeight=846;
                OnPreSection=BEGIN
                               CurrReport.SHOWOUTPUT(PrintAmountInLCY);
                             END;
    
              }
              CONTROLS
              {
                { 8   ;Label        ;0    ;423  ;7500 ;423  ;CaptionML=ENU=All amounts are in LCY. }
              }
               }
            { PROPERTIES
              {
                SectionType=Header;
                PrintOnEveryPage=Yes;
                SectionWidth=18150;
                SectionHeight=423;
              }
              CONTROLS
              {
              }
               }
            { PROPERTIES
              {
                SectionType=Header;
                PrintOnEveryPage=Yes;
                SectionWidth=18150;
                SectionHeight=423;
                OnPreSection=BEGIN
                               CurrReport.SHOWOUTPUT((CurrReport.PAGENO = 1) AND (CustFilter <> ''));
                             END;
    
              }
              CONTROLS
              {
                { 10  ;TextBox      ;0    ;0    ;18150;423  ;SourceExpr=Customer.TABLECAPTION + ': ' + CustFilter }
              }
               }
            { PROPERTIES
              {
                SectionType=Header;
                PrintOnEveryPage=Yes;
                SectionWidth=18150;
                SectionHeight=423;
                OnPreSection=BEGIN
                               CurrReport.SHOWOUTPUT((CurrReport.PAGENO = 1) AND (CustFilter <> ''));
                             END;
    
              }
              CONTROLS
              {
              }
               }
            { PROPERTIES
              {
                SectionType=Header;
                PrintOnEveryPage=Yes;
                SectionWidth=18150;
                SectionHeight=1500;
              }
              CONTROLS
              {
                { 29  ;Label        ;0    ;0    ;1200 ;846  ;ParentControl=28;
                                                             HorzAlign=Left;
                                                             VertAlign=Bottom;
                                                             FontBold=Yes;
                                                             MultiLine=Yes }
                { 33  ;Label        ;1350 ;0    ;1950 ;846  ;Visible=No;
                                                             ParentControl=32;
                                                             VertAlign=Bottom;
                                                             FontBold=Yes;
                                                             MultiLine=Yes }
                { 45  ;Label        ;7650 ;0    ;1800 ;846  ;ParentControl=44;
                                                             HorzAlign=Right;
                                                             VertAlign=Bottom;
                                                             FontBold=Yes;
                                                             MultiLine=Yes }
                { 1000000001;Label  ;13800;0    ;1800 ;1500 ;CaptionML=ENU=Arrears }
                { 1000000036;Label  ;10800;423  ;1500 ;423  ;CaptionML=ENU=Interest Paid }
              }
               }
            { PROPERTIES
              {
                SectionType=Body;
                SectionWidth=18150;
                SectionHeight=423;
              }
              CONTROLS
              {
              }
               }
          }
           }
        { PROPERTIES
          {
            DataItemIndent=1;
            DataItemTable=Table21;
            DataItemTableView=SORTING(Customer No.)
                              WHERE(Document Type=FILTER(Payment));
            DataItemVarName=CustLedgEntry3;
            OnPreDataItem=BEGIN
                            RESET;
                            DtldCustLedgEntry.SETCURRENTKEY("Customer No.","Posting Date","Entry Type");
                            DtldCustLedgEntry.SETRANGE("Customer No.",Customer."No.");
                            DtldCustLedgEntry.SETRANGE("Posting Date",CALCDATE('<+1D>',MaxDate),31129999D);
                            DtldCustLedgEntry.SETRANGE("Entry Type",DtldCustLedgEntry."Entry Type"::Application);
                            IF NOT PrintUnappliedEntries  THEN
                              DtldCustLedgEntry.SETRANGE(Unapplied,FALSE);
    
                            IF DtldCustLedgEntry.FIND('-') THEN
                              REPEAT
                                "Entry No." := DtldCustLedgEntry."Cust. Ledger Entry No.";
                                MARK(TRUE);
                              UNTIL DtldCustLedgEntry.NEXT = 0;
    
                            SETCURRENTKEY("Customer No.",Open);
                            SETRANGE("Customer No.",Customer."No.");
                            SETRANGE(Open,TRUE);
                            SETRANGE("Posting Date",0D,MaxDate);
    
                            IF FIND('-') THEN
                              REPEAT
                                MARK(TRUE);
                              UNTIL NEXT = 0;
    
                            SETCURRENTKEY("Entry No.");
                            SETRANGE(Open);
                            MARKEDONLY(TRUE);
                            SETRANGE("Date Filter",0D,MaxDate);
    
                            LastFieldNo := FIELDNO("Customer No.");
                            NumPayments := -1;
                            "Monthly Install" := 0;
                            OriginalAmt := 0;
                          END;
    
            OnAfterGetRecord=BEGIN
                               IF PrintAmountInLCY THEN BEGIN
                                 CALCFIELDS("Original Amt. (LCY)","Remaining Amt. (LCY)");
                                 OriginalAmt := "Original Amt. (LCY)";
                                 RemainingAmt := "Remaining Amt. (LCY)";
                                 CurrencyCode := '';
                               END ELSE BEGIN
                                 CALCFIELDS("Original Amount","Remaining Amount");
                                 OriginalAmt := "Original Amount";
                                 RemainingAmt := "Remaining Amount";
                                 CurrencyCode := "Currency Code";
                               END;
    
                               CurrencyTotalBuffer.UpdateTotal(
                                 CurrencyCode,
                                 RemainingAmt,
                                 0,
                                 Counter1);
    
    
                               FromDate := 010107D;
                               ToDate :=TODAY;
                               Amount := 0;
                               CustLedEntryMonth := '';
                               MonthsArrears := 0;
    
                               //Code to Count Months
                               IF (FromDate <> 0D) AND (ToDate > FromDate) THEN BEGIN
                                   Calendar.RESET;
                                   Calendar.SETRANGE("Period Type",Calendar."Period Type"::Month);
                                   Calendar.SETRANGE("Period Start",FromDate,ToDate);
                                  Months := Calendar.COUNT;
                               END ELSE
                                    Months := 0;
    
    
                               //IF "Monthly Install" <= 0 THEN
                                  // CurrReport.SKIP;
    
                               //SETRANGE("Date Filter");
                               //CALCFIELDS(Amount);
                               //IF Amount <= 0 THEN
                               //   CurrReport.SKIP;
    
                               //Calendar.RESET;
                               //Calendar.SETRANGE("Period Type",Calendar."Period Type"::Month);
    
                               //CustLedgeEntry.RESET;
                               //CustLedgeEntry.SETCURRENTKEY("Customer No.",Open,Positive);
                               //CustLedgeEntry.SETRANGE("Customer No.","No.");
                               //CustLedgeEntry.SETRANGE(Open,TRUE);
                               //CustLedgeEntry.SETRANGE(Positive,TRUE);
    
                               // Find the Debt
                               //CustLedgeEntry.SETRANGE(Positive,FALSE);
    
                               //REPEAT
                               //    FromDate1 := CustLedgeEntry."Posting Date";
                               //    ToDate1 := TODAY;
                                   //Or last day Last month
                               //    ToDate1 := CALCDATE('-CM-1D',TODAY);
                               //    Calendar.SETRANGE("Period Start",FromDate,ToDate);
                                 //  MonthsPaid := Calendar.COUNT;
                                   //CustLedgeEntry.CALCFIELDS(Amount,"Remaining Amount");
                                   //Find the Amount Paid over what period (Months Paid)
                                  // IF  ROUND((Amount - "Remaining Amount") / "Monthly Install",1)
                                                   //< Months THEN
                                       // AmtDue := AmtDue + ("Monthly Install" * Months)-
                                                                         //(Amount - "Remaining Amount");
                               //UNTIL CustLedgeEntry.NEXT = 0;
    
                               //IF AmtDue = 0
                               //THEN  CurrReport.SKIP;
    
                               //  FromDate1 := 010107D;
                               //  ToDate1 := 010507D;
                               //  Arrears := 0;
                               //  CustLedEntryMonth1 := '';
                               //  MonthsArrears := 0;
    
                                IF "Document Type" = "Finance Charge Memo"
                                 THEN BEGIN
                                 Amt:=  DtldCustLedgEntry.Amount;
                                 END;
    
    
    
                               //Code to count No. of payments
                               NumPayments := NumPayments +1;
                                //Code Ends above.
                                CustLedgeEntry.SETRANGE(Positive,FALSE);
                               IF "Cust. Ledger Entry".FIND('-') THEN BEGIN
                                  Cust.GET("Customer No.");
                                  FromDate1 := "Cust. Ledger Entry"."Posting Date";
                                  ToDate1 := TODAY;
                                  Calendar.SETRANGE("Period Start",FromDate,ToDate);
                                  MonthsPaid := Calendar.COUNT;
                                  Arrears := Cust."Monthly Install" + OriginalAmt;
                               //Code to elliminate the first entry
                               IF "Document Type" = 0
                                THEN  Arrears := OriginalAmt - OriginalAmt;
                               // IF "Document Type" <> 0 THEN
                               // Arrears := OriginalAmt - OriginalAmt;
                                // CurrReport.SKIP;
    
                               //Code ends above
                               END ELSE BEGIN
                                 Arrears := Arrears + Cust."Monthly Install";
                               END;
                                TotalArr += Arrears;
    
                               TotMonthsArr := Months - NumPayments;
                               Arrears2 := TotMonthsArr * Cust."Monthly Install";
                               TotArr := TotalArr1 + Arrears2;
    
                                AmtPeriod := Months * Cust."Monthly Install";
                                TotMonPaid := NumPayments * Cust."Monthly Install";
                                TotMonOut := TotMonthsArr * Cust."Monthly Install";
                             END;
    
          }
          SECTIONS
          {
            { PROPERTIES
              {
                SectionType=Body;
                SectionWidth=18150;
                SectionHeight=846;
              }
              CONTROLS
              {
                { 28  ;TextBox      ;0    ;423  ;1200 ;423  ;HorzAlign=Left;
                                                             SourceExpr="Posting Date" }
                { 32  ;TextBox      ;1500 ;423  ;1650 ;423  ;Visible=No;
                                                             SourceExpr="Document Type" }
                { 44  ;TextBox      ;7650 ;423  ;1800 ;423  ;CaptionML=ENU=Amount;
                                                             SourceExpr=OriginalAmt;
                                                             AutoFormatType=1;
                                                             AutoFormatExpr=CurrencyCode }
                { 1000000002;TextBox;13800;423  ;1500 ;423  ;Visible=No;
                                                             SourceExpr=Arrears }
              }
               }
          }
           }
        { PROPERTIES
          {
            DataItemIndent=2;
            DataItemTable=Table379;
            DataItemTableView=SORTING(Customer No.)
                              WHERE(Entry Type=FILTER(Application));
            OnPreDataItem=BEGIN
                            LastFieldNo := FIELDNO("Customer No.");
                            //NumPayments := 0;
                            "Monthly Install" := 0;
                            OriginalAmt := 0;
                          END;
    
            OnAfterGetRecord=BEGIN
                               IF NOT PrintUnappliedEntries  THEN
                                 IF Unapplied THEN
                                   CurrReport.SKIP;
    
                               IF PrintAmountInLCY THEN BEGIN
                                 Amt := "Amount (LCY)";
                                 CurrencyCode := '';
                               END ELSE BEGIN
                                 Amt := Amount;
                                 CurrencyCode := "Currency Code";
                               END;
                               IF Amt = 0 THEN
                                 CurrReport.SKIP;
    
                               IF PrintAppliedEntries THEN
                                 IF Applied THEN BEGIN
                                 Amt1 := "Credit Amount";
                                 CurrencyCode := '';
                                END;
                               IF Amt = 0 THEN
                                 CurrReport.SKIP;
    
    
    
    
                               FromDate := 010107D;
                               ToDate :=  "Posting Date";
                               Amount := 0;
                               CustLedEntryMonth := '';
                               MonthsArrears := 0;
                               //Code to Count Months
                               IF (FromDate <> 0D) AND (ToDate > FromDate) THEN BEGIN
                                   Calendar.RESET;
                                   Calendar.SETRANGE("Period Type",Calendar."Period Type"::Month);
                                   Calendar.SETRANGE("Period Start",FromDate,ToDate);
                                  Months := Calendar.COUNT;
                               END ELSE
                                    Months := 0;
    
                               IF "Entry Type" = 0
                               THEN BEGIN Arrs := Amt - Amt;
                               //Code ends above
                               END;
                                IF "Entry Type" <>0
                               THEN BEGIN
                                Arrs := Cust."Monthly Install" + Amt;
                                //Arrs := Arrs + Cust."Monthly Install";
                               END;
                                TotalArr1 += Arrs;
    
                               //Code to count No. of payments
                               NumPayments := NumPayments +1;
                                //Code Ends above.
                               // DtldCustLedgEntry.SETRANGE(Positive,FALSE);
                               IF "Detailed Cust. Ledger Entry".FIND('-') THEN BEGIN
                                  Cust.GET("Customer No.");
                                   FromDate1 := "Detailed Cust. Ledger Entry"."Posting Date";
                                   ToDate1 := TODAY;
                                  Calendar.SETRANGE("Period Start",FromDate1,ToDate1);
                                  MonthsPaid := Calendar.COUNT;
                                  Arrears := Cust."Monthly Install" + Amt;
    
    
                               //Code to elliminate the first entry
                               IF "Document Type" = 0
                                THEN  Arrears := Amt - Amt;
                               //Code ends above
    
                               END ELSE BEGIN
                                Arrears := Arrears + Cust."Monthly Install";
                                 END;
                                TotalArr += Arrears;
    
    
                               //Code Picking from Cust. ledger Entry table Start.
                                CustLedgeEntry.SETRANGE(Positive,FALSE);
                               //IF "Cust. Ledger Entry".FIND('-') THEN BEGIN
                                 // Cust.GET("Customer No.");
                                //  FromDate1 := "Cust. Ledger Entry"."Posting Date";
                                  //ToDate1 := TODAY;
                                  //Calendar.SETRANGE("Period Start",FromDate,ToDate);
                                  //MonthsPaid := Calendar.COUNT;
                                  //Arrears := Cust."Monthly Install" + Amt;
                               //Code to elliminate the first entry
                               //IF "Document Type" = 0
                                //THEN  Arrearsc := Amt - Amt;
                               // IF "Document Type" <> 0 THEN
                               // Arrearsc := OriginalAmt - OriginalAmt;
    
                               //Interest Amount
                                IF "Document Type" = "Finance Charge Memo"
                                 THEN BEGIN
                                Cust.GET("Customer No.");
                                Int1 := Amount;
                               END;
                               Int2 += Int1;
    
                                IF "Document Type" = "Finance Charge Memo"
                               THEN BEGIN
                                Cust.GET("Customer No.");
                                Int := Int2 - Amt ;
                               END;
    
    
    
    
                               //Code ends above
                               //END ELSE BEGIN
                                 //Arrearsc := Arrearsc + Cust."Monthly Install";
                               //END;
                               // TotalArrc += Arrearsc;
    
                               //Code picking from the cust. Ledger Entry Ends
    
                               TotMonthsArr := Months - NumPayments;
                               Arrears2 := TotMonthsArr * Cust."Monthly Install";
                               TotArr := TotalArr1 + Arrears2;
    
                               AmtPeriod := Months * Cust."Monthly Install";
                               TotMonPaid := NumPayments * Cust."Monthly Install";
                               TotMonOut := TotMonthsArr * Cust."Monthly Install";
    
    
    
    
    
                               // CASE "Document Type" OF
                                // IF "Document Type"="Finance Charge Memo"
                                //  THEN BEGIN
                                 //    Int:="Detailed Cust. Ledger Entry".Amount;
                                  //   END ELSE
                                  //   BEGIN
                                   //  Int := 0;
                                  //    END;
                             END;
    
            TotalFields=Credit Amount;
            DataItemLink=Cust. Ledger Entry No.=FIELD(Entry No.),
                         Posting Date=FIELD(Date Filter);
          }
          SECTIONS
          {
            { PROPERTIES
              {
                SectionType=Body;
                SectionWidth=18150;
                SectionHeight=423;
              }
              CONTROLS
              {
                { 42  ;TextBox      ;4950 ;0    ;1950 ;423  ;Visible=No;
                                                             SourceExpr="Entry Type" }
                { 46  ;TextBox      ;0    ;0    ;1200 ;423  ;HorzAlign=Left;
                                                             SourceExpr="Posting Date" }
                { 48  ;TextBox      ;1350 ;0    ;1800 ;423  ;Visible=No;
                                                             SourceExpr="Document Type" }
                { 50  ;TextBox      ;3150 ;0    ;1500 ;423  ;Visible=No;
                                                             SourceExpr="Document No." }
                { 52  ;TextBox      ;7650 ;0    ;1800 ;423  ;SourceExpr=Amt;
                                                             AutoFormatType=1;
                                                             AutoFormatExpr=CurrencyCode }
                { 1000000028;TextBox;13800;0    ;1500 ;423  ;SourceExpr=Arrs }
                { 1000000035;TextBox;10800;0    ;1500 ;423  ;SourceExpr=Amt1 }
              }
               }
            { PROPERTIES
              {
                SectionType=Footer;
                SectionWidth=18150;
                SectionHeight=423;
              }
              CONTROLS
              {
                { 11  ;TextBox      ;7650 ;0    ;1800 ;423  ;FontBold=Yes;
                                                             CaptionML=ENU=Amount;
                                                             SourceExpr=RemainingAmt;
                                                             AutoFormatType=1;
                                                             AutoFormatExpr=CurrencyCode }
              }
               }
          }
           }
        { PROPERTIES
          {
            DataItemIndent=1;
            DataItemTable=Table2000000026;
            DataItemTableView=SORTING(Number)
                              WHERE(Number=FILTER(1..));
            DataItemVarName=Integer2;
            OnPreDataItem=BEGIN
                            CurrencyTotalBuffer.SETFILTER("Total Amount",'<>0');
                          END;
    
            OnAfterGetRecord=BEGIN
                               IF Number = 1 THEN
                                 OK := CurrencyTotalBuffer.FIND('-')
                               ELSE
                                 OK := CurrencyTotalBuffer.NEXT <> 0;
                               IF NOT OK THEN
                                 CurrReport.BREAK;
    
                               CurrencyTotalBuffer2.UpdateTotal(
                                 CurrencyTotalBuffer."Currency Code",
                                 CurrencyTotalBuffer."Total Amount",
                                 0,
                                 Counter1);
    
    
                               IF "Document Type" = Payment THEN
                                 OK := "Cust. Ledger Entry".FIND('-')
                               ELSE
                                 OK := "Cust. Ledger Entry".NEXT <> 0;
                               IF NOT OK THEN
                                  CurrReport.SKIP;
    
    
                               IF "Document Type" = Payment THEN
                                 OK := "Detailed Cust. Ledger Entry".FIND('-')
                               ELSE
                                 OK := "Detailed Cust. Ledger Entry".NEXT <> 0;
                               IF NOT OK THEN
                                  CurrReport.SKIP;
                             END;
    
            OnPostDataItem=BEGIN
                             CurrencyTotalBuffer.DELETEALL;
                           END;
    
          }
          SECTIONS
          {
            { PROPERTIES
              {
                SectionType=Body;
                SectionWidth=18150;
                SectionHeight=846;
              }
              CONTROLS
              {
                { 98  ;TextBox      ;7650 ;423  ;1800 ;423  ;FontBold=Yes;
                                                             SourceExpr=CurrencyTotalBuffer."Total Amount";
                                                             AutoFormatType=1;
                                                             AutoFormatExpr=CurrencyTotalBuffer."Currency Code" }
                { 20  ;Label        ;1350 ;423  ;2250 ;423  ;FontSize=8;
                                                             FontBold=Yes;
                                                             CaptionML=ENU=Total Balance }
                { 1000000029;TextBox;13800;423  ;1500 ;423  ;SourceExpr=TotalArr1 }
                { 1000000030;Label  ;10350;423  ;2400 ;423  ;FontSize=8;
                                                             FontBold=Yes;
                                                             CaptionML=ENU=Total Arrears1 }
              }
               }
            { PROPERTIES
              {
                SectionType=Footer;
                SectionWidth=18150;
                SectionHeight=423;
              }
              CONTROLS
              {
              }
               }
          }
           }
        { PROPERTIES
          {
            DataItemTable=Table2000000026;
            DataItemTableView=SORTING(Number)
                              WHERE(Number=FILTER(1..));
            DataItemVarName=Integer3;
            OnPreDataItem=BEGIN
                            CurrencyTotalBuffer2.SETFILTER("Total Amount",'<>0');
                          END;
    
            OnAfterGetRecord=BEGIN
                               IF Number = 1 THEN
                                 OK := CurrencyTotalBuffer2.FIND('-')
                               ELSE
                                 OK := CurrencyTotalBuffer2.NEXT <> 0;
                               IF NOT OK THEN
                                 CurrReport.BREAK;
                             END;
    
            OnPostDataItem=BEGIN
                             CurrencyTotalBuffer2.DELETEALL;
                           END;
    
          }
          SECTIONS
          {
            { PROPERTIES
              {
                SectionType=Body;
                SectionWidth=18150;
                SectionHeight=5922;
              }
              CONTROLS
              {
                { 1000000003;TextBox;7650 ;0    ;1500 ;423  ;Visible=No;
                                                             SourceExpr=TotalArr }
                { 1000000004;TextBox;3600 ;846  ;1800 ;423  ;SourceExpr=Months }
                { 1000000005;Label  ;0    ;846  ;3000 ;423  ;CaptionML=ENU=Total Months in Period }
                { 1000000006;Label  ;1350 ;0    ;2550 ;423  ;Visible=No;
                                                             FontSize=8;
                                                             FontBold=Yes;
                                                             CaptionML=ENU=Total Arrears }
                { 1000000008;TextBox;3600 ;2538 ;1950 ;423  ;SourceExpr=TotMonthsArr }
                { 1000000009;Label  ;0    ;1692 ;3000 ;423  ;CaptionML=ENU=Total Months Paid }
                { 1000000010;Label  ;0    ;2538 ;3000 ;423  ;CaptionML=ENU=Total Months Outstanding }
                { 1000000011;Label  ;0    ;3384 ;3000 ;423  ;CaptionML=ENU=Total Arrears 2 }
                { 1000000012;TextBox;3600 ;3384 ;1950 ;423  ;SourceExpr=Arrears2 }
                { 1000000007;TextBox;3600 ;1692 ;1950 ;423  ;SourceExpr=NumPayments }
                { 1000000023;TextBox;5850 ;1692 ;2400 ;423  ;SourceExpr=TotMonPaid }
                { 1000000024;TextBox;5850 ;846  ;2400 ;423  ;SourceExpr=AmtPeriod }
                { 1000000025;TextBox;6000 ;2538 ;2250 ;423  ;SourceExpr=TotMonOut }
                { 1000000026;Label  ;0    ;4230 ;6750 ;423  ;FontSize=8;
                                                             FontBold=Yes;
                                                             CaptionML=ENU=------------------------------------------------------------------------------------------------------------------------------------------------------------ }
                { 1000000027;Label  ;0    ;5076 ;6900 ;423  ;FontSize=8;
                                                             FontBold=Yes;
                                                             CaptionML=ENU=------------------------------------------------------------------------------------------------------------------------------------------------------------- }
                { 1000000013;Label  ;0    ;4653 ;4050 ;423  ;FontSize=12;
                                                             FontBold=Yes;
                                                             CaptionML=ENU=Grand Total Arrears }
                { 1000000014;TextBox;4050 ;4653 ;1950 ;423  ;SourceExpr=TotArr }
              }
               }
            { PROPERTIES
              {
                SectionType=Footer;
                SectionWidth=18150;
                SectionHeight=846;
              }
              CONTROLS
              {
              }
               }
          }
           }
      }
      REQUESTFORM
      {
        PROPERTIES
        {
          Width=3850;
          Height=1540;
          SaveValues=Yes;
        }
        CONTROLS
        {
          { 1   ;CheckBox     ;3410 ;0    ;440  ;440  ;ShowCaption=No;
                                                       CaptionML=ENU=Show Amounts in LCY;
                                                       SourceExpr=PrintAmountInLCY }
          { 21  ;Label        ;0    ;0    ;3300 ;440  ;ParentControl=1 }
          { 2   ;CheckBox     ;3410 ;550  ;440  ;440  ;ShowCaption=No;
                                                       CaptionML=ENU=New Page per Customer;
                                                       SourceExpr=PrintOnePrPage }
          { 22  ;Label        ;0    ;550  ;3300 ;440  ;ParentControl=2 }
          { 4   ;CheckBox     ;3410 ;1100 ;440  ;440  ;ShowCaption=No;
                                                       CaptionML=ENU=Include Unapplied Entries;
                                                       SourceExpr=PrintUnappliedEntries }
          { 6   ;Label        ;0    ;1100 ;3300 ;440  ;ParentControl=4 }
        }
      }
      CODE
      {
        VAR
          Text000@1000 : TextConst 'ENU=Balance on %1';
          CurrencyTotalBuffer@1001 : TEMPORARY Record 332;
          CurrencyTotalBuffer2@1002 : TEMPORARY Record 332;
          DtldCustLedgEntry@1016 : Record 379;
          PrintAmountInLCY@1005 : Boolean;
          PrintOnePrPage@1006 : Boolean;
          CustFilter@1007 : Text[250];
          CustDateFilter@1008 : Text[30];
          MaxDate@1009 : Date;
          OriginalAmt@1010 : Decimal;
          Amt@1011 : Decimal;
          RemainingAmt@1012 : Decimal;
          Counter1@1013 : Integer;
          OK@1014 : Boolean;
          CurrencyCode@1015 : Code[10];
          PrintUnappliedEntries@1004 : Boolean;
          CompanyInformation@1000000000 : Record 79;
          Cust@1000000001 : Record 18;
          Arrears@1000000002 : Decimal;
          MonInst@1000000003 : Decimal;
          Arrears1@1000000004 : Decimal;
          "Monthly Install"@1000000005 : Decimal;
          TotalArr@1000000006 : Decimal;
          "Cust. Ledger Entry"@1000000007 : Record 21;
          PrintOriginalAmt@1000000008 : Boolean;
          "Document Type"@1000000009 : Boolean;
          Payment@1000000010 : Boolean;
          FromDate@1000000011 : Date;
          ToDate@1000000012 : Date;
          Calendar@1000000013 : Record 2000000007;
          Months@1000000014 : Integer;
          CustLedEntryMonth@1000000015 : Text[250];
          "To Date"@1000000016 : Record 2000000007;
          MonthCustLedEntryAmount@1000000017 : Decimal;
          MonthsPaid@1000000018 : Integer;
          FromDate1@1000000019 : Date;
          ToDate1@1000000020 : Date;
          CustLedEntryMonth1@1000000021 : Text[250];
          MonthsPaid1@1000000022 : Integer;
          Calendar1@1000000023 : Record 2000000007;
          Date@1000000024 : Record 2000000007;
          FINDSET@1000000025 : Record 2000000007;
          CstLEntry@1000000026 : Record 21;
          CstLEntryMonth@1000000027 : Text[250];
          CstLEntryDate@1000000028 : Date;
          EndDate@1000000029 : Text[30];
          BeginDate@1000000030 : Text[30];
          TotMonthsArr@1000000031 : Integer;
          TotalOriginalAmt@1000000032 : Decimal;
          Arrears2@1000000033 : Decimal;
          TotArr@1000000034 : Decimal;
          "Posting Date1"@1000000035 : Date;
          PrintPayment@1000000036 : Boolean;
          NoPayment@1000000037 : Boolean;
          MonthsArrears@1000000038 : Decimal;
          "Date Filter"@1000000039 : Date;
          "Customer No."@1000000040 : Code[10];
          "No."@1000000041 : Code[10];
          ToDate2@1000000042 : Date;
          CustLedgeEntry@1000000043 : Record 21;
          FINDFIRST@1000000044 : Code[10];
          AmtDue@1000000045 : Decimal;
          LastFieldNo@1000000048 : Integer;
          FooterPrinted@1000000047 : Boolean;
          NumPayments@1000000046 : Integer;
          AmtPeriod@1000000049 : Decimal;
          TotMonPaid@1000000050 : Decimal;
          TotMonOut@1000000051 : Decimal;
          Postive@1000000052 : Boolean;
          "Detailed Cust. Ledger Entry"@1000000053 : Record 379;
          Arrs@1000000054 : Decimal;
          TotalArr1@1000000055 : Decimal;
          Arrearsc@1000000056 : Decimal;
          TotalArrc@1000000057 : Decimal;
          "Finance Charge Memo"@1000000058 : Option;
          Application@1000000060 : Option;
          Amts@1000000062 : Decimal;
          Int@1000000059 : Decimal;
          "Remaining Amount"@1000000063 : Decimal;
          Int1@1000000064 : Decimal;
          Int2@1000000065 : Decimal;
          top@1000000066 : Decimal;
          Int3@1000000067 : Decimal;
          Quantity@1000000061 : Decimal;
          "Issued Fin. Charge Memo Header"@1000000068 : Record 304;
          "Interest Amount"@1000000069 : Decimal;
          "Initial Entry"@1000000070 : Option;
          "Issued Fin. Charge Memo Line"@1000000071 : Record 305;
          PrintAppliedEntries@1000000072 : Boolean;
          Amt1@1000000073 : Decimal;
          Applied@1000000074 : Boolean;
    
        PROCEDURE @1000000000();
        BEGIN
        END;
    
        BEGIN
        END.
      }
    }
    
    

    Please may i know where the error is.
    Please i need you help urgently.
    Thanks
Sign In or Register to comment.