Merge branch '1.3-dev' of github.com:akaunting/akaunting into 1.3-dev
This commit is contained in:
commit
2009dfbf00
@ -14,6 +14,7 @@ use App\Models\Expense\BillStatus;
|
|||||||
use App\Models\Expense\Vendor;
|
use App\Models\Expense\Vendor;
|
||||||
use App\Models\Expense\Bill;
|
use App\Models\Expense\Bill;
|
||||||
use App\Models\Expense\BillItem;
|
use App\Models\Expense\BillItem;
|
||||||
|
use App\Models\Expense\BillItemTax;
|
||||||
use App\Models\Expense\BillTotal;
|
use App\Models\Expense\BillTotal;
|
||||||
use App\Models\Expense\BillHistory;
|
use App\Models\Expense\BillHistory;
|
||||||
use App\Models\Expense\BillPayment;
|
use App\Models\Expense\BillPayment;
|
||||||
@ -187,7 +188,7 @@ class Bills extends Controller
|
|||||||
|
|
||||||
if ($bill_item_taxes) {
|
if ($bill_item_taxes) {
|
||||||
foreach ($bill_item_taxes as $bill_item_tax) {
|
foreach ($bill_item_taxes as $bill_item_tax) {
|
||||||
$bill_item_tax['invoice_item_id'] = $bill_item_created->id;
|
$bill_item_tax['bill_item_id'] = $bill_item_created->id;
|
||||||
|
|
||||||
BillItemTax::create($bill_item_tax);
|
BillItemTax::create($bill_item_tax);
|
||||||
|
|
||||||
@ -423,7 +424,7 @@ class Bills extends Controller
|
|||||||
|
|
||||||
if ($bill_item_taxes) {
|
if ($bill_item_taxes) {
|
||||||
foreach ($bill_item_taxes as $bill_item_tax) {
|
foreach ($bill_item_taxes as $bill_item_tax) {
|
||||||
$bill_item_tax['invoice_item_id'] = $bill_item_created->id;
|
$bill_item_tax['bill_item_id'] = $bill_item_created->id;
|
||||||
|
|
||||||
BillItemTax::create($bill_item_tax);
|
BillItemTax::create($bill_item_tax);
|
||||||
|
|
||||||
@ -511,7 +512,7 @@ class Bills extends Controller
|
|||||||
\Excel::create('bills', function ($excel) {
|
\Excel::create('bills', function ($excel) {
|
||||||
$bills = Bill::with(['items', 'histories', 'payments', 'totals'])->filter(request()->input())->get();
|
$bills = Bill::with(['items', 'histories', 'payments', 'totals'])->filter(request()->input())->get();
|
||||||
|
|
||||||
$excel->sheet('invoices', function ($sheet) use ($bills) {
|
$excel->sheet('bills', function ($sheet) use ($bills) {
|
||||||
$sheet->fromModel($bills->makeHidden([
|
$sheet->fromModel($bills->makeHidden([
|
||||||
'company_id', 'parent_id', 'created_at', 'updated_at', 'deleted_at', 'attachment', 'discount', 'items', 'histories', 'payments', 'totals', 'media'
|
'company_id', 'parent_id', 'created_at', 'updated_at', 'deleted_at', 'attachment', 'discount', 'items', 'histories', 'payments', 'totals', 'media'
|
||||||
]));
|
]));
|
||||||
|
@ -835,3 +835,11 @@ input[type="number"] {
|
|||||||
line-height: 1.428571;
|
line-height: 1.428571;
|
||||||
border-radius: 30px;
|
border-radius: 30px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.row.show-invoice .timeline>li {
|
||||||
|
margin-right: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.row.show-invoice .timeline>li a:first-child {
|
||||||
|
margin-left: 10px;
|
||||||
|
}
|
||||||
|
@ -41,6 +41,18 @@ return [
|
|||||||
|
|
||||||
'messages' => [
|
'messages' => [
|
||||||
'received' => 'Bill marked as received successfully!',
|
'received' => 'Bill marked as received successfully!',
|
||||||
|
'draft' => 'This is a <b>DRAFT</b> bill and will be reflected to charts once it gets receive.',
|
||||||
|
|
||||||
|
'status' => [
|
||||||
|
'created' => 'Created on :date',
|
||||||
|
'receive' => [
|
||||||
|
'draft' => 'Not sent',
|
||||||
|
'received' => 'Send on :date',
|
||||||
|
],
|
||||||
|
'paid' => [
|
||||||
|
'await' => 'Awaiting payment',
|
||||||
|
],
|
||||||
|
],
|
||||||
],
|
],
|
||||||
|
|
||||||
];
|
];
|
||||||
|
@ -124,6 +124,9 @@ return [
|
|||||||
'title' => [
|
'title' => [
|
||||||
'new' => 'New :type',
|
'new' => 'New :type',
|
||||||
'edit' => 'Edit :type',
|
'edit' => 'Edit :type',
|
||||||
|
'create' => 'Create :type',
|
||||||
|
'send' => 'Send :type',
|
||||||
|
'get' => 'Get :type',
|
||||||
],
|
],
|
||||||
|
|
||||||
'form' => [
|
'form' => [
|
||||||
|
@ -46,6 +46,18 @@ return [
|
|||||||
'email_sent' => 'Invoice email has been sent successfully!',
|
'email_sent' => 'Invoice email has been sent successfully!',
|
||||||
'marked_sent' => 'Invoice marked as sent successfully!',
|
'marked_sent' => 'Invoice marked as sent successfully!',
|
||||||
'email_required' => 'No email address for this customer!',
|
'email_required' => 'No email address for this customer!',
|
||||||
|
'draft' => 'This is a <b>DRAFT</b> invoice and will be reflected to charts once it gets sent.',
|
||||||
|
|
||||||
|
'status' => [
|
||||||
|
'created' => 'Created on :date',
|
||||||
|
'send' => [
|
||||||
|
'draft' => 'Not sent',
|
||||||
|
'sent' => 'Send on :date',
|
||||||
|
],
|
||||||
|
'paid' => [
|
||||||
|
'await' => 'Awaiting payment',
|
||||||
|
],
|
||||||
|
],
|
||||||
],
|
],
|
||||||
|
|
||||||
'notification' => [
|
'notification' => [
|
||||||
|
@ -15,6 +15,74 @@
|
|||||||
</div>
|
</div>
|
||||||
@endif
|
@endif
|
||||||
|
|
||||||
|
@if ($bill->status->code == 'draft')
|
||||||
|
<div class="callout callout-warning">
|
||||||
|
<p>{!! trans('invoices.messages.draft') !!}</p>
|
||||||
|
</div>
|
||||||
|
@endif
|
||||||
|
|
||||||
|
@if ($bill->status->code != 'paid')
|
||||||
|
<div class="row show-invoice">
|
||||||
|
<div class="col-md-12 no-padding-right">
|
||||||
|
<ul class="timeline">
|
||||||
|
<li>
|
||||||
|
<i class="fa fa-plus bg-blue"></i>
|
||||||
|
|
||||||
|
<div class="timeline-item">
|
||||||
|
<h3 class="timeline-header">{{ trans('general.title.create', ['type' => trans_choice('general.bills', 1)]) }}</h3>
|
||||||
|
|
||||||
|
<div class="timeline-body">
|
||||||
|
{{ trans_choice('general.statuses', 1) . ': ' . trans('bills.messages.status.created', ['date' => Date::parse($bill->created_at)->format($date_format)]) }}
|
||||||
|
|
||||||
|
<a href="{{ url('expenses/bills/' . $bill->id . '/edit') }}" class="btn btn-default btn-xs">
|
||||||
|
{{ trans('general.edit') }}
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<i class="fa fa-envelope bg-orange"></i>
|
||||||
|
|
||||||
|
<div class="timeline-item">
|
||||||
|
<h3 class="timeline-header">{{ trans('general.title.send', ['type' => trans_choice('general.bills', 1)]) }}</h3>
|
||||||
|
|
||||||
|
<div class="timeline-body">
|
||||||
|
@if ($bill->status->code == 'draft')
|
||||||
|
{{ trans_choice('general.statuses', 1) . ': ' . trans('bills.messages.status.receive.draft') }}
|
||||||
|
|
||||||
|
@permission('update-expenses-bills')
|
||||||
|
<a href="{{ url('expenses/bills/' . $bill->id . '/received') }}" class="btn btn-warning btn-xs">{{ trans('bills.mark_received') }}</a>
|
||||||
|
@endpermission
|
||||||
|
@else
|
||||||
|
{{ trans_choice('general.statuses', 1) . ': ' . trans('bills.messages.status.receive.received', ['date' => Date::parse($bill->created_at)->format($date_format)]) }}
|
||||||
|
@endif
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<i class="fa fa-money bg-green"></i>
|
||||||
|
|
||||||
|
<div class="timeline-item">
|
||||||
|
<h3 class="timeline-header">{{ trans('general.title.get', ['type' => trans('general.paid')]) }}</h3>
|
||||||
|
|
||||||
|
<div class="timeline-body">
|
||||||
|
@if($bill->status->code != 'paid' && empty($bill->payments()->count()))
|
||||||
|
{{ trans_choice('general.statuses', 1) . ': ' . trans('bills.messages.status.paid.await') }}
|
||||||
|
@else
|
||||||
|
{{ trans_choice('general.statuses', 1) . ': ' . trans('general.partially_paid') }}
|
||||||
|
@endif
|
||||||
|
|
||||||
|
@if(empty($bill->payments()->count()) || (!empty($bill->payments()->count()) && $bill->paid != $bill->amount))
|
||||||
|
<a href="#" id="button-payment" class="btn btn-success btn-xs">{{ trans('bills.add_payment') }}</a>
|
||||||
|
@endif
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
@endif
|
||||||
|
|
||||||
<div class="box box-success">
|
<div class="box box-success">
|
||||||
<div class="bill">
|
<div class="bill">
|
||||||
<div id="badge">
|
<div id="badge">
|
||||||
|
@ -15,6 +15,88 @@
|
|||||||
</div>
|
</div>
|
||||||
@endif
|
@endif
|
||||||
|
|
||||||
|
@if ($invoice->status->code == 'draft')
|
||||||
|
<div class="callout callout-warning">
|
||||||
|
<p>{!! trans('invoices.messages.draft') !!}</p>
|
||||||
|
</div>
|
||||||
|
@endif
|
||||||
|
|
||||||
|
@if ($invoice->status->code != 'paid')
|
||||||
|
<div class="row show-invoice">
|
||||||
|
<div class="col-md-12 no-padding-right">
|
||||||
|
<ul class="timeline">
|
||||||
|
<li>
|
||||||
|
<i class="fa fa-plus bg-blue"></i>
|
||||||
|
|
||||||
|
<div class="timeline-item">
|
||||||
|
<h3 class="timeline-header">{{ trans('general.title.create', ['type' => trans_choice('general.invoices', 1)]) }}</h3>
|
||||||
|
|
||||||
|
<div class="timeline-body">
|
||||||
|
{{ trans_choice('general.statuses', 1) . ': ' . trans('invoices.messages.status.created', ['date' => Date::parse($invoice->created_at)->format($date_format)]) }}
|
||||||
|
|
||||||
|
<a href="{{ url('incomes/invoices/' . $invoice->id . '/edit') }}" class="btn btn-default btn-xs">
|
||||||
|
{{ trans('general.edit') }}
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<i class="fa fa-envelope bg-orange"></i>
|
||||||
|
|
||||||
|
<div class="timeline-item">
|
||||||
|
<h3 class="timeline-header">{{ trans('general.title.send', ['type' => trans_choice('general.invoices', 1)]) }}</h3>
|
||||||
|
|
||||||
|
<div class="timeline-body">
|
||||||
|
@if ($invoice->status->code != 'sent' && $invoice->status->code != 'partial')
|
||||||
|
{{ trans_choice('general.statuses', 1) . ': ' . trans('invoices.messages.status.send.draft') }}
|
||||||
|
|
||||||
|
@permission('update-incomes-invoices')
|
||||||
|
@if($invoice->invoice_status_code == 'draft')
|
||||||
|
<a href="{{ url('incomes/invoices/' . $invoice->id . '/sent') }}" class="btn btn-default btn-xs">{{ trans('invoices.mark_sent') }}</a>
|
||||||
|
@else
|
||||||
|
<a href="javascript:void(0);" class="disabled btn btn-default btn-xs"><span class="text-disabled"> {{ trans('invoices.mark_sent') }}</span></a>
|
||||||
|
@endif
|
||||||
|
@endpermission
|
||||||
|
@if($invoice->customer_email)
|
||||||
|
<a href="{{ url('incomes/invoices/' . $invoice->id . '/email') }}" class="btn btn-warning btn-xs">{{ trans('invoices.send_mail') }}</a>
|
||||||
|
@else
|
||||||
|
<a href="javascript:void(0);" class="btn btn-warning btn-xs green-tooltip disabled" data-toggle="tooltip" data-placement="right" title="{{ trans('invoices.messages.email_required') }}">
|
||||||
|
<span class="text-disabled">{{ trans('invoices.send_mail') }}</span>
|
||||||
|
</a>
|
||||||
|
@endif
|
||||||
|
@else
|
||||||
|
{{ trans_choice('general.statuses', 1) . ': ' . trans('invoices.messages.status.send.sent', ['date' => Date::parse($invoice->created_at)->format($date_format)]) }}
|
||||||
|
@endif
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<i class="fa fa-money bg-green"></i>
|
||||||
|
|
||||||
|
<div class="timeline-item">
|
||||||
|
<h3 class="timeline-header">{{ trans('general.title.get', ['type' => trans('general.paid')]) }}</h3>
|
||||||
|
|
||||||
|
<div class="timeline-body">
|
||||||
|
@if($invoice->status->code != 'paid' && empty($invoice->payments()->count()))
|
||||||
|
{{ trans_choice('general.statuses', 1) . ': ' . trans('invoices.messages.status.paid.await') }}
|
||||||
|
@else
|
||||||
|
{{ trans_choice('general.statuses', 1) . ': ' . trans('general.partially_paid') }}
|
||||||
|
@endif
|
||||||
|
|
||||||
|
@permission('update-incomes-invoices')
|
||||||
|
<a href="{{ url('incomes/invoices/' . $invoice->id . '/pay') }}" class="btn btn-default btn-xs">{{ trans('invoices.mark_paid') }}</a>
|
||||||
|
@endpermission
|
||||||
|
@if(empty($invoice->payments()->count()) || (!empty($invoice->payments()->count()) && $invoice->paid != $invoice->amount))
|
||||||
|
<a href="#" id="button-payment" class="btn btn-success btn-xs">{{ trans('invoices.add_payment') }}</a>
|
||||||
|
@endif
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
@endif
|
||||||
|
|
||||||
<div class="box box-success">
|
<div class="box box-success">
|
||||||
<section class="invoice">
|
<section class="invoice">
|
||||||
<div id="badge">
|
<div id="badge">
|
||||||
|
Loading…
x
Reference in New Issue
Block a user