Thursday, 21 December 2017

Aging Report

Need to add custFactored Status Field  ( which is enum and maintain as range). In Aging Report :

1.     Added in Contract Field  - Enum(SOLD,NOTSOLD,BLANK)  CustFactored .
2.     Add CustFactored field in Temp Table  “CustAgingReportTmp”, CustTmpAccountSum
3.     CustAgingReportDP  modifications
i)                   Process Report

custVendBalanceList = CustVendBalanceList::construct(SysModule::Cust,
                                                                contract.parmDateTransactionDuedate(),
                                                                contract.parmExcludeZeroBalanceCustomer(),
………………………………………………………….
contract.parmFactorStatus()); //Added Line


ii)                insertCustAgingReportTmp()

insert_recordset custAgingReportTmp
           (Balance01, Balance02, Balance03, Balance04, Balance05, Balance06, Balance07,----------------------------
            HeadingAgingBucketDescription06, HeadingAgingBucketDescription07, Balance,CustFactored,SortOrder)//Added Line

                select
                    Balance01, Balance07, Balance06, Balance05, Balance04, Balance03, Balance02,
------------------------------------------
                    headingAgingBucketDescription06, headingAgingBucketDescription07, balance,CustFactored//Added Line

                from tmpAccountSum
                        join SortOrder
                        from custVendTransAging
                            where tmpAccountSum.AccountNum == custVendTransAging.AccountNum;


4.     Need to retrieve value Cust Factored sent from DP class. – CustVendBalanceList and pass to CustBalanceList

i)                   Construct ()
public static CustVendBalanceList construct(SysModule               _sysModule,
                                            DateTransactionDuedate  _dateTransactionDuedate,
                                            ……………………………………………………………………………………………………………………..
                             NoYes                   _excludeNegativeBalance = NoYes::No,
                             CustFactorStatus        _factorStatus   =   CustFactorStatus::Blank

Since only related to Cust Module my modification I passed only for Cust Case
case SysModule::Cust :
            switch(_dateTransactionDuedate)
            {
                case DateTransactionDuedate::DocumentDate :
                        balanceList = new CustBalancelistDocumentDate(  _range,
-------------------------------------------------------------------------------                                                                       
                                                                        _factorStatus);
                        break;

                case DateTransactionDuedate::TransactionDate :
                        balanceList = new CustBalancelistTransactionDate(   _range,
                                                                            ---------
                                                                            _factorStatus);
                        break;

                default :
                        balanceList = new CustBalanceList(  _range,
                                                            -------
                                                            _factorStatus);
                        break;
            }
            break;


ii)                New ()

void new(PositiveDays               _interval,
         ------------------------------------
         CustFactorStatus  _factorStatus  =   CustFactorStatus::Blank)


5.     Need to Catch the value from CustBalanceList
i)                   New()

void new(PositiveDays               _interval,
         ---------------------------------------
         NoYes                      _excludeNegativeBalance = NoYes::No,
         CustFactorStatus           _factorStatus   =   CustFactorStatus::Blank)

super(_interval, _transactionDate, _zeroDate, _payments, _period, _direction, _agingBucket,
        _printReversed, _details, _excludeZeroBalance, _excludeNegativeBalance,_factorStatus);

agingCalculation = CustVendAgingCalculation::construct(   SysModule::Cust,
                                                        -----------------
                                                        inclTransWithNoBillingClass,
                                                        _factorStatus);

ii)                insertIntoTmpAccountSum()

Since it need to insert value , not update in any of bucket…

