refactor(receivables): rewrite legacy-era regions of the allocation model, requests, pdf controller and routes in place

This commit is contained in:
Darko Gjorgjijoski
2026-08-21 09:38:43 +02:00
parent c4c816b0ed
commit c7130e1e17
6 changed files with 32 additions and 11 deletions
@@ -7,6 +7,13 @@ use App\Domains\Receivables\Models\Payment;
use App\Platform\Http\Controller;
use Illuminate\Http\Request;
/**
* Serves the receipt behind a payment's public hash.
*
* Asking for a preview short-circuits to the view data the template is
* rendered from, so the layout can be looked at without a PDF engine in
* the loop; every other caller gets the file itself.
*/
class PaymentPdfController extends Controller
{
public function __construct(
@@ -19,6 +26,8 @@ class PaymentPdfController extends Controller
return $this->paymentPdfDataProvider->getPdfData($payment);
}
return $payment->getGeneratedPDFOrStream('payment');
$receipt = $payment->getGeneratedPDFOrStream('payment');
return $receipt;
}
}