Taxes Configuration Adjusted

This commit is contained in:
devansh bawari 2021-05-06 12:38:33 +05:30
parent 48ced3f866
commit 24c3317f56
18 changed files with 185 additions and 40 deletions

View File

@ -266,11 +266,6 @@ return [
'name' => 'file_attribute_upload_size',
'title' => 'admin::app.admin.system.file-upload-size',
'type' => 'text',
], [
'name' => 'price_attribute_tax_inclusive',
'title' => 'admin::app.admin.system.tax-inclusive',
'type' => 'boolean',
'default' => false
]
],
], [
@ -390,10 +385,55 @@ return [
'type' => 'boolean',
],
],
], [
'key' => 'taxes',
'name' => 'admin::app.admin.system.taxes.taxes',
'sort' => 5,
], [
'key' => 'taxes.catalogue',
'name' => 'admin::app.admin.system.taxes.catalogue',
'sort' => 1,
], [
'key' => 'taxes.catalogue.pricing',
'name' => 'admin::app.admin.system.taxes.pricing',
'sort' => 1,
'fields' => [
[
'name' => 'tax_inclusive',
'title' => 'admin::app.admin.system.taxes.tax-inclusive',
'type' => 'boolean',
'validation' => 'required',
'default' => false
]
],
], [
'key' => 'taxes.catalogue.default-location-calculation',
'name' => 'admin::app.admin.system.taxes.default-location-calculation',
'sort' => 1,
'fields' => [
[
'name' => 'country',
'title' => 'admin::app.admin.system.taxes.default-country',
'type' => 'country',
'default' => '',
],
[
'name' => 'state',
'title' => 'admin::app.admin.system.taxes.default-state',
'type' => 'state',
'default' => '',
],
[
'name' => 'post_code',
'title' => 'admin::app.admin.system.taxes.default-post-code',
'type' => 'text',
'default' => '',
]
],
], [
'key' => 'emails',
'name' => 'admin::app.admin.emails.email',
'sort' => 5,
'sort' => 6,
], [
'key' => 'emails.configure',
'name' => 'admin::app.admin.system.email-settings',

View File

@ -371,7 +371,7 @@ return [
'item-status' => 'حالة البند',
'item-ordered' => '(:qty_ordered) سفارش ',
'item-invoice' => '(:qty_invoiced) صورتحساب',
'item-shipped' =>'(:qty_shipped) شحنت',
'item-shipped' => '(:qty_shipped) شحنت',
'item-canceled' => '(:qty_canceled)ملغاة',
'item-refunded' => '(:qty_refunded) بازپرداخت',
'price' => 'السعر',
@ -926,7 +926,7 @@ return [
],
'customers' => [
'groups' =>[
'groups' => [
'add-title' => 'أضف المجموعة',
'edit-title' => 'حرر المجموعة',
'save-btn-title' => 'احفظ المجموعة',
@ -1495,7 +1495,17 @@ return [
'cache-small-image' => 'Small Image',
'cache-medium-image' => 'Medium Image',
'cache-large-image' => 'Large Image',
'tax-inclusive' => 'Tax inclusive',
'taxes' => [
'taxes' => 'Taxes',
'catalogue' => 'Catalogue',
'pricing' => 'Pricing',
'tax-inclusive' => 'Tax inclusive',
'default-location-calculation' => 'Default Location Calculation',
'default-country' => 'Default Country',
'default-state' => 'Default State',
'default-post-code' => 'Default Post Code',
],
]
]
];

View File

@ -1471,7 +1471,17 @@ return [
'cache-small-image' => 'Small Image',
'cache-medium-image' => 'Medium Image',
'cache-large-image' => 'Large Image',
'tax-inclusive' => 'Tax inclusive',
'taxes' => [
'taxes' => 'Taxes',
'catalogue' => 'Catalogue',
'pricing' => 'Pricing',
'tax-inclusive' => 'Tax inclusive',
'default-location-calculation' => 'Default Location Calculation',
'default-country' => 'Default Country',
'default-state' => 'Default State',
'default-post-code' => 'Default Post Code',
],
],
],
];

View File

@ -1385,7 +1385,6 @@ return [
'attribute' => 'Attribute',
'image-upload-size' => 'Allowed Image Upload Size (in Kb)',
'file-upload-size' => 'Allowed File Upload Size (in Kb)',
'tax-inclusive' => 'Tax inclusive',
'review' => 'Review',
'allow-guest-review' => 'Allow Guest Review',
'inventory' => 'Inventory',
@ -1510,6 +1509,17 @@ return [
'cache-small-image' => 'Small Image',
'cache-medium-image' => 'Medium Image',
'cache-large-image' => 'Large Image',
'taxes' => [
'taxes' => 'Taxes',
'catalogue' => 'Catalogue',
'pricing' => 'Pricing',
'tax-inclusive' => 'Tax inclusive',
'default-location-calculation' => 'Default Location Calculation',
'default-country' => 'Default Country',
'default-state' => 'Default State',
'default-post-code' => 'Default Post Code',
],
]
]
];

