Accept isolated invoice issuance and reproducible PDF delivery
This commit is contained in:
@@ -79,6 +79,15 @@ final class DocumentPreview
|
||||
});
|
||||
}
|
||||
|
||||
/** Internal composition under the issuer's company lock; ordinary preview reads remain read-only. */
|
||||
public function captureDraftForIssuance(int $draft,int $actor): array
|
||||
{
|
||||
abort_unless(DB::transactionLevel()>0,409,'Captura documental exige transacção consistente.');
|
||||
$scope=$this->workflow->scope('billing_drafts',$actor,'view');
|
||||
$this->context->selectFor($actor,$scope['tenant_id'],$scope['company_id'],$scope['unit_id']);
|
||||
return $this->current($draft,$actor,$scope)+['notice'=>self::NOTICE];
|
||||
}
|
||||
|
||||
private function current(int $draft, int $actor, array $scope): array
|
||||
{
|
||||
foreach (['issuer','client','billing_drafts'] as $kind) { $this->preparation->scope($kind, $actor, 'view'); }
|
||||
|
||||
Reference in New Issue
Block a user