renamed income/expense
This commit is contained in:
		
							
								
								
									
										195
									
								
								resources/views/purchases/bills/create.blade.php
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										195
									
								
								resources/views/purchases/bills/create.blade.php
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,195 @@
 | 
			
		||||
@extends('layouts.admin')
 | 
			
		||||
 | 
			
		||||
@section('title', trans('general.title.new', ['type' => trans_choice('general.bills', 1)]))
 | 
			
		||||
 | 
			
		||||
@section('content')
 | 
			
		||||
    <div class="card">
 | 
			
		||||
        {!! Form::open([
 | 
			
		||||
            'route' => 'bills.store',
 | 
			
		||||
            'id' => 'bill',
 | 
			
		||||
            '@submit.prevent' => 'onSubmit',
 | 
			
		||||
            '@keydown' => 'form.errors.clear($event.target.name)',
 | 
			
		||||
            'files' => true,
 | 
			
		||||
            'role' => 'form',
 | 
			
		||||
            'class' => 'form-loading-button',
 | 
			
		||||
            'novalidate' => true
 | 
			
		||||
        ]) !!}
 | 
			
		||||
 | 
			
		||||
            <div class="card-body">
 | 
			
		||||
                <div class="row">
 | 
			
		||||
                    {{ Form::selectAddNewGroup('contact_id', trans_choice('general.vendors', 1), 'user', $vendors, config('general.vendors'), ['required' => 'required', 'change' => 'onChangeContact']) }}
 | 
			
		||||
 | 
			
		||||
                    {{ Form::selectGroup('currency_code', trans_choice('general.currencies', 1), 'exchange-alt', $currencies, setting('default.currency'), ['required' => 'required', 'change' => 'onChangeCurrency']) }}
 | 
			
		||||
 | 
			
		||||
                    {{ Form::dateGroup('billed_at', trans('bills.bill_date'), 'calendar', ['id' => 'billed_at', 'class' => 'form-control datepicker', 'required' => 'required', 'date-format' => 'Y-m-d', 'autocomplete' => 'off'], Date::now()->toDateString()) }}
 | 
			
		||||
 | 
			
		||||
                    {{ Form::dateGroup('due_at', trans('bills.due_date'), 'calendar', ['id' => 'due_at', 'class' => 'form-control datepicker', 'required' => 'required', 'date-format' => 'Y-m-d', 'autocomplete' => 'off'], Date::now()->toDateString()) }}
 | 
			
		||||
 | 
			
		||||
                    {{ Form::textGroup('bill_number', trans('bills.bill_number'), 'file') }}
 | 
			
		||||
 | 
			
		||||
                    {{ Form::textGroup('order_number', trans('bills.order_number'), 'shopping-cart',[]) }}
 | 
			
		||||
 | 
			
		||||
                    <div class="col-md-12 mb-4">
 | 
			
		||||
                        {!! Form::label('items', trans_choice('general.items', 2), ['class' => 'form-control-label']) !!}
 | 
			
		||||
                        <div class="table-responsive">
 | 
			
		||||
                            <table class="table table-bordered"  id="items">
 | 
			
		||||
                                <thead class="thead-light">
 | 
			
		||||
                                    <tr class="row">
 | 
			
		||||
                                        @stack('actions_th_start')
 | 
			
		||||
                                            <th class="col-md-1 action-column border-right-0 border-bottom-0">{{ trans('general.actions') }}</th>
 | 
			
		||||
                                        @stack('actions_th_end')
 | 
			
		||||
 | 
			
		||||
                                        @stack('name_th_start')
 | 
			
		||||
                                            <th class="col-md-3 text-left border-right-0 border-bottom-0">{{ trans('general.name') }}</th>
 | 
			
		||||
                                        @stack('name_th_end')
 | 
			
		||||
 | 
			
		||||
                                        @stack('quantity_th_start')
 | 
			
		||||
                                            <th class="col-md-2 text-center border-right-0 border-bottom-0">{{ trans('bills.quantity') }}</th>
 | 
			
		||||
                                        @stack('quantity_th_end')
 | 
			
		||||
 | 
			
		||||
                                        @stack('price_th_start')
 | 
			
		||||
                                            <th class="col-md-2 text-right border-right-0 border-bottom-0">{{ trans('bills.price') }}</th>
 | 
			
		||||
                                        @stack('price_th_end')
 | 
			
		||||
 | 
			
		||||
                                        @stack('taxes_th_start')
 | 
			
		||||
                                            <th class="col-md-2 text-right border-right-0 border-bottom-0">{{ trans_choice('general.taxes', 1) }}</th>
 | 
			
		||||
                                        @stack('taxes_th_end')
 | 
			
		||||
 | 
			
		||||
                                        @stack('total_th_start')
 | 
			
		||||
                                            <th class="col-md-2 text-right border-bottom-0">{{ trans('bills.total') }}</th>
 | 
			
		||||
                                        @stack('total_th_end')
 | 
			
		||||
                                    </tr>
 | 
			
		||||
                                </thead>
 | 
			
		||||
                                <tbody id="bill-item-rows">
 | 
			
		||||
                                    @include('purchases.bills.item')
 | 
			
		||||
 | 
			
		||||
                                    @stack('add_item_td_start')
 | 
			
		||||
                                        <tr class="row" id="addItem">
 | 
			
		||||
                                            <td class="col-md-1 action-column border-right-0 border-bottom-0"><button type="button" @click="onAddItem" id="button-add-item" data-toggle="tooltip" title="{{ trans('general.add') }}" class="btn btn-icon btn-outline-success btn-lg" data-original-title="{{ trans('general.add') }}"><i class="fa fa-plus"></i></button></td>
 | 
			
		||||
                                            <td class="col-md-11 text-right border-bottom-0"></td>
 | 
			
		||||
                                        </tr>
 | 
			
		||||
                                    @stack('add_item_td_end')
 | 
			
		||||
 | 
			
		||||
                                    @stack('sub_total_td_start')
 | 
			
		||||
                                        <tr class="row" id="tr-subtotal">
 | 
			
		||||
                                            <td class="col-md-10 text-right border-right-0 border-bottom-0">
 | 
			
		||||
                                                <strong>{{ trans('bills.sub_total') }}</strong>
 | 
			
		||||
                                            </td>
 | 
			
		||||
                                            <td class="col-md-2 text-right border-bottom-0 long-texts">
 | 
			
		||||
                                                <span id="sub-total" v-html="totals.sub">0</span>
 | 
			
		||||
                                            </td>
 | 
			
		||||
                                        </tr>
 | 
			
		||||
                                    @stack('sub_total_td_end')
 | 
			
		||||
 | 
			
		||||
                                    @stack('add_discount_td_start')
 | 
			
		||||
                                        <tr class="row" id="tr-discount">
 | 
			
		||||
                                            <td class="col-md-10 text-right border-right-0 border-bottom-0">
 | 
			
		||||
                                                <el-popover
 | 
			
		||||
                                                    popper-class="p-0 h-0"
 | 
			
		||||
                                                    placement="bottom"
 | 
			
		||||
                                                    width="300"
 | 
			
		||||
                                                    v-model="discount">
 | 
			
		||||
                                                    <div class="card">
 | 
			
		||||
                                                        <div class="discount card-body">
 | 
			
		||||
                                                            <div class="row align-items-center">
 | 
			
		||||
                                                                <div class="col-md-6">
 | 
			
		||||
                                                                    <div class="input-group input-group-merge">
 | 
			
		||||
                                                                        <div class="input-group-prepend">
 | 
			
		||||
                                                                            <span class="input-group-text" id="input-discount">
 | 
			
		||||
                                                                                <i class="fa fa-percent"></i>
 | 
			
		||||
                                                                            </span>
 | 
			
		||||
                                                                        </div>
 | 
			
		||||
                                                                        {!! Form::number('pre_discount', null, ['id' => 'pre-discount', 'class' => 'form-control text-right']) !!}
 | 
			
		||||
                                                                    </div>
 | 
			
		||||
                                                                </div>
 | 
			
		||||
                                                                <div class="col-md-6">
 | 
			
		||||
                                                                    <div class="discount-description">
 | 
			
		||||
                                                                        <strong>{{ trans('invoices.discount_desc') }}</strong>
 | 
			
		||||
                                                                    </div>
 | 
			
		||||
                                                                </div>
 | 
			
		||||
                                                            </div>
 | 
			
		||||
                                                        </div>
 | 
			
		||||
                                                            <div class="discount card-footer">
 | 
			
		||||
                                                                <div class="row text-center">
 | 
			
		||||
                                                                    <div class="col-md-12">
 | 
			
		||||
                                                                        <a href="javascript:void(0)" @click="discount = false"  class="btn btn-icon btn-outline-secondary">
 | 
			
		||||
                                                                            <span class="btn-inner--icon"><i class="fas fa-times"></i></span>
 | 
			
		||||
                                                                            <span class="btn-inner--text">{{ trans('general.cancel') }}</span>
 | 
			
		||||
                                                                        </a>
 | 
			
		||||
                                                                        {!! Form::button('<span class="fa fa-save"></span>  ' . trans('general.save'), ['type' => 'button', 'id' => 'save-discount', '@click' => 'onAddDiscount', 'class' => 'btn btn-success']) !!}
 | 
			
		||||
                                                                    </div>
 | 
			
		||||
                                                                </div>
 | 
			
		||||
                                                            </div>
 | 
			
		||||
                                                        </div>
 | 
			
		||||
                                                    <el-link slot="reference" type="primary" v-if="!totals.discount_text">{{ trans('invoices.add_discount') }}</el-link>
 | 
			
		||||
                                                    <el-link slot="reference" type="primary" v-if="totals.discount_text" v-html="totals.discount_text"></el-link>
 | 
			
		||||
                                                </el-popover>
 | 
			
		||||
                                            </td>
 | 
			
		||||
                                            <td class="col-md-2 text-right border-bottom-0">
 | 
			
		||||
                                                <span id="discount-total" v-html="totals.discount"></span>
 | 
			
		||||
                                                {!! Form::hidden('discount', null, ['id' => 'discount', 'class' => 'form-control text-right', 'v-model' => 'form.discount']) !!}
 | 
			
		||||
                                            </td>
 | 
			
		||||
                                        </tr>
 | 
			
		||||
                                    @stack('add_discount_td_end')
 | 
			
		||||
 | 
			
		||||
                                    @stack('tax_total_td_start')
 | 
			
		||||
                                        <tr class="row" id="tr-tax">
 | 
			
		||||
                                            <td class="col-md-10 text-right border-right-0 border-bottom-0">
 | 
			
		||||
                                                <strong>{{ trans_choice('general.taxes', 1) }}</strong>
 | 
			
		||||
                                            </td>
 | 
			
		||||
                                            <td class="col-md-2 text-right border-bottom-0 long-texts">
 | 
			
		||||
                                                <span id="tax-total" v-html="totals.tax">0</span>
 | 
			
		||||
                                            </td>
 | 
			
		||||
                                        </tr>
 | 
			
		||||
                                    @stack('tax_total_td_end')
 | 
			
		||||
 | 
			
		||||
                                    @stack('grand_total_td_start')
 | 
			
		||||
                                        <tr class="row" id="tr-total">
 | 
			
		||||
                                            <td class="col-md-10 text-right border-right-0">
 | 
			
		||||
                                                <strong>{{ trans('bills.total') }}</strong>
 | 
			
		||||
                                            </td>
 | 
			
		||||
                                            <td class="col-md-2 text-right long-texts">
 | 
			
		||||
                                                <span id="grand-total" v-html="totals.total">0</span>
 | 
			
		||||
                                            </td>
 | 
			
		||||
                                        </tr>
 | 
			
		||||
                                    @stack('grand_total_td_end')
 | 
			
		||||
                                </tbody>
 | 
			
		||||
                            </table>
 | 
			
		||||
                        </div>
 | 
			
		||||
                    </div>
 | 
			
		||||
 | 
			
		||||
                    {{ Form::textareaGroup('notes', trans_choice('general.notes', 2)) }}
 | 
			
		||||
 | 
			
		||||
                    {{ Form::selectAddNewGroup('category_id', trans_choice('general.categories', 1), 'folder', $categories, setting('default.category'), []) }}
 | 
			
		||||
 | 
			
		||||
                    {{ Form::recurring('create') }}
 | 
			
		||||
 | 
			
		||||
                    {{ Form::fileGroup('attachment', trans('general.attachment')) }}
 | 
			
		||||
 | 
			
		||||
                    {{ Form::hidden('contact_name', old('contact_name'), ['id' => 'contact_name', 'v-model' => 'form.contact_name']) }}
 | 
			
		||||
                    {{ Form::hidden('contact_email', old('contact_email'), ['id' => 'contact_email', 'v-model' => 'form.contact_email']) }}
 | 
			
		||||
                    {{ Form::hidden('contact_tax_number', old('contact_tax_number'), ['id' => 'contact_tax_number', 'v-model' => 'form.contact_tax_number']) }}
 | 
			
		||||
                    {{ Form::hidden('contact_phone', old('contact_phone'), ['id' => 'contact_phone', 'v-model' => 'form.contact_phone']) }}
 | 
			
		||||
                    {{ Form::hidden('contact_address', old('contact_address'), ['id' => 'contact_address', 'v-model' => 'form.contact_address']) }}
 | 
			
		||||
                    {{ Form::hidden('currency_rate', old('currency_rate', 1), ['id' => 'currency_rate', 'v-model' => 'form.contact_rate']) }}
 | 
			
		||||
                    {{ Form::hidden('bill_status_code', old('bill_status_code', 'draft'), ['id' => 'bill_status_code', 'v-model' => 'form.bill_status_code']) }}
 | 
			
		||||
                    {{ Form::hidden('amount', old('amount', '0'), ['id' => 'amount', 'v-model' => 'form.amount']) }}
 | 
			
		||||
                </div>
 | 
			
		||||
            </div>
 | 
			
		||||
 | 
			
		||||
            <div class="card-footer">
 | 
			
		||||
                <div class="row float-right">
 | 
			
		||||
                    {{ Form::saveButtons('purchases/bills') }}
 | 
			
		||||
                </div>
 | 
			
		||||
            </div>
 | 
			
		||||
        {!! Form::close() !!}
 | 
			
		||||
    </div>
 | 
			
		||||
