use computed function
gitea/salix/pipeline/head This commit looks good Details

This commit is contained in:
Alex Moreno 2022-03-23 09:46:44 +01:00
parent 1051a9cafb
commit ebfd0bdb29
2 changed files with 13 additions and 10 deletions

View File

@ -77,10 +77,10 @@
<th width="5%">{{$t('reference')}}</th>
<th class="number">{{$t('quantity')}}</th>
<th width="50%">{{$t('concept')}}</th>
<th class="number" v-if="type != 'withoutPrices'">{{$t('price')}}</th>
<th class="centered" width="5%" v-if="type != 'withoutPrices'">{{$t('discount')}}</th>
<th class="centered" v-if="type != 'withoutPrices'">{{$t('vat')}}</th>
<th class="number" v-if="type != 'withoutPrices'">{{$t('amount')}}</th>
<th class="number" v-if="showPrices">{{$t('price')}}</th>
<th class="centered" width="5%" v-if="showPrices">{{$t('discount')}}</th>
<th class="centered" v-if="showPrices">{{$t('vat')}}</th>
<th class="number" v-if="showPrices">{{$t('amount')}}</th>
</tr>
</thead>
<tbody v-for="sale in sales" class="no-page-break">
@ -88,10 +88,10 @@
<td width="5%">{{sale.itemFk | zerofill('000000')}}</td>
<td class="number">{{sale.quantity}}</td>
<td width="50%">{{sale.concept}}</td>
<td class="number" v-if="type != 'withoutPrices'">{{sale.price | currency('EUR', $i18n.locale)}}</td>
<td class="centered" width="5%" v-if="type != 'withoutPrices'">{{(sale.discount / 100) | percentage}}</td>
<td class="centered" v-if="type != 'withoutPrices'">{{sale.vatType}}</td>
<td class="number" v-if="type != 'withoutPrices'">{{sale.price * sale.quantity * (1 - sale.discount / 100) | currency('EUR', $i18n.locale)}}</td>
<td class="number" v-if="showPrices">{{sale.price | currency('EUR', $i18n.locale)}}</td>
<td class="centered" width="5%" v-if="showPrices">{{(sale.discount / 100) | percentage}}</td>
<td class="centered" v-if="showPrices">{{sale.vatType}}</td>
<td class="number" v-if="showPrices">{{sale.price * sale.quantity * (1 - sale.discount / 100) | currency('EUR', $i18n.locale)}}</td>
</tr>
<tr class="description font light-gray">
<td colspan="7">
@ -107,7 +107,7 @@
</td>
</tr>
</tbody>
<tfoot v-if="type != 'withoutPrices'">
<tfoot v-if="showPrices">
<tr>
<td colspan="6" class="font bold">
<span class="pull-right">{{$t('subtotal')}}</span>
@ -181,7 +181,7 @@
</div>
<!-- End of packages block -->
</div>
<div class="columns vn-mt-xl" v-if="type != 'withoutPrices'">
<div class="columns vn-mt-xl" v-if="showPrices">
<!-- Taxes block -->
<div id="taxes" class="size50 pull-right no-page-break" v-if="taxes">
<table class="column-oriented">

View File

@ -44,6 +44,9 @@ module.exports = {
});
return total;
},
showPrices() {
return this.type != 'withoutPrices';
}
},
methods: {