Packed Everything In One Package
This commit is contained in:
parent
24c3317f56
commit
8d00142e14
|
|
@ -385,51 +385,6 @@ 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',
|
||||
|
|
|
|||
|
|
@ -0,0 +1,50 @@
|
|||
<?php
|
||||
|
||||
return [
|
||||
[
|
||||
'key' => 'taxes',
|
||||
'name' => 'tax::app.admin.system.taxes.taxes',
|
||||
'sort' => 6,
|
||||
], [
|
||||
'key' => 'taxes.catalogue',
|
||||
'name' => 'tax::app.admin.system.taxes.catalogue',
|
||||
'sort' => 1,
|
||||
], [
|
||||
'key' => 'taxes.catalogue.pricing',
|
||||
'name' => 'tax::app.admin.system.taxes.pricing',
|
||||
'sort' => 1,
|
||||
'fields' => [
|
||||
[
|
||||
'name' => 'tax_inclusive',
|
||||
'title' => 'tax::app.admin.system.taxes.tax-inclusive',
|
||||
'type' => 'boolean',
|
||||
'validation' => 'required',
|
||||
'default' => false
|
||||
]
|
||||
],
|
||||
], [
|
||||
'key' => 'taxes.catalogue.default-location-calculation',
|
||||
'name' => 'tax::app.admin.system.taxes.default-location-calculation',
|
||||
'sort' => 1,
|
||||
'fields' => [
|
||||
[
|
||||
'name' => 'country',
|
||||
'title' => 'tax::app.admin.system.taxes.default-country',
|
||||
'type' => 'country',
|
||||
'default' => '',
|
||||
],
|
||||
[
|
||||
'name' => 'state',
|
||||
'title' => 'tax::app.admin.system.taxes.default-state',
|
||||
'type' => 'state',
|
||||
'default' => '',
|
||||
],
|
||||
[
|
||||
'name' => 'post_code',
|
||||
'title' => 'tax::app.admin.system.taxes.default-post-code',
|
||||
'type' => 'text',
|
||||
'default' => '',
|
||||
]
|
||||
],
|
||||
]
|
||||
];
|
||||
|
|
@ -5,17 +5,24 @@ namespace Webkul\Tax\Helpers;
|
|||
class Tax
|
||||
{
|
||||
/**
|
||||
* Tax rate precission.
|
||||
*
|
||||
* @var int
|
||||
*/
|
||||
private const TAX_RATE_PRECISION = 4;
|
||||
|
||||
/**
|
||||
* Tax amount precision.
|
||||
*
|
||||
* @var int
|
||||
*/
|
||||
private const TAX_AMOUNT_PRECISION = 2;
|
||||
|
||||
/**
|
||||
* Returns an array with tax rates and tax amount
|
||||
*
|
||||
* @param object $that
|
||||
* @param bool $asBase
|
||||
* Returns an array with tax rates and tax amount.
|
||||
*
|
||||
* @param object $that
|
||||
* @param bool $asBase
|
||||
* @return array
|
||||
*/
|
||||
public static function getTaxRatesWithAmount(object $that, bool $asBase = false): array
|
||||
|
|
@ -41,7 +48,7 @@ class Tax
|
|||
}
|
||||
|
||||
/**
|
||||
* Returns the total tax amount
|
||||
* Returns the total tax amount.
|
||||
*
|
||||
* @param object $that
|
||||
* @param bool $asBase
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
<?php
|
||||
|
||||
namespace Webkul\Tax\Providers;
|
||||
|
||||
use Illuminate\Support\ServiceProvider;
|
||||
|
|
@ -13,6 +14,8 @@ class TaxServiceProvider extends ServiceProvider
|
|||
public function boot()
|
||||
{
|
||||
$this->loadMigrationsFrom(__DIR__ . '/../Database/Migrations');
|
||||
$this->loadFactoriesFrom(__DIR__ . '/../Database/Factories');
|
||||
$this->loadTranslationsFrom(__DIR__ . '/../Resources/lang', 'tax');
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -22,6 +25,8 @@ class TaxServiceProvider extends ServiceProvider
|
|||
*/
|
||||
public function register()
|
||||
{
|
||||
$this->loadFactoriesFrom(__DIR__ . '/../Database/Factories');
|
||||
$this->mergeConfigFrom(
|
||||
dirname(__DIR__) . '/Config/system.php', 'core'
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,18 @@
|
|||
<?php
|
||||
|
||||
return [
|
||||
'admin' => [
|
||||
'system' => [
|
||||
'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',
|
||||
],
|
||||
]
|
||||
]
|
||||
];
|
||||
|
|
@ -0,0 +1,18 @@
|
|||
<?php
|
||||
|
||||
return [
|
||||
'admin' => [
|
||||
'system' => [
|
||||
'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',
|
||||
],
|
||||
]
|
||||
]
|
||||
];
|
||||
|
|
@ -0,0 +1,18 @@
|
|||
<?php
|
||||
|
||||
return [
|
||||
'admin' => [
|
||||
'system' => [
|
||||
'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',
|
||||
],
|
||||
]
|
||||
]
|
||||
];
|
||||
|
|
@ -0,0 +1,18 @@
|
|||
<?php
|
||||
|
||||
return [
|
||||
'admin' => [
|
||||
'system' => [
|
||||
'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',
|
||||
],
|
||||
]
|
||||
]
|
||||
];
|
||||
|
|
@ -0,0 +1,18 @@
|
|||
<?php
|
||||
|
||||
return [
|
||||
'admin' => [
|
||||
'system' => [
|
||||
'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',
|
||||
],
|
||||
]
|
||||
]
|
||||
];
|
||||
|
|
@ -0,0 +1,18 @@
|
|||
<?php
|
||||
|
||||
return [
|
||||
'admin' => [
|
||||
'system' => [
|
||||
'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',
|
||||
],
|
||||
]
|
||||
]
|
||||
];
|
||||
|
|
@ -0,0 +1,18 @@
|
|||
<?php
|
||||
|
||||
return [
|
||||
'admin' => [
|
||||
'system' => [
|
||||
'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',
|
||||
],
|
||||
]
|
||||
]
|
||||
];
|
||||
|
|
@ -0,0 +1,18 @@
|
|||
<?php
|
||||
|
||||
return [
|
||||
'admin' => [
|
||||
'system' => [
|
||||
'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',
|
||||
],
|
||||
]
|
||||
]
|
||||
];
|
||||
|
|
@ -0,0 +1,18 @@
|
|||
<?php
|
||||
|
||||
return [
|
||||
'admin' => [
|
||||
'system' => [
|
||||
'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',
|
||||
],
|
||||
]
|
||||
]
|
||||
];
|
||||
|
|
@ -0,0 +1,18 @@
|
|||
<?php
|
||||
|
||||
return [
|
||||
'admin' => [
|
||||
'system' => [
|
||||
'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',
|
||||
],
|
||||
]
|
||||
]
|
||||
];
|
||||
|
|
@ -1,6 +0,0 @@
|
|||
<?php
|
||||
|
||||
return [
|
||||
'name' => 'Webkul Bagisto Tax',
|
||||
'version' => '0.0.1'
|
||||
];
|
||||
Loading…
Reference in New Issue