Outgoing payment query assistance.

Hi experts,
Can you please assist me with a query that addresses my request.
My request is, during the outgoing payment process in the payment means we choose a G/L account.
I want the query to show the G/L account code and it's corresponding name whether check or cash or bank transfer.
Please this query is urgent and I need help.
Regards
Justice

Hi Justice,
I am not able to Understand Correct Requirement but Please check below Query which will give you All Modes of Account and Account Name. Please check below
SELECT T0.[DocNum], T0.[DocDate], T1.[CheckAct] AS Check_Account, T2.[AcctName] AS Check_Account_Name, T0.[CashAcct] AS Cash_Account, T3.[AcctName] AS Cash_Account_Name, T0.[TrsfrAcct] AS Transfer_Account, T4.[AcctName] AS Transfer_Account_Name FROM OVPM T0  LEFT JOIN VPM1 T1 ON T0.[DocEntry] = T1.[DocNum] LEFT JOIN OACT T2 ON T1.[CheckAct] = T2.[AcctCode] LEFT JOIN OACT T3 ON T0.[CashAcct] = T3.[AcctCode] LEFT JOIN OACT T4 ON T0.[TrsfrAcct] = T4.[AcctCode]
Hope this help
Regards:::::
Atul Chakraborty

Similar Messages

  • AP Outgoing Payment Query with Crystal Report

    Hi Experts, I'm trying to make query for AP Outgoing Payment followings. However, I couldn't get result of Outgoing Payment Number, TrsfrSum, CashSum, CheckSum. Is anyone could advise for this matter? Thanks,
    SELECT
    T0.DocDate as 'Posting Date',
    T0.DocNum as 'AP Invoice Number',
    T0.CardName as 'Supplier Name',
    T0.DocDate as 'Payment Date',
    T1.DocNum as 'Outgoing Payment Number ',
    T0.DocTotal as 'AP Invoice Total',
    (T0.[DocTotal] - T0.[PaidToDate]) as 'AP Sum',
    CASE
    WHEN T1.TrsfrSum > T0.DocTotal THEN T0.PaidToDate
    ELSE T1.TrsfrSum
    END AS 'TrsfrSum',
    CASE
    WHEN T1.CashSum > T0.DocTotal THEN T0.PaidToDate
    ELSE T1.CashSum
    END AS 'CashSum',
    CASE
    WHEN T1.CheckSum > T0.DocTotal THEN T0.PaidToDate
    ELSE T1.CheckSum
    END AS 'CheckSum',
    CASE
    WHEN T1.CreditSum > T0.DocTotal THEN T0.PaidToDate
    ELSE T1.CreditSum
    END AS 'CreditSum',
    CASE
    WHEN T1.TrsfrSum > T0.DocTotal THEN T0.PaidToDate
    ELSE T1.TrsfrSum
    END  'Paid To Date',
    T2.CheckNum as 'Cheque Number'
    FROM OPOR T0
    LEFT JOIN OVPM T1 ON T0.ReceiptNum = T1.DocEntry
    LEFT JOIN VPM1 T2 ON T1.DocNum = T2.DocNum
    Left Join OSLP T3 ON T3.SlpCode= T0.SlpCode
    UNION ALL
    SELECT
    T0.DocDate as 'Posting Date',
    T0.DocNum as 'AP Invoice Number',
    T0.CardName as 'Supplier Name',
    T0.DocDate as 'Payment Date',
    T1.DocNum as 'Outgoing Payment Number ',
    T0.DocTotal * -1 as 'AP Invoice Total',
    T0.PaidToDate * -1 as 'AP Sum',
    CASE
    WHEN T1.TrsfrSum > T0.DocTotal THEN T0.PaidToDate
    ELSE T1.TrsfrSum
    END AS 'TrsfrSum',
    CASE
    WHEN T1.CashSum > T0.DocTotal THEN T0.PaidToDate
    ELSE T1.CashSum
    END AS 'CashSum',
    CASE
    WHEN T1.CheckSum > T0.DocTotal THEN T0.PaidToDate
    ELSE T1.CheckSum
    END AS 'CheckSum',
    CASE
    WHEN T1.CreditSum > T0.DocTotal THEN T0.PaidToDate
    ELSE T1.CreditSum
    END AS 'CreditSum',
    CASE
    WHEN T1.TrsfrSum > T0.DocTotal THEN T0.PaidToDate
    ELSE T1.TrsfrSum
    END  'Paid To Date',
    T2.CheckNum as 'Cheque Number'
    FROM ORPC T0
    LEFT JOIN OVPM T1 ON T0.ReceiptNum = T1.DocEntry
    LEFT JOIN VPM1 T2 ON T1.DocNum = T2.DocNum
    Left Join OSLP T3 ON T3.SlpCode= T0.SlpCode
    ORDER BY 'CreditSum', 'CheckSum', 'CashSum', 'TrsfrSum', 'AP Sum'

    Hi Stephan,
    Try:
    SELECT
    T0.DocDate as 'Posting Date',
    'AP Invoice' as 'Type',
    T0.DocNum as 'AP Number',
    T0.CardName as 'Supplier Name',
    T0.DocDate as 'Payment Date',
    T1.DocNum as 'Outgoing Payment Number ',
    T0.DocTotal as 'AP Invoice/CR Total',
    (T0.DocTotal - T0.PaidToDate) as 'AP Sum',
    CASE
    WHEN T1.TrsfrSum > T0.DocTotal THEN T0.PaidToDate
    ELSE T1.TrsfrSum
    END AS 'TrsfrSum',
    CASE
    WHEN T1.CashSum > T0.DocTotal THEN T0.PaidToDate
    ELSE T1.CashSum
    END AS 'CashSum',
    CASE
    WHEN T1.CheckSum > T0.DocTotal THEN T0.PaidToDate
    ELSE T1.CheckSum
    END AS 'CheckSum',
    CASE
    WHEN T1.CreditSum > T0.DocTotal THEN T0.PaidToDate
    ELSE T1.CreditSum
    END AS 'CreditSum',
    CASE
    WHEN T1.TrsfrSum > T0.DocTotal THEN T0.PaidToDate
    ELSE T1.TrsfrSum
    END 'Paid To Date',
    T2.CheckNum as 'Cheque Number'
    FROM OPCH T0
    LEFT JOIN OVPM T1 ON T0.ReceiptNum = T1.DocEntry
    LEFT JOIN VPM1 T2 ON T1.DocNum = T2.DocNum
    Left Join OSLP T3 ON T3.SlpCode= T0.SlpCode
    UNION ALL
    SELECT
    T0.DocDate as 'Posting Date',
    'AP Credit Memo',
    T0.DocNum as 'AP Number',
    T0.CardName as 'Supplier Name',
    T0.DocDate as 'Payment Date',
    T1.DocNum as 'Outgoing Payment Number ',
    T0.DocTotal * -1 ,
    T0.PaidToDate * -1 as 'AP Sum',
    CASE
    WHEN T1.TrsfrSum > T0.DocTotal THEN T0.PaidToDate
    ELSE T1.TrsfrSum
    END AS 'TrsfrSum',
    CASE
    WHEN T1.CashSum > T0.DocTotal THEN T0.PaidToDate
    ELSE T1.CashSum
    END AS 'CashSum',
    CASE
    WHEN T1.CheckSum > T0.DocTotal THEN T0.PaidToDate
    ELSE T1.CheckSum
    END AS 'CheckSum',
    CASE
    WHEN T1.CreditSum > T0.DocTotal THEN T0.PaidToDate
    ELSE T1.CreditSum
    END AS 'CreditSum',
    CASE
    WHEN T1.TrsfrSum > T0.DocTotal THEN T0.PaidToDate
    ELSE T1.TrsfrSum
    END 'Paid To Date',
    T2.CheckNum as 'Cheque Number'
    FROM ORPC T0
    LEFT JOIN OVPM T1 ON T0.ReceiptNum = T1.DocEntry
    LEFT JOIN VPM1 T2 ON T1.DocNum = T2.DocNum
    Left Join OSLP T3 ON T3.SlpCode= T0.SlpCode
    ORDER BY 'CreditSum', 'CheckSum', 'CashSum', 'TrsfrSum', 'AP Sum'
    Thanks,
    Gordon

  • Outgoing payment query

    Hello everybody,
    Is there any way to calculate the duedate of a check I want to create in outgoing payment object according to some a/p invoices that had marked in the outgoing payment.
    I want to calculate duadate of three a/p invoices. every invoice has a diferent total value and different duedate.
    I tried to create a FMS with a UDF , but I don't know how to get the marked records from VPM2 before the outgoing payment is saved.
    Thank you all,
    Joseph

    Hi Joseph,
                   you can try this query and see if you get the desired result. Let me know.
    select T0.DocNum, T0.DocDate, T0.CardCode, T0.CardName, T1.CheckNum,T1.DueDate 'Check due date', T1.CheckSum, T1.BankCode + ' ' + T1.Branch + ' ' + T1.AcctNum Account
    from ovpm T0 inner join vpm1 T1 on T1.DocNum = T0.DocEntry
    inner join jdt1 T2 on T2.TransId = T0.TransId
    inner join dsc1 T3 on T3.BankCode = T1.BankCode and T3.Branch = T1.Branch and T3.Account = T1.AcctNum
    where T0.Canceled = 'N'
    and T2.Ref3Line = T1.CheckNum
    and T2.ExtrMatch = 0
    and T2.Account = T3.GLAccount
    order by T0.DocNum, T1.CheckNum
                   however, this query will get you a list of all the outgoing payments done!!
    Best Regards,
    Joseph Antony

  • Outgoing Payment Query with GL Name for all payment means

    Hi all
    Thanks a lot for the earlier help of Nagarajan! 
    I managed to improve this Query now the only problem is the Bank Transfer Bank account name does not appear on the same line as the Bank transfer amount.
    Please help to test execute on your Demo Database and let me know the correction.
    DECLARE @REPORTBY AS NVARCHAR(1)  
    /* SELECT FROM [dbo].[OFPR] T0 */    
    /* WHERE */ DECLARE @DATEFROM datetime   
    SET @DATEFROM =/* T0.F_RefDate */'[%0]'    
    /* SELECT FROM [dbo].[OFPR] T1 */    
    /* WHERE */ DECLARE @DATETO datetime    
    SET @DATETO=/* T1.T_RefDate */'[%1]'    
    SET @DATEFROM = '20140101'  
    SET @DATETO = '20140131'  
    SELECT   ISNULL(T01.BeginStr,'') + ' ' + CONVERT(NVARCHAR(20), T0.DOCNUM) [DOCUMENT NO.] 
      , T0.DocDate [DATE]
      , T0.CardCode [CARDCODE]
      , T0.CardName [NAME]
      , T0.DocCurr
      , T0.DocTotal [TOTAL incl. GST]
      , T0.DocTotalFC  [TOTAL (FC) incl. GST]
      , T0.Comments [Remarks]
      , T0.JrnlMemo
      , T0.CounterRef [Ref 2]
      /*BANK CHARGES*/
      , T0.BcgSum [Bank Charges], T0.BcgSumFC [Bank Charges (FC)]
      /*CHECK PAYMENT*/
      , T2.CheckAct, T4.AcctName, T2.Currency [Check Curr.]
      , T2.CheckSum, T0.CheckSumFC 
      , T2.AcctNum, T2.BankCode
      /*BANK TRANSFER*/
      , T0.TrsfrAcct, T4.AcctName, T0.TrsfrSum, T0.TrsfrSumFC 
      , T0.CashAcct, T6.AcctName, T0.CashSum, T0.CashSumFC 
      /*CREDIT CARD/ADJUSTMENT PAYMENT*/
      , T03.CardName [ADJ. TYPE], T3.CreditAcct [ADJ. ACC.], T5.AcctName, T0.CreditSum, T0.CredSumFC
      /*PAYMENT ON ACCOUNT*/
      , T0.PayNoDoc, T0.NoDocSum, T0.NoDocSumFC
      , T0.DocRate 
      , T0.DiffCurr 
    FROM OVPM T0   
    LEFT OUTER JOIN NNM1 T01 ON T0.ObjType = T01.ObjectCode AND T0.Series = T01.Series   
    LEFT OUTER JOIN VPM1 T2 ON T0.DocNum = T2.DocNum   
    LEFT OUTER JOIN (VPM3 T3 LEFT OUTER JOIN OCRC T03 ON T3.CreditCard = T03.CreditCard)  
    ON T0.DocNum = T3.DocNum left join OACT t4 on T2.CheckAct = T4.AcctCode left join OACT t5 on T5.AcctCode = t3.creditacct left join OACT T6 on t0.CashAcct = t6.AcctCode 
    WHERE T0.DocType = 'C'  
    AND T0.DOCDATE BETWEEN @DATEFROM AND @DATETO   
    UNION ALL   
    SELECT   ISNULL(T01.BeginStr,'') + ' ' + CONVERT(NVARCHAR(20), T0.DOCNUM) [DOCUMENT NO.] 
      , T0.DocDate [DATE]
      , T0.CardCode [CARDCODE]
      , T0.CardName [PAY-TO NAME]
      , T0.DocCurr
      , T0.DocTotal [TOTAL incl. GST]
      , T0.DocTotalFC  [TOTAL (FC) incl. GST]
      , T0.Comments [Remarks]
      , T0.JrnlMemo
      , T0.CounterRef [Ref 2]
      /*BANK CHARGES*/
      , T0.BcgSum [Bank Charges], T0.BcgSumFC [Bank Charges (FC)]
      /*CHECK PAYMENT*/
      , T2.CheckAct, T4.AcctName, T2.Currency [Check Curr.]
      , T2.CheckSum, T0.CheckSumFC 
      , T2.AcctNum, T2.BankCode
      /*BANK TRANSFER*/
      , T0.TrsfrAcct, T4.AcctName, T0.TrsfrSum, T0.TrsfrSumFC 
      , T0.CashAcct, T6.AcctName, T0.CashSum, T0.CashSumFC 
      /*CREDIT CARD/ADJUSTMENT PAYMENT*/
      , T03.CardName  [ADJ. TYPE], T3.CreditAcct [ADJ. ACC.], T5.AcctName, T0.CreditSum, T0.CredSumFC
      /*PAYMENT ON ACCOUNT*/
      , T0.PayNoDoc, T0.NoDocSum, T0.NoDocSumFC
      , T0.DocRate 
      , T0.DiffCurr 
    FROM OVPM T0   
    LEFT OUTER JOIN NNM1 T01 ON T0.ObjType = T01.ObjectCode AND T0.Series = T01.Series   
    LEFT OUTER JOIN VPM1 T2 ON T0.DocNum = T2.DocNum   
    LEFT OUTER JOIN (VPM3 T3 LEFT OUTER JOIN OCRC T03 ON T3.CreditCard = T03.CreditCard)  
    ON T0.DocNum = T3.DocNum left join OACT t4 on T2.CheckAct = T4.AcctCode left join OACT t5 on T5.AcctCode = t3.creditacct left join OACT T6 on t0.CashAcct = t6.AcctCode 
    WHERE T0.DocType = 'S'  
    AND T0.DOCDATE BETWEEN @DATEFROM AND @DATETO   
    UNION ALL  
    SELECT  ISNULL(T01.BeginStr,'') + ' ' + CONVERT(NVARCHAR(20), T0.DOCNUM) [DOCUMENT NO.] 
      , T0.DocDate [DATE]
      , T0.CardCode [CARDCODE]
      , T0.CardName [NAME]
      , T0.DocCurr 
      , T0.DocTotal [TOTAL incl. GST]
      , T0.DocTotalFC  [TOTAL (FC) incl. GST]
      , T0.Comments [Remarks]
      , T0.JrnlMemo
      , T0.CounterRef [Ref 2]
      /*BANK CHARGES*/
      , T0.BcgSum [Bank Charges], T0.BcgSumFC [Bank Charges (FC)]
      /*CHECK PAYMENT*/
      , T2.CheckAct, T4.AcctName, T2.Currency
      , T2.CheckSum, T0.CheckSumFC 
      , T2.AcctNum, T2.BankCode
      /*BANK TRANSFER*/
      , T0.TrsfrAcct, T4.AcctName, T0.TrsfrSum, T0.TrsfrSumFC 
      , T0.CashAcct, T6.AcctName, T0.CashSum, T0.CashSumFC 
      /*CREDIT CARD/ADJUSTMENT PAYMENT*/
      , T03.CardName  [ADJ. TYPE], T3.CreditAcct [ADJ. ACC.], T5.AcctName, T0.CreditSum, T0.CredSumFC
      /*PAYMENT ON ACCOUNT*/
      , T0.PayNoDoc 
      , CASE T0.DOCTYPE WHEN 'A' THEN 0 ELSE T0.NoDocSum END [PMNT ON ACC.]
      , CASE T0.DOCTYPE WHEN 'A' THEN 0 ELSE T0.NoDocSumFC END [PMNT ON ACC. (FC)] 
      , T0.DocRate [Payment Rate]
      , T0.DiffCurr 
    FROM OVPM T0   
    LEFT OUTER JOIN NNM1 T01 ON T0.ObjType = T01.ObjectCode AND T0.Series = T01.Series   
    LEFT OUTER JOIN VPM1 T2 ON T0.DocNum = T2.DocNum   
    LEFT OUTER JOIN (VPM3 T3 LEFT OUTER JOIN OCRC T03 ON T3.CreditCard = T03.CreditCard)  
    ON T0.DocNum = T3.DocNum left join OACT t4 on T2.CheckAct = T4.AcctCode left join OACT t5 on T5.AcctCode = t3.creditacct left join OACT T6 on t0.CashAcct = t6.AcctCode 
    WHERE T0.DocType = 'A'  
    AND T0.DOCDATE BETWEEN @DATEFROM AND @DATETO

    Hi,
    Please post your discussion without mentioning member name.
    Try this:
    DECLARE @REPORTBY AS NVARCHAR(1)  
    /* SELECT FROM [dbo].[OFPR] T0 */    
    /* WHERE */ DECLARE @DATEFROM datetime   
    SET @DATEFROM =/* T0.F_RefDate */'[%0]'    
    /* SELECT FROM [dbo].[OFPR] T1 */    
    /* WHERE */ DECLARE @DATETO datetime    
    SET @DATETO=/* T1.T_RefDate */'[%1]'    
    SET @DATEFROM = '20140101'  
    SET @DATETO = '20140131'  
    SELECT   ISNULL(T01.BeginStr,'') + ' ' + CONVERT(NVARCHAR(20), T0.DOCNUM) [DOCUMENT NO.] 
      , T0.DocDate [DATE]
      , T0.CardCode [CARDCODE]
      , T0.CardName [NAME]
      , T0.DocCurr
      , T0.DocTotal [TOTAL incl. GST]
      , T0.DocTotalFC  [TOTAL (FC) incl. GST]
      , T0.Comments [Remarks]
      , T0.JrnlMemo
      , T0.CounterRef [Ref 2]
         /*BANK CHARGES*/
      , T0.BcgSum [Bank Charges], T0.BcgSumFC [Bank Charges (FC)]
      /*CHECK PAYMENT*/
      , T2.CheckAct, T4.[AcctName], T2.Currency [Check Curr.]
      , T2.CheckSum, T0.CheckSumFC 
      , T2.AcctNum, T2.BankCode
      /*BANK TRANSFER*/
      , T0.TrsfrAcct,T6.[AcctName],T0.TrsfrSum, T0.TrsfrSumFC 
      , T0.CashAcct,T4.[AcctName], T0.CashSum, T0.CashSumFC 
      /*CREDIT CARD/ADJUSTMENT PAYMENT*/
      , T03.CardName [ADJ. TYPE], T3.CreditAcct [ADJ. ACC.], T5.[AcctName],T0.CreditSum, T0.CredSumFC
      /*PAYMENT ON ACCOUNT*/
      , T0.PayNoDoc, T0.NoDocSum, T0.NoDocSumFC
      , T0.DocRate 
      , T0.DiffCurr 
    FROM OVPM T0   
    LEFT OUTER JOIN NNM1 T01 ON T0.ObjType = T01.ObjectCode AND T0.Series = T01.Series   
    LEFT OUTER JOIN VPM1 T2 ON T0.DocNum = T2.DocNum   
    LEFT OUTER JOIN (VPM3 T3 LEFT OUTER JOIN OCRC T03 ON T3.CreditCard = T03.CreditCard)  
    ON T0.DocNum = T3.DocNum  left join OACT t4 on T2.CheckAct = T4.AcctCode left join OACT t5 on  T5.AcctCode = t3.creditacct left join  OACT T6 on t0.CashAcct = t6.AcctCode
    WHERE T0.DocType = 'C'  
    AND T0.DOCDATE BETWEEN @DATEFROM AND @DATETO 
    union all
    SELECT   ISNULL(T01.BeginStr,'') + ' ' + CONVERT(NVARCHAR(20), T0.DOCNUM) [DOCUMENT NO.] 
      , T0.DocDate [DATE]
      , T0.CardCode [CARDCODE]
      , T0.CardName [NAME]
      , T0.DocCurr
      , T0.DocTotal [TOTAL incl. GST]
      , T0.DocTotalFC  [TOTAL (FC) incl. GST]
      , T0.Comments [Remarks]
      , T0.JrnlMemo
      , T0.CounterRef [Ref 2]
         /*BANK CHARGES*/
      , T0.BcgSum [Bank Charges], T0.BcgSumFC [Bank Charges (FC)]
      /*CHECK PAYMENT*/
      , T2.CheckAct, T4.[AcctName], T2.Currency [Check Curr.]
      , T2.CheckSum, T0.CheckSumFC 
      , T2.AcctNum, T2.BankCode
      /*BANK TRANSFER*/
      , T0.TrsfrAcct,T6.[AcctName], T0.TrsfrSum, T0.TrsfrSumFC 
      , T0.CashAcct,T4.[AcctName], T0.CashSum, T0.CashSumFC 
      /*CREDIT CARD/ADJUSTMENT PAYMENT*/
      , T03.CardName [ADJ. TYPE], T3.CreditAcct [ADJ. ACC.], T5.[AcctName],T0.CreditSum, T0.CredSumFC
      /*PAYMENT ON ACCOUNT*/
      , T0.PayNoDoc, T0.NoDocSum, T0.NoDocSumFC
      , T0.DocRate 
      , T0.DiffCurr 
    FROM OVPM T0   
    LEFT OUTER JOIN NNM1 T01 ON T0.ObjType = T01.ObjectCode AND T0.Series = T01.Series   
    LEFT OUTER JOIN VPM1 T2 ON T0.DocNum = T2.DocNum   
    LEFT OUTER JOIN (VPM3 T3 LEFT OUTER JOIN OCRC T03 ON T3.CreditCard = T03.CreditCard)  
    ON T0.DocNum = T3.DocNum  left join OACT t4 on T2.CheckAct = T4.AcctCode left join OACT t5 on  T5.AcctCode = t3.creditacct left join  OACT T6 on t0.CashAcct = t6.AcctCode
    WHERE T0.DocType = 'S'  
    AND T0.DOCDATE BETWEEN @DATEFROM AND @DATETO 
    union all
    SELECT   ISNULL(T01.BeginStr,'') + ' ' + CONVERT(NVARCHAR(20), T0.DOCNUM) [DOCUMENT NO.] 
      , T0.DocDate [DATE]
      , T0.CardCode [CARDCODE]
      , T0.CardName [NAME]
      , T0.DocCurr
      , T0.DocTotal [TOTAL incl. GST]
      , T0.DocTotalFC  [TOTAL (FC) incl. GST]
      , T0.Comments [Remarks]
      , T0.JrnlMemo
      , T0.CounterRef [Ref 2]
         /*BANK CHARGES*/
      , T0.BcgSum [Bank Charges], T0.BcgSumFC [Bank Charges (FC)]
      /*CHECK PAYMENT*/
      , T2.CheckAct, T4.[AcctName], T2.Currency [Check Curr.]
      , T2.CheckSum, T0.CheckSumFC 
      , T2.AcctNum, T2.BankCode
      /*BANK TRANSFER*/
      , T0.TrsfrAcct, T6.[AcctName], T0.TrsfrSum, T0.TrsfrSumFC 
      , T0.CashAcct,T4.[AcctName], T0.CashSum, T0.CashSumFC 
      /*CREDIT CARD/ADJUSTMENT PAYMENT*/
      , T03.CardName [ADJ. TYPE], T3.CreditAcct [ADJ. ACC.], T5.[AcctName],T0.CreditSum, T0.CredSumFC
      /*PAYMENT ON ACCOUNT*/
      , T0.PayNoDoc, T0.NoDocSum, T0.NoDocSumFC
      , T0.DocRate 
      , T0.DiffCurr 
    FROM OVPM T0   
    LEFT OUTER JOIN NNM1 T01 ON T0.ObjType = T01.ObjectCode AND T0.Series = T01.Series   
    LEFT OUTER JOIN VPM1 T2 ON T0.DocNum = T2.DocNum   
    LEFT OUTER JOIN (VPM3 T3 LEFT OUTER JOIN OCRC T03 ON T3.CreditCard = T03.CreditCard)  
    ON T0.DocNum = T3.DocNum  left join OACT t4 on T2.CheckAct = T4.AcctCode left join OACT t5 on  T5.AcctCode = t3.creditacct left join  OACT T6 on t0.CashAcct = t6.AcctCode
    WHERE T0.DocType = 'A'  
    AND T0.DOCDATE BETWEEN @DATEFROM AND @DATETO 
    Thanks & Regards,
    Nagarajan

  • Query for outgoing payment

    Hi All,
             i need a report for the outgoing payment where i could display the account details, the doc remarks, row total and also the payment mode, whther by cash or by cheque. I have a query but i dont know how to get the mode of payment and also how to get the row total??
    SELECT T0.[DocNum], T0.[DocDate], T1.[AcctName], T1.[Descrip], T0.[CashAcct], T0.[CheckAcct] FROM OVPM T0  INNER JOIN VPM4 T1 ON T0.DocEntry = T1.DocNum WHERE T0.[DocDate]  = [%0]
    How do i get the row total and the mode of payment incorporated in the query? apart from the doc date, can i also get a selection criteria for the mode of payment as well?? Can anyone please suggest a better query??
    Thanks in advance,
    Joseph

    Try this one to start:
    SELECT T0.DocNum, T0.DocDate, T1.AcctName, T1.Descrip, T0.CashAcct, T0.CheckAcct, T0.DocTotal, CASE WHEN T0.CashSum > 0 THEN 'Cash' WHEN T0.CreditSum > 0 THEN 'CC' WHEN T0.TrsfrSum > 0 THEN 'WIRE' ELSE 'Check' END AS 'Mode'
    FROM dbo.OVPM T0
    LEFT JOIN dbo.VPM4 T1 ON T0.DocEntry = T1.DocNum
    WHERE T0.DocDate = [%0\] AND T0.JrnlMemo != 'Cancelled'
    Thanks,
    Gordon

  • Query for Journal Entry as Incoming/Outgoing Payment

    Hi all,
    I need a query that returns all journal entries that are incoming/outgoing payments.
    I have not found anything in the journal entries tables that marks it as a payment.
    thanks,
    Lucas.

    Hi Lucas,
    I am afraid 2 queries could be more meaningful. That might be more convenient:
    Incoming:
    SELECT T0.TransId as [Journal Entry#],
    T0.RefDate as [Posting Date],
    T0.BaseRef as [Incoming Payment #],
    Isnull(T1.AcctName,T0.ShortName) as [GL Account Name/Vendor Code],
    T0.Credit
    from JDT1 T0
    Left JOIN OACT T1 ON T1.AcctCode= T0.ShortName
    where T0.TransType=24 AND
    T0.Credit > 0
    Order By T0.RefDate
    Outgoing:
    SELECT T0.TransId as [Journal Entry#],
    T0.RefDate as [Posting Date],
    T0.BaseRef as [Outgoing Payment #],
    Isnull(T1.AcctName,T0.ShortName) as [GL Account Name/Vendor Code],
    T0.debit
    from JDT1 T0
    Left JOIN OACT T1 ON T1.AcctCode= T0.ShortName
    where T0.TransType=46 AND
    T0.debit > 0
    Order By T0.RefDate
    Thanks,
    Gordon

  • Outgoing payment UDF Query

    Hi experts,
    i kindly need a query that when an outgoing payment is made with doctype (S OR C),
    the invoice numatcard and invoice remarks will be picked into the two UDF's created.
    Urgent help will be appreciated.
    Regards
    Justice

    Hi Justice,
    Create 2 UDF at Row Level in Outgoing payment, First for AP Invoice Remark and Second for AP Invoice NumAtCard.
    Then Place below two Query in Respective Columns..
    This FMS is for Remarks
    Select T0.[Comments] From OPCH T0 Where T0.DocNum = $[$20.1.0]
    This FMS is for NumAtCard
    Select  T0.[NumAtCard]  From OPCH T0 Where T0.DocNum = $[$20.1.0]
    After putting both FMS in Respective Column then Make these to FMS on Auto Refresh on Customer Name.
    Hope this helps
    Regards::::
    Atul Chakraborty

  • Query print layout on Incoming/Outgoing Payment

    Hi, i'm working on  the QPL, and i've done doing the incoming and outgoing payment for customer/vendor... but when i have the 'payment on account'  it doesn't show anything...
    i check the query, everything is alright... the layout works fine with other outgoing payment which is not payment on account. It just doesn't work at all using the same query and layout for document which has payment on account...
    what should i do?
    Thnx for help...
    Martin

    SELECT T0.DocNum, T0.DocDate, T0.DocCur, T0.NumAtCard,
    T0.DocTotal,  T0.DocTotalFC,T1.DocNum, T1.CardCode,
    T1.CardName, T1.DocDate, T1.Comments,
    T1.TrsfrRef as 'Cheque No', T2.BankCode' '
    T2.AcctNum as 'Bank Code', T2.CheckSum, T0.Address,
    T2.CheckNum, T2.Currency , T3.Phone1, T3.CntctPrsn, T0.PaidSum, T0.PaidSumFc, T1.DocTotal, T1.DocTotalFc,
    T4.SumApplied, T4.AppliedFC
    FROM OVPM T1 LEFT OUTER JOIN VPM1 T2 ON
         (T2.DocNum = T1.DocNum)
          LEFT OUTER JOIN VPM2 T4 ON
         (T4.DocNum = T1.DocNum)
          LEFT OUTER JOIN OPCH T0 ON
         (T0.DocNum = T4.DocEntry)
          LEFT OUTER JOIN OCRD T3 ON
         (T3.CardCode = T0.CardCode)
    WHERE T1.DocNum = [%0] AND T4.Invtype = '18'
    Union
    SELECT T0.DocNum, T0.DocDate, T0.DocCur, T0.NumAtCard,
    -(T0.DocTotal),  -(T0.DocTotalFC),T1.DocNum, T1.CardCode,
    T1.CardName, T1.DocDate, T1.Comments,
    T1.TrsfrRef as 'Cheque No', T2.BankCode' '
    T2.AcctNum as 'Bank Code', T2.CheckSum, T0.Address,
    T2.CheckNum, T2.Currency , T3.Phone1, T3.CntctPrsn, T0.PaidSum, T0.PaidSumFc, T1.DocTotal, T1.DocTotalFc,
    T4.SumApplied, T4.AppliedFC
    FROM OVPM T1 LEFT OUTER JOIN VPM1 T2 ON
         (T2.DocNum = T1.DocNum)
          LEFT OUTER JOIN VPM2 T4 ON
         (T4.DocNum = T1.DocNum)
          LEFT OUTER JOIN ORPC T0 ON
         (T0.DocNum = T4.DocEntry)
          LEFT OUTER JOIN OCRD T3 ON
         (T3.CardCode = T0.CardCode)
    WHERE T1.DocNum = [%0] AND T4.Invtype = '19'
    Yea, it doesn't show me anything...except the free text document field in the layout... others like formula, database and variable didn't appear...
    i suspect that there's something goes wrong when i do ' payment on account'
    thnx for response...

  • Query of Outgoing Payments Monthwise

    Hi Gurus,
    I have a written a simple query which gives me a summarized outgoing payment list group by vendor with date range. Query is working fine, now I want that report in monthwise (column) format from the given date range. Cau u help me how do I write this ...
    Select T0.CardCode, T0.CardName, T1.GroupCode,T2.GroupName, sum(T0.DocTotal) as 'Total Sum'
    from OVPM T0, OCRD T1, OCRG T2
    where T0.CardCode = T1.CardCode and T1.GroupCode =T2.GroupCode and T0.DocDate>=[%0] and T0.DocDate <=[%1]
    Group by T1.GroupCode, T2.GroupName
    What I want is : If I give Date range of  From 01-08-2011 to 31-10-2011 then the out come will be like as
    Group Name      August      September     October
    Group A              100               150              125
    Group B              200               150                0
    Group C              500               150               200
    Please help me find the way.
    Regards,
    SK

    Try this..
    select p.GroupCode,p.GroupName,
    sum([1]) as [Jan],
    sum([2]) as [Feb],
    sum([3]) as [Mar],
    sum([4]) as [Apr],
    sum([5]) as [May],
    sum([6]) as [Jun],
    sum([7]) as [Jul],
    sum([8]) as [Aug],
    sum([9]) as [Sep],
    sum([10]) as [Oct],
    sum([11]) as [Nov],
    sum([12]) as [Dec]
      from(Select
    T0.CardCode, T0.CardName,
    T1.GroupCode,T2.GroupName,
    (T0.DocTotal) as 'Total',MONTH(T0.Docdate)as month
    from OVPM T0, OCRD T1, OCRG T2
    where T0.CardCode = T1.CardCode and T1.GroupCode =T2.GroupCode
    and T0.DocDate>='[%0]' and T0.DocDate <='[%1]'
    )S
    PIVOT  (sum(Total) FOR [month] IN
    ([4],[5],[6],[7],[8],[9],[10],[11],[12],[1],[2],[3])) P
    group by p.GroupCode,p.GroupName
    ORDER BY P.[GroupCode]

  • Approval Query for Outgoing Payment

    Hi All Experts,
    I have to Create Approval for Outgoing Payment where payment means is Cash,Cheque or Bank Transfer but not Credit Card.
    In other words approval should be raised for all payment means other than Credit card payment means.
    For which I have Created Query as follows
    select Distinct 'true' FROM dbo.OVPM T0
    Left join dbo.VPM3 T1 on T0.DocEntry=T1.Docnum
    WHERE  T0.CreditSum=0 And T1.CreditAcct is null
    payments goes for approval but Credit Card payment also goes for Approval which is not required.
    Please Help me to Correct the Query.
    Regards,
    Gayatri Shukla.

    Hi,
    Little modification to your query. Try this.
    select Distinct 'true' FROM dbo.OVPM T0
    Left join dbo.VPM3 T1 on T0.DocEntry=T1.Docnum
    WHERE  T0.CreditSum = 0
    Regards,
    Amrut Sabnis.

  • Outgoing Payment on Account Report?

    Hello Experts,
    i have a question i want to ask you for you for your urgent assistance.
    A customer wants to see the G/L account code and Name on the outgoing payment report when they do payments on doctype='A', that is on account.
    I want someone to help me with a query that will automatically pick the G/L account code and name on a UDF i have created on the title of the payments.
    So that i use the OVPM to bring out the Account code and name.
    Please urgent help is needed.
    Thanks

    Hi,
    I have tried with FMS to get account code and name, not getting desired result. It may not be possible due to limitation of FMS.
    are you looking for this?
    Thanks & Regards,
    Nagarajan

  • Daily Outgoing Payment Report

    Hello,
    We have a Query shown below that allows us to view Incoming payments made each day to an invoice.
    SELECT T2.CardCode [BP Acct#], T2.CardName [BP Company Name], T2.DocNum [Invoice #], T1.DocDate [Receipt Date], T2.DocTotal [Invoice Sum], T0.DcntSum, T0.SumApplied AS 'Paid to Invoice' FROM [dbo].[RCT2] T0 INNER JOIN [dbo].[ORCT] T1 ON T1.DocNum = T0.DocNum INNER JOIN [dbo].[OINV] T2 ON T2.DocEntry = T0.DocEntry WHERE T1.DocDate = '[%0]'
    We would like to modify this query so that the last column of information shows the Outgoing payments made.  Meaning, any amount of money that we owe a customer and therefore apply to their outstanding invoice or as a credit memo, etc.
    Can someone show us how to do this modification?
    Thanks!

    Mike,
    Try this, this is your query, and it works perfect on my DB
    1) SELECT T2.CardCode BP, T2.CardName CompanyName, T2.DocNum Invoice, T1.DocDate ReceiptDate, T2.DocTotal InvoiceSum, T0.DcntSum, T0.SumApplied AS 'Credit to Invoice'
    FROM dbo.VPM2 T0 INNER JOIN dbo.OVPM T1 ON T1.DocNum = T0.DocNum INNER JOIN dbo.OPCH T2 ON T2.DocEntry = T0.DocEntry
    if this query give you results, the problem could it be in the WHERE clause "where T0.DocDate = '[%0]'
    Because you are not inserting a valid value in the '[%0]', maybe you are writing a date that doesnt existe in the "Existing Values" buttom.
    Slds,.
    Esteban Martinez

  • Outgoing Payment Report - Bank Transfer

    Does SAP Business One have a built in "Outgoing Payments report" that would display payments made via bank transfers?
    Or the only option is to create a query?
    Thanks,

    Hi
    How about checking at forum too.
    Here is one of the query
    Reg: Bank Transfer Repor
    Thank you
    Bishal

  • Outgoing Payment Remarks

    Good Evening!
    I want to have a formatted search in the remarks of the outgoing payment to be the Invoice Document Number + the remarks of the invoice being paid (both if outgoing payment is charged to customer and vendor)
    Example
    Outgoing payment is 40,000 as payment for:
    PV20090701        Replenishment of petty cash fund           10000
    PV20090701        Office supplies                                         30000
    What i want is for the remarks to be
    PV20090701 ,Replenishment of petty cash fund  ; PV20090701,Office supplies
    What will my formatted search be in order to come up with this result.
    Thanks.

    hello
    do one thing  in the remarks of outgoing payments u give  the formatted search query as'' SELECT  T0.[DocNum] ,T0.[Comments] FROM OPCH T0  INNER JOIN PCH1 T1 ON T0.DocEntry = T1.DocEntry WHERE T0.[DocNum] =[%0]'' and u can select for a particular invoice now u can find the remaks forparticular invioce if the problem is solved pls close the thread
    regards
    jenny

  • Outgoing Payments Series numbering

    Hi experts,
    I have a customer who has a document numbering for payments documents as eg 2014/100001 and 2015/100001.
    When I try to preview these reports with same document numbers but different series i.e. 2014 and 2015, the preview brings the 2014 details and also the total amount it brings both 2015 and 2014 totals.
    I tried to edit the report by changing the sub reports link taking away the OVPM.Docnum parameter and replaced it with OVPM.Docentry.
    When I try to preview it brings one total per the document but the details part is not coming and the payment means details does not come at all.
    Has anyone come across this instance I am describing?
    If yes I want someone to help me out with an edited outgoing payment crystal report that addresses these repeated document numbers with different series.
    This request is very urgent and a solved help will be much appreciated.
    Please assist with a worked on default outgoing payment crystal report that addresses the scenario described.
    Regards
    Justice

    Hi Justice
    Primary Key in OVPM is DocEntry
    Primary key in all Child tables of VPM is DocNum
    Please try in this and revert.
    To Avoid this issue in future, you can give first document number in 2016 as 160001 and in 2017 as 170001.
    Thanks
    Unnikrishnan

Maybe you are looking for

  • ITunes 6.0.4 in Tiger 10.4.11 won't open

    (I also posted this in the iTunes section, but I'm getting no response there.) I recently began using a G5 iMac with 10.4. Today I tried to open iTunes 6.0.4 for the first time and after the user agreement page I get an alert with no text and and "ok

  • Crashing issues not solved with extensive troubleshooting... Please help!

    Hello community,  I'm still in the process of trying everything to resolve these issues, be it hardware related, software... Or both. Here's an extensive account of the troubles I have been experiencing and maybe someone here who has encountered a si

  • JAVA CLIENT PROXY

    Hi All, I am working on java client proxies. Can anybody give me step by step approach for creating application java class using proxy and bean classes generated from my outbound interfaces? I want to create EJB module project and EAR project,I have

  • Can't send mail on any servers

    Hi - I am able to receive mail but not send it. I have 4 smtp servers and none of them will work. I have read everything I could find to fix this. I have deleted the servers using the edit server option and re-entered them. Does anyone have any idea

  • Project Accounting Systems Module

    Can anyone explain the differences between project accounting system and project sytems module.  Are they both the same module?  Also, where can I find all the financial data against the project including revenue, profit etc.