-
-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'feature/5-estimates' into 'develop'
Ajoute la gestion des devis (#5)
- Loading branch information
Showing
49 changed files
with
3,478 additions
and
757 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
47 changes: 47 additions & 0 deletions
47
client/src/components/BillEstimateCreationForm/BillEstimateCreationForm.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
.BillEstimateCreationForm { | ||
&__discount-input .FormField__input { | ||
max-width: 90px; | ||
} | ||
|
||
&__discount-target-input .FormField__input { | ||
max-width: 110px; | ||
} | ||
|
||
&__beneficiary { | ||
display: flex; | ||
flex-direction: column; | ||
margin-top: $content-padding-small-vertical; | ||
|
||
&__label { | ||
display: block; | ||
padding: 5px 0; | ||
} | ||
} | ||
|
||
&__save { | ||
margin-top: $content-padding-large-vertical; | ||
} | ||
|
||
@media(min-width: $screen-tablet) { | ||
&__beneficiary { | ||
flex-direction: row; | ||
align-items: center; | ||
height: 2.5rem; | ||
|
||
&__label { | ||
flex: 0 0 $form-label-width; | ||
padding: 0 $input-padding-horizontal; | ||
text-align: right; | ||
} | ||
|
||
&__name { | ||
flex: 1; | ||
} | ||
} | ||
|
||
&__save { | ||
margin-top: $content-padding-small-vertical; | ||
padding-left: $form-label-width; | ||
} | ||
} | ||
} |
66 changes: 66 additions & 0 deletions
66
client/src/components/BillEstimateCreationForm/BillEstimateCreationForm.vue
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
<template> | ||
<form | ||
class="Form BillEstimateCreationForm" | ||
@submit="handleSubmit" | ||
> | ||
<div class="Form__fieldset"> | ||
<h4 class="Form__fieldset__title">{{ $t('discount') }}</h4> | ||
<FormField | ||
:value="discountRate" | ||
class="BillEstimateCreationForm__discount-input" | ||
name="discountRate" | ||
type="number" | ||
:step="0.0001" | ||
:min="0.0" | ||
:max="99.9999" | ||
addon="%" | ||
label="wanted-rate" | ||
@change="handleChangeRate" | ||
:disabled="loading" | ||
/> | ||
<FormField | ||
:value="discountTarget" | ||
class="BillEstimateCreationForm__discount-target-input" | ||
name="discountTarget" | ||
type="number" | ||
:step="0.01" | ||
:min="0" | ||
:max="maxAmount" | ||
:addon="currency" | ||
label="wanted-amount" | ||
@change="handleChangeAmount" | ||
:disabled="loading" | ||
/> | ||
<div class="BillEstimateCreationForm__beneficiary"> | ||
<div class="BillEstimateCreationForm__beneficiary__label"> | ||
{{ $t('beneficiary') }} | ||
</div> | ||
<div class="BillEstimateCreationForm__beneficiary__name"> | ||
<router-link | ||
:to="`/beneficiaries/${beneficiary.id}`" | ||
:title="$t('action-edit')" | ||
> | ||
{{ beneficiary.full_name }} | ||
</router-link> | ||
</div> | ||
</div> | ||
</div> | ||
<div class="BillEstimateCreationForm__save"> | ||
<button class="success" type="submit" :disabled="loading"> | ||
<i v-if="loading" class="fas fa-circle-notch fa-spin" /> | ||
<i v-else class="fas fa-plus" /> | ||
{{ saveLabel }} | ||
</button> | ||
<button v-if="isRegeneration" @click="$emit('cancel')" type="button" :disabled="loading"> | ||
{{ $t('cancel') }} | ||
</button> | ||
</div> | ||
</form> | ||
</template> | ||
|
||
<style lang="scss"> | ||
@import '../../themes/default/index'; | ||
@import './BillEstimateCreationForm'; | ||
</style> | ||
|
||
<script src="./index.js"></script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
import Config from '@/config/globalConfig'; | ||
import FormField from '@/components/FormField/FormField.vue'; | ||
|
||
export default { | ||
name: 'BillEstimateCreationForm', | ||
components: { FormField }, | ||
props: { | ||
discountRate: Number, | ||
discountTarget: Number, | ||
maxAmount: Number, | ||
beneficiary: Object, | ||
saveLabel: String, | ||
isRegeneration: Boolean, | ||
loading: Boolean, | ||
}, | ||
data() { | ||
return { | ||
currency: Config.currency.symbol, | ||
}; | ||
}, | ||
methods: { | ||
handleChangeRate(value) { | ||
this.$emit('change', { field: 'rate', value: Number.parseFloat(value) }); | ||
}, | ||
|
||
handleChangeAmount(value) { | ||
this.$emit('change', { field: 'amount', value: Number.parseFloat(value) }); | ||
}, | ||
|
||
handleSubmit(e) { | ||
e.preventDefault(); | ||
this.$emit('submit'); | ||
}, | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,93 +1,42 @@ | ||
.EventBilling { | ||
&__last-bill { | ||
margin-bottom: $content-padding-large-vertical; | ||
margin-bottom: $content-padding-large-vertical; | ||
|
||
&__no-bill, | ||
&__regenerate__text { | ||
margin: 0 0 .5rem; | ||
color: $text-light-color; | ||
font-style: italic; | ||
margin-bottom: $content-padding-large-vertical; | ||
} | ||
|
||
&__not-billable { | ||
color: $text-danger-color; | ||
|
||
&__text { | ||
margin: 0; | ||
font-style: italic; | ||
} | ||
} | ||
|
||
&__discount-input .FormField__input { | ||
max-width: 90px; | ||
} | ||
|
||
&__discount-target-input .FormField__input { | ||
max-width: 110px; | ||
} | ||
|
||
&__beneficiary { | ||
display: flex; | ||
flex-direction: column; | ||
margin-top: $content-padding-small-vertical; | ||
|
||
&__label { | ||
display: block; | ||
padding: 5px 0; | ||
} | ||
} | ||
|
||
&__save { | ||
margin-top: 1.2rem; | ||
} | ||
&__no-bill, | ||
&__regenerate__text { | ||
margin: 0 0 $content-padding-large-horizontal; | ||
color: $text-light-color; | ||
font-style: italic; | ||
} | ||
|
||
&__download { | ||
font-size: 1.1rem; | ||
margin-bottom: 1rem; | ||
&__no-estimate { | ||
margin: 0 0 $content-padding-large-horizontal; | ||
color: $text-warning-color; | ||
font-size: 1.1rem; | ||
} | ||
|
||
&__text { | ||
margin: 0 0 .5rem; | ||
} | ||
&__not-billable { | ||
color: $text-danger-color; | ||
|
||
&__link { | ||
display: inline-block; | ||
margin-top: .5rem; | ||
padding: 1rem 1rem 1rem .5rem; | ||
border: 1px solid; | ||
border-radius: $input-border-radius; | ||
} | ||
} | ||
|
||
.fas { | ||
width: 1.5rem; | ||
margin-right: .5rem; | ||
text-align: center; | ||
&__text { | ||
margin: 0; | ||
font-style: italic; | ||
} | ||
} | ||
|
||
@media(min-width: $screen-tablet) { | ||
&__last-bill { | ||
&__beneficiary { | ||
flex-direction: row; | ||
align-items: center; | ||
height: 2.5rem; | ||
|
||
&__label { | ||
flex: 0 0 $form-label-width; | ||
padding: 0 $input-padding-horizontal; | ||
text-align: right; | ||
} | ||
&__download { | ||
font-size: 1.1rem; | ||
margin-bottom: 1rem; | ||
|
||
&__name { | ||
flex: 1; | ||
} | ||
} | ||
&__text { | ||
margin: 0 0 .5rem; | ||
} | ||
|
||
&__save { | ||
margin-top: 1rem; | ||
padding-left: $form-label-width; | ||
} | ||
&__link { | ||
display: inline-block; | ||
margin-top: .5rem; | ||
padding: 1rem 1rem 1rem .5rem; | ||
border: 1px solid; | ||
border-radius: $input-border-radius; | ||
} | ||
} | ||
} |
Oops, something went wrong.