Skip to main content
Question

Query for Payments w/ Available Balance?

  • September 25, 2024
  • 7 replies
  • 46 views

max21
Freshman II
Forum|alt.badge.img
  • Freshman II
  • 28 replies

Does anyone know how to query for Payments with a non-zero Available Balance — curyUnappliedBal

Unfortunately this field isn’t available in the DB, and the code references other fields that also don’t exist in the DB. 
Someone on my Accounting team asked for a GI/SQL to isolate these Payments. 

 

 

 

7 replies

Laura02
Captain II
Forum|alt.badge.img+19
  • Captain II
  • 3132 replies
  • September 25, 2024

Hello,It seems like you need ARPayment.CuryDocBal, shown in your code above.

ARPayment.CuryDocBal is the unapplied balance of the payment.

Laura


max21
Freshman II
Forum|alt.badge.img
  • Author
  • Freshman II
  • 28 replies
  • September 25, 2024

Thanks for the reply @Laura02, but i’m seeing examples where that Balance field is $0 but the “Available Balance” is not zero, when viewing the document directly. 
So this is what we’re trying to query for, using available fields in the DB, but it doesn’t seem possible, or is confusing. 


darylbowman
Captain II
Forum|alt.badge.img+13
  • 1749 replies
  • September 25, 2024

Not to doubt the validity of that, but if you think it through, the formula being used to calculate CuryUnappliedBal is subtracting amounts from CuryDocBal. I’m not sure how you’d ever end up with a number greater than CuryDocBal.


max21
Freshman II
Forum|alt.badge.img
  • Author
  • Freshman II
  • 28 replies
  • September 25, 2024

Okay gotcha, yeah I think I was mixing up SOAdjust.CuryDocBal (which showed $0) and ARPayment.CuryDocBal (which was non zero). 

All that to say, ARPayment.CuryDocBal doesn’t appear to return what I’m looking for though. There are many Payments I’m seeing where this value just matched the Document Total, but the “Available Balance” (curyUnappliedBal) correctly shows $0. 


darylbowman
Captain II
Forum|alt.badge.img+13
  • 1749 replies
  • September 25, 2024

Are those Payments that have Invoices associated but haven’t been released? After adjustment was released is when the CuryDocBal would accurately reflect the amount remaining.


max21
Freshman II
Forum|alt.badge.img
  • Author
  • Freshman II
  • 28 replies
  • September 25, 2024

They aren’t applied to any Invoices or Sales Orders, and they are in the Open status (and released). So they are essentially ‘orphaned’ payments that we want more visibility into. 

Okay it seems like for documents of the “Payment” type (not “Prepayments”) in the Open status, the CuryDocBal shows what I’d expect. But for Prepayments, this is not the case. 

I think I can just use that in the logic to capture what I need. Thanks for scheming on this with me!


max21
Freshman II
Forum|alt.badge.img
  • Author
  • Freshman II
  • 28 replies
  • October 2, 2024

After digging a bit more, I’m still not really happy with how confusing and difficult it is to query this information...classic Acumatica. I’m unable to isolate “Prepayments” that have an available balance. Oh well. 


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings