mirror of
https://github.com/frappe/books.git
synced 2024-11-08 14:50:56 +00:00
fix: mark missed strings as translate
This commit is contained in:
parent
5a66e4aba6
commit
0d78df598c
@ -20,7 +20,7 @@ module.exports = {
|
||||
{
|
||||
fieldname: 'subject',
|
||||
label: t`Subject`,
|
||||
placeholder: 'Subject',
|
||||
placeholder: t`Subject`,
|
||||
fieldtype: 'Data',
|
||||
required: 1,
|
||||
},
|
||||
|
@ -20,7 +20,7 @@ export default {
|
||||
fieldname: 'rootType',
|
||||
label: t`Root Type`,
|
||||
fieldtype: 'Select',
|
||||
placeholder: 'Root Type',
|
||||
placeholder: t`Root Type`,
|
||||
options: ['Asset', 'Liability', 'Equity', 'Income', 'Expense'],
|
||||
required: 1,
|
||||
},
|
||||
@ -40,7 +40,7 @@ export default {
|
||||
{
|
||||
fieldname: 'accountType',
|
||||
label: t`Account Type`,
|
||||
placeholder: 'Account Type',
|
||||
placeholder: t`Account Type`,
|
||||
fieldtype: 'Select',
|
||||
options: [
|
||||
'Accumulated Depreciation',
|
||||
|
@ -51,7 +51,7 @@ export default {
|
||||
fieldname: 'country',
|
||||
label: t`Country`,
|
||||
fieldtype: 'AutoComplete',
|
||||
placeholder: 'Select Country',
|
||||
placeholder: t`Select Country`,
|
||||
readOnly: 1,
|
||||
required: 1,
|
||||
getList: () => countryList,
|
||||
@ -113,7 +113,7 @@ export default {
|
||||
fieldname: 'gstin',
|
||||
label: t`GSTIN`,
|
||||
fieldtype: 'Data',
|
||||
placeholder: '27AAAAA0000A1Z5',
|
||||
placeholder: t`27AAAAA0000A1Z5`,
|
||||
},
|
||||
],
|
||||
quickEditFields: [
|
||||
|
@ -29,27 +29,27 @@ export default {
|
||||
{
|
||||
fieldname: 'addressLine1',
|
||||
label: t`Address Line 1`,
|
||||
placeholder: 'Address Line 1',
|
||||
placeholder: t`Address Line 1`,
|
||||
fieldtype: 'Data',
|
||||
required: 1,
|
||||
},
|
||||
{
|
||||
fieldname: 'addressLine2',
|
||||
label: t`Address Line 2`,
|
||||
placeholder: 'Address Line 2',
|
||||
placeholder: t`Address Line 2`,
|
||||
fieldtype: 'Data',
|
||||
},
|
||||
{
|
||||
fieldname: 'city',
|
||||
label: t`City / Town`,
|
||||
placeholder: 'City / Town',
|
||||
placeholder: t`City / Town`,
|
||||
fieldtype: 'Data',
|
||||
required: 1,
|
||||
},
|
||||
{
|
||||
fieldname: 'state',
|
||||
label: t`State`,
|
||||
placeholder: 'State',
|
||||
placeholder: t`State`,
|
||||
fieldtype: 'AutoComplete',
|
||||
emptyMessage: (doc) => {
|
||||
if (doc.country) {
|
||||
@ -62,7 +62,7 @@ export default {
|
||||
{
|
||||
fieldname: 'country',
|
||||
label: t`Country`,
|
||||
placeholder: 'Country',
|
||||
placeholder: t`Country`,
|
||||
fieldtype: 'AutoComplete',
|
||||
getList: () => Object.keys(countryList).sort(),
|
||||
required: 1,
|
||||
@ -70,19 +70,19 @@ export default {
|
||||
{
|
||||
fieldname: 'postalCode',
|
||||
label: t`Postal Code`,
|
||||
placeholder: 'Postal Code',
|
||||
placeholder: t`Postal Code`,
|
||||
fieldtype: 'Data',
|
||||
},
|
||||
{
|
||||
fieldname: 'emailAddress',
|
||||
label: t`Email Address`,
|
||||
placeholder: 'Email Address',
|
||||
placeholder: t`Email Address`,
|
||||
fieldtype: 'Data',
|
||||
},
|
||||
{
|
||||
fieldname: 'phone',
|
||||
label: t`Phone`,
|
||||
placeholder: 'Phone',
|
||||
placeholder: t`Phone`,
|
||||
fieldtype: 'Data',
|
||||
},
|
||||
{
|
||||
|
@ -18,7 +18,7 @@ export default function getAugmentedAddress({ country }) {
|
||||
fieldname: 'pos',
|
||||
label: t`Place of Supply`,
|
||||
fieldtype: 'AutoComplete',
|
||||
placeholder: 'Place of Supply',
|
||||
placeholder: t`Place of Supply`,
|
||||
formula: (doc) => (stateList.includes(doc.state) ? doc.state : ''),
|
||||
getList: () => stateList,
|
||||
},
|
||||
|
@ -20,7 +20,7 @@ export default {
|
||||
{
|
||||
fieldname: 'month',
|
||||
label: t`Month`,
|
||||
placeholder: 'Month',
|
||||
placeholder: t`Month`,
|
||||
fieldtype: 'Select',
|
||||
options: [
|
||||
'January',
|
||||
|
@ -18,7 +18,7 @@ export default {
|
||||
fieldname: 'name',
|
||||
label: t`Item Name`,
|
||||
fieldtype: 'Data',
|
||||
placeholder: 'Item Name',
|
||||
placeholder: t`Item Name`,
|
||||
required: 1,
|
||||
},
|
||||
{
|
||||
@ -29,21 +29,21 @@ export default {
|
||||
{
|
||||
fieldname: 'description',
|
||||
label: t`Description`,
|
||||
placeholder: 'Item Description',
|
||||
placeholder: t`Item Description`,
|
||||
fieldtype: 'Text',
|
||||
},
|
||||
{
|
||||
fieldname: 'unit',
|
||||
label: t`Unit Type`,
|
||||
fieldtype: 'Select',
|
||||
placeholder: 'Unit Type',
|
||||
placeholder: t`Unit Type`,
|
||||
default: 'Unit',
|
||||
options: ['Unit', 'Kg', 'Gram', 'Hour', 'Day'],
|
||||
},
|
||||
{
|
||||
fieldname: 'itemType',
|
||||
label: t`Type`,
|
||||
placeholder: 'Type',
|
||||
placeholder: t`Type`,
|
||||
fieldtype: 'Select',
|
||||
default: 'Product',
|
||||
options: ['Product', 'Service'],
|
||||
@ -61,7 +61,7 @@ export default {
|
||||
label: t`Income`,
|
||||
fieldtype: 'Link',
|
||||
target: 'Account',
|
||||
placeholder: 'Income',
|
||||
placeholder: t`Income`,
|
||||
required: 1,
|
||||
disableCreation: true,
|
||||
getFilters: () => {
|
||||
@ -86,7 +86,7 @@ export default {
|
||||
label: t`Expense`,
|
||||
fieldtype: 'Link',
|
||||
target: 'Account',
|
||||
placeholder: 'Expense',
|
||||
placeholder: t`Expense`,
|
||||
required: 1,
|
||||
disableCreation: true,
|
||||
getFilters: () => {
|
||||
@ -112,7 +112,7 @@ export default {
|
||||
label: t`Tax`,
|
||||
fieldtype: 'Link',
|
||||
target: 'Tax',
|
||||
placeholder: 'Tax',
|
||||
placeholder: t`Tax`,
|
||||
},
|
||||
{
|
||||
fieldname: 'rate',
|
||||
|
@ -17,7 +17,7 @@ export default function getAugmentedItem({ country }) {
|
||||
fieldname: 'hsnCode',
|
||||
label: t`HSN/SAC`,
|
||||
fieldtype: 'Int',
|
||||
placeholder: 'HSN/SAC Code',
|
||||
placeholder: t`HSN/SAC Code`,
|
||||
},
|
||||
...Item.fields.slice(nameFieldIndex + 1, Item.fields.length),
|
||||
];
|
||||
|
@ -28,7 +28,7 @@ export default {
|
||||
fieldname: 'entryType',
|
||||
label: t`Entry Type`,
|
||||
fieldtype: 'Select',
|
||||
placeholder: 'Entry Type',
|
||||
placeholder: t`Entry Type`,
|
||||
options: Object.keys(journalEntryTypeMap),
|
||||
map: journalEntryTypeMap,
|
||||
required: 1,
|
||||
@ -67,7 +67,7 @@ export default {
|
||||
fieldname: 'userRemark',
|
||||
label: t`User Remark`,
|
||||
fieldtype: 'Text',
|
||||
placeholder: 'User Remark',
|
||||
placeholder: t`User Remark`,
|
||||
},
|
||||
{
|
||||
fieldname: 'cancelled',
|
||||
|
@ -6,7 +6,7 @@ export default {
|
||||
{
|
||||
fieldname: 'account',
|
||||
label: t`Account`,
|
||||
placeholder: 'Account',
|
||||
placeholder: t`Account`,
|
||||
fieldtype: 'Link',
|
||||
target: 'Account',
|
||||
required: 1,
|
||||
|
@ -11,7 +11,7 @@ export default {
|
||||
label: t`Name`,
|
||||
fieldtype: 'Data',
|
||||
required: 1,
|
||||
placeholder: 'Full Name',
|
||||
placeholder: t`Full Name`,
|
||||
},
|
||||
{
|
||||
fieldname: 'image',
|
||||
@ -59,14 +59,14 @@ export default {
|
||||
label: t`Currency`,
|
||||
fieldtype: 'Link',
|
||||
target: 'Currency',
|
||||
placeholder: 'INR',
|
||||
placeholder: t`INR`,
|
||||
formula: () => frappe.AccountingSettings.currency,
|
||||
},
|
||||
{
|
||||
fieldname: 'email',
|
||||
label: t`Email`,
|
||||
fieldtype: 'Data',
|
||||
placeholder: 'john@doe.com',
|
||||
placeholder: t`john@doe.com`,
|
||||
validate: {
|
||||
type: 'email',
|
||||
},
|
||||
@ -75,7 +75,7 @@ export default {
|
||||
fieldname: 'phone',
|
||||
label: t`Phone`,
|
||||
fieldtype: 'Data',
|
||||
placeholder: 'Phone',
|
||||
placeholder: t`Phone`,
|
||||
validate: {
|
||||
type: 'phone',
|
||||
},
|
||||
|
@ -23,7 +23,7 @@ export default function getAugmentedParty({ country }) {
|
||||
{
|
||||
fieldname: 'gstType',
|
||||
label: t`GST Registration`,
|
||||
placeholder: 'GST Registration',
|
||||
placeholder: t`GST Registration`,
|
||||
fieldtype: 'Select',
|
||||
default: gstTypes[0],
|
||||
options: gstTypes,
|
||||
|
@ -7,6 +7,12 @@ const paymentTypeMap = {
|
||||
Pay: t`Pay`,
|
||||
};
|
||||
|
||||
const paymentMethodMap = {
|
||||
Cash: t`Cash`,
|
||||
Cheque: t`Cheque`,
|
||||
Transfer: t`Transfer`,
|
||||
};
|
||||
|
||||
export default {
|
||||
name: 'Payment',
|
||||
label: t`Payment`,
|
||||
@ -61,7 +67,7 @@ export default {
|
||||
fieldname: 'paymentType',
|
||||
label: t`Payment Type`,
|
||||
fieldtype: 'Select',
|
||||
placeholder: 'Payment Type',
|
||||
placeholder: t`Payment Type`,
|
||||
options: Object.keys(paymentTypeMap),
|
||||
map: paymentTypeMap,
|
||||
required: 1,
|
||||
@ -69,7 +75,7 @@ export default {
|
||||
{
|
||||
fieldname: 'paymentAccount',
|
||||
label: t`To Account`,
|
||||
placeholder: 'To Account',
|
||||
placeholder: t`To Account`,
|
||||
fieldtype: 'Link',
|
||||
target: 'Account',
|
||||
required: 1,
|
||||
@ -102,16 +108,17 @@ export default {
|
||||
{
|
||||
fieldname: 'paymentMethod',
|
||||
label: t`Payment Method`,
|
||||
placeholder: 'Payment Method',
|
||||
placeholder: t`Payment Method`,
|
||||
fieldtype: 'Select',
|
||||
options: ['Cash', 'Cheque', 'Transfer'],
|
||||
options: Object.keys(paymentMethodMap),
|
||||
map: paymentMethodMap,
|
||||
default: 'Cash',
|
||||
required: 1,
|
||||
},
|
||||
{
|
||||
fieldname: 'referenceId',
|
||||
label: t`Ref. / Cheque No.`,
|
||||
placeholder: 'Ref. / Cheque No.',
|
||||
placeholder: t`Ref. / Cheque No.`,
|
||||
fieldtype: 'Data',
|
||||
required: (doc) => doc.paymentMethod !== 'Cash', // TODO: UNIQUE
|
||||
hidden: (doc) => doc.paymentMethod === 'Cash',
|
||||
@ -119,13 +126,13 @@ export default {
|
||||
{
|
||||
fieldname: 'referenceDate',
|
||||
label: t`Ref. Date`,
|
||||
placeholder: 'Ref. Date',
|
||||
placeholder: t`Ref. Date`,
|
||||
fieldtype: 'Date',
|
||||
},
|
||||
{
|
||||
fieldname: 'clearanceDate',
|
||||
label: t`Clearance Date`,
|
||||
placeholder: 'Clearance Date',
|
||||
placeholder: t`Clearance Date`,
|
||||
fieldtype: 'Date',
|
||||
hidden: (doc) => doc.paymentMethod === 'Cash',
|
||||
},
|
||||
|
@ -16,7 +16,7 @@ export default {
|
||||
{
|
||||
fieldname: 'referenceType',
|
||||
label: t`Reference Type`,
|
||||
placeholder: 'Type',
|
||||
placeholder: t`Type`,
|
||||
fieldtype: 'Select',
|
||||
options: Object.keys(referenceTypeMap),
|
||||
map: referenceTypeMap,
|
||||
@ -27,7 +27,7 @@ export default {
|
||||
label: t`Reference Name`,
|
||||
fieldtype: 'DynamicLink',
|
||||
references: 'referenceType',
|
||||
placeholder: 'Name',
|
||||
placeholder: t`Name`,
|
||||
getFilters() {
|
||||
return {
|
||||
outstandingAmount: ['>', 0],
|
||||
|
@ -20,7 +20,7 @@ export default {
|
||||
fieldname: 'email',
|
||||
label: t`Email`,
|
||||
fieldtype: 'Data',
|
||||
placeholder: 'john@doe.com',
|
||||
placeholder: t`john@doe.com`,
|
||||
validate: {
|
||||
type: 'email',
|
||||
},
|
||||
@ -34,7 +34,7 @@ export default {
|
||||
fieldname: 'phone',
|
||||
label: t`Phone`,
|
||||
fieldtype: 'Data',
|
||||
placeholder: '9888900000',
|
||||
placeholder: t`9888900000`,
|
||||
validate: {
|
||||
type: 'phone',
|
||||
},
|
||||
@ -44,13 +44,13 @@ export default {
|
||||
label: t`Address`,
|
||||
fieldtype: 'Link',
|
||||
target: 'Address',
|
||||
placeholder: 'Click to create',
|
||||
placeholder: t`Click to create`,
|
||||
inline: true,
|
||||
},
|
||||
{
|
||||
fieldname: 'template',
|
||||
label: t`Template`,
|
||||
placeholder: 'Template',
|
||||
placeholder: t`Template`,
|
||||
fieldtype: 'Select',
|
||||
options: ['Basic', 'Minimal', 'Business'],
|
||||
default: 'Basic',
|
||||
@ -58,7 +58,7 @@ export default {
|
||||
{
|
||||
fieldname: 'color',
|
||||
label: t`Color`,
|
||||
placeholder: 'Select Color',
|
||||
placeholder: t`Select Color`,
|
||||
fieldtype: 'Color',
|
||||
colors: [
|
||||
'red',
|
||||
@ -86,7 +86,7 @@ export default {
|
||||
{
|
||||
fieldname: 'font',
|
||||
label: t`Font`,
|
||||
placeholder: 'Font',
|
||||
placeholder: t`Font`,
|
||||
fieldtype: 'Select',
|
||||
options: ['Inter', 'Times New Roman', 'Arial', 'Courier'],
|
||||
default: 'Inter',
|
||||
|
@ -10,7 +10,7 @@ export default {
|
||||
{
|
||||
fieldname: 'template',
|
||||
label: t`Template`,
|
||||
placeholder: 'Template',
|
||||
placeholder: t`Template`,
|
||||
fieldtype: 'Select',
|
||||
options: ['Basic I', 'Basic II', 'Modern'],
|
||||
required: 1,
|
||||
@ -19,7 +19,7 @@ export default {
|
||||
{
|
||||
fieldname: 'font',
|
||||
label: t`Font`,
|
||||
placeholder: 'Font',
|
||||
placeholder: t`Font`,
|
||||
fieldtype: 'Select',
|
||||
options: ['Montserrat', 'Open Sans', 'Oxygen', 'Merriweather'],
|
||||
required: 1,
|
||||
|
@ -22,7 +22,7 @@ export default {
|
||||
fieldname: 'country',
|
||||
label: t`Country`,
|
||||
fieldtype: 'AutoComplete',
|
||||
placeholder: 'Select Country',
|
||||
placeholder: t`Select Country`,
|
||||
required: 1,
|
||||
getList: () => Object.keys(countryList).sort(),
|
||||
},
|
||||
@ -31,7 +31,7 @@ export default {
|
||||
fieldname: 'fullname',
|
||||
label: t`Your Name`,
|
||||
fieldtype: 'Data',
|
||||
placeholder: 'John Doe',
|
||||
placeholder: t`John Doe`,
|
||||
required: 1,
|
||||
},
|
||||
|
||||
@ -39,7 +39,7 @@ export default {
|
||||
fieldname: 'email',
|
||||
label: t`Email`,
|
||||
fieldtype: 'Data',
|
||||
placeholder: 'john@doe.com',
|
||||
placeholder: t`john@doe.com`,
|
||||
required: 1,
|
||||
validate: {
|
||||
type: 'email',
|
||||
@ -49,7 +49,7 @@ export default {
|
||||
{
|
||||
fieldname: 'companyName',
|
||||
label: t`Company Name`,
|
||||
placeholder: 'Company Name',
|
||||
placeholder: t`Company Name`,
|
||||
fieldtype: 'Data',
|
||||
required: 1,
|
||||
},
|
||||
@ -58,14 +58,14 @@ export default {
|
||||
fieldname: 'bankName',
|
||||
label: t`Bank Name`,
|
||||
fieldtype: 'Data',
|
||||
placeholder: 'Prime Bank',
|
||||
placeholder: t`Prime Bank`,
|
||||
required: 1,
|
||||
},
|
||||
|
||||
{
|
||||
fieldname: 'fiscalYearStart',
|
||||
label: t`Fiscal Year Start Date`,
|
||||
placeholder: 'Fiscal Year Start Date',
|
||||
placeholder: t`Fiscal Year Start Date`,
|
||||
fieldtype: 'Date',
|
||||
formulaDependsOn: ['country'],
|
||||
formula: (doc) => {
|
||||
@ -84,7 +84,7 @@ export default {
|
||||
{
|
||||
fieldname: 'fiscalYearEnd',
|
||||
label: t`Fiscal Year End Date`,
|
||||
placeholder: 'Fiscal Year End Date',
|
||||
placeholder: t`Fiscal Year End Date`,
|
||||
fieldtype: 'Date',
|
||||
formulaDependsOn: ['country'],
|
||||
formula: (doc) => {
|
||||
@ -103,7 +103,7 @@ export default {
|
||||
fieldname: 'currency',
|
||||
label: t`Currency`,
|
||||
fieldtype: 'Data',
|
||||
placeholder: 'Currency',
|
||||
placeholder: t`Currency`,
|
||||
formulaDependsOn: ['country'],
|
||||
formula: (doc) => {
|
||||
if (!doc.country) return;
|
||||
|
@ -19,7 +19,7 @@ export default {
|
||||
label: t`Rate`,
|
||||
fieldtype: 'Float',
|
||||
required: 1,
|
||||
placeholder: '0%',
|
||||
placeholder: t`0%`,
|
||||
},
|
||||
],
|
||||
tableFields: ['account', 'rate'],
|
||||
|
@ -5,6 +5,12 @@ import utils from '../../../accounting/utils';
|
||||
import { statusColor } from '../../../src/colors';
|
||||
|
||||
export function getStatusColumn() {
|
||||
const statusMap = {
|
||||
Unpaid: t`Unpaid`,
|
||||
Paid: t`Paid`,
|
||||
Draft: t`Draft`,
|
||||
Cancelled: t`Cancelled`,
|
||||
};
|
||||
return {
|
||||
label: t`Status`,
|
||||
fieldname: 'status',
|
||||
@ -12,8 +18,9 @@ export function getStatusColumn() {
|
||||
render(doc) {
|
||||
const status = getInvoiceStatus(doc);
|
||||
const color = statusColor[status];
|
||||
const label = statusMap[status];
|
||||
return {
|
||||
template: `<Badge class="text-xs" color="${color}">${status}</Badge>`,
|
||||
template: `<Badge class="text-xs" color="${color}">${label}</Badge>`,
|
||||
components: { Badge },
|
||||
};
|
||||
},
|
||||
|
@ -1,15 +1,21 @@
|
||||
import frappe, { t } from 'frappe';
|
||||
import getCommonExportActions from '../commonExporter';
|
||||
|
||||
const periodicityMap = {
|
||||
Monthly: t`Monthly`,
|
||||
Quarterly: t`Quarterly`,
|
||||
'Half Yearly': t`Half Yearly`,
|
||||
Yearly: t`Yearly`,
|
||||
};
|
||||
export default {
|
||||
title: 'Balance Sheet',
|
||||
title: t`Balance Sheet`,
|
||||
method: 'balance-sheet',
|
||||
filterFields: [
|
||||
{
|
||||
fieldtype: 'Date',
|
||||
fieldname: 'toDate',
|
||||
size: 'small',
|
||||
placeholder: 'ToDate',
|
||||
placeholder: t`To Date`,
|
||||
label: t`To Date`,
|
||||
required: 1,
|
||||
default: async () => {
|
||||
@ -18,9 +24,10 @@ export default {
|
||||
},
|
||||
{
|
||||
fieldtype: 'Select',
|
||||
placeholder: 'Select Period',
|
||||
placeholder: t`Select Period`,
|
||||
size: 'small',
|
||||
options: ['Monthly', 'Quarterly', 'Half Yearly', 'Yearly'],
|
||||
options: Object.keys(periodicityMap),
|
||||
map: periodicityMap,
|
||||
label: t`Periodicity`,
|
||||
fieldname: 'periodicity',
|
||||
default: 'Monthly',
|
||||
|
@ -11,7 +11,7 @@ export default {
|
||||
fieldtype: 'Link',
|
||||
target: 'Account',
|
||||
size: 'small',
|
||||
placeholder: 'Payment Account',
|
||||
placeholder: t`Payment Account`,
|
||||
label: t`Payment Account`,
|
||||
fieldname: 'paymentAccount',
|
||||
getFilters: () => {
|
||||
@ -26,20 +26,20 @@ export default {
|
||||
target: 'Party',
|
||||
size: 'small',
|
||||
label: t`Party`,
|
||||
placeholder: 'Party',
|
||||
placeholder: t`Party`,
|
||||
fieldname: 'party',
|
||||
},
|
||||
{
|
||||
fieldtype: 'Date',
|
||||
size: 'small',
|
||||
placeholder: 'From Date',
|
||||
placeholder: t`From Date`,
|
||||
label: t`From Date`,
|
||||
fieldname: 'fromDate',
|
||||
},
|
||||
{
|
||||
fieldtype: 'Date',
|
||||
size: 'small',
|
||||
placeholder: 'To Date',
|
||||
placeholder: t`To Date`,
|
||||
label: t`To Date`,
|
||||
fieldname: 'toDate',
|
||||
},
|
||||
|
@ -2,7 +2,7 @@ import { partyWithAvatar } from '@/utils';
|
||||
import { t } from 'frappe';
|
||||
import getCommonExportActions from '../commonExporter';
|
||||
|
||||
let title = 'General Ledger';
|
||||
let title = t`General Ledger`;
|
||||
|
||||
const viewConfig = {
|
||||
title,
|
||||
@ -19,13 +19,13 @@ const viewConfig = {
|
||||
size: 'small',
|
||||
label: t`Reference Type`,
|
||||
fieldname: 'referenceType',
|
||||
placeholder: 'Reference Type',
|
||||
placeholder: t`Reference Type`,
|
||||
default: 'All',
|
||||
},
|
||||
{
|
||||
fieldtype: 'DynamicLink',
|
||||
size: 'small',
|
||||
placeholder: 'Reference Name',
|
||||
placeholder: t`Reference Name`,
|
||||
references: 'referenceType',
|
||||
label: t`Reference Name`,
|
||||
fieldname: 'referenceName',
|
||||
@ -34,7 +34,7 @@ const viewConfig = {
|
||||
fieldtype: 'Link',
|
||||
target: 'Account',
|
||||
size: 'small',
|
||||
placeholder: 'Account',
|
||||
placeholder: t`Account`,
|
||||
label: t`Account`,
|
||||
fieldname: 'account',
|
||||
},
|
||||
@ -43,20 +43,20 @@ const viewConfig = {
|
||||
target: 'Party',
|
||||
label: t`Party`,
|
||||
size: 'small',
|
||||
placeholder: 'Party',
|
||||
placeholder: t`Party`,
|
||||
fieldname: 'party',
|
||||
},
|
||||
{
|
||||
fieldtype: 'Date',
|
||||
size: 'small',
|
||||
placeholder: 'From Date',
|
||||
placeholder: t`From Date`,
|
||||
label: t`From Date`,
|
||||
fieldname: 'fromDate',
|
||||
},
|
||||
{
|
||||
fieldtype: 'Date',
|
||||
size: 'small',
|
||||
placeholder: 'To Date',
|
||||
placeholder: t`To Date`,
|
||||
label: t`To Date`,
|
||||
fieldname: 'toDate',
|
||||
},
|
||||
|
@ -11,7 +11,7 @@ export default {
|
||||
fieldtype: 'AutoComplete',
|
||||
label: t`Place`,
|
||||
size: 'small',
|
||||
placeholder: 'Place',
|
||||
placeholder: t`Place`,
|
||||
fieldname: 'place',
|
||||
getList: () => stateList,
|
||||
},
|
||||
@ -19,7 +19,7 @@ export default {
|
||||
fieldtype: 'Date',
|
||||
label: t`From Date`,
|
||||
size: 'small',
|
||||
placeholder: 'From Date',
|
||||
placeholder: t`From Date`,
|
||||
fieldname: 'fromDate',
|
||||
default: () => DateTime.local().minus({ months: 3 }).toISODate(),
|
||||
},
|
||||
@ -27,7 +27,7 @@ export default {
|
||||
fieldtype: 'Date',
|
||||
label: t`To Date`,
|
||||
size: 'small',
|
||||
placeholder: 'To Date',
|
||||
placeholder: t`To Date`,
|
||||
fieldname: 'toDate',
|
||||
default: () => DateTime.local().toISODate(),
|
||||
},
|
||||
|
@ -13,7 +13,7 @@ const transferTypeMap = {
|
||||
const transferType = {
|
||||
fieldtype: 'Select',
|
||||
label: t`Transfer Type`,
|
||||
placeholder: 'Transfer Type',
|
||||
placeholder: t`Transfer Type`,
|
||||
fieldname: 'transferType',
|
||||
options: Object.keys(transferTypeMap),
|
||||
map: transferTypeMap,
|
||||
@ -23,7 +23,7 @@ const transferType = {
|
||||
|
||||
const actions = [
|
||||
{
|
||||
group: 'Export',
|
||||
group: t`Export`,
|
||||
label: t`JSON`,
|
||||
type: 'primary',
|
||||
action: async (report, filters) => {
|
||||
@ -31,7 +31,7 @@ const actions = [
|
||||
},
|
||||
},
|
||||
{
|
||||
group: 'Export',
|
||||
group: t`Export`,
|
||||
label: t`CSV`,
|
||||
type: 'primary',
|
||||
action: async (report, filters) => {
|
||||
|
@ -10,7 +10,7 @@ const transferTypeMap = {
|
||||
const transferType = {
|
||||
fieldtype: 'Select',
|
||||
label: t`Transfer Type`,
|
||||
placeholder: 'Transfer Type',
|
||||
placeholder: t`Transfer Type`,
|
||||
fieldname: 'transferType',
|
||||
options: Object.keys(transferTypeMap),
|
||||
map: transferTypeMap,
|
||||
@ -20,7 +20,7 @@ const transferType = {
|
||||
|
||||
const actions = [
|
||||
{
|
||||
group: 'Export',
|
||||
group: t`Export`,
|
||||
label: t`CSV`,
|
||||
type: 'primary',
|
||||
action: async (report, filters) => {
|
||||
|
@ -1,8 +1,14 @@
|
||||
import frappe, { t } from 'frappe';
|
||||
import getCommonExportActions from '../commonExporter';
|
||||
|
||||
const title = 'Profit and Loss';
|
||||
const title = t`Profit and Loss`;
|
||||
|
||||
const periodicityMap = {
|
||||
Monthly: t`Monthly`,
|
||||
Quarterly: t`Quarterly`,
|
||||
'Half Yearly': t`Half Yearly`,
|
||||
Yearly: t`Yearly`,
|
||||
};
|
||||
export default {
|
||||
title: title,
|
||||
method: 'profit-and-loss',
|
||||
@ -12,7 +18,7 @@ export default {
|
||||
fieldtype: 'Date',
|
||||
fieldname: 'fromDate',
|
||||
size: 'small',
|
||||
placeholder: 'From Date',
|
||||
placeholder: t`From Date`,
|
||||
label: t`From Date`,
|
||||
required: 1,
|
||||
default: async () => {
|
||||
@ -23,7 +29,7 @@ export default {
|
||||
fieldtype: 'Date',
|
||||
fieldname: 'toDate',
|
||||
size: 'small',
|
||||
placeholder: 'To Date',
|
||||
placeholder: t`To Date`,
|
||||
label: t`To Date`,
|
||||
required: 1,
|
||||
default: async () => {
|
||||
@ -33,10 +39,11 @@ export default {
|
||||
{
|
||||
fieldtype: 'Select',
|
||||
size: 'small',
|
||||
options: ['Monthly', 'Quarterly', 'Half Yearly', 'Yearly'],
|
||||
options: Object.keys(periodicityMap),
|
||||
map: periodicityMap,
|
||||
default: 'Monthly',
|
||||
label: t`Periodicity`,
|
||||
placeholder: 'Select Period...',
|
||||
placeholder: t`Select Period...`,
|
||||
fieldname: 'periodicity',
|
||||
},
|
||||
],
|
||||
|
@ -11,7 +11,7 @@ export default {
|
||||
label: t`Supplier Name`,
|
||||
fieldname: 'supplier',
|
||||
size: 'small',
|
||||
placeholder: 'Supplier Name',
|
||||
placeholder: t`Supplier Name`,
|
||||
getFilters: (query) => {
|
||||
if (query)
|
||||
return {
|
||||
@ -28,14 +28,14 @@ export default {
|
||||
fieldtype: 'Date',
|
||||
fieldname: 'fromDate',
|
||||
size: 'small',
|
||||
placeholder: 'From Date',
|
||||
placeholder: t`From Date`,
|
||||
label: t`From Date`,
|
||||
required: 1,
|
||||
},
|
||||
{
|
||||
fieldtype: 'Date',
|
||||
size: 'small',
|
||||
placeholder: 'To Date',
|
||||
placeholder: t`To Date`,
|
||||
fieldname: 'toDate',
|
||||
label: t`To Date`,
|
||||
required: 1,
|
||||
|
@ -10,7 +10,7 @@ export default {
|
||||
target: 'Party',
|
||||
label: t`Customer Name`,
|
||||
size: 'small',
|
||||
placeholder: 'Customer Name',
|
||||
placeholder: t`Customer Name`,
|
||||
fieldname: 'customer',
|
||||
getFilters: (query) => {
|
||||
if (query)
|
||||
@ -28,14 +28,14 @@ export default {
|
||||
fieldtype: 'Date',
|
||||
fieldname: 'fromDate',
|
||||
size: 'small',
|
||||
placeholder: 'From Date',
|
||||
placeholder: t`From Date`,
|
||||
label: t`From Date`,
|
||||
required: 1,
|
||||
},
|
||||
{
|
||||
fieldtype: 'Date',
|
||||
size: 'small',
|
||||
placeholder: 'To Date',
|
||||
placeholder: t`To Date`,
|
||||
fieldname: 'toDate',
|
||||
label: t`To Date`,
|
||||
required: 1,
|
||||
|
@ -1,7 +1,7 @@
|
||||
import frappe, { t } from 'frappe';
|
||||
import getCommonExportActions from '../commonExporter';
|
||||
|
||||
const title = 'Trial Balance';
|
||||
const title = t`Trial Balance`;
|
||||
|
||||
export default {
|
||||
title: title,
|
||||
@ -13,7 +13,7 @@ export default {
|
||||
fieldname: 'fromDate',
|
||||
label: t`From Date`,
|
||||
size: 'small',
|
||||
placeholder: 'From Date',
|
||||
placeholder: t`From Date`,
|
||||
required: 1,
|
||||
default: async () => {
|
||||
return (await frappe.getSingle('AccountingSettings')).fiscalYearStart;
|
||||
@ -22,7 +22,7 @@ export default {
|
||||
{
|
||||
fieldtype: 'Date',
|
||||
size: 'small',
|
||||
placeholder: 'To Date',
|
||||
placeholder: t`To Date`,
|
||||
fieldname: 'toDate',
|
||||
label: t`To Date`,
|
||||
required: 1,
|
||||
|
@ -95,7 +95,7 @@ async function exportReport(extention, reportName, getReportData) {
|
||||
|
||||
export default function getCommonExportActions(reportName) {
|
||||
return ['csv', 'json'].map((ext) => ({
|
||||
group: 'Export',
|
||||
group: frappe.t`Export`,
|
||||
label: ext.toUpperCase(),
|
||||
type: 'primary',
|
||||
action: async (getReportData) =>
|
||||
|
@ -31,7 +31,7 @@
|
||||
size="small"
|
||||
input-class="bg-gray-100"
|
||||
:df="{
|
||||
placeholder: 'Field',
|
||||
placeholder: t`Field`,
|
||||
fieldname: 'fieldname',
|
||||
fieldtype: 'Select',
|
||||
options: fieldOptions,
|
||||
@ -45,7 +45,7 @@
|
||||
size="small"
|
||||
input-class="bg-gray-100"
|
||||
:df="{
|
||||
placeholder: 'Condition',
|
||||
placeholder: t`Condition`,
|
||||
fieldname: 'condition',
|
||||
fieldtype: 'Select',
|
||||
options: conditions,
|
||||
@ -59,7 +59,7 @@
|
||||
size="small"
|
||||
input-class="bg-gray-100"
|
||||
:df="{
|
||||
placeholder: 'Value',
|
||||
placeholder: t`Value`,
|
||||
fieldname: 'value',
|
||||
fieldtype: 'Data',
|
||||
}"
|
||||
@ -116,11 +116,11 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import Popover from './Popover';
|
||||
import Button from './Button';
|
||||
import Icon from './Icon';
|
||||
import FormControl from './Controls/FormControl';
|
||||
import { t } from 'frappe';
|
||||
import Button from './Button';
|
||||
import FormControl from './Controls/FormControl';
|
||||
import Icon from './Icon';
|
||||
import Popover from './Popover';
|
||||
|
||||
let conditions = [
|
||||
{ label: t`Is`, value: '=' },
|
||||
|
@ -18,7 +18,7 @@
|
||||
<input
|
||||
type="search"
|
||||
class="bg-gray-200 text-sm pl-8 focus:outline-none h-full w-56"
|
||||
placeholder="Search..."
|
||||
:placeholder="t`Search...`"
|
||||
autocomplete="off"
|
||||
spellcheck="false"
|
||||
v-model="inputValue"
|
||||
@ -41,11 +41,10 @@
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import frappe from 'frappe';
|
||||
import reports from '../../reports/view';
|
||||
import Dropdown from '@/components/Dropdown';
|
||||
import { routeTo } from '@/utils';
|
||||
import { t } from 'frappe';
|
||||
import frappe, { t } from 'frappe';
|
||||
import reports from '../../reports/view';
|
||||
|
||||
export default {
|
||||
data() {
|
||||
|
@ -89,21 +89,21 @@
|
||||
class="pb-1 text-sm text-gray-600 hover:text-gray-800 w-full text-left"
|
||||
@click="() => reportIssue()"
|
||||
>
|
||||
Report Issue
|
||||
{{ t`Report Issue` }}
|
||||
</button>
|
||||
<p class="pb-3 text-sm text-gray-600">v{{ appVersion }}</p>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import { reportIssue } from '@/errorHandling';
|
||||
import sidebarConfig from '../sidebarConfig';
|
||||
import Button from '@/components/Button';
|
||||
import WindowControls from './WindowControls';
|
||||
import { reportIssue } from '@/errorHandling';
|
||||
import { routeTo } from '@/utils';
|
||||
import path from 'path';
|
||||
import router from '../router';
|
||||
import sidebarConfig from '../sidebarConfig';
|
||||
import Icon from './Icon.vue';
|
||||
import WindowControls from './WindowControls';
|
||||
|
||||
export default {
|
||||
components: [Button],
|
||||
|
@ -49,11 +49,8 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import config, {
|
||||
ConfigKeys,
|
||||
telemetryOptions,
|
||||
TelemetrySetting
|
||||
} from '@/config';
|
||||
import config, { ConfigKeys, TelemetrySetting } from '@/config';
|
||||
import { getTelemetryOptions } from '@/telemetry/helpers';
|
||||
import telemetry from '@/telemetry/telemetry';
|
||||
import { NounEnum, Verb } from '@/telemetry/types';
|
||||
import Button from '../Button.vue';
|
||||
@ -72,6 +69,7 @@ export default {
|
||||
},
|
||||
computed: {
|
||||
df() {
|
||||
const telemetryOptions = getTelemetryOptions();
|
||||
return {
|
||||
fieldname: 'anonymizedTelemetry',
|
||||
label: this.t`Anonymized Telemetry`,
|
||||
@ -106,7 +104,7 @@ export default {
|
||||
if (this.value === TelemetrySetting.dontLogUsage) {
|
||||
telemetry.finalLogAndStop();
|
||||
} else {
|
||||
telemetry.log(Verb.Started, NounEnum.Telemetry)
|
||||
telemetry.log(Verb.Started, NounEnum.Telemetry);
|
||||
}
|
||||
|
||||
config.set(ConfigKeys.Telemetry, this.value);
|
||||
|
@ -19,12 +19,6 @@ export enum TelemetrySetting {
|
||||
dontLogAnything = 'dontLogAnything',
|
||||
}
|
||||
|
||||
export const telemetryOptions = {
|
||||
[TelemetrySetting.allow]: frappe.t`Allow Telemetry`,
|
||||
[TelemetrySetting.dontLogUsage]: frappe.t`Don't Log Usage`,
|
||||
[TelemetrySetting.dontLogAnything]: frappe.t`Don't Log Anything`,
|
||||
};
|
||||
|
||||
export interface ConfigFile {
|
||||
id: string;
|
||||
companyName: string;
|
||||
|
@ -1,3 +1,11 @@
|
||||
<script setup>
|
||||
const periodSelectorMap = {
|
||||
'This Year': t`This Year`,
|
||||
'This Quarter': t`This Quarter`,
|
||||
'This Month': t`This Month`,
|
||||
};
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<Dropdown ref="dropdown" class="text-sm" :items="periodOptions" right>
|
||||
<template
|
||||
@ -28,7 +36,7 @@
|
||||
@keydown.up="highlightItemUp"
|
||||
@keydown.enter="selectHighlightedItem"
|
||||
>
|
||||
{{ value }}
|
||||
{{ periodSelectorMap[value] }}
|
||||
<feather-icon name="chevron-down" class="ml-1 w-3 h-3" />
|
||||
</div>
|
||||
</template>
|
||||
@ -37,6 +45,8 @@
|
||||
|
||||
<script>
|
||||
import Dropdown from '@/components/Dropdown';
|
||||
import { t } from 'frappe';
|
||||
|
||||
export default {
|
||||
name: 'PeriodSelector',
|
||||
props: {
|
||||
@ -54,7 +64,7 @@ export default {
|
||||
return {
|
||||
periodOptions: this.options.map((option) => {
|
||||
return {
|
||||
label: option,
|
||||
label: this.periodSelectorMap[option],
|
||||
action: () => this.selectOption(option),
|
||||
};
|
||||
}),
|
||||
|
@ -68,13 +68,12 @@
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import frappe from 'frappe';
|
||||
import Button from '@/components/Button';
|
||||
import { routeTo } from '@/utils';
|
||||
import frappe, { t } from 'frappe';
|
||||
import { getDatesAndPeriodicity } from './getDatesAndPeriodicity';
|
||||
import PeriodSelector from './PeriodSelector';
|
||||
import SectionHeader from './SectionHeader';
|
||||
import { getDatesAndPeriodicity } from './getDatesAndPeriodicity';
|
||||
import { routeTo } from '@/utils';
|
||||
|
||||
export default {
|
||||
name: 'UnpaidInvoices',
|
||||
components: {
|
||||
@ -85,7 +84,7 @@ export default {
|
||||
data: () => ({
|
||||
invoices: [
|
||||
{
|
||||
title: 'Invoices',
|
||||
title: t`Invoices`,
|
||||
doctype: 'SalesInvoice',
|
||||
total: 0,
|
||||
unpaid: 0,
|
||||
@ -96,7 +95,7 @@ export default {
|
||||
barWidth: 40,
|
||||
},
|
||||
{
|
||||
title: 'Bills',
|
||||
title: t`Bills`,
|
||||
doctype: 'PurchaseInvoice',
|
||||
total: 0,
|
||||
unpaid: 0,
|
||||
|
@ -449,7 +449,7 @@ export default {
|
||||
fieldname: 'importType',
|
||||
label: this.t`Import Type`,
|
||||
fieldtype: 'AutoComplete',
|
||||
placeholder: 'Import Type',
|
||||
placeholder: this.t`Import Type`,
|
||||
getList: () => importable.map((i) => frappe.models[i].label),
|
||||
};
|
||||
},
|
||||
|
@ -101,7 +101,7 @@
|
||||
class="text-brand text-sm mt-4 inline-block cursor-pointer"
|
||||
@click="showFiles = true"
|
||||
>
|
||||
Select from existing files
|
||||
{{ t`Select from existing files` }}
|
||||
</a>
|
||||
</div>
|
||||
|
||||
@ -144,7 +144,7 @@
|
||||
class="text-brand text-sm cursor-pointer"
|
||||
@click="showFiles = false"
|
||||
>
|
||||
Select file manually
|
||||
{{ t`Select file manually` }}
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
@ -158,15 +158,14 @@
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import fs from 'fs';
|
||||
import config from '@/config';
|
||||
import { DateTime } from 'luxon';
|
||||
import { ipcRenderer } from 'electron';
|
||||
import { DB_CONN_FAILURE, IPC_ACTIONS } from '../messages';
|
||||
|
||||
import { createNewDatabase, connectToLocalDatabase } from '@/initialization';
|
||||
import { showErrorDialog } from '../errorHandling';
|
||||
import LanguageSelector from '@/components/Controls/LanguageSelector.vue';
|
||||
import config from '@/config';
|
||||
import { connectToLocalDatabase, createNewDatabase } from '@/initialization';
|
||||
import { ipcRenderer } from 'electron';
|
||||
import fs from 'fs';
|
||||
import { DateTime } from 'luxon';
|
||||
import { showErrorDialog } from '../errorHandling';
|
||||
import { DB_CONN_FAILURE, IPC_ACTIONS } from '../messages';
|
||||
|
||||
export default {
|
||||
name: 'DatabaseSelector',
|
||||
|
@ -84,15 +84,13 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import frappe from 'frappe';
|
||||
import { t } from 'frappe';
|
||||
import PageHeader from '@/components/PageHeader';
|
||||
import Icon from '@/components/Icon';
|
||||
import Button from '@/components/Button';
|
||||
import { openSettings } from '@/utils';
|
||||
import { ipcRenderer } from 'electron';
|
||||
import Icon from '@/components/Icon';
|
||||
import PageHeader from '@/components/PageHeader';
|
||||
import { IPC_MESSAGES } from '@/messages';
|
||||
import { routeTo } from '@/utils';
|
||||
import { openSettings, routeTo } from '@/utils';
|
||||
import { ipcRenderer } from 'electron';
|
||||
import frappe, { t } from 'frappe';
|
||||
import { h } from 'vue';
|
||||
|
||||
export default {
|
||||
@ -115,7 +113,7 @@ export default {
|
||||
label: t`Invoice`,
|
||||
icon: 'invoice',
|
||||
description:
|
||||
'Customize your invoices by adding a logo and address details',
|
||||
t`Customize your invoices by adding a logo and address details`,
|
||||
fieldname: 'invoiceSetup',
|
||||
action() {
|
||||
openSettings('Invoice');
|
||||
@ -126,7 +124,7 @@ export default {
|
||||
label: t`General`,
|
||||
icon: 'general',
|
||||
description:
|
||||
'Setup your company information, email, country and fiscal year',
|
||||
t`Setup your company information, email, country and fiscal year`,
|
||||
fieldname: 'companySetup',
|
||||
action() {
|
||||
openSettings('General');
|
||||
@ -137,7 +135,7 @@ export default {
|
||||
label: t`System`,
|
||||
icon: 'system',
|
||||
description:
|
||||
'Setup system defaults like date format and display precision',
|
||||
t`Setup system defaults like date format and display precision`,
|
||||
fieldname: 'systemSetup',
|
||||
action() {
|
||||
openSettings('System');
|
||||
@ -154,7 +152,7 @@ export default {
|
||||
label: t`Review Accounts`,
|
||||
icon: 'review-ac',
|
||||
description:
|
||||
'Review your chart of accounts, add any account or tax heads as needed',
|
||||
t`Review your chart of accounts, add any account or tax heads as needed`,
|
||||
action: () => {
|
||||
routeTo('/chart-of-accounts');
|
||||
},
|
||||
@ -168,7 +166,7 @@ export default {
|
||||
icon: 'opening-ac',
|
||||
fieldname: 'openingBalanceChecked',
|
||||
description:
|
||||
'Setup your opening balances before performing any accounting entries',
|
||||
t`Setup your opening balances before performing any accounting entries`,
|
||||
documentation:
|
||||
'https://frappebooks.com/docs/setting-up#5-setup-opening-balances',
|
||||
},
|
||||
@ -178,7 +176,7 @@ export default {
|
||||
icon: 'percentage',
|
||||
fieldname: 'taxesAdded',
|
||||
description:
|
||||
'Setup your tax templates for your sales or purchase transactions',
|
||||
t`Setup your tax templates for your sales or purchase transactions`,
|
||||
action: () => routeTo('/list/Tax'),
|
||||
documentation:
|
||||
'https://frappebooks.com/docs/setting-up#2-add-taxes',
|
||||
@ -194,7 +192,7 @@ export default {
|
||||
label: t`Add Items`,
|
||||
icon: 'item',
|
||||
description:
|
||||
'Add products or services that you sell to your customers',
|
||||
t`Add products or services that you sell to your customers`,
|
||||
action: () => routeTo('/list/Item'),
|
||||
fieldname: 'itemCreated',
|
||||
documentation:
|
||||
@ -204,7 +202,7 @@ export default {
|
||||
key: 'Add Customers',
|
||||
label: t`Add Customers`,
|
||||
icon: 'customer',
|
||||
description: 'Add a few customers to create your first invoice',
|
||||
description: t`Add a few customers to create your first invoice`,
|
||||
action: () => routeTo('/list/Customer'),
|
||||
fieldname: 'customerCreated',
|
||||
documentation:
|
||||
@ -215,7 +213,7 @@ export default {
|
||||
label: t`Create Invoice`,
|
||||
icon: 'sales-invoice',
|
||||
description:
|
||||
'Create your first invoice and mail it to your customer',
|
||||
t`Create your first invoice and mail it to your customer`,
|
||||
action: () => routeTo('/list/SalesInvoice'),
|
||||
fieldname: 'invoiceCreated',
|
||||
documentation: 'https://frappebooks.com/docs/invoices',
|
||||
@ -231,7 +229,7 @@ export default {
|
||||
label: t`Add Items`,
|
||||
icon: 'item',
|
||||
description:
|
||||
'Add products or services that you buy from your suppliers',
|
||||
t`Add products or services that you buy from your suppliers`,
|
||||
action: () => routeTo('/list/Item'),
|
||||
fieldname: 'itemCreated',
|
||||
},
|
||||
@ -239,7 +237,7 @@ export default {
|
||||
key: 'Add Suppliers',
|
||||
label: t`Add Suppliers`,
|
||||
icon: 'supplier',
|
||||
description: 'Add a few suppliers to create your first bill',
|
||||
description: t`Add a few suppliers to create your first bill`,
|
||||
action: () => routeTo('/list/Supplier'),
|
||||
fieldname: 'supplierCreated',
|
||||
},
|
||||
@ -248,7 +246,7 @@ export default {
|
||||
label: t`Create Bill`,
|
||||
icon: 'purchase-invoice',
|
||||
description:
|
||||
'Create your first bill and mail it to your supplier',
|
||||
t`Create your first bill and mail it to your supplier`,
|
||||
action: () => routeTo('/list/PurchaseInvoice'),
|
||||
fieldname: 'billCreated',
|
||||
documentation: 'https://frappebooks.com/docs/bills',
|
||||
|
@ -48,20 +48,20 @@
|
||||
</div>
|
||||
<div v-else class="flex flex-col items-center justify-center my-auto">
|
||||
<img src="@/assets/img/list-empty-state.svg" alt="" class="w-24" />
|
||||
<p class="my-3 text-gray-800">No {{ meta.label || meta.name }} found</p>
|
||||
<p class="my-3 text-gray-800">{{ t`No entries found` }}</p>
|
||||
<Button type="primary" class="text-white" @click="$emit('makeNewDoc')">
|
||||
Create a new {{ meta.label || meta.name }}
|
||||
{{ t`Make Entry` }}
|
||||
</Button>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import frappe from 'frappe';
|
||||
import Row from '@/components/Row';
|
||||
import ListCell from './ListCell';
|
||||
import Avatar from '@/components/Avatar';
|
||||
import { openQuickEdit, routeTo } from '@/utils';
|
||||
import Button from '@/components/Button';
|
||||
import Row from '@/components/Row';
|
||||
import { openQuickEdit, routeTo } from '@/utils';
|
||||
import frappe from 'frappe';
|
||||
import ListCell from './ListCell';
|
||||
|
||||
export default {
|
||||
name: 'List',
|
||||
|
@ -37,7 +37,6 @@ import SearchBar from '@/components/SearchBar';
|
||||
import { routeTo } from '@/utils';
|
||||
import frappe from 'frappe';
|
||||
import List from './List';
|
||||
import listConfigs from './listConfig';
|
||||
|
||||
export default {
|
||||
name: 'ListView',
|
||||
@ -49,10 +48,17 @@ export default {
|
||||
SearchBar,
|
||||
FilterDropdown,
|
||||
},
|
||||
activated() {
|
||||
data() {
|
||||
return { listConfigs: undefined };
|
||||
},
|
||||
async activated() {
|
||||
if (typeof this.filters === 'object') {
|
||||
this.$refs.filterDropdown.setFilter(this.filters);
|
||||
}
|
||||
|
||||
if (this.listConfigs === undefined) {
|
||||
this.listConfigs = (await import('./listConfig')).default;
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
async makeNewDoc() {
|
||||
@ -102,8 +108,8 @@ export default {
|
||||
return frappe.getMeta(this.doctype);
|
||||
},
|
||||
listConfig() {
|
||||
if (listConfigs[this.doctype]) {
|
||||
return listConfigs[this.doctype];
|
||||
if (this?.listConfigs?.[this?.doctype]) {
|
||||
return this.listConfigs[this.doctype];
|
||||
} else {
|
||||
return {
|
||||
title: this.doctype,
|
||||
|
@ -31,7 +31,7 @@
|
||||
"
|
||||
@click="checkForUpdates(true)"
|
||||
>
|
||||
Check for Updates
|
||||
{{ t`Check for Updates` }}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
@ -43,9 +43,9 @@ import LanguageSelector from '@/components/Controls/LanguageSelector.vue';
|
||||
import TwoColumnForm from '@/components/TwoColumnForm';
|
||||
import config, {
|
||||
ConfigKeys,
|
||||
telemetryOptions,
|
||||
TelemetrySetting
|
||||
} from '@/config';
|
||||
import { getTelemetryOptions } from '@/telemetry/helpers';
|
||||
import telemetry from '@/telemetry/telemetry';
|
||||
import { checkForUpdates } from '@/utils';
|
||||
import frappe from 'frappe';
|
||||
@ -71,6 +71,7 @@ export default {
|
||||
},
|
||||
computed: {
|
||||
df() {
|
||||
const telemetryOptions = getTelemetryOptions();
|
||||
return {
|
||||
fieldname: 'anonymizedTelemetry',
|
||||
label: this.t`Anonymized Telemetry`,
|
||||
|
@ -1,6 +1,7 @@
|
||||
import config, { ConfigFile, ConfigKeys } from '@/config';
|
||||
import config, { ConfigFile, ConfigKeys, TelemetrySetting } from '@/config';
|
||||
import { IPC_ACTIONS } from '@/messages';
|
||||
import { ipcRenderer } from 'electron';
|
||||
import frappe, { t } from 'frappe';
|
||||
import { DoctypeName } from '../../models/types';
|
||||
import { Count, UniqueId } from './types';
|
||||
|
||||
@ -38,6 +39,10 @@ export async function getCounts(): Promise<Count> {
|
||||
];
|
||||
|
||||
const countMap: Count = {};
|
||||
// @ts-ignore
|
||||
if (frappe.db === undefined) {
|
||||
return countMap;
|
||||
}
|
||||
|
||||
type CountResponse = { 'count(*)': number }[];
|
||||
for (const name of interestingDocs) {
|
||||
@ -132,3 +137,9 @@ export async function getCreds() {
|
||||
const token: string = creds?.tokenString ?? '';
|
||||
return { url, token };
|
||||
}
|
||||
|
||||
export const getTelemetryOptions = () => ({
|
||||
[TelemetrySetting.allow]: t`Allow Telemetry`,
|
||||
[TelemetrySetting.dontLogUsage]: t`Don't Log Usage`,
|
||||
[TelemetrySetting.dontLogAnything]: t`Don't Log Anything`,
|
||||
});
|
||||
|
@ -309,7 +309,7 @@ export async function runWindowAction(name) {
|
||||
}
|
||||
|
||||
export function getInvoiceStatus(doc) {
|
||||
let status = 'Unpaid';
|
||||
let status = `Unpaid`;
|
||||
if (!doc.submitted) {
|
||||
status = 'Draft';
|
||||
}
|
||||
@ -526,6 +526,7 @@ async function fetchAndSetLanguageMap(code) {
|
||||
if (!success) {
|
||||
showToast({ type: 'error', message });
|
||||
} else {
|
||||
window.lm = languageMap;
|
||||
setLanguageMapOnTranslationString(languageMap);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user