PHP code example of ezesha / end-year-reports

1. Go to this page and download the library: Download ezesha/end-year-reports library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

ezesha / end-year-reports example snippets


namespace App\Reports;

use Ezesha\EndYearReports\DataProviders\FinancialDataProviderInterface;

class LedgerDataProvider implements FinancialDataProviderInterface
{
    public function getPackage(int $officeId, string $closureDate): array
    {
        // Query your ledger for this office / period and return:
        return [
            'trial_balance'    => [ /* accounts, totals */ ],
            'income_statement' => [ /* revenues, expenses, ... */ ],
            'balance_sheet'    => [ /* assets, liabilities, equity */ ],
        ];
    }
}

public string $dataProvider = \App\Reports\LedgerDataProvider::class;

$schedule->command('workers:process-reports --max-messages 50')
         ->everyMinute()
         ->named('process-reports')
         ->singleInstance();

$schedule->command('workers:retry-failed --max-age-hours 24')
         ->everyFiveMinutes()
         ->named('retry-failed-reports');
bash
php spark migrate --all
# or
php spark migrate -n "Ezesha\EndYearReports"
bash
php spark endyearreports:publish