mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-06-05 03:34:36 -04:00
Vendor Portal stubs
This commit is contained in:
parent
6674424244
commit
31054c8a13
@ -53,7 +53,7 @@ class PurchaseOrderController extends Controller
|
|||||||
public function index(ShowPurchaseOrdersRequest $request)
|
public function index(ShowPurchaseOrdersRequest $request)
|
||||||
{
|
{
|
||||||
|
|
||||||
return $this->render('purchase_orders.index');
|
return $this->render('purchase_orders.index', ['company' => auth()->user()->company, 'settings' => auth()->user()->company->settings, 'sidebar' => $this->sidebarMenu()]);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -76,13 +76,13 @@ class PurchaseOrdersTable extends Component
|
|||||||
// }
|
// }
|
||||||
|
|
||||||
$query = $query
|
$query = $query
|
||||||
->where('vendor_id', auth()->guard('vendor')->user()->client_id)
|
->where('vendor_id', auth()->guard('vendor')->user()->vendor_id)
|
||||||
// ->where('status_id', '<>', Invoice::STATUS_DRAFT)
|
// ->where('status_id', '<>', Invoice::STATUS_DRAFT)
|
||||||
// ->where('status_id', '<>', Invoice::STATUS_CANCELLED)
|
// ->where('status_id', '<>', Invoice::STATUS_CANCELLED)
|
||||||
->withTrashed()
|
->withTrashed()
|
||||||
->paginate($this->per_page);
|
->paginate($this->per_page);
|
||||||
|
|
||||||
return render('components.livewire.purchase_orders-table', [
|
return render('components.livewire.purchase-orders-table', [
|
||||||
'purchase_orders' => $query
|
'purchase_orders' => $query
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
@ -123,6 +123,30 @@ class PurchaseOrder extends BaseModel
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public static function badgeForStatus(int $status)
|
||||||
|
{
|
||||||
|
switch ($status) {
|
||||||
|
case self::STATUS_DRAFT:
|
||||||
|
return '<h5><span class="badge badge-light">'.ctrans('texts.draft').'</span></h5>';
|
||||||
|
break;
|
||||||
|
case self::STATUS_SENT:
|
||||||
|
return '<h5><span class="badge badge-primary">'.ctrans('texts.sent').'</span></h5>';
|
||||||
|
break;
|
||||||
|
case self::STATUS_APPROVED:
|
||||||
|
return '<h5><span class="badge badge-primary">'.ctrans('texts.approved').'</span></h5>';
|
||||||
|
break;
|
||||||
|
case self::STATUS_CANCELLED:
|
||||||
|
return '<h5><span class="badge badge-secondary">'.ctrans('texts.cancelled').'</span></h5>';
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
// code...
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
public function assigned_user()
|
public function assigned_user()
|
||||||
{
|
{
|
||||||
return $this->belongsTo(User::class, 'assigned_user_id', 'id')->withTrashed();
|
return $this->belongsTo(User::class, 'assigned_user_id', 'id')->withTrashed();
|
||||||
|
@ -245,7 +245,7 @@ class GoCardlessPaymentDriver extends BaseDriver
|
|||||||
sleep(1);
|
sleep(1);
|
||||||
|
|
||||||
foreach ($request->events as $event) {
|
foreach ($request->events as $event) {
|
||||||
if ($event['action'] === 'confirmed' || $event['action'] === 'paid_out' || $event['action'] === 'paid') {
|
if ($event['action'] === 'confirmed' || $event['action'] === 'paid_out') {
|
||||||
|
|
||||||
nlog("Searching for transaction reference");
|
nlog("Searching for transaction reference");
|
||||||
|
|
||||||
|
@ -4627,6 +4627,8 @@ $LANG = array(
|
|||||||
'notification_purchase_order_viewed' => 'The following vendor :client viewed Purchase Order :invoice for :amount.',
|
'notification_purchase_order_viewed' => 'The following vendor :client viewed Purchase Order :invoice for :amount.',
|
||||||
'purchase_order_date' => 'Purchase Order Date',
|
'purchase_order_date' => 'Purchase Order Date',
|
||||||
'purchase_orders' => 'Purchase Orders',
|
'purchase_orders' => 'Purchase Orders',
|
||||||
|
'purchase_order_number_placeholder' => 'Purchase Order # :purchase_order',
|
||||||
|
|
||||||
);
|
);
|
||||||
|
|
||||||
return $LANG;
|
return $LANG;
|
||||||
|
@ -79,19 +79,19 @@
|
|||||||
{{ $purchase_order->number }}
|
{{ $purchase_order->number }}
|
||||||
</td>
|
</td>
|
||||||
<td class="px-6 py-4 text-sm leading-5 text-gray-500 whitespace-nowrap">
|
<td class="px-6 py-4 text-sm leading-5 text-gray-500 whitespace-nowrap">
|
||||||
{{ $purchase_order->translateDate($purchase_order->date, $invoice->company->date_format(), $invoice->company->locale()) }}
|
{{ $purchase_order->translateDate($purchase_order->date, $purchase_order->company->date_format(), $purchase_order->company->locale()) }}
|
||||||
</td>
|
</td>
|
||||||
<td class="px-6 py-4 text-sm leading-5 text-gray-500 whitespace-nowrap">
|
<td class="px-6 py-4 text-sm leading-5 text-gray-500 whitespace-nowrap">
|
||||||
{{ App\Utils\Number::formatMoney($purchase_order->amount, $purchase_order->company) }}
|
{{ App\Utils\Number::formatMoney($purchase_order->amount, $purchase_order->company) }}
|
||||||
</td>
|
</td>
|
||||||
<td class="px-6 py-4 text-sm leading-5 text-gray-500 whitespace-nowrap">
|
<td class="px-6 py-4 text-sm leading-5 text-gray-500 whitespace-nowrap">
|
||||||
{{ App\Utils\Number::formatMoney($purchase_order->balance, $invoice->company) }}
|
{{ App\Utils\Number::formatMoney($purchase_order->balance, $purchase_order->company) }}
|
||||||
</td>
|
</td>
|
||||||
<td class="px-6 py-4 text-sm leading-5 text-gray-500 whitespace-nowrap">
|
<td class="px-6 py-4 text-sm leading-5 text-gray-500 whitespace-nowrap">
|
||||||
{{ $purchase_order->translateDate($purchase_order->due_date, $invoice->company->date_format(), $purchase_order->company->locale()) }}
|
{{ $purchase_order->translateDate($purchase_order->due_date, $purchase_order->company->date_format(), $purchase_order->company->locale()) }}
|
||||||
</td>
|
</td>
|
||||||
<td class="px-6 py-4 text-sm leading-5 text-gray-500 whitespace-nowrap">
|
<td class="px-6 py-4 text-sm leading-5 text-gray-500 whitespace-nowrap">
|
||||||
{!! App\Models\PurchaseOrder::badgeForStatus($purchase_order->status) !!}
|
{!! App\Models\PurchaseOrder::badgeForStatus($purchase_order->status_id) !!}
|
||||||
</td>
|
</td>
|
||||||
<td class="flex items-center justify-end px-6 py-4 text-sm font-medium leading-5 whitespace-nowrap">
|
<td class="flex items-center justify-end px-6 py-4 text-sm font-medium leading-5 whitespace-nowrap">
|
||||||
<a href="{{ route('vendor.purchase_order.show', $purchase_order->hashed_id) }}" class="button-link text-primary">
|
<a href="{{ route('vendor.purchase_order.show', $purchase_order->hashed_id) }}" class="button-link text-primary">
|
||||||
@ -111,7 +111,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="flex justify-center mt-6 mb-6 md:justify-between">
|
<div class="flex justify-center mt-6 mb-6 md:justify-between">
|
||||||
@if($invoices && $invoices->total() > 0)
|
@if($purchase_orders && $purchase_orders->total() > 0)
|
||||||
<span class="hidden text-sm text-gray-700 md:block mr-2">
|
<span class="hidden text-sm text-gray-700 md:block mr-2">
|
||||||
{{ ctrans('texts.showing_x_of', ['first' => $purchase_orders->firstItem(), 'last' => $purchase_orders->lastItem(), 'total' => $purchase_orders->total()]) }}
|
{{ ctrans('texts.showing_x_of', ['first' => $purchase_orders->firstItem(), 'last' => $purchase_orders->lastItem(), 'total' => $purchase_orders->total()]) }}
|
||||||
</span>
|
</span>
|
@ -1,4 +1,4 @@
|
|||||||
@extends('portal.ninja2020.layout.app')
|
@extends('portal.ninja2020.layout.vendor_app')
|
||||||
@section('meta_title', ctrans('texts.purchase_orders'))
|
@section('meta_title', ctrans('texts.purchase_orders'))
|
||||||
|
|
||||||
@section('header')
|
@section('header')
|
||||||
@ -20,6 +20,6 @@
|
|||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
<div class="flex flex-col mt-4">
|
<div class="flex flex-col mt-4">
|
||||||
@livewire('purchase_orders-table', ['company' => $company])
|
@livewire('purchase-orders-table', ['company' => $company])
|
||||||
</div>
|
</div>
|
||||||
@endsection
|
@endsection
|
||||||
|
@ -29,5 +29,6 @@ Route::group(['middleware' => ['auth:vendor', 'vendor_locale', 'domain_db'], 'pr
|
|||||||
Route::get('purchase_orders/{purchase_order}', [PurchaseOrderController::class, 'show'])->name('purchase_order.show');
|
Route::get('purchase_orders/{purchase_order}', [PurchaseOrderController::class, 'show'])->name('purchase_order.show');
|
||||||
|
|
||||||
Route::get('profile/{vendor_contact}/edit', [PurchaseOrderController::class, 'index'])->name('profile.edit');
|
Route::get('profile/{vendor_contact}/edit', [PurchaseOrderController::class, 'index'])->name('profile.edit');
|
||||||
|
Route::post('invoices/payment', [PurchaseOrderController::class, 'bulk'])->name('purchase_orders.bulk');
|
||||||
|
|
||||||
});
|
});
|
Loading…
x
Reference in New Issue
Block a user