subscription added

This commit is contained in:
2026-04-20 17:02:33 -05:00
parent 88582cbc77
commit 93db2f237f
3 changed files with 21 additions and 6 deletions

View File

@@ -47,7 +47,9 @@ export function addItem(containerId, { item = null, type = 'invoice', laborRate
temp.innerHTML = item.description;
previewDesc = temp.textContent.substring(0, 50) + (temp.textContent.length > 50 ? '...' : '');
}
const typeLabel = (item && item.qbo_item_id == '5') ? 'Labor' : 'Parts';
const typeLabel = (item && item.qbo_item_id == '5') ? 'Labor'
: (item && item.qbo_item_id == '115') ? 'Subscription'
: 'Parts';
const itemDiv = document.createElement('div');
itemDiv.className = 'border border-gray-300 rounded-lg mb-3 bg-white';
@@ -87,6 +89,7 @@ export function addItem(containerId, { item = null, type = 'invoice', laborRate
<select data-item="${itemId}" data-field="qbo_item_id" class="w-full px-2 py-2 border border-gray-300 rounded-md text-sm bg-white" onchange="window.itemEditor.handleTypeChange(this, '${prefix}', ${itemId})">
<option value="9" ${item && item.qbo_item_id == '9' ? 'selected' : ''}>Parts</option>
<option value="5" ${item && item.qbo_item_id == '5' ? 'selected' : ''}>Labor</option>
<option value="115" ${item && item.qbo_item_id == '115' ? 'selected' : ''}>Subscription</option>
</select>
</div>
@@ -177,7 +180,9 @@ function updateItemPreview(itemDiv) {
if (amountPreview && amountInput) amountPreview.textContent = amountInput.value || '$0.00';
if (typePreview && typeInput) {
typePreview.textContent = typeInput.value == '5' ? 'Labor' : 'Parts';
typePreview.textContent = typeInput.value == '5' ? 'Labor'
: typeInput.value == '115' ? 'Subscription'
: 'Parts';
}
if (descPreview && editorDiv && editorDiv.quillInstance) {