diff --git a/static/js/index.js b/static/js/index.js index ba27c0c..93efa41 100644 --- a/static/js/index.js +++ b/static/js/index.js @@ -531,6 +531,23 @@ window.app = Vue.createApp({ } } return null + }, + isReceivable(entry) { + // Check if this is a receivable entry (user owes castle) + // Receivables have a debit to an "Accounts Receivable" account with the user's ID + if (!entry.lines || entry.lines.length === 0) return false + + for (const line of entry.lines) { + // Look for a line with positive debit on an accounts receivable account + if (line.debit > 0) { + // Check if the account is associated with this user's receivables + const account = this.accounts.find(a => a.id === line.account_id) + if (account && account.name && account.name.includes('Accounts Receivable') && account.account_type === 'asset') { + return true + } + } + } + return false } }, async created() { diff --git a/templates/castle/index.html b/templates/castle/index.html index b9b0c50..fbe7ef2 100644 --- a/templates/castle/index.html +++ b/templates/castle/index.html @@ -200,7 +200,12 @@ - {% raw %}{{ entry.description }}{% endraw %} + + {% raw %}{{ entry.description }}{% endraw %} + + Pending Payment + + {% raw %}{{ formatDate(entry.entry_date) }}{% endraw %}