ekmungai / eloquent-ifrs

Eloquent Double Entry Accounting with a focus on IFRS Compliant Reporting
MIT License
334 stars 68 forks source link

Show Report #28

Closed aditiadika closed 3 years ago

aditiadika commented 3 years ago

hai @ekmungai how to show/get report? i try get report trial balance or profit loss with example on the docs always return null, even though on the table ledger already record. here is example to get report. i used v2.0.1: Screen Shot 2021-02-16 at 08 28 02 Screen Shot 2021-02-16 at 08 28 10 Screen Shot 2021-02-16 at 08 28 26 Screen Shot 2021-02-16 at 08 28 36 Screen Shot 2021-02-16 at 08 28 53

thanks

ekmungai commented 3 years ago

Hi Adit, You are skipping a step. For example, after instantiating the balance sheet, you need to call $balanceSheet->getTransactions()

Cheers

aditiadika commented 3 years ago

thanks for your reply @ekmungai , when i dd $balanceSheet->getTransactions() -> return an error "Call to undefined method IFRS\Reports\BalanceSheet::getTransactions()" i used package v2.0.1, when i check on vendor Report\BalanceSheet only available toString() & getSections(), when i dd getSections()& toString() always return null

ekmungai commented 3 years ago

After calling getSections(), whats the output of dd'ing the $balanceSheet object?

aditiadika commented 3 years ago

when i dd($balanceSheet): Screen Shot 2021-02-18 at 08 08 15

dd($balanceSheet->getSections()): Screen Shot 2021-02-18 at 08 10 08

thanks @ekmungai

ekmungai commented 3 years ago

Hi Adit,

Sorry about the mistake, I meant getSections(). This function does not return anything which is why dd gives null. Try call in and then inspecting the $balanceSheet object via dd. Also debug the actual query called in Account::getSections() to ensure that the date ranges are in line with the data in your tables

Cheers