qbo fix
This commit is contained in:
@@ -346,8 +346,6 @@ function renderInvoiceRow(invoice) {
|
||||
let statusBadge = '';
|
||||
if (paid && invoice.payment_status === 'Deposited') {
|
||||
statusBadge = `<span class="inline-block px-2 py-0.5 text-xs font-semibold rounded-full bg-blue-100 text-blue-800" title="Deposited ${formatDate(invoice.paid_date)}">Deposited</span>`;
|
||||
} else if (paid && invoice.payment_status === 'Stripe') {
|
||||
statusBadge = `<span class="inline-block px-2 py-0.5 text-xs font-semibold rounded-full bg-purple-100 text-purple-800" title="Stripe payment ${formatDate(invoice.paid_date)}">Stripe</span>`;
|
||||
} else if (paid) {
|
||||
statusBadge = `<span class="inline-block px-2 py-0.5 text-xs font-semibold rounded-full bg-green-100 text-green-800" title="Paid ${formatDate(invoice.paid_date)}">Paid</span>`;
|
||||
} else if (partial) {
|
||||
@@ -366,6 +364,14 @@ function renderInvoiceRow(invoice) {
|
||||
statusBadge = `<span class="inline-block px-2 py-0.5 text-xs font-semibold rounded-full bg-orange-200 text-orange-800">Open</span>`;
|
||||
}
|
||||
|
||||
// QBO booking error indicator
|
||||
if (invoice.qbo_payment_error) {
|
||||
const errPreview = invoice.qbo_payment_error.length > 80
|
||||
? invoice.qbo_payment_error.substring(0, 80) + '...'
|
||||
: invoice.qbo_payment_error;
|
||||
statusBadge += ` <span class="inline-block px-2 py-0.5 text-xs font-semibold rounded-full bg-red-200 text-red-800 cursor-help" title="${invoice.qbo_payment_error}">QBO ⚠</span>`;
|
||||
}
|
||||
|
||||
// Send Date — show actual sent dates if available, otherwise scheduled
|
||||
let sendDateDisplay = '—';
|
||||
const sentDates = invoice.sent_dates || [];
|
||||
@@ -450,9 +456,9 @@ function renderInvoiceRow(invoice) {
|
||||
</button>`
|
||||
: '';
|
||||
|
||||
const stripeCheckBtn = (invoice.stripe_payment_link_id && !paid)
|
||||
const stripeCheckBtn = (invoice.stripe_payment_link_id && (!paid || invoice.qbo_payment_error))
|
||||
? `<button onclick="window.invoiceView.checkStripePayment(${invoice.id})" title="Check Stripe Payment Status" class="px-2 py-1 bg-purple-50 text-purple-600 rounded hover:bg-purple-100 text-xs font-semibold">🔍 Check</button>`
|
||||
: '';
|
||||
: '';
|
||||
|
||||
const rowClass = paid ? (invoice.payment_status === 'Deposited' ? 'bg-blue-50/50' : 'bg-green-50/50') : partial ? 'bg-yellow-50/30' : overdue ? 'bg-red-50/50' : '';
|
||||
|
||||
|
||||
Reference in New Issue
Block a user