mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2024-11-05 18:52:44 +01:00
fixes for client number incrementation
This commit is contained in:
parent
faa5a05ac1
commit
ebf439adcf
@ -36,7 +36,7 @@ class StoreClientRequest extends Request
|
||||
|
||||
/* Ensure we have a client name, and that all emails are unique*/
|
||||
$rules['name'] = 'required|min:1';
|
||||
$rules['id_number'] = 'unique:clients,id_number,,id,company_id,' . auth()->user()->company()->id;
|
||||
$rules['id_number'] = 'unique:clients,id_number,' . $this->id . ',id,company_id,' . $this->company_id;
|
||||
//$rules['settings'] = 'json';
|
||||
|
||||
$contacts = request('contacts');
|
||||
|
@ -65,8 +65,8 @@ class ClientRepository extends BaseRepository
|
||||
|
||||
$client->save();
|
||||
|
||||
// if($client->id_number == "")
|
||||
// $client->id_number = $this->getNextClientNumber($client); //todo write tests for this and make sure that custom client numbers also works as expected from here
|
||||
if($client->id_number == "" || !$client->id_number)
|
||||
$client->id_number = $this->getNextClientNumber($client); //todo write tests for this and make sure that custom client numbers also works as expected from here
|
||||
|
||||
$client->save();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user