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.itemType !== 'Product' ||
(this.inserted && !this.trackItem),
barcode: () => !this.fyo.singles.InventorySettings?.enableBarcodes,
};
readOnly: ReadOnlyMap = {

View File

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

View File

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

View File

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

View File

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