Merge pull request #560 from batuhawk/1.3-dev

Invoice customization fixed some css and js issue
This commit is contained in:
Cüneyt Şentürk 2018-10-18 15:40:53 +03:00 committed by GitHub
commit 42d5690a57
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 35 additions and 16 deletions

View File

@ -15,25 +15,21 @@ class InvoiceText
*/ */
public function compose(View $view) public function compose(View $view)
{ {
$text_override = [ $text_override = [];
'items' => trans_choice('general.items', 2),
'quantity' => trans('invoices.quantity'),
'price' => trans('invoices.price'),
];
$text_items = setting('general.invoice_item'); $text_items = setting('general.invoice_item', trans_choice('general.items', 2));
if ($text_items == 'custom') { if ($text_items == 'custom') {
$text_items = setting('general.invoice_item_input'); $text_items = setting('general.invoice_item_input');
} }
$text_quantity = setting('general.invoice_quantity'); $text_quantity = setting('general.invoice_quantity', trans('invoices.quantity'));
if ($text_quantity == 'custom') { if ($text_quantity == 'custom') {
$text_quantity = setting('general.invoice_quantity_input'); $text_quantity = setting('general.invoice_quantity_input');
} }
$text_price = setting('general.invoice_price'); $text_price = setting('general.invoice_price', trans('invoices.price'));
if ($text_price == 'custom') { if ($text_price == 'custom') {
$text_price = setting('general.invoice_price_input'); $text_price = setting('general.invoice_price_input');

5
public/css/app.css vendored
View File

@ -740,3 +740,8 @@ input[type="number"] {
.link .content-wrapper, .link .right-side, .link .main-footer { .link .content-wrapper, .link .right-side, .link .main-footer {
margin-left: inherit; margin-left: inherit;
} }
.col-md-6.input-group-invoice-text {
padding-left: 0;
padding-right: 0;
}

18
public/js/app.js vendored
View File

@ -197,6 +197,8 @@ $(document).ready(function () {
return true; return true;
}); });
$('.input-group-invoice-text select').select2();
}); });
function confirmDelete(form_id, title, message, button_cancel, button_delete) { function confirmDelete(form_id, title, message, button_cancel, button_delete) {
@ -292,6 +294,22 @@ $(document).on('change', '.input-group-recurring #recurring_frequency', function
} }
}); });
$(document).on('change', '.input-group-invoice-text select', function () {
var invoice_text_custom = $(this).parent().parent().parent().find('input');
if ($(this).val() == 'custom') {
$(this).parent().parent().removeClass('col-md-12').addClass('col-md-6');
invoice_text_custom.parent().removeClass('hidden');
$(this).select2();
} else {
$(this).parent().parent().removeClass('col-md-6').addClass('col-md-12');
invoice_text_custom.parent().addClass('hidden');
}
});
function convertDateFormat(date, split_character) { function convertDateFormat(date, split_character) {
var result = []; var result = [];
var formats = { var formats = {

View File

@ -35,14 +35,14 @@ return [
'logo' => 'Logo', 'logo' => 'Logo',
'custom' => 'Custom', 'custom' => 'Custom',
'item_name' => 'Item Name', 'item_name' => 'Item Name',
'item' => 'Item (Default)', 'item' => 'Items',
'product' => 'Product', 'product' => 'Products',
'service' => 'Service', 'service' => 'Services',
'price_name' => 'Price Name', 'price_name' => 'Price Name',
'price' => 'Price (Default)', 'price' => 'Price',
'rate' => 'Rate', 'rate' => 'Rate',
'quantity_name' => 'Quantity Name', 'quantity_name' => 'Quantity Name',
'quantity' => 'Quantity (Default)', 'quantity' => 'Quantity',
], ],
'default' => [ 'default' => [
'tab' => 'Defaults', 'tab' => 'Defaults',

View File

@ -1,7 +1,7 @@
@stack($name . '_input_start') @stack($name . '_input_start')
<div class="{{ $col }} input-group-invoice_text"> <div class="{{ $col }} input-group-invoice-text">
<div class="form-group col-sm-10 {{ isset($attributes['required']) ? 'required' : '' }} {{ $errors->has($name) ? 'has-error' : ''}}"> <div class="form-group col-md-12 {{ isset($attributes['required']) ? 'required' : '' }} {{ $errors->has($name) ? 'has-error' : ''}}">
{!! Form::label($name, $text, ['class' => 'control-label']) !!} {!! Form::label($name, $text, ['class' => 'control-label']) !!}
<div class="input-group"> <div class="input-group">
<div class="input-group-addon"><i class="fa fa-{{ $icon }}"></i></div> <div class="input-group-addon"><i class="fa fa-{{ $icon }}"></i></div>
@ -10,7 +10,7 @@
{!! $errors->first($name, '<p class="help-block">:message</p>') !!} {!! $errors->first($name, '<p class="help-block">:message</p>') !!}
</div> </div>
<div class="form-group col-sm-2 {{ $errors->has('invoice_text_text') ? 'has-error' : '' }}"> <div class="form-group col-md-6 hidden {{ $errors->has('invoice_text_text') ? 'has-error' : '' }}">
{!! Form::label($input_name, trans('settings.invoice.custom'), ['class' => 'control-label']) !!} {!! Form::label($input_name, trans('settings.invoice.custom'), ['class' => 'control-label']) !!}
{!! Form::text($input_name, $input_value, ['class' => 'form-control']) !!} {!! Form::text($input_name, $input_value, ['class' => 'form-control']) !!}
{!! $errors->first($input_name, '<p class="help-block">:message</p>') !!} {!! $errors->first($input_name, '<p class="help-block">:message</p>') !!}