gutterboy Posted September 3, 2014 Report Share Posted September 3, 2014 What is the easiest way to find out if a certain user (based on their client id) has overdue invoices via the API? Thanks! Quote Link to comment Share on other sites More sharing options...
Tyson Posted September 3, 2014 Report Share Posted September 3, 2014 Easiest way: $client_id = 1; $obj = new stdClass(); Loader::loadModels($obj, array("Invoices")); $has_overdue_invoices = (count($obj->Invoices->getStatusCount($client_id, "past_due")) > 0); Quote Link to comment Share on other sites More sharing options...
gutterboy Posted September 4, 2014 Author Report Share Posted September 4, 2014 Easiest way: $client_id = 1; $obj = new stdClass(); Loader::loadModels($obj, array("Invoices")); $has_overdue_invoices = (count($obj->Invoices->getStatusCount($client_id, "past_due")) > 0); Thanks. I might do it a bit different as I am using the SDK. But I'm good now as I know the correct method to use. Cheers! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.