Merge pull request #3851 from devansh-webkul/reverting_feature
Reverted Invoice Feature
This commit is contained in:
commit
63cced9d69
|
|
@ -45,19 +45,6 @@ class OrderInvoicesDataGrid extends DataGrid
|
|||
'filterable' => true,
|
||||
]);
|
||||
|
||||
$this->addColumn([
|
||||
'index' => 'created_at',
|
||||
'label' => trans('admin::app.datagrid.invoice-date'),
|
||||
'type' => 'string',
|
||||
'searchable' => true,
|
||||
'sortable' => true,
|
||||
'filterable' => true,
|
||||
'closure' => true,
|
||||
'wrapper' => function ($value) {
|
||||
return \Carbon\Carbon::parse($value->created_at)->format('d-m-Y');
|
||||
}
|
||||
]);
|
||||
|
||||
$this->addColumn([
|
||||
'index' => 'base_grand_total',
|
||||
'label' => trans('admin::app.datagrid.grand-total'),
|
||||
|
|
@ -68,22 +55,12 @@ class OrderInvoicesDataGrid extends DataGrid
|
|||
]);
|
||||
|
||||
$this->addColumn([
|
||||
'index' => 'state',
|
||||
'label' => trans('admin::app.datagrid.state'),
|
||||
'type' => 'string',
|
||||
'closure' => true,
|
||||
'index' => 'created_at',
|
||||
'label' => trans('admin::app.datagrid.invoice-date'),
|
||||
'type' => 'datetime',
|
||||
'searchable' => true,
|
||||
'sortable' => true,
|
||||
'filterable' => true,
|
||||
'wrapper' => function ($value) {
|
||||
if ($value->state == 'paid') {
|
||||
return '<span class="badge badge-md badge-success">'. trans('admin::app.sales.orders.invoice-status-paid') .'</span>';
|
||||
} elseif ($value->state == "pending") {
|
||||
return '<span class="badge badge-md badge-warning">'. trans('admin::app.sales.orders.invoice-status-pending') .'</span>';
|
||||
} elseif ($value->state == "overdue") {
|
||||
return '<span class="badge badge-md badge-danger">'. trans('admin::app.sales.orders.invoice-status-overdue') . '</span>';
|
||||
}
|
||||
}
|
||||
]);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -2,12 +2,9 @@
|
|||
|
||||
namespace Webkul\Admin\Http\Controllers\Sales;
|
||||
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
use Webkul\Admin\Http\Controllers\Controller;
|
||||
use Webkul\Sales\Repositories\OrderRepository;
|
||||
use Webkul\Sales\Repositories\InvoiceRepository;
|
||||
|
||||
use PDF;
|
||||
|
||||
class InvoiceController extends Controller
|
||||
|
|
@ -148,24 +145,4 @@ class InvoiceController extends Controller
|
|||
|
||||
return $pdf->download('invoice-' . $invoice->created_at->format('d-m-Y') . '.pdf');
|
||||
}
|
||||
|
||||
/**
|
||||
* Update the invoice state.
|
||||
*
|
||||
* @param int $id
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function updateState($id, Request $request)
|
||||
{
|
||||
$invoice = $this->invoiceRepository->findOrFail($id);
|
||||
$task = $this->invoiceRepository->updateInvoiceState($invoice, $request->state);
|
||||
|
||||
if ($task){
|
||||
session()->flash('success', trans('admin::app.sales.orders.invoice-status-confirmed'));
|
||||
} else {
|
||||
session()->flash('success', trans('admin::app.sales.orders.invoice-status-error'));
|
||||
}
|
||||
|
||||
return back();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -211,10 +211,6 @@ Route::group(['middleware' => ['web']], function () {
|
|||
'view' => 'admin::sales.invoices.print',
|
||||
])->name('admin.sales.invoices.print');
|
||||
|
||||
Route::post('/invoices/update/state/{order_id}', 'Webkul\Admin\Http\Controllers\Sales\InvoiceController@updateState')->defaults('_config', [
|
||||
'redirect' => 'admin.sales.orders.view',
|
||||
])->name('admin.sales.invoices.update.state');
|
||||
|
||||
|
||||
// Sales Shipments Routes
|
||||
Route::get('/shipments', 'Webkul\Admin\Http\Controllers\Sales\ShipmentController@index')->defaults('_config', [
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load Diff
|
|
@ -320,14 +320,6 @@ return [
|
|||
'invoice-btn-title' => 'Invoice',
|
||||
'info' => 'Information',
|
||||
'invoices' => 'Invoices',
|
||||
'invoices-change-title' => 'Change invoice state',
|
||||
'invoices-change-state-desc' => 'Please select the new invoice state:',
|
||||
'invoice-status-paid' => 'Paid',
|
||||
'invoice-status-pending' => 'Pending',
|
||||
'invoice-status-overdue' => 'Overdue',
|
||||
'invoice-status-update' => 'Save changes',
|
||||
'invoice-status-confirmed' => 'The invoice state has been changed.',
|
||||
'invoice-status-error' => 'Could not update the invoice state. ',
|
||||
'shipments' => 'Shipments',
|
||||
'order-and-account' => 'Order and Account',
|
||||
'order-info' => 'Order Information',
|
||||
|
|
|
|||
|
|
@ -318,14 +318,6 @@ return [
|
|||
'invoice-btn-title' => 'صورت حساب',
|
||||
'info' => 'اطلاعات',
|
||||
'invoices' => 'صورت حساب ها',
|
||||
'invoices-change-title' => 'Change invoice state',
|
||||
'invoices-change-state-desc' => 'Please select the new invoice state:',
|
||||
'invoice-status-paid' => 'Paid',
|
||||
'invoice-status-pending' => 'Pending',
|
||||
'invoice-status-overdue' => 'Overdue',
|
||||
'invoice-status-update' => 'Save changes',
|
||||
'invoice-status-confirmed' => 'The invoice state has been changed.',
|
||||
'invoice-status-error' => 'Could not update the invoice state. ',
|
||||
'shipments' => 'حمل و نقل ها',
|
||||
'order-and-account' => 'سفارش و حساب',
|
||||
'order-info' => 'اطلاعات سفارش',
|
||||
|
|
|
|||
|
|
@ -319,14 +319,6 @@ return [
|
|||
'invoice-btn-title' => 'Fattura',
|
||||
'info' => 'Informazoni',
|
||||
'invoices' => 'Fatture',
|
||||
'invoices-change-title' => 'Change invoice state',
|
||||
'invoices-change-state-desc' => 'Please select the new invoice state:',
|
||||
'invoice-status-paid' => 'Paid',
|
||||
'invoice-status-pending' => 'Pending',
|
||||
'invoice-status-overdue' => 'Overdue',
|
||||
'invoice-status-update' => 'Save changes',
|
||||
'invoice-status-confirmed' => 'The invoice state has been changed.',
|
||||
'invoice-status-error' => 'Could not update the invoice state. ',
|
||||
'shipments' => 'Spedizioni',
|
||||
'order-and-account' => 'Ordine e Account',
|
||||
'order-info' => 'informazioni Ordine',
|
||||
|
|
|
|||
|
|
@ -319,14 +319,6 @@ return [
|
|||
'invoice-btn-title' => 'Factuur',
|
||||
'info' => 'Informatie',
|
||||
'invoices' => 'Facturen',
|
||||
'invoices-change-title' => 'Change invoice state',
|
||||
'invoices-change-state-desc' => 'Please select the new invoice state:',
|
||||
'invoice-status-paid' => 'Paid',
|
||||
'invoice-status-pending' => 'Pending',
|
||||
'invoice-status-overdue' => 'Overdue',
|
||||
'invoice-status-update' => 'Save changes',
|
||||
'invoice-status-confirmed' => 'The invoice state has been changed.',
|
||||
'invoice-status-error' => 'Could not update the invoice state. ',
|
||||
'shipments' => 'Verzendingen',
|
||||
'order-and-account' => 'Order and Account',
|
||||
'order-info' => 'Order Information',
|
||||
|
|
|
|||
|
|
@ -317,14 +317,6 @@ return [
|
|||
'invoice-btn-title' => 'Faktura',
|
||||
'info' => 'Informacje',
|
||||
'invoices' => 'Faktury',
|
||||
'invoices-change-title' => 'Change invoice state',
|
||||
'invoices-change-state-desc' => 'Please select the new invoice state:',
|
||||
'invoice-status-paid' => 'Paid',
|
||||
'invoice-status-pending' => 'Pending',
|
||||
'invoice-status-overdue' => 'Overdue',
|
||||
'invoice-status-update' => 'Save changes',
|
||||
'invoice-status-confirmed' => 'The invoice state has been changed.',
|
||||
'invoice-status-error' => 'Could not update the invoice state. ',
|
||||
'shipments' => 'Przesyłki',
|
||||
'order-and-account' => 'Zamówienie i konto',
|
||||
'order-info' => 'Informacje o zamówieniu',
|
||||
|
|
|
|||
|
|
@ -318,14 +318,6 @@ return [
|
|||
'invoice-btn-title' => 'Faturar',
|
||||
'info' => 'Informação',
|
||||
'invoices' => 'Faturas',
|
||||
'invoices-change-title' => 'Change invoice state',
|
||||
'invoices-change-state-desc' => 'Please select the new invoice state:',
|
||||
'invoice-status-paid' => 'Paid',
|
||||
'invoice-status-pending' => 'Pending',
|
||||
'invoice-status-overdue' => 'Overdue',
|
||||
'invoice-status-update' => 'Save changes',
|
||||
'invoice-status-confirmed' => 'The invoice state has been changed.',
|
||||
'invoice-status-error' => 'Could not update the invoice state. ',
|
||||
'shipments' => 'Envios',
|
||||
'order-and-account' => 'Pedido e Conta',
|
||||
'order-info' => 'Informação do Pedido',
|
||||
|
|
|
|||
|
|
@ -316,14 +316,6 @@ return [
|
|||
'invoice-btn-title' => 'Fatura',
|
||||
'info' => 'Bilgi',
|
||||
'invoices' => 'Faturalar',
|
||||
'invoices-change-title' => 'Change invoice state',
|
||||
'invoices-change-state-desc' => 'Please select the new invoice state:',
|
||||
'invoice-status-paid' => 'Paid',
|
||||
'invoice-status-pending' => 'Pending',
|
||||
'invoice-status-overdue' => 'Overdue',
|
||||
'invoice-status-update' => 'Save changes',
|
||||
'invoice-status-confirmed' => 'The invoice state has been changed.',
|
||||
'invoice-status-error' => 'Could not update the invoice state. ',
|
||||
'shipments' => 'Kargo',
|
||||
'order-and-account' => 'Sipariş ve Hesap',
|
||||
'order-info' => 'Sipariş Bilgisi',
|
||||
|
|
|
|||
|
|
@ -13,7 +13,10 @@
|
|||
|
||||
<div class="page-action">
|
||||
<div class="export-import" @click="showModal('downloadDataGrid')">
|
||||
<i class="export-icon"></i> <span>{{ __('admin::app.export.export') }}</span>
|
||||
<i class="export-icon"></i>
|
||||
<span>
|
||||
{{ __('admin::app.export.export') }}
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -1,10 +1,10 @@
|
|||
@extends('admin::layouts.content')
|
||||
@extends('admin::layouts.master')
|
||||
|
||||
@section('page_title')
|
||||
{{ __('admin::app.sales.invoices.view-title', ['invoice_id' => $invoice->id]) }}
|
||||
@stop
|
||||
|
||||
@section('content')
|
||||
@section('content-wrapper')
|
||||
|
||||
<?php $order = $invoice->order; ?>
|
||||
|
||||
|
|
@ -15,18 +15,11 @@
|
|||
{!! view_render_event('sales.invoice.title.before', ['order' => $order]) !!}
|
||||
|
||||
<i class="icon angle-left-icon back-link" onclick="history.length > 1 ? history.go(-1) : window.location = '{{ route('admin.dashboard.index') }}';"></i>
|
||||
|
||||
{{ __('admin::app.sales.invoices.view-title', ['invoice_id' => $invoice->id]) }}
|
||||
|
||||
{!! view_render_event('sales.invoice.title.after', ['order' => $order]) !!}
|
||||
</h1>
|
||||
|
||||
@if($invoice->state == 'paid')
|
||||
<small><span class="badge badge-md badge-success">{{ __('admin::app.sales.orders.invoice-status-paid') }}</span></small>
|
||||
@elseif($invoice->state == 'pending')
|
||||
<span class="badge badge-md badge-warning">{{ __('admin::app.sales.orders.invoice-status-pending') }}</span>
|
||||
@else
|
||||
<span class="badge badge-md badge-danger">{{ __('admin::app.sales.orders.invoice-status-overdue') }}</span>
|
||||
@endif
|
||||
</div>
|
||||
|
||||
<div class="page-action">
|
||||
|
|
@ -36,10 +29,6 @@
|
|||
{{ __('admin::app.sales.invoices.print') }}
|
||||
</a>
|
||||
|
||||
@if($invoice->state == "pending" || $invoice->state == "overdue")
|
||||
<a href="#" id="ChangeStatus" class="btn btn-lg btn-primary" @click="showModal('changeInvoiceState')">{{ __('admin::app.sales.orders.invoices-change-title') }}</a>
|
||||
@endif
|
||||
|
||||
{!! view_render_event('sales.invoice.page_action.after', ['order' => $order]) !!}
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -48,7 +37,7 @@
|
|||
<div class="sale-container">
|
||||
|
||||
<accordian :title="'{{ __('admin::app.sales.orders.order-and-account') }}'" :active="true">
|
||||
<div slot="body" style="display: flex; overflow:auto;">
|
||||
<div slot="body">
|
||||
|
||||
<div class="sale-section">
|
||||
<div class="secton-title">
|
||||
|
|
@ -57,7 +46,10 @@
|
|||
|
||||
<div class="section-content">
|
||||
<div class="row">
|
||||
<span class="title">{{ __('admin::app.sales.invoices.order-id') }}</span>
|
||||
<span class="title">
|
||||
{{ __('admin::app.sales.invoices.order-id') }}
|
||||
</span>
|
||||
|
||||
<span class="value">
|
||||
<a href="{{ route('admin.sales.orders.view', $order->id) }}">#{{ $order->increment_id }}</a>
|
||||
</span>
|
||||
|
|
@ -66,40 +58,44 @@
|
|||
{!! view_render_event('sales.invoice.increment_id.after', ['order' => $order]) !!}
|
||||
|
||||
<div class="row">
|
||||
<span class="title">{{ __('admin::app.sales.orders.order-date') }}</span>
|
||||
<span class="value">{{ $order->created_at }}</span>
|
||||
<span class="title">
|
||||
{{ __('admin::app.sales.orders.order-date') }}
|
||||
</span>
|
||||
|
||||
<span class="value">
|
||||
{{ $order->created_at }}
|
||||
</span>
|
||||
</div>
|
||||
|
||||
{!! view_render_event('sales.invoice.created_at.after', ['order' => $order]) !!}
|
||||
|
||||
<div class="row">
|
||||
<span class="title">{{ __('admin::app.sales.orders.order-status') }}</span>
|
||||
<span class="value">{{ $order->status_label }}</span>
|
||||
<span class="title">
|
||||
{{ __('admin::app.sales.orders.order-status') }}
|
||||
</span>
|
||||
|
||||
<span class="value">
|
||||
{{ $order->status_label }}
|
||||
</span>
|
||||
</div>
|
||||
|
||||
{!! view_render_event('sales.invoice.status_label.after', ['order' => $order]) !!}
|
||||
|
||||
<div class="row">
|
||||
<span class="title">{{ __('admin::app.sales.orders.channel') }}</span>
|
||||
<span class="value">{{ $order->channel_name }}</span>
|
||||
<span class="title">
|
||||
{{ __('admin::app.sales.orders.channel') }}
|
||||
</span>
|
||||
|
||||
<span class="value">
|
||||
{{ $order->channel_name }}
|
||||
</span>
|
||||
</div>
|
||||
|
||||
{!! view_render_event('sales.invoice.channel_name.after', ['order' => $order]) !!}
|
||||
|
||||
<div class="row">
|
||||
<span class="title">{{ __('admin::app.sales.orders.payment-method') }}</span>
|
||||
<span class="value">{{ core()->getConfigData('sales.paymentmethods.' . $order->payment->method . '.title') }}</span>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<span class="title">{{ __('admin::app.sales.orders.shipping-method') }}</span>
|
||||
<span class="value">{{ $order->shipping_title }}</span>
|
||||
</div>
|
||||
{!! view_render_event('sales.invoice.shipping-method.after', ['order' => $order]) !!}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="sale-section" style="margin: 0 0 0 300px;">
|
||||
<div class="sale-section">
|
||||
<div class="secton-title">
|
||||
<span>{{ __('admin::app.sales.orders.account-info') }}</span>
|
||||
</div>
|
||||
|
|
@ -184,7 +180,9 @@
|
|||
@foreach ($invoice->items as $item)
|
||||
<tr>
|
||||
<td>{{ $item->getTypeInstance()->getOrderedItem($item)->sku }}</td>
|
||||
<td>{{ $item->name }}
|
||||
|
||||
<td>
|
||||
{{ $item->name }}
|
||||
|
||||
@if (isset($item->additional['attributes']))
|
||||
<div class="item-options">
|
||||
|
|
@ -192,14 +190,19 @@
|
|||
@foreach ($item->additional['attributes'] as $attribute)
|
||||
<b>{{ $attribute['attribute_name'] }} : </b>{{ $attribute['option_label'] }}</br>
|
||||
@endforeach
|
||||
|
||||
</div>
|
||||
@endif
|
||||
</td>
|
||||
|
||||
<td>{{ core()->formatBasePrice($item->base_price) }}</td>
|
||||
|
||||
<td>{{ $item->qty }}</td>
|
||||
|
||||
<td>{{ core()->formatBasePrice($item->base_total) }}</td>
|
||||
|
||||
<td>{{ core()->formatBasePrice($item->base_tax_amount) }}</td>
|
||||
|
||||
@if ($invoice->base_discount_amount > 0)
|
||||
<td>{{ core()->formatBasePrice($item->base_discount_amount) }}</td>
|
||||
@endif
|
||||
|
|
@ -207,6 +210,7 @@
|
|||
<td>{{ core()->formatBasePrice($item->base_total + $item->base_tax_amount - $item->base_discount_amount) }}</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
|
@ -244,61 +248,12 @@
|
|||
<td>{{ core()->formatBasePrice($invoice->base_grand_total) }}</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
</div>
|
||||
</accordian>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<modal id="changeInvoiceState" :is-open="modalIds.changeInvoiceState">
|
||||
<h3 slot="header">{{ __('admin::app.sales.orders.invoices-change-title') }}</h3>
|
||||
<div slot="body">
|
||||
<option-wrapper></option-wrapper>
|
||||
</div>
|
||||
</modal>
|
||||
@stop
|
||||
|
||||
@push('scripts')
|
||||
<script type="text/x-template" id="options-template">
|
||||
<form method="POST" action="{{ route('admin.sales.invoices.update.state', $invoice->id) }}">
|
||||
<div class="page-content">
|
||||
<p>Please select the new invoice state:</p>
|
||||
|
||||
<div class="form-container">
|
||||
@csrf()
|
||||
<div>
|
||||
<input type="radio" name="state" id="paid" value="paid">
|
||||
<label for="paid">{{ __('admin::app.sales.orders.invoice-status-paid') }}</label>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<input type="radio" name="state" id="pending" value="pending" @if($invoice->state == "pending") checked @endif>
|
||||
<label for="pending">{{ __('admin::app.sales.orders.invoice-status-pending') }}</label>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<input type="radio" name="state" id="overdue" value="overdue" @if($invoice->state == "overdue") checked @endif>
|
||||
<label for="overdue">{{ __('admin::app.sales.orders.invoice-status-overdue') }}</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<br />
|
||||
|
||||
<button type="submit" class="btn btn-md btn-primary">{{ __('admin::app.sales.orders.invoice-status-update')}}</button>
|
||||
</div>
|
||||
</form>
|
||||
</script>
|
||||
|
||||
<script>
|
||||
Vue.component('option-wrapper', {
|
||||
template: '#options-template',
|
||||
|
||||
methods: {
|
||||
onSubmit: function(e) {
|
||||
// e.target.submit();
|
||||
}
|
||||
}
|
||||
});
|
||||
</script>
|
||||
@endpush
|
||||
@stop
|
||||
|
|
@ -473,16 +473,8 @@
|
|||
<td>#{{ $invoice->id }}</td>
|
||||
<td>{{ $invoice->created_at }}</td>
|
||||
<td>#{{ $invoice->order->increment_id }}</td>
|
||||
<td>{{ $invoice->order->customer_full_name }}</td>
|
||||
<td>
|
||||
@if($invoice->state == "paid")
|
||||
{{ __('admin::app.sales.orders.invoice-status-paid') }}
|
||||
@elseif($invoice->state == "overdue")
|
||||
{{ __('admin::app.sales.orders.invoice-status-overdue') }}
|
||||
@else
|
||||
{{ __('admin::app.sales.orders.invoice-status-pending') }}
|
||||
@endif
|
||||
</td>
|
||||
<td>{{ $invoice->address->name }}</td>
|
||||
<td>{{ $invoice->status_label }}</td>
|
||||
<td>{{ core()->formatBasePrice($invoice->base_grand_total) }}</td>
|
||||
<td class="action">
|
||||
<a href="{{ route('admin.sales.invoices.view', $invoice->id) }}">
|
||||
|
|
|
|||
|
|
@ -106,8 +106,6 @@ class Ipn
|
|||
|
||||
if ($this->order->canInvoice()) {
|
||||
$invoice = $this->invoiceRepository->create($this->prepareInvoiceData());
|
||||
|
||||
$this->invoiceRepository->updateInvoiceState($invoice, "paid");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -282,12 +282,6 @@ class Order extends Model implements OrderContract
|
|||
return false;
|
||||
}
|
||||
|
||||
foreach ($this->invoices as $item) {
|
||||
if ($item->state == 'pending' || $item->state == 'overdue') {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
foreach ($this->items as $item) {
|
||||
if ($item->qty_to_refund > 0 && $item->order->status !== self::STATUS_CLOSED) {
|
||||
return true;
|
||||
|
|
|
|||
|
|
@ -97,7 +97,7 @@ class InvoiceRepository extends Repository
|
|||
$invoice = $this->model->create([
|
||||
'order_id' => $order->id,
|
||||
'total_qty' => $totalQty,
|
||||
'state' => 'pending',
|
||||
'state' => 'paid',
|
||||
'base_currency_code' => $order->base_currency_code,
|
||||
'channel_currency_code' => $order->channel_currency_code,
|
||||
'order_currency_code' => $order->order_currency_code,
|
||||
|
|
@ -192,8 +192,11 @@ class InvoiceRepository extends Repository
|
|||
}
|
||||
|
||||
$this->collectTotals($invoice);
|
||||
|
||||
$this->orderRepository->collectTotals($order);
|
||||
|
||||
$this->orderRepository->updateOrderStatus($order);
|
||||
|
||||
Event::dispatch('sales.invoice.save.after', $invoice);
|
||||
} catch (\Exception $e) {
|
||||
DB::rollBack();
|
||||
|
|
@ -253,21 +256,4 @@ class InvoiceRepository extends Repository
|
|||
|
||||
return $invoice;
|
||||
}
|
||||
|
||||
/*
|
||||
* @param \Webkul\Sales\Contracts\Invoice $invoice
|
||||
* @return void
|
||||
*/
|
||||
public function updateInvoiceState($invoice, $status)
|
||||
{
|
||||
$invoice->state = $status;
|
||||
$invoice->save();
|
||||
|
||||
if ($status == 'paid'){
|
||||
$order = $this->orderRepository->findOrFail($invoice->order->id);
|
||||
$this->orderRepository->updateOrderStatus($order);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue