29 lines
928 B
PHP
29 lines
928 B
PHP
<?php
|
|
|
|
namespace Modules\Portal\Http\Controllers\Supplier;
|
|
|
|
use App\TransactionPayment;
|
|
use Modules\Portal\Http\Controllers\BasePortalController;
|
|
|
|
class PaymentController extends BasePortalController
|
|
{
|
|
public function index()
|
|
{
|
|
$this->ensureCrmSubscription();
|
|
$payments = TransactionPayment::join('transactions as t', 'transaction_payments.transaction_id', '=', 't.id')
|
|
->where('t.business_id', $this->businessId())
|
|
->where('t.contact_id', $this->contactId())
|
|
->whereIn('t.type', ['purchase', 'purchase_return'])
|
|
->select(
|
|
'transaction_payments.*',
|
|
't.ref_no',
|
|
't.invoice_no',
|
|
't.type as transaction_type'
|
|
)
|
|
->orderByDesc('transaction_payments.paid_on')
|
|
->paginate(20);
|
|
|
|
return view('portal::supplier.payments.index', compact('payments'));
|
|
}
|
|
}
|