mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-09 03:14:30 -04:00
Show required fields
This commit is contained in:
parent
d1b94fadfa
commit
efeb5bec74
@ -377,42 +377,45 @@ $_contact->push();
|
|||||||
|
|
||||||
public function checkFields()
|
public function checkFields()
|
||||||
{
|
{
|
||||||
MultiDB::setDb($this->db);
|
|
||||||
$_contact = ClientContact::withTrashed()->find($this->contact_id);
|
|
||||||
|
|
||||||
foreach ($this->fields as $index => $field) {
|
$this->show_form = true;
|
||||||
$_field = $this->mappings[$field['name']];
|
|
||||||
|
|
||||||
if (Str::startsWith($field['name'], 'client_')) {
|
// MultiDB::setDb($this->db);
|
||||||
if (empty($_contact->client->{$_field})
|
// $_contact = ClientContact::withTrashed()->find($this->contact_id);
|
||||||
|| is_null($_contact->client->{$_field})
|
|
||||||
// || in_array($_field, $this->client_address_array)
|
|
||||||
) {
|
|
||||||
$this->show_form = true;
|
|
||||||
} else {
|
|
||||||
$this->fields[$index]['filled'] = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (Str::startsWith($field['name'], 'contact_')) {
|
// foreach ($this->fields as $index => $field) {
|
||||||
if (empty($_contact->{$_field}) || is_null($_contact->{$_field}) || str_contains($_contact->{$_field}, '@example.com')) {
|
// $_field = $this->mappings[$field['name']];
|
||||||
$this->show_form = true;
|
|
||||||
} else {
|
|
||||||
$this->fields[$index]['filled'] = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
$left = collect($this->fields)
|
// if (Str::startsWith($field['name'], 'client_')) {
|
||||||
->filter(fn ($field) => !array_key_exists('filled', $field))
|
// if (empty($_contact->client->{$_field})
|
||||||
->count();
|
// || is_null($_contact->client->{$_field})
|
||||||
|
// // || in_array($_field, $this->client_address_array)
|
||||||
|
// ) {
|
||||||
|
// $this->show_form = true;
|
||||||
|
// } else {
|
||||||
|
// $this->fields[$index]['filled'] = true;
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
|
||||||
if ($left === 0) {
|
// if (Str::startsWith($field['name'], 'contact_')) {
|
||||||
$this->dispatch(
|
// if (empty($_contact->{$_field}) || is_null($_contact->{$_field}) || str_contains($_contact->{$_field}, '@example.com')) {
|
||||||
'passed-required-fields-check',
|
// $this->show_form = true;
|
||||||
client_postal_code: $this->contact->client->postal_code
|
// } else {
|
||||||
);
|
// $this->fields[$index]['filled'] = true;
|
||||||
}
|
// }
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
|
||||||
|
// $left = collect($this->fields)
|
||||||
|
// ->filter(fn ($field) => !array_key_exists('filled', $field))
|
||||||
|
// ->count();
|
||||||
|
|
||||||
|
// if ($left === 0) {
|
||||||
|
// $this->dispatch(
|
||||||
|
// 'passed-required-fields-check',
|
||||||
|
// client_postal_code: $this->contact->client->postal_code
|
||||||
|
// );
|
||||||
|
// }
|
||||||
}
|
}
|
||||||
|
|
||||||
public function showCopyBillingCheckbox(): bool
|
public function showCopyBillingCheckbox(): bool
|
||||||
|
Loading…
x
Reference in New Issue
Block a user