Fixes for required fields when forcing custom values as required
This commit is contained in:
parent
8d037a5ca9
commit
18801c9809
|
|
@ -584,9 +584,8 @@ class MultiDB
|
||||||
$current_db = config('database.default');
|
$current_db = config('database.default');
|
||||||
|
|
||||||
foreach (self::$dbs as $db) {
|
foreach (self::$dbs as $db) {
|
||||||
if ($company = Company::on($db)->where("expense_mailbox", $expense_mailbox)->first()) {
|
self::setDb($db);
|
||||||
self::setDb($db);
|
if ($company = Company::where("expense_mailbox", $expense_mailbox)->first()) {
|
||||||
|
|
||||||
return $company;
|
return $company;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -161,12 +161,13 @@ class InvoicePay extends Component
|
||||||
private function checkRequiredFields(CompanyGateway $company_gateway)
|
private function checkRequiredFields(CompanyGateway $company_gateway)
|
||||||
{
|
{
|
||||||
|
|
||||||
$fields = $company_gateway->driver()->getClientRequiredFields();
|
/** @var \App\Models\ClientContact $contact */
|
||||||
|
$contact = $this->getContext()['contact'];
|
||||||
|
|
||||||
|
$fields = $company_gateway->driver($contact->client)->getClientRequiredFields();
|
||||||
|
|
||||||
$this->setContext('fields', $fields); // $this->context['fields'] = $fields;
|
$this->setContext('fields', $fields); // $this->context['fields'] = $fields;
|
||||||
|
|
||||||
/** @var \App\Models\ClientContact $contact */
|
|
||||||
$contact = $this->getContext()['contact'];
|
|
||||||
|
|
||||||
foreach ($fields as $index => $field) {
|
foreach ($fields as $index => $field) {
|
||||||
$_field = $this->mappings[$field['name']];
|
$_field = $this->mappings[$field['name']];
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue