firebed / aade-mydata

Interface for ΑΑΔΕ myDATA invoicing REST API. It handles all the boilerplate code for sending, cancelling and requesting invoices.
https://docs.invoicemaker.gr/getting-started
MIT License
61 stars 21 forks source link

getExpensesClassifications returns empty results #16

Closed imneckro closed 7 months ago

imneckro commented 7 months ago

Hello. Im using below code to get expenses clasification but returns nothing at all:

    $request = new RequestDocs();
    try {        
        $continuationToken = null;
        do {
            $response = $request->handle(
                dateFrom: $datefrom,
                dateTo: $dateto,
                nextPartitionKey: $continuationToken?->getNextPartitionKey(),
                nextRowKey: $continuationToken?->getNextRowKey()
            );
            $getExpensesClassifications = $response->getExpensesClassifications();
            $continuationToken = $response->getContinuationToken();
        } while ($continuationToken);
    } catch (MyDataException $e) {
           die($e->getMessage());
    }

echo "<pre>";
print_r($getExpensesClassifications);
firebed commented 7 months ago

Can you confirm that the response xml has expenses classifiactions and it's not empty? You can get the result XML using:

$xml = $request->getResponseXML()
imneckro commented 7 months ago

I tried $xml = $request->getResponseXML() and got Fatal error: Uncaught Error: Call to undefined method Firebed\AadeMyData\Models\RequestedDoc::getResponseXML()

firebed commented 7 months ago

You might have an old version. Please update to the latest version 4.0.6

imneckro commented 7 months ago

using version 4.0.4.. tried to update and got:

Using version ^4.0 for firebed/aade-mydata
./composer.json has been updated
Running composer update firebed/aade-mydata
Loading composer repositories with package information
Updating dependencies
Nothing to modify in lock file
Writing lock file
Installing dependencies from lock file (including require-dev)
Nothing to install, update or remove
Generating autoload files
4 packages you are using are looking for funding.
Use the `composer fund` command to find out more!
imneckro commented 7 months ago

nevermind i was missing soap extension in php. just installed to so ill come back with results

imneckro commented 7 months ago

Please close issue as resolved. After updating to 4.0.6 everything is ok. I am sorry for troubling you.

firebed commented 7 months ago

No problem, happy to help!