mirror of
https://github.com/FOSSBilling/FOSSBilling.git
synced 2026-11-22 13:02:39 +09:00
canChangeCurrency() method updated
This commit is contained in:
1 parent
405f55f264
commit
b346795d3a
1 file changed
+4
-4
@@ -221,13 +221,13 @@ class Service implements InjectionAwareInterface
|
||||
return false;
|
||||
}
|
||||
|
||||
$invoice = $this->di['db']->load('Invoice', 'client_id = ?', $model->client_id);
|
||||
if($invoice) {
|
||||
$invoice = $this->di['db']->findOne('Invoice', 'client_id = ?', $model->id);
|
||||
if($invoice instanceof \Model_Invoice) {
|
||||
throw new \Box_Exception('Currency can not be changed. Client already have invoices issued.');
|
||||
}
|
||||
|
||||
$order = $this->di['db']->load('ClientOrder', 'client_id = ?', $model->client_id);
|
||||
if($order) {
|
||||
$order = $this->di['db']->findOne('ClientOrder', 'client_id = ?', $model->id);
|
||||
if ($order instanceof \Model_ClientOrder) {
|
||||
throw new \Box_Exception('Currency can not be changed. Client already have orders.');
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user