@@ -15,6 +15,12 @@ final class SupplierPayables
|
||||
{
|
||||
public static function enabled(): bool
|
||||
{
|
||||
if (app(StandaloneRuntime::class)->enabled()) {
|
||||
return app(StandaloneRuntime::class)->feature('supplier-payables', DB::connection())
|
||||
&& is_string(config('common-payables.source_instance')) && trim(config('common-payables.source_instance')) !== ''
|
||||
&& Schema::hasTable('pa_obligations') && Schema::hasTable('pa_access');
|
||||
}
|
||||
|
||||
$isolated = app()->environment(['testing', 'payable-testing']) && DB::connection()->getDriverName() === 'pgsql'
|
||||
&& (bool) preg_match('/^compras_receipts_test_[a-f0-9]{12}$/D', DB::connection()->getDatabaseName());
|
||||
|
||||
@@ -207,7 +213,10 @@ final class SupplierPayables
|
||||
$engine = $this->engine($u);
|
||||
$d = $engine->listing(Invoice::query()->where('tenant_id', $u->tenant_id)->pluck('id')->all());
|
||||
$d['permissions'] = ['prepare' => $this->can($u, 'prepare'), 'validate' => $this->can($u, 'validate')];
|
||||
$d['payments_available'] = app()->environment('payable-testing') && Schema::hasTable('ps_payments') && $this->can($u, 'payments_view');
|
||||
$payments = app(StandaloneRuntime::class)->enabled()
|
||||
? app(StandaloneRuntime::class)->feature('supplier-settlements', DB::connection())
|
||||
: app()->environment('payable-testing');
|
||||
$d['payments_available'] = $payments && Schema::hasTable('ps_payments') && $this->can($u, 'payments_view');
|
||||
$d['history_import_available'] = self::historyEnabled();
|
||||
$d['history_decisions_available'] = self::historyDecisionsEnabled();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user