Skip to content

Get account balance details #191

@dopeck

Description

@dopeck

try {
$query = new ReadByQuery();
$query->setObjectName('GLACCOUNTBALANCE');
$where = new EqualToString();
$where->setField('PERIOD');
$where->setValue('Month Ended February 2023');
$query->setQuery($where);
$query->setPageSize(1000);
$query->setFields(['*']);
$response = $client->execute($query);
$result = $response->getResult();
$getData = $result->getData();
echo "Page 1 success! Number of vendor records found: " . $result->getTotalCount() . ". Number remaining: " . $result->getNumRemaining() . PHP_EOL;
echo "
";
$i = 1;
// Get pages 2 through 4
while ($result->getNumRemaining() > 0 && $i <= 1000 && $getResultId = $result->getResultId()) {
$i++;
$more = new ReadMore();
$more->setResultId($getResultId);
$response = $client->execute($more);
$result = $response->getResult();
$getData = $result->getData();
echo "Page $i success! Records remaining: " . $result->getNumRemaining() . PHP_EOL;
echo "
";
}
echo "Successfully read $i pages" . PHP_EOL;
} catch (ResponseException $ex) {
echo 'Failed! ' . $ex->getMessage();
} catch (Exception $ex) {
echo get_class($ex) . ': ' . $ex->getMessage();
}

I am trying to get the account balances using the code above, but it is grouping the account balance details by the vendor. How do I get the account balance details without it being grouped by the vendor?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions