Merge branch 'master' of github.com:akaunting/akaunting
This commit is contained in:
commit
33e5a7d09b
@ -62,21 +62,21 @@ trait Currencies
|
|||||||
|
|
||||||
public function getConvertedAmount($format = false, $with_tax = true)
|
public function getConvertedAmount($format = false, $with_tax = true)
|
||||||
{
|
{
|
||||||
$amount = $with_tax ? $this->amount : isset($this->amount_without_tax) ? $this->amount_without_tax : $this->amount;
|
$amount = $with_tax ? $this->amount : (isset($this->amount_without_tax) ? $this->amount_without_tax : $this->amount);
|
||||||
|
|
||||||
return $this->convert($amount, $this->currency_code, $this->currency_rate, $format);
|
return $this->convert($amount, $this->currency_code, $this->currency_rate, $format);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getReverseConvertedAmount($format = false, $with_tax = true)
|
public function getReverseConvertedAmount($format = false, $with_tax = true)
|
||||||
{
|
{
|
||||||
$amount = $with_tax ? $this->amount : isset($this->amount_without_tax) ? $this->amount_without_tax : $this->amount;
|
$amount = $with_tax ? $this->amount : (isset($this->amount_without_tax) ? $this->amount_without_tax : $this->amount);
|
||||||
|
|
||||||
return $this->reverseConvert($amount, $this->currency_code, $this->currency_rate, $format);
|
return $this->reverseConvert($amount, $this->currency_code, $this->currency_rate, $format);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getDynamicConvertedAmount($format = false, $with_tax = true)
|
public function getDynamicConvertedAmount($format = false, $with_tax = true)
|
||||||
{
|
{
|
||||||
$amount = $with_tax ? $this->amount : isset($this->amount_without_tax) ? $this->amount_without_tax : $this->amount;
|
$amount = $with_tax ? $this->amount : (isset($this->amount_without_tax) ? $this->amount_without_tax : $this->amount);
|
||||||
|
|
||||||
return $this->dynamicConvert($this->default_currency_code, $amount, $this->currency_code, $this->currency_rate, $format);
|
return $this->dynamicConvert($this->default_currency_code, $amount, $this->currency_code, $this->currency_rate, $format);
|
||||||
}
|
}
|
||||||
|
@ -98,10 +98,18 @@
|
|||||||
|
|
||||||
$('#name').focus();
|
$('#name').focus();
|
||||||
|
|
||||||
$("#tax_id").select2({
|
$('#tax_id').select2({
|
||||||
placeholder: {
|
placeholder: {
|
||||||
id: '-1', // the value of the option
|
id: '-1', // the value of the option
|
||||||
text: "{{ trans('general.form.select.field', ['field' => trans_choice('general.taxes', 1)]) }}"
|
text: "{{ trans('general.form.select.field', ['field' => trans_choice('general.taxes', 1)]) }}"
|
||||||
|
},
|
||||||
|
escapeMarkup: function (markup) {
|
||||||
|
return markup;
|
||||||
|
},
|
||||||
|
language: {
|
||||||
|
noResults: function () {
|
||||||
|
return '<span id="tax-add-new plus"><i class="fa fa-plus"></i> {{ trans('general.title.new', ['type' => trans_choice('general.tax_rates', 1)]) }}</span>';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -116,6 +124,26 @@
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
$(document).on('click', '.select2-results__option.select2-results__message', function(e) {
|
||||||
|
tax_name = $('.select2-search__field').val();
|
||||||
|
|
||||||
|
$('body > .select2-container.select2-container--default.select2-container--open').remove();
|
||||||
|
|
||||||
|
$('#modal-create-tax').remove();
|
||||||
|
|
||||||
|
$.ajax({
|
||||||
|
url: '{{ url("modals/taxes/create") }}',
|
||||||
|
type: 'GET',
|
||||||
|
dataType: 'JSON',
|
||||||
|
data: {name: tax_name},
|
||||||
|
success: function(json) {
|
||||||
|
if (json['success']) {
|
||||||
|
$('body').append(json['html']);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
$(document).on('click', '#button-category', function (e) {
|
$(document).on('click', '#button-category', function (e) {
|
||||||
$('#modal-create-category').remove();
|
$('#modal-create-category').remove();
|
||||||
|
|
||||||
|
@ -87,10 +87,18 @@
|
|||||||
$("#sale_price").focusout();
|
$("#sale_price").focusout();
|
||||||
$("#purchase_price").focusout();*/
|
$("#purchase_price").focusout();*/
|
||||||
|
|
||||||
$("#tax_id").select2({
|
$('#tax_id').select2({
|
||||||
placeholder: {
|
placeholder: {
|
||||||
id: '-1', // the value of the option
|
id: '-1', // the value of the option
|
||||||
text: "{{ trans('general.form.select.field', ['field' => trans_choice('general.taxes', 1)]) }}"
|
text: "{{ trans('general.form.select.field', ['field' => trans_choice('general.taxes', 1)]) }}"
|
||||||
|
},
|
||||||
|
escapeMarkup: function (markup) {
|
||||||
|
return markup;
|
||||||
|
},
|
||||||
|
language: {
|
||||||
|
noResults: function () {
|
||||||
|
return '<span id="tax-add-new plus"><i class="fa fa-plus"></i> {{ trans('general.title.new', ['type' => trans_choice('general.tax_rates', 1)]) }}</span>';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -129,5 +137,25 @@
|
|||||||
});
|
});
|
||||||
@endif
|
@endif
|
||||||
});
|
});
|
||||||
|
|
||||||
|
$(document).on('click', '.select2-results__option.select2-results__message', function(e) {
|
||||||
|
tax_name = $('.select2-search__field').val();
|
||||||
|
|
||||||
|
$('body > .select2-container.select2-container--default.select2-container--open').remove();
|
||||||
|
|
||||||
|
$('#modal-create-tax').remove();
|
||||||
|
|
||||||
|
$.ajax({
|
||||||
|
url: '{{ url("modals/taxes/create") }}',
|
||||||
|
type: 'GET',
|
||||||
|
dataType: 'JSON',
|
||||||
|
data: {name: tax_name},
|
||||||
|
success: function(json) {
|
||||||
|
if (json['success']) {
|
||||||
|
$('body').append(json['html']);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
</script>
|
</script>
|
||||||
@endpush
|
@endpush
|
||||||
|
Loading…
x
Reference in New Issue
Block a user