@@ -5,6 +5,7 @@ namespace App\Services;
|
||||
use App\Enums\PurchasingRole;
|
||||
use App\Models\Invoice;
|
||||
use App\Models\InvoiceItem;
|
||||
use App\Models\PurchaseOrder;
|
||||
use App\Models\User;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
@@ -82,6 +83,18 @@ final class SupplierPayables
|
||||
return $result;
|
||||
}
|
||||
|
||||
/** Audited originals, once per payment; imported copies are never added.
|
||||
* @return list<array<string,mixed>>
|
||||
*/
|
||||
public function readPaymentHistory(User $user, int $invoiceId): array
|
||||
{
|
||||
$this->readContext($user);
|
||||
abort_unless(Invoice::query()->where('tenant_id', $user->tenant_id)->whereKey($invoiceId)
|
||||
->whereIn('purchase_order_id', PurchaseOrder::query()->visibleTo($user)->select('id'))->exists(), 404);
|
||||
|
||||
return $this->paymentHistory($user, $invoiceId);
|
||||
}
|
||||
|
||||
/** @return array<string,mixed> */
|
||||
public static function paymentFacts(\stdClass $payment, ?\stdClass $registration, ?\stdClass $decision): array
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user