edit column re-factoring dynamic
This commit is contained in:
@@ -34,8 +34,8 @@ export default {
|
||||
},
|
||||
type: {
|
||||
type: String,
|
||||
default: 'sale',
|
||||
description: 'Show item price'
|
||||
default: 'invoice',
|
||||
description: 'document type'
|
||||
},
|
||||
editColumn: {
|
||||
type: Object,
|
||||
@@ -67,7 +67,9 @@ export default {
|
||||
onEditItemColumns() {
|
||||
let edit_column = this.edit_column;
|
||||
|
||||
window.axios.get(url + '/modals/invoices/item-columns/edit')
|
||||
window.axios.get(url + '/modals/documents/item-columns/edit', {
|
||||
type:
|
||||
})
|
||||
.then(response => {
|
||||
edit_column.show = true;
|
||||
edit_column.html = response.data.html;
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
<akaunting-edit-item-columns
|
||||
type="{{ $type }}"
|
||||
:edit-column="{{ json_encode([
|
||||
'status' => true,
|
||||
'text' => trans('general.add_new'),
|
||||
|
||||
32
resources/views/modals/documents/item_columns.blade.php
Normal file
32
resources/views/modals/documents/item_columns.blade.php
Normal file
@@ -0,0 +1,32 @@
|
||||
{!! Form::open([
|
||||
'id' => 'form-item-column',
|
||||
'method' => 'PATCH',
|
||||
'route' => 'modals.documents.item-columns.update',
|
||||
'@submit.prevent' => 'onSubmit',
|
||||
'@keydown' => 'form.errors.clear($event.target.name)',
|
||||
'files' => true,
|
||||
'role' => 'form',
|
||||
'class' => 'form-loading-button',
|
||||
'novalidate' => true,
|
||||
]) !!}
|
||||
<div class="row">
|
||||
{{ Form::invoice_text('item_name', trans('settings.invoice.item_name'), 'font', $item_names, setting($type . '.item_name'), [], 'item_name_input', setting($type . '.item_name_input', null), 'col-md-12') }}
|
||||
|
||||
{{ Form::invoice_text('price_name', trans('settings.invoice.price_name'), 'font', $price_names, setting($type . '.price_name'), [], 'price_name_input', setting($type . '.price_name_input', null), 'col-md-12') }}
|
||||
|
||||
{{ Form::invoice_text('quantity_name', trans('settings.invoice.quantity_name'), 'font', $quantity_names, setting($type . '.quantity_name'), [], 'quantity_name_input', setting($type . '.quantity_name_input', null), 'col-md-12') }}
|
||||
|
||||
{{ Form::radioGroup('hide_item_name', trans('settings.invoice.hide.item_name'), setting($type . '.hide_item_name', null)) }}
|
||||
|
||||
{{ Form::radioGroup('hide_item_description', trans('settings.invoice.hide.item_description'), setting($type . '.hide_item_description', null)) }}
|
||||
|
||||
{{ Form::radioGroup('hide_quantity', trans('settings.invoice.hide.quantity'), setting($type . '.hide_quantity', null)) }}
|
||||
|
||||
{{ Form::radioGroup('hide_price', trans('settings.invoice.hide.price'), setting($type . '.hide_price', null)) }}
|
||||
|
||||
{{ Form::radioGroup('hide_amount', trans('settings.invoice.hide.amount'), setting($type . '.hide_amount', null)) }}
|
||||
|
||||
{!! Form::hidden('type', $type) !!}
|
||||
{!! Form::hidden('_prefix', $type) !!}
|
||||
</div>
|
||||
{!! Form::close() !!}
|
||||
@@ -1,31 +0,0 @@
|
||||
{!! Form::open([
|
||||
'id' => 'form-item-column',
|
||||
'method' => 'PATCH',
|
||||
'route' => 'modals.invoices.item-columns.update',
|
||||
'@submit.prevent' => 'onSubmit',
|
||||
'@keydown' => 'form.errors.clear($event.target.name)',
|
||||
'files' => true,
|
||||
'role' => 'form',
|
||||
'class' => 'form-loading-button',
|
||||
'novalidate' => true,
|
||||
]) !!}
|
||||
<div class="row">
|
||||
{{ Form::invoice_text('item_name', trans('settings.invoice.item_name'), 'font', $item_names, setting('invoice.item_name'), [], 'item_name_input', setting('invoice.item_name_input', null), 'col-md-12') }}
|
||||
|
||||
{{ Form::invoice_text('price_name', trans('settings.invoice.price_name'), 'font', $price_names, setting('invoice.price_name'), [], 'price_name_input', setting('invoice.price_name_input', null), 'col-md-12') }}
|
||||
|
||||
{{ Form::invoice_text('quantity_name', trans('settings.invoice.quantity_name'), 'font', $quantity_names, setting('invoice.quantity_name'), [], 'quantity_name_input', setting('invoice.quantity_name_input', null), 'col-md-12') }}
|
||||
|
||||
{{ Form::radioGroup('hide_item_name', trans('settings.invoice.hide.item_name'), setting('invoice.hide_item_name', null)) }}
|
||||
|
||||
{{ Form::radioGroup('hide_item_description', trans('settings.invoice.hide.item_description'), setting('invoice.hide_item_description', null)) }}
|
||||
|
||||
{{ Form::radioGroup('hide_quantity', trans('settings.invoice.hide.quantity'), setting('invoice.hide_quantity', null)) }}
|
||||
|
||||
{{ Form::radioGroup('hide_price', trans('settings.invoice.hide.price'), setting('invoice.hide_price', null)) }}
|
||||
|
||||
{{ Form::radioGroup('hide_amount', trans('settings.invoice.hide.amount'), setting('invoice.hide_amount', null)) }}
|
||||
|
||||
{!! Form::hidden('_prefix', 'invoice') !!}
|
||||
</div>
|
||||
{!! Form::close() !!}
|
||||
Reference in New Issue
Block a user