Featured Post

Dynamics GP 2019 is now Released

It is now released, Microsoft Dynamics GP 2019 which moves the system to the modern product life cycle   " Beginning with the October...

Saturday, May 20, 2017

Cash Collection per Customer per SalesPerson

We usually think of commission from sales perspective, which means that the higher a sales person sells, the higher their commission is. Although, this is not quite accurate when you work with big distribution companies, you start to realize that "cash collection" for the sales is more important than the sales itself. 

The concept is pretty much straight forward, when evaluating sales force and salesperson, it is not only important to give commissions for sales persons who can up-sell and increase sales, but rather the ones who can sell and collect high as well. 

When trying to understand this requirements from Dynamics GP perspective, it is clear that the system doesn't keep track of the sales person per cash receipt, but rather it is stored on the customer card level. For that purpose, the report below retrieves all the cash receipts (check and cash) per Customer per Sales Person


CREATE VIEW [dbo].[GPEssentials_Vw_SalespersonCollection]
AS
    SELECT  A.DOCNUMBR AS DocumentNumber ,
            BACHNUMB AS BatchNumber ,
            A.CUSTNMBR AS CustomerNumber ,
            C.CUSTNAME CustomerName ,
            C.CUSTCLAS AS CustomerClass ,
            D.CLASDSCR AS CustomerClassDescription ,
            C.SLPRSNID AS CustomerSalesPersonID ,
            E.SalesPersonName ,
            DOCDATE AS DocumentDate ,
            Trx_Month AS TransactionMonth ,
            A.CHEKBKID AS CheckBookID ,
            A.CURNCYID AS CurrencyID ,
            CURTRXAM AS CurrentTransactionAmount ,
            ORTRXAMT AS OriginalTransactionAmount ,
            CASE CSHRCTYP
              WHEN 1 THEN 'Cash'
              WHEN 0 THEN 'Check'
              ELSE ''
            END AS CashReceiptType
    FROM    ( SELECT    'Unposted' AS Trx_Status ,
                        BACHNUMB ,
                        DOCNUMBR ,
                        CUSTNMBR ,
                        DOCDATE ,
                        MONTH(DOCDATE) AS Trx_Month ,
                        CHEKBKID ,
                        CURNCYID ,
                        CURTRXAM ,
                        ORTRXAMT ,
                        CSHRCTYP
              FROM      RM10201
                        DOCNUMBR NOT LIKE 'CSIR%'
              UNION ALL
              SELECT    'Posted' AS Trx_Status ,
                        BACHNUMB ,
                        DOCNUMBR ,
                        CUSTNMBR ,
                        DOCDATE ,
                        MONTH(DOCDATE) AS Trx_Month ,
                        MSCSCHID ,
                        CURNCYID ,
                        CURTRXAM ,
                        ORTRXAMT ,
                        CSHRCTYP
              FROM      RM20101
              WHERE     RMDTYPAL = 9
                        AND DOCNUMBR NOT LIKE 'CSIR%'
            ) AS A
            LEFT OUTER JOIN RM00101 AS C ON C.CUSTNMBR = A.CUSTNMBR
            LEFT OUTER JOIN RM00201 AS D ON D.CLASSID = C.CUSTCLAS
            LEFT OUTER JOIN ( SELECT    RTRIM(LTRIM(SLPRSNID)) AS SalesPersonID ,
                                        CONCAT(RTRIM(LTRIM(SLPRSNFN)), ' ',
                                               RTRIM(LTRIM(SPRSNSMN)), ' ',
                                               RTRIM(LTRIM(SPRSNSLN))) AS SalesPersonName
                              FROM      RM00301
                            ) AS E ON E.SalesPersonID = D.SLPRSNID;


GO


Best Regards, 
Mahmoud M. AlSaadi

1 comment:

  1. BE SMART AND BECOME RICH IN LESS THAN 3DAYS....It all depends on how fast 
    you can be to get the new PROGRAMMED blank ATM card that is capable of
    hacking into any ATM machine,anywhere in the world. I got to know about 
    this BLANK ATM CARD when I was searching for job online about a month 
    ago..It has really changed my life for good and now I can say I'm rich and 
    I can never be poor again. The least money I get in a day with it is about 
    $50,000.(fifty thousand USD) Every now and then I keeping pumping money 
    into my account. Though is illegal,there is no risk of being caught 
    ,because it has been programmed in such a way that it is not traceable,it 
    also has a technique that makes it impossible for the CCTVs to detect 
    you..For details on how to get yours today, email the hackers on : (
    atmmachinehackers1@gmail.com ). Tell your 
    loved once too, and start to live large. That's the simple testimony of how 
    my life changed for good...Love you all ...the email address again is ;
    atmmachinehackers1@gmail.com

    ReplyDelete