monitor default currency
This commit is contained in:
parent
5114f560a3
commit
28c44c03f6
@ -56,6 +56,12 @@ class DeleteCurrency extends Job
|
|||||||
'transactions' => 'transactions',
|
'transactions' => 'transactions',
|
||||||
];
|
];
|
||||||
|
|
||||||
return $this->countRelationships($this->currency, $rels);
|
$relationships = $this->countRelationships($this->currency, $rels);
|
||||||
|
|
||||||
|
if ($this->currency->code == setting('default.currency')) {
|
||||||
|
$relationships[] = strtolower(trans_choice('general.companies', 1));
|
||||||
|
}
|
||||||
|
|
||||||
|
return $relationships;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -32,8 +32,19 @@ class UpdateCurrency extends Job
|
|||||||
{
|
{
|
||||||
$this->authorize();
|
$this->authorize();
|
||||||
|
|
||||||
|
// Force the rate to be 1 for default currency
|
||||||
|
if ($this->request->get('default_currency')) {
|
||||||
|
$this->request['rate'] = '1';
|
||||||
|
}
|
||||||
|
|
||||||
$this->currency->update($this->request->all());
|
$this->currency->update($this->request->all());
|
||||||
|
|
||||||
|
// Update default currency setting
|
||||||
|
if ($this->request->get('default_currency')) {
|
||||||
|
setting()->set('default.currency', $this->request->get('code'));
|
||||||
|
setting()->save();
|
||||||
|
}
|
||||||
|
|
||||||
return $this->currency;
|
return $this->currency;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user