diff --git a/models/baseModels/Invoice/Invoice.ts b/models/baseModels/Invoice/Invoice.ts index eb3ef339..4f41c163 100644 --- a/models/baseModels/Invoice/Invoice.ts +++ b/models/baseModels/Invoice/Invoice.ts @@ -191,6 +191,9 @@ export abstract class Invoice extends Transactional { async validate() { await super.validate(); + if (this.isQuote) { + return; + } if ( this.enableDiscounting && !this.fyo.singles?.AccountingSettings?.discountAccount diff --git a/models/inventory/helpers.ts b/models/inventory/helpers.ts index 3cfb92d8..d5d200db 100644 --- a/models/inventory/helpers.ts +++ b/models/inventory/helpers.ts @@ -15,6 +15,9 @@ import type { SerialNumberStatus } from './types'; export async function validateBatch( doc: StockMovement | StockTransfer | Invoice ) { + if (doc.schemaName === ModelNameEnum.SalesQuote) { + return; + } for (const row of doc.items ?? []) { await validateItemRowBatch(row); } @@ -52,6 +55,9 @@ async function validateItemRowBatch( } export async function validateSerialNumber(doc: StockMovement | StockTransfer) { + if (doc.schemaName === ModelNameEnum.SalesQuote) { + return; + } if (doc.isCancelled) { return; } @@ -64,6 +70,9 @@ export async function validateSerialNumber(doc: StockMovement | StockTransfer) { async function validateItemRowSerialNumber( row: StockMovementItem | StockTransferItem ) { + if (row.parentdoc?.schemaName === ModelNameEnum.SalesQuote) { + return; + } const idx = row.idx ?? 0; const item = row.item; diff --git a/schemas/app/Defaults.json b/schemas/app/Defaults.json index 42508dd8..262c0097 100644 --- a/schemas/app/Defaults.json +++ b/schemas/app/Defaults.json @@ -129,6 +129,7 @@ "label": "Sales Quote Print Template", "fieldtype": "Link", "target": "PrintTemplate", + "default": "Business - Quote", "section": "Print Templates" }, { @@ -136,6 +137,7 @@ "label": "Sales Invoice Print Template", "fieldtype": "Link", "target": "PrintTemplate", + "default": "Business - Sales Invoice", "section": "Print Templates" }, { @@ -143,6 +145,7 @@ "label": "Purchase Invoice Print Template", "fieldtype": "Link", "target": "PrintTemplate", + "default": "Business - Purchase Invoice", "section": "Print Templates" }, { @@ -157,6 +160,7 @@ "label": "Payment Print Template", "fieldtype": "Link", "target": "PrintTemplate", + "default": "Business - Payment", "section": "Print Templates" }, { @@ -164,6 +168,7 @@ "label": "Shipment Print Template", "fieldtype": "Link", "target": "PrintTemplate", + "default": "Business - Shipment", "section": "Print Templates" }, { @@ -185,6 +190,7 @@ "label": "POS Print Template", "fieldtype": "Link", "target": "PrintTemplate", + "default": "Business-POS - Sales Invoice", "section": "Print Templates" }, { diff --git a/schemas/app/inventory/Point of Sale/POSSettings.json b/schemas/app/inventory/Point of Sale/POSSettings.json index e9b904dc..0d2887bb 100644 --- a/schemas/app/inventory/Point of Sale/POSSettings.json +++ b/schemas/app/inventory/Point of Sale/POSSettings.json @@ -42,7 +42,7 @@ }, { "fieldname": "posUI", - "label": "Pos Ui", + "label": "POS UI", "fieldtype": "Select", "options": [ { @@ -67,11 +67,12 @@ }, { "fieldname": "defaultAccount", - "label": "default Account", + "label": "Default Account", "fieldtype": "Link", "create": true, "required": true, "target": "Account", + "default": "Debtors", "section": "Default" }, { diff --git a/src/components/Controls/AutoComplete.vue b/src/components/Controls/AutoComplete.vue index 749ddd51..43d1a5bc 100644 --- a/src/components/Controls/AutoComplete.vue +++ b/src/components/Controls/AutoComplete.vue @@ -26,8 +26,8 @@ :placeholder="inputPlaceholder" :readonly="isReadOnly" :tabindex="isReadOnly ? '-1' : '0'" - @focus="(e) => !isReadOnly && onFocus(e, toggleDropdown)" - @click="(e) => !isReadOnly && onFocus(e, toggleDropdown)" + @focus="(e) => !isReadOnly && onInputFocus(e)" + @click="(e) => !isReadOnly && onClick(e, toggleDropdown)" @blur="(e) => !isReadOnly && onBlur(e.target.value)" @input="onInput" @keydown.up="highlightItemUp" @@ -36,6 +36,7 @@ @keydown.tab="toggleDropdown(false)" @keydown.esc="toggleDropdown(false)" /> + @@ -42,12 +42,26 @@