Minor fixes for client required fields

This commit is contained in:
David Bomba 2021-11-18 21:35:00 +11:00
parent b88b410c1c
commit 5673cae467
2 changed files with 3 additions and 3 deletions

View File

@ -28,7 +28,7 @@ class ClientFactory
$client->public_notes = '';
$client->balance = 0;
$client->paid_to_date = 0;
// $client->country_id = 4;
$client->country_id = 840;
$client->is_deleted = 0;
$client->client_hash = Str::random(40);
$client->settings = ClientSettings::defaults();

View File

@ -141,7 +141,7 @@ class RequiredClientInfo extends Component
$_field = $this->mappings[$field['name']];
if (Str::startsWith($field['name'], 'client_')) {
if (empty($this->contact->client->{$_field}) || is_null($this->contact->client->{$_field})) {
if (empty($this->contact->client->{$_field}) || is_null($this->contact->client->{$_field}) || $this->contact->client->{$_field} = 840) {
$this->show_form = true;
} else {
$this->fields[$index]['filled'] = true;
@ -149,7 +149,7 @@ class RequiredClientInfo extends Component
}
if (Str::startsWith($field['name'], 'contact_')) {
if ((empty($this->contact->{$_field}) || is_null($this->contact->{$_field}))) {
if ((empty($this->contact->{$_field}) || is_null($this->contact->{$_field})) || $this->contact->client->{$_field} = 840) {
$this->show_form = true;
} else {
$this->fields[$index]['filled'] = true;