GL Coding for an On Account and Unapplied Receipts

How do I get the GL code to an unapplied and/or on account receipt? It's the ar_distributions table that is messing with me I think.
This is giving me two lines of code, one of which I want, the other is not the one I want.
SELECT /*+ parallel(cash,4) parallel(cashh,4) */
'On Account' acct_type
, cash.receipt_number
, trunc(cash.creation_date) creation_date
, TRUNC(cash.last_update_date) last_update_date
, SUM(DECODE(araa.status,'ACC'
,DECODE(UPPER('USD'),NULL,
ROUND(araa.acctd_amount_applied_from,2),araa.amount_applied),0)) amount
, araa.acctd_amount_applied_from
, araa.amount_applied
, dist.source_id
, dist.acctd_amount_cr
, dist.acctd_amount_dr
, dist.source_type
, dist.source_type
, dist.currency_code
, dist.creation_date
, dist.last_update_date
, dist.line_id
, dist.location_segment_id
, dist.org_id
, gl.segment1
, gl.segment2
, gl.segment3
, gl.segment4
, gl.segment5
, gl.segment6
FROM ar.ar_cash_receipts_all cash
, ar.ar_cash_receipt_history_all cashh
, ar.ar_payment_schedules_all pay
, ar.ar_receivable_applications_all araa
, ar.ar_distributions_all dist
, gl.gl_code_combinations gl
WHERE cash.cash_receipt_id = araa.cash_receipt_id
AND pay.payment_schedule_id = araa.payment_schedule_id
AND cash.cash_receipt_id = pay.cash_receipt_id
AND cashh.cash_receipt_id = cash.cash_receipt_id
AND cashh.cash_receipt_history_id(+) = dist.source_id
AND dist.code_combination_id = gl.code_combination_id(+)
AND NVL(cash.confirmed_flag,'Y') = 'Y'
AND NVL(araa.confirmed_flag,'Y') = 'Y'
AND cashh.first_posted_record_flag = 'Y'
AND pay.status = 'OP'
AND araa.status = 'ACC'
AND cash.receipt_number = '&RECNUM'
AND dist.source_type = 'UNAPP'
HAVING SUM(DECODE(araa.status,'ACC'
,DECODE(UPPER('USD'),NULL
,ROUND((araa.acctd_amount_applied_from * NVL(cash.exchange_rate, 1)),2)
,araa.acctd_amount_applied_from),0)) != 0
GROUP BY cash.receipt_number, cash.creation_date, cash.last_update_date, pay.amount_applied, dist.source_id , dist.acctd_amount_cr
, dist.acctd_amount_dr, araa.acctd_amount_applied_from, araa.amount_applied
, gl.segment1, gl.segment2, gl.segment3, gl.segment4, gl.segment5, gl.segment6
, dist.source_type
, dist.source_type, dist.currency_code, dist.creation_date, dist.last_update_date, dist.line_id
, dist.location_segment_id
, dist.org_id
ORDER BY 2

OK I figured it out - I deleted the ar_distributions table and linked the cash history table directly to the gl code table so the GL code is actually linked to the header record:
AND cashh.account_code_combination_id = gl.code_combination_id

