commit melhorias sgf
This commit is contained in:
@@ -0,0 +1,11 @@
|
||||
<?php
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
use App\Shared\Context\CompanyContext;
|
||||
require __DIR__.'/sgf-ledger-proof-bootstrap.php';
|
||||
config(['sgf_single_installation.finance_enabled'=>true,'sales_ledger.synthetic_enabled'=>true,'cost_ledger.synthetic_enabled'=>true,'industrial_ledger.synthetic_enabled'=>true,'cost_ledger.correction_enabled'=>true,'industrial_ledger.correction_enabled'=>true,'purchasing_workspace.single_installation'=>true,'purchasing_workspace.id'=>$tag,'purchasing_workspace.scope'=>$f['scope'],'purchasing_workspace.profiles'=>App\Modules\Purchasing\PurchasingEntry::profiles($f)]);
|
||||
$as=function($role,$module,$path)use($app,$profiles,$f){Auth::forgetGuards();Auth::shouldUse('web');$user=App\Models\User::findOrFail($profiles[$role]['user_id']);Auth::guard('web')->setUser($user);$r=Illuminate\Http\Request::create($path,'GET',[],[],[],['REMOTE_ADDR'=>'127.0.0.1']);$session=app('session')->driver();$session->start();$session->put('company_context',$f['scope']+['module_id'=>$module,'token'=>'render-'.$role]);$r->setLaravelSession($session);$r->setUserResolver(fn()=>$user);$app->instance('request',$r);app(CompanyContext::class)->selectFor($user->id,$f['tenant'],$f['company'],$f['unit']);return $r;};
|
||||
$r=$as('accounting_prepare','accounting','/general-ledger');$response=app(App\Modules\Accounting\ComposedLedgerController::class)->page($r,app(App\Modules\Accounting\ComposedLedger::class));$ok($response->getStatusCode()===200&&str_contains($response->getContent(),'Diário integrado'),'accounting HTML renders through the qualified native book');$ok(str_contains($response->getContent(),'Compra ')&&str_contains($response->getContent(),'Venda '),'same accounting page lists existing supplier and new host sales origins');
|
||||
$r=$as('finance_prepare','finance','/finance/payables');$response=app(App\Modules\Purchasing\ComposedFinanceController::class)->index($r,app(App\Modules\Purchasing\ComposedFinance::class));$ok($response->getStatusCode()===200&&str_contains($response->getContent(),'100,00 MZN'),'finance HTML renders the original100MZN obligation');$ok(str_contains($response->getContent(),'data-action="payment-prepare"')&&!str_contains($response->getContent(),'data-action="payment-decide"'),'preparer screen does not offer financial confirmation');
|
||||
$r=$as('read_only','finance','/finance/payables');$response=app(App\Modules\Purchasing\ComposedFinanceController::class)->index($r,app(App\Modules\Purchasing\ComposedFinance::class));$ok(!str_contains($response->getContent(),'data-action='),'read-only finance screen offers no writer');
|
||||
$r=$as('read_only','accounting','/sgf');$entry=app(App\Shared\Installation\PresentationEntry::class)->screen($r);$html=$entry->getContent();$ok($entry->getStatusCode()===200&&substr_count($html,'action="/sgf/entrar"')===17,'single chooser retains seven existing and ten new QA identities');$ok(substr_count($html,'Escolha o módulo')===17,'module choice remains explicit for every identity');
|
||||
file_put_contents($work.'/presentation-result.json',json_encode(['passed'=>true,'checks'=>$checks,'blade_rendered'=>true,'browser_visual_review'=>false,'business_commands'=>0],JSON_PRETTY_PRINT));echo json_encode(['passed'=>true,'checks'=>count($checks),'proof'=>$work.'/presentation-result.json']).PHP_EOL;
|
||||
Reference in New Issue
Block a user