Merge pull request #1332 from Gadha2311/default-account

fix: default account mandatory error
This commit is contained in:
Able k Saju
2025-09-12 15:05:17 +05:30
committed by GitHub
6 changed files with 52 additions and 7 deletions
+3
View File
@@ -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
+9
View File
@@ -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;
+6
View File
@@ -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"
},
{
@@ -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"
},
{
+14 -2
View File
@@ -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)"
/>
<svg
v-if="!isReadOnly && !canLink"
class="w-3 h-3"
@@ -289,6 +290,17 @@ export default {
this.toggleDropdown(false);
},
onInputFocus(e) {
this.isFocused = true;
},
onClick(e, toggleDropdown) {
if (this.isFocused) {
this.toggleDropdown = toggleDropdown;
this.toggleDropdown(true);
this.updateSuggestions();
this.$emit('focus', e);
}
},
onFocus(e, toggleDropdown) {
this.isFocused = true;
this.toggleDropdown = toggleDropdown;
+17 -3
View File
@@ -1,7 +1,7 @@
<template>
<feather-icon
:name="isExapanded ? 'chevron-up' : 'chevron-down'"
class="w-4 h-4 inline-flex"
class="w-4 h-4 inline-flex cursor-pointer text-gray-700 dark:text-gray-200"
@click="isExapanded = !isExapanded"
/>
@@ -42,12 +42,26 @@
<div class="flex flex-col ml-1">
<feather-icon
name="chevron-up"
class="w-3 h-3 cursor-pointer hover:text-blue-500"
class="
w-3
h-3
cursor-pointer
hover:text-blue-500
text-gray-700
dark:text-gray-200
"
@click="adjustQuantity(1)"
/>
<feather-icon
name="chevron-down"
class="w-3 h-3 cursor-pointer hover:text-blue-500"
class="
w-3
h-3
cursor-pointer
hover:text-blue-500
text-gray-700
dark:text-gray-200
"
@click="adjustQuantity(-1)"
/>
</div>