Merge branch 'master' into master

This commit is contained in:
Denis Duliçi
2018-12-24 10:17:40 +03:00
committed by GitHub
176 changed files with 890 additions and 621 deletions

View File

@@ -60,18 +60,24 @@ trait Currencies
return $money;
}
public function getConvertedAmount($format = false)
public function getConvertedAmount($format = false, $with_tax = true)
{
return $this->convert($this->amount, $this->currency_code, $this->currency_rate, $format);
$amount = $with_tax ? $this->amount : (isset($this->amount_without_tax) ? $this->amount_without_tax : $this->amount);
return $this->convert($amount, $this->currency_code, $this->currency_rate, $format);
}
public function getReverseConvertedAmount($format = false)
public function getReverseConvertedAmount($format = false, $with_tax = true)
{
return $this->reverseConvert($this->amount, $this->currency_code, $this->currency_rate, $format);
$amount = $with_tax ? $this->amount : (isset($this->amount_without_tax) ? $this->amount_without_tax : $this->amount);
return $this->reverseConvert($amount, $this->currency_code, $this->currency_rate, $format);
}
public function getDynamicConvertedAmount($format = false)
public function getDynamicConvertedAmount($format = false, $with_tax = true)
{
return $this->dynamicConvert($this->default_currency_code, $this->amount, $this->currency_code, $this->currency_rate, $format);
$amount = $with_tax ? $this->amount : (isset($this->amount_without_tax) ? $this->amount_without_tax : $this->amount);
return $this->dynamicConvert($this->default_currency_code, $amount, $this->currency_code, $this->currency_rate, $format);
}
}

View File

@@ -3,15 +3,15 @@
namespace App\Traits;
use App\Utilities\Info;
use App\Models\Module\Module as Model;
use Artisan;
use Cache;
use Date;
use File;
use GuzzleHttp\Client;
use GuzzleHttp\Exception\RequestException;
use Module;
use App\Models\Module\Module as MModule;
use ZipArchive;
use Cache;
use Date;
trait Modules
{
@@ -148,7 +148,7 @@ trait Modules
$installed = [];
$modules = Module::all();
$installed_modules = MModule::where('company_id', '=', session('company_id'))->pluck('status', 'alias')->toArray();
$installed_modules = Model::where('company_id', '=', session('company_id'))->pluck('status', 'alias')->toArray();
foreach ($modules as $module) {
if (!array_key_exists($module->alias, $installed_modules)) {
@@ -528,6 +528,7 @@ trait Modules
'Accept' => 'application/json',
'Referer' => env('APP_URL'),
'Akaunting' => version('short'),
'Language' => language()->getShortCode()
];
$data['http_errors'] = false;

View File

@@ -18,7 +18,8 @@ trait SiteApi
'Authorization' => 'Bearer ' . setting('general.api_token'),
'Accept' => 'application/json',
'Referer' => env('APP_URL'),
'Akaunting' => version('short')
'Akaunting' => version('short'),
'Language' => language()->getShortCode()
);
$data['http_errors'] = false;