2
0
mirror of https://github.com/frappe/books.git synced 2025-01-24 15:48:25 +00:00

fix(ux): rename Purchase Invoice to Bill & Sales Invoice to Invoice

This commit is contained in:
18alantom 2021-12-16 16:27:52 +05:30 committed by Alan
parent bc17e72cda
commit 95867541df
6 changed files with 41 additions and 38 deletions

View File

@ -5,7 +5,7 @@ import PurchaseInvoice from './PurchaseInvoiceDocument';
export default { export default {
name: 'PurchaseInvoice', name: 'PurchaseInvoice',
doctype: 'DocType', doctype: 'DocType',
label: 'Purchase Invoice', label: 'Bill',
documentClass: PurchaseInvoice, documentClass: PurchaseInvoice,
printTemplate: InvoiceTemplate, printTemplate: InvoiceTemplate,
isSingle: 0, isSingle: 0,
@ -20,33 +20,33 @@ export default {
fieldname: 'name', fieldname: 'name',
fieldtype: 'Data', fieldtype: 'Data',
required: 1, required: 1,
readOnly: 1 readOnly: 1,
}, },
{ {
fieldname: 'date', fieldname: 'date',
label: 'Date', label: '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: 'Supplier',
fieldtype: 'Link', fieldtype: 'Link',
target: 'Supplier', target: 'Supplier',
required: 1 required: 1,
}, },
{ {
fieldname: 'account', fieldname: 'account',
label: 'Account', label: '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'),
getFilters: () => { getFilters: () => {
return { return {
isGroup: 0, isGroup: 0,
accountType: 'Payable' accountType: 'Payable',
}; };
} },
}, },
{ {
fieldname: 'currency', fieldname: 'currency',
@ -54,83 +54,83 @@ export default {
fieldtype: 'Link', fieldtype: 'Link',
target: 'Currency', target: 'Currency',
hidden: 1, hidden: 1,
formula: doc => doc.getFrom('Party', doc.supplier, 'currency'), formula: (doc) => doc.getFrom('Party', doc.supplier, 'currency'),
formulaDependsOn: ['supplier'] formulaDependsOn: ['supplier'],
}, },
{ {
fieldname: 'exchangeRate', fieldname: 'exchangeRate',
label: 'Exchange Rate', label: 'Exchange Rate',
fieldtype: 'Float', fieldtype: 'Float',
formula: doc => doc.getExchangeRate(), formula: (doc) => doc.getExchangeRate(),
required: true required: true,
}, },
{ {
fieldname: 'items', fieldname: 'items',
label: 'Items', label: 'Items',
fieldtype: 'Table', fieldtype: 'Table',
childtype: 'PurchaseInvoiceItem', childtype: 'PurchaseInvoiceItem',
required: true required: true,
}, },
{ {
fieldname: 'netTotal', fieldname: 'netTotal',
label: 'Net Total', label: 'Net Total',
fieldtype: 'Currency', fieldtype: 'Currency',
formula: doc => doc.getSum('items', 'amount'), formula: (doc) => doc.getSum('items', 'amount'),
readOnly: 1, readOnly: 1,
getCurrency: doc => doc.currency getCurrency: (doc) => doc.currency,
}, },
{ {
fieldname: 'baseNetTotal', fieldname: 'baseNetTotal',
label: 'Net Total (Company Currency)', label: 'Net Total (Company Currency)',
fieldtype: 'Currency', fieldtype: 'Currency',
formula: doc => doc.netTotal * doc.exchangeRate, formula: (doc) => doc.netTotal * doc.exchangeRate,
readOnly: 1 readOnly: 1,
}, },
{ {
fieldname: 'taxes', fieldname: 'taxes',
label: 'Taxes', label: 'Taxes',
fieldtype: 'Table', fieldtype: 'Table',
childtype: 'TaxSummary', childtype: 'TaxSummary',
formula: doc => doc.getTaxSummary(), formula: (doc) => doc.getTaxSummary(),
readOnly: 1 readOnly: 1,
}, },
{ {
fieldname: 'grandTotal', fieldname: 'grandTotal',
label: 'Grand Total', label: 'Grand Total',
fieldtype: 'Currency', fieldtype: 'Currency',
formula: doc => doc.getGrandTotal(), formula: (doc) => doc.getGrandTotal(),
readOnly: 1, readOnly: 1,
getCurrency: doc => doc.currency getCurrency: (doc) => doc.currency,
}, },
{ {
fieldname: 'baseGrandTotal', fieldname: 'baseGrandTotal',
label: 'Grand Total (Company Currency)', label: 'Grand Total (Company Currency)',
fieldtype: 'Currency', fieldtype: 'Currency',
formula: doc => doc.grandTotal * doc.exchangeRate, formula: (doc) => doc.grandTotal * doc.exchangeRate,
readOnly: 1 readOnly: 1,
}, },
{ {
fieldname: 'outstandingAmount', fieldname: 'outstandingAmount',
label: 'Outstanding Amount', label: 'Outstanding Amount',
fieldtype: 'Currency', fieldtype: 'Currency',
formula: doc => { formula: (doc) => {
if (doc.submitted) return; if (doc.submitted) return;
return doc.baseGrandTotal; return doc.baseGrandTotal;
}, },
readOnly: 1 readOnly: 1,
}, },
{ {
fieldname: 'terms', fieldname: 'terms',
label: 'Terms', label: 'Terms',
fieldtype: 'Text' fieldtype: 'Text',
}, },
{ {
fieldname: 'cancelled', fieldname: 'cancelled',
label: 'Cancelled', label: 'Cancelled',
fieldtype: 'Check', fieldtype: 'Check',
default: 0 default: 0,
} },
], ],
actions: getActions('PurchaseInvoice') actions: getActions('PurchaseInvoice'),
}; };

