I am trying to calculate the Credit Totals for customers (Can be found in Customer Tracker).
I have tried GlbCustCred but the numbers are inaccurate. When I try to run Recalculate Customer Credit, it says process submitted but none of the values in GlbCustCred change.
I was able to get the Invoice Credit with this query
select
SUM(ih.InvoiceBal)
from erp.Customer c
join erp.InvcHead ih on c.Company=ih.Company and c.CustNum = ih.CustNum
where ih.OpenInvoice = 1
and ih.Posted = 1
Order Credit is more difficult because when I try a similar query to get the total charge of the open orders for a company it is incorrect because according to the customer tracker the order credit is 0 because there are no open orders with that company.
Has anyone been able to find a way to pull the Order Credit value in a query?