2
0
mirror of https://github.com/frappe/books.git synced 2025-02-02 12:08:27 +00:00

feat: add enable barcode

This commit is contained in:
18alantom 2023-01-16 11:01:12 +05:30
parent fe68edd94d
commit cf4f8d368c
5 changed files with 16 additions and 1 deletions

View File

@ -120,6 +120,7 @@ export class Item extends Doc {
!this.fyo.singles.AccountingSettings?.enableInventory || !this.fyo.singles.AccountingSettings?.enableInventory ||
this.itemType !== 'Product' || this.itemType !== 'Product' ||
(this.inserted && !this.trackItem), (this.inserted && !this.trackItem),
barcode: () => !this.fyo.singles.InventorySettings?.enableBarcodes,
}; };
readOnly: ReadOnlyMap = { readOnly: ReadOnlyMap = {

View File

@ -9,6 +9,7 @@ export class InventorySettings extends Doc {
valuationMethod?: ValuationMethod; valuationMethod?: ValuationMethod;
stockReceivedButNotBilled?: string; stockReceivedButNotBilled?: string;
costOfGoodsSold?: string; costOfGoodsSold?: string;
enableBarcodes?: boolean;
static filters: FiltersMap = { static filters: FiltersMap = {
stockInHand: () => ({ stockInHand: () => ({

View File

@ -106,6 +106,12 @@
"fieldtype": "Int", "fieldtype": "Int",
"placeholder": "HSN/SAC Code" "placeholder": "HSN/SAC Code"
}, },
{
"fieldname": "barcode",
"label": "Barcode",
"fieldtype": "Data",
"placeholder": "Barcode"
},
{ {
"fieldname": "trackItem", "fieldname": "trackItem",
"label": "Track Item", "label": "Track Item",
@ -122,6 +128,7 @@
"description", "description",
"incomeAccount", "incomeAccount",
"expenseAccount", "expenseAccount",
"barcode",
"hsnCode", "hsnCode",
"trackItem" "trackItem"
], ],

View File

@ -45,6 +45,11 @@
"label": "Cost Of Goods Sold Acc.", "label": "Cost Of Goods Sold Acc.",
"fieldtype": "Link", "fieldtype": "Link",
"target": "Account" "target": "Account"
},
{
"fieldname": "enableBarcodes",
"label": "Enable Barcodes",
"fieldtype": "Check"
} }
] ]
} }

View File

@ -126,7 +126,8 @@ export default {
fieldnames.includes('hideGetStarted') || fieldnames.includes('hideGetStarted') ||
fieldnames.includes('displayPrecision') || fieldnames.includes('displayPrecision') ||
fieldnames.includes('enableDiscounting') || fieldnames.includes('enableDiscounting') ||
fieldnames.includes('enableInventory') fieldnames.includes('enableInventory') ||
fieldnames.includes('enableBarcodes')
) { ) {
this.showReloadToast(); this.showReloadToast();
} }