View File

@ -1,6 +1,6 @@
export default { export default {
name: 'PurchaseInvoiceSettings', name: 'PurchaseInvoiceSettings',
label: 'Purchase Invoice Settings', label: 'Bills Settings',
doctype: 'DocType', doctype: 'DocType',
isSingle: 1, isSingle: 1,
isChild: 0, isChild: 0,
@ -12,7 +12,7 @@ export default {
fieldtype: 'Link', fieldtype: 'Link',
target: 'NumberSeries', target: 'NumberSeries',
required: 1, required: 1,
default: 'PINV' default: 'PINV',
} },
] ],
}; };

View File

@ -4,7 +4,7 @@ import SalesInvoice from './SalesInvoiceDocument';
export default { export default {
name: 'SalesInvoice', name: 'SalesInvoice',
label: 'Sales Invoice', label: 'Invoice',
doctype: 'DocType', doctype: 'DocType',
documentClass: SalesInvoice, documentClass: SalesInvoice,
printTemplate: InvoiceTemplate, printTemplate: InvoiceTemplate,

View File

@ -5,7 +5,8 @@ class GeneralLedger {
const filters = {}; const filters = {};
if (params.account) filters.account = params.account; if (params.account) filters.account = params.account;
if (params.party) filters.party = params.party; if (params.party) filters.party = params.party;
if (params.referenceType) filters.referenceType = params.referenceType; if (params.referenceType !== 'All')
filters.referenceType = params.referenceType;
if (params.referenceName) filters.referenceName = params.referenceName; if (params.referenceName) filters.referenceName = params.referenceName;
if (params.toDate || params.fromDate) { if (params.toDate || params.fromDate) {
filters.date = []; filters.date = [];

View File

@ -8,8 +8,9 @@ const viewConfig = {
{ {
fieldtype: 'Select', fieldtype: 'Select',
options: [ options: [
{ label: 'Sales Invoice', value: 'SalesInvoice' }, { label: 'All References', value: 'All' },
{ label: 'Purchase Invoice', value: 'PurchaseInvoice' }, { label: 'Invoices', value: 'SalesInvoice' },
{ label: 'Bills', value: 'PurchaseInvoice' },
{ label: 'Payment', value: 'Payment' }, { label: 'Payment', value: 'Payment' },
{ label: 'Journal Entry', value: 'JournalEntry' }, { label: 'Journal Entry', value: 'JournalEntry' },
], ],
@ -17,6 +18,7 @@ const viewConfig = {
label: 'Reference Type', label: 'Reference Type',
fieldname: 'referenceType', fieldname: 'referenceType',
placeholder: 'Reference Type', placeholder: 'Reference Type',
default: 'All',
}, },
{ {
fieldtype: 'DynamicLink', fieldtype: 'DynamicLink',

View File

@ -85,7 +85,7 @@ export default {
data: () => ({ data: () => ({
invoices: [ invoices: [
{ {
title: 'Sales Invoices', title: 'Invoices',
doctype: 'SalesInvoice', doctype: 'SalesInvoice',
total: 0, total: 0,
unpaid: 0, unpaid: 0,
@ -96,7 +96,7 @@ export default {
barWidth: 40 barWidth: 40
}, },
{ {
title: 'Purchase Invoices', title: 'Bills',
doctype: 'PurchaseInvoice', doctype: 'PurchaseInvoice',
total: 0, total: 0,
unpaid: 0, unpaid: 0,