View File

@ -934,7 +934,7 @@ return [
],
'customers' => [
'groups' =>[
'groups' => [
'add-title' => 'Agregar grupo',
'edit-title' => 'Editar grupo',
'save-btn-title' => 'Guardar grupo',
@ -1502,7 +1502,17 @@ return [
'cache-small-image' => 'Small Image',
'cache-medium-image' => 'Medium Image',
'cache-large-image' => 'Large Image',
'tax-inclusive' => 'Tax inclusive',
]
'taxes' => [
'taxes' => 'Taxes',
'catalogue' => 'Catalogue',
'pricing' => 'Pricing',
'tax-inclusive' => 'Tax inclusive',
'default-location-calculation' => 'Default Location Calculation',
'default-country' => 'Default Country',
'default-state' => 'Default State',
'default-post-code' => 'Default Post Code',
],
]
]
];

View File

@ -924,7 +924,7 @@ return [
],
'customers' => [
'groups' =>[
'groups' => [
'add-title' => 'افزودن گروه',
'edit-title' => 'ویرایش گروه',
'save-btn-title' => 'ذخیره گروه',
@ -1075,7 +1075,7 @@ return [
'qty-in-cart' => 'کمیت در سبد خرید',
'product-attribute' => 'ویژگی محصول',
'attribute-name-children-only' => '(فقط کودکان) :attribute_name',
'attribute-name-parent-only' => '(فقط والدین) :attribute_name' ,
'attribute-name-parent-only' => '(فقط والدین) :attribute_name',
'is-equal-to' => 'برابر است با',
'is-not-equal-to' => 'مساوی نیست',
'equals-or-greater-than' => 'برابر یا بیشتر از',
@ -1320,7 +1320,7 @@ return [
'delete-failed' => 'هنگام حذف :name خطایی روی داد.',
'last-delete-error' => 'حداقل یک :name لازم است.',
'user-define-error' => 'نمی توان :name سیستم را حذف کرد.',
'attribute-error' => 'در محصولات قابل تنظیم استفاده می شود :name ' ,
'attribute-error' => 'در محصولات قابل تنظیم استفاده می شود :name ',
'attribute-product-error' => ' در محصولات استفاده می شود :name',
'customer-associate' => ' نمی توان حذف کرد زیرا مشتری با این گروه در ارتباط است :name',
'currency-delete-error' => 'این ارز به عنوان ارز پایه کانال تنظیم شده است بنابراین نمی توان آن را حذف کرد.',
@ -1489,7 +1489,17 @@ return [
'cache-small-image' => 'Small Image',
'cache-medium-image' => 'Medium Image',
'cache-large-image' => 'Large Image',
'tax-inclusive' => 'Tax inclusive',
'taxes' => [
'taxes' => 'Taxes',
'catalogue' => 'Catalogue',
'pricing' => 'Pricing',
'tax-inclusive' => 'Tax inclusive',
'default-location-calculation' => 'Default Location Calculation',
'default-country' => 'Default Country',
'default-state' => 'Default State',
'default-post-code' => 'Default Post Code',
],
]
]
];

View File

@ -642,8 +642,8 @@ return [
'add-attribute-title' => 'Aggiungi Attributi',
'search' => 'Cerca',
'group-exist-error' => 'Un gruppo con lo stesso nome esiste già.',
'actions' => 'Azioni',
'description' => 'Descrizione'
'actions' => 'Azioni',
'description' => 'Descrizione'
],
'categories' => [
'title' => 'Categorie',
@ -928,7 +928,7 @@ return [
],
'customers' => [
'groups' =>[
'groups' => [
'add-title' => 'Aggiungi Gruppo',
'edit-title' => 'Modifica Gruppo',
'save-btn-title' => 'Salva Gruppo',
@ -1492,7 +1492,17 @@ return [
'cache-small-image' => 'Small Image',
'cache-medium-image' => 'Medium Image',
'cache-large-image' => 'Large Image',
'tax-inclusive' => 'Tax inclusive',
'taxes' => [
'taxes' => 'Taxes',
'catalogue' => 'Catalogue',
'pricing' => 'Pricing',
'tax-inclusive' => 'Tax inclusive',
'default-location-calculation' => 'Default Location Calculation',
'default-country' => 'Default Country',
'default-state' => 'Default State',
'default-post-code' => 'Default Post Code',
],
]
]
];

View File

@ -923,7 +923,7 @@ return [
],
'customers' => [
'groups' =>[
'groups' => [
'add-title' => 'Groep toevoegen',
'edit-title' => 'Groep wijzigen',
'save-btn-title' => 'Groep opslaan',
@ -1486,6 +1486,17 @@ return [
'cache-medium-image' => 'Medium Image',
'cache-large-image' => 'Large Image',
'tax-inclusive' => 'Tax inclusive',
'taxes' => [
'taxes' => 'Taxes',
'catalogue' => 'Catalogue',
'pricing' => 'Pricing',
'tax-inclusive' => 'Tax inclusive',
'default-location-calculation' => 'Default Location Calculation',
'default-country' => 'Default Country',
'default-state' => 'Default State',
'default-post-code' => 'Default Post Code',
],
]
]
];

View File

@ -926,7 +926,7 @@ return [
],
'customers' => [
'groups' =>[
'groups' => [
'add-title' => 'Dodaj grupę',
'edit-title' => 'Edytuj grupę',
'save-btn-title' => 'Zapisz grupę',
@ -1476,7 +1476,17 @@ return [
'cache-small-image' => 'Small Image',
'cache-medium-image' => 'Medium Image',
'cache-large-image' => 'Large Image',
'tax-inclusive' => 'Tax inclusive',
]
'taxes' => [
'taxes' => 'Taxes',
'catalogue' => 'Catalogue',
'pricing' => 'Pricing',
'tax-inclusive' => 'Tax inclusive',
'default-location-calculation' => 'Default Location Calculation',
'default-country' => 'Default Country',
'default-state' => 'Default State',
'default-post-code' => 'Default Post Code',
],
]
]
];

View File

@ -1490,7 +1490,17 @@ return [
'cache-small-image' => 'Small Image',
'cache-medium-image' => 'Medium Image',
'cache-large-image' => 'Large Image',
'tax-inclusive' => 'Tax inclusive',
'taxes' => [
'taxes' => 'Taxes',
'catalogue' => 'Catalogue',
'pricing' => 'Pricing',
'tax-inclusive' => 'Tax inclusive',
'default-location-calculation' => 'Default Location Calculation',
'default-country' => 'Default Country',
'default-state' => 'Default State',
'default-post-code' => 'Default Post Code',
],
]
]
];

View File

@ -916,7 +916,7 @@ return [
],
'customers' => [
'groups' =>[
'groups' => [
'add-title' => 'Grup Ekle',
'edit-title' => 'Grup Düzenle',
'save-btn-title' => 'Grup Kaydet',
@ -1473,7 +1473,17 @@ return [
'cache-small-image' => 'Small Image',
'cache-medium-image' => 'Medium Image',
'cache-large-image' => 'Large Image',
'tax-inclusive' => 'Tax inclusive',
'taxes' => [
'taxes' => 'Taxes',
'catalogue' => 'Catalogue',
'pricing' => 'Pricing',
'tax-inclusive' => 'Tax inclusive',
'default-location-calculation' => 'Default Location Calculation',
'default-country' => 'Default Country',
'default-state' => 'Default State',
'default-post-code' => 'Default Post Code',
],
]
]
];

View File

@ -362,9 +362,9 @@
<script type="text/x-template" id="state-template">
<div>
<input type="text" v-validate="'required'" v-if="!haveStates()" class="control" v-model="state" :id="name" :name="name" data-vv-as="&quot;{{ __('admin::app.customers.customers.state') }}&quot;"/>
<input type="text" v-validate="validations" v-if="!haveStates()" class="control" v-model="state" :id="name" :name="name" data-vv-as="&quot;{{ __('admin::app.customers.customers.state') }}&quot;"/>
<select v-validate="'required'" v-if="haveStates()" class="control" v-model="state" :id="name" :name="name" data-vv-as="&quot;{{ __('admin::app.customers.customers.state') }}&quot;" >
<select v-validate="validations" v-if="haveStates()" class="control" v-model="state" :id="name" :name="name" data-vv-as="&quot;{{ __('admin::app.customers.customers.state') }}&quot;" >
<option value="">{{ __('admin::app.customers.customers.select-state') }}</option>

View File

@ -672,7 +672,9 @@ class Cart
function __construct()
{
$this->country = strtoupper(config('app.default_country'));
$this->country = core()->getConfigData('taxes.catalogue.default-location-calculation.country') != '' ? core()->getConfigData('taxes.catalogue.default-location-calculation.country') : strtoupper(config('app.default_country'));
$this->state = core()->getConfigData('taxes.catalogue.default-location-calculation.state');
$this->postcode = core()->getConfigData('taxes.catalogue.default-location-calculation.post_code');
}
};
}

View File

@ -761,7 +761,7 @@ abstract class AbstractType
*/
public function isTaxInclusive(): bool
{
return (bool) core()->getConfigData('catalog.products.attribute.price_attribute_tax_inclusive');
return (bool) core()->getConfigData('taxes.catalogue.pricing.tax_inclusive');
}
/**
@ -791,7 +791,9 @@ abstract class AbstractType
function __construct()
{
$this->country = strtoupper(config('app.default_country'));
$this->country = core()->getConfigData('taxes.catalogue.default-location-calculation.country') != '' ? core()->getConfigData('taxes.catalogue.default-location-calculation.country') : strtoupper(config('app.default_country'));
$this->state = core()->getConfigData('taxes.catalogue.default-location-calculation.state');
$this->postcode = core()->getConfigData('taxes.catalogue.default-location-calculation.post_code');
}
};
}

View File

@ -25,7 +25,7 @@
{!! view_render_event('bagisto.shop.checkout.cart-mini.subtotal.before', ['cart' => $cart]) !!}
@if ((bool) core()->getConfigData('catalog.products.attribute.price_attribute_tax_inclusive'))
@if ((bool) core()->getConfigData('taxes.catalogue.pricing.tax_inclusive'))
<b>{{ core()->currency($cart->base_grand_total) }}</b>
@else
<b>{{ core()->currency($cart->base_sub_total) }}</b>
@ -72,7 +72,7 @@
{!! view_render_event('bagisto.shop.checkout.cart-mini.item.price.before', ['item' => $item]) !!}
<div class="item-price">
@if ((bool) core()->getConfigData('catalog.products.attribute.price_attribute_tax_inclusive'))
@if ((bool) core()->getConfigData('taxes.catalogue.pricing.tax_inclusive'))
<b>{{ core()->currency($item->base_total + $item->tax_amount) }}</b>
@else
<b>{{ core()->currency($item->base_total) }}</b>

View File

@ -63,7 +63,7 @@
@include ('shop::products.price', ['product' => $product])
@if ((bool) core()->getConfigData('catalog.products.attribute.price_attribute_tax_inclusive'))
@if ((bool) core()->getConfigData('taxes.catalogue.pricing.tax_inclusive'))
<div>
{{ __('shop::app.products.tax-inclusive') }}
</div>

View File

@ -1,6 +1,6 @@
<div class="mini-cart-container">
<mini-cart
is-tax-inclusive="{{ (bool) core()->getConfigData('catalog.products.attribute.price_attribute_tax_inclusive') }}"
is-tax-inclusive="{{ (bool) core()->getConfigData('taxes.catalogue.pricing.tax_inclusive') }}"
view-cart="{{ route('shop.checkout.cart.index') }}"
cart-text="{{ __('shop::app.minicart.view-cart') }}"
checkout-text="{{ __('shop::app.minicart.checkout') }}"

View File

@ -126,7 +126,7 @@
<div class="col-12 price">
@include ('shop::products.price', ['product' => $product])
@if ((bool) core()->getConfigData('catalog.products.attribute.price_attribute_tax_inclusive'))
@if ((bool) core()->getConfigData('taxes.catalogue.pricing.tax_inclusive'))
<span>
{{ __('velocity::app.products.tax-inclusive') }}
</span>