@endsection
 | 
			
		||||
 | 
			
		||||
@push('scripts_start')
 | 
			
		||||
    <script type="text/javascript">
 | 
			
		||||
        var bill_items = false;
 | 
			
		||||
    </script>
 | 
			
		||||
 | 
			
		||||
    <script src="{{ asset('public/js/purchases/bills.js?v=' . version('short')) }}"></script>
 | 
			
		||||
@endpush
 | 
			
		||||
							
								
								
									
										198
									
								
								resources/views/purchases/bills/edit.blade.php
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										198
									
								
								resources/views/purchases/bills/edit.blade.php
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,198 @@
 | 
			
		||||
@extends('layouts.admin')
 | 
			
		||||
 | 
			
		||||
@section('title', trans('general.title.edit', ['type' => trans_choice('general.bills', 1)]))
 | 
			
		||||
 | 
			
		||||
@section('content')
 | 
			
		||||
    <div class="card">
 | 
			
		||||
        {!! Form::model($bill, [
 | 
			
		||||
            'id' => 'bill',
 | 
			
		||||
            'method' => 'PATCH',
 | 
			
		||||
            'route' => ['bills.update', $bill->id],
 | 
			
		||||
            '@submit.prevent' => 'onSubmit',
 | 
			
		||||
            '@keydown' => 'form.errors.clear($event.target.name)',
 | 
			
		||||
            'files' => true,
 | 
			
		||||
            'role' => 'form',
 | 
			
		||||
            'class' => 'form-loading-button',
 | 
			
		||||
            'novalidate' => true
 | 
			
		||||
        ]) !!}
 | 
			
		||||
 | 
			
		||||
            <div class="card-body">
 | 
			
		||||
                <div class="row">
 | 
			
		||||
                    {{ Form::selectAddNewGroup('contact_id', trans_choice('general.vendors', 1), 'user', $vendors, $bill->contact_id, ['required' => 'required', 'change' => 'onChangeContact']) }}
 | 
			
		||||
 | 
			
		||||
                    {{ Form::selectGroup('currency_code', trans_choice('general.currencies', 1), 'exchange', $currencies, $bill->currency_code, ['required' => 'required', 'change' => 'onChangeCurrency']) }}
 | 
			
		||||
 | 
			
		||||
                    {{ Form::dateGroup('billed_at', trans('bills.bill_date'), 'calendar', ['id' => 'billed_at', 'class' => 'form-control datepicker', 'required' => 'required', 'date-format' => 'Y-m-d', 'autocomplete' => 'off'], Date::parse($bill->billed_at)->toDateString()) }}
 | 
			
		||||
 | 
			
		||||
                    {{ Form::dateGroup('due_at', trans('bills.due_date'), 'calendar', ['id' => 'due_at', 'class' => 'form-control datepicker', 'required' => 'required', 'date-format' => 'Y-m-d', 'autocomplete' => 'off'], Date::parse($bill->due_at)->toDateString()) }}
 | 
			
		||||
 | 
			
		||||
                    {{ Form::textGroup('bill_number', trans('bills.bill_number'), 'file-text-o') }}
 | 
			
		||||
 | 
			
		||||
                    {{ Form::textGroup('order_number', trans('bills.order_number'), 'shopping-cart',[]) }}
 | 
			
		||||
 | 
			
		||||
                    <div class="col-md-12 mb-4">
 | 
			
		||||
                        {!! Form::label('items', trans_choice('general.items', 2), ['class' => 'control-label']) !!}
 | 
			
		||||
                        <div class="table-responsive">
 | 
			
		||||
                            <table class="table table-bordered" id="items">
 | 
			
		||||
                                <thead class="thead-light">
 | 
			
		||||
                                    <tr class="row">
 | 
			
		||||
                                        @stack('actions_th_start')
 | 
			
		||||
                                            <th class="col-md-1 action-column border-right-0 border-bottom-0">{{ trans('general.actions') }}</th>
 | 
			
		||||
                                        @stack('actions_th_end')
 | 
			
		||||
 | 
			
		||||
                                        @stack('name_th_start')
 | 
			
		||||
                                            <th class="col-md-3 text-left border-right-0 border-bottom-0">{{ trans('general.name') }}</th>
 | 
			
		||||
                                        @stack('name_th_end')
 | 
			
		||||
 | 
			
		||||
                                        @stack('quantity_th_start')
 | 
			
		||||
                                            <th class="col-md-2 text-center border-right-0 border-bottom-0">{{ trans('bills.quantity') }}</th>
 | 
			
		||||
                                        @stack('quantity_th_end')
 | 
			
		||||
 | 
			
		||||
                                        @stack('price_th_start')
 | 
			
		||||
                                            <th class="col-md-2 text-right border-right-0 border-bottom-0">{{ trans('bills.price') }}</th>
 | 
			
		||||
                                        @stack('price_th_end')
 | 
			
		||||
 | 
			
		||||
                                        @stack('taxes_th_start')
 | 
			
		||||
                                            <th class="col-md-2 text-right border-right-0 border-bottom-0">{{ trans_choice('general.taxes', 1) }}</th>
 | 
			
		||||
                                        @stack('taxes_th_end')
 | 
			
		||||
 | 
			
		||||
                                        @stack('total_th_start')
 | 
			
		||||
                                            <th class="col-md-2 text-right border-bottom-0">{{ trans('bills.total') }}</th>
 | 
			
		||||
                                        @stack('total_th_end')
 | 
			
		||||
                                    </tr>
 | 
			
		||||
                                </thead>
 | 
			
		||||
                                <tbody>
 | 
			
		||||
                                    @include('purchases.bills.item')
 | 
			
		||||
 | 
			
		||||
                                    @stack('add_item_td_start')
 | 
			
		||||
                                        <tr class="row" id="addItem">
 | 
			
		||||
                                            <td class="col-md-1 action-column border-right-0 border-bottom-0"><button type="button" @click="onAddItem" id="button-add-item" data-toggle="tooltip" title="{{ trans('general.add') }}" class="btn btn-icon btn-outline-success btn-lg" data-original-title="{{ trans('general.add') }}"><i class="fa fa-plus"></i></button></td>
 | 
			
		||||
                                            <td class="col-md-11 text-right border-bottom-0"></td>
 | 
			
		||||
                                        </tr>
 | 
			
		||||
                                    @stack('add_item_td_end')
 | 
			
		||||
 | 
			
		||||
                                    @stack('sub_total_td_start')
 | 
			
		||||
                                        <tr class="row" id="tr-subtotal">
 | 
			
		||||
                                            <td class="col-md-10 text-right border-right-0 border-bottom-0">
 | 
			
		||||
                                                <strong>{{ trans('bills.sub_total') }}</strong>
 | 
			
		||||
                                            </td>
 | 
			
		||||
                                            <td class="col-md-2 text-right border-bottom-0 long-texts">
 | 
			
		||||
                                                <span id="sub-total" v-html="totals.sub">0</span>
 | 
			
		||||
                                            </td>
 | 
			
		||||
                                        </tr>
 | 
			
		||||
                                    @stack('sub_total_td_end')
 | 
			
		||||
 | 
			
		||||
                                    @stack('add_discount_td_start')
 | 
			
		||||
                                        <tr class="row" id="tr-discount">
 | 
			
		||||
                                            <td class="col-md-10 text-right border-right-0 border-bottom-0">
 | 
			
		||||
                                                <el-popover
 | 
			
		||||
                                                    popper-class="p-0 h-0"
 | 
			
		||||
                                                    placement="bottom"
 | 
			
		||||
                                                    width="300"
 | 
			
		||||
                                                    v-model="discount">
 | 
			
		||||
                                                    <div class="card">
 | 
			
		||||
                                                        <div class="discount card-body">
 | 
			
		||||
                                                            <div class="row align-items-center">
 | 
			
		||||
                                                                <div class="col-md-6">
 | 
			
		||||
                                                                    <div class="input-group input-group-merge">
 | 
			
		||||
                                                                        <div class="input-group-prepend">
 | 
			
		||||
                                                                            <span class="input-group-text" id="input-discount">
 | 
			
		||||
                                                                                <i class="fa fa-percent"></i>
 | 
			
		||||
                                                                            </span>
 | 
			
		||||
                                                                        </div>
 | 
			
		||||
                                                                        {!! Form::number('pre_discount', null, ['id' => 'pre-discount', 'class' => 'form-control text-right']) !!}
 | 
			
		||||
                                                                    </div>
 | 
			
		||||
                                                                </div>
 | 
			
		||||
                                                                <div class="col-md-6">
 | 
			
		||||
                                                                    <div class="discount-description">
 | 
			
		||||
                                                                        <strong>{{ trans('invoices.discount_desc') }}</strong>
 | 
			
		||||
                                                                    </div>
 | 
			
		||||
                                                                </div>
 | 
			
		||||
                                                            </div>
 | 
			
		||||
                                                        </div>
 | 
			
		||||
                                                        <div class="discount card-footer">
 | 
			
		||||
                                                            <div class="row text-center">
 | 
			
		||||
                                                                <div class="col-md-12">
 | 
			
		||||
                                                                    <a href="javascript:void(0)" @click="discount = false"  class="btn btn-icon btn-outline-secondary">
 | 
			
		||||
                                                                        <span class="btn-inner--icon"><i class="fas fa-times"></i></span>
 | 
			
		||||
                                                                        <span class="btn-inner--text">{{ trans('general.cancel') }}</span>
 | 
			
		||||
                                                                    </a>
 | 
			
		||||
                                                                    {!! Form::button('<span class="fa fa-save"></span>  ' . trans('general.save'), ['type' => 'button', 'id' => 'save-discount', '@click' => 'onAddDiscount', 'class' => 'btn btn-success']) !!}
 | 
			
		||||
                                                                </div>
 | 
			
		||||
                                                            </div>
 | 
			
		||||
                                                        </div>
 | 
			
		||||
                                                    </div>
 | 
			
		||||
                                                    <el-link slot="reference" type="primary" v-if="!totals.discount_text">{{ trans('invoices.add_discount') }}</el-link>
 | 
			
		||||
                                                    <el-link slot="reference" type="primary" v-if="totals.discount_text" v-html="totals.discount_text"></el-link>
 | 
			
		||||
                                                </el-popover>
 | 
			
		||||
                                            </td>
 | 
			
		||||
                                            <td class="col-md-2 text-right border-bottom-0">
 | 
			
		||||
                                                <span id="discount-total" v-html="totals.discount"></span>
 | 
			
		||||
                                                {!! Form::hidden('discount', null, ['id' => 'discount', 'class' => 'form-control text-right', 'v-model' => 'form.discount']) !!}
 | 
			
		||||
                                            </td>
 | 
			
		||||
                                        </tr>
 | 
			
		||||
                                    @stack('add_discount_td_end')
 | 
			
		||||
 | 
			
		||||
                                    @stack('tax_total_td_start')
 | 
			
		||||
                                        <tr class="row" id="tr-tax">
 | 
			
		||||
                                            <td class="col-md-10 text-right border-right-0 border-bottom-0">
 | 
			
		||||
                                                <strong>{{ trans_choice('general.taxes', 1) }}</strong>
 | 
			
		||||
                                            </td>
 | 
			
		||||
                                            <td class="col-md-2 text-right border-bottom-0 long-texts">
 | 
			
		||||
                                                <span id="tax-total" v-html="totals.tax">0</span>
 | 
			
		||||
                                            </td>
 | 
			
		||||
                                        </tr>
 | 
			
		||||
                                    @stack('tax_total_td_end')
 | 
			
		||||
 | 
			
		||||
                                    @stack('grand_total_td_start')
 | 
			
		||||
                                        <tr class="row" id="tr-total">
 | 
			
		||||
                                            <td class="col-md-10 text-right border-right-0">
 | 
			
		||||
                                                <strong>{{ trans('bills.total') }}</strong>
 | 
			
		||||
                                            </td>
 | 
			
		||||
                                            <td class="col-md-2 text-right long-texts">
 | 
			
		||||
                                                <span id="grand-total" v-html="totals.total">0</span>
 | 
			
		||||
                                            </td>
 | 
			
		||||
                                        </tr>
 | 
			
		||||
                                    @stack('grand_total_td_end')
 | 
			
		||||
                                </tbody>
 | 
			
		||||
                            </table>
 | 
			
		||||
                        </div>
 | 
			
		||||
                    </div>
 | 
			
		||||
 | 
			
		||||
                    {{ Form::textareaGroup('notes', trans_choice('general.notes', 2)) }}
 | 
			
		||||
 | 
			
		||||
                    {{ Form::selectAddNewGroup('category_id', trans_choice('general.categories', 1), 'folder', $categories, $bill->category_id) }}
 | 
			
		||||
 | 
			
		||||
                    {{ Form::recurring('edit', $bill) }}
 | 
			
		||||
 | 
			
		||||
                    {{ Form::fileGroup('attachment', trans('general.attachment')) }}
 | 
			
		||||
 | 
			
		||||
                    {{ Form::hidden('contact_name', old('contact_name'), ['id' => 'contact_name', 'v-model' => 'form.contact_name']) }}
 | 
			
		||||
                    {{ Form::hidden('contact_email', old('contact_email'), ['id' => 'contact_email', 'v-model' => 'form.contact_email']) }}
 | 
			
		||||
                    {{ Form::hidden('contact_tax_number', old('contact_tax_number'), ['id' => 'contact_tax_number', 'v-model' => 'form.contact_tax_number']) }}
 | 
			
		||||
                    {{ Form::hidden('contact_phone', old('contact_phone'), ['id' => 'contact_phone', 'v-model' => 'form.contact_phone']) }}
 | 
			
		||||
                    {{ Form::hidden('contact_address', old('contact_address'), ['id' => 'contact_address', 'v-model' => 'form.contact_address']) }}
 | 
			
		||||
                    {{ Form::hidden('currency_rate', old('currency_rate', 1), ['id' => 'currency_rate', 'v-model' => 'form.contact_rate']) }}
 | 
			
		||||
                    {{ Form::hidden('bill_status_code', old('bill_status_code', 'draft'), ['id' => 'bill_status_code', 'v-model' => 'form.bill_status_code']) }}
 | 
			
		||||
                    {{ Form::hidden('amount', old('amount', '0'), ['id' => 'amount', 'v-model' => 'form.amount']) }}
 | 
			
		||||
                </div>
 | 
			
		||||
            </div>
 | 
			
		||||
 | 
			
		||||
            @permission('update-purchases-bills')
 | 
			
		||||
                <div class="card-footer">
 | 
			
		||||
                    <div class="row float-right">
 | 
			
		||||
                        {{ Form::saveButtons('purchases/bills') }}
 | 
			
		||||
                    </div>
 | 
			
		||||
                </div>
 | 
			
		||||
            @endpermission
 | 
			
		||||
        {!! Form::close() !!}
 | 
			
		||||
    </div>
 | 
			
		||||
@endsection
 | 
			
		||||
 | 
			
		||||
@push('scripts_start')
 | 
			
		||||
    <script type="text/javascript">
 | 
			
		||||
        var bill_items = {!! json_encode($bill->items()->select(['item_id', 'name', 'quantity', 'price', 'total', 'tax'])->get()) !!};
 | 
			
		||||
    </script>
 | 
			
		||||
 | 
			
		||||
    <script src="{{ asset('public/js/purchases/bills.js?v=' . version('short')) }}"></script>
 | 
			
		||||
@endpush
 | 
			
		||||
							
								
								
									
										104
									
								
								resources/views/purchases/bills/index.blade.php
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										104
									
								
								resources/views/purchases/bills/index.blade.php
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,104 @@
 | 
			
		||||
@extends('layouts.admin')
 | 
			
		||||
 | 
			
		||||
@section('title', trans_choice('general.bills', 2))
 | 
			
		||||
 | 
			
		||||
@section('new_button')
 | 
			
		||||
    @permission('create-purchases-bills')
 | 
			
		||||
        <span><a href="{{ route('bills.create') }}" class="btn btn-success btn-sm header-button-top"><span class="fa fa-plus"></span>  {{ trans('general.add_new') }}</a></span>
 | 
			
		||||
        <span><a href="{{ url('common/import/purchases/bills') }}" class="btn btn-white btn-sm header-button-top"><span class="fa fa-upload"></span>  {{ trans('import.import') }}</a></span>
 | 
			
		||||
    @endpermission
 | 
			
		||||
    <span><a href="{{ route('bills.export', request()->input()) }}" class="btn btn-white btn-sm header-button-bottom"><span class="fa fa-download"></span>  {{ trans('general.export') }}</a></span>
 | 
			
		||||
@endsection
 | 
			
		||||
 | 
			
		||||
@section('content')
 | 
			
		||||
    @if ($bills->count())
 | 
			
		||||
        <div class="card">
 | 
			
		||||
            <div class="card-header border-bottom-0" v-bind:class="[bulk_action.show ? 'bg-gradient-primary' : '']">
 | 
			
		||||
                {!! Form::open([
 | 
			
		||||
                    'url' => 'purchases/bills',
 | 
			
		||||
                    'role' => 'form',
 | 
			
		||||
                    'method' => 'GET',
 | 
			
		||||
                    'class' => 'mb-0'
 | 
			
		||||
                ]) !!}
 | 
			
		||||
                    <div class="row" v-if="!bulk_action.show">
 | 
			
		||||
                        <div class="col-12 d-flex align-items-center">
 | 
			
		||||
                            <span class="font-weight-400 d-none d-lg-block mr-2">{{ trans('general.search') }}:</span>
 | 
			
		||||
                            <akaunting-search></akaunting-search>
 | 
			
		||||
                        </div>
 | 
			
		||||
                    </div>
 | 
			
		||||
 | 
			
		||||
                    {{ Form::bulkActionRowGroup('general.bills', $bulk_actions, 'purchases/bills') }}
 | 
			
		||||
                {!! Form::close() !!}
 | 
			
		||||
            </div>
 | 
			
		||||
 | 
			
		||||
            <div class="table-responsive">
 | 
			
		||||
                <table class="table table-flush table-hover">
 | 
			
		||||
                    <thead class="thead-light">
 | 
			
		||||
                        <tr class="row table-head-line">
 | 
			
		||||
                            <th class="col-sm-2 col-md-1 col-lg-1 col-xl-1 d-none d-sm-block">{{ Form::bulkActionAllGroup() }}</th>
 | 
			
		||||
                            <th class="col-sm-2 col-md-2 col-lg-1 col-xl-1 d-none d-sm-block">@sortablelink('bill_number', trans_choice('general.numbers', 1), ['filter' => 'active, visible'], ['class' => 'col-aka', 'rel' => 'nofollow'])</th>
 | 
			
		||||
                            <th class="col-xs-4 col-sm-4 col-md-3 col-lg-2 col-xl-2">@sortablelink('contact_name', trans_choice('general.vendors', 1))</th>
 | 
			
		||||
                            <th class="col-md-2 col-lg-2 col-xl-2 d-none d-md-block text-right">@sortablelink('amount', trans('general.amount'))</th>
 | 
			
		||||
                            <th class="col-lg-2 col-xl-2 d-none d-lg-block">@sortablelink('billed_at', trans('bills.bill_date'))</th>
 | 
			
		||||
                            <th class="col-lg-2 col-xl-2 d-none d-lg-block">@sortablelink('due_at', trans('bills.due_date'))</th>
 | 
			
		||||
                            <th class="col-xs-4 col-sm-2 col-md-2 col-lg-1 col-xl-1">@sortablelink('bill_status_code', trans_choice('general.statuses', 1))</th>
 | 
			
		||||
                            <th class="col-xs-4 col-sm-2 col-md-2 col-lg-1 col-xl-1 text-center">{{ trans('general.actions') }}</th>
 | 
			
		||||
                        </tr>
 | 
			
		||||
                    </thead>
 | 
			
		||||
 | 
			
		||||
                    <tbody>
 | 
			
		||||
                        @foreach($bills as $item)
 | 
			
		||||
                            @php $paid = $item->paid; @endphp
 | 
			
		||||
                            <tr class="row align-items-center border-top-1">
 | 
			
		||||
                                <td class="col-sm-2 col-md-1 col-lg-1 col-xl-1 d-none d-sm-block">{{ Form::bulkActionGroup($item->id, $item->bill_number) }}</td>
 | 
			
		||||
                                <td class="col-sm-2 col-md-2 col-lg-1 col-xl-1 d-none d-sm-block"><a class="col-aka text-success" href="{{ route('bills.show', $item->id) }}">{{ $item->bill_number }}</a></td>
 | 
			
		||||
                                <td class="col-xs-4 col-sm-4 col-md-3 col-lg-2 col-xl-2">{{ $item->contact_name }}</td>
 | 
			
		||||
                                <td class="col-md-2 col-lg-2 col-xl-2 d-none d-md-block text-right">@money($item->amount, $item->currency_code, true)</td>
 | 
			
		||||
                                <td class="col-lg-2 col-xl-2 d-none d-lg-block">@date($item->billed_at)</td>
 | 
			
		||||
                                <td class="col-lg-2 col-xl-2 d-none d-lg-block">@date($item->due_at)</td>
 | 
			
		||||
                                <td class="col-xs-4 col-sm-2 col-md-2 col-lg-1 col-xl-1">
 | 
			
		||||
                                    <span class="badge badge-pill badge-{{ $item->status->label }}">{{ trans('bills.status.' . $item->status->code) }}</span>
 | 
			
		||||
                                </td>
 | 
			
		||||
                                <td class="col-xs-4 col-sm-2 col-md-2 col-lg-1 col-xl-1 text-center">
 | 
			
		||||
                                    <div class="dropdown">
 | 
			
		||||
                                        <a class="btn btn-neutral btn-sm text-light items-align-center py-2" href="#" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
 | 
			
		||||
                                            <i class="fa fa-ellipsis-h text-muted"></i>
 | 
			
		||||
                                        </a>
 | 
			
		||||
                                        <div class="dropdown-menu dropdown-menu-right dropdown-menu-arrow">
 | 
			
		||||
                                            <a class="dropdown-item" href="{{ route('bills.show', $item->id) }}">{{ trans('general.show') }}</a>
 | 
			
		||||
                                            @if (!$item->reconciled)
 | 
			
		||||
                                                <a class="dropdown-item" href="{{ route('bills.edit', $item->id) }}">{{ trans('general.edit') }}</a>
 | 
			
		||||
                                            @endif
 | 
			
		||||
                                            <div class="dropdown-divider"></div>
 | 
			
		||||
                                            @permission('create-purchases-bills')
 | 
			
		||||
                                                <a class="dropdown-item" href="{{ route('bills.duplicate', $item->id) }}">{{ trans('general.duplicate') }}</a>
 | 
			
		||||
                                            @endpermission
 | 
			
		||||
                                            @permission('delete-purchases-bills')
 | 
			
		||||
                                                <div class="dropdown-divider"></div>
 | 
			
		||||
                                                @if (!$item->reconciled)
 | 
			
		||||
                                                    {!! Form::deleteLink($item, 'purchases/bills') !!}
 | 
			
		||||
                                                @endif
 | 
			
		||||
                                            @endpermission
 | 
			
		||||
                                        </div>
 | 
			
		||||
                                    </div>
 | 
			
		||||
                                </td>
 | 
			
		||||
                            </tr>
 | 
			
		||||
                        @endforeach
 | 
			
		||||
                    </tbody>
 | 
			
		||||
                </table>
 | 
			
		||||
            </div>
 | 
			
		||||
 | 
			
		||||
            <div class="card-footer table-action">
 | 
			
		||||
                <div class="row">
 | 
			
		||||
                    @include('partials.admin.pagination', ['items' => $bills])
 | 
			
		||||
                </div>
 | 
			
		||||
            </div>
 | 
			
		||||
        </div>
 | 
			
		||||
    @else
 | 
			
		||||
        @include('partials.admin.empty_page', ['page' => 'bills', 'docs_path' => 'purchases/bills'])
 | 
			
		||||
    @endif
 | 
			
		||||
