Abstract footer to separate component. Abstract logo to separate component. Be able to edit team in modal. Add custom fields to team. Removed vat and reg no from team (replaced by custom fields). Custom fields are also stored on the invoice. When creating invoice add team custom fields to invoice as well. Be able to set default invoice due date, late fee, vat rate and currency.

This commit is contained in:
HenriT
2021-04-13 12:07:08 +03:00
parent dce73b5603
commit 580fd9aa5a
19 changed files with 523 additions and 137 deletions

31
src/store/team-fields.js Normal file
View File

@ -0,0 +1,31 @@
import TeamField from '@/store/models/team-field';
export default {
namespaced: true,
state: {},
mutations: {},
actions: {
init() {},
terminate() {},
async teamFieldProps(store, payload) {
return TeamField.update({
where: payload.fieldId,
data: payload.props,
});
},
async updateTeamField({ dispatch }, payload) {
await dispatch('teamFieldProps', payload);
return dispatch('teams/updateTeam', null, { root: true });
},
async addNewField(store, teamId) {
const field = await TeamField.createNew();
field.$update({
team_id: teamId,
});
},
async deleteTeamField({ dispatch }, fieldId) {
await TeamField.delete(fieldId);
return dispatch('teams/updateTeam', null, { root: true });
},
},
};