2015-10-14 16:15:39 +02:00
|
|
|
@extends('header')
|
2015-03-16 22:45:25 +01:00
|
|
|
|
2016-09-23 16:00:47 +02:00
|
|
|
@section('content')
|
2017-11-03 09:19:03 +01:00
|
|
|
@parent
|
2015-03-16 22:45:25 +01:00
|
|
|
|
2017-11-03 09:19:03 +01:00
|
|
|
{!! Former::open($url)
|
|
|
|
->method($method)
|
2018-03-14 12:03:30 +01:00
|
|
|
->autocomplete('off')
|
2017-11-03 09:19:03 +01:00
|
|
|
->rules(['product_key' => 'required|max:255'])
|
2017-11-30 20:17:50 +01:00
|
|
|
->addClass('col-lg-10 col-lg-offset-1 main-form warn-on-exit') !!}
|
2017-11-03 10:25:14 +01:00
|
|
|
|
|
|
|
@if ($product)
|
|
|
|
{{ Former::populate($product) }}
|
|
|
|
{{ Former::populateField('cost', Utils::roundSignificant($product->cost)) }}
|
|
|
|
@endif
|
|
|
|
|
|
|
|
<span style="display:none">
|
|
|
|
{!! Former::text('public_id') !!}
|
|
|
|
{!! Former::text('action') !!}
|
|
|
|
</span>
|
2015-03-16 22:45:25 +01:00
|
|
|
|
2017-12-08 12:57:46 +01:00
|
|
|
<div class="row">
|
|
|
|
<div class="col-lg-10 col-lg-offset-1">
|
|
|
|
|
|
|
|
<div class="panel panel-default">
|
|
|
|
<div class="panel-body form-padding-right">
|
2015-03-16 22:45:25 +01:00
|
|
|
|
2017-12-08 12:57:46 +01:00
|
|
|
{!! Former::text('product_key')->label('texts.product') !!}
|
|
|
|
{!! Former::textarea('notes')->rows(6) !!}
|
2015-03-16 22:45:25 +01:00
|
|
|
|
2018-04-04 21:08:37 +02:00
|
|
|
@include('partials/custom_fields', ['entityType' => ENTITY_PRODUCT])
|
2017-02-23 15:33:02 +01:00
|
|
|
|
2017-12-08 12:57:46 +01:00
|
|
|
{!! Former::text('cost') !!}
|
2017-02-23 15:33:02 +01:00
|
|
|
|
2017-12-08 12:57:46 +01:00
|
|
|
@if ($account->invoice_item_taxes)
|
|
|
|
@include('partials.tax_rates')
|
|
|
|
@endif
|
2015-03-16 22:45:25 +01:00
|
|
|
|
2017-12-08 12:57:46 +01:00
|
|
|
</div>
|
|
|
|
</div>
|
2017-11-03 09:19:03 +01:00
|
|
|
</div>
|
|
|
|
</div>
|
2018-01-17 11:19:46 +01:00
|
|
|
|
2018-05-03 15:46:55 +02:00
|
|
|
@foreach(Module::getOrdered() as $module)
|
2018-06-03 17:49:30 +02:00
|
|
|
@if(View::exists($module->alias . '::products.edit'))
|
2018-05-03 15:46:55 +02:00
|
|
|
<div class="row">
|
|
|
|
<div class="col-lg-10 col-lg-offset-1">
|
|
|
|
<div class="panel panel-default">
|
|
|
|
<div class="panel-heading">
|
|
|
|
<h3 class="panel-title in-white">
|
|
|
|
<i class="fa fa-{{ $module->icon }}"></i>
|
|
|
|
{{ $module->name }}
|
|
|
|
</h3>
|
|
|
|
</div>
|
|
|
|
<div class="panel-body form-padding-right">
|
2018-06-03 17:49:30 +02:00
|
|
|
@includeIf($module->alias . '::products.edit')
|
2018-05-03 15:46:55 +02:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
@endif
|
|
|
|
@endforeach
|
2018-06-10 12:34:07 +02:00
|
|
|
|
|
|
|
@if (Auth::user()->canCreateOrEdit(ENTITY_PRODUCT, $product))
|
2017-11-03 09:19:03 +01:00
|
|
|
<center class="buttons">
|
|
|
|
{!! Button::normal(trans('texts.cancel'))->large()->asLinkTo(HTMLUtils::previousUrl('/products'))->appendIcon(Icon::create('remove-circle')) !!}
|
|
|
|
{!! Button::success(trans('texts.save'))->submit()->large()->appendIcon(Icon::create('floppy-disk')) !!}
|
2017-11-03 10:25:14 +01:00
|
|
|
@if ($product)
|
|
|
|
{!! DropdownButton::normal(trans('texts.more_actions'))
|
|
|
|
->withContents($product->present()->moreActions())
|
|
|
|
->large()
|
|
|
|
->dropup() !!}
|
|
|
|
@endif
|
2017-11-03 09:19:03 +01:00
|
|
|
</center>
|
2018-06-07 12:08:34 +02:00
|
|
|
@endif
|
2017-11-03 09:19:03 +01:00
|
|
|
{!! Former::close() !!}
|
2015-03-16 22:45:25 +01:00
|
|
|
|
2017-11-03 09:19:03 +01:00
|
|
|
<script type="text/javascript">
|
2015-03-16 22:45:25 +01:00
|
|
|
|
2017-11-03 10:25:14 +01:00
|
|
|
$(function() {
|
|
|
|
$('#product_key').focus();
|
|
|
|
});
|
|
|
|
|
|
|
|
function submitAction(action) {
|
|
|
|
$('#action').val(action);
|
|
|
|
$('.main-form').submit();
|
|
|
|
}
|
|
|
|
|
|
|
|
function onDeleteClick() {
|
|
|
|
sweetConfirm(function() {
|
|
|
|
submitAction('delete');
|
|
|
|
});
|
|
|
|
}
|
2015-03-16 22:45:25 +01:00
|
|
|
|
2017-11-03 09:19:03 +01:00
|
|
|
</script>
|
2015-03-16 22:45:25 +01:00
|
|
|
|
2016-09-23 16:00:47 +02:00
|
|
|
@stop
|