mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-09 03:14:30 -04:00
Support for 1:1 columns
This commit is contained in:
parent
a51436f224
commit
a2eec608d9
@ -272,12 +272,21 @@ document.addEventListener('DOMContentLoaded', function() {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Some variables don't map 1:1 to table columns. This gives us support for such cases.
|
||||||
|
$aliases = [
|
||||||
|
'$quote.balance_due' => 'partial',
|
||||||
|
];
|
||||||
|
|
||||||
try {
|
try {
|
||||||
$_variable = explode('.', $variable)[1];
|
$_variable = explode('.', $variable)[1];
|
||||||
} catch (Exception $e) {
|
} catch (Exception $e) {
|
||||||
throw new Exception('Company settings seems to be broken. Missing $entity.variable type.');
|
throw new Exception('Company settings seems to be broken. Missing $entity.variable type.');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (\in_array($variable, \array_keys($aliases))) {
|
||||||
|
$_variable = $aliases[$variable];
|
||||||
|
}
|
||||||
|
|
||||||
if (is_null($this->entity->{$_variable})) {
|
if (is_null($this->entity->{$_variable})) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user