mirror of
https://github.com/frappe/books.git
synced 2026-08-24 02:24:17 -05:00
Merge pull request #1332 from Gadha2311/default-account
fix: default account mandatory error
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -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"
|
||||
},
|
||||
{
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user