@endsection
 | 
			
		||||
 | 
			
		||||
@push('scripts_start')
 | 
			
		||||
    <script src="{{ asset('public/js/purchases/bills.js?v=' . version('short')) }}"></script>
 | 
			
		||||
@endpush
 | 
			
		||||
							
								
								
									
										123
									
								
								resources/views/purchases/bills/item.blade.php
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										123
									
								
								resources/views/purchases/bills/item.blade.php
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,123 @@
 | 
			
		||||
<tr class="row" v-for="(row, index) in form.items"
 | 
			
		||||
    :index="index">
 | 
			
		||||
    @stack('actions_td_start')
 | 
			
		||||
        <td class="col-md-1 action-column border-right-0 border-bottom-0">
 | 
			
		||||
            @stack('actions_button_start')
 | 
			
		||||
                <button type="button"
 | 
			
		||||
                        @click="onDeleteItem(index)"
 | 
			
		||||
                        data-toggle="tooltip"
 | 
			
		||||
                        title="{{ trans('general.delete') }}"
 | 
			
		||||
                        class="btn btn-icon btn-outline-danger btn-lg"><i class="fa fa-trash"></i>
 | 
			
		||||
                </button>
 | 
			
		||||
            @stack('actions_button_end')
 | 
			
		||||
        </td>
 | 
			
		||||
    @stack('actions_td_end')
 | 
			
		||||
 | 
			
		||||
    @stack('name_td_start')
 | 
			
		||||
        <td class="col-md-3 border-right-0 border-bottom-0">
 | 
			
		||||
            @stack('name_input_start')
 | 
			
		||||
                <input class="form-control"
 | 
			
		||||
                       data-item="name"
 | 
			
		||||
                       required="required"
 | 
			
		||||
                       name="items[][name]"
 | 
			
		||||
                       v-model="row.name"
 | 
			
		||||
                       @input="onGetItem($event, index)"
 | 
			
		||||
                       type="text"
 | 
			
		||||
                       autocomplete="off">
 | 
			
		||||
                <div class="dropdown-menu item-show dropdown-menu-center" ref="menu" :class="[{show: row.show}]">
 | 
			
		||||
                    <div class="list-group list-group-flush">
 | 
			
		||||
                        <a class="list-group-item list-group-item-action" v-for="(item, item_index) in items" @click="onSelectItem(item, index)">
 | 
			
		||||
                            <div class="row align-items-center">
 | 
			
		||||
                                <div class="col ml--2">
 | 
			
		||||
                                    <div class="d-flex justify-content-between align-items-center">
 | 
			
		||||
                                        <div>
 | 
			
		||||
                                            <div class="name" v-text="item.name"></div>
 | 
			
		||||
                                        </div>
 | 
			
		||||
                                    </div>
 | 
			
		||||
                                </div>
 | 
			
		||||
                            </div>
 | 
			
		||||
                        </a>
 | 
			
		||||
                    </div>
 | 
			
		||||
                </div>
 | 
			
		||||
                <input name="items[][show]"
 | 
			
		||||
                       value="false"
 | 
			
		||||
                       v-model="row.show"
 | 
			
		||||
                       data-item="show"
 | 
			
		||||
                       type="hidden">
 | 
			
		||||
                <input name="items[][item_id]"
 | 
			
		||||
                       v-model="row.item_id"
 | 
			
		||||
                       data-item="item_id"
 | 
			
		||||
                       type="hidden">
 | 
			
		||||
                {!! $errors->first('item.name', '<p class="help-block">:message</p>') !!}
 | 
			
		||||
            @stack('name_input_end')
 | 
			
		||||
        </td>
 | 
			
		||||
    @stack('name_td_end')
 | 
			
		||||
 | 
			
		||||
    @stack('quantity_td_start')
 | 
			
		||||
        <td class="col-md-2 border-right-0 border-bottom-0">
 | 
			
		||||
            @stack('quantity_input_start')
 | 
			
		||||
                <input class="form-control text-center"
 | 
			
		||||
                       autocomplete="off"
 | 
			
		||||
                       required="required"
 | 
			
		||||
                       data-item="quantity"
 | 
			
		||||
                       v-model="row.quantity"
 | 
			
		||||
                       @input="onCalculateTotal"
 | 
			
		||||
                       name="item[][quantity]"
 | 
			
		||||
                       type="text">
 | 
			
		||||
                {!! $errors->first('item.quantity', '<p class="help-block">:message</p>') !!}
 | 
			
		||||
            @stack('quantity_input_end')
 | 
			
		||||
        </td>
 | 
			
		||||
    @stack('quantity_td_end')
 | 
			
		||||
 | 
			
		||||
    @stack('price_td_start')
 | 
			
		||||
        <td class="col-md-2 border-right-0 border-bottom-0">
 | 
			
		||||
            @stack('price_input_start')
 | 
			
		||||
                <input class="form-control text-right input-price"
 | 
			
		||||
                       required="required"
 | 
			
		||||
                       autocomplete="off"
 | 
			
		||||
                       data-item="price"
 | 
			
		||||
                       v-model.lazy="row.price"
 | 
			
		||||
                       v-money="money"
 | 
			
		||||
                       @input="onCalculateTotal"
 | 
			
		||||
                       name="items[][price]"
 | 
			
		||||
                       type="text">
 | 
			
		||||
                <input name="items[][currency]"
 | 
			
		||||
                       data-item="currency"
 | 
			
		||||
                       v-model="row.currency"
 | 
			
		||||
                       @input="onCalculateTotal"
 | 
			
		||||
                       type="hidden">
 | 
			
		||||
                {!! $errors->first('item.price', '<p class="help-block">:message</p>') !!}
 | 
			
		||||
            @stack('price_input_end')
 | 
			
		||||
        </td>
 | 
			
		||||
    @stack('price_td_end')
 | 
			
		||||
 | 
			
		||||
    @stack('taxes_td_start')
 | 
			
		||||
        <td class="col-md-2 border-right-0 border-bottom-0">
 | 
			
		||||
            @stack('tax_id_input_start')
 | 
			
		||||
                {{ Form::multiSelectAddNewGroup('tax_id', '', '', $taxes, '', [
 | 
			
		||||
                    'data-item' => 'tax_id',
 | 
			
		||||
                    'v-model' => 'row.tax_id',
 | 
			
		||||
                    'change' => 'onCalculateTotal',
 | 
			
		||||
                    'class' => 'form-control'
 | 
			
		||||
                ], 'mb-0 select-tax') }}
 | 
			
		||||
            @stack('tax_id_input_end')
 | 
			
		||||
        </td>
 | 
			
		||||
    @stack('taxes_td_end')
 | 
			
		||||
 | 
			
		||||
    @stack('total_td_start')
 | 
			
		||||
        <td class="col-md-2 text-right total-column border-bottom-0 long-texts">
 | 
			
		||||
            <input name="item[][total]"
 | 
			
		||||
                data-item="total"
 | 
			
		||||
                v-model.lazy="row.total"
 | 
			
		||||
                v-money="money"
 | 
			
		||||
                type="hidden">
 | 
			
		||||
            @stack('total_input_start')
 | 
			
		||||
                @if (empty($item) || !isset($item->total))
 | 
			
		||||
                    <span id="item-total" v-html="row.total">0</span>
 | 
			
		||||
                @else
 | 
			
		||||
                    <span id="item-total" v-html="row.total">@money($item->total, $bill->currency_code, true)</span>
 | 
			
		||||
                @endif
 | 
			
		||||
            @stack('total_input_end')
 | 
			
		||||
        </td>
 | 
			
		||||
    @stack('total_td_end')
 | 
			
		||||
</tr>
 | 
			
		||||
							
								
								
									
										271
									
								
								resources/views/purchases/bills/print.blade.php
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										271
									
								
								resources/views/purchases/bills/print.blade.php
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,271 @@
 | 
			
		||||
@extends('layouts.print')
 | 
			
		||||
 | 
			
		||||
@section('title', trans_choice('general.bills', 1) . ': ' . $bill->bill_number)
 | 
			
		||||
 | 
			
		||||
