Skip to content

Commit

Permalink
Merge branch 'hotfix/0.23.2'
Browse files Browse the repository at this point in the history
  • Loading branch information
polosson committed Feb 12, 2024
2 parents 73073a3 + 4ba583e commit a87776d
Show file tree
Hide file tree
Showing 53 changed files with 1,657 additions and 880 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@ Tous les changements notables sur le projet sont documentés dans ce fichier.

Ce projet adhère au principe du [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## 0.23.2 (2024-02-12)

- Sur le calendrier, la vérification du matériel manquant est différée pour optimiser les temps de chargement.
- Dans les devis et factures, le calcul de la remise s'applique sur le montant total, non plus sur le total journalier.

## 0.23.1 (2023-12-16)

- Les fiches de sorties des événements peuvent être éditées même en l'absence d'un bénéficiaire.
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.23.1
0.23.2
6 changes: 3 additions & 3 deletions client/src/locale/en/common.js
Original file line number Diff line number Diff line change
Expand Up @@ -286,10 +286,10 @@ export default {
'time': "time",
'delete-selected': "Delete-selected",

"daily-total-without-tax": "Daily total excl. tax:",
"daily-total": "Daily total:",
"daily-total-discountable": "Daily total discountable:",
"daily-total-without-tax-after-discount": "Daily total excl. tax after discount:",
"daily-total-after-discount": "Daily Total after discount:",
"total-discountable": "Total discountable:",
"total-after-discount": "Total with discount:",
"total-without-taxes": "Total excl. tax:",
"total-taxes": "Taxes:",
"total-with-taxes": "Total incl. taxes:",
Expand Down
6 changes: 3 additions & 3 deletions client/src/locale/fr/common.js
Original file line number Diff line number Diff line change
Expand Up @@ -285,10 +285,10 @@ export default {
'time': "heure",
'delete-selected': "Effacer la selection",

"daily-total-without-tax": "Total H.T.\u00A0/\u00A0jour\u00A0:",
"daily-total": "Total\u00A0/\u00A0jour\u00A0:",
"daily-total-discountable": "Total remisable\u00A0/\u00A0jour\u00A0:",
"daily-total-without-tax-after-discount": "Total H.T.\u00A0/\u00A0jour après remise\u00A0:",
"daily-total-after-discount": "Total\u00A0/\u00A0jour après remise\u00A0:",
"total-discountable": "Total remisable\u00A0:",
"total-after-discount": "Total après remise\u00A0:",
"total-without-taxes": "Total H.T.\u00A0:",
"total-taxes": "T.V.A.\u00A0:",
"total-with-taxes": "Total T.T.C.\u00A0:",
Expand Down
20 changes: 8 additions & 12 deletions client/src/stores/api/events.ts
Original file line number Diff line number Diff line change
Expand Up @@ -106,12 +106,10 @@ export type RawEvent<
degressive_rate: DecimalType,
discount_rate: DecimalType,
vat_rate: DecimalType,
daily_total_without_discount: DecimalType,
daily_total_discountable: DecimalType,
daily_total_discount: DecimalType,
daily_total_without_taxes: DecimalType,
daily_total_taxes: DecimalType,
daily_total_with_taxes: DecimalType,
daily_total: DecimalType,
total_without_discount: DecimalType,
total_discountable: DecimalType,
total_discount: DecimalType,
total_without_taxes: DecimalType,
total_taxes: DecimalType,
total_with_taxes: DecimalType,
Expand Down Expand Up @@ -193,12 +191,10 @@ export const normalize = (rawEvent: RawEvent): Event => {
vat_rate: new Decimal(event.vat_rate),
degressive_rate: new Decimal(event.degressive_rate),
discount_rate: new Decimal(event.discount_rate),
daily_total_without_discount: new Decimal(event.daily_total_without_discount),
daily_total_discountable: new Decimal(event.daily_total_discountable),
daily_total_discount: new Decimal(event.daily_total_discount),
daily_total_without_taxes: new Decimal(event.daily_total_without_taxes),
daily_total_taxes: new Decimal(event.daily_total_taxes),
daily_total_with_taxes: new Decimal(event.daily_total_with_taxes),
daily_total: new Decimal(event.daily_total),
total_without_discount: new Decimal(event.total_without_discount),
total_discountable: new Decimal(event.total_discountable),
total_discount: new Decimal(event.total_discount),
total_without_taxes: new Decimal(event.total_without_taxes),
total_taxes: new Decimal(event.total_taxes),
total_with_taxes: new Decimal(event.total_with_taxes),
Expand Down
5 changes: 5 additions & 0 deletions client/src/themes/default/components/EventTotals/index.scss
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,11 @@
text-align: right;
}

&--secondary {
margin-bottom: globals.$spacing-medium;
color: globals.$text-light-color;
}

&--grand-total {
margin-bottom: globals.$spacing-medium;

Expand Down
50 changes: 30 additions & 20 deletions client/src/themes/default/components/EventTotals/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ const EventTotals = defineComponent({
}

const { vat_rate: vatRate } = this.event;
return vatRate.toNumber() > 0;
return !vatRate.isZero();
},

hasDiscount(): boolean {
Expand All @@ -49,28 +49,28 @@ const EventTotals = defineComponent({
}

const { discount_rate: discountRate } = this.event;
return discountRate.toNumber() > 0;
return !discountRate.isZero();
},

discountableDifferentFromTotal(): boolean {
isNotFullyDiscountable(): boolean {
const { is_billable: isBillable } = this.event;
if (!isBillable) {
return false;
}

const {
daily_total_discountable: dailyTotalDiscountable,
daily_total_without_taxes: dailyTotalWithoutTaxes,
total_without_discount: totalWithoutDiscount,
total_discountable: totalDiscountable,
} = this.event;

return dailyTotalDiscountable.toNumber() !== dailyTotalWithoutTaxes.toNumber();
return !totalDiscountable.eq(totalWithoutDiscount);
},
},
created() {
this.$store.dispatch('categories/fetch');
},
render() {
const { $t: __, event, itemsCount, useTaxes, hasDiscount, discountableDifferentFromTotal } = this;
const { $t: __, event, itemsCount, useTaxes, hasDiscount, isNotFullyDiscountable } = this;
const {
is_billable: isBillable,
duration,
Expand Down Expand Up @@ -107,11 +107,11 @@ const EventTotals = defineComponent({
const {
degressive_rate: degressiveRate,
vat_rate: vatRate,
daily_total: dailyTotal,
total_without_discount: totalWithoutDiscount,
discount_rate: discountRate,
daily_total_without_discount: dailyTotalWithoutDiscount,
daily_total_discountable: dailyTotalDiscountable,
daily_total_discount: dailyTotalDiscount,
daily_total_without_taxes: dailyTotalWithoutTaxes,
total_discountable: totalDiscountable,
total_discount: totalDiscount,
total_without_taxes: totalWithoutTaxes,
total_taxes: totalTaxes,
total_with_taxes: totalWithTaxes,
Expand All @@ -123,10 +123,10 @@ const EventTotals = defineComponent({
<div class="EventTotals__billing">
<div class="EventTotals__line">
<div class="EventTotals__line__title">
{__('daily-total')}
{useTaxes ? __('daily-total-without-tax') : __('daily-total')}
</div>
<div class="EventTotals__line__price">
{formatAmount(dailyTotalWithoutDiscount, currency)}
{formatAmount(dailyTotal, currency)}
</div>
</div>
<div class="EventTotals__line">
Expand All @@ -142,18 +142,18 @@ const EventTotals = defineComponent({
{useTaxes ? __('total-without-taxes') : __('total')}
</div>
<div class="EventTotals__line__price">
{formatAmount(totalWithoutTaxes, currency)}
{formatAmount(totalWithoutDiscount, currency)}
</div>
</div>
{hasDiscount && (
<Fragment>
{discountableDifferentFromTotal && (
{isNotFullyDiscountable && (
<div class="EventTotals__line">
<div class="EventTotals__line__title">
{__('daily-total-discountable')}
{__('total-discountable')}
</div>
<div class="EventTotals__line__price">
{formatAmount(dailyTotalDiscountable, currency)}
{formatAmount(totalDiscountable, currency)}
</div>
</div>
)}
Expand All @@ -162,15 +162,15 @@ const EventTotals = defineComponent({
{__('discount-rate', { rate: discountRate })}
</div>
<div class="EventTotals__line__price">
- {formatAmount(dailyTotalDiscount, currency)}
- {formatAmount(totalDiscount, currency)}
</div>
</div>
<div class="EventTotals__line EventTotals__line--grand-total">
<div class="EventTotals__line__title">
{useTaxes ? __('daily-total-without-tax-after-discount') : __('daily-total-after-discount')}
{__('total-after-discount')}
</div>
<div class="EventTotals__line__price">
{formatAmount(dailyTotalWithoutTaxes, currency)}
{formatAmount(totalWithoutTaxes, currency)}
</div>
</div>
</Fragment>
Expand All @@ -195,6 +195,16 @@ const EventTotals = defineComponent({
</div>
</Fragment>
)}
{(!hasDiscount && isNotFullyDiscountable) && (
<div class="EventTotals__line EventTotals__line--secondary">
<div class="EventTotals__line__title">
{__('total-discountable')}
</div>
<div class="EventTotals__line__price">
{formatAmount(totalDiscountable, currency)}
</div>
</div>
)}
</div>
</div>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,6 @@ import Item from './Item';
const DefaultLayoutSidebarMenu = defineComponent({
name: 'DefaultLayoutSidebarMenu',
computed: {
reservationsEnabled() {
return this.$store.state.settings.reservation.enabled;
},

links() {
const links = [
{ ident: 'calendar', url: '/', icon: 'calendar-alt', exact: true },
Expand Down
Loading

0 comments on commit a87776d

Please sign in to comment.