diff --git a/app/Http/Controllers/Expenses/Bills.php b/app/Http/Controllers/Expenses/Bills.php index 13bda6147..778a9ec8d 100644 --- a/app/Http/Controllers/Expenses/Bills.php +++ b/app/Http/Controllers/Expenses/Bills.php @@ -14,6 +14,7 @@ use App\Models\Expense\BillStatus; use App\Models\Expense\Vendor; use App\Models\Expense\Bill; use App\Models\Expense\BillItem; +use App\Models\Expense\BillItemTax; use App\Models\Expense\BillTotal; use App\Models\Expense\BillHistory; use App\Models\Expense\BillPayment; @@ -187,7 +188,7 @@ class Bills extends Controller if ($bill_item_taxes) { 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); @@ -423,7 +424,7 @@ class Bills extends Controller if ($bill_item_taxes) { 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); @@ -511,7 +512,7 @@ class Bills extends Controller \Excel::create('bills', function ($excel) { $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([ 'company_id', 'parent_id', 'created_at', 'updated_at', 'deleted_at', 'attachment', 'discount', 'items', 'histories', 'payments', 'totals', 'media' ])); diff --git a/public/css/app.css b/public/css/app.css index 443cb131e..ba9862cb6 100644 --- a/public/css/app.css +++ b/public/css/app.css @@ -835,3 +835,11 @@ input[type="number"] { line-height: 1.428571; border-radius: 30px; } + +.row.show-invoice .timeline>li { + margin-right: 0; +} + +.row.show-invoice .timeline>li a:first-child { + margin-left: 10px; +} diff --git a/resources/lang/en-GB/bills.php b/resources/lang/en-GB/bills.php index b8832c93d..501cc9414 100644 --- a/resources/lang/en-GB/bills.php +++ b/resources/lang/en-GB/bills.php @@ -41,6 +41,18 @@ return [ 'messages' => [ 'received' => 'Bill marked as received successfully!', + 'draft' => 'This is a DRAFT 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', + ], + ], ], ]; diff --git a/resources/lang/en-GB/general.php b/resources/lang/en-GB/general.php index 116fce799..0c805ee47 100644 --- a/resources/lang/en-GB/general.php +++ b/resources/lang/en-GB/general.php @@ -124,6 +124,9 @@ return [ 'title' => [ 'new' => 'New :type', 'edit' => 'Edit :type', + 'create' => 'Create :type', + 'send' => 'Send :type', + 'get' => 'Get :type', ], 'form' => [ diff --git a/resources/lang/en-GB/invoices.php b/resources/lang/en-GB/invoices.php index 53b99b561..d93d947ab 100644 --- a/resources/lang/en-GB/invoices.php +++ b/resources/lang/en-GB/invoices.php @@ -46,6 +46,18 @@ return [ 'email_sent' => 'Invoice email has been sent successfully!', 'marked_sent' => 'Invoice marked as sent successfully!', 'email_required' => 'No email address for this customer!', + 'draft' => 'This is a DRAFT 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' => [ diff --git a/resources/views/expenses/bills/show.blade.php b/resources/views/expenses/bills/show.blade.php index 9c356e772..8cf28d3e2 100644 --- a/resources/views/expenses/bills/show.blade.php +++ b/resources/views/expenses/bills/show.blade.php @@ -15,6 +15,74 @@ @endif + @if ($bill->status->code == 'draft') +
{!! trans('invoices.messages.draft') !!}
+{!! trans('invoices.messages.draft') !!}
+