@section('content')
 | 
			
		||||
    <div class="mt-6">
 | 
			
		||||
        <div class="row">
 | 
			
		||||
            <div class="col-md-7">
 | 
			
		||||
                <div class="table-responsive">
 | 
			
		||||
                    <table class="table table-borderless">
 | 
			
		||||
                        <tbody>
 | 
			
		||||
                            <tr>
 | 
			
		||||
                                <th>
 | 
			
		||||
                                    @if (!empty($bill->contact->logo) && !empty($bill->contact->logo->id))
 | 
			
		||||
                                        <img src="{{ Storage::url($bill->contact->logo->id) }}" height="128" width="128" alt="{{ $bill->contact_name }}"/>
 | 
			
		||||
                                    @else
 | 
			
		||||
                                        <img src="{{ $logo }}" alt="{{ $bill->contact_name }}"/>
 | 
			
		||||
                                    @endif
 | 
			
		||||
                                </th>
 | 
			
		||||
                            </tr>
 | 
			
		||||
                        </tbody>
 | 
			
		||||
                    </table>
 | 
			
		||||
                </div>
 | 
			
		||||
            </div>
 | 
			
		||||
            <div class="col-md-5">
 | 
			
		||||
                <div class="table-responsive">
 | 
			
		||||
                    <table class="table table-borderless">
 | 
			
		||||
                        <tbody>
 | 
			
		||||
                            <tr>
 | 
			
		||||
                                <th>
 | 
			
		||||
                                    {{ setting('company.name') }}
 | 
			
		||||
                                </th>
 | 
			
		||||
                            </tr>
 | 
			
		||||
                            <tr>
 | 
			
		||||
                                <th>
 | 
			
		||||
                                    {!! nl2br(setting('company.address')) !!}
 | 
			
		||||
                                </th>
 | 
			
		||||
                            </tr>
 | 
			
		||||
                            <tr>
 | 
			
		||||
                                <th>
 | 
			
		||||
                                    @if (setting('company.tax_number'))
 | 
			
		||||
                                        {{ trans('general.tax_number') }}: {{ setting('company.tax_number') }}
 | 
			
		||||
                                    @endif
 | 
			
		||||
                                </th>
 | 
			
		||||
                            </tr>
 | 
			
		||||
                            <tr>
 | 
			
		||||
                                <th>
 | 
			
		||||
                                    @if (setting('company.phone'))
 | 
			
		||||
                                        {{ setting('company.phone') }}
 | 
			
		||||
                                    @endif
 | 
			
		||||
                                </th>
 | 
			
		||||
                            </tr>
 | 
			
		||||
                            <tr>
 | 
			
		||||
                                <th>
 | 
			
		||||
                                    {{ setting('company.email') }}
 | 
			
		||||
                                </th>
 | 
			
		||||
                            </tr>
 | 
			
		||||
                        </tbody>
 | 
			
		||||
                    </table>
 | 
			
		||||
                </div>
 | 
			
		||||
            </div>
 | 
			
		||||
        </div>
 | 
			
		||||
 | 
			
		||||
        <div class="dropdown-divider"></div>
 | 
			
		||||
 | 
			
		||||
        <div class="row">
 | 
			
		||||
            <div class="col-md-7">
 | 
			
		||||
                <div class="table-responsive">
 | 
			
		||||
                    <table class="table table-borderless">
 | 
			
		||||
                        <tbody>
 | 
			
		||||
                            <tr>
 | 
			
		||||
                                <th>
 | 
			
		||||
                                   {{ trans('bills.bill_from') }}
 | 
			
		||||
                                    @stack('name_input_start')
 | 
			
		||||
                                        <strong class="d-block">{{ $bill->contact_name }}</strong><br>
 | 
			
		||||
                                    @stack('name_input_end')
 | 
			
		||||
                                </th>
 | 
			
		||||
                            </tr>
 | 
			
		||||
                            <tr>
 | 
			
		||||
                                <th>
 | 
			
		||||
                                    @stack('address_input_start')
 | 
			
		||||
                                        {!! nl2br($bill->contact_address) !!}
 | 
			
		||||
                                    @stack('address_input_end')
 | 
			
		||||
                                </th>
 | 
			
		||||
                            </tr>
 | 
			
		||||
                            <tr>
 | 
			
		||||
                                <th>
 | 
			
		||||
                                    @stack('tax_number_input_start')
 | 
			
		||||
                                        @if ($bill->contact_tax_number)
 | 
			
		||||
                                            {{ trans('general.tax_number') }}: {{ $bill->contact_tax_number }}
 | 
			
		||||
                                        @endif
 | 
			
		||||
                                    @stack('tax_number_input_end')
 | 
			
		||||
                                </th>
 | 
			
		||||
                            </tr>
 | 
			
		||||
                            <tr>
 | 
			
		||||
                                <th>
 | 
			
		||||
                                    @stack('phone_input_start')
 | 
			
		||||
                                        @if ($bill->contact_phone)
 | 
			
		||||
                                            {{ $bill->contact_phone }}
 | 
			
		||||
                                        @endif
 | 
			
		||||
                                    @stack('phone_input_end')
 | 
			
		||||
                                </th>
 | 
			
		||||
                            </tr>
 | 
			
		||||
                            <tr>
 | 
			
		||||
                                <th>
 | 
			
		||||
                                    @stack('email_start')
 | 
			
		||||
                                        {{ $bill->contact_email }}
 | 
			
		||||
                                    @stack('email_input_end')
 | 
			
		||||
                                </th>
 | 
			
		||||
                            </tr>
 | 
			
		||||
                        </tbody>
 | 
			
		||||
                    </table>
 | 
			
		||||
                </div>
 | 
			
		||||
            </div>
 | 
			
		||||
            <div class="col-md-5">
 | 
			
		||||
                <div class="table-responsive">
 | 
			
		||||
                    <table class="table table-borderless">
 | 
			
		||||
                        <tbody>
 | 
			
		||||
                            @stack('bill_number_input_start')
 | 
			
		||||
                                <tr>
 | 
			
		||||
                                    <th>{{ trans('bills.bill_number') }}:</th>
 | 
			
		||||
                                    <td class="text-right">{{ $bill->bill_number }}</td>
 | 
			
		||||
                                </tr>
 | 
			
		||||
                            @stack('bill_number_input_end')
 | 
			
		||||
 | 
			
		||||
                            @stack('order_number_input_start')
 | 
			
		||||
                                @if ($bill->order_number)
 | 
			
		||||
                                    <tr>
 | 
			
		||||
                                        <th>{{ trans('bills.order_number') }}:</th>
 | 
			
		||||
                                        <td class="text-right">{{ $bill->order_number }}</td>
 | 
			
		||||
                                    </tr>
 | 
			
		||||
                                @endif
 | 
			
		||||
                            @stack('order_number_input_end')
 | 
			
		||||
 | 
			
		||||
                            @stack('billed_at_input_start')
 | 
			
		||||
                                <tr>
 | 
			
		||||
                                    <th>{{ trans('bills.bill_date') }}:</th>
 | 
			
		||||
                                    <td class="text-right">@date($bill->billed_at)</td>
 | 
			
		||||
                                </tr>
 | 
			
		||||
                            @stack('billed_at_input_end')
 | 
			
		||||
 | 
			
		||||
                            @stack('due_at_input_start')
 | 
			
		||||
                                <tr>
 | 
			
		||||
                                    <th>{{ trans('bills.payment_due') }}:</th>
 | 
			
		||||
                                    <td class="text-right">@date($bill->due_at)</td>
 | 
			
		||||
                                </tr>
 | 
			
		||||
                            @stack('due_at_input_end')
 | 
			
		||||
                        </tbody>
 | 
			
		||||
                    </table>
 | 
			
		||||
                </div>
 | 
			
		||||
            </div>
 | 
			
		||||
        </div>
 | 
			
		||||
 | 
			
		||||
        <table class="table table-striped">
 | 
			
		||||
            <thead>
 | 
			
		||||
                <tr>
 | 
			
		||||
                    @stack('actions_th_start')
 | 
			
		||||
                    @stack('actions_th_end')
 | 
			
		||||
 | 
			
		||||
                    @stack('name_th_start')
 | 
			
		||||
                        <th>{{ trans_choice('general.items', 1) }}</th>
 | 
			
		||||
                    @stack('name_th_end')
 | 
			
		||||
 | 
			
		||||
                    @stack('quantity_th_start')
 | 
			
		||||
                        <th class="text-center">{{ trans('bills.quantity') }}</th>
 | 
			
		||||
                    @stack('quantity_th_end')
 | 
			
		||||
 | 
			
		||||
                    @stack('price_th_start')
 | 
			
		||||
                        <th class="text-center pr-5">{{ trans('bills.price') }}</th>
 | 
			
		||||
                    @stack('price_th_end')
 | 
			
		||||
 | 
			
		||||
                    @stack('taxes_th_start')
 | 
			
		||||
                    @stack('taxes_th_end')
 | 
			
		||||
 | 
			
		||||
                    @stack('total_th_start')
 | 
			
		||||
                        <th class="text-right">{{ trans('bills.total') }}</th>
 | 
			
		||||
                    @stack('total_th_end')
 | 
			
		||||
                </tr>
 | 
			
		||||
            </thead>
 | 
			
		||||
            <tbody>
 | 
			
		||||
                @foreach($bill->items as $item)
 | 
			
		||||
                    <tr>
 | 
			
		||||
                        @stack('name_td_start')
 | 
			
		||||
                            <td>{{ $item->name }}</td>
 | 
			
		||||
                        @stack('name_td_end')
 | 
			
		||||
 | 
			
		||||
                        @stack('quantity_td_start')
 | 
			
		||||
                            <td class="text-center">{{ $item->quantity }}</td>
 | 
			
		||||
                        @stack('quantity_td_end')
 | 
			
		||||
 | 
			
		||||
                        @stack('price_td_start')
 | 
			
		||||
                            <td class="text-center pr-5">@money($item->price, $bill->currency_code, true)</td>
 | 
			
		||||
                        @stack('price_td_end')
 | 
			
		||||
 | 
			
		||||
                        @stack('total_td_start')
 | 
			
		||||
                            <td class="text-right">@money($item->total, $bill->currency_code, true)</td>
 | 
			
		||||
                        @stack('total_td_end')
 | 
			
		||||
                    </tr>
 | 
			
		||||
                @endforeach
 | 
			
		||||
            </tbody>
 | 
			
		||||
        </table>
 | 
			
		||||
 | 
			
		||||
        <div class="row">
 | 
			
		||||
            <div class="col-md-7">
 | 
			
		||||
                <div class="table-responsive">
 | 
			
		||||
                    @stack('notes_input_start')
 | 
			
		||||
                        @if ($bill->notes)
 | 
			
		||||
                            <table class="table table-borderless">
 | 
			
		||||
                                <tbody>
 | 
			
		||||
                                    <tr>
 | 
			
		||||
                                        <th>
 | 
			
		||||
                                            {{ trans_choice('general.notes', 2) }}
 | 
			
		||||
                                        </th>
 | 
			
		||||
                                    </tr>
 | 
			
		||||
                                    <tr>
 | 
			
		||||
                                        <th>
 | 
			
		||||
                                            {{ $bill->notes }}
 | 
			
		||||
                                        </th>
 | 
			
		||||
                                    </tr>
 | 
			
		||||
                                </tbody>
 | 
			
		||||
                            </table>
 | 
			
		||||
                        @endif
 | 
			
		||||
                    @stack('notes_input_end')
 | 
			
		||||
                </div>
 | 
			
		||||
            </div>
 | 
			
		||||
            <div class="col-md-5">
 | 
			
		||||
                <div class="table-responsive">
 | 
			
		||||
                    <table class="table table-borderless">
 | 
			
		||||
                        <tbody>
 | 
			
		||||
                            @foreach ($bill->totals as $total)
 | 
			
		||||
                                @if ($total->code != 'total')
 | 
			
		||||
                                    @stack($total->code . '_td_start')
 | 
			
		||||
                                        <tr>
 | 
			
		||||
                                            <th>
 | 
			
		||||
                                                {{ trans($total->title) }}:
 | 
			
		||||
                                            </th>
 | 
			
		||||
                                            <td class="text-right">
 | 
			
		||||
                                                @money($total->amount, $bill->currency_code, true)
 | 
			
		||||
                                            </td>
 | 
			
		||||
                                        </tr>
 | 
			
		||||
                                    @stack($total->code . '_td_end')
 | 
			
		||||
                                @else
 | 
			
		||||
                                    @if ($bill->paid)
 | 
			
		||||
                                        <tr class="text-success">
 | 
			
		||||
                                            <th>
 | 
			
		||||
                                                {{ trans('invoices.paid') }}:
 | 
			
		||||
                                            </th>
 | 
			
		||||
                                            <td class="text-right">
 | 
			
		||||
                                                - @money($bill->paid, $bill->currency_code, true)
 | 
			
		||||
                                            </td>
 | 
			
		||||
                                        </tr>
 | 
			
		||||
                                    @endif
 | 
			
		||||
                                    @stack('grand_total_td_start')
 | 
			
		||||
                                        <tr>
 | 
			
		||||
                                            <th>
 | 
			
		||||
                                                {{ trans($total->name) }}:
 | 
			
		||||
                                            </th>
 | 
			
		||||
                                            <td class="text-right">
 | 
			
		||||
                                                @money($total->amount - $bill->paid, $bill->currency_code, true)
 | 
			
		||||
                                            </td>
 | 
			
		||||
                                        </tr>
 | 
			
		||||
                                    @stack('grand_total_td_end')
 | 
			
		||||
                                @endif
 | 
			
		||||
                            @endforeach
 | 
			
		||||
                        </tbody>
 | 
			
		||||
                    </table>
 | 
			
		||||
                </div>
 | 
			
		||||
            </div>
 | 
			
		||||
        </div>
 | 
			
		||||
    </div>
 | 
			
		||||
@endsection
 | 
			
		||||
							
								
								
									
										607
									
								
								resources/views/purchases/bills/show.blade.php
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										607
									
								
								resources/views/purchases/bills/show.blade.php
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,607 @@
 | 
			
		||||
@extends('layouts.admin')
 | 
			
		||||
 | 
			
		||||
@section('title', trans_choice('general.bills', 1) . ': ' . $bill->bill_number)
 | 
			
		||||
 | 
			
		||||
