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

fix: translate all labels

This commit is contained in:
18alantom 2022-02-16 11:49:16 +05:30 committed by Alan
parent f99de4cd86
commit c52b7f54ad
84 changed files with 833 additions and 771 deletions

View File

@ -294,47 +294,47 @@ export async function generateGstr2Csv(getReportData) {
async function generateB2bCsvGstr2(rows, columns) { async function generateB2bCsvGstr2(rows, columns) {
const csvColumns = [ const csvColumns = [
{ {
label: 'GSTIN of Supplier', label: t`GSTIN of Supplier`,
fieldname: 'gstin', fieldname: 'gstin',
}, },
{ {
label: 'Invoice Number', label: t`Invoice Number`,
fieldname: 'invNo', fieldname: 'invNo',
}, },
{ {
label: 'Invoice Date', label: t`Invoice Date`,
fieldname: 'invDate', fieldname: 'invDate',
}, },
{ {
label: 'Invoice Value', label: t`Invoice Value`,
fieldname: 'invAmt', fieldname: 'invAmt',
}, },
{ {
label: 'Place of supply', label: t`Place of supply`,
fieldname: 'place', fieldname: 'place',
}, },
{ {
label: 'Reverse Charge', label: t`Reverse Charge`,
fieldname: 'reverseCharge', fieldname: 'reverseCharge',
}, },
{ {
label: 'Rate', label: t`Rate`,
fieldname: 'rate', fieldname: 'rate',
}, },
{ {
label: 'Taxable Value', label: t`Taxable Value`,
fieldname: 'taxVal', fieldname: 'taxVal',
}, },
{ {
label: 'Intergrated Tax Paid', label: t`Intergrated Tax Paid`,
fieldname: 'igstAmt', fieldname: 'igstAmt',
}, },
{ {
label: 'Central Tax Paid', label: t`Central Tax Paid`,
fieldname: 'cgstAmt', fieldname: 'cgstAmt',
}, },
{ {
label: 'State/UT Tax Paid', label: t`State/UT Tax Paid`,
fieldname: 'sgstAmt', fieldname: 'sgstAmt',
}, },
]; ];

View File

@ -1,5 +1,7 @@
import { t } from 'frappe';
export const ledgerLink = { export const ledgerLink = {
label: 'Ledger Entries', label: t`Ledger Entries`,
condition: (doc) => doc.submitted, condition: (doc) => doc.submitted,
action: (doc, router) => { action: (doc, router) => {
router.push({ router.push({

View File

@ -1,67 +1,61 @@
const { t } = require('frappe');
module.exports = { module.exports = {
name: 'File', name: 'File',
doctype: 'DocType', doctype: 'DocType',
isSingle: 0, isSingle: 0,
keywordFields: [ keywordFields: ['name', 'filename'],
'name',
'filename'
],
fields: [ fields: [
{ {
fieldname: 'name', fieldname: 'name',
label: 'File Path', label: t`File Path`,
fieldtype: 'Data', fieldtype: 'Data',
required: 1, required: 1,
}, },
{ {
fieldname: 'filename', fieldname: 'filename',
label: 'File Name', label: t`File Name`,
fieldtype: 'Data', fieldtype: 'Data',
required: 1, required: 1,
}, },
{ {
fieldname: 'mimetype', fieldname: 'mimetype',
label: 'MIME Type', label: t`MIME Type`,
fieldtype: 'Data', fieldtype: 'Data',
}, },
{ {
fieldname: 'size', fieldname: 'size',
label: 'File Size', label: t`File Size`,
fieldtype: 'Int', fieldtype: 'Int',
}, },
{ {
fieldname: 'referenceDoctype', fieldname: 'referenceDoctype',
label: 'Reference DocType', label: t`Reference DocType`,
fieldtype: 'Data', fieldtype: 'Data',
}, },
{ {
fieldname: 'referenceName', fieldname: 'referenceName',
label: 'Reference Name', label: t`Reference Name`,
fieldtype: 'Data', fieldtype: 'Data',
}, },
{ {
fieldname: 'referenceField', fieldname: 'referenceField',
label: 'Reference Field', label: t`Reference Field`,
fieldtype: 'Data', fieldtype: 'Data',
}, },
], ],
layout: [ layout: [
{ {
columns: [ columns: [{ fields: ['filename'] }],
{ fields: ['filename'] },
]
}, },
{ {
columns: [ columns: [{ fields: ['mimetype'] }, { fields: ['size'] }],
{ fields: ['mimetype'] },
{ fields: ['size'] },
]
}, },
{ {
columns: [ columns: [
{ fields: ['referenceDoctype'] }, { fields: ['referenceDoctype'] },
{ fields: ['referenceName'] }, { fields: ['referenceName'] },
] ],
}, },
] ],
} };

View File

@ -1,22 +1,24 @@
const { t } = require('frappe');
module.exports = { module.exports = {
"name": "NumberSeries", name: 'NumberSeries',
"documentClass": require('./NumberSeriesDocument.js'), documentClass: require('./NumberSeriesDocument.js'),
"doctype": "DocType", doctype: 'DocType',
"isSingle": 0, isSingle: 0,
"isChild": 0, isChild: 0,
"keywordFields": [], keywordFields: [],
"fields": [ fields: [
{ {
"fieldname": "name", fieldname: 'name',
"label": "Prefix", label: t`Prefix`,
"fieldtype": "Data", fieldtype: 'Data',
"required": 1 required: 1,
}, },
{ {
"fieldname": "current", fieldname: 'current',
"label": "Current", label: t`Current`,
"fieldtype": "Int", fieldtype: 'Int',
"required": 1 required: 1,
} },
] ],
} };

View File

@ -1,10 +1,12 @@
const { t } = require('frappe');
module.exports = { module.exports = {
name: 'PatchRun', name: 'PatchRun',
fields: [ fields: [
{ {
fieldname: 'name', fieldname: 'name',
fieldtype: 'Data', fieldtype: 'Data',
label: 'Name' label: t`Name`,
} },
] ],
}; };

View File

@ -1,31 +1,33 @@
const { t } = require('frappe');
module.exports = { module.exports = {
name: "PrintFormat", name: 'PrintFormat',
label: "Print Format", label: t`Print Format`,
doctype: "DocType", doctype: 'DocType',
isSingle: 0, isSingle: 0,
isChild: 0, isChild: 0,
keywordFields: [], keywordFields: [],
fields: [ fields: [
{ {
fieldname: "name", fieldname: 'name',
label: "Name", label: t`Name`,
fieldtype: "Data", fieldtype: 'Data',
required: 1 required: 1,
}, },
{ {
fieldname: "for", fieldname: 'for',
label: "For", label: t`For`,
fieldtype: "Data", fieldtype: 'Data',
required: 1 required: 1,
}, },
{ {
fieldname: "template", fieldname: 'template',
label: "Template", label: t`Template`,
fieldtype: "Code", fieldtype: 'Code',
required: 1, required: 1,
options: { options: {
mode: 'text/html' mode: 'text/html',
} },
} },
] ],
} };

View File

@ -1,15 +1,17 @@
const { t } = require('frappe');
module.exports = { module.exports = {
"name": "Role", name: 'Role',
"doctype": "DocType", doctype: 'DocType',
"isSingle": 0, isSingle: 0,
"isChild": 0, isChild: 0,
"keywordFields": [], keywordFields: [],
"fields": [ fields: [
{ {
"fieldname": "name", fieldname: 'name',
"label": "Name", label: t`Name`,
"fieldtype": "Data", fieldtype: 'Data',
"required": 1 required: 1,
} },
] ],
} };

View File

@ -1,21 +1,23 @@
const { t } = require('frappe');
module.exports = { module.exports = {
"name": "Session", name: 'Session',
"doctype": "DocType", doctype: 'DocType',
"isSingle": 0, isSingle: 0,
"isChild": 0, isChild: 0,
"keywordFields": [], keywordFields: [],
"fields": [ fields: [
{ {
"fieldname": "username", fieldname: 'username',
"label": "Username", label: t`Username`,
"fieldtype": "Data", fieldtype: 'Data',
"required": 1 required: 1,
}, },
{ {
"fieldname": "password", fieldname: 'password',
"label": "Password", label: t`Password`,
"fieldtype": "Password", fieldtype: 'Password',
"required": 1 required: 1,
} },
] ],
} };

View File

@ -1,27 +1,29 @@
const { t } = require('frappe');
module.exports = { module.exports = {
"name": "SingleValue", name: 'SingleValue',
"doctype": "DocType", doctype: 'DocType',
"isSingle": 0, isSingle: 0,
"isChild": 0, isChild: 0,
"keywordFields": [], keywordFields: [],
"fields": [ fields: [
{ {
"fieldname": "parent", fieldname: 'parent',
"label": "Parent", label: t`Parent`,
"fieldtype": "Data", fieldtype: 'Data',
"required": 1 required: 1,
}, },
{ {
"fieldname": "fieldname", fieldname: 'fieldname',
"label": "Fieldname", label: t`Fieldname`,
"fieldtype": "Data", fieldtype: 'Data',
"required": 1 required: 1,
}, },
{ {
"fieldname": "value", fieldname: 'value',
"label": "Value", label: t`Value`,
"fieldtype": "Data", fieldtype: 'Data',
"required": 1 required: 1,
} },
] ],
} };

View File

@ -29,7 +29,7 @@ let dateFormatOptions = (() => {
module.exports = { module.exports = {
name: 'SystemSettings', name: 'SystemSettings',
label: 'System Settings', label: t`System Settings`,
doctype: 'DocType', doctype: 'DocType',
isSingle: 1, isSingle: 1,
isChild: 0, isChild: 0,
@ -37,7 +37,7 @@ module.exports = {
fields: [ fields: [
{ {
fieldname: 'dateFormat', fieldname: 'dateFormat',
label: 'Date Format', label: t`Date Format`,
fieldtype: 'Select', fieldtype: 'Select',
options: dateFormatOptions, options: dateFormatOptions,
default: 'MMM d, y', default: 'MMM d, y',
@ -46,14 +46,14 @@ module.exports = {
}, },
{ {
fieldname: 'locale', fieldname: 'locale',
label: 'Locale', label: t`Locale`,
fieldtype: 'Data', fieldtype: 'Data',
default: DEFAULT_LOCALE, default: DEFAULT_LOCALE,
description: t`Set the local code, this is used for number formatting.`, description: t`Set the local code, this is used for number formatting.`,
}, },
{ {
fieldname: 'displayPrecision', fieldname: 'displayPrecision',
label: 'Display Precision', label: t`Display Precision`,
fieldtype: 'Int', fieldtype: 'Int',
default: DEFAULT_DISPLAY_PRECISION, default: DEFAULT_DISPLAY_PRECISION,
required: 1, required: 1,
@ -71,7 +71,7 @@ module.exports = {
}, },
{ {
fieldname: 'internalPrecision', fieldname: 'internalPrecision',
label: 'Internal Precision', label: t`Internal Precision`,
fieldtype: 'Int', fieldtype: 'Int',
minValue: 0, minValue: 0,
default: DEFAULT_INTERNAL_PRECISION, default: DEFAULT_INTERNAL_PRECISION,
@ -79,14 +79,14 @@ module.exports = {
}, },
{ {
fieldname: 'hideGetStarted', fieldname: 'hideGetStarted',
label: 'Hide Get Started', label: t`Hide Get Started`,
fieldtype: 'Check', fieldtype: 'Check',
default: 0, default: 0,
description: t`Hides the Get Started section from the sidebar. Change will be visible on restart or refreshing the app.`, description: t`Hides the Get Started section from the sidebar. Change will be visible on restart or refreshing the app.`,
}, },
{ {
fieldname: 'autoReportErrors', fieldname: 'autoReportErrors',
label: 'Hide & Auto Report Errors', label: t`Hide & Auto Report Errors`,
fieldtype: 'Check', fieldtype: 'Check',
default: 0, default: 0,
description: t`Prevent errors from showing and automatically report all errors.`, description: t`Prevent errors from showing and automatically report all errors.`,

View File

@ -1,9 +1,10 @@
const { indicators } = require('../../../../src/colors'); const { indicators } = require('../../../../src/colors');
const { BLUE, GREEN } = indicators; const { BLUE, GREEN } = indicators;
const { t } = require('frappe');
module.exports = { module.exports = {
name: 'ToDo', name: 'ToDo',
label: 'To Do', label: t`To Do`,
naming: 'autoincrement', naming: 'autoincrement',
isSingle: 0, isSingle: 0,
keywordFields: ['subject', 'description'], keywordFields: ['subject', 'description'],
@ -18,14 +19,14 @@ module.exports = {
fields: [ fields: [
{ {
fieldname: 'subject', fieldname: 'subject',
label: 'Subject', label: t`Subject`,
placeholder: 'Subject', placeholder: 'Subject',
fieldtype: 'Data', fieldtype: 'Data',
required: 1, required: 1,
}, },
{ {
fieldname: 'status', fieldname: 'status',
label: 'Status', label: t`Status`,
fieldtype: 'Select', fieldtype: 'Select',
options: ['Open', 'Closed'], options: ['Open', 'Closed'],
default: 'Open', default: 'Open',
@ -33,7 +34,7 @@ module.exports = {
}, },
{ {
fieldname: 'description', fieldname: 'description',
label: 'Description', label: t`Description`,
fieldtype: 'Text', fieldtype: 'Text',
}, },
], ],
@ -42,7 +43,7 @@ module.exports = {
actions: [ actions: [
{ {
label: 'Close', label: t`Close`,
condition: (doc) => doc.status !== 'Closed', condition: (doc) => doc.status !== 'Closed',
action: async (doc) => { action: async (doc) => {
await doc.set('status', 'Closed'); await doc.set('status', 'Closed');
@ -50,7 +51,7 @@ module.exports = {
}, },
}, },
{ {
label: 'Re-Open', label: t`Re-Open`,
condition: (doc) => doc.status !== 'Open', condition: (doc) => doc.status !== 'Open',
action: async (doc) => { action: async (doc) => {
await doc.set('status', 'Open'); await doc.set('status', 'Open');

View File

@ -1,43 +1,42 @@
const { t } = require('frappe');
module.exports = { module.exports = {
"name": "User", name: 'User',
"doctype": "DocType", doctype: 'DocType',
"isSingle": 0, isSingle: 0,
"isChild": 0, isChild: 0,
"keywordFields": [ keywordFields: ['name', 'fullName'],
"name", fields: [
"fullName" {
fieldname: 'name',
label: t`Email`,
fieldtype: 'Data',
required: 1,
},
{
fieldname: 'password',
label: t`Password`,
fieldtype: 'Password',
required: 1,
hidden: 1,
},
{
fieldname: 'fullName',
label: t`Full Name`,
fieldtype: 'Data',
required: 1,
},
{
fieldname: 'roles',
label: t`Roles`,
fieldtype: 'Table',
childtype: 'UserRole',
},
{
fieldname: 'userId',
label: t`User ID`,
fieldtype: 'Data',
hidden: 1,
},
], ],
"fields": [ };
{
"fieldname": "name",
"label": "Email",
"fieldtype": "Data",
"required": 1
},
{
"fieldname": "password",
"label": "Password",
"fieldtype": "Password",
"required": 1,
"hidden": 1,
},
{
"fieldname": "fullName",
"label": "Full Name",
"fieldtype": "Data",
"required": 1
},
{
"fieldname": "roles",
"label": "Roles",
"fieldtype": "Table",
"childtype": "UserRole"
},
{
"fieldname": "userId",
"label": "User ID",
"fieldtype": "Data",
"hidden": 1
}
]
}

View File

@ -1,15 +1,17 @@
const { t } = require('frappe');
module.exports = { module.exports = {
"name": "UserRole", name: 'UserRole',
"doctype": "DocType", doctype: 'DocType',
"isSingle": 0, isSingle: 0,
"isChild": 1, isChild: 1,
"keywordFields": [], keywordFields: [],
"fields": [ fields: [
{ {
"fieldname": "role", fieldname: 'role',
"label": "Role", label: t`Role`,
"fieldtype": "Link", fieldtype: 'Link',
"target": "Role" target: 'Role',
} },
] ],
} };

View File

@ -1,9 +1,9 @@
import frappe from 'frappe'; import frappe, { t } from 'frappe';
import Account from './AccountDocument'; import Account from './AccountDocument';
export default { export default {
name: 'Account', name: 'Account',
label: 'Account', label: t`Account`,
doctype: 'DocType', doctype: 'DocType',
documentClass: Account, documentClass: Account,
isSingle: 0, isSingle: 0,
@ -12,13 +12,13 @@ export default {
fields: [ fields: [
{ {
fieldname: 'name', fieldname: 'name',
label: 'Account Name', label: t`Account Name`,
fieldtype: 'Data', fieldtype: 'Data',
required: 1, required: 1,
}, },
{ {
fieldname: 'rootType', fieldname: 'rootType',
label: 'Root Type', label: t`Root Type`,
fieldtype: 'Select', fieldtype: 'Select',
placeholder: 'Root Type', placeholder: 'Root Type',
options: ['Asset', 'Liability', 'Equity', 'Income', 'Expense'], options: ['Asset', 'Liability', 'Equity', 'Income', 'Expense'],
@ -26,7 +26,7 @@ export default {
}, },
{ {
fieldname: 'parentAccount', fieldname: 'parentAccount',
label: 'Parent Account', label: t`Parent Account`,
fieldtype: 'Link', fieldtype: 'Link',
target: 'Account', target: 'Account',
getFilters: (query, doc) => { getFilters: (query, doc) => {
@ -39,7 +39,7 @@ export default {
}, },
{ {
fieldname: 'accountType', fieldname: 'accountType',
label: 'Account Type', label: t`Account Type`,
placeholder: 'Account Type', placeholder: 'Account Type',
fieldtype: 'Select', fieldtype: 'Select',
options: [ options: [
@ -66,13 +66,13 @@ export default {
}, },
{ {
fieldname: 'balance', fieldname: 'balance',
label: 'Balance', label: t`Balance`,
fieldtype: 'Currency', fieldtype: 'Currency',
readOnly: 1, readOnly: 1,
}, },
{ {
fieldname: 'isGroup', fieldname: 'isGroup',
label: 'Is Group', label: t`Is Group`,
fieldtype: 'Check', fieldtype: 'Check',
}, },
], ],

View File

@ -1,6 +1,8 @@
import { t } from 'frappe';
export default { export default {
name: 'AccountingLedgerEntry', name: 'AccountingLedgerEntry',
label: 'Ledger Entry', label: t`Ledger Entry`,
naming: 'autoincrement', naming: 'autoincrement',
doctype: 'DocType', doctype: 'DocType',
isSingle: 0, isSingle: 0,
@ -9,64 +11,64 @@ export default {
fields: [ fields: [
{ {
fieldname: 'date', fieldname: 'date',
label: 'Date', label: t`Date`,
fieldtype: 'Date' fieldtype: 'Date',
}, },
{ {
fieldname: 'account', fieldname: 'account',
label: 'Account', label: t`Account`,
fieldtype: 'Link', fieldtype: 'Link',
target: 'Account', target: 'Account',
required: 1 required: 1,
}, },
{ {
fieldname: 'description', fieldname: 'description',
label: 'Description', label: t`Description`,
fieldtype: 'Text' fieldtype: 'Text',
}, },
{ {
fieldname: 'party', fieldname: 'party',
label: 'Party', label: t`Party`,
fieldtype: 'Link', fieldtype: 'Link',
target: 'Party' target: 'Party',
}, },
{ {
fieldname: 'debit', fieldname: 'debit',
label: 'Debit', label: t`Debit`,
fieldtype: 'Currency' fieldtype: 'Currency',
}, },
{ {
fieldname: 'credit', fieldname: 'credit',
label: 'Credit', label: t`Credit`,
fieldtype: 'Currency' fieldtype: 'Currency',
}, },
{ {
fieldname: 'againstAccount', fieldname: 'againstAccount',
label: 'Against Account', label: t`Against Account`,
fieldtype: 'Text' fieldtype: 'Text',
}, },
{ {
fieldname: 'referenceType', fieldname: 'referenceType',
label: 'Ref. Type', label: t`Ref. Type`,
fieldtype: 'Data' fieldtype: 'Data',
}, },
{ {
fieldname: 'referenceName', fieldname: 'referenceName',
label: 'Ref. Name', label: t`Ref. Name`,
fieldtype: 'DynamicLink', fieldtype: 'DynamicLink',
references: 'referenceType' references: 'referenceType',
}, },
{ {
fieldname: 'balance', fieldname: 'balance',
label: 'Balance', label: t`Balance`,
fieldtype: 'Currency' fieldtype: 'Currency',
}, },
{ {
fieldname: 'reverted', fieldname: 'reverted',
label: 'Reverted', label: t`Reverted`,
fieldtype: 'Check', fieldtype: 'Check',
default: 0 default: 0,
} },
], ],
quickEditFields: [ quickEditFields: [
'date', 'date',
@ -78,6 +80,6 @@ export default {
'againstAccount', 'againstAccount',
'referenceType', 'referenceType',
'referenceName', 'referenceName',
'balance' 'balance',
] ],
}; };

View File

@ -1,9 +1,10 @@
import { t } from 'frappe';
import countryInfo from '~/fixtures/countryInfo.json'; import countryInfo from '~/fixtures/countryInfo.json';
const countryList = Object.keys(countryInfo).sort(); const countryList = Object.keys(countryInfo).sort();
export default { export default {
name: 'AccountingSettings', name: 'AccountingSettings',
label: 'Accounting Settings', label: t`Accounting Settings`,
naming: 'name', // {random|autoincrement} naming: 'name', // {random|autoincrement}
isSingle: 1, isSingle: 1,
isChild: 0, isChild: 0,
@ -12,14 +13,14 @@ export default {
keywordFields: [], keywordFields: [],
fields: [ fields: [
{ {
label: 'Company Name', label: t`Company Name`,
fieldname: 'companyName', fieldname: 'companyName',
fieldtype: 'Data', fieldtype: 'Data',
required: 1, required: 1,
}, },
{ {
label: 'Write Off Account', label: t`Write Off Account`,
fieldname: 'writeOffAccount', fieldname: 'writeOffAccount',
fieldtype: 'Link', fieldtype: 'Link',
target: 'Account', target: 'Account',
@ -33,7 +34,7 @@ export default {
}, },
{ {
label: 'Round Off Account', label: t`Round Off Account`,
fieldname: 'roundOffAccount', fieldname: 'roundOffAccount',
fieldtype: 'Link', fieldtype: 'Link',
target: 'Account', target: 'Account',
@ -48,7 +49,7 @@ export default {
{ {
fieldname: 'country', fieldname: 'country',
label: 'Country', label: t`Country`,
fieldtype: 'AutoComplete', fieldtype: 'AutoComplete',
placeholder: 'Select Country', placeholder: 'Select Country',
readOnly: 1, readOnly: 1,
@ -58,7 +59,7 @@ export default {
{ {
fieldname: 'currency', fieldname: 'currency',
label: 'Currency', label: t`Currency`,
fieldtype: 'Data', fieldtype: 'Data',
readOnly: 1, readOnly: 1,
required: 0, required: 0,
@ -66,14 +67,14 @@ export default {
{ {
fieldname: 'fullname', fieldname: 'fullname',
label: 'Name', label: t`Name`,
fieldtype: 'Data', fieldtype: 'Data',
required: 1, required: 1,
}, },
{ {
fieldname: 'email', fieldname: 'email',
label: 'Email', label: t`Email`,
fieldtype: 'Data', fieldtype: 'Data',
required: 1, required: 1,
validate: { validate: {
@ -83,36 +84,36 @@ export default {
{ {
fieldname: 'bankName', fieldname: 'bankName',
label: 'Bank Name', label: t`Bank Name`,
fieldtype: 'Data', fieldtype: 'Data',
required: 1, required: 1,
}, },
{ {
fieldname: 'fiscalYearStart', fieldname: 'fiscalYearStart',
label: 'Fiscal Year Start Date', label: t`Fiscal Year Start Date`,
fieldtype: 'Date', fieldtype: 'Date',
required: 1, required: 1,
}, },
{ {
fieldname: 'fiscalYearEnd', fieldname: 'fiscalYearEnd',
label: 'Fiscal Year End Date', label: t`Fiscal Year End Date`,
fieldtype: 'Date', fieldtype: 'Date',
required: 1, required: 1,
}, },
{ {
fieldname: 'setupComplete', fieldname: 'setupComplete',
label: 'Setup Complete', label: t`Setup Complete`,
fieldtype: 'Check', fieldtype: 'Check',
default: 0, default: 0,
}, },
{ {
fieldname: 'gstin', fieldname: 'gstin',
label: 'GSTIN', label: t`GSTIN`,
fieldtype: 'Data', fieldtype: 'Data',
placeholder: '27AAAAA0000A1Z5' placeholder: '27AAAAA0000A1Z5',
}, },
], ],
quickEditFields: [ quickEditFields: [

View File

@ -1,3 +1,4 @@
import { t } from 'frappe';
import { stateCodeMap } from '../../../accounting/gst'; import { stateCodeMap } from '../../../accounting/gst';
import countryList from '../../../fixtures/countryInfo.json'; import countryList from '../../../fixtures/countryInfo.json';
import { titleCase } from '../../../src/utils'; import { titleCase } from '../../../src/utils';
@ -27,27 +28,27 @@ export default {
fields: [ fields: [
{ {
fieldname: 'addressLine1', fieldname: 'addressLine1',
label: 'Address Line 1', label: t`Address Line 1`,
placeholder: 'Address Line 1', placeholder: 'Address Line 1',
fieldtype: 'Data', fieldtype: 'Data',
required: 1, required: 1,
}, },
{ {
fieldname: 'addressLine2', fieldname: 'addressLine2',
label: 'Address Line 2', label: t`Address Line 2`,
placeholder: 'Address Line 2', placeholder: 'Address Line 2',
fieldtype: 'Data', fieldtype: 'Data',
}, },
{ {
fieldname: 'city', fieldname: 'city',
label: 'City / Town', label: t`City / Town`,
placeholder: 'City / Town', placeholder: 'City / Town',
fieldtype: 'Data', fieldtype: 'Data',
required: 1, required: 1,
}, },
{ {
fieldname: 'state', fieldname: 'state',
label: 'State', label: t`State`,
placeholder: 'State', placeholder: 'State',
fieldtype: 'AutoComplete', fieldtype: 'AutoComplete',
emptyMessage: (doc) => { emptyMessage: (doc) => {
@ -60,7 +61,7 @@ export default {
}, },
{ {
fieldname: 'country', fieldname: 'country',
label: 'Country', label: t`Country`,
placeholder: 'Country', placeholder: 'Country',
fieldtype: 'AutoComplete', fieldtype: 'AutoComplete',
getList: () => Object.keys(countryList).sort(), getList: () => Object.keys(countryList).sort(),
@ -68,31 +69,31 @@ export default {
}, },
{ {
fieldname: 'postalCode', fieldname: 'postalCode',
label: 'Postal Code', label: t`Postal Code`,
placeholder: 'Postal Code', placeholder: 'Postal Code',
fieldtype: 'Data', fieldtype: 'Data',
}, },
{ {
fieldname: 'emailAddress', fieldname: 'emailAddress',
label: 'Email Address', label: t`Email Address`,
placeholder: 'Email Address', placeholder: 'Email Address',
fieldtype: 'Data', fieldtype: 'Data',
}, },
{ {
fieldname: 'phone', fieldname: 'phone',
label: 'Phone', label: t`Phone`,
placeholder: 'Phone', placeholder: 'Phone',
fieldtype: 'Data', fieldtype: 'Data',
}, },
{ {
fieldname: 'fax', fieldname: 'fax',
label: 'Fax', label: t`Fax`,
fieldtype: 'Data', fieldtype: 'Data',
}, },
{ {
fieldname: 'addressDisplay', fieldname: 'addressDisplay',
fieldtype: 'Text', fieldtype: 'Text',
label: 'Address Display', label: t`Address Display`,
readOnly: true, readOnly: true,
formula: (doc) => { formula: (doc) => {
return [ return [

View File

@ -1,3 +1,4 @@
import { t } from 'frappe';
import { cloneDeep } from 'lodash'; import { cloneDeep } from 'lodash';
import { stateCodeMap } from '../../../accounting/gst'; import { stateCodeMap } from '../../../accounting/gst';
import { titleCase } from '../../../src/utils'; import { titleCase } from '../../../src/utils';
@ -15,7 +16,7 @@ export default function getAugmentedAddress({ country }) {
...Address.fields, ...Address.fields,
{ {
fieldname: 'pos', fieldname: 'pos',
label: 'Place of Supply', label: t`Place of Supply`,
fieldtype: 'AutoComplete', fieldtype: 'AutoComplete',
placeholder: 'Place of Supply', placeholder: 'Place of Supply',
formula: (doc) => (stateList.includes(doc.state) ? doc.state : ''), formula: (doc) => (stateList.includes(doc.state) ? doc.state : ''),

View File

@ -1,3 +1,5 @@
import { t } from 'frappe';
export default { export default {
name: 'Color', name: 'Color',
doctype: 'DocType', doctype: 'DocType',
@ -5,12 +7,12 @@ export default {
{ {
fieldname: 'name', fieldname: 'name',
fieldtype: 'Data', fieldtype: 'Data',
label: 'Color' label: t`Color`,
}, },
{ {
fieldname: 'hexvalue', fieldname: 'hexvalue',
fieldtype: 'Data', fieldtype: 'Data',
label: 'Hex Value' label: t`Hex Value`,
} },
] ],
}; };

View File

@ -1,27 +1,27 @@
import { t } from 'frappe';
export default { export default {
"name": "CompanySettings", name: 'CompanySettings',
"label": "Company Settings", label: t`Company Settings`,
"naming": "autoincrement", naming: 'autoincrement',
"isSingle": true, isSingle: true,
"isChild": false, isChild: false,
"keywordFields": [ keywordFields: ['companyName'],
"companyName" fields: [
],
"fields": [
{ {
"fieldname": "companyName", fieldname: 'companyName',
"label": "Company Name", label: t`Company Name`,
"fieldtype": "Data", fieldtype: 'Data',
"disabled": false, disabled: false,
"required": true required: true,
}, },
{ {
"fieldname": "companyAddress", fieldname: 'companyAddress',
"label": "Company Address", label: t`Company Address`,
"fieldtype": "Link", fieldtype: 'Link',
"disabled": false, disabled: false,
"required": true, required: true,
"target": "Address" target: 'Address',
} },
] ],
}; };

View File

@ -1,62 +1,60 @@
import { t } from 'frappe';
export default { export default {
"name": "Contact", name: 'Contact',
"doctype": "DocType", doctype: 'DocType',
"isSingle": 0, isSingle: 0,
"naming": "autoincrement", naming: 'autoincrement',
"pageSettings": { pageSettings: {
"hideTitle": true hideTitle: true,
}, },
"titleField": "fullName", titleField: 'fullName',
"keywordFields": [ keywordFields: ['fullName'],
"fullName" fields: [
],
"fields": [
{ {
"fieldname": "fullName", fieldname: 'fullName',
"label": "Full Name", label: t`Full Name`,
"fieldtype": "Data", fieldtype: 'Data',
"required": 1 required: 1,
}, },
{ {
"fieldname": "emailAddress", fieldname: 'emailAddress',
"label": "Email Address", label: t`Email Address`,
"fieldtype": "Data" fieldtype: 'Data',
}, },
{ {
"fieldname": "userId", fieldname: 'userId',
"label": "User ID", label: t`User ID`,
"fieldtype": "Link", fieldtype: 'Link',
"target": "User", target: 'User',
"hidden": 1 hidden: 1,
}, },
{ {
"fieldname": "status", fieldname: 'status',
"label": "Status", label: t`Status`,
"fieldtype": "Select", fieldtype: 'Select',
"options": ["Passive", "Open", "Replied"] options: ['Passive', 'Open', 'Replied'],
}, },
{ {
"fieldname": "gender", fieldname: 'gender',
"label": "Gender", label: t`Gender`,
"fieldtype": "Select", fieldtype: 'Select',
"options": ["Male", "Female", "Gender"] options: ['Male', 'Female', 'Gender'],
}, },
{ {
"fieldname": "mobileNumber", fieldname: 'mobileNumber',
"label": "Mobile Number", label: t`Mobile Number`,
"fieldtype": "Data" fieldtype: 'Data',
}, },
{ {
"fieldname": "phone", fieldname: 'phone',
"label": "Phone", label: t`Phone`,
"fieldtype": "Data" fieldtype: 'Data',
} },
], ],
events: { events: {
validate: (doc) => { validate: (doc) => {},
}
}, },
listSettings: { listSettings: {
@ -65,16 +63,16 @@ export default {
}, },
getRowHTML(list, data) { getRowHTML(list, data) {
return `<div class="col-11">${list.getNameHTML(data)}</div>`; return `<div class="col-11">${list.getNameHTML(data)}</div>`;
} },
}, },
layout: [ layout: [
// section 1 // section 1
{ {
columns: [ columns: [
{ fields: [ "fullName", "emailAddress", "userId", "status" ] }, { fields: ['fullName', 'emailAddress', 'userId', 'status'] },
{ fields: [ "postalCode", "gender", "phone", "mobileNumber" ] } { fields: ['postalCode', 'gender', 'phone', 'mobileNumber'] },
] ],
} },
] ],
}; };

View File

@ -1,6 +1,8 @@
import { t } from 'frappe';
export default { export default {
name: 'Currency', name: 'Currency',
label: 'Currency', label: t`Currency`,
doctype: 'DocType', doctype: 'DocType',
isSingle: 0, isSingle: 0,
keywordFields: ['name', 'symbol'], keywordFields: ['name', 'symbol'],
@ -8,27 +10,27 @@ export default {
fields: [ fields: [
{ {
fieldname: 'name', fieldname: 'name',
label: 'Currency Name', label: t`Currency Name`,
fieldtype: 'Data', fieldtype: 'Data',
required: 1, required: 1,
}, },
{ {
fieldname: 'fraction', fieldname: 'fraction',
label: 'Fraction', label: t`Fraction`,
fieldtype: 'Data', fieldtype: 'Data',
}, },
{ {
fieldname: 'fractionUnits', fieldname: 'fractionUnits',
label: 'Fraction Units', label: t`Fraction Units`,
fieldtype: 'Int', fieldtype: 'Int',
}, },
{ {
label: 'Smallest Currency Fraction Value', label: t`Smallest Currency Fraction Value`,
fieldname: 'smallestValue', fieldname: 'smallestValue',
fieldtype: 'Currency', fieldtype: 'Currency',
}, },
{ {
label: 'Symbol', label: t`Symbol`,
fieldname: 'symbol', fieldname: 'symbol',
fieldtype: 'Data', fieldtype: 'Data',
}, },

View File

@ -1,4 +1,4 @@
import frappe from 'frappe'; import frappe, { t } from 'frappe';
export default { export default {
name: 'Email', name: 'Email',
@ -12,7 +12,7 @@ export default {
fields: [ fields: [
{ {
fieldname: 'name', fieldname: 'name',
label: 'name', label: t`name`,
fieldtype: 'Data', fieldtype: 'Data',
required: 0, required: 0,
hidden: 1, hidden: 1,
@ -20,7 +20,7 @@ export default {
}, },
{ {
fieldname: 'fromEmailAddress', fieldname: 'fromEmailAddress',
label: 'From', label: t`From`,
fieldtype: 'Data', fieldtype: 'Data',
required: 1, required: 1,
hidden: 0, hidden: 0,
@ -32,7 +32,7 @@ export default {
}, },
{ {
fieldname: 'toEmailAddress', fieldname: 'toEmailAddress',
label: 'To', label: t`To`,
fieldtype: 'Data', fieldtype: 'Data',
required: 1, required: 1,
hidden: 0, hidden: 0,
@ -40,7 +40,7 @@ export default {
}, },
{ {
fieldname: 'date', fieldname: 'date',
label: 'Date', label: t`Date`,
fieldtype: 'Datetime', fieldtype: 'Datetime',
required: 0, required: 0,
hidden: 0, hidden: 0,
@ -48,7 +48,7 @@ export default {
}, },
{ {
fieldname: 'subject', fieldname: 'subject',
label: 'Subject', label: t`Subject`,
fieldtype: 'Data', fieldtype: 'Data',
required: 0, required: 0,
hidden: 0, hidden: 0,
@ -56,7 +56,7 @@ export default {
}, },
{ {
fieldname: 'bodyText', fieldname: 'bodyText',
label: 'Body', label: t`Body`,
fieldtype: 'Text', fieldtype: 'Text',
required: 0, required: 0,
hidden: 0, hidden: 0,
@ -64,7 +64,7 @@ export default {
}, },
{ {
fieldname: 'filePath', fieldname: 'filePath',
label: 'File Path', label: t`File Path`,
fieldtype: 'Text', fieldtype: 'Text',
required: 0, required: 0,
hidden: 1, hidden: 1,

View File

@ -1,8 +1,8 @@
import frappe from 'frappe'; import frappe, { t } from 'frappe';
export default { export default {
name: 'EmailAccount', name: 'EmailAccount',
label: 'Email Account', label: t`Email Account`,
doctype: 'DocType', doctype: 'DocType',
isSingle: true, isSingle: true,
isChild: false, isChild: false,
@ -10,7 +10,7 @@ export default {
fields: [ fields: [
{ {
fieldname: 'email', fieldname: 'email',
label: 'Email', label: t`Email`,
fieldtype: 'Data', fieldtype: 'Data',
required: 1, required: 1,
formula: async () => { formula: async () => {
@ -20,19 +20,19 @@ export default {
}, },
{ {
fieldname: 'password', fieldname: 'password',
label: 'Password', label: t`Password`,
fieldtype: 'Password', fieldtype: 'Password',
required: 1, required: 1,
}, },
{ {
fieldname: 'confirmPassword', fieldname: 'confirmPassword',
label: 'Confirm Password', label: t`Confirm Password`,
fieldtype: 'Password', fieldtype: 'Password',
required: 1, required: 1,
}, },
{ {
fieldname: 'smtpHost', fieldname: 'smtpHost',
label: 'SMTP Host', label: t`SMTP Host`,
fieldtype: 'Select', fieldtype: 'Select',
options: [ options: [
'smtp.gmail.com', 'smtp.gmail.com',
@ -45,7 +45,7 @@ export default {
}, },
{ {
fieldname: 'smtpPort', fieldname: 'smtpPort',
label: 'SMTP Port', label: t`SMTP Port`,
fieldtype: 'Select', fieldtype: 'Select',
options: ['465', '587'], options: ['465', '587'],
default: '465', default: '465',

View File

@ -1,4 +1,4 @@
import { DateTime } from 'luxon'; import { t } from 'frappe';
import EventDocument from './EventDocument'; import EventDocument from './EventDocument';
export default { export default {
@ -10,20 +10,20 @@ export default {
fields: [ fields: [
{ {
fieldname: 'title', fieldname: 'title',
label: 'Title', label: t`Title`,
fieldtype: 'Data' fieldtype: 'Data',
}, },
{ {
fieldname: 'date', fieldname: 'date',
label: 'Date', label: t`Date`,
fieldtype: 'Date' fieldtype: 'Date',
}, },
{ {
fieldname: 'schedule', fieldname: 'schedule',
fieldtype: 'Table', fieldtype: 'Table',
childtype: 'EventSchedule', childtype: 'EventSchedule',
label: 'Schedule' label: t`Schedule`,
} },
], ],
titleField: 'title', titleField: 'title',
keywordFields: [], keywordFields: [],
@ -34,6 +34,6 @@ export default {
}, },
getRowHTML(list, data) { getRowHTML(list, data) {
return `<div class='col-11'>${data.title} on ${data.date}</div>`; return `<div class='col-11'>${data.title} on ${data.date}</div>`;
} },
} },
}; };

View File

@ -1,3 +1,5 @@
import { t } from 'frappe';
export default { export default {
name: 'EventSchedule', name: 'EventSchedule',
doctype: 'DocType', doctype: 'DocType',
@ -5,13 +7,13 @@ export default {
fields: [ fields: [
{ {
fieldname: 'startTime', fieldname: 'startTime',
label: 'Start Time', label: t`Start Time`,
fieldtype: 'Data', fieldtype: 'Data',
}, },
{ {
fieldname: 'title', fieldname: 'title',
label: 'Title', label: t`Title`,
fieldtype: 'Data', fieldtype: 'Data',
}, },
] ],
}; };

View File

@ -1,15 +1,17 @@
import { t } from 'frappe';
export default { export default {
"name": "EventSettings", name: 'EventSettings',
"label": "Event Settings", label: t`Event Settings`,
"doctype": "DocType", doctype: 'DocType',
"isSingle": 1, isSingle: 1,
"isChild": 0, isChild: 0,
"keywordFields": [], keywordFields: [],
"fields": [ fields: [
{ {
fieldname: "enableNotifications", fieldname: 'enableNotifications',
label: "Enable Notifications", label: t`Enable Notifications`,
fieldtype: "Check" fieldtype: 'Check',
} },
] ],
}; };

View File

@ -1,9 +1,10 @@
import { t } from 'frappe';
import model from 'frappe/model'; import model from 'frappe/model';
import Quotation from '../Quotation/Quotation'; import Quotation from '../Quotation/Quotation';
export default model.extend(Quotation, { export default model.extend(Quotation, {
name: 'Fulfillment', name: 'Fulfillment',
label: 'Fulfillment', label: t`Fulfillment`,
settings: 'FulfillmentSettings', settings: 'FulfillmentSettings',
fields: [ fields: [
{ {

View File

@ -1,3 +1,4 @@
import { t } from 'frappe';
import { cloneDeep } from 'lodash'; import { cloneDeep } from 'lodash';
import FulfillmentItemOriginal from './FulfillmentItem'; import FulfillmentItemOriginal from './FulfillmentItem';
@ -12,7 +13,7 @@ export default function getAugmentedFulfillmentItem({ country }) {
...FulfillmentItem.fields, ...FulfillmentItem.fields,
{ {
fieldname: 'hsnCode', fieldname: 'hsnCode',
label: 'HSN/SAC', label: t`HSN/SAC`,
fieldtype: 'Int', fieldtype: 'Int',
formula: (row, doc) => doc.getFrom('Item', row.item, 'hsnCode'), formula: (row, doc) => doc.getFrom('Item', row.item, 'hsnCode'),
formulaDependsOn: ['item'], formulaDependsOn: ['item'],

View File

@ -1,9 +1,10 @@
import { t } from 'frappe';
import model from 'frappe/model'; import model from 'frappe/model';
import QuotationSettings from '../QuotationSettings/QuotationSettings'; import QuotationSettings from '../QuotationSettings/QuotationSettings';
export default model.extend(QuotationSettings, { export default model.extend(QuotationSettings, {
name: 'FulfillmentSettings', name: 'FulfillmentSettings',
label: 'Fulfillment Settings', label: t`Fulfillment Settings`,
fields: [ fields: [
{ {
fieldname: 'numberSeries', fieldname: 'numberSeries',

View File

@ -1,9 +1,9 @@
import frappe from 'frappe'; import frappe, { t } from 'frappe';
import GSTR3B from './GSTR3BDocument.js'; import GSTR3B from './GSTR3BDocument.js';
export default { export default {
name: 'GSTR3B', name: 'GSTR3B',
label: 'GSTR 3B', label: t`GSTR 3B`,
doctype: 'DocType', doctype: 'DocType',
documentClass: GSTR3B, documentClass: GSTR3B,
print: { print: {
@ -13,13 +13,13 @@ export default {
fields: [ fields: [
{ {
fieldname: 'year', fieldname: 'year',
label: 'Year', label: t`Year`,
fieldtype: 'Data', fieldtype: 'Data',
required: 1, required: 1,
}, },
{ {
fieldname: 'month', fieldname: 'month',
label: 'Month', label: t`Month`,
placeholder: 'Month', placeholder: 'Month',
fieldtype: 'Select', fieldtype: 'Select',
options: [ options: [
@ -40,7 +40,7 @@ export default {
}, },
{ {
fieldname: 'jsonData', fieldname: 'jsonData',
label: 'JSON Data', label: t`JSON Data`,
fieldtype: 'Code', fieldtype: 'Code',
formula: (doc) => doc.getJson(), formula: (doc) => doc.getJson(),
required: 1, required: 1,
@ -55,7 +55,7 @@ export default {
], ],
links: [ links: [
{ {
label: 'Print PDF', label: t`Print PDF`,
condition: (form) => !form.doc._notInserted, condition: (form) => !form.doc._notInserted,
action: async (form) => { action: async (form) => {
form.$router.push({ form.$router.push({
@ -64,7 +64,7 @@ export default {
}, },
}, },
{ {
label: 'Delete', label: t`Delete`,
condition: (form) => !form.doc._notInserted, condition: (form) => !form.doc._notInserted,
action: async (form) => { action: async (form) => {
const doc = await frappe.getDoc('GSTR3B', form.doc.name); const doc = await frappe.getDoc('GSTR3B', form.doc.name);

View File

@ -1,65 +1,66 @@
import { t } from 'frappe';
export default { export default {
name: 'GetStarted', name: 'GetStarted',
isSingle: 1, isSingle: 1,
fields: [ fields: [
{ {
fieldname: 'onboardingComplete', fieldname: 'onboardingComplete',
label: 'Onboarding Complete', label: t`Onboarding Complete`,
fieldtype: 'Check', fieldtype: 'Check',
}, },
{ {
fieldname: 'companySetup', fieldname: 'companySetup',
label: 'Company Setup', label: t`Company Setup`,
fieldtype: 'Check', fieldtype: 'Check',
}, },
{ {
fieldname: 'systemSetup', fieldname: 'systemSetup',
label: 'System Setup', label: t`System Setup`,
fieldtype: 'Check', fieldtype: 'Check',
}, },
{ {
fieldname: 'invoiceSetup', fieldname: 'invoiceSetup',
label: 'Invoice Setup', label: t`Invoice Setup`,
fieldtype: 'Check', fieldtype: 'Check',
}, },
{ {
fieldname: 'itemCreated', fieldname: 'itemCreated',
label: 'Item Created', label: t`Item Created`,
fieldtype: 'Check', fieldtype: 'Check',
}, },
{ {
fieldname: 'customerCreated', fieldname: 'customerCreated',
label: 'Customer Created', label: t`Customer Created`,
fieldtype: 'Check', fieldtype: 'Check',
}, },
{ {
fieldname: 'supplierCreated', fieldname: 'supplierCreated',
label: 'Supplier Created', label: t`Supplier Created`,
fieldtype: 'Check', fieldtype: 'Check',
}, },
{ {
fieldname: 'invoiceCreated', fieldname: 'invoiceCreated',
label: 'Invoice Created', label: t`Invoice Created`,
fieldtype: 'Check', fieldtype: 'Check',
}, },
{ {
fieldname: 'billCreated', fieldname: 'billCreated',
label: 'Bill Created', label: t`Bill Created`,
fieldtype: 'Check', fieldtype: 'Check',
}, },
{ {
fieldname: 'chartOfAccountsReviewed', fieldname: 'chartOfAccountsReviewed',
label: 'Chart Of Accounts Reviewed', label: t`Chart Of Accounts Reviewed`,
fieldtype: 'Check', fieldtype: 'Check',
}, },
{ {
fieldname: 'openingBalanceChecked', fieldname: 'openingBalanceChecked',
label: 'Opening Balances', label: t`Opening Balances`,
fieldtype: 'Check', fieldtype: 'Check',
}, },
{ {
fieldname: 'taxesAdded', fieldname: 'taxesAdded',
label: 'Add Taxes', label: t`Add Taxes`,
fieldtype: 'Check', fieldtype: 'Check',
}, },
], ],

View File

@ -9,25 +9,25 @@ export default {
fields: [ fields: [
{ {
fieldname: 'name', fieldname: 'name',
label: 'Item Name', label: t`Item Name`,
fieldtype: 'Data', fieldtype: 'Data',
placeholder: 'Item Name', placeholder: 'Item Name',
required: 1, required: 1,
}, },
{ {
fieldname: 'image', fieldname: 'image',
label: 'Image', label: t`Image`,
fieldtype: 'AttachImage', fieldtype: 'AttachImage',
}, },
{ {
fieldname: 'description', fieldname: 'description',
label: 'Description', label: t`Description`,
placeholder: 'Item Description', placeholder: 'Item Description',
fieldtype: 'Text', fieldtype: 'Text',
}, },
{ {
fieldname: 'unit', fieldname: 'unit',
label: 'Unit Type', label: t`Unit Type`,
fieldtype: 'Select', fieldtype: 'Select',
placeholder: 'Unit Type', placeholder: 'Unit Type',
default: 'Unit', default: 'Unit',
@ -35,7 +35,7 @@ export default {
}, },
{ {
fieldname: 'itemType', fieldname: 'itemType',
label: 'Type', label: t`Type`,
placeholder: 'Type', placeholder: 'Type',
fieldtype: 'Select', fieldtype: 'Select',
default: 'Product', default: 'Product',
@ -43,7 +43,7 @@ export default {
}, },
{ {
fieldname: 'incomeAccount', fieldname: 'incomeAccount',
label: 'Income', label: t`Income`,
fieldtype: 'Link', fieldtype: 'Link',
target: 'Account', target: 'Account',
placeholder: 'Income', placeholder: 'Income',
@ -68,7 +68,7 @@ export default {
}, },
{ {
fieldname: 'expenseAccount', fieldname: 'expenseAccount',
label: 'Expense', label: t`Expense`,
fieldtype: 'Link', fieldtype: 'Link',
target: 'Account', target: 'Account',
placeholder: 'Expense', placeholder: 'Expense',
@ -94,14 +94,14 @@ export default {
}, },
{ {
fieldname: 'tax', fieldname: 'tax',
label: 'Tax', label: t`Tax`,
fieldtype: 'Link', fieldtype: 'Link',
target: 'Tax', target: 'Tax',
placeholder: 'Tax', placeholder: 'Tax',
}, },
{ {
fieldname: 'rate', fieldname: 'rate',
label: 'Rate', label: t`Rate`,
fieldtype: 'Currency', fieldtype: 'Currency',
validate(value) { validate(value) {
if (value.lte(0)) { if (value.lte(0)) {

View File

@ -1,3 +1,4 @@
import { t } from 'frappe';
import { cloneDeep } from 'lodash'; import { cloneDeep } from 'lodash';
import ItemOriginal from './Item'; import ItemOriginal from './Item';
@ -8,13 +9,13 @@ export default function getAugmentedItem({ country }) {
} }
if (country === 'India') { if (country === 'India') {
const nameFieldIndex = Item.fields.findIndex(i => i.fieldname === 'name'); const nameFieldIndex = Item.fields.findIndex((i) => i.fieldname === 'name');
Item.fields = [ Item.fields = [
...Item.fields.slice(0, nameFieldIndex + 1), ...Item.fields.slice(0, nameFieldIndex + 1),
{ {
fieldname: 'hsnCode', fieldname: 'hsnCode',
label: 'HSN/SAC', label: t`HSN/SAC`,
fieldtype: 'Int', fieldtype: 'Int',
placeholder: 'HSN/SAC Code', placeholder: 'HSN/SAC Code',
}, },

View File

@ -1,8 +1,9 @@
import { ledgerLink } from '../../../accounting/utils'; import { t } from 'frappe';
import { DateTime } from 'luxon'; import { DateTime } from 'luxon';
import { ledgerLink } from '../../../accounting/utils';
export default { export default {
label: 'Journal Entry', label: t`Journal Entry`,
name: 'JournalEntry', name: 'JournalEntry',
doctype: 'DocType', doctype: 'DocType',
isSubmittable: 1, isSubmittable: 1,
@ -10,7 +11,7 @@ export default {
fields: [ fields: [
{ {
fieldname: 'entryType', fieldname: 'entryType',
label: 'Entry Type', label: t`Entry Type`,
fieldtype: 'Select', fieldtype: 'Select',
placeholder: 'Entry Type', placeholder: 'Entry Type',
options: [ options: [
@ -30,36 +31,36 @@ export default {
}, },
{ {
fieldname: 'date', fieldname: 'date',
label: 'Date', label: t`Date`,
fieldtype: 'Date', fieldtype: 'Date',
default: () => DateTime.local().toISODate(), default: () => DateTime.local().toISODate(),
}, },
{ {
fieldname: 'accounts', fieldname: 'accounts',
label: 'Account Entries', label: t`Account Entries`,
fieldtype: 'Table', fieldtype: 'Table',
childtype: 'JournalEntryAccount', childtype: 'JournalEntryAccount',
required: true, required: true,
}, },
{ {
fieldname: 'referenceNumber', fieldname: 'referenceNumber',
label: 'Reference Number', label: t`Reference Number`,
fieldtype: 'Data', fieldtype: 'Data',
}, },
{ {
fieldname: 'referenceDate', fieldname: 'referenceDate',
label: 'Reference Date', label: t`Reference Date`,
fieldtype: 'Date', fieldtype: 'Date',
}, },
{ {
fieldname: 'userRemark', fieldname: 'userRemark',
label: 'User Remark', label: t`User Remark`,
fieldtype: 'Text', fieldtype: 'Text',
placeholder: 'User Remark', placeholder: 'User Remark',
}, },
{ {
fieldname: 'cancelled', fieldname: 'cancelled',
label: 'Cancelled', label: t`Cancelled`,
fieldtype: 'Check', fieldtype: 'Check',
default: 0, default: 0,
}, },

View File

@ -8,7 +8,7 @@ export default {
columns: [ columns: [
'date', 'date',
{ {
label: 'Status', label: t`Status`,
fieldtype: 'Select', fieldtype: 'Select',
size: 'small', size: 'small',
render(doc) { render(doc) {
@ -31,7 +31,7 @@ export default {
}, },
}, },
{ {
label: 'Entry ID', label: t`Entry ID`,
fieldname: 'name', fieldname: 'name',
fieldtype: 'Data', fieldtype: 'Data',
getValue(doc) { getValue(doc) {

View File

@ -1,10 +1,11 @@
import { t } from 'frappe';
export default { export default {
name: 'JournalEntryAccount', name: 'JournalEntryAccount',
isChild: 1, isChild: 1,
fields: [ fields: [
{ {
fieldname: 'account', fieldname: 'account',
label: 'Account', label: t`Account`,
placeholder: 'Account', placeholder: 'Account',
fieldtype: 'Link', fieldtype: 'Link',
target: 'Account', target: 'Account',
@ -14,13 +15,13 @@ export default {
}, },
{ {
fieldname: 'debit', fieldname: 'debit',
label: 'Debit', label: t`Debit`,
fieldtype: 'Currency', fieldtype: 'Currency',
formula: autoDebitCredit('debit'), formula: autoDebitCredit('debit'),
}, },
{ {
fieldname: 'credit', fieldname: 'credit',
label: 'Credit', label: t`Credit`,
fieldtype: 'Currency', fieldtype: 'Currency',
formula: autoDebitCredit('credit'), formula: autoDebitCredit('credit'),
}, },

View File

@ -1,6 +1,7 @@
import { t } from 'frappe';
export default { export default {
name: 'JournalEntrySettings', name: 'JournalEntrySettings',
label: 'Journal Entry Setting', label: t`Journal Entry Setting`,
doctype: 'DocType', doctype: 'DocType',
isSingle: 1, isSingle: 1,
isChild: 0, isChild: 0,
@ -8,11 +9,11 @@ export default {
fields: [ fields: [
{ {
fieldname: 'numberSeries', fieldname: 'numberSeries',
label: 'Number Series', label: t`Number Series`,
fieldtype: 'Link', fieldtype: 'Link',
target: 'NumberSeries', target: 'NumberSeries',
required: 1, required: 1,
default: 'JV' default: 'JV',
} },
] ],
}; };

View File

@ -5,7 +5,7 @@ import PartyWidget from './PartyWidget.vue';
export default { export default {
name: 'Customer', name: 'Customer',
label: 'Customer', label: t`Customer`,
basedOn: 'Party', basedOn: 'Party',
filters: { filters: {
customer: 1, customer: 1,

View File

@ -2,35 +2,35 @@ import frappe, { t } from 'frappe';
export default { export default {
name: 'Party', name: 'Party',
label: 'Party', label: t`Party`,
regional: 1, regional: 1,
keywordFields: ['name'], keywordFields: ['name'],
fields: [ fields: [
{ {
fieldname: 'name', fieldname: 'name',
label: 'Name', label: t`Name`,
fieldtype: 'Data', fieldtype: 'Data',
required: 1, required: 1,
placeholder: 'Full Name', placeholder: 'Full Name',
}, },
{ {
fieldname: 'image', fieldname: 'image',
label: 'Image', label: t`Image`,
fieldtype: 'AttachImage', fieldtype: 'AttachImage',
}, },
{ {
fieldname: 'customer', fieldname: 'customer',
label: 'Is Customer', label: t`Is Customer`,
fieldtype: 'Check', fieldtype: 'Check',
}, },
{ {
fieldname: 'supplier', fieldname: 'supplier',
label: 'Is Supplier', label: t`Is Supplier`,
fieldtype: 'Check', fieldtype: 'Check',
}, },
{ {
fieldname: 'defaultAccount', fieldname: 'defaultAccount',
label: 'Default Account', label: t`Default Account`,
fieldtype: 'Link', fieldtype: 'Link',
target: 'Account', target: 'Account',
getFilters: (query, doc) => { getFilters: (query, doc) => {
@ -51,12 +51,12 @@ export default {
}, },
{ {
fieldname: 'outstandingAmount', fieldname: 'outstandingAmount',
label: 'Outstanding Amount', label: t`Outstanding Amount`,
fieldtype: 'Currency', fieldtype: 'Currency',
}, },
{ {
fieldname: 'currency', fieldname: 'currency',
label: 'Currency', label: t`Currency`,
fieldtype: 'Link', fieldtype: 'Link',
target: 'Currency', target: 'Currency',
placeholder: 'INR', placeholder: 'INR',
@ -64,7 +64,7 @@ export default {
}, },
{ {
fieldname: 'email', fieldname: 'email',
label: 'Email', label: t`Email`,
fieldtype: 'Data', fieldtype: 'Data',
placeholder: 'john@doe.com', placeholder: 'john@doe.com',
validate: { validate: {
@ -73,7 +73,7 @@ export default {
}, },
{ {
fieldname: 'phone', fieldname: 'phone',
label: 'Phone', label: t`Phone`,
fieldtype: 'Data', fieldtype: 'Data',
placeholder: 'Phone', placeholder: 'Phone',
validate: { validate: {
@ -82,7 +82,7 @@ export default {
}, },
{ {
fieldname: 'address', fieldname: 'address',
label: 'Address', label: t`Address`,
fieldtype: 'Link', fieldtype: 'Link',
target: 'Address', target: 'Address',
placeholder: t`Click to create`, placeholder: t`Click to create`,
@ -90,7 +90,7 @@ export default {
}, },
{ {
fieldname: 'addressDisplay', fieldname: 'addressDisplay',
label: 'Address Display', label: t`Address Display`,
fieldtype: 'Text', fieldtype: 'Text',
readOnly: true, readOnly: true,
formula: (doc) => { formula: (doc) => {

View File

@ -1,3 +1,4 @@
import { t } from 'frappe';
import { cloneDeep } from 'lodash'; import { cloneDeep } from 'lodash';
import PartyOriginal from './Party'; import PartyOriginal from './Party';
@ -15,13 +16,13 @@ export default function getAugmentedParty({ country }) {
0, 0,
{ {
fieldname: 'gstin', fieldname: 'gstin',
label: 'GSTIN No.', label: t`GSTIN No.`,
fieldtype: 'Data', fieldtype: 'Data',
hidden: (doc) => (doc.gstType === 'Registered Regular' ? 0 : 1), hidden: (doc) => (doc.gstType === 'Registered Regular' ? 0 : 1),
}, },
{ {
fieldname: 'gstType', fieldname: 'gstType',
label: 'GST Registration', label: t`GST Registration`,
placeholder: 'GST Registration', placeholder: 'GST Registration',
fieldtype: 'Select', fieldtype: 'Select',
default: gstTypes[0], default: gstTypes[0],
@ -33,7 +34,7 @@ export default function getAugmentedParty({ country }) {
} else { } else {
Party.fields.splice(3, 0, { Party.fields.splice(3, 0, {
fieldname: 'taxId', fieldname: 'taxId',
label: 'Tax ID', label: t`Tax ID`,
fieldtype: 'Data', fieldtype: 'Data',
}); });
Party.quickEditFields.push('taxId'); Party.quickEditFields.push('taxId');

View File

@ -5,7 +5,7 @@ import PartyWidget from './PartyWidget.vue';
export default { export default {
name: 'Supplier', name: 'Supplier',
label: 'Supplier', label: t`Supplier`,
basedOn: 'Party', basedOn: 'Party',
filters: { filters: {
supplier: 1, supplier: 1,

View File

@ -1,9 +1,9 @@
import frappe from 'frappe'; import frappe, { t } from 'frappe';
import utils from '../../../accounting/utils'; import utils from '../../../accounting/utils';
export default { export default {
name: 'Payment', name: 'Payment',
label: 'Payment', label: t`Payment`,
isSingle: 0, isSingle: 0,
isChild: 0, isChild: 0,
isSubmittable: 1, isSubmittable: 1,
@ -12,20 +12,20 @@ export default {
fields: [ fields: [
{ {
fieldname: 'party', fieldname: 'party',
label: 'Party', label: t`Party`,
fieldtype: 'Link', fieldtype: 'Link',
target: 'Party', target: 'Party',
required: 1, required: 1,
}, },
{ {
fieldname: 'date', fieldname: 'date',
label: 'Posting Date', label: t`Posting Date`,
fieldtype: 'Date', fieldtype: 'Date',
default: () => new Date().toISOString(), default: () => new Date().toISOString(),
}, },
{ {
fieldname: 'account', fieldname: 'account',
label: 'From Account', label: t`From Account`,
fieldtype: 'Link', fieldtype: 'Link',
target: 'Account', target: 'Account',
required: 1, required: 1,
@ -46,7 +46,7 @@ export default {
}, },
{ {
fieldname: 'paymentType', fieldname: 'paymentType',
label: 'Payment Type', label: t`Payment Type`,
fieldtype: 'Select', fieldtype: 'Select',
placeholder: 'Payment Type', placeholder: 'Payment Type',
options: ['Receive', 'Pay'], options: ['Receive', 'Pay'],
@ -54,7 +54,7 @@ export default {
}, },
{ {
fieldname: 'paymentAccount', fieldname: 'paymentAccount',
label: 'To Account', label: t`To Account`,
placeholder: 'To Account', placeholder: 'To Account',
fieldtype: 'Link', fieldtype: 'Link',
target: 'Account', target: 'Account',
@ -76,7 +76,7 @@ export default {
}, },
{ {
fieldname: 'paymentMethod', fieldname: 'paymentMethod',
label: 'Payment Method', label: t`Payment Method`,
placeholder: 'Payment Method', placeholder: 'Payment Method',
fieldtype: 'Select', fieldtype: 'Select',
options: ['Cash', 'Cheque', 'Transfer'], options: ['Cash', 'Cheque', 'Transfer'],
@ -85,7 +85,7 @@ export default {
}, },
{ {
fieldname: 'referenceId', fieldname: 'referenceId',
label: 'Ref. / Cheque No.', label: t`Ref. / Cheque No.`,
placeholder: 'Ref. / Cheque No.', placeholder: 'Ref. / Cheque No.',
fieldtype: 'Data', fieldtype: 'Data',
required: (doc) => doc.paymentMethod !== 'Cash', // TODO: UNIQUE required: (doc) => doc.paymentMethod !== 'Cash', // TODO: UNIQUE
@ -93,20 +93,20 @@ export default {
}, },
{ {
fieldname: 'referenceDate', fieldname: 'referenceDate',
label: 'Ref. Date', label: t`Ref. Date`,
placeholder: 'Ref. Date', placeholder: 'Ref. Date',
fieldtype: 'Date', fieldtype: 'Date',
}, },
{ {
fieldname: 'clearanceDate', fieldname: 'clearanceDate',
label: 'Clearance Date', label: t`Clearance Date`,
placeholder: 'Clearance Date', placeholder: 'Clearance Date',
fieldtype: 'Date', fieldtype: 'Date',
hidden: (doc) => doc.paymentMethod === 'Cash', hidden: (doc) => doc.paymentMethod === 'Cash',
}, },
{ {
fieldname: 'amount', fieldname: 'amount',
label: 'Amount', label: t`Amount`,
fieldtype: 'Currency', fieldtype: 'Currency',
required: 1, required: 1,
formula: (doc) => doc.getSum('for', 'amount', false), formula: (doc) => doc.getSum('for', 'amount', false),
@ -135,19 +135,19 @@ export default {
}, },
{ {
fieldname: 'writeoff', fieldname: 'writeoff',
label: 'Write Off / Refund', label: t`Write Off / Refund`,
fieldtype: 'Currency', fieldtype: 'Currency',
}, },
{ {
fieldname: 'for', fieldname: 'for',
label: 'Payment Reference', label: t`Payment Reference`,
fieldtype: 'Table', fieldtype: 'Table',
childtype: 'PaymentFor', childtype: 'PaymentFor',
required: 0, required: 0,
}, },
{ {
fieldname: 'cancelled', fieldname: 'cancelled',
label: 'Cancelled', label: t`Cancelled`,
fieldtype: 'Check', fieldtype: 'Check',
default: 0, default: 0,
}, },

View File

@ -7,7 +7,7 @@ export default {
columns: [ columns: [
'party', 'party',
{ {
label: 'Status', label: t`Status`,
fieldname: 'status', fieldname: 'status',
fieldtype: 'Select', fieldtype: 'Select',
size: 'small', size: 'small',

View File

@ -7,7 +7,7 @@ const referenceTypeMap = {
export default { export default {
name: 'PaymentFor', name: 'PaymentFor',
label: 'Payment For', label: t`Payment For`,
isSingle: 0, isSingle: 0,
isChild: 1, isChild: 1,
keywordFields: [], keywordFields: [],
@ -15,7 +15,7 @@ export default {
fields: [ fields: [
{ {
fieldname: 'referenceType', fieldname: 'referenceType',
label: 'Reference Type', label: t`Reference Type`,
placeholder: 'Type', placeholder: 'Type',
fieldtype: 'Select', fieldtype: 'Select',
options: Object.keys(referenceTypeMap), options: Object.keys(referenceTypeMap),
@ -24,7 +24,7 @@ export default {
}, },
{ {
fieldname: 'referenceName', fieldname: 'referenceName',
label: 'Reference Name', label: t`Reference Name`,
fieldtype: 'DynamicLink', fieldtype: 'DynamicLink',
references: 'referenceType', references: 'referenceType',
placeholder: 'Name', placeholder: 'Name',
@ -37,7 +37,7 @@ export default {
}, },
{ {
fieldname: 'amount', fieldname: 'amount',
label: 'Amount', label: t`Amount`,
fieldtype: 'Currency', fieldtype: 'Currency',
formula: (row, doc) => { formula: (row, doc) => {
return ( return (

View File

@ -1,17 +1,19 @@
import { t } from 'frappe';
export default { export default {
name: "PaymentSettings", name: 'PaymentSettings',
label: "Payment Settings", label: t`Payment Settings`,
isSingle: 1, isSingle: 1,
isChild: 0, isChild: 0,
keywordFields: [], keywordFields: [],
"fields": [ fields: [
{ {
"fieldname": "numberSeries", fieldname: 'numberSeries',
"label": "Number Series", label: t`Number Series`,
"fieldtype": "Link", fieldtype: 'Link',
"target": "NumberSeries", target: 'NumberSeries',
"required": 1, required: 1,
"default": "PAY" default: 'PAY',
} },
] ],
}; };

View File

@ -1,23 +1,24 @@
import theme from '@/theme'; import theme from '@/theme';
import { t } from 'frappe';
export default { export default {
name: 'PrintSettings', name: 'PrintSettings',
label: 'Print Settings', label: t`Print Settings`,
isSingle: 1, isSingle: 1,
fields: [ fields: [
{ {
fieldname: 'logo', fieldname: 'logo',
label: 'Logo', label: t`Logo`,
fieldtype: 'AttachImage', fieldtype: 'AttachImage',
}, },
{ {
fieldname: 'companyName', fieldname: 'companyName',
label: 'Company Name', label: t`Company Name`,
fieldtype: 'Data', fieldtype: 'Data',
}, },
{ {
fieldname: 'email', fieldname: 'email',
label: 'Email', label: t`Email`,
fieldtype: 'Data', fieldtype: 'Data',
placeholder: 'john@doe.com', placeholder: 'john@doe.com',
validate: { validate: {
@ -26,12 +27,12 @@ export default {
}, },
{ {
fieldname: 'displayLogo', fieldname: 'displayLogo',
label: 'Display Logo in Invoice', label: t`Display Logo in Invoice`,
fieldtype: 'Check', fieldtype: 'Check',
}, },
{ {
fieldname: 'phone', fieldname: 'phone',
label: 'Phone', label: t`Phone`,
fieldtype: 'Data', fieldtype: 'Data',
placeholder: '9888900000', placeholder: '9888900000',
validate: { validate: {
@ -40,7 +41,7 @@ export default {
}, },
{ {
fieldname: 'address', fieldname: 'address',
label: 'Address', label: t`Address`,
fieldtype: 'Link', fieldtype: 'Link',
target: 'Address', target: 'Address',
placeholder: 'Click to create', placeholder: 'Click to create',
@ -48,7 +49,7 @@ export default {
}, },
{ {
fieldname: 'template', fieldname: 'template',
label: 'Template', label: t`Template`,
placeholder: 'Template', placeholder: 'Template',
fieldtype: 'Select', fieldtype: 'Select',
options: ['Basic', 'Minimal', 'Business'], options: ['Basic', 'Minimal', 'Business'],
@ -56,7 +57,7 @@ export default {
}, },
{ {
fieldname: 'color', fieldname: 'color',
label: 'Color', label: t`Color`,
placeholder: 'Select Color', placeholder: 'Select Color',
fieldtype: 'Color', fieldtype: 'Color',
colors: [ colors: [
@ -78,13 +79,13 @@ export default {
}; };
}) })
.concat({ .concat({
label: 'Black', label: t`Black`,
value: theme.colors['black'], value: theme.colors['black'],
}), }),
}, },
{ {
fieldname: 'font', fieldname: 'font',
label: 'Font', label: t`Font`,
placeholder: 'Font', placeholder: 'Font',
fieldtype: 'Select', fieldtype: 'Select',
options: ['Inter', 'Times New Roman', 'Arial', 'Courier'], options: ['Inter', 'Times New Roman', 'Arial', 'Courier'],

View File

@ -1,3 +1,4 @@
import { t } from 'frappe';
import InvoiceTemplate from '../SalesInvoice/InvoiceTemplate.vue'; import InvoiceTemplate from '../SalesInvoice/InvoiceTemplate.vue';
import { getActions } from '../Transaction/Transaction'; import { getActions } from '../Transaction/Transaction';
import PurchaseInvoice from './PurchaseInvoiceDocument'; import PurchaseInvoice from './PurchaseInvoiceDocument';
@ -5,7 +6,7 @@ import PurchaseInvoice from './PurchaseInvoiceDocument';
export default { export default {
name: 'PurchaseInvoice', name: 'PurchaseInvoice',
doctype: 'DocType', doctype: 'DocType',
label: 'Bill', label: t`Bill`,
documentClass: PurchaseInvoice, documentClass: PurchaseInvoice,
printTemplate: InvoiceTemplate, printTemplate: InvoiceTemplate,
isSingle: 0, isSingle: 0,
@ -16,7 +17,7 @@ export default {
showTitle: true, showTitle: true,
fields: [ fields: [
{ {
label: 'Bill No', label: t`Bill No`,
fieldname: 'name', fieldname: 'name',
fieldtype: 'Data', fieldtype: 'Data',
required: 1, required: 1,
@ -24,20 +25,20 @@ export default {
}, },
{ {
fieldname: 'date', fieldname: 'date',
label: 'Date', label: t`Date`,
fieldtype: 'Date', fieldtype: 'Date',
default: () => new Date().toISOString().slice(0, 10), default: () => new Date().toISOString().slice(0, 10),
}, },
{ {
fieldname: 'supplier', fieldname: 'supplier',
label: 'Supplier', label: t`Supplier`,
fieldtype: 'Link', fieldtype: 'Link',
target: 'Supplier', target: 'Supplier',
required: 1, required: 1,
}, },
{ {
fieldname: 'account', fieldname: 'account',
label: 'Account', label: t`Account`,
fieldtype: 'Link', fieldtype: 'Link',
target: 'Account', target: 'Account',
formula: (doc) => doc.getFrom('Party', doc.supplier, 'defaultAccount'), formula: (doc) => doc.getFrom('Party', doc.supplier, 'defaultAccount'),
@ -50,7 +51,7 @@ export default {
}, },
{ {
fieldname: 'currency', fieldname: 'currency',
label: 'Supplier Currency', label: t`Supplier Currency`,
fieldtype: 'Link', fieldtype: 'Link',
target: 'Currency', target: 'Currency',
hidden: 1, hidden: 1,
@ -61,7 +62,7 @@ export default {
}, },
{ {
fieldname: 'exchangeRate', fieldname: 'exchangeRate',
label: 'Exchange Rate', label: t`Exchange Rate`,
fieldtype: 'Float', fieldtype: 'Float',
default: 1, default: 1,
formula: async (doc) => await doc.getExchangeRate(), formula: async (doc) => await doc.getExchangeRate(),
@ -69,14 +70,14 @@ export default {
}, },
{ {
fieldname: 'items', fieldname: 'items',
label: 'Items', label: t`Items`,
fieldtype: 'Table', fieldtype: 'Table',
childtype: 'PurchaseInvoiceItem', childtype: 'PurchaseInvoiceItem',
required: true, required: true,
}, },
{ {
fieldname: 'netTotal', fieldname: 'netTotal',
label: 'Net Total', label: t`Net Total`,
fieldtype: 'Currency', fieldtype: 'Currency',
formula: (doc) => doc.getSum('items', 'amount', false), formula: (doc) => doc.getSum('items', 'amount', false),
readOnly: 1, readOnly: 1,
@ -84,14 +85,14 @@ export default {
}, },
{ {
fieldname: 'baseNetTotal', fieldname: 'baseNetTotal',
label: 'Net Total (Company Currency)', label: t`Net Total (Company Currency)`,
fieldtype: 'Currency', fieldtype: 'Currency',
formula: (doc) => doc.netTotal.mul(doc.exchangeRate), formula: (doc) => doc.netTotal.mul(doc.exchangeRate),
readOnly: 1, readOnly: 1,
}, },
{ {
fieldname: 'taxes', fieldname: 'taxes',
label: 'Taxes', label: t`Taxes`,
fieldtype: 'Table', fieldtype: 'Table',
childtype: 'TaxSummary', childtype: 'TaxSummary',
formula: (doc) => doc.getTaxSummary(), formula: (doc) => doc.getTaxSummary(),
@ -99,7 +100,7 @@ export default {
}, },
{ {
fieldname: 'grandTotal', fieldname: 'grandTotal',
label: 'Grand Total', label: t`Grand Total`,
fieldtype: 'Currency', fieldtype: 'Currency',
formula: (doc) => doc.getGrandTotal(), formula: (doc) => doc.getGrandTotal(),
readOnly: 1, readOnly: 1,
@ -107,14 +108,14 @@ export default {
}, },
{ {
fieldname: 'baseGrandTotal', fieldname: 'baseGrandTotal',
label: 'Grand Total (Company Currency)', label: t`Grand Total (Company Currency)`,
fieldtype: 'Currency', fieldtype: 'Currency',
formula: (doc) => doc.grandTotal.mul(doc.exchangeRate), formula: (doc) => doc.grandTotal.mul(doc.exchangeRate),
readOnly: 1, readOnly: 1,
}, },
{ {
fieldname: 'outstandingAmount', fieldname: 'outstandingAmount',
label: 'Outstanding Amount', label: t`Outstanding Amount`,
fieldtype: 'Currency', fieldtype: 'Currency',
formula: (doc) => { formula: (doc) => {
if (doc.submitted) return; if (doc.submitted) return;
@ -124,12 +125,12 @@ export default {
}, },
{ {
fieldname: 'terms', fieldname: 'terms',
label: 'Terms', label: t`Terms`,
fieldtype: 'Text', fieldtype: 'Text',
}, },
{ {
fieldname: 'cancelled', fieldname: 'cancelled',
label: 'Cancelled', label: t`Cancelled`,
fieldtype: 'Check', fieldtype: 'Check',
default: 0, default: 0,
}, },

View File

@ -1,3 +1,4 @@
import { t } from 'frappe';
export default { export default {
name: 'PurchaseInvoiceItem', name: 'PurchaseInvoiceItem',
doctype: 'DocType', doctype: 'DocType',
@ -7,7 +8,7 @@ export default {
fields: [ fields: [
{ {
fieldname: 'item', fieldname: 'item',
label: 'Item', label: t`Item`,
fieldtype: 'Link', fieldtype: 'Link',
target: 'Item', target: 'Item',
required: 1, required: 1,
@ -22,21 +23,21 @@ export default {
}, },
{ {
fieldname: 'description', fieldname: 'description',
label: 'Description', label: t`Description`,
fieldtype: 'Text', fieldtype: 'Text',
formula: (row, doc) => doc.getFrom('Item', row.item, 'description'), formula: (row, doc) => doc.getFrom('Item', row.item, 'description'),
hidden: 1, hidden: 1,
}, },
{ {
fieldname: 'quantity', fieldname: 'quantity',
label: 'Quantity', label: t`Quantity`,
fieldtype: 'Float', fieldtype: 'Float',
required: 1, required: 1,
default: 1, default: 1,
}, },
{ {
fieldname: 'rate', fieldname: 'rate',
label: 'Rate', label: t`Rate`,
fieldtype: 'Currency', fieldtype: 'Currency',
required: 1, required: 1,
formula: async (row, doc) => { formula: async (row, doc) => {
@ -48,14 +49,14 @@ export default {
}, },
{ {
fieldname: 'baseRate', fieldname: 'baseRate',
label: 'Rate (Company Currency)', label: t`Rate (Company Currency)`,
fieldtype: 'Currency', fieldtype: 'Currency',
formula: (row, doc) => row.rate.mul(doc.exchangeRate), formula: (row, doc) => row.rate.mul(doc.exchangeRate),
readOnly: 1, readOnly: 1,
}, },
{ {
fieldname: 'account', fieldname: 'account',
label: 'Account', label: t`Account`,
fieldtype: 'Link', fieldtype: 'Link',
target: 'Account', target: 'Account',
required: 1, required: 1,
@ -63,7 +64,7 @@ export default {
}, },
{ {
fieldname: 'tax', fieldname: 'tax',
label: 'Tax', label: t`Tax`,
fieldtype: 'Link', fieldtype: 'Link',
target: 'Tax', target: 'Tax',
formula: (row, doc) => { formula: (row, doc) => {
@ -73,7 +74,7 @@ export default {
}, },
{ {
fieldname: 'amount', fieldname: 'amount',
label: 'Amount', label: t`Amount`,
fieldtype: 'Currency', fieldtype: 'Currency',
readOnly: 1, readOnly: 1,
formula: (row) => row.rate.mul(row.quantity), formula: (row) => row.rate.mul(row.quantity),
@ -81,7 +82,7 @@ export default {
}, },
{ {
fieldname: 'baseAmount', fieldname: 'baseAmount',
label: 'Amount (Company Currency)', label: t`Amount (Company Currency)`,
fieldtype: 'Currency', fieldtype: 'Currency',
readOnly: 1, readOnly: 1,
formula: (row, doc) => row.amount.mul(doc.exchangeRate), formula: (row, doc) => row.amount.mul(doc.exchangeRate),

View File

@ -1,3 +1,4 @@
import { t } from 'frappe';
import { cloneDeep } from 'lodash'; import { cloneDeep } from 'lodash';
import PurchaseInvoiceItemOriginal from './PurchaseInvoiceItem'; import PurchaseInvoiceItemOriginal from './PurchaseInvoiceItem';
@ -12,7 +13,7 @@ export default function getAugmentedPurchaseInvoiceItem({ country }) {
...PurchaseInvoiceItem.fields, ...PurchaseInvoiceItem.fields,
{ {
fieldname: 'hsnCode', fieldname: 'hsnCode',
label: 'HSN/SAC', label: t`HSN/SAC`,
fieldtype: 'Int', fieldtype: 'Int',
formula: (row, doc) => doc.getFrom('Item', row.item, 'hsnCode'), formula: (row, doc) => doc.getFrom('Item', row.item, 'hsnCode'),
formulaDependsOn: ['item'], formulaDependsOn: ['item'],

View File

@ -1,6 +1,7 @@
import { t } from 'frappe';
export default { export default {
name: 'PurchaseInvoiceSettings', name: 'PurchaseInvoiceSettings',
label: 'Bills Settings', label: t`Bills Settings`,
doctype: 'DocType', doctype: 'DocType',
isSingle: 1, isSingle: 1,
isChild: 0, isChild: 0,
@ -8,7 +9,7 @@ export default {
fields: [ fields: [
{ {
fieldname: 'numberSeries', fieldname: 'numberSeries',
label: 'Number Series', label: t`Number Series`,
fieldtype: 'Link', fieldtype: 'Link',
target: 'NumberSeries', target: 'NumberSeries',
required: 1, required: 1,

View File

@ -1,3 +1,4 @@
import { t } from 'frappe';
import model from 'frappe/model'; import model from 'frappe/model';
import PurchaseInvoice from '../PurchaseInvoice/PurchaseInvoice'; import PurchaseInvoice from '../PurchaseInvoice/PurchaseInvoice';
@ -5,7 +6,7 @@ export default model.extend(
PurchaseInvoice, PurchaseInvoice,
{ {
name: 'PurchaseOrder', name: 'PurchaseOrder',
label: 'Purchase Order', label: t`Purchase Order`,
settings: 'PurchaseOrderSettings', settings: 'PurchaseOrderSettings',
fields: [ fields: [
{ {

View File

@ -1,9 +1,10 @@
import { t } from 'frappe';
import model from 'frappe/model'; import model from 'frappe/model';
import PurchaseInvoiceSettings from '../PurchaseInvoiceSettings/PurchaseInvoiceSettings'; import PurchaseInvoiceSettings from '../PurchaseInvoiceSettings/PurchaseInvoiceSettings';
export default model.extend(PurchaseInvoiceSettings, { export default model.extend(PurchaseInvoiceSettings, {
name: 'PurchaseOrderSettings', name: 'PurchaseOrderSettings',
label: 'Purchase Order Settings', label: t`Purchase Order Settings`,
fields: [ fields: [
{ {
fieldname: 'numberSeries', fieldname: 'numberSeries',

View File

@ -1,9 +1,10 @@
import { t } from 'frappe';
import model from 'frappe/model'; import model from 'frappe/model';
import PurchaseOrder from '../PurchaseOrder/PurchaseOrder'; import PurchaseOrder from '../PurchaseOrder/PurchaseOrder';
export default model.extend(PurchaseOrder, { export default model.extend(PurchaseOrder, {
name: 'PurchaseReceipt', name: 'PurchaseReceipt',
label: 'Purchase Receipt', label: t`Purchase Receipt`,
settings: 'PurchaseReceiptSettings', settings: 'PurchaseReceiptSettings',
fields: [ fields: [
{ {

View File

@ -1,3 +1,4 @@
import { t } from 'frappe';
import model from 'frappe/model'; import model from 'frappe/model';
import PurchaseOrderItem from '../PurchaseOrderItem/PurchaseOrderItem'; import PurchaseOrderItem from '../PurchaseOrderItem/PurchaseOrderItem';
@ -8,7 +9,7 @@ export default model.extend(
fields: [ fields: [
{ {
fieldname: 'acceptedQuantity', fieldname: 'acceptedQuantity',
label: 'Accepted Quantity', label: t`Accepted Quantity`,
fieldtype: 'Float', fieldtype: 'Float',
required: 1, required: 1,
}, },

View File

@ -1,9 +1,10 @@
import { t } from 'frappe';
import model from 'frappe/model'; import model from 'frappe/model';
import PurchaseOrderSettings from '../PurchaseOrderSettings/PurchaseOrderSettings'; import PurchaseOrderSettings from '../PurchaseOrderSettings/PurchaseOrderSettings';
export default model.extend(PurchaseOrderSettings, { export default model.extend(PurchaseOrderSettings, {
name: 'PurchaseReceiptSettings', name: 'PurchaseReceiptSettings',
label: 'Purchase Receipt Settings', label: t`Purchase Receipt Settings`,
fields: [ fields: [
{ {
fieldname: 'numberSeries', fieldname: 'numberSeries',

View File

@ -1,3 +1,4 @@
import { t } from 'frappe';
import model from 'frappe/model'; import model from 'frappe/model';
import SalesInvoice from '../SalesInvoice/SalesInvoice'; import SalesInvoice from '../SalesInvoice/SalesInvoice';
@ -5,7 +6,7 @@ const Quotation = model.extend(
SalesInvoice, SalesInvoice,
{ {
name: 'Quotation', name: 'Quotation',
label: 'Quotation', label: t`Quotation`,
settings: 'QuotationSettings', settings: 'QuotationSettings',
fields: [ fields: [
{ {

View File

@ -1,3 +1,4 @@
import { t } from 'frappe';
import { cloneDeep } from 'lodash'; import { cloneDeep } from 'lodash';
import QuotationItemOriginal from './QuotationItem'; import QuotationItemOriginal from './QuotationItem';
@ -12,7 +13,7 @@ export default function getAugmentedQuotationItem({ country }) {
...QuotationItem.fields, ...QuotationItem.fields,
{ {
fieldname: 'hsnCode', fieldname: 'hsnCode',
label: 'HSN/SAC', label: t`HSN/SAC`,
fieldtype: 'Int', fieldtype: 'Int',
formula: (row, doc) => doc.getFrom('Item', row.item, 'hsnCode'), formula: (row, doc) => doc.getFrom('Item', row.item, 'hsnCode'),
formulaDependsOn: ['item'], formulaDependsOn: ['item'],

View File

@ -1,9 +1,10 @@
import { t } from 'frappe';
import model from 'frappe/model'; import model from 'frappe/model';
import SalesInvoiceSettings from '../SalesInvoiceSettings/SalesInvoiceSettings'; import SalesInvoiceSettings from '../SalesInvoiceSettings/SalesInvoiceSettings';
export default model.extend(SalesInvoiceSettings, { export default model.extend(SalesInvoiceSettings, {
name: 'QuotationSettings', name: 'QuotationSettings',
label: 'Quotation Settings', label: t`Quotation Settings`,
fields: [ fields: [
{ {
fieldname: 'numberSeries', fieldname: 'numberSeries',

View File

@ -1,10 +1,11 @@
import { t } from 'frappe';
import { getActions } from '../Transaction/Transaction'; import { getActions } from '../Transaction/Transaction';
import InvoiceTemplate from './InvoiceTemplate.vue'; import InvoiceTemplate from './InvoiceTemplate.vue';
import SalesInvoice from './SalesInvoiceDocument'; import SalesInvoice from './SalesInvoiceDocument';
export default { export default {
name: 'SalesInvoice', name: 'SalesInvoice',
label: 'Invoice', label: t`Invoice`,
doctype: 'DocType', doctype: 'DocType',
documentClass: SalesInvoice, documentClass: SalesInvoice,
printTemplate: InvoiceTemplate, printTemplate: InvoiceTemplate,
@ -15,7 +16,7 @@ export default {
settings: 'SalesInvoiceSettings', settings: 'SalesInvoiceSettings',
fields: [ fields: [
{ {
label: 'Invoice No', label: t`Invoice No`,
fieldname: 'name', fieldname: 'name',
fieldtype: 'Data', fieldtype: 'Data',
required: 1, required: 1,
@ -23,20 +24,20 @@ export default {
}, },
{ {
fieldname: 'date', fieldname: 'date',
label: 'Date', label: t`Date`,
fieldtype: 'Date', fieldtype: 'Date',
default: () => new Date().toISOString().slice(0, 10), default: () => new Date().toISOString().slice(0, 10),
}, },
{ {
fieldname: 'customer', fieldname: 'customer',
label: 'Customer', label: t`Customer`,
fieldtype: 'Link', fieldtype: 'Link',
target: 'Customer', target: 'Customer',
required: 1, required: 1,
}, },
{ {
fieldname: 'account', fieldname: 'account',
label: 'Account', label: t`Account`,
fieldtype: 'Link', fieldtype: 'Link',
target: 'Account', target: 'Account',
disableCreation: true, disableCreation: true,
@ -50,7 +51,7 @@ export default {
}, },
{ {
fieldname: 'currency', fieldname: 'currency',
label: 'Customer Currency', label: t`Customer Currency`,
fieldtype: 'Link', fieldtype: 'Link',
target: 'Currency', target: 'Currency',
formula: (doc) => formula: (doc) =>
@ -60,7 +61,7 @@ export default {
}, },
{ {
fieldname: 'exchangeRate', fieldname: 'exchangeRate',
label: 'Exchange Rate', label: t`Exchange Rate`,
fieldtype: 'Float', fieldtype: 'Float',
default: 1, default: 1,
formula: (doc) => doc.getExchangeRate(), formula: (doc) => doc.getExchangeRate(),
@ -68,14 +69,14 @@ export default {
}, },
{ {
fieldname: 'items', fieldname: 'items',
label: 'Items', label: t`Items`,
fieldtype: 'Table', fieldtype: 'Table',
childtype: 'SalesInvoiceItem', childtype: 'SalesInvoiceItem',
required: true, required: true,
}, },
{ {
fieldname: 'netTotal', fieldname: 'netTotal',
label: 'Net Total', label: t`Net Total`,
fieldtype: 'Currency', fieldtype: 'Currency',
formula: (doc) => doc.getSum('items', 'amount', false), formula: (doc) => doc.getSum('items', 'amount', false),
readOnly: 1, readOnly: 1,
@ -83,14 +84,14 @@ export default {
}, },
{ {
fieldname: 'baseNetTotal', fieldname: 'baseNetTotal',
label: 'Net Total (Company Currency)', label: t`Net Total (Company Currency)`,
fieldtype: 'Currency', fieldtype: 'Currency',
formula: (doc) => doc.netTotal.mul(doc.exchangeRate), formula: (doc) => doc.netTotal.mul(doc.exchangeRate),
readOnly: 1, readOnly: 1,
}, },
{ {
fieldname: 'taxes', fieldname: 'taxes',
label: 'Taxes', label: t`Taxes`,
fieldtype: 'Table', fieldtype: 'Table',
childtype: 'TaxSummary', childtype: 'TaxSummary',
formula: (doc) => doc.getTaxSummary(), formula: (doc) => doc.getTaxSummary(),
@ -98,7 +99,7 @@ export default {
}, },
{ {
fieldname: 'grandTotal', fieldname: 'grandTotal',
label: 'Grand Total', label: t`Grand Total`,
fieldtype: 'Currency', fieldtype: 'Currency',
formula: (doc) => doc.getGrandTotal(), formula: (doc) => doc.getGrandTotal(),
readOnly: 1, readOnly: 1,
@ -106,14 +107,14 @@ export default {
}, },
{ {
fieldname: 'baseGrandTotal', fieldname: 'baseGrandTotal',
label: 'Grand Total (Company Currency)', label: t`Grand Total (Company Currency)`,
fieldtype: 'Currency', fieldtype: 'Currency',
formula: (doc) => doc.grandTotal.mul(doc.exchangeRate), formula: (doc) => doc.grandTotal.mul(doc.exchangeRate),
readOnly: 1, readOnly: 1,
}, },
{ {
fieldname: 'outstandingAmount', fieldname: 'outstandingAmount',
label: 'Outstanding Amount', label: t`Outstanding Amount`,
fieldtype: 'Currency', fieldtype: 'Currency',
formula: (doc) => { formula: (doc) => {
if (doc.submitted) return; if (doc.submitted) return;
@ -123,12 +124,12 @@ export default {
}, },
{ {
fieldname: 'terms', fieldname: 'terms',
label: 'Notes', label: t`Notes`,
fieldtype: 'Text', fieldtype: 'Text',
}, },
{ {
fieldname: 'cancelled', fieldname: 'cancelled',
label: 'Cancelled', label: t`Cancelled`,
fieldtype: 'Check', fieldtype: 'Check',
default: 0, default: 0,
}, },

View File

@ -1,3 +1,4 @@
import { t } from 'frappe';
import { cloneDeep } from 'lodash'; import { cloneDeep } from 'lodash';
import SalesInvoiceItemOriginal from './SalesInvoiceItem'; import SalesInvoiceItemOriginal from './SalesInvoiceItem';
@ -12,7 +13,7 @@ export default function getAugmentedSalesInvoiceItem({ country }) {
...SalesInvoiceItem.fields, ...SalesInvoiceItem.fields,
{ {
fieldname: 'hsnCode', fieldname: 'hsnCode',
label: 'HSN/SAC', label: t`HSN/SAC`,
fieldtype: 'Int', fieldtype: 'Int',
formula: (row, doc) => doc.getFrom('Item', row.item, 'hsnCode'), formula: (row, doc) => doc.getFrom('Item', row.item, 'hsnCode'),
formulaDependsOn: ['item'], formulaDependsOn: ['item'],

View File

@ -1,3 +1,4 @@
import { t } from 'frappe';
export default { export default {
name: 'SalesInvoiceItem', name: 'SalesInvoiceItem',
doctype: 'DocType', doctype: 'DocType',
@ -8,7 +9,7 @@ export default {
fields: [ fields: [
{ {
fieldname: 'item', fieldname: 'item',
label: 'Item', label: t`Item`,
fieldtype: 'Link', fieldtype: 'Link',
target: 'Item', target: 'Item',
required: 1, required: 1,
@ -23,7 +24,7 @@ export default {
}, },
{ {
fieldname: 'description', fieldname: 'description',
label: 'Description', label: t`Description`,
fieldtype: 'Text', fieldtype: 'Text',
formula: (row, doc) => doc.getFrom('Item', row.item, 'description'), formula: (row, doc) => doc.getFrom('Item', row.item, 'description'),
hidden: 1, hidden: 1,
@ -31,7 +32,7 @@ export default {
}, },
{ {
fieldname: 'quantity', fieldname: 'quantity',
label: 'Quantity', label: t`Quantity`,
fieldtype: 'Float', fieldtype: 'Float',
required: 1, required: 1,
default: 1, default: 1,
@ -47,7 +48,7 @@ export default {
}, },
{ {
fieldname: 'rate', fieldname: 'rate',
label: 'Rate', label: t`Rate`,
fieldtype: 'Currency', fieldtype: 'Currency',
required: 1, required: 1,
formula: async (row, doc) => { formula: async (row, doc) => {
@ -72,14 +73,14 @@ export default {
}, },
{ {
fieldname: 'baseRate', fieldname: 'baseRate',
label: 'Rate (Company Currency)', label: t`Rate (Company Currency)`,
fieldtype: 'Currency', fieldtype: 'Currency',
formula: (row, doc) => row.rate.mul(doc.exchangeRate), formula: (row, doc) => row.rate.mul(doc.exchangeRate),
readOnly: 1, readOnly: 1,
}, },
{ {
fieldname: 'account', fieldname: 'account',
label: 'Account', label: t`Account`,
hidden: 1, hidden: 1,
fieldtype: 'Link', fieldtype: 'Link',
target: 'Account', target: 'Account',
@ -88,7 +89,7 @@ export default {
}, },
{ {
fieldname: 'tax', fieldname: 'tax',
label: 'Tax', label: t`Tax`,
fieldtype: 'Link', fieldtype: 'Link',
target: 'Tax', target: 'Tax',
formula: (row, doc) => doc.getFrom('Item', row.item, 'tax'), formula: (row, doc) => doc.getFrom('Item', row.item, 'tax'),
@ -96,7 +97,7 @@ export default {
}, },
{ {
fieldname: 'amount', fieldname: 'amount',
label: 'Amount', label: t`Amount`,
fieldtype: 'Currency', fieldtype: 'Currency',
readOnly: 1, readOnly: 1,
formula: (row) => row.rate.mul(row.quantity), formula: (row) => row.rate.mul(row.quantity),
@ -104,7 +105,7 @@ export default {
}, },
{ {
fieldname: 'baseAmount', fieldname: 'baseAmount',
label: 'Amount (Company Currency)', label: t`Amount (Company Currency)`,
fieldtype: 'Currency', fieldtype: 'Currency',
readOnly: 1, readOnly: 1,
formula: (row, doc) => row.amount.mul(doc.exchangeRate), formula: (row, doc) => row.amount.mul(doc.exchangeRate),

View File

@ -1,6 +1,7 @@
import { t } from 'frappe';
export default { export default {
name: 'SalesInvoiceSettings', name: 'SalesInvoiceSettings',
label: 'SalesInvoice Settings', label: t`SalesInvoice Settings`,
doctype: 'DocType', doctype: 'DocType',
isSingle: 1, isSingle: 1,
isChild: 0, isChild: 0,
@ -8,7 +9,7 @@ export default {
fields: [ fields: [
{ {
fieldname: 'numberSeries', fieldname: 'numberSeries',
label: 'Number Series', label: t`Number Series`,
fieldtype: 'Link', fieldtype: 'Link',
target: 'NumberSeries', target: 'NumberSeries',
required: 1, required: 1,
@ -16,7 +17,7 @@ export default {
}, },
{ {
fieldname: 'template', fieldname: 'template',
label: 'Template', label: t`Template`,
placeholder: 'Template', placeholder: 'Template',
fieldtype: 'Select', fieldtype: 'Select',
options: ['Basic I', 'Basic II', 'Modern'], options: ['Basic I', 'Basic II', 'Modern'],
@ -25,7 +26,7 @@ export default {
}, },
{ {
fieldname: 'font', fieldname: 'font',
label: 'Font', label: t`Font`,
placeholder: 'Font', placeholder: 'Font',
fieldtype: 'Select', fieldtype: 'Select',
options: ['Montserrat', 'Open Sans', 'Oxygen', 'Merriweather'], options: ['Montserrat', 'Open Sans', 'Oxygen', 'Merriweather'],
@ -34,7 +35,7 @@ export default {
}, },
{ {
fieldname: 'themeColor', fieldname: 'themeColor',
label: 'Theme Color', label: t`Theme Color`,
fieldtype: 'Data', fieldtype: 'Data',
required: 1, required: 1,
default: '#000000', default: '#000000',

View File

@ -1,9 +1,10 @@
import { t } from 'frappe';
import model from 'frappe/model'; import model from 'frappe/model';
import Quotation from '../Quotation/Quotation'; import Quotation from '../Quotation/Quotation';
export default model.extend(Quotation, { export default model.extend(Quotation, {
name: 'SalesOrder', name: 'SalesOrder',
label: 'Sales Order', label: t`Sales Order`,
settings: 'SalesOrderSettings', settings: 'SalesOrderSettings',
fields: [ fields: [
{ {

View File

@ -1,3 +1,4 @@
import { t } from 'frappe';
import { cloneDeep } from 'lodash'; import { cloneDeep } from 'lodash';
import SalesOrderItemOriginal from './SalesOrderItem'; import SalesOrderItemOriginal from './SalesOrderItem';
@ -12,7 +13,7 @@ export default function getAugmentedSalesOrderItem({ country }) {
...SalesOrderItem.fields, ...SalesOrderItem.fields,
{ {
fieldname: 'hsnCode', fieldname: 'hsnCode',
label: 'HSN/SAC', label: t`HSN/SAC`,
fieldtype: 'Int', fieldtype: 'Int',
formula: (row, doc) => doc.getFrom('Item', row.item, 'hsnCode'), formula: (row, doc) => doc.getFrom('Item', row.item, 'hsnCode'),
formulaDependsOn: ['item'], formulaDependsOn: ['item'],

View File

@ -1,9 +1,10 @@
import { t } from 'frappe';
import model from 'frappe/model'; import model from 'frappe/model';
import QuotationSettings from '../QuotationSettings/QuotationSettings'; import QuotationSettings from '../QuotationSettings/QuotationSettings';
export default model.extend(QuotationSettings, { export default model.extend(QuotationSettings, {
name: 'SalesOrderSettings', name: 'SalesOrderSettings',
label: 'Sales Order Settings', label: t`Sales Order Settings`,
fields: [ fields: [
{ {
fieldname: 'numberSeries', fieldname: 'numberSeries',

View File

@ -1,9 +1,10 @@
import { t } from 'frappe';
import { DateTime } from 'luxon'; import { DateTime } from 'luxon';
import countryList from '~/fixtures/countryInfo.json'; import countryList from '~/fixtures/countryInfo.json';
export default { export default {
name: 'SetupWizard', name: 'SetupWizard',
label: 'Setup Wizard', label: t`Setup Wizard`,
naming: 'name', naming: 'name',
isSingle: 1, isSingle: 1,
isChild: 0, isChild: 0,
@ -13,12 +14,12 @@ export default {
fields: [ fields: [
{ {
fieldname: 'companyLogo', fieldname: 'companyLogo',
label: 'Company Logo', label: t`Company Logo`,
fieldtype: 'AttachImage', fieldtype: 'AttachImage',
}, },
{ {
fieldname: 'country', fieldname: 'country',
label: 'Country', label: t`Country`,
fieldtype: 'AutoComplete', fieldtype: 'AutoComplete',
placeholder: 'Select Country', placeholder: 'Select Country',
required: 1, required: 1,
@ -27,7 +28,7 @@ export default {
{ {
fieldname: 'fullname', fieldname: 'fullname',
label: 'Your Name', label: t`Your Name`,
fieldtype: 'Data', fieldtype: 'Data',
placeholder: 'John Doe', placeholder: 'John Doe',
required: 1, required: 1,
@ -35,7 +36,7 @@ export default {
{ {
fieldname: 'email', fieldname: 'email',
label: 'Email', label: t`Email`,
fieldtype: 'Data', fieldtype: 'Data',
placeholder: 'john@doe.com', placeholder: 'john@doe.com',
required: 1, required: 1,
@ -46,7 +47,7 @@ export default {
{ {
fieldname: 'companyName', fieldname: 'companyName',
label: 'Company Name', label: t`Company Name`,
placeholder: 'Company Name', placeholder: 'Company Name',
fieldtype: 'Data', fieldtype: 'Data',
required: 1, required: 1,
@ -54,7 +55,7 @@ export default {
{ {
fieldname: 'bankName', fieldname: 'bankName',
label: 'Bank Name', label: t`Bank Name`,
fieldtype: 'Data', fieldtype: 'Data',
placeholder: 'Prime Bank', placeholder: 'Prime Bank',
required: 1, required: 1,
@ -62,7 +63,7 @@ export default {
{ {
fieldname: 'fiscalYearStart', fieldname: 'fiscalYearStart',
label: 'Fiscal Year Start Date', label: t`Fiscal Year Start Date`,
placeholder: 'Fiscal Year Start Date', placeholder: 'Fiscal Year Start Date',
fieldtype: 'Date', fieldtype: 'Date',
formulaDependsOn: ['country'], formulaDependsOn: ['country'],
@ -81,7 +82,7 @@ export default {
{ {
fieldname: 'fiscalYearEnd', fieldname: 'fiscalYearEnd',
label: 'Fiscal Year End Date', label: t`Fiscal Year End Date`,
placeholder: 'Fiscal Year End Date', placeholder: 'Fiscal Year End Date',
fieldtype: 'Date', fieldtype: 'Date',
formulaDependsOn: ['country'], formulaDependsOn: ['country'],
@ -99,7 +100,7 @@ export default {
}, },
{ {
fieldname: 'currency', fieldname: 'currency',
label: 'Currency', label: t`Currency`,
fieldtype: 'Data', fieldtype: 'Data',
placeholder: 'Currency', placeholder: 'Currency',
formulaDependsOn: ['country'], formulaDependsOn: ['country'],
@ -111,7 +112,7 @@ export default {
}, },
{ {
fieldname: 'completed', fieldname: 'completed',
label: 'Completed', label: t`Completed`,
fieldtype: 'Check', fieldtype: 'Check',
readonly: 1, readonly: 1,
}, },

View File

@ -1,6 +1,7 @@
import { t } from 'frappe';
export default { export default {
name: 'Tax', name: 'Tax',
label: 'Tax', label: t`Tax`,
doctype: 'DocType', doctype: 'DocType',
isSingle: 0, isSingle: 0,
isChild: 0, isChild: 0,
@ -8,17 +9,17 @@ export default {
fields: [ fields: [
{ {
fieldname: 'name', fieldname: 'name',
label: 'Name', label: t`Name`,
fieldtype: 'Data', fieldtype: 'Data',
required: 1 required: 1,
}, },
{ {
fieldname: 'details', fieldname: 'details',
label: 'Details', label: t`Details`,
fieldtype: 'Table', fieldtype: 'Table',
childtype: 'TaxDetail', childtype: 'TaxDetail',
required: 1 required: 1,
} },
], ],
quickEditFields: ['details'] quickEditFields: ['details'],
}; };

View File

@ -1,6 +1,7 @@
import { t } from 'frappe';
export default { export default {
name: 'TaxDetail', name: 'TaxDetail',
label: 'Tax Detail', label: t`Tax Detail`,
doctype: 'DocType', doctype: 'DocType',
isSingle: 0, isSingle: 0,
isChild: 1, isChild: 1,
@ -8,21 +9,18 @@ export default {
fields: [ fields: [
{ {
fieldname: 'account', fieldname: 'account',
label: 'Tax Account', label: t`Tax Account`,
fieldtype: 'Link', fieldtype: 'Link',
target: 'Account', target: 'Account',
required: 1 required: 1,
}, },
{ {
fieldname: 'rate', fieldname: 'rate',
label: 'Rate', label: t`Rate`,
fieldtype: 'Float', fieldtype: 'Float',
required: 1, required: 1,
placeholder: '0%' placeholder: '0%',
} },
], ],
tableFields: [ tableFields: ['account', 'rate'],
'account',
'rate'
]
}; };

View File

@ -1,3 +1,4 @@
import { t } from 'frappe';
export default { export default {
name: 'TaxSummary', name: 'TaxSummary',
doctype: 'DocType', doctype: 'DocType',
@ -5,26 +6,26 @@ export default {
fields: [ fields: [
{ {
fieldname: 'account', fieldname: 'account',
label: 'Tax Account', label: t`Tax Account`,
fieldtype: 'Link', fieldtype: 'Link',
target: 'Account', target: 'Account',
required: 1, required: 1,
}, },
{ {
fieldname: 'rate', fieldname: 'rate',
label: 'Rate', label: t`Rate`,
fieldtype: 'Float', fieldtype: 'Float',
required: 1, required: 1,
}, },
{ {
fieldname: 'amount', fieldname: 'amount',
label: 'Amount', label: t`Amount`,
fieldtype: 'Currency', fieldtype: 'Currency',
required: 1, required: 1,
}, },
{ {
fieldname: 'baseAmount', fieldname: 'baseAmount',
label: 'Amount (Company Currency)', label: t`Amount (Company Currency)`,
fieldtype: 'Currency', fieldtype: 'Currency',
formula: (row, doc) => row.amount.mul(doc.exchangeRate), formula: (row, doc) => row.amount.mul(doc.exchangeRate),
readOnly: 1, readOnly: 1,

View File

@ -1,12 +1,12 @@
import Badge from '@/components/Badge'; import Badge from '@/components/Badge';
import { getInvoiceStatus, openQuickEdit, routeTo } from '@/utils'; import { getInvoiceStatus, openQuickEdit, routeTo } from '@/utils';
import frappe from 'frappe'; import frappe, { t } from 'frappe';
import utils from '../../../accounting/utils'; import utils from '../../../accounting/utils';
import { statusColor } from '../../../src/colors'; import { statusColor } from '../../../src/colors';
export function getStatusColumn() { export function getStatusColumn() {
return { return {
label: 'Status', label: t`Status`,
fieldname: 'status', fieldname: 'status',
fieldtype: 'Select', fieldtype: 'Select',
render(doc) { render(doc) {
@ -23,7 +23,7 @@ export function getStatusColumn() {
export function getActions(doctype) { export function getActions(doctype) {
return [ return [
{ {
label: 'Make Payment', label: t`Make Payment`,
condition: (doc) => doc.submitted && doc.outstandingAmount > 0, condition: (doc) => doc.submitted && doc.outstandingAmount > 0,
action: async function makePayment(doc) { action: async function makePayment(doc) {
let payment = await frappe.getNewDoc('Payment'); let payment = await frappe.getNewDoc('Payment');
@ -55,7 +55,7 @@ export function getActions(doctype) {
}, },
}, },
{ {
label: 'Print', label: t`Print`,
condition: (doc) => doc.submitted, condition: (doc) => doc.submitted,
action(doc) { action(doc) {
routeTo(`/print/${doc.doctype}/${doc.name}`); routeTo(`/print/${doc.doctype}/${doc.name}`);

View File

@ -1,4 +1,4 @@
import frappe from 'frappe'; import frappe, { t } from 'frappe';
import getCommonExportActions from '../commonExporter'; import getCommonExportActions from '../commonExporter';
export default { export default {
@ -10,7 +10,7 @@ export default {
fieldname: 'toDate', fieldname: 'toDate',
size: 'small', size: 'small',
placeholder: 'ToDate', placeholder: 'ToDate',
label: 'To Date', label: t`To Date`,
required: 1, required: 1,
default: async () => { default: async () => {
return (await frappe.getSingle('AccountingSettings')).fiscalYearEnd; return (await frappe.getSingle('AccountingSettings')).fiscalYearEnd;
@ -21,7 +21,7 @@ export default {
placeholder: 'Select Period', placeholder: 'Select Period',
size: 'small', size: 'small',
options: ['Monthly', 'Quarterly', 'Half Yearly', 'Yearly'], options: ['Monthly', 'Quarterly', 'Half Yearly', 'Yearly'],
label: 'Periodicity', label: t`Periodicity`,
fieldname: 'periodicity', fieldname: 'periodicity',
default: 'Monthly', default: 'Monthly',
}, },
@ -29,7 +29,7 @@ export default {
actions: getCommonExportActions('balance-sheet'), actions: getCommonExportActions('balance-sheet'),
getColumns({ data }) { getColumns({ data }) {
const columns = [ const columns = [
{ label: 'Account', fieldtype: 'Data', fieldname: 'account', width: 2 }, { label: t`Account`, fieldtype: 'Data', fieldname: 'account', width: 2 },
]; ];
if (data && data.columns) { if (data && data.columns) {

View File

@ -1,4 +1,5 @@
const title = 'Bank Reconciliation'; const title = 'Bank Reconciliation';
import { t } from 'frappe';
import ImportWizard from '../../src/components/ImportWizart'; import ImportWizard from '../../src/components/ImportWizart';
import BankReconciliationImport from './BankReconciliationImport'; import BankReconciliationImport from './BankReconciliationImport';
@ -11,7 +12,7 @@ export default {
target: 'Account', target: 'Account',
size: 'small', size: 'small',
placeholder: 'Payment Account', placeholder: 'Payment Account',
label: 'Payment Account', label: t`Payment Account`,
fieldname: 'paymentAccount', fieldname: 'paymentAccount',
getFilters: () => { getFilters: () => {
return { return {
@ -24,7 +25,7 @@ export default {
fieldtype: 'Link', fieldtype: 'Link',
target: 'Party', target: 'Party',
size: 'small', size: 'small',
label: 'Party', label: t`Party`,
placeholder: 'Party', placeholder: 'Party',
fieldname: 'party', fieldname: 'party',
}, },
@ -32,20 +33,20 @@ export default {
fieldtype: 'Date', fieldtype: 'Date',
size: 'small', size: 'small',
placeholder: 'From Date', placeholder: 'From Date',
label: 'From Date', label: t`From Date`,
fieldname: 'fromDate', fieldname: 'fromDate',
}, },
{ {
fieldtype: 'Date', fieldtype: 'Date',
size: 'small', size: 'small',
placeholder: 'To Date', placeholder: 'To Date',
label: 'To Date', label: t`To Date`,
fieldname: 'toDate', fieldname: 'toDate',
}, },
], ],
actions: [ actions: [
{ {
label: 'Reconcile', label: t`Reconcile`,
type: 'secondary', type: 'secondary',
condition: (report) => report.currentFilters.paymentAccount, condition: (report) => report.currentFilters.paymentAccount,
action: async (report) => { action: async (report) => {
@ -66,54 +67,54 @@ export default {
getColumns() { getColumns() {
return [ return [
{ {
label: 'Posting Date', label: t`Posting Date`,
fieldtype: 'Date', fieldtype: 'Date',
fieldname: 'date', fieldname: 'date',
}, },
{ {
label: 'Payment Account', label: t`Payment Account`,
fieldtype: 'Link', fieldtype: 'Link',
}, },
{ {
label: 'Debit', label: t`Debit`,
fieldtype: 'Currency', fieldtype: 'Currency',
}, },
{ {
label: 'Credit', label: t`Credit`,
fieldtype: 'Currency', fieldtype: 'Currency',
}, },
{ {
label: 'Balance', label: t`Balance`,
fieldtype: 'Currency', fieldtype: 'Currency',
}, },
{ {
label: 'Ref/Cheque ID', label: t`Ref/Cheque ID`,
fieldtype: 'Data', fieldtype: 'Data',
fieldname: 'referenceId', fieldname: 'referenceId',
}, },
{ {
label: 'Clearance Date', label: t`Clearance Date`,
fieldtype: 'Date', fieldtype: 'Date',
fieldname: 'clearanceDate', fieldname: 'clearanceDate',
}, },
{ {
label: 'Ref. Type', label: t`Ref. Type`,
fieldtype: 'Data', fieldtype: 'Data',
fieldname: 'referenceType', fieldname: 'referenceType',
}, },
{ {
label: 'Ref. Name', label: t`Ref. Name`,
fieldtype: 'Data', fieldtype: 'Data',
fieldname: 'referenceName', fieldname: 'referenceName',
}, },
{ {
label: 'Ref. Date', label: t`Ref. Date`,
fieldtype: 'Date', fieldtype: 'Date',
fieldname: 'referenceDate', fieldname: 'referenceDate',
}, },
{ {
label: 'Party', label: t`Party`,
fieldtype: 'Link', fieldtype: 'Link',
}, },
]; ];

View File

@ -9,14 +9,14 @@ const viewConfig = {
{ {
fieldtype: 'Select', fieldtype: 'Select',
options: [ options: [
{ label: 'All References', value: 'All' }, { label: t`All References`, value: 'All' },
{ label: 'Invoices', value: 'SalesInvoice' }, { label: t`Invoices`, value: 'SalesInvoice' },
{ label: 'Bills', value: 'PurchaseInvoice' }, { label: t`Bills`, value: 'PurchaseInvoice' },
{ label: 'Payment', value: 'Payment' }, { label: t`Payment`, value: 'Payment' },
{ label: 'Journal Entry', value: 'JournalEntry' }, { label: t`Journal Entry`, value: 'JournalEntry' },
], ],
size: 'small', size: 'small',
label: 'Reference Type', label: t`Reference Type`,
fieldname: 'referenceType', fieldname: 'referenceType',
placeholder: 'Reference Type', placeholder: 'Reference Type',
default: 'All', default: 'All',
@ -26,7 +26,7 @@ const viewConfig = {
size: 'small', size: 'small',
placeholder: 'Reference Name', placeholder: 'Reference Name',
references: 'referenceType', references: 'referenceType',
label: 'Reference Name', label: t`Reference Name`,
fieldname: 'referenceName', fieldname: 'referenceName',
}, },
{ {
@ -34,13 +34,13 @@ const viewConfig = {
target: 'Account', target: 'Account',
size: 'small', size: 'small',
placeholder: 'Account', placeholder: 'Account',
label: 'Account', label: t`Account`,
fieldname: 'account', fieldname: 'account',
}, },
{ {
fieldtype: 'Link', fieldtype: 'Link',
target: 'Party', target: 'Party',
label: 'Party', label: t`Party`,
size: 'small', size: 'small',
placeholder: 'Party', placeholder: 'Party',
fieldname: 'party', fieldname: 'party',
@ -49,21 +49,21 @@ const viewConfig = {
fieldtype: 'Date', fieldtype: 'Date',
size: 'small', size: 'small',
placeholder: 'From Date', placeholder: 'From Date',
label: 'From Date', label: t`From Date`,
fieldname: 'fromDate', fieldname: 'fromDate',
}, },
{ {
fieldtype: 'Date', fieldtype: 'Date',
size: 'small', size: 'small',
placeholder: 'To Date', placeholder: 'To Date',
label: 'To Date', label: t`To Date`,
fieldname: 'toDate', fieldname: 'toDate',
}, },
{ {
fieldtype: 'Check', fieldtype: 'Check',
size: 'small', size: 'small',
default: 0, default: 0,
label: 'Cancelled', label: t`Cancelled`,
fieldname: 'reverted', fieldname: 'reverted',
}, },
], ],
@ -72,47 +72,47 @@ const viewConfig = {
getColumns() { getColumns() {
return [ return [
{ {
label: 'Account', label: t`Account`,
fieldtype: 'Link', fieldtype: 'Link',
fieldname: 'account', fieldname: 'account',
width: 1.5, width: 1.5,
}, },
{ {
label: 'Date', label: t`Date`,
fieldtype: 'Date', fieldtype: 'Date',
fieldname: 'date', fieldname: 'date',
width: 0.75, width: 0.75,
}, },
{ {
label: 'Debit', label: t`Debit`,
fieldtype: 'Currency', fieldtype: 'Currency',
fieldname: 'debit', fieldname: 'debit',
width: 1.25, width: 1.25,
}, },
{ {
label: 'Credit', label: t`Credit`,
fieldtype: 'Currency', fieldtype: 'Currency',
fieldname: 'credit', fieldname: 'credit',
width: 1.25, width: 1.25,
}, },
{ {
label: 'Balance', label: t`Balance`,
fieldtype: 'Currency', fieldtype: 'Currency',
fieldname: 'balance', fieldname: 'balance',
width: 1.25, width: 1.25,
}, },
{ {
label: 'Reference Type', label: t`Reference Type`,
fieldtype: 'Data', fieldtype: 'Data',
fieldname: 'referenceType', fieldname: 'referenceType',
}, },
{ {
label: 'Reference Name', label: t`Reference Name`,
fieldtype: 'Data', fieldtype: 'Data',
fieldname: 'referenceName', fieldname: 'referenceName',
}, },
{ {
label: 'Party', label: t`Party`,
fieldtype: 'Link', fieldtype: 'Link',
fieldname: 'party', fieldname: 'party',
component(cellValue) { component(cellValue) {

View File

@ -1,3 +1,4 @@
import { t } from 'frappe';
import { DateTime } from 'luxon'; import { DateTime } from 'luxon';
import { stateCodeMap } from '../../accounting/gst'; import { stateCodeMap } from '../../accounting/gst';
import { titleCase } from '../../src/utils'; import { titleCase } from '../../src/utils';
@ -8,7 +9,7 @@ export default {
filterFields: [ filterFields: [
{ {
fieldtype: 'AutoComplete', fieldtype: 'AutoComplete',
label: 'Place', label: t`Place`,
size: 'small', size: 'small',
placeholder: 'Place', placeholder: 'Place',
fieldname: 'place', fieldname: 'place',
@ -16,7 +17,7 @@ export default {
}, },
{ {
fieldtype: 'Date', fieldtype: 'Date',
label: 'From Date', label: t`From Date`,
size: 'small', size: 'small',
placeholder: 'From Date', placeholder: 'From Date',
fieldname: 'fromDate', fieldname: 'fromDate',
@ -24,7 +25,7 @@ export default {
}, },
{ {
fieldtype: 'Date', fieldtype: 'Date',
label: 'To Date', label: t`To Date`,
size: 'small', size: 'small',
placeholder: 'To Date', placeholder: 'To Date',
fieldname: 'toDate', fieldname: 'toDate',
@ -34,59 +35,59 @@ export default {
getColumns({ filters }) { getColumns({ filters }) {
const columns = [ const columns = [
{ {
label: 'Party', label: t`Party`,
fieldtype: 'Data', fieldtype: 'Data',
fieldname: 'partyName', fieldname: 'partyName',
width: 1.5, width: 1.5,
}, },
{ {
label: 'Invoice No.', label: t`Invoice No.`,
fieldname: 'invNo', fieldname: 'invNo',
fieldtype: 'Data', fieldtype: 'Data',
}, },
{ {
label: 'Invoice Value', label: t`Invoice Value`,
fieldname: 'invAmt', fieldname: 'invAmt',
fieldtype: 'Currency', fieldtype: 'Currency',
}, },
{ {
label: 'Invoice Date', label: t`Invoice Date`,
fieldname: 'invDate', fieldname: 'invDate',
fieldtype: 'Date', fieldtype: 'Date',
}, },
{ {
label: 'Place of supply', label: t`Place of supply`,
fieldname: 'place', fieldname: 'place',
fieldtype: 'Data', fieldtype: 'Data',
}, },
{ {
label: 'Rate', label: t`Rate`,
fieldname: 'rate', fieldname: 'rate',
fieldtype: 'Data', fieldtype: 'Data',
width: 0.5, width: 0.5,
}, },
{ {
label: 'Taxable Value', label: t`Taxable Value`,
fieldname: 'taxVal', fieldname: 'taxVal',
fieldtype: 'Currency', fieldtype: 'Currency',
}, },
{ {
label: 'Reverse Chrg.', label: t`Reverse Chrg.`,
fieldname: 'reverseCharge', fieldname: 'reverseCharge',
fieldtype: 'Data', fieldtype: 'Data',
}, },
{ {
label: 'Intergrated Tax', label: t`Intergrated Tax`,
fieldname: 'igstAmt', fieldname: 'igstAmt',
fieldtype: 'Currency', fieldtype: 'Currency',
}, },
{ {
label: 'Central Tax', label: t`Central Tax`,
fieldname: 'cgstAmt', fieldname: 'cgstAmt',
fieldtype: 'Currency', fieldtype: 'Currency',
}, },
{ {
label: 'State Tax', label: t`State Tax`,
fieldname: 'sgstAmt', fieldname: 'sgstAmt',
fieldtype: 'Currency', fieldtype: 'Currency',
}, },
@ -95,7 +96,7 @@ export default {
const transferType = filters.transferType || 'B2B'; const transferType = filters.transferType || 'B2B';
if (transferType === 'B2B') { if (transferType === 'B2B') {
columns.unshift({ columns.unshift({
label: 'GSTIN No.', label: t`GSTIN No.`,
fieldname: 'gstin', fieldname: 'gstin',
fieldtype: 'Data', fieldtype: 'Data',
width: 1.5, width: 1.5,

View File

@ -1,6 +1,7 @@
const title = 'GSTR 1'; const title = 'GSTR 1';
import { t } from 'frappe';
import { generateGstr1Csv, generateGstr1Json } from '../../accounting/gst';
import baseConfig from './BaseViewConfig'; import baseConfig from './BaseViewConfig';
import { generateGstr1Json, generateGstr1Csv } from '../../accounting/gst';
const transferTypeMap = { const transferTypeMap = {
B2B: 'B2B', B2B: 'B2B',
@ -11,7 +12,7 @@ const transferTypeMap = {
const transferType = { const transferType = {
fieldtype: 'Select', fieldtype: 'Select',
label: 'Transfer Type', label: t`Transfer Type`,
placeholder: 'Transfer Type', placeholder: 'Transfer Type',
fieldname: 'transferType', fieldname: 'transferType',
options: Object.keys(transferTypeMap), options: Object.keys(transferTypeMap),
@ -23,7 +24,7 @@ const transferType = {
const actions = [ const actions = [
{ {
group: 'Export', group: 'Export',
label: 'JSON', label: t`JSON`,
type: 'primary', type: 'primary',
action: async (report, filters) => { action: async (report, filters) => {
generateGstr1Json(report, filters); generateGstr1Json(report, filters);
@ -31,13 +32,13 @@ const actions = [
}, },
{ {
group: 'Export', group: 'Export',
label: 'CSV', label: t`CSV`,
type: 'primary', type: 'primary',
action: async (report, filters) => { action: async (report, filters) => {
generateGstr1Csv(report, filters); generateGstr1Csv(report, filters);
}, },
}, },
] ];
export default { export default {
title: title, title: title,

View File

@ -1,6 +1,7 @@
const title = 'GSTR 2'; const title = 'GSTR 2';
import baseConfig from './BaseViewConfig'; import { t } from 'frappe';
import { generateGstr2Csv } from '../../accounting/gst'; import { generateGstr2Csv } from '../../accounting/gst';
import baseConfig from './BaseViewConfig';
const transferTypeMap = { const transferTypeMap = {
B2B: 'B2B', B2B: 'B2B',
@ -8,7 +9,7 @@ const transferTypeMap = {
const transferType = { const transferType = {
fieldtype: 'Select', fieldtype: 'Select',
label: 'Transfer Type', label: t`Transfer Type`,
placeholder: 'Transfer Type', placeholder: 'Transfer Type',
fieldname: 'transferType', fieldname: 'transferType',
options: Object.keys(transferTypeMap), options: Object.keys(transferTypeMap),
@ -20,13 +21,13 @@ const transferType = {
const actions = [ const actions = [
{ {
group: 'Export', group: 'Export',
label: 'CSV', label: t`CSV`,
type: 'primary', type: 'primary',
action: async (report, filters) => { action: async (report, filters) => {
generateGstr2Csv(report, filters); generateGstr2Csv(report, filters);
}, },
}, },
] ];
export default { export default {
title: title, title: title,

View File

@ -1,4 +1,4 @@
import frappe from 'frappe'; import frappe, { t } from 'frappe';
import getCommonExportActions from '../commonExporter'; import getCommonExportActions from '../commonExporter';
const title = 'Profit and Loss'; const title = 'Profit and Loss';
@ -13,7 +13,7 @@ export default {
fieldname: 'fromDate', fieldname: 'fromDate',
size: 'small', size: 'small',
placeholder: 'From Date', placeholder: 'From Date',
label: 'From Date', label: t`From Date`,
required: 1, required: 1,
default: async () => { default: async () => {
return (await frappe.getSingle('AccountingSettings')).fiscalYearStart; return (await frappe.getSingle('AccountingSettings')).fiscalYearStart;
@ -24,7 +24,7 @@ export default {
fieldname: 'toDate', fieldname: 'toDate',
size: 'small', size: 'small',
placeholder: 'To Date', placeholder: 'To Date',
label: 'To Date', label: t`To Date`,
required: 1, required: 1,
default: async () => { default: async () => {
return (await frappe.getSingle('AccountingSettings')).fiscalYearEnd; return (await frappe.getSingle('AccountingSettings')).fiscalYearEnd;
@ -35,7 +35,7 @@ export default {
size: 'small', size: 'small',
options: ['Monthly', 'Quarterly', 'Half Yearly', 'Yearly'], options: ['Monthly', 'Quarterly', 'Half Yearly', 'Yearly'],
default: 'Monthly', default: 'Monthly',
label: 'Periodicity', label: t`Periodicity`,
placeholder: 'Select Period...', placeholder: 'Select Period...',
fieldname: 'periodicity', fieldname: 'periodicity',
}, },
@ -43,7 +43,7 @@ export default {
actions: getCommonExportActions('profit-and-loss'), actions: getCommonExportActions('profit-and-loss'),
getColumns({ data }) { getColumns({ data }) {
const columns = [ const columns = [
{ label: 'Account', fieldtype: 'Data', fieldname: 'account', width: 2 }, { label: t`Account`, fieldtype: 'Data', fieldname: 'account', width: 2 },
]; ];
if (data && data.columns) { if (data && data.columns) {

View File

@ -1,4 +1,5 @@
const title = 'Purchase Register'; const title = 'Purchase Register';
import { t } from 'frappe';
export default { export default {
title: title, title: title,
@ -7,7 +8,7 @@ export default {
{ {
fieldtype: 'Link', fieldtype: 'Link',
target: 'Party', target: 'Party',
label: 'Supplier Name', label: t`Supplier Name`,
fieldname: 'supplier', fieldname: 'supplier',
size: 'small', size: 'small',
placeholder: 'Supplier Name', placeholder: 'Supplier Name',
@ -28,7 +29,7 @@ export default {
fieldname: 'fromDate', fieldname: 'fromDate',
size: 'small', size: 'small',
placeholder: 'From Date', placeholder: 'From Date',
label: 'From Date', label: t`From Date`,
required: 1, required: 1,
}, },
{ {
@ -36,20 +37,20 @@ export default {
size: 'small', size: 'small',
placeholder: 'To Date', placeholder: 'To Date',
fieldname: 'toDate', fieldname: 'toDate',
label: 'To Date', label: t`To Date`,
required: 1, required: 1,
}, },
], ],
actions: [], actions: [],
getColumns() { getColumns() {
return [ return [
{ label: 'PurchaseInvoice', fieldname: 'name' }, { label: t`PurchaseInvoice`, fieldname: 'name' },
{ label: 'Posting Date', fieldname: 'date' }, { label: t`Posting Date`, fieldname: 'date' },
{ label: 'Supplier', fieldname: 'supplier' }, { label: t`Supplier`, fieldname: 'supplier' },
{ label: 'Payable Account', fieldname: 'account' }, { label: t`Payable Account`, fieldname: 'account' },
{ label: 'Net Total', fieldname: 'netTotal', fieldtype: 'Currency' }, { label: t`Net Total`, fieldname: 'netTotal', fieldtype: 'Currency' },
{ label: 'Total Tax', fieldname: 'totalTax', fieldtype: 'Currency' }, { label: t`Total Tax`, fieldname: 'totalTax', fieldtype: 'Currency' },
{ label: 'Grand Total', fieldname: 'grandTotal', fieldtype: 'Currency' }, { label: t`Grand Total`, fieldname: 'grandTotal', fieldtype: 'Currency' },
]; ];
}, },
}; };

View File

@ -1,4 +1,5 @@
const title = 'Sales Register'; const title = 'Sales Register';
import { t } from 'frappe';
export default { export default {
title: title, title: title,
@ -7,7 +8,7 @@ export default {
{ {
fieldtype: 'Link', fieldtype: 'Link',
target: 'Party', target: 'Party',
label: 'Customer Name', label: t`Customer Name`,
size: 'small', size: 'small',
placeholder: 'Customer Name', placeholder: 'Customer Name',
fieldname: 'customer', fieldname: 'customer',
@ -28,7 +29,7 @@ export default {
fieldname: 'fromDate', fieldname: 'fromDate',
size: 'small', size: 'small',
placeholder: 'From Date', placeholder: 'From Date',
label: 'From Date', label: t`From Date`,
required: 1, required: 1,
}, },
{ {
@ -36,20 +37,20 @@ export default {
size: 'small', size: 'small',
placeholder: 'To Date', placeholder: 'To Date',
fieldname: 'toDate', fieldname: 'toDate',
label: 'To Date', label: t`To Date`,
required: 1, required: 1,
}, },
], ],
actions: [], actions: [],
getColumns() { getColumns() {
return [ return [
{ label: 'SalesInvoice', fieldname: 'name' }, { label: t`SalesInvoice`, fieldname: 'name' },
{ label: 'Posting Date', fieldname: 'date', fieldtype: 'Date' }, { label: t`Posting Date`, fieldname: 'date', fieldtype: 'Date' },
{ label: 'Customer', fieldname: 'customer' }, { label: t`Customer`, fieldname: 'customer' },
{ label: 'Receivable Account', fieldname: 'account' }, { label: t`Receivable Account`, fieldname: 'account' },
{ label: 'Net Total', fieldname: 'netTotal', fieldtype: 'Currency' }, { label: t`Net Total`, fieldname: 'netTotal', fieldtype: 'Currency' },
{ label: 'Total Tax', fieldname: 'totalTax', fieldtype: 'Currency' }, { label: t`Total Tax`, fieldname: 'totalTax', fieldtype: 'Currency' },
{ label: 'Grand Total', fieldname: 'grandTotal', fieldtype: 'Currency' }, { label: t`Grand Total`, fieldname: 'grandTotal', fieldtype: 'Currency' },
]; ];
}, },
}; };

View File

@ -1,4 +1,4 @@
import frappe from 'frappe'; import frappe, { t } from 'frappe';
import getCommonExportActions from '../commonExporter'; import getCommonExportActions from '../commonExporter';
const title = 'Trial Balance'; const title = 'Trial Balance';
@ -11,7 +11,7 @@ export default {
{ {
fieldtype: 'Date', fieldtype: 'Date',
fieldname: 'fromDate', fieldname: 'fromDate',
label: 'From Date', label: t`From Date`,
size: 'small', size: 'small',
placeholder: 'From Date', placeholder: 'From Date',
required: 1, required: 1,
@ -24,7 +24,7 @@ export default {
size: 'small', size: 'small',
placeholder: 'To Date', placeholder: 'To Date',
fieldname: 'toDate', fieldname: 'toDate',
label: 'To Date', label: t`To Date`,
required: 1, required: 1,
default: async () => { default: async () => {
return (await frappe.getSingle('AccountingSettings')).fiscalYearEnd; return (await frappe.getSingle('AccountingSettings')).fiscalYearEnd;
@ -34,26 +34,26 @@ export default {
actions: getCommonExportActions('trial-balance'), actions: getCommonExportActions('trial-balance'),
getColumns() { getColumns() {
const columns = [ const columns = [
{ label: 'Account', fieldtype: 'Data', fieldname: 'account', width: 2 }, { label: t`Account`, fieldtype: 'Data', fieldname: 'account', width: 2 },
{ {
label: 'Opening (Dr)', label: t`Opening (Dr)`,
fieldtype: 'Currency', fieldtype: 'Currency',
fieldname: 'openingDebit', fieldname: 'openingDebit',
}, },
{ {
label: 'Opening (Cr)', label: t`Opening (Cr)`,
fieldtype: 'Currency', fieldtype: 'Currency',
fieldname: 'openingCredit', fieldname: 'openingCredit',
}, },
{ label: 'Debit', fieldtype: 'Currency', fieldname: 'debit' }, { label: t`Debit`, fieldtype: 'Currency', fieldname: 'debit' },
{ label: 'Credit', fieldtype: 'Currency', fieldname: 'credit' }, { label: t`Credit`, fieldtype: 'Currency', fieldname: 'credit' },
{ {
label: 'Closing (Dr)', label: t`Closing (Dr)`,
fieldtype: 'Currency', fieldtype: 'Currency',
fieldname: 'closingDebit', fieldname: 'closingDebit',
}, },
{ {
label: 'Closing (Cr)', label: t`Closing (Cr)`,
fieldtype: 'Currency', fieldtype: 'Currency',
fieldname: 'closingCredit', fieldname: 'closingCredit',
}, },

View File

@ -4,6 +4,7 @@ import AutoComplete from './AutoComplete';
import Badge from '@/components/Badge'; import Badge from '@/components/Badge';
import { openQuickEdit } from '@/utils'; import { openQuickEdit } from '@/utils';
import { markRaw } from 'vue'; import { markRaw } from 'vue';
import { t } from 'frappe';
export default { export default {
name: 'Link', name: 'Link',
@ -63,7 +64,7 @@ export default {
}, },
getCreateNewOption() { getCreateNewOption() {
return { return {
label: 'Create', label: t`Create`,
value: 'Create', value: 'Create',
action: () => this.openNewDoc(), action: () => this.openNewDoc(),
component: markRaw({ component: markRaw({

View File

@ -120,16 +120,17 @@ import Popover from './Popover';
import Button from './Button'; import Button from './Button';
import Icon from './Icon'; import Icon from './Icon';
import FormControl from './Controls/FormControl'; import FormControl from './Controls/FormControl';
import { t } from 'frappe';
let conditions = [ let conditions = [
{ label: 'Is', value: '=' }, { label: t`Is`, value: '=' },
{ label: 'Is Not', value: '!=' }, { label: t`Is Not`, value: '!=' },
{ label: 'Contains', value: 'like' }, { label: t`Contains`, value: 'like' },
{ label: 'Does Not Contain', value: 'not like' }, { label: t`Does Not Contain`, value: 'not like' },
{ label: 'Greater Than', value: '>' }, { label: t`Greater Than`, value: '>' },
{ label: 'Less Than', value: '<' }, { label: t`Less Than`, value: '<' },
{ label: 'Is Empty', value: 'is null' }, { label: t`Is Empty`, value: 'is null' },
{ label: 'Is Not Empty', value: 'is not null' }, { label: t`Is Not Empty`, value: 'is not null' },
]; ];
export default { export default {

View File

@ -45,6 +45,7 @@ import frappe from 'frappe';
import reports from '../../reports/view'; import reports from '../../reports/view';
import Dropdown from '@/components/Dropdown'; import Dropdown from '@/components/Dropdown';
import { routeTo } from '@/utils'; import { routeTo } from '@/utils';
import { t } from 'frappe';
export default { export default {
data() { data() {
@ -69,7 +70,7 @@ export default {
}); });
if (this.suggestions.length === 0) { if (this.suggestions.length === 0) {
this.suggestions = [{ label: 'No results found.' }]; this.suggestions = [{ label: t`No results found.` }];
} }
}, },
clearInput() { clearInput() {
@ -116,7 +117,7 @@ export default {
getViews() { getViews() {
return [ return [
{ {
label: 'Chart of Accounts', label: t`Chart of Accounts`,
route: '/chartOfAccounts', route: '/chartOfAccounts',
group: 'List', group: 'List',
}, },