@@ -7,6 +7,8 @@ use App\Services\BudgetDistributionArtifact;
|
||||
use App\Services\FinanceBundle;
|
||||
use App\Services\ReplenishmentRun;
|
||||
use App\Services\RequisitionExpiryRun;
|
||||
use App\Services\StandaloneArtifact;
|
||||
use App\Services\StandaloneRuntime;
|
||||
use Carbon\CarbonImmutable;
|
||||
use Illuminate\Support\Facades\Date;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
@@ -23,7 +25,19 @@ class AppServiceProvider extends ServiceProvider
|
||||
$this->app->singleton(ReplenishmentRun::class);
|
||||
$this->app->singleton(RequisitionExpiryRun::class);
|
||||
$this->app->scoped(AdministrativeGeography::class);
|
||||
require_once base_path('packages/purchasing/bootstrap.php');
|
||||
$this->app->scoped(StandaloneRuntime::class, fn () => new StandaloneRuntime(config('standalone-runtime'), new StandaloneArtifact));
|
||||
$runtime = $this->app->make(StandaloneRuntime::class);
|
||||
$paths = null;
|
||||
if ($runtime->enabled()) {
|
||||
if (config('common-finance-bundle.root') !== null || config('budget-distributions.enabled') === true) {
|
||||
throw new \LogicException('COMPRAS_RUNTIME_MIXED_COMPOSITION');
|
||||
}
|
||||
$paths = $runtime->configure(DB::connection());
|
||||
$runtime->assertLoadedPackages(allowMissing: true);
|
||||
config(['common-budget.path' => $paths['budget-control'], 'common-payables.path' => $paths['payables'],
|
||||
'general-ledger.path' => $paths['general-ledger']]);
|
||||
}
|
||||
require_once ($paths['purchasing'] ?? config('common-purchasing.path')).'/bootstrap.php';
|
||||
$package = config('common-budget.path');
|
||||
if (config('budget-distributions.enabled') === true) {
|
||||
BudgetDistributionArtifact::verify($package,
|
||||
@@ -33,6 +47,10 @@ class AppServiceProvider extends ServiceProvider
|
||||
FinanceBundle::configure();
|
||||
$payables = config('common-payables.path');
|
||||
require_once $payables.'/bootstrap.php';
|
||||
if ($paths !== null) {
|
||||
require_once $paths['general-ledger'].'/bootstrap.php';
|
||||
$runtime->assertLoadedPackages();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user