@section('content')
 | 
			
		||||
    @stack('recurring_message_start')
 | 
			
		||||
        @if (($recurring = $bill->recurring) && ($next = $recurring->next()))
 | 
			
		||||
            <div class="callout callout-info">
 | 
			
		||||
                @stack('recurring_message_head_start')
 | 
			
		||||
                    <h4>{{ trans('recurring.recurring') }}</h4>
 | 
			
		||||
                @stack('recurring_message_head_end')
 | 
			
		||||
 | 
			
		||||
                @stack('recurring_message_body_start')
 | 
			
		||||
                    <p>{{ trans('recurring.message', [
 | 
			
		||||
                        'type' => mb_strtolower(trans_choice('general.bills', 1)),
 | 
			
		||||
                        'date' => $next->format($date_format)
 | 
			
		||||
                    ]) }}
 | 
			
		||||
                    </p>
 | 
			
		||||
                @stack('recurring_message_body_end')
 | 
			
		||||
            </div>
 | 
			
		||||
        @endif
 | 
			
		||||
    @stack('recurring_message_end')
 | 
			
		||||
 | 
			
		||||
    @stack('status_message_start')
 | 
			
		||||
        @if ($bill->status->code == 'draft')
 | 
			
		||||
            <div class="row">
 | 
			
		||||
                <div class="col-sm-12 col-md-12 col-lg-12 col-xl-12">
 | 
			
		||||
                    <div class="alert alert-warning fade show" role="alert">
 | 
			
		||||
                        @stack('status_message_body_start')
 | 
			
		||||
                            <span class="alert-text">
 | 
			
		||||
                                <strong>{!! trans('bills.messages.draft') !!}</strong>
 | 
			
		||||
                            </span>
 | 
			
		||||
                        @stack('status_message_body_end')
 | 
			
		||||
                    </div>
 | 
			
		||||
                </div>
 | 
			
		||||
            </div>
 | 
			
		||||
        @endif
 | 
			
		||||
    @stack('status_message_end')
 | 
			
		||||
 | 
			
		||||
    @stack('timeline_start')
 | 
			
		||||
        @if ($bill->status->code != 'paid')
 | 
			
		||||
            @stack('timeline_body_start')
 | 
			
		||||
                <div class="card">
 | 
			
		||||
                    <div class="card-body">
 | 
			
		||||
                        <div class="timeline timeline-one-side" data-timeline-content="axis" data-timeline-axis-style="dashed">
 | 
			
		||||
                            @stack('timeline_body_create_bill_start')
 | 
			
		||||
                                <div class="timeline-block">
 | 
			
		||||
                                    <span class="timeline-step badge-info">
 | 
			
		||||
                                        <i class="fas fa-plus"></i>
 | 
			
		||||
                                    </span>
 | 
			
		||||
                                    <div class="timeline-content">
 | 
			
		||||
                                        @stack('timeline_body_create_bill_head_start')
 | 
			
		||||
                                            <h2 class="font-weight-500">{{ trans('bills.create_bill') }}</h2>
 | 
			
		||||
                                        @stack('timeline_body_create_bill_head_end')
 | 
			
		||||
 | 
			
		||||
                                        @stack('timeline_body_create_bill_body_start')
 | 
			
		||||
                                            @stack('timeline_body_create_bill_body_message_start')
 | 
			
		||||
                                                <small>{{ trans_choice('general.statuses', 1) .  ':'  }}</small>
 | 
			
		||||
                                                <small>{{ trans('bills.messages.status.created', ['date' => Date::parse($bill->created_at)->format($date_format)]) }}</small>
 | 
			
		||||
                                            @stack('timeline_body_create_bill_body_message_end')
 | 
			
		||||
 | 
			
		||||
                                            <div class="mt-3">
 | 
			
		||||
                                                @stack('timeline_body_create_bill_body_button_edit_start')
 | 
			
		||||
                                                    <a href="{{ url('purchases/bills/' . $bill->id . '/edit') }}" class="btn btn-info btn-sm btn-alone">
 | 
			
		||||
                                                        {{ trans('general.edit') }}
 | 
			
		||||
                                                    </a>
 | 
			
		||||
                                                @stack('timeline_body_create_bill_body_button_edit_end')
 | 
			
		||||
                                            </div>
 | 
			
		||||
                                        @stack('timeline_body_create_bill_body_end')
 | 
			
		||||
                                    </div>
 | 
			
		||||
                                </div>
 | 
			
		||||
                            @stack('timeline_body_create_bill_end')
 | 
			
		||||
 | 
			
		||||
                            @stack('timeline_body_receive_bill_start')
 | 
			
		||||
                                <div class="timeline-block">
 | 
			
		||||
                                    <span class="timeline-step badge-warning">
 | 
			
		||||
                                        <i class="far fa-envelope"></i>
 | 
			
		||||
                                    </span>
 | 
			
		||||
                                    <div class="timeline-content">
 | 
			
		||||
                                        @stack('timeline_body_receive_bill_head_start')
 | 
			
		||||
                                            <h2 class="font-weight-500">{{ trans('bills.receive_bill') }}</h2>
 | 
			
		||||
                                        @stack('timeline_body_receive_bill_head_end')
 | 
			
		||||
 | 
			
		||||
                                        @stack('timeline_body_receive_bill_body_start')
 | 
			
		||||
                                            @if ($bill->status->code == 'draft')
 | 
			
		||||
                                                @stack('timeline_body_receive_bill_body_message_start')
 | 
			
		||||
                                                    <small>{{ trans_choice('general.statuses', 1) .  ':'  }}</small>
 | 
			
		||||
                                                    <small>{{ trans('bills.messages.status.receive.draft') }}</small>
 | 
			
		||||
                                                @stack('timeline_body_receive_bill_body_message_end')
 | 
			
		||||
 | 
			
		||||
                                                <div class="mt-3">
 | 
			
		||||
                                                    @stack('timeline_body_receive_bill_body_button_sent_start')
 | 
			
		||||
                                                        @permission('update-purchases-bills')
 | 
			
		||||
                                                            <a href="{{ url('purchases/bills/' . $bill->id . '/received') }}" class="btn btn-warning btn-sm btn-alone">{{ trans('bills.mark_received') }}</a>
 | 
			
		||||
                                                        @endpermission
 | 
			
		||||
                                                    @stack('timeline_body_receive_bill_body_button_sent_end')
 | 
			
		||||
                                                </div>
 | 
			
		||||
                                            @else
 | 
			
		||||
                                                @stack('timeline_body_receive_bill_body_message_start')
 | 
			
		||||
                                                    <small>{{ trans_choice('general.statuses', 1) .  ':'  }}</small>
 | 
			
		||||
                                                    <small>{{ trans('bills.messages.status.receive.received', ['date' => Date::parse($bill->created_at)->format($date_format)]) }}</small>
 | 
			
		||||
                                                @stack('timeline_body_receive_bill_body_message_end')
 | 
			
		||||
                                            @endif
 | 
			
		||||
                                        @stack('timeline_body_receive_bill_body_end')
 | 
			
		||||
                                    </div>
 | 
			
		||||
                                </div>
 | 
			
		||||
                            @stack('timeline_body_receive_bill_end')
 | 
			
		||||
 | 
			
		||||
                            @stack('timeline_body_make_payment_start')
 | 
			
		||||
                                <div class="timeline-block">
 | 
			
		||||
                                    <span class="timeline-step badge-success">
 | 
			
		||||
                                        <i class="far fa-money-bill-alt"></i>
 | 
			
		||||
                                    </span>
 | 
			
		||||
 | 
			
		||||
                                    <div class="timeline-content">
 | 
			
		||||
                                        @stack('timeline_body_make_payment_head_start')
 | 
			
		||||
                                            <h2 class="font-weight-500">{{ trans('bills.make_payment') }}</h2>
 | 
			
		||||
                                        @stack('timeline_body_make_payment_head_end')
 | 
			
		||||
 | 
			
		||||
                                        @stack('timeline_body_make_payment_body_start')
 | 
			
		||||
                                            @stack('timeline_body_get_paid_body_message_start')
 | 
			
		||||
                                                @if($bill->status->code != 'paid' && empty($bill->transactions->count()))
 | 
			
		||||
                                                    <small>{{ trans_choice('general.statuses', 1) .  ':'  }}</small>
 | 
			
		||||
                                                    <small>{{ trans('bills.messages.status.paid.await') }}</small>
 | 
			
		||||
                                                @else
 | 
			
		||||
                                                    <small>{{ trans_choice('general.statuses', 1) . ':' }}</small>
 | 
			
		||||
                                                    <small>{{ trans('general.partially_paid') }}</small>
 | 
			
		||||
                                                @endif
 | 
			
		||||
                                            @stack('timeline_body_make_payment_body_message_end')
 | 
			
		||||
 | 
			
		||||
                                            <div class="mt-3">
 | 
			
		||||
                                                @stack('timeline_body_make_payment_body_button_payment_start')
 | 
			
		||||
                                                    @if(empty($bill->transactions->count()) || (!empty($bill->transactions->count()) && $bill->paid != $bill->amount))
 | 
			
		||||
                                                        <button @click="onPayment" id="button-payment" class="btn btn-success btn-sm header-button-bottom">{{ trans('bills.add_payment') }}</button>
 | 
			
		||||
                                                    @endif
 | 
			
		||||
                                                @stack('timeline_body_make_payment_body_button_payment_end')
 | 
			
		||||
                                            </div>
 | 
			
		||||
                                        @stack('timeline_body_make_payment_body_end')
 | 
			
		||||
                                    </div>
 | 
			
		||||
                                </div>
 | 
			
		||||
                            @stack('timeline_body_make_payment_end')
 | 
			
		||||
                        </div>
 | 
			
		||||
                    </div>
 | 
			
		||||
                </div>
 | 
			
		||||
            @stack('timeline_body_end')
 | 
			
		||||
        @endif
 | 
			
		||||
    @stack('timeline_end')
 | 
			
		||||
 | 
			
		||||
    @stack('bill_start')
 | 
			
		||||
        <div class="card">
 | 
			
		||||
            @stack('bill_status_start')
 | 
			
		||||
                <div class="card-header status-{{ $bill->status->label }}">
 | 
			
		||||
                    <h3 class="text-white mb-0 float-right">{{ trans('bills.status.' . $bill->status->code) }}</h3>
 | 
			
		||||
                </div>
 | 
			
		||||
            @stack('bill_status_end')
 | 
			
		||||
 | 
			
		||||
            <div class="card-body">
 | 
			
		||||
                @stack('bill_header_start')
 | 
			
		||||
                    <div class="row mx--4">
 | 
			
		||||
                        <div class="col-md-7 border-bottom-1">
 | 
			
		||||
                            <div class="table-responsive mt-2">
 | 
			
		||||
                                <table class="table table-borderless">
 | 
			
		||||
                                    <tbody>
 | 
			
		||||
                                        <tr>
 | 
			
		||||
                                            <th>
 | 
			
		||||
                                                @if (!empty($bill->contact->logo) && !empty($bill->contact->logo->id))
 | 
			
		||||
                                                    <img src="{{ Storage::url($bill->contact->logo->id) }}" height="128" width="128" alt="{{ $bill->contact_name }}"/>
 | 
			
		||||
                                                @else
 | 
			
		||||
                                                    <img src="{{ $logo }}" alt="{{ $bill->contact_name }}"/>
 | 
			
		||||
                                                @endif
 | 
			
		||||
                                            </th>
 | 
			
		||||
                                        </tr>
 | 
			
		||||
                                    </tbody>
 | 
			
		||||
                                </table>
 | 
			
		||||
                            </div>
 | 
			
		||||
                        </div>
 | 
			
		||||
                        <div class="col-md-5 border-bottom-1">
 | 
			
		||||
                            <div class="table-responsive">
 | 
			
		||||
                                <table class="table table-borderless">
 | 
			
		||||
                                    <tbody>
 | 
			
		||||
                                        <tr>
 | 
			
		||||
                                            <th>
 | 
			
		||||
                                                {{ setting('company.name') }}
 | 
			
		||||
                                            </th>
 | 
			
		||||
                                        </tr>
 | 
			
		||||
                                        <tr>
 | 
			
		||||
                                            <th>
 | 
			
		||||
                                                {!! nl2br(setting('company.address')) !!}
 | 
			
		||||
                                            </th>
 | 
			
		||||
                                        </tr>
 | 
			
		||||
                                        <tr>
 | 
			
		||||
                                            <th>
 | 
			
		||||
                                                @if (setting('company.tax_number'))
 | 
			
		||||
                                                    {{ trans('general.tax_number') }}: {{ setting('company.tax_number') }}
 | 
			
		||||
                                                @endif
 | 
			
		||||
                                            </th>
 | 
			
		||||
                                        </tr>
 | 
			
		||||
                                        <tr>
 | 
			
		||||
                                            <th>
 | 
			
		||||
                                                @if (setting('company.phone'))
 | 
			
		||||
                                                    {{ setting('company.phone') }}
 | 
			
		||||
                                                @endif
 | 
			
		||||
                                            </th>
 | 
			
		||||
                                        </tr>
 | 
			
		||||
                                        <tr>
 | 
			
		||||
                                            <th>
 | 
			
		||||
                                                {{ setting('company.email') }}
 | 
			
		||||
                                            </th>
 | 
			
		||||
                                        </tr>
 | 
			
		||||
                                    </tbody>
 | 
			
		||||
                                </table>
 | 
			
		||||
                            </div>
 | 
			
		||||
                        </div>
 | 
			
		||||
                    </div>
 | 
			
		||||
                @stack('bill_header_end')
 | 
			
		||||
 | 
			
		||||
                @stack('bill_information_start')
 | 
			
		||||
                    <div class="row">
 | 
			
		||||
                        <div class="col-md-7 long-texts">
 | 
			
		||||
                            <div class="table-responsive">
 | 
			
		||||
                                <table class="table table-borderless">
 | 
			
		||||
                                    <tbody>
 | 
			
		||||
                                        <tr>
 | 
			
		||||
                                            <th>
 | 
			
		||||
                                                {{ trans('bills.bill_from') }}
 | 
			
		||||
                                                @stack('name_input_start')
 | 
			
		||||
                                                    <strong class="d-block">{{ $bill->contact_name }}</strong>
 | 
			
		||||
                                                @stack('name_input_end')
 | 
			
		||||
                                            </th>
 | 
			
		||||
                                        </tr>
 | 
			
		||||
                                        <tr>
 | 
			
		||||
                                            <th>
 | 
			
		||||
                                                @stack('address_input_start')
 | 
			
		||||
                                                    {!! nl2br($bill->contact_address) !!}
 | 
			
		||||
                                                @stack('address_input_end')
 | 
			
		||||
                                            </th>
 | 
			
		||||
                                        </tr>
 | 
			
		||||
                                        <tr>
 | 
			
		||||
                                            <th>
 | 
			
		||||
                                                @stack('tax_number_input_start')
 | 
			
		||||
                                                    @if ($bill->contact_tax_number)
 | 
			
		||||
                                                        {{ trans('general.tax_number') }}: {{ $bill->contact_tax_number }}
 | 
			
		||||
                                                    @endif
 | 
			
		||||
                                                @stack('tax_number_input_end')
 | 
			
		||||
                                            </th>
 | 
			
		||||
                                        </tr>
 | 
			
		||||
                                        <tr>
 | 
			
		||||
                                            <th>
 | 
			
		||||
                                                @stack('phone_input_start')
 | 
			
		||||
                                                    @if ($bill->contact_phone)
 | 
			
		||||
                                                        {{ $bill->contact_phone }}
 | 
			
		||||
                                                    @endif
 | 
			
		||||
                                                @stack('phone_input_end')
 | 
			
		||||
                                            </th>
 | 
			
		||||
                                        </tr>
 | 
			
		||||
                                        <tr>
 | 
			
		||||
                                            <th>
 | 
			
		||||
                                                @stack('email_start')
 | 
			
		||||
                                                    {{ $bill->contact_email }}
 | 
			
		||||
                                                @stack('email_input_end')
 | 
			
		||||
                                            </th>
 | 
			
		||||
                                        </tr>
 | 
			
		||||
                                    </tbody>
 | 
			
		||||
                                </table>
 | 
			
		||||
                            </div>
 | 
			
		||||
                        </div>
 | 
			
		||||
                        <div class="col-md-5 long-texts">
 | 
			
		||||
                            <div class="table-responsive">
 | 
			
		||||
                                <table class="table table-borderless">
 | 
			
		||||
                                    <tbody>
 | 
			
		||||
                                        @stack('bill_number_input_start')
 | 
			
		||||
                                            <tr>
 | 
			
		||||
                                                <th>{{ trans('bills.bill_number') }}:</th>
 | 
			
		||||
                                                <td class="text-right">{{ $bill->bill_number }}</td>
 | 
			
		||||
                                            </tr>
 | 
			
		||||
                                        @stack('bill_number_input_end')
 | 
			
		||||
 | 
			
		||||
                                        @stack('order_number_input_start')
 | 
			
		||||
                                            @if ($bill->order_number)
 | 
			
		||||
                                                <tr>
 | 
			
		||||
                                                    <th>{{ trans('bills.order_number') }}:</th>
 | 
			
		||||
                                                    <td class="text-right">{{ $bill->order_number }}</td>
 | 
			
		||||
                                                </tr>
 | 
			
		||||
                                            @endif
 | 
			
		||||
                                        @stack('order_number_input_end')
 | 
			
		||||
 | 
			
		||||
                                        @stack('billed_at_input_start')
 | 
			
		||||
                                            <tr>
 | 
			
		||||
                                                <th>{{ trans('bills.bill_date') }}:</th>
 | 
			
		||||
                                                <td class="text-right">@date($bill->billed_at)</td>
 | 
			
		||||
                                            </tr>
 | 
			
		||||
                                        @stack('billed_at_input_end')
 | 
			
		||||
 | 
			
		||||
                                        @stack('due_at_input_start')
 | 
			
		||||
                                            <tr>
 | 
			
		||||
                                                <th>{{ trans('bills.payment_due') }}:</th>
 | 
			
		||||
                                                <td class="text-right">@date($bill->due_at)</td>
 | 
			
		||||
                                            </tr>
 | 
			
		||||
                                        @stack('due_at_input_end')
 | 
			
		||||
                                    </tbody>
 | 
			
		||||
                                </table>
 | 
			
		||||
                            </div>
 | 
			
		||||
                        </div>
 | 
			
		||||
                    </div>
 | 
			
		||||
                @stack('bill_information_end')
 | 
			
		||||
 | 
			
		||||
                @stack('bill_item_start')
 | 
			
		||||
                    <div class="row show-table">
 | 
			
		||||
                        <div class="col-md-12">
 | 
			
		||||
                            <div class="table-responsive">
 | 
			
		||||
                                <table class="table table-striped">
 | 
			
		||||
                                    <tbody>
 | 
			
		||||
                                        <tr class="row">
 | 
			
		||||
                                            @stack('name_th_start')
 | 
			
		||||
                                                <th class="col-xs-4 col-sm-3 pl-5">{{ trans_choice('general.items', 1) }}</th>
 | 
			
		||||
                                            @stack('name_th_end')
 | 
			
		||||
 | 
			
		||||
                                            @stack('quantity_th_start')
 | 
			
		||||
                                                <th class="col-xs-4 col-sm-3 text-center">{{ trans('bills.quantity') }}</th>
 | 
			
		||||
                                            @stack('quantity_th_end')
 | 
			
		||||
 | 
			
		||||
                                            @stack('price_th_start')
 | 
			
		||||
                                                <th class="col-sm-3 text-center d-none d-sm-block pl-5">{{ trans('bills.price') }}</th>
 | 
			
		||||
                                            @stack('price_th_end')
 | 
			
		||||
 | 
			
		||||
                                            @stack('total_th_start')
 | 
			
		||||
                                                <th class="col-xs-4 col-sm-3 text-right pr-5">{{ trans('bills.total') }}</th>
 | 
			
		||||
                                            @stack('total_th_end')
 | 
			
		||||
                                        </tr>
 | 
			
		||||
                                        @foreach($bill->items as $item)
 | 
			
		||||
                                            <tr class="row">
 | 
			
		||||
                                                @stack('name_td_start')
 | 
			
		||||
                                                    <td class="col-xs-4 col-sm-3 pl-5">{{ $item->name }}</td>
 | 
			
		||||
                                                @stack('name_td_end')
 | 
			
		||||
 | 
			
		||||
                                                @stack('quantity_td_start')
 | 
			
		||||
                                                    <td class="col-xs-4 col-sm-3 text-center">{{ $item->quantity }}</td>
 | 
			
		||||
                                                @stack('quantity_td_end')
 | 
			
		||||
 | 
			
		||||
                                                @stack('price_td_start')
 | 
			
		||||
                                                    <td class="col-sm-3 text-center d-none d-sm-block pl-8">@money($item->price, $bill->currency_code, true)</td>
 | 
			
		||||
                                                @stack('price_td_end')
 | 
			
		||||
 | 
			
		||||
                                                @stack('total_td_start')
 | 
			
		||||
                                                    <td class="col-xs-4 col-sm-3 text-right pr-5">@money($item->total, $bill->currency_code, true)</td>
 | 
			
		||||
                                                @stack('total_td_end')
 | 
			
		||||
                                            </tr>
 | 
			
		||||
                                        @endforeach
 | 
			
		||||
                                    </tbody>
 | 
			
		||||
                                </table>
 | 
			
		||||
                            </div>
 | 
			
		||||
                        </div>
 | 
			
		||||
                    </div>
 | 
			
		||||
                @stack('bill_item_end')
 | 
			
		||||
 | 
			
		||||
                @stack('bill_total_start')
 | 
			
		||||
                    <div class="row mt-5">
 | 
			
		||||
                        <div class="col-md-7">
 | 
			
		||||
                            @stack('notes_input_start')
 | 
			
		||||
                                <div class="table-responsive">
 | 
			
		||||
                                    <table class="table table-borderless">
 | 
			
		||||
                                        <tbody>
 | 
			
		||||
                                            @if ($bill->notes)
 | 
			
		||||
                                                <tr>
 | 
			
		||||
                                                    <th>
 | 
			
		||||
                                                        <p class="form-control-label">{{ trans_choice('general.notes', 2) }}:</p>
 | 
			
		||||
                                                        <p class="form-control text-muted long-texts">{{ $bill->notes }}</p>
 | 
			
		||||
                                                    </th>
 | 
			
		||||
                                                </tr>
 | 
			
		||||
                                            @endif
 | 
			
		||||
                                        </tbody>
 | 
			
		||||
                                    </table>
 | 
			
		||||
                                </div>
 | 
			
		||||
                            @stack('notes_input_end')
 | 
			
		||||
                        </div>
 | 
			
		||||
                        <div class="col-md-5">
 | 
			
		||||
                            <div class="table-responsive">
 | 
			
		||||
                                <table class="table">
 | 
			
		||||
                                    <tbody>
 | 
			
		||||
                                        @foreach ($bill->totals as $total)
 | 
			
		||||
                                            @if ($total->code != 'total')
 | 
			
		||||
                                                @stack($total->code . '_td_start')
 | 
			
		||||
                                                    <tr>
 | 
			
		||||
                                                        <th>{{ trans($total->title) }}:</th>
 | 
			
		||||
                                                        <td class="text-right">@money($total->amount, $bill->currency_code, true)</td>
 | 
			
		||||
                                                    </tr>
 | 
			
		||||
                                                @stack($total->code . '_td_end')
 | 
			
		||||
                                            @else
 | 
			
		||||
                                                @if ($bill->paid)
 | 
			
		||||
                                                    <tr class="text-success">
 | 
			
		||||
                                                        <th>{{ trans('bills.paid') }}:</th>
 | 
			
		||||
                                                        <td class="text-right">- @money($bill->paid, $bill->currency_code, true)</td>
 | 
			
		||||
                                                    </tr>
 | 
			
		||||
                                                @endif
 | 
			
		||||
                                                @stack('grand_total_td_start')
 | 
			
		||||
                                                    <tr>
 | 
			
		||||
                                                        <th>{{ trans($total->name) }}:</th>
 | 
			
		||||
                                                        <td class="text-right">@money($total->amount - $bill->paid, $bill->currency_code, true)</td>
 | 
			
		||||
                                                    </tr>
 | 
			
		||||
                                                @stack('grand_total_td_end')
 | 
			
		||||
                                            @endif
 | 
			
		||||
                                        @endforeach
 | 
			
		||||
                                    </tbody>
 | 
			
		||||
                                </table>
 | 
			
		||||
                            </div>
 | 
			
		||||
                        </div>
 | 
			
		||||
                    </div>
 | 
			
		||||
                @stack('bill_total_end')
 | 
			
		||||
            </div>
 | 
			
		||||
 | 
			
		||||
            @stack('box_footer_start')
 | 
			
		||||
                <div class="card-footer">
 | 
			
		||||
                    <div class="float-right">
 | 
			
		||||
                        @stack('button_edit_start')
 | 
			
		||||
                            @if(!$bill->reconciled)
 | 
			
		||||
                                <a href="{{ route('bills.edit', $bill->id) }}" class="btn btn-info header-button-top">
 | 
			
		||||
                                    <i class="fas fa-edit"></i>  {{ trans('general.edit') }}
 | 
			
		||||
                                </a>
 | 
			
		||||
                            @endif
 | 
			
		||||
                        @stack('button_edit_end')
 | 
			
		||||
 | 
			
		||||
                        @stack('button_print_start')
 | 
			
		||||
                            <a href="{{ route('bills.print', $bill->id) }}" target="_blank" class="btn btn-success header-button-top">
 | 
			
		||||
                                <i class="fa fa-print"></i>  {{ trans('general.print') }}
 | 
			
		||||
                            </a>
 | 
			
		||||
                        @stack('button_print_end')
 | 
			
		||||
 | 
			
		||||
                        @stack('button_group_start')
 | 
			
		||||
                            <div class="dropup">
 | 
			
		||||
                                <button type="button" class="btn btn-primary header-button-top" data-toggle="dropdown" aria-expanded="false"><i class="fa fa-chevron-up"></i>  {{ trans('general.more_actions') }}</button>
 | 
			
		||||
                                <div class="dropdown-menu" role="menu">
 | 
			
		||||
                                    @stack('button_pay_start')
 | 
			
		||||
                                        @if($bill->status->code != 'paid')
 | 
			
		||||
                                            @if(empty($bill->paid) || ($bill->paid != $bill->amount))
 | 
			
		||||
                                                <a class="dropdown-item" href="#" id="button-payment">{{ trans('bills.add_payment') }}</a>
 | 
			
		||||
                                            @endif
 | 
			
		||||
                                            @permission('update-purchases-bills')
 | 
			
		||||
                                                @if($bill->bill_status_code == 'draft')
 | 
			
		||||
                                                    <a class="dropdown-item" href="{{ route('bills.received', $bill->id) }}">{{ trans('bills.mark_received') }}</a></a>
 | 
			
		||||
                                                @else
 | 
			
		||||
                                                    <button type="button" class="dropdown-item" disabled="disabled">{{ trans('bills.mark_received') }}</button>
 | 
			
		||||
                                                @endif
 | 
			
		||||
                                            @endpermission
 | 
			
		||||
                                            <div class="dropdown-divider"></div>
 | 
			
		||||
                                        @endif
 | 
			
		||||
                                    @stack('button_pay_end')
 | 
			
		||||
 | 
			
		||||
                                    @stack('button_pdf_start')
 | 
			
		||||
                                        <a class="dropdown-item" href="{{ route('bills.pdf', $bill->id) }}">{{ trans('bills.download_pdf') }}</a>
 | 
			
		||||
                                    @stack('button_pdf_end')
 | 
			
		||||
 | 
			
		||||
                                    @stack('button_delete_start')
 | 
			
		||||
                                        @permission('delete-purchases-bills')
 | 
			
		||||
                                            @if(!$bill->reconciled)
 | 
			
		||||
                                                {!! Form::deleteLink($bill, 'purchases/bills') !!}
 | 
			
		||||
                                            @endif
 | 
			
		||||
                                        @endpermission
 | 
			
		||||
                                    @stack('button_delete_end')
 | 
			
		||||
                                </div>
 | 
			
		||||
                            </div>
 | 
			
		||||
                        @stack('button_group_end')
 | 
			
		||||
 | 
			
		||||
                        @if($bill->attachment)
 | 
			
		||||
                            @php $file = $bill->attachment; @endphp
 | 
			
		||||
                            @include('partials.media.file')
 | 
			
		||||
                        @endif
 | 
			
		||||
                    </div>
 | 
			
		||||
                </div>
 | 
			
		||||
            @stack('box_footer_end')
 | 
			
		||||
        </div>
 | 
			
		||||
    @stack('bill_end')
 | 
			
		||||
 | 
			
		||||
    @stack('row_footer_start')
 | 
			
		||||
        <div class="row">
 | 
			
		||||
            @stack('row_footer_history_start')
 | 
			
		||||
                <div class="col-sm-6 col-md-6 col-lg-6 col-xl-6">
 | 
			
		||||
                    <div class="accordion">
 | 
			
		||||
                        <div class="card">
 | 
			
		||||
                            <div class="card-header" id="headingOne" data-toggle="collapse" data-target="#collapseOne" aria-expanded="false" aria-controls="collapseOne">
 | 
			
		||||
                                <h4 class="mb-0">{{ trans('bills.histories') }}</h4>
 | 
			
		||||
                            </div>
 | 
			
		||||
                            <div id="collapseOne" class="collapse hide" aria-labelledby="headingOne">
 | 
			
		||||
                                <div class="table-responsive">
 | 
			
		||||
                                    <table class="table">
 | 
			
		||||
                                        <thead class="thead-light">
 | 
			
		||||
                                            <tr class="row table-head-line">
 | 
			
		||||
                                                <th class="col-xs-4 col-sm-4">{{ trans('general.date') }}</th>
 | 
			
		||||
                                                <th class="col-xs-4 col-sm-4 text-center">{{ trans_choice('general.statuses', 1) }}</th>
 | 
			
		||||
                                                <th class="col-xs-4 col-sm-4 text-left long-texts">{{ trans('general.description') }}</th>
 | 
			
		||||
                                            </tr>
 | 
			
		||||
                                        </thead>
 | 
			
		||||
                                        <tbody>
 | 
			
		||||
                                            @foreach($bill->histories as $history)
 | 
			
		||||
                                                <tr class="row align-items-center">
 | 
			
		||||
                                                    <td class="col-xs-4 col-sm-4">@date($history->created_at)</td>
 | 
			
		||||
                                                    <td class="col-xs-4 col-sm-4 text-center">{{ $history->status->name }}</td>
 | 
			
		||||
                                                    <td class="col-xs-4 col-sm-4 text-left long-texts">{{ $history->description }}</td>
 | 
			
		||||
                                                </tr>
 | 
			
		||||
                                            @endforeach
 | 
			
		||||
                                        </tbody>
 | 
			
		||||
                                    </table>
 | 
			
		||||
                                </div>
 | 
			
		||||
                            </div>
 | 
			
		||||
                        </div>
 | 
			
		||||
                    </div>
 | 
			
		||||
                </div>
 | 
			
		||||
            @stack('row_footer_history_end')
 | 
			
		||||
 | 
			
		||||
            @stack('row_footer_transaction_start')
 | 
			
		||||
                <div class="col-sm-6 col-md-6 col-lg-6 col-xl-6">
 | 
			
		||||
                    <div class="accordion">
 | 
			
		||||
                        <div class="card">
 | 
			
		||||
                            <div class="card-header" id="headingTwo" data-toggle="collapse" data-target="#collapseTwo" aria-expanded="false" aria-controls="collapseTwo">
 | 
			
		||||
                                <h4 class="mb-0">{{ trans_choice('general.transactions', 2) }}</h4>
 | 
			
		||||
                            </div>
 | 
			
		||||
                            <div id="collapseTwo" class="collapse hide" aria-labelledby="headingTwo">
 | 
			
		||||
                                <div class="table-responsive">
 | 
			
		||||
                                    <table class="table table-flush table-hover">
 | 
			
		||||
                                        <thead class="thead-light">
 | 
			
		||||
                                            <tr class="row table-head-line">
 | 
			
		||||
                                                <th class="col-xs-4 col-sm-3">{{ trans('general.date') }}</th>
 | 
			
		||||
                                                <th class="col-xs-4 col-sm-3">{{ trans('general.amount') }}</th>
 | 
			
		||||
                                                <th class="col-sm-3 d-none d-sm-block">{{ trans_choice('general.accounts', 1) }}</th>
 | 
			
		||||
                                                <th class="col-xs-4 col-sm-3">{{ trans('general.actions') }}</th>
 | 
			
		||||
                                            </tr>
 | 
			
		||||
                                        </thead>
 | 
			
		||||
                                        <tbody>
 | 
			
		||||
                                            @if ($bill->transactions->count())
 | 
			
		||||
                                                @foreach($bill->transactions as $transaction)
 | 
			
		||||
                                                    <tr class="row align-items-center border-top-1">
 | 
			
		||||
                                                        <td class="col-xs-4 col-sm-3">@date($item->paid_at)</td>
 | 
			
		||||
                                                        <td class="col-xs-4 col-sm-3">@money($transaction->amount, $transaction->currency_code, true)</td>
 | 
			
		||||
                                                        <td class="col-sm-3 d-none d-sm-block">{{ $transaction->account->name }}</td>
 | 
			
		||||
                                                        <td class="col-xs-4 col-sm-3">
 | 
			
		||||
                                                            @if ($transaction->reconciled)
 | 
			
		||||
                                                                <button type="button" class="btn btn-secondary btn-sm">
 | 
			
		||||
                                                                    <i class="fa fa-check"></i> {{ trans('reconciliations.reconciled') }}
 | 
			
		||||
                                                                </button>
 | 
			
		||||
                                                            @else
 | 
			
		||||
                                                                {!! Form::open([
 | 
			
		||||
                                                                    'id' => 'bill-transaction-' . $transaction->id,
 | 
			
		||||
                                                                    'method' => 'DELETE',
 | 
			
		||||
                                                                    'route' => ['transactions.destroy', $transaction->id],
 | 
			
		||||
                                                                    'style' => 'display:inline'
 | 
			
		||||
                                                                ]) !!}
 | 
			
		||||
                                                                {!! Form::button('<i class="fa fa-trash-o" aria-hidden="true"></i> ' . trans('general.delete'), array(
 | 
			
		||||
                                                                    'type'    => 'button',
 | 
			
		||||
                                                                    'class'   => 'btn btn-danger btn-sm',
 | 
			
		||||
                                                                    'title'   => trans('general.delete'),
 | 
			
		||||
                                                                    'onclick' => 'confirmDelete("' . '#bill-transaction-' . $transaction->id . '", "' . trans_choice('general.transaction', 2) . '", "' . trans('general.delete_confirm', ['name' => '<strong>' . Date::parse($transaction->paid_at)->format($date_format) . ' - ' . money($transaction->amount, $transaction->currency_code, true) . ' - ' . $transaction->account->name . '</strong>', 'type' => strtolower(trans_choice('general.transactions', 1))]) . '", "' . trans('general.cancel') . '", "' . trans('general.delete') . '")'
 | 
			
		||||
                                                                )) !!}
 | 
			
		||||
                                                                {!! Form::close() !!}
 | 
			
		||||
                                                            @endif
 | 
			
		||||
                                                        </td>
 | 
			
		||||
                                                    </tr>
 | 
			
		||||
                                                @endforeach
 | 
			
		||||
                                            @else
 | 
			
		||||
                                                <tr>
 | 
			
		||||
                                                    <td colspan="4">
 | 
			
		||||
                                                        <div class="text-muted" id="datatable-basic_info" role="status" aria-live="polite">
 | 
			
		||||
                                                            {{ trans('general.no_records') }}
 | 
			
		||||
                                                        </div>
 | 
			
		||||
                                                    </td>
 | 
			
		||||
                                                </tr>
 | 
			
		||||
                                            @endif
 | 
			
		||||
                                        </tbody>
 | 
			
		||||
                                    </table>
 | 
			
		||||
                                </div>
 | 
			
		||||
                            </div>
 | 
			
		||||
                        </div>
 | 
			
		||||
                    </div>
 | 
			
		||||
                </div>
 | 
			
		||||
            @stack('row_footer_transaction_end')
 | 
			
		||||
        </div>
 | 
			
		||||
    @stack('row_footer_end')
 | 
			
		||||
