@@ -27,10 +27,13 @@ final class RequisitionExpiry
|
||||
$db = DB::connection();
|
||||
$purchasing = new \ReflectionClass(InternalRequisitions::class);
|
||||
|
||||
return config('requisition-expiry.qa_enabled') === true && app()->environment('testing')
|
||||
$available = app(StandaloneRuntime::class)->enabled()
|
||||
? app(StandaloneRuntime::class)->feature('requisition-expiry', $db)
|
||||
: config('requisition-expiry.qa_enabled') === true && app()->environment('testing')
|
||||
&& (($db->getDriverName() === 'sqlite' && $db->getDatabaseName() === ':memory:') || ($db->getDriverName() === 'pgsql'
|
||||
&& $db->getConfig('host') === '127.0.0.1' && preg_match('/^compras_receipts_test_[a-f0-9]{12}$/D', $db->getDatabaseName())))
|
||||
&& $purchasing->hasMethod('supportsExpiryCycles') && $purchasing->getMethod('supportsExpiryCycles')->invoke(null) === true
|
||||
&& $db->getConfig('host') === '127.0.0.1' && preg_match('/^compras_receipts_test_[a-f0-9]{12}$/D', $db->getDatabaseName())));
|
||||
|
||||
return $available && $purchasing->hasMethod('supportsExpiryCycles') && $purchasing->getMethod('supportsExpiryCycles')->invoke(null) === true
|
||||
&& defined(BudgetControl::class.'::REQUISITION_CYCLES_VERSION')
|
||||
&& constant(BudgetControl::class.'::REQUISITION_CYCLES_VERSION') === CommonBudget::REQUISITION_CYCLES_CONTRACT
|
||||
&& Schema::hasTable('budget_requisition_cycles') && Schema::hasColumn('requisitions', 'approval_cycle')
|
||||
|
||||
Reference in New Issue
Block a user