mirror of
https://github.com/frappe/books.git
synced 2024-12-25 12:10:06 +00:00
fix: Handle null table
This commit is contained in:
parent
1980e5e26f
commit
c842334003
@ -636,7 +636,7 @@ module.exports = class BaseDocument extends Observable {
|
||||
|
||||
// helper functions
|
||||
getSum(tablefield, childfield) {
|
||||
return this[tablefield]
|
||||
return (this[tablefield] || [])
|
||||
.map(d => parseFloat(d[childfield], 10) || 0)
|
||||
.reduce((a, b) => a + b, 0);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user