@endsection
 | 
			
		||||
 | 
			
		||||
@push('content_content_end')
 | 
			
		||||
    <akaunting-modal
 | 
			
		||||
        :show="payment.modal"
 | 
			
		||||
        @cancel="payment.modal = false"
 | 
			
		||||
        :title="'{{ trans('general.title.new', ['type' => trans_choice('general.payments', 1)]) }}'"
 | 
			
		||||
        :message="payment.html"
 | 
			
		||||
        :button_cancel="'{{ trans('general.button.save') }}'"
 | 
			
		||||
        :button_delete="'{{ trans('general.button.cancel') }}'">
 | 
			
		||||
        <template #modal-body>
 | 
			
		||||
            @include('modals.bills.payment')
 | 
			
		||||
        </template>
 | 
			
		||||
 | 
			
		||||
        <template #card-footer>
 | 
			
		||||
            <div class="float-right">
 | 
			
		||||
                <button type="button" class="btn btn-outline-secondary" @click="closePayment">
 | 
			
		||||
                    <span>{{ trans('general.cancel') }}</span>
 | 
			
		||||
                </button>
 | 
			
		||||
 | 
			
		||||
                <button type="button" class="btn btn-success button-submit" @click="addPayment">
 | 
			
		||||
                    <div class="aka-loader d-none"></div>
 | 
			
		||||
                    <span>{{ trans('general.confirm') }}</span>
 | 
			
		||||
                </button>
 | 
			
		||||
            </div>
 | 
			
		||||
        </template>
 | 
			
		||||
    </akaunting-modal>
 | 
			
		||||
@endpush
 | 
			
		||||
 | 
			
		||||
@push('scripts_start')
 | 
			
		||||
    <script src="{{ asset('public/js/purchases/bills.js?v=' . version('short')) }}"></script>
 | 
			
		||||
@endpush
 | 
			
		||||
		Reference in New Issue
	
	Block a user