Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions POS/src/components/sale/DraftInvoicesDialog.vue
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
</div>
<div class="flex items-center gap-1">
<button
v-if="props.allowPrintDraftInvoices"
@click.stop="handlePrintDraft(draft)"
class="text-gray-400 hover:text-blue-600 transition-colors p-1"
:title="__('Print draft')"
Expand Down Expand Up @@ -180,6 +181,10 @@ const props = defineProps({
type: String,
default: DEFAULT_CURRENCY,
},
allowPrintDraftInvoices: {
type: Boolean,
default: false,
},
})

const emit = defineEmits(["update:modelValue", "load-draft", "drafts-updated"])
Expand Down Expand Up @@ -218,6 +223,10 @@ async function loadDrafts() {
}

function handlePrintDraft(draft) {
if (!props.allowPrintDraftInvoices) {
return
}

try {
const invoiceData = {
name: draft.draft_id,
Expand Down
1 change: 1 addition & 0 deletions POS/src/pages/POSSale.vue
Original file line number Diff line number Diff line change
Expand Up @@ -503,6 +503,7 @@
<DraftInvoicesDialog
v-model="uiStore.showDraftDialog"
:currency="shiftStore.profileCurrency"
:allow-print-draft-invoices="posSettingsStore.allowPrintDraftInvoices"
@load-draft="handleLoadDraft"
@drafts-updated="draftsStore.updateDraftsCount"
/>
Expand Down
2 changes: 2 additions & 0 deletions pos_next/api/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
"allow_negative_stock",
"enable_sales_persons",
"silent_print",
"allow_print_draft_invoices",
"allow_sales_order",
"allow_select_sales_order",
"create_only_sales_order",
Expand Down Expand Up @@ -62,6 +63,7 @@
"allow_negative_stock": 0,
"enable_sales_persons": "Disabled",
"silent_print": 0,
"allow_print_draft_invoices": 0,
"allow_sales_order": 0,
"allow_select_sales_order": 0,
"create_only_sales_order": 0,
Expand Down
Loading