1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-10 05:02:36 +01:00

fixes for client number incrementation

This commit is contained in:
David Bomba 2019-10-08 22:17:05 +11:00
parent faa5a05ac1
commit ebf439adcf
2 changed files with 3 additions and 3 deletions

View File

@ -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');

View File

@ -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();