akaunting 3.0 (the last dance)

This commit is contained in:
Burak Civan
2022-06-01 10:15:55 +03:00
parent cead09f6d4
commit d9c0764572
3812 changed files with 126831 additions and 102949 deletions

View File

@ -1,135 +1,80 @@
<template>
<div>
<h1 class="text-white">
{{ translations.company.title }}
</h1>
<div class="relative bg-body z-10 rounded-lg shadow-2xl p-10" style="height:675px;">
<WizardSteps :active_state="active"></WizardSteps>
<div class="card">
<div class="card-header wizard-header p-3">
<el-steps :active="active" finish-status="success" align-center>
<el-step :title="translations.company.title"></el-step>
<el-step :title="translations.currencies.title"></el-step>
<el-step :title="translations.taxes.title"></el-step>
<el-step :title="translations.finish.title"></el-step>
</el-steps>
</div>
<form ref="form" class="w-100 mb-0">
<div class="card-body">
<div class="document-loading" v-if="pageLoad">
<div>
<i class="fas fa-spinner fa-pulse fa-7x"></i>
</div>
<form ref="form" class="w-full">
<div class="relative">
<div v-if="pageLoad" class="absolute left-0 right-0 top-0 bottom-0 w-full h-full bg-white rounded-lg flex items-center justify-center z-50">
<span class="material-icons form-spin text-lg animate-spin text-9xl">data_usage</span>
</div>
<div class="row mb-0">
<div class="col-12 mb-4">
<base-input
:label="translations.company.api_key"
name="api_key"
data-name="api_key"
:placeholder="translations.company.api_key"
prepend-icon="fas fa-key"
v-model="company.api_key"
/>
<div class="flex flex-col justify-between">
<div class="grid sm:grid-cols-6 gap-x-8 gap-y-6 my-3.5 menu-scroll gap-10">
<div class="sm:col-span-6">
<base-input :label="translations.company.api_key" name="api_key" data-name="api_key" :placeholder="translations.company.api_key" v-model="company.api_key"/>
<p class="mb-0 mt--3">
<small>
<div>
<a href="https://akaunting.com/dashboard" target="_blank">Click here</a>
to get your API key.
</div>
</small>
</p>
<div class="mt-2">
<small>
<a href="https://akaunting.com/dashboard" class="text-green" target="_blank">Click here</a>
to get your API key.
</small>
</div>
</div>
<div class="sm:col-span-3">
<base-input type="text" :label="translations.company.tax_number" name="tax_number" data-name="tax_number" :placeholder="translations.company.tax_number" v-model="company.tax_number"/>
</div>
<div class="sm:col-span-3">
<akaunting-date :title="translations.company.financial_start" data-name="financial_start" :placeholder="translations.company.financial_start" icon="calendar_today"
:date-config="{
dateFormat: 'd-m',
allowInput: false,
altInput: true,
altFormat: 'j F'
}"
v-model="company.financial_start"
></akaunting-date>
</div>
<div class="sm:col-span-3 grid gap-10">
<div class="sm:col-span-3">
<base-input :label="translations.company.address">
<textarea class="form-element" name="address" data-name="address" rows="3" :placeholder="translations.company.address" v-model="company.address"></textarea>
</base-input>
</div>
<div class="sm:col-span-3">
<base-input :label="translations.company.country">
<el-select v-model="company.country" filterable>
<el-option
v-for="(country, index) in sortedCountries"
:key="index"
:label="country.value"
:value="country.key"
>
</el-option>
</el-select>
</base-input>
<input name="country" type="hidden" class="d-none" v-model="company.country">
</div>
</div>
<div class="sm:col-span-3">
<label class="form-control-label">{{ translations.company.logo }}</label>
<akaunting-dropzone-file-upload ref="dropzoneWizard" class="form-file dropzone-column w-2/5" style="height:12.2rem" preview-classes="single" :attachments="logo" :v-model="logo">
</akaunting-dropzone-file-upload>
</div>
</div>
<div class="col-6">
<base-input
type="text"
:label="translations.company.tax_number"
name="tax_number"
data-name="tax_number"
:placeholder="translations.company.tax_number"
prepend-icon="fas fa-percent"
v-model="company.tax_number"
/>
</div>
<div class="flex items-center justify-center mt-5 gap-x-10">
<base-button class="w-1/2 flex items-center justify-center px-6 py-1.5 text-base rounded-lg bg-transparent hover:bg-gray-100" @click="next()">{{ translations.company.skip }}</base-button>
<div class="col-6">
<akaunting-date
:title="translations.company.financial_start"
data-name="financial_start"
:placeholder="translations.company.financial_start"
icon="fas fa-calendar"
:date-config="{
dateFormat: 'd-m',
allowInput: false,
altInput: true,
altFormat: 'j F'
}"
v-model="real_date"
></akaunting-date>
</div>
<div class="col-12">
<base-input :label="translations.company.address">
<textarea
class="form-control"
name="address"
data-name="address"
rows="3"
:placeholder="translations.company.address"
v-model="company.address"
></textarea>
</base-input>
</div>
<div class="col-6">
<base-input :label="translations.company.country">
<el-select v-model="company.country" filterable>
<template slot="prefix">
<span class="el-input__suffix-inner el-select-icon">
<i :class="'select-icon-position el-input__icon fas fa-globe-americas'"></i>
</span>
</template>
<el-option
v-for="(country, index) in sortedCountries"
:key="index"
:label="country.value"
:value="country.key"
>
</el-option>
</el-select>
</base-input>
<input name="country" type="hidden" class="d-none" v-model="company.country"></input>
</div>
<div class="col-6 mb-0">
<label class="form-control-label">{{ translations.company.logo }}</label>
<akaunting-dropzone-file-upload
ref="dropzoneWizard"
class="form-file"
preview-classes="single"
:attachments="logo"
:v-model="logo"
>
</akaunting-dropzone-file-upload>
</div>
</div>
</div>
<div class="card-footer">
<div class="row">
<div class="col-md-12 text-right">
<base-button
id="button"
type="success"
native-type="button"
@click="onEditSave()"
>{{ translations.company.save }}</base-button>
<base-button type="white" native-type="submit" @click="next()">{{ translations.company.skip }}</base-button>
<base-button id="button" class="w-1/2 relative flex items-center justify-center bg-green hover:bg-green-700 text-white px-6 py-1.5 text-base rounded-lg disabled:bg-green-100" @click="onEditSave()">
{{ translations.company.save }}
</base-button>
</div>
</div>
</div>
@ -139,10 +84,11 @@
</template>
<script>
import { Step, Steps, Select, Option } from "element-ui";
import { Select, Option } from "element-ui";
import AkauntingDropzoneFileUpload from "./../../components/AkauntingDropzoneFileUpload";
import AkauntingDate from "./../../components/AkauntingDate";
import WizardAction from "./../../mixins/wizardAction";
import WizardSteps from "./Steps.vue";
export default {
name: "Company",
@ -150,12 +96,11 @@ export default {
mixins: [WizardAction],
components: {
[Step.name]: Step,
[Steps.name]: Steps,
[Select.name]: Select,
[Option.name]: Option,
AkauntingDropzoneFileUpload,
AkauntingDate,
WizardSteps
},
props: {
@ -296,11 +241,8 @@ export default {
size: company.logo.size,
downloadPath: false,
}];
this.logo.push(logo_arr);
}
this.real_date = company.financial_start;
}
},
@ -362,6 +304,8 @@ export default {
formData.appendRecursive(data_name);
this.company.financial_start = data_name.financial_start;
window.axios({
method: "POST",
url: url + "/wizard/companies",

View File

@ -1,312 +1,195 @@
<template>
<div>
<h1 class="text-white">
{{ translations.currencies.title }}
</h1>
<div class="relative bg-body z-10 rounded-lg shadow-2xl p-10" style="height:675px;">
<WizardSteps :active_state="active"></WizardSteps>
<div class="card">
<div class="card-header wizard-header p-3">
<el-steps :active="active" finish-status="success" align-center>
<el-step :title="translations.company.title"></el-step>
<el-step :title="translations.currencies.title"></el-step>
<el-step :title="translations.taxes.title"></el-step>
<el-step :title="translations.finish.title"></el-step>
</el-steps>
</div>
<div class="flex flex-col justify-between overflow-y-auto" style="height: calc(100% - 53px)">
<div v-if="pageLoad" class="absolute left-0 right-0 top-0 bottom-0 w-full h-full bg-white rounded-lg flex items-center justify-center z-50">
<span class="material-icons form-spin animate-spin text-9xl">data_usage</span>
</div>
<div class="card-body">
<div class="document-loading" v-if="pageLoad">
<div>
<i class="fas fa-spinner fa-pulse fa-7x"></i>
</div>
</div>
<div class="overflow-x-visible menu-scroll mt-1">
<form ref="form" class="py-2 align-middle inline-block min-w-full">
<table id="tbl-currencies" class="min-w-full divide-y divide-gray-200">
<thead>
<tr class="flex items-center px-1">
<th class="w-4/12 ltr:pr-6 rtl:pl-6 py-3 ltr:text-left rtl:text-right text-sm font-bold text-black tracking-wider">
{{ translations.currencies.name }}
</th>
<div class="d-flex justify-content-end mb-3">
<base-button
type="success"
native-type="button"
class="btn-sm"
@click="onAddItem()"
>{{ translations.currencies.add_new }}</base-button
>
</div>
<th class="w-4/12 ltr:pr-6 rtl:pl-6 py-3 text-center text-sm font-bold text-black tracking-wider">
{{ translations.currencies.code }}
</th>
<div class="row flex-column">
<form ref="form">
<table class="table table-flush table-hover" id="tbl-currencies">
<thead class="thead-light">
<tr class="row table-head-line">
<th class="col-xs-4 col-sm-4 col-md-3">
{{ translations.currencies.name }}
</th>
<th class="col-md-3 d-none d-md-block">
{{ translations.currencies.code }}
</th>
<th class="col-md-2 d-none d-md-block">
{{ translations.currencies.rate }}
</th>
<th class="col-xs-4 col-sm-4 col-md-2">
{{ translations.currencies.enabled }}
</th>
<th class="col-xs-4 col-sm-4 col-md-2 text-center">
{{ translations.currencies.actions }}
</th>
</tr>
</thead>
<th class="w-4/12 ltr:pr-6 rtl:pl-6 py-3 ltr:text-right rtl:text-left text-sm font-bold text-black tracking-wider">
{{ translations.currencies.rate }}
</th>
</tr>
</thead>
<tbody>
<tr
v-for="(item, index) in currencies"
:key="index"
class="row align-items-center border-top-1"
>
<td class="col-xs-4 col-sm-4 col-md-3">
<a href="javascript:void(0);"> {{ item.name }} </a>
</td>
<td class="col-md-3 d-none d-md-block">{{ item.code }}</td>
<td class="col-md-2 d-none d-md-block">{{ item.rate }}</td>
<td class="col-xs-4 col-sm-4 col-md-2">
<label class="custom-toggle d-inline-block" name="staus-1">
<input
type="checkbox"
:checked="item.enabled"
@input="onSwitchUpdate(item)"
/>
<span
class="custom-toggle-slider rounded-circle status-green"
:data-label-on="translations.currencies.yes"
:data-label-off="translations.currencies.no"
>
</span>
</label>
</td>
<td class="col-xs-4 col-sm-4 col-md-2 text-center">
<div class="dropdown">
<a
class="btn btn-neutral btn-sm text-light items-align-center py-2"
href="#"
role="button"
data-toggle="dropdown"
aria-haspopup="true"
aria-expanded="false"
>
<i class="fa fa-ellipsis-h text-muted"></i>
</a>
<tbody data-table-body>
<tr v-for="(item, index) in currencies" :key="index" data-table-list class="relative flex items-center border-b hover:bg-gray-100 px-1 flex-wrap group">
<td :class="current_tab == index ? 'hidden' : ''" class="w-4/12 ltr:pr-6 rtl:pl-6 py-4 ltr:text-left rtl:text-right whitespace-nowrap text-sm font-medium text-black">
{{ item.name }}
</td>
<td :class="current_tab == index ? 'hidden' : ''" class="w-4/12 ltr:pr-6 rtl:pl-6 py-4 text-center whitespace-nowrap text-sm font-medium text-black">
{{ item.code }}
</td>
<td :class="current_tab == index ? 'hidden' : ''" class="w-4/12 relative ltr:pr-6 rtl:pl-6 py-4 ltr:text-right rtl:text-left whitespace-nowrap text-sm font-medium text-black">
{{ item.rate }}
<div
class="dropdown-menu dropdown-menu-right dropdown-menu-arrow"
>
<button
type="button"
class="dropdown-item"
@click="onEditItem(item, index)"
>
{{ translations.currencies.edit }}
<div class="absolute ltr:right-12 rtl:left-12 -top-4 hidden items-center group-hover:flex">
<button type="button" class="relative bg-white hover:bg-gray-100 border py-0.5 px-1 cursor-pointer index-actions " @click="onEditItem(item, index)">
<span class="material-icons-outlined text-purple text-lg">edit</span>
<div class="inline-block absolute invisible z-20 py-1 px-2 text-sm font-medium text-gray-900 bg-white rounded-lg border border-gray-200 shadow-sm opacity-0 whitespace-nowrap tooltip-content -top-10 -left-2" data-tooltip-placement="top">
<span>{{ translations.currencies.edit }}</span>
<div class="absolute w-2 h-2 -bottom-1 before:content-[' '] before:absolute before:w-2 before:h-2 before:bg-white before:border-gray-200 before:transform before:rotate-45 before:border before:border-t-0 before:border-l-0" data-popper-arrow></div>
</div>
</button>
<button type="button" class="relative bg-white hover:bg-gray-100 border py-0.5 px-1 cursor-pointer index-actions " @click="onClickDelete(item)">
<span class="material-icons-outlined text-purple text-lg">delete</span>
<div class="inline-block absolute invisible z-20 py-1 px-2 text-sm font-medium text-gray-900 bg-white rounded-lg border border-gray-200 shadow-sm opacity-0 whitespace-nowrap tooltip-content -top-10 -left-2" data-tooltip-placement="top">
<span>{{ translations.currencies.delete }}</span>
<div class="absolute w-2 h-2 -bottom-1 before:content-[' '] before:absolute before:w-2 before:h-2 before:bg-white before:border-gray-200 before:transform before:rotate-45 before:border before:border-t-0 before:border-l-0" data-popper-arrow></div>
</div>
</button>
</div>
</td>
<td class="w-full p-0 current-tab" v-if="current_tab == index">
<div class="grid sm:grid-cols-6 gap-x-8 gap-y-6 py-3">
<base-input name="name" data-name="name"
form-classes="sm:col-span-2"
class="required"
v-model="model.name"
:error="onFailErrorGet('name')"
/>
<base-input class="sm:col-span-2 required" :error="onFailErrorGet('code')">
<el-select name="code" v-model="model.select" @change="onChangeCodeItem(model.select)" filterable>
<el-option
v-for="option in currency_codes"
:key="option"
:label="option"
:value="option"
>
</el-option>
</el-select>
</base-input>
<base-input name="rate" data-name="rate" :placeholder="translations.currencies.rate"
form-classes="sm:col-span-2"
class="required"
v-model="model.rate"
:error="onFailErrorGet('rate')"
/>
<div class="flex justify-end items-center sm:col-span-6">
<base-button class=" flex items-center justify-center px-6 py-1.5 text-base rounded-lg bg-transparent hover:bg-gray-100 ltr:mr-2 rtl:ml-2" @click="onCancelItem()">
{{ translations.currencies.cancel }}
</base-button>
<base-button class="relative flex items-center justify-center bg-green hover:bg-green-700 text-white px-6 py-1.5 text-base rounded-lg disabled:bg-green-100" @click="onEditForm(item)">
{{ translations.currencies.save }}
</base-button>
</div>
</div>
</td>
</tr>
</tbody>
</table>
<div class="flex flex-col items-center">
<div v-if="!currencies.length" class="flex flex-col items-center gap-y-2">
<span class="text-dark">
{{ translations.currencies.no_currency }}
</span>
<span class="text-gray-700">
{{ translations.currencies.create_currency }}
</span>
</div>
<div v-if="currencies.length" class="w-full border-b hover:bg-gray-100" style="height:53px;">
<button type="button" class="w-full h-full flex items-center justify-center text-purple font-medium disabled:bg-gray-200" @click="onAddItem()">
<span class="material-icons-outlined text-base font-bold ltr:mr-1 rtl:ml-1">add</span>
<span class="border-b border-transparent transition-all">{{ translations.currencies.new_currency }}</span>
</button>
</div>
<button v-else type="button" class="relative flex items-center justify-center bg-green hover:bg-green-700 text-white px-6 py-1.5 text-base rounded-lg disabled:bg-green-100 mt-3" @click="onAddItem()">
{{ translations.currencies.new_currency }}
</button>
<div class="dropdown-divider"></div>
<button
type="button"
class="dropdown-item"
@click="onClickDelete(item)"
>
{{ translations.currencies.delete }}
</button>
</div>
</div>
</td>
<td class="w-100 p-0 current-tab" v-if="current_tab == index">
<div class="row pt-3 pb-3">
<div
class="form-container col-12 d-flex justify-content-between align-items-start"
>
<base-input
:label="translations.currencies.name"
name="name"
data-name="name"
:placeholder="translations.currencies.name"
prepend-icon="fas fa-font"
form-classes="col-md-3"
class="required"
v-model="model.name"
:error="onFailErrorGet('name')"
/>
<base-input
:label="translations.currencies.code"
class="required"
form-classes="col-md-3"
:error="onFailErrorGet('code')"
>
<el-select
name="code"
v-model="model.select"
@change="onChangeCodeItem(model.select)"
filterable
>
<template slot="prefix">
<span
class="el-input__suffix-inner el-select-icon"
>
<i
:class="'select-icon-position el-input__icon fa fa-code'"
></i>
</span>
</template>
<el-option
v-for="option in currency_codes"
:key="option"
:label="option"
:value="option"
>
</el-option> </el-select
></base-input>
<base-input
:label="translations.currencies.rate"
name="rate"
data-name="rate"
:placeholder="translations.currencies.rate"
prepend-icon="fas fa-percentage"
form-classes="col-md-3"
class="required"
v-model="model.rate"
:error="onFailErrorGet('rate')"
/>
<div class="mt-4 col-md-3 current-tab-btn">
<base-button
type="white"
native-type="button"
@click="onCancelItem()"
>
{{ translations.currencies.cancel }}</base-button
>
<base-button
type="success"
native-type="button"
@click="onEditForm(item)"
>
{{ translations.currencies.save }}</base-button
>
<div v-if="new_datas" class="grid sm:grid-cols-7 gap-x-8 gap-y-6 my-3.5 w-full">
<base-input :label="translations.currencies.name" name="name" data-name="name" :placeholder="translations.currencies.name"
class="sm:col-span-3 required"
v-model="model.name"
:error="onFailErrorGet('name')"
/>
<base-input :label="translations.currencies.code" class="sm:col-span-2 required" :error="onFailErrorGet('code')">
<el-select name="code" v-model="model.select" required="required" @change="onChangeCodeItem(model.select)"filterable>
<el-option
v-for="option in currency_codes"
:key="option"
:label="option"
:value="option"
>
</el-option>
</el-select>
</base-input>
<base-input :label="translations.currencies.rate" name="rate" data-name="rate" :placeholder="translations.currencies.rate"
class="sm:col-span-2 required"
v-model="model.rate"
:error="onFailErrorGet('rate')"
/>
<div class="flex items-center justify-end sm:col-span-7">
<base-button class=" flex items-center justify-center px-6 py-1.5 text-base rounded-lg bg-transparent hover:bg-gray-100 ltr:mr-2 rtl:ml-2" @click="new_datas = false">
{{ translations.currencies.cancel }}
</base-button>
<base-button :disabled="button_loading" class="relative flex items-center justify-center bg-green hover:bg-green-700 text-white px-6 py-1.5 text-base rounded-lg disabled:bg-green-100" @click="onSubmitForm()">
<i v-if="button_loading" class="submit-spin absolute w-2 h-2 rounded-full left-0 right-0 -top-3.5 m-auto"></i>
<span :class="[{'opacity-0': button_loading}]">
{{ translations.currencies.save }}
</span>
</base-button>
</div>
</div>
</div>
</div>
</td>
</tr>
<tr v-if="new_datas">
<td class="p-0">
<div class="row pt-3 pb-3">
<div
class="form-container col-12 d-flex justify-content-between align-items-start"
>
<base-input
:label="translations.currencies.name"
name="name"
data-name="name"
:placeholder="translations.currencies.name"
prepend-icon="fas fa-font"
class="required"
v-model="model.name"
:error="onFailErrorGet('name')"
/>
<base-input
:label="translations.currencies.code"
class="required"
:error="onFailErrorGet('code')"
>
<el-select
name="code"
v-model="model.select"
required="required"
@change="onChangeCodeItem(model.select)"
filterable
>
<template slot="prefix">
<span
class="el-input__suffix-inner el-select-icon"
>
<i
:class="'select-icon-position el-input__icon fa fa-code'"
></i>
</span>
</template>
<el-option
v-for="option in currency_codes"
:key="option"
:label="option"
:value="option"
>
</el-option> </el-select
></base-input>
<base-input
:label="translations.currencies.rate"
name="rate"
data-name="rate"
:placeholder="translations.currencies.rate"
prepend-icon="fas fa-percentage"
class="required"
v-model="model.rate"
:error="onFailErrorGet('rate')"
/>
<div>
<div class="d-flex">
<akaunting-radio-group
name="enabled"
:text="translations.currencies.enabled"
:enable="translations.currencies.yes"
:disable="translations.currencies.no"
:value="model.enabled"
>
</akaunting-radio-group>
</div>
</div>
<div class="mt-4">
<base-button
type="success"
native-type="button"
@click="onSubmitForm()"
>{{ translations.currencies.save }}</base-button
>
</div>
</div>
</div>
</td>
</tr>
</tbody>
</table>
</form>
</form>
</div>
<div class="flex items-center justify-center mt-5 gap-x-10">
<base-button class="w-1/2 flex items-center justify-center px-6 py-1.5 text-base rounded-lg bg-transparent hover:bg-gray-100" @click="prev()">
{{ translations.currencies.previous }}
</base-button>
<base-button class="w-1/2 relative flex items-center justify-center bg-green hover:bg-green-700 text-white px-6 py-1.5 text-base rounded-lg disabled:bg-green-100" @click="next()">
{{translations.currencies.next}}
</base-button>
</div>
</div>
<notifications></notifications>
<form id="form-dynamic-component" method="POST" action="#"></form>
<component
v-bind:is="component"
@deleted="onDeleteCurrency($event)"
></component>
</div>
<div class="card-footer">
<div class="row">
<div class="col-md-12 d-flex justify-content-between">
<base-button type="white" native-type="submit" @click="prev()">{{
translations.currencies.previous
}}</base-button>
<base-button type="white" native-type="submit" @click="next()">{{
translations.currencies.next
}}</base-button>
</div>
</div>
</div>
<component v-bind:is="component" @deleted="onDeleteCurrency($event)"></component>
</div>
</div>
</template>
<script>
import { Step, Steps, Select, Option } from "element-ui";
import AkauntingRadioGroup from "./../../components/forms/AkauntingRadioGroup";
import { Select, Option } from "element-ui";
import AkauntingRadioGroup from "./../../components/AkauntingRadioGroup";
import BulkAction from "./../../plugins/bulk-action";
import MixinsGlobal from "./../../mixins/global";
import WizardAction from "./../../mixins/wizardAction";
import WizardSteps from "./Steps.vue";
export default {
name: "Currencies",
@ -314,11 +197,10 @@ export default {
mixins: [MixinsGlobal, WizardAction],
components: {
[Step.name]: Step,
[Steps.name]: Steps,
[Select.name]: Select,
[Option.name]: Option,
AkauntingRadioGroup,
WizardSteps
},
props: {
@ -347,12 +229,6 @@ export default {
},
methods: {
onSwitchUpdate(item) {
this.onStatus(item.id, event);
this.onStatusControl(this.currencies, item.id, event);
},
onClickDelete(item) {
this.confirmDelete(
`${

View File

@ -1,102 +1,65 @@
<template>
<div>
<h1 class="text-white">{{ translations.finish.title }}</h1>
<div class="card">
<div class="card-header wizard-header p-3">
<el-steps :active="active" finish-status="success" align-center>
<el-step :title="translations.company.title"></el-step>
<el-step :title="translations.currencies.title"></el-step>
<el-step :title="translations.taxes.title"></el-step>
<el-step :title="translations.finish.title"></el-step>
</el-steps>
</div>
<div class="card-body bg-default">
<div class="document-loading" v-if="pageLoad">
<div>
<i class="fas fa-spinner fa-pulse fa-7x"></i>
</div>
<div class="relative bg-body z-10 rounded-lg shadow-2xl py-10 ltr:pl-10 rtl:pr-10 overflow-hidden">
<div class="pr-10">
<WizardSteps :active_state="active"></WizardSteps>
</div>
<div class="row">
<div class="col-sm-12 col-md-12 col-lg-12 col-xl-12">
<div class="content-header">
<h3 class="text-white">
{{ translations.finish.recommended_apps }}
</h3>
<div class="flex flex-col justify-between" style="height:565px;">
<div v-if="pageLoad" class="absolute left-0 right-0 top-0 bottom-0 w-full h-full bg-white rounded-lg flex items-center justify-center z-50">
<span class="material-icons form-spin text-lg animate-spin text-9xl">data_usage</span>
</div>
<div class="row">
<div
v-for="(item, index) in modules"
:key="index"
class="col-md-3"
>
<div class="card">
<div class="card-header py-2">
<h4 class="ml--3 mb-0 float-left">
<a :href="route_url + '/apps/' + item.slug">{{ item.name }}</a>
</h4>
</div>
<a :href="route_url + '/apps/' + item.slug"
><img
v-for="(file, indis) in item.files"
:key="indis"
v-if="
file.media_type == 'image' &&
file.pivot.zone == 'thumbnail'
"
:src="file.path_string"
:alt="item.name"
class="card-img-top border-radius-none"
/></a>
<div class="card-footer py-2">
<div class="float-left ml--3 mt--1">
<i
v-for="(stars, indis) in item.vote"
:key="indis"
class="fa fa-star text-xs text-yellow"
></i>
<small class="text-xs"> {{ item.total_review }} </small>
<div class="flex mt-6">
<div class="w-full lg:w-1/2 ltr:pr-10 rtl:pl-10 mt-3">
<div class="grid sm:grid-cols-6">
<h1 class="sm:col-span-6 text-black-300 mb-2">
{{ translations.finish.recommended_apps }}
</h1>
<div v-for="(item, index) in modules" :key="index" class="sm:col-span-6 mb-6">
<a :href="route_url + '/apps/' + item.slug" class="flex items-center">
<div class="w-1/4">
<img v-for="(file, indis) in item.files" :key="indis" v-if="file.media_type == 'image' && file.pivot.zone == 'thumbnail'"
:src="file.path_string"
:alt="item.name"
class="rounded-lg object-cover"
/>
</div>
<div class="w-3/4 lg:ltr:pl-8 lg:rtl:pr-8">
<span class="font-medium">{{ item.name }}</span>
<div class="text-black-300 text-sm my-2" style="overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;"
v-html="item.description"></div>
</div>
</a>
</div>
</div>
<div class="float-right mr--3">
<small
><strong> {{ item.price }} </strong></small
>
</div>
</div>
</div>
</div>
<div class="relative w-1/2 right-0 ltr:pl-10 rtl:pr-10 mt-3 hidden: lg:flex lg:flex-col">
<div class="bg-purple rounded-tl-lg rounded-bl-lg p-6">
<div class="w-48 text-white rtl:float-left rtl:text-left text-2xl font-semibold leading-9">
{{ translations.finish.apps_managing }}
</div>
<div style="width:372px; height:372px;"></div>
<img :src="image_src" class="absolute top-0 right-2 top-12" alt="" />
</div>
<base-button class="flex items-center justify-center text-base rounded-lg disabled:opacity-50 relative m-auto bottom-40 bg-white hover:bg-gray-100 text-purple rounded-md py-3 px-5 font-semibold btn-default" @click="finish()">
{{ translations.finish.go_to_dashboard }}
</base-button>
</div>
</div>
<div class="col-md-12"><ul></ul></div>
</div>
</div>
</div>
<div class="card-footer">
<div class="row">
<div class="col-md-12 d-flex justify-content-between">
<base-button type="white" native-type="submit" @click="prev()">{{
translations.finish.previous
}}</base-button>
<base-button
type="success"
native-type="submit"
@click="finish()"
>{{ translations.finish.go_to_dashboard }}</base-button
>
</div>
</div>
</div>
</div>
</div>
</template>
<script>
import { Step, Steps } from "element-ui";
import WizardSteps from "./Steps.vue";
export default {
name: "Finish",
components: {
[Step.name]: Step,
[Steps.name]: Steps,
WizardSteps
},
props: {
@ -117,6 +80,7 @@ export default {
return {
active: 3,
route_url: url,
image_src: app_url + "/public/img/wizard-modules.png",
};
},
@ -131,7 +95,7 @@ export default {
this.$notify({
message: this.translations.finish.error_message,
timeout: 1000,
icon: "fas fa-bell",
icon: "",
type: 0
});
@ -151,4 +115,4 @@ export default {
},
},
};
</script>
</script>

View File

@ -0,0 +1,72 @@
<template>
<div>
<nav aria-label="Progress">
<ol role="list" class="flex mb-10">
<li class="w-1/4">
<span class="pr-6 flex flex-col">
<span
:class="[{'bg-purple': active_state > 0}, {'bg-purple': active_state == 0}]"
class="w-full h-1 bg-gray-300 rounded-xl text-transparent">Text</span>
<span :class="[{'font-bold': active_state == 0}, {'font-bold': active_state > 0}]" class="text-sm font-normal mt-2">{{ translations.company.title }}</span>
</span>
</li>
<li class="w-1/4">
<span class="px-3 flex flex-col">
<span
:class="[{'bg-purple': active_state > 1}, {'bg-purple': active_state == 1}]"
class="w-full h-1 bg-gray-300 rounded-xl text-transparent">Text</span>
<span :class="[{'font-bold': active_state == 1}, {'font-bold': active_state > 1}]" class="text-sm font-normal mt-2">{{ translations.currencies.title }}</span>
</span>
</li>
<li class="w-1/4">
<span class="px-3 flex flex-col">
<span
:class="[{'bg-purple': active_state > 2}, {'bg-purple': active_state == 2}]"
class="w-full h-1 bg-gray-300 rounded-xl text-transparent">Text</span>
<span :class="[{'font-bold': active_state == 2}, {'font-bold': active_state > 2}]" class="text-sm font-normal mt-2">{{ translations.taxes.title }}</span>
</span>
</li>
<li class="w-1/4">
<span class="pl-6 flex flex-col">
<span
:class="[{'bg-purple': active_state == 3}]"
class="w-full h-1 bg-gray-300 rounded-xl text-transparent">Text</span>
<span :class="[{'font-bold': active_state == 3}]" class="text-sm font-normal mt-2">{{ translations.finish.title }}</span>
</span>
</li>
</ol>
</nav>
</div>
</template>
<script>
export default {
name: "Steps",
components: {},
props: {
active_state: {
type: [Boolean, String, Number],
}
},
created() {
this.translations = wizard_translations;
},
data() {
return {
translations: {
company: {},
currencies: {},
taxes: {},
finish: {},
},
};
},
};
</script>

View File

@ -1,237 +1,165 @@
<template>
<div>
<h1 class="text-white">{{ translations.taxes.title }}</h1>
<div class="card">
<div class="card-header wizard-header p-3">
<el-steps :active="active" finish-status="success" align-center>
<el-step :title="translations.company.title"></el-step>
<el-step :title="translations.currencies.title"></el-step>
<el-step :title="translations.taxes.title"></el-step>
<el-step :title="translations.finish.title"></el-step>
</el-steps>
</div>
<div class="card-body">
<div class="document-loading" v-if="pageLoad">
<div>
<i class="fas fa-spinner fa-pulse fa-7x"></i>
</div>
</div>
<div class="d-flex justify-content-end mb-3">
<base-button
type="success"
native-type="button"
class="btn-sm"
@click="onAddItem()"
>{{ translations.taxes.add_new }}</base-button
>
</div>
<div class="row flex-column">
<form ref="form">
<table class="table table-flush table-hover" id="tbl-taxes">
<thead class="thead-light">
<tr class="row table-head-line">
<th class="col-xs-4 col-sm-4 col-md-3">
{{ translations.taxes.name }}
</th>
<th class="col-md-3 d-none d-md-block">
{{ translations.taxes.rate }}
</th>
<th class="col-xs-4 col-sm-4 col-md-3">
{{ translations.taxes.enabled }}
</th>
<th class="col-xs-4 col-sm-4 col-md-3 text-center">
{{ translations.taxes.actions }}
</th>
</tr>
</thead>
<tbody>
<tr
v-for="(item, index) in taxes"
:key="index"
class="row align-items-center border-top-1"
>
<td class="col-xs-4 col-sm-4 col-md-3 tax-name">
<a href="javascript:void(0);"> {{ item.name }} </a>
</td>
<td class="col-md-3 d-none d-md-block">{{ item.rate }}</td>
<td class="col-xs-4 col-sm-4 col-md-3">
<label class="custom-toggle d-inline-block" name="staus-1">
<input
type="checkbox"
:checked="item.enabled"
@input="onSwitchUpdate(item)"
/>
<span
class="custom-toggle-slider rounded-circle status-green"
:data-label-on="translations.taxes.yes"
:data-label-off="translations.taxes.no"
>
</span>
</label>
</td>
<td class="col-xs-4 col-sm-4 col-md-3 text-center">
<div class="dropdown">
<a
class="btn btn-neutral btn-sm text-light items-align-center py-2"
href="#"
role="button"
data-toggle="dropdown"
aria-haspopup="true"
aria-expanded="false"
>
<i class="fa fa-ellipsis-h text-muted"></i>
</a>
<div class="relative bg-body z-10 rounded-lg shadow-2xl p-10" style="height:675px;">
<WizardSteps :active_state="active"></WizardSteps>
<div
class="dropdown-menu dropdown-menu-right dropdown-menu-arrow"
>
<button
type="button"
class="dropdown-item"
@click="onEditItem(item, index)"
>
{{ translations.taxes.edit }}
<div class="flex flex-col justify-between overflow-y-auto" style="height: calc(100% - 53px)">
<div v-if="pageLoad" class="absolute left-0 right-0 top-0 bottom-0 w-full h-full bg-white rounded-lg flex items-center justify-center z-50">
<span class="material-icons form-spin animate-spin text-9xl">data_usage</span>
</div>
<div class="overflow-x-visible menu-scroll mt-1">
<form ref="form" class="py-2 align-middle inline-block min-w-full">
<table id="tbl-taxes" v-if="taxes.length" class="min-w-full divide-y divide-gray-200">
<thead class="thead-light">
<tr class="flex items-center px-1">
<th class="w-6/12 ltr:pr-6 rtl:pl-6 py-3 ltr:text-left rtl:text-right text-xs font-medium text-black tracking-wider">
{{ translations.taxes.name }}
</th>
<th class="w-6/12 ltr:pr-6 rtl:pl-6 py-3 ltr:text-right rtl:text-left text-xs font-medium text-black tracking-wider">
{{ translations.taxes.rate }}
</th>
</tr>
</thead>
<tbody data-table-body>
<tr v-for="(item, index) in taxes" :key="index" data-table-list class="relative flex items-center border-b hover:bg-gray-100 px-1 flex-wrap group">
<td :class="current_tab == index ? 'hidden' : ''" class="w-6/12 ltr:pr-6 rtl:pl-6 py-4 ltr:text-left rtl:text-right whitespace-nowrap text-sm font-medium text-black">
{{ item.name }}
</td>
<td :class="current_tab == index ? 'hidden' : ''" class="w-6/12 relative ltr:pr-6 rtl:pl-6 py-4 ltr:text-right rtl:text-left whitespace-nowrap text-sm font-medium text-black">
{{ item.rate }}
<div class="absolute ltr:right-12 rtl:left-12 -top-4 hidden items-center group-hover:flex">
<button type="button" class="relative bg-white hover:bg-gray-100 border py-0.5 px-1 cursor-pointer index-actions " @click="onEditItem(item, index)">
<span class="material-icons-outlined text-purple text-lg">edit</span>
<div class="inline-block absolute invisible z-20 py-1 px-2 text-sm font-medium text-gray-900 bg-white rounded-lg border border-gray-200 shadow-sm opacity-0 whitespace-nowrap tooltip-content -top-10 -left-2" data-tooltip-placement="top">
<span>{{ translations.taxes.edit }}</span>
<div class="absolute w-2 h-2 -bottom-1 before:content-[' '] before:absolute before:w-2 before:h-2 before:bg-white before:border-gray-200 before:transform before:rotate-45 before:border before:border-t-0 before:border-l-0" data-popper-arrow></div>
</div>
</button>
<button type="button" class="relative bg-white hover:bg-gray-100 border py-0.5 px-1 cursor-pointer index-actions " @click="onClickDelete(item)">
<span class="material-icons-outlined text-purple text-lg">delete</span>
<div class="inline-block absolute invisible z-20 py-1 px-2 text-sm font-medium text-gray-900 bg-white rounded-lg border border-gray-200 shadow-sm opacity-0 whitespace-nowrap tooltip-content -top-10 -left-2" data-tooltip-placement="top">
<span>{{ translations.taxes.delete }}</span>
<div class="absolute w-2 h-2 -bottom-1 before:content-[' '] before:absolute before:w-2 before:h-2 before:bg-white before:border-gray-200 before:transform before:rotate-45 before:border before:border-t-0 before:border-l-0" data-popper-arrow></div>
</div>
</button>
</div>
</td>
<td class="w-full p-0 current-tab" v-if="current_tab == index">
<div class="grid sm:grid-cols-6 gap-x-8 gap-y-6 py-3">
<base-input name="name" data-name="name" :placeholder="translations.taxes.name"
form-classes="sm:col-span-2"
class="required"
v-model="model.name"
:error="onFailErrorGet('name')"
/>
<div class="sm:col-span-2"></div>
<base-input name="rate" data-name="rate" :placeholder="translations.taxes.rate"
form-classes="sm:col-span-2"
class="required"
v-model="model.rate"
:error="onFailErrorGet('rate')"
/>
<div class="flex justify-end items-center sm:col-span-6">
<base-button class="flex items-center justify-center px-6 py-1.5 text-base rounded-lg bg-transparent hover:bg-gray-100 ltr:mr-2 rtl:ml-2" @click="onCancelItem()">
{{ translations.taxes.cancel }}
</base-button>
<base-button class="relative flex items-center justify-center bg-green hover:bg-green-700 text-white px-6 py-1.5 text-base rounded-lg disabled:bg-green-100" @click="onEditForm(item)">
{{ translations.taxes.save }}
</base-button>
</div>
</div>
</td>
</tr>
</tbody>
</table>
<div class="flex flex-col items-center">
<div v-if="!taxes.length" class="flex flex-col items-center gap-y-2">
<span class="text-dark">
{{ translations.taxes.no_taxes }}
</span>
<span class="text-gray-700">
{{ translations.taxes.create_task }}
</span>
</div>
<div v-if="taxes.length" class="w-full border-b hover:bg-gray-100" style="height:53px;">
<button type="button" class="w-full h-full flex items-center justify-center text-purple font-medium disabled:bg-gray-200" @click="onAddItem()">
<span class="material-icons-outlined text-base font-bold ltr:mr-1 rtl:ml-1">add</span>
{{ translations.taxes.new_tax }}
</button>
</div>
<button v-else type="button" class="relative flex items-center justify-center bg-green hover:bg-green-700 text-white px-6 py-1.5 text-base rounded-lg disabled:bg-green-100 mt-3" @click="onAddItem()">
{{ translations.taxes.new_tax }}
</button>
<div class="dropdown-divider"></div>
<button
type="button"
class="dropdown-item"
@click="onClickDelete(item)"
>
{{ translations.taxes.delete }}
</button>
</div>
</div>
</td>
<td class="w-100 p-0 current-tab" v-if="current_tab == index">
<div class="row pt-3 pb-3">
<div
class="form-container col-12 d-flex justify-content-between align-items-start"
>
<base-input
:label="translations.taxes.name"
name="name"
data-name="name"
:placeholder="translations.taxes.name"
prepend-icon="fas fa-font"
form-classes="col-md-4"
class="required"
v-model="model.name"
:error="onFailErrorGet('name')"
<div v-if="new_datas" class="grid sm:grid-cols-4 gap-x-8 gap-y-6 my-3.5 w-full">
<base-input :label="translations.taxes.name" name="name" data-name="name" :placeholder="translations.taxes.name"
class="sm:col-span-2 required"
v-model="model.name"
:error="onFailErrorGet('name')"
/>
<base-input
:label="translations.taxes.rate"
name="rate"
data-name="rate"
:placeholder="translations.taxes.rate"
prepend-icon="fas fa-percentage"
form-classes="col-md-4"
class="required"
v-model="model.rate"
:error="onFailErrorGet('rate')"
<base-input :label="translations.taxes.rate" name="rate" data-name="rate"
:placeholder="translations.taxes.rate"
class="sm:col-span-2 required"
v-model="model.rate"
:error="onFailErrorGet('rate')"
/>
<div class="mt-4 col-md-4 current-tab-btn">
<base-button
type="white"
native-type="button"
@click="onCancelItem()"
>
{{ translations.taxes.cancel }}</base-button
>
<base-button
type="success"
native-type="button"
@click="onEditForm(item)"
>{{ translations.taxes.save }}</base-button
>
<div class="flex items-center justify-end sm:col-span-4">
<base-button class="flex items-center justify-center px-6 py-1.5 text-base rounded-lg bg-transparent hover:bg-gray-100 ltr:mr-2 rtl:ml-2" @click="new_datas = false">
{{ translations.taxes.cancel }}
</base-button>
<base-button :disabled="button_loading" class="relative flex items-center justify-center bg-green hover:bg-green-700 text-white px-6 py-1.5 text-base rounded-lg disabled:bg-green-100" @click="onSubmitForm()">
<i v-if="button_loading" class="submit-spin absolute w-2 h-2 rounded-full left-0 right-0 -top-3.5 m-auto"></i>
<span :class="[{'opacity-0': button_loading}]">
{{ translations.taxes.save }}
</span>
</base-button>
</div>
</div>
</div>
</td>
</tr>
<tr v-if="new_datas">
<td class="p-0">
<div class="row pt-3 pb-3">
<div
class="form-container col-12 d-flex justify-content-between align-items-start"
>
<base-input
:label="translations.taxes.name"
name="name"
data-name="name"
:placeholder="translations.taxes.name"
prepend-icon="fas fa-font"
class="required"
v-model="model.name"
:error="onFailErrorGet('name')"
/>
<base-input
:label="translations.taxes.rate"
name="rate"
data-name="rate"
:placeholder="translations.taxes.rate"
prepend-icon="fas fa-percentage"
class="required"
v-model="model.rate"
:error="onFailErrorGet('rate')"
/>
<div>
<div class="d-flex">
<akaunting-radio-group
name="enabled"
:text="translations.taxes.enabled"
:enable="translations.taxes.yes"
:disable="translations.taxes.no"
:value="model.enabled"
>
</akaunting-radio-group>
</div>
</div>
<div class="mt-4">
<base-button
type="success"
native-type="button"
@click="onSubmitForm()"
>{{ translations.taxes.save }}</base-button
>
</div>
</div>
</div>
</td>
</tr>
</tbody>
</table>
</form>
</form>
</div>
<div class="flex items-center justify-center mt-5 gap-x-10">
<base-button class="w-1/2 flex items-center justify-center px-6 py-1.5 text-base rounded-lg bg-transparent hover:bg-gray-100" @click="prev()">
{{ translations.taxes.previous }}
</base-button>
<base-button class="w-1/2 relative flex items-center justify-center bg-green hover:bg-green-700 text-white px-6 py-1.5 text-base rounded-lg disabled:bg-green-100" @click="next()">
{{ translations.taxes.next }}
</base-button>
</div>
</div>
<notifications></notifications>
<form id="form-dynamic-component" method="POST" action="#"></form>
<component
v-bind:is="component"
@deleted="onDeleteCurrency($event)"
></component>
</div>
<div class="card-footer">
<div class="row">
<div class="col-md-12 d-flex justify-content-between">
<base-button type="white" native-type="submit" @click="prev()">{{
translations.taxes.previous
}}</base-button>
<base-button type="white" native-type="submit" @click="next()">{{
translations.taxes.next
}}</base-button>
</div>
</div>
</div>
<component v-bind:is="component" @deleted="onDeleteCurrency($event)"></component>
</div>
</div>
</template>
<script>
import { Step, Steps } from "element-ui";
import AkauntingRadioGroup from "./../../components/forms/AkauntingRadioGroup";
import AkauntingRadioGroup from "./../../components/AkauntingRadioGroup";
import BulkAction from "./../../plugins/bulk-action";
import MixinsGlobal from "./../../mixins/global";
import WizardAction from "./../../mixins/wizardAction";
import WizardSteps from "./Steps.vue";
export default {
name: "Taxes",
@ -239,9 +167,8 @@ export default {
mixins: [MixinsGlobal, WizardAction],
components: {
[Step.name]: Step,
[Steps.name]: Steps,
AkauntingRadioGroup,
WizardSteps
},
props: {
@ -262,16 +189,12 @@ export default {
return {
active: 2,
bulk_action: new BulkAction(url + "/settings/taxes"),
add_taxes: true,
new_add_taxes: false
};
},
methods: {
onSwitchUpdate(item) {
this.onStatus(item.id, event);
this.onStatusControl(this.taxes, item.id, event);
},
onClickDelete(item) {
this.confirmDelete(
`${
@ -307,8 +230,19 @@ export default {
);
},
onNewTax() {
this.new_add_taxes = true;
this.add_taxes = false;
},
onCancelNewTax() {
this.new_add_taxes = false;
this.add_taxes = true;
},
onSubmitForm() {
this.onSubmitEvent("POST", url + "/wizard/taxes", "type", this.taxes);
},
prev() {
@ -323,9 +257,3 @@ export default {
},
};
</script>
<style scoped>
.current-tab-btn {
padding: 0 80px;
}
</style>