click if sent

This commit is contained in:
2026-03-25 18:01:45 -05:00
parent fe7a9f6dd4
commit 5e792ab96f

View File

@@ -245,6 +245,12 @@ function renderInvoiceRow(invoice) {
else if (daysUntil <= 3) sendDateDisplay += ` <span class="text-xs text-yellow-600">(in ${daysUntil}d)</span>`; else if (daysUntil <= 3) sendDateDisplay += ` <span class="text-xs text-yellow-600">(in ${daysUntil}d)</span>`;
} }
} }
// Send Date cell — only clickable if actually sent
const sendDateClickable = sentDates.length > 0;
const sendDateCell = sendDateClickable
? `<span class="cursor-pointer hover:text-blue-600" onclick="window.invoiceView.editSentDates(${invoice.id})" title="Click to edit sent dates">${sendDateDisplay}</span>`
: sendDateDisplay;
// Amount column — show balance when partially paid // Amount column — show balance when partially paid
let amountDisplay; let amountDisplay;
@@ -302,9 +308,7 @@ function renderInvoiceRow(invoice) {
<td class="px-4 py-3 text-sm text-gray-500">${invoice.customer_name || 'N/A'}</td> <td class="px-4 py-3 text-sm text-gray-500">${invoice.customer_name || 'N/A'}</td>
<td class="px-4 py-3 whitespace-nowrap text-sm text-gray-500">${formatDate(invoice.invoice_date)}</td> <td class="px-4 py-3 whitespace-nowrap text-sm text-gray-500">${formatDate(invoice.invoice_date)}</td>
<td class="px-4 py-3 whitespace-nowrap text-sm text-gray-600"> <td class="px-4 py-3 whitespace-nowrap text-sm text-gray-600">
<span class="cursor-pointer hover:text-blue-600" onclick="window.invoiceView.editSentDates(${invoice.id})" title="Click to edit sent dates"> ${sendDateCell}
${sendDateDisplay}
</span>
</td> <td class="px-4 py-3 whitespace-nowrap text-sm text-gray-500">${invoice.terms}</td> </td> <td class="px-4 py-3 whitespace-nowrap text-sm text-gray-500">${invoice.terms}</td>
<td class="px-4 py-3 whitespace-nowrap text-sm text-gray-900 font-semibold">${amountDisplay}</td> <td class="px-4 py-3 whitespace-nowrap text-sm text-gray-900 font-semibold">${amountDisplay}</td>
<td class="px-4 py-3 whitespace-nowrap text-sm font-medium space-x-1"> <td class="px-4 py-3 whitespace-nowrap text-sm font-medium space-x-1">