Similar Messages

  • AR Receipts On Account and Unapplied fields

    Hi All
    Can you please help me finding out what are the database field names for On Account and Unapplied fields in AR receipts form and in which table these two fields reside?
    Please let me know asap on the same.
    Appreciate your time on this in advance.
    Regds
    Mano

    Hello.
    Have a look to AR_RECEIPT_AMOUNTS_V view where you can see what you are looking for in a simplified manner.
    Octavio

  • I forgot my password for my iTunes account and the email that is associated with my iTunes account no longer works. How do I recover my password and be able to change my security questions?

    I forgot my password for my iTunes account and the email that is associated with my iTunes account no longer works. How do I recover my password and be able to change my security questions?

    Forgotten Security Questions / Answers...
    See Here > Apple ID: Contacting Apple for help with Apple ID account security
              Ask to speak with the Account Security Team...
    Or Email Here  >  Apple  Support  iTunes Store  Contact
    More Info >  Apple ID: All about Apple ID security questions
    Note:
    You can only set up and/or change a Rescue Email Before you forget the questions/answers

  • HT2242 I am British, live in Spain, and want to use my UK credit card for my iTunes account and use English, but can't find a way to do this. Can anyone help?

    I am British, live in Spain, and want to use my UK credit card for my iTunes account and use English, but can't find a way to do this. Can anyone help?

    under usage-i only have the camera roll, photo library and photostream-they don't show the individual albums withing my libraries-if i delete library-i would delete about 12 albums
    I don't sync pics but was hoping the albums showed up there.  It was a long shot.

  • Daughter has used iPad for her Apple account and I can't use the App store because her username automatically shows up in the Apple ID window.  How do I change that?

    My daughter has used our iPad for her Apple account and now I can't use the App store because her username automatically shows up in the Apple ID window.  How do I change that so I can put our Apple ID in with the appropriate Password?

    Open Settings -> Store
    Tap on the Apple ID shown and sign out. Then sign in with your own Apple ID.
    Update: Oops, AnaMusic was faster...

  • Can someone please help i cant connect to itunes from my iphone 4 ,,i had an iphone 3 and when i got my iphone 4 i changed my email address for new itunes account and my old phone which hubby uses

    Can someone please help i cant connect to itunes from my iphone 4 ,,i had an iphone 3 and when i got my iphone 4 i changed my email address for new itunes account and my old phone which hubby uses is changed aswell ..for some reason i cant update my apps off m iphone & in itunes via pc it will say apps are all up to date but i have 25 apps that need updating please can someone help ,, i can download a new app but i cant update existing ones ,,,
    very frustrated iphone user !!

    Changing devices is no reason to create a new Apple ID.
    All content purchased from iTunes is permanently linked to the Apple ID it was purchased with.
    To update apps purchased with the old ID, you MUST sign in with that Apple ID.

  • Work Flow for Manually Disabling Account and Reporting on Disabling Account

    Hi All
    THis is my First Time To Create Work Flow for Idm Project Please Help me
    i want Work Flow for Manually Disabling Account and Reporting on Disabling Accounts
    Please Tell me How I will have to start, to create the code, I know how to configure but may be I will use BPEL or Through Netbeans and plugin I will use.
    please provide me sample code, so that I can start workflow work

    Thats configurable buddy ! ! And possible in 10G and 11G both versions.
    Functional Roles : These are the groups/roles in OIM 10g/11g with access policies attached at the backend.
    - Create a dummy resource and name it Request Role or anything as you like. Attach an Object Form to it and have form field for Role Name, this would be a lookup type field linked to all OIM groups (leave system values using lookup query). So a user can select any OIM Group in this request as per configuration. Have approval workflows defined on this dummy resource Request Role and in its Provisioning Process make user/s a part of the requested group.
    - Now once the user is made a part of the group, the associated access policy would be invoked automatically and thereby provisioning. The only thing you need to keep in mind is that create the access policy without approval (there is a check box). If you do this the approvals would never be invoked even if you assign a group manually to the user coz it suppresses all the approvals in this access policy.
    IT Roles : These would be linked to the resource and you can define individual approvals on the resources as required.These approvals would be required if someone raises a request for these resources individually.
    Thanks
    Sunny

  • HT201269 I am trying to remove the backup encrypt for my Iphone 4 but the itunes ask for the password and  basically I have not set any password before ...!!! Please note that I entered the password for my apple account and also it did not work, how i can

    I am trying to remove the backup encrypt for my Iphone 4 but the itunes ask for the password and  basically I have not set any password before ...!!! Please note that I entered the password for my apple account and also it did not work, how i can reset it?

    You can't reset it.  If you don't konw the password then you can't use that backup

  • I changed the password on my computer for my gmail account, and now new gmail calendar information is not appearing.

    I changed the password on my computer for my gmail account, and now new gmail calendar information is not appearing on my iTouch.

    Go to Settings>Mail>GMail account and update the password for the account

  • Why I pay for my Individual account and Creative Cloud for the team?

    Hi,
    I subscribe to Creative Cloud from last year. I started a company with two other partners. I registered us for Creative Cloud Team. I asked the tech support and I was not supposed to continue paying for the individual account.
    However, I continue to pay for the old account and the Individual account team ... How not to pay for my personal account?
    Tanx

    Hi JF-Grimard
    I will cancel your personal account and refund the August & September charges as you started your Teams membership in August.
    Thanks
    Bev

  • I have paid up for a Teachers account and am unable to install any program. I keep getting directed to your 'Trial has expired'.

    I have paid up for a Teachers account and am unable to install any program. I keep getting directed to your 'Trial has expired'.

    Hi Pamela,
    You can follow the article: Activation & deactivation help which might be helpful for your activation issue.
    Please let us know if it works or if you still face any issue.
    Thanks,
    Ratandeep Arora

  • HT1918 I am changing my address of my billing for my iTunes account and it will not take my new credit card ?  Why?  And why is it so hard to find someone from apple to help?!  Very frustrated!!

    I am changing my address of my billing for my iTunes account and it will not take my new credit card ?  Why?  And why is it so hard to find someone from apple to help?!  Very frustrated!!

    Contact iTunes Customer Service and request assistance
    Use this Link  >  Apple  Support  iTunes Store  Contact

  • Ageing 7 Buckets - By Account Report - Unapplied Receipts Register

    Hi Guys,
    I am not a disco professional, just wanted to know if i want the following reports (Ageing 7 Buckets - By Account Report - Unapplied Receipts Register) to run from disco how do i achive this ?
    Thanks
    Bal

    Hi Bal
    Does the report exist? If so you need to share it with a user that you have access to then log in as that user and run it.
    If the report does not exist you will need to create it.
    If you're asking whether Discoverer can create an aging report with buckets the answer is yes and the trick is to master the CASE statement. This might help:
    CASE WHEN days_late < 8 THEN 'Within 1 week'
    WHEN days_late < 15 THEN 'More than 1 but less than 2 weeks'
    WHEN days_late < 22 THEN 'More than 2 but less than 3 weeks'
    .... and do on until .....
    WHEN days_late < 91 THEN 'some suitable bucket'
    ELSE 'More than 90 days'
    END
    As you create the CASE statement the set of values remaining is decreased by that statement just processed. So for example if you start out by looking for anything less than 8 then once those have been determined there will be no more values in the set. Thus next we look for anything less than 15, and so on.
    If you want to work the other way, from the top down you need to use the greater than symbol like this:
    CASE WHEN days_late > 89 THEN 'More than 90 days'
    WHEN days_late > 59 THEN 'More than 60 days'
    .... and do on until .....
    WHEN days_late > 7 THEN 'More than 7 days'
    ELSE 'Within 1 week'
    END
    Best wishes
    Michael

  • Difference between unapplied cash and unapplied receipts

    Can anyone explain the Difference between unapplied cash and unapplied receipt ?

    Unapplied cash simply means customer over paid and there is some dollar left which is 'Unapplied' then there is no transaction or Credit Memo associated to the unapplied amount.
    Unapplied receipt : You have only collected the money from customer ie receipt is created but you havn't tag this particular invoice is being appllied.

  • Help!  I no longer have the email address for my itunes account and cannot verify Apple ID

    I am trying to log into my itunes account and it tells me I need to verify my account by logging into my email.  My AppleID is an old email account that I can no longer access.  I want to log in to itunes to update my email account on file, but when I try to log in it says I need to verify my account.  I'm stuck.  Does this mean I can no longer access the money I have on my itunes account since it doesn't let me sign in without verifying?
    Frustrating!

    i am having the same prob spent almost 2hours in apple store in kingston and they made me email apple support in the end who told me to sort it online when it didnt work in the first place i phoned up and was told they would email me back and still waiting for issue to be resolved i swear dell is bloody easier at least you can talk to someone v.unhappy especially the amount of money these products cost they should know better tut tut

Maybe you are looking for