Merge branch 'master' of github.com:akaunting/akaunting

This commit is contained in:
Denis Duliçi 2020-12-29 22:42:29 +03:00
commit bc4735d178
9 changed files with 130 additions and 12 deletions

37
public/css/custom.css vendored
View File

@ -856,6 +856,14 @@ table .align-items-center td span.badge {
/*-- Embed accordion textarea Start--*/
.embed-card-body-footer {
margin-bottom: -1.5rem;
border-top: 1px solid #e9ecef;
margin-left: -25px;
margin-right: -25px;
}
.embed-acoordion-textarea .form-control-label {
margin-top: 20px;
margin-bottom: -10px;
}
.embed-acoordion-textarea {
@ -1005,6 +1013,10 @@ table .align-items-center td span.badge {
background-color: #fff;
}
.aka-box:hover {
background-color: #f6f9fc;
}
.aka-box-content>:last-child {
margin-bottom: 0;
}
@ -1209,17 +1221,31 @@ table .align-items-center td span.badge {
position: relative;
}
.aka-select-menu-option:hover {
background-color: #F5F7FA;
}
.text-strong {
font-weight: bold;
}
.aka-select-footer {
text-align: center;
border-top: 1px solid #b2c2cd;
padding: 8px;
border-top: 1px solid #dee2e6;
cursor: pointer;
color: #55588b;
color: #3c3f72;
font-weight: bold;
height: 40px;
line-height: 40px;
margin-top: 6px;
border-bottom-left-radius: 4px;
border-bottom-right-radius: 4px;
}
.aka-select-footer:hover {
background-color: #3c3f72 !important;
color: white !important;
border-top-color: #3c3f72;
}
.document-item-table>.aka-table>.aka-table-body>.aka-table-row:last-child .btn-aka-link {
@ -1358,6 +1384,11 @@ table .align-items-center td span.badge {
.item-select .v-money.text-right.disabled-money {
color: #8898aa;
background-color: transparent !important;
}
.item-select .v-money.text-right.disabled-money:hover {
background-color: #F5F7FA !important;
}
/* Akaunting Item Button Finish */

View File

@ -0,0 +1,59 @@
<template>
<div>
{{ conversion }}
</div>
</template>
<script>
import Vue from 'vue';
export default {
name: 'akaunting-currency-conversion',
props: {
currencyConversionText: {
type: String,
default: 'Currency conversion'
},
price: {
type: String,
default: 'sale'
},
currecyCode: {
type: String,
default: 'USD'
},
currencyRate: {
default: 1.000,
},
},
data() {
return {
conversion: '',
};
},
created() {
this.conversion = this.currencyConversionText.replace(':price', this.price).replace(':currency_code', this.currecyCode).replace(':currency_rate', this.currencyRate);
},
watch: {
currencyConversionText: function (text) {
this.conversion = text.replace(':price', this.price).replace(':currency_code', this.currecyCode).replace('', this.currencyRate);
},
price: function (price) {
this.conversion = this.currencyConversionText.replace(':price', price).replace(':currency_code', this.currecyCode).replace(':currency_rate', this.currencyRate);
},
currecyCode: function (currecyCode) {
this.conversion = this.currencyConversionText.replace(':price', this.price).replace(':currency_code', currecyCode).replace(':currency_rate', this.currencyRate);
},
currencyRate: function (currencyRate) {
this.conversion = this.currencyConversionText.replace(':price', this.price).replace(':currency_code', this.currecyCode).replace(':currency_rate', currencyRate);
},
},
};
</script>

View File

@ -45,6 +45,7 @@
:value="item.price"
v-bind="money"
masked
disabled
class="text-right disabled-money"
></money>
</div>

View File

@ -10,7 +10,7 @@
</span>
</div>
<money :name="name" @input="input" :placeholder="placeholder" v-bind="money" :value="model" :disabled="disabled" :masked="masked" class="form-control"></money>
<money :name="name" @input="input" :placeholder="placeholder" v-bind="money" :value="model" :disabled="disabled" :masked="masked" class="form-control" :class="moneyClass"></money>
</div>
<div class="invalid-feedback d-block" v-if="error" v-html="error"></div>
@ -27,14 +27,13 @@
</span>
</div>
<money :name="name" @input="input" :placeholder="placeholder" v-bind="money" :value="model" :disabled="disabled" :masked="masked" class="form-control"></money>
<money :name="name" @input="input" :placeholder="placeholder" v-bind="money" :value="model" :disabled="disabled" :masked="masked" class="form-control" :class="moneyClass"></money>
</div>
<money v-else :name="name" @input="input" :placeholder="placeholder" v-bind="money" :value="model" :disabled="disabled" :masked="masked" class="form-control"></money>
<money v-else :name="name" @input="input" :placeholder="placeholder" v-bind="money" :value="model" :disabled="disabled" :masked="masked" class="form-control" :class="moneyClass"></money>
<div class="invalid-feedback d-block" v-if="error" v-html="error"></div>
</div>
</template>
<script>
@ -68,6 +67,11 @@ export default {
type: String,
description: "Prepend icon (left)"
},
moneyClass: {
type: String,
default: null,
description: "Selectbox disabled status"
},
group_class: {
type: String,
default: null,

View File

@ -18,6 +18,7 @@ import AkauntingDate from './../components/AkauntingDate';
import AkauntingRecurring from './../components/AkauntingRecurring';
import AkauntingHtmlEditor from './../components/AkauntingHtmlEditor';
import AkauntingCountdown from './../components/AkauntingCountdown';
import AkauntingCurrencyConversion from './../components/AkauntingCurrencyConversion';
import NProgress from 'nprogress';
import 'nprogress/nprogress.css';
@ -46,6 +47,7 @@ export default {
AkauntingRecurring,
AkauntingHtmlEditor,
AkauntingCountdown,
AkauntingCurrencyConversion,
[Select.name]: Select,
[Option.name]: Option,
[Steps.name]: Steps,

View File

@ -8,6 +8,7 @@ return [
'decimal_mark' => 'Decimal Mark',
'thousands_separator' => 'Thousands Separator',
'precision' => 'Precision',
'conversion' => 'Currency conversion: :price (:currency_code) at :currency_rate',
'symbol' => [
'symbol' => 'Symbol',
'position' => 'Symbol Position',

View File

@ -17,7 +17,7 @@
</td>
<td class="text-right border-bottom-0 long-texts pb-0">
<div>
{{ Form::moneyGroup('sub_total', '', '', ['disabled' => 'true' , 'row-input' => 'true', 'v-model' => 'totals.sub', 'currency' => $currency, 'dynamic-currency' => 'currency'], 0.00, 'text-right disabled-money') }}
{{ Form::moneyGroup('sub_total', '', '', ['disabled' => 'true' , 'row-input' => 'true', 'v-model' => 'totals.sub', 'currency' => $currency, 'dynamic-currency' => 'currency', 'money-class' => 'text-right disabled-money'], 0.00, 'text-right disabled-money') }}
</div>
</td>
<td class="border-bottom-0 pb-0"></td>
@ -33,7 +33,7 @@
</td>
<td class="text-right border-top-0 border-bottom-0 long-texts pb-0">
<div>
{{ Form::moneyGroup('item_discount', '', '', ['disabled' => 'true' , 'row-input' => 'true', 'v-model' => 'totals.item_discount', 'currency' => $currency, 'dynamic-currency' => 'currency'], 0.00, 'text-right disabled-money') }}
{{ Form::moneyGroup('item_discount', '', '', ['disabled' => 'true' , 'row-input' => 'true', 'v-model' => 'totals.item_discount', 'currency' => $currency, 'dynamic-currency' => 'currency', 'money-class' => 'text-right disabled-money'], 0.00, 'text-right disabled-money') }}
</div>
</td>
<td class="border-top-0 pb-0"></td>
@ -88,7 +88,7 @@
</td>
<td class="text-right border-top-0 border-bottom-0 pb-0">
<div>
{{ Form::moneyGroup('discount_total', '', '', ['disabled' => 'true' , 'row-input' => 'true', 'v-model' => 'totals.discount', 'currency' => $currency, 'dynamic-currency' => 'currency'], 0.00, 'text-right disabled-money') }}
{{ Form::moneyGroup('discount_total', '', '', ['disabled' => 'true' , 'row-input' => 'true', 'v-model' => 'totals.discount', 'currency' => $currency, 'dynamic-currency' => 'currency', 'money-class' => 'text-right disabled-money'], 0.00, 'text-right disabled-money') }}
</div>
{!! Form::hidden('discount', null, ['id' => 'discount', 'class' => 'form-control text-right', 'v-model' => 'form.discount']) !!}
</td>
@ -106,7 +106,7 @@
</td>
<td class="text-right border-top-0 border-bottom-0 long-texts pb-0">
<div>
{{ Form::moneyGroup('tax_total', '', '', ['disabled' => 'true' , 'row-input' => 'true', 'v-model' => 'tax.total', 'currency' => $currency, 'dynamic-currency' => 'currency'], 0.00, 'text-right disabled-money') }}
{{ Form::moneyGroup('tax_total', '', '', ['disabled' => 'true' , 'row-input' => 'true', 'v-model' => 'tax.total', 'currency' => $currency, 'dynamic-currency' => 'currency', 'money-class' => 'text-right disabled-money'], 0.00, 'text-right disabled-money') }}
</div>
</td>
<td class="border-top-0 pb-0"></td>
@ -122,12 +122,27 @@
</td>
<td class="text-right border-top-0 long-texts pb-0">
<div>
{{ Form::moneyGroup('grand_total', '', '', ['disabled' => 'true' , 'row-input' => 'true', 'v-model' => 'totals.total', 'currency' => $currency, 'dynamic-currency' => 'currency'], 0.00, 'text-right disabled-money') }}
{{ Form::moneyGroup('grand_total', '', '', ['disabled' => 'true' , 'row-input' => 'true', 'v-model' => 'totals.total', 'currency' => $currency, 'dynamic-currency' => 'currency', 'money-class' => 'text-right disabled-money'], 0.00, 'text-right disabled-money') }}
</div>
</td>
<td class="border-top-0"></td>
</tr>
@stack('grand_total_td_end')
@stack('currency_conversion_td_start')
<tr id="tr-currency-conversion" class="d-none" :class="[{'d-table-row': (('{{ setting('default.currency') }}' != form.currency_code) && totals.total)}]">
<td class="border-top-0 pb-0"></td>
<td class="text-right border-top-0 border-right-0 align-middle pb-0" colspan="2">
<akaunting-currency-conversion
currency-conversion-text="{{ trans('currencies.conversion') }}"
:price="(totals.total / form.currency_rate).toFixed(2)"
currecy-code="{{ setting('default.currency') }}"
:currency-rate="form.currency_rate"
></akaunting-currency-conversion>
</td>
<td class="border-top-0"></td>
</tr>
@stack('currency_conversion_td_end')
</tbody>
</table>
</div>

View File

@ -10,6 +10,7 @@
<script type="text/javascript">
var document_items = {!! $document_items !!};
var document_default_currency = '{{ setting('default.currency') }}';
var document_currencies = {!! $currencies !!};
var document_taxes = {!! $taxes !!};
</script>

View File

@ -7,6 +7,10 @@
:form-classes="[{'has-error': form.errors.has('{{ $name }}') }]"
@endif
@if (!empty($attributes['money-class']))
money-class="{{ $attributes['money-class'] }}"
@endif
@if (isset($attributes['required']))
:required="{{ ($attributes['required']) ? 'true' : 'false' }}"
@endif