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;
|
||||
}
|
||||
|
||||
// Some variables don't map 1:1 to table columns. This gives us support for such cases.
|
||||
$aliases = [
|
||||
'$quote.balance_due' => 'partial',
|
||||
];
|
||||
|
||||
try {
|
||||
$_variable = explode('.', $variable)[1];
|
||||
} catch (Exception $e) {
|
||||
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})) {
|
||||
return true;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user