|
@@ -760,8 +760,11 @@ class Services extends ApiServices
|
|
|
if ($apiValidationBase->validTenancy($instance->getTenancyId())) {
|
|
|
if (!is_null($instance->getClientId()) && $instance->getClientId() > 0) {
|
|
|
// chequeo el cliente exista
|
|
|
- if (!$apiValidationBase->validClient($instance->getClientId())) {
|
|
|
+ $clientFound = $apiValidationBase->validClient($instance->getClientId());
|
|
|
+ if (!$clientFound) {
|
|
|
$content = "El id del cliente no existe.";
|
|
|
+ }else if($clientFound->getCurrentState() == "cancelled" || $clientFound->getCurrentState() == "deleted"){
|
|
|
+ throw new \Exception ("No puede usar el cliente cancelado o eliminado");
|
|
|
}
|
|
|
}
|
|
|
if (is_null($content)) {
|
|
@@ -918,8 +921,11 @@ class Services extends ApiServices
|
|
|
if ($apiValidationBase->validTenancy($instance->getTenancyId())) {
|
|
|
if (!is_null($instance->getClientId()) && $instance->getClientId() > 0) {
|
|
|
// chequeo el cliente exista
|
|
|
- if (!$apiValidationBase->validClient($instance->getClientId())) {
|
|
|
+ $clientFound = $apiValidationBase->validClient($instance->getClientId());
|
|
|
+ if (!$clientFound) {
|
|
|
$content = "El id del cliente no existe.";
|
|
|
+ }else if($clientFound->getCurrentState() == "cancelled" || $clientFound->getCurrentState() == "deleted"){
|
|
|
+ throw new \Exception ("No puede usar el cliente cancelado o eliminado");
|
|
|
}
|
|
|
}
|
|
|
if (is_null($content)) {
|