mirror of
https://github.com/frappe/books.git
synced 2024-09-20 03:29:00 +00:00
Add viewConfig for PnL and TB
This commit is contained in:
parent
edd9f35756
commit
163a25529b
31
reports/ProfitAndLoss/viewConfig.js
Normal file
31
reports/ProfitAndLoss/viewConfig.js
Normal file
@ -0,0 +1,31 @@
|
|||||||
|
const title = 'Profit and Loss';
|
||||||
|
module.exports = {
|
||||||
|
title: title,
|
||||||
|
method: 'profit-and-loss',
|
||||||
|
filterFields: [
|
||||||
|
{ fieldtype: 'Date', fieldname: 'fromDate', label: 'From Date', required: 1 },
|
||||||
|
{ fieldtype: 'Date', fieldname: 'toDate', label: 'To Date', required: 1 },
|
||||||
|
{
|
||||||
|
fieldtype: 'Select', options: ['Monthly', 'Quarterly', 'Half Yearly', 'Yearly'],
|
||||||
|
label: 'Periodicity', fieldname: 'periodicity', default: 'Monthly'
|
||||||
|
}
|
||||||
|
],
|
||||||
|
getColumns(data) {
|
||||||
|
const columns = [
|
||||||
|
{ label: 'Account', fieldtype: 'Data', fieldname: 'account', width: 340 }
|
||||||
|
];
|
||||||
|
|
||||||
|
if (data && data.columns) {
|
||||||
|
const currencyColumns = data.columns;
|
||||||
|
const columnDefs = currencyColumns.map(name => ({
|
||||||
|
label: name,
|
||||||
|
fieldname: name,
|
||||||
|
fieldtype: 'Currency'
|
||||||
|
}));
|
||||||
|
|
||||||
|
columns.push(...columnDefs);
|
||||||
|
}
|
||||||
|
|
||||||
|
return columns;
|
||||||
|
}
|
||||||
|
};
|
22
reports/TrialBalance/viewConfig.js
Normal file
22
reports/TrialBalance/viewConfig.js
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
const title = 'Trial Balance';
|
||||||
|
module.exports = {
|
||||||
|
title: title,
|
||||||
|
method: 'trial-balance',
|
||||||
|
filterFields: [
|
||||||
|
{ fieldtype: 'Date', fieldname: 'fromDate', label: 'From Date', required: 1 },
|
||||||
|
{ fieldtype: 'Date', fieldname: 'toDate', label: 'To Date', required: 1 }
|
||||||
|
],
|
||||||
|
getColumns(data) {
|
||||||
|
const columns = [
|
||||||
|
{ label: 'Account', fieldtype: 'Data', fieldname: 'account', width: 340 },
|
||||||
|
{ label: 'Opening (Dr)', fieldtype: 'Currency', fieldname: 'openingDebit' },
|
||||||
|
{ label: 'Opening (Cr)', fieldtype: 'Currency', fieldname: 'openingCredit' },
|
||||||
|
{ label: 'Debit', fieldtype: 'Currency', fieldname: 'debit' },
|
||||||
|
{ label: 'Credit', fieldtype: 'Currency', fieldname: 'credit' },
|
||||||
|
{ label: 'Closing (Dr)', fieldtype: 'Currency', fieldname: 'closingDebit' },
|
||||||
|
{ label: 'Closing (Cr)', fieldtype: 'Currency', fieldname: 'closingCredit' }
|
||||||
|
];
|
||||||
|
|
||||||
|
return columns;
|
||||||
|
}
|
||||||
|
};
|
@ -1,4 +1,6 @@
|
|||||||
module.exports = {
|
module.exports = {
|
||||||
'general-ledger': require('./GeneralLedger/viewConfig'),
|
'general-ledger': require('./GeneralLedger/viewConfig'),
|
||||||
'sales-register': require('./SalesRegister/viewConfig')
|
'sales-register': require('./SalesRegister/viewConfig'),
|
||||||
|
'profit-and-loss': require('./ProfitAndLoss/viewConfig'),
|
||||||
|
'trial-balance': require('./TrialBalance/viewConfig')
|
||||||
}
|
}
|
||||||
|
@ -9,16 +9,22 @@
|
|||||||
description="List of all ledger entries booked against all accounts"
|
description="List of all ledger entries booked against all accounts"
|
||||||
@click="routeTo('general-ledger', { 'referenceType': 'Invoice' })"
|
@click="routeTo('general-ledger', { 'referenceType': 'Invoice' })"
|
||||||
/>
|
/>
|
||||||
|
<clickable-card
|
||||||
|
class="mt-2"
|
||||||
|
title="Profit and Loss"
|
||||||
|
description="Profit and Loss statement"
|
||||||
|
@click="routeTo('profit-and-loss')"
|
||||||
|
/>
|
||||||
<clickable-card
|
<clickable-card
|
||||||
class="mt-2"
|
class="mt-2"
|
||||||
title="Trial Balance"
|
title="Trial Balance"
|
||||||
description="Balance of accounts"
|
description="Trial Balance"
|
||||||
@click="routeTo('trial-balance')"
|
@click="routeTo('trial-balance')"
|
||||||
/>
|
/>
|
||||||
<clickable-card
|
<clickable-card
|
||||||
class="mt-2"
|
class="mt-2"
|
||||||
title="Sales Register"
|
title="Sales Register"
|
||||||
description="Sales"
|
description="Sales transactions for a given period with invoiced amount and tax details"
|
||||||
@click="routeTo('sales-register')"
|
@click="routeTo('sales-register')"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
Loading…
Reference in New Issue
Block a user