if (_withAmountCur)
    {
        insert_recordset custTmpAccountSum
            (AccountNum, CurrencyCode, BillingClassification, InvoiceId, TransDate, Txt, Voucher,CustFactored,Balance01, Balance01Cur, Name, GroupId)
                select AccountNum, CurrencyCode, BillingClassification, InvoiceId, TransDate, Txt, Voucher,CustFactored,sum(Amount), sum(AmountCur)
                    from _agingCalculatedTmp
                        group by AccountNum, CurrencyCode, BillingClassification, TransDate, InvoiceId, Voucher,CustFactored,Txt
                join Name, GroupId from customers
                    group by Name, GroupId
                        where _agingCalculatedTmp.AccountNum == customers.AccountNum;




Methods where  actually they include the transactions :
  [s]    \Classes\CustAgingCalculation\selectTransactions 
  \Classes\CustAgingCalculation\selectDetailsOfTransactions



  [s]    \Classes\CustAgingCalculation\selectTransactions                                                       13
 
update_recordSet agingProcessingTmp setting
        IsPayment = true
            where agingProcessingTmp.AmountCur < 0
                exists join custTrans
                    where custTrans.RecId == agingProcessingTmp.TransRecId
                        && !custTrans.Invoice;


[s]    \Classes\CustAgingCalculation\selectDetailsOfTransactions                                               1
case DateTransactionDuedate::DueDate:

            update_recordSet agingProcessingDetailsTmp setting
                TransDate = custSettlement.DueDate
                    join agingProcessingTmp
                        where agingProcessingTmp.RecId == agingProcessingDetailsTmp.ProcessingRecId
                    join custSettlement
                        where agingProcessingTmp.SettlementRecId == custSettlement.RecId
                            && custSettlement.TransDate > balanceAsOfDate
                            && custSettlement.DueDate > dateNull();

            update_recordSet agingProcessingDetailsTmp setting
                TransDate = custTransOpen.DueDate
                    join agingProcessingTmp
                        where agingProcessingTmp.RecId == agingProcessingDetailsTmp.ProcessingRecId
                    join custTransOpen
                        where agingProcessingTmp.TransOpenRecId == custTransOpen.RecId
                            && custTransOpen.TransDate <= balanceAsOfDate
                            && custTransOpen.DueDate > dateNull();
            break;

        case DateTransactionDuedate::DocumentDate:
            update_recordSet agingProcessingDetailsTmp setting
                TransDate = custTrans.DocumentDate
                    join agingProcessingTmp
                        where agingProcessingTmp.RecId == agingProcessingDetailsTmp.ProcessingRecId
                    join custTrans
                        where agingProcessingTmp.TransRecId == custTrans.RecId
                            && custTrans.TransDate <= balanceAsOfDate
                            && (!custTrans.Closed || custTrans.Closed >= balanceAsOfDate)
                            && custTrans.DocumentDate > dateNull()
                    exists join customersVendors

                        where custTrans.AccountNum == customersVendors.AccountNum;


1.)    Remove the date 12/31/2154 – this occurs when the unit setup is ‘0’ and interval ‘unlimited’ in the aging period definition
A.      To navigate this:
AP>> setup>> Aging Period Definitions.




If date is 2154/12/31 - then the value should be null :
---------------------------------------------------------

=iif(Fields!Heading14.Value = FormatDateTime(CDate("2154/12/31"),2), "",Fields!Heading14.Value)

If we want Date  from Date time :
---------------------------------------

Format(Fields!Heading7DateValue.Value, Microsoft.Dynamics.Framework.Reports.BuiltInMethods.GetExtendedDataTypeFormat("Transdate", Parameters!AX_RenderingCulture.Value))


=======================================================

=iif(Fields!Heading14.Value = FormatDateTime(CDate("2154/12/31"),2), "",Format(Fields!Heading14.Value, Microsoft.Dynamics.Framework.Reports.BuiltInMethods.GetExtendedDataTypeFormat("Transdate", Parameters!AX_RenderingCulture.Value)))
=====================================================


2 comments:

  1. Hello this is for customer Aging.
    How about vendor aging?

    ReplyDelete
  2. Do you need Finance? Are you looking for Finance? Are you looking for finance to enlarge your business? We help individuals and companies to obtain finance for business expanding and to setup a new business ranging any amount. Get finance at affordable interest rate of 3%, Do you need this finance for business and to clear your bills? Then send us an email now for more information contact us now via (financialserviceoffer876@gmail.com) whats-App +918929509036 Dr James Eric Finance Pvt Ltd Thanks

    ReplyDelete